@nivaro/react 0.3.119 → 0.3.121

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.
@@ -1,41 +1,41 @@
1
- import { jsx as t, jsxs as p, Fragment as ve } from "react/jsx-runtime";
2
- import { useQuery as U, useQueryClient as vt } from "@tanstack/react-query";
3
- import { Pencil as jt, ChevronDown as Wt } from "lucide-react";
4
- import { useMemo as _e, useRef as It, useState as Q, useEffect as ke, useCallback as bt, Fragment as Ht } from "react";
5
- import { DrilldownContext as Ut, useNivaroClient as Ne, useApiFetchConfig as Vt, useDrilldown as _t } from "../context.js";
6
- import { useDebounced as Bt } from "../hooks/useDebounced.js";
7
- import { parseAllowedCollections as Gt } from "../lib/allowed-collections.js";
8
- import { get as Y, patch as Jt } from "../lib/commands.js";
9
- import { toastError as Qt } from "../lib/error-toast.js";
10
- import { readGroupStructure as Yt, isFolded as zt, isEmptyValue as ye, planFieldGrid as Xt } from "../lib/form-structure.js";
11
- import { quietHiddenSectionsOf as Zt } from "../lib/layout-resolve.js";
12
- import { useLiveRecord as el } from "../lib/live.js";
13
- import { isDisplayFormulaField as Ce, resolvePlacementText as tl, displayFormulaOf as ll, formatDisplayValue as rl } from "../lib/placement-behaviour.js";
14
- import { invalidateRecordRow as nl, useRecordReader as al } from "../lib/record-loader.js";
15
- import { sanitizeHtml as il } from "../lib/sanitize-html.js";
16
- import { titleCase as Ze, formatRelative as We } from "../lib/utils.js";
17
- import { matchesVisibleWhen as sl } from "../lib/visible-when.js";
18
- import { InboundRequestPopover as dl } from "./integrations/InboundRequest.js";
19
- import { FileM2MField as ol } from "./item-edit/FilePickerField.js";
20
- import { useFieldTouches as cl } from "./item-edit/HeaderFreshness.js";
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
21
  import { richTextToPlain as ml } from "./item-edit/helpers.js";
22
- import { isNamelessLabel as ul, NAMELESS_LABEL as fl } from "./item-edit/option-disambiguate.js";
23
- import { PersonalDefaultMark as gt } from "./item-edit/PersonalDefaultControl.js";
24
- import { usePlacementTextContext as pl, evaluateDisplayFormula as hl } from "./item-edit/placement-behaviour.js";
25
- import { RuleHiddenNotes as bl } from "./item-edit/RuleHiddenNotes.js";
26
- import { RELATED_LOADING_CLASS as gl, RelatedMissingLabel as yl } from "./item-edit/related-missing.js";
27
- import { ruleHiddenGroups as xl, groupHasReadableField as vl } from "./item-edit/rule-hidden.js";
28
- import { UserChip as kt } from "./item-edit/UserChip.js";
29
- import { DesignNode as _l } from "./layout-editor/DesignNode.js";
30
- import { DesignCanvas as kl } from "./layout-editor/design-canvas.js";
31
- import { revealGroupKey as Nl } from "./layout-editor/design-context.js";
32
- import { choiceLabelsFrom as wl } from "./layout-editor/overview/describe-conditions.js";
33
- import { useRecordIntegrity as Sl, integrityByField as $l } from "./panels/RecordIntegrityBanner.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
34
  import { RecordHoverCard as et } from "./RecordHoverCard.js";
