@nivaro/react 0.3.33 → 0.3.34

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 (29) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +79 -5
  4. package/dist/index.js +338 -329
  5. package/dist/shared/components/ItemEditForm.js +5494 -5302
  6. package/dist/shared/components/ProfileView.js +46 -44
  7. package/dist/shared/components/ReportView.js +208 -205
  8. package/dist/shared/components/SearchHighlight.js +30 -0
  9. package/dist/shared/components/TipLayer.js +39 -37
  10. package/dist/shared/components/item-edit/CatalogPickerField.js +1484 -1232
  11. package/dist/shared/components/item-edit/FieldAffordances.js +370 -203
  12. package/dist/shared/components/item-edit/FieldRow.js +396 -354
  13. package/dist/shared/components/item-edit/PersonalDefaultPill.js +50 -0
  14. package/dist/shared/components/item-edit/RelationCombobox.js +42 -41
  15. package/dist/shared/components/item-edit/catalog-search.js +34 -0
  16. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +34 -34
  17. package/dist/shared/components/item-edit/personal-default-checks.js +134 -0
  18. package/dist/shared/components/item-edit/usePersonalDefaults.js +358 -0
  19. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +130 -111
  20. package/dist/shared/components/layout-editor/inspector/RulesTab.js +76 -75
  21. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  22. package/dist/shared/components/profile/MyDefaultsCard.js +667 -0
  23. package/dist/shared/components/profile/PersonProfile.js +42 -40
  24. package/dist/shared/components/profile/my-defaults-labels.js +76 -0
  25. package/dist/shared/components/profile/primitives.js +72 -67
  26. package/dist/shared/lib/personal-defaults.js +76 -0
  27. package/dist/shared/lib/request-gate.js +78 -76
  28. package/dist/shared/lib/search-text.js +111 -0
  29. package/package.json +1 -1
@@ -1,27 +1,30 @@
1
1
  import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { useQueryClient as Pe, useQueries as at, useQuery as ne, useMutation as it } from "@tanstack/react-query";
3
- import { Info as ot, Loader2 as st, Sparkles as dt, Lock as ct, SlidersHorizontal as ut, History as mt, BellRing as pt, Bell as ht, Sigma as xt } from "lucide-react";
4
- import { memo as ft, useState as fe, useRef as L, useId as yt, useEffect as re, useCallback as Ee } from "react";
2
+ import { useQueryClient as Ke, useQueries as pt, useQuery as ie, useMutation as ht } from "@tanstack/react-query";
3
+ import { Info as xt, Loader2 as ft, Sparkles as yt, Lock as bt, SlidersHorizontal as gt, MoreHorizontal as vt, History as wt, BellRing as kt, Bell as _t, Sigma as Nt } from "lucide-react";
4
+ import { memo as Ft, useState as be, useRef as R, useId as Ct, useEffect as ae, useCallback as Oe } from "react";
5
5
  import { toast as K } from "sonner";
6
- import { useParentDraft as bt, useNivaroClient as le } from "../../context.js";
7
- import { showsAiButton as gt, AUTOFILL_CHECK_KEY as vt, readAiFill as wt } from "../../lib/ai-fill.js";
8
- import { get as U, del as kt, post as xe } from "../../lib/commands.js";
9
- import { titleCase as he, cn as P } from "../../lib/utils.js";
10
- import { GlossaryLabel as je } from "../ai/GlossaryText.js";
11
- import { Label as _t } from "../ui/label.js";
12
- import { TooltipProvider as Z, Tooltip as I, TooltipTrigger as ee, TooltipContent as te } from "../ui/tooltip.js";
13
- import { useAddendumFields as Nt } from "./AddendumFieldContext.js";
14
- import { AutoIdPreviewField as Ft } from "./AutoIdPreviewField.js";
15
- import { useFieldAffordances as Ct, useFieldContextMenu as Lt, usePresenceSoftLock as Rt, LockReasonBadge as $t, PresenceSoftLockStrip as St, RemoteChangeGhost as Tt } from "./FieldAffordances.js";
16
- import { FieldRenderer as qt } from "./FieldRenderer.js";
17
- import { FormHelpVideoButton as At } from "./FormHelpVideoButton.js";
18
- import { getCascadeFilters as Et, SYSTEM_FIELDS as jt, parseJson as Pt, buildCascadeFilter as Dt, CascadeEffectController as Mt } from "./helpers.js";
19
- import { isDerivedForRecord as Ot } from "./live-rollups.js";
20
- import { useM2MStaging as Bt } from "./M2MStagingContext.js";
21
- import { usePlacementTextContext as Kt, placementFieldText as Ut, isDisplayFormulaRow as Ht, fieldCounterConfig as Wt, fieldIsRecommended as Vt, RecommendedMarker as zt, RepeatLastButton as Gt, DisplayFormulaValue as Qt, FieldCounter as Yt } from "./placement-behaviour.js";
22
- import { keepIfEqual as Jt, jsonEqual as Xt } from "./render-stability.js";
23
- import { resolveOptionFilterTokens as Zt } from "../../lib/option-filter-tokens.js";
24
- const It = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), en = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), tn = /* @__PURE__ */ new Set([
6
+ import { useParentDraft as Lt, useNivaroClient as oe } from "../../context.js";
7
+ import { showsAiButton as Rt, AUTOFILL_CHECK_KEY as St, readAiFill as $t } from "../../lib/ai-fill.js";
8
+ import { get as U, del as Tt, post as ye } from "../../lib/commands.js";
9
+ import { titleCase as fe, cn as A } from "../../lib/utils.js";
10
+ import { GlossaryLabel as De } from "../ai/GlossaryText.js";
11
+ import { Label as qt } from "../ui/label.js";
12
+ import { TooltipProvider as ee, Tooltip as te, TooltipTrigger as ne, TooltipContent as re } from "../ui/tooltip.js";
13
+ import { useAddendumFields as At } from "./AddendumFieldContext.js";
14
+ import { AutoIdPreviewField as Pt } from "./AutoIdPreviewField.js";
15
+ import { FOCUSABLE as Be } from "./entry/entry-keys.js";
16
+ import { useFieldAffordances as Et, useFieldContextMenu as jt, usePresenceSoftLock as Mt, LockReasonBadge as Ot, PresenceSoftLockStrip as Dt, RemoteChangeGhost as Bt } from "./FieldAffordances.js";
17
+ import { FieldRenderer as Ht } from "./FieldRenderer.js";
18
+ import { FormHelpVideoButton as Kt } from "./FormHelpVideoButton.js";
19
+ import { getCascadeFilters as Ut, SYSTEM_FIELDS as Wt, parseJson as zt, buildCascadeFilter as Vt, CascadeEffectController as Gt } from "./helpers.js";
20
+ import { isDerivedForRecord as Qt } from "./live-rollups.js";
21
+ import { useM2MStaging as Yt } from "./M2MStagingContext.js";
22
+ import { PersonalDefaultPill as Jt, PersonalDefaultHint as It } from "./PersonalDefaultPill.js";
23
+ import { isDisplayFormulaRow as He, usePlacementTextContext as Xt, placementFieldText as Zt, fieldCounterConfig as en, fieldIsRecommended as tn, RecommendedMarker as nn, RepeatLastButton as rn, DisplayFormulaValue as an, FieldCounter as on } from "./placement-behaviour.js";
24
+ import { keepIfEqual as ln, jsonEqual as sn } from "./render-stability.js";
25
+ import { usePersonalDefaultsApi as dn } from "./usePersonalDefaults.js";
26
+ import { resolveOptionFilterTokens as cn } from "../../lib/option-filter-tokens.js";
27
+ const un = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), mn = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), pn = /* @__PURE__ */ new Set([
25
28
  "input",
26
29
  "textarea",
27
30
  "wysiwyg",
@@ -29,7 +32,7 @@ const It = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
29
32
  "input-rich-text-html",
30
33
  "rich_text",
31
34
  "extension-editorjs"
32
- ]), nn = /* @__PURE__ */ new Set([
35
+ ]), hn = /* @__PURE__ */ new Set([
33
36
  "relation-m2o",
34
37
  "relation-m2m",
35
38
  "select-multiple-m2m",
@@ -40,101 +43,101 @@ const It = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
40
43
  "file",
41
44
  "files",
42
45
  "image"
43
- ]), rn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
44
- function ln(d) {
46
+ ]), xn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
47
+ function fn(d) {
45
48
  const e = d.interface ?? "";
46
- return nn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") ? !1 : !!(en.has(d.type ?? "") || tn.has(e) || !e && d.type && !It.has(d.type));
49
+ return hn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") ? !1 : !!(mn.has(d.type ?? "") || pn.has(e) || !e && d.type && !un.has(d.type));
47
50
  }
