@nivaro/react 0.3.46 → 0.3.48

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 (57) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +248 -16
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/CollectionBrowserView.js +813 -826
  6. package/dist/shared/components/ErrorNotice.js +169 -0
  7. package/dist/shared/components/ErrorSurface.js +23 -17
  8. package/dist/shared/components/ListLoadError.js +8 -29
  9. package/dist/shared/components/LoadErrorNote.js +38 -21
  10. package/dist/shared/components/QueryErrorState.js +8 -11
  11. package/dist/shared/components/ReportView.js +1320 -1291
  12. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  13. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  14. package/dist/shared/components/chat/ChatPanel.js +368 -367
  15. package/dist/shared/components/command-center/PeekPanel.js +33 -32
  16. package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
  18. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  19. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  20. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  21. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  22. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  23. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  24. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  25. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  26. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  27. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  28. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  29. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  30. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  31. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  32. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  33. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  34. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  35. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  36. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  37. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  38. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  39. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  40. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  41. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  42. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  43. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  44. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  45. package/dist/shared/components/panels/SlaClock.js +35 -36
  46. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  47. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  48. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  49. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  50. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  51. package/dist/shared/components/support/SupportView.js +94 -87
  52. package/dist/shared/lib/autofill-poll.js +21 -18
  53. package/dist/shared/lib/error-actions.js +85 -0
  54. package/dist/shared/lib/error-message.js +223 -82
  55. package/dist/shared/lib/error-toast.js +71 -13
  56. package/dist/shared/lib/safe-error.js +136 -38
  57. package/package.json +1 -1
@@ -1,42 +1,43 @@
1
1
  import { jsxs as t, jsx as e, Fragment as _e } from "react/jsx-runtime";
2
- import { useSensors as Mt, useSensor as Ye, PointerSensor as Kt, KeyboardSensor as zt, DndContext as Qe, closestCenter as We } from "@dnd-kit/core";
3
- import { sortableKeyboardCoordinates as Bt, SortableContext as Ue, verticalListSortingStrategy as He, arrayMove as Ve, useSortable as ct } from "@dnd-kit/sortable";
2
+ import { useSensors as Kt, useSensor as Ye, PointerSensor as zt, KeyboardSensor as Bt, DndContext as Qe, closestCenter as We } from "@dnd-kit/core";
3
+ import { sortableKeyboardCoordinates as Qt, SortableContext as Ue, verticalListSortingStrategy as He, arrayMove as Ve, useSortable as ct } from "@dnd-kit/sortable";
4
4
  import { CSS as dt } from "@dnd-kit/utilities";
5
5
  import { useMutation as M, useQueryClient as ke, useQuery as H } from "@tanstack/react-query";
6
- import { X as ve, ArrowLeft as da, Check as Ne, Pencil as Te, Download as ma, Plus as ye, Trash2 as Se, ArrowRight as Qt, Zap as pa, PlugZap as ua, Filter as mt, Link2 as Ft, LayoutGrid as ha, Link2Off as xa, ListChecks as Wt, Loader2 as we, GripVertical as pt, Settings as fa, GitFork as ga, ChevronDown as Oe, Search as ut, History as ba, ChevronRight as ht, ExternalLink as ya } from "lucide-react";
7
- import { useState as $, useEffect as xe, useContext as va, useRef as Je, useMemo as Na, createContext as wa } from "react";
8
- import { createPortal as ka } from "react-dom";
9
- import { toast as P } from "sonner";
10
- import { useNivaroClient as Z, useNavigation as _a } from "../../context.js";
6
+ import { X as ve, ArrowLeft as ma, Check as Ne, Pencil as Te, Download as pa, Plus as ye, Trash2 as Se, ArrowRight as Wt, Zap as ua, PlugZap as ha, Filter as mt, Link2 as Ft, LayoutGrid as xa, Link2Off as fa, ListChecks as Ut, Loader2 as we, GripVertical as pt, Settings as ga, GitFork as ba, ChevronDown as Oe, Search as ut, History as ya, ChevronRight as ht, ExternalLink as va } from "lucide-react";
7
+ import { useState as $, useEffect as xe, useContext as Na, useRef as Je, useMemo as wa, createContext as ka } from "react";
8
+ import { createPortal as _a } from "react-dom";
9
+ import { toast as T } from "sonner";
10
+ import { useNivaroClient as Z, useNavigation as Ca } from "../../context.js";
11
11
  import { post as I, get as V, patch as be, del as $e } from "../../lib/commands.js";
12
- import { describeTransition as Ca, sentenceLabelsFromFields as Sa } from "../../lib/config-sentences.js";
13
- import { cn as J, formatRelative as qa, titleCase as $a } from "../../lib/utils.js";
14
- import { ExplainCard as Fa } from "../ai/ExplainButton.js";
15
- import { ConfigHistoryButton as Ea } from "../ConfigHistory.js";
16
- import { ConfigReadBack as Oa } from "../ConfigReadBack.js";
17
- import { PipelineCumulativeFlowCard as Ra } from "../charts/CumulativeFlowChart.js";
18
- import { useCollectionBody as Pa } from "../layout-editor/collection-meta.js";
19
- import { QueryErrorState as Ta } from "../QueryErrorState.js";
20
- import { Term as Et } from "../Term.js";
12
+ import { describeTransition as Sa, sentenceLabelsFromFields as qa } from "../../lib/config-sentences.js";
13
+ import { toastError as Et } from "../../lib/error-toast.js";
14
+ import { cn as J, formatRelative as $a, titleCase as Fa } from "../../lib/utils.js";
15
+ import { ExplainCard as Ea } from "../ai/ExplainButton.js";
16
+ import { ConfigHistoryButton as Oa } from "../ConfigHistory.js";
17
+ import { ConfigReadBack as Ra } from "../ConfigReadBack.js";
18
+ import { PipelineCumulativeFlowCard as Pa } from "../charts/CumulativeFlowChart.js";
19
+ import { useCollectionBody as Ta } from "../layout-editor/collection-meta.js";
20
+ import { QueryErrorState as Aa } from "../QueryErrorState.js";
21
+ import { Term as Ot } from "../Term.js";
21
22
  import { Badge as Ce } from "../ui/badge.js";
22
- import { Button as T } from "../ui/button.js";
23
+ import { Button as P } from "../ui/button.js";
23
24
  import { Input as U } from "../ui/input.js";
24
25
  import { Label as Y } from "../ui/label.js";
25
26
  import { Popover as De, PopoverTrigger as Le, PopoverContent as je } from "../ui/popover.js";
26
- import { Select as Aa, SelectTrigger as Da, SelectValue as La, SelectContent as ja, SelectItem as Ma } from "../ui/select.js";
27
+ import { Select as Da, SelectTrigger as La, SelectValue as ja, SelectContent as Ma, SelectItem as Ka } from "../ui/select.js";
27
28
  import { Skeleton as Ae } from "../ui/skeleton.js";
28
29
  import { Switch as Ee } from "../ui/switch.js";
29
- import { Textarea as Ut } from "../ui/textarea.js";
30
+ import { Textarea as Ht } from "../ui/textarea.js";
30
31
  import { FieldPicker as ot } from "./FieldPicker.js";
31
- import { OwnerMatrix as Ka } from "./OwnerMatrix.js";
32
- import { OwnerMatrixVersionsCard as za } from "./OwnerMatrixVersionsCard.js";
33
- import { TemplateLintCard as Ba, SkipReportCard as Qa } from "./PipelineHealthCards.js";
34
- import { PipelineSkipCriteria as Wa } from "./PipelineSkipCriteria.js";
35
- import { PipelineStateOwners as Ua } from "./PipelineStateOwners.js";
36
- import { findM2ORelation as Ha, extractTemplateFields as Va, renderDisplayTemplate as lt } from "./relations.js";
37
- import { TeamsView as Ya } from "./TeamsView.js";
38
- import { useScopeDimensions as Ga, rankTeamForFilters as Ia, tierOrder as Ot } from "./teamScopes.js";
39
- const Ht = "rgb(var(--nvr-cyan-rgb, 0 206 255))";
32
+ import { OwnerMatrix as za } from "./OwnerMatrix.js";
33
+ import { OwnerMatrixVersionsCard as Ba } from "./OwnerMatrixVersionsCard.js";
34
+ import { TemplateLintCard as Qa, SkipReportCard as Wa } from "./PipelineHealthCards.js";
35
+ import { PipelineSkipCriteria as Ua } from "./PipelineSkipCriteria.js";
36
+ import { PipelineStateOwners as Ha } from "./PipelineStateOwners.js";
37
+ import { findM2ORelation as Va, extractTemplateFields as Ya, renderDisplayTemplate as lt } from "./relations.js";
38
+ import { TeamsView as Ga } from "./TeamsView.js";
39
+ import { useScopeDimensions as Ia, rankTeamForFilters as Ja, tierOrder as Rt } from "./teamScopes.js";
40
+ const Vt = "rgb(var(--nvr-cyan-rgb, 0 206 255))";
40
41
  function pe({
41
42
  value: a,
42
43
  onChange: n,
@@ -133,7 +134,7 @@ function pe({
133
134
  ] })
134
135
  ] });
135
136
  }
136
- function Ja({
137
+ function Xa({
137
138
  values: a,
138
139
  onChange: n,
139
140
  options: c,
@@ -218,7 +219,7 @@ function Ja({
218
219
  ] })
219
220
  ] });
220
221
  }
