@nivaro/react 0.3.16 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +51 -1
  4. package/dist/index.js +243 -240
  5. package/dist/shared/components/CollectionBrowserView.js +439 -438
  6. package/dist/shared/components/ItemEditForm.js +3758 -3708
  7. package/dist/shared/components/ProfileView.js +38 -23
  8. package/dist/shared/components/RecordReadView.js +452 -430
  9. package/dist/shared/components/bulk/BulkActionButtons.js +113 -106
  10. package/dist/shared/components/chat/ChannelArchive.js +16 -17
  11. package/dist/shared/components/chat/ChatAnalyticsView.js +2 -2
  12. package/dist/shared/components/chat/ChatPanel.js +992 -930
  13. package/dist/shared/components/chat/Composer.js +307 -303
  14. package/dist/shared/components/chat/chat-core.js +8 -4
  15. package/dist/shared/components/chat/chat-drafts.js +60 -43
  16. package/dist/shared/components/item-edit/InlineTableField.js +159 -158
  17. package/dist/shared/components/item-edit/RecordLiveSync.js +169 -155
  18. package/dist/shared/components/item-edit/RelationCombobox.js +274 -247
  19. package/dist/shared/components/item-edit/RowHistorySheet.js +62 -62
  20. package/dist/shared/components/item-edit/picker-search.js +28 -0
  21. package/dist/shared/components/panels/RevisionsPanel.js +268 -260
  22. package/dist/shared/components/pipeline/PipelineEditorView.js +1672 -1568
  23. package/dist/shared/components/profile/BrowserPushCard.js +135 -89
  24. package/dist/shared/components/profile/push-failure.js +76 -0
  25. package/dist/shared/lib/display-prefs.js +90 -0
  26. package/dist/shared/lib/request-gate.js +140 -127
  27. package/dist/shared/lib/theme-accents.js +21 -16
  28. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { jsx as s, jsxs as _, Fragment as xn } from "react/jsx-runtime";
2
- import { useQueryClient as jo, useQuery as Fe, useQueries as Ct } from "@tanstack/react-query";
3
- import { Loader2 as vn, ListChecks as Ya, SquarePen as Ga, Rows3 as Xa, PanelBottomOpen as Za, Zap as Ca, Clock as Ni, History as Lr, AlertTriangle as Yn, ChevronRight as To, GripVertical as xo, FileUp as vo, X as wo, GripHorizontal as el, Lock as tl } from "lucide-react";
2
+ import { useQueryClient as jo, useQuery as Fe, useQueries as Zt } from "@tanstack/react-query";
3
+ import { Loader2 as vn, ListChecks as Ya, SquarePen as Ga, Rows3 as Xa, PanelBottomOpen as Ca, Zap as Za, Clock as Ni, History as Lr, AlertTriangle as Yn, ChevronRight as To, GripVertical as xo, FileUp as vo, X as wo, GripHorizontal as el, Lock as tl } from "lucide-react";
4
4
  import { useState as U, useMemo as T, useEffect as $e, useRef as xe, useCallback as Mt, Fragment as Si } from "react";
5
5
  import { createPortal as nl } from "react-dom";
6
6
  import { ChangeReasonDialog as rl, changeReasonChallenge as $i } from "./ChangeReasonDialog.js";
@@ -22,11 +22,11 @@ import { useAddendumO2M as wl, useAddendumView as _l } from "./AddendumFieldCont
22
22
  import { resolveCompareEndpoint as kl, useCompareSeries as Nl, compareColumnClosed as Kt, fmtMoney as qi, CompareProposalBanner as Sl, CompareStripChips as $l, GridStatChip as ql, CompareCell as Ei, compareRowFor as Oi, compareColumnSum as El, ReconcileAction as Ol } from "./CompareSeries.js";
23
23
  import { FieldRenderer as yn } from "./FieldRenderer.js";
24
24
  import { GridBulkEditDialog as Il } from "./GridBulkEditDialog.js";
25
- import { SENTINEL_FIELDS as Ii, applyDisplayTemplate as Bn, parseJson as No, EMPTY_NESTED_OPS as Mr, SYSTEM_FIELDS as So } from "./helpers.js";
25
+ import { SENTINEL_FIELDS as Mi, applyDisplayTemplate as Bn, parseJson as No, EMPTY_NESTED_OPS as Mr, SYSTEM_FIELDS as So } from "./helpers.js";
26
26
  import { NUMBER_FIELD_TYPES as Al, checkNumberEntry as jl, changedRowFields as $o, lineRuleErrors as Tl } from "./line-qty.js";
27
- import { NestedRelationEditor as Ai } from "./NestedRelationEditor.js";
27
+ import { NestedRelationEditor as Ii } from "./NestedRelationEditor.js";
28
28
  import { useO2MStaging as Ll, useLiveRows as Ml, useStagedRelations as Kl } from "./O2MStagingContext.js";
29
- import { RelationCombobox as ji } from "./RelationCombobox.js";
29
+ import { RelationCombobox as Ai } from "./RelationCombobox.js";
30
30
  import { useRowCommentCounts as Rl, RowCommentButton as Pl } from "./RowComments.js";
31
31
  import { RowHistorySheet as qo, parseImportStamp as Dl } from "./RowHistorySheet.js";
32
32
  import { useRowMatches as Wl, RowMatchDot as Eo, rowFromCandidate as Ul, RowMatchPanel as Jl } from "./RowMatchPanel.js";
@@ -44,7 +44,7 @@ function Oo(a, f) {
44
44
  const ne = String(f.value ?? "");
45
45
  return z === "neq" ? W !== ne : W === ne;
46
46
  }
