@nivaro/react 0.3.139 → 0.3.141

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 (100) hide show
  1. package/dist/components/InlineGridField.js +95 -92
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +39 -2
  5. package/dist/shared/components/AudienceConfirmPanel.js +19 -19
  6. package/dist/shared/components/BroadcastView.js +213 -211
  7. package/dist/shared/components/CollectionBrowserView.js +2702 -2671
  8. package/dist/shared/components/ConfigHistory.js +45 -45
  9. package/dist/shared/components/ConformanceView.js +110 -110
  10. package/dist/shared/components/DataTable.js +51 -51
  11. package/dist/shared/components/FilePreviewLightbox.js +26 -25
  12. package/dist/shared/components/ItemEditForm.js +3475 -3458
  13. package/dist/shared/components/LiveCount.js +27 -23
  14. package/dist/shared/components/LiveTraceView.js +62 -61
  15. package/dist/shared/components/PageRenderer.js +422 -410
  16. package/dist/shared/components/ProfileView.js +199 -199
  17. package/dist/shared/components/QualityRulesView.js +70 -70
  18. package/dist/shared/components/QueryTable.js +131 -130
  19. package/dist/shared/components/RecordGraph.js +98 -98
  20. package/dist/shared/components/RecordReadView.js +287 -288
  21. package/dist/shared/components/ReportView.js +1279 -1259
  22. package/dist/shared/components/RowPresence.js +83 -76
  23. package/dist/shared/components/SlaRulesView.js +73 -74
  24. package/dist/shared/components/UnseenDot.js +183 -22
  25. package/dist/shared/components/WidgetSlot.js +73 -73
  26. package/dist/shared/components/ai/AiChart.js +36 -32
  27. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  28. package/dist/shared/components/ai/TaskDo.js +87 -87
  29. package/dist/shared/components/ai/answer-formats.js +37 -30
  30. package/dist/shared/components/ai/call-log/format.js +17 -16
  31. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  32. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  33. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  34. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  35. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  36. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  37. package/dist/shared/components/cbv/column-totals.js +53 -51
  38. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  40. package/dist/shared/components/command-center/announce.js +7 -6
  41. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  42. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  43. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  44. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  45. package/dist/shared/components/delivery-analytics/drill.js +32 -32
  46. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  47. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  48. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  49. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  50. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  51. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  52. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  53. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  54. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  55. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  56. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  57. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  58. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  59. package/dist/shared/components/item-edit/InlineTableField.js +1390 -1376
  60. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  61. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  62. package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
  63. package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
  64. package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
  65. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  66. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  67. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
  68. package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
  69. package/dist/shared/components/layout-editor/settings/controls.js +98 -90
  70. package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
  71. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  72. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  73. package/dist/shared/components/ops-report/format.js +37 -36
  74. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  75. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  76. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  77. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  78. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  79. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  80. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  81. package/dist/shared/components/profile/DelegationCard.js +13 -12
  82. package/dist/shared/components/profile/PersonActivity.js +48 -48
  83. package/dist/shared/components/profile/PersonExtras.js +107 -107
  84. package/dist/shared/components/profile/PersonWeek.js +9 -9
  85. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  86. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  87. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  88. package/dist/shared/components/queue/QueueWorklist.js +884 -872
  89. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  90. package/dist/shared/components/support/RequestList.js +123 -123
  91. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  92. package/dist/shared/lib/activity-sentence.js +251 -229
  93. package/dist/shared/lib/format-value.js +5 -4
  94. package/dist/shared/lib/layout-resolve.js +64 -48
  95. package/dist/shared/lib/number-format.js +87 -0
  96. package/dist/shared/lib/number-kind.js +133 -0
  97. package/dist/shared/lib/utils.js +24 -20
  98. package/dist/shared/lib/watch-list.js +1 -1
  99. package/dist/shared/lib/widget-value-format.js +26 -12
  100. package/package.json +1 -1
@@ -1,40 +1,42 @@
1
1
  import { jsx as t, jsxs as p, Fragment as me } from "react/jsx-runtime";