48
- function an(d, e, u, p) {
49
- const f = le();
50
- return ne({
51
- queryKey: ["field-lineage", d, e, u],
51
+ function yn(d, e, m, h) {
52
+ const f = oe();
53
+ return ie({
54
+ queryKey: ["field-lineage", d, e, m],
52
55
  queryFn: () => f.request(
53
- U(`/lineage/${d}/${encodeURIComponent(e)}/${u}`)
54
- ).then((o) => o.data),
55
- enabled: p,
56
+ U(`/lineage/${d}/${encodeURIComponent(e)}/${m}`)
57
+ ).then((l) => l.data),
58
+ enabled: h,
56
59
  staleTime: 3e4
57
60
  });
58
61
  }
59
- function En(d, e = "rows") {
60
- var l, N, b;
62
+ function Qn(d, e = "rows") {
63
+ var i, N, b;
61
64
  if (d && (d.kind === "write" || d.kind === "read") && d.formula) {
62
- const m = (y) => typeof y == "number" ? y.toLocaleString(void 0, { maximumFractionDigits: 2 }) : y == null || y === "" ? "∅" : String(y);
65
+ const u = (y) => typeof y == "number" ? y.toLocaleString(void 0, { maximumFractionDigits: 2 }) : y == null || y === "" ? "∅" : String(y);
63
66
  return `= ${d.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (y, a) => {
64
67
  var x;
65
- return m((x = d.inputs) == null ? void 0 : x[a]);
68
+ return u((x = d.inputs) == null ? void 0 : x[a]);
66
69
  }).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
67
70
  }
68
71
  if (!d || d.kind !== "rollup") return null;
69
- const u = (d.sources ?? []).reduce((m, i) => m + i.rows.length, 0), p = (d.sources ?? []).reduce((m, i) => {
72
+ const m = (d.sources ?? []).reduce((u, o) => u + o.rows.length, 0), h = (d.sources ?? []).reduce((u, o) => {
70
73
  var y;
71
- return m + (((y = i.excluded) == null ? void 0 : y.length) ?? 0);
72
- }, 0), f = (b = (N = (l = (d.sources ?? []).find((m) => {
73
- var i;
74
- return (i = m.excluded) == null ? void 0 : i.length;
75
- })) == null ? void 0 : l.excluded) == null ? void 0 : N[0]) == null ? void 0 : b.reason, o = [`= ${u} ${u === 1 ? e.replace(/s$/, "") : e}`];
76
- return p && o.push(
77
- `${p} excluded${f ? ` (${f.replace(/^does not match: /, "")})` : ""}`
78
- ), o.join(" · ");
74
+ return u + (((y = o.excluded) == null ? void 0 : y.length) ?? 0);
75
+ }, 0), f = (b = (N = (i = (d.sources ?? []).find((u) => {
76
+ var o;
77
+ return (o = u.excluded) == null ? void 0 : o.length;
78
+ })) == null ? void 0 : i.excluded) == null ? void 0 : N[0]) == null ? void 0 : b.reason, l = [`= ${m} ${m === 1 ? e.replace(/s$/, "") : e}`];
79
+ return h && l.push(
80
+ `${h} excluded${f ? ` (${f.replace(/^does not match: /, "")})` : ""}`
81
+ ), l.join(" · ");
79
82
  }
80
- function on({
83
+ function bn({
81
84
  collection: d,
82
85
  itemId: e,
83
- field: u
86
+ field: m
84
87
  }) {
85
- const [p, f] = fe(!1), o = L(null), { data: l, isLoading: N } = an(d, e, u, p);
86
- re(() => {
87
- if (!p) return;
88
- const i = (y) => {
88
+ const [h, f] = be(!1), l = R(null), { data: i, isLoading: N } = yn(d, e, m, h);
89
+ ae(() => {
90
+ if (!h) return;
91
+ const o = (y) => {
89
92
  var a;
90
- (a = o.current) != null && a.contains(y.target) || f(!1);
93
+ (a = l.current) != null && a.contains(y.target) || f(!1);
91
94
  };
92
- return window.addEventListener("mousedown", i), () => window.removeEventListener("mousedown", i);
93
- }, [p]);
94
- const b = (i) => i == null ? "—" : Number(i).toLocaleString(void 0, { maximumFractionDigits: 2 }), m = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
95
- return /* @__PURE__ */ c("div", { ref: o, className: "relative inline-flex", children: [
95
+ return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
96
+ }, [h]);
97
+ const b = (o) => o == null ? "—" : Number(o).toLocaleString(void 0, { maximumFractionDigits: 2 }), u = (i == null ? void 0 : i.stored_value) != null ? Number(i.stored_value) : null;
98
+ return /* @__PURE__ */ c("div", { ref: l, className: "relative inline-flex", children: [
96
99
  /* @__PURE__ */ n(
97
100
  "button",
98
101
  {
99
102
  type: "button",
100
- onClick: () => f((i) => !i),
103
+ onClick: () => f((o) => !o),
101
104
  title: "Where does this number come from?",
102
- className: P(
105
+ className: A(
103
106
  "inline-flex items-center rounded p-0.5 transition-opacity",
104
- p ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
107
+ h ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
105
108
  ),
106
109
  "data-field-lineage": !0,
107
- children: /* @__PURE__ */ n(xt, { className: "h-3 w-3" })
110
+ children: /* @__PURE__ */ n(Nt, { className: "h-3 w-3" })
108
111
  }
109
112
  ),
110
- p && /* @__PURE__ */ c("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
113
+ h && /* @__PURE__ */ c("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
111
114
  /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
112
115
  N && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
113
- (l == null ? void 0 : l.kind) === "write" && /* @__PURE__ */ c("div", { className: "space-y-1 px-1 py-1", children: [
114
- /* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: l.formula }),
115
- Object.entries(l.inputs ?? {}).map(([i, y]) => /* @__PURE__ */ c("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
116
- /* @__PURE__ */ n("span", { className: "font-mono", children: i }),
116
+ (i == null ? void 0 : i.kind) === "write" && /* @__PURE__ */ c("div", { className: "space-y-1 px-1 py-1", children: [
117
+ /* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: i.formula }),
118
+ Object.entries(i.inputs ?? {}).map(([o, y]) => /* @__PURE__ */ c("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
119
+ /* @__PURE__ */ n("span", { className: "font-mono", children: o }),
117
120
  " = ",
118
121
  b(y)
119
- ] }, i)),
122
+ ] }, o)),
120
123
  /* @__PURE__ */ c("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
121
124
  "= ",
122
- b(l.stored_value)
125
+ b(i.stored_value)
123
126
  ] })
124
127
  ] }),
125
- (l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((i, y) => {
128
+ (i == null ? void 0 : i.kind) === "rollup" && (i.sources ?? []).map((o, y) => {
126
129
  var a;
127
130
  return /* @__PURE__ */ c("div", { className: "mb-1.5", children: [
128
131
  /* @__PURE__ */ c("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
129
- (i.aggregate ?? "sum").toUpperCase(),
130
- i.value_field ? ` of ${i.value_field}` : "",
132
+ (o.aggregate ?? "sum").toUpperCase(),
133
+ o.value_field ? ` of ${o.value_field}` : "",
131
134
  " across ",
132
- i.collection,
133
- i.filtered ? " (filtered)" : ""
135
+ o.collection,
136
+ o.filtered ? " (filtered)" : ""
134
137
  ] }),
135
- i.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: i.error }),
136
- i.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: i.note }),
137
- i.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: i.rows.map((x) => /* @__PURE__ */ c(
138
+ o.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: o.error }),
139
+ o.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: o.note }),
140
+ o.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: o.rows.map((x) => /* @__PURE__ */ c(
138
141
  "div",
139
142
  {
140
143
  className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
@@ -153,19 +156,19 @@ function on({
153
156
  },
154
157
  x.id
155
158
  )) }),
156
- i.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
157
- i.subtotal != null && /* @__PURE__ */ c("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
159
+ o.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
160
+ o.subtotal != null && /* @__PURE__ */ c("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
158
161
  "subtotal ",
159
- b(i.subtotal)
162
+ b(o.subtotal)
160
163
  ] }),
161
- (((a = i.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ c("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
164
+ (((a = o.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ c("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
162
165
  /* @__PURE__ */ c("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
163
- i.excluded.length,
166
+ o.excluded.length,
164
167
  " excluded —",
165
168
  " ",
166
- i.excluded[0].reason.replace(/^does not match: /, "")
169
+ o.excluded[0].reason.replace(/^does not match: /, "")
167
170
  ] }),
168
- i.excluded.slice(0, 8).map((x) => /* @__PURE__ */ c(
171
+ o.excluded.slice(0, 8).map((x) => /* @__PURE__ */ c(
169
172
  "div",
170
173
  {
171
174
  className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
@@ -176,47 +179,47 @@ function on({
176
179
  },
177
180
  x.id
178
181
  )),
179
- i.excluded.length > 8 && /* @__PURE__ */ c("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
182
+ o.excluded.length > 8 && /* @__PURE__ */ c("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
180
183
  "+",
181
- i.excluded.length - 8,
184
+ o.excluded.length - 8,
182
185
  " more"
183
186
  ] })
184
187
  ] })
185
188
  ] }, y);
186
189
  }),
187
- (l == null ? void 0 : l.kind) === "rollup" && m != null && /* @__PURE__ */ c("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
190
+ (i == null ? void 0 : i.kind) === "rollup" && u != null && /* @__PURE__ */ c("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
188
191
  "stored ",
189
- b(m),
192
+ b(u),
190
193
  (() => {
191
- const i = (l.sources ?? []).reduce((a, x) => a + (x.subtotal ?? 0), 0);
192
- return (l.sources ?? []).some((a) => a.truncated) ? null : Math.abs(i - m) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
194
+ const o = (i.sources ?? []).reduce((a, x) => a + (x.subtotal ?? 0), 0);
195
+ return (i.sources ?? []).some((a) => a.truncated) ? null : Math.abs(o - u) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
193
196
  })()
194
197
  ] })
195
198
  ] })
196
199
  ] });
197
200
  }
198
- function sn({
201
+ function gn({
199
202
  collection: d,
200
203
  itemId: e,
201
- field: u,
202
- formatValue: p,
204
+ field: m,
205
+ formatValue: h,
203
206
  onRestore: f
204
207
  }) {
205
- const o = le(), [l, N] = fe(!1), b = L(null), { data: m, isLoading: i } = ne({
206
- queryKey: ["field-value-history", d, e, u],
207
- queryFn: () => o.request(U(`/field-history/${d}/${encodeURIComponent(e)}/${u}`)).then((a) => a.data ?? []),
208
- enabled: l,
208
+ const l = oe(), [i, N] = be(!1), b = R(null), { data: u, isLoading: o } = ie({
209
+ queryKey: ["field-value-history", d, e, m],
210
+ queryFn: () => l.request(U(`/field-history/${d}/${encodeURIComponent(e)}/${m}`)).then((a) => a.data ?? []),
211
+ enabled: i,
209
212
  staleTime: 6e4
210
213
  });
211
- re(() => {
212
- if (!l) return;
214
+ ae(() => {
215
+ if (!i) return;
213
216
  const a = (x) => {
214
- var H;
215
- (H = b.current) != null && H.contains(x.target) || N(!1);
217
+ var W;
218
+ (W = b.current) != null && W.contains(x.target) || N(!1);
216
219
  };
217
220
  return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
218
- }, [l]);
219
- const y = (a, x) => x || (a == null || a === "" ? "—" : p ? p(a) : typeof a == "boolean" || a === "true" || a === "false" ? a === !0 || a === "true" ? "Yes" : "No" : typeof a == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(a) ? new Date(a).toLocaleString() : typeof a == "object" ? JSON.stringify(a).slice(0, 60) : String(a).slice(0, 80));
221
+ }, [i]);
222
+ const y = (a, x) => x || (a == null || a === "" ? "—" : h ? h(a) : typeof a == "boolean" || a === "true" || a === "false" ? a === !0 || a === "true" ? "Yes" : "No" : typeof a == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(a) ? new Date(a).toLocaleString() : typeof a == "object" ? JSON.stringify(a).slice(0, 60) : String(a).slice(0, 80));
220
223
  return /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex", children: [
221
224
  /* @__PURE__ */ n(
222
225
  "button",
@@ -224,17 +227,17 @@ function sn({
224
227
  type: "button",
225
228
  onClick: () => N((a) => !a),
226
229
  title: "Value history",
227
- className: P(
230
+ className: A(
228
231
  "inline-flex items-center rounded p-0.5 transition-opacity",
229
- l ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
232
+ i ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
230
233
  ),
231
234
  "data-field-history": !0,
232
- children: /* @__PURE__ */ n(mt, { className: "h-3 w-3" })
235
+ children: /* @__PURE__ */ n(wt, { className: "h-3 w-3" })
233
236
  }
234
237
  ),
235
- l && /* @__PURE__ */ c("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
238
+ i && /* @__PURE__ */ c("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
236
239
  /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
237
- i ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (m ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (m ?? []).map((a, x) => /* @__PURE__ */ c(
240
+ o ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (u ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (u ?? []).map((a, x) => /* @__PURE__ */ c(
238
241
  "div",
239
242
  {
240
243
  className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
@@ -277,209 +280,214 @@ function sn({
277
280
  ] })
278
281
  ] });
279
282
  }
280
- function dn({
283
+ function vn({
281
284
  collection: d,
282
285
  itemId: e,
283
- field: u
286
+ field: m
284
287
  }) {
285
- const p = le(), f = Pe(), { data: o } = ne({
288
+ const h = oe(), f = Ke(), { data: l } = ie({
286
289
  queryKey: ["field-watch-config"],
287
- queryFn: () => p.request(U("/field-watches/config")).then((i) => i.data).catch(() => ({ enabled: !1 })),
290
+ queryFn: () => h.request(U("/field-watches/config")).then((o) => o.data).catch(() => ({ enabled: !1 })),
288
291
  staleTime: 5 * 6e4
289
- }), l = ["field-watch-self", d, e], { data: N = [] } = ne({
290
- queryKey: l,
291
- queryFn: () => p.request(U("/field-watches/self", { collection: d, item_id: e })).then((i) => i.data ?? []).catch(() => []),
292
- enabled: !!(o != null && o.enabled),
292
+ }), i = ["field-watch-self", d, e], { data: N = [] } = ie({
293
+ queryKey: i,
294
+ queryFn: () => h.request(U("/field-watches/self", { collection: d, item_id: e })).then((o) => o.data ?? []).catch(() => []),
295
+ enabled: !!(l != null && l.enabled),
293
296
  staleTime: 6e4
294
- }), b = N.includes(u), m = it({
295
- mutationFn: () => b ? p.request(
296
- kt(
297
- `/field-watches/self?collection=${encodeURIComponent(d)}&field=${encodeURIComponent(u)}&item_id=${encodeURIComponent(e)}`
297
+ }), b = N.includes(m), u = ht({
298
+ mutationFn: () => b ? h.request(
299
+ Tt(
300
+ `/field-watches/self?collection=${encodeURIComponent(d)}&field=${encodeURIComponent(m)}&item_id=${encodeURIComponent(e)}`
298
301
  )
299
- ) : p.request(xe("/field-watches/self", { collection: d, field: u, item_id: e })),
302
+ ) : h.request(ye("/field-watches/self", { collection: d, field: m, item_id: e })),
300
303
  onSuccess: () => {
301
- f.invalidateQueries({ queryKey: l }), K.success(
304
+ f.invalidateQueries({ queryKey: i }), K.success(
302
305
  b ? "No longer watching this field" : "Watching — you will be notified when it changes"
303
306
  );
304
307
  },
305
308
  onError: () => K.error("Could not update the watch")
306
309
  });
307
- return o != null && o.enabled ? /* @__PURE__ */ n(
310
+ return l != null && l.enabled ? /* @__PURE__ */ n(
308
311
  "button",
309
312
  {
310
313
  type: "button",
311
- onClick: () => m.mutate(),
314
+ onClick: () => u.mutate(),
312
315
  title: b ? "Stop watching this field on this record" : "Watch this field on this record",
313
- "data-field-watch": u,
316
+ "data-field-watch": m,
314
317
  className: `rounded p-0.5 transition-colors ${b ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
315
- children: b ? /* @__PURE__ */ n(pt, { className: "h-3 w-3" }) : /* @__PURE__ */ n(ht, { className: "h-3 w-3" })
318
+ children: b ? /* @__PURE__ */ n(kt, { className: "h-3 w-3" }) : /* @__PURE__ */ n(_t, { className: "h-3 w-3" })
316
319
  }
317
320
  ) : null;
318
321
  }
319
- function cn(d) {
322
+ function wn(d) {
320
323
  return d ? d.querySelector(
321
324
  'input:not([type=hidden]), textarea, [role="combobox"], [contenteditable="true"]'
322
325
  ) ?? d.querySelector("button") : null;
323
326
  }
324
- const jn = ft(function({
327
+ const Yn = Ft(function({
325
328
  field: e,
326
- draft: u,
327
- onChange: p,
329
+ draft: m,
330
+ onChange: h,
328
331
  relations: f,
329
- collection: o,
330
- itemId: l,
332
+ collection: l,
333
+ itemId: i,
331
334
  error: N,
332
335
  visible: b,
333
- locked: m,
334
- layoutAiEnabled: i,
336
+ locked: u,
337
+ layoutAiEnabled: o,
335
338
  renderField: y,
336
339
  onCountChange: a,
337
340
  swapButton: x,
338
- swapContent: H,
339
- forceVisible: De,
340
- autoFillTick: ae
341
+ swapContent: W,
342
+ forceVisible: Ue,
343
+ autoFillTick: le
341
344
  }) {
342
- var Te, qe, Ae;
343
- const W = rn.has(e.interface ?? ""), C = bt(), g = Bt(), ye = Pe(), ie = le(), [be, V] = fe(!1), s = Ct(), oe = L(null), z = yt(), ge = L(null), ve = L(!1);
344
- re(() => {
345
- const t = ve.current ? cn(ge.current) : null;
345
+ var Ee, je, Me;
346
+ const z = xn.has(e.interface ?? ""), C = Lt(), g = Yt(), ge = Ke(), se = oe(), [ve, V] = be(!1), s = Et(), G = R(null), Q = Ct(), de = R(null), we = R(!1);
347
+ ae(() => {
348
+ const t = we.current ? wn(de.current) : null;
346
349
  if (!t || t.hasAttribute("aria-label")) return;
347
- t.id || (t.id = `${z}-control`);
348
- const r = t.tagName === "BUTTON" ? `${z} ${t.id}` : z;
350
+ t.id || (t.id = `${Q}-control`);
351
+ const r = t.tagName === "BUTTON" ? `${Q} ${t.id}` : Q;
349
352
  t.getAttribute("aria-labelledby") !== r && t.setAttribute("aria-labelledby", r);
350
353
  });
351
- const we = m && !W, ke = L(null);
352
- re(() => {
353
- const t = ke.current;
354
+ const ke = u && !z, _e = R(null);
355
+ ae(() => {
356
+ const t = _e.current;
354
357
  if (!t) return;
355
- if (!we) {
358
+ if (!ke) {
356
359
  t.removeAttribute("inert");
357
360
  return;
358
361
  }
359
362
  const r = typeof document < "u" ? document.activeElement : null;
360
363
  r instanceof HTMLElement && t.contains(r) && r.blur(), t.setAttribute("inert", "");
361
- }, [we, ae]);
362
- const G = e.field, _e = Ee(
364
+ }, [ke, le]);
365
+ const Y = e.field, Ne = Oe(
363
366
  (t) => {
364
- m || p(G, t);
367
+ u || h(Y, t);
365
368
  },
366
- [m, p, G]
367
- ), Me = Ee(
368
- (t) => a == null ? void 0 : a(G, t),
369
- [a, G]
370
- ), Oe = L(void 0), Ne = L(void 0), Fe = L(void 0), {
371
- onContextMenu: Be,
372
- onKeyDown: Ke,
373
- menu: Ue
374
- } = Lt({
375
- wrapperRef: oe,
369
+ [u, h, Y]
370
+ ), We = Oe(
371
+ (t) => a == null ? void 0 : a(Y, t),
372
+ [a, Y]
373
+ ), ze = R(void 0), Fe = R(void 0), Ce = R(void 0), {
374
+ onContextMenu: Ve,
375
+ onKeyDown: Ge,
376
+ menu: Qe,
377
+ openFrom: Ye,
378
+ isOpen: Le,
379
+ hasFieldItems: Je
380
+ } = jt({
381
+ wrapperRef: G,
376
382
  field: e,
377
- value: u[e.field],
383
+ value: m[e.field],
378
384
  relations: f,
379
- collection: o,
380
- itemId: l,
381
- openRelated: s == null ? void 0 : s.openRelated
382
- }), q = Rt(oe), He = Kt(), Ce = s == null ? void 0 : s.remoteChanges[e.field], D = s == null ? void 0 : s.lockReasons[e.field], $ = s == null ? void 0 : s.applyToLines[e.field], Q = gt(e._overrides, i, ln(e)), se = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[vt] === !0;
383
- async function We() {
385
+ collection: l,
386
+ itemId: i,
387
+ openRelated: s == null ? void 0 : s.openRelated,
388
+ // Only a field the person can edit here may carry a personal default.
389
+ editable: !u && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !He(e)
390
+ }), P = Mt(G), Ie = Xt(), Re = s == null ? void 0 : s.remoteChanges[e.field], O = s == null ? void 0 : s.lockReasons[e.field], T = s == null ? void 0 : s.applyToLines[e.field], L = dn(), Se = (L == null ? void 0 : L.applied(e.field)) ?? !1, $e = (L == null ? void 0 : L.hintFor(e.field)) ?? null, J = Rt(e._overrides, o, fn(e)), ce = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[St] === !0;
391
+ async function Xe() {
384
392
  var t;
385
- if (Q.perField) return Ve();
393
+ if (J.perField) return Ze();
386
394
  V(!0);
387
395
  try {
388
- const r = await ie.request(
389
- xe("/ai/generate", {
390
- collection: o,
391
- item_id: l !== "new" ? l : void 0,
396
+ const r = await se.request(
397
+ ye("/ai/generate", {
398
+ collection: l,
399
+ item_id: i !== "new" ? i : void 0,
392
400
  field: e.field
393
401
  })
394
402
  );
395
- ((t = r.data) == null ? void 0 : t.value) != null && p(e.field, r.data.value);
403
+ ((t = r.data) == null ? void 0 : t.value) != null && h(e.field, r.data.value);
396
404
  } catch {
397
405
  } finally {
398
406
  V(!1);
399
407
  }
400
408
  }
401
- async function Ve() {
402
- var r, h, k, j, T, F;
409
+ async function Ze() {
410
+ var r, p, k, M, q, F;
403
411
  const t = {};
404
- for (const v of ((r = wt(e._overrides)) == null ? void 0 : r.tokens) ?? []) v in u && (t[v] = u[v]);
412
+ for (const v of ((r = $t(e._overrides)) == null ? void 0 : r.tokens) ?? []) v in m && (t[v] = m[v]);
405
413
  V(!0);
406
414
  try {
407
- const v = await ie.request(
408
- xe("/ai/field-fill", {
409
- collection: o,
415
+ const v = await se.request(
416
+ ye("/ai/field-fill", {
417
+ collection: l,
410
418
  layout_id: (s == null ? void 0 : s.layoutId) ?? null,
411
419
  field: e.field,
412
- item_id: l && l !== "new" ? l : null,
420
+ item_id: i && i !== "new" ? i : null,
413
421
  values: t
414
422
  })
415
- ), _ = (h = v.data) == null ? void 0 : h.value;
416
- typeof _ == "string" && _ !== "" ? p(e.field, _) : K.info("The AI had nothing to write here"), (j = (k = v.data) == null ? void 0 : k.missing) != null && j.length && K.info(`Filled without ${v.data.missing.join(", ")} (empty or not visible to you)`);
423
+ ), _ = (p = v.data) == null ? void 0 : p.value;
424
+ typeof _ == "string" && _ !== "" ? h(e.field, _) : K.info("The AI had nothing to write here"), (M = (k = v.data) == null ? void 0 : k.missing) != null && M.length && K.info(`Filled without ${v.data.missing.join(", ")} (empty or not visible to you)`);
417
425
  } catch (v) {
418
426
  const _ = v;
419
- K.error(((F = (T = _ == null ? void 0 : _.response) == null ? void 0 : T.data) == null ? void 0 : F.error) ?? (_ == null ? void 0 : _.message) ?? "AI fill failed");
427
+ K.error(((F = (q = _ == null ? void 0 : _.response) == null ? void 0 : q.data) == null ? void 0 : F.error) ?? (_ == null ? void 0 : _.message) ?? "AI fill failed");
420
428
  } finally {
421
429
  V(!1);
422
430
  }
423
431
  }
424
- const A = Et(e.dependency_config), Le = A.flatMap((t) => {
432
+ const E = Ut(e.dependency_config), Te = E.flatMap((t) => {
425
433
  const r = f.find(
426
- (k) => k.one_collection === o && k.one_field === t.parent_field
434
+ (k) => k.one_collection === l && k.one_field === t.parent_field
427
435
  );
428
436
  if (!r) return [];
429
437
  if (r.junction_field) return [{ rule: t, rel: r }];
430
- const h = f.find(
438
+ const p = f.find(
431
439
  (k) => k.many_collection === r.many_collection && k.id !== r.id
432
440
  );
433
- return h != null && h.many_field ? [{ rule: t, rel: { ...r, junction_field: h.many_field } }] : [];
434
- }), ze = at({
435
- queries: Le.map(({ rel: t }) => ({
436
- queryKey: ["m2m-items", t.many_collection, t.many_field, l],
437
- queryFn: () => ie.request(
441
+ return p != null && p.many_field ? [{ rule: t, rel: { ...r, junction_field: p.many_field } }] : [];
442
+ }), et = pt({
443
+ queries: Te.map(({ rel: t }) => ({
444
+ queryKey: ["m2m-items", t.many_collection, t.many_field, i],
445
+ queryFn: () => se.request(
438
446
  U(`/items/${t.many_collection}`, {
439
- filter: JSON.stringify({ [t.many_field]: { _eq: l } }),
447
+ filter: JSON.stringify({ [t.many_field]: { _eq: i } }),
440
448
  limit: 200,
441
449
  fields: `id,${t.junction_field}`
442
450
  })
443
451
  ).then((r) => r.data ?? []),
444
- enabled: !!l && l !== "new",
452
+ enabled: !!i && i !== "new",
445
453
  staleTime: 3e4
446
454
  }))
447
- }), Ge = Object.fromEntries(
448
- Le.map(({ rule: t, rel: r }, h) => {
449
- var T;
450
- const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`, j = (g == null ? void 0 : g.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
455
+ }), tt = Object.fromEntries(
456
+ Te.map(({ rule: t, rel: r }, p) => {
457
+ var q;
458
+ const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`, M = (g == null ? void 0 : g.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
451
459
  return [
452
460
  t.parent_field,
453
- (((T = ze[h]) == null ? void 0 : T.data) ?? []).filter((F) => !j.has(F.id)).map((F) => F[r.junction_field])
461
+ (((q = et[p]) == null ? void 0 : q.data) ?? []).filter((F) => !M.has(F.id)).map((F) => F[r.junction_field])
454
462
  ];
455
463
  })
456
- ), Y = Nt()[e.field] ?? [];
457
- if (!De && (!b || !e.layout_assigned && (e.hidden || jt.has(e.field))))
464
+ ), I = At()[e.field] ?? [];
465
+ if (!Ue && (!b || !e.layout_assigned && (e.hidden || Wt.has(e.field))))
458
466
  return null;
459
- const de = u[e.field] ?? null, J = Ut(e, He), S = J.label ?? he(e.field);
460
- ve.current = S !== "";
461
- const E = Ht(e), Re = E ? null : Wt(e), Qe = !E && !m && !e.readonly && ((Te = e._overrides) == null ? void 0 : Te.repeat_last) === !0, Ye = Ot(e, u), Je = (Ae = (qe = Pt(e.options)) == null ? void 0 : qe.auto_id) == null ? void 0 : Ae.pattern, w = (() => {
467
+ const ue = m[e.field] ?? null, X = Zt(e, Ie), S = X.label ?? fe(e.field);
468
+ we.current = S !== "";
469
+ const j = He(e), qe = j ? null : en(e), nt = !j && !u && !e.readonly && ((Ee = e._overrides) == null ? void 0 : Ee.repeat_last) === !0, rt = Qt(e, m), it = (Me = (je = zt(e.options)) == null ? void 0 : je.auto_id) == null ? void 0 : Me.pattern, w = (() => {
462
470
  const t = f.find(
463
- (h) => h.one_collection === o && h.one_field === e.field
471
+ (p) => p.one_collection === l && p.one_field === e.field
464
472
  );
465
473
  if (!t) return null;
466
474
  if (t.junction_field) return t;
467
475
  const r = f.find(
468
- (h) => h.many_collection === t.many_collection && h.id !== t.id
476
+ (p) => p.many_collection === t.many_collection && p.id !== t.id
469
477
  );
470
478
  return r ? { ...t, junction_field: r.many_field } : null;
471
- })(), ce = w ? null : f.find((t) => t.many_collection === o && t.many_field === e.field) ?? null, ue = w ? f.find(
479
+ })(), me = w ? null : f.find((t) => t.many_collection === l && t.many_field === e.field) ?? null, pe = w ? f.find(
472
480
  (t) => t.many_collection === w.many_collection && t.many_field === w.junction_field && t.id !== w.id
473
- ) ?? null : null, M = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, $e = M ? (g == null ? void 0 : g.getStagedLinks(M)) ?? [] : [], Xe = w ? (ye.getQueryData([
481
+ ) ?? null : null, D = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, Ae = D ? (g == null ? void 0 : g.getStagedLinks(D)) ?? [] : [], at = w ? (ge.getQueryData([
474
482
  "m2m-items",
475
483
  w.many_collection,
476
484
  w.many_field,
477
- l
478
- ]) ?? []).map((t) => t[w.junction_field]) : [], Ze = w ? $e[0] ?? Xe[0] ?? null : de, Ie = (ue == null ? void 0 : ue.one_collection) ?? (ce == null ? void 0 : ce.one_collection) ?? void 0, X = (t) => {
485
+ i
486
+ ]) ?? []).map((t) => t[w.junction_field]) : [], ot = w ? Ae[0] ?? at[0] ?? null : ue, lt = (pe == null ? void 0 : pe.one_collection) ?? (me == null ? void 0 : me.one_collection) ?? void 0, Z = (t) => {
479
487
  var r;
480
- return ((C == null ? void 0 : C.collection) === o ? (r = C == null ? void 0 : C.fieldLabels) == null ? void 0 : r[t] : void 0) ?? he(String(t));
481
- }, R = Dt({
482
- rules: A,
488
+ return ((C == null ? void 0 : C.collection) === l ? (r = C == null ? void 0 : C.fieldLabels) == null ? void 0 : r[t] : void 0) ?? fe(String(t));
489
+ }, $ = Vt({
490
+ rules: E,
483
491
  // A parent whose value THIS field's own pick derived must not narrow this
484
492
  // field's options — otherwise picking a region locks the region picker
485
493
  // into the zone the pick itself filled, and cross-zone changes read as
@@ -489,44 +497,44 @@ const jn = ft(function({
489
497
  return ((r = g == null ? void 0 : g.getDerivedOrigin) == null ? void 0 : r.call(g, t)) === e.field;
490
498
  },
491
499
  parentValue: (t) => {
492
- if (u[t] != null) return u[t];
493
- const r = f.find((v) => v.one_collection === o && v.one_field === t);
500
+ if (m[t] != null) return m[t];
501
+ const r = f.find((v) => v.one_collection === l && v.one_field === t);
494
502
  if (!r) return null;
495
- let h = r;
496
- if (!h.junction_field) {
503
+ let p = r;
504
+ if (!p.junction_field) {
497
505
  const v = f.find(
498
506
  (_) => _.many_collection === r.many_collection && _.id !== r.id
499
507
  );
500
- if (v != null && v.many_field) h = { ...r, junction_field: v.many_field };
508
+ if (v != null && v.many_field) p = { ...r, junction_field: v.many_field };
501
509
  else return null;
502
510
  }
503
- const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, j = (g == null ? void 0 : g.getStagedLinks(k)) ?? [], T = Ge[t] ?? [], F = [...new Set([...j, ...T].map((v) => String(v)))];
511
+ const k = p.one_field ?? `${p.many_collection}.${p.junction_field}`, M = (g == null ? void 0 : g.getStagedLinks(k)) ?? [], q = tt[t] ?? [], F = [...new Set([...M, ...q].map((v) => String(v)))];
504
512
  return F.length === 0 ? null : F.length === 1 ? F[0] : F;
505
513
  },
506
514
  parentOptionFilter: (t) => {
507
- var h;
508
- const r = (C == null ? void 0 : C.collection) === o ? (h = C.fieldOptionFilters) == null ? void 0 : h[t] : void 0;
509
- return r ? Zt(r, u, l) : void 0;
515
+ var p;
516
+ const r = (C == null ? void 0 : C.collection) === l ? (p = C.fieldOptionFilters) == null ? void 0 : p[t] : void 0;
517
+ return r ? cn(r, m, i) : void 0;
510
518
  }
511
- }), O = R.filter ? Jt(Oe, R.filter, Xt) : R.filter, B = R.satisfiedParents.map(X), me = R.satisfiedParents, et = R.unsatisfiedParents.length ? X(R.unsatisfiedParents[0]) : null, pe = R.missingRequiredParents, Se = pe.length ? X(pe[0]) : null;
512
- function tt() {
513
- const t = Fe.current;
519
+ }), B = $.filter ? ln(ze, $.filter, sn) : $.filter, H = $.satisfiedParents.map(Z), he = $.satisfiedParents, st = $.unsatisfiedParents.length ? Z($.unsatisfiedParents[0]) : null, xe = $.missingRequiredParents, Pe = xe.length ? Z(xe[0]) : null;
520
+ function dt() {
521
+ const t = Ce.current;
514
522
  if (t && t.src === e) return t.value;
515
523
  const r = { ...e, readonly: !0 };
516
- return Fe.current = { src: e, value: r }, r;
524
+ return Ce.current = { src: e, value: r }, r;
517
525
  }
518
- function nt() {
519
- const t = JSON.stringify([B, me]), r = Ne.current;
520
- if (r && r.sig === t && r.onChange === p) return r.value;
521
- const h = {
522
- labels: B,
523
- keys: me,
524
- onClear: (k) => p(k, null)
526
+ function ct() {
527
+ const t = JSON.stringify([H, he]), r = Fe.current;
528
+ if (r && r.sig === t && r.onChange === h) return r.value;
529
+ const p = {
530
+ labels: H,
531
+ keys: he,
532
+ onClear: (k) => h(k, null)
525
533
  };
526
- return Ne.current = { sig: t, onChange: p, value: h }, h;
534
+ return Fe.current = { sig: t, onChange: h, value: p }, p;
527
535
  }
528
- function rt() {
529
- for (const t of me) {
536
+ function ut() {
537
+ for (const t of he) {
530
538
  const r = document.querySelector(`[data-field="${t}"]`);
531
539
  r && (r.scrollIntoView({ behavior: "smooth", block: "center" }), r.style.transition = "box-shadow 0.15s ease", r.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", r.style.borderRadius = "12px", setTimeout(() => {
532
540
  r.style.boxShadow = "none", setTimeout(() => {
@@ -535,96 +543,96 @@ const jn = ft(function({
535
543
  }, 900));
536
544
  }
537
545
  }
538
- const lt = () => {
539
- if (w && M) {
540
- for (const r of $e) g == null || g.unstageLink(M, r);
541
- const t = ye.getQueryData([
546
+ const mt = () => {
547
+ if (w && D) {
548
+ for (const r of Ae) g == null || g.unstageLink(D, r);
549
+ const t = ge.getQueryData([
542
550
  "m2m-items",
543
551
  w.many_collection,
544
552
  w.many_field,
545
- l
553
+ i
546
554
  ]) ?? [];
547
- for (const r of t) g == null || g.stageUnlink(M, r.id);
555
+ for (const r of t) g == null || g.stageUnlink(D, r.id);
548
556
  } else
549
- p(e.field, null);
557
+ h(e.field, null);
550
558
  };
551
559
  return (
552
560
  // biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only hosts the field context menu (right-click / Shift+F10); the inputs inside stay the controls
553
561
  /* @__PURE__ */ c(
554
562
  "div",
555
563
  {
556
- ref: oe,
564
+ ref: G,
557
565
  "data-field": e.field,
558
- "data-field-collection": o,
566
+ "data-field-collection": l,
559
567
  "data-field-interface": e.interface ?? void 0,
560
- "data-autofill-check": se ? "" : void 0,
561
- className: P(
568
+ "data-autofill-check": ce ? "" : void 0,
569
+ className: A(
562
570
  "group/fieldrow space-y-1.5",
563
- se && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
571
+ ce && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
564
572
  ),
565
- onContextMenu: Be,
566
- onKeyDown: Ke,
567
- onFocusCapture: q.onFocusCapture,
573
+ onContextMenu: Ve,
574
+ onKeyDown: Ge,
575
+ onFocusCapture: P.onFocusCapture,
568
576
  children: [
569
- Ue,
570
- A.length > 0 && /* @__PURE__ */ n(
571
- Mt,
577
+ Qe,
578
+ E.length > 0 && /* @__PURE__ */ n(
579
+ Gt,
572
580
  {
573
- cascadeRules: A,
574
- cascadeFilter: O,
575
- currentValue: Ze,
576
- relatedCollection: Ie,
577
- missingRequiredParents: pe,
578
- onClear: lt
581
+ cascadeRules: E,
582
+ cascadeFilter: B,
583
+ currentValue: ot,
584
+ relatedCollection: lt,
585
+ missingRequiredParents: xe,
586
+ onClear: mt
579
587
  }
580
588
  ),
581
- (S !== "" || Y.length > 0) && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]", children: [
582
- S !== "" && /* @__PURE__ */ c(_t, { id: z, "data-field-label": !0, className: "text-sm font-medium", children: [
583
- /* @__PURE__ */ n(je, { text: S, collection: o }),
589
+ (S !== "" || I.length > 0) && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]", children: [
590
+ S !== "" && /* @__PURE__ */ c(qt, { id: Q, "data-field-label": !0, className: "text-sm font-medium", children: [
591
+ /* @__PURE__ */ n(De, { text: S, collection: l }),
584
592
  e.required && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
585
- Vt(e) && /* @__PURE__ */ n(zt, {})
593
+ tn(e) && /* @__PURE__ */ n(nn, {})
586
594
  ] }),
587
- J.note && /* @__PURE__ */ n(Z, { delayDuration: 100, children: /* @__PURE__ */ c(I, { children: [
588
- /* @__PURE__ */ n(ee, { asChild: !0, children: /* @__PURE__ */ n(ot, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
589
- /* @__PURE__ */ n(te, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? J.note : /* @__PURE__ */ n(je, { text: J.note, collection: o }) })
595
+ X.note && /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ c(te, { children: [
596
+ /* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(xt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
597
+ /* @__PURE__ */ n(re, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? X.note : /* @__PURE__ */ n(De, { text: X.note, collection: l }) })
590
598
  ] }) }),
591
- !E && l && l !== "new" && /* @__PURE__ */ n(
592
- sn,
599
+ !j && i && i !== "new" && /* @__PURE__ */ n(
600
+ gn,
593
601
  {
594
- collection: o,
595
- itemId: l,
602
+ collection: l,
603
+ itemId: i,
596
604
  field: e.field,
597
- onRestore: e.readonly ? void 0 : (t) => p(e.field, t)
605
+ onRestore: e.readonly ? void 0 : (t) => h(e.field, t)
598
606
  }
599
607
  ),
600
- !E && l && l !== "new" && /* @__PURE__ */ n(dn, { collection: o, itemId: l, field: e.field }),
601
- l && l !== "new" && Ye && /* @__PURE__ */ n(on, { collection: o, itemId: l, field: e.field }),
602
- Qe && /* @__PURE__ */ n(
603
- Gt,
608
+ !j && i && i !== "new" && /* @__PURE__ */ n(vn, { collection: l, itemId: i, field: e.field }),
609
+ i && i !== "new" && rt && /* @__PURE__ */ n(bn, { collection: l, itemId: i, field: e.field }),
610
+ nt && /* @__PURE__ */ n(
611
+ rn,
604
612
  {
605
- collection: o,
606
- itemId: l,
613
+ collection: l,
614
+ itemId: i,
607
615
  field: e.field,
608
- label: S || he(e.field),
609
- onFill: (t) => p(e.field, t)
616
+ label: S || fe(e.field),
617
+ onFill: (t) => h(e.field, t)
610
618
  }
611
619
  ),
612
- !E && Q.show && !(Q.perField && (m || e.readonly)) && /* @__PURE__ */ c(
620
+ !j && J.show && !(J.perField && (u || e.readonly)) && /* @__PURE__ */ c(
613
621
  "button",
614
622
  {
615
623
  type: "button",
616
- onClick: We,
617
- disabled: be,
618
- "data-ai-fill": Q.perField ? e.field : void 0,
624
+ onClick: Xe,
625
+ disabled: ve,
626
+ "data-ai-fill": J.perField ? e.field : void 0,
619
627
  className: "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 disabled:opacity-50 transition-colors",
620
628
  title: "Generate with AI",
621
629
  children: [
622
- be ? /* @__PURE__ */ n(st, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(dt, { className: "h-3 w-3" }),
630
+ ve ? /* @__PURE__ */ n(ft, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(yt, { className: "h-3 w-3" }),
623
631
  "AI"
624
632
  ]
625
633
  }
626
634
  ),
627
- se && /* @__PURE__ */ n(
635
+ ce && /* @__PURE__ */ n(
628
636
  "span",
629
637
  {
630
638
  "data-tip": "People often change what the AI read from the document here — check it",
@@ -632,34 +640,48 @@ const jn = ft(function({
632
640
  children: "Check this"
633
641
  }
634
642
  ),
643
+ Se && /* @__PURE__ */ n(
644
+ Jt,
645
+ {
646
+ field: e.field,
647
+ label: S,
648
+ onUndo: () => {
649
+ L == null || L.undo(e.field), requestAnimationFrame(() => {
650
+ var r, p;
651
+ const t = ((r = de.current) == null ? void 0 : r.querySelector(Be)) ?? ((p = G.current) == null ? void 0 : p.querySelector(Be));
652
+ t == null || t.focus();
653
+ });
654
+ }
655
+ }
656
+ ),
635
657
  x,
636
- $ && !m && !e.readonly && /* @__PURE__ */ c(
658
+ T && !u && !e.readonly && /* @__PURE__ */ c(
637
659
  "button",
638
660
  {
639
661
  type: "button",
640
- onClick: () => $.onApply(u[e.field] ?? null),
641
- disabled: u[e.field] == null || u[e.field] === "" || $.count === 0,
662
+ onClick: () => T.onApply(m[e.field] ?? null),
663
+ disabled: m[e.field] == null || m[e.field] === "" || T.count === 0,
642
664
  "data-apply-to-lines": e.field,
643
- "data-tip": $.count === 0 ? "No lines yet — add lines first" : u[e.field] == null || u[e.field] === "" ? "Pick a value first" : $.count != null ? `Copy this value onto all ${$.count} lines (staged until you save)` : "Copy this value onto every line (staged until you save)",
665
+ "data-tip": T.count === 0 ? "No lines yet — add lines first" : m[e.field] == null || m[e.field] === "" ? "Pick a value first" : T.count != null ? `Copy this value onto all ${T.count} lines (staged until you save)` : "Copy this value onto every line (staged until you save)",
644
666
  className: "inline-flex items-center gap-1 rounded border border-nvr-cyan/40 px-1.5 py-0.5 text-[10.5px] font-medium text-[#0e7490] transition-colors hover:bg-nvr-cyan/10 disabled:cursor-not-allowed disabled:opacity-40 dark:text-nvr-cyan",
645
667
  children: [
646
- $.label ?? "Apply to lines",
668
+ T.label ?? "Apply to lines",
647
669
  " ↓"
648
670
  ]
649
671
  }
650
672
  ),
651
- Y.length > 0 && /* @__PURE__ */ n(Z, { delayDuration: 100, children: /* @__PURE__ */ c(I, { children: [
652
- /* @__PURE__ */ n(ee, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
673
+ I.length > 0 && /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ c(te, { children: [
674
+ /* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
653
675
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
654
676
  "addendum"
655
677
  ] }) }),
656
- /* @__PURE__ */ c(te, { side: "top", className: "max-w-[220px] text-[12px]", children: [
678
+ /* @__PURE__ */ c(re, { side: "top", className: "max-w-[220px] text-[12px]", children: [
657
679
  /* @__PURE__ */ c("p", { className: "font-medium mb-1", children: [
658
680
  "In active addendum",
659
- Y.length > 1 ? "s" : "",
681
+ I.length > 1 ? "s" : "",
660
682
  ":"
661
683
  ] }),
662
- Y.map((t) => /* @__PURE__ */ c("p", { className: "text-slate-400", children: [
684
+ I.map((t) => /* @__PURE__ */ c("p", { className: "text-slate-400", children: [
663
685
  t.title,
664
686
  " ",
665
687
  /* @__PURE__ */ c("span", { className: "capitalize", children: [
@@ -671,116 +693,136 @@ const jn = ft(function({
671
693
  ] })
672
694
  ] }) }),
673
695
  /* @__PURE__ */ n(
674
- At,
696
+ Kt,
675
697
  {
676
- collection: o,
698
+ collection: l,
677
699
  kind: "field",
678
700
  name: e.field,
679
701
  label: S
680
702
  }
681
703
  ),
682
- (m || e.readonly) && D ? /* @__PURE__ */ n($t, { reason: D, onHover: s == null ? void 0 : s.onLockHover }) : m ? /* @__PURE__ */ n(Z, { delayDuration: 200, children: /* @__PURE__ */ c(I, { children: [
683
- /* @__PURE__ */ n(ee, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(ct, { className: "h-3 w-3" }) }) }),
684
- /* @__PURE__ */ n(te, { side: "top", className: "text-[12px]", children: "This field is locked" })
704
+ (u || e.readonly) && O ? /* @__PURE__ */ n(Ot, { reason: O, onHover: s == null ? void 0 : s.onLockHover }) : u ? /* @__PURE__ */ n(ee, { delayDuration: 200, children: /* @__PURE__ */ c(te, { children: [
705
+ /* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(bt, { className: "h-3 w-3" }) }) }),
706
+ /* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: "This field is locked" })
685
707
  ] }) }) : null,
686
- A.length > 0 && (() => {
687
- const t = !!O && Object.keys(O).length > 0 && B.length > 0, r = A.map(
688
- (h) => X(String(h.parent_field))
708
+ E.length > 0 && (() => {
709
+ const t = !!B && Object.keys(B).length > 0 && H.length > 0, r = E.map(
710
+ (p) => Z(String(p.parent_field))
689
711
  );
690
- return /* @__PURE__ */ n(Z, { delayDuration: 100, children: /* @__PURE__ */ c(I, { children: [
691
- /* @__PURE__ */ n(ee, { asChild: !0, children: /* @__PURE__ */ n(
712
+ return /* @__PURE__ */ n(ee, { delayDuration: 100, children: /* @__PURE__ */ c(te, { children: [
713
+ /* @__PURE__ */ n(ne, { asChild: !0, children: /* @__PURE__ */ n(
692
714
  "button",
693
715
  {
694
716
  type: "button",
695
717
  "aria-label": `Show the fields that narrow ${S || "this list"}`,
696
- onClick: rt,
697
- className: P(
718
+ onClick: ut,
719
+ className: A(
698
720
  "inline-flex items-center transition-colors",
699
721
  t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
700
722
  ),
701
- children: /* @__PURE__ */ n(ut, { className: "h-3 w-3" })
723
+ children: /* @__PURE__ */ n(gt, { className: "h-3 w-3" })
702
724
  }
703
725
  ) }),
704
- /* @__PURE__ */ n(te, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${B.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
726
+ /* @__PURE__ */ n(re, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${H.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
705
727
  ] }) });
706
- })()
728
+ })(),
729
+ Je && // The field menu for touch and pointer people (right-click / Shift+F10 still work).
730
+ // Shown on hover, focus and touch; opacity (not `hidden`) keeps its slot and its tab stop.
731
+ /* @__PURE__ */ n(
732
+ "button",
733
+ {
734
+ type: "button",
735
+ "data-field-menu-trigger": e.field,
736
+ "aria-label": "Field options",
737
+ "aria-haspopup": "menu",
738
+ "aria-expanded": Le,
739
+ "data-tip": "Field options",
740
+ onClick: (t) => Ye(t.currentTarget),
741
+ className: A(
742
+ "inline-flex h-5 w-5 items-center justify-center rounded text-slate-500 opacity-0 transition-[opacity,color,background-color] duration-150 hover:bg-muted hover:text-slate-800 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 group-hover/fieldrow:opacity-100 group-focus-within/fieldrow:opacity-100 [@media(hover:none)]:opacity-100 dark:text-slate-400 dark:hover:text-slate-100",
743
+ Le && "opacity-100"
744
+ ),
745
+ children: /* @__PURE__ */ n(vt, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
746
+ }
747
+ )
707
748
  ] }),
708
- q.editor && !m && /* @__PURE__ */ n(
709
- St,
749
+ P.editor && !u && /* @__PURE__ */ n(
750
+ Dt,
710
751
  {
711
- editor: q.editor,
712
- confirming: q.confirming,
713
- onConfirm: q.confirm,
714
- onCancel: q.cancel
752
+ editor: P.editor,
753
+ confirming: P.confirming,
754
+ onConfirm: P.confirm,
755
+ onCancel: P.cancel
715
756
  }
716
757
  ),
717
- H ?? /* @__PURE__ */ n(
758
+ W ?? /* @__PURE__ */ n(
718
759
  "div",
719
760
  {
720
- ref: ge,
721
- className: P(m && !W && "cursor-not-allowed"),
722
- "data-tip": (m || e.readonly) && D ? D : void 0,
723
- onPointerEnter: (m || e.readonly) && D ? s == null ? void 0 : s.onLockHover : void 0,
761
+ ref: de,
762
+ className: A(u && !z && "cursor-not-allowed"),
763
+ "data-tip": (u || e.readonly) && O ? O : void 0,
764
+ onPointerEnter: (u || e.readonly) && O ? s == null ? void 0 : s.onLockHover : void 0,
724
765
  children: /* @__PURE__ */ n(
725
766
  "div",
726
767
  {
727
- ref: ke,
728
- className: P(
768
+ ref: _e,
769
+ className: A(
729
770
  // A locked FILE field stays interactive: its chips keep the
730
771
  // download link and preview click (the component itself hides
731
772
  // upload/replace/remove when readonly) — blocking pointer events
732
773
  // made attachments unopenable on every locked form (addendum
733
774
  // view, terminal states).
734
- m && !W && "pointer-events-none opacity-60",
775
+ u && !z && "pointer-events-none opacity-60",
735
776
  // The ring lands with a 2px shake so the eye finds the field;
736
777
  // the animation runs once when the class is added.
737
778
  N && "nvr-shake ring-1 ring-red-400 rounded-md",
738
- ae && "nvr-autofill-glow"
779
+ le && "nvr-autofill-glow"
739
780
  ),
740
- children: E ? /* @__PURE__ */ n(Qt, { field: e, values: u }) : Je ? /* @__PURE__ */ n(
741
- Ft,
781
+ children: j ? /* @__PURE__ */ n(an, { field: e, values: m }) : it ? /* @__PURE__ */ n(
782
+ Pt,
742
783
  {
743
- collection: o,
784
+ collection: l,
744
785
  field: e,
745
- draft: u,
746
- itemId: l
786
+ draft: m,
787
+ itemId: i
747
788
  }
748
789
  ) : y ? y({
749
790
  field: e,
750
- value: de,
751
- onChange: _e,
752
- disabled: m,
753
- collection: o,
754
- itemId: l,
791
+ value: ue,
792
+ onChange: Ne,
793
+ disabled: u,
794
+ collection: l,
795
+ itemId: i,
755
796
  relations: f,
756
- cascadeFilter: O,
757
- unsatisfiedParentLabel: et,
758
- requiredParentLabel: Se
797
+ cascadeFilter: B,
798
+ unsatisfiedParentLabel: st,
799
+ requiredParentLabel: Pe
759
800
  }) : /* @__PURE__ */ n(
760
- qt,
801
+ Ht,
761
802
  {
762
- field: m && W ? tt() : e,
763
- value: de,
764
- onChange: _e,
803
+ field: u && z ? dt() : e,
804
+ value: ue,
805
+ onChange: Ne,
765
806
  relations: f,
766
- collection: o,
767
- itemId: l,
768
- cascadeFilter: O,
769
- requiredParentLabel: Se,
770
- narrowedBy: B.length > 0 ? nt() : void 0,
771
- onCountChange: a ? Me : void 0
807
+ collection: l,
808
+ itemId: i,
809
+ cascadeFilter: B,
810
+ requiredParentLabel: Pe,
811
+ narrowedBy: H.length > 0 ? ct() : void 0,
812
+ onCountChange: a ? We : void 0
772
813
  }
773
814
  )
774
815
  },
775
- ae ?? 0
816
+ le ?? 0
776
817
  )
777
818
  }
778
819
  ),
779
- Re && /* @__PURE__ */ n(Yt, { value: u[e.field], config: Re }),
780
- Ce && /* @__PURE__ */ n(
781
- Tt,
820
+ qe && /* @__PURE__ */ n(on, { value: m[e.field], config: qe }),
821
+ $e && !Se && /* @__PURE__ */ n(It, { field: e.field, text: $e }),
822
+ Re && /* @__PURE__ */ n(
823
+ Bt,
782
824
  {
783
- change: Ce,
825
+ change: Re,
784
826
  onDismiss: () => s == null ? void 0 : s.dismissRemoteChange(e.field),
785
827
  onTakeTheirs: s != null && s.takeRemoteChange ? () => {
786
828
  var t;
@@ -794,7 +836,7 @@ const jn = ft(function({
794
836
  );
795
837
  });
796
838
  export {
797
- jn as FieldRow,
798
- En as lineageSummary,
799
- an as useFieldLineage
839
+ Yn as FieldRow,
840
+ Qn as lineageSummary,
841
+ yn as useFieldLineage
800
842
  };