@nivaro/react 0.3.107 → 0.3.109

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 (31) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +149 -0
  4. package/dist/index.js +742 -738
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/CollectionBrowserView.js +410 -416
  7. package/dist/shared/components/ItemEditForm.js +2413 -2384
  8. package/dist/shared/components/collections-directory/CollectionHoverCard.js +177 -0
  9. package/dist/shared/components/collections-directory/CollectionRow.js +359 -0
  10. package/dist/shared/components/collections-directory/CollectionRowMenu.js +213 -0
  11. package/dist/shared/components/collections-directory/CollectionsDirectory.js +543 -0
  12. package/dist/shared/components/collections-directory/CollectionsToolbar.js +287 -0
  13. package/dist/shared/components/collections-directory/PinnedSection.js +97 -0
  14. package/dist/shared/components/collections-directory/directory-data.js +159 -0
  15. package/dist/shared/components/collections-directory/page-model.js +122 -0
  16. package/dist/shared/components/collections-directory/sections.js +108 -0
  17. package/dist/shared/components/collections-directory/shared-pins.js +70 -0
  18. package/dist/shared/components/imports/CollectionImportPanel.js +631 -595
  19. package/dist/shared/components/imports/import-picker-options.js +44 -0
  20. package/dist/shared/components/item-edit/InlineTableField.js +441 -438
  21. package/dist/shared/components/item-edit/NestedRelationEditor.js +36 -36
  22. package/dist/shared/components/item-edit/RelationCombobox.js +1 -1
  23. package/dist/shared/components/item-edit/StepsBar.js +24 -23
  24. package/dist/shared/components/item-edit/form-density.js +1 -0
  25. package/dist/shared/components/item-edit/section-rows.js +39 -0
  26. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +88 -66
  27. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  28. package/dist/shared/lib/activity-sentence.js +4 -4
  29. package/dist/shared/lib/layout-ops.js +24 -22
  30. package/dist/shared/lib/template-paths.js +17 -0
  31. package/package.json +1 -1
@@ -43,79 +43,80 @@ import { shapeForField as tc } from "../lib/skeleton-shapes.js";
43
43
  import { knownTotalFrom as nc } from "../lib/slow-reason.js";
44
44
  import { nextSortValue as ac } from "../lib/sort-cycle.js";
45
45
  import { isFileCollection as rc } from "../lib/system-collections.js";
46
- import { useMyScopes as sc, matchScopeDimension as Dl, effectiveScopeSeedIds as lc, translateScopeValues as oc } from "../lib/use-my-scopes.js";
47
- import { useNewItemLayouts as ic } from "../lib/use-new-item-layouts.js";
48
- import { loadUserCard as dc, userCardQuery as cc } from "../lib/user-cards.js";
49
- import { cn as Xt, humanHours as uc, formatDateTime as pc } from "../lib/utils.js";
50
- import { usePublishAskContext as mc, useAskRecordDrag as fc } from "./ai/ask-context.js";
51
- import { useAvailableBulkActions as bc, bulkActionEnabled as hc, mergeBulkActions as gc, guardMatches as xc, useBuiltinGate as vc, BulkActionButtons as kc } from "./bulk/BulkActionButtons.js";
52
- import { BulkCompareButton as yc } from "./bulk/BulkCompareButton.js";
53
- import { BulkFieldUpdate as wc } from "./bulk/BulkFieldUpdate.js";
54
- import { BulkRowMark as _c } from "./bulk/BulkRowMark.js";
55
- import { MessageStakeholdersForm as Nc } from "./bulk/MessageStakeholders.js";
56
- import { useRowPushActions as Sc, runRowPush as Cc } from "./bulk/RowPushActions.js";
57
- import { CellCopyLayer as $c } from "./CellCopyLayer.js";
58
- import { CopyAsButton as qc } from "./CopyAsButton.js";
59
- import { useTreeConfig as Tc, CollectionTree as Lc } from "./cbv/CollectionTree.js";
60
- import { readExportRows as Fc, stableSort as Rc, m2oLabelPaths as Ec, resolveAllPaths as Dc, userLabel as Pc, m2oLabel as Oc, localYmd as Mc } from "./cbv/export-rows.js";
61
- import { FormulaColumnAdder as Ac } from "./cbv/FormulaColumnAdder.js";
62
- import { FoundElsewhere as Ic } from "./cbv/FoundElsewhere.js";
63
- import { useHierarchyScope as Kc, HierarchyScopePicker as jc } from "./cbv/HierarchyScope.js";
64
- import { tabStopRowKey as Bc, rowFocusTarget as Qc } from "./cbv/row-focus.js";
65
- import { splitRiskFilter as Pl, riskFilterEntry as Uc } from "./cbv/saved-view-risk.js";
66
- import { isFilterRefusal as zc, unknownFieldsOf as Ol, dropUnknownField as Wc } from "./cbv/unknown-fields.js";
67
- import { ViewDefaultMenu as Vc } from "./cbv/ViewDefaultMenu.js";
68
- import { CbvFileLabel as Hc } from "./cbv-file-label.js";
69
- import { exactCountParams as Yc, lastPageFromCount as Jc } from "./cbv-pager.js";
70
- import { relationFilterRequests as Gc, mergeFilterOptions as Xc } from "./cbv-relation-filter.js";
71
- import { useRecordRoomTypes as Zc, canOpenChatRoom as eu, discussRecord as tu } from "./chat/chat-core.js";
72
- import { FilterControl as nu } from "./DataTable.js";
73
- import { FocusModeToggle as au } from "./FocusModeToggle.js";
74
- import { FULFILMENT_FILTER_OPTIONS as Ml, FulfilmentPill as ru, fulfilmentFigures as su } from "./FulfilmentPill.js";
75
- import { HScrollProxy as lu } from "./HScrollProxy.js";
76
- import { useDocumentAutofillConfig as ou, startDocumentExtraction as iu } from "./import/DocumentAutofillButton.js";
77
- import { INTEGRATIONS_FILTER_OPTIONS as Al, IntegrationDots as du } from "./integrations/IntegrationDots.js";
78
- import { useQuickPickerSteps as cu, QuickPickerDialog as uu } from "./item-edit/QuickPickerDialog.js";
79
- import { usePickerExclusion as pu } from "./item-edit/RecordGrantTools.js";
46
+ import { templateRelationPaths as sc } from "../lib/template-paths.js";
47
+ import { useMyScopes as lc, matchScopeDimension as Dl, effectiveScopeSeedIds as oc, translateScopeValues as ic } from "../lib/use-my-scopes.js";
48
+ import { useNewItemLayouts as dc } from "../lib/use-new-item-layouts.js";
49
+ import { loadUserCard as cc, userCardQuery as uc } from "../lib/user-cards.js";
50
+ import { cn as Xt, humanHours as pc, formatDateTime as mc } from "../lib/utils.js";
51
+ import { usePublishAskContext as fc, useAskRecordDrag as bc } from "./ai/ask-context.js";
52
+ import { useAvailableBulkActions as hc, bulkActionEnabled as gc, mergeBulkActions as xc, guardMatches as vc, useBuiltinGate as kc, BulkActionButtons as yc } from "./bulk/BulkActionButtons.js";
53
+ import { BulkCompareButton as wc } from "./bulk/BulkCompareButton.js";
54
+ import { BulkFieldUpdate as _c } from "./bulk/BulkFieldUpdate.js";
55
+ import { BulkRowMark as Nc } from "./bulk/BulkRowMark.js";
56
+ import { MessageStakeholdersForm as Sc } from "./bulk/MessageStakeholders.js";
57
+ import { useRowPushActions as Cc, runRowPush as $c } from "./bulk/RowPushActions.js";
58
+ import { CellCopyLayer as qc } from "./CellCopyLayer.js";
59
+ import { CopyAsButton as Tc } from "./CopyAsButton.js";
60
+ import { useTreeConfig as Lc, CollectionTree as Fc } from "./cbv/CollectionTree.js";
61
+ import { readExportRows as Rc, stableSort as Ec, m2oLabelPaths as Dc, resolveAllPaths as Pc, userLabel as Oc, m2oLabel as Mc, localYmd as Ac } from "./cbv/export-rows.js";
62
+ import { FormulaColumnAdder as Ic } from "./cbv/FormulaColumnAdder.js";
63
+ import { FoundElsewhere as Kc } from "./cbv/FoundElsewhere.js";
64
+ import { useHierarchyScope as jc, HierarchyScopePicker as Bc } from "./cbv/HierarchyScope.js";
65
+ import { tabStopRowKey as Qc, rowFocusTarget as Uc } from "./cbv/row-focus.js";
66
+ import { splitRiskFilter as Pl, riskFilterEntry as zc } from "./cbv/saved-view-risk.js";
67
+ import { isFilterRefusal as Wc, unknownFieldsOf as Ol, dropUnknownField as Vc } from "./cbv/unknown-fields.js";
68
+ import { ViewDefaultMenu as Hc } from "./cbv/ViewDefaultMenu.js";
69
+ import { CbvFileLabel as Yc } from "./cbv-file-label.js";
70
+ import { exactCountParams as Jc, lastPageFromCount as Gc } from "./cbv-pager.js";
71
+ import { relationFilterRequests as Xc, mergeFilterOptions as Zc } from "./cbv-relation-filter.js";
72
+ import { useRecordRoomTypes as eu, canOpenChatRoom as tu, discussRecord as nu } from "./chat/chat-core.js";
73
+ import { FilterControl as au } from "./DataTable.js";
74
+ import { FocusModeToggle as ru } from "./FocusModeToggle.js";
75
+ import { FULFILMENT_FILTER_OPTIONS as Ml, FulfilmentPill as su, fulfilmentFigures as lu } from "./FulfilmentPill.js";
76
+ import { HScrollProxy as ou } from "./HScrollProxy.js";
77
+ import { useDocumentAutofillConfig as iu, startDocumentExtraction as du } from "./import/DocumentAutofillButton.js";
78
+ import { INTEGRATIONS_FILTER_OPTIONS as Al, IntegrationDots as cu } from "./integrations/IntegrationDots.js";
79
+ import { useQuickPickerSteps as uu, QuickPickerDialog as pu } from "./item-edit/QuickPickerDialog.js";
80
+ import { usePickerExclusion as mu } from "./item-edit/RecordGrantTools.js";
80
81
  import { invalidateRecordQueries as Il } from "./item-edit/RecordLiveSync.js";
81
- import { relatedMissing as mu } from "./item-edit/related-missing.js";
82
+ import { relatedMissing as fu } from "./item-edit/related-missing.js";
82
83
  import { UserRosterCluster as Kl, UserChip as jl } from "./item-edit/UserChip.js";
83
- import { LiveRowMark as fu } from "./LiveRowMark.js";
84
- import { CopyListLinkButton as bu } from "./list/CopyListLinkButton.js";
85
- import { useInlineEdit as hu, InlineEditCell as gu } from "./list/InlineEdit.js";
86
- import { MapView as xu } from "./MapView.js";
87
- import { usePickerExcludedRows as vu, PICKER_EXCLUDED_ROW_CLASS as ku, PICKER_EXCLUDED_TITLE as yu } from "./PickerExcludedRows.js";
84
+ import { LiveRowMark as bu } from "./LiveRowMark.js";
85
+ import { CopyListLinkButton as hu } from "./list/CopyListLinkButton.js";
86
+ import { useInlineEdit as gu, InlineEditCell as xu } from "./list/InlineEdit.js";
87
+ import { MapView as vu } from "./MapView.js";
88
+ import { usePickerExcludedRows as ku, PICKER_EXCLUDED_ROW_CLASS as yu, PICKER_EXCLUDED_TITLE as wu } from "./PickerExcludedRows.js";
88
89
  import { ConfirmButton as Or } from "./profile/primitives.js";
89
90
  import { pruneQuickSelection as Lr } from "./quick-filters/config.js";
90
- import { QuickFilterBarEditor as wu, QuickFilterEditButton as Bl } from "./quick-filters/QuickFilterBarEditor.js";
91
- import { useQuickFilterEditing as _u } from "./quick-filters/useQuickFilterEditing.js";
92
- import { RealtimeStaleMark as Nu } from "./RealtimeStatusBanner.js";
93
- import { RecordDrilldownSheet as Su } from "./RecordDrilldownSheet.js";
94
- import { RowHighlightLegend as Cu } from "./RowHighlightLegend.js";
95
- import { RowPresence as $u } from "./RowPresence.js";
96
- import { TableSkeletonRows as qu } from "./Skeletons.js";
97
- import { SlowNoticeView as Tu } from "./SlowNotice.js";
98
- import { TipLayer as Lu } from "./TipLayer.js";
91
+ import { QuickFilterBarEditor as _u, QuickFilterEditButton as Bl } from "./quick-filters/QuickFilterBarEditor.js";
92
+ import { useQuickFilterEditing as Nu } from "./quick-filters/useQuickFilterEditing.js";
93
+ import { RealtimeStaleMark as Su } from "./RealtimeStatusBanner.js";
94
+ import { RecordDrilldownSheet as Cu } from "./RecordDrilldownSheet.js";
95
+ import { RowHighlightLegend as $u } from "./RowHighlightLegend.js";
96
+ import { RowPresence as qu } from "./RowPresence.js";
97
+ import { TableSkeletonRows as Tu } from "./Skeletons.js";
98
+ import { SlowNoticeView as Lu } from "./SlowNotice.js";
99
+ import { TipLayer as Fu } from "./TipLayer.js";
99
100
  import { UnseenDot as Ql } from "./UnseenDot.js";
100
101
  import { SimpleSelectXs as qn, SimpleSelect as Ul } from "./ui/SimpleSelect.js";