35
- import { RelativeTime as Fl } from "./RelativeTime.js";
36
- import { SimpleSelectXs as yt } from "./ui/SimpleSelect.js";
37
- import { WidgetSlot as ql } from "./WidgetSlot.js";
38
- const xe = (a) => {
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";
38
+ const _e = (a) => {
39
39
  if (!a) return {};
40
40
  if (typeof a == "object") return a;
41
41
  try {
@@ -44,39 +44,74 @@ const xe = (a) => {
44
44
  return {};
45
45
  }
46
46
  }, Al = 3;
47
- function Rl(a) {
48
- let m = a;
49
- if (typeof m == "string")
47
+ function Tl(a) {
48
+ let u = a;
49
+ if (typeof u == "string")
50
50
  try {
51
- m = JSON.parse(m);
51
+ u = JSON.parse(u);
52
52
  } catch {
53
- m = m ? m.split(",").map((s) => s.trim()) : [];
53
+ u = u ? u.split(",").map((i) => i.trim()) : [];
54
54
  }
55
- if (!Array.isArray(m)) return [];
56
- const b = [];
57
- for (const s of m)
58
- if (typeof s == "string" && s) b.push({ field: s, label: null });
59
- else if (s && typeof s == "object" && typeof s.field == "string") {
60
- const F = s.label;
61
- b.push({
62
- field: s.field,
63
- label: typeof F == "string" && F.trim() ? F.trim() : null
55
+ if (!Array.isArray(u)) return [];
56
+ const h = [];
57
+ for (const i of u)
58
+ if (typeof i == "string" && i) h.push({ field: i, label: null });
59
+ else if (i && typeof i == "object" && typeof i.field == "string") {
60
+ const w = i.label;
61
+ h.push({
62
+ field: i.field,
63
+ label: typeof w == "string" && w.trim() ? w.trim() : null
64
64
  });
65
65
  }
66
- return b.filter((s) => !s.field.startsWith("__"));
66
+ return h.filter((i) => !i.field.startsWith("__"));
67
67
  }
68
- const Nt = (a) => {
69
- const m = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
70
- if (m) return `${m[2]}/${m[3]}/${m[1]}`;
71
- const b = new Date(String(a));
72
- return Number.isNaN(b.getTime()) ? String(a) : `${String(b.getMonth() + 1).padStart(2, "0")}/${String(b.getDate()).padStart(2, "0")}/${b.getFullYear()}`;
68
+ const St = (a) => {
69
+ const u = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
70
+ if (u) return `${u[2]}/${u[3]}/${u[1]}`;
71
+ const h = new Date(String(a));
72
+ return Number.isNaN(h.getTime()) ? String(a) : `${String(h.getMonth() + 1).padStart(2, "0")}/${String(h.getDate()).padStart(2, "0")}/${h.getFullYear()}`;
73
73
  }, tt = (a) => {
74
- const m = Number(a);
75
- return Number.isNaN(m) ? String(a) : `$${m.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
76
- }, He = (a) => {
77
- const m = Number(a);
78
- return Number.isNaN(m) ? String(a) : m.toLocaleString("en-US");
79
- }, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Tl = `
74
+ const u = Number(a);
75
+ return Number.isNaN(u) ? String(a) : `$${u.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
76
+ }, Be = (a) => {
77
+ const u = Number(a);
78
+ 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);
82
+ 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;
85
+ const m = () => {
86
+ if (!i) {
87
+ const L = x.scrollWidth - x.clientWidth;
88
+ L > 0.5 && (_.current = S.getBoundingClientRect().width + L, w(!0));
89
+ return;
90
+ }
91
+ const F = N.getBoundingClientRect().right - S.getBoundingClientRect().left;
92
+ _.current && F >= _.current + 1 && w(!1);
93
+ };
94
+ m();
95
+ const T = new ResizeObserver(m);
96
+ return T.observe(N), () => T.disconnect();
97
+ }, [i]), /* @__PURE__ */ p(
98
+ "span",
99
+ {
100
+ ref: h,
101
+ "data-field-touch-text": !0,
102
+ "data-short": i || void 0,
103
+ className: "min-w-0 truncate",
104
+ children: [
105
+ a,
106
+ !i && /* @__PURE__ */ p(me, { children: [
107
+ " · ",
108
+ /* @__PURE__ */ t(ql, { value: u })
109
+ ] })
110
+ ]
111
+ }
112
+ );
113
+ }
114
+ const le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Ol = `
80
115
  [data-read-board]{grid-template-columns:minmax(0,1fr)}
81
116
  [data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
82
117
  @media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
@@ -91,49 +126,49 @@ const Nt = (a) => {
91
126
  }
92
127
  @media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
93
128
  `;
94
- function Ue({
129
+ function Ie({
95
130
  value: a,
96
- trueTone: m = "positive"
131
+ trueTone: u = "positive"
97
132
  }) {
98
- const b = a === !0 || a === 1 || a === "1" || a === "true";
133
+ const h = a === !0 || a === 1 || a === "1" || a === "true";
99
134
  return /* @__PURE__ */ t(
100
135
  "span",
101
136
  {
102
- className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${b ? m === "danger" ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400" : "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
103
- children: b ? "Yes" : "No"
137
+ className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${h ? u === "danger" ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400" : "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
138
+ children: h ? "Yes" : "No"
104
139
  }
105
140
  );
106
141
  }
107
- function Ll({ collection: a, id: m }) {
108
- const b = Ne(), s = al(), F = _t(), { data: N } = U({
142
+ function Ll({ collection: a, id: u }) {
143
+ const h = Ne(), i = il(), w = Nt(), { data: _ } = U({
109
144
  queryKey: ["cbv-collection-meta", a],
110
- queryFn: () => b.request(
111
- Y(`/collections/${a}`)
112
- ).then((A) => A.data).catch(() => ({ display_template: null, fields: [] })),
145
+ queryFn: () => h.request(
146
+ z(`/collections/${a}`)
147
+ ).then((F) => F.data).catch(() => ({ display_template: null, fields: [] })),
113
148
  staleTime: 10 * 6e4,
114
149
  retry: !1
115
150
  }), {
116
- data: _,
117
- isPending: O,
118
- error: q
151
+ data: x,
152
+ isPending: S,
153
+ error: N
119
154
  } = U({
120
- queryKey: ["rrv-related", a, String(m)],
121
- queryFn: () => s(a, m),
122
- enabled: m != null && !!N,
155
+ queryKey: ["rrv-related", a, String(u)],
156
+ queryFn: () => i(a, u),
157
+ enabled: u != null && !!_,
123
158
  staleTime: 6e4,
124
159
  retry: !1
125
160
  });
126
- if (m == null) return /* @__PURE__ */ t(le, {});
127
- if (!_ && !q && (O || !N))
128
- return /* @__PURE__ */ t("span", { className: gl });
129
- if (!_) return /* @__PURE__ */ t(yl, { error: q, collection: a, id: m });
130
- let f = "";
131
- const T = N == null ? void 0 : N.display_template;
132
- if (T && (f = T.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (A, j) => {
133
- const w = j.split(".").reduce((x, g) => x == null ? void 0 : x[g], _);
134
- return w == null ? "" : String(w);
135
- }).trim()), !f) {
136
- for (const A of [
161
+ 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 });
165
+ 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);
169
+ return q == null ? "" : String(q);
170
+ }).trim()), !m) {
171
+ for (const F of [
137
172
  "name",
138
173
  "title",
139
174
  "label",
@@ -143,65 +178,65 @@ function Ll({ collection: a, id: m }) {
143
178
  "filename_download",
144
179
  "filename"
145
180
  ])
146
- if (_[A]) {
147
- f = String(_[A]);
181
+ if (x[F]) {
182
+ m = String(x[F]);
148
183
  break;
149
184
  }
150
185
  }
151
- return ul(f) && (f = fl), F ? /* @__PURE__ */ t(et, { collection: a, id: m, children: /* @__PURE__ */ t(
186
+ return fl(m) && (m = pl), w ? /* @__PURE__ */ t(et, { collection: a, id: u, children: /* @__PURE__ */ t(
152
187
  "button",
153
188
  {
154
189
  type: "button",
155
- onClick: () => F.open({ collection: a, itemId: String(m) }),
190
+ onClick: () => w.open({ collection: a, itemId: String(u) }),
156
191
  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",
157
- children: f
192
+ children: m
158
193
  }
159
- ) }) : /* @__PURE__ */ t(et, { collection: a, id: m, children: f });
194
+ ) }) : /* @__PURE__ */ t(et, { collection: a, id: u, children: m });
160
195
  }
161
- function Ol({ id: a }) {
162
- const m = Ne(), { apiBase: b } = Vt(), { data: s, isPending: F } = U({
196
+ function El({ id: a }) {
197
+ const u = Ne(), { apiBase: h } = Vt(), { data: i, isPending: w } = U({
163
198
  queryKey: ["rrv-file-meta", String(a)],
164
- queryFn: () => m.request(
165
- Y(`/files/${a}/meta`)
166
- ).then((_) => _.data).catch(() => null),
199
+ queryFn: () => u.request(
200
+ z(`/files/${a}/meta`)
201
+ ).then((x) => x.data).catch(() => null),
167
202
  enabled: a != null,
168
203
  staleTime: 5 * 6e4,
169
204
  retry: !1
170
205
  });
171
206
  if (a == null) return /* @__PURE__ */ t(le, {});
172
- if (!s && F)
207
+ if (!i && w)
173
208
  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))]" });
174
- const N = (s == null ? void 0 : s.title) || (s == null ? void 0 : s.filename_download) || `#${String(a)}`;
209
+ const _ = (i == null ? void 0 : i.title) || (i == null ? void 0 : i.filename_download) || `#${String(a)}`;
175
210
  return /* @__PURE__ */ t(
176
211
  "a",
177
212
  {
178
- href: `${b}/files/${a}`,
213
+ href: `${h}/files/${a}`,
179
214
  target: "_blank",
180
215
  rel: "noreferrer",
181
216
  className: "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",
182
- children: N
217
+ children: _
183
218
  }
184
219
  );
185
220
  }
186
- const lt = ({ collection: a, id: m }) => a === "nivaro_files" ? /* @__PURE__ */ t(Ol, { id: m }) : /* @__PURE__ */ t(Ll, { collection: a, id: m });
187
- function Cl({
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({
188
223
  junction: a,
189
- parentFk: m,
190
- junctionField: b,
191
- parentId: s,
192
- onCount: F,
193
- onTarget: N,
194
- relation: _
224
+ parentFk: u,
225
+ junctionField: h,
226
+ parentId: i,
227
+ onCount: w,
228
+ onTarget: _,
229
+ relation: x
195
230
  }) {
196
- var W;
197
- const O = Ne(), { data: q } = U({
231
+ var j;
232
+ const S = Ne(), { data: N } = U({
198
233
  queryKey: ["cbv-collection-meta", a],
199
- queryFn: () => O.request(Y(`/collections/${a}`)).then((v) => v.data),
234
+ queryFn: () => S.request(z(`/collections/${a}`)).then((k) => k.data),
200
235
  staleTime: 10 * 6e4,
201
236
  retry: !1
202
- }), f = ((q == null ? void 0 : q.relations) ?? []).find(
203
- (v) => v.many_collection === a && v.many_field === b
204
- ), T = Gt(f == null ? void 0 : f.one_allowed_collections), A = !!f && !f.one_collection && (T.length > 0 || !!f.one_collection_field), j = (f == null ? void 0 : f.one_collection_field) ?? "collection", w = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (f == null ? void 0 : f.one_collection) ?? (A ? T.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : w(T[0]) : null), { data: g } = U({
237
+ }), m = ((N == null ? void 0 : N.relations) ?? []).find(
238
+ (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({
205
240
  // Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
206
241
  // so never the same cache entry): every link write that refreshes the form's list —
207
242
  // a file upload, a picker change, the save itself — refreshes Summary's too. Its own
@@ -209,89 +244,89 @@ function Cl({
209
244
  queryKey: [
210
245
  "m2m-items",
211
246
  a,
212
- m,
213
- s,
247
+ u,
248
+ i,
214
249
  "rrv",
215
- b,
216
- A ? j : ""
250
+ h,
251
+ F ? L : ""
217
252
  ],
218
- queryFn: () => O.request(
219
- Y(`/items/${a}`, {
220
- filter: JSON.stringify({ [m]: { _eq: s } }),
221
- fields: A ? `id,${b},${j}` : `id,${b}`,
253
+ queryFn: () => S.request(
254
+ z(`/items/${a}`, {
255
+ filter: JSON.stringify({ [u]: { _eq: i } }),
256
+ fields: F ? `id,${h},${L}` : `id,${h}`,
222
257
  limit: 200
223
258
  })
224
259
  ).then(
225
- (v) => (v.data ?? []).filter((k) => k[b] != null).map((k) => {
226
- const $ = k[b];
260
+ (k) => (k.data ?? []).filter(($) => $[h] != null).map(($) => {
261
+ const A = $[h];
227
262
  return {
228
- id: String(typeof $ == "object" ? $.id : $),
229
- collection: A ? w(k[j]) : null
263
+ id: String(typeof A == "object" ? A.id : A),
264
+ collection: F ? q($[L]) : null
230
265
  };
231
266
  })
232
267
  ).catch(() => []),
233
268
  // The fields list depends on the companion leg — wait for it.
234
- enabled: !!q,
269
+ enabled: !!N,
235
270
  staleTime: 3e4,
236
271
  retry: !1
237
- }), C = g == null ? void 0 : g.map((v) => v.id), S = x ?? (A ? ((W = g == null ? void 0 : g.find((v) => v.collection)) == null ? void 0 : W.collection) ?? null : null), D = C == null ? void 0 : C.length;
238
- return ke(() => {
239
- D !== void 0 && (F == null || F(D));
240
- }, [D, F]), ke(() => {
241
- S && (N == null || N(S));
242
- }, [S, N]), q && !S && (!A || g) ? /* @__PURE__ */ t(le, {}) : !C || !S ? /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(le, {}) : S === "nivaro_files" && _ ? /* @__PURE__ */ t("div", { className: "mt-1", children: /* @__PURE__ */ t(
243
- ol,
272
+ }), 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
+ return fe(() => {
274
+ D !== void 0 && (w == null || w(D));
275
+ }, [D, w]), fe(() => {
276
+ 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,
244
279
  {
245
- relation: _,
246
- parentId: s,
280
+ relation: x,
281
+ parentId: i,
247
282
  allRelations: [],
248
283
  disabled: !0
249
284
  }
250
- ) }) : /* @__PURE__ */ t("span", { className: "flex flex-wrap gap-x-1.5 gap-y-0.5", children: (g ?? []).map(({ id: v, collection: k }, $) => /* @__PURE__ */ p(
285
+ ) }) : /* @__PURE__ */ t("span", { className: "flex flex-wrap gap-x-1.5 gap-y-0.5", children: (g ?? []).map(({ id: k, collection: $ }, A) => /* @__PURE__ */ p(
251
286
  "span",
252
287
  {
253
288
  className: "inline-flex items-center whitespace-nowrap",
254
289
  children: [
255
- /* @__PURE__ */ t(lt, { collection: k ?? S, id: v }),
256
- $ < C.length - 1 && /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
290
+ /* @__PURE__ */ t(rt, { collection: $ ?? R, id: k }),
291
+ A < E.length - 1 && /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
257
292
  ]
258
293
  },
259
- `${k ?? S}:${v}`
294
+ `${$ ?? R}:${k}`
260
295
  )) });
261
296
  }
262
- function Dl({
297
+ function Pl({
263
298
  collection: a,
264
- fkField: m,
265
- parentId: b,
266
- layoutId: s,
267
- presets: F,
268
- defaultPreset: N,
269
- onCount: _
299
+ fkField: u,
300
+ parentId: h,
301
+ layoutId: i,
302
+ presets: w,
303
+ defaultPreset: _,
304
+ onCount: x
270
305
  }) {
271
- const O = Ne(), q = _t(), f = (F ?? []).filter((l) => l && Array.isArray(l.columns)), [T, A] = Q(
306
+ const S = Ne(), N = Nt(), m = (w ?? []).filter((l) => l && Array.isArray(l.columns)), [T, F] = H(
272
307
  () => {
273
308
  var l;
274
- return f.length >= 2 ? ((l = f.find((d) => d.name === N)) == null ? void 0 : l.name) ?? f[0].name : "__all__";
309
+ return m.length >= 2 ? ((l = m.find((d) => d.name === _)) == null ? void 0 : l.name) ?? m[0].name : "__all__";
275
310
  }
276
- ), { data: j } = U({
311
+ ), { data: L } = U({
277
312
  queryKey: ["cbv-collection-meta", a],
278
- queryFn: () => O.request(Y(`/collections/${a}`)).then((l) => l.data),
313
+ queryFn: () => S.request(z(`/collections/${a}`)).then((l) => l.data),
279
314
  staleTime: 10 * 6e4,
280
315
  retry: !1
281
- }), w = (l) => {
316
+ }), q = (l) => {
282
317
  var d;
283
- return ((d = ((j == null ? void 0 : j.relations) ?? []).find(
318
+ return ((d = ((L == null ? void 0 : L.relations) ?? []).find(
284
319
  (o) => o.many_collection === a && o.many_field === l && o.one_collection
285
320
  )) == null ? void 0 : d.one_collection) ?? null;
286
- }, { data: x } = U({
287
- queryKey: ["rrv-cols", a, s ?? null],
288
- queryFn: () => O.request(
289
- Y(`/field-config/${a}`, s ? { layout_id: s } : {})
321
+ }, { data: v } = U({
322
+ queryKey: ["rrv-cols", a, i ?? null],
323
+ queryFn: () => S.request(
324
+ z(`/field-config/${a}`, i ? { layout_id: i } : {})
290
325
  ).then((l) => ({
291
326
  // Lines carry their own number — sort by it and show it first.
292
327
  lineNo: (l.data ?? []).some((d) => d.field === "line_number"),
293
328
  cols: (l.data ?? []).filter(
294
- (d) => !d.hidden && !d.field.startsWith("__") && (!d.field.includes(".") || d.interface === "relation-path") && d.field !== m && ((s ? d.layout_assigned : !0) ?? !0) && (d.interface === "relation-path" || [
329
+ (d) => !d.hidden && !d.field.startsWith("__") && (!d.field.includes(".") || d.interface === "relation-path") && d.field !== u && ((i ? d.layout_assigned : !0) ?? !0) && (d.interface === "relation-path" || [
295
330
  "string",
296
331
  "text",
297
332
  "integer",
@@ -303,69 +338,69 @@ function Dl({
303
338
  "timestamp",
304
339
  "uuid"
305
340
  ].includes(d.type ?? ""))
306
- ).filter((d, o, h) => h.findIndex((L) => L.field === d.field) === o)
341
+ ).filter((d, o, b) => b.findIndex((O) => O.field === d.field) === o)
307
342
  })),
308
343
  staleTime: 5 * 6e4,
309
344
  retry: !1
310
- }), g = (x == null ? void 0 : x.cols) ?? [], C = !!(x != null && x.lineNo), S = T !== "__all__" ? f.find((l) => l.name === T) : null, D = _e(() => {
311
- if (!S) return g;
312
- const l = new Set(S.columns), d = g.filter((o) => l.has(o.field));
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(() => {
346
+ if (!R) return g;
347
+ const l = new Set(R.columns), d = g.filter((o) => l.has(o.field));
313
348
  return d.length > 0 ? d : g;
314
- }, [g, S]), [W, v] = Q(""), [k, $] = Q(1), [ie, V] = Q({}), Z = Bt(ie, 350), De = _e(() => {
349
+ }, [g, R]), [j, k] = H(""), [$, A] = H(1), [ie, V] = H({}), Z = Gt(ie, 350), Ee = ke(() => {
315
350
  const l = [
316
- { path: [m], op: "_eq", value: b }
351
+ { path: [u], op: "_eq", value: h }
317
352
  ];
318
353
  for (const [d, o] of Object.entries(Z)) {
319
354
  if (!(o != null && o.value.trim())) continue;
320
- const h = o.value.trim(), L = Number(h), M = o.op === "_contains" ? h : h === "true" || h === "false" ? h === "true" : Number.isNaN(L) ? h : L;
321
- l.push({ path: [d], op: o.op, value: M });
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;
356
+ l.push({ path: [d], op: o.op, value: W });
322
357
  }
323
358
  return JSON.stringify(l);
324
- }, [Z, m, b]), u = 25, {
325
- data: B,
326
- isLoading: ue,
327
- isFetching: Ee
359
+ }, [Z, u, h]), f = 25, {
360
+ data: G,
361
+ isLoading: pe,
362
+ isFetching: De
328
363
  } = U({
329
- queryKey: ["rrv-rows", a, m, b, W, C, k, De],
330
- queryFn: () => O.request(
331
- Y(`/items/${a}`, {
332
- limit: u,
333
- page: k,
334
- ...W ? { sort: W } : C ? { sort: "line_number" } : {},
335
- conditions: De
364
+ queryKey: ["rrv-rows", a, u, h, j, E, $, Ee],
365
+ queryFn: () => S.request(
366
+ z(`/items/${a}`, {
367
+ limit: f,
368
+ page: $,
369
+ ...j ? { sort: j } : E ? { sort: "line_number" } : {},
370
+ conditions: Ee
336
371
  })
337
372
  ),
338
373
  placeholderData: (l) => l,
339
374
  staleTime: 3e4,
340
375
  retry: !1
341
- }), E = (B == null ? void 0 : B.data) ?? [], ee = (B == null ? void 0 : B.total) ?? E.length, H = Object.values(Z).some((l) => !!(l != null && l.value.trim()));
342
- ke(() => {
343
- B && !H && (_ == null || _(ee));
344
- }, [B, H, ee, _]);
345
- const fe = D.filter((l) => l.field.includes(".")), pe = E.map((l) => String(l.id)), { data: z } = U({
376
+ }), P = (G == null ? void 0 : G.data) ?? [], ee = (G == null ? void 0 : G.total) ?? P.length, I = Object.values(Z).some((l) => !!(l != null && l.value.trim()));
377
+ fe(() => {
378
+ G && !I && (x == null || x(ee));
379
+ }, [G, I, ee, x]);
380
+ const he = D.filter((l) => l.field.includes(".")), be = P.map((l) => String(l.id)), { data: Y } = U({
346
381
  queryKey: [
347
382
  "rrv-resolve-paths",
348
383
  a,
349
- fe.map((l) => l.field).join(","),
350
- pe.join(",")
384
+ he.map((l) => l.field).join(","),
385
+ be.join(",")
351
386
  ],
352
- queryFn: () => O.request(
353
- Y(`/items/${a}/resolve-paths`, {
354
- ids: pe.join(","),
355
- paths: fe.map((l) => l.field).join(",")
387
+ queryFn: () => S.request(
388
+ z(`/items/${a}/resolve-paths`, {
389
+ ids: be.join(","),
390
+ paths: he.map((l) => l.field).join(",")
356
391
  })
357
392
  ).then((l) => l.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
358
- enabled: fe.length > 0 && pe.length > 0,
393
+ enabled: he.length > 0 && be.length > 0,
359
394
  staleTime: 3e4
360
- }), P = C && E.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee / u)), de = (l, d, o) => {
361
- $(1), V((h) => {
362
- const L = { ...h };
363
- return o ? L[l] = { op: d, value: o } : delete L[l], L;
395
+ }), M = E && P.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee / f)), de = (l, d, o) => {
396
+ A(1), V((b) => {
397
+ const O = { ...b };
398
+ return o ? O[l] = { op: d, value: o } : delete O[l], O;
364
399
  });
365
- }, Ve = (l) => {
366
- $(1), v((d) => d === l ? `-${l}` : d === `-${l}` ? "" : l);
400
+ }, He = (l) => {
401
+ A(1), k((d) => d === l ? `-${l}` : d === `-${l}` ? "" : l);
367
402
  };
368
- if (ue)
403
+ if (pe)
369
404
  return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((l) => /* @__PURE__ */ t(
370
405
  "div",
371
406
  {
@@ -373,22 +408,22 @@ function Dl({
373
408
  },
374
409
  l
375
410
  )) });
376
- if (E.length === 0 && Object.keys(Z).length === 0)
411
+ if (P.length === 0 && Object.keys(Z).length === 0)
377
412
  return /* @__PURE__ */ t("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
378
- const Be = (l, d) => {
379
- var M, re;
413
+ const Ue = (l, d) => {
414
+ var W, re;
380
415
  if (d.field.includes(".")) {
381
- const ne = (M = z == null ? void 0 : z.rows[String(l.id)]) == null ? void 0 : M[d.field];
382
- if (!z)
416
+ const ne = (W = Y == null ? void 0 : Y.rows[String(l.id)]) == null ? void 0 : W[d.field];
417
+ if (!Y)
383
418
  return /* @__PURE__ */ t("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
384
419
  if (!ne || ne.value === "") return /* @__PURE__ */ t(le, {});
385
- const qe = z.targets[d.field], he = (re = ne.ids) == null ? void 0 : re[0];
386
- return q && qe && he ? /* @__PURE__ */ t(et, { collection: qe, id: he, children: /* @__PURE__ */ t(
420
+ 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(
387
422
  "button",
388
423
  {
389
424
  type: "button",
390
- onClick: (Ge) => {
391
- Ge.stopPropagation(), q.open({ collection: qe, itemId: String(he) });
425
+ onClick: (Ve) => {
426
+ Ve.stopPropagation(), N.open({ collection: qe, itemId: String(ge) });
392
427
  },
393
428
  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",
394
429
  children: ne.value
@@ -396,19 +431,19 @@ function Dl({
396
431
  ) }) : ne.value;
397
432
  }
398
433
  const o = l[d.field];
399
- if (d.type === "boolean" && o == null) return /* @__PURE__ */ t(Ue, { value: !1 });
434
+ if (d.type === "boolean" && o == null) return /* @__PURE__ */ t(Ie, { value: !1 });
400
435
  if (o == null || o === "") return /* @__PURE__ */ t(le, {});
401
- const h = w(d.field);
402
- if (h === "nivaro_users")
403
- return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(kt, { userId: String(o), size: "compact" }) });
404
- if (h) return /* @__PURE__ */ t(lt, { collection: h, id: o });
405
- if (d.type === "boolean") return /* @__PURE__ */ t(Ue, { value: o });
436
+ const b = q(d.field);
437
+ 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 });
406
441
  if (d.type === "decimal" || d.type === "float") return tt(o);
407
- if (d.type === "integer") return He(o);
408
- if (d.type === "date" || d.type === "datetime" || d.type === "timestamp") return Nt(o);
409
- const L = String(o);
410
- return L.length > 48 ? `${L.slice(0, 48)}…` : L;
411
- }, oe = (l) => ["decimal", "float", "integer"].includes(l.type ?? "") && !w(l.field) && !l.field.includes("."), Pe = (l) => {
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;
446
+ }, oe = (l) => ["decimal", "float", "integer"].includes(l.type ?? "") && !q(l.field) && !l.field.includes("."), Pe = (l) => {
412
447
  const d = l.options;
413
448
  if (!d) return {};
414
449
  if (typeof d == "string")
@@ -424,21 +459,21 @@ function Dl({
424
459
  }, Me = D.some((l) => we(l)), Se = (l) => {
425
460
  const d = we(l);
426
461
  if (!d) return null;
427
- const o = E.map((M) => Number(M[l.field])).filter((M) => !Number.isNaN(M));
428
- let h = null;
429
- if (d === "count" ? h = E.length : o.length > 0 && (d === "sum" ? h = o.reduce((M, re) => M + re, 0) : d === "avg" ? h = o.reduce((M, re) => M + re, 0) / o.length : d === "min" ? h = Math.min(...o) : d === "max" && (h = Math.max(...o))), h === null) return "—";
430
- const L = Pe(l).format;
431
- return d === "count" || L === "int" ? He(Math.round(h)) : L === "currency" || l.type === "decimal" || l.type === "float" ? tt(h) : d === "avg" ? h.toFixed(2) : He(h);
432
- }, $e = (l) => !w(l.field) && !l.field.includes("."), Ke = (l) => w(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) => Ke(l) != null);
462
+ const o = P.map((W) => Number(W[l.field])).filter((W) => !Number.isNaN(W));
463
+ let b = null;
464
+ 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);
467
+ }, $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);
433
468
  return /* @__PURE__ */ p("div", { children: [
434
- f.length >= 2 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
469
+ m.length >= 2 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
435
470
  { name: "__all__", label: "All" },
436
- ...f.map((l) => ({ name: l.name, label: l.name }))
471
+ ...m.map((l) => ({ name: l.name, label: l.name }))
437
472
  ].map((l) => /* @__PURE__ */ t(
438
473
  "button",
439
474
  {
440
475
  type: "button",
441
- onClick: () => A(l.name),
476
+ onClick: () => F(l.name),
442
477
  "aria-pressed": T === l.name,
443
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"}`,
444
479
  children: l.label
@@ -448,21 +483,21 @@ function Dl({
448
483
  /* @__PURE__ */ t(
449
484
  "div",
450
485
  {
451
- className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ee && !ue ? "opacity-70" : ""}`,
486
+ className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${De && !pe ? "opacity-70" : ""}`,
452
487
  children: /* @__PURE__ */ p("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
453
488
  /* @__PURE__ */ p("thead", { children: [
454
489
  /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
455
- P && /* @__PURE__ */ t("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", 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: "#" }),
456
491
  D.map((l) => {
457
- const d = W === l.field || W === `-${l.field}`;
492
+ const d = j === l.field || j === `-${l.field}`;
458
493
  return /* @__PURE__ */ p(
459
494
  "th",
460
495
  {
461
- onClick: () => $e(l) && Ve(l.field),
496
+ onClick: () => $e(l) && He(l.field),
462
497
  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" : ""}`,
463
498
  children: [
464
499
  l.label || Ze(l.field),
465
- $e(l) && /* @__PURE__ */ t("span", { className: d ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: d ? W.startsWith("-") ? "▼" : "▲" : "⇅" })
500
+ $e(l) && /* @__PURE__ */ t("span", { className: d ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: d ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
466
501
  ]
467
502
  },
468
503
  l.field
@@ -470,15 +505,15 @@ function Dl({
470
505
  })
471
506
  ] }),
472
507
  Fe && /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
473
- P && /* @__PURE__ */ t("th", { className: "px-1.5 py-1" }),
508
+ M && /* @__PURE__ */ t("th", { className: "px-1.5 py-1" }),
474
509
  D.map((l) => {
475
- const d = Ke(l), o = ie[l.field];
510
+ const d = We(l), o = ie[l.field];
476
511
  return /* @__PURE__ */ p("th", { className: "px-1.5 py-1 font-normal", children: [
477
512
  d === "text" && /* @__PURE__ */ t(
478
513
  "input",
479
514
  {
480
515
  value: (o == null ? void 0 : o.value) ?? "",
481
- onChange: (h) => de(l.field, "_contains", h.target.value),
516
+ onChange: (b) => de(l.field, "_contains", b.target.value),
482
517
  placeholder: "Filter…",
483
518
  "aria-label": `Filter ${l.field}`,
484
519
  className: "h-6 w-full min-w-[56px] rounded border border-slate-200 bg-white px-1.5 text-[10.5px] font-normal normal-case tracking-normal outline-none focus:border-nvr-cyan/50 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100"
@@ -486,10 +521,10 @@ function Dl({
486
521
  ),
487
522
  d === "num" && /* @__PURE__ */ p("span", { className: "flex items-center gap-0.5", children: [
488
523
  /* @__PURE__ */ t(
489
- yt,
524
+ xt,
490
525
  {
491
526
  value: (o == null ? void 0 : o.op) ?? "_eq",
492
- onChange: (h) => de(l.field, h, (o == null ? void 0 : o.value) ?? ""),
527
+ onChange: (b) => de(l.field, b, (o == null ? void 0 : o.value) ?? ""),
493
528
  options: [
494
529
  { value: "_eq", label: "=" },
495
530
  { value: "_gte", label: "≥" },
@@ -503,17 +538,17 @@ function Dl({
503
538
  {
504
539
  type: "number",
505
540
  value: (o == null ? void 0 : o.value) ?? "",
506
- onChange: (h) => de(l.field, (o == null ? void 0 : o.op) ?? "_eq", h.target.value),
541
+ onChange: (b) => de(l.field, (o == null ? void 0 : o.op) ?? "_eq", b.target.value),
507
542
  "aria-label": `Filter ${l.field}`,
508
543
  className: "h-6 w-full min-w-[48px] rounded border border-slate-200 bg-white px-1 text-[10.5px] font-normal outline-none focus:border-nvr-cyan/50 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100"
509
544
  }
510
545
  )
511
546
  ] }),
512
547
  d === "bool" && /* @__PURE__ */ t(
513
- yt,
548
+ xt,
514
549
  {
515
550
  value: (o == null ? void 0 : o.value) ?? "",
516
- onChange: (h) => de(l.field, "_eq", h),
551
+ onChange: (b) => de(l.field, "_eq", b),
517
552
  options: [
518
553
  { value: "", label: "All" },
519
554
  { value: "true", label: "Yes" },
@@ -528,26 +563,26 @@ function Dl({
528
563
  ] })
529
564
  ] }),
530
565
  /* @__PURE__ */ p("tbody", { children: [
531
- E.length === 0 && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
566
+ P.length === 0 && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
532
567
  "td",
533
568
  {
534
- colSpan: D.length + (P ? 1 : 0),
569
+ colSpan: D.length + (M ? 1 : 0),
535
570
  className: "py-4 text-center text-[12px] text-slate-400",
536
571
  children: "No matches — adjust filters"
537
572
  }
538
573
  ) }),
539
- E.map((l) => /* @__PURE__ */ p(
574
+ P.map((l) => /* @__PURE__ */ p(
540
575
  "tr",
541
576
  {
542
- onClick: q ? () => q.open({ collection: a, itemId: String(l.id) }) : void 0,
543
- className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${q ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
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" : ""}`,
544
579
  children: [
545
- P && /* @__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) }),
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) }),
546
581
  D.map((d) => /* @__PURE__ */ t(
547
582
  "td",
548
583
  {
549
584
  className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${oe(d) ? "text-right" : ""}`,
550
- children: Be(l, d)
585
+ children: Ue(l, d)
551
586
  },
552
587
  d.field
553
588
  ))
@@ -556,20 +591,20 @@ function Dl({
556
591
  String(l.id)
557
592
  ))
558
593
  ] }),
559
- Me && E.length > 0 && /* @__PURE__ */ t("tfoot", { children: /* @__PURE__ */ p(
594
+ Me && P.length > 0 && /* @__PURE__ */ t("tfoot", { children: /* @__PURE__ */ p(
560
595
  "tr",
561
596
  {
562
597
  "data-read-grid-footer": !0,
563
598
  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",
564
599
  children: [
565
- P && /* @__PURE__ */ t("td", {}),
600
+ M && /* @__PURE__ */ t("td", {}),
566
601
  D.map((l) => {
567
602
  const d = we(l);
568
603
  return /* @__PURE__ */ t(
569
604
  "td",
570
605
  {
571
606
  className: `whitespace-nowrap px-2.5 py-1.5 ${oe(l) ? "text-right" : ""}`,
572
- children: d && /* @__PURE__ */ p(ve, { children: [
607
+ children: d && /* @__PURE__ */ p(me, { children: [
573
608
  /* @__PURE__ */ t("span", { className: "mr-1 font-mono text-[10px] text-slate-400", children: d.toUpperCase() }),
574
609
  /* @__PURE__ */ t("span", { className: "tabular-nums", children: Se(l) })
575
610
  ] })
@@ -583,11 +618,11 @@ function Dl({
583
618
  ] })
584
619
  }
585
620
  ),
586
- ee > u && /* @__PURE__ */ p("div", { className: "mt-1.5 flex items-center justify-between", children: [
621
+ ee > f && /* @__PURE__ */ p("div", { className: "mt-1.5 flex items-center justify-between", children: [
587
622
  /* @__PURE__ */ p("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
588
- ((k - 1) * u + 1).toLocaleString("en-US"),
623
+ (($ - 1) * f + 1).toLocaleString("en-US"),
589
624
  "–",
590
- Math.min(k * u, ee).toLocaleString("en-US"),
625
+ Math.min($ * f, ee).toLocaleString("en-US"),
591
626
  " of",
592
627
  " ",
593
628
  ee.toLocaleString("en-US")
@@ -597,8 +632,8 @@ function Dl({
597
632
  "button",
598
633
  {
599
634
  type: "button",
600
- disabled: k <= 1,
601
- onClick: () => $(1),
635
+ disabled: $ <= 1,
636
+ onClick: () => A(1),
602
637
  "aria-label": "First page",
603
638
  "data-tip": "First page",
604
639
  className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
@@ -609,14 +644,14 @@ function Dl({
609
644
  "button",
610
645
  {
611
646
  type: "button",
612
- disabled: k <= 1,
613
- onClick: () => $((l) => Math.max(1, l - 1)),
647
+ disabled: $ <= 1,
648
+ onClick: () => A((l) => Math.max(1, l - 1)),
614
649
  className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
615
650
  children: "← Prev"
616
651
  }
617
652
  ),
618
653
  /* @__PURE__ */ p("span", { className: "min-w-[48px] text-center text-[11px] tabular-nums text-slate-500", children: [
619
- k,
654
+ $,
620
655
  " / ",
621
656
  se.toLocaleString("en-US")
622
657
  ] }),
@@ -624,8 +659,8 @@ function Dl({
624
659
  "button",
625
660
  {
626
661
  type: "button",
627
- disabled: k >= se,
628
- onClick: () => $((l) => l + 1),
662
+ disabled: $ >= se,
663
+ onClick: () => A((l) => l + 1),
629
664
  className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
630
665
  children: "Next →"
631
666
  }
@@ -634,8 +669,8 @@ function Dl({
634
669
  "button",
635
670
  {
636
671
  type: "button",
637
- disabled: k >= se,
638
- onClick: () => $(se),
672
+ disabled: $ >= se,
673
+ onClick: () => A(se),
639
674
  "aria-label": "Last page",
640
675
  "data-tip": "Last page",
641
676
  className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
@@ -646,61 +681,59 @@ function Dl({
646
681
  ] })
647
682
  ] });
648
683
  }
649
- function xt({
684
+ function _t({
650
685
  collection: a,
651
- itemId: m,
652
- layoutData: b,
653
- design: s,
654
- flush: F,
655
- renderSlot: N,
656
- integrityMarks: _,
657
- renderGrid: O,
658
- onEditSection: q,
659
- gridCounts: f
686
+ itemId: u,
687
+ layoutData: h,
688
+ design: i,
689
+ flush: w,
690
+ renderSlot: _,
691
+ integrityMarks: x,
692
+ renderGrid: S,
693
+ onEditSection: N,
694
+ gridCounts: m
660
695
  }) {
661
- var ot;
662
- const T = Ne(), A = pl(), j = s ? s.record ?? {} : null, w = !!(s != null && s.context.showHidden), x = s ? String(((ot = s.record) == null ? void 0 : ot.id) ?? "") : m ?? "", g = _e(
663
- () => s ? {
664
- ...s.layout,
665
- layout: s.layout.layout ?? { id: 0, name: "" }
666
- } : b,
667
- [s, b]
668
- ), C = (e) => ({
669
- kind: Ce(e.field) ? "slot" : "field",
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(
698
+ () => i ? {
699
+ ...i.layout,
700
+ layout: i.layout.layout ?? { id: 0, name: "" }
701
+ } : h,
702
+ [i, h]
703
+ ), E = (e) => ({
704
+ kind: Le(e.field) ? "slot" : "field",
670
705
  field: e.field,
671
706
  group_key: e.group_key ?? null
672
- }), S = (e, r, i = !1) => s ? /* @__PURE__ */ t(_l, { target: e, children: i ? /* @__PURE__ */ t("div", { "data-design-hidden": !0, className: "opacity-40", children: r }) : r }) : r, D = _e(
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(
673
708
  () => [
674
709
  ...new Set(
675
- (s ? [] : (g == null ? void 0 : g.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
710
+ (i ? [] : (g == null ? void 0 : g.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
676
711
  )
677
712
  ].sort(),
678
- [g, s]
679
- ), { data: W } = cl(a, x, D), v = (e) => {
680
- const r = W == null ? void 0 : W[e];
713
+ [g, i]
714
+ ), { data: j } = ul(a, v, D), k = (e) => {
715
+ const r = j == null ? void 0 : j[e];
681
716
  if (!r) return null;
682
- const i = r.via !== "user";
717
+ const s = r.via !== "user";
683
718
  return r.caller && r.activity_id ? /* @__PURE__ */ t(
684
- dl,
719
+ ol,
685
720
  {
686
721
  activityId: r.activity_id,
687
722
  callerName: r.caller.name,
688
723
  collection: a,
689
- itemId: x,
724
+ itemId: v,
690
725
  children: /* @__PURE__ */ p(
691
726
  "button",
692
727
  {
693
728
  type: "button",
694
729
  "data-field-touch": e,
695
730
  "data-field-touch-caller": r.caller.key,
696
- "data-tip": `Changed ${We(r.at)} by ${r.caller.name} (through the API) — click for the request`,
697
- "aria-label": `Changed ${We(r.at)} by ${r.caller.name} through the API`,
698
- className: "ml-1 inline-flex items-center gap-1 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",
731
+ "data-tip": `Changed ${je(r.at)} by ${r.caller.name} (through the API) — click for the request`,
732
+ "aria-label": `Changed ${je(r.at)} by ${r.caller.name} through the API`,
733
+ 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",
699
734
  children: [
700
- /* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400", "aria-hidden": !0 }),
701
- r.caller.name,
702
- " · ",
703
- /* @__PURE__ */ t(Fl, { value: r.at })
735
+ /* @__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 })
704
737
  ]
705
738
  }
706
739
  )
@@ -709,27 +742,27 @@ function xt({
709
742
  "span",
710
743
  {
711
744
  "data-field-touch": e,
712
- "data-tip": `Changed ${We(r.at)} by ${r.who}${i ? ` · ${r.via}` : ""}`,
745
+ "data-tip": `Changed ${je(r.at)} by ${r.who}${s ? ` · ${r.via}` : ""}`,
713
746
  role: "img",
714
- "aria-label": `Changed ${We(r.at)} by ${r.who}`,
715
- className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${i ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
747
+ "aria-label": `Changed ${je(r.at)} by ${r.who}`,
748
+ 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"}`
716
749
  }
717
750
  );
718
- }, { data: k } = Sl(a, x, !!_ && !s), $ = _e(
719
- () => _ && (k != null && k.enabled) ? $l(k.findings) : null,
720
- [_, k]
751
+ }, { data: $ } = $l(a, v, !!x && !i), A = ke(
752
+ () => x && ($ != null && $.enabled) ? Fl($.findings) : null,
753
+ [x, $]
721
754
  ), ie = ({ field: e }) => {
722
- const r = $ == null ? void 0 : $.get(e);
755
+ const r = A == null ? void 0 : A.get(e);
723
756
  if (!r || r.length === 0) return null;
724
- const i = r.map((c) => c.message || c.rule).join(`
757
+ const s = r.map((c) => c.message || c.rule).join(`
725
758
  `);
726
759
  return /* @__PURE__ */ t(
727
760
  "span",
728
761
  {
729
762
  "data-integrity-mark": e,
730
- "data-tip": i,
763
+ "data-tip": s,
731
764
  role: "img",
732
- "aria-label": `${r.length} data integrity issue${r.length === 1 ? "" : "s"}: ${i}`,
765
+ "aria-label": `${r.length} data integrity issue${r.length === 1 ? "" : "s"}: ${s}`,
733
766
  className: "ml-1.5 inline-flex h-[14px] min-w-[14px] items-center justify-center rounded-full bg-amber-400/90 px-1 align-middle text-[9px] font-bold leading-none text-amber-950 dark:bg-amber-400 dark:text-amber-950",
734
767
  children: r.length > 1 ? r.length : "!"
735
768
  }
@@ -737,225 +770,225 @@ function xt({
737
770
  }, { data: V } = U({
738
771
  queryKey: ["cbv-collection-meta", a],
739
772
  queryFn: () => T.request(
740
- Y(`/collections/${a}`)
773
+ z(`/collections/${a}`)
741
774
  ).then((e) => e.data),
742
775
  staleTime: 10 * 6e4,
743
776
  retry: !1
744
- }), Z = vt(), { data: De } = U({
745
- queryKey: ["rrv-record", a, x],
746
- enabled: !s,
747
- queryFn: () => T.request(Y(`/items/${a}/${x}`)).then((e) => e.data),
748
- initialData: () => Z.getQueryData(["item", a, x]) ?? void 0,
777
+ }), Z = kt(), { data: Ee } = U({
778
+ queryKey: ["rrv-record", a, v],
779
+ enabled: !i,
780
+ queryFn: () => T.request(z(`/items/${a}/${v}`)).then((e) => e.data),
781
+ initialData: () => Z.getQueryData(["item", a, v]) ?? void 0,
749
782
  initialDataUpdatedAt: () => {
750
783
  var e;
751
- return (e = Z.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
784
+ return (e = Z.getQueryState(["item", a, v])) == null ? void 0 : e.dataUpdatedAt;
752
785
  },
753
786
  staleTime: 3e4,
754
787
  retry: !1
755
- }), u = j ?? De;
756
- el(a, s ? null : x, (e) => {
757
- e.aspectsOnly || e.deleted || (Z.invalidateQueries({ queryKey: ["rrv-record", a, x] }), Z.invalidateQueries({ queryKey: ["field-touch", a, x] }));
788
+ }), f = L ?? Ee;
789
+ tl(a, i ? null : v, (e) => {
790
+ e.aspectsOnly || e.deleted || (Z.invalidateQueries({ queryKey: ["rrv-record", a, v] }), Z.invalidateQueries({ queryKey: ["field-touch", a, v] }));
758
791
  });
759
- const B = It(null), [ue, Ee] = Q(() => /* @__PURE__ */ new Set());
760
- ke(() => {
761
- const e = B.current;
762
- if (B.current = u ?? null, s || !e || !u || e === u) return;
763
- const r = Object.keys(u).filter(
764
- (c) => !c.startsWith("__") && JSON.stringify(e[c]) !== JSON.stringify(u[c])
792
+ const G = Xe(null), [pe, De] = H(() => /* @__PURE__ */ new Set());
793
+ fe(() => {
794
+ const e = G.current;
795
+ if (G.current = f ?? null, i || !e || !f || e === f) return;
796
+ const r = Object.keys(f).filter(
797
+ (c) => !c.startsWith("__") && JSON.stringify(e[c]) !== JSON.stringify(f[c])
765
798
  );
766
799
  if (r.length === 0) return;
767
- Ee(new Set(r));
768
- const i = setTimeout(() => Ee(/* @__PURE__ */ new Set()), 2400);
769
- return () => clearTimeout(i);
770
- }, [u, s]);
771
- const E = (e) => ue.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: ee } = U({
800
+ De(new Set(r));
801
+ const s = setTimeout(() => De(/* @__PURE__ */ new Set()), 2400);
802
+ return () => clearTimeout(s);
803
+ }, [f, i]);
804
+ const P = (e) => pe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: ee } = U({
772
805
  queryKey: ["rrv-field-config", a, g.layout.id],
773
- enabled: !s,
806
+ enabled: !i,
774
807
  queryFn: () => T.request(
775
- Y(`/field-config/${a}`, { layout_id: g.layout.id })
808
+ z(`/field-config/${a}`, { layout_id: g.layout.id })
776
809
  ).then((e) => e.data ?? []).catch(() => null),
777
810
  staleTime: 5 * 6e4,
778
811
  retry: !1
779
- }), H = _e(
812
+ }), I = ke(
780
813
  () => new Map((ee ?? (V == null ? void 0 : V.fields) ?? []).map((e) => [e.field, e])),
781
814
  [ee, V]
782
- ), fe = (V == null ? void 0 : V.relations) ?? [], pe = (e) => {
815
+ ), he = (V == null ? void 0 : V.relations) ?? [], be = (e) => {
783
816
  var r;
784
- return ((r = fe.find(
785
- (i) => i.many_collection === a && i.many_field === e && i.one_collection
817
+ return ((r = he.find(
818
+ (s) => s.many_collection === a && s.many_field === e && s.one_collection
786
819
  )) == null ? void 0 : r.one_collection) ?? null;
787
- }, z = (e) => fe.find(
820
+ }, Y = (e) => he.find(
788
821
  (r) => r.one_collection === a && (r.one_field === e || r.many_collection === e)
789
- ) ?? null, P = (e) => {
822
+ ) ?? null, M = (e) => {
790
823
  var r;
791
- return !((e.is_visible === void 0 || e.is_visible) && xe(e.overrides).hidden !== !0 && !((r = H.get(e.field)) != null && r.hidden));
824
+ return !((e.is_visible === void 0 || e.is_visible) && _e(e.overrides).hidden !== !0 && !((r = I.get(e.field)) != null && r.hidden));
792
825
  }, se = g.assignments.filter(
793
- (e) => (!e.field.startsWith("__") || Ce(e.field)) && (w || !P(e))
826
+ (e) => (!e.field.startsWith("__") || Le(e.field)) && (q || !M(e))
794
827
  ), de = g.assignments.filter(
795
- (e) => e.field.startsWith("__widget_") && e.widget_id != null && (w || e.is_visible === void 0 || !!e.is_visible)
796
- ), Ve = (e) => {
828
+ (e) => e.field.startsWith("__widget_") && e.widget_id != null && (q || e.is_visible === void 0 || !!e.is_visible)
829
+ ), He = (e) => {
797
830
  if (!e.input_bindings) return [];
798
831
  try {
799
832
  return JSON.parse(String(e.input_bindings));
800
833
  } catch {
801
834
  return [];
802
835
  }
803
- }, Be = N || s ? g.assignments.filter(
804
- (e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !Ce(e.field) && (w || e.is_visible === void 0 || !!e.is_visible)
805
- ).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe), we = (e) => (N == null ? void 0 : N(e.field, e)) ?? (s ? /* @__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") => N || s ? Be.filter(
806
- (i) => e === null ? i.group_key == null && r === "leading" === Pe.has(i.field) : i.group_key === e
836
+ }, Ue = _ || i ? g.assignments.filter(
837
+ (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(
839
+ (s) => e === null ? s.group_key == null && r === "leading" === Pe.has(s.field) : s.group_key === e
807
840
  ).sort(
808
- (i, c) => r === "leading" && e === null ? oe.indexOf(i.field) - oe.indexOf(c.field) : 0
809
- ).map((i) => ({ key: i.field, a: i, node: we(i) })).filter((i) => i.node != null) : [], Se = (e, r = "trailing") => {
810
- const i = Me(e, r);
811
- return i.length === 0 ? null : /* @__PURE__ */ t(
841
+ (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);
844
+ return s.length === 0 ? null : /* @__PURE__ */ t(
812
845
  "div",
813
846
  {
814
847
  className: r === "leading" ? "mb-4 space-y-4" : "mt-3 space-y-4",
815
848
  "data-read-live-slots": r,
816
- children: i.map((c) => /* @__PURE__ */ t("div", { children: S(
849
+ children: s.map((c) => /* @__PURE__ */ t("div", { children: R(
817
850
  { kind: "slot", field: c.a.field, group_key: c.a.group_key ?? null },
818
851
  c.node,
819
- P(c.a)
852
+ M(c.a)
820
853
  ) }, c.key))
821
854
  }
822
855
  );
823
- }, [$e, Ke] = Q({}), Fe = (e) => w || $e[e] === !0, [l, d] = Q({}), o = bt(
824
- (e) => (r) => d((i) => i[e] === r ? i : { ...i, [e]: r }),
856
+ }, [$e, We] = H({}), Fe = (e) => q || $e[e] === !0, [l, d] = H({}), o = gt(
857
+ (e) => (r) => d((s) => s[e] === r ? s : { ...s, [e]: r }),
825
858
  []
826
- ), [h, L] = Q({}), M = bt(
827
- (e) => (r) => L((i) => i[e] === r ? i : { ...i, [e]: r }),
859
+ ), [b, O] = H({}), W = gt(
860
+ (e) => (r) => O((s) => s[e] === r ? s : { ...s, [e]: r }),
828
861
  []
829
862
  ), re = (e) => {
830
863
  const r = de.filter((c) => c.group_key === e).sort((c, y) => c.sort - y.sort);
831
864
  if (r.length === 0) return null;
832
- const i = r.some((c) => Fe(c.field));
833
- return /* @__PURE__ */ t("div", { className: i ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: r.map((c) => /* @__PURE__ */ t("div", { hidden: !Fe(c.field), children: S(
865
+ const s = r.some((c) => Fe(c.field));
866
+ 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(
834
867
  { kind: "slot", field: c.field, group_key: c.group_key ?? null },
835
868
  /* @__PURE__ */ t(
836
- ql,
869
+ Rl,
837
870
  {
838
871
  widgetId: c.widget_id,
839
- inputBindings: Ve(c),
840
- itemDraft: u ?? {},
872
+ inputBindings: He(c),
873
+ itemDraft: f ?? {},
841
874
  itemCollection: a,
842
- ready: !!u,
875
+ ready: !!f,
843
876
  label: c.label_override ?? void 0,
844
877
  defaultExpanded: c.default_expanded == null ? !0 : !!c.default_expanded,
845
- onContentChange: (y) => Ke(
846
- (I) => I[c.field] === y ? I : { ...I, [c.field]: y }
878
+ onContentChange: (y) => We(
879
+ (B) => B[c.field] === y ? B : { ...B, [c.field]: y }
847
880
  )
848
881
  }
849
882
  ),
850
- P(c)
883
+ M(c)
851
884
  ) }, c.field)) });
852
- }, [ne, qe] = Q(() => /* @__PURE__ */ new Set()), he = w || !u ? [] : xl({
885
+ }, [ne, qe] = H(() => /* @__PURE__ */ new Set()), ge = q || !f ? [] : vl({
853
886
  groups: g.groups.filter(
854
887
  (e) => e.type !== "container" && e.visibility_mode !== "new_only"
855
888
  ),
856
- values: u,
857
- fields: [...H.values()],
858
- choices: wl([...H.values()]),
859
- quiet: Zt(g.layout.conditions),
860
- readable: (e) => vl(
889
+ values: f,
890
+ fields: [...I.values()],
891
+ choices: Sl([...I.values()]),
892
+ quiet: el(g.layout.conditions),
893
+ readable: (e) => _l(
861
894
  g.assignments.filter((r) => r.group_key === e).map((r) => r.field),
862
- u,
863
- !!s
895
+ f,
896
+ !!i
864
897
  )
865
- }), Ge = (e) => qe((r) => {
866
- const i = new Set(r);
867
- return i.has(e) ? i.delete(e) : i.add(e), i;
868
- }), rt = [...g.groups].sort((e, r) => e.sort - r.sort).filter((e) => w || e.visibility_mode !== "new_only").filter(
869
- (e) => w || !u || ne.has(e.key) || sl(e.visible_when, u)
870
- ), [wt, Je] = Q(() => /* @__PURE__ */ new Set()), be = (e) => !e.is_collapsed || wt.has(e.key), St = (e) => Je((r) => {
871
- const i = new Set(r);
872
- return i.has(e) ? i.delete(e) : i.add(e), i;
873
- }), Ae = (s == null ? void 0 : s.context.fold) ?? null, Re = (s == null ? void 0 : s.context.reveal) ?? null;
874
- ke(() => {
875
- Ae && Je(Ae.open ? new Set(g.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
876
- }, [Ae == null ? void 0 : Ae.seq]), ke(() => {
877
- const e = Re ? Nl(Re.target) : null;
878
- e && Je((r) => r.has(e) ? r : new Set(r).add(e));
879
- }, [Re == null ? void 0 : Re.seq]);
880
- const Qe = [];
881
- for (const e of rt) {
898
+ }), Ve = (e) => qe((r) => {
899
+ const s = new Set(r);
900
+ 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) => {
904
+ const s = new Set(r);
905
+ return s.has(e) ? s.delete(e) : s.add(e), s;
906
+ }), Re = (i == null ? void 0 : i.context.fold) ?? null, Ae = (i == null ? void 0 : i.context.reveal) ?? null;
907
+ fe(() => {
908
+ Re && Ge(Re.open ? new Set(g.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
909
+ }, [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));
912
+ }, [Ae == null ? void 0 : Ae.seq]);
913
+ const Je = [];
914
+ for (const e of nt) {
882
915
  if (e.type === "container") {
883
- for (const r of rt.filter((i) => i.container_id != null && i.container_id === e.id))
884
- Qe.push(r);
916
+ for (const r of nt.filter((s) => s.container_id != null && s.container_id === e.id))
917
+ Je.push(r);
885
918
  continue;
886
919
  }
887
- e.container_id == null && Qe.push(e);
920
+ e.container_id == null && Je.push(e);
888
921
  }
889
- const G = (e) => {
922
+ const J = (e) => {
890
923
  var r;
891
- return !!((r = z(e.field)) != null && r.junction_field);
892
- }, nt = (e) => {
893
- var i;
924
+ return !!((r = Y(e.field)) != null && r.junction_field);
925
+ }, at = (e) => {
926
+ var s;
894
927
  const r = String(
895
- xe(e.overrides).interface ?? ((i = H.get(e.field)) == null ? void 0 : i.interface) ?? ""
928
+ _e(e.overrides).interface ?? ((s = I.get(e.field)) == null ? void 0 : s.interface) ?? ""
896
929
  );
897
930
  return /rich|wysiwyg|editorjs/i.test(r);
898
931
  }, Te = (e) => {
899
- const r = H.get(e.field), i = xe(e.overrides);
900
- if (i.summary_toggle === !0 && !s && x && u)
932
+ const r = I.get(e.field), s = _e(e.overrides);
933
+ if (s.summary_toggle === !0 && !i && v && f)
901
934
  return /* @__PURE__ */ t(
902
- El,
935
+ Ml,
903
936
  {
904
937
  collection: a,
905
- itemId: String(x),
938
+ itemId: String(v),
906
939
  field: e.field,
907
- value: u[e.field],
940
+ value: f[e.field],
908
941
  label: ce(e)
909
942
  }
910
943
  );
911
- if (Ce(e.field)) {
912
- const K = ll(i), me = hl((K == null ? void 0 : K.expr) ?? "", u ?? {});
913
- return /* @__PURE__ */ t("span", { "data-display-formula": e.field, className: "tabular-nums", children: me.error ? "—" : rl(me.value, K ?? { format: "", currency: null }) });
944
+ 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 }) });
914
947
  }
915
- const c = z(e.field);
916
- if (s && !x && (c != null && c.junction_field)) return /* @__PURE__ */ t(le, {});
948
+ const c = Y(e.field);
949
+ if (i && !v && (c != null && c.junction_field)) return /* @__PURE__ */ t(le, {});
917
950
  if (c != null && c.junction_field && c.many_collection && c.many_field)
918
951
  return /* @__PURE__ */ t(
919
- Cl,
952
+ Dl,
920
953
  {
921
954
  junction: c.many_collection,
922
955
  parentFk: c.many_field,
923
956
  junctionField: c.junction_field,
924
- parentId: x,
957
+ parentId: v,
925
958
  onCount: o(e.field),
926
- onTarget: M(e.field),
959
+ onTarget: W(e.field),
927
960
  relation: c
928
961
  }
929
962
  );
930
- const y = u == null ? void 0 : u[e.field], I = pe(e.field);
931
- if (I === "nivaro_users" && y != null)
932
- return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(kt, { userId: String(y), size: "compact" }) });
933
- if (I) return /* @__PURE__ */ t(lt, { collection: I, id: y });
934
- if ((r == null ? void 0 : r.type) === "boolean" && (y == null || y === "")) return /* @__PURE__ */ t(Ue, { value: !1 });
963
+ const y = f == null ? void 0 : f[e.field], B = be(e.field);
964
+ 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 });
935
968
  if (y == null || y === "") return /* @__PURE__ */ t(le, {});
936
969
  if ((r == null ? void 0 : r.type) === "boolean")
937
970
  return /* @__PURE__ */ t(
938
- Ue,
971
+ Ie,
939
972
  {
940
973
  value: y,
941
- trueTone: (i.options ?? {}).trueTone ?? "positive"
974
+ trueTone: (s.options ?? {}).trueTone ?? "positive"
942
975
  }
943
976
  );
944
- const te = i.options ?? {};
945
- 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: ml(y) }) : /* @__PURE__ */ t(
977
+ 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(
946
979
  "div",
947
980
  {
948
981
  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",
949
- dangerouslySetInnerHTML: { __html: il(y) }
982
+ dangerouslySetInnerHTML: { __html: sl(y) }
950
983
  }
951
- ) : 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: He(y) }) : (r == null ? void 0 : r.type) === "date" || (r == null ? void 0 : r.type) === "datetime" || (r == null ? void 0 : r.type) === "timestamp" ? Nt(y) : String(y);
952
- }, $t = (e) => {
953
- const r = xe(e.overrides), i = z(e.field);
954
- if (!(i != null && i.many_collection) || !i.many_field) return null;
955
- if (s && !x) return /* @__PURE__ */ t("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
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) => {
986
+ const r = _e(e.overrides), s = Y(e.field);
987
+ if (!(s != null && s.many_collection) || !s.many_field) return null;
988
+ if (i && !v) return /* @__PURE__ */ t("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
956
989
  const c = r.options ?? {}, y = (() => {
957
990
  var K;
958
- const te = (K = H.get(e.field)) == null ? void 0 : K.options;
991
+ const te = (K = I.get(e.field)) == null ? void 0 : K.options;
959
992
  if (!te) return {};
960
993
  if (typeof te == "string")
961
994
  try {
@@ -964,94 +997,94 @@ function xt({
964
997
  return {};
965
998
  }
966
999
  return te;
967
- })(), I = c.layout_id ?? null;
1000
+ })(), B = c.layout_id ?? null;
968
1001
  return /* @__PURE__ */ t(
969
- Dl,
1002
+ Pl,
970
1003
  {
971
- collection: i.many_collection,
972
- fkField: i.many_field,
973
- parentId: x,
974
- layoutId: I,
1004
+ collection: s.many_collection,
1005
+ fkField: s.many_field,
1006
+ parentId: v,
1007
+ layoutId: B,
975
1008
  presets: c.column_presets ?? y.column_presets,
976
1009
  defaultPreset: c.default_preset ?? y.default_preset ?? null,
977
1010
  onCount: o(e.field)
978
1011
  },
979
1012
  e.field
980
1013
  );
981
- }, X = (e) => !!z(e.field) && !G(e), Ft = !!g.layout.hide_empty, at = Array.isArray(g.layout.header_fields) ? g.layout.header_fields.filter((e) => typeof e == "string") : [], qt = new Set(at), At = (e) => {
982
- if (!u || G(e)) return !1;
983
- const r = u[e.field];
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) => {
1015
+ if (!f || J(e)) return !1;
1016
+ const r = f[e.field];
984
1017
  return r == null || r === "" || Array.isArray(r) && r.length === 0;
985
- }, Rt = (e) => se.find((r) => r.field === e), ce = (e) => {
1018
+ }, Ct = (e) => se.find((r) => r.field === e), ce = (e) => {
986
1019
  var c;
987
- const r = xe(e.overrides).label, i = A ? tl(e.overrides, A).label : void 0;
988
- return i !== void 0 ? i : Ce(e.field) ? typeof r == "string" && r.trim() ? r : "Formula" : typeof r == "string" && r.trim() ? r : e.label_override || ((c = H.get(e.field)) == null ? void 0 : c.label) || Ze(e.field);
989
- }, Tt = (e) => {
990
- const r = Yt(e.swap_config), i = se.filter((n) => n.group_key === e.key && !qt.has(n.field)).filter((n) => w || !u || !zt(n.overrides) || !ye(u[n.field])).sort((n, R) => n.sort - R.sort), c = de.filter((n) => n.group_key === e.key), y = Me(e.key), I = i.length === 0 && c.length === 0 && y.length === 0;
991
- if (I && !s) return null;
992
- const te = (n) => Ft && !w && (X(n) || G(n)) && ((f == null ? void 0 : f[n.field]) ?? l[n.field]) === 0, K = i.filter((n) => !X(n)), me = i.filter(X), je = c.filter((n) => Fe(n.field)), Ot = !e.hide_when_empty && y.length === 0 && je.length === 0 && i.length > 0 && i.some((n) => X(n) || G(n)) && i.every(te), Ye = (n) => !Ot && te(n), Ct = i.filter((n) => !Ye(n)), ge = (n) => (f == null ? void 0 : f[n.field]) ?? l[n.field], Dt = !!e.hide_when_empty && !s && !w && !!u && y.length === 0 && je.length === 0 && i.every((n) => X(n) || G(n) ? ge(n) === 0 : ye(u[n.field])) || !I && Ct.length === 0 && y.length === 0 && je.length === 0, Et = (n) => (f == null ? void 0 : f[n.field]) ?? l[n.field], ze = !!r.emptyText && !!u && !s && y.length === 0 && je.length === 0 && i.every((n) => X(n) || G(n) ? Et(n) === 0 : ye(u[n.field])), Pt = Xt(K, { rows: r.rows }).units, Xe = e.is_collapsed ? Rl(e.summary_fields).map((n) => {
993
- const R = i.find((Le) => Le.field === n.field);
994
- return R ? { a: R, label: n.label || ce(R) } : null;
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;
1024
+ 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;
995
1028
  }).filter((n) => !!n).filter(
996
- ({ a: n }) => !e.summary_hide_empty || !u || (X(n) || G(n) ? ge(n) !== 0 : !ye(u[n.field]))
997
- ).slice(0, Al) : [], ct = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : me.length > 0 || c.length > 0 || y.length > 0 || K.length > 4 ? "full" : "half", Mt = (n) => {
998
- var ft, pt, ht;
999
- const R = Ye(n), J = !!(xe(n.overrides).options ?? {}).emphasis, Oe = nt(n) || !!((pt = (ft = H.get(n.field)) == null ? void 0 : ft.interface) != null && pt.includes("rich-text")), mt = u == null ? void 0 : u[n.field], ut = !Oe && !G(n) && !pe(n.field) && (String(((ht = H.get(n.field)) == null ? void 0 : ht.interface) ?? "").includes("textarea") || typeof mt == "string" && mt.length > 36);
1029
+ ({ 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);
1000
1033
  return /* @__PURE__ */ t(
1001
1034
  "div",
1002
1035
  {
1003
- hidden: R,
1004
- className: `min-w-0 ${Oe || G(n) && (h[n.field] === "nivaro_files" || (l[n.field] ?? 0) > 3) ? "col-span-full" : J || ut ? "col-span-2" : ""}`,
1005
- children: S(
1006
- C(n),
1007
- /* @__PURE__ */ p(ve, { children: [
1008
- /* @__PURE__ */ p("dt", { className: Ie, children: [
1009
- ce(n),
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" : ""}`,
1038
+ children: R(
1039
+ E(n),
1040
+ /* @__PURE__ */ p(me, { children: [
1041
+ /* @__PURE__ */ p("dt", { className: vt, "data-fact-label": !0, children: [
1042
+ /* @__PURE__ */ t("span", { className: "max-w-full shrink-0 truncate", children: ce(n) }),
1010
1043
  /* @__PURE__ */ t(ie, { field: n.field }),
1011
- /* @__PURE__ */ t(gt, { field: n.field }),
1012
- v(n.field)
1044
+ /* @__PURE__ */ t(yt, { field: n.field }),
1045
+ k(n.field)
1013
1046
  ] }),
1014
1047
  /* @__PURE__ */ t(
1015
1048
  "dd",
1016
1049
  {
1017
1050
  "data-replay-field": n.field,
1018
1051
  "data-field-collection": a,
1019
- "data-remote-changed": ue.has(n.field) || void 0,
1020
- className: `mt-1 min-w-0${E(n.field)} ${J ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${G(n) || Oe ? "" : ut ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
1021
- children: u ? 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
+ "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))]" })
1022
1055
  }
1023
1056
  )
1024
1057
  ] }),
1025
- P(n)
1058
+ M(n)
1026
1059
  )
1027
1060
  },
1028
1061
  n.field
1029
1062
  );
1030
- }, Kt = (n, R) => {
1031
- const Le = u && !s ? R.filter((J) => !ye(u[J.field])) : R;
1063
+ }, jt = (n, C) => {
1064
+ const Ce = f && !i ? C.filter((Q) => !ve(f[Q.field])) : C;
1032
1065
  return /* @__PURE__ */ p(
1033
1066
  "div",
1034
1067
  {
1035
1068
  "data-read-row": n.key,
1036
- className: `min-w-0 ${R.length > 2 ? "col-span-full" : "col-span-2"}`,
1069
+ className: `min-w-0 ${C.length > 2 ? "col-span-full" : "col-span-2"}`,
1037
1070
  children: [
1038
- /* @__PURE__ */ t("dt", { className: Ie, children: n.label.trim() || R.map(ce).join(" / ") }),
1039
- /* @__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: u ? Le.length === 0 ? /* @__PURE__ */ t(le, {}) : Le.map((J, Oe) => /* @__PURE__ */ p(Ht, { 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: [
1040
1073
  Oe > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
1041
- S(
1042
- C(J),
1074
+ R(
1075
+ E(Q),
1043
1076
  /* @__PURE__ */ t(
1044
1077
  "span",
1045
1078
  {
1046
- "data-replay-field": J.field,
1079
+ "data-replay-field": Q.field,
1047
1080
  "data-field-collection": a,
1048
- className: `min-w-0 break-words${E(J.field)}`,
1049
- children: Te(J)
1081
+ className: `min-w-0 break-words${P(Q.field)}`,
1082
+ children: Te(Q)
1050
1083
  }
1051
1084
  ),
1052
- P(J)
1085
+ M(Q)
1053
1086
  )
1054
- ] }, J.field)) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
1087
+ ] }, 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))]" }) })
1055
1088
  ]
1056
1089
  },
1057
1090
  `row:${n.key}`
@@ -1060,70 +1093,70 @@ function xt({
1060
1093
  return /* @__PURE__ */ t(
1061
1094
  "section",
1062
1095
  {
1063
- hidden: Dt,
1096
+ hidden: Pt,
1064
1097
  "data-read-section": e.key,
1065
- "data-read-width": ct,
1098
+ "data-read-width": ut,
1066
1099
  className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
1067
- children: S(
1100
+ children: R(
1068
1101
  { kind: "group", key: e.key },
1069
- /* @__PURE__ */ p(ve, { children: [
1102
+ /* @__PURE__ */ p(me, { children: [
1070
1103
  /* @__PURE__ */ p(
1071
1104
  "h3",
1072
1105
  {
1073
1106
  "data-read-head": "",
1074
- className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${be(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
1107
+ className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${ye(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
1075
1108
  children: [
1076
- e.is_collapsed ? /* @__PURE__ */ p(ve, { children: [
1109
+ e.is_collapsed ? /* @__PURE__ */ p(me, { children: [
1077
1110
  /* @__PURE__ */ t(
1078
1111
  "button",
1079
1112
  {
1080
1113
  type: "button",
1081
- onClick: () => St(e.key),
1082
- "aria-expanded": be(e),
1083
- className: `min-w-0 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white ${Xe.length > 0 && !be(e) ? "shrink-0" : "flex-1"}`,
1114
+ onClick: () => Ft(e.key),
1115
+ "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"}`,
1084
1117
  children: e.label
1085
1118
  }
1086
1119
  ),
1087
- !be(e) && Xe.length > 0 && // #3195: two or three values while the section is closed. Not
1120
+ !ye(e) && Ye.length > 0 && // #3195: two or three values while the section is closed. Not
1088
1121
  // interactive: the heading's toggle covers the whole row.
1089
1122
  /* @__PURE__ */ t(
1090
1123
  "span",
1091
1124
  {
1092
1125
  "data-read-collapsed-summary": e.key,
1093
1126
  className: "pointer-events-none flex min-w-0 flex-1 items-baseline gap-x-3 overflow-hidden whitespace-nowrap text-[12px] font-normal",
1094
- children: Xe.map(({ a: n, label: R }) => /* @__PURE__ */ p("span", { className: "flex min-w-0 shrink items-baseline gap-1", children: [
1095
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: R }),
1096
- /* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: u ? X(n) || G(n) ? ge(n) == null ? "…" : `${ge(n)} ${X(n) ? ge(n) === 1 ? "row" : "rows" : ge(n) === 1 ? "item" : "items"}` : ye(u[n.field]) ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Te(n) : "…" })
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) : "…" })
1097
1130
  ] }, n.field))
1098
1131
  }
1099
1132
  )
1100
1133
  ] }) : /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: e.label }),
1101
- q && (K.length > 0 || me.length > 0) && /* @__PURE__ */ t(
1134
+ N && (K.length > 0 || ue.length > 0) && /* @__PURE__ */ t(
1102
1135
  "button",
1103
1136
  {
1104
1137
  type: "button",
1105
1138
  "data-read-edit-section": e.key,
1106
1139
  onClick: () => {
1107
- var n, R;
1108
- return q(e.key, ((n = K[0]) == null ? void 0 : n.field) ?? ((R = me[0]) == null ? void 0 : R.field) ?? null);
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);
1109
1142
  },
1110
1143
  title: `Edit ${e.label}`,
1111
1144
  "aria-label": `Edit ${e.label}`,
1112
1145
  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",
1113
- children: /* @__PURE__ */ t(jt, { className: "h-3 w-3" })
1146
+ children: /* @__PURE__ */ t(Bt, { className: "h-3 w-3" })
1114
1147
  }
1115
1148
  ),
1116
1149
  e.is_collapsed && /* @__PURE__ */ t(
1117
- Wt,
1150
+ It,
1118
1151
  {
1119
1152
  "aria-hidden": "true",
1120
- 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 ${be(e) ? "" : "-rotate-90"}`
1153
+ 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"}`
1121
1154
  }
1122
1155
  )
1123
1156
  ]
1124
1157
  }
1125
1158
  ),
1126
- /* @__PURE__ */ p("div", { "data-read-body": "", className: "px-5 pb-5 pt-4", hidden: !be(e), children: [
1159
+ /* @__PURE__ */ p("div", { "data-read-body": "", className: "px-5 pb-5 pt-4", hidden: !ye(e), children: [
1127
1160
  ze && /* @__PURE__ */ t(
1128
1161
  "p",
1129
1162
  {
@@ -1140,37 +1173,37 @@ function xt({
1140
1173
  "dl",
1141
1174
  {
1142
1175
  className: "grid gap-x-6 gap-y-5",
1143
- "data-read-dl": ct,
1176
+ "data-read-dl": ut,
1144
1177
  style: ze ? { display: "none" } : void 0,
1145
- children: Pt.map(
1146
- (n) => n.kind === "row" ? Kt(n.row, n.members) : Mt(n.field)
1178
+ children: Wt.map(
1179
+ (n) => n.kind === "row" ? jt(n.row, n.members) : Kt(n.field)
1147
1180
  )
1148
1181
  }
1149
1182
  ),
1150
- me.map((n) => {
1151
- var R;
1183
+ ue.map((n) => {
1184
+ var C;
1152
1185
  return /* @__PURE__ */ t(
1153
1186
  "div",
1154
1187
  {
1155
1188
  className: K.length > 0 ? "mt-3" : "",
1156
- hidden: Ye(n) || ze,
1157
- children: S(
1158
- C(n),
1159
- /* @__PURE__ */ p(ve, { children: [
1160
- (R = $ == null ? void 0 : $.get(n.field)) != null && R.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: [
1189
+ hidden: Qe(n) || ze,
1190
+ children: R(
1191
+ E(n),
1192
+ /* @__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: [
1161
1194
  /* @__PURE__ */ t("span", { children: ce(n) }),
1162
1195
  /* @__PURE__ */ t(ie, { field: n.field }),
1163
1196
  /* @__PURE__ */ p("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
1164
1197
  "— ",
1165
- $.get(n.field).length,
1198
+ A.get(n.field).length,
1166
1199
  " line issue",
1167
- $.get(n.field).length === 1 ? "" : "s",
1200
+ A.get(n.field).length === 1 ? "" : "s",
1168
1201
  "; switch to Edit to fix"
1169
1202
  ] })
1170
1203
  ] }) : null,
1171
- (O ? O(n) : null) ?? $t(n)
1204
+ (S ? S(n) : null) ?? qt(n)
1172
1205
  ] }),
1173
- P(n)
1206
+ M(n)
1174
1207
  )
1175
1208
  },
1176
1209
  n.field
@@ -1178,7 +1211,7 @@ function xt({
1178
1211
  }),
1179
1212
  re(e.key),
1180
1213
  Se(e.key),
1181
- I && s && /* @__PURE__ */ t(
1214
+ B && i && /* @__PURE__ */ t(
1182
1215
  "div",
1183
1216
  {
1184
1217
  "data-design-drop": e.key,
@@ -1193,23 +1226,23 @@ function xt({
1193
1226
  },
1194
1227
  e.key
1195
1228
  );
1196
- }, it = Se(null), Lt = Se(null, "leading"), st = at.map((e) => Rt(e)).filter((e) => !!e && !X(e)).filter((e) => w || !At(e)), [ae, ...dt] = st;
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;
1197
1230
  return /* @__PURE__ */ p(
1198
1231
  "div",
1199
1232
  {
1200
- className: F ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
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",
1201
1234
  children: [
1202
1235
  Lt,
1203
- st.length > 0 && /* @__PURE__ */ p(
1236
+ dt.length > 0 && /* @__PURE__ */ p(
1204
1237
  "div",
1205
1238
  {
1206
1239
  "data-read-header": !0,
1207
1240
  className: "mb-4 rounded-xl border border-slate-200 bg-white px-5 py-4 dark:border-slate-700/60 dark:bg-slate-900/40",
1208
1241
  children: [
1209
- ae && S(
1242
+ ae && R(
1210
1243
  { kind: "header", field: ae.field },
1211
1244
  /* @__PURE__ */ p("div", { className: "min-w-0", children: [
1212
- /* @__PURE__ */ p("p", { className: Ie, children: [
1245
+ /* @__PURE__ */ p("p", { className: lt, children: [
1213
1246
  ce(ae),
1214
1247
  /* @__PURE__ */ t(ie, { field: ae.field })
1215
1248
  ] }),
@@ -1218,73 +1251,73 @@ function xt({
1218
1251
  {
1219
1252
  "data-replay-field": ae.field,
1220
1253
  "data-field-collection": a,
1221
- className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${E(ae.field)}`,
1222
- children: u ? Te(ae) : "…"
1254
+ 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) : "…"
1223
1256
  }
1224
1257
  )
1225
1258
  ] }),
1226
- P(ae)
1259
+ M(ae)
1227
1260
  ),
1228
- 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: S(
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(
1229
1262
  { kind: "header", field: e.field },
1230
- /* @__PURE__ */ p(ve, { children: [
1231
- /* @__PURE__ */ p("dt", { className: Ie, children: [
1232
- ce(e),
1263
+ /* @__PURE__ */ p(me, { children: [
1264
+ /* @__PURE__ */ p("dt", { className: vt, children: [
1265
+ /* @__PURE__ */ t("span", { className: "max-w-full shrink-0 truncate", children: ce(e) }),
1233
1266
  /* @__PURE__ */ t(ie, { field: e.field }),
1234
- /* @__PURE__ */ t(gt, { field: e.field }),
1235
- v(e.field)
1267
+ /* @__PURE__ */ t(yt, { field: e.field }),
1268
+ k(e.field)
1236
1269
  ] }),
1237
1270
  /* @__PURE__ */ t(
1238
1271
  "dd",
1239
1272
  {
1240
1273
  "data-replay-field": e.field,
1241
1274
  "data-field-collection": a,
1242
- "data-remote-changed": ue.has(e.field) || void 0,
1243
- className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${E(e.field)}`,
1244
- children: u ? Te(e) : "…"
1275
+ "data-remote-changed": pe.has(e.field) || void 0,
1276
+ className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${P(e.field)}`,
1277
+ children: f ? Te(e) : "…"
1245
1278
  }
1246
1279
  )
1247
1280
  ] }),
1248
- P(e)
1281
+ M(e)
1249
1282
  ) }, e.field)) })
1250
1283
  ]
1251
1284
  }
1252
1285
  ),
1253
- /* @__PURE__ */ t("style", { children: Tl }),
1254
- V && he.length > 0 && /* @__PURE__ */ t("div", { className: "mb-3", children: /* @__PURE__ */ t(bl, { items: he, revealed: ne, onToggle: Ge }) }),
1255
- V ? /* @__PURE__ */ t("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Qe.map(Tt) }) : /* @__PURE__ */ p("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
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: [
1256
1289
  /* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1257
1290
  /* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1258
1291
  /* @__PURE__ */ t("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
1259
1292
  ] }),
1260
- it && /* @__PURE__ */ t("div", { className: "mt-4", children: it })
1293
+ st && /* @__PURE__ */ t("div", { className: "mt-4", children: st })
1261
1294
  ]
1262
1295
  }
1263
1296
  );
1264
1297
  }
1265
- function Nr(a) {
1266
- return a.design ? /* @__PURE__ */ t(kl, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ t(Ut.Provider, { value: null, children: /* @__PURE__ */ t(xt, { ...a }) }) }) : /* @__PURE__ */ t(xt, { ...a });
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 });
1267
1300
  }
1268
- function El({
1301
+ function Ml({
1269
1302
  collection: a,
1270
- itemId: m,
1271
- field: b,
1272
- value: s,
1273
- label: F
1303
+ itemId: u,
1304
+ field: h,
1305
+ value: i,
1306
+ label: w
1274
1307
  }) {
1275
- const N = Ne(), _ = vt(), [O, q] = Q(null), f = O ?? (s === !0 || s === 1 || s === "1" || s === "true"), T = async () => {
1276
- if (O !== null) return;
1277
- const A = !f;
1278
- q(A);
1308
+ const _ = Ne(), x = kt(), [S, N] = H(null), m = S ?? (i === !0 || i === 1 || i === "1" || i === "true"), T = async () => {
1309
+ if (S !== null) return;
1310
+ const F = !m;
1311
+ N(F);
1279
1312
  try {
1280
- await N.request(Jt(`/items/${a}/${m}`, { [b]: A })), await Promise.all([
1281
- _.invalidateQueries({ queryKey: ["rrv-record", a, m] }),
1282
- _.invalidateQueries({ queryKey: ["item", a, m] })
1283
- ]), nl(_, a, m);
1284
- } catch (j) {
1285
- Qt(j, "Could not save that change");
1313
+ await _.request(Qt(`/items/${a}/${u}`, { [h]: F })), await Promise.all([
1314
+ x.invalidateQueries({ queryKey: ["rrv-record", a, u] }),
1315
+ x.invalidateQueries({ queryKey: ["item", a, u] })
1316
+ ]), al(x, a, u);
1317
+ } catch (L) {
1318
+ zt(L, "Could not save that change");
1286
1319
  } finally {
1287
- q(null);
1320
+ N(null);
1288
1321
  }
1289
1322
  };
1290
1323
  return /* @__PURE__ */ p(
@@ -1292,33 +1325,33 @@ function El({
1292
1325
  {
1293
1326
  type: "button",
1294
1327
  role: "switch",
1295
- "aria-checked": f,
1296
- "aria-label": typeof F == "string" ? F : b,
1297
- disabled: O !== null,
1328
+ "aria-checked": m,
1329
+ "aria-label": typeof w == "string" ? w : h,
1330
+ disabled: S !== null,
1298
1331
  onClick: () => void T(),
1299
- "data-summary-toggle": b,
1332
+ "data-summary-toggle": h,
1300
1333
  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",
1301
1334
  children: [
1302
1335
  /* @__PURE__ */ t(
1303
1336
  "span",
1304
1337
  {
1305
1338
  "aria-hidden": !0,
1306
- className: `relative inline-flex h-[18px] w-8 shrink-0 items-center rounded-full transition-colors ${f ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-slate-600"}`,
1339
+ className: `relative inline-flex h-[18px] w-8 shrink-0 items-center rounded-full transition-colors ${m ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-slate-600"}`,
1307
1340
  children: /* @__PURE__ */ t(
1308
1341
  "span",
1309
1342
  {
1310
- className: `inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${f ? "translate-x-[16px]" : "translate-x-[2px]"}`
1343
+ className: `inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${m ? "translate-x-[16px]" : "translate-x-[2px]"}`
1311
1344
  }
1312
1345
  )
1313
1346
  }
1314
1347
  ),
1315
- f ? "Yes" : "No"
1348
+ m ? "Yes" : "No"
1316
1349
  ]
1317
1350
  }
1318
1351
  );
1319
1352
  }
1320
1353
  export {
1321
1354
  Al as COLLAPSED_SUMMARY_MAX,
1322
- Nr as RecordReadView,
1323
- Rl as collapsedSummaryEntries
1355
+ Sr as RecordReadView,
1356
+ Tl as collapsedSummaryEntries
1324
1357
  };