@nivaro/react 0.2.54 → 0.2.56

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 (151) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +367 -2
  4. package/dist/index.js +645 -616
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/stale-chunk.js +60 -0
  150. package/dist/shared/lib/worker-socket.js +200 -0
  151. package/package.json +1 -1
@@ -1,25 +1,26 @@
1
- import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
- import { useQueryClient as ve, useQueries as De, useQuery as J, useMutation as Me } from "@tanstack/react-query";
3
- import { Info as Ke, Loader2 as Oe, Sparkles as Ue, Lock as Be, SlidersHorizontal as He, History as We, BellRing as ze, Bell as Ge, Sigma as Qe } from "lucide-react";
4
- import { useState as oe, useRef as se, useEffect as we } from "react";
5
- import { toast as D } from "sonner";
6
- import { useParentDraft as Ve, useNivaroClient as X } from "../../context.js";
7
- import { showsAiButton as Ye, AUTOFILL_CHECK_KEY as Je, readAiFill as Xe } from "../../lib/ai-fill.js";
8
- import { get as M, del as Ze, post as ie } from "../../lib/commands.js";
9
- import { titleCase as ge, cn as j } from "../../lib/utils.js";
10
- import { GlossaryLabel as Ie } from "../ai/GlossaryText.js";
11
- import { Label as et } from "../ui/label.js";
12
- import { TooltipProvider as G, Tooltip as Q, TooltipTrigger as V, TooltipContent as Y } from "../ui/tooltip.js";
13
- import { useAddendumFields as tt } from "./AddendumFieldContext.js";
14
- import { AutoIdPreviewField as nt } from "./AutoIdPreviewField.js";
15
- import { useFieldAffordances as at, useFieldContextMenu as rt, usePresenceSoftLock as lt, LockReasonBadge as it, PresenceSoftLockStrip as ot, RemoteChangeGhost as st } from "./FieldAffordances.js";
16
- import { FieldRenderer as dt } from "./FieldRenderer.js";
17
- import { FormHelpVideoButton as ct } from "./FormHelpVideoButton.js";
18
- import { getCascadeFilters as ut, SYSTEM_FIELDS as mt, parseJson as pt, buildCascadeFilter as ht, CascadeEffectController as xt } from "./helpers.js";
19
- import { isDerivedForRecord as ft } from "./live-rollups.js";
20
- import { useM2MStaging as yt } from "./M2MStagingContext.js";
21
- import { resolveOptionFilterTokens as bt } from "../../lib/option-filter-tokens.js";
22
- const gt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), vt = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), wt = /* @__PURE__ */ new Set([
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { useQueryClient as Ce, useQueries as We, useQuery as Z, useMutation as Ve } from "@tanstack/react-query";
3
+ import { Info as ze, Loader2 as Ge, Sparkles as Qe, Lock as Ye, SlidersHorizontal as Je, History as Xe, BellRing as Ze, Bell as Ie, Sigma as et } from "lucide-react";
4
+ import { useState as ce, useRef as ue, useEffect as Fe } from "react";
5
+ import { toast as K } from "sonner";
6
+ import { useParentDraft as tt, useNivaroClient as I } from "../../context.js";
7
+ import { showsAiButton as nt, AUTOFILL_CHECK_KEY as at, readAiFill as rt } from "../../lib/ai-fill.js";
8
+ import { get as O, del as lt, post as de } from "../../lib/commands.js";
9
+ import { titleCase as se, cn as P } from "../../lib/utils.js";
10
+ import { GlossaryLabel as Ne } from "../ai/GlossaryText.js";
11
+ import { Label as it } from "../ui/label.js";
12
+ import { TooltipProvider as Q, Tooltip as Y, TooltipTrigger as J, TooltipContent as X } from "../ui/tooltip.js";
13
+ import { useAddendumFields as ot } from "./AddendumFieldContext.js";
14
+ import { AutoIdPreviewField as st } from "./AutoIdPreviewField.js";
15
+ import { useFieldAffordances as dt, useFieldContextMenu as ct, usePresenceSoftLock as ut, LockReasonBadge as mt, PresenceSoftLockStrip as pt, RemoteChangeGhost as ht } from "./FieldAffordances.js";
16
+ import { FieldRenderer as xt } from "./FieldRenderer.js";
17
+ import { FormHelpVideoButton as ft } from "./FormHelpVideoButton.js";
18
+ import { getCascadeFilters as yt, SYSTEM_FIELDS as bt, parseJson as gt, buildCascadeFilter as vt, CascadeEffectController as wt } from "./helpers.js";
19
+ import { isDerivedForRecord as kt } from "./live-rollups.js";
20
+ import { useM2MStaging as _t } from "./M2MStagingContext.js";
21
+ import { usePlacementTextContext as Nt, placementFieldText as Ct, isDisplayFormulaRow as Ft, fieldCounterConfig as Lt, fieldIsRecommended as Rt, RecommendedMarker as $t, RepeatLastButton as St, DisplayFormulaValue as Tt, FieldCounter as qt } from "./placement-behaviour.js";
22
+ import { resolveOptionFilterTokens as jt } from "../../lib/option-filter-tokens.js";
23
+ const Pt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), Et = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), At = /* @__PURE__ */ new Set([
23
24
  "input",
24
25
  "textarea",
25
26
  "wysiwyg",
@@ -27,7 +28,7 @@ const gt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
27
28
  "input-rich-text-html",
28
29
  "rich_text",
29
30
  "extension-editorjs"
30
- ]), kt = /* @__PURE__ */ new Set([
31
+ ]), Dt = /* @__PURE__ */ new Set([
31
32
  "relation-m2o",
32
33
  "relation-m2m",
33
34
  "select-multiple-m2m",
@@ -38,24 +39,24 @@ const gt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
38
39
  "file",
39
40
  "files",
40
41
  "image"
41
- ]), _t = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
42
- function Nt(e) {
42
+ ]), Mt = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
43
+ function Kt(e) {
43
44
  const o = e.interface ?? "";
44
- return kt.has(o) || o.startsWith("relation-") || o.endsWith("-m2o") || o.endsWith("-m2m") ? !1 : !!(vt.has(e.type ?? "") || wt.has(o) || !o && e.type && !gt.has(e.type));
45
+ return Dt.has(o) || o.startsWith("relation-") || o.endsWith("-m2o") || o.endsWith("-m2m") ? !1 : !!(Et.has(e.type ?? "") || At.has(o) || !o && e.type && !Pt.has(e.type));
45
46
  }