101
- import { RevisionsPanel as Fu } from "./panels/RevisionsPanel.js";
102
- import { itemActionChoiceStep as Ru, ItemActionChoiceList as Eu } from "./panels/ItemActionChoices.js";
103
- function Tn(n, o, h) {
104
- const d = n.find((w) => w.one_collection === o && w.one_field === h);
102
+ import { RevisionsPanel as Ru } from "./panels/RevisionsPanel.js";
103
+ import { itemActionChoiceStep as Eu, ItemActionChoiceList as Du } from "./panels/ItemActionChoices.js";
104
+ function Tn(n, i, h) {
105
+ const d = n.find((w) => w.one_collection === i && w.one_field === h);
105
106
  if (d != null && d.many_collection)
106
107
  return { kind: d.junction_field ? "m2m" : "o2m", relation: d };
107
108
  }
108
- function _a(n, o) {
109
+ function _a(n, i) {
109
110
  var w;
110
- if (!o || o.kind !== "m2m") return null;
111
- const h = o.relation.many_collection, d = o.relation.junction_field;
111
+ if (!i || i.kind !== "m2m") return null;
112
+ const h = i.relation.many_collection, d = i.relation.junction_field;
112
113
  return !h || !d ? null : ((w = n.find((N) => N.many_collection === h && N.many_field === d)) == null ? void 0 : w.one_collection) ?? null;
113
114
  }
114
115
  function Xn(n) {
115
116
  if (!n) return "id";
116
- const o = new Set(n.fields.map((d) => d.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((d) => d[1]);
117
- for (const d of h) if (o.has(d)) return d;
118
- for (const d of eo) if (o.has(d)) return d;
117
+ const i = new Set(n.fields.map((d) => d.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((d) => d[1]);
118
+ for (const d of h) if (i.has(d)) return d;
119
+ for (const d of eo) if (i.has(d)) return d;
119
120
  return "id";
120
121
  }
121
122
  const zl = (n) => typeof n == "string" ? n : n.key, Wl = {
@@ -124,10 +125,10 @@ const zl = (n) => typeof n == "string" ? n : n.key, Wl = {
124
125
  green: "text-emerald-600 dark:text-emerald-400 font-semibold",
125
126
  blue: "text-sky-600 dark:text-sky-400 font-semibold"
126
127
  };
127
- function Na(n, o) {
128
- if (!o || o.length === 0) return null;
128
+ function Na(n, i) {
129
+ if (!i || i.length === 0) return null;
129
130
  const h = n == null ? "" : String(n), d = Number(h);
130
- for (const w of o) {
131
+ for (const w of i) {
131
132
  const N = Number(w.value), q = Number.isFinite(d) && Number.isFinite(N);
132
133
  switch (w.op) {
133
134
  case "gt":
@@ -155,7 +156,7 @@ function Na(n, o) {
155
156
  }
156
157
  return null;
157
158
  }
158
- const Du = [
159
+ const Pu = [
159
160
  { label: "None", cfg: null },
160
161
  { label: "Currency", cfg: { type: "number", decimals: 2, thousands: !0, prefix: "$" } },
161
162
  { label: "Number", cfg: { type: "number", thousands: !0 } },
@@ -165,53 +166,46 @@ const Du = [
165
166
  { label: "Relative time", cfg: { type: "datetime", template: "relative" } },
166
167
  { label: "Yes / No", cfg: { type: "boolean", true_label: "Yes", false_label: "No" } },
167
168
  { label: "Count (related)", cfg: { type: "count" } }
168
- ], je = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (o) => o.toUpperCase()), eo = ["name", "title", "label", "display_name", "subject", "email", "slug"];
169
- function Mr(n, o) {
170
- if (!n) return o === "id" ? null : `id,${o}`;
169
+ ], je = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()), eo = ["name", "title", "label", "display_name", "subject", "email", "slug"];
170
+ function Mr(n, i) {
171
+ if (!n) return i === "id" ? null : `id,${i}`;
171
172
  const h = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((d) => d[1]);
172
- return h.some((d) => d.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", o, ...h])].join(",");
173
+ return h.some((d) => d.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", i, ...h])].join(",");
173
174
  }
174
- function Fa(n, o) {
175
+ function Fa(n, i) {
175
176
  if (!n) {
176
177
  for (const h of eo) {
177
- const d = o[h];
178
+ const d = i[h];
178
179
  if (d != null && d !== "") return String(d);
179
180
  }
180
- return String(o.id ?? "");
181
+ return String(i.id ?? "");
181
182
  }
182
183
  return n.replace(/\{\{([\w.]+)\}\}/g, (h, d) => {
183
- const w = d.split(".").reduce((N, q) => N == null ? void 0 : N[q], o);
184
+ const w = d.split(".").reduce((N, q) => N == null ? void 0 : N[q], i);
184
185
  return w == null ? "" : String(w);
185
186
  });
186
187
  }
187
- function Ar(n, o, h) {
188
+ function Ar(n, i, h) {
188
189
  return n.find(
189
- (d) => d.many_collection === o && d.many_field === h && // Loose: a relation list may omit junction_field rather than send null
190
+ (d) => d.many_collection === i && d.many_field === h && // Loose: a relation list may omit junction_field rather than send null
190
191
  // (record compare showed a raw "124133", army 11 staging check).
191
192
  !d.junction_field && !!d.one_collection
192
193
  );
193
194
  }
194
- function Pu(n) {
195
- const o = new Date(String(n));
196
- if (Number.isNaN(o.getTime())) return String(n);
197
- const h = Date.now() - o.getTime(), d = Math.floor(h / 6e4);
195
+ function Ou(n) {
196
+ const i = new Date(String(n));
197
+ if (Number.isNaN(i.getTime())) return String(n);
198
+ const h = Date.now() - i.getTime(), d = Math.floor(h / 6e4);
198
199
  if (d < 1) return "just now";
199
200
  if (d < 60) return `${d}m ago`;
200
201
  const w = Math.floor(d / 60);
201
202
  if (w < 24) return `${w}h ago`;
202
203
  const N = Math.floor(w / 24);
203
- return N < 7 ? `${N}d ago` : o.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
204
+ return N < 7 ? `${N}d ago` : i.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
204
205
  }
205
206
  const xt = (n) => n.toLocaleString("en-US"), to = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), Tt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Fr = /* @__PURE__ */ new Map();
206
- function Ou(n) {
207
- return n ? [
208
- ...new Set(
209
- [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((o) => o[1]).filter((o) => o.includes("."))
210
- )
211
- ] : [];
212
- }
213
- function no(n, o, h, d = []) {
214
- const w = d.length > 0 ? `${o}\0${d.join(",")}` : o;
207
+ function no(n, i, h, d = []) {
208
+ const w = d.length > 0 ? `${i}\0${d.join(",")}` : i;
215
209
  let N = Fr.get(w);
216
210
  N || (N = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, Fr.set(w, N));
217
211
  const q = N;
@@ -221,7 +215,7 @@ function no(n, o, h, d = []) {
221
215
  const S = [...q.ids], F = [];
222
216
  for (let B = 0; B < S.length; B += 200) F.push(S.slice(B, B + 200));
223
217
  const K = (B, L) => n.request(
224
- G(`/items/${o}`, {
218
+ G(`/items/${i}`, {
225
219
  filter: JSON.stringify({ id: { _in: B } }),
226
220
  limit: B.length,
227
221
  // A template naming a linked record's field (categories:
@@ -258,7 +252,7 @@ const Mu = {
258
252
  function Au({ summary: n }) {
259
253
  var S;
260
254
  if (!n || n.total === 0) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
261
- const o = n.latest, h = n.active > 0, d = !!(o != null && o.workflow_state) && !["approved", "rejected", "reverted"].includes(o.status), w = o ? d ? ((S = o.workflow_state) == null ? void 0 : S.label) ?? "" : Mu[o.status] ?? o.status : "", N = o == null ? void 0 : o.cost_impact, q = N != null && N !== 0 ? `${N > 0 ? "+" : "−"}$${Math.abs(N).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, $ = o ? `${o.title ?? "Addendum"} — ${w}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
255
+ const i = n.latest, h = n.active > 0, d = !!(i != null && i.workflow_state) && !["approved", "rejected", "reverted"].includes(i.status), w = i ? d ? ((S = i.workflow_state) == null ? void 0 : S.label) ?? "" : Mu[i.status] ?? i.status : "", N = i == null ? void 0 : i.cost_impact, q = N != null && N !== 0 ? `${N > 0 ? "+" : "−"}$${Math.abs(N).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, $ = i ? `${i.title ?? "Addendum"} — ${w}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
262
256
  return /* @__PURE__ */ c(
263
257
  "span",
264
258
  {
@@ -281,22 +275,22 @@ function Au({ summary: n }) {
281
275
  }
282
276
  );
283
277
  }
284
- function Ir({ relatedCollection: n, id: o }) {
285
- return rc(n) ? /* @__PURE__ */ a(Hc, { id: o }) : /* @__PURE__ */ a(Iu, { relatedCollection: n, id: o });
278
+ function Ir({ relatedCollection: n, id: i }) {
279
+ return rc(n) ? /* @__PURE__ */ a(Yc, { id: i }) : /* @__PURE__ */ a(Iu, { relatedCollection: n, id: i });
286
280
  }
287
281
  function Iu({
288
282
  relatedCollection: n,
289
- id: o
283
+ id: i
290
284
  }) {
291
- const h = Lt(), d = to.has(n), w = o != null && o !== "", { data: N, isPending: q } = ne({
285
+ const h = Lt(), d = to.has(n), w = i != null && i !== "", { data: N, isPending: q } = ne({
292
286
  queryKey: ["cbv-collection-meta", n],
293
287
  queryFn: () => h.request(G(`/collections/${n}`)).then((L) => L.data),
294
288
  staleTime: 10 * 6e4,
295
289
  enabled: !Tt(n),
296
290
  retry: !1
297
- }), $ = Ou(N == null ? void 0 : N.display_template), S = Tt(n) || !q, { data: F, isLoading: K } = ne({
298
- queryKey: ["cbv-relation-item", n, String(o), $.join(",")],
299
- queryFn: () => d ? h.request(G(`/users/${o}`)).then((L) => L.data) : no(h, n, String(o), $),
291
+ }), $ = sc(N == null ? void 0 : N.display_template), S = Tt(n) || !q, { data: F, isLoading: K } = ne({
292
+ queryKey: ["cbv-relation-item", n, String(i), $.join(",")],
293
+ queryFn: () => d ? h.request(G(`/users/${i}`)).then((L) => L.data) : no(h, n, String(i), $),
300
294
  enabled: w && S && (d || !Tt(n)),
301
295
  staleTime: 30 * 6e4,
302
296
  retry: !1
@@ -305,7 +299,7 @@ function Iu({
305
299
  if (K || !S)
306
300
  return /* @__PURE__ */ a("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
307
301
  if (!F) {
308
- const L = mu(null);
302
+ const L = fu(null);
309
303
  return /* @__PURE__ */ a(
310
304
  "span",
311
305
  {
@@ -321,8 +315,8 @@ function Iu({
321
315
  ) : Fa((N == null ? void 0 : N.display_template) ?? null, F);
322
316
  return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: B });
323
317
  }
324
- function ao(n, o, h, d, w, N) {
325
- const q = o.getQueryData(["cbv-collection-meta", h]);
318
+ function ao(n, i, h, d, w, N) {
319
+ const q = i.getQueryData(["cbv-collection-meta", h]);
326
320
  return Hd(
327
321
  Yd(n, h, q, d, w).then(
328
322
  ($) => window.location.origin + N({ collection: h, itemId: $ })
@@ -330,7 +324,7 @@ function ao(n, o, h, d, w, N) {
330
324
  ).catch(() => {
331
325
  });
332
326
  }
333
- function qa(n, o) {
327
+ function qa(n, i) {
334
328
  for (const h of [
335
329
  "cbv-items",
336
330
  "cbv-pipeline-instances",
@@ -340,21 +334,21 @@ function qa(n, o) {
340
334
  "cbv-resolved",
341
335
  "cbv-row-instance"
342
336
  ])
343
- n.invalidateQueries({ queryKey: [h, o] });
337
+ n.invalidateQueries({ queryKey: [h, i] });
344
338
  }
345
- function Ku(n, o) {
339
+ function Ku(n, i) {
346
340
  return n ? n.is_admin ? !0 : (n.collections ?? []).some(
347
- (h) => (h.collection === o || h.collection === "*") && (h.actions.includes("update") || h.actions.includes("*"))
341
+ (h) => (h.collection === i || h.collection === "*") && (h.actions.includes("update") || h.actions.includes("*"))
348
342
  ) : !1;
349
343
  }
350
- function ju(n, o) {
344
+ function ju(n, i) {
351
345
  return n ? n.is_admin ? !0 : (n.collections ?? []).some(
352
- (h) => (h.collection === o || h.collection === "*") && (h.actions.includes("delete") || h.actions.includes("*"))
346
+ (h) => (h.collection === i || h.collection === "*") && (h.actions.includes("delete") || h.actions.includes("*"))
353
347
  ) : !1;
354
348
  }
355
349
  function Bu({
356
350
  collection: n,
357
- id: o,
351
+ id: i,
358
352
  hasPipeline: h,
359
353
  onOpen: d,
360
354
  onPeek: w,
@@ -372,7 +366,7 @@ function Bu({
372
366
  label: L,
373
367
  meta: y.getQueryData(["cbv-collection-meta", n]),
374
368
  row: F,
375
- id: o,
369
+ id: i,
376
370
  collection: n
377
371
  }), [m, D] = _(!1), [O, M] = _({ x: 0, y: 0 }), T = pe(null), de = pe(null);
378
372
  me(() => {
@@ -383,10 +377,10 @@ function Bu({
383
377
  queryFn: () => u.request(G("/security/my/permissions")).then((g) => g.data),
384
378
  enabled: m && !W,
385
379
  staleTime: 5 * 6e4
386
- }), we = pu(n, String(o), {
380
+ }), we = mu(n, String(i), {
387
381
  enabled: m && W,
388
382
  onDone: () => D(!1)
389
- }), [Ae, Y] = _(!1), Be = Zc(m), Se = eu() && !!(Be != null && Be.some((g) => g.collection === n));
383
+ }), [Ae, Y] = _(!1), Be = eu(m), Se = tu() && !!(Be != null && Be.some((g) => g.collection === n));
390
384
  me(() => {
391
385
  if (!m) return;
392
386
  const g = (Z) => {
@@ -401,21 +395,21 @@ function Bu({
401
395
  };
402
396
  }, [m]);
403
397
  const { data: X } = ne({
404
- queryKey: ["cbv-row-instance", n, String(o)],
405
- queryFn: () => u.request(G(`/pipelines/instance/${n}/${o}`)).then((g) => g.data).catch(() => null),
398
+ queryKey: ["cbv-row-instance", n, String(i)],
399
+ queryFn: () => u.request(G(`/pipelines/instance/${n}/${i}`)).then((g) => g.data).catch(() => null),
406
400
  enabled: m && h,
407
401
  staleTime: 15e3
408
402
  }), $e = be(
409
403
  () => ((X == null ? void 0 : X.available_transitions) ?? []).filter((g) => g.in_row_menu !== !1),
410
404
  [X]
411
- ), { data: it } = bc(m ? [n] : []), rt = ad({
405
+ ), { data: it } = hc(m ? [n] : []), rt = ad({
412
406
  isAdmin: W,
413
407
  roleMayDelete: ju(fe, n),
414
- builtinOpen: it ? (it[n] ?? []).some((g) => g.source === "builtin" && g.key === "delete") && hc(K, n, "delete") : void 0,
408
+ builtinOpen: it ? (it[n] ?? []).some((g) => g.source === "builtin" && g.key === "delete") && gc(K, n, "delete") : void 0,
415
409
  hasPipeline: h,
416
410
  run: h ? X === void 0 ? void 0 : X : null
417
411
  }), Ie = be(
418
- () => m ? gc(it, [n], K).filter(
412
+ () => m ? xc(it, [n], K).filter(
419
413
  // Transition-kind registry actions (Cancel / Uncancel) are the pipeline
420
414
  // transitions already listed above — never the same move twice.
421
415
  (g) => g.kind !== "builtin" && g.kind !== "transition"
@@ -428,9 +422,9 @@ function Bu({
428
422
  Z && typeof Z.field == "string" && !(F && Z.field in F) && g.add(Z.field);
429
423
  return [...g].sort();
430
424
  }, [Ie, F]), { data: We } = ne({
431
- queryKey: ["row-action-guard", n, String(o), Oe.join(",")],
425
+ queryKey: ["row-action-guard", n, String(i), Oe.join(",")],
432
426
  queryFn: () => u.request(
433
- G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(o))}`, {
427
+ G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(i))}`, {
434
428
  fields: Oe.join(",")
435
429
  })
436
430
  ).then((g) => g.data ?? {}).catch(() => ({})),
@@ -442,10 +436,10 @@ function Bu({
442
436
  return !((Z = E.guard) != null && Z.length);
443
437
  });
444
438
  const g = { ...We ?? {}, ...F ?? {} };
445
- return Ie.filter((E) => xc(E.guard, g) !== !1);
446
- }, [Ie, Oe, We, F]), { pushActions: le, failedPartners: ee } = Sc({
439
+ return Ie.filter((E) => vc(E.guard, g) !== !1);
440
+ }, [Ie, Oe, We, F]), { pushActions: le, failedPartners: ee } = Cc({
447
441
  collection: n,
448
- id: o,
442
+ id: i,
449
443
  open: m,
450
444
  bulkData: it,
451
445
  bulkEnabledKeys: K
@@ -483,15 +477,15 @@ function Bu({
483
477
  m || (H(null), oe(""), Y(!1));
484
478
  }, [m]);
485
479
  const re = ((pn = f == null ? void 0 : f.push) == null ? void 0 : pn.kind) === "push" && f.push.action.choose ? f.push.action : null, qe = ne({
486
- queryKey: ["item-action-choices", (re == null ? void 0 : re.id) ?? null, n, String(o)],
480
+ queryKey: ["item-action-choices", (re == null ? void 0 : re.id) ?? null, n, String(i)],
487
481
  queryFn: () => u.request(
488
- G(`/item-actions/${re.id}/choices`, { collection: n, item: String(o) })
482
+ G(`/item-actions/${re.id}/choices`, { collection: n, item: String(i) })
489
483
  ).then((g) => g.data ?? []),
490
484
  enabled: !!re,
491
485
  staleTime: 0
492
486
  }), [vt, Kt] = _(null), cn = (re == null ? void 0 : re.id) ?? null;
493
487
  me(() => Kt(null), [cn]);
494
- const Ve = qe.data ? Ru(qe.data) : null, ft = Ve && !Ve.ask ? Ve.value : vt, kt = !!re && (!Ve || Ve.ask && vt == null);
488
+ const Ve = qe.data ? Eu(qe.data) : null, ft = Ve && !Ve.ask ? Ve.value : vt, kt = !!re && (!Ve || Ve.ask && vt == null);
495
489
  Pi.useLayoutEffect(() => {
496
490
  var Ke;
497
491
  if (!m) return;
@@ -507,7 +501,7 @@ function Bu({
507
501
  }, [m, O, f, $e.length]);
508
502
  const Dt = qt({
509
503
  mutationFn: ({ transitionId: g, comment: E }) => u.request(
510
- he(`/pipelines/instance/${n}/${o}/transition`, {
504
+ he(`/pipelines/instance/${n}/${i}/transition`, {
511
505
  transition_id: g,
512
506
  ...E != null && E.trim() ? { comment: E.trim() } : {}
513
507
  })
@@ -515,7 +509,7 @@ function Bu({
515
509
  onSuccess: (g, E) => {
516
510
  D(!1);
517
511
  const Z = $e.find((ue) => ue.id === E.transitionId);
518
- ge.success(Z ? `${R.name} moved to ${mt(Z)}` : `${R.name} moved`), qa(y, n), Il(y, n, [o]), S == null || S();
512
+ ge.success(Z ? `${R.name} moved to ${mt(Z)}` : `${R.name} moved`), qa(y, n), Il(y, n, [i]), S == null || S();
519
513
  },
520
514
  onError: (g) => ge.error(
521
515
  Zt(g, "Transition failed"),
@@ -523,7 +517,7 @@ function Bu({
523
517
  )
524
518
  }), un = qt({
525
519
  mutationFn: async ({ action: g, comment: E }) => {
526
- const Z = { collection: n, ids: [o], reason: (E == null ? void 0 : E.trim()) || null }, ue = g.source === "db" ? await u.request(he("/bulk-actions/run", { ...Z, key: g.key })) : await u.request(he(`/bulk-actions/${g.key}/execute`, Z));
520
+ const Z = { collection: n, ids: [i], reason: (E == null ? void 0 : E.trim()) || null }, ue = g.source === "db" ? await u.request(he("/bulk-actions/run", { ...Z, key: g.key })) : await u.request(he(`/bulk-actions/${g.key}/execute`, Z));
527
521
  return { action: g, result: ue.data ?? {} };
528
522
  },
529
523
  onSuccess: ({ action: g, result: E }) => {
@@ -539,14 +533,14 @@ function Bu({
539
533
  ge.info(`${R.name}: ${an ?? "nothing to change"}`);
540
534
  return;
541
535
  }
542
- ge.success(`${g.label} — done on ${R.name}`), qa(y, n), Il(y, n, [o]), S == null || S();
536
+ ge.success(`${g.label} — done on ${R.name}`), qa(y, n), Il(y, n, [i]), S == null || S();
543
537
  },
544
538
  onError: (g) => {
545
539
  const E = g.response;
546
540
  ge.error((E == null ? void 0 : E.error) ?? Zt(g, "Action failed"), $a(g));
547
541
  }
548
542
  }), bt = qt({
549
- mutationFn: ({ op: g, note: E, pick: Z }) => Cc(u, n, o, g, E, Z).then((ue) => ({ op: g, outcome: ue })),
543
+ mutationFn: ({ op: g, note: E, pick: Z }) => $c(u, n, i, g, E, Z).then((ue) => ({ op: g, outcome: ue })),
550
544
  onSuccess: ({ op: g, outcome: E }) => {
551
545
  D(!1);
552
546
  const Z = g.kind === "push" ? g.action.label : "Retry";
@@ -633,7 +627,7 @@ function Bu({
633
627
  }
634
628
  ),
635
629
  (re == null ? void 0 : re.choose) && (qe.isError ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-red-600 dark:text-red-400", children: "Could not load the options." }) : qe.isLoading ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Loading…" }) : Ve != null && Ve.ask ? /* @__PURE__ */ a("div", { className: "mb-1.5 -mt-3 px-1", children: /* @__PURE__ */ a(
636
- Eu,
630
+ Du,
637
631
  {
638
632
  choose: re.choose,
639
633
  options: qe.data ?? [],
@@ -669,14 +663,14 @@ function Bu({
669
663
  placeholder: ((yt = f.push) == null ? void 0 : yt.kind) === "push" ? ((Fn = (lt = f.push.action.confirm) == null ? void 0 : lt.input) == null ? void 0 : Fn.placeholder) ?? ((fn = (mn = f.push.action.confirm) == null ? void 0 : mn.input) == null ? void 0 : fn.label) ?? "" : (tn = f.action) != null && tn.require_reason || ((nn = $e.find((g) => g.id === f.picked)) == null ? void 0 : nn.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
670
664
  rows: 2,
671
665
  "aria-label": ((ea = f.push) == null ? void 0 : ea.kind) === "push" ? ((ce = (ta = f.push.action.confirm) == null ? void 0 : ta.input) == null ? void 0 : ce.label) ?? "Note" : "Reason",
672
- "aria-describedby": Ln ? `row-reason-hint-${String(o)}` : void 0,
666
+ "aria-describedby": Ln ? `row-reason-hint-${String(i)}` : void 0,
673
667
  className: "w-full resize-none rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
674
668
  }
675
669
  ),
676
670
  Ln && /* @__PURE__ */ a(
677
671
  "p",
678
672
  {
679
- id: `row-reason-hint-${String(o)}`,
673
+ id: `row-reason-hint-${String(i)}`,
680
674
  className: "mt-1 px-1 text-[11px] text-slate-500 dark:text-slate-400",
681
675
  "data-row-reason-hint": !0,
682
676
  children: "Add a reason to continue."
@@ -711,13 +705,13 @@ function Bu({
711
705
  D(!1), d();
712
706
  }),
713
707
  Ge("Open in new tab", () => {
714
- D(!1), window.open(q({ collection: n, itemId: String(o) }), "_blank");
708
+ D(!1), window.open(q({ collection: n, itemId: String(i) }), "_blank");
715
709
  }),
716
710
  w && Ge("Peek details", () => {
717
711
  D(!1), w();
718
712
  }),
719
713
  Se && Ge("Discuss in chat", () => {
720
- D(!1), tu(u, n, String(o)).then((g) => {
714
+ D(!1), nu(u, n, String(i)).then((g) => {
721
715
  g || ge.error("This record has no chat room you can open");
722
716
  }).catch(() => ge.error("Could not open the chat room"));
723
717
  }),
@@ -828,7 +822,7 @@ function Bu({
828
822
  D(!1), (g = navigator.clipboard) == null || g.writeText(R.copy ?? ""), ge.success("ID copied");
829
823
  }),
830
824
  Ge("Copy link", () => {
831
- D(!1), ao(u, y, n, F, o, q), ge.success("Link copied");
825
+ D(!1), ao(u, y, n, F, i, q), ge.success("Link copied");
832
826
  }),
833
827
  W && /* @__PURE__ */ c(ze, { children: [
834
828
  jt,
@@ -898,12 +892,12 @@ function Rr(n) {
898
892
  }
899
893
  function Vl({
900
894
  collection: n,
901
- field: o,
895
+ field: i,
902
896
  fieldType: h,
903
897
  value: d,
904
898
  relations: w
905
899
  }) {
906
- const N = Ar(w, n, o);
900
+ const N = Ar(w, n, i);
907
901
  if (N != null && N.one_collection)
908
902
  return /* @__PURE__ */ a(Ir, { relatedCollection: N.one_collection, id: d });
909
903
  if (d == null) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
@@ -924,17 +918,17 @@ function Vl({
924
918
  );
925
919
  return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: $ });
926
920
  }
927
- return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: Pu(d) });
921
+ return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: Ou(d) });
928
922
  }
929
923
  return typeof d == "string" ? /* @__PURE__ */ a(
930
924
  "span",
931
925
  {
932
926
  className: Xt(
933
927
  "block max-w-[240px] truncate text-[12px] text-slate-700 dark:text-slate-200",
934
- Rr(o) && "font-mono",
928
+ Rr(i) && "font-mono",
935
929
  // An id cell opens the record. Underline it so that is legible
936
930
  // before you click rather than after.
937
- Rr(o) && "underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover:decoration-nvr-cyan dark:decoration-slate-600"
931
+ Rr(i) && "underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover:decoration-nvr-cyan dark:decoration-slate-600"
938
932
  ),
939
933
  "data-tip": d.length > 28 ? d : void 0,
940
934
  children: d
@@ -944,7 +938,7 @@ function Vl({
944
938
  {
945
939
  className: Xt(
946
940
  "text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
947
- Rr(o) && "font-mono"
941
+ Rr(i) && "font-mono"
948
942
  ),
949
943
  children: String(d)
950
944
  }
@@ -952,7 +946,7 @@ function Vl({
952
946
  }
953
947
  function Da({
954
948
  label: n,
955
- options: o,
949
+ options: i,
956
950
  selected: h,
957
951
  onChange: d,
958
952
  loading: w,
@@ -981,7 +975,7 @@ function Da({
981
975
  };
982
976
  return window.addEventListener("mousedown", O), () => window.removeEventListener("mousedown", O);
983
977
  }, [F]);
984
- const y = B && !S ? o.filter((O) => O.label.toLowerCase().includes(B.toLowerCase())) : o, W = new Set(h.map(String)), R = ((D = o.find((O) => String(O.value) === String(h[0]))) == null ? void 0 : D.label) ?? String(h[0] ?? ""), m = h.length === 0 ? n : h.length === 1 ? R : `${R} +${h.length - 1}`;
978
+ const y = B && !S ? i.filter((O) => O.label.toLowerCase().includes(B.toLowerCase())) : i, W = new Set(h.map(String)), R = ((D = i.find((O) => String(O.value) === String(h[0]))) == null ? void 0 : D.label) ?? String(h[0] ?? ""), m = h.length === 0 ? n : h.length === 1 ? R : `${R} +${h.length - 1}`;
985
979
  return /* @__PURE__ */ c("div", { ref: u, className: N ? "relative w-full" : "relative", children: [
986
980
  /* @__PURE__ */ c(
987
981
  "button",
@@ -1056,7 +1050,7 @@ function Da({
1056
1050
  }
1057
1051
  function Qu({
1058
1052
  target: n,
1059
- label: o,
1053
+ label: i,
1060
1054
  selected: h,
1061
1055
  onChange: d,
1062
1056
  preferIds: w
@@ -1072,7 +1066,7 @@ function Qu({
1072
1066
  // page-only list; a new name keeps an old cached entry from answering.
1073
1067
  queryKey: ["cbv-filter-options-all", n, u, y ?? "", F, B],
1074
1068
  queryFn: async () => {
1075
- const T = Gc({
1069
+ const T = Xc({
1076
1070
  search: F,
1077
1071
  preferIds: w,
1078
1072
  labelField: u,
@@ -1085,7 +1079,7 @@ function Qu({
1085
1079
  (we) => N.request(G(`/items/${n}`, we)).then((Ae) => de(Ae.data ?? []))
1086
1080
  )
1087
1081
  );
1088
- return Xc(fe);
1082
+ return Zc(fe);
1089
1083
  },
1090
1084
  staleTime: 10 * 6e4,
1091
1085
  enabled: S && !!L,
@@ -1118,7 +1112,7 @@ function Qu({
1118
1112
  Da,
1119
1113
  {
1120
1114
  block: !0,
1121
- label: o ?? "All",
1115
+ label: i ?? "All",
1122
1116
  options: M,
1123
1117
  selected: h,
1124
1118
  onChange: d,
@@ -1132,13 +1126,13 @@ function Qu({
1132
1126
  }
1133
1127
  function Uu({
1134
1128
  collection: n,
1135
- field: o,
1129
+ field: i,
1136
1130
  selected: h,
1137
1131
  onChange: d
1138
1132
  }) {
1139
1133
  const w = Lt(), [N, q] = _(!1), { data: $ = [], isLoading: S } = ne({
1140
- queryKey: ["cbv-distinct", n, o],
1141
- queryFn: () => w.request(G(`/items/${n}/distinct`, { field: o })).then((F) => F.data ?? []),
1134
+ queryKey: ["cbv-distinct", n, i],
1135
+ queryFn: () => w.request(G(`/items/${n}/distinct`, { field: i })).then((F) => F.data ?? []),
1142
1136
  staleTime: 5 * 6e4,
1143
1137
  enabled: N,
1144
1138
  retry: !1
@@ -1160,7 +1154,7 @@ function Uu({
1160
1154
  }
1161
1155
  function zu({
1162
1156
  value: n,
1163
- onChange: o
1157
+ onChange: i
1164
1158
  }) {
1165
1159
  const [h, d] = _(!1), [w, N] = _(""), [q, $] = _(""), S = pe(null);
1166
1160
  me(() => {
@@ -1188,7 +1182,7 @@ function zu({
1188
1182
  }, [h, n]);
1189
1183
  const L = () => {
1190
1184
  const u = w || q;
1191
- u && (o(nd({ op: K, from: u, to: q || w || u })), d(!1));
1185
+ u && (i(nd({ op: K, from: u, to: q || w || u })), d(!1));
1192
1186
  };
1193
1187
  return /* @__PURE__ */ c("div", { ref: S, className: "relative w-full", children: [
1194
1188
  /* @__PURE__ */ c(
@@ -1207,7 +1201,7 @@ function zu({
1207
1201
  role: "button",
1208
1202
  tabIndex: -1,
1209
1203
  onClick: (u) => {
1210
- u.stopPropagation(), o(null);
1204
+ u.stopPropagation(), i(null);
1211
1205
  },
1212
1206
  "aria-label": "Clear date filter",
1213
1207
  className: "text-slate-400 hover:text-slate-600",
@@ -1224,7 +1218,7 @@ function zu({
1224
1218
  {
1225
1219
  type: "button",
1226
1220
  onClick: () => {
1227
- o(u.value || null), d(!1);
1221
+ i(u.value || null), d(!1);
1228
1222
  },
1229
1223
  className: `block w-full rounded px-2 py-1 text-left text-[11.5px] font-normal normal-case tracking-normal ${n === u.value || !n && !u.value ? "bg-nvr-cyan/[0.08] font-medium text-slate-800 dark:text-slate-100" : "text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"}`,
1230
1224
  children: u.label
@@ -1285,7 +1279,7 @@ function zu({
1285
1279
  }
1286
1280
  function Wu({
1287
1281
  def: n,
1288
- selected: o,
1282
+ selected: i,
1289
1283
  onChange: h,
1290
1284
  allowedIds: d,
1291
1285
  scopeDefault: w,
@@ -1301,7 +1295,7 @@ function Wu({
1301
1295
  n.label_field,
1302
1296
  n.sort ?? "",
1303
1297
  B,
1304
- o.map(String).sort().join(",")
1298
+ i.map(String).sort().join(",")
1305
1299
  ],
1306
1300
  queryFn: async () => {
1307
1301
  const R = B !== "[]" ? Ud(
@@ -1323,17 +1317,17 @@ function Wu({
1323
1317
  label: String(we[n.label_field] ?? we[S] ?? ""),
1324
1318
  id: we.id
1325
1319
  })).filter((we) => we.value != null && we.label !== "")
1326
- ), D = await m(R, !0), O = new Set(D.map((T) => String(T.value))), M = o.filter((T) => !O.has(String(T)));
1320
+ ), D = await m(R, !0), O = new Set(D.map((T) => String(T.value))), M = i.filter((T) => !O.has(String(T)));
1327
1321
  return M.length === 0 ? D : [...D, ...await m({ [S]: { _in: M } }, !1)];
1328
1322
  },
1329
1323
  staleTime: 10 * 6e4,
1330
- enabled: F || o.length > 0,
1324
+ enabled: F || i.length > 0,
1331
1325
  retry: !1
1332
1326
  }), y = d != null && d.length ? L.filter((R) => d.some((m) => String(m) === String(R.id))) : L, W = d != null && d.length ? {
1333
1327
  label: "restricted",
1334
1328
  cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
1335
1329
  title: `Options limited to your restricted ${n.label} scope${w ? "; selection seeded from your defaults" : ""}`
1336
- } : w && o.length > 0 ? {
1330
+ } : w && i.length > 0 ? {
1337
1331
  label: "your default",
1338
1332
  cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
1339
1333
  title: `Pre-selected from your default ${n.label} filter (Profile → Default filters) — adjust freely`
@@ -1343,7 +1337,7 @@ function Wu({
1343
1337
  {
1344
1338
  label: n.label,
1345
1339
  options: y,
1346
- selected: o,
1340
+ selected: i,
1347
1341
  onChange: h,
1348
1342
  loading: u,
1349
1343
  badge: W,
@@ -1382,47 +1376,47 @@ const ro = [
1382
1376
  _lte: "_gt"
1383
1377
  };
1384
1378
  function so(n) {
1385
- const o = /* @__PURE__ */ new Date(), h = (w) => w.toISOString().slice(0, 10), d = h(o);
1379
+ const i = /* @__PURE__ */ new Date(), h = (w) => w.toISOString().slice(0, 10), d = h(i);
1386
1380
  if (n === "today") return { from: d, to: d };
1387
1381
  if (n === "7d" || n === "30d" || n === "90d") {
1388
1382
  const w = Number(n.slice(0, -1));
1389
- return { from: h(new Date(o.getTime() - w * 864e5)), to: d };
1383
+ return { from: h(new Date(i.getTime() - w * 864e5)), to: d };
1390
1384
  }
1391
- return n === "year" ? { from: `${o.getFullYear()}-01-01`, to: d } : null;
1385
+ return n === "year" ? { from: `${i.getFullYear()}-01-01`, to: d } : null;
1392
1386
  }
1393
1387
  function Hl(n) {
1394
1388
  var h;
1395
- const o = [];
1389
+ const i = [];
1396
1390
  for (const d of n) {
1397
1391
  const w = d.fieldType === "date" || d.fieldType === "datetime" || d.fieldType === "timestamp";
1398
1392
  if (d.op === "_between") {
1399
1393
  const [$, S] = String(d.value).split("..");
1400
1394
  if (d.not) {
1401
1395
  const F = [];
1402
- $ && F.push({ path: d.path, op: "_lt", value: $ }), S && F.push({ path: d.path, op: "_gt", value: w ? `${S}T23:59:59` : S }), F.length && o.push({ or: F });
1396
+ $ && F.push({ path: d.path, op: "_lt", value: $ }), S && F.push({ path: d.path, op: "_gt", value: w ? `${S}T23:59:59` : S }), F.length && i.push({ or: F });
1403
1397
  continue;
1404
1398
  }
1405
- $ && o.push({ path: d.path, op: "_gte", value: $ }), S && o.push({ path: d.path, op: "_lte", value: w ? `${S}T23:59:59` : S });
1399
+ $ && i.push({ path: d.path, op: "_gte", value: $ }), S && i.push({ path: d.path, op: "_lte", value: w ? `${S}T23:59:59` : S });
1406
1400
  continue;
1407
1401
  }
1408
1402
  if ((h = d.path[0]) != null && h.startsWith("$has_") || d.path[0] === "$missing_required" || d.path[0] === "$unseen") {
1409
- o.push({ path: d.path, op: "_eq", value: !d.not });
1403
+ i.push({ path: d.path, op: "_eq", value: !d.not });
1410
1404
  continue;
1411
1405
  }
1412
1406
  if (d.op === "_preset") {
1413
1407
  const $ = so(String(d.value));
1414
- $ && (d.not ? o.push({
1408
+ $ && (d.not ? i.push({
1415
1409
  or: [
1416
1410
  { path: d.path, op: "_lt", value: $.from },
1417
1411
  { path: d.path, op: "_gt", value: `${$.to}T23:59:59` }
1418
1412
  ]
1419
- }) : (o.push({ path: d.path, op: "_gte", value: $.from }), o.push({ path: d.path, op: "_lte", value: `${$.to}T23:59:59` })));
1413
+ }) : (i.push({ path: d.path, op: "_gte", value: $.from }), i.push({ path: d.path, op: "_lte", value: `${$.to}T23:59:59` })));
1420
1414
  continue;
1421
1415
  }
1422
1416
  let N = d.op.includes(":") ? d.op.split(":")[0] : d.op, q = d.op.includes(":") ? d.op.split(":")[1] : d.value || null;
1423
- d.fieldType === "boolean" && (q === "true" || q === "false") && (q = q === "true"), d.not && (N = Vu[N] ?? N), o.push({ path: d.path, op: N, value: q });
1417
+ d.fieldType === "boolean" && (q === "true" || q === "false") && (q = q === "true"), d.not && (N = Vu[N] ?? N), i.push({ path: d.path, op: N, value: q });
1424
1418
  }
1425
- return o;
1419
+ return i;
1426
1420
  }
1427
1421
  const Yl = [
1428
1422
  { label: "Contains", value: "_contains" },
@@ -1470,20 +1464,20 @@ const Yl = [
1470
1464
  ]
1471
1465
  };
1472
1466
  function Yu(n) {
1473
- for (const o of Object.values(Hu)) {
1474
- const h = o.find((d) => d.value === n);
1467
+ for (const i of Object.values(Hu)) {
1468
+ const h = i.find((d) => d.value === n);
1475
1469
  if (h) return h.label;
1476
1470
  }
1477
1471
  return n;
1478
1472
  }
1479
- function ot(n, o, h) {
1473
+ function ot(n, i, h) {
1480
1474
  return n.find(
1481
- (d) => d.many_collection === o && d.many_field === h && d.one_collection
1475
+ (d) => d.many_collection === i && d.many_field === h && d.one_collection
1482
1476
  );
1483
1477
  }
1484
1478
  function Kr({
1485
1479
  relatedCollection: n,
1486
- depth: o,
1480
+ depth: i,
1487
1481
  path: h,
1488
1482
  pathLabels: d,
1489
1483
  filterText: w,
@@ -1497,8 +1491,8 @@ function Kr({
1497
1491
  retry: !1
1498
1492
  }), [F, K] = _(/* @__PURE__ */ new Set());
1499
1493
  if (!S)
1500
- return /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + o}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1501
- const B = o < 2;
1494
+ return /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1495
+ const B = i < 2;
1502
1496
  return /* @__PURE__ */ a(ze, { children: S.fields.filter((L) => !L.hidden && (!w || L.field.includes(w))).map((L) => {
1503
1497
  const u = B ? ot(S.relations, n, L.field) : void 0, y = B && N ? Tn(S.relations, n, L.field) : void 0, W = (u == null ? void 0 : u.one_collection) ?? null, R = F.has(L.field);
1504
1498
  return /* @__PURE__ */ c("div", { children: [
@@ -1517,7 +1511,7 @@ function Kr({
1517
1511
  );
1518
1512
  },
1519
1513
  className: "flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
1520
- style: { paddingLeft: `${0.5 + o}rem` },
1514
+ style: { paddingLeft: `${0.5 + i}rem` },
1521
1515
  children: [
1522
1516
  W || y ? R ? "▾ " : "▸ " : "",
1523
1517
  je(L.field),
@@ -1529,7 +1523,7 @@ function Kr({
1529
1523
  Kr,
1530
1524
  {
1531
1525
  relatedCollection: W,
1532
- depth: o + 1,
1526
+ depth: i + 1,
1533
1527
  path: [...h, L.field],
1534
1528
  pathLabels: [...d, je(L.field)],
1535
1529
  filterText: "",
@@ -1541,7 +1535,7 @@ function Kr({
1541
1535
  lo,
1542
1536
  {
1543
1537
  aliasInfo: y,
1544
- depth: o + 1,
1538
+ depth: i + 1,
1545
1539
  path: [...h, L.field],
1546
1540
  pathLabels: [...d, je(L.field)],
1547
1541
  includeAliases: N,
@@ -1553,7 +1547,7 @@ function Kr({
1553
1547
  }
1554
1548
  function lo({
1555
1549
  aliasInfo: n,
1556
- depth: o,
1550
+ depth: i,
1557
1551
  path: h,
1558
1552
  pathLabels: d,
1559
1553
  includeAliases: w,
@@ -1578,23 +1572,23 @@ function lo({
1578
1572
  Kr,
1579
1573
  {
1580
1574
  relatedCollection: F,
1581
- depth: o,
1575
+ depth: i,
1582
1576
  path: h,
1583
1577
  pathLabels: d,
1584
1578
  filterText: "",
1585
1579
  includeAliases: w,
1586
1580
  onPick: N
1587
1581
  }
1588
- ) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + o}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1582
+ ) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1589
1583
  }
1590
- function Jl(n, o, h) {
1591
- if (o) return "relation";
1584
+ function Jl(n, i, h) {
1585
+ if (i) return "relation";
1592
1586
  const d = n.type ?? "string";
1593
1587
  return d === "integer" || d === "decimal" || d === "float" ? "number" : d === "datetime" || d === "timestamp" ? "date" : d;
1594
1588
  }
1595
1589
  function Ju({
1596
1590
  collection: n,
1597
- path: o,
1591
+ path: i,
1598
1592
  pathLabels: h,
1599
1593
  search: d,
1600
1594
  depth: w,
@@ -1640,7 +1634,7 @@ function Ju({
1640
1634
  const L = d.trim().toLowerCase(), u = (m) => !L || m.toLowerCase().includes(L) || m.toLowerCase().replace(/ /g, "_").includes(L), y = [];
1641
1635
  for (const m of S.fields) {
1642
1636
  if (m.hidden) continue;
1643
- const D = je(m.field), O = ot(S.relations, n, m.field), M = Tn(S.relations, n, m.field), T = [...o, m.field], de = [...h, D];
1637
+ const D = je(m.field), O = ot(S.relations, n, m.field), M = Tn(S.relations, n, m.field), T = [...i, m.field], de = [...h, D];
1644
1638
  if (O != null && O.one_collection && !Tt(O.one_collection))
1645
1639
  u(D) && y.push({
1646
1640
  key: m.field,
@@ -1695,7 +1689,7 @@ function Ju({
1695
1689
  breadcrumb: M,
1696
1690
  hint: Jl(T, fe ?? void 0),
1697
1691
  leaf: {
1698
- path: [...o, m.field, T.field],
1692
+ path: [...i, m.field, T.field],
1699
1693
  pathLabels: [...h, M, de],
1700
1694
  fieldType: fe != null && fe.one_collection ? "relation" : T.type ?? "string",
1701
1695
  relTarget: (fe == null ? void 0 : fe.one_collection) ?? void 0
@@ -1744,7 +1738,7 @@ function Ju({
1744
1738
  }
1745
1739
  function Gu({
1746
1740
  target: n,
1747
- selected: o,
1741
+ selected: i,
1748
1742
  labels: h,
1749
1743
  onToggle: d
1750
1744
  }) {
@@ -1774,7 +1768,7 @@ function Gu({
1774
1768
  staleTime: 10 * 6e4,
1775
1769
  enabled: !!$,
1776
1770
  retry: !1
1777
- }), L = new Set(o.map(String)), u = N ? K.filter((y) => y.label.toLowerCase().includes(N.toLowerCase())) : K;
1771
+ }), L = new Set(i.map(String)), u = N ? K.filter((y) => y.label.toLowerCase().includes(N.toLowerCase())) : K;
1778
1772
  return /* @__PURE__ */ c("div", { className: "flex max-h-64 flex-col", children: [
1779
1773
  /* @__PURE__ */ a(
1780
1774
  "input",
@@ -1804,39 +1798,39 @@ function Gu({
1804
1798
  },
1805
1799
  String(y.value)
1806
1800
  )) }),
1807
- o.length > 0 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 px-3 py-1 text-[11px] text-slate-400 dark:border-slate-800", children: [
1808
- o.length,
1801
+ i.length > 0 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 px-3 py-1 text-[11px] text-slate-400 dark:border-slate-800", children: [
1802
+ i.length,
1809
1803
  " selected ·",
1810
1804
  " ",
1811
- o.map((y) => h[String(y)] ?? y).slice(0, 3).join(", "),
1812
- o.length > 3 ? "…" : ""
1805
+ i.map((y) => h[String(y)] ?? y).slice(0, 3).join(", "),
1806
+ i.length > 3 ? "…" : ""
1813
1807
  ] })
1814
1808
  ] });
1815
1809
  }
1816
1810
  function Xu(n) {
1817
1811
  var h, d;
1818
- const o = n.pathLabels.join(" › ");
1812
+ const i = n.pathLabels.join(" › ");
1819
1813
  if (Array.isArray(n.value)) {
1820
1814
  const w = n.valueLabels ?? n.value.map(String);
1821
1815
  return {
1822
- field: o,
1816
+ field: i,
1823
1817
  op: "any of",
1824
1818
  value: w.length <= 2 ? w.join(", ") : `${w[0]} +${w.length - 1}`
1825
1819
  };
1826
1820
  }
1827
1821
  if (n.op === "_between") {
1828
1822
  const [w, N] = String(n.value).split("..");
1829
- return { field: o, op: "between", value: `${w} – ${N}` };
1823
+ return { field: i, op: "between", value: `${w} – ${N}` };
1830
1824
  }
1831
1825
  if (n.op === "_preset") {
1832
1826
  const w = ((h = Ra.find((N) => N.value === n.value)) == null ? void 0 : h.label) ?? String(n.value);
1833
- return { field: o, op: "in the", value: `${w} (rolling)` };
1827
+ return { field: i, op: "in the", value: `${w} (rolling)` };
1834
1828
  }
1835
- return (d = n.path[0]) != null && d.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: o, op: "", value: "" } : { field: o, op: Yu(n.op).toLowerCase(), value: String(n.value ?? "") };
1829
+ return (d = n.path[0]) != null && d.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: i, op: "", value: "" } : { field: i, op: Yu(n.op).toLowerCase(), value: String(n.value ?? "") };
1836
1830
  }
1837
1831
  function Zu({
1838
1832
  collection: n,
1839
- meta: o,
1833
+ meta: i,
1840
1834
  search: h,
1841
1835
  onSearch: d,
1842
1836
  filters: w,
@@ -2261,12 +2255,12 @@ function Zu({
2261
2255
  }
2262
2256
  function ep({
2263
2257
  collection: n,
2264
- meta: o,
2258
+ meta: i,
2265
2259
  onPick: h
2266
2260
  }) {
2267
2261
  const [d, w] = _(/* @__PURE__ */ new Set()), N = (q, $) => h(q, $);
2268
- return /* @__PURE__ */ a("div", { className: "max-h-56 overflow-y-auto", children: o.fields.filter((q) => !q.hidden).map((q) => {
2269
- const $ = ot(o.relations, n, q.field), S = Tn(o.relations, n, q.field);
2262
+ return /* @__PURE__ */ a("div", { className: "max-h-56 overflow-y-auto", children: i.fields.filter((q) => !q.hidden).map((q) => {
2263
+ const $ = ot(i.relations, n, q.field), S = Tn(i.relations, n, q.field);
2270
2264
  if (!($ != null && $.one_collection) && !S) return null;
2271
2265
  const F = d.has(q.field);
2272
2266
  return /* @__PURE__ */ c("div", { children: [
@@ -2315,11 +2309,11 @@ function ep({
2315
2309
  }
2316
2310
  function tp({
2317
2311
  collection: n,
2318
- ids: o,
2312
+ ids: i,
2319
2313
  onDone: h,
2320
2314
  onCancel: d
2321
2315
  }) {
2322
- const w = Lt(), [N, q] = _(o[0]), [$, S] = _(!1), [F, K] = _(null), [B, L] = _(null), u = o.find((R) => String(R) !== String(N));
2316
+ const w = Lt(), [N, q] = _(i[0]), [$, S] = _(!1), [F, K] = _(null), [B, L] = _(null), u = i.find((R) => String(R) !== String(N));
2323
2317
  me(() => {
2324
2318
  L(null);
2325
2319
  let R = !0;
@@ -2357,7 +2351,7 @@ function tp({
2357
2351
  };
2358
2352
  return /* @__PURE__ */ c("span", { className: "flex flex-wrap items-center gap-2", children: [
2359
2353
  /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: "Keep" }),
2360
- o.map((R) => /* @__PURE__ */ a(
2354
+ i.map((R) => /* @__PURE__ */ a(
2361
2355
  "button",
2362
2356
  {
2363
2357
  type: "button",
@@ -2395,7 +2389,7 @@ function tp({
2395
2389
  }
2396
2390
  function np({
2397
2391
  collection: n,
2398
- selectedIds: o,
2392
+ selectedIds: i,
2399
2393
  transitions: h,
2400
2394
  states: d = [],
2401
2395
  fields: w,
@@ -2404,7 +2398,7 @@ function np({
2404
2398
  onClear: $,
2405
2399
  onSuccess: S
2406
2400
  }) {
2407
- const F = Ta(), K = Lt(), B = Ea(), L = Zl(), [u, y] = _("actions"), W = vc([n], q), { data: R = [] } = ne({
2401
+ const F = Ta(), K = Lt(), B = Ea(), L = Zl(), [u, y] = _("actions"), W = kc([n], q), { data: R = [] } = ne({
2408
2402
  queryKey: ["bulk-recipes", n],
2409
2403
  queryFn: () => K.request(G("/bulk-recipes", { collection: n })).then((f) => f.data ?? []).catch(() => []),
2410
2404
  staleTime: 6e4
@@ -2429,7 +2423,7 @@ function np({
2429
2423
  mt(async (re) => {
2430
2424
  const qe = await K.request(
2431
2425
  he(`/items/${n}/bulk-update?progress=${re}`, {
2432
- ids: o,
2426
+ ids: i,
2433
2427
  data: { [String(oe.field)]: oe.value ?? "" }
2434
2428
  })
2435
2429
  );
@@ -2446,7 +2440,7 @@ function np({
2446
2440
  mt(async (re) => {
2447
2441
  const qe = await K.request(
2448
2442
  he(`/items/${n}/bulk-transition?progress=${re}`, {
2449
- ids: o,
2443
+ ids: i,
2450
2444
  transition_ids: h.filter((vt) => {
2451
2445
  var Kt;
2452
2446
  return vt.label === ((Kt = f.config) == null ? void 0 : Kt.transition_label);
@@ -2474,11 +2468,11 @@ function np({
2474
2468
  }, [h]), Se = Be.find((f) => f.label === fe) ?? null, [X, $e] = _(""), it = (f) => d.find((H) => String(H.id).toUpperCase() === f.toUpperCase()), rt = Se ? [...Se.targets.keys()].filter(Boolean).sort((f, H) => {
2475
2469
  var te, oe;
2476
2470
  return Number(((te = it(f)) == null ? void 0 : te.sort) ?? 0) - Number(((oe = it(H)) == null ? void 0 : oe.sort) ?? 0);
2477
- }) : [], Ie = rt.length > 1, Oe = Se ? Ie ? X ? Se.targets.get(X) ?? [] : [] : Se.ids : [], We = Oe.length ? `${Oe.join(",")}|${o.join(",")}` : "", { data: k, isFetching: le } = ne({
2471
+ }) : [], Ie = rt.length > 1, Oe = Se ? Ie ? X ? Se.targets.get(X) ?? [] : [] : Se.ids : [], We = Oe.length ? `${Oe.join(",")}|${i.join(",")}` : "", { data: k, isFetching: le } = ne({
2478
2472
  queryKey: ["bulk-transition-preview", n, We],
2479
2473
  queryFn: () => K.request(
2480
2474
  he(`/items/${n}/bulk-transition?dry_run=1`, {
2481
- ids: o,
2475
+ ids: i,
2482
2476
  transition_ids: Oe,
2483
2477
  comment: "(preview)"
2484
2478
  })
@@ -2489,7 +2483,7 @@ function np({
2489
2483
  }), [ee, xe] = _(!1), [st, Ze] = _(null), mt = async (f) => {
2490
2484
  xe(!0), Ze(null);
2491
2485
  const H = Qi();
2492
- Ui(H, o);
2486
+ Ui(H, i);
2493
2487
  try {
2494
2488
  const te = await f(H);
2495
2489
  Ze(te), S(), $(), y("actions");
@@ -2501,7 +2495,7 @@ function np({
2501
2495
  }, Et = (f, H) => void mt(async (te) => {
2502
2496
  const oe = await K.request(
2503
2497
  he(`/items/${n}/bulk-update?progress=${te}`, {
2504
- ids: o,
2498
+ ids: i,
2505
2499
  data: { [f]: H ?? null },
2506
2500
  by_form: !0
2507
2501
  })
@@ -2529,9 +2523,9 @@ function np({
2529
2523
  }
2530
2524
  ),
2531
2525
  /* @__PURE__ */ c("span", { className: "text-[13px] font-medium text-nvr-cyan dark:text-nvr-cyan", children: [
2532
- o.length,
2526
+ i.length,
2533
2527
  " item",
2534
- o.length === 1 ? "" : "s",
2528
+ i.length === 1 ? "" : "s",
2535
2529
  " selected"
2536
2530
  ] }),
2537
2531
  st && /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: st }),
@@ -2572,13 +2566,13 @@ function np({
2572
2566
  )
2573
2567
  ] }, f.id);
2574
2568
  }),
2575
- o.length >= 2 && /* @__PURE__ */ a(
2569
+ i.length >= 2 && /* @__PURE__ */ a(
2576
2570
  "button",
2577
2571
  {
2578
2572
  type: "button",
2579
2573
  onClick: () => {
2580
2574
  const f = Ad(
2581
- o.map((H) => L.urlFor({ collection: n, itemId: String(H) }))
2575
+ i.map((H) => L.urlFor({ collection: n, itemId: String(H) }))
2582
2576
  );
2583
2577
  f.blocked > 0 || f.capped > 0 ? ge.warning(Rl(f)) : ge.success(Rl(f));
2584
2578
  },
@@ -2589,16 +2583,16 @@ function np({
2589
2583
  }
2590
2584
  ),
2591
2585
  W("compare") && /* @__PURE__ */ a(
2592
- yc,
2586
+ wc,
2593
2587
  {
2594
- targets: o.map((f) => ({ collection: n, id: f })),
2588
+ targets: i.map((f) => ({ collection: n, id: f })),
2595
2589
  fields: w,
2596
2590
  relations: N,
2597
2591
  renderValue: (f, H, te, oe) => rp(n, f, H, te, oe),
2598
2592
  className: "h-8 rounded-md border border-white/20 dark:border-border px-3 text-[12.5px] font-medium hover:bg-white/10 dark:hover:bg-muted"
2599
2593
  }
2600
2594
  ),
2601
- W("merge") && o.length === 2 && F.isAdmin && /* @__PURE__ */ a(
2595
+ W("merge") && i.length === 2 && F.isAdmin && /* @__PURE__ */ a(
2602
2596
  "button",
2603
2597
  {
2604
2598
  type: "button",
@@ -2609,9 +2603,9 @@ function np({
2609
2603
  }
2610
2604
  ),
2611
2605
  /* @__PURE__ */ a(
2612
- kc,
2606
+ yc,
2613
2607
  {
2614
- targets: o.map((f) => ({ collection: n, id: f })),
2608
+ targets: i.map((f) => ({ collection: n, id: f })),
2615
2609
  enabledKeys: q,
2616
2610
  tone: "dark",
2617
2611
  disabled: ee,
@@ -2621,10 +2615,10 @@ function np({
2621
2615
  }
2622
2616
  ),
2623
2617
  W("update-field") && /* @__PURE__ */ a(
2624
- wc,
2618
+ _c,
2625
2619
  {
2626
2620
  collection: n,
2627
- selectedIds: o,
2621
+ selectedIds: i,
2628
2622
  disabled: ee,
2629
2623
  onApply: Et,
2630
2624
  onSaveRecipe: (f, H) => {
@@ -2665,7 +2659,7 @@ function np({
2665
2659
  tp,
2666
2660
  {
2667
2661
  collection: n,
2668
- ids: o.slice(0, 2),
2662
+ ids: i.slice(0, 2),
2669
2663
  onDone: (f) => {
2670
2664
  Ze(f), S(), $(), y("actions");
2671
2665
  },
@@ -2673,10 +2667,10 @@ function np({
2673
2667
  }
2674
2668
  ),
2675
2669
  u === "message" && /* @__PURE__ */ a(
2676
- Nc,
2670
+ Sc,
2677
2671
  {
2678
2672
  collection: n,
2679
- selectedIds: o,
2673
+ selectedIds: i,
2680
2674
  onDone: (f) => {
2681
2675
  Ze(f), y("actions");
2682
2676
  },
@@ -2693,7 +2687,7 @@ function np({
2693
2687
  mt(async (te) => {
2694
2688
  const oe = await K.request(
2695
2689
  he(`/items/${n}/bulk-transition?progress=${te}`, {
2696
- ids: o,
2690
+ ids: i,
2697
2691
  transition_ids: Oe,
2698
2692
  ...H ? { comment: H } : {}
2699
2693
  })
@@ -2847,9 +2841,9 @@ function np({
2847
2841
  u === "confirm-delete" && /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2848
2842
  /* @__PURE__ */ c("span", { className: "text-[12.5px] text-slate-300 dark:text-muted-foreground", children: [
2849
2843
  "Delete ",
2850
- o.length,
2844
+ i.length,
2851
2845
  " item",
2852
- o.length === 1 ? "" : "s",
2846
+ i.length === 1 ? "" : "s",
2853
2847
  "? Deleted records move to Trash for 30 days."
2854
2848
  ] }),
2855
2849
  /* @__PURE__ */ a(
@@ -2858,7 +2852,7 @@ function np({
2858
2852
  type: "button",
2859
2853
  disabled: ee,
2860
2854
  onClick: () => void mt(async (f) => `Deleted ${(await K.request(
2861
- he(`/items/${n}/bulk-delete?progress=${f}`, { ids: o })
2855
+ he(`/items/${n}/bulk-delete?progress=${f}`, { ids: i })
2862
2856
  )).deleted} items`),
2863
2857
  className: "h-8 rounded-md bg-red-600 px-3 text-[12.5px] font-medium hover:bg-red-700 disabled:opacity-50",
2864
2858
  children: ee ? "Deleting…" : "Delete"
@@ -2890,9 +2884,9 @@ const ap = {
2890
2884
  tasks: "short",
2891
2885
  addendums: "short"
2892
2886
  };
2893
- function Z0({
2887
+ function em({
2894
2888
  collection: n,
2895
- quickFilters: o = [],
2889
+ quickFilters: i = [],
2896
2890
  initialColumns: h,
2897
2891
  initialSort: d,
2898
2892
  pageSize: w = 25,
@@ -2929,7 +2923,7 @@ function Z0({
2929
2923
  () => (m == null ? void 0 : m.qf) ?? {}
2930
2924
  ), [Dt, un] = _(
2931
2925
  m ? m.lc ?? [] : $ ?? []
2932
- ), { scopes: bt, ready: Ln } = sc(), [Ge, jt] = _(!1), [pn, en] = _(/* @__PURE__ */ new Set()), [He, zt] = _(
2926
+ ), { scopes: bt, ready: Ln } = lc(), [Ge, jt] = _(!1), [pn, en] = _(/* @__PURE__ */ new Set()), [He, zt] = _(
2933
2927
  () => (m == null ? void 0 : m.cf) ?? {}
2934
2928
  ), yt = Mi("drill.browser"), lt = yt.value, [Fn, mn] = _(null), [fn, tn] = _(!1), [nn, ea] = _(() => {
2935
2929
  try {
@@ -3026,12 +3020,12 @@ function Z0({
3026
3020
  }, [I]);
3027
3021
  const Ot = Pe.checkbox_selection !== !1, Jr = Pe.show_actions !== !1, [_t, uo] = _(!1), po = () => {
3028
3022
  _t && sn([]), uo(!_t);
3029
- }, aa = B && Pe.allow_create !== !1, Gr = typeof Pe.create_label == "string" && Pe.create_label.trim().slice(0, 40) || "New item", ra = ic(aa && !(I != null && I.singleton) ? n : null), [ja, Mn] = _(!1), [Ba, sa] = _(null), { steps: Qa } = cu(
3023
+ }, aa = B && Pe.allow_create !== !1, Gr = typeof Pe.create_label == "string" && Pe.create_label.trim().slice(0, 40) || "New item", ra = dc(aa && !(I != null && I.singleton) ? n : null), [ja, Mn] = _(!1), [Ba, sa] = _(null), { steps: Qa } = uu(
3030
3024
  aa && !(I != null && I.singleton) ? n : null,
3031
3025
  null
3032
3026
  ), Xr = (e) => {
3033
3027
  e ? W({ collection: n, itemId: "new", layoutSlug: e }) : dn("new");
3034
- }, An = ou(aa && !(I != null && I.singleton) ? n : null), mo = Ai(), Zr = pe(null), [fo, bo] = _(null), [es, ts] = _(!1), ns = (e) => {
3028
+ }, An = iu(aa && !(I != null && I.singleton) ? n : null), mo = Ai(), Zr = pe(null), [fo, bo] = _(null), [es, ts] = _(!1), ns = (e) => {
3035
3029
  var t;
3036
3030
  bo(e), (t = Zr.current) == null || t.click();
3037
3031
  }, ho = async (e) => {
@@ -3039,7 +3033,7 @@ function Z0({
3039
3033
  if (e.target.value = "", !!t.length) {
3040
3034
  ts(!0);
3041
3035
  try {
3042
- const r = await iu(mo, t, n);
3036
+ const r = await du(mo, t, n);
3043
3037
  W({ collection: n, itemId: "new", layoutSlug: fo, query: { autofill: r } });
3044
3038
  } catch (r) {
3045
3039
  ql(r, "The document could not be read", { action: "New from document" });
@@ -3056,43 +3050,43 @@ function Z0({
3056
3050
  };
3057
3051
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
3058
3052
  }, [ja]);
3059
- const Ye = m != null && m.ps ? m.ps : Pe.page_size && Pe.page_size > 0 ? Math.min(Pe.page_size, 200) : w, Nt = o.length > 0 ? o : Pe.quick_filters ?? [], rs = async (e) => {
3053
+ const Ye = m != null && m.ps ? m.ps : Pe.page_size && Pe.page_size > 0 ? Math.min(Pe.page_size, 200) : w, Nt = i.length > 0 ? i : Pe.quick_filters ?? [], rs = async (e) => {
3060
3054
  const t = {};
3061
3055
  if (!bt) return t;
3062
3056
  for (const r of e) {
3063
3057
  const s = Dl(bt, { key: r.key, collection: r.collection });
3064
3058
  if (!s) continue;
3065
- const l = lc(bt, s.name);
3059
+ const l = oc(bt, s.name);
3066
3060
  if (l.length === 0) continue;
3067
- const i = await oc(u, s, l, r.value_field).catch(
3061
+ const o = await ic(u, s, l, r.value_field).catch(
3068
3062
  () => []
3069
3063
  );
3070
- i.length > 0 && (t[r.key] = i);
3064
+ o.length > 0 && (t[r.key] = o);
3071
3065
  }
3072
3066
  return t;
3073
- }, la = wt && o.length === 0, za = pe(null), xn = _u({
3067
+ }, la = wt && i.length === 0, za = pe(null), xn = Nu({
3074
3068
  collection: n,
3075
3069
  filters: Nt,
3076
3070
  onApplied: (e, t) => {
3077
3071
  const r = { sel: cn, applied: ft, seeded: pn };
3078
3072
  Ve((l) => Lr(l, t, e)), kt((l) => Lr(l, t, e)), en((l) => {
3079
- const i = Lr(
3073
+ const o = Lr(
3080
3074
  Object.fromEntries([...l].map((b) => [b, []])),
3081
3075
  t,
3082
3076
  e
3083
3077
  );
3084
- return new Set(Object.keys(i));
3078
+ return new Set(Object.keys(o));
3085
3079
  }), T(1);
3086
- const s = e.filter((l) => !t.some((i) => i.key === l.key));
3080
+ const s = e.filter((l) => !t.some((o) => o.key === l.key));
3087
3081
  return s.length > 0 && !m && !Ia && rs(s).then((l) => {
3088
3082
  if (Object.keys(l).length === 0) return;
3089
- const i = (b) => {
3083
+ const o = (b) => {
3090
3084
  var v;
3091
3085
  const x = { ...b };
3092
3086
  for (const [U, j] of Object.entries(l)) (((v = x[U]) == null ? void 0 : v.length) ?? 0) || (x[U] = j);
3093
3087
  return x;
3094
3088
  };
3095
- Ve(i), kt(i), en((b) => /* @__PURE__ */ new Set([...b, ...Object.keys(l)]));
3089
+ Ve(o), kt(o), en((b) => /* @__PURE__ */ new Set([...b, ...Object.keys(l)]));
3096
3090
  }), window.setTimeout(() => {
3097
3091
  var l;
3098
3092
  return (l = za.current) == null ? void 0 : l.focus();
@@ -3102,7 +3096,7 @@ function Z0({
3102
3096
  }
3103
3097
  });
3104
3098
  me(() => {
3105
- if (Ge || !Ln || o.length === 0 && !I) return;
3099
+ if (Ge || !Ln || i.length === 0 && !I) return;
3106
3100
  const e = bt, t = Object.values((e == null ? void 0 : e.defaults) ?? {}).some((r) => r.length > 0) || Object.values((e == null ? void 0 : e.restricted) ?? {}).some((r) => r.length > 0);
3107
3101
  if (!e || Nt.length === 0 || !t || m || Ia) {
3108
3102
  jt(!0);
@@ -3113,10 +3107,10 @@ function Z0({
3113
3107
  if (Object.keys(r).length > 0) {
3114
3108
  const s = (l) => {
3115
3109
  var b;
3116
- const i = { ...l };
3110
+ const o = { ...l };
3117
3111
  for (const [x, v] of Object.entries(r))
3118
- (((b = i[x]) == null ? void 0 : b.length) ?? 0) > 0 || (i[x] = v);
3119
- return i;
3112
+ (((b = o[x]) == null ? void 0 : b.length) ?? 0) > 0 || (o[x] = v);
3113
+ return o;
3120
3114
  };
3121
3115
  Ve(s), kt(s), en(new Set(Object.keys(r)));
3122
3116
  }
@@ -3134,7 +3128,7 @@ function Z0({
3134
3128
  }), vo = wt || Ku(xo, n), os = be(
3135
3129
  () => new Map(((I == null ? void 0 : I.fields) ?? []).map((e) => [e.field, e])),
3136
3130
  [I]
3137
- ), is = hu(), ds = (e) => (
3131
+ ), is = gu(), ds = (e) => (
3138
3132
  // Ask-the-table answers are a one-off overlay, not the list's own rows.
3139
3133
  ae ? null : vd({
3140
3134
  config: ls,
@@ -3145,27 +3139,27 @@ function Z0({
3145
3139
  mayUpdate: vo
3146
3140
  })
3147
3141
  ), ko = (e, t, r, s, l) => {
3148
- const i = e.id, b = l === 0 ? null : kd(
3142
+ const o = e.id, b = l === 0 ? null : kd(
3149
3143
  ve.filter((x) => !!ds(x)),
3150
3144
  t,
3151
3145
  l
3152
3146
  );
3153
3147
  is.commit({
3154
- cellKey: `${String(i)}|${t}`,
3148
+ cellKey: `${String(o)}|${t}`,
3155
3149
  collection: n,
3156
- id: i,
3150
+ id: o,
3157
3151
  field: t,
3158
3152
  kind: r,
3159
3153
  before: e[t],
3160
3154
  value: s,
3161
- next: b ? `${String(i)}|${b}` : null,
3155
+ next: b ? `${String(o)}|${b}` : null,
3162
3156
  optimistic: () => {
3163
3157
  const x = y.getQueriesData({ queryKey: ["cbv-items", n] });
3164
3158
  return y.setQueriesData({ queryKey: ["cbv-items", n] }, (v) => {
3165
3159
  const U = v;
3166
3160
  return U != null && U.data ? {
3167
3161
  ...U,
3168
- data: U.data.map((j) => String(j.id) === String(i) ? { ...j, [t]: s } : j)
3162
+ data: U.data.map((j) => String(j.id) === String(o) ? { ...j, [t]: s } : j)
3169
3163
  } : v;
3170
3164
  }), () => {
3171
3165
  for (const [v, U] of x) y.setQueryData(v, U);
@@ -3177,16 +3171,16 @@ function Z0({
3177
3171
  }, yo = (e, t, r, s) => {
3178
3172
  const l = r ? null : ds(t);
3179
3173
  if (!l) return s;
3180
- const i = os.get(t);
3174
+ const o = os.get(t);
3181
3175
  return /* @__PURE__ */ a(
3182
- gu,
3176
+ xu,
3183
3177
  {
3184
3178
  controller: is,
3185
3179
  cellKey: `${String(e.id)}|${t}`,
3186
3180
  kind: l,
3187
3181
  value: e[t],
3188
3182
  label: et(t),
3189
- choices: i ? xd(i) : void 0,
3183
+ choices: o ? xd(o) : void 0,
3190
3184
  target: l === "m2o" ? gd(Xe, n, t) : null,
3191
3185
  onCommit: (b, x) => ko(e, t, l, b, x),
3192
3186
  children: s
@@ -3201,8 +3195,8 @@ function Z0({
3201
3195
  const t = { ...In }, r = t[e];
3202
3196
  r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", oa(t);
3203
3197
  }, et = (e) => Ie[e] ?? (e.startsWith("__f:") ? We[e] ?? "Formula" : e.includes(".") ? e.split(".").map(je).join(" › ") : e === "id" ? "ID" : je(e)), cs = (e, t) => {
3204
- var s, l, i;
3205
- const r = t.includes(".") ? (i = (l = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(e.id)]) == null ? void 0 : l[t]) == null ? void 0 : i.value : e[t];
3198
+ var s, l, o;
3199
+ const r = t.includes(".") ? (o = (l = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(e.id)]) == null ? void 0 : l[t]) == null ? void 0 : o.value : e[t];
3206
3200
  return typeof r == "string" && /^-?\d+(\.\d+)?$/.test(r.trim()) ? Number(r) : r;
3207
3201
  }, _o = (e, t) => {
3208
3202
  const r = We[t];
@@ -3211,8 +3205,8 @@ function Z0({
3211
3205
  const r = We[t];
3212
3206
  if (r)
3213
3207
  return r.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (s, l) => {
3214
- const i = cs(e, l);
3215
- return i == null || i === "" ? "—" : String(i);
3208
+ const o = cs(e, l);
3209
+ return o == null || o === "" ? "—" : String(o);
3216
3210
  });
3217
3211
  }, Yt = be(
3218
3212
  () => ve.filter((e) => !e.includes(".")).map((e) => ({ field: e, info: Tn(Xe, n, e) })).filter(
@@ -3271,8 +3265,8 @@ function Z0({
3271
3265
  else {
3272
3266
  const s = on.get(r), l = s == null ? void 0 : s.relations.find(
3273
3267
  (b) => b.many_collection === r && b.many_field === t.info.relation.junction_field
3274
- ), i = (l == null ? void 0 : l.one_collection) ?? "";
3275
- e[t.field] = `${t.field}.${Xn(i ? ms.get(i) : void 0)}`;
3268
+ ), o = (l == null ? void 0 : l.one_collection) ?? "";
3269
+ e[t.field] = `${t.field}.${Xn(o ? ms.get(o) : void 0)}`;
3276
3270
  }
3277
3271
  }
3278
3272
  return e;
@@ -3283,12 +3277,12 @@ function Z0({
3283
3277
  e[t.field] = { kind: "o2m" };
3284
3278
  else {
3285
3279
  const r = t.info.relation.many_collection ?? "", s = on.get(r), l = s == null ? void 0 : s.relations.find(
3286
- (i) => i.many_collection === r && i.many_field === t.info.relation.junction_field
3280
+ (o) => o.many_collection === r && o.many_field === t.info.relation.junction_field
3287
3281
  );
3288
3282
  l != null && l.one_collection && (e[t.field] = { kind: "m2m", target: l.one_collection });
3289
3283
  }
3290
3284
  return e;
3291
- }, [Yt, on]), Ya = $l(He, 350), [vn, So] = _((m == null ? void 0 : m.a) === !0), [bs, Co] = _(null), Kn = Kc(n, bs), [Rt, hs] = _(null), { data: jn } = Tc(n), [Mt, ia] = _(() => (D == null ? void 0 : D.riskIds) ?? []), _e = be(() => {
3285
+ }, [Yt, on]), Ya = $l(He, 350), [vn, So] = _((m == null ? void 0 : m.a) === !0), [bs, Co] = _(null), Kn = jc(n, bs), [Rt, hs] = _(null), { data: jn } = Lc(n), [Mt, ia] = _(() => (D == null ? void 0 : D.riskIds) ?? []), _e = be(() => {
3292
3286
  var t;
3293
3287
  const e = Hl(Be);
3294
3288
  for (const r of Nt) {
@@ -3303,13 +3297,13 @@ function Z0({
3303
3297
  else if (s.kind === "state" && s.value.length)
3304
3298
  e.push({ path: ["$state"], op: "_in", value: s.value });
3305
3299
  else if (s.kind === "fulfilment" && Fe) {
3306
- const l = Fe.shipped_field, i = Fe.remaining_field ?? null;
3300
+ const l = Fe.shipped_field, o = Fe.remaining_field ?? null;
3307
3301
  s.value === "none" ? e.push({
3308
3302
  or: [
3309
3303
  { path: [l], op: "_null", value: !0 },
3310
3304
  { path: [l], op: "_lte", value: 0 }
3311
3305
  ]
3312
- }) : s.value === "partial" ? (e.push({ path: [l], op: "_gt", value: 0 }), i && e.push({ path: [i], op: "_gt", value: 0 })) : s.value === "complete" && (e.push({ path: [l], op: "_gt", value: 0 }), i && e.push({ path: [i], op: "_lte", value: 0 }));
3306
+ }) : s.value === "partial" ? (e.push({ path: [l], op: "_gt", value: 0 }), o && e.push({ path: [o], op: "_gt", value: 0 })) : s.value === "complete" && (e.push({ path: [l], op: "_gt", value: 0 }), o && e.push({ path: [o], op: "_lte", value: 0 }));
3313
3307
  } else if (s.kind === "integrations")
3314
3308
  e.push({ path: ["$integrations"], op: "_eq", value: s.value });
3315
3309
  else if (s.kind === "tasks")
@@ -3319,8 +3313,8 @@ function Z0({
3319
3313
  value: s.value === "none" ? !1 : s.value === "overdue" ? "overdue" : !0
3320
3314
  });
3321
3315
  else if (s.kind === "aging" && s.value.replace(":", "") !== "") {
3322
- const [l, i] = s.value.split(":");
3323
- e.push({ path: ["$aging"], op: "_between", value: `${l ?? ""}..${i ?? ""}` });
3316
+ const [l, o] = s.value.split(":");
3317
+ e.push({ path: ["$aging"], op: "_between", value: `${l ?? ""}..${o ?? ""}` });
3324
3318
  } else if (s.kind === "text" && s.value.trim())
3325
3319
  e.push({ path: s.path, op: "_contains", value: s.value.trim() });
3326
3320
  else if (s.kind === "num" && s.value !== "" && !Number.isNaN(Number(s.value)))
@@ -3389,17 +3383,17 @@ function Z0({
3389
3383
  Ye,
3390
3384
  _e,
3391
3385
  Bn
3392
- ]), l = fe.current, i = pd(l, s, e, X);
3393
- if (i.after === void 0 && i.sort === X) return r(e);
3386
+ ]), l = fe.current, o = pd(l, s, e, X);
3387
+ if (o.after === void 0 && o.sort === X) return r(e);
3394
3388
  try {
3395
3389
  const b = await u.request(
3396
3390
  G(`/items/${n}`, {
3397
3391
  ...t,
3398
- ...i.after !== void 0 ? { after: i.after } : { page: e },
3399
- ...i.sort ? { sort: i.sort } : {}
3392
+ ...o.after !== void 0 ? { after: o.after } : { page: e },
3393
+ ...o.sort ? { sort: o.sort } : {}
3400
3394
  })
3401
3395
  );
3402
- return i.after !== void 0 && md(l, s, e, b.next_cursor), b;
3396
+ return o.after !== void 0 && md(l, s, e, b.next_cursor), b;
3403
3397
  } catch (b) {
3404
3398
  if (!fd(b)) throw b;
3405
3399
  return bd(l, s), r(e);
@@ -3452,9 +3446,9 @@ function Z0({
3452
3446
  const e = await u.request(
3453
3447
  G(
3454
3448
  `/items/${n}`,
3455
- Yc({ search: Y, conditions: _e })
3449
+ Jc({ search: Y, conditions: _e })
3456
3450
  )
3457
- ), t = Jc(e, Ye);
3451
+ ), t = Gc(e, Ye);
3458
3452
  if (t == null) {
3459
3453
  ge("This list is too big to count right now", {
3460
3454
  description: "Use Next to keep going, or narrow the list with a filter."
@@ -3479,7 +3473,7 @@ function Z0({
3479
3473
  var l;
3480
3474
  const s = ft[r.key] ?? [];
3481
3475
  return JSON.stringify(
3482
- (l = r.or_paths) != null && l.length ? { or: r.or_paths.map((i) => ({ path: i, op: "_in", value: s })) } : { path: r.path, op: "_in", value: s }
3476
+ (l = r.or_paths) != null && l.length ? { or: r.or_paths.map((o) => ({ path: o, op: "_in", value: s })) } : { path: r.path, op: "_in", value: s }
3483
3477
  );
3484
3478
  })
3485
3479
  ), t = JSON.parse(_e).filter(
@@ -3524,7 +3518,7 @@ function Z0({
3524
3518
  duration_ms: Date.now() - Cs.current
3525
3519
  })
3526
3520
  });
3527
- }, [u, n, Y, ke, ht, ae]), mc(
3521
+ }, [u, n, Y, ke, ht, ae]), fc(
3528
3522
  n ? {
3529
3523
  list: {
3530
3524
  collection: n,
@@ -3541,7 +3535,7 @@ function Z0({
3541
3535
  }
3542
3536
  } : null
3543
3537
  );
3544
- const Lo = fc(), $s = Ii(ht), tr = Ki({
3538
+ const Lo = bc(), $s = Ii(ht), tr = Ki({
3545
3539
  pending: ht,
3546
3540
  request: n ? { method: "GET", url: `/items/${n}` } : null,
3547
3541
  noun: ((I == null ? void 0 : I.display_name) ?? n ?? "").replace(/_/g, " ").toLowerCase() || null,
@@ -3591,11 +3585,11 @@ function Z0({
3591
3585
  Ls.current,
3592
3586
  (z) => z && { ...z, ...P(z) }
3593
3587
  );
3594
- let i = [], b = null, x = null, v = !1;
3588
+ let o = [], b = null, x = null, v = !1;
3595
3589
  const U = async () => {
3596
3590
  b = null;
3597
- const P = i;
3598
- if (i = [], P.length === 0 || v) return;
3591
+ const P = o;
3592
+ if (o = [], P.length === 0 || v) return;
3599
3593
  x || (x = setTimeout(() => {
3600
3594
  x = null, y.invalidateQueries({ queryKey: ["cbv-view-count", n] });
3601
3595
  }, 1500));
@@ -3690,9 +3684,9 @@ function Z0({
3690
3684
  (String(z.item) === "*" || ar.current.has(String(z.item))) && s(J);
3691
3685
  continue;
3692
3686
  }
3693
- i.push(z);
3687
+ o.push(z);
3694
3688
  }
3695
- i.length > 0 && !b && (b = setTimeout(() => void U(), 300));
3689
+ o.length > 0 && !b && (b = setTimeout(() => void U(), 300));
3696
3690
  }, Le = nr.subscribeCollections(
3697
3691
  [n],
3698
3692
  (P) => id(rr, [P], j)
@@ -3729,7 +3723,7 @@ function Z0({
3729
3723
  }), Qe = Ce.map((e) => String(e.id)).join(","), Mo = be(
3730
3724
  () => Ce.map((e) => ({ collection: n, id: e.id })),
3731
3725
  [Ce, n]
3732
- ), Ao = vu(Mo, wt), or = !!(I != null && I.addendums_enabled), { data: ir } = ne({
3726
+ ), Ao = ku(Mo, wt), or = !!(I != null && I.addendums_enabled), { data: ir } = ne({
3733
3727
  queryKey: ["cbv-addendum-summary", n, Qe],
3734
3728
  queryFn: () => u.request(
3735
3729
  he("/addendums/summary", { collection: n, ids: Qe.split(",") })
@@ -3824,20 +3818,20 @@ function Z0({
3824
3818
  staleTime: 3e4,
3825
3819
  retry: !1
3826
3820
  }), $t = (e, t) => {
3827
- var l, i, b;
3821
+ var l, o, b;
3828
3822
  const r = t.includes(".") ? t : Je[t];
3829
3823
  if (!r) return null;
3830
- const s = (b = (i = (l = Te == null ? void 0 : Te.rows) == null ? void 0 : l[String(e)]) == null ? void 0 : i[r]) == null ? void 0 : b.value;
3824
+ const s = (b = (o = (l = Te == null ? void 0 : Te.rows) == null ? void 0 : l[String(e)]) == null ? void 0 : o[r]) == null ? void 0 : b.value;
3831
3825
  return s == null || s === "" ? "—" : s;
3832
3826
  }, As = (e) => {
3833
3827
  var r;
3834
3828
  const t = e.includes(".") ? e : Je[e];
3835
3829
  return t ? ((r = Te == null ? void 0 : Te.targets) == null ? void 0 : r[t]) ?? null : null;
3836
3830
  }, jo = (e, t) => {
3837
- var i, b, x, v;
3831
+ var o, b, x, v;
3838
3832
  const r = t.includes(".") ? t : Je[t];
3839
3833
  if (!r) return null;
3840
- const s = (i = Te == null ? void 0 : Te.targets) == null ? void 0 : i[r], l = ((v = (x = (b = Te == null ? void 0 : Te.rows) == null ? void 0 : b[String(e)]) == null ? void 0 : x[r]) == null ? void 0 : v.ids) ?? [];
3834
+ const s = (o = Te == null ? void 0 : Te.targets) == null ? void 0 : o[r], l = ((v = (x = (b = Te == null ? void 0 : Te.rows) == null ? void 0 : b[String(e)]) == null ? void 0 : x[r]) == null ? void 0 : v.ids) ?? [];
3841
3835
  return !s || Tt(s) || l.length === 0 ? null : { target: s, id: String(l[0]) };
3842
3836
  }, Qt = (e) => e.includes(".") || e in Je;
3843
3837
  ws.current = (e) => Gi({
@@ -3850,7 +3844,7 @@ function Z0({
3850
3844
  isResolvedCol: Qt,
3851
3845
  fetchResolved: Ms,
3852
3846
  fetchRelation: (t, r) => no(u, t, r),
3853
- userCardQuery: (t) => cc(u, t)
3847
+ userCardQuery: (t) => uc(u, t)
3854
3848
  });
3855
3849
  const yn = (e) => {
3856
3850
  if (e.includes(".")) return { kind: "text", path: e.split(".") };
@@ -3878,37 +3872,37 @@ function Z0({
3878
3872
  Ue("__state__", { kind: "state", value: [.../* @__PURE__ */ new Set([...P, j.state_key])] });
3879
3873
  return;
3880
3874
  }
3881
- const i = yn(t);
3882
- if (i) {
3883
- if (i.kind === "in") {
3875
+ const o = yn(t);
3876
+ if (o) {
3877
+ if (o.kind === "in") {
3884
3878
  const Le = ot(Xe, n, t) ? r[t] != null ? [r[t]] : [] : ((U = (v = (x = Te == null ? void 0 : Te.rows) == null ? void 0 : x[String(l)]) == null ? void 0 : v[Je[t]]) == null ? void 0 : U.ids) ?? [];
3885
3879
  if (Le.length === 0) return;
3886
3880
  const P = He[t], z = (P == null ? void 0 : P.kind) === "in" ? P.value : [];
3887
3881
  Ue(t, { kind: "in", value: [.../* @__PURE__ */ new Set([...z, ...Le])] });
3888
3882
  return;
3889
3883
  }
3890
- if (i.kind === "enum") {
3884
+ if (o.kind === "enum") {
3891
3885
  if (r[t] == null || r[t] === "") return;
3892
3886
  const j = He[t], Le = (j == null ? void 0 : j.kind) === "in" ? j.value : [];
3893
3887
  Ue(t, { kind: "in", value: [.../* @__PURE__ */ new Set([...Le, r[t]])] });
3894
3888
  return;
3895
3889
  }
3896
- if (i.kind === "text") {
3890
+ if (o.kind === "text") {
3897
3891
  const j = t.includes(".") || t in Je ? $t(l, t) : String(r[t] ?? "");
3898
- j && j !== "—" && Ue(t, { kind: "text", value: j, path: i.path });
3892
+ j && j !== "—" && Ue(t, { kind: "text", value: j, path: o.path });
3899
3893
  return;
3900
3894
  }
3901
- if (i.kind === "num") {
3895
+ if (o.kind === "num") {
3902
3896
  if (r[t] == null || r[t] === "") return;
3903
3897
  Ue(t, { kind: "num", op: "_eq", value: String(r[t]) });
3904
3898
  return;
3905
3899
  }
3906
- if (i.kind === "bool") {
3900
+ if (o.kind === "bool") {
3907
3901
  if (r[t] == null) return;
3908
3902
  Ue(t, { kind: "bool", value: r[t] ? "true" : "false" });
3909
3903
  return;
3910
3904
  }
3911
- if (i.kind === "date") {
3905
+ if (o.kind === "date") {
3912
3906
  const j = String(r[t] ?? "").slice(0, 10);
3913
3907
  j && Ue(t, { kind: "date", value: `r:${j}..${j}` });
3914
3908
  }
@@ -3918,21 +3912,21 @@ function Z0({
3918
3912
  const r = yn(e);
3919
3913
  return r ? r.kind === "in" ? !!ot(Xe, n, e) && t[e] != null : r.kind === "enum" || r.kind === "num" ? t[e] != null && t[e] !== "" : r.kind === "text" : !1;
3920
3914
  }, Uo = (e) => {
3921
- const { key: t, row: r, cellText: s } = e, l = r.id, i = yn(t);
3922
- if (!i) return;
3915
+ const { key: t, row: r, cellText: s } = e, l = r.id, o = yn(t);
3916
+ if (!o) return;
3923
3917
  let b = null;
3924
3918
  const x = `${t}:${Date.now().toString(36)}`;
3925
- if (i.kind === "in" && ot(Xe, n, t) && r[t] != null)
3919
+ if (o.kind === "in" && ot(Xe, n, t) && r[t] != null)
3926
3920
  b = { id: x, path: [t], op: "_neq", value: r[t], label: s, field: t };
3927
- else if ((i.kind === "enum" || i.kind === "num") && r[t] != null && r[t] !== "")
3921
+ else if ((o.kind === "enum" || o.kind === "num") && r[t] != null && r[t] !== "")
3928
3922
  b = { id: x, path: [t], op: "_neq", value: r[t], label: s, field: t };
3929
- else if (i.kind === "text") {
3923
+ else if (o.kind === "text") {
3930
3924
  const v = t.includes(".") || t in Je ? $t(l, t) : String(r[t] ?? "");
3931
- v && v !== "—" && (b = { id: x, path: i.path, op: "_ncontains", value: v, label: v, field: t });
3925
+ v && v !== "—" && (b = { id: x, path: o.path, op: "_ncontains", value: v, label: v, field: t });
3932
3926
  }
3933
3927
  b && Br((v) => [...v, b]);
3934
3928
  }, zo = (e) => {
3935
- var s, l, i;
3929
+ var s, l, o;
3936
3930
  const t = yn(e);
3937
3931
  if (!t) return null;
3938
3932
  const r = He[e];
@@ -3940,7 +3934,7 @@ function Z0({
3940
3934
  const b = /* @__PURE__ */ new Set(), x = Je[e];
3941
3935
  for (const v of Ce)
3942
3936
  if (x)
3943
- for (const U of ((i = (l = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(v.id)]) == null ? void 0 : l[x]) == null ? void 0 : i.ids) ?? [])
3937
+ for (const U of ((o = (l = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(v.id)]) == null ? void 0 : l[x]) == null ? void 0 : o.ids) ?? [])
3944
3938
  b.add(U);
3945
3939
  else v[e] != null && v[e] !== "" && typeof v[e] != "object" && b.add(v[e]);
3946
3940
  return /* @__PURE__ */ a(
@@ -4033,10 +4027,10 @@ function Z0({
4033
4027
  const t = String(((r = St.get(e)) == null ? void 0 : r.type) ?? "").toLowerCase();
4034
4028
  return t === "timestamp" || t === "datetime" || t === "date";
4035
4029
  }, wn = (e, t, r) => {
4036
- var l, i, b;
4030
+ var l, o, b;
4037
4031
  const s = xe[t];
4038
4032
  if ((s == null ? void 0 : s.type) === "count") {
4039
- const x = t.includes(".") ? t : Je[t], v = r != null && x ? (b = (i = (l = Te == null ? void 0 : Te.rows) == null ? void 0 : l[String(r)]) == null ? void 0 : i[x]) == null ? void 0 : b.ids : void 0, U = cd(e === "—" ? "" : e, v);
4033
+ const x = t.includes(".") ? t : Je[t], v = r != null && x ? (b = (o = (l = Te == null ? void 0 : Te.rows) == null ? void 0 : l[String(r)]) == null ? void 0 : o[x]) == null ? void 0 : b.ids : void 0, U = cd(e === "—" ? "" : e, v);
4040
4034
  return String(U);
4041
4035
  }
4042
4036
  return s && e && e !== "—" ? Ll(e, s) : e;
@@ -4078,11 +4072,11 @@ function Z0({
4078
4072
  e.columns.filter((p) => typeof p != "string" && p.admin_only).map(zl)
4079
4073
  );
4080
4074
  Yo(l);
4081
- const i = e.columns.map(zl).filter((p) => wt || !l.has(p)), b = {};
4075
+ const o = e.columns.map(zl).filter((p) => wt || !l.has(p)), b = {};
4082
4076
  for (const p of e.columns)
4083
4077
  typeof p != "string" && p.formula && p.key.startsWith("__f:") && (b[p.key] = p.formula);
4084
4078
  k(b);
4085
- const x = i.filter((p) => p.includes(".") || St.has(p) || !!b[p]);
4079
+ const x = o.filter((p) => p.includes(".") || St.has(p) || !!b[p]);
4086
4080
  x.length > 0 && rt(x);
4087
4081
  const v = {}, U = {}, j = {};
4088
4082
  let Le = !1;
@@ -4102,18 +4096,18 @@ function Z0({
4102
4096
  On(null), Se([]), ia([]), $e(d ?? ""), rt(h ?? null), Oe({}), k({}), st({}), mt({}), oa(null), T(1);
4103
4097
  }, Hn = () => ({
4104
4098
  // The pressed highlight pills ride along as one `$at_risk` filter entry.
4105
- filters: [...Be, ...[Uc(Mt, ma)].filter((e) => e !== null)],
4099
+ filters: [...Be, ...[zc(Mt, ma)].filter((e) => e !== null)],
4106
4100
  sort: X,
4107
4101
  columns: [
4108
4102
  ...ve.map((e, t) => {
4109
- const r = Ie[e], s = xe[e], l = In[e] ?? (t === 0 && Wa !== null ? "none" : void 0), i = H[e], b = Et[e], x = Ze[e], v = We[e];
4110
- return !r && !s && !l && !(i != null && i.length) && !b && !x && !v && !Ks.has(e) ? e : {
4103
+ const r = Ie[e], s = xe[e], l = In[e] ?? (t === 0 && Wa !== null ? "none" : void 0), o = H[e], b = Et[e], x = Ze[e], v = We[e];
4104
+ return !r && !s && !l && !(o != null && o.length) && !b && !x && !v && !Ks.has(e) ? e : {
4111
4105
  key: e,
4112
4106
  ...v ? { formula: v } : {},
4113
4107
  ...r ? { label: r } : {},
4114
4108
  ...s ? { format: s } : {},
4115
4109
  ...l ? { pin: l } : {},
4116
- ...i != null && i.length ? { tint: i } : {},
4110
+ ...o != null && o.length ? { tint: o } : {},
4117
4111
  ...b ? { width: b } : {},
4118
4112
  ...x ? { agg: x } : {},
4119
4113
  ...Ks.has(e) ? { admin_only: !0 } : {}
@@ -4260,17 +4254,17 @@ function Z0({
4260
4254
  if (!Ma) {
4261
4255
  Qr(!0);
4262
4256
  try {
4263
- const { rows: r, truncated: s } = await Fc(
4257
+ const { rows: r, truncated: s } = await Rc(
4264
4258
  (C, Q) => u.request(
4265
4259
  G(`/items/${n}`, {
4266
4260
  limit: Q,
4267
4261
  offset: C,
4268
4262
  ...Y ? { search: Y } : {},
4269
- sort: Rc(X),
4263
+ sort: Ec(X),
4270
4264
  ..._e ? { conditions: _e } : {}
4271
4265
  })
4272
4266
  )
4273
- ), l = ve, i = [], b = [];
4267
+ ), l = ve, o = [], b = [];
4274
4268
  for (const C of l) {
4275
4269
  if (C.includes(".") || C.startsWith("__") || C in Je) continue;
4276
4270
  const Q = (e = ot(Xe, n, C)) == null ? void 0 : e.one_collection;
@@ -4286,13 +4280,13 @@ function Z0({
4286
4280
  staleTime: 10 * 6e4
4287
4281
  }).catch(() => {
4288
4282
  });
4289
- i.push({
4283
+ o.push({
4290
4284
  column: C,
4291
4285
  template: (Ne == null ? void 0 : Ne.display_template) ?? null,
4292
4286
  labelField: Xn(Ne)
4293
4287
  });
4294
4288
  }
4295
- const x = [.../* @__PURE__ */ new Set([...Vn, ...i.flatMap(Ec)])], v = await Dc(
4289
+ const x = [.../* @__PURE__ */ new Set([...Vn, ...o.flatMap(Dc)])], v = await Pc(
4296
4290
  r.map((C) => String(C.id)),
4297
4291
  x,
4298
4292
  (C, Q) => u.request(
@@ -4311,10 +4305,10 @@ function Z0({
4311
4305
  ].map(String), j = /* @__PURE__ */ new Map();
4312
4306
  await Promise.all(
4313
4307
  U.map(
4314
- (C) => dc(u, C).then((Q) => j.set(C.toUpperCase(), Pc(Q, C))).catch(() => j.set(C.toUpperCase(), C))
4308
+ (C) => cc(u, C).then((Q) => j.set(C.toUpperCase(), Oc(Q, C))).catch(() => j.set(C.toUpperCase(), C))
4315
4309
  )
4316
4310
  );
4317
- const Le = new Map(i.map((C) => [C.column, C])), P = new Set(b), z = (C) => {
4311
+ const Le = new Map(o.map((C) => [C.column, C])), P = new Set(b), z = (C) => {
4318
4312
  const Q = C == null ? "" : String(typeof C == "object" ? JSON.stringify(C) : C);
4319
4313
  return /[",\n]/.test(Q) ? `"${Q.replace(/"/g, '""')}"` : Q;
4320
4314
  }, J = (C, Q) => {
@@ -4333,7 +4327,7 @@ function Z0({
4333
4327
  return Ne && Cn ? Ll(Cn, Ne) : Cn;
4334
4328
  }
4335
4329
  const De = C[Q], xl = Le.get(Q);
4336
- return xl && De != null && De !== "" ? Oc(xl, v[String(C.id)]) || De : P.has(Q) && De != null && De !== "" ? j.get(String(De).toUpperCase()) ?? De : De != null && De !== "" && ((Ne == null ? void 0 : Ne.type) === "number" || mr(Q)) ? Wi(De) : De != null && De !== "" && ((Ne == null ? void 0 : Ne.type) === "datetime" || Vo(Q)) ? Vi(De) : Q === "id" ? Tr(I, C) ?? De : Ne && De != null ? Gn(String(De), Ne) : De;
4330
+ return xl && De != null && De !== "" ? Mc(xl, v[String(C.id)]) || De : P.has(Q) && De != null && De !== "" ? j.get(String(De).toUpperCase()) ?? De : De != null && De !== "" && ((Ne == null ? void 0 : Ne.type) === "number" || mr(Q)) ? Wi(De) : De != null && De !== "" && ((Ne == null ? void 0 : Ne.type) === "datetime" || Vo(Q)) ? Vi(De) : Q === "id" ? Tr(I, C) ?? De : Ne && De != null ? Gn(String(De), Ne) : De;
4337
4331
  }, p = Jt.filter((C) => C.kind !== "actions"), gt = new Set(
4338
4332
  p.filter((C) => C.kind !== "data" && C.kind !== "formula").map((C) => C.kind)
4339
4333
  ), nt = r.map((C) => String(C.id)), It = await Hi(nt, gt, {
@@ -4388,7 +4382,7 @@ function Z0({
4388
4382
  `)], { type: "text/csv;charset=utf-8" }), at = URL.createObjectURL(A), V = document.createElement("a");
4389
4383
  V.href = at;
4390
4384
  const ye = Pe.export_filename, se = ((t = dt.find((C) => C.id === Ht)) == null ? void 0 : t.name) ?? "all";
4391
- V.download = ye ? `${ye.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g, se).replace(/\{\{\s*date\s*\}\}/g, Mc()).replace(/[^A-Za-z0-9 ._-]/g, "")}.csv` : `${n}.csv`, V.click(), setTimeout(() => URL.revokeObjectURL(at), 1e4), s && ge.warning(`Exported the first ${r.length.toLocaleString()} rows`, {
4385
+ V.download = ye ? `${ye.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g, se).replace(/\{\{\s*date\s*\}\}/g, Ac()).replace(/[^A-Za-z0-9 ._-]/g, "")}.csv` : `${n}.csv`, V.click(), setTimeout(() => URL.revokeObjectURL(at), 1e4), s && ge.warning(`Exported the first ${r.length.toLocaleString()} rows`, {
4392
4386
  description: `${Re.toLocaleString()} match — narrow the filter to export the rest.`
4393
4387
  });
4394
4388
  } catch (r) {
@@ -4432,8 +4426,8 @@ function Z0({
4432
4426
  ...((b = r.currentTarget.parentElement) == null ? void 0 : b.querySelectorAll(
4433
4427
  ":scope > [data-row-open]"
4434
4428
  )) ?? []
4435
- ], l = Qc(s.length, s.indexOf(r.currentTarget), r.key), i = l === null ? null : s[l];
4436
- i && (i.focus(), (x = i.scrollIntoView) == null || x.call(i, { block: "nearest" }));
4429
+ ], l = Uc(s.length, s.indexOf(r.currentTarget), r.key), o = l === null ? null : s[l];
4430
+ o && (o.focus(), (x = o.scrollIntoView) == null || x.call(o, { block: "nearest" }));
4437
4431
  }
4438
4432
  };
4439
4433
  }, dn = (e) => {
@@ -4525,16 +4519,16 @@ function Z0({
4525
4519
  if (!ce) return Ce.map((s) => ({ kind: "row", row: s }));
4526
4520
  const e = /* @__PURE__ */ new Map();
4527
4521
  for (const s of Ce) {
4528
- const l = mi(s), i = e.get(l) ?? [];
4529
- i.push(s), e.set(l, i);
4522
+ const l = mi(s), o = e.get(l) ?? [];
4523
+ o.push(s), e.set(l, o);
4530
4524
  }
4531
4525
  const t = [...e.keys()].sort((s, l) => s === "(empty)" ? 1 : l === "(empty)" ? -1 : s.localeCompare(l, void 0, { numeric: !0 })), r = [];
4532
4526
  for (const s of t) {
4533
4527
  const l = e.get(s) ?? [];
4534
- if (r.push({ kind: "header", gkey: s, label: s, count: l.length }), !En.has(s)) for (const i of l) r.push({ kind: "row", row: i });
4528
+ if (r.push({ kind: "header", gkey: s, label: s, count: l.length }), !En.has(s)) for (const o of l) r.push({ kind: "row", row: o });
4535
4529
  }
4536
4530
  return r;
4537
- })(), [fi, bi] = _(null), hi = Bc(el, fi), xr = Jt.filter((e) => Ft(e.key) === "left").map((e) => e.key), tl = Jt.filter((e) => Ft(e.key) === "right").map((e) => e.key), vr = pe(/* @__PURE__ */ new Map()), [Jn, gi] = _({});
4531
+ })(), [fi, bi] = _(null), hi = Qc(el, fi), xr = Jt.filter((e) => Ft(e.key) === "left").map((e) => e.key), tl = Jt.filter((e) => Ft(e.key) === "right").map((e) => e.key), vr = pe(/* @__PURE__ */ new Map()), [Jn, gi] = _({});
4538
4532
  Oi(() => {
4539
4533
  const e = {};
4540
4534
  for (const [r, s] of vr.current)
@@ -4582,7 +4576,7 @@ function Z0({
4582
4576
  const s = yr.current;
4583
4577
  if (!s) return;
4584
4578
  const l = Math.max(60, Math.min(640, s.startW + (r.clientX - s.startX)));
4585
- f((i) => ({ ...i, [s.key]: l }));
4579
+ f((o) => ({ ...o, [s.key]: l }));
4586
4580
  }, t = () => {
4587
4581
  yr.current = null, document.body.style.cursor = "";
4588
4582
  };
@@ -4657,7 +4651,7 @@ function Z0({
4657
4651
  if (s != null && s.label) return s.label;
4658
4652
  }
4659
4653
  }, _r = (() => {
4660
- var s, l, i, b;
4654
+ var s, l, o, b;
4661
4655
  if (ae) return null;
4662
4656
  let e = !1;
4663
4657
  const t = (x, v, U, j = !1) => {
@@ -4713,7 +4707,7 @@ function Z0({
4713
4707
  const P = (l = Ml.find((z) => z.value === v.value)) == null ? void 0 : l.label;
4714
4708
  P && r.push({ kind: "phrase", text: P.toLowerCase() });
4715
4709
  } else if (v.kind === "integrations") {
4716
- const P = (i = Al.find((z) => z.value === v.value)) == null ? void 0 : i.label;
4710
+ const P = (o = Al.find((z) => z.value === v.value)) == null ? void 0 : o.label;
4717
4711
  P && r.push({ kind: "is", field: U, values: [P.toLowerCase()] });
4718
4712
  } else if (v.kind === "tasks")
4719
4713
  r.push({
@@ -4834,8 +4828,8 @@ function Z0({
4834
4828
  [data-cbv] .cbv-overlay { animation: none; opacity: 1; }
4835
4829
  }
4836
4830
  ` }),
4837
- /* @__PURE__ */ a(Lu, {}),
4838
- /* @__PURE__ */ a($c, {}),
4831
+ /* @__PURE__ */ a(Fu, {}),
4832
+ /* @__PURE__ */ a(qc, {}),
4839
4833
  ie && Xl(
4840
4834
  /* @__PURE__ */ c(
4841
4835
  "div",
@@ -5025,8 +5019,8 @@ function Z0({
5025
5019
  e.id
5026
5020
  );
5027
5021
  }),
5028
- /* @__PURE__ */ a(Nu, { className: "h-8" }),
5029
- /* @__PURE__ */ a(au, {}),
5022
+ /* @__PURE__ */ a(Su, { className: "h-8" }),
5023
+ /* @__PURE__ */ a(ru, {}),
5030
5024
  sr > 0 && /* @__PURE__ */ c(
5031
5025
  "button",
5032
5026
  {
@@ -5056,9 +5050,9 @@ function Z0({
5056
5050
  children: /* @__PURE__ */ a(Sr, { className: `h-4 w-4 ${ht ? "animate-spin" : ""}` })
5057
5051
  }
5058
5052
  ),
5059
- /* @__PURE__ */ a(bu, { listKey: `cbv:${n}`, getState: Xo }),
5053
+ /* @__PURE__ */ a(hu, { listKey: `cbv:${n}`, getState: Xo }),
5060
5054
  wt && Pe.copy_as !== !1 && /* @__PURE__ */ a(
5061
- qc,
5055
+ Tc,
5062
5056
  {
5063
5057
  collection: n,
5064
5058
  list: {
@@ -5072,7 +5066,7 @@ function Z0({
5072
5066
  }
5073
5067
  ),
5074
5068
  Kn.parent && /* @__PURE__ */ a(
5075
- jc,
5069
+ Bc,
5076
5070
  {
5077
5071
  parent: Kn.parent,
5078
5072
  value: bs,
@@ -5291,8 +5285,8 @@ function Z0({
5291
5285
  s.preventDefault();
5292
5286
  const l = Kt.current;
5293
5287
  if (Kt.current = null, l == null || l === t) return;
5294
- const i = [...ve], [b] = i.splice(l, 1);
5295
- i.splice(t, 0, b), rt(i);
5288
+ const o = [...ve], [b] = o.splice(l, 1);
5289
+ o.splice(t, 0, b), rt(o);
5296
5290
  },
5297
5291
  className: "group flex items-center gap-1.5 rounded px-1.5 py-1 hover:bg-slate-50 dark:hover:bg-slate-800",
5298
5292
  children: [
@@ -5311,8 +5305,8 @@ function Z0({
5311
5305
  value: Ie[e] ?? "",
5312
5306
  placeholder: e.includes(".") ? e.split(".").map(je).join(" › ") : je(e),
5313
5307
  onChange: (s) => Oe((l) => {
5314
- const i = { ...l };
5315
- return s.target.value ? i[e] = s.target.value : delete i[e], i;
5308
+ const o = { ...l };
5309
+ return s.target.value ? o[e] = s.target.value : delete o[e], o;
5316
5310
  }),
5317
5311
  onKeyDown: (s) => {
5318
5312
  (s.key === "Enter" || s.key === "Escape") && ee(null);
@@ -5372,15 +5366,15 @@ function Z0({
5372
5366
  }
5373
5367
  ),
5374
5368
  oe === e && /* @__PURE__ */ c("div", { className: "mb-1 ml-5 mr-1 rounded-md border border-slate-100 bg-slate-50 p-1.5 dark:border-slate-800 dark:bg-slate-800/60", children: [
5375
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: Du.map((s) => {
5369
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: Pu.map((s) => {
5376
5370
  const l = JSON.stringify(xe[e] ?? null) === JSON.stringify(s.cfg);
5377
5371
  return /* @__PURE__ */ a(
5378
5372
  "button",
5379
5373
  {
5380
5374
  type: "button",
5381
5375
  onClick: () => {
5382
- st((i) => {
5383
- const b = { ...i };
5376
+ st((o) => {
5377
+ const b = { ...o };
5384
5378
  return s.cfg ? b[e] = s.cfg : delete b[e], b;
5385
5379
  }), re(null);
5386
5380
  },
@@ -5398,8 +5392,8 @@ function Z0({
5398
5392
  onKeyDown: (s) => {
5399
5393
  if (s.key === "Enter") {
5400
5394
  const l = s.target.value.trim();
5401
- l && st((i) => ({
5402
- ...i,
5395
+ l && st((o) => ({
5396
+ ...o,
5403
5397
  [e]: { type: "datetime", template: l }
5404
5398
  })), re(null);
5405
5399
  }
@@ -5420,10 +5414,10 @@ function Z0({
5420
5414
  {
5421
5415
  ariaLabel: "Rule operator",
5422
5416
  value: s.op,
5423
- onChange: (i) => te((b) => ({
5417
+ onChange: (o) => te((b) => ({
5424
5418
  ...b,
5425
5419
  [e]: (b[e] ?? []).map(
5426
- (x, v) => v === l ? { ...x, op: i } : x
5420
+ (x, v) => v === l ? { ...x, op: o } : x
5427
5421
  )
5428
5422
  })),
5429
5423
  options: [
@@ -5441,46 +5435,46 @@ function Z0({
5441
5435
  "input",
5442
5436
  {
5443
5437
  value: s.value ?? "",
5444
- onChange: (i) => te((b) => ({
5438
+ onChange: (o) => te((b) => ({
5445
5439
  ...b,
5446
5440
  [e]: (b[e] ?? []).map(
5447
- (x, v) => v === l ? { ...x, value: i.target.value } : x
5441
+ (x, v) => v === l ? { ...x, value: o.target.value } : x
5448
5442
  )
5449
5443
  })),
5450
5444
  placeholder: "value",
5451
5445
  className: "h-5 w-16 rounded border border-slate-200 bg-white px-1 text-[10.5px] dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100"
5452
5446
  }
5453
5447
  ),
5454
- ["red", "amber", "green", "blue"].map((i) => /* @__PURE__ */ a(
5448
+ ["red", "amber", "green", "blue"].map((o) => /* @__PURE__ */ a(
5455
5449
  "button",
5456
5450
  {
5457
5451
  type: "button",
5458
- "aria-label": i,
5452
+ "aria-label": o,
5459
5453
  onClick: () => te((b) => ({
5460
5454
  ...b,
5461
5455
  [e]: (b[e] ?? []).map(
5462
- (x, v) => v === l ? { ...x, color: i } : x
5456
+ (x, v) => v === l ? { ...x, color: o } : x
5463
5457
  )
5464
5458
  })),
5465
5459
  className: Xt(
5466
5460
  "h-3.5 w-3.5 rounded-full border",
5467
- i === "red" && "bg-red-500",
5468
- i === "amber" && "bg-amber-400",
5469
- i === "green" && "bg-emerald-500",
5470
- i === "blue" && "bg-sky-500",
5471
- s.color === i ? "border-slate-700 ring-1 ring-slate-400 dark:border-white" : "border-transparent opacity-50"
5461
+ o === "red" && "bg-red-500",
5462
+ o === "amber" && "bg-amber-400",
5463
+ o === "green" && "bg-emerald-500",
5464
+ o === "blue" && "bg-sky-500",
5465
+ s.color === o ? "border-slate-700 ring-1 ring-slate-400 dark:border-white" : "border-transparent opacity-50"
5472
5466
  )
5473
5467
  },
5474
- i
5468
+ o
5475
5469
  )),
5476
5470
  /* @__PURE__ */ a(
5477
5471
  "button",
5478
5472
  {
5479
5473
  type: "button",
5480
5474
  "aria-label": "Remove rule",
5481
- onClick: () => te((i) => ({
5482
- ...i,
5483
- [e]: (i[e] ?? []).filter((b, x) => x !== l)
5475
+ onClick: () => te((o) => ({
5476
+ ...o,
5477
+ [e]: (o[e] ?? []).filter((b, x) => x !== l)
5484
5478
  })),
5485
5479
  className: "ml-auto text-slate-300 hover:text-slate-500",
5486
5480
  children: "✕"
@@ -5537,7 +5531,7 @@ function Z0({
5537
5531
  /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
5538
5532
  /* @__PURE__ */ a("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Formula column" }),
5539
5533
  /* @__PURE__ */ a(
5540
- Ac,
5534
+ Ic,
5541
5535
  {
5542
5536
  fields: Pt.map((e) => e.field),
5543
5537
  onAdd: (e, t) => {
@@ -5640,8 +5634,8 @@ function Z0({
5640
5634
  var s;
5641
5635
  gn(!1);
5642
5636
  const e = ve, t = e.map((l) => et(l)).join(" "), r = Ce.map(
5643
- (l) => e.map((i) => {
5644
- const b = Qt(i) ? wn($t(l.id, i) ?? "", i, l.id) : wn(String(l[i] ?? ""), i, l.id);
5637
+ (l) => e.map((o) => {
5638
+ const b = Qt(o) ? wn($t(l.id, o) ?? "", o, l.id) : wn(String(l[o] ?? ""), o, l.id);
5645
5639
  return String(b ?? "").replace(/[\t\n]/g, " ");
5646
5640
  }).join(" ")
5647
5641
  ).join(`
@@ -5864,7 +5858,7 @@ ${r}`).then(() => {
5864
5858
  )
5865
5859
  ] }),
5866
5860
  Ba && /* @__PURE__ */ a(
5867
- uu,
5861
+ pu,
5868
5862
  {
5869
5863
  collection: n,
5870
5864
  layoutSlug: Ba.slug,
@@ -5899,7 +5893,7 @@ ${r}`).then(() => {
5899
5893
  }
5900
5894
  )
5901
5895
  ] }),
5902
- la && xn.editing && /* @__PURE__ */ a(wu, { ctl: xn, collection: n }),
5896
+ la && xn.editing && /* @__PURE__ */ a(_u, { ctl: xn, collection: n }),
5903
5897
  Nt.length > 0 && !(la && xn.editing) && /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900", children: [
5904
5898
  Nt.map((e) => /* @__PURE__ */ a(
5905
5899
  Wu,
@@ -6046,7 +6040,7 @@ ${r}`).then(() => {
6046
6040
  }
6047
6041
  ),
6048
6042
  wt && /* @__PURE__ */ a(
6049
- Vc,
6043
+ Hc,
6050
6044
  {
6051
6045
  name: e.name,
6052
6046
  isDefault: !!e.is_default,
@@ -6132,7 +6126,7 @@ ${r}`).then(() => {
6132
6126
  ] }),
6133
6127
  tt != null && /* @__PURE__ */ c("div", { className: "mx-4 mt-3 flex flex-wrap items-center gap-3 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700 dark:border-red-900/40 dark:bg-red-900/10 dark:text-red-400", children: [
6134
6128
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: Pd(tt) === 503 ? Od(tt) : Zt(tt, "Failed to load records") }),
6135
- (tt == null ? void 0 : tt.status) === 403 && !zc(tt) && /* @__PURE__ */ a(
6129
+ (tt == null ? void 0 : tt.status) === 403 && !Wc(tt) && /* @__PURE__ */ a(
6136
6130
  "button",
6137
6131
  {
6138
6132
  type: "button",
@@ -6149,7 +6143,7 @@ ${r}`).then(() => {
6149
6143
  {
6150
6144
  type: "button",
6151
6145
  onClick: () => {
6152
- const t = Wc(e, { filters: Be, sort: X, colFilters: He });
6146
+ const t = Vc(e, { filters: Be, sort: X, colFilters: He });
6153
6147
  Se(t.filters), $e(t.sort), zt(t.colFilters), T(1);
6154
6148
  },
6155
6149
  title: `Remove the filter or sort on "${e}" — this list cannot filter on it`,
@@ -6174,7 +6168,7 @@ ${r}`).then(() => {
6174
6168
  )
6175
6169
  ] }),
6176
6170
  Rt === "tree" && jn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900", children: /* @__PURE__ */ a(
6177
- Lc,
6171
+ Fc,
6178
6172
  {
6179
6173
  collection: n,
6180
6174
  config: jn,
@@ -6187,7 +6181,7 @@ ${r}`).then(() => {
6187
6181
  }
6188
6182
  ) }) }) : Rt && (K != null && K.some((e) => e.key === Rt)) ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": Rt, children: (gl = K.find((e) => e.key === Rt)) == null ? void 0 : gl.render() }) : null,
6189
6183
  da && kn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a(
6190
- xu,
6184
+ vu,
6191
6185
  {
6192
6186
  collection: n,
6193
6187
  latField: kn.latField,
@@ -6224,7 +6218,7 @@ ${r}`).then(() => {
6224
6218
  /* @__PURE__ */ a(Sr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
6225
6219
  $s != null ? `${tr.text ?? "Still working"} — ${$s}s` : "Loading…"
6226
6220
  ] }) }) }),
6227
- ca && tr.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(Tu, { reason: tr, variant: "pill" }) }),
6221
+ ca && tr.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(Lu, { reason: tr, variant: "pill" }) }),
6228
6222
  /* @__PURE__ */ a(
6229
6223
  "div",
6230
6224
  {
@@ -6294,7 +6288,7 @@ ${r}`).then(() => {
6294
6288
  t
6295
6289
  );
6296
6290
  }
6297
- const i = St.get(t), b = !!(i != null && i.computed_formula && !i.computed_store && !i.sql_filterable), x = Qt(t) || b, v = !x && (X === t || X === `-${t}` || X.replace(/^-/, "").startsWith(`${t}.`)), U = X.startsWith("-") && v, j = St.get(t), Le = et(t);
6291
+ const o = St.get(t), b = !!(o != null && o.computed_formula && !o.computed_store && !o.sql_filterable), x = Qt(t) || b, v = !x && (X === t || X === `-${t}` || X.replace(/^-/, "").startsWith(`${t}.`)), U = X.startsWith("-") && v, j = St.get(t), Le = et(t);
6298
6292
  return /* @__PURE__ */ c(
6299
6293
  "th",
6300
6294
  {
@@ -6347,24 +6341,24 @@ ${r}`).then(() => {
6347
6341
  {
6348
6342
  block: !0,
6349
6343
  label: "All",
6350
- options: ((Ct == null ? void 0 : Ct.states) ?? []).map((i) => ({
6351
- value: i.key,
6352
- label: i.label ?? i.key
6344
+ options: ((Ct == null ? void 0 : Ct.states) ?? []).map((o) => ({
6345
+ value: o.key,
6346
+ label: o.label ?? o.key
6353
6347
  })),
6354
6348
  selected: ((l = He.__state__) == null ? void 0 : l.kind) === "state" ? He.__state__.value : [],
6355
- onChange: (i) => Ue(
6349
+ onChange: (o) => Ue(
6356
6350
  "__state__",
6357
- i.length ? { kind: "state", value: i.map(String) } : null
6351
+ o.length ? { kind: "state", value: o.map(String) } : null
6358
6352
  )
6359
6353
  }
6360
6354
  ) }, t);
6361
6355
  if (e.kind === "fulfilment") {
6362
- const i = He.__fulfilment__;
6356
+ const o = He.__fulfilment__;
6363
6357
  return /* @__PURE__ */ a("th", { style: Me(t), className: s, children: /* @__PURE__ */ a(
6364
6358
  qn,
6365
6359
  {
6366
6360
  ariaLabel: "Shipped filter",
6367
- value: (i == null ? void 0 : i.kind) === "fulfilment" ? i.value : "",
6361
+ value: (o == null ? void 0 : o.kind) === "fulfilment" ? o.value : "",
6368
6362
  options: [
6369
6363
  { value: "", label: "All" },
6370
6364
  ...Ml.filter(
@@ -6382,7 +6376,7 @@ ${r}`).then(() => {
6382
6376
  ) }, t);
6383
6377
  }
6384
6378
  if (e.kind === "aging") {
6385
- const i = He.__aging__;
6379
+ const o = He.__aging__;
6386
6380
  return /* @__PURE__ */ a(
6387
6381
  "th",
6388
6382
  {
@@ -6390,7 +6384,7 @@ ${r}`).then(() => {
6390
6384
  className: s,
6391
6385
  "data-aging-filter": !0,
6392
6386
  children: /* @__PURE__ */ a(
6393
- nu,
6387
+ au,
6394
6388
  {
6395
6389
  layout: "cell",
6396
6390
  def: {
@@ -6399,7 +6393,7 @@ ${r}`).then(() => {
6399
6393
  type: "range",
6400
6394
  range_unit: "h"
6401
6395
  },
6402
- value: (i == null ? void 0 : i.kind) === "aging" ? i.value : "",
6396
+ value: (o == null ? void 0 : o.kind) === "aging" ? o.value : "",
6403
6397
  onChange: (b) => {
6404
6398
  const x = typeof b == "string" ? b : "";
6405
6399
  Ue(
@@ -6414,7 +6408,7 @@ ${r}`).then(() => {
6414
6408
  );
6415
6409
  }
6416
6410
  if (e.kind === "integrations") {
6417
- const i = He.__integrations__, b = (i == null ? void 0 : i.kind) === "integrations" ? i.value : "";
6411
+ const o = He.__integrations__, b = (o == null ? void 0 : o.kind) === "integrations" ? o.value : "";
6418
6412
  return /* @__PURE__ */ a(
6419
6413
  "th",
6420
6414
  {
@@ -6444,7 +6438,7 @@ ${r}`).then(() => {
6444
6438
  );
6445
6439
  }
6446
6440
  if (e.kind === "tasks") {
6447
- const i = He.__tasks__, b = (i == null ? void 0 : i.kind) === "tasks" ? i.value : "";
6441
+ const o = He.__tasks__, b = (o == null ? void 0 : o.kind) === "tasks" ? o.value : "";
6448
6442
  return /* @__PURE__ */ a(
6449
6443
  "th",
6450
6444
  {
@@ -6487,7 +6481,7 @@ ${r}`).then(() => {
6487
6481
  // #3229 — one placeholder per real column, real row height (h-8, or the
6488
6482
  // table's comfortable h-11), real pins/widths: nothing moves on arrival.
6489
6483
  /* @__PURE__ */ a(
6490
- qu,
6484
+ Tu,
6491
6485
  {
6492
6486
  columns: pi,
6493
6487
  rows: Math.min(Ye, 20),
@@ -6506,11 +6500,11 @@ ${r}`).then(() => {
6506
6500
  children: (() => {
6507
6501
  const e = Be.length === 0 && Object.keys(He).length === 0 && !Object.values(ft).some((s) => s.length > 0) && !Y, t = I == null ? void 0 : I.empty_state;
6508
6502
  if (e && t && (t.title || t.message)) {
6509
- const s = t.cta_url ?? "", l = s.startsWith("/"), i = /^https?:\/\//.test(s);
6503
+ const s = t.cta_url ?? "", l = s.startsWith("/"), o = /^https?:\/\//.test(s);
6510
6504
  return /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-center", children: [
6511
6505
  /* @__PURE__ */ a("p", { className: "text-[14px] font-semibold text-slate-700 dark:text-slate-200", children: t.title || "Nothing here yet" }),
6512
6506
  t.message && /* @__PURE__ */ a("p", { className: "max-w-[52ch] text-[12.5px] leading-relaxed text-slate-500 dark:text-muted-foreground", children: t.message }),
6513
- t.cta_label && (l || i) && /* @__PURE__ */ a(
6507
+ t.cta_label && (l || o) && /* @__PURE__ */ a(
6514
6508
  "a",
6515
6509
  {
6516
6510
  href: s,
@@ -6561,7 +6555,7 @@ ${r}`).then(() => {
6561
6555
  }
6562
6556
  ),
6563
6557
  /* @__PURE__ */ a(
6564
- Ic,
6558
+ Kc,
6565
6559
  {
6566
6560
  term: Y,
6567
6561
  collection: n,
@@ -6617,17 +6611,17 @@ ${r}`).then(() => {
6617
6611
  },
6618
6612
  `__group__${e.gkey}`
6619
6613
  );
6620
- const s = e.row, l = s.id, i = rn.includes(l), b = (z = Ee == null ? void 0 : Ee.instances) == null ? void 0 : z[String(l)], x = Oo[String(l)], v = cr == null ? void 0 : cr[String(l)], U = Do.get(String(l)) ?? null, j = Ao(n, l), Le = !i && x ? Xd(x.color) : void 0, P = i ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Le ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6614
+ const s = e.row, l = s.id, o = rn.includes(l), b = (z = Ee == null ? void 0 : Ee.instances) == null ? void 0 : z[String(l)], x = Oo[String(l)], v = cr == null ? void 0 : cr[String(l)], U = Do.get(String(l)) ?? null, j = Ao(n, l), Le = !o && x ? Xd(x.color) : void 0, P = o ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Le ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6621
6615
  return /* @__PURE__ */ c(
6622
6616
  "tr",
6623
6617
  {
6624
6618
  ...Lo({ collection: n, id: String(l) }),
6625
6619
  ...li(l),
6626
6620
  "data-row-key": String(l),
6627
- title: At.titleFor(String(l)) ?? (U && !U.is_mine ? Ld(U) : void 0) ?? (x ? `At risk — ${x.rule}` : void 0) ?? (j ? yu : void 0),
6621
+ title: At.titleFor(String(l)) ?? (U && !U.is_mine ? Ld(U) : void 0) ?? (x ? `At risk — ${x.rule}` : void 0) ?? (j ? wu : void 0),
6628
6622
  "data-picker-excluded": j ? "" : void 0,
6629
6623
  style: r,
6630
- className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${i ? "bg-nvr-cyan/[0.08]" : Le ?? ""} ${j ? ku : ""}`,
6624
+ className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${o ? "bg-nvr-cyan/[0.08]" : Le ?? ""} ${j ? yu : ""}`,
6631
6625
  children: [
6632
6626
  Ot && /* @__PURE__ */ a(
6633
6627
  "td",
@@ -6636,25 +6630,25 @@ ${r}`).then(() => {
6636
6630
  onClick: (J) => J.stopPropagation(),
6637
6631
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
6638
6632
  U || At.isNew(String(l)) ? /* @__PURE__ */ a(
6639
- fu,
6633
+ bu,
6640
6634
  {
6641
6635
  lock: U,
6642
6636
  isNew: At.isNew(String(l)),
6643
6637
  dataAttr: "data-cbv-live-mark"
6644
6638
  }
6645
6639
  ) : Ts[El(n, String(l))] ? /* @__PURE__ */ a(
6646
- $u,
6640
+ qu,
6647
6641
  {
6648
6642
  viewers: Ts[El(n, String(l))],
6649
6643
  dataAttr: "data-cbv-presence"
6650
6644
  }
6651
6645
  ) : /* @__PURE__ */ a(Ql, { change: v, dataAttr: "data-cbv-unseen" }),
6652
- /* @__PURE__ */ a(_c, { rowId: l }),
6646
+ /* @__PURE__ */ a(Nc, { rowId: l }),
6653
6647
  _t && /* @__PURE__ */ a(
6654
6648
  "input",
6655
6649
  {
6656
6650
  type: "checkbox",
6657
- checked: i,
6651
+ checked: o,
6658
6652
  onChange: () => ii(l),
6659
6653
  "aria-label": `Select ${Vd(I, s, l, n) || "this record"}`
6660
6654
  }
@@ -6732,9 +6726,9 @@ ${r}`).then(() => {
6732
6726
  "td",
6733
6727
  {
6734
6728
  style: Me(p),
6735
- "data-tip": V != null && (A != null && A.entered_at) ? `In ${A.state_label ?? "this state"} since ${pc(A.entered_at)}` : void 0,
6729
+ "data-tip": V != null && (A != null && A.entered_at) ? `In ${A.state_label ?? "this state"} since ${mc(A.entered_at)}` : void 0,
6736
6730
  className: `whitespace-nowrap px-3 py-1.5 text-[12px] tabular-nums text-slate-600 dark:text-slate-300 ${ct(p, "z-[1]", P)}`,
6737
- children: V == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : uc(V)
6731
+ children: V == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : pc(V)
6738
6732
  },
6739
6733
  p
6740
6734
  );
@@ -6776,11 +6770,11 @@ ${r}`).then(() => {
6776
6770
  className: `whitespace-nowrap px-3 py-1.5 ${ct(p, "z-[1]", P)}`,
6777
6771
  onClick: (A) => A.stopPropagation(),
6778
6772
  children: /* @__PURE__ */ a(
6779
- ru,
6773
+ su,
6780
6774
  {
6781
6775
  collection: n,
6782
6776
  itemId: String(l),
6783
- figures: su(
6777
+ figures: lu(
6784
6778
  s[Fe.shipped_field],
6785
6779
  s[Fe.requested_field]
6786
6780
  ),
@@ -6796,7 +6790,7 @@ ${r}`).then(() => {
6796
6790
  {
6797
6791
  style: Me(p),
6798
6792
  className: `whitespace-nowrap px-3 py-1.5 ${ct(p, "z-[1]", P)}`,
6799
- children: /* @__PURE__ */ a(du, { rows: ur == null ? void 0 : ur[String(l)] })
6793
+ children: /* @__PURE__ */ a(cu, { rows: ur == null ? void 0 : ur[String(l)] })
6800
6794
  },
6801
6795
  p
6802
6796
  );
@@ -7023,9 +7017,9 @@ ${r}`).then(() => {
7023
7017
  )
7024
7018
  }
7025
7019
  ),
7026
- /* @__PURE__ */ a(lu, { scrollerRef: Vr }),
7020
+ /* @__PURE__ */ a(ou, { scrollerRef: Vr }),
7027
7021
  /* @__PURE__ */ a(
7028
- Cu,
7022
+ $u,
7029
7023
  {
7030
7024
  collections: n ? [n] : [],
7031
7025
  selectedIds: Mt,
@@ -7142,7 +7136,7 @@ ${r}`).then(() => {
7142
7136
  }
7143
7137
  ),
7144
7138
  lt != null && lt.length ? /* @__PURE__ */ a(
7145
- Su,
7139
+ Cu,
7146
7140
  {
7147
7141
  collection: lt[0].collection,
7148
7142
  itemId: lt[0].itemId,
@@ -7154,7 +7148,7 @@ ${r}`).then(() => {
7154
7148
  }
7155
7149
  ) : null,
7156
7150
  Fn && /* @__PURE__ */ a(
7157
- Fu,
7151
+ Ru,
7158
7152
  {
7159
7153
  collection: n,
7160
7154
  item: Fn,
@@ -7200,12 +7194,12 @@ ${r}`).then(() => {
7200
7194
  }
7201
7195
  );
7202
7196
  }
7203
- function rp(n, o, h, d, w) {
7204
- const N = Ar(o, n, h);
7197
+ function rp(n, i, h, d, w) {
7198
+ const N = Ar(i, n, h);
7205
7199
  return N != null && N.one_collection ? /* @__PURE__ */ a(Ir, { relatedCollection: N.one_collection, id: d }) : Xi(d, w);
7206
7200
  }
7207
7201
  export {
7208
- Z0 as CollectionBrowserView,
7202
+ em as CollectionBrowserView,
7209
7203
  Da as MultiPick,
7210
7204
  Bu as RowActionsMenu,
7211
7205
  Wl as TINT_TEXT,
@@ -7213,6 +7207,6 @@ export {
7213
7207
  qa as invalidateCbvRowQueries,
7214
7208
  ju as roleMayDelete,
7215
7209
  Ku as roleMayUpdate,
7216
- Ou as templateRelationPaths,
7210
+ sc as templateRelationPaths,
7217
7211
  Na as tintFor
7218
7212
  };