47
- function Ti(a, f) {
47
+ function ji(a, f) {
48
48
  var E, z;
49
49
  if (!(f != null && f.length)) return [];
50
50
  const v = [];
@@ -110,7 +110,7 @@ function Bl(a) {
110
110
  }
111
111
  return v;
112
112
  }
113
- const Li = /* @__PURE__ */ new Set([
113
+ const Ki = /* @__PURE__ */ new Set([
114
114
  "alias",
115
115
  "o2m",
116
116
  "m2m",
@@ -134,7 +134,7 @@ function Ko(a, f, v, E) {
134
134
  }
135
135
  return ne;
136
136
  }
137
- const Mi = 1e3;
137
+ const Ti = 1e3;
138
138
  function Hl(a) {
139
139
  let f = 0;
140
140
  for (let v = 0; v < a.length; v++) f = f * 31 + a.charCodeAt(v) | 0;
@@ -151,7 +151,7 @@ function Yl(a) {
151
151
  function Rt(a, f) {
152
152
  return pt(a, f);
153
153
  }
154
- function Ki(a, f) {
154
+ function Li(a, f) {
155
155
  return f.map((v) => {
156
156
  const E = a[`__m2m_${v}`];
157
157
  return String(E !== void 0 ? E ?? "" : a[v] ?? "");
@@ -208,7 +208,7 @@ function Xl({
208
208
  stagingActive: te,
209
209
  pendingRows: je,
210
210
  pendingEdits: L,
211
- pendingDeletes: C
211
+ pendingDeletes: Z
212
212
  }) {
213
213
  const pe = Pr(), [G, Ee] = U(!1), [ze, ie] = U(null), [Oe, ge] = U({}), [X, de] = U(null), he = T(
214
214
  () => (a.columns ?? []).map(
@@ -260,7 +260,7 @@ function Xl({
260
260
  return Q;
261
261
  }, [z, a.target_field]);
262
262
  function Te(Q) {
263
- const D = ae.get(Q), P = (D == null ? void 0 : D.id) != null ? String(D.id) : null, j = !!(P && (C != null && C.has(P))), se = (je ?? []).findIndex(
263
+ const D = ae.get(Q), P = (D == null ? void 0 : D.id) != null ? String(D.id) : null, j = !!(P && (Z != null && Z.has(P))), se = (je ?? []).findIndex(
264
264
  (S) => String(S[a.target_field]) === Q
265
265
  );
266
266
  let fe = 0;
@@ -310,7 +310,7 @@ function Xl({
310
310
  ie(null);
311
311
  }
312
312
  }
313
- function Ce(Q, D, P) {
313
+ function Ze(Q, D, P) {
314
314
  return pt(Q, (j) => j in P ? P[j] : Kr(D, j));
315
315
  }
316
316
  function Pe(Q) {
@@ -318,13 +318,13 @@ function Xl({
318
318
  return { __input__: j !== void 0 && j !== "" ? Number(j) || 0 : se, __saved__: P };
319
319
  }
320
320
  function et(Q, D) {
321
- const P = Ce(Q, D, Pe(String(D.id)));
321
+ const P = Ze(Q, D, Pe(String(D.id)));
322
322
  return P === null ? "—" : P.toLocaleString("en-US", { style: "currency", currency: "USD" });
323
323
  }
324
324
  function be(Q) {
325
325
  if (!a.value_max) return null;
326
326
  const D = ae.get(String(Q.id)), P = Number((D == null ? void 0 : D[a.value_field]) ?? 0) || 0;
327
- return Ce(a.value_max, Q, { __input__: P, __saved__: P });
327
+ return Ze(a.value_max, Q, { __input__: P, __saved__: P });
328
328
  }
329
329
  return /* @__PURE__ */ _(xn, { children: [
330
330
  /* @__PURE__ */ s(
@@ -375,12 +375,12 @@ function Xl({
375
375
  (tt) => !!tt.formula || tt.format === "currency"
376
376
  ), Wt = N.indexOf(!0), qt = Wt === -1 ? he.length : Math.max(1, Wt), Gn = (tt) => {
377
377
  const Ye = he[tt];
378
- let Zn = 0;
378
+ let Cn = 0;
379
379
  for (const _e of me) {
380
- const _n = Ye.formula ? Ce(Ye.formula, _e, Pe(String(_e.id))) : Number(Kr(_e, Ye.path ?? ""));
381
- _n !== null && Number.isFinite(_n) && (Zn += _n);
380
+ const _n = Ye.formula ? Ze(Ye.formula, _e, Pe(String(_e.id))) : Number(Kr(_e, Ye.path ?? ""));
381
+ _n !== null && Number.isFinite(_n) && (Cn += _n);
382
382
  }
383
- return Zn.toLocaleString("en-US", {
383
+ return Cn.toLocaleString("en-US", {
384
384
  style: "currency",
385
385
  currency: "USD"
386
386
  });
@@ -498,7 +498,7 @@ function Xl({
498
498
  ] }) })
499
499
  ] });
500
500
  }
501
- function Zl({
501
+ function Cl({
502
502
  config: a,
503
503
  rows: f,
504
504
  relatedCollection: v,
@@ -518,10 +518,10 @@ function Zl({
518
518
  }
519
519
  oe(!0);
520
520
  try {
521
- const L = await W.request(re(`/collections/${v}`)).then((X) => X.data), C = ((L == null ? void 0 : L.relations) ?? []).find(
521
+ const L = await W.request(re(`/collections/${v}`)).then((X) => X.data), Z = ((L == null ? void 0 : L.relations) ?? []).find(
522
522
  (X) => X.one_collection === v && X.one_field === a.relation
523
523
  );
524
- if (!(C != null && C.many_collection) || !(C != null && C.many_field)) {
524
+ if (!(Z != null && Z.many_collection) || !(Z != null && Z.many_field)) {
525
525
  Se.error(
526
526
  `${a.label}: "${a.relation}" is not a relation on ${v}`
527
527
  );
@@ -533,14 +533,14 @@ function Zl({
533
533
  return;
534
534
  }
535
535
  const G = await W.request(
536
- re(`/items/${C.many_collection}`, {
537
- filter: JSON.stringify({ [C.many_field]: { _in: pe } }),
538
- fields: `id,${C.many_field},${a.aggregate.field}`,
536
+ re(`/items/${Z.many_collection}`, {
537
+ filter: JSON.stringify({ [Z.many_field]: { _in: pe } }),
538
+ fields: `id,${Z.many_field},${a.aggregate.field}`,
539
539
  limit: "2000"
540
540
  })
541
541
  ).then((X) => X.data ?? []), Ee = a.aggregate.op ?? "sum", ze = /* @__PURE__ */ new Map();
542
542
  for (const X of G) {
543
- const de = String(X[C.many_field] ?? ""), he = Number(X[a.aggregate.field]);
543
+ const de = String(X[Z.many_field] ?? ""), he = Number(X[a.aggregate.field]);
544
544
  !de || Number.isNaN(he) || ze.set(de, [...ze.get(de) ?? [], he]);
545
545
  }
546
546
  const ie = (X) => {
@@ -608,7 +608,7 @@ function Zl({
608
608
  }
609
609
  );
610
610
  }
611
- function Cl({
611
+ function Zl({
612
612
  config: a,
613
613
  matchCfg: f,
614
614
  rows: v,
@@ -617,7 +617,7 @@ function Cl({
617
617
  relatedCollection: W,
618
618
  manyField: ne
619
619
  }) {
620
- const oe = Pr(), J = jo(), [A, te] = U(!1), [je, L] = U(null), C = async () => {
620
+ const oe = Pr(), J = jo(), [A, te] = U(!1), [je, L] = U(null), Z = async () => {
621
621
  if (A) return;
622
622
  te(!0), L(null);
623
623
  const pe = a.fk_field, G = a.alloc_qty_field, Ee = a.candidates.min_capacity ?? 1, ze = [
@@ -651,7 +651,7 @@ function Cl({
651
651
  z
652
652
  );
653
653
  if (!xt) continue;
654
- const Ce = await oe.request(
654
+ const Ze = await oe.request(
655
655
  re(`/items/${a.candidates.collection}`, {
656
656
  filter: JSON.stringify(xt.query),
657
657
  fields: ["id", ...ze].join(","),
@@ -659,11 +659,11 @@ function Cl({
659
659
  limit: 500
660
660
  })
661
661
  ).then((D) => D.data ?? []);
662
- if (Ce.length === 0) {
662
+ if (Ze.length === 0) {
663
663
  X.push(he + 1);
664
664
  continue;
665
665
  }
666
- const Pe = Ce.map((D) => String(D.id)), et = await oe.request(
666
+ const Pe = Ze.map((D) => String(D.id)), et = await oe.request(
667
667
  re(`/items/${f.collection}`, {
668
668
  filter: JSON.stringify({ [pe]: { _in: Pe } }),
669
669
  fields: `${pe},${G}`,
@@ -675,7 +675,7 @@ function Cl({
675
675
  be[P] = (be[P] ?? 0) + (Number(D[G]) || 0);
676
676
  }
677
677
  const Q = Te;
678
- for (const D of Ce) {
678
+ for (const D of Ze) {
679
679
  if (Te <= 0) break;
680
680
  const P = String(D.id), se = (Rt(a.candidates.capacity_formula, D) ?? 0) - (be[P] ?? 0) - (ie[P] ?? 0);
681
681
  if (se < Ee) continue;
@@ -706,7 +706,7 @@ function Cl({
706
706
  {
707
707
  type: "button",
708
708
  disabled: A,
709
- onClick: () => void C(),
709
+ onClick: () => void Z(),
710
710
  className: "h-6 px-2.5 rounded border border-nvr-cyan text-nvr-cyan hover:bg-nvr-cyan/10 transition-colors disabled:opacity-50",
711
711
  children: A ? "Allocating…" : a.label ?? "Auto allocate"
712
712
  }
@@ -714,7 +714,12 @@ function Cl({
714
714
  je && /* @__PURE__ */ s("span", { className: "text-[11px] text-slate-500", children: je })
715
715
  ] });
716
716
  }
717
- function Rd({
717
+ function ed(a) {
718
+ return a.filter(
719
+ (f) => f.group_key === "__apply_values__" && !Ki.has(f.type ?? "") && !Mi.has(f.field) && !f.readonly && !(f.computed_type === "write" && f.computed_formula) && f.interface !== "formula-column" && f.interface !== "match-agg-column" && f.interface !== "relation-path"
720
+ );
721
+ }
722
+ function Pd({
718
723
  relatedCollection: a,
719
724
  manyField: f,
720
725
  parentId: v,
@@ -728,7 +733,7 @@ function Rd({
728
733
  enableReorder: te = !0,
729
734
  parentCascades: je,
730
735
  rowRules: L,
731
- columnPresets: C,
736
+ columnPresets: Z,
732
737
  defaultPreset: pe,
733
738
  drawerRelations: G,
734
739
  parentContextFields: Ee,
@@ -746,7 +751,7 @@ function Rd({
746
751
  rowMatchPanel: ae,
747
752
  lineSla: Te,
748
753
  rowLints: xt,
749
- stats: Ce,
754
+ stats: Ze,
750
755
  compareSeries: Pe,
751
756
  sumCap: et,
752
757
  spreadRemaining: be,
@@ -771,7 +776,7 @@ function Rd({
771
776
  queryFn: () => S.request(re(`/field-config/${E}`)).then((e) => e.data ?? []),
772
777
  enabled: fe === void 0 && !!E && !!P,
773
778
  staleTime: 5 * 6e4
774
- }), Zn = T(() => {
779
+ }), Cn = T(() => {
775
780
  if (fe) return fe;
776
781
  const e = Ye == null ? void 0 : Ye.find((t) => t.field === P), n = e != null && e.options ? typeof e.options == "string" ? (() => {
777
782
  try {
@@ -781,13 +786,13 @@ function Rd({
781
786
  }
782
787
  })() : e.options : {};
783
788
  return (n == null ? void 0 : n.editor_mode) === "split" ? "split" : "drawer";
784
- }, [fe, Ye, P]), _e = !j && (Xn ?? Zn) === "split", _n = (e) => {
789
+ }, [fe, Ye, P]), _e = !j && (Xn ?? Cn) === "split", _n = (e) => {
785
790
  tt(e);
786
791
  try {
787
792
  localStorage.setItem(Gn, e);
788
793
  } catch {
789
794
  }
790
- }, Dr = `nvr_grid_split_h_${a}`, [Cn, Pi] = U(() => {
795
+ }, Dr = `nvr_grid_split_h_${a}`, [Zn, Pi] = U(() => {
791
796
  if (typeof localStorage > "u") return 320;
792
797
  try {
793
798
  const e = Number(localStorage.getItem(Dr));
@@ -798,10 +803,10 @@ function Rd({
798
803
  });
799
804
  $e(() => {
800
805
  try {
801
- localStorage.setItem(Dr, String(Cn));
806
+ localStorage.setItem(Dr, String(Zn));
802
807
  } catch {
803
808
  }
804
- }, [Cn, Dr]);
809
+ }, [Zn, Dr]);
805
810
  const er = xe(null), tr = xe(null), Di = xe(async () => {
806
811
  }), Wr = xe(
807
812
  async () => {
@@ -874,7 +879,7 @@ function Rd({
874
879
  Qi.current = !0, S.request(
875
880
  re(`/items/${a}`, {
876
881
  filter: JSON.stringify({ [f]: { _eq: D } }),
877
- limit: Mi
882
+ limit: Ti
878
883
  })
879
884
  ).then((e) => {
880
885
  for (const n of e.data ?? [])
@@ -902,7 +907,7 @@ function Rd({
902
907
  const t = (await S.request(
903
908
  re(`/items/${a}`, {
904
909
  filter: JSON.stringify({ [f]: { _eq: e } }),
905
- limit: Mi
910
+ limit: Ti
906
911
  })
907
912
  )).data ?? [];
908
913
  for (const r of t) {
@@ -981,7 +986,7 @@ function Rd({
981
986
  var t, r, i;
982
987
  const n = ((i = (r = (t = e.target) == null ? void 0 : t.closest) == null ? void 0 : r.call(t, "[data-grid-cell]")) == null ? void 0 : i.getAttribute("data-grid-cell")) ?? null;
983
988
  n !== vt.current && (vt.current && or(vt.current, "end"), vt.current = n, n && or(n, "start"));
984
- }, Zo = (e) => {
989
+ }, Co = (e) => {
985
990
  var t, r;
986
991
  (r = (t = e.relatedTarget) == null ? void 0 : t.closest) != null && r.call(t, "[data-grid-cell]") || (vt.current && or(vt.current, "end"), vt.current = null);
987
992
  };
@@ -1035,10 +1040,10 @@ function Rd({
1035
1040
  };
1036
1041
  return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
1037
1042
  }, [p, j]);
1038
- const [gt, Sn] = U(!1), [Gi, zt] = U(null), [$n, ar] = U(null), [Xi, Zi] = U(!1);
1039
- async function Co() {
1043
+ const [gt, Sn] = U(!1), [Gi, zt] = U(null), [$n, ar] = U(null), [Xi, Ci] = U(!1);
1044
+ async function Zo() {
1040
1045
  if (!$n) return;
1041
- Zi(!0);
1046
+ Ci(!0);
1042
1047
  const e = [];
1043
1048
  let n = "";
1044
1049
  for (const r of $n.groups) {
@@ -1051,7 +1056,7 @@ function Rd({
1051
1056
  }
1052
1057
  i.length && e.push({ ...r, members: i });
1053
1058
  }
1054
- Zi(!1), V.invalidateQueries({ queryKey: ["o2m-rows", a, f, v] });
1059
+ Ci(!1), V.invalidateQueries({ queryKey: ["o2m-rows", a, f, v] });
1055
1060
  const t = e.reduce((r, i) => r + i.members.length, 0);
1056
1061
  ar(
1057
1062
  t > 0 ? {
@@ -1062,9 +1067,9 @@ function Rd({
1062
1067
  }
1063
1068
  const [lr, qn] = U(null), Le = _l(), [Qr, ea] = U(() => {
1064
1069
  var e;
1065
- return pe === Hn ? Hn : pe && (C != null && C.some((n) => n.name === pe)) ? pe : (e = C == null ? void 0 : C[0]) == null ? void 0 : e.name;
1070
+ return pe === Hn ? Hn : pe && (Z != null && Z.some((n) => n.name === pe)) ? pe : (e = Z == null ? void 0 : Z[0]) == null ? void 0 : e.name;
1066
1071
  });
1067
- function Ci(e) {
1072
+ function Zi(e) {
1068
1073
  ea(e);
1069
1074
  }
1070
1075
  const ut = xe(null), En = xe(!1), dr = (e) => {
@@ -1100,7 +1105,7 @@ function Rd({
1100
1105
  ).then((e) => e.data ?? {}),
1101
1106
  enabled: !!Qt,
1102
1107
  staleTime: 5 * 6e4
1103
- }), Z = (Vr == null ? void 0 : Vr.row_order_field) ?? null, cr = T(() => {
1108
+ }), C = (Vr == null ? void 0 : Vr.row_order_field) ?? null, cr = T(() => {
1104
1109
  if (!de || Object.keys(de).length === 0) return null;
1105
1110
  const e = {};
1106
1111
  for (const [n, t] of Object.entries(de))
@@ -1173,7 +1178,7 @@ function Rd({
1173
1178
  if (!n) return null;
1174
1179
  const t = Dl(n.comment);
1175
1180
  return t ? `From ${t.template} · ${ko(n.at)} by ${n.who}` : null;
1176
- }, On = je ?? [], rs = Ct({
1181
+ }, On = je ?? [], rs = Zt({
1177
1182
  queries: On.map((e) => ({
1178
1183
  queryKey: [
1179
1184
  "resolve-cascade",
@@ -1267,7 +1272,7 @@ function Rd({
1267
1272
  };
1268
1273
  }),
1269
1274
  [ss, v, N == null ? void 0 : N.draft]
1270
- ), os = Ct({
1275
+ ), os = Zt({
1271
1276
  queries: Yr.map((e) => ({
1272
1277
  queryKey: [
1273
1278
  "match-agg",
@@ -1356,9 +1361,9 @@ function Rd({
1356
1361
  return e;
1357
1362
  }, [Ae]), $ = T(() => {
1358
1363
  let e = ft ? Xe.map((n) => ({ ...n, ...ft[String(n.id)] ?? {} })) : Xe;
1359
- if (Z) {
1364
+ if (C) {
1360
1365
  const n = (t) => {
1361
- const r = K ? H.get(String(t.id)) : void 0, i = (r == null ? void 0 : r[Z]) ?? t[Z];
1366
+ const r = K ? H.get(String(t.id)) : void 0, i = (r == null ? void 0 : r[C]) ?? t[C];
1362
1367
  return Number(i ?? -1);
1363
1368
  };
1364
1369
  e = [...e].sort((t, r) => n(t) - n(r));
@@ -1378,7 +1383,7 @@ function Rd({
1378
1383
  }, [
1379
1384
  Xe,
1380
1385
  ft,
1381
- Z,
1386
+ C,
1382
1387
  K,
1383
1388
  H,
1384
1389
  ie,
@@ -1445,7 +1450,7 @@ function Rd({
1445
1450
  return $.find((t) => String(t.id) === n);
1446
1451
  }
1447
1452
  const da = /* @__PURE__ */ new Set(["__apply_values__", "__create_with_defaults__"]), An = (e) => e === "select-multiple-m2m" || (e ?? "").endsWith("-m2m");
1448
- function Zr(e) {
1453
+ function Cr(e) {
1449
1454
  const n = We.find(
1450
1455
  (r) => r.one_collection === a && (r.one_field === e.field || r.junction_field != null && r.many_collection === e.field)
1451
1456
  );
@@ -1460,30 +1465,30 @@ function Rd({
1460
1465
  junctionOtherField: t.many_field
1461
1466
  };
1462
1467
  }
1463
- const Cr = JSON.stringify([...H.entries()]) + "|" + [...Je].sort().join(",") + "|" + JSON.stringify(M), sn = (e, n = []) => {
1468
+ const Zr = JSON.stringify([...H.entries()]) + "|" + [...Je].sort().join(",") + "|" + JSON.stringify(M), sn = (e, n = []) => {
1464
1469
  var o;
1465
- if (!Z) return e;
1470
+ if (!C) return e;
1466
1471
  const t = new Set(n);
1467
1472
  for (const c of $) {
1468
1473
  const u = Number(
1469
- (K ? (o = H.get(String(c.id))) == null ? void 0 : o[Z] : void 0) ?? c[Z]
1474
+ (K ? (o = H.get(String(c.id))) == null ? void 0 : o[C] : void 0) ?? c[C]
1470
1475
  );
1471
1476
  Number.isFinite(u) && t.add(u);
1472
1477
  }
1473
1478
  for (const c of M) {
1474
- const u = Number(c[Z]);
1479
+ const u = Number(c[C]);
1475
1480
  Number.isFinite(u) && t.add(u);
1476
1481
  }
1477
- const r = Number(e[Z]);
1482
+ const r = Number(e[C]);
1478
1483
  if (Number.isFinite(r) && r > 0 && !t.has(r)) return e;
1479
1484
  let i = 1;
1480
1485
  for (const c of t) c >= i && (i = c + 1);
1481
- return { ...e, [Z]: i };
1486
+ return { ...e, [C]: i };
1482
1487
  }, on = (e) => {
1483
1488
  const n = [];
1484
1489
  return e.map((t) => {
1485
1490
  const r = sn(t, n);
1486
- return Z && n.push(Number(r[Z])), r;
1491
+ return C && n.push(Number(r[C])), r;
1487
1492
  });
1488
1493
  }, ei = T(() => {
1489
1494
  const e = [
@@ -1498,7 +1503,7 @@ function Rd({
1498
1503
  r >= 0 && r < e.length && (e[r] = n);
1499
1504
  }
1500
1505
  return e;
1501
- }, [$, Cr, p]), jn = T(() => {
1506
+ }, [$, Zr, p]), jn = T(() => {
1502
1507
  if (Le === "original") return ei;
1503
1508
  const e = me.find((n) => n.addendumId === Le);
1504
1509
  return e ? e.rows.map(
@@ -1507,7 +1512,7 @@ function Rd({
1507
1512
  e.baseRows ? n : void 0
1508
1513
  )
1509
1514
  ) : ei;
1510
- }, [Le, me, ei]), ms = Xe.length >= Mi, wt = N == null ? void 0 : N.draft, Vt = Mt(
1515
+ }, [Le, me, ei]), ms = Xe.length >= Ti, wt = N == null ? void 0 : N.draft, Vt = Mt(
1511
1516
  (e) => {
1512
1517
  if (e.startsWith("$parent."))
1513
1518
  return (wt == null ? void 0 : wt[e.slice(8)]) ?? 0;
@@ -1518,7 +1523,7 @@ function Rd({
1518
1523
  return e === "$count" ? jn.length : wt == null ? void 0 : wt[e];
1519
1524
  },
1520
1525
  [wt, jn]
1521
- ), ti = T(() => Ce != null && Ce.length ? Ce.map((e) => ({ ...e, result: pt(e.value, Vt) })) : null, [Ce, Vt]), hr = T(
1526
+ ), ti = T(() => Ze != null && Ze.length ? Ze.map((e) => ({ ...e, result: pt(e.value, Vt) })) : null, [Ze, Vt]), hr = T(
1522
1527
  () => Pe != null && Pe.endpoint ? kl(Pe.endpoint, wt) : null,
1523
1528
  [Pe == null ? void 0 : Pe.endpoint, wt]
1524
1529
  ), ni = Nl({
@@ -1728,7 +1733,7 @@ function Rd({
1728
1733
  }), (t = e.get(c)) == null || t.fields.add(i.source_field);
1729
1734
  }
1730
1735
  return [...e.entries()];
1731
- }, [Ln, xs, N == null ? void 0 : N.draft]), vs = Ct({
1736
+ }, [Ln, xs, N == null ? void 0 : N.draft]), vs = Zt({
1732
1737
  queries: ma.map(([e, n]) => ({
1733
1738
  queryKey: ["pinned-parent", n.collection, n.id, [...n.fields].sort().join(",")],
1734
1739
  queryFn: () => we(n.collection, n.id, [...n.fields]).then((t) => [e, t]).catch(() => [e, null]),
@@ -1756,8 +1761,8 @@ function Rd({
1756
1761
  const t = Ln.get(e);
1757
1762
  return t ? ws(t, n) : null;
1758
1763
  }, Ne = ke.filter(
1759
- (e) => !e.hidden && (!Li.has(e.type) || An(e.interface)) && e.field !== f && e.field !== "id" && (!Qt || e.layout_assigned === !0) && !Ii.has(e.field) && !da.has(e.group_key ?? "")
1760
- ), _t = C && C.length >= 2 && Qr !== Hn ? C.find((e) => e.name === Qr) : void 0, pa = new Set(
1764
+ (e) => !e.hidden && (!Ki.has(e.type) || An(e.interface)) && e.field !== f && e.field !== "id" && (!Qt || e.layout_assigned === !0) && !Mi.has(e.field) && !da.has(e.group_key ?? "")
1765
+ ), _t = Z && Z.length >= 2 && Qr !== Hn ? Z.find((e) => e.name === Qr) : void 0, pa = new Set(
1761
1766
  (G ?? []).map((e) => typeof e == "string" ? e : e.field)
1762
1767
  ), _s = _t ? new Set(
1763
1768
  _t.columns.filter((e) => {
@@ -1798,13 +1803,13 @@ function Rd({
1798
1803
  )
1799
1804
  ],
1800
1805
  [kt]
1801
- ), Ns = Ct({
1806
+ ), Ns = Zt({
1802
1807
  queries: dn.map((e) => ({
1803
1808
  queryKey: ["field-config", e, null],
1804
1809
  queryFn: () => S.request(re(`/field-config/${e}`)).then((n) => n.data ?? []),
1805
1810
  staleTime: 6e4
1806
1811
  }))
1807
- }), Ss = Ct({
1812
+ }), Ss = Zt({
1808
1813
  queries: dn.map((e) => ({
1809
1814
  queryKey: ["collection-meta", e],
1810
1815
  queryFn: () => S.request(re(`/collections/${e}`)).then((n) => {
@@ -1847,7 +1852,7 @@ function Rd({
1847
1852
  ), Es = T(() => {
1848
1853
  if (!X) return null;
1849
1854
  const e = [];
1850
- te && (Z || O || K) && e.push(24), A && e.push(32), (O || K) && e.push(80), e.push(220);
1855
+ te && (C || O || K) && e.push(24), A && e.push(32), (O || K) && e.push(80), e.push(220);
1851
1856
  let n = 0;
1852
1857
  const t = [];
1853
1858
  return e.forEach((r, i) => {
@@ -1862,7 +1867,7 @@ function Rd({
1862
1867
  X,
1863
1868
  Kn,
1864
1869
  te,
1865
- Z,
1870
+ C,
1866
1871
  O,
1867
1872
  K,
1868
1873
  A
@@ -1882,7 +1887,7 @@ function Rd({
1882
1887
  a,
1883
1888
  vr,
1884
1889
  !!ne && !O
1885
- ), Is = Ct({
1890
+ ), Is = Zt({
1886
1891
  queries: Ht.map((e) => {
1887
1892
  const n = kt.get(e);
1888
1893
  return {
@@ -2166,7 +2171,7 @@ function Rd({
2166
2171
  }
2167
2172
  for (const c of e.keys()) o.has(c) || i.push(c);
2168
2173
  return t.size === 0 && r.size === 0 && i.length === 0 ? null : { added: t, changed: r, removed: i, total: t.size + r.size + i.length };
2169
- }, [Xe, ya, Cr, O, Nt]), va = () => {
2174
+ }, [Xe, ya, Zr, O, Nt]), va = () => {
2170
2175
  un.current = new Map(Xe.map((e) => [String(e.id), Nt(e)])), li((e) => e + 1);
2171
2176
  }, fn = xe(null), [Nr, Rs] = U({}), Dn = T(() => {
2172
2177
  const e = fn.current, n = p == null ? void 0 : p.rowId;
@@ -2254,7 +2259,7 @@ function Rd({
2254
2259
  r.who && e.add(r.who);
2255
2260
  }
2256
2261
  return [...e];
2257
- }, [Ot, Br]), [Ze, Yt] = U(null), di = xe(/* @__PURE__ */ new Set()), Ws = (e, n) => JSON.stringify([e, n]), [mn, wa] = U(() => /* @__PURE__ */ new Map()), Us = xe(""), ci = xe(() => {
2262
+ }, [Ot, Br]), [Ce, Yt] = U(null), di = xe(/* @__PURE__ */ new Set()), Ws = (e, n) => JSON.stringify([e, n]), [mn, wa] = U(() => /* @__PURE__ */ new Map()), Us = xe(""), ci = xe(() => {
2258
2263
  }), _a = (e) => {
2259
2264
  const n = tr.current;
2260
2265
  if (!n) return null;
@@ -2298,14 +2303,14 @@ function Rd({
2298
2303
  const [t, r] = JSON.parse(n);
2299
2304
  mn.get(t) !== r && e.delete(n);
2300
2305
  }
2301
- Ze && mn.get(Ze.rowKey) !== Ze.editor && Yt(null);
2302
- }, [mn, Ze]), $e(() => {
2303
- if (!Ze || typeof window > "u") return;
2306
+ Ce && mn.get(Ce.rowKey) !== Ce.editor && Yt(null);
2307
+ }, [mn, Ce]), $e(() => {
2308
+ if (!Ce || typeof window > "u") return;
2304
2309
  const e = (n) => {
2305
2310
  n.key === "Escape" && Yt(null);
2306
2311
  };
2307
2312
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2308
- }, [Ze]);
2313
+ }, [Ce]);
2309
2314
  const ui = T(() => {
2310
2315
  if (mn.size === 0) return [];
2311
2316
  const e = [];
@@ -2340,15 +2345,10 @@ function Rd({
2340
2345
  for (const t of n.deletes) e.deletes.has(t) || ot(t);
2341
2346
  e.pending < n.pending && (Et.current = Date.now());
2342
2347
  }
2343
- }, [Cr]);
2344
- const fi = T(
2345
- () => ke.filter(
2346
- (e) => e.group_key === "__apply_values__" && !Li.has(e.type ?? "") && !Ii.has(e.field)
2347
- ),
2348
- [ke]
2349
- ), Qs = T(
2348
+ }, [Zr]);
2349
+ const fi = T(() => ed(ke), [ke]), Qs = T(
2350
2350
  () => ke.filter(
2351
- (e) => e.group_key === "__create_with_defaults__" && !Li.has(e.type ?? "") && !Ii.has(e.field)
2351
+ (e) => e.group_key === "__create_with_defaults__" && !Ki.has(e.type ?? "") && !Mi.has(e.field)
2352
2352
  ),
2353
2353
  [ke]
2354
2354
  ), Ve = T(() => {
@@ -2398,7 +2398,7 @@ function Rd({
2398
2398
  c.length && e.push({ field: t, target: r.one_collection, filter: o, ids: c });
2399
2399
  }
2400
2400
  return e;
2401
- }, [it, mi, Ve, $, M]), Fs = Ct({
2401
+ }, [it, mi, Ve, $, M]), Fs = Zt({
2402
2402
  queries: pi.map((e) => ({
2403
2403
  queryKey: [
2404
2404
  "cascade-stale-sweep",
@@ -2801,7 +2801,7 @@ function Rd({
2801
2801
  Yt({ rowKey: n, editor: t });
2802
2802
  return;
2803
2803
  }
2804
- Ze && Yt(null);
2804
+ Ce && Yt(null);
2805
2805
  const r = ce({ ...e });
2806
2806
  fn.current = { rowId: n, snap: Nt(e) }, De({ rowId: n, draft: r, locksPending: Nn.size > 0 }), $r(n, r);
2807
2807
  }
@@ -2823,7 +2823,7 @@ function Rd({
2823
2823
  if (j) return;
2824
2824
  const t = `pending:${n}`;
2825
2825
  if ((p == null ? void 0 : p.rowId) === t) return;
2826
- Ze && Yt(null);
2826
+ Ce && Yt(null);
2827
2827
  const r = ce({ ...e });
2828
2828
  De({ rowId: t, draft: r, locksPending: Nn.size > 0 }), $r(t, r);
2829
2829
  }
@@ -2974,12 +2974,12 @@ function Rd({
2974
2974
  ((l = Ge.current) == null ? void 0 : l.rowId) === e && De(null);
2975
2975
  };
2976
2976
  if (ze != null && ze.length) {
2977
- const l = p.rowId.startsWith("pending:"), m = l ? parseInt(p.rowId.split(":")[1], 10) : null, g = p.rowId === "new" || l ? null : p.rowId, b = Ki(p.draft, ze);
2977
+ const l = p.rowId.startsWith("pending:"), m = l ? parseInt(p.rowId.split(":")[1], 10) : null, g = p.rowId === "new" || l ? null : p.rowId, b = Li(p.draft, ze);
2978
2978
  if ($.some((w) => {
2979
2979
  if (String(w.id) === g || Je.has(String(w.id))) return !1;
2980
2980
  const y = H.has(String(w.id)) ? { ...w, ...H.get(String(w.id)) } : w;
2981
- return Ki(y, ze) === b;
2982
- }) || M.some((w, y) => y !== m && Ki(w, ze) === b))
2981
+ return Li(y, ze) === b;
2982
+ }) || M.some((w, y) => y !== m && Li(w, ze) === b))
2983
2983
  return zt(`A row with the same ${ze.join(" + ")} already exists.`), !1;
2984
2984
  }
2985
2985
  const t = (l) => l == null || l === "", r = Ne.filter(
@@ -3084,7 +3084,7 @@ function Rd({
3084
3084
  if (Et.current = Date.now(), w != null && ot(String(w)), w != null && l.length && await Promise.all(
3085
3085
  l.map(([y, x]) => {
3086
3086
  if (x == null) return Promise.resolve();
3087
- const R = y.slice(6), I = Zr({
3087
+ const R = y.slice(6), I = Cr({
3088
3088
  field: R,
3089
3089
  interface: "select-multiple-m2m"
3090
3090
  });
@@ -3186,32 +3186,32 @@ function Rd({
3186
3186
  Sn(!1);
3187
3187
  }
3188
3188
  }
3189
- const [Ia, Aa] = U(/* @__PURE__ */ new Set()), [ht, Xs] = U(null), [Tt, Zs] = U(null), [ja, Cs] = U(!1), [Gt, Ta] = U(1), [Xt, gn] = U(!1), [eo, La] = U(!1), [xi, Ma] = U({}), [to, no] = U(!1), [ro, Er] = U(!1), [vi, Ka] = U("empty-only"), [Or, io] = U(null), [Lt, hn] = U(null), [Zt, so] = U({}), [oo, ao] = U(!1);
3189
+ const [Ia, Aa] = U(/* @__PURE__ */ new Set()), [ht, Xs] = U(null), [Tt, Cs] = U(null), [ja, Zs] = U(!1), [Gt, Ta] = U(1), [Xt, gn] = U(!1), [eo, La] = U(!1), [xi, Ma] = U({}), [to, no] = U(!1), [ro, Er] = U(!1), [vi, Ka] = U("empty-only"), [Or, io] = U(null), [Lt, hn] = U(null), [Ct, so] = U({}), [oo, ao] = U(!1);
3190
3190
  function Ra(e, n) {
3191
3191
  Ma((t) => ({ ...t, [e]: n }));
3192
3192
  }
3193
3193
  async function Pa() {
3194
- if (Object.keys(Zt).some(
3195
- (n) => Zt[n] !== null && Zt[n] !== void 0
3194
+ if (Object.keys(Ct).some(
3195
+ (n) => Ct[n] !== null && Ct[n] !== void 0
3196
3196
  )) {
3197
3197
  ao(!0);
3198
3198
  try {
3199
3199
  if ($.length)
3200
3200
  if (K && k)
3201
3201
  $.filter((n) => !Je.has(String(n.id))).forEach(
3202
- (n) => k.queueEdit(a, f, String(n.id), Zt)
3202
+ (n) => k.queueEdit(a, f, String(n.id), Ct)
3203
3203
  );
3204
3204
  else {
3205
3205
  await Promise.all(
3206
3206
  $.map(
3207
- (n) => S.request(yt(`/items/${a}/${n.id}${dt}`, Zt))
3207
+ (n) => S.request(yt(`/items/${a}/${n.id}${dt}`, Ct))
3208
3208
  )
3209
3209
  );
3210
3210
  for (const n of $) ot(String(n.id));
3211
3211
  V.invalidateQueries({ queryKey: ["o2m-rows", a, f, v] });
3212
3212
  }
3213
3213
  M.length && k && M.forEach(
3214
- (n, t) => k.updateRow(a, f, t, { ...n, ...Zt })
3214
+ (n, t) => k.updateRow(a, f, t, { ...n, ...Ct })
3215
3215
  ), no(!1), so({});
3216
3216
  } catch {
3217
3217
  } finally {
@@ -3287,10 +3287,10 @@ function Rd({
3287
3287
  Xs(e);
3288
3288
  }
3289
3289
  function uo(e, n) {
3290
- e.preventDefault(), Zs(n);
3290
+ e.preventDefault(), Cs(n);
3291
3291
  }
3292
3292
  function bn() {
3293
- Xs(null), Zs(null);
3293
+ Xs(null), Cs(null);
3294
3294
  }
3295
3295
  async function Ua(e) {
3296
3296
  if (e.preventDefault(), ht === null || Tt === null || ht === Tt) {
@@ -3300,29 +3300,29 @@ function Rd({
3300
3300
  const n = [...$], [t] = n.splice(ht, 1);
3301
3301
  n.splice(Tt, 0, t);
3302
3302
  const r = n.map((i, o) => ({ row: i, newOrder: o })).filter(({ row: i, newOrder: o }) => {
3303
- const c = K ? H.get(String(i.id)) : void 0, u = (c == null ? void 0 : c[Z]) ?? i[Z];
3303
+ const c = K ? H.get(String(i.id)) : void 0, u = (c == null ? void 0 : c[C]) ?? i[C];
3304
3304
  return Number(u ?? -1) !== o;
3305
3305
  });
3306
3306
  if (K && k) {
3307
3307
  r.forEach(
3308
3308
  ({ row: i, newOrder: o }) => k.queueEdit(a, f, String(i.id), {
3309
- [Z]: o
3309
+ [C]: o
3310
3310
  })
3311
3311
  ), bn();
3312
3312
  return;
3313
3313
  }
3314
- Cs(!0);
3314
+ Zs(!0);
3315
3315
  try {
3316
3316
  await Promise.all(
3317
3317
  r.map(
3318
3318
  ({ row: i, newOrder: o }) => S.request(
3319
- yt(`/items/${a}/${i.id}${dt}`, { [Z]: o })
3319
+ yt(`/items/${a}/${i.id}${dt}`, { [C]: o })
3320
3320
  )
3321
3321
  )
3322
3322
  ), V.invalidateQueries({ queryKey: ["o2m-rows", a, f, v] });
3323
3323
  } catch {
3324
3324
  } finally {
3325
- Cs(!1), bn();
3325
+ Zs(!1), bn();
3326
3326
  }
3327
3327
  }
3328
3328
  async function wi(e, n) {
@@ -3511,7 +3511,7 @@ function Rd({
3511
3511
  }
3512
3512
  if (es || !O && nn)
3513
3513
  return /* @__PURE__ */ s("div", { className: "py-3 text-center text-[12px] text-slate-400", children: /* @__PURE__ */ s(vn, { className: "h-4 w-4 animate-spin inline" }) });
3514
- const Ir = (p == null ? void 0 : p.rowId) === "new", at = en && Le === "original" && !j, St = (at ? 1 : 0) + (te && (Z || O || K) ? 1 : 0) + (A ? 1 : 0) + (O || K ? 1 : 0) + Re.length + 1, Jn = at ? "select" : te && (Z || K) ? "reorder" : A ? "num" : K ? "status" : "data", zn = (e) => {
3514
+ const Ir = (p == null ? void 0 : p.rowId) === "new", at = en && Le === "original" && !j, St = (at ? 1 : 0) + (te && (C || O || K) ? 1 : 0) + (A ? 1 : 0) + (O || K ? 1 : 0) + Re.length + 1, Jn = at ? "select" : te && (C || K) ? "reorder" : A ? "num" : K ? "status" : "data", zn = (e) => {
3515
3515
  if (!Ot) return null;
3516
3516
  const n = Ot.added.has(e) ? "bg-emerald-500" : Ot.changed.has(e) ? "bg-amber-500" : null;
3517
3517
  return n ? /* @__PURE__ */ s(
@@ -3756,7 +3756,7 @@ function Rd({
3756
3756
  }, jr = (e, n) => !G || G.length === 0 ? null : /* @__PURE__ */ s("div", { className: "mt-3 space-y-2 border-t border-slate-100 pt-3 dark:border-border", children: G.map((t) => {
3757
3757
  const r = typeof t == "string" ? t : t.field, i = typeof t == "string" ? void 0 : t.hint, o = typeof t == "string" ? void 0 : t.match, c = o ? Rr(o, n, v, N == null ? void 0 : N.draft) : null;
3758
3758
  return /* @__PURE__ */ s(
3759
- Ai,
3759
+ Ii,
3760
3760
  {
3761
3761
  parentCollection: a,
3762
3762
  relationField: r,
@@ -4013,7 +4013,7 @@ function Rd({
4013
4013
  }
4014
4014
  ),
4015
4015
  be && ((n = be.fields) == null ? void 0 : n.length) > 0 && !j && /* @__PURE__ */ s(
4016
- ed,
4016
+ td,
4017
4017
  {
4018
4018
  config: be,
4019
4019
  draft: e.draft,
@@ -4087,12 +4087,12 @@ function Rd({
4087
4087
  ]
4088
4088
  }
4089
4089
  );
4090
- }, go = Qr === Hn, Ha = go ? null : (_t == null ? void 0 : _t.name) ?? ((bo = C == null ? void 0 : C[0]) == null ? void 0 : bo.name), ho = C && C.length >= 2 && /* @__PURE__ */ _("div", { className: "flex items-center gap-1 text-[11px]", children: [
4090
+ }, go = Qr === Hn, Ha = go ? null : (_t == null ? void 0 : _t.name) ?? ((bo = Z == null ? void 0 : Z[0]) == null ? void 0 : bo.name), ho = Z && Z.length >= 2 && /* @__PURE__ */ _("div", { className: "flex items-center gap-1 text-[11px]", children: [
4091
4091
  /* @__PURE__ */ s(
4092
4092
  "button",
4093
4093
  {
4094
4094
  type: "button",
4095
- onClick: () => Ci(Hn),
4095
+ onClick: () => Zi(Hn),
4096
4096
  className: ve(
4097
4097
  "h-6 px-2.5 rounded border transition-colors",
4098
4098
  go ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan" : "border-slate-200 text-slate-600 hover:border-slate-400 hover:text-slate-800"
@@ -4100,11 +4100,11 @@ function Rd({
4100
4100
  children: "All"
4101
4101
  }
4102
4102
  ),
4103
- C.map((e) => /* @__PURE__ */ s(
4103
+ Z.map((e) => /* @__PURE__ */ s(
4104
4104
  "button",
4105
4105
  {
4106
4106
  type: "button",
4107
- onClick: () => Ci(e.name),
4107
+ onClick: () => Zi(e.name),
4108
4108
  className: ve(
4109
4109
  "h-6 px-2.5 rounded border transition-colors",
4110
4110
  Ha === e.name ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan" : "border-slate-200 text-slate-600 hover:border-slate-400 hover:text-slate-800"
@@ -4124,7 +4124,7 @@ function Rd({
4124
4124
  className: "space-y-1.5",
4125
4125
  "data-o2m-collection": a,
4126
4126
  onFocusCapture: Xo,
4127
- onBlurCapture: Zo,
4127
+ onBlurCapture: Co,
4128
4128
  children: [
4129
4129
  /* @__PURE__ */ s(
4130
4130
  rl,
@@ -4210,7 +4210,7 @@ function Rd({
4210
4210
  (n) => typeof n == "object" && n.field === nt.relation && !!n.match
4211
4211
  );
4212
4212
  return e != null && e.match ? /* @__PURE__ */ s(
4213
- Cl,
4213
+ Zl,
4214
4214
  {
4215
4215
  config: nt,
4216
4216
  matchCfg: e.match,
@@ -4223,7 +4223,7 @@ function Rd({
4223
4223
  ) : null;
4224
4224
  })(),
4225
4225
  (Qe ?? []).map((e) => /* @__PURE__ */ s(
4226
- Zl,
4226
+ Cl,
4227
4227
  {
4228
4228
  config: e,
4229
4229
  rows: [...$, ...M.map((n, t) => ({ ...n, __pendingIndex: t }))],
@@ -4275,7 +4275,7 @@ function Rd({
4275
4275
  }
4276
4276
  ),
4277
4277
  Uo && /* @__PURE__ */ s("span", { className: "absolute left-0 top-full z-[70] mt-1 w-[300px] rounded-lg border border-slate-200 bg-white p-2 shadow-xl dark:border-border dark:bg-card", children: /* @__PURE__ */ s(
4278
- ji,
4278
+ Ai,
4279
4279
  {
4280
4280
  collection: E,
4281
4281
  value: null,
@@ -4311,7 +4311,7 @@ function Rd({
4311
4311
  }
4312
4312
  ),
4313
4313
  be && ((yo = be.fields) == null ? void 0 : yo.length) > 0 && be.across_rows !== !1 && $.length + M.length > 1 && /* @__PURE__ */ s(
4314
- td,
4314
+ nd,
4315
4315
  {
4316
4316
  config: be,
4317
4317
  remaining: pt(be.remaining, Vt),
@@ -4381,7 +4381,7 @@ function Rd({
4381
4381
  "inline-flex h-6 w-6 items-center justify-center rounded border transition-colors",
4382
4382
  _e ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan" : "border-slate-200 text-slate-500 hover:border-slate-400 hover:text-slate-800 dark:border-border dark:text-slate-300"
4383
4383
  ),
4384
- children: _e ? /* @__PURE__ */ s(Xa, { className: "h-3 w-3", "aria-hidden": "true" }) : /* @__PURE__ */ s(Za, { className: "h-3 w-3", "aria-hidden": "true" })
4384
+ children: _e ? /* @__PURE__ */ s(Xa, { className: "h-3 w-3", "aria-hidden": "true" }) : /* @__PURE__ */ s(Ca, { className: "h-3 w-3", "aria-hidden": "true" })
4385
4385
  }
4386
4386
  ),
4387
4387
  Xt && /* @__PURE__ */ s(vn, { className: "h-3 w-3 animate-spin text-slate-400" }),
@@ -4394,7 +4394,7 @@ function Rd({
4394
4394
  "data-grid-save-mode": "live",
4395
4395
  "data-tip": "Every change to a line here is saved the moment you make it — no Save needed",
4396
4396
  children: [
4397
- /* @__PURE__ */ s(Ca, { className: "h-3 w-3", "aria-hidden": "true" }),
4397
+ /* @__PURE__ */ s(Za, { className: "h-3 w-3", "aria-hidden": "true" }),
4398
4398
  "Saves as you go"
4399
4399
  ]
4400
4400
  }
@@ -4442,7 +4442,7 @@ function Rd({
4442
4442
  yn,
4443
4443
  {
4444
4444
  field: e,
4445
- value: Zt[e.field] ?? null,
4445
+ value: Ct[e.field] ?? null,
4446
4446
  onChange: (n) => so((t) => ({ ...t, [e.field]: n })),
4447
4447
  relations: We,
4448
4448
  collection: a,
@@ -4697,7 +4697,7 @@ function Rd({
4697
4697
  onChange: (e) => rr(e.target.checked ? new Set(_i) : /* @__PURE__ */ new Set())
4698
4698
  }
4699
4699
  ) }),
4700
- te && (Z || O || K) && /* @__PURE__ */ s("th", { className: "w-6" }),
4700
+ te && (C || O || K) && /* @__PURE__ */ s("th", { className: "w-6" }),
4701
4701
  A && /* @__PURE__ */ s("th", { className: "w-8 px-2 py-2 text-left font-medium text-slate-400 text-[11px]", children: "#" }),
4702
4702
  (O || K) && /* @__PURE__ */ s("th", { className: "px-3 py-2 text-left font-medium text-slate-400 text-[11px] w-20", children: "Status" }),
4703
4703
  Re.map((e) => /* @__PURE__ */ s(
@@ -4713,7 +4713,7 @@ function Rd({
4713
4713
  /* @__PURE__ */ _("tbody", { children: [
4714
4714
  eo && /* @__PURE__ */ _("tr", { className: "border-b border-nvr-cyan/20 bg-nvr-cyan/5", children: [
4715
4715
  at && /* @__PURE__ */ s("td", { className: "w-7" }),
4716
- te && (Z || O || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
4716
+ te && (C || O || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
4717
4717
  A && /* @__PURE__ */ s("td", { className: "w-8" }),
4718
4718
  (O || K) && /* @__PURE__ */ s("td", { className: "px-3 py-0.5 align-middle w-20", children: /* @__PURE__ */ s("span", { className: "text-[10px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Defaults" }) }),
4719
4719
  Qs.map((e) => /* @__PURE__ */ s(
@@ -4798,7 +4798,7 @@ function Rd({
4798
4798
  "data-o2m-row": `${a}:${t}`,
4799
4799
  "data-o2m-editing": u ? "" : void 0,
4800
4800
  tabIndex: _e ? -1 : void 0,
4801
- draggable: te && !!Z && !u && !b,
4801
+ draggable: te && !!C && !u && !b,
4802
4802
  onDragStart: () => co(n),
4803
4803
  onDragOver: (y) => uo(y, n),
4804
4804
  onDrop: Ua,
@@ -4844,14 +4844,14 @@ function Rd({
4844
4844
  ]
4845
4845
  }
4846
4846
  ),
4847
- te && (Z || K) && /* @__PURE__ */ _(
4847
+ te && (C || K) && /* @__PURE__ */ _(
4848
4848
  "td",
4849
4849
  {
4850
4850
  className: "relative w-6 px-1 align-middle",
4851
4851
  onClick: (y) => y.stopPropagation(),
4852
4852
  children: [
4853
4853
  Jn === "reorder" && zn(t),
4854
- Z && /* @__PURE__ */ s(xo, { className: "h-3 w-3 text-slate-300 cursor-grab" })
4854
+ C && /* @__PURE__ */ s(xo, { className: "h-3 w-3 text-slate-300 cursor-grab" })
4855
4855
  ]
4856
4856
  }
4857
4857
  ),
@@ -4883,7 +4883,7 @@ function Rd({
4883
4883
  }
4884
4884
  ),
4885
4885
  (() => {
4886
- const y = Ti(h, xt);
4886
+ const y = ji(h, xt);
4887
4887
  return y.length ? /* @__PURE__ */ s(
4888
4888
  Yn,
4889
4889
  {
@@ -4921,7 +4921,7 @@ function Rd({
4921
4921
  }
4922
4922
  ),
4923
4923
  !A && (() => {
4924
- const y = Ti(h, xt);
4924
+ const y = ji(h, xt);
4925
4925
  return y.length ? /* @__PURE__ */ s(
4926
4926
  Yn,
4927
4927
  {
@@ -5153,7 +5153,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5153
5153
  ]
5154
5154
  }
5155
5155
  ),
5156
- !_e && (Ze == null ? void 0 : Ze.rowKey) === t && /* @__PURE__ */ s("tr", { "data-row-soft-lock-row": "", children: /* @__PURE__ */ s("td", { colSpan: St, className: "p-0", children: po(Ze, "row") }) }),
5156
+ !_e && (Ce == null ? void 0 : Ce.rowKey) === t && /* @__PURE__ */ s("tr", { "data-row-soft-lock-row": "", children: /* @__PURE__ */ s("td", { colSpan: St, className: "p-0", children: po(Ce, "row") }) }),
5157
5157
  u && lt === "inline" && Dn.length > 0 && /* @__PURE__ */ s("tr", { "data-row-remote-change-row": "", children: /* @__PURE__ */ s("td", { colSpan: St, className: "px-2 pt-2", children: Ps(t) }) }),
5158
5158
  w && /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ _(
5159
5159
  "td",
@@ -5179,7 +5179,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5179
5179
  N == null ? void 0 : N.draft
5180
5180
  ) : null;
5181
5181
  return /* @__PURE__ */ s(
5182
- Ai,
5182
+ Ii,
5183
5183
  {
5184
5184
  parentCollection: a,
5185
5185
  relationField: x,
@@ -5235,7 +5235,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5235
5235
  children: [
5236
5236
  lt !== "panel" && /* @__PURE__ */ _(xn, { children: [
5237
5237
  at && /* @__PURE__ */ s("td", { className: "w-7" }),
5238
- (Z || O || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5238
+ (C || O || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5239
5239
  A && /* @__PURE__ */ s("td", { className: "w-8 px-2 align-middle text-slate-400 text-[11px] select-none", children: $.length + M.length + 1 }),
5240
5240
  (O || K) && /* @__PURE__ */ s("td", { className: "px-3 py-1.5" })
5241
5241
  ] }),
@@ -5248,12 +5248,12 @@ Reason: “${F.reason}”` : ""}` : void 0;
5248
5248
  }) : Re.map((e) => {
5249
5249
  if (st(e))
5250
5250
  return /* @__PURE__ */ s("td", { className: "px-2 py-1 align-top", children: /* @__PURE__ */ s("div", { className: "py-0.5 overflow-hidden text-slate-500", children: Rn(e, p.draft, !0) }) }, e.field);
5251
- const n = e.computed_type === "write" && !!e.computed_formula, t = An(e.interface), r = `__m2m_${e.field}`, i = t ? Zr(e) : null;
5251
+ const n = e.computed_type === "write" && !!e.computed_formula, t = An(e.interface), r = `__m2m_${e.field}`, i = t ? Cr(e) : null;
5252
5252
  return /* @__PURE__ */ s("td", { className: "px-2 py-1 align-top", children: n ? /* @__PURE__ */ s("div", { className: "py-0.5 overflow-hidden text-slate-500 italic", children: Ue(
5253
5253
  e,
5254
5254
  Rt(e.computed_formula, p.draft) ?? null
5255
5255
  ) }) : t && i ? /* @__PURE__ */ s("div", { onClick: (o) => o.stopPropagation(), children: /* @__PURE__ */ s(
5256
- ji,
5256
+ Ai,
5257
5257
  {
5258
5258
  collection: i.targetCollection,
5259
5259
  value: p.draft[r] ?? null,
@@ -5300,7 +5300,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5300
5300
  ),
5301
5301
  $.length === 0 && M.length === 0 && !Ir && /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: St, className: "px-3 py-14 text-center text-slate-400", children: se ? `No ${se.toLowerCase()} yet` : O ? "No pending rows" : "No rows yet" }) }),
5302
5302
  !O && Le !== "original" && (() => {
5303
- const e = me.find((u) => u.addendumId === Le), n = (te && (Z || K) ? 1 : 0) + (A ? 1 : 0) + (K ? 1 : 0) + Re.length + 1;
5303
+ const e = me.find((u) => u.addendumId === Le), n = (te && (C || K) ? 1 : 0) + (A ? 1 : 0) + (K ? 1 : 0) + Re.length + 1;
5304
5304
  if (!e)
5305
5305
  return $.length === 0 ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(
5306
5306
  "td",
@@ -5310,7 +5310,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5310
5310
  children: se ? `No ${se.toLowerCase()} yet` : "No rows"
5311
5311
  }
5312
5312
  ) }) : $.map((u, d) => /* @__PURE__ */ _("tr", { className: "border-b border-slate-100", children: [
5313
- te && (Z || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5313
+ te && (C || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5314
5314
  A && /* @__PURE__ */ s("td", { className: "w-8 px-2 align-middle text-[11px] text-slate-400 select-none", children: d + 1 }),
5315
5315
  K && /* @__PURE__ */ s("td", { className: "w-20" }),
5316
5316
  Re.map((l) => /* @__PURE__ */ s("td", { className: "px-2 py-1.5 text-[11px] text-slate-700", children: st(l) ? _r(l, u) : Ue(
@@ -5344,7 +5344,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5344
5344
  {
5345
5345
  className: "border-b border-red-100 bg-red-50/40 dark:border-red-500/25 dark:bg-red-500/10",
5346
5346
  children: [
5347
- te && (Z || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5347
+ te && (C || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5348
5348
  A && /* @__PURE__ */ s("td", { className: "w-8 px-2 align-middle text-[11px] text-red-300 select-none", children: "–" }),
5349
5349
  K && /* @__PURE__ */ s("td", { className: "w-20" }),
5350
5350
  Re.map((m) => /* @__PURE__ */ s(
@@ -5386,7 +5386,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5386
5386
  {
5387
5387
  className: w ? "border-b border-amber-100 bg-amber-50/40 dark:border-amber-500/25 dark:bg-amber-400/10" : "border-b border-slate-100",
5388
5388
  children: [
5389
- te && (Z || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5389
+ te && (C || K) && /* @__PURE__ */ s("td", { className: "w-6" }),
5390
5390
  A && /* @__PURE__ */ s(
5391
5391
  "td",
5392
5392
  {
@@ -5433,7 +5433,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5433
5433
  className: "border-b border-dashed border-slate-200 bg-slate-50/60 dark:border-border dark:bg-white/[0.025]",
5434
5434
  children: [
5435
5435
  at && /* @__PURE__ */ s("td", {}),
5436
- te && (Z || O || K) && /* @__PURE__ */ s("td", {}),
5436
+ te && (C || O || K) && /* @__PURE__ */ s("td", {}),
5437
5437
  A && /* @__PURE__ */ s("td", {}),
5438
5438
  (O || K) && /* @__PURE__ */ s("td", { className: "px-3 py-1 align-top", children: /* @__PURE__ */ _("span", { className: "text-[10px] font-medium uppercase tracking-wide text-slate-500 dark:text-slate-400", children: [
5439
5439
  q.label,
@@ -5546,7 +5546,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5546
5546
  A && /* @__PURE__ */ s("td", { className: "w-8 px-2 align-middle text-slate-400 text-[11px] select-none", children: /* @__PURE__ */ _("span", { className: "inline-flex items-center gap-1", children: [
5547
5547
  $.length + n + 1,
5548
5548
  (() => {
5549
- const d = Ti(
5549
+ const d = ji(
5550
5550
  r ? (p == null ? void 0 : p.draft) ?? e : e,
5551
5551
  xt
5552
5552
  );
@@ -5589,7 +5589,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5589
5589
  r ? p.draft : e,
5590
5590
  !0
5591
5591
  ) }) }, l.field);
5592
- const m = l.computed_type === "write" && !!l.computed_formula, g = An(l.interface), b = `__m2m_${l.field}`, h = g && i ? Zr(l) : null, w = l.interface === "relation-path" && e.id != null ? (R = ft == null ? void 0 : ft[String(e.id)]) == null ? void 0 : R[l.field] : void 0, y = m ? Rt(
5592
+ const m = l.computed_type === "write" && !!l.computed_formula, g = An(l.interface), b = `__m2m_${l.field}`, h = g && i ? Cr(l) : null, w = l.interface === "relation-path" && e.id != null ? (R = ft == null ? void 0 : ft[String(e.id)]) == null ? void 0 : R[l.field] : void 0, y = m ? Rt(
5593
5593
  l.computed_formula,
5594
5594
  r ? p.draft : e
5595
5595
  ) ?? e[l.field] : r ? p.draft[l.field] ?? w : e[l.field] ?? w, x = Array.isArray(e.__rule_set) ? e.__rule_set.includes(l.field) : !1;
@@ -5603,7 +5603,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5603
5603
  "data-tip": x && !r ? `${l.label || qe(l.field)} · set by an auto-fill rule, not the file` : void 0,
5604
5604
  children: [
5605
5605
  m ? /* @__PURE__ */ s("div", { className: "py-0.5 overflow-hidden text-slate-500 italic", children: Ue(l, y) }) : g && i && h ? /* @__PURE__ */ s("div", { onClick: (I) => I.stopPropagation(), children: /* @__PURE__ */ s(
5606
- ji,
5606
+ Ai,
5607
5607
  {
5608
5608
  collection: h.targetCollection,
5609
5609
  value: p.draft[b] ?? null,
@@ -5710,7 +5710,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5710
5710
  children: /* @__PURE__ */ s("td", { colSpan: St, className: "px-3 py-2", children: /* @__PURE__ */ s("div", { className: "space-y-2", children: G.map((d) => {
5711
5711
  const l = typeof d == "string" ? d : d.field, m = typeof d == "string" ? void 0 : d.hint;
5712
5712
  return /* @__PURE__ */ s(
5713
- Ai,
5713
+ Ii,
5714
5714
  {
5715
5715
  parentCollection: a,
5716
5716
  relationField: l,
@@ -5754,7 +5754,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5754
5754
  ];
5755
5755
  return /* @__PURE__ */ s("tfoot", { children: /* @__PURE__ */ _("tr", { className: "border-t border-slate-200 bg-slate-50 text-[11px] font-medium text-slate-600 dark:border-slate-700 dark:bg-white/[0.03] dark:text-slate-300", children: [
5756
5756
  at && /* @__PURE__ */ s("td", {}),
5757
- te && (Z || O || K) && /* @__PURE__ */ s("td", {}),
5757
+ te && (C || O || K) && /* @__PURE__ */ s("td", {}),
5758
5758
  A && /* @__PURE__ */ s("td", {}),
5759
5759
  (O || K) && /* @__PURE__ */ s("td", {}),
5760
5760
  Re.map((t) => {
@@ -5841,7 +5841,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5841
5841
  type: "button",
5842
5842
  "data-grid-nested-retry": "",
5843
5843
  disabled: Xi,
5844
- onClick: () => void Co(),
5844
+ onClick: () => void Zo(),
5845
5845
  className: "font-semibold underline-offset-2 hover:underline disabled:opacity-50",
5846
5846
  children: Xi ? "Retrying…" : "Retry"
5847
5847
  }
@@ -5870,7 +5870,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5870
5870
  ]
5871
5871
  }
5872
5872
  ),
5873
- _e && Ze && Le === "original" && /* @__PURE__ */ s("div", { "data-grid-split-editor-lock": "", children: po(Ze, "docked") }),
5873
+ _e && Ce && Le === "original" && /* @__PURE__ */ s("div", { "data-grid-split-editor-lock": "", children: po(Ce, "docked") }),
5874
5874
  _e && p && Le === "original" && (() => {
5875
5875
  const e = p.rowId, n = e.startsWith("pending:"), t = n ? parseInt(e.split(":")[1], 10) : -1, r = !n && e !== "new" ? $.findIndex((d) => String(d.id) === e) : -1, i = r >= 0 ? $[r] : void 0, o = e === "new" ? $.length + M.length + 1 : n ? $.length + t + 1 : r + 1, c = A ? `Line ${o} · ` : "", u = e === "new" ? `${c}New line` : `${c}${Ar(p.draft)}`;
5876
5876
  return /* @__PURE__ */ _(
@@ -5879,7 +5879,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5879
5879
  "data-o2m-editing": "",
5880
5880
  "data-grid-split-editor": "",
5881
5881
  className: "flex flex-col rounded-lg border border-nvr-cyan/40 bg-white shadow-[0_6px_24px_-8px_rgba(15,23,42,0.35)] ring-1 ring-nvr-cyan/15 dark:border-nvr-cyan/30 dark:bg-card",
5882
- style: { height: Cn },
5882
+ style: { height: Zn },
5883
5883
  children: [
5884
5884
  /* @__PURE__ */ s(
5885
5885
  "button",
@@ -5889,7 +5889,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5889
5889
  "data-tip": "Drag to resize · ↑/↓ nudge",
5890
5890
  className: "flex h-3 w-full shrink-0 cursor-row-resize touch-none select-none items-center justify-center rounded-t-lg border-b border-nvr-cyan/20 text-slate-300 hover:bg-nvr-cyan/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-nvr-cyan dark:text-slate-500",
5891
5891
  onPointerDown: (d) => {
5892
- er.current = { startY: d.clientY, startH: Cn }, d.currentTarget.setPointerCapture(d.pointerId);
5892
+ er.current = { startY: d.clientY, startH: Zn }, d.currentTarget.setPointerCapture(d.pointerId);
5893
5893
  },
5894
5894
  onPointerMove: (d) => {
5895
5895
  const l = er.current;
@@ -5960,7 +5960,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5960
5960
  client: S,
5961
5961
  allowRestore: !!oe && !j,
5962
5962
  rowLabel: (e, n) => {
5963
- const t = Z ? n[Z] : n.line_number, r = t != null && t !== "" ? `Line ${String(t)}` : `Line #${e}`, i = Ne.find(
5963
+ const t = C ? n[C] : n.line_number, r = t != null && t !== "" ? `Line ${String(t)}` : `Line #${e}`, i = Ne.find(
5964
5964
  (c) => c.field !== "id" && !Ve.get(c.field) && /^(string|text)$/i.test(c.type ?? "") && typeof n[c.field] == "string" && n[c.field].trim() !== ""
5965
5965
  ), o = i ? String(n[i.field]) : null;
5966
5966
  return { title: r, subtitle: o && o.length > 48 ? `${o.slice(0, 48)}…` : o };
@@ -5978,7 +5978,7 @@ Reason: “${F.reason}”` : ""}` : void 0;
5978
5978
  e || (kn(null), Jr(null));
5979
5979
  },
5980
5980
  rowTitle: (() => {
5981
- const e = Z ? Ie == null ? void 0 : Ie[Z] : Ie == null ? void 0 : Ie.line_number;
5981
+ const e = C ? Ie == null ? void 0 : Ie[C] : Ie == null ? void 0 : Ie.line_number;
5982
5982
  return e != null && e !== "" ? `Line ${String(e)}` : "This row";
5983
5983
  })(),
5984
5984
  rowSubtitle: (() => {
@@ -6031,7 +6031,7 @@ function Ro(a) {
6031
6031
  f
6032
6032
  )) });
6033
6033
  }
6034
- function ed({
6034
+ function td({
6035
6035
  config: a,
6036
6036
  draft: f,
6037
6037
  remaining: v,
@@ -6043,7 +6043,7 @@ function ed({
6043
6043
  (ie) => (z == null ? void 0 : z.has(ie)) && (!ne || oe(f[ie]))
6044
6044
  ).length, A = a.fields.filter(
6045
6045
  (ie) => !(z != null && z.has(ie)) && (!ne || oe(f[ie]))
6046
- ), te = T(() => (a.presets ?? ["even", "front", "back", "shape"]).filter((Oe) => Oe !== "shape" || !!W), [a.presets, W]), [je, L] = U("even"), C = te.includes(je) ? je : te[0] ?? "even", pe = v == null || !Number.isFinite(v) ? 0 : Math.round(v * 100) / 100, G = (ie) => a.format === "number" ? ie.toLocaleString(void 0, { maximumFractionDigits: 2 }) : ie.toLocaleString(void 0, { style: "currency", currency: "USD" }), Ee = pe <= 0 ? pe < 0 ? `${G(-pe)} over — nothing to spread` : "Nothing left to spread" : A.length === 0 ? J > 0 ? "Every open target field already holds a value" : "Every target field already holds a value" : null;
6046
+ ), te = T(() => (a.presets ?? ["even", "front", "back", "shape"]).filter((Oe) => Oe !== "shape" || !!W), [a.presets, W]), [je, L] = U("even"), Z = te.includes(je) ? je : te[0] ?? "even", pe = v == null || !Number.isFinite(v) ? 0 : Math.round(v * 100) / 100, G = (ie) => a.format === "number" ? ie.toLocaleString(void 0, { maximumFractionDigits: 2 }) : ie.toLocaleString(void 0, { style: "currency", currency: "USD" }), Ee = pe <= 0 ? pe < 0 ? `${G(-pe)} over — nothing to spread` : "Nothing left to spread" : A.length === 0 ? J > 0 ? "Every open target field already holds a value" : "Every target field already holds a value" : null;
6047
6047
  return /* @__PURE__ */ _("div", { className: "mt-2 flex flex-wrap items-center gap-2", "data-o2m-spread": !0, children: [
6048
6048
  /* @__PURE__ */ _(
6049
6049
  "button",
@@ -6051,7 +6051,7 @@ function ed({
6051
6051
  type: "button",
6052
6052
  onClick: () => {
6053
6053
  if (Ee) return;
6054
- const ie = W ? A.map((X) => W.values[X] ?? 0) : void 0, Oe = Ko(pe, A.length, C, ie), ge = {};
6054
+ const ie = W ? A.map((X) => W.values[X] ?? 0) : void 0, Oe = Ko(pe, A.length, Z, ie), ge = {};
6055
6055
  A.forEach((X, de) => {
6056
6056
  ge[X] = Oe[de];
6057
6057
  }), E(ge);
@@ -6069,7 +6069,7 @@ function ed({
6069
6069
  Ro,
6070
6070
  {
6071
6071
  presets: te,
6072
- value: C,
6072
+ value: Z,
6073
6073
  onChange: L,
6074
6074
  shapeLabel: W == null ? void 0 : W.label
6075
6075
  }
@@ -6091,7 +6091,7 @@ function ed({
6091
6091
  Ee && /* @__PURE__ */ s("span", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: Ee })
6092
6092
  ] });
6093
6093
  }
6094
- function td(a) {
6094
+ function nd(a) {
6095
6095
  const [f, v] = U(!1), [E, z] = U("even"), W = a.remaining == null || !Number.isFinite(a.remaining) ? 0 : Math.round(a.remaining * 100) / 100, ne = (J) => a.config.format === "number" ? J.toLocaleString(void 0, { maximumFractionDigits: 2 }) : J.toLocaleString(void 0, { style: "currency", currency: "USD" });
6096
6096
  if (W <= 0) return null;
6097
6097
  const oe = (a.config.presets ?? ["even", "front", "back"]).filter(
@@ -6171,8 +6171,9 @@ function Ao(a) {
6171
6171
  return ((v = f == null ? void 0 : f.response) == null ? void 0 : v.error) ?? ((E = f == null ? void 0 : f.response) == null ? void 0 : E.message) ?? (f == null ? void 0 : f.message) ?? "the server refused it";
6172
6172
  }
6173
6173
  export {
6174
- Rd as InlineTableField,
6174
+ Pd as InlineTableField,
6175
+ ed as applyValueColumns,
6175
6176
  Rt as evalClientFormula,
6176
- Ti as failingLints,
6177
+ ji as failingLints,
6177
6178
  Ko as spreadAmounts
6178
6179
  };