46
- function Ct(e, o, f, m) {
47
- const u = X();
48
- return J({
47
+ function Ot(e, o, f, p) {
48
+ const c = I();
49
+ return Z({
49
50
  queryKey: ["field-lineage", e, o, f],
50
- queryFn: () => u.request(
51
- M(`/lineage/${e}/${encodeURIComponent(o)}/${f}`)
51
+ queryFn: () => c.request(
52
+ O(`/lineage/${e}/${encodeURIComponent(o)}/${f}`)
52
53
  ).then((i) => i.data),
53
- enabled: m,
54
+ enabled: p,
54
55
  staleTime: 3e4
55
56
  });
56
57
  }
57
- function Jt(e, o = "rows") {
58
- var d, _, p;
58
+ function pn(e, o = "rows") {
59
+ var u, _, m;
59
60
  if (e && (e.kind === "write" || e.kind === "read") && e.formula) {
60
61
  const v = (y) => typeof y == "number" ? y.toLocaleString(void 0, { maximumFractionDigits: 2 }) : y == null || y === "" ? "∅" : String(y);
61
62
  return `= ${e.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (y, a) => {
@@ -64,66 +65,66 @@ function Jt(e, o = "rows") {
64
65
  }).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
65
66
  }
66
67
  if (!e || e.kind !== "rollup") return null;
67
- const f = (e.sources ?? []).reduce((v, l) => v + l.rows.length, 0), m = (e.sources ?? []).reduce((v, l) => {
68
+ const f = (e.sources ?? []).reduce((v, l) => v + l.rows.length, 0), p = (e.sources ?? []).reduce((v, l) => {
68
69
  var y;
69
70
  return v + (((y = l.excluded) == null ? void 0 : y.length) ?? 0);
70
- }, 0), u = (p = (_ = (d = (e.sources ?? []).find((v) => {
71
+ }, 0), c = (m = (_ = (u = (e.sources ?? []).find((v) => {
71
72
  var l;
72
73
  return (l = v.excluded) == null ? void 0 : l.length;
73
- })) == null ? void 0 : d.excluded) == null ? void 0 : _[0]) == null ? void 0 : p.reason, i = [`= ${f} ${f === 1 ? o.replace(/s$/, "") : o}`];
74
- return m && i.push(
75
- `${m} excluded${u ? ` (${u.replace(/^does not match: /, "")})` : ""}`
74
+ })) == null ? void 0 : u.excluded) == null ? void 0 : _[0]) == null ? void 0 : m.reason, i = [`= ${f} ${f === 1 ? o.replace(/s$/, "") : o}`];
75
+ return p && i.push(
76
+ `${p} excluded${c ? ` (${c.replace(/^does not match: /, "")})` : ""}`
76
77
  ), i.join(" · ");
77
78
  }
78
- function Ft({
79
+ function Ut({
79
80
  collection: e,
80
81
  itemId: o,
81
82
  field: f
82
83
  }) {
83
- const [m, u] = oe(!1), i = se(null), { data: d, isLoading: _ } = Ct(e, o, f, m);
84
- we(() => {
85
- if (!m) return;
84
+ const [p, c] = ce(!1), i = ue(null), { data: u, isLoading: _ } = Ot(e, o, f, p);
85
+ Fe(() => {
86
+ if (!p) return;
86
87
  const l = (y) => {
87
88
  var a;
88
- (a = i.current) != null && a.contains(y.target) || u(!1);
89
+ (a = i.current) != null && a.contains(y.target) || c(!1);
89
90
  };
90
91
  return window.addEventListener("mousedown", l), () => window.removeEventListener("mousedown", l);
91
- }, [m]);
92
- const p = (l) => l == null ? "—" : Number(l).toLocaleString(void 0, { maximumFractionDigits: 2 }), v = (d == null ? void 0 : d.stored_value) != null ? Number(d.stored_value) : null;
93
- return /* @__PURE__ */ s("div", { ref: i, className: "relative inline-flex", children: [
92
+ }, [p]);
93
+ const m = (l) => l == null ? "—" : Number(l).toLocaleString(void 0, { maximumFractionDigits: 2 }), v = (u == null ? void 0 : u.stored_value) != null ? Number(u.stored_value) : null;
94
+ return /* @__PURE__ */ d("div", { ref: i, className: "relative inline-flex", children: [
94
95
  /* @__PURE__ */ n(
95
96
  "button",
96
97
  {
97
98
  type: "button",
98
- onClick: () => u((l) => !l),
99
+ onClick: () => c((l) => !l),
99
100
  title: "Where does this number come from?",
100
- className: j(
101
+ className: P(
101
102
  "inline-flex items-center rounded p-0.5 transition-opacity",
102
- m ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
103
+ p ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
103
104
  ),
104
105
  "data-field-lineage": !0,
105
- children: /* @__PURE__ */ n(Qe, { className: "h-3 w-3" })
106
+ children: /* @__PURE__ */ n(et, { className: "h-3 w-3" })
106
107
  }
107
108
  ),
108
- m && /* @__PURE__ */ s("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: [
109
+ p && /* @__PURE__ */ d("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: [
109
110
  /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
110
111
  _ && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
111
- (d == null ? void 0 : d.kind) === "write" && /* @__PURE__ */ s("div", { className: "space-y-1 px-1 py-1", children: [
112
- /* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: d.formula }),
113
- Object.entries(d.inputs ?? {}).map(([l, y]) => /* @__PURE__ */ s("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
112
+ (u == null ? void 0 : u.kind) === "write" && /* @__PURE__ */ d("div", { className: "space-y-1 px-1 py-1", children: [
113
+ /* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: u.formula }),
114
+ Object.entries(u.inputs ?? {}).map(([l, y]) => /* @__PURE__ */ d("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
114
115
  /* @__PURE__ */ n("span", { className: "font-mono", children: l }),
115
116
  " = ",
116
- p(y)
117
+ m(y)
117
118
  ] }, l)),
118
- /* @__PURE__ */ s("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
119
+ /* @__PURE__ */ d("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
119
120
  "= ",
120
- p(d.stored_value)
121
+ m(u.stored_value)
121
122
  ] })
122
123
  ] }),
123
- (d == null ? void 0 : d.kind) === "rollup" && (d.sources ?? []).map((l, y) => {
124
+ (u == null ? void 0 : u.kind) === "rollup" && (u.sources ?? []).map((l, y) => {
124
125
  var a;
125
- return /* @__PURE__ */ s("div", { className: "mb-1.5", children: [
126
- /* @__PURE__ */ s("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
126
+ return /* @__PURE__ */ d("div", { className: "mb-1.5", children: [
127
+ /* @__PURE__ */ d("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
127
128
  (l.aggregate ?? "sum").toUpperCase(),
128
129
  l.value_field ? ` of ${l.value_field}` : "",
129
130
  " across ",
@@ -132,13 +133,13 @@ function Ft({
132
133
  ] }),
133
134
  l.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: l.error }),
134
135
  l.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: l.note }),
135
- l.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: l.rows.map((h) => /* @__PURE__ */ s(
136
+ l.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: l.rows.map((h) => /* @__PURE__ */ d(
136
137
  "div",
137
138
  {
138
139
  className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
139
140
  children: [
140
141
  /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: h.label }),
141
- /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: p(h.value) }),
142
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: m(h.value) }),
142
143
  /* @__PURE__ */ n(
143
144
  "span",
144
145
  {
@@ -152,29 +153,29 @@ function Ft({
152
153
  h.id
153
154
  )) }),
154
155
  l.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." }),
155
- l.subtotal != null && /* @__PURE__ */ s("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: [
156
+ l.subtotal != null && /* @__PURE__ */ d("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: [
156
157
  "subtotal ",
157
- p(l.subtotal)
158
+ m(l.subtotal)
158
159
  ] }),
159
- (((a = l.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ s("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
160
- /* @__PURE__ */ s("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
160
+ (((a = l.excluded) == null ? void 0 : a.length) ?? 0) > 0 && /* @__PURE__ */ d("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
161
+ /* @__PURE__ */ d("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
161
162
  l.excluded.length,
162
163
  " excluded —",
163
164
  " ",
164
165
  l.excluded[0].reason.replace(/^does not match: /, "")
165
166
  ] }),
166
- l.excluded.slice(0, 8).map((h) => /* @__PURE__ */ s(
167
+ l.excluded.slice(0, 8).map((h) => /* @__PURE__ */ d(
167
168
  "div",
168
169
  {
169
170
  className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
170
171
  children: [
171
172
  /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children: h.label }),
172
- /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: p(h.value) })
173
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: m(h.value) })
173
174
  ]
174
175
  },
175
176
  h.id
176
177
  )),
177
- l.excluded.length > 8 && /* @__PURE__ */ s("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
178
+ l.excluded.length > 8 && /* @__PURE__ */ d("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
178
179
  "+",
179
180
  l.excluded.length - 8,
180
181
  " more"
@@ -182,76 +183,76 @@ function Ft({
182
183
  ] })
183
184
  ] }, y);
184
185
  }),
185
- (d == null ? void 0 : d.kind) === "rollup" && v != null && /* @__PURE__ */ s("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
186
+ (u == null ? void 0 : u.kind) === "rollup" && v != null && /* @__PURE__ */ d("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
186
187
  "stored ",
187
- p(v),
188
+ m(v),
188
189
  (() => {
189
- const l = (d.sources ?? []).reduce((a, h) => a + (h.subtotal ?? 0), 0);
190
- return (d.sources ?? []).some((a) => a.truncated) ? null : Math.abs(l - v) < 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" });
190
+ const l = (u.sources ?? []).reduce((a, h) => a + (h.subtotal ?? 0), 0);
191
+ return (u.sources ?? []).some((a) => a.truncated) ? null : Math.abs(l - v) < 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" });
191
192
  })()
192
193
  ] })
193
194
  ] })
194
195
  ] });
195
196
  }
196
- function Lt({
197
+ function Bt({
197
198
  collection: e,
198
199
  itemId: o,
199
200
  field: f,
200
- formatValue: m,
201
- onRestore: u
201
+ formatValue: p,
202
+ onRestore: c
202
203
  }) {
203
- const i = X(), [d, _] = oe(!1), p = se(null), { data: v, isLoading: l } = J({
204
+ const i = I(), [u, _] = ce(!1), m = ue(null), { data: v, isLoading: l } = Z({
204
205
  queryKey: ["field-value-history", e, o, f],
205
- queryFn: () => i.request(M(`/field-history/${e}/${encodeURIComponent(o)}/${f}`)).then((a) => a.data ?? []),
206
- enabled: d,
206
+ queryFn: () => i.request(O(`/field-history/${e}/${encodeURIComponent(o)}/${f}`)).then((a) => a.data ?? []),
207
+ enabled: u,
207
208
  staleTime: 6e4
208
209
  });
209
- we(() => {
210
- if (!d) return;
210
+ Fe(() => {
211
+ if (!u) return;
211
212
  const a = (h) => {
212
- var K;
213
- (K = p.current) != null && K.contains(h.target) || _(!1);
213
+ var U;
214
+ (U = m.current) != null && U.contains(h.target) || _(!1);
214
215
  };
215
216
  return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
216
- }, [d]);
217
- const y = (a, h) => h || (a == null || a === "" ? "—" : m ? m(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));
218
- return /* @__PURE__ */ s("div", { ref: p, className: "relative inline-flex", children: [
217
+ }, [u]);
218
+ const y = (a, h) => h || (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));
219
+ return /* @__PURE__ */ d("div", { ref: m, className: "relative inline-flex", children: [
219
220
  /* @__PURE__ */ n(
220
221
  "button",
221
222
  {
222
223
  type: "button",
223
224
  onClick: () => _((a) => !a),
224
225
  title: "Value history",
225
- className: j(
226
+ className: P(
226
227
  "inline-flex items-center rounded p-0.5 transition-opacity",
227
- d ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
228
+ u ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
228
229
  ),
229
230
  "data-field-history": !0,
230
- children: /* @__PURE__ */ n(We, { className: "h-3 w-3" })
231
+ children: /* @__PURE__ */ n(Xe, { className: "h-3 w-3" })
231
232
  }
232
233
  ),
233
- d && /* @__PURE__ */ s("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: [
234
+ u && /* @__PURE__ */ d("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: [
234
235
  /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
235
- l ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (v ?? []).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: (v ?? []).map((a, h) => /* @__PURE__ */ s(
236
+ l ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (v ?? []).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: (v ?? []).map((a, h) => /* @__PURE__ */ d(
236
237
  "div",
237
238
  {
238
239
  className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
239
240
  children: [
240
- /* @__PURE__ */ s("span", { className: "flex items-baseline justify-between gap-2", children: [
241
+ /* @__PURE__ */ d("span", { className: "flex items-baseline justify-between gap-2", children: [
241
242
  /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: y(a.value, a.display) }),
242
- u && h > 0 && /* @__PURE__ */ n(
243
+ c && h > 0 && /* @__PURE__ */ n(
243
244
  "button",
244
245
  {
245
246
  type: "button",
246
247
  onClick: () => {
247
- u(a.value ?? null), _(!1);
248
+ c(a.value ?? null), _(!1);
248
249
  },
249
250
  className: "shrink-0 rounded border border-slate-200 px-1.5 py-px text-[10px] text-slate-500 hover:border-nvr-cyan/60 hover:text-nvr-navy dark:border-border dark:hover:text-nvr-cyan",
250
251
  children: "Restore"
251
252
  }
252
253
  )
253
254
  ] }),
254
- /* @__PURE__ */ s("span", { className: "block text-[10.5px] text-slate-400", children: [
255
+ /* @__PURE__ */ d("span", { className: "block text-[10.5px] text-slate-400", children: [
255
256
  a.action === "create" ? "initial value" : "changed",
256
257
  a.timestamp ? ` · ${new Date(a.timestamp).toLocaleString()}` : "",
257
258
  a.user_name ? ` · ${a.user_name}` : "",
@@ -263,7 +264,7 @@ function Lt({
263
264
  }
264
265
  )
265
266
  ] }),
266
- a.note && /* @__PURE__ */ s("span", { className: "block text-[10.5px] italic text-slate-500 dark:text-slate-400", children: [
267
+ a.note && /* @__PURE__ */ d("span", { className: "block text-[10.5px] italic text-slate-500 dark:text-slate-400", children: [
267
268
  "“",
268
269
  a.note,
269
270
  "”"
@@ -275,85 +276,85 @@ function Lt({
275
276
  ] })
276
277
  ] });
277
278
  }
278
- function Rt({
279
+ function Ht({
279
280
  collection: e,
280
281
  itemId: o,
281
282
  field: f
282
283
  }) {
283
- const m = X(), u = ve(), { data: i } = J({
284
+ const p = I(), c = Ce(), { data: i } = Z({
284
285
  queryKey: ["field-watch-config"],
285
- queryFn: () => m.request(M("/field-watches/config")).then((l) => l.data).catch(() => ({ enabled: !1 })),
286
+ queryFn: () => p.request(O("/field-watches/config")).then((l) => l.data).catch(() => ({ enabled: !1 })),
286
287
  staleTime: 5 * 6e4
287
- }), d = ["field-watch-self", e, o], { data: _ = [] } = J({
288
- queryKey: d,
289
- queryFn: () => m.request(M("/field-watches/self", { collection: e, item_id: o })).then((l) => l.data ?? []).catch(() => []),
288
+ }), u = ["field-watch-self", e, o], { data: _ = [] } = Z({
289
+ queryKey: u,
290
+ queryFn: () => p.request(O("/field-watches/self", { collection: e, item_id: o })).then((l) => l.data ?? []).catch(() => []),
290
291
  enabled: !!(i != null && i.enabled),
291
292
  staleTime: 6e4
292
- }), p = _.includes(f), v = Me({
293
- mutationFn: () => p ? m.request(
294
- Ze(
293
+ }), m = _.includes(f), v = Ve({
294
+ mutationFn: () => m ? p.request(
295
+ lt(
295
296
  `/field-watches/self?collection=${encodeURIComponent(e)}&field=${encodeURIComponent(f)}&item_id=${encodeURIComponent(o)}`
296
297
  )
297
- ) : m.request(ie("/field-watches/self", { collection: e, field: f, item_id: o })),
298
+ ) : p.request(de("/field-watches/self", { collection: e, field: f, item_id: o })),
298
299
  onSuccess: () => {
299
- u.invalidateQueries({ queryKey: d }), D.success(
300
- p ? "No longer watching this field" : "Watching — you will be notified when it changes"
300
+ c.invalidateQueries({ queryKey: u }), K.success(
301
+ m ? "No longer watching this field" : "Watching — you will be notified when it changes"
301
302
  );
302
303
  },
303
- onError: () => D.error("Could not update the watch")
304
+ onError: () => K.error("Could not update the watch")
304
305
  });
305
306
  return i != null && i.enabled ? /* @__PURE__ */ n(
306
307
  "button",
307
308
  {
308
309
  type: "button",
309
310
  onClick: () => v.mutate(),
310
- title: p ? "Stop watching this field on this record" : "Watch this field on this record",
311
+ title: m ? "Stop watching this field on this record" : "Watch this field on this record",
311
312
  "data-field-watch": f,
312
- className: `rounded p-0.5 transition-colors ${p ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
313
- children: p ? /* @__PURE__ */ n(ze, { className: "h-3 w-3" }) : /* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
313
+ className: `rounded p-0.5 transition-colors ${m ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
314
+ children: m ? /* @__PURE__ */ n(Ze, { className: "h-3 w-3" }) : /* @__PURE__ */ n(Ie, { className: "h-3 w-3" })
314
315
  }
315
316
  ) : null;
316
317
  }
317
- function Xt({
318
+ function hn({
318
319
  field: e,
319
320
  draft: o,
320
321
  onChange: f,
321
- relations: m,
322
- collection: u,
322
+ relations: p,
323
+ collection: c,
323
324
  itemId: i,
324
- error: d,
325
+ error: u,
325
326
  visible: _,
326
- locked: p,
327
+ locked: m,
327
328
  layoutAiEnabled: v,
328
329
  renderField: l,
329
330
  onCountChange: y,
330
331
  swapButton: a,
331
332
  swapContent: h,
332
- forceVisible: K,
333
- autoFillTick: de
333
+ forceVisible: U,
334
+ autoFillTick: me
334
335
  }) {
335
- var ye, be;
336
- const Z = _t.has(e.interface ?? ""), F = Ve(), b = yt(), ce = ve(), I = X(), [ue, O] = oe(!1), c = at(), ee = se(null), {
337
- onContextMenu: ke,
338
- onKeyDown: _e,
339
- menu: Ne
340
- } = rt({
341
- wrapperRef: ee,
336
+ var we, ke, _e;
337
+ const ee = Mt.has(e.interface ?? ""), F = tt(), b = _t(), pe = Ce(), te = I(), [he, B] = ce(!1), s = dt(), ne = ue(null), {
338
+ onContextMenu: Le,
339
+ onKeyDown: Re,
340
+ menu: $e
341
+ } = ct({
342
+ wrapperRef: ne,
342
343
  field: e,
343
344
  value: o[e.field],
344
- relations: m,
345
- collection: u,
345
+ relations: p,
346
+ collection: c,
346
347
  itemId: i,
347
- openRelated: c == null ? void 0 : c.openRelated
348
- }), $ = lt(ee), me = c == null ? void 0 : c.remoteChanges[e.field], P = c == null ? void 0 : c.lockReasons[e.field], L = c == null ? void 0 : c.applyToLines[e.field], U = Ye(e._overrides, v, Nt(e)), te = !!(c != null && c.fromAutofill) && !!e._overrides && e._overrides[Je] === !0;
349
- async function Ce() {
348
+ openRelated: s == null ? void 0 : s.openRelated
349
+ }), $ = ut(ne), Se = Nt(), xe = s == null ? void 0 : s.remoteChanges[e.field], E = s == null ? void 0 : s.lockReasons[e.field], L = s == null ? void 0 : s.applyToLines[e.field], H = nt(e._overrides, v, Kt(e)), ae = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[at] === !0;
350
+ async function Te() {
350
351
  var t;
351
- if (U.perField) return Fe();
352
- O(!0);
352
+ if (H.perField) return qe();
353
+ B(!0);
353
354
  try {
354
- const r = await I.request(
355
- ie("/ai/generate", {
356
- collection: u,
355
+ const r = await te.request(
356
+ de("/ai/generate", {
357
+ collection: c,
357
358
  item_id: i !== "new" ? i : void 0,
358
359
  field: e.field
359
360
  })
@@ -361,47 +362,47 @@ function Xt({
361
362
  ((t = r.data) == null ? void 0 : t.value) != null && f(e.field, r.data.value);
362
363
  } catch {
363
364
  } finally {
364
- O(!1);
365
+ B(!1);
365
366
  }
366
367
  }
367
- async function Fe() {
368
- var r, x, N, q, R, C;
368
+ async function qe() {
369
+ var r, x, N, j, R, C;
369
370
  const t = {};
370
- for (const g of ((r = Xe(e._overrides)) == null ? void 0 : r.tokens) ?? []) g in o && (t[g] = o[g]);
371
- O(!0);
371
+ for (const g of ((r = rt(e._overrides)) == null ? void 0 : r.tokens) ?? []) g in o && (t[g] = o[g]);
372
+ B(!0);
372
373
  try {
373
- const g = await I.request(
374
- ie("/ai/field-fill", {
375
- collection: u,
376
- layout_id: (c == null ? void 0 : c.layoutId) ?? null,
374
+ const g = await te.request(
375
+ de("/ai/field-fill", {
376
+ collection: c,
377
+ layout_id: (s == null ? void 0 : s.layoutId) ?? null,
377
378
  field: e.field,
378
379
  item_id: i && i !== "new" ? i : null,
379
380
  values: t
380
381
  })
381
382
  ), k = (x = g.data) == null ? void 0 : x.value;
382
- typeof k == "string" && k !== "" ? f(e.field, k) : D.info("The AI had nothing to write here"), (q = (N = g.data) == null ? void 0 : N.missing) != null && q.length && D.info(`Filled without ${g.data.missing.join(", ")} (empty or not visible to you)`);
383
+ typeof k == "string" && k !== "" ? f(e.field, k) : K.info("The AI had nothing to write here"), (j = (N = g.data) == null ? void 0 : N.missing) != null && j.length && K.info(`Filled without ${g.data.missing.join(", ")} (empty or not visible to you)`);
383
384
  } catch (g) {
384
385
  const k = g;
385
- D.error(((C = (R = k == null ? void 0 : k.response) == null ? void 0 : R.data) == null ? void 0 : C.error) ?? (k == null ? void 0 : k.message) ?? "AI fill failed");
386
+ K.error(((C = (R = k == null ? void 0 : k.response) == null ? void 0 : R.data) == null ? void 0 : C.error) ?? (k == null ? void 0 : k.message) ?? "AI fill failed");
386
387
  } finally {
387
- O(!1);
388
+ B(!1);
388
389
  }
389
390
  }
390
- const S = ut(e.dependency_config), pe = S.flatMap((t) => {
391
- const r = m.find(
392
- (N) => N.one_collection === u && N.one_field === t.parent_field
391
+ const S = yt(e.dependency_config), fe = S.flatMap((t) => {
392
+ const r = p.find(
393
+ (N) => N.one_collection === c && N.one_field === t.parent_field
393
394
  );
394
395
  if (!r) return [];
395
396
  if (r.junction_field) return [{ rule: t, rel: r }];
396
- const x = m.find(
397
+ const x = p.find(
397
398
  (N) => N.many_collection === r.many_collection && N.id !== r.id
398
399
  );
399
400
  return x != null && x.many_field ? [{ rule: t, rel: { ...r, junction_field: x.many_field } }] : [];
400
- }), Le = De({
401
- queries: pe.map(({ rel: t }) => ({
401
+ }), je = We({
402
+ queries: fe.map(({ rel: t }) => ({
402
403
  queryKey: ["m2m-items", t.many_collection, t.many_field, i],
403
- queryFn: () => I.request(
404
- M(`/items/${t.many_collection}`, {
404
+ queryFn: () => te.request(
405
+ O(`/items/${t.many_collection}`, {
405
406
  filter: JSON.stringify({ [t.many_field]: { _eq: i } }),
406
407
  limit: 200,
407
408
  fields: `id,${t.junction_field}`
@@ -410,39 +411,39 @@ function Xt({
410
411
  enabled: !!i && i !== "new",
411
412
  staleTime: 3e4
412
413
  }))
413
- }), Re = Object.fromEntries(
414
- pe.map(({ rule: t, rel: r }, x) => {
414
+ }), Pe = Object.fromEntries(
415
+ fe.map(({ rule: t, rel: r }, x) => {
415
416
  var R;
416
- const N = r.one_field ?? `${r.many_collection}.${r.junction_field}`, q = (b == null ? void 0 : b.getStagedUnlinks(N)) ?? /* @__PURE__ */ new Set();
417
+ const N = r.one_field ?? `${r.many_collection}.${r.junction_field}`, j = (b == null ? void 0 : b.getStagedUnlinks(N)) ?? /* @__PURE__ */ new Set();
417
418
  return [
418
419
  t.parent_field,
419
- (((R = Le[x]) == null ? void 0 : R.data) ?? []).filter((C) => !q.has(C.id)).map((C) => C[r.junction_field])
420
+ (((R = je[x]) == null ? void 0 : R.data) ?? []).filter((C) => !j.has(C.id)).map((C) => C[r.junction_field])
420
421
  ];
421
422
  })
422
- ), B = tt()[e.field] ?? [];
423
- if (!K && (!_ || !e.layout_assigned && (e.hidden || mt.has(e.field))))
423
+ ), W = ot()[e.field] ?? [];
424
+ if (!U && (!_ || !e.layout_assigned && (e.hidden || bt.has(e.field))))
424
425
  return null;
425
- const ne = o[e.field] ?? null, H = e.label ?? ge(e.field), $e = ft(e, o), Se = (be = (ye = pt(e.options)) == null ? void 0 : ye.auto_id) == null ? void 0 : be.pattern, w = (() => {
426
- const t = m.find(
427
- (x) => x.one_collection === u && x.one_field === e.field
426
+ const re = o[e.field] ?? null, V = Ct(e, Se), A = V.label ?? se(e.field), T = Ft(e), ye = T ? null : Lt(e), Ee = !T && !m && !e.readonly && ((we = e._overrides) == null ? void 0 : we.repeat_last) === !0, Ae = kt(e, o), De = (_e = (ke = gt(e.options)) == null ? void 0 : ke.auto_id) == null ? void 0 : _e.pattern, w = (() => {
427
+ const t = p.find(
428
+ (x) => x.one_collection === c && x.one_field === e.field
428
429
  );
429
430
  if (!t) return null;
430
431
  if (t.junction_field) return t;
431
- const r = m.find(
432
+ const r = p.find(
432
433
  (x) => x.many_collection === t.many_collection && x.id !== t.id
433
434
  );
434
435
  return r ? { ...t, junction_field: r.many_field } : null;
435
- })(), ae = w ? null : m.find((t) => t.many_collection === u && t.many_field === e.field) ?? null, re = w ? m.find(
436
+ })(), le = w ? null : p.find((t) => t.many_collection === c && t.many_field === e.field) ?? null, ie = w ? p.find(
436
437
  (t) => t.many_collection === w.many_collection && t.many_field === w.junction_field && t.id !== w.id
437
- ) ?? null : null, E = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, he = E ? (b == null ? void 0 : b.getStagedLinks(E)) ?? [] : [], Te = w ? (ce.getQueryData([
438
+ ) ?? null : null, D = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, be = D ? (b == null ? void 0 : b.getStagedLinks(D)) ?? [] : [], Me = w ? (pe.getQueryData([
438
439
  "m2m-items",
439
440
  w.many_collection,
440
441
  w.many_field,
441
442
  i
442
- ]) ?? []).map((t) => t[w.junction_field]) : [], qe = w ? he[0] ?? Te[0] ?? null : ne, je = (re == null ? void 0 : re.one_collection) ?? (ae == null ? void 0 : ae.one_collection) ?? void 0, W = (t) => {
443
+ ]) ?? []).map((t) => t[w.junction_field]) : [], Ke = w ? be[0] ?? Me[0] ?? null : re, Oe = (ie == null ? void 0 : ie.one_collection) ?? (le == null ? void 0 : le.one_collection) ?? void 0, z = (t) => {
443
444
  var r;
444
- return ((F == null ? void 0 : F.collection) === u ? (r = F == null ? void 0 : F.fieldLabels) == null ? void 0 : r[t] : void 0) ?? ge(String(t));
445
- }, T = ht({
445
+ return ((F == null ? void 0 : F.collection) === c ? (r = F == null ? void 0 : F.fieldLabels) == null ? void 0 : r[t] : void 0) ?? se(String(t));
446
+ }, q = vt({
446
447
  rules: S,
447
448
  // A parent whose value THIS field's own pick derived must not narrow this
448
449
  // field's options — otherwise picking a region locks the region picker
@@ -454,27 +455,27 @@ function Xt({
454
455
  },
455
456
  parentValue: (t) => {
456
457
  if (o[t] != null) return o[t];
457
- const r = m.find((g) => g.one_collection === u && g.one_field === t);
458
+ const r = p.find((g) => g.one_collection === c && g.one_field === t);
458
459
  if (!r) return null;
459
460
  let x = r;
460
461
  if (!x.junction_field) {
461
- const g = m.find(
462
+ const g = p.find(
462
463
  (k) => k.many_collection === r.many_collection && k.id !== r.id
463
464
  );
464
465
  if (g != null && g.many_field) x = { ...r, junction_field: g.many_field };
465
466
  else return null;
466
467
  }
467
- const N = x.one_field ?? `${x.many_collection}.${x.junction_field}`, q = (b == null ? void 0 : b.getStagedLinks(N)) ?? [], R = Re[t] ?? [], C = [...new Set([...q, ...R].map((g) => String(g)))];
468
+ const N = x.one_field ?? `${x.many_collection}.${x.junction_field}`, j = (b == null ? void 0 : b.getStagedLinks(N)) ?? [], R = Pe[t] ?? [], C = [...new Set([...j, ...R].map((g) => String(g)))];
468
469
  return C.length === 0 ? null : C.length === 1 ? C[0] : C;
469
470
  },
470
471
  parentOptionFilter: (t) => {
471
472
  var x;
472
- const r = (F == null ? void 0 : F.collection) === u ? (x = F.fieldOptionFilters) == null ? void 0 : x[t] : void 0;
473
- return r ? bt(r, o, i) : void 0;
473
+ const r = (F == null ? void 0 : F.collection) === c ? (x = F.fieldOptionFilters) == null ? void 0 : x[t] : void 0;
474
+ return r ? jt(r, o, i) : void 0;
474
475
  }
475
- }), A = T.filter, z = T.satisfiedParents.map(W), xe = T.satisfiedParents, Pe = T.unsatisfiedParents.length ? W(T.unsatisfiedParents[0]) : null, le = T.missingRequiredParents, fe = le.length ? W(le[0]) : null;
476
- function Ee() {
477
- for (const t of xe) {
476
+ }), M = q.filter, G = q.satisfiedParents.map(z), ge = q.satisfiedParents, Ue = q.unsatisfiedParents.length ? z(q.unsatisfiedParents[0]) : null, oe = q.missingRequiredParents, ve = oe.length ? z(oe[0]) : null;
477
+ function Be() {
478
+ for (const t of ge) {
478
479
  const r = document.querySelector(`[data-field="${t}"]`);
479
480
  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(() => {
480
481
  r.style.boxShadow = "none", setTimeout(() => {
@@ -483,85 +484,96 @@ function Xt({
483
484
  }, 900));
484
485
  }
485
486
  }
486
- const Ae = () => {
487
- if (w && E) {
488
- for (const r of he) b == null || b.unstageLink(E, r);
489
- const t = ce.getQueryData([
487
+ const He = () => {
488
+ if (w && D) {
489
+ for (const r of be) b == null || b.unstageLink(D, r);
490
+ const t = pe.getQueryData([
490
491
  "m2m-items",
491
492
  w.many_collection,
492
493
  w.many_field,
493
494
  i
494
495
  ]) ?? [];
495
- for (const r of t) b == null || b.stageUnlink(E, r.id);
496
+ for (const r of t) b == null || b.stageUnlink(D, r.id);
496
497
  } else
497
498
  f(e.field, null);
498
499
  };
499
500
  return (
500
501
  // biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only hosts the field context menu (right-click / Shift+F10); the inputs inside stay the controls
501
- /* @__PURE__ */ s(
502
+ /* @__PURE__ */ d(
502
503
  "div",
503
504
  {
504
- ref: ee,
505
+ ref: ne,
505
506
  "data-field": e.field,
506
- "data-field-collection": u,
507
+ "data-field-collection": c,
507
508
  "data-field-interface": e.interface ?? void 0,
508
- "data-autofill-check": te ? "" : void 0,
509
- className: j(
509
+ "data-autofill-check": ae ? "" : void 0,
510
+ className: P(
510
511
  "group/fieldrow space-y-1.5",
511
- te && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
512
+ ae && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
512
513
  ),
513
- onContextMenu: ke,
514
- onKeyDown: _e,
514
+ onContextMenu: Le,
515
+ onKeyDown: Re,
515
516
  onFocusCapture: $.onFocusCapture,
516
517
  children: [
517
- Ne,
518
+ $e,
518
519
  S.length > 0 && /* @__PURE__ */ n(
519
- xt,
520
+ wt,
520
521
  {
521
522
  cascadeRules: S,
522
- cascadeFilter: A,
523
- currentValue: qe,
524
- relatedCollection: je,
525
- missingRequiredParents: le,
526
- onClear: Ae
523
+ cascadeFilter: M,
524
+ currentValue: Ke,
525
+ relatedCollection: Oe,
526
+ missingRequiredParents: oe,
527
+ onClear: He
527
528
  }
528
529
  ),
529
- (H !== "" || B.length > 0) && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]", children: [
530
- H !== "" && /* @__PURE__ */ s(et, { "data-field-label": !0, className: "text-sm font-medium", children: [
531
- /* @__PURE__ */ n(Ie, { text: H, collection: u }),
532
- e.required && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" })
530
+ (A !== "" || W.length > 0) && /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]", children: [
531
+ A !== "" && /* @__PURE__ */ d(it, { "data-field-label": !0, className: "text-sm font-medium", children: [
532
+ /* @__PURE__ */ n(Ne, { text: A, collection: c }),
533
+ e.required && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
534
+ Rt(e) && /* @__PURE__ */ n($t, {})
533
535
  ] }),
534
- e.note && /* @__PURE__ */ n(G, { delayDuration: 100, children: /* @__PURE__ */ s(Q, { children: [
535
- /* @__PURE__ */ n(V, { asChild: !0, children: /* @__PURE__ */ n(Ke, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
536
- /* @__PURE__ */ n(Y, { side: "top", className: "max-w-[240px] text-[12px]", children: e.note })
536
+ V.note && /* @__PURE__ */ n(Q, { delayDuration: 100, children: /* @__PURE__ */ d(Y, { children: [
537
+ /* @__PURE__ */ n(J, { asChild: !0, children: /* @__PURE__ */ n(ze, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
538
+ /* @__PURE__ */ n(X, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? V.note : /* @__PURE__ */ n(Ne, { text: V.note, collection: c }) })
537
539
  ] }) }),
538
- i && i !== "new" && /* @__PURE__ */ n(
539
- Lt,
540
+ !T && i && i !== "new" && /* @__PURE__ */ n(
541
+ Bt,
540
542
  {
541
- collection: u,
543
+ collection: c,
542
544
  itemId: i,
543
545
  field: e.field,
544
546
  onRestore: e.readonly ? void 0 : (t) => f(e.field, t)
545
547
  }
546
548
  ),
547
- i && i !== "new" && /* @__PURE__ */ n(Rt, { collection: u, itemId: i, field: e.field }),
548
- i && i !== "new" && $e && /* @__PURE__ */ n(Ft, { collection: u, itemId: i, field: e.field }),
549
- U.show && !(U.perField && (p || e.readonly)) && /* @__PURE__ */ s(
549
+ !T && i && i !== "new" && /* @__PURE__ */ n(Ht, { collection: c, itemId: i, field: e.field }),
550
+ i && i !== "new" && Ae && /* @__PURE__ */ n(Ut, { collection: c, itemId: i, field: e.field }),
551
+ Ee && /* @__PURE__ */ n(
552
+ St,
553
+ {
554
+ collection: c,
555
+ itemId: i,
556
+ field: e.field,
557
+ label: A || se(e.field),
558
+ onFill: (t) => f(e.field, t)
559
+ }
560
+ ),
561
+ !T && H.show && !(H.perField && (m || e.readonly)) && /* @__PURE__ */ d(
550
562
  "button",
551
563
  {
552
564
  type: "button",
553
- onClick: Ce,
554
- disabled: ue,
555
- "data-ai-fill": U.perField ? e.field : void 0,
565
+ onClick: Te,
566
+ disabled: he,
567
+ "data-ai-fill": H.perField ? e.field : void 0,
556
568
  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",
557
569
  title: "Generate with AI",
558
570
  children: [
559
- ue ? /* @__PURE__ */ n(Oe, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(Ue, { className: "h-3 w-3" }),
571
+ he ? /* @__PURE__ */ n(Ge, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(Qe, { className: "h-3 w-3" }),
560
572
  "AI"
561
573
  ]
562
574
  }
563
575
  ),
564
- te && /* @__PURE__ */ n(
576
+ ae && /* @__PURE__ */ n(
565
577
  "span",
566
578
  {
567
579
  "data-tip": "People often change what the AI read from the document here — check it",
@@ -570,7 +582,7 @@ function Xt({
570
582
  }
571
583
  ),
572
584
  a,
573
- L && !p && !e.readonly && /* @__PURE__ */ s(
585
+ L && !m && !e.readonly && /* @__PURE__ */ d(
574
586
  "button",
575
587
  {
576
588
  type: "button",
@@ -585,21 +597,21 @@ function Xt({
585
597
  ]
586
598
  }
587
599
  ),
588
- B.length > 0 && /* @__PURE__ */ n(G, { delayDuration: 100, children: /* @__PURE__ */ s(Q, { children: [
589
- /* @__PURE__ */ n(V, { asChild: !0, children: /* @__PURE__ */ s("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: [
600
+ W.length > 0 && /* @__PURE__ */ n(Q, { delayDuration: 100, children: /* @__PURE__ */ d(Y, { children: [
601
+ /* @__PURE__ */ n(J, { asChild: !0, children: /* @__PURE__ */ d("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: [
590
602
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
591
603
  "addendum"
592
604
  ] }) }),
593
- /* @__PURE__ */ s(Y, { side: "top", className: "max-w-[220px] text-[12px]", children: [
594
- /* @__PURE__ */ s("p", { className: "font-medium mb-1", children: [
605
+ /* @__PURE__ */ d(X, { side: "top", className: "max-w-[220px] text-[12px]", children: [
606
+ /* @__PURE__ */ d("p", { className: "font-medium mb-1", children: [
595
607
  "In active addendum",
596
- B.length > 1 ? "s" : "",
608
+ W.length > 1 ? "s" : "",
597
609
  ":"
598
610
  ] }),
599
- B.map((t) => /* @__PURE__ */ s("p", { className: "text-slate-400", children: [
611
+ W.map((t) => /* @__PURE__ */ d("p", { className: "text-slate-400", children: [
600
612
  t.title,
601
613
  " ",
602
- /* @__PURE__ */ s("span", { className: "capitalize", children: [
614
+ /* @__PURE__ */ d("span", { className: "capitalize", children: [
603
615
  "(",
604
616
  t.status,
605
617
  ")"
@@ -608,41 +620,41 @@ function Xt({
608
620
  ] })
609
621
  ] }) }),
610
622
  /* @__PURE__ */ n(
611
- ct,
623
+ ft,
612
624
  {
613
- collection: u,
625
+ collection: c,
614
626
  kind: "field",
615
627
  name: e.field,
616
- label: H
628
+ label: A
617
629
  }
618
630
  ),
619
- (p || e.readonly) && P ? /* @__PURE__ */ n(it, { reason: P, onHover: c == null ? void 0 : c.onLockHover }) : p ? /* @__PURE__ */ n(G, { delayDuration: 200, children: /* @__PURE__ */ s(Q, { children: [
620
- /* @__PURE__ */ n(V, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(Be, { className: "h-3 w-3" }) }) }),
621
- /* @__PURE__ */ n(Y, { side: "top", className: "text-[12px]", children: "This field is locked" })
631
+ (m || e.readonly) && E ? /* @__PURE__ */ n(mt, { reason: E, onHover: s == null ? void 0 : s.onLockHover }) : m ? /* @__PURE__ */ n(Q, { delayDuration: 200, children: /* @__PURE__ */ d(Y, { children: [
632
+ /* @__PURE__ */ n(J, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(Ye, { className: "h-3 w-3" }) }) }),
633
+ /* @__PURE__ */ n(X, { side: "top", className: "text-[12px]", children: "This field is locked" })
622
634
  ] }) }) : null,
623
635
  S.length > 0 && (() => {
624
- const t = !!A && Object.keys(A).length > 0 && z.length > 0, r = S.map(
625
- (x) => W(String(x.parent_field))
636
+ const t = !!M && Object.keys(M).length > 0 && G.length > 0, r = S.map(
637
+ (x) => z(String(x.parent_field))
626
638
  );
627
- return /* @__PURE__ */ n(G, { delayDuration: 100, children: /* @__PURE__ */ s(Q, { children: [
628
- /* @__PURE__ */ n(V, { asChild: !0, children: /* @__PURE__ */ n(
639
+ return /* @__PURE__ */ n(Q, { delayDuration: 100, children: /* @__PURE__ */ d(Y, { children: [
640
+ /* @__PURE__ */ n(J, { asChild: !0, children: /* @__PURE__ */ n(
629
641
  "button",
630
642
  {
631
643
  type: "button",
632
- onClick: Ee,
633
- className: j(
644
+ onClick: Be,
645
+ className: P(
634
646
  "inline-flex items-center transition-colors",
635
647
  t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
636
648
  ),
637
- children: /* @__PURE__ */ n(He, { className: "h-3 w-3" })
649
+ children: /* @__PURE__ */ n(Je, { className: "h-3 w-3" })
638
650
  }
639
651
  ) }),
640
- /* @__PURE__ */ n(Y, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${z.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
652
+ /* @__PURE__ */ n(X, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${G.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
641
653
  ] }) });
642
654
  })()
643
655
  ] }),
644
- $.editor && !p && /* @__PURE__ */ n(
645
- ot,
656
+ $.editor && !m && /* @__PURE__ */ n(
657
+ pt,
646
658
  {
647
659
  editor: $.editor,
648
660
  confirming: $.confirming,
@@ -653,75 +665,76 @@ function Xt({
653
665
  h ?? /* @__PURE__ */ n(
654
666
  "div",
655
667
  {
656
- className: j(p && !Z && "cursor-not-allowed"),
657
- "data-tip": (p || e.readonly) && P ? P : void 0,
658
- onPointerEnter: (p || e.readonly) && P ? c == null ? void 0 : c.onLockHover : void 0,
668
+ className: P(m && !ee && "cursor-not-allowed"),
669
+ "data-tip": (m || e.readonly) && E ? E : void 0,
670
+ onPointerEnter: (m || e.readonly) && E ? s == null ? void 0 : s.onLockHover : void 0,
659
671
  children: /* @__PURE__ */ n(
660
672
  "div",
661
673
  {
662
- className: j(
674
+ className: P(
663
675
  // A locked FILE field stays interactive: its chips keep the
664
676
  // download link and preview click (the component itself hides
665
677
  // upload/replace/remove when readonly) — blocking pointer events
666
678
  // made attachments unopenable on every locked form (addendum
667
679
  // view, terminal states).
668
- p && !Z && "pointer-events-none opacity-60",
680
+ m && !ee && "pointer-events-none opacity-60",
669
681
  // The ring lands with a 2px shake so the eye finds the field;
670
682
  // the animation runs once when the class is added.
671
- d && "nvr-shake ring-1 ring-red-400 rounded-md",
672
- de && "nvr-autofill-glow"
683
+ u && "nvr-shake ring-1 ring-red-400 rounded-md",
684
+ me && "nvr-autofill-glow"
673
685
  ),
674
- children: Se ? /* @__PURE__ */ n(
675
- nt,
686
+ children: T ? /* @__PURE__ */ n(Tt, { field: e, values: o }) : De ? /* @__PURE__ */ n(
687
+ st,
676
688
  {
677
- collection: u,
689
+ collection: c,
678
690
  field: e,
679
691
  draft: o,
680
692
  itemId: i
681
693
  }
682
694
  ) : l ? l({
683
695
  field: e,
684
- value: ne,
696
+ value: re,
685
697
  onChange: (t) => f(e.field, t),
686
- disabled: p,
687
- collection: u,
698
+ disabled: m,
699
+ collection: c,
688
700
  itemId: i,
689
- relations: m,
690
- cascadeFilter: A,
691
- unsatisfiedParentLabel: Pe,
692
- requiredParentLabel: fe
701
+ relations: p,
702
+ cascadeFilter: M,
703
+ unsatisfiedParentLabel: Ue,
704
+ requiredParentLabel: ve
693
705
  }) : /* @__PURE__ */ n(
694
- dt,
706
+ xt,
695
707
  {
696
- field: p && Z ? { ...e, readonly: !0 } : e,
697
- value: ne,
708
+ field: m && ee ? { ...e, readonly: !0 } : e,
709
+ value: re,
698
710
  onChange: (t) => f(e.field, t),
699
- relations: m,
700
- collection: u,
711
+ relations: p,
712
+ collection: c,
701
713
  itemId: i,
702
- cascadeFilter: A,
703
- requiredParentLabel: fe,
704
- narrowedBy: z.length > 0 ? {
705
- labels: z,
706
- keys: xe,
714
+ cascadeFilter: M,
715
+ requiredParentLabel: ve,
716
+ narrowedBy: G.length > 0 ? {
717
+ labels: G,
718
+ keys: ge,
707
719
  onClear: (t) => f(t, null)
708
720
  } : void 0,
709
721
  onCountChange: y ? (t) => y(e.field, t) : void 0
710
722
  }
711
723
  )
712
724
  },
713
- de ?? 0
725
+ me ?? 0
714
726
  )
715
727
  }
716
728
  ),
717
- me && /* @__PURE__ */ n(
718
- st,
729
+ ye && /* @__PURE__ */ n(qt, { value: o[e.field], config: ye }),
730
+ xe && /* @__PURE__ */ n(
731
+ ht,
719
732
  {
720
- change: me,
721
- onDismiss: () => c == null ? void 0 : c.dismissRemoteChange(e.field),
722
- onTakeTheirs: c != null && c.takeRemoteChange ? () => {
733
+ change: xe,
734
+ onDismiss: () => s == null ? void 0 : s.dismissRemoteChange(e.field),
735
+ onTakeTheirs: s != null && s.takeRemoteChange ? () => {
723
736
  var t;
724
- return (t = c.takeRemoteChange) == null ? void 0 : t.call(c, e.field);
737
+ return (t = s.takeRemoteChange) == null ? void 0 : t.call(s, e.field);
725
738
  } : void 0
726
739
  }
727
740
  )
@@ -731,7 +744,7 @@ function Xt({
731
744
  );
732
745
  }
733
746
  export {
734
- Xt as FieldRow,
735
- Jt as lineageSummary,
736
- Ct as useFieldLineage
747
+ hn as FieldRow,
748
+ pn as lineageSummary,
749
+ Ot as useFieldLineage
737
750
  };