221
- const Xa = [
222
+ const Za = [
222
223
  "#6b7280",
223
224
  "#ef4444",
224
225
  "#f97316",
@@ -246,7 +247,7 @@ function Ge({
246
247
  title: "No color"
247
248
  }
248
249
  ),
249
- Xa.map((c) => /* @__PURE__ */ e(
250
+ Za.map((c) => /* @__PURE__ */ e(
250
251
  "button",
251
252
  {
252
253
  type: "button",
@@ -262,7 +263,7 @@ function Ge({
262
263
  ))
263
264
  ] });
264
265
  }
265
- function Rt({ state: a, small: n }) {
266
+ function Pt({ state: a, small: n }) {
266
267
  return /* @__PURE__ */ t(
267
268
  "span",
268
269
  {
@@ -280,7 +281,7 @@ function Rt({ state: a, small: n }) {
280
281
  }
281
282
  );
282
283
  }
283
- function Pt({
284
+ function Tt({
284
285
  initial: a,
285
286
  onSave: n,
286
287
  onCancel: c,
@@ -454,9 +455,9 @@ function Pt({
454
455
  ] }, r.value)) })
455
456
  ] }),
456
457
  /* @__PURE__ */ t("div", { className: "flex gap-2 justify-end", children: [
457
- /* @__PURE__ */ e(T, { type: "button", variant: "outline", size: "sm", onClick: c, children: "Cancel" }),
458
+ /* @__PURE__ */ e(P, { type: "button", variant: "outline", size: "sm", onClick: c, children: "Cancel" }),
458
459
  /* @__PURE__ */ e(
459
- T,
460
+ P,
460
461
  {
461
462
  type: "button",
462
463
  size: "sm",
@@ -468,19 +469,19 @@ function Pt({
468
469
  ] })
469
470
  ] });
470
471
  }
471
- function Tt(a) {
472
+ function At(a) {
472
473
  return !a || a.length === 0 ? "" : [...a].sort(
473
474
  (n, c) => `${n.field}${n.op}${String(n.value)}`.localeCompare(`${c.field}${c.op}${String(c.value)}`)
474
475
  ).map((n) => `${n.field}:${n.op}:${String(n.value ?? "")}`).join("|");
475
476
  }
476
- function At(a) {
477
+ function Dt(a) {
477
478
  const n = /* @__PURE__ */ new Map();
478
479
  for (const g of a) {
479
480
  n.has(g.label) || n.set(g.label, { label: g.label, color: g.color, routes: [], minSort: g.sort });
480
481
  const l = n.get(g.label);
481
482
  l.minSort = Math.min(l.minSort, g.sort);
482
- const x = Tt(g.condition_rules), o = l.routes.find(
483
- (r) => r.from_state === g.from_state && Tt(r.condition_rules) === x
483
+ const x = At(g.condition_rules), o = l.routes.find(
484
+ (r) => r.from_state === g.from_state && At(r.condition_rules) === x
484
485
  );
485
486
  o ? (o.ids.push(g.id), o.to_states.push(g.to_state), o.minSort = Math.min(o.minSort, g.sort)) : l.routes.push({
486
487
  ids: [g.id],
@@ -505,12 +506,12 @@ function At(a) {
505
506
  for (const g of c) g.routes.sort((l, x) => l.minSort - x.minSort);
506
507
  return c;
507
508
  }
508
- const Vt = wa(null);
509
- function Dt({ id: a, children: n }) {
509
+ const Yt = ka(null);
510
+ function Lt({ id: a, children: n }) {
510
511
  const { attributes: c, listeners: g, setNodeRef: l, transform: x, transition: o, isDragging: r } = ct({
511
512
  id: a
512
513
  });
513
- return /* @__PURE__ */ e(Vt.Provider, { value: { listeners: g, attributes: c }, children: /* @__PURE__ */ e(
514
+ return /* @__PURE__ */ e(Yt.Provider, { value: { listeners: g, attributes: c }, children: /* @__PURE__ */ e(
514
515
  "div",
515
516
  {
516
517
  ref: l,
@@ -523,8 +524,8 @@ function Dt({ id: a, children: n }) {
523
524
  }
524
525
  ) });
525
526
  }
526
- function Lt() {
527
- const a = va(Vt);
527
+ function jt() {
528
+ const a = Na(Yt);
528
529
  return /* @__PURE__ */ e(
529
530
  "button",
530
531
  {
@@ -537,10 +538,10 @@ function Lt() {
537
538
  }
538
539
  );
539
540
  }
540
- function Za(a) {
541
+ function es(a) {
541
542
  return a ? Array.isArray(a) ? a.map(String).filter(Boolean) : typeof a == "string" && a.trim() ? [a] : [] : [];
542
543
  }
543
- function es({
544
+ function ts({
544
545
  relatedCollection: a,
545
546
  value: n,
546
547
  onChange: c
@@ -558,7 +559,7 @@ function es({
558
559
  staleTime: 6e4,
559
560
  enabled: !!a
560
561
  }), u = ((v == null ? void 0 : v.fields) ?? []).map((O) => O.field), d = (v == null ? void 0 : v.display_template) ?? null, N = ["name", "title", "label", "display_name", "subject", "email", "slug"], m = [
561
- .../* @__PURE__ */ new Set(["id", ...Va(d), ...N])
562
+ .../* @__PURE__ */ new Set(["id", ...Ya(d), ...N])
562
563
  ], f = u.length ? m.filter((O) => O === "id" || u.includes(O)).join(",") : "id", { data: b, isLoading: p, isError: w } = H({
563
564
  queryKey: ["relation-picker-items", a, f],
564
565
  queryFn: () => g.request(
@@ -674,7 +675,7 @@ function es({
674
675
  ] })
675
676
  ] });
676
677
  }
677
- const ts = [
678
+ const as = [
678
679
  { value: "eq", label: "equals" },
679
680
  { value: "neq", label: "not equals" },
680
681
  { value: "gt", label: "greater than" },
@@ -684,8 +685,8 @@ const ts = [
684
685
  { value: "contains", label: "contains" },
685
686
  { value: "null", label: "is empty" },
686
687
  { value: "nnull", label: "is not empty" }
687
- ], as = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), ss = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), ns = /* @__PURE__ */ new Set(["boolean"]);
688
- function ls({
688
+ ], ss = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), ns = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), ls = /* @__PURE__ */ new Set(["boolean"]);
689
+ function rs({
689
690
  rules: a,
690
691
  onChange: n,
691
692
  collection: c
@@ -703,7 +704,7 @@ function ls({
703
704
  if (!p.includes(".")) {
704
705
  const w = v.find((k) => k.field === p);
705
706
  if (w) {
706
- const k = Ha(u, c ?? "", p);
707
+ const k = Va(u, c ?? "", p);
707
708
  return { type: w.type, relatedCollection: (k == null ? void 0 : k.one_collection) ?? void 0 };
708
709
  }
709
710
  }
@@ -711,7 +712,7 @@ function ls({
711
712
  }
712
713
  const N = (p, w) => n(a.map((k, S) => S === p ? { ...k, ...w } : k)), m = (p) => n(a.filter((w, k) => k !== p));
713
714
  function f(p) {
714
- return p ? p.split(".").map($a).join(" → ") : "";
715
+ return p ? p.split(".").map(Fa).join(" → ") : "";
715
716
  }
716
717
  return /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-200 pt-3", children: [
717
718
  /* @__PURE__ */ t(
@@ -732,7 +733,7 @@ function ls({
732
733
  l && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
733
734
  /* @__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." }),
734
735
  a.map((p, w) => {
735
- const k = p.op === "null" || p.op === "nnull", S = d(p.field), A = as.has(S.type), L = ss.has(S.type), O = ns.has(S.type), y = !!S.relatedCollection;
736
+ const k = p.op === "null" || p.op === "nnull", S = d(p.field), A = ss.has(S.type), L = ns.has(S.type), O = ls.has(S.type), y = !!S.relatedCollection;
736
737
  return /* @__PURE__ */ t(
737
738
  "div",
738
739
  {
@@ -765,15 +766,15 @@ function ls({
765
766
  {
766
767
  value: p.op,
767
768
  onChange: (i) => N(w, { op: i || "eq" }),
768
- options: ts.map((i) => ({ value: i.value, label: i.label })),
769
+ options: as.map((i) => ({ value: i.value, label: i.label })),
769
770
  placeholder: "Operator…"
770
771
  }
771
772
  ) }),
772
773
  !k && /* @__PURE__ */ e("div", { className: "flex-1 min-w-[120px]", children: y ? /* @__PURE__ */ e(
773
- es,
774
+ ts,
774
775
  {
775
776
  relatedCollection: S.relatedCollection,
776
- value: Za(p.value),
777
+ value: es(p.value),
777
778
  onChange: (i) => N(w, { value: i.length === 1 ? i[0] : i })
778
779
  }
779
780
  ) : O ? /* @__PURE__ */ e(
@@ -820,7 +821,7 @@ function ls({
820
821
  );
821
822
  }),
822
823
  /* @__PURE__ */ t(
823
- T,
824
+ P,
824
825
  {
825
826
  type: "button",
826
827
  size: "sm",
@@ -836,7 +837,7 @@ function ls({
836
837
  ] })
837
838
  ] });
838
839
  }
839
- function rs({
840
+ function is({
840
841
  requirement: a,
841
842
  childRelations: n,
842
843
  onChange: c,
@@ -959,7 +960,7 @@ function rs({
959
960
  ] })
960
961
  ] });
961
962
  }
962
- function is({
963
+ function os({
963
964
  requirements: a,
964
965
  onChange: n,
965
966
  collection: c
@@ -980,7 +981,7 @@ function is({
980
981
  className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
981
982
  children: [
982
983
  l ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" }),
983
- /* @__PURE__ */ e(Wt, { className: "h-3 w-3" }),
984
+ /* @__PURE__ */ e(Ut, { className: "h-3 w-3" }),
984
985
  "Requirements ",
985
986
  /* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
986
987
  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 })
@@ -990,7 +991,7 @@ function is({
990
991
  l && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
991
992
  /* @__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." }),
992
993
  a.map((d, N) => /* @__PURE__ */ e(
993
- rs,
994
+ is,
994
995
  {
995
996
  requirement: d,
996
997
  childRelations: h,
@@ -1000,7 +1001,7 @@ function is({
1000
1001
  N
1001
1002
  )),
1002
1003
  /* @__PURE__ */ t(
1003
- T,
1004
+ P,
1004
1005
  {
1005
1006
  type: "button",
1006
1007
  size: "sm",
@@ -1032,7 +1033,7 @@ function Fe({
1032
1033
  return /* @__PURE__ */ t("div", { className: "space-y-1", children: [
1033
1034
  /* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: a }),
1034
1035
  /* @__PURE__ */ e(
1035
- Ut,
1036
+ Ht,
1036
1037
  {
1037
1038
  value: x,
1038
1039
  onChange: (v) => {
@@ -1060,15 +1061,15 @@ function Fe({
1060
1061
  ] });
1061
1062
  }
1062
1063
  const rt = "__custom__";
1063
- function os(a) {
1064
+ function cs(a) {
1064
1065
  return a.status === "live" ? `Live v${a.published_version ?? "?"}` : a.status === "draft" ? "Draft changes" : "Not published";
1065
1066
  }
1066
- function cs({
1067
+ function ds({
1067
1068
  externalApi: a,
1068
1069
  value: n,
1069
1070
  onChange: c
1070
1071
  }) {
1071
- const g = Z(), l = _a(), x = a.trim(), { data: o } = H({
1072
+ const g = Z(), l = Ca(), x = a.trim(), { data: o } = H({
1072
1073
  queryKey: ["payload-templates", "list", x],
1073
1074
  queryFn: () => g.request(
1074
1075
  V(`/payload-templates?external_api=${encodeURIComponent(x)}`)
@@ -1082,7 +1083,7 @@ function cs({
1082
1083
  { value: rt, label: "Custom (inline Liquid)" },
1083
1084
  ...(o ?? []).map((m) => ({
1084
1085
  value: m.key,
1085
- label: `${m.label} · ${os(m)}`
1086
+ label: `${m.label} · ${cs(m)}`
1086
1087
  }))
1087
1088
  ], v = (r ?? []).find((m) => m.name === x || String(m.id) === x), u = v ? String(v.id) : x, d = n ? `/external-apis/${encodeURIComponent(u)}/payloads/${encodeURIComponent(n)}` : null, N = d ? l.consoleUrl ? l.consoleUrl(d) : d : null;
1088
1089
  return /* @__PURE__ */ t("div", { className: "space-y-1", children: [
@@ -1104,7 +1105,7 @@ function cs({
1104
1105
  onClick: () => l.navigate(N),
1105
1106
  className: "flex shrink-0 items-center gap-1 text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200",
1106
1107
  children: [
1107
- /* @__PURE__ */ e(ya, { className: "h-3 w-3" }),
1108
+ /* @__PURE__ */ e(va, { className: "h-3 w-3" }),
1108
1109
  "Open template"
1109
1110
  ]
1110
1111
  }
@@ -1112,7 +1113,7 @@ function cs({
1112
1113
  ] })
1113
1114
  ] });
1114
1115
  }
1115
- function ds({
1116
+ function ms({
1116
1117
  actions: a,
1117
1118
  onChange: n
1118
1119
  }) {
@@ -1250,7 +1251,7 @@ function ds({
1250
1251
  ] })
1251
1252
  ] }),
1252
1253
  o.type === "erp_submit" && /* @__PURE__ */ e(
1253
- cs,
1254
+ ds,
1254
1255
  {
1255
1256
  externalApi: String(o.external_api ?? ""),
1256
1257
  value: o.payload_template_key,
@@ -1260,7 +1261,7 @@ function ds({
1260
1261
  !(o.type === "erp_submit" && o.payload_template_key) && /* @__PURE__ */ t("div", { className: "space-y-1", children: [
1261
1262
  /* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: "Payload template (Liquid — must render to valid JSON)" }),
1262
1263
  /* @__PURE__ */ e(
1263
- Ut,
1264
+ Ht,
1264
1265
  {
1265
1266
  value: o.payload_template ?? "",
1266
1267
  onChange: (h) => l(r, { payload_template: h.target.value }),
@@ -1334,7 +1335,7 @@ function ds({
1334
1335
  r
1335
1336
  )),
1336
1337
  /* @__PURE__ */ t(
1337
- T,
1338
+ P,
1338
1339
  {
1339
1340
  type: "button",
1340
1341
  size: "sm",
@@ -1375,15 +1376,15 @@ function it({
1375
1376
  notify_text: a.notify_text ?? null,
1376
1377
  comment_mode: a.comment_mode ?? "none",
1377
1378
  actions: a.actions ?? null
1378
- }), v = (b, p) => h((w) => ({ ...w, [b]: p })), u = (b) => b.collection.trim() !== "" && b.fk_field.trim() !== "" && b.fields.length > 0, d = (r.requirements ?? []).every(u), N = r.to_states.length > 0 && r.label.trim() && d, { data: m } = Pa(c, {
1379
+ }), v = (b, p) => h((w) => ({ ...w, [b]: p })), u = (b) => b.collection.trim() !== "" && b.fk_field.trim() !== "" && b.fields.length > 0, d = (r.requirements ?? []).every(u), N = r.to_states.length > 0 && r.label.trim() && d, { data: m } = Ta(c, {
1379
1380
  select: (b) => Array.isArray(b == null ? void 0 : b.fields) ? b.fields : []
1380
- }), f = Ca(
1381
+ }), f = Sa(
1381
1382
  {
1382
1383
  ...r,
1383
1384
  condition_rules: (r.condition_rules ?? []).filter((b) => b.field.trim()),
1384
1385
  requirements: (r.requirements ?? []).filter(u)
1385
1386
  },
1386
- Sa(m ?? [], [], c, {
1387
+ qa(m ?? [], [], c, {
1387
1388
  states: Object.fromEntries(n.map((b) => [b.id, b.label]))
1388
1389
  })
1389
1390
  );
@@ -1421,7 +1422,7 @@ function it({
1421
1422
  /* @__PURE__ */ e(Y, { className: "text-[12px]", children: r.to_previous ? "Fallback state" : `To State${r.to_states.length !== 1 ? "s" : ""}` }),
1422
1423
  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)." }),
1423
1424
  /* @__PURE__ */ e(
1424
- Ja,
1425
+ Xa,
1425
1426
  {
1426
1427
  values: r.to_states,
1427
1428
  onChange: (b) => v("to_states", b),
@@ -1462,7 +1463,7 @@ function it({
1462
1463
  /* @__PURE__ */ e(Ge, { value: r.color, onChange: (b) => v("color", b) })
1463
1464
  ] }),
1464
1465
  /* @__PURE__ */ e(
1465
- ls,
1466
+ rs,
1466
1467
  {
1467
1468
  rules: r.condition_rules ?? [],
1468
1469
  onChange: (b) => v("condition_rules", b),
@@ -1470,7 +1471,7 @@ function it({
1470
1471
  }
1471
1472
  ),
1472
1473
  /* @__PURE__ */ e(
1473
- is,
1474
+ os,
1474
1475
  {
1475
1476
  requirements: r.requirements ?? [],
1476
1477
  onChange: (b) => v("requirements", b.length > 0 ? b : null),
@@ -1478,7 +1479,7 @@ function it({
1478
1479
  }
1479
1480
  ),
1480
1481
  /* @__PURE__ */ e(
1481
- ds,
1482
+ ms,
1482
1483
  {
1483
1484
  actions: r.actions ?? [],
1484
1485
  onChange: (b) => v("actions", b.length > 0 ? b : null)
@@ -1585,11 +1586,11 @@ function it({
1585
1586
  ] }),
1586
1587
  /* @__PURE__ */ e(Ee, { checked: r.to_previous, onCheckedChange: (b) => v("to_previous", b) })
1587
1588
  ] }),
1588
- /* @__PURE__ */ e(Oa, { kind: "transition", sentences: f }),
1589
+ /* @__PURE__ */ e(Ra, { kind: "transition", sentences: f }),
1589
1590
  /* @__PURE__ */ t("div", { className: "flex gap-2 justify-end", children: [
1590
- /* @__PURE__ */ e(T, { type: "button", variant: "outline", size: "sm", onClick: x, children: "Cancel" }),
1591
+ /* @__PURE__ */ e(P, { type: "button", variant: "outline", size: "sm", onClick: x, children: "Cancel" }),
1591
1592
  /* @__PURE__ */ e(
1592
- T,
1593
+ P,
1593
1594
  {
1594
1595
  type: "button",
1595
1596
  size: "sm",
@@ -1608,19 +1609,19 @@ function it({
1608
1609
  ] })
1609
1610
  ] });
1610
1611
  }
1611
- function ms(a) {
1612
+ function ps(a) {
1612
1613
  var g, l;
1613
1614
  const n = ((g = a.first_name) == null ? void 0 : g[0]) ?? "", c = ((l = a.last_name) == null ? void 0 : l[0]) ?? "";
1614
1615
  return (n + c).toUpperCase() || a.email[0].toUpperCase();
1615
1616
  }
1616
- function ps(a) {
1617
+ function us(a) {
1617
1618
  const n = a.filter((l) => !l.filters || l.filters.length === 0), c = /* @__PURE__ */ new Set(), g = [];
1618
1619
  for (const l of n)
1619
1620
  for (const x of l.users)
1620
1621
  c.has(x.user) || (c.add(x.user), g.push(x));
1621
1622
  return g;
1622
1623
  }
1623
- function us({
1624
+ function hs({
1624
1625
  users: a,
1625
1626
  filteredCount: n
1626
1627
  }) {
@@ -1633,7 +1634,7 @@ function us({
1633
1634
  {
1634
1635
  title: `${l.first_name ?? ""} ${l.last_name ?? ""}`.trim() || l.email,
1635
1636
  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",
1636
- children: ms(l)
1637
+ children: ps(l)
1637
1638
  },
1638
1639
  l.user
1639
1640
  )),
@@ -1656,7 +1657,7 @@ function us({
1656
1657
  )
1657
1658
  ] });
1658
1659
  }
1659
- function hs({
1660
+ function xs({
1660
1661
  s: a,
1661
1662
  groups: n,
1662
1663
  expandedStateId: c,
@@ -1703,9 +1704,9 @@ function hs({
1703
1704
  a.lock_record && /* @__PURE__ */ e(Ce, { variant: "outline", className: "text-[10px] h-4 px-1", children: "locked" })
1704
1705
  ] }) }),
1705
1706
  /* @__PURE__ */ e(
1706
- us,
1707
+ hs,
1707
1708
  {
1708
- users: ps(n),
1709
+ users: us(n),
1709
1710
  filteredCount: n.filter((N) => N.filters && N.filters.length > 0).length
1710
1711
  }
1711
1712
  ),
@@ -1717,7 +1718,7 @@ function hs({
1717
1718
  onClick: g,
1718
1719
  className: "rounded p-1 text-slate-400 hover:text-slate-700",
1719
1720
  title: "Configure owners & skip",
1720
- children: /* @__PURE__ */ e(fa, { className: "h-3.5 w-3.5" })
1721
+ children: /* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" })
1721
1722
  }
1722
1723
  ),
1723
1724
  /* @__PURE__ */ e(
@@ -1743,7 +1744,7 @@ function hs({
1743
1744
  }
1744
1745
  );
1745
1746
  }
1746
- function xs({
1747
+ function fs({
1747
1748
  d: a,
1748
1749
  siblings: n,
1749
1750
  onSave: c,
@@ -1847,7 +1848,7 @@ function xs({
1847
1848
  ] }),
1848
1849
  /* @__PURE__ */ t("div", { className: "mt-2 flex justify-end gap-1.5", children: [
1849
1850
  /* @__PURE__ */ e(
1850
- T,
1851
+ P,
1851
1852
  {
1852
1853
  size: "sm",
1853
1854
  variant: "ghost",
@@ -1857,7 +1858,7 @@ function xs({
1857
1858
  }
1858
1859
  ),
1859
1860
  /* @__PURE__ */ e(
1860
- T,
1861
+ P,
1861
1862
  {
1862
1863
  size: "sm",
1863
1864
  className: "h-6 px-2.5 text-[11px]",
@@ -1872,7 +1873,7 @@ function xs({
1872
1873
  ] })
1873
1874
  ] });
1874
1875
  }
1875
- function fs({
1876
+ function gs({
1876
1877
  d: a,
1877
1878
  siblings: n,
1878
1879
  onEdit: c,
@@ -1925,7 +1926,7 @@ function fs({
1925
1926
  ] }),
1926
1927
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0", children: [
1927
1928
  /* @__PURE__ */ e(
1928
- xs,
1929
+ fs,
1929
1930
  {
1930
1931
  d: a,
1931
1932
  siblings: n,
@@ -1956,7 +1957,7 @@ function fs({
1956
1957
  }
1957
1958
  );
1958
1959
  }
1959
- function gs({
1960
+ function bs({
1960
1961
  binding: a,
1961
1962
  templateId: n
1962
1963
  }) {
@@ -1965,9 +1966,9 @@ function gs({
1965
1966
  xe(() => {
1966
1967
  o(l.map((i) => i.id));
1967
1968
  }, [l]);
1968
- const r = x.map((i) => l.find((_) => _.id === i)).filter(Boolean), h = Mt(
1969
- Ye(Kt),
1970
- Ye(zt, { coordinateGetter: Bt })
1969
+ const r = x.map((i) => l.find((_) => _.id === i)).filter(Boolean), h = Kt(
1970
+ Ye(zt),
1971
+ Ye(Bt, { coordinateGetter: Qt })
1971
1972
  ), [v, u] = $(null), [d, N] = $({
1972
1973
  field: "",
1973
1974
  label: "",
@@ -1987,21 +1988,21 @@ function gs({
1987
1988
  }), p = ((y = b == null ? void 0 : b.fields) == null ? void 0 : y.filter((i) => !i.hidden)) ?? [], w = () => g.invalidateQueries({ queryKey: ["pipeline-template", n] }), k = M({
1988
1989
  mutationFn: (i) => c.request(I(`/pipelines/bindings/${a.id}/dimensions`, i)),
1989
1990
  onSuccess: () => {
1990
- w(), f({ field: "", label: "", sort: 0, is_row_axis: !1, required: !1 }), P.success("Dimension added");
1991
+ w(), f({ field: "", label: "", sort: 0, is_row_axis: !1, required: !1 }), T.success("Dimension added");
1991
1992
  },
1992
- onError: () => P.error("Failed to add dimension")
1993
+ onError: () => T.error("Failed to add dimension")
1993
1994
  }), S = M({
1994
1995
  mutationFn: ({ dimId: i, body: _ }) => c.request(be(`/pipelines/dimensions/${i}`, _)),
1995
1996
  onSuccess: () => {
1996
- w(), u(null), P.success("Dimension updated");
1997
+ w(), u(null), T.success("Dimension updated");
1997
1998
  },
1998
- onError: () => P.error("Failed to update dimension")
1999
+ onError: () => T.error("Failed to update dimension")
1999
2000
  }), A = M({
2000
2001
  mutationFn: (i) => c.request($e(`/pipelines/dimensions/${i}`)),
2001
2002
  onSuccess: () => {
2002
- w(), P.success("Dimension deleted");
2003
+ w(), T.success("Dimension deleted");
2003
2004
  },
2004
- onError: () => P.error("Failed to delete dimension")
2005
+ onError: () => T.error("Failed to delete dimension")
2005
2006
  }), L = (i) => {
2006
2007
  u(i.id), N({
2007
2008
  field: i.field,
@@ -2088,7 +2089,7 @@ function gs({
2088
2089
  ] }),
2089
2090
  /* @__PURE__ */ t("div", { className: "flex justify-end gap-2", children: [
2090
2091
  /* @__PURE__ */ e(
2091
- T,
2092
+ P,
2092
2093
  {
2093
2094
  type: "button",
2094
2095
  variant: "ghost",
@@ -2099,7 +2100,7 @@ function gs({
2099
2100
  }
2100
2101
  ),
2101
2102
  /* @__PURE__ */ e(
2102
- T,
2103
+ P,
2103
2104
  {
2104
2105
  type: "button",
2105
2106
  size: "sm",
@@ -2114,7 +2115,7 @@ function gs({
2114
2115
  },
2115
2116
  i.id
2116
2117
  ) : /* @__PURE__ */ e(
2117
- fs,
2118
+ gs,
2118
2119
  {
2119
2120
  d: i,
2120
2121
  siblings: r,
@@ -2190,7 +2191,7 @@ function gs({
2190
2191
  "Required"
2191
2192
  ] }),
2192
2193
  /* @__PURE__ */ t(
2193
- T,
2194
+ P,
2194
2195
  {
2195
2196
  type: "button",
2196
2197
  size: "sm",
@@ -2207,7 +2208,7 @@ function gs({
2207
2208
  ] })
2208
2209
  ] });
2209
2210
  }
2210
- function vn({
2211
+ function wn({
2211
2212
  templateId: a,
2212
2213
  onBack: n,
2213
2214
  onExport: c,
@@ -2216,9 +2217,9 @@ function vn({
2216
2217
  var qt;
2217
2218
  const l = Z(), x = ke(), o = new Set(g ?? []), [r, h] = $(!1), [v, u] = $(""), [d, N] = $(!1), [m, f] = $(null), [b, p] = $(!1), [w, k] = $(null), [S, A] = $(null), [L, O] = $(
2218
2219
  null
2219
- ), [y, i] = $(""), [_, F] = $(""), [E, B] = $(null), [j, K] = $(!1), [W, te] = $([]), ae = Mt(
2220
- Ye(Kt),
2221
- Ye(zt, { coordinateGetter: Bt })
2220
+ ), [y, i] = $(""), [_, F] = $(""), [E, B] = $(null), [j, K] = $(!1), [W, te] = $([]), ae = Kt(
2221
+ Ye(zt),
2222
+ Ye(Bt, { coordinateGetter: Qt })
2222
2223
  ), { data: oe } = H({
2223
2224
  queryKey: ["collection-fields", y],
2224
2225
  queryFn: () => l.request(V(`/collections/${y}`)).then((s) => {
@@ -2241,12 +2242,12 @@ function vn({
2241
2242
  const s = (z == null ? void 0 : z.states) ?? [];
2242
2243
  te(s.map((C) => C.id));
2243
2244
  }, [z == null ? void 0 : z.states]), xe(() => {
2244
- const s = At((z == null ? void 0 : z.transitions) ?? []);
2245
+ const s = Dt((z == null ? void 0 : z.transitions) ?? []);
2245
2246
  xt(s.map((C) => C.label)), ft(
2246
2247
  Object.fromEntries(s.map((C) => [C.label, C.routes.map((R) => R.ids[0])]))
2247
2248
  );
2248
2249
  }, [z == null ? void 0 : z.transitions]);
2249
- const { data: Xt } = H({
2250
+ const { data: Zt } = H({
2250
2251
  queryKey: ["collections", "tables_only"],
2251
2252
  queryFn: () => l.request(V("/collections?tables_only=true")).then((s) => s.data)
2252
2253
  }), { data: Ze } = H({
@@ -2260,28 +2261,28 @@ function vn({
2260
2261
  onSuccess: () => {
2261
2262
  le(), h(!1);
2262
2263
  },
2263
- onError: () => P.error("Failed to update pipeline")
2264
+ onError: () => T.error("Failed to update pipeline")
2264
2265
  }), gt = M({
2265
2266
  mutationFn: (s) => l.request(I(`/pipelines/${a}/states`, s)),
2266
2267
  onSuccess: () => {
2267
2268
  le(), N(!1);
2268
2269
  },
2269
- onError: () => P.error("Failed to add state")
2270
+ onError: () => T.error("Failed to add state")
2270
2271
  }), tt = M({
2271
2272
  mutationFn: ({ stateId: s, body: C }) => l.request(be(`/pipelines/states/${s}`, C)),
2272
2273
  onSuccess: () => {
2273
2274
  le(), f(null);
2274
2275
  },
2275
- onError: () => P.error("Failed to update state")
2276
- }), Zt = M({
2276
+ onError: () => T.error("Failed to update state")
2277
+ }), ea = M({
2277
2278
  mutationFn: (s) => l.request($e(`/pipelines/states/${s}`)),
2278
2279
  onSuccess: () => {
2279
- le(), P.success("State deleted");
2280
+ le(), T.success("State deleted");
2280
2281
  },
2281
2282
  onError: (s) => {
2282
2283
  var R;
2283
2284
  const C = ((R = s == null ? void 0 : s.response) == null ? void 0 : R.error) ?? (s == null ? void 0 : s.message);
2284
- P.error(C || "Failed to delete state", { duration: 9e3 });
2285
+ T.error(C || "Failed to delete state", { duration: 9e3 });
2285
2286
  }
2286
2287
  }), bt = M({
2287
2288
  mutationFn: async (s) => {
@@ -2309,7 +2310,7 @@ function vn({
2309
2310
  onSuccess: () => {
2310
2311
  le(), p(!1);
2311
2312
  },
2312
- onError: () => P.error("Failed to add transition")
2313
+ onError: () => T.error("Failed to add transition")
2313
2314
  }), yt = M({
2314
2315
  mutationFn: async ({
2315
2316
  labelGroup: s,
@@ -2340,7 +2341,7 @@ function vn({
2340
2341
  onSuccess: () => {
2341
2342
  le(), k(null);
2342
2343
  },
2343
- onError: () => P.error("Failed to add route")
2344
+ onError: () => T.error("Failed to add route")
2344
2345
  }), vt = M({
2345
2346
  mutationFn: async ({ route: s, data: C }) => {
2346
2347
  const R = /* @__PURE__ */ new Map();
@@ -2381,31 +2382,30 @@ function vn({
2381
2382
  le(), O(null);
2382
2383
  },
2383
2384
  onError: (s) => {
2384
- const C = s == null ? void 0 : s.response;
2385
- P.error((C == null ? void 0 : C.error) ?? (s == null ? void 0 : s.message) ?? "Failed to update route");
2385
+ Et(s, "Failed to update route");
2386
2386
  }
2387
2387
  }), Nt = M({
2388
2388
  mutationFn: async (s) => {
2389
2389
  for (const C of s) await l.request($e(`/pipelines/transitions/${C}`));
2390
2390
  },
2391
2391
  onSuccess: () => {
2392
- le(), P.success("Deleted");
2392
+ le(), T.success("Deleted");
2393
2393
  },
2394
- onError: () => P.error("Failed to delete")
2395
- }), ea = M({
2394
+ onError: () => T.error("Failed to delete")
2395
+ }), ta = M({
2396
2396
  mutationFn: async (s) => {
2397
2397
  for (const { id: C, sort: R } of s)
2398
2398
  await l.request(be(`/pipelines/transitions/${C}`, { sort: R }));
2399
2399
  },
2400
2400
  onSuccess: () => le(),
2401
- onError: () => P.error("Failed to reorder")
2402
- }), ta = M({
2401
+ onError: () => T.error("Failed to reorder")
2402
+ }), aa = M({
2403
2403
  mutationFn: async ({ ids: s, color: C }) => {
2404
2404
  for (const R of s)
2405
2405
  await l.request(be(`/pipelines/transitions/${R}`, { color: C }));
2406
2406
  },
2407
2407
  onSuccess: () => le(),
2408
- onError: () => P.error("Failed to update color")
2408
+ onError: () => T.error("Failed to update color")
2409
2409
  }), [qe, ze] = $(null), Re = M({
2410
2410
  mutationFn: async ({
2411
2411
  from: s,
@@ -2427,37 +2427,36 @@ function vn({
2427
2427
  return;
2428
2428
  }
2429
2429
  const R = "done" in s ? s.done.filter((G) => G.rewritten).length : 0;
2430
- le(), A(null), ze(null), P.success(
2430
+ le(), A(null), ze(null), T.success(
2431
2431
  R ? `Renamed to "${C}" · ${R} reference${R === 1 ? "" : "s"} updated` : `Renamed to "${C}"`
2432
2432
  );
2433
2433
  },
2434
2434
  onError: (s) => {
2435
- const C = s == null ? void 0 : s.response;
2436
- P.error((C == null ? void 0 : C.error) ?? (s == null ? void 0 : s.message) ?? "Failed to rename");
2435
+ Et(s, "Failed to rename");
2437
2436
  }
2438
2437
  }), wt = M({
2439
2438
  mutationFn: (s) => l.request(I(`/pipelines/${a}/bind`, s)),
2440
2439
  onSuccess: () => {
2441
- le(), i(""), F(""), P.success("Collection bound");
2440
+ le(), i(""), F(""), T.success("Collection bound");
2442
2441
  },
2443
- onError: () => P.error("Failed to bind collection")
2444
- }), aa = M({
2442
+ onError: () => T.error("Failed to bind collection")
2443
+ }), sa = M({
2445
2444
  mutationFn: (s) => l.request($e(`/pipelines/bindings/${s}`)),
2446
2445
  onSuccess: () => {
2447
- le(), P.success("Collection unbound");
2446
+ le(), T.success("Collection unbound");
2448
2447
  },
2449
- onError: () => P.error("Failed to unbind")
2448
+ onError: () => T.error("Failed to unbind")
2450
2449
  }), at = M({
2451
2450
  mutationFn: ({
2452
2451
  bindingId: s,
2453
2452
  body: C
2454
2453
  }) => l.request(be(`/pipelines/bindings/${s}`, C)),
2455
2454
  onSuccess: () => le(),
2456
- onError: () => P.error("Failed to update binding")
2455
+ onError: () => T.error("Failed to update binding")
2457
2456
  });
2458
2457
  if (Q && !z)
2459
2458
  return /* @__PURE__ */ e(
2460
- Ta,
2459
+ Aa,
2461
2460
  {
2462
2461
  error: X,
2463
2462
  what: "this pipeline",
@@ -2470,7 +2469,7 @@ function vn({
2470
2469
  /* @__PURE__ */ e(Ae, { className: "h-48 rounded-xl" }),
2471
2470
  /* @__PURE__ */ e(Ae, { className: "h-48 rounded-xl" })
2472
2471
  ] });
2473
- const re = z.states ?? [], kt = z.transitions ?? [], ue = z.bindings ?? [], sa = Xt ?? [], st = W.length > 0 ? W.map((s) => re.find((C) => C.id === s)).filter(Boolean) : re, _t = new Map(re.map((s) => [s.id, s])), nt = new Map(At(kt).map((s) => [s.label, s])), Ct = me.map((s) => nt.get(s)).filter((s) => !!s);
2472
+ const re = z.states ?? [], kt = z.transitions ?? [], ue = z.bindings ?? [], na = Zt ?? [], st = W.length > 0 ? W.map((s) => re.find((C) => C.id === s)).filter(Boolean) : re, _t = new Map(re.map((s) => [s.id, s])), nt = new Map(Dt(kt).map((s) => [s.label, s])), Ct = me.map((s) => nt.get(s)).filter((s) => !!s);
2474
2473
  function St(s, C, R) {
2475
2474
  const G = [];
2476
2475
  let ee = 0;
@@ -2485,9 +2484,9 @@ function vn({
2485
2484
  }
2486
2485
  }
2487
2486
  }
2488
- ea.mutate(G);
2487
+ ta.mutate(G);
2489
2488
  }
2490
- function na(s) {
2489
+ function la(s) {
2491
2490
  const { active: C, over: R } = s;
2492
2491
  if (!R || C.id === R.id) return;
2493
2492
  const G = Ve(
@@ -2497,13 +2496,13 @@ function vn({
2497
2496
  );
2498
2497
  xt(G), St(G, Ke, nt);
2499
2498
  }
2500
- function la(s, C) {
2499
+ function ra(s, C) {
2501
2500
  const { active: R, over: G } = C;
2502
2501
  if (!G || R.id === G.id) return;
2503
2502
  const ee = Ke[s] ?? [], q = Ve(ee, ee.indexOf(R.id), ee.indexOf(G.id)), D = { ...Ke, [s]: q };
2504
2503
  ft(D), St(me, D, nt);
2505
2504
  }
2506
- const ra = ue.some((s) => (s.dimensions ?? []).length > 0), ia = new Set(ue.map((s) => s.collection)), oa = sa.filter((s) => !ia.has(s.collection)), ca = (s) => {
2505
+ const ia = ue.some((s) => (s.dimensions ?? []).length > 0), oa = new Set(ue.map((s) => s.collection)), ca = na.filter((s) => !oa.has(s.collection)), da = (s) => {
2507
2506
  const { active: C, over: R } = s;
2508
2507
  if (!R || C.id === R.id) return;
2509
2508
  const G = W.indexOf(C.id), ee = W.indexOf(R.id), q = Ve(W, G, ee);
@@ -2523,7 +2522,7 @@ function vn({
2523
2522
  onClick: n,
2524
2523
  className: "flex items-center gap-1 text-slate-400 transition-colors hover:text-slate-700",
2525
2524
  children: [
2526
- /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
2525
+ /* @__PURE__ */ e(ma, { className: "h-3.5 w-3.5" }),
2527
2526
  "Pipelines"
2528
2527
  ]
2529
2528
  }
@@ -2547,9 +2546,9 @@ function vn({
2547
2546
  className: "h-7 text-[13px] w-48"
2548
2547
  }
2549
2548
  ),
2550
- /* @__PURE__ */ e(T, { type: "submit", size: "sm", variant: "ghost", className: "h-7 px-1.5", children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }) }),
2549
+ /* @__PURE__ */ e(P, { type: "submit", size: "sm", variant: "ghost", className: "h-7 px-1.5", children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" }) }),
2551
2550
  /* @__PURE__ */ e(
2552
- T,
2551
+ P,
2553
2552
  {
2554
2553
  type: "button",
2555
2554
  size: "sm",
@@ -2578,7 +2577,7 @@ function vn({
2578
2577
  ] }),
2579
2578
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
2580
2579
  !o.has("history") && /* @__PURE__ */ e(
2581
- Ea,
2580
+ Oa,
2582
2581
  {
2583
2582
  collection: "nivaro_workflow_templates",
2584
2583
  item: a,
@@ -2586,7 +2585,7 @@ function vn({
2586
2585
  }
2587
2586
  ),
2588
2587
  c && /* @__PURE__ */ t(
2589
- T,
2588
+ P,
2590
2589
  {
2591
2590
  size: "sm",
2592
2591
  variant: "outline",
@@ -2594,11 +2593,11 @@ function vn({
2594
2593
  try {
2595
2594
  await c();
2596
2595
  } catch {
2597
- P.error("Export failed");
2596
+ T.error("Export failed");
2598
2597
  }
2599
2598
  },
2600
2599
  children: [
2601
- /* @__PURE__ */ e(ma, { className: "mr-1.5 h-3.5 w-3.5" }),
2600
+ /* @__PURE__ */ e(pa, { className: "mr-1.5 h-3.5 w-3.5" }),
2602
2601
  " Export"
2603
2602
  ]
2604
2603
  }
@@ -2634,7 +2633,7 @@ function vn({
2634
2633
  ] })
2635
2634
  ] }),
2636
2635
  /* @__PURE__ */ e(
2637
- Fa,
2636
+ Ea,
2638
2637
  {
2639
2638
  kind: "config",
2640
2639
  params: { type: "pipeline", id: a },
@@ -2650,7 +2649,7 @@ function vn({
2650
2649
  /* @__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." })
2651
2650
  ] }),
2652
2651
  !d && /* @__PURE__ */ t(
2653
- T,
2652
+ P,
2654
2653
  {
2655
2654
  size: "sm",
2656
2655
  variant: "outline",
@@ -2669,13 +2668,13 @@ function vn({
2669
2668
  {
2670
2669
  sensors: ae,
2671
2670
  collisionDetection: We,
2672
- onDragEnd: ca,
2671
+ onDragEnd: da,
2673
2672
  children: /* @__PURE__ */ e(Ue, { items: W, strategy: He, children: /* @__PURE__ */ t("div", { className: "space-y-2", children: [
2674
2673
  st.map((s) => {
2675
2674
  var C, R;
2676
2675
  return /* @__PURE__ */ t("div", { children: [
2677
2676
  (m == null ? void 0 : m.id) === s.id ? /* @__PURE__ */ e(
2678
- Pt,
2677
+ Tt,
2679
2678
  {
2680
2679
  initial: s,
2681
2680
  saving: tt.isPending,
@@ -2683,7 +2682,7 @@ function vn({
2683
2682
  onCancel: () => f(null)
2684
2683
  }
2685
2684
  ) : /* @__PURE__ */ e(
2686
- hs,
2685
+ xs,
2687
2686
  {
2688
2687
  s,
2689
2688
  groups: (Ze == null ? void 0 : Ze[s.id]) ?? [],
@@ -2691,13 +2690,13 @@ function vn({
2691
2690
  onToggleExpand: () => B(E === s.id ? null : s.id),
2692
2691
  onEdit: () => f(s),
2693
2692
  onDelete: () => {
2694
- confirm(`Delete state "${s.label}"?`) && Zt.mutate(s.id);
2693
+ confirm(`Delete state "${s.label}"?`) && ea.mutate(s.id);
2695
2694
  }
2696
2695
  }
2697
2696
  ),
2698
2697
  E === s.id && (m == null ? void 0 : m.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: [
2699
2698
  /* @__PURE__ */ e(
2700
- Ua,
2699
+ Ha,
2701
2700
  {
2702
2701
  stateId: s.id,
2703
2702
  stateName: s.label,
@@ -2706,7 +2705,7 @@ function vn({
2706
2705
  }
2707
2706
  ),
2708
2707
  /* @__PURE__ */ e("div", { className: "border-t border-slate-200 pt-4", children: /* @__PURE__ */ e(
2709
- Wa,
2708
+ Ua,
2710
2709
  {
2711
2710
  stateId: s.id,
2712
2711
  stateName: s.label,
@@ -2719,7 +2718,7 @@ function vn({
2719
2718
  ] }, s.id);
2720
2719
  }),
2721
2720
  d && /* @__PURE__ */ e(
2722
- Pt,
2721
+ Tt,
2723
2722
  {
2724
2723
  initial: {},
2725
2724
  saving: gt.isPending,
@@ -2739,7 +2738,7 @@ function vn({
2739
2738
  /* @__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." })
2740
2739
  ] }),
2741
2740
  !b && /* @__PURE__ */ t(
2742
- T,
2741
+ P,
2743
2742
  {
2744
2743
  size: "sm",
2745
2744
  variant: "outline",
@@ -2760,13 +2759,13 @@ function vn({
2760
2759
  {
2761
2760
  sensors: ae,
2762
2761
  collisionDetection: We,
2763
- onDragEnd: na,
2762
+ onDragEnd: la,
2764
2763
  children: /* @__PURE__ */ e(Ue, { items: me, strategy: He, children: Ct.map((s) => {
2765
2764
  var ee;
2766
2765
  const C = new Map(s.routes.map((q) => [q.ids[0], q])), R = Ke[s.label] ?? s.routes.map((q) => q.ids[0]), G = R.map((q) => C.get(q)).filter((q) => !!q);
2767
- return /* @__PURE__ */ e(Dt, { id: s.label, children: /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white", children: [
2766
+ return /* @__PURE__ */ e(Lt, { id: s.label, children: /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white", children: [
2768
2767
  /* @__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: [
2769
- /* @__PURE__ */ e(Lt, {}),
2768
+ /* @__PURE__ */ e(jt, {}),
2770
2769
  /* @__PURE__ */ t(De, { children: [
2771
2770
  /* @__PURE__ */ e(Le, { asChild: !0, children: /* @__PURE__ */ e(
2772
2771
  "button",
@@ -2791,7 +2790,7 @@ function vn({
2791
2790
  value: s.color,
2792
2791
  onChange: (q) => {
2793
2792
  const D = s.routes.flatMap((se) => se.ids);
2794
- ta.mutate({ ids: D, color: q });
2793
+ aa.mutate({ ids: D, color: q });
2795
2794
  }
2796
2795
  }
2797
2796
  )
@@ -2942,7 +2941,7 @@ function vn({
2942
2941
  {
2943
2942
  sensors: ae,
2944
2943
  collisionDetection: We,
2945
- onDragEnd: (q) => la(s.label, q),
2944
+ onDragEnd: (q) => ra(s.label, q),
2946
2945
  children: /* @__PURE__ */ e(
2947
2946
  Ue,
2948
2947
  {
@@ -2988,16 +2987,16 @@ function vn({
2988
2987
  )
2989
2988
  },
2990
2989
  D
2991
- ) : /* @__PURE__ */ e(Dt, { id: q.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: [
2992
- /* @__PURE__ */ e(Lt, {}),
2990
+ ) : /* @__PURE__ */ e(Lt, { id: q.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: [
2991
+ /* @__PURE__ */ e(jt, {}),
2993
2992
  /* @__PURE__ */ t("div", { className: "flex flex-1 min-w-0 flex-wrap items-center gap-1.5 text-[12px]", children: [
2994
- se ? /* @__PURE__ */ e(Rt, { state: se }) : /* @__PURE__ */ e("span", { className: "italic text-slate-400 text-[11px]", children: "any state" }),
2995
- /* @__PURE__ */ e(Qt, { className: "h-3 w-3 text-slate-300 shrink-0" }),
2993
+ se ? /* @__PURE__ */ e(Pt, { state: se }) : /* @__PURE__ */ e("span", { className: "italic text-slate-400 text-[11px]", children: "any state" }),
2994
+ /* @__PURE__ */ e(Wt, { className: "h-3 w-3 text-slate-300 shrink-0" }),
2996
2995
  q.to_states.map((ne, ie) => {
2997
2996
  const $t = _t.get(ne);
2998
2997
  return $t ? /* @__PURE__ */ t("span", { className: "flex items-center gap-1", children: [
2999
2998
  ie > 0 && /* @__PURE__ */ e("span", { className: "text-slate-300", children: "·" }),
3000
- /* @__PURE__ */ e(Rt, { state: $t, small: !0 })
2999
+ /* @__PURE__ */ e(Pt, { state: $t, small: !0 })
3001
3000
  ] }, ne) : null;
3002
3001
  }),
3003
3002
  q.auto_trigger && /* @__PURE__ */ t(
@@ -3006,7 +3005,7 @@ function vn({
3006
3005
  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",
3007
3006
  title: "Automatic — fired by the engine when conditions match; hidden from users",
3008
3007
  children: [
3009
- /* @__PURE__ */ e(pa, { className: "h-2.5 w-2.5" }),
3008
+ /* @__PURE__ */ e(ua, { className: "h-2.5 w-2.5" }),
3010
3009
  "Auto"
3011
3010
  ]
3012
3011
  }
@@ -3043,7 +3042,7 @@ function vn({
3043
3042
  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",
3044
3043
  title: "Transition actions run after this transition lands",
3045
3044
  children: [
3046
- /* @__PURE__ */ e(ua, { className: "h-2.5 w-2.5" }),
3045
+ /* @__PURE__ */ e(ha, { className: "h-2.5 w-2.5" }),
3047
3046
  (q.actions ?? []).length
3048
3047
  ]
3049
3048
  }
@@ -3120,7 +3119,7 @@ function vn({
3120
3119
  ] })
3121
3120
  ] })
3122
3121
  ] }),
3123
- !o.has("branches") && /* @__PURE__ */ e(Cs, { templateId: a, states: st }),
3122
+ !o.has("branches") && /* @__PURE__ */ e(Ss, { templateId: a, states: st }),
3124
3123
  !o.has("bindings") && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3125
3124
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
3126
3125
  "Applied to Collections",
@@ -3160,7 +3159,7 @@ function vn({
3160
3159
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
3161
3160
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Owner fallback:" }),
3162
3161
  /* @__PURE__ */ e(
3163
- ws,
3162
+ ks,
3164
3163
  {
3165
3164
  value: s.owner_fallback_field ?? "",
3166
3165
  onCommit: (R) => at.mutate({
@@ -3204,8 +3203,8 @@ function vn({
3204
3203
  ),
3205
3204
  "aria-label": "Configure matrix dimensions",
3206
3205
  children: [
3207
- /* @__PURE__ */ e(ha, { className: "h-3.5 w-3.5" }),
3208
- /* @__PURE__ */ e(Et, { id: "dimension", children: "Dimensions" }),
3206
+ /* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" }),
3207
+ /* @__PURE__ */ e(Ot, { id: "dimension", children: "Dimensions" }),
3209
3208
  (s.dimensions ?? []).length > 0 && /* @__PURE__ */ t("span", { className: "font-mono text-[10px] opacity-70", children: [
3210
3209
  "(",
3211
3210
  (C = s.dimensions) == null ? void 0 : C.length,
@@ -3219,16 +3218,16 @@ function vn({
3219
3218
  {
3220
3219
  type: "button",
3221
3220
  onClick: () => {
3222
- confirm(`Unbind "${s.collection}"?`) && aa.mutate(s.id);
3221
+ confirm(`Unbind "${s.collection}"?`) && sa.mutate(s.id);
3223
3222
  },
3224
3223
  className: "rounded p-1.5 text-slate-400 hover:text-red-500 transition-colors",
3225
3224
  title: "Unbind collection",
3226
- children: /* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" })
3225
+ children: /* @__PURE__ */ e(fa, { className: "h-3.5 w-3.5" })
3227
3226
  }
3228
3227
  )
3229
3228
  ] })
3230
3229
  ] }),
3231
- ce === s.id && /* @__PURE__ */ e(gs, { binding: s, templateId: a })
3230
+ ce === s.id && /* @__PURE__ */ e(bs, { binding: s, templateId: a })
3232
3231
  ] }, s.id);
3233
3232
  }) }),
3234
3233
  /* @__PURE__ */ t("div", { className: "space-y-2 pt-2", children: [
@@ -3238,7 +3237,7 @@ function vn({
3238
3237
  {
3239
3238
  value: y,
3240
3239
  onChange: i,
3241
- options: oa.map((s) => ({
3240
+ options: ca.map((s) => ({
3242
3241
  value: s.collection,
3243
3242
  label: s.display_name ?? s.collection
3244
3243
  })),
@@ -3261,7 +3260,7 @@ function vn({
3261
3260
  }
3262
3261
  ),
3263
3262
  /* @__PURE__ */ t(
3264
- T,
3263
+ P,
3265
3264
  {
3266
3265
  type: "button",
3267
3266
  size: "sm",
@@ -3285,45 +3284,45 @@ function vn({
3285
3284
  ] })
3286
3285
  ] })
3287
3286
  ] }),
3288
- !o.has("matrix") && ra && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3287
+ !o.has("matrix") && ia && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3289
3288
  /* @__PURE__ */ t("div", { className: "flex items-start justify-between gap-4", children: [
3290
3289
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
3291
- /* @__PURE__ */ e(Et, { id: "owner-matrix", children: "Owner Matrix" }),
3290
+ /* @__PURE__ */ e(Ot, { id: "owner-matrix", children: "Owner Matrix" }),
3292
3291
  /* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "Who is responsible in each state, per dimension value. Records resolve their owners from this grid automatically — notifications, queues, and SLAs follow it." })
3293
3292
  ] }),
3294
3293
  /* @__PURE__ */ t(
3295
- T,
3294
+ P,
3296
3295
  {
3297
3296
  size: "sm",
3298
3297
  variant: "outline",
3299
3298
  className: "h-7 shrink-0 gap-1.5 text-[12px]",
3300
3299
  onClick: () => K(!0),
3301
3300
  children: [
3302
- /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
3301
+ /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" }),
3303
3302
  " Manage teams"
3304
3303
  ]
3305
3304
  }
3306
3305
  )
3307
3306
  ] }),
3308
- /* @__PURE__ */ e(Ka, { templateId: a, states: st, bindings: ue })
3307
+ /* @__PURE__ */ e(za, { templateId: a, states: st, bindings: ue })
3309
3308
  ] }),
3310
- j && /* @__PURE__ */ e(Ts, { onClose: () => K(!1) }),
3311
- !o.has("simulator") && /* @__PURE__ */ e(Ss, { bindings: ue }),
3312
- !o.has("canvas") && /* @__PURE__ */ e(Os, { templateId: a }),
3313
- !o.has("flow-map") && /* @__PURE__ */ e(Rs, { templateId: a }),
3314
- !o.has("cumulative-flow") && /* @__PURE__ */ e(Ra, { templateId: a }),
3315
- !o.has("replay") && /* @__PURE__ */ e(Ps, { templateId: a }),
3316
- !o.has("migration") && /* @__PURE__ */ e(Es, { templateId: a }),
3317
- !o.has("lint") && /* @__PURE__ */ e(Ba, { templateId: a }),
3318
- !o.has("coverage") && /* @__PURE__ */ e(Fs, { templateId: a, states: re }),
3319
- !o.has("skip-report") && /* @__PURE__ */ e(Qa, { templateId: a }),
3320
- !o.has("ai-review") && /* @__PURE__ */ e(bs, { templateId: a }),
3321
- !o.has("versions") && /* @__PURE__ */ e(ys, { templateId: a }),
3322
- !o.has("matrix-versions") && /* @__PURE__ */ e(za, { templateId: a })
3309
+ j && /* @__PURE__ */ e(As, { onClose: () => K(!1) }),
3310
+ !o.has("simulator") && /* @__PURE__ */ e(qs, { bindings: ue }),
3311
+ !o.has("canvas") && /* @__PURE__ */ e(Rs, { templateId: a }),
3312
+ !o.has("flow-map") && /* @__PURE__ */ e(Ps, { templateId: a }),
3313
+ !o.has("cumulative-flow") && /* @__PURE__ */ e(Pa, { templateId: a }),
3314
+ !o.has("replay") && /* @__PURE__ */ e(Ts, { templateId: a }),
3315
+ !o.has("migration") && /* @__PURE__ */ e(Os, { templateId: a }),
3316
+ !o.has("lint") && /* @__PURE__ */ e(Qa, { templateId: a }),
3317
+ !o.has("coverage") && /* @__PURE__ */ e(Es, { templateId: a, states: re }),
3318
+ !o.has("skip-report") && /* @__PURE__ */ e(Wa, { templateId: a }),
3319
+ !o.has("ai-review") && /* @__PURE__ */ e(ys, { templateId: a }),
3320
+ !o.has("versions") && /* @__PURE__ */ e(vs, { templateId: a }),
3321
+ !o.has("matrix-versions") && /* @__PURE__ */ e(Ba, { templateId: a })
3323
3322
  ] })
3324
3323
  ] });
3325
3324
  }
3326
- function bs({ templateId: a }) {
3325
+ function ys({ templateId: a }) {
3327
3326
  const n = Z(), [c, g] = $(
3328
3327
  null
3329
3328
  ), l = M({
@@ -3333,7 +3332,7 @@ function bs({ templateId: a }) {
3333
3332
  onSuccess: g,
3334
3333
  onError: (x) => {
3335
3334
  var o;
3336
- return P.error(
3335
+ return T.error(
3337
3336
  ((o = x == null ? void 0 : x.response) == null ? void 0 : o.error) ?? (x == null ? void 0 : x.message) ?? "Review failed"
3338
3337
  );
3339
3338
  }
@@ -3345,7 +3344,7 @@ function bs({ templateId: a }) {
3345
3344
  /* @__PURE__ */ e("p", { className: "mt-0.5 max-w-[72ch] text-[12px] text-slate-500", children: "Structure analysis (unreachable states, dead ends, missing send-backs, unowned states) plus an AI critique of the state graph." })
3346
3345
  ] }),
3347
3346
  /* @__PURE__ */ e(
3348
- T,
3347
+ P,
3349
3348
  {
3350
3349
  type: "button",
3351
3350
  size: "sm",
@@ -3366,7 +3365,7 @@ function bs({ templateId: a }) {
3366
3365
  ] })
3367
3366
  ] });
3368
3367
  }
3369
- function ys({ templateId: a }) {
3368
+ function vs({ templateId: a }) {
3370
3369
  const n = Z(), c = ke(), [g, l] = $(null), [x, o] = $(null), { data: r, isFetching: h } = H({
3371
3370
  queryKey: ["pipeline-version-diff", a, x],
3372
3371
  queryFn: () => n.request(V(`/pipelines/${a}/versions/${x}/diff`)).then((N) => N.data),
@@ -3380,15 +3379,15 @@ function ys({ templateId: a }) {
3380
3379
  var f, b;
3381
3380
  l(null);
3382
3381
  const m = ((b = (f = N == null ? void 0 : N.data) == null ? void 0 : f.transitions) == null ? void 0 : b.kept_in_history) ?? 0;
3383
- P.success(
3382
+ T.success(
3384
3383
  m > 0 ? `Version restored — ${m} extra transition(s) kept (referenced by history)` : "Version restored"
3385
3384
  ), c.invalidateQueries({ queryKey: ["pipeline", a] }), c.invalidateQueries({ queryKey: ["pipeline-versions", a] });
3386
3385
  },
3387
- onError: () => P.error("Failed to restore version")
3386
+ onError: () => T.error("Failed to restore version")
3388
3387
  });
3389
3388
  return /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-3", children: [
3390
3389
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
3391
- /* @__PURE__ */ e(ba, { className: "h-4 w-4 text-slate-400" }),
3390
+ /* @__PURE__ */ e(ya, { className: "h-4 w-4 text-slate-400" }),
3392
3391
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-semibold text-slate-800", children: "Config versions" }),
3393
3392
  v && v.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: v.length })
3394
3393
  ] }),
@@ -3406,10 +3405,10 @@ function ys({ templateId: a }) {
3406
3405
  N.note ?? "—",
3407
3406
  (m = N.created_by_name) != null && m.trim() ? ` · ${N.created_by_name}` : ""
3408
3407
  ] }),
3409
- /* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: qa(N.created_at) }),
3408
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: $a(N.created_at) }),
3410
3409
  g === N.id ? /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center gap-1.5", children: [
3411
3410
  /* @__PURE__ */ e(
3412
- T,
3411
+ P,
3413
3412
  {
3414
3413
  size: "sm",
3415
3414
  variant: "destructive",
@@ -3420,7 +3419,7 @@ function ys({ templateId: a }) {
3420
3419
  }
3421
3420
  ),
3422
3421
  /* @__PURE__ */ e(
3423
- T,
3422
+ P,
3424
3423
  {
3425
3424
  size: "sm",
3426
3425
  variant: "outline",
@@ -3451,7 +3450,7 @@ function ys({ templateId: a }) {
3451
3450
  ] })
3452
3451
  ] }, N.id);
3453
3452
  }) }),
3454
- x != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: h ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : r ? /* @__PURE__ */ e(vs, { 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." }) }),
3453
+ x != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: h ? /* @__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." }) }),
3455
3454
  /* @__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." })
3456
3455
  ] });
3457
3456
  }
@@ -3460,7 +3459,7 @@ function Be(a) {
3460
3459
  const n = typeof a == "string" ? a : JSON.stringify(a);
3461
3460
  return n.length > 80 ? `${n.slice(0, 80)}…` : n;
3462
3461
  }
3463
- function vs({
3462
+ function Ns({
3464
3463
  fromVersion: a,
3465
3464
  to: n,
3466
3465
  diff: c
@@ -3545,10 +3544,10 @@ function vs({
3545
3544
  )
3546
3545
  ] });
3547
3546
  }
3548
- function Yt(a, n) {
3547
+ function Gt(a, n) {
3549
3548
  return a.filter((c) => !c.is_terminal && !n.includes(c.key)).map((c) => ({ value: c.key, label: c.label }));
3550
3549
  }
3551
- function Ns(a) {
3550
+ function ws(a) {
3552
3551
  return a ? `Runs only while the record is in ${a}, by that step's owners or an administrator.` : "No starting step: only an administrator can run this split.";
3553
3552
  }
3554
3553
  function Ie({
@@ -3567,7 +3566,7 @@ function Ie({
3567
3566
  a.label
3568
3567
  ] }) : /* @__PURE__ */ e("span", { className: g, style: l, children: a.label });
3569
3568
  }
3570
- function ws({ value: a, onCommit: n }) {
3569
+ function ks({ value: a, onCommit: n }) {
3571
3570
  const [c, g] = $(a);
3572
3571
  return xe(() => g(a), [a]), /* @__PURE__ */ e(
3573
3572
  "input",
@@ -3586,7 +3585,7 @@ function ws({ value: a, onCommit: n }) {
3586
3585
  }
3587
3586
  );
3588
3587
  }
3589
- function ks({
3588
+ function _s({
3590
3589
  states: a,
3591
3590
  saving: n,
3592
3591
  onSave: c,
@@ -3619,7 +3618,7 @@ function ks({
3619
3618
  {
3620
3619
  value: u,
3621
3620
  onChange: d,
3622
- options: Yt(a, o),
3621
+ options: Gt(a, o),
3623
3622
  noneLabel: "No starting step",
3624
3623
  placeholder: "No starting step",
3625
3624
  className: "max-w-xs"
@@ -3632,7 +3631,7 @@ function ks({
3632
3631
  "text-[11px]",
3633
3632
  u ? "text-slate-500" : "text-amber-700 dark:text-amber-400"
3634
3633
  ),
3635
- children: Ns(m)
3634
+ children: ws(m)
3636
3635
  }
3637
3636
  )
3638
3637
  ] }),
@@ -3667,9 +3666,9 @@ function ks({
3667
3666
  )) })
3668
3667
  ] }),
3669
3668
  /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-2", children: [
3670
- /* @__PURE__ */ e(T, { type: "button", size: "sm", variant: "ghost", className: "text-[12px]", onClick: g, children: "Cancel" }),
3669
+ /* @__PURE__ */ e(P, { type: "button", size: "sm", variant: "ghost", className: "text-[12px]", onClick: g, children: "Cancel" }),
3671
3670
  /* @__PURE__ */ e(
3672
- T,
3671
+ P,
3673
3672
  {
3674
3673
  type: "button",
3675
3674
  size: "sm",
@@ -3687,7 +3686,7 @@ function ks({
3687
3686
  ] })
3688
3687
  ] });
3689
3688
  }
3690
- function _s({
3689
+ function Cs({
3691
3690
  split: a,
3692
3691
  states: n,
3693
3692
  saving: c,
@@ -3703,7 +3702,7 @@ function _s({
3703
3702
  onChange: (o) => {
3704
3703
  o !== l && g(o || null);
3705
3704
  },
3706
- options: Yt(n, a.branch_states),
3705
+ options: Gt(n, a.branch_states),
3707
3706
  noneLabel: "No starting step",
3708
3707
  placeholder: "No starting step",
3709
3708
  className: "h-7 w-56"
@@ -3726,7 +3725,7 @@ function _s({
3726
3725
  )
3727
3726
  ] });
3728
3727
  }
3729
- function Cs({
3728
+ function Ss({
3730
3729
  templateId: a,
3731
3730
  states: n
3732
3731
  }) {
@@ -3736,44 +3735,44 @@ function Cs({
3736
3735
  }), u = () => g.invalidateQueries({ queryKey: h }), d = M({
3737
3736
  mutationFn: (f) => c.request(I(`/workflows/templates/${a}/splits`, f)),
3738
3737
  onSuccess: () => {
3739
- u(), x(!1), P.success("Split created");
3738
+ u(), x(!1), T.success("Split created");
3740
3739
  },
3741
3740
  onError: (f) => {
3742
3741
  var p;
3743
3742
  const b = ((p = f == null ? void 0 : f.response) == null ? void 0 : p.error) ?? (f == null ? void 0 : f.message);
3744
- P.error(b ?? "Failed to create split");
3743
+ T.error(b ?? "Failed to create split");
3745
3744
  }
3746
3745
  }), N = M({
3747
3746
  mutationFn: ({ splitId: f, from: b }) => c.request(
3748
3747
  be(`/workflows/templates/${a}/splits/${f}`, { from_state: b })
3749
3748
  ),
3750
3749
  onSuccess: () => {
3751
- u(), P.success("Starting step saved");
3750
+ u(), T.success("Starting step saved");
3752
3751
  },
3753
3752
  onError: (f) => {
3754
3753
  var p;
3755
3754
  const b = ((p = f == null ? void 0 : f.response) == null ? void 0 : p.error) ?? (f == null ? void 0 : f.message);
3756
- P.error(b ?? "Failed to save the starting step");
3755
+ T.error(b ?? "Failed to save the starting step");
3757
3756
  }
3758
3757
  }), m = M({
3759
3758
  mutationFn: (f) => c.request($e(`/workflows/templates/${a}/splits/${f}`)),
3760
3759
  onSuccess: () => {
3761
- u(), r(null), P.success("Split deleted");
3760
+ u(), r(null), T.success("Split deleted");
3762
3761
  },
3763
- onError: () => P.error("Failed to delete split")
3762
+ onError: () => T.error("Failed to delete split")
3764
3763
  });
3765
3764
  return /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3766
3765
  /* @__PURE__ */ t("div", { className: "flex items-start justify-between gap-4", children: [
3767
3766
  /* @__PURE__ */ t("h2", { className: "flex-1 text-[13px] font-semibold text-slate-800", children: [
3768
3767
  /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
3769
- /* @__PURE__ */ e(ga, { className: "h-4 w-4 text-slate-400" }),
3768
+ /* @__PURE__ */ e(ba, { className: "h-4 w-4 text-slate-400" }),
3770
3769
  "Parallel Branches",
3771
3770
  /* @__PURE__ */ e("span", { className: "font-mono text-[11px] font-normal text-slate-400", children: (v == null ? void 0 : v.length) ?? 0 })
3772
3771
  ] }),
3773
3772
  /* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: `A split sends one record into several states at the same time — each branch keeps its own owners and SLA clock. When every branch reaches a terminal state, the record auto-joins into the join state. Splits appear as a "Split" action on bound records while the record is in the split's starting step; a split with no starting step can only be run by an administrator.` })
3774
3773
  ] }),
3775
3774
  !l && /* @__PURE__ */ t(
3776
- T,
3775
+ P,
3777
3776
  {
3778
3777
  size: "sm",
3779
3778
  variant: "outline",
@@ -3799,7 +3798,7 @@ function Cs({
3799
3798
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
3800
3799
  /* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-700", children: f.label }),
3801
3800
  /* @__PURE__ */ e(
3802
- _s,
3801
+ Cs,
3803
3802
  {
3804
3803
  split: f,
3805
3804
  states: n,
@@ -3809,14 +3808,14 @@ function Cs({
3809
3808
  ),
3810
3809
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
3811
3810
  f.branch_state_objs.map((p) => /* @__PURE__ */ e(Ie, { state: p }, p.id)),
3812
- /* @__PURE__ */ e(Qt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
3811
+ /* @__PURE__ */ e(Wt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
3813
3812
  f.join_state_obj ? /* @__PURE__ */ e(Ie, { state: f.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
3814
3813
  ] })
3815
3814
  ] }),
3816
3815
  o === f.id ? /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-2", children: [
3817
3816
  /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-500", children: "Delete?" }),
3818
3817
  /* @__PURE__ */ e(
3819
- T,
3818
+ P,
3820
3819
  {
3821
3820
  size: "sm",
3822
3821
  variant: "destructive",
@@ -3827,7 +3826,7 @@ function Cs({
3827
3826
  }
3828
3827
  ),
3829
3828
  /* @__PURE__ */ e(
3830
- T,
3829
+ P,
3831
3830
  {
3832
3831
  size: "sm",
3833
3832
  variant: "ghost",
@@ -3851,7 +3850,7 @@ function Cs({
3851
3850
  );
3852
3851
  }),
3853
3852
  l && /* @__PURE__ */ e(
3854
- ks,
3853
+ _s,
3855
3854
  {
3856
3855
  states: n,
3857
3856
  saving: d.isPending,
@@ -3861,11 +3860,11 @@ function Cs({
3861
3860
  )
3862
3861
  ] });
3863
3862
  }
3864
- function Ss({ bindings: a }) {
3863
+ function qs({ bindings: a }) {
3865
3864
  var v;
3866
3865
  const n = Z(), [c, g] = $(""), [l, x] = $(""), o = l || ((v = a[0]) == null ? void 0 : v.collection) || "", r = M({
3867
3866
  mutationFn: () => n.request(I("/pipelines/simulate", { collection: o, item_id: c.trim() })).then((u) => u.data),
3868
- onError: () => P.error("Simulation failed")
3867
+ onError: () => T.error("Simulation failed")
3869
3868
  }), h = r.data;
3870
3869
  return a.length === 0 ? null : /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3871
3870
  /* @__PURE__ */ t("div", { children: [
@@ -3907,7 +3906,7 @@ function Ss({ bindings: a }) {
3907
3906
  }
3908
3907
  )
3909
3908
  ] }),
3910
- /* @__PURE__ */ e(T, { size: "sm", disabled: !c.trim() || r.isPending, onClick: () => r.mutate(), children: r.isPending ? "Running…" : "Simulate" })
3909
+ /* @__PURE__ */ e(P, { size: "sm", disabled: !c.trim() || r.isPending, onClick: () => r.mutate(), children: r.isPending ? "Running…" : "Simulate" })
3911
3910
  ] }),
3912
3911
  r.isSuccess && h === null && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No pipeline binding or instance for this record." }),
3913
3912
  h && /* @__PURE__ */ t("div", { className: "space-y-4", children: [
@@ -3977,7 +3976,7 @@ function Ss({ bindings: a }) {
3977
3976
  ] });
3978
3977
  }
3979
3978
  const Pe = 900, ge = 230;
3980
- function Gt({
3979
+ function It({
3981
3980
  selected: a,
3982
3981
  onChange: n
3983
3982
  }) {
@@ -4056,21 +4055,21 @@ function Gt({
4056
4055
  ] })
4057
4056
  ] });
4058
4057
  }
4059
- function qs({
4058
+ function $s({
4060
4059
  templateId: a,
4061
4060
  cluster: n,
4062
4061
  onDone: c
4063
4062
  }) {
4064
4063
  var w, k;
4065
- const g = Z(), l = ke(), x = !!((w = n.suggestion) != null && w.group_id) && n.suggestion.mismatched_filters.length === 0, o = Object.values(n.dims).filter(Boolean).join(" · ") || "New group", [r, h] = $(o), [v, u] = $([]), [d, N] = $([]), m = Ga(), { data: f } = H({
4064
+ const g = Z(), l = ke(), x = !!((w = n.suggestion) != null && w.group_id) && n.suggestion.mismatched_filters.length === 0, o = Object.values(n.dims).filter(Boolean).join(" · ") || "New group", [r, h] = $(o), [v, u] = $([]), [d, N] = $([]), m = Ia(), { data: f } = H({
4066
4065
  queryKey: ["user-groups-teams"],
4067
4066
  queryFn: () => g.request(V("/user-groups")).then((S) => S.data),
4068
4067
  staleTime: 6e4
4069
4068
  }), b = (f ?? []).map((S) => ({
4070
4069
  ...S,
4071
- rank: Ia(S.scopes, n.filters, m, n.collection)
4070
+ rank: Ja(S.scopes, n.filters, m, n.collection)
4072
4071
  })).sort(
4073
- (S, A) => Ot(S.rank.tier) - Ot(A.rank.tier) || S.name.localeCompare(A.name, void 0, { sensitivity: "base" })
4072
+ (S, A) => Rt(S.rank.tier) - Rt(A.rank.tier) || S.name.localeCompare(A.name, void 0, { sensitivity: "base" })
4074
4073
  ), p = M({
4075
4074
  mutationFn: async () => {
4076
4075
  var A;
@@ -4095,13 +4094,13 @@ function qs({
4095
4094
  },
4096
4095
  onSuccess: (S) => {
4097
4096
  var A;
4098
- P.success(
4097
+ T.success(
4099
4098
  x ? `Added ${S} owner${S === 1 ? "" : "s"} to ${(A = n.suggestion) == null ? void 0 : A.group_label}` : `Created "${r.trim() || o}" with ${S} owner${S === 1 ? "" : "s"}`
4100
4099
  ), l.invalidateQueries({ queryKey: ["owner-gaps", a] }), l.invalidateQueries({ queryKey: ["owner-lint", a] }), l.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] }), c();
4101
4100
  },
4102
4101
  onError: (S) => {
4103
4102
  var A;
4104
- return P.error(
4103
+ return T.error(
4105
4104
  ((A = S == null ? void 0 : S.response) == null ? void 0 : A.error) ?? "Assignment failed",
4106
4105
  { duration: 9e3 }
4107
4106
  );
@@ -4148,11 +4147,11 @@ function qs({
4148
4147
  );
4149
4148
  })
4150
4149
  ] }),
4151
- /* @__PURE__ */ e(Gt, { selected: v, onChange: u }),
4150
+ /* @__PURE__ */ e(It, { selected: v, onChange: u }),
4152
4151
  /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-1.5", children: [
4153
- /* @__PURE__ */ e(T, { size: "sm", variant: "ghost", className: "h-6 px-2 text-[11px]", onClick: c, children: "Cancel" }),
4152
+ /* @__PURE__ */ e(P, { size: "sm", variant: "ghost", className: "h-6 px-2 text-[11px]", onClick: c, children: "Cancel" }),
4154
4153
  /* @__PURE__ */ e(
4155
- T,
4154
+ P,
4156
4155
  {
4157
4156
  size: "sm",
4158
4157
  className: "h-6 px-2.5 text-[11px]",
@@ -4164,14 +4163,14 @@ function qs({
4164
4163
  ] })
4165
4164
  ] });
4166
4165
  }
4167
- function $s({ templateId: a, finding: n }) {
4166
+ function Fs({ templateId: a, finding: n }) {
4168
4167
  const c = Z(), g = ke(), [l, x] = $(
4169
4168
  "idle"
4170
4169
  ), [o, r] = $([]), h = (p) => {
4171
- P.success(p), x("idle"), r([]), g.invalidateQueries({ queryKey: ["owner-lint", a] }), g.invalidateQueries({ queryKey: ["owner-gaps", a] }), g.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
4170
+ T.success(p), x("idle"), r([]), g.invalidateQueries({ queryKey: ["owner-lint", a] }), g.invalidateQueries({ queryKey: ["owner-gaps", a] }), g.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
4172
4171
  }, v = (p) => {
4173
4172
  var w;
4174
- return P.error(((w = p == null ? void 0 : p.response) == null ? void 0 : w.error) ?? "Action failed", {
4173
+ return T.error(((w = p == null ? void 0 : p.response) == null ? void 0 : w.error) ?? "Action failed", {
4175
4174
  duration: 9e3
4176
4175
  });
4177
4176
  }, u = M({
@@ -4233,7 +4232,7 @@ function $s({ templateId: a, finding: n }) {
4233
4232
  ] }),
4234
4233
  l === "idle" && /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center gap-1", children: [
4235
4234
  n.type === "duplicate" && n.other_group_id && /* @__PURE__ */ e(
4236
- T,
4235
+ P,
4237
4236
  {
4238
4237
  size: "sm",
4239
4238
  variant: "outline",
@@ -4245,7 +4244,7 @@ function $s({ templateId: a, finding: n }) {
4245
4244
  ),
4246
4245
  n.type === "empty" && /* @__PURE__ */ t(_e, { children: [
4247
4246
  /* @__PURE__ */ e(
4248
- T,
4247
+ P,
4249
4248
  {
4250
4249
  size: "sm",
4251
4250
  variant: "outline",
@@ -4256,7 +4255,7 @@ function $s({ templateId: a, finding: n }) {
4256
4255
  }
4257
4256
  ),
4258
4257
  /* @__PURE__ */ e(
4259
- T,
4258
+ P,
4260
4259
  {
4261
4260
  size: "sm",
4262
4261
  variant: "outline",
@@ -4268,7 +4267,7 @@ function $s({ templateId: a, finding: n }) {
4268
4267
  )
4269
4268
  ] }),
4270
4269
  n.type === "unknown_field" && n.dead_field && n.group_filters && /* @__PURE__ */ e(
4271
- T,
4270
+ P,
4272
4271
  {
4273
4272
  size: "sm",
4274
4273
  variant: "outline",
@@ -4285,7 +4284,7 @@ function $s({ templateId: a, finding: n }) {
4285
4284
  n.other_group_name,
4286
4285
  "” and delete this group?",
4287
4286
  /* @__PURE__ */ e(
4288
- T,
4287
+ P,
4289
4288
  {
4290
4289
  size: "sm",
4291
4290
  className: "h-6 px-2 text-[11px]",
@@ -4295,7 +4294,7 @@ function $s({ templateId: a, finding: n }) {
4295
4294
  }
4296
4295
  ),
4297
4296
  /* @__PURE__ */ e(
4298
- T,
4297
+ P,
4299
4298
  {
4300
4299
  size: "sm",
4301
4300
  variant: "ghost",
@@ -4310,7 +4309,7 @@ function $s({ templateId: a, finding: n }) {
4310
4309
  n.group_name,
4311
4310
  "”? It has no members, so nothing loses coverage.",
4312
4311
  /* @__PURE__ */ e(
4313
- T,
4312
+ P,
4314
4313
  {
4315
4314
  size: "sm",
4316
4315
  variant: "destructive",
@@ -4321,7 +4320,7 @@ function $s({ templateId: a, finding: n }) {
4321
4320
  }
4322
4321
  ),
4323
4322
  /* @__PURE__ */ e(
4324
- T,
4323
+ P,
4325
4324
  {
4326
4325
  size: "sm",
4327
4326
  variant: "ghost",
@@ -4332,10 +4331,10 @@ function $s({ templateId: a, finding: n }) {
4332
4331
  )
4333
4332
  ] }),
4334
4333
  l === "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: [
4335
- /* @__PURE__ */ e(Gt, { selected: o, onChange: r }),
4334
+ /* @__PURE__ */ e(It, { selected: o, onChange: r }),
4336
4335
  /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-1.5", children: [
4337
4336
  /* @__PURE__ */ e(
4338
- T,
4337
+ P,
4339
4338
  {
4340
4339
  size: "sm",
4341
4340
  variant: "ghost",
@@ -4347,7 +4346,7 @@ function $s({ templateId: a, finding: n }) {
4347
4346
  }
4348
4347
  ),
4349
4348
  /* @__PURE__ */ e(
4350
- T,
4349
+ P,
4351
4350
  {
4352
4351
  size: "sm",
4353
4352
  className: "h-6 px-2.5 text-[11px]",
@@ -4360,7 +4359,7 @@ function $s({ templateId: a, finding: n }) {
4360
4359
  ] })
4361
4360
  ] });
4362
4361
  }
4363
- function Fs({
4362
+ function Es({
4364
4363
  templateId: a,
4365
4364
  states: n
4366
4365
  }) {
@@ -4380,11 +4379,11 @@ function Fs({
4380
4379
  mutationFn: (y) => c.request(I(`/pipelines/${a}/owner-cleanup`, y ? { user_id: y } : {})),
4381
4380
  onSuccess: (y) => {
4382
4381
  const i = y.data;
4383
- P.success(
4382
+ T.success(
4384
4383
  `Removed ${i.group_members_removed} seat(s) and ${i.instance_owners_removed} record owner(s)`
4385
4384
  ), g.invalidateQueries({ queryKey: ["owner-gaps", a] }), g.invalidateQueries({ queryKey: ["owner-lint", a] }), g.invalidateQueries({ queryKey: ["owner-groups", a] }), g.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
4386
4385
  },
4387
- onError: () => P.error("Cleanup failed")
4386
+ onError: () => T.error("Cleanup failed")
4388
4387
  }), b = (u == null ? void 0 : u.clusters) ?? [], p = u == null ? void 0 : u.dead_seats, w = ((m == null ? void 0 : m.findings) ?? []).filter((y) => y.type !== "inactive_member"), k = b.reduce((y, i) => y + i.count, 0), S = new Map(
4389
4388
  n.map((y) => [y.key, { label: y.label, color: y.color ?? null }])
4390
4389
  ), A = /* @__PURE__ */ new Map();
@@ -4399,7 +4398,7 @@ function Fs({
4399
4398
  {
4400
4399
  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",
4401
4400
  children: [
4402
- /* @__PURE__ */ e("span", { className: "text-slate-400", children: Jt(y) }),
4401
+ /* @__PURE__ */ e("span", { className: "text-slate-400", children: Xt(y) }),
4403
4402
  /* @__PURE__ */ e("span", { className: "font-medium text-slate-700 dark:text-foreground", children: i })
4404
4403
  ]
4405
4404
  },
@@ -4412,7 +4411,7 @@ function Fs({
4412
4411
  /* @__PURE__ */ e("p", { className: "mt-0.5 max-w-[68ch] text-[12px] text-slate-500 dark:text-muted-foreground", children: "Who actually covers this pipeline — open records resolving nobody, seats held by people who can no longer act, and hygiene problems in the matrix itself. Every finding is fixable in place." })
4413
4412
  ] }),
4414
4413
  /* @__PURE__ */ e(
4415
- T,
4414
+ P,
4416
4415
  {
4417
4416
  size: "sm",
4418
4417
  variant: "outline",
@@ -4462,7 +4461,7 @@ function Fs({
4462
4461
  o ? /* @__PURE__ */ t("span", { className: "ml-auto flex items-center gap-1.5", children: [
4463
4462
  /* @__PURE__ */ e("span", { className: "text-[11.5px] text-slate-600 dark:text-slate-300", children: "Remove all of them from every group and open record?" }),
4464
4463
  /* @__PURE__ */ e(
4465
- T,
4464
+ P,
4466
4465
  {
4467
4466
  size: "sm",
4468
4467
  className: "h-6 bg-violet-600 px-2 text-[11px] text-white hover:bg-violet-700",
@@ -4474,7 +4473,7 @@ function Fs({
4474
4473
  }
4475
4474
  ),
4476
4475
  /* @__PURE__ */ e(
4477
- T,
4476
+ P,
4478
4477
  {
4479
4478
  size: "sm",
4480
4479
  variant: "ghost",
@@ -4484,7 +4483,7 @@ function Fs({
4484
4483
  }
4485
4484
  )
4486
4485
  ] }) : /* @__PURE__ */ e(
4487
- T,
4486
+ P,
4488
4487
  {
4489
4488
  size: "sm",
4490
4489
  variant: "outline",
@@ -4554,7 +4553,7 @@ function Fs({
4554
4553
  style: { backgroundColor: (_ == null ? void 0 : _.color) ?? "#94a3b8" }
4555
4554
  }
4556
4555
  ),
4557
- /* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (_ == null ? void 0 : _.label) ?? It(y) }),
4556
+ /* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (_ == null ? void 0 : _.label) ?? Jt(y) }),
4558
4557
  /* @__PURE__ */ t("span", { className: "ml-auto text-[11px] tabular-nums text-slate-400", children: [
4559
4558
  F,
4560
4559
  " record",
@@ -4586,7 +4585,7 @@ function Fs({
4586
4585
  }
4587
4586
  ),
4588
4587
  /* @__PURE__ */ e(
4589
- T,
4588
+ P,
4590
4589
  {
4591
4590
  size: "sm",
4592
4591
  variant: "outline",
@@ -4609,13 +4608,13 @@ function Fs({
4609
4608
  " ",
4610
4609
  "already matches",
4611
4610
  " ",
4612
- jt(E.suggestion.matched_filters.join(", ")) || "nothing"
4611
+ Mt(E.suggestion.matched_filters.join(", ")) || "nothing"
4613
4612
  ] }),
4614
4613
  E.suggestion.mismatched_filters.length > 0 && /* @__PURE__ */ t("span", { className: "text-amber-700 dark:text-amber-400", children: [
4615
4614
  " ",
4616
4615
  "— it misses",
4617
4616
  " ",
4618
- jt(E.suggestion.mismatched_filters.join(", ")),
4617
+ Mt(E.suggestion.mismatched_filters.join(", ")),
4619
4618
  ", so assigning creates a group for this combination"
4620
4619
  ] })
4621
4620
  ] }) : /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1 text-amber-700 dark:text-amber-400", children: [
@@ -4623,7 +4622,7 @@ function Fs({
4623
4622
  "No group comes close — assigning creates one for this combination."
4624
4623
  ] }) }),
4625
4624
  h === j && /* @__PURE__ */ e(
4626
- qs,
4625
+ $s,
4627
4626
  {
4628
4627
  templateId: a,
4629
4628
  cluster: E,
@@ -4653,26 +4652,26 @@ function Fs({
4653
4652
  ] }),
4654
4653
  /* @__PURE__ */ e("div", { className: "max-h-96 divide-y divide-slate-100 overflow-y-auto px-3 dark:divide-border/60", children: w.map((y, i) => (
4655
4654
  // biome-ignore lint/suspicious/noArrayIndexKey: findings are positional
4656
- /* @__PURE__ */ e($s, { templateId: a, finding: y }, i)
4655
+ /* @__PURE__ */ e(Fs, { templateId: a, finding: y }, i)
4657
4656
  )) })
4658
4657
  ] })
4659
4658
  ] })
4660
4659
  ] });
4661
4660
  }
4662
- function It(a) {
4661
+ function Jt(a) {
4663
4662
  return a.replace(/[_-]+/g, " ").replace(/\b\w/g, (n) => n.toUpperCase());
4664
4663
  }
4665
- function Jt(a) {
4664
+ function Xt(a) {
4666
4665
  const n = a.split(".");
4667
4666
  for (; n.length > 1 && /^((short_)?name|label|key|id|.*_id)$/i.test(n[n.length - 1]); )
4668
4667
  n.pop();
4669
4668
  const c = n[n.length - 1].replace(/s$/i, "");
4670
- return It(c);
4669
+ return Jt(c);
4671
4670
  }
4672
- function jt(a) {
4673
- return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (n) => Jt(n));
4671
+ function Mt(a) {
4672
+ return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (n) => Xt(n));
4674
4673
  }
4675
- function Es({ templateId: a }) {
4674
+ function Os({ templateId: a }) {
4676
4675
  const n = Z(), c = ke(), [g, l] = $(""), [x, o] = $(""), [r, h] = $(!1), { data: v } = H({
4677
4676
  queryKey: ["instance-distribution", a],
4678
4677
  queryFn: () => n.request(V(`/pipelines/${a}/instance-distribution`)),
@@ -4687,11 +4686,11 @@ function Es({ templateId: a }) {
4687
4686
  I(`/pipelines/${a}/start-missing`, { collection: k })
4688
4687
  ),
4689
4688
  onSuccess: (k) => {
4690
- P.success(`${k.data.started} instance(s) started`), c.invalidateQueries({ queryKey: ["instance-distribution", a] });
4689
+ T.success(`${k.data.started} instance(s) started`), c.invalidateQueries({ queryKey: ["instance-distribution", a] });
4691
4690
  },
4692
4691
  onError: (k) => {
4693
4692
  var S;
4694
- return P.error(((S = k.response) == null ? void 0 : S.error) ?? "Start failed");
4693
+ return T.error(((S = k.response) == null ? void 0 : S.error) ?? "Start failed");
4695
4694
  }
4696
4695
  }), w = M({
4697
4696
  mutationFn: () => n.request(
@@ -4701,11 +4700,11 @@ function Es({ templateId: a }) {
4701
4700
  })
4702
4701
  ),
4703
4702
  onSuccess: (k) => {
4704
- P.success(`${k.data.migrated} instance(s) migrated`), h(!1), l(""), o(""), c.invalidateQueries({ queryKey: ["instance-distribution", a] });
4703
+ T.success(`${k.data.migrated} instance(s) migrated`), h(!1), l(""), o(""), c.invalidateQueries({ queryKey: ["instance-distribution", a] });
4705
4704
  },
4706
4705
  onError: (k) => {
4707
4706
  var S;
4708
- return P.error(((S = k.response) == null ? void 0 : S.error) ?? "Migration failed");
4707
+ return T.error(((S = k.response) == null ? void 0 : S.error) ?? "Migration failed");
4709
4708
  }
4710
4709
  });
4711
4710
  return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
@@ -4756,18 +4755,18 @@ function Es({ templateId: a }) {
4756
4755
  m,
4757
4756
  " instance(s) to"
4758
4757
  ] }),
4759
- /* @__PURE__ */ t(Aa, { value: x || void 0, onValueChange: o, children: [
4760
- /* @__PURE__ */ e(Da, { className: "h-8 w-[220px] text-[12.5px]", children: /* @__PURE__ */ e(La, { placeholder: "Pick a state…" }) }),
4761
- /* @__PURE__ */ e(ja, { children: d.filter((k) => String(k.id) !== g).map((k) => /* @__PURE__ */ e(Ma, { value: k.id, children: k.label }, k.id)) })
4758
+ /* @__PURE__ */ t(Da, { value: x || void 0, onValueChange: o, children: [
4759
+ /* @__PURE__ */ e(La, { className: "h-8 w-[220px] text-[12.5px]", children: /* @__PURE__ */ e(ja, { placeholder: "Pick a state…" }) }),
4760
+ /* @__PURE__ */ e(Ma, { children: d.filter((k) => String(k.id) !== g).map((k) => /* @__PURE__ */ e(Ka, { value: k.id, children: k.label }, k.id)) })
4762
4761
  ] }),
4763
- x && !r && /* @__PURE__ */ e(T, { size: "sm", className: "h-8 text-[12.5px]", onClick: () => h(!0), children: "Migrate…" }),
4762
+ x && !r && /* @__PURE__ */ e(P, { size: "sm", className: "h-8 text-[12.5px]", onClick: () => h(!0), children: "Migrate…" }),
4764
4763
  x && 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: [
4765
4764
  /* @__PURE__ */ t("span", { className: "text-[12px] text-amber-800 dark:text-amber-300", children: [
4766
4765
  m,
4767
4766
  " record(s) will move, each with a history entry. Sure?"
4768
4767
  ] }),
4769
4768
  /* @__PURE__ */ e(
4770
- T,
4769
+ P,
4771
4770
  {
4772
4771
  size: "sm",
4773
4772
  className: "h-6 text-[11.5px]",
@@ -4789,7 +4788,7 @@ function Es({ templateId: a }) {
4789
4788
  ] })
4790
4789
  ] });
4791
4790
  }
4792
- function Os({ templateId: a }) {
4791
+ function Rs({ templateId: a }) {
4793
4792
  const n = Z(), [c, g] = $(
4794
4793
  null
4795
4794
  ), [l, x] = $(() => {
@@ -4802,7 +4801,7 @@ function Os({ templateId: a }) {
4802
4801
  queryKey: ["pipeline-canvas", a],
4803
4802
  queryFn: () => n.request(V(`/pipelines/${a}`)).then((i) => i.data),
4804
4803
  staleTime: 3e4
4805
- }), h = (r == null ? void 0 : r.states) ?? [], v = (r == null ? void 0 : r.transitions) ?? [], u = Na(() => {
4804
+ }), h = (r == null ? void 0 : r.states) ?? [], v = (r == null ? void 0 : r.transitions) ?? [], u = wa(() => {
4806
4805
  var Me;
4807
4806
  const i = new Map(h.map((Q) => [String(Q.id).toUpperCase(), Q])), _ = /* @__PURE__ */ new Map(), F = h.filter((Q) => Q.is_initial).map((Q) => ({ id: String(Q.id).toUpperCase(), r: 0 })), E = /* @__PURE__ */ new Map();
4808
4807
  for (const Q of v) {
@@ -4847,11 +4846,11 @@ function Os({ templateId: a }) {
4847
4846
  })
4848
4847
  ),
4849
4848
  onSuccess: () => {
4850
- P.success("Transition created — configure it in the Transitions list"), p.invalidateQueries({ queryKey: ["pipeline-canvas", a] }), p.invalidateQueries({ queryKey: ["pipeline", a] });
4849
+ T.success("Transition created — configure it in the Transitions list"), p.invalidateQueries({ queryKey: ["pipeline-canvas", a] }), p.invalidateQueries({ queryKey: ["pipeline", a] });
4851
4850
  },
4852
4851
  onError: (i) => {
4853
4852
  var _;
4854
- return P.error(((_ = i.response) == null ? void 0 : _.error) ?? "Create failed");
4853
+ return T.error(((_ = i.response) == null ? void 0 : _.error) ?? "Create failed");
4855
4854
  }
4856
4855
  }), k = (i, _) => {
4857
4856
  if (_.shiftKey) {
@@ -4968,7 +4967,7 @@ function Os({ templateId: a }) {
4968
4967
  y1: d(N).y + u.NODE_H / 2,
4969
4968
  x2: f.x,
4970
4969
  y2: f.y,
4971
- stroke: Ht,
4970
+ stroke: Vt,
4972
4971
  strokeWidth: 2,
4973
4972
  strokeDasharray: "5 4"
4974
4973
  }
@@ -5086,7 +5085,7 @@ function Os({ templateId: a }) {
5086
5085
  ] })
5087
5086
  ] });
5088
5087
  }
5089
- function Rs({ templateId: a }) {
5088
+ function Ps({ templateId: a }) {
5090
5089
  var L, O;
5091
5090
  const n = Z(), [c, g] = $(90), [l, x] = $(null), { data: o } = H({
5092
5091
  queryKey: ["flow-map", a, c],
@@ -5149,7 +5148,7 @@ function Rs({ templateId: a }) {
5149
5148
  "path",
5150
5149
  {
5151
5150
  d: y.path,
5152
- fill: y.f.back ? "#ef4444" : Ht,
5151
+ fill: y.f.back ? "#ef4444" : Vt,
5153
5152
  opacity: l === null ? y.f.back ? 0.45 : 0.3 : l === y.f ? 0.75 : 0.08,
5154
5153
  onMouseEnter: () => x(y.f),
5155
5154
  onMouseLeave: () => x(null)
@@ -5247,7 +5246,7 @@ function Rs({ templateId: a }) {
5247
5246
  ] })
5248
5247
  ] });
5249
5248
  }
5250
- function Ps({ templateId: a }) {
5249
+ function Ts({ templateId: a }) {
5251
5250
  const n = Z(), [c, g] = $(90), [l, x] = $(0), [o, r] = $(!1), [h, v] = $(!0), { data: u } = H({
5252
5251
  queryKey: ["pipeline-replay", a, c],
5253
5252
  queryFn: () => n.request(V(`/pipelines/${a}/replay`, { days: c })).then((w) => w.data),
@@ -5345,7 +5344,7 @@ function Ps({ templateId: a }) {
5345
5344
  }) }),
5346
5345
  /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
5347
5346
  /* @__PURE__ */ e(
5348
- T,
5347
+ P,
5349
5348
  {
5350
5349
  size: "sm",
5351
5350
  variant: "outline",
@@ -5377,13 +5376,13 @@ function Ps({ templateId: a }) {
5377
5376
  ] })
5378
5377
  ] });
5379
5378
  }
5380
- function Ts({ onClose: a }) {
5379
+ function As({ onClose: a }) {
5381
5380
  return xe(() => {
5382
5381
  const n = (c) => {
5383
5382
  c.key === "Escape" && a();
5384
5383
  };
5385
5384
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
5386
- }, [a]), ka(
5385
+ }, [a]), _a(
5387
5386
  /* @__PURE__ */ t("div", { className: "fixed inset-0 z-[120]", children: [
5388
5387
  /* @__PURE__ */ e(
5389
5388
  "button",
@@ -5409,17 +5408,17 @@ function Ts({ onClose: a }) {
5409
5408
  }
5410
5409
  )
5411
5410
  ] }),
5412
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(Ya, { compact: !0 }) })
5411
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(Ga, { compact: !0 }) })
5413
5412
  ] })
5414
5413
  ] }),
5415
5414
  document.body
5416
5415
  );
5417
5416
  }
5418
5417
  export {
5419
- bs as AiReviewCard,
5420
- Fs as OwnerGapsCard,
5421
- vn as PipelineEditorView,
5422
- Ss as PipelineSimulatorCard,
5423
- Ns as splitStartNote,
5424
- Yt as splitStartOptions
5418
+ ys as AiReviewCard,
5419
+ Es as OwnerGapsCard,
5420
+ wn as PipelineEditorView,
5421
+ qs as PipelineSimulatorCard,
5422
+ ws as splitStartNote,
5423
+ Gt as splitStartOptions
5425
5424
  };