2
- import { useQuery as U, useQueryClient as kt } from "@tanstack/react-query";
3
- import { Pencil as Bt, ChevronDown as It } from "lucide-react";
4
- import { useMemo as ke, useRef as Xe, useState as H, useEffect as fe, useCallback as gt, Fragment as Ht } from "react";
5
- import { DrilldownContext as Ut, useNivaroClient as Ne, useApiFetchConfig as Vt, useDrilldown as Nt } from "../context.js";
6
- import { useDebounced as Gt } from "../hooks/useDebounced.js";
7
- import { parseAllowedCollections as Jt } from "../lib/allowed-collections.js";
8
- import { get as z, patch as Qt } from "../lib/commands.js";
9
- import { toastError as zt } from "../lib/error-toast.js";
10
- import { readGroupStructure as Yt, isFolded as Xt, isEmptyValue as ve, planFieldGrid as Zt } from "../lib/form-structure.js";
11
- import { quietHiddenSectionsOf as el } from "../lib/layout-resolve.js";
12
- import { useLiveRecord as tl } from "../lib/live.js";
13
- import { isDisplayFormulaField as Le, resolvePlacementText as ll, displayFormulaOf as rl, formatDisplayValue as nl } from "../lib/placement-behaviour.js";
14
- import { invalidateRecordRow as al, useRecordReader as il } from "../lib/record-loader.js";
15
- import { sanitizeHtml as sl } from "../lib/sanitize-html.js";
16
- import { titleCase as Ze, formatRelative as je } from "../lib/utils.js";
17
- import { matchesVisibleWhen as dl } from "../lib/visible-when.js";
18
- import { InboundRequestPopover as ol } from "./integrations/InboundRequest.js";
19
- import { FileM2MField as cl } from "./item-edit/FilePickerField.js";
20
- import { useFieldTouches as ul } from "./item-edit/HeaderFreshness.js";
21
- import { richTextToPlain as ml } from "./item-edit/helpers.js";
22
- import { isNamelessLabel as fl, NAMELESS_LABEL as pl } from "./item-edit/option-disambiguate.js";
23
- import { PersonalDefaultMark as yt } from "./item-edit/PersonalDefaultControl.js";
24
- import { usePlacementTextContext as hl, evaluateDisplayFormula as bl } from "./item-edit/placement-behaviour.js";
25
- import { RuleHiddenNotes as gl } from "./item-edit/RuleHiddenNotes.js";
26
- import { RELATED_LOADING_CLASS as yl, RelatedMissingLabel as xl } from "./item-edit/related-missing.js";
27
- import { ruleHiddenGroups as vl, groupHasReadableField as _l } from "./item-edit/rule-hidden.js";
28
- import { UserChip as wt } from "./item-edit/UserChip.js";
29
- import { DesignNode as kl } from "./layout-editor/DesignNode.js";
30
- import { DesignCanvas as Nl } from "./layout-editor/design-canvas.js";
31
- import { revealGroupKey as wl } from "./layout-editor/design-context.js";
32
- import { choiceLabelsFrom as Sl } from "./layout-editor/overview/describe-conditions.js";
33
- import { useRecordIntegrity as $l, integrityByField as Fl } from "./panels/RecordIntegrityBanner.js";
34
- import { RecordHoverCard as et } from "./RecordHoverCard.js";
35
- import { RelativeTime as ql } from "./RelativeTime.js";
36
- import { SimpleSelectXs as xt } from "./ui/SimpleSelect.js";
37
- import { WidgetSlot as Rl } from "./WidgetSlot.js";
2
+ import { useQuery as H, useQueryClient as _t } from "@tanstack/react-query";
3
+ import { Pencil as Ut, ChevronDown as Ht } from "lucide-react";
4
+ import { useMemo as ke, useRef as Ye, useState as U, useEffect as fe, useCallback as bt, Fragment as Vt } from "react";
5
+ import { DrilldownContext as Gt, useNivaroClient as we, useApiFetchConfig as Jt, useDrilldown as kt } from "../context.js";
6
+ import { useDebounced as Qt } from "../hooks/useDebounced.js";
7
+ import { parseAllowedCollections as zt } from "../lib/allowed-collections.js";
8
+ import { get as z, patch as Yt } from "../lib/commands.js";
9
+ import { toastError as Xt } from "../lib/error-toast.js";
10
+ import { readGroupStructure as Zt, isFolded as el, isEmptyValue as ve, planFieldGrid as tl } from "../lib/form-structure.js";
11
+ import { quietHiddenSectionsOf as ll } from "../lib/layout-resolve.js";
12
+ import { useLiveRecord as rl } from "../lib/live.js";
13
+ import { formatCurrency as wt, formatFieldNumber as Nt, formatGrouped as nl } from "../lib/number-format.js";
14
+ import { isDisplayFormulaField as Le, resolvePlacementText as al, displayFormulaOf as il, formatDisplayValue as sl } from "../lib/placement-behaviour.js";
15
+ import { invalidateRecordRow as dl, useRecordReader as ol } from "../lib/record-loader.js";
16
+ import { sanitizeHtml as cl } from "../lib/sanitize-html.js";
17
+ import { titleCase as Xe, formatRelative as je } from "../lib/utils.js";
18
+ import { matchesVisibleWhen as ul } from "../lib/visible-when.js";
19
+ import { InboundRequestPopover as ml } from "./integrations/InboundRequest.js";
20
+ import { FileM2MField as fl } from "./item-edit/FilePickerField.js";
21
+ import { useFieldTouches as pl } from "./item-edit/HeaderFreshness.js";
22
+ import { richTextToPlain as hl } from "./item-edit/helpers.js";
23
+ import { isNamelessLabel as bl, NAMELESS_LABEL as gl } from "./item-edit/option-disambiguate.js";
24
+ import { PersonalDefaultMark as gt } from "./item-edit/PersonalDefaultControl.js";
25
+ import { usePlacementTextContext as yl, evaluateDisplayFormula as xl } from "./item-edit/placement-behaviour.js";
26
+ import { RuleHiddenNotes as vl } from "./item-edit/RuleHiddenNotes.js";
27
+ import { RELATED_LOADING_CLASS as _l, RelatedMissingLabel as kl } from "./item-edit/related-missing.js";
28
+ import { ruleHiddenGroups as wl, groupHasReadableField as Nl } from "./item-edit/rule-hidden.js";
29
+ import { UserChip as St } from "./item-edit/UserChip.js";
30
+ import { DesignNode as Sl } from "./layout-editor/DesignNode.js";
31
+ import { DesignCanvas as $l } from "./layout-editor/design-canvas.js";
32
+ import { revealGroupKey as Fl } from "./layout-editor/design-context.js";
33
+ import { choiceLabelsFrom as ql } from "./layout-editor/overview/describe-conditions.js";
34
+ import { useRecordIntegrity as Rl, integrityByField as Al } from "./panels/RecordIntegrityBanner.js";
35
+ import { RecordHoverCard as Ze } from "./RecordHoverCard.js";
36
+ import { RelativeTime as Cl } from "./RelativeTime.js";
37
+ import { SimpleSelectXs as yt } from "./ui/SimpleSelect.js";
38
+ import { WidgetSlot as Ol } from "./WidgetSlot.js";
39
+ import { numberCurrencyOf as $t, numberKindOf as et } from "../lib/number-kind.js";
38
40
  const _e = (a) => {
39
41
  if (!a) return {};
40
42
  if (typeof a == "object") return a;
@@ -43,8 +45,8 @@ const _e = (a) => {
43
45
  } catch {
44
46
  return {};
45
47
  }
46
- }, Al = 3;
47
- function Tl(a) {
48
+ }, Tl = 3;
49
+ function Ll(a) {
48
50
  let u = a;
49
51
  if (typeof u == "string")
50
52
  try {
@@ -57,43 +59,40 @@ function Tl(a) {
57
59
  for (const i of u)
58
60
  if (typeof i == "string" && i) h.push({ field: i, label: null });
59
61
  else if (i && typeof i == "object" && typeof i.field == "string") {
60
- const w = i.label;
62
+ const N = i.label;
61
63
  h.push({
62
64
  field: i.field,
63
- label: typeof w == "string" && w.trim() ? w.trim() : null
65
+ label: typeof N == "string" && N.trim() ? N.trim() : null
64
66
  });
65
67
  }
66
68
  return h.filter((i) => !i.field.startsWith("__"));
67
69
  }
68
- const St = (a) => {
70
+ const Ft = (a) => {
69
71
  const u = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
70
72
  if (u) return `${u[2]}/${u[3]}/${u[1]}`;
71
73
  const h = new Date(String(a));
72
74
  return Number.isNaN(h.getTime()) ? String(a) : `${String(h.getMonth() + 1).padStart(2, "0")}/${String(h.getDate()).padStart(2, "0")}/${h.getFullYear()}`;
73
- }, tt = (a) => {
74
- const u = Number(a);
75
- return Number.isNaN(u) ? String(a) : `$${u.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
76
- }, Be = (a) => {
75
+ }, El = (a) => {
77
76
  const u = Number(a);
78
77
  return Number.isNaN(u) ? String(a) : u.toLocaleString("en-US");
79
- }, lt = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", vt = `${lt} flex min-w-0 items-center whitespace-nowrap`;
80
- function Cl({ name: a, at: u }) {
81
- const h = Xe(null), [i, w] = H(!1), _ = Xe(0);
78
+ }, tt = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", xt = `${tt} flex min-w-0 items-center whitespace-nowrap`;
79
+ function Dl({ name: a, at: u }) {
80
+ const h = Ye(null), [i, N] = U(!1), _ = Ye(0);
82
81
  return fe(() => {
83
- const x = h.current, S = x == null ? void 0 : x.parentElement, N = S == null ? void 0 : S.parentElement;
84
- if (!x || !S || !N || typeof ResizeObserver > "u") return;
82
+ const x = h.current, S = x == null ? void 0 : x.parentElement, w = S == null ? void 0 : S.parentElement;
83
+ if (!x || !S || !w || typeof ResizeObserver > "u") return;
85
84
  const m = () => {
86
85
  if (!i) {
87
- const L = x.scrollWidth - x.clientWidth;
88
- L > 0.5 && (_.current = S.getBoundingClientRect().width + L, w(!0));
86
+ const T = x.scrollWidth - x.clientWidth;
87
+ T > 0.5 && (_.current = S.getBoundingClientRect().width + T, N(!0));
89
88
  return;
90
89
  }
91
- const F = N.getBoundingClientRect().right - S.getBoundingClientRect().left;
92
- _.current && F >= _.current + 1 && w(!1);
90
+ const F = w.getBoundingClientRect().right - S.getBoundingClientRect().left;
91
+ _.current && F >= _.current + 1 && N(!1);
93
92
  };
94
93
  m();
95
- const T = new ResizeObserver(m);
96
- return T.observe(N), () => T.disconnect();
94
+ const C = new ResizeObserver(m);
95
+ return C.observe(w), () => C.disconnect();
97
96
  }, [i]), /* @__PURE__ */ p(
98
97
  "span",
99
98
  {
@@ -105,13 +104,13 @@ function Cl({ name: a, at: u }) {
105
104
  a,
106
105
  !i && /* @__PURE__ */ p(me, { children: [
107
106
  " · ",
108
- /* @__PURE__ */ t(ql, { value: u })
107
+ /* @__PURE__ */ t(Cl, { value: u })
109
108
  ] })
110
109
  ]
111
110
  }
112
111
  );
113
112
  }
114
- const le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Ol = `
113
+ const le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Pl = `
115
114
  [data-read-board]{grid-template-columns:minmax(0,1fr)}
116
115
  [data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
117
116
  @media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@@ -126,7 +125,7 @@ const le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:tex
126
125
  }
127
126
  @media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
128
127
  `;
129
- function Ie({
128
+ function Be({
130
129
  value: a,
131
130
  trueTone: u = "positive"
132
131
  }) {
@@ -139,8 +138,8 @@ function Ie({
139
138
  }
140
139
  );
141
140
  }
142
- function Ll({ collection: a, id: u }) {
143
- const h = Ne(), i = il(), w = Nt(), { data: _ } = U({
141
+ function Kl({ collection: a, id: u }) {
142
+ const h = we(), i = ol(), N = kt(), { data: _ } = H({
144
143
  queryKey: ["cbv-collection-meta", a],
145
144
  queryFn: () => h.request(
146
145
  z(`/collections/${a}`)
@@ -150,8 +149,8 @@ function Ll({ collection: a, id: u }) {
150
149
  }), {
151
150
  data: x,
152
151
  isPending: S,
153
- error: N
154
- } = U({
152
+ error: w
153
+ } = H({
155
154
  queryKey: ["rrv-related", a, String(u)],
156
155
  queryFn: () => i(a, u),
157
156
  enabled: u != null && !!_,
@@ -159,13 +158,13 @@ function Ll({ collection: a, id: u }) {
159
158
  retry: !1
160
159
  });
161
160
  if (u == null) return /* @__PURE__ */ t(le, {});
162
- if (!x && !N && (S || !_))
163
- return /* @__PURE__ */ t("span", { className: yl });
164
- if (!x) return /* @__PURE__ */ t(xl, { error: N, collection: a, id: u });
161
+ if (!x && !w && (S || !_))
162
+ return /* @__PURE__ */ t("span", { className: _l });
163
+ if (!x) return /* @__PURE__ */ t(kl, { error: w, collection: a, id: u });
165
164
  let m = "";
166
- const T = _ == null ? void 0 : _.display_template;
167
- if (T && (m = T.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (F, L) => {
168
- const q = L.split(".").reduce((v, g) => v == null ? void 0 : v[g], x);
165
+ const C = _ == null ? void 0 : _.display_template;
166
+ if (C && (m = C.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (F, T) => {
167
+ const q = T.split(".").reduce((v, g) => v == null ? void 0 : v[g], x);
169
168
  return q == null ? "" : String(q);
170
169
  }).trim()), !m) {
171
170
  for (const F of [
@@ -183,18 +182,18 @@ function Ll({ collection: a, id: u }) {
183
182
  break;
184
183
  }
185
184
  }
186
- return fl(m) && (m = pl), w ? /* @__PURE__ */ t(et, { collection: a, id: u, children: /* @__PURE__ */ t(
185
+ return bl(m) && (m = gl), N ? /* @__PURE__ */ t(Ze, { collection: a, id: u, children: /* @__PURE__ */ t(
187
186
  "button",
188
187
  {
189
188
  type: "button",
190
- onClick: () => w.open({ collection: a, itemId: String(u) }),
189
+ onClick: () => N.open({ collection: a, itemId: String(u) }),
191
190
  className: "inline-block max-w-full truncate text-left align-bottom underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
192
191
  children: m
193
192
  }
194
- ) }) : /* @__PURE__ */ t(et, { collection: a, id: u, children: m });
193
+ ) }) : /* @__PURE__ */ t(Ze, { collection: a, id: u, children: m });
195
194
  }
196
- function El({ id: a }) {
197
- const u = Ne(), { apiBase: h } = Vt(), { data: i, isPending: w } = U({
195
+ function Wl({ id: a }) {
196
+ const u = we(), { apiBase: h } = Jt(), { data: i, isPending: N } = H({
198
197
  queryKey: ["rrv-file-meta", String(a)],
199
198
  queryFn: () => u.request(
200
199
  z(`/files/${a}/meta`)
@@ -204,7 +203,7 @@ function El({ id: a }) {
204
203
  retry: !1
205
204
  });
206
205
  if (a == null) return /* @__PURE__ */ t(le, {});
207
- if (!i && w)
206
+ if (!i && N)
208
207
  return /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
209
208
  const _ = (i == null ? void 0 : i.title) || (i == null ? void 0 : i.filename_download) || `#${String(a)}`;
210
209
  return /* @__PURE__ */ t(
@@ -218,25 +217,25 @@ function El({ id: a }) {
218
217
  }
219
218
  );
220
219
  }
221
- const rt = ({ collection: a, id: u }) => a === "nivaro_files" ? /* @__PURE__ */ t(El, { id: u }) : /* @__PURE__ */ t(Ll, { collection: a, id: u });
222
- function Dl({
220
+ const lt = ({ collection: a, id: u }) => a === "nivaro_files" ? /* @__PURE__ */ t(Wl, { id: u }) : /* @__PURE__ */ t(Kl, { collection: a, id: u });
221
+ function Ml({
223
222
  junction: a,
224
223
  parentFk: u,
225
224
  junctionField: h,
226
225
  parentId: i,
227
- onCount: w,
226
+ onCount: N,
228
227
  onTarget: _,
229
228
  relation: x
230
229
  }) {
231
230
  var j;
232
- const S = Ne(), { data: N } = U({
231
+ const S = we(), { data: w } = H({
233
232
  queryKey: ["cbv-collection-meta", a],
234
233
  queryFn: () => S.request(z(`/collections/${a}`)).then((k) => k.data),
235
234
  staleTime: 10 * 6e4,
236
235
  retry: !1
237
- }), m = ((N == null ? void 0 : N.relations) ?? []).find(
236
+ }), m = ((w == null ? void 0 : w.relations) ?? []).find(
238
237
  (k) => k.many_collection === a && k.many_field === h
239
- ), T = Jt(m == null ? void 0 : m.one_allowed_collections), F = !!m && !m.one_collection && (T.length > 0 || !!m.one_collection_field), L = (m == null ? void 0 : m.one_collection_field) ?? "collection", q = (k) => k ? k === "directus_users" ? "nivaro_users" : k : null, v = (m == null ? void 0 : m.one_collection) ?? (F ? T.some((k) => k === "directus_users" || k === "nivaro_users") ? "nivaro_users" : q(T[0]) : null), { data: g } = U({
238
+ ), C = zt(m == null ? void 0 : m.one_allowed_collections), F = !!m && !m.one_collection && (C.length > 0 || !!m.one_collection_field), T = (m == null ? void 0 : m.one_collection_field) ?? "collection", q = (k) => k ? k === "directus_users" ? "nivaro_users" : k : null, v = (m == null ? void 0 : m.one_collection) ?? (F ? C.some((k) => k === "directus_users" || k === "nivaro_users") ? "nivaro_users" : q(C[0]) : null), { data: g } = H({
240
239
  // Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
241
240
  // so never the same cache entry): every link write that refreshes the form's list —
242
241
  // a file upload, a picker change, the save itself — refreshes Summary's too. Its own
@@ -248,12 +247,12 @@ function Dl({
248
247
  i,
249
248
  "rrv",
250
249
  h,
251
- F ? L : ""
250
+ F ? T : ""
252
251
  ],
253
252
  queryFn: () => S.request(
254
253
  z(`/items/${a}`, {
255
254
  filter: JSON.stringify({ [u]: { _eq: i } }),
256
- fields: F ? `id,${h},${L}` : `id,${h}`,
255
+ fields: F ? `id,${h},${T}` : `id,${h}`,
257
256
  limit: 200
258
257
  })
259
258
  ).then(
@@ -261,21 +260,21 @@ function Dl({
261
260
  const A = $[h];
262
261
  return {
263
262
  id: String(typeof A == "object" ? A.id : A),
264
- collection: F ? q($[L]) : null
263
+ collection: F ? q($[T]) : null
265
264
  };
266
265
  })
267
266
  ).catch(() => []),
268
267
  // The fields list depends on the companion leg — wait for it.
269
- enabled: !!N,
268
+ enabled: !!w,
270
269
  staleTime: 3e4,
271
270
  retry: !1
272
271
  }), E = g == null ? void 0 : g.map((k) => k.id), R = v ?? (F ? ((j = g == null ? void 0 : g.find((k) => k.collection)) == null ? void 0 : j.collection) ?? null : null), D = E == null ? void 0 : E.length;
273
272
  return fe(() => {
274
- D !== void 0 && (w == null || w(D));
275
- }, [D, w]), fe(() => {
273
+ D !== void 0 && (N == null || N(D));
274
+ }, [D, N]), fe(() => {
276
275
  R && (_ == null || _(R));
277
- }, [R, _]), N && !R && (!F || g) ? /* @__PURE__ */ t(le, {}) : !E || !R ? /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : E.length === 0 ? /* @__PURE__ */ t(le, {}) : R === "nivaro_files" && x ? /* @__PURE__ */ t("div", { className: "mt-1", children: /* @__PURE__ */ t(
278
- cl,
276
+ }, [R, _]), w && !R && (!F || g) ? /* @__PURE__ */ t(le, {}) : !E || !R ? /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : E.length === 0 ? /* @__PURE__ */ t(le, {}) : R === "nivaro_files" && x ? /* @__PURE__ */ t("div", { className: "mt-1", children: /* @__PURE__ */ t(
277
+ fl,
279
278
  {
280
279
  relation: x,
281
280
  parentId: i,
@@ -287,38 +286,38 @@ function Dl({
287
286
  {
288
287
  className: "inline-flex items-center whitespace-nowrap",
289
288
  children: [
290
- /* @__PURE__ */ t(rt, { collection: $ ?? R, id: k }),
289
+ /* @__PURE__ */ t(lt, { collection: $ ?? R, id: k }),
291
290
  A < E.length - 1 && /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
292
291
  ]
293
292
  },
294
293
  `${$ ?? R}:${k}`
295
294
  )) });
296
295
  }
297
- function Pl({
296
+ function jl({
298
297
  collection: a,
299
298
  fkField: u,
300
299
  parentId: h,
301
300
  layoutId: i,
302
- presets: w,
301
+ presets: N,
303
302
  defaultPreset: _,
304
303
  onCount: x
305
304
  }) {
306
- const S = Ne(), N = Nt(), m = (w ?? []).filter((l) => l && Array.isArray(l.columns)), [T, F] = H(
305
+ const S = we(), w = kt(), m = (N ?? []).filter((l) => l && Array.isArray(l.columns)), [C, F] = U(
307
306
  () => {
308
307
  var l;
309
308
  return m.length >= 2 ? ((l = m.find((d) => d.name === _)) == null ? void 0 : l.name) ?? m[0].name : "__all__";
310
309
  }
311
- ), { data: L } = U({
310
+ ), { data: T } = H({
312
311
  queryKey: ["cbv-collection-meta", a],
313
312
  queryFn: () => S.request(z(`/collections/${a}`)).then((l) => l.data),
314
313
  staleTime: 10 * 6e4,
315
314
  retry: !1
316
315
  }), q = (l) => {
317
316
  var d;
318
- return ((d = ((L == null ? void 0 : L.relations) ?? []).find(
317
+ return ((d = ((T == null ? void 0 : T.relations) ?? []).find(
319
318
  (o) => o.many_collection === a && o.many_field === l && o.one_collection
320
319
  )) == null ? void 0 : d.one_collection) ?? null;
321
- }, { data: v } = U({
320
+ }, { data: v } = H({
322
321
  queryKey: ["rrv-cols", a, i ?? null],
323
322
  queryFn: () => S.request(
324
323
  z(`/field-config/${a}`, i ? { layout_id: i } : {})
@@ -338,21 +337,21 @@ function Pl({
338
337
  "timestamp",
339
338
  "uuid"
340
339
  ].includes(d.type ?? ""))
341
- ).filter((d, o, b) => b.findIndex((O) => O.field === d.field) === o)
340
+ ).filter((d, o, b) => b.findIndex((L) => L.field === d.field) === o)
342
341
  })),
343
342
  staleTime: 5 * 6e4,
344
343
  retry: !1
345
- }), g = (v == null ? void 0 : v.cols) ?? [], E = !!(v != null && v.lineNo), R = T !== "__all__" ? m.find((l) => l.name === T) : null, D = ke(() => {
344
+ }), g = (v == null ? void 0 : v.cols) ?? [], E = !!(v != null && v.lineNo), R = C !== "__all__" ? m.find((l) => l.name === C) : null, D = ke(() => {
346
345
  if (!R) return g;
347
346
  const l = new Set(R.columns), d = g.filter((o) => l.has(o.field));
348
347
  return d.length > 0 ? d : g;
349
- }, [g, R]), [j, k] = H(""), [$, A] = H(1), [ie, V] = H({}), Z = Gt(ie, 350), Ee = ke(() => {
348
+ }, [g, R]), [j, k] = U(""), [$, A] = U(1), [ie, V] = U({}), Z = Qt(ie, 350), Ee = ke(() => {
350
349
  const l = [
351
350
  { path: [u], op: "_eq", value: h }
352
351
  ];
353
352
  for (const [d, o] of Object.entries(Z)) {
354
353
  if (!(o != null && o.value.trim())) continue;
355
- const b = o.value.trim(), O = Number(b), W = o.op === "_contains" ? b : b === "true" || b === "false" ? b === "true" : Number.isNaN(O) ? b : O;
354
+ const b = o.value.trim(), L = Number(b), W = o.op === "_contains" ? b : b === "true" || b === "false" ? b === "true" : Number.isNaN(L) ? b : L;
356
355
  l.push({ path: [d], op: o.op, value: W });
357
356
  }
358
357
  return JSON.stringify(l);
@@ -360,7 +359,7 @@ function Pl({
360
359
  data: G,
361
360
  isLoading: pe,
362
361
  isFetching: De
363
- } = U({
362
+ } = H({
364
363
  queryKey: ["rrv-rows", a, u, h, j, E, $, Ee],
365
364
  queryFn: () => S.request(
366
365
  z(`/items/${a}`, {
@@ -377,7 +376,7 @@ function Pl({
377
376
  fe(() => {
378
377
  G && !I && (x == null || x(ee));
379
378
  }, [G, I, ee, x]);
380
- const he = D.filter((l) => l.field.includes(".")), be = P.map((l) => String(l.id)), { data: Y } = U({
379
+ const he = D.filter((l) => l.field.includes(".")), be = P.map((l) => String(l.id)), { data: Y } = H({
381
380
  queryKey: [
382
381
  "rrv-resolve-paths",
383
382
  a,
@@ -392,12 +391,12 @@ function Pl({
392
391
  ).then((l) => l.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
393
392
  enabled: he.length > 0 && be.length > 0,
394
393
  staleTime: 3e4
395
- }), M = E && P.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee / f)), de = (l, d, o) => {
394
+ }), K = E && P.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee / f)), de = (l, d, o) => {
396
395
  A(1), V((b) => {
397
- const O = { ...b };
398
- return o ? O[l] = { op: d, value: o } : delete O[l], O;
396
+ const L = { ...b };
397
+ return o ? L[l] = { op: d, value: o } : delete L[l], L;
399
398
  });
400
- }, He = (l) => {
399
+ }, Ie = (l) => {
401
400
  A(1), k((d) => d === l ? `-${l}` : d === `-${l}` ? "" : l);
402
401
  };
403
402
  if (pe)
@@ -418,12 +417,12 @@ function Pl({
418
417
  return /* @__PURE__ */ t("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
419
418
  if (!ne || ne.value === "") return /* @__PURE__ */ t(le, {});
420
419
  const qe = Y.targets[d.field], ge = (re = ne.ids) == null ? void 0 : re[0];
421
- return N && qe && ge ? /* @__PURE__ */ t(et, { collection: qe, id: ge, children: /* @__PURE__ */ t(
420
+ return w && qe && ge ? /* @__PURE__ */ t(Ze, { collection: qe, id: ge, children: /* @__PURE__ */ t(
422
421
  "button",
423
422
  {
424
423
  type: "button",
425
- onClick: (Ve) => {
426
- Ve.stopPropagation(), N.open({ collection: qe, itemId: String(ge) });
424
+ onClick: (He) => {
425
+ He.stopPropagation(), w.open({ collection: qe, itemId: String(ge) });
427
426
  },
428
427
  className: "inline-block max-w-full truncate text-left align-bottom underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
429
428
  children: ne.value
@@ -431,18 +430,18 @@ function Pl({
431
430
  ) }) : ne.value;
432
431
  }
433
432
  const o = l[d.field];
434
- if (d.type === "boolean" && o == null) return /* @__PURE__ */ t(Ie, { value: !1 });
433
+ if (d.type === "boolean" && o == null) return /* @__PURE__ */ t(Be, { value: !1 });
435
434
  if (o == null || o === "") return /* @__PURE__ */ t(le, {});
436
435
  const b = q(d.field);
437
436
  if (b === "nivaro_users")
438
- return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(wt, { userId: String(o), size: "compact" }) });
439
- if (b) return /* @__PURE__ */ t(rt, { collection: b, id: o });
440
- if (d.type === "boolean") return /* @__PURE__ */ t(Ie, { value: o });
441
- if (d.type === "decimal" || d.type === "float") return tt(o);
442
- if (d.type === "integer") return Be(o);
443
- if (d.type === "date" || d.type === "datetime" || d.type === "timestamp") return St(o);
444
- const O = String(o);
445
- return O.length > 48 ? `${O.slice(0, 48)}…` : O;
437
+ return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(St, { userId: String(o), size: "compact" }) });
438
+ if (b) return /* @__PURE__ */ t(lt, { collection: b, id: o });
439
+ if (d.type === "boolean") return /* @__PURE__ */ t(Be, { value: o });
440
+ if (d.type === "decimal" || d.type === "float" || d.type === "integer")
441
+ return Nt(o, d) || String(o);
442
+ if (d.type === "date" || d.type === "datetime" || d.type === "timestamp") return Ft(o);
443
+ const L = String(o);
444
+ return L.length > 48 ? `${L.slice(0, 48)}…` : L;
446
445
  }, oe = (l) => ["decimal", "float", "integer"].includes(l.type ?? "") && !q(l.field) && !l.field.includes("."), Pe = (l) => {
447
446
  const d = l.options;
448
447
  if (!d) return {};
@@ -453,17 +452,17 @@ function Pl({
453
452
  return {};
454
453
  }
455
454
  return d;
456
- }, we = (l) => {
455
+ }, Ne = (l) => {
457
456
  const d = Pe(l).aggregate;
458
457
  return typeof d == "string" && ["sum", "avg", "min", "max", "count"].includes(d) ? d : null;
459
- }, Me = D.some((l) => we(l)), Se = (l) => {
460
- const d = we(l);
458
+ }, Ke = D.some((l) => Ne(l)), Se = (l) => {
459
+ const d = Ne(l);
461
460
  if (!d) return null;
462
461
  const o = P.map((W) => Number(W[l.field])).filter((W) => !Number.isNaN(W));
463
462
  let b = null;
464
463
  if (d === "count" ? b = P.length : o.length > 0 && (d === "sum" ? b = o.reduce((W, re) => W + re, 0) : d === "avg" ? b = o.reduce((W, re) => W + re, 0) / o.length : d === "min" ? b = Math.min(...o) : d === "max" && (b = Math.max(...o))), b === null) return "—";
465
- const O = Pe(l).format;
466
- return d === "count" || O === "int" ? Be(Math.round(b)) : O === "currency" || l.type === "decimal" || l.type === "float" ? tt(b) : d === "avg" ? b.toFixed(2) : Be(b);
464
+ const L = Pe(l).format;
465
+ return d === "count" || L === "int" ? El(Math.round(b)) : et(l) === "money" ? wt(b, { currency: $t(l) ?? "USD" }) : nl(b, 2);
467
466
  }, $e = (l) => !q(l.field) && !l.field.includes("."), We = (l) => q(l.field) || l.field.includes(".") ? null : l.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(l.type ?? "") ? "num" : ["string", "text"].includes(l.type ?? "") ? "text" : null, Fe = D.some((l) => We(l) != null);
468
467
  return /* @__PURE__ */ p("div", { children: [
469
468
  m.length >= 2 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
@@ -474,8 +473,8 @@ function Pl({
474
473
  {
475
474
  type: "button",
476
475
  onClick: () => F(l.name),
477
- "aria-pressed": T === l.name,
478
- className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${T === l.name ? "border-nvr-cyan bg-nvr-cyan/10 text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800"}`,
476
+ "aria-pressed": C === l.name,
477
+ className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${C === l.name ? "border-nvr-cyan bg-nvr-cyan/10 text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800"}`,
479
478
  children: l.label
480
479
  },
481
480
  l.name
@@ -487,16 +486,16 @@ function Pl({
487
486
  children: /* @__PURE__ */ p("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
488
487
  /* @__PURE__ */ p("thead", { children: [
489
488
  /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
490
- M && /* @__PURE__ */ t("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "#" }),
489
+ K && /* @__PURE__ */ t("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "#" }),
491
490
  D.map((l) => {
492
491
  const d = j === l.field || j === `-${l.field}`;
493
492
  return /* @__PURE__ */ p(
494
493
  "th",
495
494
  {
496
- onClick: () => $e(l) && He(l.field),
495
+ onClick: () => $e(l) && Ie(l.field),
497
496
  className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${oe(l) ? "text-right" : "text-left"} ${$e(l) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
498
497
  children: [
499
- l.label || Ze(l.field),
498
+ l.label || Xe(l.field),
500
499
  $e(l) && /* @__PURE__ */ t("span", { className: d ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: d ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
501
500
  ]
502
501
  },
@@ -505,7 +504,7 @@ function Pl({
505
504
  })
506
505
  ] }),
507
506
  Fe && /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
508
- M && /* @__PURE__ */ t("th", { className: "px-1.5 py-1" }),
507
+ K && /* @__PURE__ */ t("th", { className: "px-1.5 py-1" }),
509
508
  D.map((l) => {
510
509
  const d = We(l), o = ie[l.field];
511
510
  return /* @__PURE__ */ p("th", { className: "px-1.5 py-1 font-normal", children: [
@@ -521,7 +520,7 @@ function Pl({
521
520
  ),
522
521
  d === "num" && /* @__PURE__ */ p("span", { className: "flex items-center gap-0.5", children: [
523
522
  /* @__PURE__ */ t(
524
- xt,
523
+ yt,
525
524
  {
526
525
  value: (o == null ? void 0 : o.op) ?? "_eq",
527
526
  onChange: (b) => de(l.field, b, (o == null ? void 0 : o.value) ?? ""),
@@ -545,7 +544,7 @@ function Pl({
545
544
  )
546
545
  ] }),
547
546
  d === "bool" && /* @__PURE__ */ t(
548
- xt,
547
+ yt,
549
548
  {
550
549
  value: (o == null ? void 0 : o.value) ?? "",
551
550
  onChange: (b) => de(l.field, "_eq", b),
@@ -566,7 +565,7 @@ function Pl({
566
565
  P.length === 0 && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
567
566
  "td",
568
567
  {
569
- colSpan: D.length + (M ? 1 : 0),
568
+ colSpan: D.length + (K ? 1 : 0),
570
569
  className: "py-4 text-center text-[12px] text-slate-400",
571
570
  children: "No matches — adjust filters"
572
571
  }
@@ -574,10 +573,10 @@ function Pl({
574
573
  P.map((l) => /* @__PURE__ */ p(
575
574
  "tr",
576
575
  {
577
- onClick: N ? () => N.open({ collection: a, itemId: String(l.id) }) : void 0,
578
- className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${N ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
576
+ onClick: w ? () => w.open({ collection: a, itemId: String(l.id) }) : void 0,
577
+ className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${w ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
579
578
  children: [
580
- M && /* @__PURE__ */ t("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: l.line_number == null ? "" : String(l.line_number) }),
579
+ K && /* @__PURE__ */ t("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: l.line_number == null ? "" : String(l.line_number) }),
581
580
  D.map((d) => /* @__PURE__ */ t(
582
581
  "td",
583
582
  {
@@ -591,15 +590,15 @@ function Pl({
591
590
  String(l.id)
592
591
  ))
593
592
  ] }),
594
- Me && P.length > 0 && /* @__PURE__ */ t("tfoot", { children: /* @__PURE__ */ p(
593
+ Ke && P.length > 0 && /* @__PURE__ */ t("tfoot", { children: /* @__PURE__ */ p(
595
594
  "tr",
596
595
  {
597
596
  "data-read-grid-footer": !0,
598
597
  className: "border-t border-slate-200 bg-slate-50 text-[11px] font-medium text-slate-600 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-300",
599
598
  children: [
600
- M && /* @__PURE__ */ t("td", {}),
599
+ K && /* @__PURE__ */ t("td", {}),
601
600
  D.map((l) => {
602
- const d = we(l);
601
+ const d = Ne(l);
603
602
  return /* @__PURE__ */ t(
604
603
  "td",
605
604
  {
@@ -681,20 +680,20 @@ function Pl({
681
680
  ] })
682
681
  ] });
683
682
  }
684
- function _t({
683
+ function vt({
685
684
  collection: a,
686
685
  itemId: u,
687
686
  layoutData: h,
688
687
  design: i,
689
- flush: w,
688
+ flush: N,
690
689
  renderSlot: _,
691
690
  integrityMarks: x,
692
691
  renderGrid: S,
693
- onEditSection: N,
692
+ onEditSection: w,
694
693
  gridCounts: m
695
694
  }) {
696
- var ct;
697
- const T = Ne(), F = hl(), L = i ? i.record ?? {} : null, q = !!(i != null && i.context.showHidden), v = i ? String(((ct = i.record) == null ? void 0 : ct.id) ?? "") : u ?? "", g = ke(
695
+ var ot;
696
+ const C = we(), F = yl(), T = i ? i.record ?? {} : null, q = !!(i != null && i.context.showHidden), v = i ? String(((ot = i.record) == null ? void 0 : ot.id) ?? "") : u ?? "", g = ke(
698
697
  () => i ? {
699
698
  ...i.layout,
700
699
  layout: i.layout.layout ?? { id: 0, name: "" }
@@ -704,19 +703,19 @@ function _t({
704
703
  kind: Le(e.field) ? "slot" : "field",
705
704
  field: e.field,
706
705
  group_key: e.group_key ?? null
707
- }), R = (e, r, s = !1) => i ? /* @__PURE__ */ t(kl, { target: e, children: s ? /* @__PURE__ */ t("div", { "data-design-hidden": !0, className: "opacity-40", children: r }) : r }) : r, D = ke(
706
+ }), R = (e, r, s = !1) => i ? /* @__PURE__ */ t(Sl, { target: e, children: s ? /* @__PURE__ */ t("div", { "data-design-hidden": !0, className: "opacity-40", children: r }) : r }) : r, D = ke(
708
707
  () => [
709
708
  ...new Set(
710
709
  (i ? [] : (g == null ? void 0 : g.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
711
710
  )
712
711
  ].sort(),
713
712
  [g, i]
714
- ), { data: j } = ul(a, v, D), k = (e) => {
713
+ ), { data: j } = pl(a, v, D), k = (e) => {
715
714
  const r = j == null ? void 0 : j[e];
716
715
  if (!r) return null;
717
716
  const s = r.via !== "user";
718
717
  return r.caller && r.activity_id ? /* @__PURE__ */ t(
719
- ol,
718
+ ml,
720
719
  {
721
720
  activityId: r.activity_id,
722
721
  callerName: r.caller.name,
@@ -733,7 +732,7 @@ function _t({
733
732
  className: "ml-1 inline-flex min-w-0 items-center gap-1 overflow-hidden rounded-full bg-amber-50 px-1.5 align-middle text-[9.5px] font-medium leading-4 text-amber-800 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300 dark:hover:bg-amber-400/20",
734
733
  children: [
735
734
  /* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-amber-400", "aria-hidden": !0 }),
736
- /* @__PURE__ */ t(Cl, { name: r.caller.name, at: r.at })
735
+ /* @__PURE__ */ t(Dl, { name: r.caller.name, at: r.at })
737
736
  ]
738
737
  }
739
738
  )
@@ -748,8 +747,8 @@ function _t({
748
747
  className: `ml-1 inline-block h-1.5 w-1.5 shrink-0 rounded-full align-middle ${s ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
749
748
  }
750
749
  );
751
- }, { data: $ } = $l(a, v, !!x && !i), A = ke(
752
- () => x && ($ != null && $.enabled) ? Fl($.findings) : null,
750
+ }, { data: $ } = Rl(a, v, !!x && !i), A = ke(
751
+ () => x && ($ != null && $.enabled) ? Al($.findings) : null,
753
752
  [x, $]
754
753
  ), ie = ({ field: e }) => {
755
754
  const r = A == null ? void 0 : A.get(e);
@@ -767,17 +766,17 @@ function _t({
767
766
  children: r.length > 1 ? r.length : "!"
768
767
  }
769
768
  );
770
- }, { data: V } = U({
769
+ }, { data: V } = H({
771
770
  queryKey: ["cbv-collection-meta", a],
772
- queryFn: () => T.request(
771
+ queryFn: () => C.request(
773
772
  z(`/collections/${a}`)
774
773
  ).then((e) => e.data),
775
774
  staleTime: 10 * 6e4,
776
775
  retry: !1
777
- }), Z = kt(), { data: Ee } = U({
776
+ }), Z = _t(), { data: Ee } = H({
778
777
  queryKey: ["rrv-record", a, v],
779
778
  enabled: !i,
780
- queryFn: () => T.request(z(`/items/${a}/${v}`)).then((e) => e.data),
779
+ queryFn: () => C.request(z(`/items/${a}/${v}`)).then((e) => e.data),
781
780
  initialData: () => Z.getQueryData(["item", a, v]) ?? void 0,
782
781
  initialDataUpdatedAt: () => {
783
782
  var e;
@@ -785,11 +784,11 @@ function _t({
785
784
  },
786
785
  staleTime: 3e4,
787
786
  retry: !1
788
- }), f = L ?? Ee;
789
- tl(a, i ? null : v, (e) => {
787
+ }), f = T ?? Ee;
788
+ rl(a, i ? null : v, (e) => {
790
789
  e.aspectsOnly || e.deleted || (Z.invalidateQueries({ queryKey: ["rrv-record", a, v] }), Z.invalidateQueries({ queryKey: ["field-touch", a, v] }));
791
790
  });
792
- const G = Xe(null), [pe, De] = H(() => /* @__PURE__ */ new Set());
791
+ const G = Ye(null), [pe, De] = U(() => /* @__PURE__ */ new Set());
793
792
  fe(() => {
794
793
  const e = G.current;
795
794
  if (G.current = f ?? null, i || !e || !f || e === f) return;
@@ -801,10 +800,10 @@ function _t({
801
800
  const s = setTimeout(() => De(/* @__PURE__ */ new Set()), 2400);
802
801
  return () => clearTimeout(s);
803
802
  }, [f, i]);
804
- const P = (e) => pe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: ee } = U({
803
+ const P = (e) => pe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: ee } = H({
805
804
  queryKey: ["rrv-field-config", a, g.layout.id],
806
805
  enabled: !i,
807
- queryFn: () => T.request(
806
+ queryFn: () => C.request(
808
807
  z(`/field-config/${a}`, { layout_id: g.layout.id })
809
808
  ).then((e) => e.data ?? []).catch(() => null),
810
809
  staleTime: 5 * 6e4,
@@ -819,14 +818,14 @@ function _t({
819
818
  )) == null ? void 0 : r.one_collection) ?? null;
820
819
  }, Y = (e) => he.find(
821
820
  (r) => r.one_collection === a && (r.one_field === e || r.many_collection === e)
822
- ) ?? null, M = (e) => {
821
+ ) ?? null, K = (e) => {
823
822
  var r;
824
823
  return !((e.is_visible === void 0 || e.is_visible) && _e(e.overrides).hidden !== !0 && !((r = I.get(e.field)) != null && r.hidden));
825
824
  }, se = g.assignments.filter(
826
- (e) => (!e.field.startsWith("__") || Le(e.field)) && (q || !M(e))
825
+ (e) => (!e.field.startsWith("__") || Le(e.field)) && (q || !K(e))
827
826
  ), de = g.assignments.filter(
828
827
  (e) => e.field.startsWith("__widget_") && e.widget_id != null && (q || e.is_visible === void 0 || !!e.is_visible)
829
- ), He = (e) => {
828
+ ), Ie = (e) => {
830
829
  if (!e.input_bindings) return [];
831
830
  try {
832
831
  return JSON.parse(String(e.input_bindings));
@@ -835,12 +834,12 @@ function _t({
835
834
  }
836
835
  }, Ue = _ || i ? g.assignments.filter(
837
836
  (e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !Le(e.field) && (q || e.is_visible === void 0 || !!e.is_visible)
838
- ).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe), we = (e) => (_ == null ? void 0 : _(e.field, e)) ?? (i ? /* @__PURE__ */ t("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || Ze(e.field.replace(/^_+|_+$/g, "")) }) : null), Me = (e, r = "trailing") => _ || i ? Ue.filter(
837
+ ).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe), Ne = (e) => (_ == null ? void 0 : _(e.field, e)) ?? (i ? /* @__PURE__ */ t("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || Xe(e.field.replace(/^_+|_+$/g, "")) }) : null), Ke = (e, r = "trailing") => _ || i ? Ue.filter(
839
838
  (s) => e === null ? s.group_key == null && r === "leading" === Pe.has(s.field) : s.group_key === e
840
839
  ).sort(
841
840
  (s, c) => r === "leading" && e === null ? oe.indexOf(s.field) - oe.indexOf(c.field) : 0
842
- ).map((s) => ({ key: s.field, a: s, node: we(s) })).filter((s) => s.node != null) : [], Se = (e, r = "trailing") => {
843
- const s = Me(e, r);
841
+ ).map((s) => ({ key: s.field, a: s, node: Ne(s) })).filter((s) => s.node != null) : [], Se = (e, r = "trailing") => {
842
+ const s = Ke(e, r);
844
843
  return s.length === 0 ? null : /* @__PURE__ */ t(
845
844
  "div",
846
845
  {
@@ -849,15 +848,15 @@ function _t({
849
848
  children: s.map((c) => /* @__PURE__ */ t("div", { children: R(
850
849
  { kind: "slot", field: c.a.field, group_key: c.a.group_key ?? null },
851
850
  c.node,
852
- M(c.a)
851
+ K(c.a)
853
852
  ) }, c.key))
854
853
  }
855
854
  );
856
- }, [$e, We] = H({}), Fe = (e) => q || $e[e] === !0, [l, d] = H({}), o = gt(
855
+ }, [$e, We] = U({}), Fe = (e) => q || $e[e] === !0, [l, d] = U({}), o = bt(
857
856
  (e) => (r) => d((s) => s[e] === r ? s : { ...s, [e]: r }),
858
857
  []
859
- ), [b, O] = H({}), W = gt(
860
- (e) => (r) => O((s) => s[e] === r ? s : { ...s, [e]: r }),
858
+ ), [b, L] = U({}), W = bt(
859
+ (e) => (r) => L((s) => s[e] === r ? s : { ...s, [e]: r }),
861
860
  []
862
861
  ), re = (e) => {
863
862
  const r = de.filter((c) => c.group_key === e).sort((c, y) => c.sort - y.sort);
@@ -866,10 +865,10 @@ function _t({
866
865
  return /* @__PURE__ */ t("div", { className: s ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: r.map((c) => /* @__PURE__ */ t("div", { hidden: !Fe(c.field), children: R(
867
866
  { kind: "slot", field: c.field, group_key: c.group_key ?? null },
868
867
  /* @__PURE__ */ t(
869
- Rl,
868
+ Ol,
870
869
  {
871
870
  widgetId: c.widget_id,
872
- inputBindings: He(c),
871
+ inputBindings: Ie(c),
873
872
  itemDraft: f ?? {},
874
873
  itemCollection: a,
875
874
  ready: !!f,
@@ -880,59 +879,59 @@ function _t({
880
879
  )
881
880
  }
882
881
  ),
883
- M(c)
882
+ K(c)
884
883
  ) }, c.field)) });
885
- }, [ne, qe] = H(() => /* @__PURE__ */ new Set()), ge = q || !f ? [] : vl({
884
+ }, [ne, qe] = U(() => /* @__PURE__ */ new Set()), ge = q || !f ? [] : wl({
886
885
  groups: g.groups.filter(
887
886
  (e) => e.type !== "container" && e.visibility_mode !== "new_only"
888
887
  ),
889
888
  values: f,
890
889
  fields: [...I.values()],
891
- choices: Sl([...I.values()]),
892
- quiet: el(g.layout.conditions),
893
- readable: (e) => _l(
890
+ choices: ql([...I.values()]),
891
+ quiet: ll(g.layout.conditions),
892
+ readable: (e) => Nl(
894
893
  g.assignments.filter((r) => r.group_key === e).map((r) => r.field),
895
894
  f,
896
895
  !!i
897
896
  )
898
- }), Ve = (e) => qe((r) => {
897
+ }), He = (e) => qe((r) => {
899
898
  const s = new Set(r);
900
899
  return s.has(e) ? s.delete(e) : s.add(e), s;
901
- }), nt = [...g.groups].sort((e, r) => e.sort - r.sort).filter((e) => q || e.visibility_mode !== "new_only").filter(
902
- (e) => q || !f || ne.has(e.key) || dl(e.visible_when, f)
903
- ), [$t, Ge] = H(() => /* @__PURE__ */ new Set()), ye = (e) => !e.is_collapsed || $t.has(e.key), Ft = (e) => Ge((r) => {
900
+ }), rt = [...g.groups].sort((e, r) => e.sort - r.sort).filter((e) => q || e.visibility_mode !== "new_only").filter(
901
+ (e) => q || !f || ne.has(e.key) || ul(e.visible_when, f)
902
+ ), [qt, Ve] = U(() => /* @__PURE__ */ new Set()), ye = (e) => !e.is_collapsed || qt.has(e.key), Rt = (e) => Ve((r) => {
904
903
  const s = new Set(r);
905
904
  return s.has(e) ? s.delete(e) : s.add(e), s;
906
905
  }), Re = (i == null ? void 0 : i.context.fold) ?? null, Ae = (i == null ? void 0 : i.context.reveal) ?? null;
907
906
  fe(() => {
908
- Re && Ge(Re.open ? new Set(g.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
907
+ Re && Ve(Re.open ? new Set(g.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
909
908
  }, [Re == null ? void 0 : Re.seq]), fe(() => {
910
- const e = Ae ? wl(Ae.target) : null;
911
- e && Ge((r) => r.has(e) ? r : new Set(r).add(e));
909
+ const e = Ae ? Fl(Ae.target) : null;
910
+ e && Ve((r) => r.has(e) ? r : new Set(r).add(e));
912
911
  }, [Ae == null ? void 0 : Ae.seq]);
913
- const Je = [];
914
- for (const e of nt) {
912
+ const Ge = [];
913
+ for (const e of rt) {
915
914
  if (e.type === "container") {
916
- for (const r of nt.filter((s) => s.container_id != null && s.container_id === e.id))
917
- Je.push(r);
915
+ for (const r of rt.filter((s) => s.container_id != null && s.container_id === e.id))
916
+ Ge.push(r);
918
917
  continue;
919
918
  }
920
- e.container_id == null && Je.push(e);
919
+ e.container_id == null && Ge.push(e);
921
920
  }
922
921
  const J = (e) => {
923
922
  var r;
924
923
  return !!((r = Y(e.field)) != null && r.junction_field);
925
- }, at = (e) => {
924
+ }, nt = (e) => {
926
925
  var s;
927
926
  const r = String(
928
927
  _e(e.overrides).interface ?? ((s = I.get(e.field)) == null ? void 0 : s.interface) ?? ""
929
928
  );
930
929
  return /rich|wysiwyg|editorjs/i.test(r);
931
- }, Te = (e) => {
930
+ }, Ce = (e) => {
932
931
  const r = I.get(e.field), s = _e(e.overrides);
933
932
  if (s.summary_toggle === !0 && !i && v && f)
934
933
  return /* @__PURE__ */ t(
935
- Ml,
934
+ Bl,
936
935
  {
937
936
  collection: a,
938
937
  itemId: String(v),
@@ -942,14 +941,14 @@ function _t({
942
941
  }
943
942
  );
944
943
  if (Le(e.field)) {
945
- const K = rl(s), ue = bl((K == null ? void 0 : K.expr) ?? "", f ?? {});
946
- return /* @__PURE__ */ t("span", { "data-display-formula": e.field, className: "tabular-nums", children: ue.error ? "—" : nl(ue.value, K ?? { format: "", currency: null }) });
944
+ const M = il(s), ue = xl((M == null ? void 0 : M.expr) ?? "", f ?? {});
945
+ return /* @__PURE__ */ t("span", { "data-display-formula": e.field, className: "tabular-nums", children: ue.error ? "—" : sl(ue.value, M ?? { format: "", currency: null }) });
947
946
  }
948
947
  const c = Y(e.field);
949
948
  if (i && !v && (c != null && c.junction_field)) return /* @__PURE__ */ t(le, {});
950
949
  if (c != null && c.junction_field && c.many_collection && c.many_field)
951
950
  return /* @__PURE__ */ t(
952
- Dl,
951
+ Ml,
953
952
  {
954
953
  junction: c.many_collection,
955
954
  parentFk: c.many_field,
@@ -962,33 +961,33 @@ function _t({
962
961
  );
963
962
  const y = f == null ? void 0 : f[e.field], B = be(e.field);
964
963
  if (B === "nivaro_users" && y != null)
965
- return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(wt, { userId: String(y), size: "compact" }) });
966
- if (B) return /* @__PURE__ */ t(rt, { collection: B, id: y });
967
- if ((r == null ? void 0 : r.type) === "boolean" && (y == null || y === "")) return /* @__PURE__ */ t(Ie, { value: !1 });
964
+ return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(St, { userId: String(y), size: "compact" }) });
965
+ if (B) return /* @__PURE__ */ t(lt, { collection: B, id: y });
966
+ if ((r == null ? void 0 : r.type) === "boolean" && (y == null || y === "")) return /* @__PURE__ */ t(Be, { value: !1 });
968
967
  if (y == null || y === "") return /* @__PURE__ */ t(le, {});
969
968
  if ((r == null ? void 0 : r.type) === "boolean")
970
969
  return /* @__PURE__ */ t(
971
- Ie,
970
+ Be,
972
971
  {
973
972
  value: y,
974
973
  trueTone: (s.options ?? {}).trueTone ?? "positive"
975
974
  }
976
975
  );
977
976
  const te = s.options ?? {};
978
- return at(e) && typeof y == "string" ? /^\s*\{/.test(y) ? /* @__PURE__ */ t("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: ml(y) }) : /* @__PURE__ */ t(
977
+ return nt(e) && typeof y == "string" ? /^\s*\{/.test(y) ? /* @__PURE__ */ t("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: hl(y) }) : /* @__PURE__ */ t(
979
978
  "div",
980
979
  {
981
980
  className: "rrv-prose min-w-0 font-normal leading-relaxed [overflow-wrap:anywhere] [&_a]:underline [&_h1]:text-[15px] [&_h1]:font-semibold [&_h2]:text-[14px] [&_h2]:font-semibold [&_h3]:font-semibold [&_li]:ml-4 [&_ol]:list-decimal [&_p]:my-1 [&_ul]:list-disc",
982
- dangerouslySetInnerHTML: { __html: sl(y) }
981
+ dangerouslySetInnerHTML: { __html: cl(y) }
983
982
  }
984
- ) : te.format === "currency" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children: tt(y) }) : (r == null ? void 0 : r.type) === "decimal" || (r == null ? void 0 : r.type) === "float" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children: Be(y) }) : (r == null ? void 0 : r.type) === "date" || (r == null ? void 0 : r.type) === "datetime" || (r == null ? void 0 : r.type) === "timestamp" ? St(y) : String(y);
985
- }, qt = (e) => {
983
+ ) : te.format === "currency" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children: wt(y, { currency: $t(r) ?? "USD" }) || String(y) }) : r && et(r) && et(r) !== "plain" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children: Nt(y, r) || String(y) }) : (r == null ? void 0 : r.type) === "date" || (r == null ? void 0 : r.type) === "datetime" || (r == null ? void 0 : r.type) === "timestamp" ? Ft(y) : String(y);
984
+ }, At = (e) => {
986
985
  const r = _e(e.overrides), s = Y(e.field);
987
986
  if (!(s != null && s.many_collection) || !s.many_field) return null;
988
987
  if (i && !v) return /* @__PURE__ */ t("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
989
988
  const c = r.options ?? {}, y = (() => {
990
- var K;
991
- const te = (K = I.get(e.field)) == null ? void 0 : K.options;
989
+ var M;
990
+ const te = (M = I.get(e.field)) == null ? void 0 : M.options;
992
991
  if (!te) return {};
993
992
  if (typeof te == "string")
994
993
  try {
@@ -999,7 +998,7 @@ function _t({
999
998
  return te;
1000
999
  })(), B = c.layout_id ?? null;
1001
1000
  return /* @__PURE__ */ t(
1002
- Pl,
1001
+ jl,
1003
1002
  {
1004
1003
  collection: s.many_collection,
1005
1004
  fkField: s.many_field,
@@ -1011,37 +1010,37 @@ function _t({
1011
1010
  },
1012
1011
  e.field
1013
1012
  );
1014
- }, X = (e) => !!Y(e.field) && !J(e), Rt = !!g.layout.hide_empty, it = Array.isArray(g.layout.header_fields) ? g.layout.header_fields.filter((e) => typeof e == "string") : [], At = new Set(it), Tt = (e) => {
1013
+ }, X = (e) => !!Y(e.field) && !J(e), Ct = !!g.layout.hide_empty, at = Array.isArray(g.layout.header_fields) ? g.layout.header_fields.filter((e) => typeof e == "string") : [], Ot = new Set(at), Tt = (e) => {
1015
1014
  if (!f || J(e)) return !1;
1016
1015
  const r = f[e.field];
1017
1016
  return r == null || r === "" || Array.isArray(r) && r.length === 0;
1018
- }, Ct = (e) => se.find((r) => r.field === e), ce = (e) => {
1017
+ }, Lt = (e) => se.find((r) => r.field === e), ce = (e) => {
1019
1018
  var c;
1020
- const r = _e(e.overrides).label, s = F ? ll(e.overrides, F).label : void 0;
1021
- return s !== void 0 ? s : Le(e.field) ? typeof r == "string" && r.trim() ? r : "Formula" : typeof r == "string" && r.trim() ? r : e.label_override || ((c = I.get(e.field)) == null ? void 0 : c.label) || Ze(e.field);
1022
- }, Ot = (e) => {
1023
- const r = Yt(e.swap_config), s = se.filter((n) => n.group_key === e.key && !At.has(n.field)).filter((n) => q || !f || !Xt(n.overrides) || !ve(f[n.field])).sort((n, C) => n.sort - C.sort), c = de.filter((n) => n.group_key === e.key), y = Me(e.key), B = s.length === 0 && c.length === 0 && y.length === 0;
1019
+ const r = _e(e.overrides).label, s = F ? al(e.overrides, F).label : void 0;
1020
+ return s !== void 0 ? s : Le(e.field) ? typeof r == "string" && r.trim() ? r : "Formula" : typeof r == "string" && r.trim() ? r : e.label_override || ((c = I.get(e.field)) == null ? void 0 : c.label) || Xe(e.field);
1021
+ }, Et = (e) => {
1022
+ const r = Zt(e.swap_config), s = se.filter((n) => n.group_key === e.key && !Ot.has(n.field)).filter((n) => q || !f || !el(n.overrides) || !ve(f[n.field])).sort((n, O) => n.sort - O.sort), c = de.filter((n) => n.group_key === e.key), y = Ke(e.key), B = s.length === 0 && c.length === 0 && y.length === 0;
1024
1023
  if (B && !i) return null;
1025
- const te = (n) => Rt && !q && (X(n) || J(n)) && ((m == null ? void 0 : m[n.field]) ?? l[n.field]) === 0, K = s.filter((n) => !X(n)), ue = s.filter(X), Ke = c.filter((n) => Fe(n.field)), Et = !e.hide_when_empty && y.length === 0 && Ke.length === 0 && s.length > 0 && s.some((n) => X(n) || J(n)) && s.every(te), Qe = (n) => !Et && te(n), Dt = s.filter((n) => !Qe(n)), xe = (n) => (m == null ? void 0 : m[n.field]) ?? l[n.field], Pt = !!e.hide_when_empty && !i && !q && !!f && y.length === 0 && Ke.length === 0 && s.every((n) => X(n) || J(n) ? xe(n) === 0 : ve(f[n.field])) || !B && Dt.length === 0 && y.length === 0 && Ke.length === 0, Mt = (n) => (m == null ? void 0 : m[n.field]) ?? l[n.field], ze = !!r.emptyText && !!f && !i && y.length === 0 && Ke.length === 0 && s.every((n) => X(n) || J(n) ? Mt(n) === 0 : ve(f[n.field])), Wt = Zt(K, { rows: r.rows }).units, Ye = e.is_collapsed ? Tl(e.summary_fields).map((n) => {
1026
- const C = s.find((Ce) => Ce.field === n.field);
1027
- return C ? { a: C, label: n.label || ce(C) } : null;
1024
+ const te = (n) => Ct && !q && (X(n) || J(n)) && ((m == null ? void 0 : m[n.field]) ?? l[n.field]) === 0, M = s.filter((n) => !X(n)), ue = s.filter(X), Me = c.filter((n) => Fe(n.field)), Pt = !e.hide_when_empty && y.length === 0 && Me.length === 0 && s.length > 0 && s.some((n) => X(n) || J(n)) && s.every(te), Je = (n) => !Pt && te(n), Kt = s.filter((n) => !Je(n)), xe = (n) => (m == null ? void 0 : m[n.field]) ?? l[n.field], Wt = !!e.hide_when_empty && !i && !q && !!f && y.length === 0 && Me.length === 0 && s.every((n) => X(n) || J(n) ? xe(n) === 0 : ve(f[n.field])) || !B && Kt.length === 0 && y.length === 0 && Me.length === 0, Mt = (n) => (m == null ? void 0 : m[n.field]) ?? l[n.field], Qe = !!r.emptyText && !!f && !i && y.length === 0 && Me.length === 0 && s.every((n) => X(n) || J(n) ? Mt(n) === 0 : ve(f[n.field])), jt = tl(M, { rows: r.rows }).units, ze = e.is_collapsed ? Ll(e.summary_fields).map((n) => {
1025
+ const O = s.find((Oe) => Oe.field === n.field);
1026
+ return O ? { a: O, label: n.label || ce(O) } : null;
1028
1027
  }).filter((n) => !!n).filter(
1029
1028
  ({ a: n }) => !e.summary_hide_empty || !f || (X(n) || J(n) ? xe(n) !== 0 : !ve(f[n.field]))
1030
- ).slice(0, Al) : [], ut = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : ue.length > 0 || c.length > 0 || y.length > 0 || K.length > 4 ? "full" : "half", Kt = (n) => {
1031
- var pt, ht, bt;
1032
- const C = Qe(n), Q = !!(_e(n.overrides).options ?? {}).emphasis, Oe = at(n) || !!((ht = (pt = I.get(n.field)) == null ? void 0 : pt.interface) != null && ht.includes("rich-text")), mt = f == null ? void 0 : f[n.field], ft = !Oe && !J(n) && !be(n.field) && (String(((bt = I.get(n.field)) == null ? void 0 : bt.interface) ?? "").includes("textarea") || typeof mt == "string" && mt.length > 36);
1029
+ ).slice(0, Tl) : [], ct = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : ue.length > 0 || c.length > 0 || y.length > 0 || M.length > 4 ? "full" : "half", Bt = (n) => {
1030
+ var ft, pt, ht;
1031
+ const O = Je(n), Q = !!(_e(n.overrides).options ?? {}).emphasis, Te = nt(n) || !!((pt = (ft = I.get(n.field)) == null ? void 0 : ft.interface) != null && pt.includes("rich-text")), ut = f == null ? void 0 : f[n.field], mt = !Te && !J(n) && !be(n.field) && (String(((ht = I.get(n.field)) == null ? void 0 : ht.interface) ?? "").includes("textarea") || typeof ut == "string" && ut.length > 36);
1033
1032
  return /* @__PURE__ */ t(
1034
1033
  "div",
1035
1034
  {
1036
- hidden: C,
1037
- className: `min-w-0 ${Oe || J(n) && (b[n.field] === "nivaro_files" || (l[n.field] ?? 0) > 3) ? "col-span-full" : Q || ft ? "col-span-2" : ""}`,
1035
+ hidden: O,
1036
+ className: `min-w-0 ${Te || J(n) && (b[n.field] === "nivaro_files" || (l[n.field] ?? 0) > 3) ? "col-span-full" : Q || mt ? "col-span-2" : ""}`,
1038
1037
  children: R(
1039
1038
  E(n),
1040
1039
  /* @__PURE__ */ p(me, { children: [
1041
- /* @__PURE__ */ p("dt", { className: vt, "data-fact-label": !0, children: [
1040
+ /* @__PURE__ */ p("dt", { className: xt, "data-fact-label": !0, children: [
1042
1041
  /* @__PURE__ */ t("span", { className: "max-w-full shrink-0 truncate", children: ce(n) }),
1043
1042
  /* @__PURE__ */ t(ie, { field: n.field }),
1044
- /* @__PURE__ */ t(yt, { field: n.field }),
1043
+ /* @__PURE__ */ t(gt, { field: n.field }),
1045
1044
  k(n.field)
1046
1045
  ] }),
1047
1046
  /* @__PURE__ */ t(
@@ -1050,27 +1049,27 @@ function _t({
1050
1049
  "data-replay-field": n.field,
1051
1050
  "data-field-collection": a,
1052
1051
  "data-remote-changed": pe.has(n.field) || void 0,
1053
- className: `mt-1 min-w-0${P(n.field)} ${Q ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${J(n) || Oe ? "" : ft ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
1054
- children: f ? Te(n) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
1052
+ className: `mt-1 min-w-0${P(n.field)} ${Q ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${J(n) || Te ? "" : mt ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
1053
+ children: f ? Ce(n) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
1055
1054
  }
1056
1055
  )
1057
1056
  ] }),
1058
- M(n)
1057
+ K(n)
1059
1058
  )
1060
1059
  },
1061
1060
  n.field
1062
1061
  );
1063
- }, jt = (n, C) => {
1064
- const Ce = f && !i ? C.filter((Q) => !ve(f[Q.field])) : C;
1062
+ }, It = (n, O) => {
1063
+ const Oe = f && !i ? O.filter((Q) => !ve(f[Q.field])) : O;
1065
1064
  return /* @__PURE__ */ p(
1066
1065
  "div",
1067
1066
  {
1068
1067
  "data-read-row": n.key,
1069
- className: `min-w-0 ${C.length > 2 ? "col-span-full" : "col-span-2"}`,
1068
+ className: `min-w-0 ${O.length > 2 ? "col-span-full" : "col-span-2"}`,
1070
1069
  children: [
1071
- /* @__PURE__ */ t("dt", { className: lt, children: n.label.trim() || C.map(ce).join(" / ") }),
1072
- /* @__PURE__ */ t("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: f ? Ce.length === 0 ? /* @__PURE__ */ t(le, {}) : Ce.map((Q, Oe) => /* @__PURE__ */ p(Ht, { children: [
1073
- Oe > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
1070
+ /* @__PURE__ */ t("dt", { className: tt, children: n.label.trim() || O.map(ce).join(" / ") }),
1071
+ /* @__PURE__ */ t("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: f ? Oe.length === 0 ? /* @__PURE__ */ t(le, {}) : Oe.map((Q, Te) => /* @__PURE__ */ p(Vt, { children: [
1072
+ Te > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
1074
1073
  R(
1075
1074
  E(Q),
1076
1075
  /* @__PURE__ */ t(
@@ -1079,10 +1078,10 @@ function _t({
1079
1078
  "data-replay-field": Q.field,
1080
1079
  "data-field-collection": a,
1081
1080
  className: `min-w-0 break-words${P(Q.field)}`,
1082
- children: Te(Q)
1081
+ children: Ce(Q)
1083
1082
  }
1084
1083
  ),
1085
- M(Q)
1084
+ K(Q)
1086
1085
  )
1087
1086
  ] }, Q.field)) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
1088
1087
  ]
@@ -1093,9 +1092,9 @@ function _t({
1093
1092
  return /* @__PURE__ */ t(
1094
1093
  "section",
1095
1094
  {
1096
- hidden: Pt,
1095
+ hidden: Wt,
1097
1096
  "data-read-section": e.key,
1098
- "data-read-width": ut,
1097
+ "data-read-width": ct,
1099
1098
  className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
1100
1099
  children: R(
1101
1100
  { kind: "group", key: e.key },
@@ -1111,43 +1110,43 @@ function _t({
1111
1110
  "button",
1112
1111
  {
1113
1112
  type: "button",
1114
- onClick: () => Ft(e.key),
1113
+ onClick: () => Rt(e.key),
1115
1114
  "aria-expanded": ye(e),
1116
- className: `min-w-0 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white ${Ye.length > 0 && !ye(e) ? "shrink-0" : "flex-1"}`,
1115
+ className: `min-w-0 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white ${ze.length > 0 && !ye(e) ? "shrink-0" : "flex-1"}`,
1117
1116
  children: e.label
1118
1117
  }
1119
1118
  ),
1120
- !ye(e) && Ye.length > 0 && // #3195: two or three values while the section is closed. Not
1119
+ !ye(e) && ze.length > 0 && // #3195: two or three values while the section is closed. Not
1121
1120
  // interactive: the heading's toggle covers the whole row.
1122
1121
  /* @__PURE__ */ t(
1123
1122
  "span",
1124
1123
  {
1125
1124
  "data-read-collapsed-summary": e.key,
1126
1125
  className: "pointer-events-none flex min-w-0 flex-1 items-baseline gap-x-3 overflow-hidden whitespace-nowrap text-[12px] font-normal",
1127
- children: Ye.map(({ a: n, label: C }) => /* @__PURE__ */ p("span", { className: "flex min-w-0 shrink items-baseline gap-1", children: [
1128
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: C }),
1129
- /* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: f ? X(n) || J(n) ? xe(n) == null ? "…" : `${xe(n)} ${X(n) ? xe(n) === 1 ? "row" : "rows" : xe(n) === 1 ? "item" : "items"}` : ve(f[n.field]) ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Te(n) : "…" })
1126
+ children: ze.map(({ a: n, label: O }) => /* @__PURE__ */ p("span", { className: "flex min-w-0 shrink items-baseline gap-1", children: [
1127
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: O }),
1128
+ /* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: f ? X(n) || J(n) ? xe(n) == null ? "…" : `${xe(n)} ${X(n) ? xe(n) === 1 ? "row" : "rows" : xe(n) === 1 ? "item" : "items"}` : ve(f[n.field]) ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Ce(n) : "…" })
1130
1129
  ] }, n.field))
1131
1130
  }
1132
1131
  )
1133
1132
  ] }) : /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: e.label }),
1134
- N && (K.length > 0 || ue.length > 0) && /* @__PURE__ */ t(
1133
+ w && (M.length > 0 || ue.length > 0) && /* @__PURE__ */ t(
1135
1134
  "button",
1136
1135
  {
1137
1136
  type: "button",
1138
1137
  "data-read-edit-section": e.key,
1139
1138
  onClick: () => {
1140
- var n, C;
1141
- return N(e.key, ((n = K[0]) == null ? void 0 : n.field) ?? ((C = ue[0]) == null ? void 0 : C.field) ?? null);
1139
+ var n, O;
1140
+ return w(e.key, ((n = M[0]) == null ? void 0 : n.field) ?? ((O = ue[0]) == null ? void 0 : O.field) ?? null);
1142
1141
  },
1143
1142
  title: `Edit ${e.label}`,
1144
1143
  "aria-label": `Edit ${e.label}`,
1145
1144
  className: "relative -my-1 rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-slate-700 focus-visible:opacity-100 group-hover/rs:opacity-100 dark:hover:bg-white/5 dark:hover:text-slate-200 motion-reduce:transition-none",
1146
- children: /* @__PURE__ */ t(Bt, { className: "h-3 w-3" })
1145
+ children: /* @__PURE__ */ t(Ut, { className: "h-3 w-3" })
1147
1146
  }
1148
1147
  ),
1149
1148
  e.is_collapsed && /* @__PURE__ */ t(
1150
- It,
1149
+ Ht,
1151
1150
  {
1152
1151
  "aria-hidden": "true",
1153
1152
  className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${ye(e) ? "" : "-rotate-90"}`
@@ -1157,7 +1156,7 @@ function _t({
1157
1156
  }
1158
1157
  ),
1159
1158
  /* @__PURE__ */ p("div", { "data-read-body": "", className: "px-5 pb-5 pt-4", hidden: !ye(e), children: [
1160
- ze && /* @__PURE__ */ t(
1159
+ Qe && /* @__PURE__ */ t(
1161
1160
  "p",
1162
1161
  {
1163
1162
  "data-read-empty": e.key,
@@ -1165,7 +1164,7 @@ function _t({
1165
1164
  children: r.emptyText
1166
1165
  }
1167
1166
  ),
1168
- K.length > 0 && // One column rhythm for the whole page: every section's facts sit
1167
+ M.length > 0 && // One column rhythm for the whole page: every section's facts sit
1169
1168
  // on the same 2 / 3 / 4 / 6 tracks, so values line up card to
1170
1169
  // card instead of each card auto-filling its own grid. Hidden, not
1171
1170
  // unrendered, under the empty text: its link facts must keep reporting.
@@ -1173,24 +1172,24 @@ function _t({
1173
1172
  "dl",
1174
1173
  {
1175
1174
  className: "grid gap-x-6 gap-y-5",
1176
- "data-read-dl": ut,
1177
- style: ze ? { display: "none" } : void 0,
1178
- children: Wt.map(
1179
- (n) => n.kind === "row" ? jt(n.row, n.members) : Kt(n.field)
1175
+ "data-read-dl": ct,
1176
+ style: Qe ? { display: "none" } : void 0,
1177
+ children: jt.map(
1178
+ (n) => n.kind === "row" ? It(n.row, n.members) : Bt(n.field)
1180
1179
  )
1181
1180
  }
1182
1181
  ),
1183
1182
  ue.map((n) => {
1184
- var C;
1183
+ var O;
1185
1184
  return /* @__PURE__ */ t(
1186
1185
  "div",
1187
1186
  {
1188
- className: K.length > 0 ? "mt-3" : "",
1189
- hidden: Qe(n) || ze,
1187
+ className: M.length > 0 ? "mt-3" : "",
1188
+ hidden: Je(n) || Qe,
1190
1189
  children: R(
1191
1190
  E(n),
1192
1191
  /* @__PURE__ */ p(me, { children: [
1193
- (C = A == null ? void 0 : A.get(n.field)) != null && C.length ? /* @__PURE__ */ p("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
1192
+ (O = A == null ? void 0 : A.get(n.field)) != null && O.length ? /* @__PURE__ */ p("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
1194
1193
  /* @__PURE__ */ t("span", { children: ce(n) }),
1195
1194
  /* @__PURE__ */ t(ie, { field: n.field }),
1196
1195
  /* @__PURE__ */ p("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
@@ -1201,9 +1200,9 @@ function _t({
1201
1200
  "; switch to Edit to fix"
1202
1201
  ] })
1203
1202
  ] }) : null,
1204
- (S ? S(n) : null) ?? qt(n)
1203
+ (S ? S(n) : null) ?? At(n)
1205
1204
  ] }),
1206
- M(n)
1205
+ K(n)
1207
1206
  )
1208
1207
  },
1209
1208
  n.field
@@ -1226,14 +1225,14 @@ function _t({
1226
1225
  },
1227
1226
  e.key
1228
1227
  );
1229
- }, st = Se(null), Lt = Se(null, "leading"), dt = it.map((e) => Ct(e)).filter((e) => !!e && !X(e)).filter((e) => q || !Tt(e)), [ae, ...ot] = dt;
1228
+ }, it = Se(null), Dt = Se(null, "leading"), st = at.map((e) => Lt(e)).filter((e) => !!e && !X(e)).filter((e) => q || !Tt(e)), [ae, ...dt] = st;
1230
1229
  return /* @__PURE__ */ p(
1231
1230
  "div",
1232
1231
  {
1233
- className: w ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
1232
+ className: N ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
1234
1233
  children: [
1235
- Lt,
1236
- dt.length > 0 && /* @__PURE__ */ p(
1234
+ Dt,
1235
+ st.length > 0 && /* @__PURE__ */ p(
1237
1236
  "div",
1238
1237
  {
1239
1238
  "data-read-header": !0,
@@ -1242,7 +1241,7 @@ function _t({
1242
1241
  ae && R(
1243
1242
  { kind: "header", field: ae.field },
1244
1243
  /* @__PURE__ */ p("div", { className: "min-w-0", children: [
1245
- /* @__PURE__ */ p("p", { className: lt, children: [
1244
+ /* @__PURE__ */ p("p", { className: tt, children: [
1246
1245
  ce(ae),
1247
1246
  /* @__PURE__ */ t(ie, { field: ae.field })
1248
1247
  ] }),
@@ -1252,19 +1251,19 @@ function _t({
1252
1251
  "data-replay-field": ae.field,
1253
1252
  "data-field-collection": a,
1254
1253
  className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${P(ae.field)}`,
1255
- children: f ? Te(ae) : "…"
1254
+ children: f ? Ce(ae) : "…"
1256
1255
  }
1257
1256
  )
1258
1257
  ] }),
1259
- M(ae)
1258
+ K(ae)
1260
1259
  ),
1261
- ot.length > 0 && /* @__PURE__ */ t("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: ot.map((e) => /* @__PURE__ */ t("div", { className: "min-w-0", children: R(
1260
+ dt.length > 0 && /* @__PURE__ */ t("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: dt.map((e) => /* @__PURE__ */ t("div", { className: "min-w-0", children: R(
1262
1261
  { kind: "header", field: e.field },
1263
1262
  /* @__PURE__ */ p(me, { children: [
1264
- /* @__PURE__ */ p("dt", { className: vt, children: [
1263
+ /* @__PURE__ */ p("dt", { className: xt, children: [
1265
1264
  /* @__PURE__ */ t("span", { className: "max-w-full shrink-0 truncate", children: ce(e) }),
1266
1265
  /* @__PURE__ */ t(ie, { field: e.field }),
1267
- /* @__PURE__ */ t(yt, { field: e.field }),
1266
+ /* @__PURE__ */ t(gt, { field: e.field }),
1268
1267
  k(e.field)
1269
1268
  ] }),
1270
1269
  /* @__PURE__ */ t(
@@ -1274,50 +1273,50 @@ function _t({
1274
1273
  "data-field-collection": a,
1275
1274
  "data-remote-changed": pe.has(e.field) || void 0,
1276
1275
  className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${P(e.field)}`,
1277
- children: f ? Te(e) : "…"
1276
+ children: f ? Ce(e) : "…"
1278
1277
  }
1279
1278
  )
1280
1279
  ] }),
1281
- M(e)
1280
+ K(e)
1282
1281
  ) }, e.field)) })
1283
1282
  ]
1284
1283
  }
1285
1284
  ),
1286
- /* @__PURE__ */ t("style", { children: Ol }),
1287
- V && ge.length > 0 && /* @__PURE__ */ t("div", { className: "mb-3", children: /* @__PURE__ */ t(gl, { items: ge, revealed: ne, onToggle: Ve }) }),
1288
- V ? /* @__PURE__ */ t("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Je.map(Ot) }) : /* @__PURE__ */ p("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
1285
+ /* @__PURE__ */ t("style", { children: Pl }),
1286
+ V && ge.length > 0 && /* @__PURE__ */ t("div", { className: "mb-3", children: /* @__PURE__ */ t(vl, { items: ge, revealed: ne, onToggle: He }) }),
1287
+ V ? /* @__PURE__ */ t("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Ge.map(Et) }) : /* @__PURE__ */ p("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
1289
1288
  /* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1290
1289
  /* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1291
1290
  /* @__PURE__ */ t("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
1292
1291
  ] }),
1293
- st && /* @__PURE__ */ t("div", { className: "mt-4", children: st })
1292
+ it && /* @__PURE__ */ t("div", { className: "mt-4", children: it })
1294
1293
  ]
1295
1294
  }
1296
1295
  );
1297
1296
  }
1298
- function Sr(a) {
1299
- return a.design ? /* @__PURE__ */ t(Nl, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ t(Ut.Provider, { value: null, children: /* @__PURE__ */ t(_t, { ...a }) }) }) : /* @__PURE__ */ t(_t, { ...a });
1297
+ function Cr(a) {
1298
+ return a.design ? /* @__PURE__ */ t($l, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ t(Gt.Provider, { value: null, children: /* @__PURE__ */ t(vt, { ...a }) }) }) : /* @__PURE__ */ t(vt, { ...a });
1300
1299
  }
1301
- function Ml({
1300
+ function Bl({
1302
1301
  collection: a,
1303
1302
  itemId: u,
1304
1303
  field: h,
1305
1304
  value: i,
1306
- label: w
1305
+ label: N
1307
1306
  }) {
1308
- const _ = Ne(), x = kt(), [S, N] = H(null), m = S ?? (i === !0 || i === 1 || i === "1" || i === "true"), T = async () => {
1307
+ const _ = we(), x = _t(), [S, w] = U(null), m = S ?? (i === !0 || i === 1 || i === "1" || i === "true"), C = async () => {
1309
1308
  if (S !== null) return;
1310
1309
  const F = !m;
1311
- N(F);
1310
+ w(F);
1312
1311
  try {
1313
- await _.request(Qt(`/items/${a}/${u}`, { [h]: F })), await Promise.all([
1312
+ await _.request(Yt(`/items/${a}/${u}`, { [h]: F })), await Promise.all([
1314
1313
  x.invalidateQueries({ queryKey: ["rrv-record", a, u] }),
1315
1314
  x.invalidateQueries({ queryKey: ["item", a, u] })
1316
- ]), al(x, a, u);
1317
- } catch (L) {
1318
- zt(L, "Could not save that change");
1315
+ ]), dl(x, a, u);
1316
+ } catch (T) {
1317
+ Xt(T, "Could not save that change");
1319
1318
  } finally {
1320
- N(null);
1319
+ w(null);
1321
1320
  }
1322
1321
  };
1323
1322
  return /* @__PURE__ */ p(
@@ -1326,9 +1325,9 @@ function Ml({
1326
1325
  type: "button",
1327
1326
  role: "switch",
1328
1327
  "aria-checked": m,
1329
- "aria-label": typeof w == "string" ? w : h,
1328
+ "aria-label": typeof N == "string" ? N : h,
1330
1329
  disabled: S !== null,
1331
- onClick: () => void T(),
1330
+ onClick: () => void C(),
1332
1331
  "data-summary-toggle": h,
1333
1332
  className: "group inline-flex items-center gap-2 rounded-md py-0.5 text-[13px] font-medium text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-60 dark:text-slate-100",
1334
1333
  children: [
@@ -1351,7 +1350,7 @@ function Ml({
1351
1350
  );
1352
1351
  }
1353
1352
  export {
1354
- Al as COLLAPSED_SUMMARY_MAX,
1355
- Sr as RecordReadView,
1356
- Tl as collapsedSummaryEntries
1353
+ Tl as COLLAPSED_SUMMARY_MAX,
1354
+ Cr as RecordReadView,
1355
+ Ll as collapsedSummaryEntries
1357
1356
  };