@nivaro/react 0.3.49 → 0.3.51

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 (46) hide show
  1. package/dist/components/InlineGridField.js +166 -105
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +38 -4
  5. package/dist/shared/components/ItemEditForm.js +5258 -5034
  6. package/dist/shared/components/QueryTable.js +489 -347
  7. package/dist/shared/components/ReportView.js +105 -99
  8. package/dist/shared/components/alerts/AlertManagerView.js +327 -301
  9. package/dist/shared/components/item-edit/CatalogPickerField.js +1230 -1175
  10. package/dist/shared/components/item-edit/CloneDialog.js +192 -142
  11. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
  12. package/dist/shared/components/item-edit/FieldRenderer.js +249 -244
  13. package/dist/shared/components/item-edit/FieldRow.js +402 -370
  14. package/dist/shared/components/item-edit/FilePickerField.js +315 -307
  15. package/dist/shared/components/item-edit/InlineGridField.js +92 -90
  16. package/dist/shared/components/item-edit/InlineTableField.js +3119 -2951
  17. package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
  18. package/dist/shared/components/item-edit/PlanGrid.js +162 -162
  19. package/dist/shared/components/item-edit/PolishFields.js +169 -162
  20. package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
  21. package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
  22. package/dist/shared/components/item-edit/RelationCombobox.js +198 -191
  23. package/dist/shared/components/item-edit/SummaryPanel.js +282 -259
  24. package/dist/shared/components/item-edit/UserChip.js +233 -200
  25. package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
  26. package/dist/shared/components/item-edit/header-midair.js +51 -0
  27. package/dist/shared/components/item-edit/helpers.js +181 -155
  28. package/dist/shared/components/item-edit/line-midair.js +207 -0
  29. package/dist/shared/components/item-edit/soft-rules.js +27 -0
  30. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  31. package/dist/shared/components/panels/CommentPanel.js +290 -284
  32. package/dist/shared/components/panels/ItemLockBanner.js +414 -358
  33. package/dist/shared/components/panels/PipelinePanel.js +1241 -992
  34. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  35. package/dist/shared/components/panels/TaskPanel.js +71 -61
  36. package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
  37. package/dist/shared/components/panels/requirement-side-effects.js +40 -0
  38. package/dist/shared/components/queue/QueueWorklist.js +925 -871
  39. package/dist/shared/components/queue/column-chooser.js +21 -0
  40. package/dist/shared/components/queue/live-state-aspect.js +6 -0
  41. package/dist/shared/components/ui/number-draft-input.js +93 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
  43. package/dist/shared/lib/draft-store.js +48 -34
  44. package/dist/shared/lib/error-hints.js +1 -0
  45. package/dist/shared/lib/query-stats.js +60 -60
  46. package/package.json +1 -1
@@ -1,81 +1,83 @@
1
- import { jsxs as d, Fragment as Se, jsx as a } from "react/jsx-runtime";
2
- import { useSensors as Hl, useSensor as Jl, PointerSensor as Yl, DndContext as zl, closestCenter as Xl } from "@dnd-kit/core";
3
- import { SortableContext as Zl, verticalListSortingStrategy as eo, arrayMove as to, useSortable as no } from "@dnd-kit/sortable";
4
- import { CSS as ro } from "@dnd-kit/utilities";
5
- import { useQueryClient as ao, useQuery as W, useMutation as Ne, useQueries as Qe } from "@tanstack/react-query";
6
- import { AlertTriangle as lo, FileDiff as oo, RefreshCw as so, Rows3 as ba, Flame as io, Sparkles as co, BarChart3 as uo, SlidersHorizontal as mo, ListChecks as po, Rows4 as bo, Rows2 as ho, Play as fo, Plus as Yt, ChevronDown as ha, Star as go, Pin as xo, Loader2 as yo, Check as ko, Save as vo, Bell as wo, Inbox as _o, GripVertical as No } from "lucide-react";
7
- import { useState as w, useRef as U, useEffect as j, useMemo as V } from "react";
8
- import { createPortal as fa } from "react-dom";
9
- import { toast as O } from "sonner";
10
- import { useNivaroClient as _a, useItemEditAuth as ga, useItemNavigation as So, useNavigation as Co, useOverlayState as $o } from "../../context.js";
11
- import { useDebounced as qo } from "../../hooks/useDebounced.js";
12
- import { useElapsedLoading as Fo } from "../../hooks/useElapsedLoading.js";
13
- import { useSlowReason as To } from "../../hooks/useSlowReason.js";
14
- import { useBulkProgressFeed as Ro } from "../../lib/bulk-progress.js";
15
- import { get as A, post as se, patch as xa, del as Dn, put as Eo } from "../../lib/commands.js";
16
- import { evaluateExpression as Ao } from "../../lib/expression.js";
17
- import { clauseFromControlValue as Lo, filterSentence as Oo } from "../../lib/filter-sentence.js";
18
- import { deliverLive as Do, releaseLiveOwner as Po } from "../../lib/focus-mode.js";
19
- import { formatMultiValue as tt, formatValue as Ko } from "../../lib/format-value.js";
20
- import { createCursorBook as Mo, pageRequest as Qo, noteNextCursor as Bo } from "../../lib/keyset-pager.js";
21
- import { normalizeInlineEdit as jo, inlineM2oTarget as Uo, inlineChoices as Io, inlineEditFor as Vo, nextInlineKey as Go } from "../../lib/list-inline-edit.js";
22
- import { sanitizeQueueLinkState as Wo, readListLinkFromLocation as Ho, dropListLinkParam as Jo } from "../../lib/list-link.js";
23
- import { expandCoalesced as Yo, LIVE_ASPECTS as Ct } from "../../lib/live.js";
24
- import { useRowChanges as zo, useRowLocksByCollection as Xo, lockLabel as Zo } from "../../lib/live-list.js";
25
- import { OPEN_IN_TABS_CAP as es, openInTabs as ts, openInTabsMessage as ya } from "../../lib/open-in-tabs.js";
26
- import { isOwnWrite as ns } from "../../lib/own-writes.js";
27
- import { usePrefetchIntent as rs } from "../../lib/prefetch.js";
28
- import { useRowPresence as as, rowPresenceKey as ls } from "../../lib/presence-hooks.js";
29
- import { buildGroups as os } from "../../lib/queue-grouping.js";
30
- import { cascadeFilter as ss, fetchCascadeRelations as is } from "../../lib/quick-filter-cascade.js";
31
- import { useOptionalRealtime as cs } from "../../lib/realtime.js";
32
- import { rowHighlightTextClass as ds, rowHighlightClass as us } from "../../lib/row-highlight.js";
1
+ import { jsxs as d, Fragment as Ce, jsx as a } from "react/jsx-runtime";
2
+ import { useSensors as zl, useSensor as Xl, PointerSensor as Zl, DndContext as eo, closestCenter as to } from "@dnd-kit/core";
3
+ import { SortableContext as no, verticalListSortingStrategy as ro, arrayMove as ao, useSortable as lo } from "@dnd-kit/sortable";
4
+ import { CSS as oo } from "@dnd-kit/utilities";
5
+ import { useQueryClient as so, useQuery as W, useMutation as Se, useQueries as Be } from "@tanstack/react-query";
6
+ import { AlertTriangle as io, FileDiff as co, RefreshCw as uo, Rows3 as xa, Flame as mo, Sparkles as po, BarChart3 as bo, SlidersHorizontal as ho, ListChecks as fo, Rows4 as go, Rows2 as xo, Play as yo, Plus as zt, ChevronDown as ya, Star as ko, Pin as vo, Loader2 as wo, Check as _o, Save as No, Bell as So, Inbox as Co, GripVertical as $o } from "lucide-react";
7
+ import { useState as w, useRef as U, useEffect as M, useMemo as V } from "react";
8
+ import { createPortal as ka } from "react-dom";
9
+ import { toast as D } from "sonner";
10
+ import { useNivaroClient as $a, useItemEditAuth as va, useItemNavigation as qo, useNavigation as Fo, useOverlayState as To } from "../../context.js";
11
+ import { useDebounced as Ro } from "../../hooks/useDebounced.js";
12
+ import { useElapsedLoading as Eo } from "../../hooks/useElapsedLoading.js";
13
+ import { useSlowReason as Ao } from "../../hooks/useSlowReason.js";
14
+ import { useBulkProgressFeed as Lo } from "../../lib/bulk-progress.js";
15
+ import { get as A, post as se, patch as wa, del as Mn, put as Oo } from "../../lib/commands.js";
16
+ import { evaluateExpression as Do } from "../../lib/expression.js";
17
+ import { clauseFromControlValue as Ko, filterSentence as Po } from "../../lib/filter-sentence.js";
18
+ import { deliverLive as Mo, releaseLiveOwner as Qo } from "../../lib/focus-mode.js";
19
+ import { formatMultiValue as tt, formatValue as Bo } from "../../lib/format-value.js";
20
+ import { createCursorBook as jo, pageRequest as Uo, noteNextCursor as Io } from "../../lib/keyset-pager.js";
21
+ import { normalizeInlineEdit as Vo, inlineM2oTarget as Go, inlineChoices as Wo, inlineEditFor as Ho, nextInlineKey as Yo } from "../../lib/list-inline-edit.js";
22
+ import { sanitizeQueueLinkState as Jo, readListLinkFromLocation as zo, dropListLinkParam as Xo } from "../../lib/list-link.js";
23
+ import { expandCoalesced as Zo, LIVE_ASPECTS as Ct } from "../../lib/live.js";
24
+ import { useRowChanges as es, useRowLocksByCollection as ts, lockLabel as ns } from "../../lib/live-list.js";
25
+ import { OPEN_IN_TABS_CAP as rs, openInTabs as as, openInTabsMessage as _a } from "../../lib/open-in-tabs.js";
26
+ import { isOwnWrite as ls } from "../../lib/own-writes.js";
27
+ import { usePrefetchIntent as os } from "../../lib/prefetch.js";
28
+ import { useRowPresence as ss, rowPresenceKey as is } from "../../lib/presence-hooks.js";
29
+ import { buildGroups as cs } from "../../lib/queue-grouping.js";
30
+ import { cascadeFilter as ds, fetchCascadeRelations as us } from "../../lib/quick-filter-cascade.js";
31
+ import { useOptionalRealtime as ms } from "../../lib/realtime.js";
32
+ import { rowHighlightTextClass as ps, rowHighlightClass as bs } from "../../lib/row-highlight.js";
33
33
  import { userErrorMessage as $t } from "../../lib/safe-error.js";
34
- import { useMyScopes as ms, matchScopeDimension as ps, effectiveScopeSeedIds as bs } from "../../lib/use-my-scopes.js";
35
- import { useNewItemLayouts as hs } from "../../lib/use-new-item-layouts.js";
36
- import { formatNumber as ie, cn as R, titleCase as Pn, humanHours as fs, formatRelative as gs, formatDateTime as xs, formatDate as ys } from "../../lib/utils.js";
37
- import { usePublishAskContext as ks, useAskRecordDrag as vs } from "../ai/ask-context.js";
38
- import { useBuiltinGate as ws, BulkActionButtons as _s } from "../bulk/BulkActionButtons.js";
39
- import { BulkRowMark as Ns } from "../bulk/BulkRowMark.js";
40
- import { RowActionsMenu as Ss, roleMayUpdate as Cs } from "../CollectionBrowserView.js";
41
- import { DataTable as $s } from "../DataTable.js";
42
- import { EmptyState as qs } from "../EmptyState.js";
43
- import { FocusModeToggle as Fs } from "../FocusModeToggle.js";
44
- import { FulfilmentPill as Ts, FULFILMENT_FILTER_OPTIONS as Rs } from "../FulfilmentPill.js";
45
- import { ImportFromFileButton as Es } from "../import/ImportFromFileButton.js";
46
- import { IntegrationDots as As, INTEGRATIONS_FILTER_OPTIONS as Ls } from "../integrations/IntegrationDots.js";
47
- import { IntegrationsFilterPill as Os } from "../integrations/IntegrationsFilterPill.js";
48
- import { readQueueReturn as Ds, writeQueueReturn as ka } from "../item-edit/QueueReturnChip.js";
49
- import { ListLoadError as Ps } from "../ListLoadError.js";
50
- import { LiveRowMark as Ks } from "../LiveRowMark.js";
51
- import { CopyListLinkButton as Ms } from "../list/CopyListLinkButton.js";
52
- import { useInlineEdit as Qs, InlineEditCell as Bs } from "../list/InlineEdit.js";
53
- import { usePickerExcludedRows as js, PICKER_EXCLUDED_ROW_CLASS as Us, PICKER_EXCLUDED_TITLE as Is } from "../PickerExcludedRows.js";
54
- import { RealtimeStaleMark as Vs } from "../RealtimeStatusBanner.js";
55
- import { RecordDrilldownSheet as Gs } from "../RecordDrilldownSheet.js";
56
- import { RowHighlightLegend as Ws } from "../RowHighlightLegend.js";
57
- import { RowPresence as Hs } from "../RowPresence.js";
58
- import { TickerNumber as Kn } from "../TickerNumber.js";
59
- import { UnseenDot as Js } from "../UnseenDot.js";
60
- import { Badge as Ys } from "../ui/badge.js";
61
- import { Checkbox as Mn } from "../ui/checkbox.js";
62
- import { Command as va, CommandInput as zs, CommandList as wa, CommandEmpty as Xs, CommandItem as qt } from "../ui/command.js";
63
- import { Label as Zs } from "../ui/label.js";
34
+ import { useMyScopes as hs, matchScopeDimension as fs, effectiveScopeSeedIds as gs } from "../../lib/use-my-scopes.js";
35
+ import { useNewItemLayouts as xs } from "../../lib/use-new-item-layouts.js";
36
+ import { formatNumber as ie, cn as R, titleCase as Qn, humanHours as ys, formatRelative as ks, formatDateTime as vs, formatDate as ws } from "../../lib/utils.js";
37
+ import { usePublishAskContext as _s, useAskRecordDrag as Ns } from "../ai/ask-context.js";
38
+ import { useBuiltinGate as Ss, BulkActionButtons as Cs } from "../bulk/BulkActionButtons.js";
39
+ import { BulkRowMark as $s } from "../bulk/BulkRowMark.js";
40
+ import { RowActionsMenu as qs, roleMayUpdate as Fs } from "../CollectionBrowserView.js";
41
+ import { DataTable as Ts } from "../DataTable.js";
42
+ import { EmptyState as Rs } from "../EmptyState.js";
43
+ import { FocusModeToggle as Es } from "../FocusModeToggle.js";
44
+ import { FulfilmentPill as As, FULFILMENT_FILTER_OPTIONS as Ls } from "../FulfilmentPill.js";
45
+ import { ImportFromFileButton as Os } from "../import/ImportFromFileButton.js";
46
+ import { IntegrationDots as Ds, INTEGRATIONS_FILTER_OPTIONS as Ks } from "../integrations/IntegrationDots.js";
47
+ import { IntegrationsFilterPill as Ps } from "../integrations/IntegrationsFilterPill.js";
48
+ import { readQueueReturn as Ms, writeQueueReturn as Na } from "../item-edit/QueueReturnChip.js";
49
+ import { ListLoadError as Qs } from "../ListLoadError.js";
50
+ import { LiveRowMark as Bs } from "../LiveRowMark.js";
51
+ import { CopyListLinkButton as js } from "../list/CopyListLinkButton.js";
52
+ import { useInlineEdit as Us, InlineEditCell as Is } from "../list/InlineEdit.js";
53
+ import { usePickerExcludedRows as Vs, PICKER_EXCLUDED_ROW_CLASS as Gs, PICKER_EXCLUDED_TITLE as Ws } from "../PickerExcludedRows.js";
54
+ import { RealtimeStaleMark as Hs } from "../RealtimeStatusBanner.js";
55
+ import { RecordDrilldownSheet as Ys } from "../RecordDrilldownSheet.js";
56
+ import { RowHighlightLegend as Js } from "../RowHighlightLegend.js";
57
+ import { RowPresence as zs } from "../RowPresence.js";
58
+ import { TickerNumber as Bn } from "../TickerNumber.js";
59
+ import { UnseenDot as Xs } from "../UnseenDot.js";
60
+ import { Badge as Zs } from "../ui/badge.js";
61
+ import { Checkbox as jn } from "../ui/checkbox.js";
62
+ import { Command as Sa, CommandInput as ei, CommandList as Ca, CommandEmpty as ti, CommandItem as qt } from "../ui/command.js";
63
+ import { Label as ni } from "../ui/label.js";
64
64
  import { Popover as nt, PopoverTrigger as rt, PopoverContent as at } from "../ui/popover.js";
65
- import { Skeleton as ei } from "../ui/skeleton.js";
66
- import { OwnerAvatars as ti } from "./OwnerAvatars.js";
67
- import { QueueBulkBar as ni } from "./QueueBulkBar.js";
68
- import { QueueItemSheet as ri } from "./QueueItemSheet.js";
69
- import { QueueKanbanBoard as ai } from "./QueueKanbanBoard.js";
70
- import { QueueQuickFilters as li } from "./QueueQuickFilters.js";
71
- import { QueueWorkloadView as oi } from "./QueueWorkloadView.js";
72
- import { useTransitionNote as si, needsTransitionNote as ii } from "./transition-note.js";
73
- function ci({ summary: l }) {
65
+ import { Skeleton as ri } from "../ui/skeleton.js";
66
+ import { dedupeChooserKeys as ai } from "./column-chooser.js";
67
+ import { stateAspectEffect as li } from "./live-state-aspect.js";
68
+ import { OwnerAvatars as oi } from "./OwnerAvatars.js";
69
+ import { QueueBulkBar as si } from "./QueueBulkBar.js";
70
+ import { QueueItemSheet as ii } from "./QueueItemSheet.js";
71
+ import { QueueKanbanBoard as ci } from "./QueueKanbanBoard.js";
72
+ import { QueueQuickFilters as di } from "./QueueQuickFilters.js";
73
+ import { QueueWorkloadView as ui } from "./QueueWorkloadView.js";
74
+ import { useTransitionNote as mi, needsTransitionNote as pi } from "./transition-note.js";
75
+ function bi({ summary: l }) {
74
76
  if (!l || l.count === 0)
75
77
  return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
76
78
  const y = [l.last_from, l.last_to].filter(Boolean).join(" → "), L = [
77
79
  y ? `Last: ${y}` : null,
78
- l.last_at ? gs(l.last_at) : null,
80
+ l.last_at ? ks(l.last_at) : null,
79
81
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
80
82
  ].filter(Boolean).join(" · ");
81
83
  return /* @__PURE__ */ d(
@@ -97,15 +99,15 @@ function ci({ summary: l }) {
97
99
  }
98
100
  );
99
101
  }
100
- const di = 50, zt = "nivaro_addendums", ui = [
102
+ const hi = 50, Xt = "nivaro_addendums", fi = [
101
103
  { value: "mine", label: "My Items" },
102
104
  { value: "unowned", label: "No Owners" },
103
105
  { value: "claimed", label: "Claimed by me" },
104
106
  { value: "all", label: "All Items" }
105
107
  ];
106
- function mi({ summary: l }) {
108
+ function gi({ summary: l }) {
107
109
  if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
108
- const y = l.active > 0, L = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", K = l.cost_impact, G = K != null && K !== 0 ? `${K > 0 ? "+" : "−"}$${Math.abs(K).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
110
+ const y = l.active > 0, L = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", P = l.cost_impact, G = P != null && P !== 0 ? `${P > 0 ? "+" : "−"}$${Math.abs(P).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
109
111
  return /* @__PURE__ */ d(
110
112
  "span",
111
113
  {
@@ -134,22 +136,22 @@ function mi({ summary: l }) {
134
136
  }
135
137
  );
136
138
  }
137
- function pi(l) {
138
- return fs(l);
139
+ function xi(l) {
140
+ return ys(l);
139
141
  }
140
- function bi({ status: l }) {
142
+ function yi({ status: l }) {
141
143
  return l ? /* @__PURE__ */ a("span", { className: R("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
142
144
  }
143
- function hi({ points: l, inline: y = !1 }) {
145
+ function ki({ points: l, inline: y = !1 }) {
144
146
  if (l.length < 2) return null;
145
- const L = y ? 40 : 64, K = y ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, S = L / (l.length - 1), H = l.map(
146
- (xe, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(K - 2 - (xe - f) / h * (K - 4)).toFixed(1)}`
147
+ const L = y ? 40 : 64, P = y ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, S = L / (l.length - 1), H = l.map(
148
+ (xe, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(P - 2 - (xe - f) / h * (P - 4)).toFixed(1)}`
147
149
  ).join(" ");
148
150
  return /* @__PURE__ */ a(
149
151
  "svg",
150
152
  {
151
153
  width: L,
152
- height: K,
154
+ height: P,
153
155
  className: y ? "opacity-40" : "mt-1.5 opacity-40",
154
156
  "aria-hidden": "true",
155
157
  children: /* @__PURE__ */ a("path", { d: H, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
@@ -160,7 +162,7 @@ function Ft({
160
162
  label: l,
161
163
  count: y,
162
164
  filteredCount: L,
163
- active: K,
165
+ active: P,
164
166
  isLoading: G,
165
167
  tone: f,
166
168
  trend: h,
@@ -175,17 +177,17 @@ function Ft({
175
177
  onClick: xe,
176
178
  className: R(
177
179
  "nvr-section-enter flex items-center gap-1.5 bg-white px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:bg-card dark:hover:bg-card/80",
178
- K && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
179
- !K && !G && y === 0 && "opacity-50"
180
+ P && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
181
+ !P && !G && y === 0 && "opacity-50"
180
182
  ),
181
- children: G ? /* @__PURE__ */ a(ei, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Se, { children: [
182
- /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Se, { children: [
183
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Kn, { value: L, format: ie }) }),
183
+ children: G ? /* @__PURE__ */ a(ri, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Ce, { children: [
184
+ /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Ce, { children: [
185
+ /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Bn, { value: L, format: ie }) }),
184
186
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
185
187
  "/ ",
186
- /* @__PURE__ */ a(Kn, { value: y, format: ie })
188
+ /* @__PURE__ */ a(Bn, { value: y, format: ie })
187
189
  ] })
188
- ] }) : /* @__PURE__ */ a(Kn, { value: y, format: ie }) }),
190
+ ] }) : /* @__PURE__ */ a(Bn, { value: y, format: ie }) }),
189
191
  /* @__PURE__ */ a(
190
192
  "span",
191
193
  {
@@ -209,16 +211,16 @@ function Ft({
209
211
  ]
210
212
  }
211
213
  ),
212
- h && y > 0 && /* @__PURE__ */ a(hi, { points: h, inline: !0 })
214
+ h && y > 0 && /* @__PURE__ */ a(ki, { points: h, inline: !0 })
213
215
  ] })
214
216
  }
215
217
  );
216
218
  }
217
- function fi({
219
+ function vi({
218
220
  label: l,
219
221
  count: y,
220
222
  filteredCount: L,
221
- color: K,
223
+ color: P,
222
224
  active: G,
223
225
  onClick: f
224
226
  }) {
@@ -236,11 +238,11 @@ function fi({
236
238
  "span",
237
239
  {
238
240
  className: "h-2 w-2 shrink-0 rounded-full",
239
- style: { backgroundColor: K ?? "#94a3b8" }
241
+ style: { backgroundColor: P ?? "#94a3b8" }
240
242
  }
241
243
  ),
242
244
  l,
243
- /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Se, { children: [
245
+ /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Ce, { children: [
244
246
  /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(L) }),
245
247
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
246
248
  " / ",
@@ -254,19 +256,19 @@ function fi({
254
256
  function lt(l) {
255
257
  return l.split(".").map((y) => y.replace(/_/g, " ").replace(/\b\w/g, (L) => L.toUpperCase())).join(" → ");
256
258
  }
257
- function gi({
259
+ function wi({
258
260
  id: l,
259
261
  label: y,
260
262
  checked: L,
261
- onCheckedChange: K
263
+ onCheckedChange: P
262
264
  }) {
263
- const { attributes: G, listeners: f, setNodeRef: h, transform: S, transition: H, isDragging: xe } = no({
265
+ const { attributes: G, listeners: f, setNodeRef: h, transform: S, transition: H, isDragging: xe } = lo({
264
266
  id: l
265
267
  }), g = {
266
- transform: ro.Transform.toString(S),
268
+ transform: oo.Transform.toString(S),
267
269
  transition: H,
268
270
  opacity: xe ? 0.4 : 1
269
- }, z = `col-toggle-${l}`;
271
+ }, Y = `col-toggle-${l}`;
270
272
  return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
271
273
  /* @__PURE__ */ a(
272
274
  "span",
@@ -274,42 +276,42 @@ function gi({
274
276
  ...G,
275
277
  ...f,
276
278
  className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
277
- children: /* @__PURE__ */ a(No, { className: "h-3.5 w-3.5" })
279
+ children: /* @__PURE__ */ a($o, { className: "h-3.5 w-3.5" })
278
280
  }
279
281
  ),
280
- /* @__PURE__ */ a(Mn, { id: z, checked: L, onCheckedChange: K }),
281
- /* @__PURE__ */ a(Zs, { htmlFor: z, className: "cursor-pointer text-[12px] font-normal", children: y })
282
+ /* @__PURE__ */ a(jn, { id: Y, checked: L, onCheckedChange: P }),
283
+ /* @__PURE__ */ a(ni, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: y })
282
284
  ] });
283
285
  }
284
- function Qc({
286
+ function Wc({
285
287
  queueId: l,
286
288
  realtime: y,
287
289
  renderError: L,
288
- hideCreateActions: K = !1,
290
+ hideCreateActions: P = !1,
289
291
  onAsk: G
290
292
  }) {
291
- var zr, Xr, Zr, ea, ta, na, ra, aa, la, oa, sa, ia, ca, da, ua, ma;
292
- const f = ao(), h = _a(), { userId: S } = ga(), H = So(), { navigate: xe } = Co(), [g, z] = w("all"), [de, D] = w(1), Qn = U(Mo()), [Tt, Na] = w(() => {
293
+ var ta, na, ra, aa, la, oa, sa, ia, ca, da, ua, ma, pa, ba, ha, fa;
294
+ const f = so(), h = $a(), { userId: S } = va(), H = qo(), { navigate: xe } = Fo(), [g, Y] = w("all"), [de, O] = w(1), Un = U(jo()), [Tt, qa] = w(() => {
293
295
  try {
294
296
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
295
297
  } catch {
296
298
  return "compact";
297
299
  }
298
- }), [q, Be] = w("table"), [I, je] = w(""), [_, M] = w({}), [Rt, Bn] = w(() => /* @__PURE__ */ new Set()), [$, ot] = w(null), [ye, Xt] = w(/* @__PURE__ */ new Set()), [st, Zt] = w(null), [it, en] = w(null), [tn, Et] = w(0), Ce = zo(), nn = cs(), rn = U({}).current, jn = U(/* @__PURE__ */ new Set()), [Sa, Ca] = w(0), [Un, $a] = w(0), $e = U(!1), At = U([]), In = U(null), Vn = U(!1), Gn = U(0), an = U("table");
299
- an.current = q;
300
- const ln = 25, { data: i, error: Lt } = W({
300
+ }), [q, je] = w("table"), [I, Ue] = w(""), [_, Q] = w({}), [Rt, In] = w(() => /* @__PURE__ */ new Set()), [$, ot] = w(null), [ye, Zt] = w(/* @__PURE__ */ new Set()), [st, en] = w(null), [it, tn] = w(null), [nn, Et] = w(0), $e = es(), rn = ms(), an = U({}).current, Vn = U(/* @__PURE__ */ new Set()), [Fa, Ta] = w(0), [Gn, Ra] = w(0), qe = U(!1), At = U([]), Wn = U(null), Hn = U(!1), Yn = U(0), ln = U("table");
301
+ ln.current = q;
302
+ const on = 25, { data: i, error: Lt } = W({
301
303
  queryKey: ["queue-meta", l],
302
304
  queryFn: () => h.request(A(`/queues/${l}`)).then((e) => e.data),
303
305
  enabled: !!l
304
- }), { scopes: ct, ready: Wn } = ms(), Hn = U(!1), [Jn, Yn] = w(!1), [qe, qa] = w({}), ue = U({});
305
- j(() => {
306
- if (Hn.current || !Wn || !i) return;
307
- Hn.current = !0;
306
+ }), { scopes: ct, ready: Jn } = hs(), zn = U(!1), [Xn, Zn] = w(!1), [Fe, Ea] = w({}), ue = U({});
307
+ M(() => {
308
+ if (zn.current || !Jn || !i) return;
309
+ zn.current = !0;
308
310
  const e = (i.extra_field_meta ?? []).filter(
309
311
  (t) => t.kind === "relation" && t.target_collection && t.display_field
310
312
  );
311
313
  if (e.length === 0 || !ct) {
312
- Yn(!0);
314
+ Zn(!0);
313
315
  return;
314
316
  }
315
317
  (async () => {
@@ -328,7 +330,7 @@ function Qc({
328
330
  ];
329
331
  };
330
332
  for (const o of e) {
331
- const s = ps(ct, { collection: o.target_collection });
333
+ const s = fs(ct, { collection: o.target_collection });
332
334
  if (!s) continue;
333
335
  const m = `extra.${o.path}`;
334
336
  try {
@@ -337,7 +339,7 @@ function Qc({
337
339
  const C = await r(o, p);
338
340
  C.length > 0 && (n[m.slice(6)] = C);
339
341
  }
340
- const N = bs(ct, s.name);
342
+ const N = gs(ct, s.name);
341
343
  if (N.length === 0) continue;
342
344
  const k = _[m];
343
345
  if (k && (Array.isArray(k) ? k.length > 0 : k !== ""))
@@ -347,25 +349,25 @@ function Qc({
347
349
  } catch {
348
350
  }
349
351
  }
350
- Object.keys(n).length > 0 && qa(n), Object.keys(t).length > 0 && (ue.current = t, M((o) => ({ ...o, ...t }))), Yn(!0);
352
+ Object.keys(n).length > 0 && Ea(n), Object.keys(t).length > 0 && (ue.current = t, Q((o) => ({ ...o, ...t }))), Zn(!0);
351
353
  })();
352
- }, [Wn, ct, i]);
353
- const Ue = ((Xr = (zr = i == null ? void 0 : i.sources) == null ? void 0 : zr.find((e) => e.type === "collection")) == null ? void 0 : Xr.collection) ?? null, { data: zn = [] } = W({
354
- queryKey: ["queue-browser-quick-filters", Ue],
355
- queryFn: () => h.request(A(`/collections/${Ue}`)).then((e) => {
354
+ }, [Jn, ct, i]);
355
+ const Ie = ((na = (ta = i == null ? void 0 : i.sources) == null ? void 0 : ta.find((e) => e.type === "collection")) == null ? void 0 : na.collection) ?? null, { data: er = [] } = W({
356
+ queryKey: ["queue-browser-quick-filters", Ie],
357
+ queryFn: () => h.request(A(`/collections/${Ie}`)).then((e) => {
356
358
  var t, n;
357
359
  return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
358
360
  }).catch(() => []),
359
- enabled: !!Ue,
361
+ enabled: !!Ie,
360
362
  staleTime: 3e5
361
- }), te = V(() => {
363
+ }), re = V(() => {
362
364
  const e = /* @__PURE__ */ new Set(), t = [];
363
365
  for (const n of (i == null ? void 0 : i.sources) ?? [])
364
366
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
365
367
  return t;
366
- }, [i == null ? void 0 : i.sources]), Ot = hs(
367
- te.length === 1 ? te[0] : null
368
- ), on = K === !0 || Array.isArray(K) && te.length > 0 && te.every((e) => K.includes(e)), me = (i == null ? void 0 : i.claims_enabled) !== !1, u = i == null ? void 0 : i.display_config, Fe = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Fa = (u == null ? void 0 : u.work_next) !== !1, Dt = (u == null ? void 0 : u.bulk_actions) !== !1, sn = ws(
368
+ }, [i == null ? void 0 : i.sources]), Ot = xs(
369
+ re.length === 1 ? re[0] : null
370
+ ), sn = P === !0 || Array.isArray(P) && re.length > 0 && re.every((e) => P.includes(e)), me = (i == null ? void 0 : i.claims_enabled) !== !1, u = i == null ? void 0 : i.display_config, Te = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Aa = (u == null ? void 0 : u.work_next) !== !1, Dt = (u == null ? void 0 : u.bulk_actions) !== !1, cn = Ss(
369
371
  [
370
372
  ...new Set(
371
373
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -375,16 +377,16 @@ function Qc({
375
377
  ), E = (e, t) => {
376
378
  var n, r;
377
379
  return ((r = (n = i == null ? void 0 : i.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
378
- }, Xn = U(!1);
379
- j(() => {
380
- !i || Xn.current || (Xn.current = !0, je("-priority"));
380
+ }, tr = U(!1);
381
+ M(() => {
382
+ !i || tr.current || (tr.current = !0, Ue("-priority"));
381
383
  }, [i]);
382
- const [ne, Ta] = w(!1);
383
- j(() => {
384
- i != null && i.display_config && !Fe.includes(q) && Be(Fe[0]);
385
- }, [i, q, Fe]), j(() => {
384
+ const [J, La] = w(!1);
385
+ M(() => {
386
+ i != null && i.display_config && !Te.includes(q) && je(Te[0]);
387
+ }, [i, q, Te]), M(() => {
386
388
  if (!(i != null && i.sources)) return;
387
- const e = nn ? (b, C) => nn.subscribeCollections(b, C) : y == null ? void 0 : y.subscribe;
389
+ const e = rn ? (b, C) => rn.subscribeCollections(b, C) : y == null ? void 0 : y.subscribe;
388
390
  if (!e) return;
389
391
  const t = [
390
392
  ...new Set(
@@ -396,42 +398,46 @@ function Qc({
396
398
  let r = null, o = null, s = null;
397
399
  const m = () => {
398
400
  s || (s = setTimeout(() => {
399
- s = null, $a((b) => b + 1);
401
+ s = null, Ra((b) => b + 1);
400
402
  }, 1500));
401
403
  }, p = () => {
402
404
  o || (o = setTimeout(() => {
403
- if (o = null, Gn.current > 0 || Vn.current) {
405
+ if (o = null, Yn.current > 0 || Hn.current) {
404
406
  At.current = [], Et((b) => b + 1);
405
407
  return;
406
408
  }
407
- $e.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
409
+ qe.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
408
410
  }, 900));
409
411
  }, N = (b) => {
410
- let C = !1, v = 0, J = !1;
411
- const Y = b.flatMap(
412
- (T) => T ? Yo(T) : [T]
412
+ let C = !1, v = 0, z = !1;
413
+ const X = b.flatMap(
414
+ (T) => T ? Zo(T) : [T]
413
415
  );
414
- for (const T of Y) {
415
- const ee = T == null ? void 0 : T.changed_fields, Jt = (T == null ? void 0 : T.collection) != null ? `${T.collection}:${String(T.item)}` : null, pa = Jt != null && jn.current.has(Jt);
416
- if (T && !T.action && (ee != null && ee.length) && ee.every((St) => St.startsWith("$"))) {
417
- ee.includes(Ct.tasks) && n.add("queue-task-counts"), ee.includes(Ct.integrations) && n.add("queue-integrations-summary"), ee.includes(Ct.addendums) && n.add("queue-collection-addendums"), ee.includes(Ct.lock) && Ca((St) => St + 1), ee.includes(Ct.state) && (J = !0, (pa || an.current === "kanban") && (C = !0)), r || (r = setTimeout(() => {
416
+ for (const T of X) {
417
+ const ne = T == null ? void 0 : T.changed_fields, Jt = (T == null ? void 0 : T.collection) != null ? `${T.collection}:${String(T.item)}` : null, ga = Jt != null && Vn.current.has(Jt);
418
+ if (T && !T.action && (ne != null && ne.length) && ne.every((Ne) => Ne.startsWith("$"))) {
419
+ if (ne.includes(Ct.tasks) && n.add("queue-task-counts"), ne.includes(Ct.integrations) && n.add("queue-integrations-summary"), ne.includes(Ct.addendums) && n.add("queue-collection-addendums"), ne.includes(Ct.lock) && Ta((Ne) => Ne + 1), ne.includes(Ct.state)) {
420
+ const Ne = li(ga, ln.current === "kanban");
421
+ z = !0, Ne.refresh && (C = !0), v += Ne.pill;
422
+ }
423
+ r || (r = setTimeout(() => {
418
424
  r = null;
419
- for (const St of n) f.invalidateQueries({ queryKey: [St] });
425
+ for (const Ne of n) f.invalidateQueries({ queryKey: [Ne] });
420
426
  n.clear();
421
427
  }, 300));
422
428
  continue;
423
429
  }
424
- J = !0;
425
- const Wl = (T == null ? void 0 : T.collection) != null && ns(T.collection, T.item);
426
- Jt && (pa || (T == null ? void 0 : T.action) === "create" || an.current === "kanban") ? (C = !0, Wl || At.current.push({ key: Jt, by: null })) : v += 1;
430
+ z = !0;
431
+ const Jl = (T == null ? void 0 : T.collection) != null && ls(T.collection, T.item);
432
+ Jt && (ga || (T == null ? void 0 : T.action) === "create" || ln.current === "kanban") ? (C = !0, Jl || At.current.push({ key: Jt, by: null })) : v += 1;
427
433
  }
428
- v > 0 && Et((T) => T + v), C && p(), J && m();
429
- }, k = e(t, (b) => Do(rn, [b ?? {}], N));
434
+ v > 0 && Et((T) => T + v), C && p(), z && m();
435
+ }, k = e(t, (b) => Mo(an, [b ?? {}], N));
430
436
  return () => {
431
- k(), Po(rn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
437
+ k(), Qo(an), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
432
438
  };
433
- }, [nn, y, i == null ? void 0 : i.sources, f, l, S, rn]);
434
- const Te = qo(_, 350), Ra = JSON.stringify(Te) === JSON.stringify(_), cn = U(!1), Re = q === "table" && !!$, Zn = (() => {
439
+ }, [rn, y, i == null ? void 0 : i.sources, f, l, S, an]);
440
+ const Re = Ro(_, 350), Oa = JSON.stringify(Re) === JSON.stringify(_), dn = U(!1), Ee = q === "table" && !!$, nr = (() => {
435
441
  const e = /* @__PURE__ */ new Set();
436
442
  for (const t of (i == null ? void 0 : i.extra_field_meta) ?? [])
437
443
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
@@ -443,7 +449,7 @@ function Qc({
443
449
  return [...e].slice(0, 12);
444
450
  })(), ke = (() => {
445
451
  const e = {};
446
- for (const [t, n] of Object.entries(Te))
452
+ for (const [t, n] of Object.entries(Re))
447
453
  if (n) {
448
454
  if (Array.isArray(n)) {
449
455
  n.length > 0 && (e[t] = n);
@@ -458,58 +464,58 @@ function Qc({
458
464
  }
459
465
  return e;
460
466
  })();
461
- function Ie(e, t) {
462
- M((n) => ({ ...n, [e]: n[e] === t ? "" : t })), D(1);
467
+ function Ve(e, t) {
468
+ Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })), O(1);
463
469
  }
464
- function Ea(e) {
465
- M((t) => {
470
+ function Da(e) {
471
+ Q((t) => {
466
472
  const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((s) => s !== e) : [...r, e];
467
473
  return { ...t, state: o };
468
- }), D(1);
474
+ }), O(1);
469
475
  }
470
- const Aa = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], La = (e) => !e || Array.isArray(e) && e.length === 0;
471
- function Oa() {
472
- M({ ...ue.current }), z("all"), D(1);
476
+ const Ka = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Pa = (e) => !e || Array.isArray(e) && e.length === 0;
477
+ function Ma() {
478
+ Q({ ...ue.current }), Y("all"), O(1);
473
479
  }
474
- const [dt, Da] = w(() => {
480
+ const [dt, Qa] = w(() => {
475
481
  try {
476
482
  return localStorage.getItem("nvr_queue_insights_open") === "1";
477
483
  } catch {
478
484
  return !1;
479
485
  }
480
486
  });
481
- j(() => {
487
+ M(() => {
482
488
  try {
483
489
  localStorage.setItem("nvr_queue_insights_open", dt ? "1" : "0");
484
490
  } catch {
485
491
  }
486
492
  }, [dt]);
487
- const { data: Pa = [] } = W({
493
+ const { data: Ba = [] } = W({
488
494
  queryKey: ["queue-view-subs", l],
489
495
  queryFn: () => h.request(A("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
490
496
  staleTime: 3e4
491
- }), Pt = (e) => Pa.find((t) => t.queue_view_id === e), Ka = (e) => {
492
- const t = Pt(e);
493
- (t ? h.request(Dn(`/notification-subscriptions/${t.id}`)) : h.request(
497
+ }), Kt = (e) => Ba.find((t) => t.queue_view_id === e), ja = (e) => {
498
+ const t = Kt(e);
499
+ (t ? h.request(Mn(`/notification-subscriptions/${t.id}`)) : h.request(
494
500
  se("/notification-subscriptions", {
495
501
  queue_id: l,
496
502
  queue_view_id: e,
497
503
  digest_frequency: "instant"
498
504
  })
499
505
  )).then(() => {
500
- O.success(
506
+ D.success(
501
507
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
502
508
  ), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
503
- }).catch((r) => O.error($t(r, "Failed")));
504
- }, [er, dn] = w(null), un = [
509
+ }).catch((r) => D.error($t(r, "Failed")));
510
+ }, [rr, un] = w(null), mn = [
505
511
  ...new Set(
506
512
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
507
513
  )
508
- ], { data: Ma = {} } = W({
509
- queryKey: ["queue-custom-actions", l, un.join(",")],
514
+ ], { data: Ua = {} } = W({
515
+ queryKey: ["queue-custom-actions", l, mn.join(",")],
510
516
  queryFn: async () => {
511
517
  const e = {};
512
- for (const t of un.slice(0, 6))
518
+ for (const t of mn.slice(0, 6))
513
519
  try {
514
520
  const n = await h.request(
515
521
  A("/custom-actions", { collection: t })
@@ -520,20 +526,20 @@ function Qc({
520
526
  }
521
527
  return e;
522
528
  },
523
- enabled: un.length > 0,
529
+ enabled: mn.length > 0,
524
530
  staleTime: 6e4
525
- }), Qa = (e) => Ma[e] ?? [], Ba = (e, t) => {
531
+ }), Ia = (e) => Ua[e] ?? [], Va = (e, t) => {
526
532
  h.request(se(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
527
- O.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
533
+ D.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
528
534
  }).catch((n) => {
529
535
  const r = n.response;
530
- O.error((r == null ? void 0 : r.error) ?? $t(n, `${e.label} failed`));
536
+ D.error((r == null ? void 0 : r.error) ?? $t(n, `${e.label} failed`));
531
537
  });
532
- }, { data: mn = [] } = W({
538
+ }, { data: pn = [] } = W({
533
539
  queryKey: ["queue-triage-labels", l],
534
540
  queryFn: () => h.request(A(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
535
541
  staleTime: 3e4
536
- }), tr = (e, t) => {
542
+ }), ar = (e, t) => {
537
543
  h.request(
538
544
  se(`/queues/${l}/triage-labels/toggle`, {
539
545
  collection: e.collection,
@@ -542,28 +548,28 @@ function Qc({
542
548
  })
543
549
  ).then(() => {
544
550
  f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
545
- }).catch((n) => O.error($t(n, "Label failed")));
551
+ }).catch((n) => D.error($t(n, "Label failed")));
546
552
  }, {
547
553
  data: c,
548
- isLoading: nr,
554
+ isLoading: lr,
549
555
  isFetching: ut,
550
- isPlaceholderData: ja,
556
+ isPlaceholderData: Ga,
551
557
  dataUpdatedAt: ce,
552
- isError: rr,
553
- error: Ua,
554
- refetch: Ia
558
+ isError: or,
559
+ error: Wa,
560
+ refetch: Ha
555
561
  } = W({
556
562
  queryKey: [
557
563
  "queue-items",
558
564
  l,
559
565
  g,
560
566
  I,
561
- Te,
567
+ Re,
562
568
  q === "table" && !$ ? de : "all",
563
569
  $
564
570
  ],
565
571
  queryFn: async () => {
566
- const e = !Re && q === "table", t = JSON.stringify([l, g, I, ke, ln]), n = e ? Qo(Qn.current, t, de, "").after : void 0, r = await h.request(
572
+ const e = !Ee && q === "table", t = JSON.stringify([l, g, I, ke, on]), n = e ? Uo(Un.current, t, de, "").after : void 0, r = await h.request(
567
573
  A(`/queues/${l}/items`, {
568
574
  scope: g,
569
575
  // Last State Change is Aging read the other way round: the newest
@@ -572,13 +578,13 @@ function Qc({
572
578
  filters: JSON.stringify(ke),
573
579
  // Table + group: headers only (rows load per group on expand, #741).
574
580
  // Kanban renders the full matching set, grouped client-side.
575
- ...Re ? {
581
+ ...Ee ? {
576
582
  group_by: $,
577
- ...Zn.length ? { group_sums: Zn.join(",") } : {}
578
- } : q === "table" ? { page: de, limit: ln, ...n ? { after: n } : {} } : {}
583
+ ...nr.length ? { group_sums: nr.join(",") } : {}
584
+ } : q === "table" ? { page: de, limit: on, ...n ? { after: n } : {} } : {}
579
585
  })
580
586
  );
581
- return n && Bo(Qn.current, t, de, r.next_cursor), r;
587
+ return n && Io(Un.current, t, de, r.next_cursor), r;
582
588
  },
583
589
  // Wait for display_config AND scope seeding so the first fetch uses the
584
590
  // configured defaults and already carries the viewer's restricted filters.
@@ -587,40 +593,40 @@ function Qc({
587
593
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
588
594
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
589
595
  // waits for the debounced copy to settle; later typing still debounces.
590
- enabled: !!l && ne && Jn && (cn.current || Ra),
596
+ enabled: !!l && J && Xn && (dn.current || Oa),
591
597
  // Keep the previous page rendered while a sort/filter/page change refetches —
592
598
  // swapping to skeletons collapsed the table height and jittered the page.
593
599
  placeholderData: (e) => e
594
600
  });
595
- c && !cn.current && (cn.current = !0);
596
- const Ve = Object.entries(ue.current).filter(
601
+ c && !dn.current && (dn.current = !0);
602
+ const Ge = Object.entries(ue.current).filter(
597
603
  ([e, t]) => {
598
604
  var n;
599
- return !((n = qe[e.slice(6)]) != null && n.length) && JSON.stringify(ke[e] ?? null) === JSON.stringify(t);
605
+ return !((n = Fe[e.slice(6)]) != null && n.length) && JSON.stringify(ke[e] ?? null) === JSON.stringify(t);
600
606
  }
601
- ).map(([e]) => e), ar = Ve.length > 0 && Object.keys(ke).every((e) => Ve.includes(e)), lr = Object.fromEntries(
602
- Object.entries(ke).filter(([e]) => !Ve.includes(e))
603
- ), { data: Va } = W({
604
- queryKey: ["queue-default-hidden", l, g, lr],
605
- enabled: !!l && !!c && !ut && c.total === 0 && ((Zr = c.empty) == null ? void 0 : Zr.reason) === "filters" && Ve.length > 0 && !ar,
607
+ ).map(([e]) => e), sr = Ge.length > 0 && Object.keys(ke).every((e) => Ge.includes(e)), ir = Object.fromEntries(
608
+ Object.entries(ke).filter(([e]) => !Ge.includes(e))
609
+ ), { data: Ya } = W({
610
+ queryKey: ["queue-default-hidden", l, g, ir],
611
+ enabled: !!l && !!c && !ut && c.total === 0 && ((ra = c.empty) == null ? void 0 : ra.reason) === "filters" && Ge.length > 0 && !sr,
606
612
  staleTime: 3e4,
607
613
  retry: !1,
608
614
  queryFn: () => h.request(
609
615
  A(`/queues/${l}/items`, {
610
616
  scope: g,
611
- filters: JSON.stringify(lr),
617
+ filters: JSON.stringify(ir),
612
618
  page: 1,
613
619
  limit: 1
614
620
  })
615
621
  ).then((e) => Number(e.total ?? 0))
616
- }), pe = ar ? Math.max(0, (((ea = c == null ? void 0 : c.stats) == null ? void 0 : ea.total) ?? 0) - ((c == null ? void 0 : c.total) ?? 0)) : Va ?? 0, or = (e) => Ve.map(e).join(" and "), sr = () => {
617
- M((e) => {
622
+ }), pe = sr ? Math.max(0, (((aa = c == null ? void 0 : c.stats) == null ? void 0 : aa.total) ?? 0) - ((c == null ? void 0 : c.total) ?? 0)) : Ya ?? 0, cr = (e) => Ge.map(e).join(" and "), dr = () => {
623
+ Q((e) => {
618
624
  const t = { ...e };
619
- for (const n of Ve) delete t[n];
625
+ for (const n of Ge) delete t[n];
620
626
  return t;
621
- }), D(1);
627
+ }), O(1);
622
628
  };
623
- j(() => {
629
+ M(() => {
624
630
  if (typeof window > "u" || !ce) return;
625
631
  const e = window;
626
632
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
@@ -629,20 +635,20 @@ function Qc({
629
635
  at: ce,
630
636
  scope: g,
631
637
  sort: I,
632
- filters: JSON.stringify(Te),
638
+ filters: JSON.stringify(Re),
633
639
  page: de
634
640
  }, r = t.find((o) => o.queue === l);
635
641
  t.push(n), t.length > 50 && t.shift(), r && r !== n && ce - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
636
642
  }, [ce]);
637
- const Ge = nr && !c || !ne || !Jn && !c, ir = (ut && !nr || ja && ut) && !$e.current, Ga = V(
638
- () => (Re ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
639
- [Re, c == null ? void 0 : c.data]
640
- ), Wa = as(Ga), Kt = si(), cr = Fo(ut && !$e.current), Ha = To({
641
- pending: ut && !$e.current,
643
+ const We = lr && !c || !J || !Xn && !c, ur = (ut && !lr || Ga && ut) && !qe.current, Ja = V(
644
+ () => (Ee ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
645
+ [Ee, c == null ? void 0 : c.data]
646
+ ), za = ss(Ja), Pt = mi(), mr = Eo(ut && !qe.current), Xa = Ao({
647
+ pending: ut && !qe.current,
642
648
  request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
643
649
  noun: "items"
644
- }), Ja = rs();
645
- async function dr(e, t) {
650
+ }), Za = os();
651
+ async function pr(e, t) {
646
652
  var p;
647
653
  const r = (await h.request(A(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
648
654
  if (!r || r.states.length === 0)
@@ -654,7 +660,7 @@ function Qc({
654
660
  );
655
661
  if (!s) throw new Error("No transition available to move this item here");
656
662
  let m = null;
657
- if (ii(s) && (m = await Kt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
663
+ if (pi(s) && (m = await Pt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
658
664
  throw new Error("Not moved — this move needs a note");
659
665
  await h.request(
660
666
  se(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
@@ -663,17 +669,17 @@ function Qc({
663
669
  })
664
670
  );
665
671
  }
666
- const Ya = Ne({
672
+ const el = Se({
667
673
  mutationFn: async ({ item: e, targetState: t }) => {
668
- await dr(e, t);
674
+ await pr(e, t);
669
675
  },
670
676
  onSuccess: () => {
671
677
  f.invalidateQueries({ queryKey: ["queue-items", l, g] });
672
678
  },
673
679
  onError: (e) => {
674
- O.error($t(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
680
+ D.error($t(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
675
681
  }
676
- }), Ee = Ne({
682
+ }), Ae = Se({
677
683
  mutationFn: (e) => h.request(
678
684
  se(`/queues/${l}/claim`, {
679
685
  source_collection: e.collection,
@@ -681,8 +687,8 @@ function Qc({
681
687
  })
682
688
  ),
683
689
  onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
684
- onError: () => O.error("Failed to claim item")
685
- }), We = Ne({
690
+ onError: () => D.error("Failed to claim item")
691
+ }), He = Se({
686
692
  mutationFn: (e) => h.request(
687
693
  se(`/queues/${l}/release`, {
688
694
  source_collection: e.collection,
@@ -690,18 +696,18 @@ function Qc({
690
696
  })
691
697
  ),
692
698
  onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
693
- onError: () => O.error("Failed to release item")
694
- }), { data: He } = W({
699
+ onError: () => D.error("Failed to release item")
700
+ }), { data: Ye } = W({
695
701
  queryKey: ["queue-column-prefs", l],
696
702
  queryFn: () => h.request(A(`/queues/${l}/column-prefs`)),
697
703
  enabled: !!l
698
- }), [Mt, Qt] = w(null), [Je, pn] = w(null);
699
- j(() => {
700
- He && pn(He.data.default_view_id);
701
- }, [He]);
702
- const [za, ur] = w({}), be = Re ? (c == null ? void 0 : c.groups) ?? null : null, Bt = (be ?? []).filter((e) => !ye.has(e.key)).map((e) => e.key).flatMap(
703
- (e) => Array.from({ length: za[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
704
- ), bn = Qe({
704
+ }), [Mt, Qt] = w(null), [Je, bn] = w(null);
705
+ M(() => {
706
+ Ye && bn(Ye.data.default_view_id);
707
+ }, [Ye]);
708
+ const [tl, br] = w({}), be = Ee ? (c == null ? void 0 : c.groups) ?? null : null, Bt = (be ?? []).filter((e) => !ye.has(e.key)).map((e) => e.key).flatMap(
709
+ (e) => Array.from({ length: tl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
710
+ ), hn = Be({
705
711
  queries: Bt.map(({ key: e, page: t }) => ({
706
712
  queryKey: [
707
713
  "queue-items",
@@ -709,7 +715,7 @@ function Qc({
709
715
  "group-rows",
710
716
  g,
711
717
  I,
712
- Te,
718
+ Re,
713
719
  $,
714
720
  e,
715
721
  t
@@ -722,23 +728,23 @@ function Qc({
722
728
  group_by: $,
723
729
  group_key: e,
724
730
  page: t,
725
- limit: di
731
+ limit: hi
726
732
  })
727
733
  ).then((n) => ({ key: e, rows: n.data })),
728
- enabled: !!c && Re,
734
+ enabled: !!c && Ee,
729
735
  placeholderData: (n) => n
730
736
  }))
731
- }), Xa = bn.map((e) => e.dataUpdatedAt).join(","), hn = V(() => {
737
+ }), nl = hn.map((e) => e.dataUpdatedAt).join(","), fn = V(() => {
732
738
  const e = /* @__PURE__ */ new Map();
733
- return bn.forEach((t, n) => {
739
+ return hn.forEach((t, n) => {
734
740
  if (!t.data) return;
735
741
  const r = Bt[n].key;
736
742
  e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
737
743
  }), e;
738
- }, [Xa, Bt.map((e) => `${e.key}\0${e.page}`).join("")]), Za = new Set(
739
- bn.flatMap((e, t) => e.isFetching ? [Bt[t].key] : [])
740
- ), F = be ? [...hn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
741
- ks(
744
+ }, [nl, Bt.map((e) => `${e.key}\0${e.page}`).join("")]), rl = new Set(
745
+ hn.flatMap((e, t) => e.isFetching ? [Bt[t].key] : [])
746
+ ), F = be ? [...fn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
747
+ _s(
742
748
  l ? {
743
749
  queue: {
744
750
  id: l,
@@ -749,8 +755,8 @@ function Qc({
749
755
  }
750
756
  } : null
751
757
  );
752
- const el = vs(), mt = F.some((e) => e.fulfilment !== void 0), pt = F.some((e) => e.send_backs !== void 0), { data: jt, dataUpdatedAt: tl } = W({
753
- queryKey: ["queue-live-stats", l, g, Te, Un],
758
+ const al = Ns(), mt = F.some((e) => e.fulfilment !== void 0), pt = F.some((e) => e.send_backs !== void 0), { data: jt, dataUpdatedAt: ll } = W({
759
+ queryKey: ["queue-live-stats", l, g, Re, Gn],
754
760
  queryFn: () => h.request(
755
761
  A(`/queues/${l}/items`, {
756
762
  scope: g,
@@ -759,35 +765,35 @@ function Qc({
759
765
  limit: 1
760
766
  })
761
767
  ),
762
- enabled: Un > 0 && !!c,
768
+ enabled: Gn > 0 && !!c,
763
769
  staleTime: Number.POSITIVE_INFINITY,
764
770
  placeholderData: (e) => e,
765
771
  retry: !1
766
- }), fn = !!jt && tl > ce, x = fn ? jt.stats : c == null ? void 0 : c.stats, X = fn ? jt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, mr = fn ? jt.state_counts : c == null ? void 0 : c.state_counts;
767
- jn.current = new Set(F.map((e) => `${e.collection}:${e.item_id}`));
768
- const bt = Xo(
772
+ }), gn = !!jt && ll > ce, x = gn ? jt.stats : c == null ? void 0 : c.stats, Z = gn ? jt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, hr = gn ? jt.state_counts : c == null ? void 0 : c.state_counts;
773
+ Vn.current = new Set(F.map((e) => `${e.collection}:${e.item_id}`));
774
+ const bt = ts(
769
775
  F.map((e) => ({ collection: e.collection, id: e.item_id })),
770
- Sa
771
- ), pr = U(ce), br = U(0);
772
- !$e.current && ce !== br.current && (pr.current = ce), j(() => {
776
+ Fa
777
+ ), fr = U(ce), gr = U(0);
778
+ !qe.current && ce !== gr.current && (fr.current = ce), M(() => {
773
779
  const e = new Set(F.map((t) => `${t.collection}:${t.item_id}`));
774
- if ($e.current) {
775
- $e.current = !1, br.current = ce;
780
+ if (qe.current) {
781
+ qe.current = !1, gr.current = ce;
776
782
  const t = At.current;
777
783
  At.current = [];
778
- const n = In.current, r = /* @__PURE__ */ new Set();
784
+ const n = Wn.current, r = /* @__PURE__ */ new Set();
779
785
  for (const o of t)
780
- !e.has(o.key) || r.has(o.key) || (r.add(o.key), Ce.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
786
+ !e.has(o.key) || r.has(o.key) || (r.add(o.key), $e.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
781
787
  if (n) {
782
788
  const o = [...e].filter((s) => !n.has(s) && !r.has(s));
783
- o.length > 0 && o.length <= 20 && Ce.note(o, null, "create");
789
+ o.length > 0 && o.length <= 20 && $e.note(o, null, "create");
784
790
  }
785
791
  }
786
- In.current = e;
787
- }, [ce]), j(() => {
792
+ Wn.current = e;
793
+ }, [ce]), M(() => {
788
794
  Et(0);
789
795
  }, [c]);
790
- function nl() {
796
+ function ol() {
791
797
  f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Et(0);
792
798
  }
793
799
  const { data: he } = W({
@@ -821,11 +827,11 @@ function Qc({
821
827
  )
822
828
  ],
823
829
  [i == null ? void 0 : i.sources]
824
- ), { data: rl } = W({
830
+ ), { data: sl } = W({
825
831
  queryKey: ["collections"],
826
832
  queryFn: () => h.request(A("/collections")).then((e) => e.data),
827
833
  staleTime: 300 * 1e3
828
- }), Ye = Qe({
834
+ }), ze = Be({
829
835
  queries: ft.map((e) => ({
830
836
  queryKey: ["queue-collection-addendums", e],
831
837
  queryFn: () => h.request(
@@ -836,39 +842,39 @@ function Qc({
836
842
  }).catch(() => !1),
837
843
  staleTime: 300 * 1e3
838
844
  }))
839
- }).some((e) => e.data === !0), { data: gn = [] } = W({
845
+ }).some((e) => e.data === !0), { data: xn = [] } = W({
840
846
  queryKey: ["queue-integrations-collections"],
841
847
  queryFn: () => h.request(A("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
842
848
  staleTime: 300 * 1e3
843
- }), ve = ft.some((e) => gn.includes(e)), xn = V(() => {
849
+ }), ve = ft.some((e) => xn.includes(e)), yn = V(() => {
844
850
  var t;
845
851
  const e = {};
846
852
  if (!ve) return e;
847
853
  for (const n of F) {
848
- if (!gn.includes(n.collection)) continue;
854
+ if (!xn.includes(n.collection)) continue;
849
855
  const r = e[t = n.collection] ?? (e[t] = []);
850
856
  r.length < 500 && r.push(n.item_id);
851
857
  }
852
858
  return e;
853
- }, [F, gn, ve]), hr = Object.keys(xn), fr = Qe({
854
- queries: hr.map((e) => ({
855
- queryKey: ["queue-integrations-summary", e, xn[e].join(",")],
859
+ }, [F, xn, ve]), xr = Object.keys(yn), yr = Be({
860
+ queries: xr.map((e) => ({
861
+ queryKey: ["queue-integrations-summary", e, yn[e].join(",")],
856
862
  queryFn: () => h.request(
857
863
  se("/integration-obligations/summary", {
858
864
  collection: e,
859
- ids: xn[e]
865
+ ids: yn[e]
860
866
  })
861
867
  ).then((t) => t.data ?? {}).catch(() => ({})),
862
868
  staleTime: 3e4
863
869
  }))
864
- }), al = fr.map((e) => e.dataUpdatedAt).join(","), ll = V(() => {
870
+ }), il = yr.map((e) => e.dataUpdatedAt).join(","), cl = V(() => {
865
871
  const e = {};
866
- return hr.forEach((t, n) => {
872
+ return xr.forEach((t, n) => {
867
873
  var o;
868
- const r = ((o = fr[n]) == null ? void 0 : o.data) ?? {};
874
+ const r = ((o = yr[n]) == null ? void 0 : o.data) ?? {};
869
875
  for (const [s, m] of Object.entries(r)) e[`${t}:${s}`] = m;
870
876
  }), e;
871
- }, [al]), yn = V(() => {
877
+ }, [il]), kn = V(() => {
872
878
  var t;
873
879
  const e = {};
874
880
  for (const n of F) {
@@ -878,21 +884,21 @@ function Qc({
878
884
  r.length < 500 && r.push(n.item_id);
879
885
  }
880
886
  return e;
881
- }, [F]), kn = Object.keys(yn), gr = Qe({
882
- queries: kn.map((e) => ({
883
- queryKey: ["queue-task-counts", e, yn[e].join(",")],
887
+ }, [F]), vn = Object.keys(kn), kr = Be({
888
+ queries: vn.map((e) => ({
889
+ queryKey: ["queue-task-counts", e, kn[e].join(",")],
884
890
  queryFn: () => h.request(
885
- se("/tasks/counts", { collection: e, ids: yn[e] })
891
+ se("/tasks/counts", { collection: e, ids: kn[e] })
886
892
  ).then((t) => t.data ?? {}).catch(() => ({})),
887
893
  staleTime: 3e4
888
894
  }))
889
- }), ol = gr.map((e) => e.dataUpdatedAt).join(","), sl = V(() => {
895
+ }), dl = kr.map((e) => e.dataUpdatedAt).join(","), ul = V(() => {
890
896
  const e = {};
891
- return kn.forEach((t, n) => {
897
+ return vn.forEach((t, n) => {
892
898
  var r;
893
- for (const [o, s] of Object.entries(((r = gr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
899
+ for (const [o, s] of Object.entries(((r = kr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
894
900
  }), e;
895
- }, [ol]), xr = kn.length > 0, yr = Qe({
901
+ }, [dl]), vr = vn.length > 0, wr = Be({
896
902
  queries: ft.map((e) => ({
897
903
  queryKey: ["queue-collection-risk-rules", e],
898
904
  queryFn: () => h.request(
@@ -900,9 +906,9 @@ function Qc({
900
906
  ).then((t) => t.data ?? []).catch(() => []),
901
907
  staleTime: 300 * 1e3
902
908
  }))
903
- }), il = yr.map((e) => e.dataUpdatedAt).join(","), kr = V(() => {
909
+ }), ml = wr.map((e) => e.dataUpdatedAt).join(","), _r = V(() => {
904
910
  const e = /* @__PURE__ */ new Map();
905
- for (const t of yr)
911
+ for (const t of wr)
906
912
  for (const n of t.data ?? []) {
907
913
  const r = e.get(n.name);
908
914
  e.set(n.name, {
@@ -911,7 +917,7 @@ function Qc({
911
917
  });
912
918
  }
913
919
  return [...e.values()];
914
- }, [il]), vr = Qe({
920
+ }, [ml]), Nr = Be({
915
921
  queries: ft.map((e) => ({
916
922
  queryKey: ["queue-collection-states", e],
917
923
  queryFn: () => h.request(
@@ -919,57 +925,57 @@ function Qc({
919
925
  ).then((t) => t.data),
920
926
  staleTime: 300 * 1e3
921
927
  }))
922
- }), wr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), we = V(() => {
928
+ }), Sr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), we = V(() => {
923
929
  const e = {};
924
- for (const t of vr)
930
+ for (const t of Nr)
925
931
  (t.data ?? []).forEach((n, r) => {
926
932
  e[n.key] = { label: n.label, color: n.color, sort: r };
927
933
  });
928
934
  return e;
929
- }, [vr.map((e) => e.data)]), _r = x ? Object.entries(x.by_state).sort(
935
+ }, [Nr.map((e) => e.data)]), Cr = x ? Object.entries(x.by_state).sort(
930
936
  (e, t) => {
931
937
  var n, r;
932
938
  return (((n = we[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = we[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
933
939
  }
934
- ) : [], Nr = (e) => [...e].sort(
940
+ ) : [], $r = (e) => [...e].sort(
935
941
  (t, n) => {
936
942
  var r, o;
937
943
  return (((r = we[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = we[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
938
944
  }
939
- ), vn = V(() => {
945
+ ), wn = V(() => {
940
946
  const e = {};
941
947
  for (const [t, n] of Object.entries(we)) e[t] = n.label;
942
948
  return e;
943
- }, [we]), Ae = (e) => e ? e === "none" ? "No State" : vn[e] ?? wr(e) : "—", gt = (e) => {
944
- if (e === zt) return "Addendums";
945
- const t = (rl ?? []).find((n) => n.collection === e);
946
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || wr(e);
949
+ }, [we]), Le = (e) => e ? e === "none" ? "No State" : wn[e] ?? Sr(e) : "—", gt = (e) => {
950
+ if (e === Xt) return "Addendums";
951
+ const t = (sl ?? []).find((n) => n.collection === e);
952
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Sr(e);
947
953
  }, le = V(() => $ ? be ? be.map((e) => ({
948
954
  key: e.key,
949
- rows: hn.get(e.key) ?? [],
955
+ rows: fn.get(e.key) ?? [],
950
956
  breached: e.breached,
951
957
  atRisk: e.at_risk,
952
958
  count: e.count,
953
959
  sums: e.sums ?? {}
954
- })) : os(F, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [F, $, be, hn]), wn = U(null);
955
- j(() => {
960
+ })) : cs(F, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [F, $, be, fn]), _n = U(null);
961
+ M(() => {
956
962
  if (!$ || !le) {
957
- wn.current = null;
963
+ _n.current = null;
958
964
  return;
959
965
  }
960
- if (Re && !be || wn.current === $) return;
961
- wn.current = $;
966
+ if (Ee && !be || _n.current === $) return;
967
+ _n.current = $;
962
968
  const e = le.reduce((t, n) => t + n.count, 0);
963
- Xt(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), ur({});
969
+ Zt(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), br({});
964
970
  }, [$, be]);
965
- function cl(e) {
966
- Xt((t) => {
971
+ function pl(e) {
972
+ Zt((t) => {
967
973
  const n = new Set(t);
968
974
  return n.has(e) ? n.delete(e) : n.add(e), n;
969
975
  });
970
976
  }
971
- const oe = V(() => le ? le.filter((e) => !ye.has(e.key)).flatMap((e) => e.rows) : F, [le, F, ye]), P = (e) => `${e.collection}:${e.item_id}`, [_e, Le] = w(null), [dl, _n] = w(!1), [Ut, It] = w(null), Nn = (e) => {
972
- if (e.collection === zt && e.url) {
977
+ const oe = V(() => le ? le.filter((e) => !ye.has(e.key)).flatMap((e) => e.rows) : F, [le, F, ye]), K = (e) => `${e.collection}:${e.item_id}`, [_e, Oe] = w(null), [bl, Nn] = w(!1), [Ut, It] = w(null), Sn = (e) => {
978
+ if (e.collection === Xt && e.url) {
973
979
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
974
980
  if (t) {
975
981
  const n = {};
@@ -989,33 +995,33 @@ function Qc({
989
995
  };
990
996
  }, xt = (e) => {
991
997
  var t;
992
- i && ka({
998
+ i && Na({
993
999
  queue_id: l,
994
1000
  name: i.name,
995
1001
  path: `${window.location.pathname}${window.location.search}`,
996
1002
  at: Date.now(),
997
1003
  scroll: ((t = Gt.current) == null ? void 0 : t.scrollTop) ?? 0,
998
1004
  state: { scope: g, page: de, sort: I, filters: _, group_by: $, view: q }
999
- }), H.open(Nn(e));
1000
- }, [Q, yt] = w(
1005
+ }), H.open(Sn(e));
1006
+ }, [B, yt] = w(
1001
1007
  null
1002
1008
  );
1003
- j(() => {
1004
- if (!Q) return;
1009
+ M(() => {
1010
+ if (!B) return;
1005
1011
  const e = () => yt(null);
1006
1012
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
1007
1013
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
1008
1014
  };
1009
- }, [Q]);
1015
+ }, [B]);
1010
1016
  const Vt = (e) => {
1011
- It(P(e));
1017
+ It(K(e));
1012
1018
  const t = (u == null ? void 0 : u.row_click) ?? "preview";
1013
- if (t === "full" || e.collection === zt) {
1019
+ if (t === "full" || e.collection === Xt) {
1014
1020
  xt(e);
1015
1021
  return;
1016
1022
  }
1017
1023
  if (t === "layout") {
1018
- Qr({
1024
+ Ir({
1019
1025
  collection: e.collection,
1020
1026
  itemId: e.item_id,
1021
1027
  rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
@@ -1024,85 +1030,96 @@ function Qc({
1024
1030
  });
1025
1031
  return;
1026
1032
  }
1027
- Le(e);
1033
+ Oe(e);
1028
1034
  };
1029
- j(() => {
1035
+ M(() => {
1030
1036
  if (!_e) return;
1031
- const e = F.find((t) => P(t) === P(_e));
1032
- e && e !== _e && Le(e);
1037
+ const e = F.find((t) => K(t) === K(_e));
1038
+ e && e !== _e && Oe(e);
1033
1039
  }, [F]);
1034
- const ul = (e) => !e.claimed_by || e.claimed_by.id === S;
1035
- function Sr(e) {
1036
- const t = e ? oe.findIndex((r) => P(r) === P(e)) + 1 : 0, n = oe.slice(t).find(ul);
1040
+ const hl = (e) => !e.claimed_by || e.claimed_by.id === S;
1041
+ function qr(e) {
1042
+ const t = e ? oe.findIndex((r) => K(r) === K(e)) + 1 : 0, n = oe.slice(t).find(hl);
1037
1043
  if (!n) {
1038
- _n(!1), Le(null), O.info("Nothing left to work on — queue clear!");
1044
+ Nn(!1), Oe(null), D.info("Nothing left to work on — queue clear!");
1039
1045
  return;
1040
1046
  }
1041
- if (It(P(n)), me && !n.claimed_by && Ee.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1047
+ if (It(K(n)), me && !n.claimed_by && Ae.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1042
1048
  xt(n);
1043
1049
  return;
1044
1050
  }
1045
- _n(!0), Le(n);
1051
+ Nn(!0), Oe(n);
1046
1052
  }
1047
- j(() => {
1053
+ M(() => {
1048
1054
  if (q !== "table") return;
1049
1055
  function e(t) {
1050
1056
  var o;
1051
1057
  const n = t.target;
1052
1058
  if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
1053
1059
  return;
1054
- const r = Ut ? oe.findIndex((s) => P(s) === Ut) : -1;
1060
+ const r = Ut ? oe.findIndex((s) => K(s) === Ut) : -1;
1055
1061
  if (t.key === "j" || t.key === "ArrowDown") {
1056
1062
  t.preventDefault();
1057
1063
  const s = oe[Math.min(r + 1, oe.length - 1)];
1058
- s && It(P(s));
1064
+ s && It(K(s));
1059
1065
  } else if (t.key === "k" || t.key === "ArrowUp") {
1060
1066
  t.preventDefault();
1061
1067
  const s = oe[Math.max(r - 1, 0)];
1062
- s && It(P(s));
1068
+ s && It(K(s));
1063
1069
  } else if (t.key === "Enter" && r >= 0 && !_e)
1064
1070
  t.preventDefault(), Vt(oe[r]);
1065
1071
  else if (t.key === "c" && r >= 0 && me) {
1066
1072
  t.preventDefault();
1067
1073
  const s = oe[r];
1068
- ((o = s.claimed_by) == null ? void 0 : o.id) === S ? We.mutate(s) : Ee.mutate(s);
1074
+ ((o = s.claimed_by) == null ? void 0 : o.id) === S ? He.mutate(s) : Ae.mutate(s);
1069
1075
  } else t.key === "o" && r >= 0 && (t.preventDefault(), xt(oe[r]));
1070
1076
  }
1071
1077
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1072
- }, [q, oe, Ut, _e, S, Ee, We, me]);
1073
- const { data: B } = W({
1078
+ }, [q, oe, Ut, _e, S, Ae, He, me]);
1079
+ const { data: j } = W({
1074
1080
  queryKey: ["queue-views", l],
1075
1081
  queryFn: () => h.request(A(`/queues/${l}/views`)),
1076
1082
  enabled: !!l
1077
- }), [ze, Xe] = w(null), [ml, Sn] = w(!1), [Cn, Cr] = w(""), [$r, qr] = w(!1), [kt, Fr] = w(!1);
1083
+ }), [Xe, Ze] = w(null), [fl, Cn] = w(!1), [$n, Fr] = w(""), [Tr, Rr] = w(!1), [kt, Er] = w(!1);
1078
1084
  function vt(e) {
1079
1085
  const t = e.state ?? {};
1080
- z(t.scope ?? "all"), M({ ...ue.current, ...t.filters ?? {} }), je(t.sort ?? ""), ot(t.group_by ?? null), Qt(t.columns ?? null), en(t.pins ?? null), t.view && Be(Fe.includes(t.view) ? t.view : Fe[0]), D(1), Xe(e.id);
1086
+ Y(t.scope ?? "all"), Q({ ...ue.current, ...t.filters ?? {} }), Ue(t.sort ?? ""), ot(t.group_by ?? null), Qt(t.columns ?? null), tn(t.pins ?? null), t.view && je(Te.includes(t.view) ? t.view : Te[0]), O(1), Ze(e.id);
1081
1087
  }
1082
- function pl() {
1088
+ function gl() {
1083
1089
  var t, n;
1084
- const e = B == null ? void 0 : B.data.find((r) => r.is_default);
1090
+ const e = j == null ? void 0 : j.data.find((r) => r.is_default);
1085
1091
  if (e) {
1086
1092
  vt(e);
1087
1093
  return;
1088
1094
  }
1089
- z(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...ue.current }), je(""), ot(null), Qt(null), en(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && Be(i.display_config.default_view), D(1), Xe(null);
1095
+ Y(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...ue.current }), Ue(""), ot(null), Qt(null), tn(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && je(i.display_config.default_view), O(1), Ze(null);
1090
1096
  }
1091
- j(() => {
1092
- if (ne || !(i != null && i.display_config) || He === void 0 || B === void 0) return;
1093
- const e = He.data.default_view_id, t = e != null ? B.data.find((r) => r.id === e) : void 0, n = B.data.find((r) => r.is_default);
1094
- t ? vt(t) : n ? vt(n) : (Be(i.display_config.default_view), z(i.display_config.default_scope)), Ta(!0);
1095
- }, [i, He, B, ne]);
1097
+ M(() => {
1098
+ if (J || !(i != null && i.display_config) || Ye === void 0 || j === void 0) return;
1099
+ const e = Ye.data.default_view_id, t = e != null ? j.data.find((r) => r.id === e) : void 0, n = j.data.find((r) => r.is_default);
1100
+ t ? vt(t) : n ? vt(n) : (je(i.display_config.default_view), Y(i.display_config.default_scope)), La(!0);
1101
+ }, [i, Ye, j, J]);
1096
1102
  const Gt = U(null), Wt = U(null);
1097
- j(() => {
1098
- if (!ne) return;
1099
- const e = Ds();
1103
+ M(() => {
1104
+ if (!J) return;
1105
+ const e = Ms();
1100
1106
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1101
- ka({ ...e, restore: !1 });
1107
+ Na({ ...e, restore: !1 });
1102
1108
  const t = e.state ?? {};
1103
- t.scope && z(t.scope), t.filters && M({ ...ue.current, ...t.filters }), t.sort != null && je(t.sort), ot(t.group_by ?? null), t.view && Be(t.view), t.page && D(t.page), Wt.current = e.scroll ?? 0;
1104
- }, [ne, l]), j(() => {
1105
- if (!ne || typeof window > "u") return;
1109
+ t.scope && Y(t.scope), t.filters && Q({ ...ue.current, ...t.filters }), t.sort != null && Ue(t.sort), ot(t.group_by ?? null), t.view && je(t.view), t.page && O(t.page), Wt.current = e.scroll ?? 0;
1110
+ }, [J, l]), M(() => {
1111
+ if (!J || typeof window > "u") return;
1112
+ const e = new URLSearchParams(window.location.search), t = e.get("scope");
1113
+ if (t !== "all" && t !== "mine") return;
1114
+ e.delete("scope");
1115
+ const n = e.toString();
1116
+ window.history.replaceState(
1117
+ window.history.state,
1118
+ "",
1119
+ `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1120
+ ), Y(t), O(1);
1121
+ }, [J]), M(() => {
1122
+ if (!J || typeof window > "u") return;
1106
1123
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1107
1124
  if (!t) return;
1108
1125
  e.delete("owner");
@@ -1111,17 +1128,17 @@ function Qc({
1111
1128
  window.history.state,
1112
1129
  "",
1113
1130
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1114
- ), z("all"), M((r) => ({ ...r, owners: [t] })), Xe(null), D(1);
1115
- }, [ne]), j(() => {
1116
- if (!ne) return;
1117
- const e = Wo(Ho(`queue:${l}`));
1118
- e && (Jo(), vt({
1131
+ ), Y("all"), Q((r) => ({ ...r, owners: [t] })), Ze(null), O(1);
1132
+ }, [J]), M(() => {
1133
+ if (!J) return;
1134
+ const e = Jo(zo(`queue:${l}`));
1135
+ e && (Xo(), vt({
1119
1136
  id: -1,
1120
1137
  // Saved views type filters loosely as strings; multi-selects ride as arrays there too.
1121
1138
  state: e
1122
- }), Xe(null), e.page && D(e.page));
1123
- }, [ne]);
1124
- const bl = () => ({
1139
+ }), Ze(null), e.page && O(e.page));
1140
+ }, [J]);
1141
+ const xl = () => ({
1125
1142
  scope: g,
1126
1143
  filters: _,
1127
1144
  sort: I,
@@ -1131,29 +1148,29 @@ function Qc({
1131
1148
  pins: it,
1132
1149
  ...de > 1 ? { page: de } : {}
1133
1150
  });
1134
- j(() => {
1151
+ M(() => {
1135
1152
  Wt.current == null || F.length === 0 || !Gt.current || (Gt.current.scrollTop = Wt.current, Wt.current = null);
1136
1153
  }, [F]);
1137
- const { isAdmin: Oe } = ga(), hl = F.map((e) => `${e.collection}|${e.item_id}`).join(","), fl = V(
1154
+ const { isAdmin: De } = va(), yl = F.map((e) => `${e.collection}|${e.item_id}`).join(","), kl = V(
1138
1155
  () => F.map((e) => ({ collection: e.collection, id: e.item_id })),
1139
- [hl]
1140
- ), Tr = js(fl, Oe), gl = (e) => Ut === P(e) ? (
1156
+ [yl]
1157
+ ), Ar = Vs(kl, De), vl = (e) => Ut === K(e) ? (
1141
1158
  // Pinned sticky cells use bg-inherit — the highlight must be
1142
1159
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
1143
1160
  // scrolled content bleeds through the pinned columns. Same
1144
1161
  // pair DataTable uses for selected rows when pins are active.
1145
1162
  "bg-[#f2fdff] dark:bg-[#20303a]"
1146
- ) : e.at_risk ? us(e.at_risk_color ?? "red") : void 0, Rr = Oe || (i == null ? void 0 : i.owner) != null && i.owner === S, xl = Ne({
1147
- mutationFn: ({ viewId: e, on: t }) => h.request(xa(`/queues/views/${e}`, { is_default: t })),
1163
+ ) : e.at_risk ? bs(e.at_risk_color ?? "red") : void 0, Lr = De || (i == null ? void 0 : i.owner) != null && i.owner === S, wl = Se({
1164
+ mutationFn: ({ viewId: e, on: t }) => h.request(wa(`/queues/views/${e}`, { is_default: t })),
1148
1165
  onSuccess: () => {
1149
- f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("Queue default view updated");
1166
+ f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("Queue default view updated");
1150
1167
  },
1151
- onError: () => O.error("Could not update the queue default view")
1152
- }), Er = Ne({
1168
+ onError: () => D.error("Could not update the queue default view")
1169
+ }), Or = Se({
1153
1170
  mutationFn: () => h.request(
1154
1171
  se(`/queues/${l}/views`, {
1155
- name: Cn.trim(),
1156
- is_shared: $r || kt,
1172
+ name: $n.trim(),
1173
+ is_shared: Tr || kt,
1157
1174
  is_default: kt,
1158
1175
  state: {
1159
1176
  scope: g,
@@ -1167,12 +1184,12 @@ function Qc({
1167
1184
  })
1168
1185
  ),
1169
1186
  onSuccess: (e) => {
1170
- Sn(!1), Cr(""), qr(!1), Fr(!1), Xe(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("View saved");
1187
+ Cn(!1), Fr(""), Rr(!1), Er(!1), Ze(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("View saved");
1171
1188
  },
1172
- onError: () => O.error("Failed to save view")
1173
- }), [Ar, Lr] = w(null), De = Ne({
1189
+ onError: () => D.error("Failed to save view")
1190
+ }), [Dr, Kr] = w(null), Ke = Se({
1174
1191
  mutationFn: (e) => h.request(
1175
- xa(`/queues/views/${e.id}`, {
1192
+ wa(`/queues/views/${e.id}`, {
1176
1193
  state: {
1177
1194
  scope: g,
1178
1195
  filters: _,
@@ -1185,68 +1202,74 @@ function Qc({
1185
1202
  })
1186
1203
  ),
1187
1204
  onSuccess: (e, t) => {
1188
- f.invalidateQueries({ queryKey: ["queue-views", l] }), Lr(t.id), setTimeout(() => Lr((n) => n === t.id ? null : n), 2e3), O.success(`Saved "${t.name}" with the current filters, scope and sort`);
1205
+ f.invalidateQueries({ queryKey: ["queue-views", l] }), Kr(t.id), setTimeout(() => Kr((n) => n === t.id ? null : n), 2e3), D.success(`Saved "${t.name}" with the current filters, scope and sort`);
1189
1206
  },
1190
- onError: () => O.error("Failed to update view")
1191
- }), yl = Ne({
1192
- mutationFn: (e) => h.request(Dn(`/queues/views/${e}`)),
1207
+ onError: () => D.error("Failed to update view")
1208
+ }), [qn, Ht] = w(null);
1209
+ M(() => {
1210
+ if (qn == null) return;
1211
+ const e = setTimeout(() => Ht(null), 5e3);
1212
+ return () => clearTimeout(e);
1213
+ }, [qn]);
1214
+ const Pr = Se({
1215
+ mutationFn: (e) => h.request(Mn(`/queues/views/${e}`)),
1193
1216
  onSuccess: (e, t) => {
1194
- f.invalidateQueries({ queryKey: ["queue-views", l] }), Xe(null), Je === t && pn(null);
1217
+ Ht(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), Ze(null), Je === t && bn(null);
1195
1218
  },
1196
- onError: () => O.error("Failed to delete view")
1197
- }), kl = Ne({
1198
- mutationFn: (e) => h.request(Eo(`/queues/${l}/default-view`, { view_id: e })),
1199
- onMutate: (e) => pn(e),
1219
+ onError: () => D.error("Failed to delete view")
1220
+ }), _l = Se({
1221
+ mutationFn: (e) => h.request(Oo(`/queues/${l}/default-view`, { view_id: e })),
1222
+ onMutate: (e) => bn(e),
1200
1223
  onSuccess: (e, t) => {
1201
- f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.success(
1224
+ f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.success(
1202
1225
  t === null ? "Reverted to the general default" : "Set as your default view"
1203
1226
  );
1204
1227
  },
1205
1228
  onError: () => {
1206
- f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.error("Failed to update default view");
1229
+ f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.error("Failed to update default view");
1207
1230
  }
1208
- }), [Pe, Ze] = w([]), [Z, Or] = w(!1), vl = () => {
1209
- Z && Ze([]), Or(!Z);
1231
+ }), [Pe, et] = w([]), [ee, Mr] = w(!1), Nl = () => {
1232
+ ee && et([]), Mr(!ee);
1210
1233
  };
1211
- j(() => {
1212
- q !== "table" && Z && (Or(!1), Ze([]));
1213
- }, [q, Z]), Ro(), Gn.current = Pe.length;
1214
- const [Dr, Pr] = w(!1);
1215
- async function $n(e, t) {
1216
- const n = F.filter((m) => Pe.includes(P(m)));
1217
- Pr(!0), Kt.beginBatch();
1234
+ M(() => {
1235
+ q !== "table" && ee && (Mr(!1), et([]));
1236
+ }, [q, ee]), Lo(), Yn.current = Pe.length;
1237
+ const [Qr, Br] = w(!1);
1238
+ async function Fn(e, t) {
1239
+ const n = F.filter((m) => Pe.includes(K(m)));
1240
+ Br(!0), Pt.beginBatch();
1218
1241
  const r = await Promise.allSettled(n.map(t));
1219
- Kt.endBatch();
1242
+ Pt.endBatch();
1220
1243
  const o = r.filter((m) => m.status === "fulfilled").length, s = r.length - o;
1221
- Pr(!1), Ze([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? O.warning(`${e}: ${o} succeeded, ${s} failed`) : O.success(`${e}: ${o} succeeded`);
1244
+ Br(!1), et([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? D.warning(`${e}: ${o} succeeded, ${s} failed`) : D.success(`${e}: ${o} succeeded`);
1222
1245
  }
1223
- const Ke = (e) => {
1246
+ const Me = (e) => {
1224
1247
  var t;
1225
1248
  for (const n of (i == null ? void 0 : i.sources) ?? []) {
1226
1249
  const r = (t = n.column_formats) == null ? void 0 : t[e];
1227
1250
  if (r) return r;
1228
1251
  }
1229
1252
  return null;
1230
- }, wl = (e) => {
1231
- if ($ === "state") return e === "No state" ? e : Ae(e);
1253
+ }, Sl = (e) => {
1254
+ if ($ === "state") return e === "No state" ? e : Le(e);
1232
1255
  if ($ === "collection") return gt(e);
1233
1256
  if ($ != null && $.startsWith("extra.") && e !== "—") {
1234
- const t = Ke($.slice(6));
1257
+ const t = Me($.slice(6));
1235
1258
  if (t) return tt(e, t);
1236
1259
  }
1237
1260
  return e;
1238
- }, _l = le == null ? void 0 : le.map((e) => ({
1261
+ }, Cl = le == null ? void 0 : le.map((e) => ({
1239
1262
  key: e.key,
1240
1263
  rows: e.rows,
1241
- header: /* @__PURE__ */ d(Se, { children: [
1242
- /* @__PURE__ */ a("span", { children: wl(e.key) }),
1264
+ header: /* @__PURE__ */ d(Ce, { children: [
1265
+ /* @__PURE__ */ a("span", { children: Sl(e.key) }),
1243
1266
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1244
1267
  "(",
1245
1268
  ie(e.count),
1246
1269
  ")"
1247
1270
  ] }),
1248
1271
  Object.entries(e.sums).map(([t, n]) => {
1249
- const r = Ke(t);
1272
+ const r = Me(t);
1250
1273
  return /* @__PURE__ */ d(
1251
1274
  "span",
1252
1275
  {
@@ -1262,14 +1285,14 @@ function Qc({
1262
1285
  t
1263
1286
  );
1264
1287
  }),
1265
- be && !ye.has(e.key) && Za.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1288
+ be && !ye.has(e.key) && rl.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1266
1289
  be && !ye.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1267
1290
  "button",
1268
1291
  {
1269
1292
  type: "button",
1270
1293
  "data-queue-group-more": e.key,
1271
1294
  onClick: (t) => {
1272
- t.stopPropagation(), ur((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1295
+ t.stopPropagation(), br((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1273
1296
  },
1274
1297
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
1275
1298
  children: [
@@ -1290,13 +1313,13 @@ function Qc({
1290
1313
  " at risk"
1291
1314
  ] })
1292
1315
  ] })
1293
- })), qn = (((ta = c == null ? void 0 : c.available_values.collection) == null ? void 0 : ta.length) ?? 0) > 1, Kr = F.some((e) => !!e.unseen) || bt.size > 0 || F.some((e) => Ce.isNew(P(e))), Mr = [
1294
- ...qn ? [
1316
+ })), Tn = (((la = c == null ? void 0 : c.available_values.collection) == null ? void 0 : la.length) ?? 0) > 1, jr = F.some((e) => !!e.unseen) || bt.size > 0 || F.some((e) => $e.isNew(K(e))), Ur = [
1317
+ ...Tn ? [
1295
1318
  {
1296
1319
  key: "collection",
1297
1320
  header: E("collection", "Collection"),
1298
1321
  sortable: !0,
1299
- render: (e) => /* @__PURE__ */ a(Ys, { variant: "outline", children: gt(e.collection) })
1322
+ render: (e) => /* @__PURE__ */ a(Zs, { variant: "outline", children: gt(e.collection) })
1300
1323
  }
1301
1324
  ] : [],
1302
1325
  {
@@ -1304,22 +1327,22 @@ function Qc({
1304
1327
  header: E("label", "Item"),
1305
1328
  sortable: !0,
1306
1329
  // Room in the left padding for the hanging unseen mark (#643).
1307
- className: Kr ? "pl-[30px]" : void 0,
1308
- headerClassName: Kr ? "pl-[30px]" : void 0,
1330
+ className: jr ? "pl-[30px]" : void 0,
1331
+ headerClassName: jr ? "pl-[30px]" : void 0,
1309
1332
  render: (e) => (
1310
1333
  // Underlined because clicking opens the item. The row is clickable as
1311
1334
  // a whole, but nothing on it said so — an underline is the one
1312
1335
  // convention people already read as "this goes somewhere".
1313
1336
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1314
- bt.get(P(e)) || Ce.isNew(P(e)) ? /* @__PURE__ */ a(
1315
- Ks,
1337
+ bt.get(K(e)) || $e.isNew(K(e)) ? /* @__PURE__ */ a(
1338
+ Bs,
1316
1339
  {
1317
- lock: bt.get(P(e)),
1318
- isNew: Ce.isNew(P(e)),
1340
+ lock: bt.get(K(e)),
1341
+ isNew: $e.isNew(K(e)),
1319
1342
  dataAttr: "data-queue-live-mark",
1320
1343
  hang: !0
1321
1344
  }
1322
- ) : /* @__PURE__ */ a(Js, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1345
+ ) : /* @__PURE__ */ a(Xs, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1323
1346
  /* @__PURE__ */ a(
1324
1347
  "span",
1325
1348
  {
@@ -1338,9 +1361,9 @@ function Qc({
1338
1361
  t
1339
1362
  )),
1340
1363
  /* @__PURE__ */ a(
1341
- Hs,
1364
+ zs,
1342
1365
  {
1343
- viewers: Wa[ls(e.collection, e.item_id)],
1366
+ viewers: za[is(e.collection, e.item_id)],
1344
1367
  dataAttr: "data-queue-presence"
1345
1368
  }
1346
1369
  )
@@ -1359,9 +1382,9 @@ function Qc({
1359
1382
  backgroundColor: e.state_color ? `${e.state_color}1a` : void 0,
1360
1383
  color: e.state_color ?? void 0
1361
1384
  },
1362
- title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ae(e.state)}` : Ae(e.state),
1385
+ title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Le(e.state)}` : Le(e.state),
1363
1386
  children: [
1364
- Ae(e.state),
1387
+ Le(e.state),
1365
1388
  e.via_addendum && /* @__PURE__ */ a("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
1366
1389
  ]
1367
1390
  }
@@ -1371,13 +1394,13 @@ function Qc({
1371
1394
  key: "owners",
1372
1395
  header: E("owners", "Owners"),
1373
1396
  sortable: !0,
1374
- render: (e) => /* @__PURE__ */ a(ti, { owners: e.owners })
1397
+ render: (e) => /* @__PURE__ */ a(oi, { owners: e.owners })
1375
1398
  },
1376
1399
  {
1377
1400
  key: "aging_hours",
1378
1401
  header: E("aging_hours", "Aging"),
1379
1402
  sortable: !0,
1380
- render: (e) => pi(e.aging_hours)
1403
+ render: (e) => xi(e.aging_hours)
1381
1404
  },
1382
1405
  {
1383
1406
  // When the record entered its current state — the same moment Aging
@@ -1385,13 +1408,13 @@ function Qc({
1385
1408
  key: "state_entered",
1386
1409
  header: E("state_entered", "Last State Change"),
1387
1410
  sortable: !0,
1388
- render: (e) => e.state_entered_at ? Ko(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1411
+ render: (e) => e.state_entered_at ? Bo(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1389
1412
  },
1390
1413
  {
1391
1414
  key: "sla_status",
1392
1415
  header: E("sla_status", "SLA"),
1393
1416
  sortable: !0,
1394
- render: (e) => /* @__PURE__ */ a(bi, { status: e.sla_status })
1417
+ render: (e) => /* @__PURE__ */ a(yi, { status: e.sla_status })
1395
1418
  },
1396
1419
  {
1397
1420
  key: "at_risk",
@@ -1399,18 +1422,18 @@ function Qc({
1399
1422
  sortable: !0,
1400
1423
  render: (e) => {
1401
1424
  var t;
1402
- return e.at_risk ? /* @__PURE__ */ d("span", { className: ds(e.at_risk_color ?? "red"), children: [
1425
+ return e.at_risk ? /* @__PURE__ */ d("span", { className: ps(e.at_risk_color ?? "red"), children: [
1403
1426
  "⚑ ",
1404
1427
  ((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
1405
1428
  ] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
1406
1429
  }
1407
1430
  },
1408
- ...Ye ? [
1431
+ ...ze ? [
1409
1432
  {
1410
1433
  key: "addendums",
1411
1434
  header: E("addendums", "Addendums"),
1412
1435
  sortable: !1,
1413
- render: (e) => /* @__PURE__ */ a(mi, { summary: e.addendums })
1436
+ render: (e) => /* @__PURE__ */ a(gi, { summary: e.addendums })
1414
1437
  }
1415
1438
  ] : [],
1416
1439
  ...mt ? [
@@ -1419,7 +1442,7 @@ function Qc({
1419
1442
  header: E("fulfilment", "Shipped"),
1420
1443
  sortable: !0,
1421
1444
  render: (e) => /* @__PURE__ */ a(
1422
- Ts,
1445
+ As,
1423
1446
  {
1424
1447
  collection: e.collection,
1425
1448
  itemId: e.item_id,
@@ -1433,16 +1456,16 @@ function Qc({
1433
1456
  key: "integrations",
1434
1457
  header: E("integrations", "Integrations"),
1435
1458
  sortable: !1,
1436
- render: (e) => /* @__PURE__ */ a(As, { rows: ll[`${e.collection}:${e.item_id}`] })
1459
+ render: (e) => /* @__PURE__ */ a(Ds, { rows: cl[`${e.collection}:${e.item_id}`] })
1437
1460
  }
1438
1461
  ] : [],
1439
- ...xr ? [
1462
+ ...vr ? [
1440
1463
  {
1441
1464
  key: "tasks",
1442
1465
  header: E("tasks", "Tasks"),
1443
1466
  sortable: !1,
1444
1467
  render: (e) => {
1445
- const t = sl[`${e.collection}:${e.item_id}`];
1468
+ const t = ul[`${e.collection}:${e.item_id}`];
1446
1469
  return !t || t.open === 0 ? /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
1447
1470
  "span",
1448
1471
  {
@@ -1462,10 +1485,10 @@ function Qc({
1462
1485
  key: "send_backs",
1463
1486
  header: E("send_backs", "Sent back"),
1464
1487
  sortable: !0,
1465
- render: (e) => /* @__PURE__ */ a(ci, { summary: e.send_backs })
1488
+ render: (e) => /* @__PURE__ */ a(bi, { summary: e.send_backs })
1466
1489
  }
1467
1490
  ] : []
1468
- ], Nl = {
1491
+ ], $l = {
1469
1492
  key: "claim",
1470
1493
  header: "",
1471
1494
  render: (e) => e.claimed_by ? /* @__PURE__ */ a(
@@ -1473,7 +1496,7 @@ function Qc({
1473
1496
  {
1474
1497
  type: "button",
1475
1498
  onClick: (t) => {
1476
- t.stopPropagation(), We.mutate(e);
1499
+ t.stopPropagation(), He.mutate(e);
1477
1500
  },
1478
1501
  className: "text-[11px] text-slate-400 underline hover:text-slate-600",
1479
1502
  children: "Release"
@@ -1483,13 +1506,13 @@ function Qc({
1483
1506
  {
1484
1507
  type: "button",
1485
1508
  onClick: (t) => {
1486
- t.stopPropagation(), Ee.mutate(e);
1509
+ t.stopPropagation(), Ae.mutate(e);
1487
1510
  },
1488
1511
  className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
1489
1512
  children: "Claim"
1490
1513
  }
1491
1514
  )
1492
- }, wt = (i == null ? void 0 : i.available_extra_fields) ?? [], _t = $o("drill.queue"), re = _t.value, Qr = (e) => _t.push([e]), Sl = (e) => {
1515
+ }, wt = (i == null ? void 0 : i.available_extra_fields) ?? [], _t = To("drill.queue"), ae = _t.value, Ir = (e) => _t.push([e]), ql = (e) => {
1493
1516
  var t;
1494
1517
  for (const n of (i == null ? void 0 : i.sources) ?? []) {
1495
1518
  const r = (t = n.drilldown) == null ? void 0 : t[e];
@@ -1501,78 +1524,78 @@ function Qc({
1501
1524
  };
1502
1525
  }
1503
1526
  return { enabled: !0, layout_id: null, width: null };
1504
- }, Cl = V(() => {
1527
+ }, Fl = V(() => {
1505
1528
  const e = {};
1506
1529
  for (const t of (i == null ? void 0 : i.sources) ?? [])
1507
1530
  for (const [n, r] of Object.entries(t.column_formats ?? {}))
1508
1531
  n in e || (e[n] = r);
1509
1532
  return e;
1510
- }, [i == null ? void 0 : i.sources]), $l = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ql = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1511
- function Fl(e) {
1512
- if ($l.test(e)) return { text: e.split("@")[0], title: e };
1513
- if (ql.test(e)) {
1533
+ }, [i == null ? void 0 : i.sources]), Tl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Rl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1534
+ function El(e) {
1535
+ if (Tl.test(e)) return { text: e.split("@")[0], title: e };
1536
+ if (Rl.test(e)) {
1514
1537
  const t = new Date(e);
1515
1538
  if (!Number.isNaN(t.getTime()))
1516
1539
  return {
1517
- text: ys(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1518
- title: xs(t)
1540
+ text: ws(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1541
+ title: vs(t)
1519
1542
  };
1520
1543
  }
1521
1544
  return { text: e, title: e };
1522
1545
  }
1523
- const Fn = jo(u == null ? void 0 : u.inline_edit), Br = Fn.enabled ? [
1546
+ const Rn = Vo(u == null ? void 0 : u.inline_edit), Vr = Rn.enabled ? [
1524
1547
  ...new Set(
1525
1548
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
1526
1549
  )
1527
- ] : [], Tl = Qe({
1528
- queries: Br.map((e) => ({
1550
+ ] : [], Al = Be({
1551
+ queries: Vr.map((e) => ({
1529
1552
  queryKey: ["cbv-collection-meta", e],
1530
1553
  queryFn: () => h.request(A(`/collections/${e}`)).then((t) => t.data),
1531
1554
  staleTime: 10 * 6e4,
1532
1555
  retry: !1
1533
1556
  }))
1534
- }), Tn = /* @__PURE__ */ new Map();
1535
- Br.forEach((e, t) => {
1557
+ }), En = /* @__PURE__ */ new Map();
1558
+ Vr.forEach((e, t) => {
1536
1559
  var r;
1537
- const n = (r = Tl[t]) == null ? void 0 : r.data;
1538
- n && Tn.set(e, {
1560
+ const n = (r = Al[t]) == null ? void 0 : r.data;
1561
+ n && En.set(e, {
1539
1562
  fields: new Map((n.fields ?? []).map((o) => [o.field, o])),
1540
1563
  relations: n.relations ?? []
1541
1564
  });
1542
1565
  });
1543
- const { data: Rl } = W({
1566
+ const { data: Ll } = W({
1544
1567
  queryKey: ["my-permissions"],
1545
1568
  queryFn: () => h.request(A("/security/my/permissions")).then((e) => e.data),
1546
- enabled: Fn.enabled && !Oe,
1569
+ enabled: Rn.enabled && !De,
1547
1570
  staleTime: 5 * 6e4
1548
- }), jr = Qs(), Ur = (e, t) => {
1571
+ }), Gr = Us(), Wr = (e, t) => {
1549
1572
  if (t.includes(".")) return null;
1550
- const n = Tn.get(e.collection);
1573
+ const n = En.get(e.collection);
1551
1574
  if (!n) return null;
1552
- const r = bt.get(P(e));
1553
- return r && !r.is_mine ? null : Vo({
1554
- config: Fn,
1575
+ const r = bt.get(K(e));
1576
+ return r && !r.is_mine ? null : Ho({
1577
+ config: Rn,
1555
1578
  key: t,
1556
1579
  field: n.fields.get(t),
1557
1580
  collection: e.collection,
1558
1581
  relations: n.relations,
1559
- mayUpdate: Oe || Cs(Rl, e.collection)
1582
+ mayUpdate: De || Fs(Ll, e.collection)
1560
1583
  });
1561
- }, Ir = (e, t, n) => {
1584
+ }, Hr = (e, t, n) => {
1562
1585
  var r, o, s;
1563
1586
  return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
1564
- }, El = (e, t, n, r, o) => {
1565
- const s = (b) => `${P(e)}|${b}`, m = [...ae].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Ur(e, b)), p = o === 0 ? null : Go(m, t, o), N = (b) => b.collection === e.collection && b.item_id === e.item_id, k = (b) => N(b) ? n === "m2o" ? {
1587
+ }, Ol = (e, t, n, r, o) => {
1588
+ const s = (b) => `${K(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Wr(e, b)), p = o === 0 ? null : Yo(m, t, o), N = (b) => b.collection === e.collection && b.item_id === e.item_id, k = (b) => N(b) ? n === "m2o" ? {
1566
1589
  ...b,
1567
1590
  extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
1568
1591
  } : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
1569
- jr.commit({
1592
+ Gr.commit({
1570
1593
  cellKey: s(t),
1571
1594
  collection: e.collection,
1572
1595
  id: e.item_id,
1573
1596
  field: t,
1574
1597
  kind: n,
1575
- before: Ir(e, t, n),
1598
+ before: Hr(e, t, n),
1576
1599
  value: r,
1577
1600
  next: p ? s(p) : null,
1578
1601
  optimistic: () => {
@@ -1587,42 +1610,42 @@ function Qc({
1587
1610
  // Labels, rollups and the row's place in the queue follow the server.
1588
1611
  onSaved: () => void f.invalidateQueries({ queryKey: ["queue-items", l] })
1589
1612
  });
1590
- }, Al = (e, t, n) => {
1591
- const r = Ur(e, t);
1613
+ }, Dl = (e, t, n) => {
1614
+ const r = Wr(e, t);
1592
1615
  if (!r) return n;
1593
- const o = Tn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
1616
+ const o = En.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
1594
1617
  return /* @__PURE__ */ a(
1595
- Bs,
1618
+ Is,
1596
1619
  {
1597
- controller: jr,
1598
- cellKey: `${P(e)}|${t}`,
1620
+ controller: Gr,
1621
+ cellKey: `${K(e)}|${t}`,
1599
1622
  kind: r,
1600
- value: Ir(e, t, r),
1623
+ value: Hr(e, t, r),
1601
1624
  label: E(`extra.${t}`, lt(t)),
1602
- choices: s ? Io(s) : void 0,
1603
- target: r === "m2o" && o ? Uo(o.relations, e.collection, t) : null,
1604
- onCommit: (m, p) => El(e, t, r, m, p),
1625
+ choices: s ? Wo(s) : void 0,
1626
+ target: r === "m2o" && o ? Go(o.relations, e.collection, t) : null,
1627
+ onCommit: (m, p) => Ol(e, t, r, m, p),
1605
1628
  children: n
1606
1629
  }
1607
1630
  );
1608
- }, Ll = wt.map((e) => ({
1631
+ }, Kl = wt.map((e) => ({
1609
1632
  key: `extra.${e}`,
1610
1633
  header: E(`extra.${e}`, lt(e)),
1611
1634
  sortable: !0,
1612
- render: (t) => Al(t, e, Ol(t, e))
1635
+ render: (t) => Dl(t, e, Pl(t, e))
1613
1636
  }));
1614
- function Ol(e, t) {
1637
+ function Pl(e, t) {
1615
1638
  var n, r;
1616
1639
  {
1617
1640
  const o = (n = e.extra) == null ? void 0 : n[t];
1618
1641
  if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
1619
- const s = Ke(t), m = s ? tt(String(o), s) : String(o), { text: p, title: N } = Fl(m), k = ((i == null ? void 0 : i.extra_field_meta) ?? []).find((v) => v.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], C = Sl(t);
1642
+ const s = Me(t), m = s ? tt(String(o), s) : String(o), { text: p, title: N } = El(m), k = ((i == null ? void 0 : i.extra_field_meta) ?? []).find((v) => v.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], C = ql(t);
1620
1643
  return (k == null ? void 0 : k.kind) === "relation" && k.target_collection && b.length > 0 && C.enabled && !k.aggregate ? /* @__PURE__ */ a(
1621
1644
  "button",
1622
1645
  {
1623
1646
  type: "button",
1624
1647
  onClick: (v) => {
1625
- v.stopPropagation(), Qr({
1648
+ v.stopPropagation(), Ir({
1626
1649
  collection: k.target_collection,
1627
1650
  itemId: b[0],
1628
1651
  layoutId: C.layout_id,
@@ -1639,7 +1662,7 @@ function Qc({
1639
1662
  {
1640
1663
  type: "button",
1641
1664
  onClick: (v) => {
1642
- v.stopPropagation(), dn({ row: e, path: t, value: m });
1665
+ v.stopPropagation(), un({ row: e, path: t, value: m });
1643
1666
  },
1644
1667
  title: "Show the rows behind this number",
1645
1668
  className: "block max-w-[200px] truncate text-left text-[12px] tabular-nums underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
@@ -1648,25 +1671,25 @@ function Qc({
1648
1671
  ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: N, children: p });
1649
1672
  }
1650
1673
  }
1651
- const Vr = [
1652
- ...qn ? ["collection"] : [],
1674
+ const Yr = [
1675
+ ...Tn ? ["collection"] : [],
1653
1676
  "state",
1654
1677
  "owners",
1655
1678
  "aging_hours",
1656
1679
  "state_entered",
1657
1680
  "sla_status",
1658
1681
  "at_risk",
1659
- ...Ye ? ["addendums"] : [],
1682
+ ...ze ? ["addendums"] : [],
1660
1683
  ...mt ? ["fulfilment"] : [],
1661
1684
  ...ve ? ["integrations"] : [],
1662
1685
  ...pt ? ["send_backs"] : [],
1663
- ...xr ? ["tasks"] : [],
1686
+ ...vr ? ["tasks"] : [],
1664
1687
  ...wt.map((e) => `extra.${e}`)
1665
- ], Dl = [
1666
- ...qn ? ["collection"] : [],
1688
+ ], Ml = [
1689
+ ...Tn ? ["collection"] : [],
1667
1690
  "state",
1668
1691
  "owners",
1669
- ...Ye ? ["addendums"] : [],
1692
+ ...ze ? ["addendums"] : [],
1670
1693
  ...mt ? ["fulfilment"] : [],
1671
1694
  ...ve ? ["integrations"] : [],
1672
1695
  ...pt ? ["send_backs"] : [],
@@ -1674,29 +1697,29 @@ function Qc({
1674
1697
  "sla_status",
1675
1698
  "at_risk",
1676
1699
  ...wt.slice(0, 2).map((e) => `extra.${e}`)
1677
- ], Pl = (u == null ? void 0 : u.default_columns) ?? null, Rn = Mt ?? Pl, ae = new Set(Rn ?? Dl);
1678
- Ye && !Rt.has("addendums") && ae.add("addendums"), mt && !Rt.has("fulfilment") && ae.add("fulfilment"), ve && !Rt.has("integrations") && ae.add("integrations"), pt && !Rt.has("send_backs") && ae.add("send_backs");
1679
- const Kl = new Set(Oe ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1680
- for (const e of Kl) ae.delete(e);
1681
- const et = [
1682
- ...(Rn ?? []).filter((e) => Vr.includes(e)),
1683
- ...Vr.filter((e) => !(Rn ?? []).includes(e))
1684
- ], Ml = Hl(Jl(Yl, { activationConstraint: { distance: 4 } }));
1685
- function Ql(e) {
1700
+ ], Ql = (u == null ? void 0 : u.default_columns) ?? null, An = Mt ?? Ql, te = new Set(An ?? Ml);
1701
+ ze && !Rt.has("addendums") && te.add("addendums"), mt && !Rt.has("fulfilment") && te.add("fulfilment"), ve && !Rt.has("integrations") && te.add("integrations"), pt && !Rt.has("send_backs") && te.add("send_backs");
1702
+ const Bl = new Set(De ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1703
+ for (const e of Bl) te.delete(e);
1704
+ const Nt = [
1705
+ ...(An ?? []).filter((e) => Yr.includes(e)),
1706
+ ...Yr.filter((e) => !(An ?? []).includes(e))
1707
+ ], jl = zl(Xl(Zl, { activationConstraint: { distance: 4 } }));
1708
+ function Ul(e) {
1686
1709
  const { active: t, over: n } = e;
1687
1710
  if (!n || t.id === n.id) return;
1688
- const r = et.indexOf(String(t.id)), o = et.indexOf(String(n.id));
1711
+ const r = Nt.indexOf(String(t.id)), o = Nt.indexOf(String(n.id));
1689
1712
  r === -1 || o === -1 || Qt(
1690
- to(et, r, o).filter((s) => ae.has(s))
1713
+ ao(Nt, r, o).filter((s) => te.has(s))
1691
1714
  );
1692
1715
  }
1693
- const Gr = Mr.find((e) => e.key === "label"), Bl = {
1694
- ...Gr,
1716
+ const Jr = Ur.find((e) => e.key === "label"), Il = {
1717
+ ...Jr,
1695
1718
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1696
- /* @__PURE__ */ a(Ns, { rowId: e.item_id }),
1697
- Gr.render(e, ...t)
1719
+ /* @__PURE__ */ a($s, { rowId: e.item_id }),
1720
+ Jr.render(e, ...t)
1698
1721
  ] })
1699
- }, jl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1722
+ }, Vl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1700
1723
  (e) => ({
1701
1724
  key: `formula.${e.key}`,
1702
1725
  header: e.label,
@@ -1704,7 +1727,7 @@ function Qc({
1704
1727
  const n = {
1705
1728
  ...t,
1706
1729
  ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([s, m]) => [`extra.${s}`, m])) : {}
1707
- }, r = Ao(e.formula, (s) => {
1730
+ }, r = Do(e.formula, (s) => {
1708
1731
  const m = n[s] ?? (t.extra ? t.extra[s] : void 0), p = Number(m);
1709
1732
  return Number.isFinite(p) ? p : m ?? null;
1710
1733
  });
@@ -1713,55 +1736,63 @@ function Qc({
1713
1736
  return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
1714
1737
  }
1715
1738
  })
1716
- ), Wr = [...Mr, ...Ll, ...jl], Ul = {
1739
+ ), Ln = [...Ur, ...Kl, ...Vl], zr = ai(
1740
+ Nt,
1741
+ (e) => {
1742
+ var n;
1743
+ const t = (n = Ln.find((r) => r.key === e)) == null ? void 0 : n.header;
1744
+ return typeof t == "string" ? t : e;
1745
+ },
1746
+ te
1747
+ ), Gl = {
1717
1748
  key: "__actions__",
1718
1749
  header: "",
1719
- render: (e) => e.collection === "tasks" || e.collection === zt ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
1720
- Ss,
1750
+ render: (e) => e.collection === "tasks" || e.collection === Xt ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
1751
+ qs,
1721
1752
  {
1722
1753
  collection: e.collection,
1723
1754
  id: e.item_id,
1724
1755
  hasPipeline: e.state != null,
1725
1756
  onOpen: () => xt(e),
1726
- onPeek: () => Le(e),
1757
+ onPeek: () => Oe(e),
1727
1758
  urlFor: H.urlFor,
1728
1759
  onDeleted: () => {
1729
- h.request(Dn(`/items/${e.collection}/${e.item_id}`)).then(() => {
1730
- O.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
1731
- }).catch((t) => O.error($t(t, "Delete failed")));
1760
+ h.request(Mn(`/items/${e.collection}/${e.item_id}`)).then(() => {
1761
+ D.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
1762
+ }).catch((t) => D.error($t(t, "Delete failed")));
1732
1763
  },
1733
1764
  onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
1734
1765
  bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
1735
- disabled: Z
1766
+ disabled: ee
1736
1767
  }
1737
1768
  ) })
1738
- }, Ht = [
1739
- Bl,
1740
- ...et.filter((e) => ae.has(e)).map((e) => Wr.find((t) => t.key === e)).filter((e) => e !== void 0),
1741
- ...me ? [Nl] : [],
1742
- Ul
1743
- ], Hr = V(() => {
1769
+ }, Yt = [
1770
+ Il,
1771
+ ...Nt.filter((e) => te.has(e)).map((e) => Ln.find((t) => t.key === e)).filter((e) => e !== void 0),
1772
+ ...me ? [$l] : [],
1773
+ Gl
1774
+ ], Xr = V(() => {
1744
1775
  var r;
1745
- const e = u == null ? void 0 : u.default_pins, t = it ?? (e && Object.keys(e).length > 0 ? e : { [((r = Ht[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(Ht.map((o) => o.key));
1776
+ const e = u == null ? void 0 : u.default_pins, t = it ?? (e && Object.keys(e).length > 0 ? e : { [((r = Yt[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(Yt.map((o) => o.key));
1746
1777
  return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
1747
- }, [it, u == null ? void 0 : u.default_pins, Ht.map((e) => e.key).join("|")]), Jr = [
1778
+ }, [it, u == null ? void 0 : u.default_pins, Yt.map((e) => e.key).join("|")]), Zr = [
1748
1779
  { value: "state", label: "State" },
1749
1780
  { value: "collection", label: "Collection" },
1750
1781
  { value: "sla_status", label: "SLA status" },
1751
1782
  { value: "at_risk", label: "At risk" },
1752
1783
  { value: "owners", label: "Owner" },
1753
1784
  { value: "aging", label: "Aging" },
1754
- ...wt.filter((e) => ae.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
1755
- ], Yr = (e) => async (t, n) => {
1785
+ ...wt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
1786
+ ], ea = (e) => async (t, n) => {
1756
1787
  if (!e.target_collection || !e.display_field) return [];
1757
1788
  const r = {
1758
1789
  limit: 25,
1759
1790
  sort: e.display_field,
1760
1791
  // Records hidden from pickers (a retired zone) are not offered.
1761
1792
  picker: "1"
1762
- }, o = n != null && n.narrowBy.length ? ss(
1793
+ }, o = n != null && n.narrowBy.length ? ds(
1763
1794
  e.target_collection,
1764
- await is(h, f, e.target_collection),
1795
+ await us(h, f, e.target_collection),
1765
1796
  n.narrowBy
1766
1797
  ) : null, s = [
1767
1798
  ...t.trim() ? [{ [e.display_field]: { _contains: t.trim() } }] : [],
@@ -1770,15 +1801,15 @@ function Qc({
1770
1801
  s.length > 0 && (r.filter = JSON.stringify(s.length === 1 ? s[0] : { _and: s }));
1771
1802
  const p = (await h.request(
1772
1803
  A(`/items/${e.target_collection}`, r)
1773
- )).data ?? [], N = Ke(e.path), k = qe[e.path] ? new Set(qe[e.path]) : null, b = /* @__PURE__ */ new Set(), C = [];
1804
+ )).data ?? [], N = Me(e.path), k = Fe[e.path] ? new Set(Fe[e.path]) : null, b = /* @__PURE__ */ new Set(), C = [];
1774
1805
  for (const v of p) {
1775
- const J = v[e.display_field];
1776
- if (J == null || J === "") continue;
1777
- const Y = String(J);
1778
- b.has(Y) || k && !k.has(Y) || (b.add(Y), C.push({ label: N ? tt(Y, N) : Y, value: Y }));
1806
+ const z = v[e.display_field];
1807
+ if (z == null || z === "") continue;
1808
+ const X = String(z);
1809
+ b.has(X) || k && !k.has(X) || (b.add(X), C.push({ label: N ? tt(X, N) : X, value: X }));
1779
1810
  }
1780
1811
  return C;
1781
- }, En = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Me = [
1812
+ }, On = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
1782
1813
  {
1783
1814
  key: "collection",
1784
1815
  placeholder: E("collection", "Collection"),
@@ -1796,16 +1827,16 @@ function Qc({
1796
1827
  multi: !0,
1797
1828
  // Until the rows land, the pipeline's own states (no counts yet) rather
1798
1829
  // than an empty list.
1799
- options: Nr(
1830
+ options: $r(
1800
1831
  c ? c.available_values.state ?? [] : Object.keys(we)
1801
1832
  ).map((e) => {
1802
1833
  var t;
1803
1834
  return {
1804
- label: Ae(e),
1835
+ label: Le(e),
1805
1836
  value: e,
1806
1837
  // How many rows sit in it under the other active filters (the State
1807
1838
  // filter itself left out, or every other state would read 0).
1808
- count: mr ? mr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1839
+ count: hr ? hr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1809
1840
  };
1810
1841
  })
1811
1842
  },
@@ -1828,12 +1859,12 @@ function Qc({
1828
1859
  { label: "No", value: "no" }
1829
1860
  ]
1830
1861
  },
1831
- ...kr.length > 0 ? [
1862
+ ..._r.length > 0 ? [
1832
1863
  {
1833
1864
  key: "at_risk_rule",
1834
1865
  placeholder: "Highlight rule",
1835
1866
  type: "select",
1836
- options: kr
1867
+ options: _r
1837
1868
  }
1838
1869
  ] : [],
1839
1870
  {
@@ -1842,7 +1873,7 @@ function Qc({
1842
1873
  type: "range",
1843
1874
  range_unit: "h"
1844
1875
  },
1845
- ...Ye ? [
1876
+ ...ze ? [
1846
1877
  {
1847
1878
  key: "addendums",
1848
1879
  placeholder: "Addendums",
@@ -1860,7 +1891,7 @@ function Qc({
1860
1891
  key: "integrations",
1861
1892
  placeholder: E("integrations", "Integrations"),
1862
1893
  type: "select",
1863
- options: Ls.map((e) => ({ label: e.label, value: e.value }))
1894
+ options: Ks.map((e) => ({ label: e.label, value: e.value }))
1864
1895
  }
1865
1896
  ] : [],
1866
1897
  ...mt ? [
@@ -1868,7 +1899,7 @@ function Qc({
1868
1899
  key: "fulfilment",
1869
1900
  placeholder: "Shipped",
1870
1901
  type: "select",
1871
- options: Rs
1902
+ options: Ls
1872
1903
  }
1873
1904
  ] : [],
1874
1905
  ...pt ? [
@@ -1883,13 +1914,13 @@ function Qc({
1883
1914
  ]
1884
1915
  }
1885
1916
  ] : [],
1886
- ...mn.length > 0 ? [
1917
+ ...pn.length > 0 ? [
1887
1918
  {
1888
1919
  key: "labels",
1889
1920
  placeholder: "Triage label",
1890
1921
  type: "combobox",
1891
1922
  multi: !0,
1892
- options: mn.map((e) => ({ label: e, value: e }))
1923
+ options: pn.map((e) => ({ label: e, value: e }))
1893
1924
  }
1894
1925
  ] : [],
1895
1926
  {
@@ -1913,7 +1944,7 @@ function Qc({
1913
1944
  },
1914
1945
  ...wt.map((e) => {
1915
1946
  var m, p;
1916
- const t = En.get(e), n = E(`extra.${e}`, lt(e)), r = { key: `extra.${e}`, placeholder: n }, o = Ke(e);
1947
+ const t = On.get(e), n = E(`extra.${e}`, lt(e)), r = { key: `extra.${e}`, placeholder: n }, o = Me(e);
1917
1948
  if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
1918
1949
  if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
1919
1950
  if ((o == null ? void 0 : o.type) === "boolean")
@@ -1935,27 +1966,27 @@ function Qc({
1935
1966
  ...r,
1936
1967
  type: "combobox",
1937
1968
  multi: !0,
1938
- restricted: !!((p = qe[e]) != null && p.length),
1939
- loadOptions: Yr(t)
1969
+ restricted: !!((p = Fe[e]) != null && p.length),
1970
+ loadOptions: ea(t)
1940
1971
  } : { ...r, placeholder: `Search ${n}…`, type: "text" };
1941
1972
  })
1942
- ], An = Me.filter(
1943
- (e) => ae.has(e.key) || e.key === "label" || e.key === "owners"
1944
- ), Ln = (e) => {
1973
+ ], Dn = Qe.filter(
1974
+ (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1975
+ ), Kn = (e) => {
1945
1976
  var t;
1946
- return (((t = Me.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1947
- }, On = (() => {
1977
+ return (((t = Qe.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1978
+ }, Pn = (() => {
1948
1979
  var n, r;
1949
1980
  const e = [];
1950
- for (const [o, s] of Object.entries(Te)) {
1981
+ for (const [o, s] of Object.entries(Re)) {
1951
1982
  if (!s || Array.isArray(s) && s.length === 0) continue;
1952
- const m = Me.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, N = p ? Ke(p) : null, k = Lo({
1953
- field: Ln(o),
1983
+ const m = Qe.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, N = p ? Me(p) : null, k = Ko({
1984
+ field: Kn(o),
1954
1985
  type: (m == null ? void 0 : m.type) ?? "select",
1955
1986
  value: s,
1956
1987
  optionLabel: (b) => {
1957
1988
  var C, v;
1958
- return (v = (C = m == null ? void 0 : m.options) == null ? void 0 : C.find((J) => J.value === b)) == null ? void 0 : v.label;
1989
+ return (v = (C = m == null ? void 0 : m.options) == null ? void 0 : C.find((z) => z.value === b)) == null ? void 0 : v.label;
1959
1990
  },
1960
1991
  currency: (N == null ? void 0 : N.type) === "number" && N.prefix === "$",
1961
1992
  rangeUnit: m == null ? void 0 : m.range_unit
@@ -1963,39 +1994,39 @@ function Qc({
1963
1994
  k && e.push(k);
1964
1995
  }
1965
1996
  const t = c == null ? void 0 : c.total;
1966
- return Oo({
1997
+ return Po({
1967
1998
  noun: "items",
1968
1999
  scope: g === "mine" ? "you own" : g === "unowned" ? "with no owners" : g === "claimed" ? "you claimed" : null,
1969
- viewName: ((r = (n = B == null ? void 0 : B.data) == null ? void 0 : n.find((o) => o.id === ze)) == null ? void 0 : r.name) ?? null,
2000
+ viewName: ((r = (n = j == null ? void 0 : j.data) == null ? void 0 : n.find((o) => o.id === Xe)) == null ? void 0 : r.name) ?? null,
1970
2001
  clauses: e,
1971
2002
  shown: typeof t == "number" ? t : null,
1972
2003
  of: (x == null ? void 0 : x.total) ?? null
1973
2004
  });
1974
- })(), Nt = new Set(Object.keys(ue.current)), Il = ((e) => {
2005
+ })(), St = new Set(Object.keys(ue.current)), Wl = ((e) => {
1975
2006
  var n;
1976
2007
  if (e.some((r) => r.key === "state")) return e;
1977
- const t = Me.find((r) => r.key === "state");
2008
+ const t = Qe.find((r) => r.key === "state");
1978
2009
  return !t || c && !((n = c.available_values.state) != null && n.length) ? e : [...e, t];
1979
2010
  })(
1980
2011
  (() => {
1981
2012
  var o;
1982
2013
  const e = (s) => {
1983
- var J, Y, T;
2014
+ var z, X, T;
1984
2015
  if (!s.key.startsWith("extra.")) return null;
1985
2016
  if (s.type === "combobox") return s;
1986
- const m = s.key.slice(6), p = En.get(m), N = Nt.has(s.key);
2017
+ const m = s.key.slice(6), p = On.get(m), N = St.has(s.key);
1987
2018
  if ((p == null ? void 0 : p.kind) !== "relation" && !N) return null;
1988
- const k = Ke(m), b = (J = c == null ? void 0 : c.available_values.extra) == null ? void 0 : J[m], C = s.placeholder.replace(/^Search (.*)…$/, "$1"), v = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
2019
+ const k = Me(m), b = (z = c == null ? void 0 : c.available_values.extra) == null ? void 0 : z[m], C = s.placeholder.replace(/^Search (.*)…$/, "$1"), v = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
1989
2020
  return b != null && b.length ? {
1990
2021
  key: s.key,
1991
2022
  placeholder: C,
1992
2023
  type: "combobox",
1993
2024
  multi: !0,
1994
2025
  cascade: v,
1995
- restricted: !!((Y = qe[m]) != null && Y.length),
1996
- options: b.map((ee) => ({
1997
- label: k && k.type !== "number" ? tt(ee, k) : ee,
1998
- value: ee
2026
+ restricted: !!((X = Fe[m]) != null && X.length),
2027
+ options: b.map((ne) => ({
2028
+ label: k && k.type !== "number" ? tt(ne, k) : ne,
2029
+ value: ne
1999
2030
  }))
2000
2031
  } : (p == null ? void 0 : p.kind) === "relation" ? {
2001
2032
  key: s.key,
@@ -2003,48 +2034,48 @@ function Qc({
2003
2034
  type: "combobox",
2004
2035
  multi: !0,
2005
2036
  cascade: v,
2006
- restricted: !!((T = qe[m]) != null && T.length),
2007
- loadOptions: Yr(p)
2037
+ restricted: !!((T = Fe[m]) != null && T.length),
2038
+ loadOptions: ea(p)
2008
2039
  } : null;
2009
2040
  };
2010
- if (zn.length > 0) {
2041
+ if (er.length > 0) {
2011
2042
  const s = [], m = /* @__PURE__ */ new Set();
2012
- for (const p of zn) {
2043
+ for (const p of er) {
2013
2044
  const N = (p.path ?? []).join(".");
2014
2045
  let k;
2015
2046
  if (p.key === "state" || /(^|_)state$/.test(((o = p.path) == null ? void 0 : o[0]) ?? ""))
2016
- k = Me.find((b) => b.key === "state");
2047
+ k = Qe.find((b) => b.key === "state");
2017
2048
  else {
2018
- const b = Me.filter((v) => {
2019
- var Y;
2049
+ const b = Qe.filter((v) => {
2050
+ var X;
2020
2051
  if (!v.key.startsWith("extra.") || m.has(v.key)) return !1;
2021
- const J = v.key.slice(6);
2022
- return ((Y = En.get(J)) == null ? void 0 : Y.target_collection) === p.collection;
2052
+ const z = v.key.slice(6);
2053
+ return ((X = On.get(z)) == null ? void 0 : X.target_collection) === p.collection;
2023
2054
  }), C = b.find((v) => v.key.slice(6).startsWith(`${N}.`)) ?? b[0];
2024
2055
  k = C ? e(C) : null;
2025
2056
  }
2026
2057
  !k || m.has(k.key) || (m.add(k.key), s.push(p.label ? { ...k, placeholder: p.label } : k));
2027
2058
  }
2028
- for (const p of Me.map(e))
2029
- p && !m.has(p.key) && (Nt.has(p.key) || p.restricted) && s.push(p);
2059
+ for (const p of Qe.map(e))
2060
+ p && !m.has(p.key) && (St.has(p.key) || p.restricted) && s.push(p);
2030
2061
  if (s.length > 0) return s;
2031
2062
  }
2032
- const t = An.map(e).filter((s) => s !== null), r = [
2033
- ...t.filter((s) => Nt.has(s.key) || s.restricted),
2034
- ...t.filter((s) => !Nt.has(s.key) && !s.restricted)
2063
+ const t = Dn.map(e).filter((s) => s !== null), r = [
2064
+ ...t.filter((s) => St.has(s.key) || s.restricted),
2065
+ ...t.filter((s) => !St.has(s.key) && !s.restricted)
2035
2066
  ].slice(0, 6);
2036
- return r.length > 0 ? r : An.filter((s) => s.key === "state" || s.key === "owners");
2067
+ return r.length > 0 ? r : Dn.filter((s) => s.key === "state" || s.key === "owners");
2037
2068
  })()
2038
- ), Vl = (() => {
2069
+ ), Hl = (() => {
2039
2070
  if (!x) return null;
2040
- const e = X ?? x, t = [
2071
+ const e = Z ?? x, t = [
2041
2072
  {
2042
2073
  key: "breached",
2043
2074
  n: e.sla_breached,
2044
2075
  label: "past SLA",
2045
2076
  tone: "text-red-600 dark:text-red-400",
2046
2077
  on: _.sla_status === "breached",
2047
- toggle: () => Ie("sla_status", "breached")
2078
+ toggle: () => Ve("sla_status", "breached")
2048
2079
  },
2049
2080
  {
2050
2081
  key: "warning",
@@ -2052,7 +2083,7 @@ function Qc({
2052
2083
  label: "SLA soon",
2053
2084
  tone: "text-amber-700 dark:text-amber-400",
2054
2085
  on: _.sla_status === "warning",
2055
- toggle: () => Ie("sla_status", "warning")
2086
+ toggle: () => Ve("sla_status", "warning")
2056
2087
  },
2057
2088
  {
2058
2089
  key: "at_risk",
@@ -2060,7 +2091,7 @@ function Qc({
2060
2091
  label: "at risk",
2061
2092
  tone: "text-red-600 dark:text-red-400",
2062
2093
  on: _.at_risk === "yes",
2063
- toggle: () => Ie("at_risk", "yes")
2094
+ toggle: () => Ve("at_risk", "yes")
2064
2095
  },
2065
2096
  {
2066
2097
  key: "unowned",
@@ -2069,7 +2100,7 @@ function Qc({
2069
2100
  tone: "text-slate-600 dark:text-slate-300",
2070
2101
  on: g === "unowned",
2071
2102
  toggle: () => {
2072
- z(g === "unowned" ? "all" : "unowned"), D(1);
2103
+ Y(g === "unowned" ? "all" : "unowned"), O(1);
2073
2104
  }
2074
2105
  }
2075
2106
  ].filter((n) => n.n > 0 || n.on);
@@ -2107,9 +2138,9 @@ function Qc({
2107
2138
  }
2108
2139
  );
2109
2140
  })();
2110
- function Gl(e) {
2111
- const t = new Set(ae);
2112
- t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Bn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Bn((n) => {
2141
+ function Yl(e) {
2142
+ const t = new Set(te);
2143
+ t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && In((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && In((n) => {
2113
2144
  const r = new Set(n);
2114
2145
  return r.delete(e), r;
2115
2146
  })), Qt([...t]);
@@ -2117,7 +2148,7 @@ function Qc({
2117
2148
  return Lt ? (L == null ? void 0 : L((Lt == null ? void 0 : Lt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
2118
2149
  /* @__PURE__ */ d("div", { className: "shrink-0", children: [
2119
2150
  (c == null ? void 0 : c.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
2120
- /* @__PURE__ */ a(lo, { className: "h-4 w-4 shrink-0" }),
2151
+ /* @__PURE__ */ a(io, { className: "h-4 w-4 shrink-0" }),
2121
2152
  /* @__PURE__ */ a("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
2122
2153
  ] }),
2123
2154
  /* @__PURE__ */ d(
@@ -2126,13 +2157,13 @@ function Qc({
2126
2157
  className: "flex flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900",
2127
2158
  "data-queue-toolbar": !0,
2128
2159
  children: [
2129
- ne ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ui.filter((e) => me || e.value !== "claimed").map(
2160
+ J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: fi.filter((e) => me || e.value !== "claimed").map(
2130
2161
  (e, t) => /* @__PURE__ */ a(
2131
2162
  "button",
2132
2163
  {
2133
2164
  type: "button",
2134
2165
  onClick: () => {
2135
- z(e.value), D(1);
2166
+ Y(e.value), O(1);
2136
2167
  },
2137
2168
  className: R(
2138
2169
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
@@ -2144,17 +2175,17 @@ function Qc({
2144
2175
  e.value
2145
2176
  )
2146
2177
  ) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
2147
- ne ? Fe.length <= 1 ? null : (
2178
+ J ? Te.length <= 1 ? null : (
2148
2179
  // One allowed view means nothing to switch to — no button.
2149
2180
  /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
2150
2181
  { value: "table", label: "Table" },
2151
2182
  { value: "kanban", label: "Kanban" },
2152
2183
  { value: "workload", label: "Workload" }
2153
- ].filter((e) => Fe.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
2184
+ ].filter((e) => Te.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
2154
2185
  "button",
2155
2186
  {
2156
2187
  type: "button",
2157
- onClick: () => Be(e.value),
2188
+ onClick: () => je(e.value),
2158
2189
  className: R(
2159
2190
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
2160
2191
  t > 0 && "border-l border-slate-200 dark:border-border",
@@ -2172,7 +2203,7 @@ function Qc({
2172
2203
  "aria-pressed": _.unseen === "yes",
2173
2204
  "data-queue-unseen-filter": !0,
2174
2205
  title: "Only records someone else changed since you last opened them",
2175
- onClick: () => M((e) => {
2206
+ onClick: () => Q((e) => {
2176
2207
  const t = { ...e };
2177
2208
  return t.unseen === "yes" ? delete t.unseen : t.unseen = "yes", t;
2178
2209
  }),
@@ -2183,47 +2214,47 @@ function Qc({
2183
2214
  ]
2184
2215
  }
2185
2216
  ),
2186
- Ye && /* @__PURE__ */ d(
2217
+ ze && /* @__PURE__ */ d(
2187
2218
  "button",
2188
2219
  {
2189
2220
  type: "button",
2190
2221
  "aria-pressed": _.addendums === "active",
2191
2222
  title: "Only records with an addendum still in review",
2192
- onClick: () => M((e) => {
2223
+ onClick: () => Q((e) => {
2193
2224
  const t = { ...e };
2194
2225
  return t.addendums === "active" ? delete t.addendums : t.addendums = "active", t;
2195
2226
  }),
2196
2227
  className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${_.addendums === "active" ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
2197
2228
  children: [
2198
- /* @__PURE__ */ a(oo, { className: "h-3.5 w-3.5" }),
2229
+ /* @__PURE__ */ a(co, { className: "h-3.5 w-3.5" }),
2199
2230
  "Active addendums"
2200
2231
  ]
2201
2232
  }
2202
2233
  ),
2203
2234
  ve && /* @__PURE__ */ a(
2204
- Os,
2235
+ Ps,
2205
2236
  {
2206
2237
  label: E("integrations", "Integrations"),
2207
2238
  value: _.integrations,
2208
- onChange: (e) => M((t) => {
2239
+ onChange: (e) => Q((t) => {
2209
2240
  const n = { ...t };
2210
2241
  return e ? n.integrations = e : delete n.integrations, n;
2211
2242
  })
2212
2243
  }
2213
2244
  ),
2214
- /* @__PURE__ */ a(Vs, { className: "h-8" }),
2215
- /* @__PURE__ */ a(Fs, {}),
2216
- tn > 0 && /* @__PURE__ */ d(
2245
+ /* @__PURE__ */ a(Hs, { className: "h-8" }),
2246
+ /* @__PURE__ */ a(Es, {}),
2247
+ nn > 0 && /* @__PURE__ */ d(
2217
2248
  "button",
2218
2249
  {
2219
2250
  type: "button",
2220
- onClick: nl,
2251
+ onClick: ol,
2221
2252
  className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
2222
2253
  children: [
2223
- /* @__PURE__ */ a(so, { className: "h-3 w-3" }),
2224
- tn,
2254
+ /* @__PURE__ */ a(uo, { className: "h-3 w-3" }),
2255
+ nn,
2225
2256
  " update",
2226
- tn === 1 ? "" : "s",
2257
+ nn === 1 ? "" : "s",
2227
2258
  " · Refresh"
2228
2259
  ]
2229
2260
  }
@@ -2239,17 +2270,17 @@ function Qc({
2239
2270
  $ ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2240
2271
  ),
2241
2272
  children: [
2242
- /* @__PURE__ */ a(ba, { className: "h-3.5 w-3.5" }),
2243
- $ ? `Group: ${((na = Jr.find((e) => e.value === $)) == null ? void 0 : na.label) ?? $}` : "Group"
2273
+ /* @__PURE__ */ a(xa, { className: "h-3.5 w-3.5" }),
2274
+ $ ? `Group: ${((oa = Zr.find((e) => e.value === $)) == null ? void 0 : oa.label) ?? $}` : "Group"
2244
2275
  ]
2245
2276
  }
2246
2277
  ) }),
2247
- /* @__PURE__ */ a(at, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(va, { children: [
2248
- /* @__PURE__ */ a(zs, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2249
- /* @__PURE__ */ d(wa, { children: [
2250
- /* @__PURE__ */ a(Xs, { children: "No attribute found." }),
2278
+ /* @__PURE__ */ a(at, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Sa, { children: [
2279
+ /* @__PURE__ */ a(ei, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2280
+ /* @__PURE__ */ d(Ca, { children: [
2281
+ /* @__PURE__ */ a(ti, { children: "No attribute found." }),
2251
2282
  /* @__PURE__ */ a(qt, { value: "__none__", onSelect: () => ot(null), children: "None" }),
2252
- Jr.map((e) => /* @__PURE__ */ a(
2283
+ Zr.map((e) => /* @__PURE__ */ a(
2253
2284
  qt,
2254
2285
  {
2255
2286
  value: e.label,
@@ -2266,14 +2297,14 @@ function Qc({
2266
2297
  {
2267
2298
  type: "button",
2268
2299
  onClick: () => {
2269
- je(I === "-priority" ? "" : "-priority"), D(1);
2300
+ Ue(I === "-priority" ? "" : "-priority"), O(1);
2270
2301
  },
2271
2302
  className: R(
2272
2303
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2273
2304
  I === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2274
2305
  ),
2275
2306
  children: [
2276
- /* @__PURE__ */ a(io, { className: "h-3.5 w-3.5" }),
2307
+ /* @__PURE__ */ a(mo, { className: "h-3.5 w-3.5" }),
2277
2308
  "Priority"
2278
2309
  ]
2279
2310
  }
@@ -2282,7 +2313,7 @@ function Qc({
2282
2313
  "button",
2283
2314
  {
2284
2315
  type: "button",
2285
- onClick: () => Xt(
2316
+ onClick: () => Zt(
2286
2317
  ye.size > 0 ? /* @__PURE__ */ new Set() : new Set(le.map((e) => e.key))
2287
2318
  ),
2288
2319
  className: "flex h-8 items-center rounded-md px-2 text-[12px] text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
@@ -2299,15 +2330,15 @@ function Qc({
2299
2330
  st ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2300
2331
  ),
2301
2332
  children: [
2302
- /* @__PURE__ */ a(ba, { className: "h-3.5 w-3.5" }),
2333
+ /* @__PURE__ */ a(xa, { className: "h-3.5 w-3.5" }),
2303
2334
  st ? `Lanes: ${st === "collection" ? "Collection" : "Owner"}` : "Lanes"
2304
2335
  ]
2305
2336
  }
2306
2337
  ) }),
2307
- /* @__PURE__ */ a(at, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(va, { children: /* @__PURE__ */ d(wa, { children: [
2308
- /* @__PURE__ */ a(qt, { value: "none", onSelect: () => Zt(null), children: "None" }),
2309
- /* @__PURE__ */ a(qt, { value: "collection", onSelect: () => Zt("collection"), children: "Collection" }),
2310
- /* @__PURE__ */ a(qt, { value: "owner", onSelect: () => Zt("owners"), children: "Owner" })
2338
+ /* @__PURE__ */ a(at, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Sa, { children: /* @__PURE__ */ d(Ca, { children: [
2339
+ /* @__PURE__ */ a(qt, { value: "none", onSelect: () => en(null), children: "None" }),
2340
+ /* @__PURE__ */ a(qt, { value: "collection", onSelect: () => en("collection"), children: "Collection" }),
2341
+ /* @__PURE__ */ a(qt, { value: "owner", onSelect: () => en("owners"), children: "Owner" })
2311
2342
  ] }) }) })
2312
2343
  ] }),
2313
2344
  G && i && /* @__PURE__ */ d(
@@ -2319,17 +2350,17 @@ function Qc({
2319
2350
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2320
2351
  "data-queue-ask": !0,
2321
2352
  children: [
2322
- /* @__PURE__ */ a(co, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2353
+ /* @__PURE__ */ a(po, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2323
2354
  "Ask about this queue"
2324
2355
  ]
2325
2356
  }
2326
2357
  ),
2327
- /* @__PURE__ */ a(Ms, { listKey: `queue:${l}`, getState: bl }),
2358
+ /* @__PURE__ */ a(js, { listKey: `queue:${l}`, getState: xl }),
2328
2359
  /* @__PURE__ */ d(
2329
2360
  "button",
2330
2361
  {
2331
2362
  type: "button",
2332
- onClick: () => Da((e) => !e),
2363
+ onClick: () => Qa((e) => !e),
2333
2364
  "aria-expanded": dt,
2334
2365
  title: "Trends, aging, pace and states",
2335
2366
  className: R(
@@ -2338,7 +2369,7 @@ function Qc({
2338
2369
  ),
2339
2370
  "data-queue-insights-toggle": !0,
2340
2371
  children: [
2341
- /* @__PURE__ */ a(uo, { className: "h-3.5 w-3.5" }),
2372
+ /* @__PURE__ */ a(bo, { className: "h-3.5 w-3.5" }),
2342
2373
  "Insights"
2343
2374
  ]
2344
2375
  }
@@ -2350,37 +2381,30 @@ function Qc({
2350
2381
  type: "button",
2351
2382
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2352
2383
  children: [
2353
- /* @__PURE__ */ a(mo, { className: "h-3.5 w-3.5" }),
2384
+ /* @__PURE__ */ a(ho, { className: "h-3.5 w-3.5" }),
2354
2385
  "Columns"
2355
2386
  ]
2356
2387
  }
2357
2388
  ) }),
2358
2389
  /* @__PURE__ */ a(at, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
2359
- zl,
2390
+ eo,
2360
2391
  {
2361
- sensors: Ml,
2362
- collisionDetection: Xl,
2363
- onDragEnd: Ql,
2364
- children: /* @__PURE__ */ a(
2365
- Zl,
2366
- {
2367
- items: et,
2368
- strategy: eo,
2369
- children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: et.map((e) => {
2370
- const t = Wr.find((n) => n.key === e);
2371
- return /* @__PURE__ */ a(
2372
- gi,
2373
- {
2374
- id: e,
2375
- label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2376
- checked: ae.has(e),
2377
- onCheckedChange: () => Gl(e)
2378
- },
2379
- e
2380
- );
2381
- }) })
2382
- }
2383
- )
2392
+ sensors: jl,
2393
+ collisionDetection: to,
2394
+ onDragEnd: Ul,
2395
+ children: /* @__PURE__ */ a(no, { items: zr, strategy: ro, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: zr.map((e) => {
2396
+ const t = Ln.find((n) => n.key === e);
2397
+ return /* @__PURE__ */ a(
2398
+ wi,
2399
+ {
2400
+ id: e,
2401
+ label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2402
+ checked: te.has(e),
2403
+ onCheckedChange: () => Yl(e)
2404
+ },
2405
+ e
2406
+ );
2407
+ }) }) })
2384
2408
  }
2385
2409
  ) })
2386
2410
  ] }),
@@ -2388,14 +2412,14 @@ function Qc({
2388
2412
  "button",
2389
2413
  {
2390
2414
  type: "button",
2391
- onClick: vl,
2392
- "aria-pressed": Z,
2393
- "data-queue-bulk-mode": Z ? "on" : "off",
2394
- "data-tip": Z ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
2395
- className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${Z ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
2415
+ onClick: Nl,
2416
+ "aria-pressed": ee,
2417
+ "data-queue-bulk-mode": ee ? "on" : "off",
2418
+ "data-tip": ee ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
2419
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${ee ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
2396
2420
  children: [
2397
- /* @__PURE__ */ a(po, { className: "h-3.5 w-3.5" }),
2398
- Z ? "Done" : "Bulk select"
2421
+ /* @__PURE__ */ a(fo, { className: "h-3.5 w-3.5" }),
2422
+ ee ? "Done" : "Bulk select"
2399
2423
  ]
2400
2424
  }
2401
2425
  ),
@@ -2405,7 +2429,7 @@ function Qc({
2405
2429
  type: "button",
2406
2430
  onClick: () => {
2407
2431
  const e = Tt === "compact" ? "comfortable" : "compact";
2408
- Na(e);
2432
+ qa(e);
2409
2433
  try {
2410
2434
  localStorage.setItem("nvr_table_density", e);
2411
2435
  } catch {
@@ -2414,32 +2438,32 @@ function Qc({
2414
2438
  "aria-label": "Row density",
2415
2439
  title: Tt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2416
2440
  className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 shadow-sm hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted",
2417
- children: Tt === "compact" ? /* @__PURE__ */ a(bo, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(ho, { className: "h-3.5 w-3.5" })
2441
+ children: Tt === "compact" ? /* @__PURE__ */ a(go, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(xo, { className: "h-3.5 w-3.5" })
2418
2442
  }
2419
2443
  ),
2420
- q === "table" && Fa && oe.length > 0 && /* @__PURE__ */ d(
2444
+ q === "table" && Aa && oe.length > 0 && /* @__PURE__ */ d(
2421
2445
  "button",
2422
2446
  {
2423
2447
  type: "button",
2424
- onClick: () => Sr(),
2448
+ onClick: () => qr(),
2425
2449
  className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110",
2426
2450
  children: [
2427
- /* @__PURE__ */ a(fo, { className: "h-3 w-3 fill-current" }),
2451
+ /* @__PURE__ */ a(yo, { className: "h-3 w-3 fill-current" }),
2428
2452
  "Work Next"
2429
2453
  ]
2430
2454
  }
2431
2455
  ),
2432
- !on && te.length === 1 && (Ot ? /* @__PURE__ */ d(nt, { children: [
2456
+ !sn && re.length === 1 && (Ot ? /* @__PURE__ */ d(nt, { children: [
2433
2457
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2434
2458
  "button",
2435
2459
  {
2436
2460
  type: "button",
2437
2461
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2438
2462
  children: [
2439
- /* @__PURE__ */ a(Yt, { className: "h-3.5 w-3.5" }),
2463
+ /* @__PURE__ */ a(zt, { className: "h-3.5 w-3.5" }),
2440
2464
  "New ",
2441
- Pn(te[0]),
2442
- /* @__PURE__ */ a(ha, { className: "h-3 w-3 opacity-60" })
2465
+ Qn(re[0]),
2466
+ /* @__PURE__ */ a(ya, { className: "h-3 w-3 opacity-60" })
2443
2467
  ]
2444
2468
  }
2445
2469
  ) }),
@@ -2449,14 +2473,14 @@ function Qc({
2449
2473
  {
2450
2474
  type: "button",
2451
2475
  onClick: () => H.open({
2452
- collection: te[0],
2476
+ collection: re[0],
2453
2477
  itemId: "new",
2454
2478
  // Same layout the queue opens existing records with.
2455
2479
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
2456
2480
  }),
2457
2481
  className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2458
2482
  children: [
2459
- ((ra = Ot.active) == null ? void 0 : ra.create_label) ?? ((aa = Ot.active) == null ? void 0 : aa.name) ?? "Default layout",
2483
+ ((sa = Ot.active) == null ? void 0 : sa.create_label) ?? ((ia = Ot.active) == null ? void 0 : ia.name) ?? "Default layout",
2460
2484
  /* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2461
2485
  ]
2462
2486
  }
@@ -2466,7 +2490,7 @@ function Qc({
2466
2490
  {
2467
2491
  type: "button",
2468
2492
  onClick: () => H.open({
2469
- collection: te[0],
2493
+ collection: re[0],
2470
2494
  itemId: "new",
2471
2495
  layoutSlug: e.slug
2472
2496
  }),
@@ -2481,7 +2505,7 @@ function Qc({
2481
2505
  {
2482
2506
  type: "button",
2483
2507
  onClick: () => H.open({
2484
- collection: te[0],
2508
+ collection: re[0],
2485
2509
  itemId: "new",
2486
2510
  // Open a new record on the same layout the queue opens
2487
2511
  // existing ones with, so creating and reviewing match.
@@ -2489,26 +2513,26 @@ function Qc({
2489
2513
  }),
2490
2514
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2491
2515
  children: [
2492
- /* @__PURE__ */ a(Yt, { className: "h-3.5 w-3.5" }),
2516
+ /* @__PURE__ */ a(zt, { className: "h-3.5 w-3.5" }),
2493
2517
  "New ",
2494
- Pn(te[0])
2518
+ Qn(re[0])
2495
2519
  ]
2496
2520
  }
2497
2521
  )),
2498
- !on && te.length > 1 && /* @__PURE__ */ d(nt, { children: [
2522
+ !sn && re.length > 1 && /* @__PURE__ */ d(nt, { children: [
2499
2523
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2500
2524
  "button",
2501
2525
  {
2502
2526
  type: "button",
2503
2527
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2504
2528
  children: [
2505
- /* @__PURE__ */ a(Yt, { className: "h-3.5 w-3.5" }),
2529
+ /* @__PURE__ */ a(zt, { className: "h-3.5 w-3.5" }),
2506
2530
  "New",
2507
- /* @__PURE__ */ a(ha, { className: "h-3 w-3 opacity-60" })
2531
+ /* @__PURE__ */ a(ya, { className: "h-3 w-3 opacity-60" })
2508
2532
  ]
2509
2533
  }
2510
2534
  ) }),
2511
- /* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children: te.map((e) => /* @__PURE__ */ d(
2535
+ /* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children: re.map((e) => /* @__PURE__ */ d(
2512
2536
  "button",
2513
2537
  {
2514
2538
  type: "button",
@@ -2519,18 +2543,18 @@ function Qc({
2519
2543
  }),
2520
2544
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2521
2545
  children: [
2522
- /* @__PURE__ */ a(Yt, { className: "h-3 w-3 opacity-60" }),
2523
- Pn(e)
2546
+ /* @__PURE__ */ a(zt, { className: "h-3 w-3 opacity-60" }),
2547
+ Qn(e)
2524
2548
  ]
2525
2549
  },
2526
2550
  e
2527
2551
  )) })
2528
2552
  ] }),
2529
- !on && Ue && xe && /* @__PURE__ */ a(
2530
- Es,
2553
+ !sn && Ie && xe && /* @__PURE__ */ a(
2554
+ Os,
2531
2555
  {
2532
- collection: Ue,
2533
- onParsed: (e, t) => xe(`/collections/${Ue}/new`, {
2556
+ collection: Ie,
2557
+ onParsed: (e, t) => xe(`/collections/${Ie}/new`, {
2534
2558
  state: { importResult: e, importTemplateId: t.id }
2535
2559
  })
2536
2560
  }
@@ -2551,11 +2575,11 @@ function Qc({
2551
2575
  {
2552
2576
  label: "Total",
2553
2577
  count: (x == null ? void 0 : x.total) ?? 0,
2554
- filteredCount: X ? X.total : null,
2555
- active: Object.values(_).every(La) && g === "all",
2556
- isLoading: Ge,
2578
+ filteredCount: Z ? Z.total : null,
2579
+ active: Object.values(_).every(Pa) && g === "all",
2580
+ isLoading: We,
2557
2581
  ...ht("total"),
2558
- onClick: Oa
2582
+ onClick: Ma
2559
2583
  }
2560
2584
  ),
2561
2585
  /* @__PURE__ */ a(
@@ -2563,13 +2587,13 @@ function Qc({
2563
2587
  {
2564
2588
  label: "Warning",
2565
2589
  count: (x == null ? void 0 : x.sla_warning) ?? 0,
2566
- filteredCount: X ? X.sla_warning : null,
2590
+ filteredCount: Z ? Z.sla_warning : null,
2567
2591
  tone: "amber",
2568
2592
  active: _.sla_status === "warning",
2569
- isLoading: Ge,
2593
+ isLoading: We,
2570
2594
  deltaBadIsUp: !0,
2571
2595
  ...ht("sla_warning"),
2572
- onClick: () => Ie("sla_status", "warning")
2596
+ onClick: () => Ve("sla_status", "warning")
2573
2597
  }
2574
2598
  ),
2575
2599
  /* @__PURE__ */ a(
@@ -2577,13 +2601,13 @@ function Qc({
2577
2601
  {
2578
2602
  label: "Breached",
2579
2603
  count: (x == null ? void 0 : x.sla_breached) ?? 0,
2580
- filteredCount: X ? X.sla_breached : null,
2604
+ filteredCount: Z ? Z.sla_breached : null,
2581
2605
  tone: "red",
2582
2606
  active: _.sla_status === "breached",
2583
- isLoading: Ge,
2607
+ isLoading: We,
2584
2608
  deltaBadIsUp: !0,
2585
2609
  ...ht("sla_breached"),
2586
- onClick: () => Ie("sla_status", "breached")
2610
+ onClick: () => Ve("sla_status", "breached")
2587
2611
  }
2588
2612
  ),
2589
2613
  /* @__PURE__ */ a(
@@ -2591,13 +2615,13 @@ function Qc({
2591
2615
  {
2592
2616
  label: "At Risk",
2593
2617
  count: (x == null ? void 0 : x.at_risk) ?? 0,
2594
- filteredCount: X ? X.at_risk : null,
2618
+ filteredCount: Z ? Z.at_risk : null,
2595
2619
  tone: "red",
2596
2620
  active: _.at_risk === "yes",
2597
- isLoading: Ge,
2621
+ isLoading: We,
2598
2622
  deltaBadIsUp: !0,
2599
2623
  ...ht("at_risk"),
2600
- onClick: () => Ie("at_risk", "yes")
2624
+ onClick: () => Ve("at_risk", "yes")
2601
2625
  }
2602
2626
  ),
2603
2627
  /* @__PURE__ */ a(
@@ -2605,13 +2629,13 @@ function Qc({
2605
2629
  {
2606
2630
  label: "Unowned",
2607
2631
  count: (x == null ? void 0 : x.unowned) ?? 0,
2608
- filteredCount: X ? X.unowned : null,
2632
+ filteredCount: Z ? Z.unowned : null,
2609
2633
  active: g === "unowned",
2610
- isLoading: Ge,
2634
+ isLoading: We,
2611
2635
  deltaBadIsUp: !0,
2612
2636
  ...ht("unowned"),
2613
2637
  onClick: () => {
2614
- z(g === "unowned" ? "all" : "unowned"), D(1);
2638
+ Y(g === "unowned" ? "all" : "unowned"), O(1);
2615
2639
  }
2616
2640
  }
2617
2641
  )
@@ -2626,10 +2650,10 @@ function Qc({
2626
2650
  {
2627
2651
  type: "button",
2628
2652
  onClick: () => {
2629
- M((r) => ({
2653
+ Q((r) => ({
2630
2654
  ...r,
2631
2655
  aging_hours: r.aging_hours === t ? "" : t
2632
- })), D(1);
2656
+ })), O(1);
2633
2657
  },
2634
2658
  className: R(
2635
2659
  "rounded-md border px-2 py-1 tabular-nums transition-colors",
@@ -2650,7 +2674,7 @@ function Qc({
2650
2674
  "data-queue-burndown": !0,
2651
2675
  className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${ge.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : ge.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
2652
2676
  "data-tip": "Average net change per day over the last 14 days of snapshots",
2653
- children: ge.dir === "down" ? /* @__PURE__ */ d(Se, { children: [
2677
+ children: ge.dir === "down" ? /* @__PURE__ */ d(Ce, { children: [
2654
2678
  "▼ ",
2655
2679
  Math.abs(ge.pace).toFixed(1),
2656
2680
  "/day — clears in ~",
@@ -2658,24 +2682,24 @@ function Qc({
2658
2682
  " day",
2659
2683
  ge.days === 1 ? "" : "s",
2660
2684
  " at this pace"
2661
- ] }) : ge.dir === "up" ? /* @__PURE__ */ d(Se, { children: [
2685
+ ] }) : ge.dir === "up" ? /* @__PURE__ */ d(Ce, { children: [
2662
2686
  "▲ Growing ",
2663
2687
  ge.pace.toFixed(1),
2664
2688
  "/day"
2665
- ] }) : /* @__PURE__ */ a(Se, { children: "→ Holding steady" })
2689
+ ] }) : /* @__PURE__ */ a(Ce, { children: "→ Holding steady" })
2666
2690
  }
2667
2691
  ),
2668
- _r.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: _r.map(([e, t]) => {
2692
+ Cr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Cr.map(([e, t]) => {
2669
2693
  var n;
2670
2694
  return /* @__PURE__ */ a(
2671
- fi,
2695
+ vi,
2672
2696
  {
2673
- label: Ae(e),
2697
+ label: Le(e),
2674
2698
  count: t,
2675
- filteredCount: X ? X.by_state[e] ?? 0 : null,
2699
+ filteredCount: Z ? Z.by_state[e] ?? 0 : null,
2676
2700
  color: ((n = we[e]) == null ? void 0 : n.color) ?? null,
2677
- active: Aa.includes(e),
2678
- onClick: () => Ea(e)
2701
+ active: Ka.includes(e),
2702
+ onClick: () => Da(e)
2679
2703
  },
2680
2704
  e
2681
2705
  );
@@ -2684,18 +2708,18 @@ function Qc({
2684
2708
  }
2685
2709
  ),
2686
2710
  q !== "workload" && /* @__PURE__ */ a(
2687
- li,
2711
+ di,
2688
2712
  {
2689
- defs: Il,
2713
+ defs: Wl,
2690
2714
  values: _,
2691
- seededKeys: Nt,
2715
+ seededKeys: St,
2692
2716
  onApply: (e) => {
2693
- M((t) => ({ ...t, ...e })), D(1);
2717
+ Q((t) => ({ ...t, ...e })), O(1);
2694
2718
  },
2695
2719
  onClear: () => {
2696
- M({ ...ue.current }), D(1);
2720
+ Q({ ...ue.current }), O(1);
2697
2721
  },
2698
- right: Vl
2722
+ right: Hl
2699
2723
  }
2700
2724
  ),
2701
2725
  /* @__PURE__ */ d(
@@ -2711,7 +2735,7 @@ function Qc({
2711
2735
  className: "inline-flex h-6 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.06] px-2.5 text-[12px] text-slate-700 dark:text-slate-200",
2712
2736
  children: [
2713
2737
  "Your default ",
2714
- or(Ln),
2738
+ cr(Kn),
2715
2739
  " filter is hiding",
2716
2740
  " ",
2717
2741
  pe.toLocaleString("en-US"),
@@ -2722,7 +2746,7 @@ function Qc({
2722
2746
  "button",
2723
2747
  {
2724
2748
  type: "button",
2725
- onClick: sr,
2749
+ onClick: dr,
2726
2750
  className: "font-medium text-[#0284a8] underline-offset-2 hover:underline dark:text-nvr-cyan",
2727
2751
  children: "Show all"
2728
2752
  }
@@ -2753,10 +2777,10 @@ function Qc({
2753
2777
  "aria-label": "Clear the owner filter",
2754
2778
  "data-queue-owner-filter-clear": !0,
2755
2779
  onClick: () => {
2756
- M((e) => {
2780
+ Q((e) => {
2757
2781
  const { owners: t, ...n } = e;
2758
2782
  return n;
2759
- }), D(1);
2783
+ }), O(1);
2760
2784
  },
2761
2785
  className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
2762
2786
  children: "✕"
@@ -2765,27 +2789,27 @@ function Qc({
2765
2789
  ]
2766
2790
  }
2767
2791
  ),
2768
- !((B == null ? void 0 : B.data) ?? []).some((e) => e.is_default) && /* @__PURE__ */ a(
2792
+ !((j == null ? void 0 : j.data) ?? []).some((e) => e.is_default) && /* @__PURE__ */ a(
2769
2793
  "button",
2770
2794
  {
2771
2795
  type: "button",
2772
- onClick: pl,
2796
+ onClick: gl,
2773
2797
  title: "Revert to the queue default (filters, columns and sort cleared)",
2774
2798
  className: R(
2775
2799
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
2776
- ze == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2800
+ Xe == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2777
2801
  ),
2778
2802
  children: "Default"
2779
2803
  }
2780
2804
  ),
2781
- ((B == null ? void 0 : B.data) ?? []).map((e) => {
2805
+ ((j == null ? void 0 : j.data) ?? []).map((e) => {
2782
2806
  var t;
2783
2807
  return /* @__PURE__ */ d(
2784
2808
  "span",
2785
2809
  {
2786
2810
  className: R(
2787
2811
  "group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
2788
- ze === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2812
+ Xe === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2789
2813
  ),
2790
2814
  children: [
2791
2815
  /* @__PURE__ */ a(
@@ -2793,13 +2817,13 @@ function Qc({
2793
2817
  {
2794
2818
  type: "button",
2795
2819
  title: Je === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2796
- onClick: () => kl.mutate(Je === e.id ? null : e.id),
2820
+ onClick: () => _l.mutate(Je === e.id ? null : e.id),
2797
2821
  className: R(
2798
2822
  "shrink-0",
2799
2823
  Je === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2800
2824
  ),
2801
2825
  children: /* @__PURE__ */ a(
2802
- go,
2826
+ ko,
2803
2827
  {
2804
2828
  className: R("h-3 w-3", Je === e.id && "fill-current"),
2805
2829
  "aria-label": Je === e.id ? "Default view" : "Set as default"
@@ -2811,69 +2835,99 @@ function Qc({
2811
2835
  e.name,
2812
2836
  e.is_default ? /* @__PURE__ */ a("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ a("span", { className: "ml-1 text-slate-400", children: "· shared" })
2813
2837
  ] }),
2814
- Rr && /* @__PURE__ */ a(
2838
+ Lr && /* @__PURE__ */ a(
2815
2839
  "button",
2816
2840
  {
2817
2841
  type: "button",
2818
- onClick: () => xl.mutate({ viewId: e.id, on: !e.is_default }),
2842
+ onClick: () => wl.mutate({ viewId: e.id, on: !e.is_default }),
2819
2843
  title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
2820
2844
  className: R(
2821
2845
  "shrink-0",
2822
2846
  e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2823
2847
  ),
2824
2848
  "aria-label": e.is_default ? "Unset queue default" : "Set queue default",
2825
- children: /* @__PURE__ */ a(xo, { className: R("h-3 w-3", e.is_default && "fill-current") })
2849
+ children: /* @__PURE__ */ a(vo, { className: R("h-3 w-3", e.is_default && "fill-current") })
2826
2850
  }
2827
2851
  ),
2828
- (e.user === S || Oe) && ze === e.id && /* @__PURE__ */ a(
2852
+ (e.user === S || De) && Xe === e.id && /* @__PURE__ */ a(
2829
2853
  "button",
2830
2854
  {
2831
2855
  type: "button",
2832
- onClick: () => De.mutate(e),
2833
- disabled: De.isPending,
2856
+ onClick: () => Ke.mutate(e),
2857
+ disabled: Ke.isPending,
2834
2858
  title: "Update this view with the current filters, scope and sort",
2835
2859
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2836
2860
  "aria-label": `Update view ${e.name}`,
2837
- "data-view-update-state": De.isPending ? "saving" : Ar === e.id ? "saved" : "idle",
2838
- children: De.isPending && ((t = De.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(yo, { className: "h-3 w-3 animate-spin" }) : Ar === e.id ? /* @__PURE__ */ a(
2839
- ko,
2861
+ "data-view-update-state": Ke.isPending ? "saving" : Dr === e.id ? "saved" : "idle",
2862
+ children: Ke.isPending && ((t = Ke.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(wo, { className: "h-3 w-3 animate-spin" }) : Dr === e.id ? /* @__PURE__ */ a(
2863
+ _o,
2840
2864
  {
2841
2865
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
2842
2866
  strokeWidth: 3
2843
2867
  }
2844
- ) : /* @__PURE__ */ a(vo, { className: "h-3 w-3" })
2868
+ ) : /* @__PURE__ */ a(No, { className: "h-3 w-3" })
2845
2869
  }
2846
2870
  ),
2847
- ze === e.id && /* @__PURE__ */ a(
2871
+ Xe === e.id && /* @__PURE__ */ a(
2848
2872
  "button",
2849
2873
  {
2850
2874
  type: "button",
2851
- onClick: () => Ka(e.id),
2852
- title: Pt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2875
+ onClick: () => ja(e.id),
2876
+ title: Kt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2853
2877
  className: R(
2854
2878
  "shrink-0",
2855
- Pt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2879
+ Kt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2856
2880
  ),
2857
2881
  "aria-label": `Subscribe to view ${e.name}`,
2858
- children: /* @__PURE__ */ a(wo, { className: R("h-3 w-3", Pt(e.id) && "fill-current") })
2882
+ children: /* @__PURE__ */ a(So, { className: R("h-3 w-3", Kt(e.id) && "fill-current") })
2859
2883
  }
2860
2884
  ),
2861
- e.user === S && /* @__PURE__ */ a(
2885
+ e.user === S && (qn === e.id ? /* @__PURE__ */ d(
2886
+ "span",
2887
+ {
2888
+ className: "flex shrink-0 items-center gap-1",
2889
+ "data-view-delete-confirm": e.id,
2890
+ children: [
2891
+ /* @__PURE__ */ a("span", { className: "text-red-600 dark:text-red-400", children: "Delete?" }),
2892
+ /* @__PURE__ */ a(
2893
+ "button",
2894
+ {
2895
+ type: "button",
2896
+ onClick: () => Pr.mutate(e.id),
2897
+ disabled: Pr.isPending,
2898
+ className: "font-semibold text-red-600 hover:underline disabled:opacity-50 dark:text-red-400",
2899
+ "aria-label": `Yes, delete view ${e.name}`,
2900
+ children: "Yes"
2901
+ }
2902
+ ),
2903
+ /* @__PURE__ */ a(
2904
+ "button",
2905
+ {
2906
+ type: "button",
2907
+ onClick: () => Ht(null),
2908
+ className: "text-slate-500 hover:underline dark:text-slate-400",
2909
+ "aria-label": `Keep view ${e.name}`,
2910
+ children: "No"
2911
+ }
2912
+ )
2913
+ ]
2914
+ }
2915
+ ) : /* @__PURE__ */ a(
2862
2916
  "button",
2863
2917
  {
2864
2918
  type: "button",
2865
- onClick: () => yl.mutate(e.id),
2919
+ onClick: () => Ht(e.id),
2866
2920
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
2867
2921
  "aria-label": `Delete view ${e.name}`,
2868
2922
  children: "×"
2869
2923
  }
2870
- )
2924
+ ))
2871
2925
  ]
2872
2926
  },
2873
2927
  e.id
2874
2928
  );
2875
2929
  }),
2876
- /* @__PURE__ */ d(nt, { open: ml, onOpenChange: Sn, children: [
2930
+ /* @__PURE__ */ d(nt, { open: fl, onOpenChange: Cn, children: [
2877
2931
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ a(
2878
2932
  "button",
2879
2933
  {
@@ -2885,14 +2939,14 @@ function Qc({
2885
2939
  ) }),
2886
2940
  /* @__PURE__ */ d(at, { className: "w-[240px] p-3", align: "end", children: [
2887
2941
  (() => {
2888
- const e = B == null ? void 0 : B.data.find((t) => t.id === ze);
2889
- return !e || e.user !== S && !Oe ? null : /* @__PURE__ */ d(
2942
+ const e = j == null ? void 0 : j.data.find((t) => t.id === Xe);
2943
+ return !e || e.user !== S && !De ? null : /* @__PURE__ */ d(
2890
2944
  "button",
2891
2945
  {
2892
2946
  type: "button",
2893
- disabled: De.isPending,
2947
+ disabled: Ke.isPending,
2894
2948
  onClick: () => {
2895
- De.mutate(e), Sn(!1);
2949
+ Ke.mutate(e), Cn(!1);
2896
2950
  },
2897
2951
  className: "mb-2 w-full rounded-md border border-nvr-cyan/40 bg-nvr-cyan/5 px-2 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 disabled:opacity-50 dark:text-nvr-cyan",
2898
2952
  children: [
@@ -2906,29 +2960,29 @@ function Qc({
2906
2960
  /* @__PURE__ */ a(
2907
2961
  "input",
2908
2962
  {
2909
- value: Cn,
2910
- onChange: (e) => Cr(e.target.value),
2963
+ value: $n,
2964
+ onChange: (e) => Fr(e.target.value),
2911
2965
  placeholder: "View name",
2912
2966
  className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
2913
2967
  }
2914
2968
  ),
2915
2969
  /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2916
2970
  /* @__PURE__ */ a(
2917
- Mn,
2971
+ jn,
2918
2972
  {
2919
- checked: $r || kt,
2973
+ checked: Tr || kt,
2920
2974
  disabled: kt,
2921
- onCheckedChange: (e) => qr(e === !0)
2975
+ onCheckedChange: (e) => Rr(e === !0)
2922
2976
  }
2923
2977
  ),
2924
2978
  "Share with everyone"
2925
2979
  ] }),
2926
- Rr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2980
+ Lr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2927
2981
  /* @__PURE__ */ a(
2928
- Mn,
2982
+ jn,
2929
2983
  {
2930
2984
  checked: kt,
2931
- onCheckedChange: (e) => Fr(e === !0)
2985
+ onCheckedChange: (e) => Er(e === !0)
2932
2986
  }
2933
2987
  ),
2934
2988
  "Set as queue default (everyone starts here)"
@@ -2937,8 +2991,8 @@ function Qc({
2937
2991
  "button",
2938
2992
  {
2939
2993
  type: "button",
2940
- disabled: !Cn.trim() || Er.isPending,
2941
- onClick: () => Er.mutate(),
2994
+ disabled: !$n.trim() || Or.isPending,
2995
+ onClick: () => Or.mutate(),
2942
2996
  className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
2943
2997
  children: "Save current view"
2944
2998
  }
@@ -2950,76 +3004,76 @@ function Qc({
2950
3004
  )
2951
3005
  ] }),
2952
3006
  /* @__PURE__ */ d("div", { ref: Gt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2953
- rr && /* @__PURE__ */ a(Ps, { error: Ua, onRetry: () => void Ia(), className: "mb-3" }),
2954
- On && /* @__PURE__ */ a(
3007
+ or && /* @__PURE__ */ a(Qs, { error: Wa, onRetry: () => void Ha(), className: "mb-3" }),
3008
+ Pn && /* @__PURE__ */ a(
2955
3009
  "p",
2956
3010
  {
2957
3011
  "data-filter-sentence": !0,
2958
- "data-tip": On,
3012
+ "data-tip": Pn,
2959
3013
  "aria-live": "polite",
2960
3014
  className: "mb-1.5 shrink-0 truncate px-0.5 text-[11.5px] text-slate-500 dark:text-slate-400",
2961
- children: On
3015
+ children: Pn
2962
3016
  }
2963
3017
  ),
2964
- q === "table" ? /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
3018
+ q === "table" ? /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2965
3019
  "div",
2966
3020
  {
2967
- ref: Ce.rootRef,
3021
+ ref: $e.rootRef,
2968
3022
  className: R(
2969
3023
  "relative min-w-0 flex-1 transition-opacity duration-200",
2970
- ir && "pointer-events-none opacity-60"
3024
+ ur && "pointer-events-none opacity-60"
2971
3025
  ),
2972
- "aria-busy": ir || void 0,
3026
+ "aria-busy": ur || void 0,
2973
3027
  children: [
2974
- cr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2975
- Ha.text ?? "Still working",
3028
+ mr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
3029
+ Xa.text ?? "Still working",
2976
3030
  " — ",
2977
- cr,
3031
+ mr,
2978
3032
  "s"
2979
3033
  ] }),
2980
3034
  /* @__PURE__ */ a(
2981
- $s,
3035
+ Ts,
2982
3036
  {
2983
3037
  fillHeight: !0,
2984
- enterKey: pr.current,
3038
+ enterKey: fr.current,
2985
3039
  density: Tt,
2986
3040
  minBodyHeight: 360,
2987
- columns: Ht,
3041
+ columns: Yt,
2988
3042
  rows: F,
2989
3043
  rowKey: (e) => `${e.collection}:${e.item_id}`,
2990
3044
  total: (c == null ? void 0 : c.total) ?? 0,
2991
3045
  page: de,
2992
- limit: ln,
2993
- isLoading: Ge,
2994
- onPageChange: D,
3046
+ limit: on,
3047
+ isLoading: We,
3048
+ onPageChange: O,
2995
3049
  onRowClick: (e) => Vt(e),
2996
3050
  rowDragProps: (e) => ({
2997
- ...el({ collection: e.collection, id: e.item_id }),
2998
- ...Ja.record(e.collection, e.item_id)
3051
+ ...al({ collection: e.collection, id: e.item_id }),
3052
+ ...Za.record(e.collection, e.item_id)
2999
3053
  }),
3000
3054
  onRowContextMenu: (e, t) => {
3001
3055
  t.preventDefault(), yt({ x: t.clientX, y: t.clientY, row: e });
3002
3056
  },
3003
3057
  rowTitle: (e) => {
3004
- const t = bt.get(P(e));
3005
- return Ce.titleFor(P(e)) ?? (t && !t.is_mine ? Zo(t) : void 0) ?? (Tr(e.collection, e.item_id) ? Is : void 0);
3058
+ const t = bt.get(K(e));
3059
+ return $e.titleFor(K(e)) ?? (t && !t.is_mine ? ns(t) : void 0) ?? (Ar(e.collection, e.item_id) ? Ws : void 0);
3006
3060
  },
3007
3061
  rowClassName: (e) => R(
3008
- gl(e),
3009
- Tr(e.collection, e.item_id) && Us
3062
+ vl(e),
3063
+ Ar(e.collection, e.item_id) && Gs
3010
3064
  ),
3011
- emptyMessage: rr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
3012
- qs,
3065
+ emptyMessage: or ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
3066
+ Rs,
3013
3067
  {
3014
- icon: _o,
3015
- title: ((la = c == null ? void 0 : c.empty) == null ? void 0 : la.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((oa = c == null ? void 0 : c.empty) == null ? void 0 : oa.reason) === "scope_mine" ? "Nothing waiting on you" : ((sa = c == null ? void 0 : c.empty) == null ? void 0 : sa.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3016
- detail: ((ia = c == null ? void 0 : c.empty) == null ? void 0 : ia.reason) === "filters" && pe > 0 ? `Your default ${or(Ln)} filter is hiding ${pe.toLocaleString("en-US")} item${pe === 1 ? "" : "s"} here.` : ((ca = c == null ? void 0 : c.empty) == null ? void 0 : ca.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((da = c == null ? void 0 : c.empty) == null ? void 0 : da.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3017
- action: ((ua = c == null ? void 0 : c.empty) == null ? void 0 : ua.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3068
+ icon: Co,
3069
+ title: ((ca = c == null ? void 0 : c.empty) == null ? void 0 : ca.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((da = c == null ? void 0 : c.empty) == null ? void 0 : da.reason) === "scope_mine" ? "Nothing waiting on you" : ((ua = c == null ? void 0 : c.empty) == null ? void 0 : ua.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3070
+ detail: ((ma = c == null ? void 0 : c.empty) == null ? void 0 : ma.reason) === "filters" && pe > 0 ? `Your default ${cr(Kn)} filter is hiding ${pe.toLocaleString("en-US")} item${pe === 1 ? "" : "s"} here.` : ((pa = c == null ? void 0 : c.empty) == null ? void 0 : pa.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((ba = c == null ? void 0 : c.empty) == null ? void 0 : ba.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3071
+ action: ((ha = c == null ? void 0 : c.empty) == null ? void 0 : ha.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3018
3072
  pe > 0 && /* @__PURE__ */ d(
3019
3073
  "button",
3020
3074
  {
3021
3075
  type: "button",
3022
- onClick: sr,
3076
+ onClick: dr,
3023
3077
  className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-semibold text-white hover:brightness-105",
3024
3078
  "data-queue-empty-defaults": !0,
3025
3079
  children: [
@@ -3036,8 +3090,8 @@ function Qc({
3036
3090
  var t;
3037
3091
  const e = {};
3038
3092
  for (const [n, r] of Object.entries(ue.current))
3039
- (t = qe[n.slice(6)]) != null && t.length && (e[n] = r);
3040
- M(e), D(1);
3093
+ (t = Fe[n.slice(6)]) != null && t.length && (e[n] = r);
3094
+ Q(e), O(1);
3041
3095
  },
3042
3096
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
3043
3097
  "data-queue-empty-clear": !0,
@@ -3049,7 +3103,7 @@ function Qc({
3049
3103
  {
3050
3104
  type: "button",
3051
3105
  onClick: () => {
3052
- z("all"), D(1);
3106
+ Y("all"), O(1);
3053
3107
  },
3054
3108
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
3055
3109
  "data-queue-empty-all": !0,
@@ -3061,40 +3115,40 @@ function Qc({
3061
3115
  ),
3062
3116
  sort: I,
3063
3117
  onSortChange: (e) => {
3064
- je(e), D(1);
3118
+ Ue(e), O(1);
3065
3119
  },
3066
- filterDefs: An,
3120
+ filterDefs: Dn,
3067
3121
  filterValues: _,
3068
3122
  onFilterChange: (e, t) => {
3069
- M((n) => ({ ...n, [e]: t })), D(1);
3123
+ Q((n) => ({ ...n, [e]: t })), O(1);
3070
3124
  },
3071
- rowGroups: _l ?? void 0,
3125
+ rowGroups: Cl ?? void 0,
3072
3126
  collapsedGroups: ye,
3073
- onToggleGroup: cl,
3074
- selectedIds: Dt && Z ? Pe : void 0,
3075
- onSelectionChange: Dt && Z ? Ze : void 0,
3127
+ onToggleGroup: pl,
3128
+ selectedIds: Dt && ee ? Pe : void 0,
3129
+ onSelectionChange: Dt && ee ? et : void 0,
3076
3130
  hideFilterRow: !0,
3077
3131
  nowrapCells: !0,
3078
- columnPins: Hr,
3132
+ columnPins: Xr,
3079
3133
  onColumnPinChange: (e, t) => {
3080
- en((n) => {
3081
- const r = { ...n ?? Hr };
3134
+ tn((n) => {
3135
+ const r = { ...n ?? Xr };
3082
3136
  return t ? r[e] = t : delete r[e], r;
3083
3137
  });
3084
3138
  },
3085
3139
  columnFilterRow: !0,
3086
3140
  hScrollProxy: !0,
3087
3141
  footer: /* @__PURE__ */ a(
3088
- Ws,
3142
+ Js,
3089
3143
  {
3090
3144
  collections: ft,
3091
3145
  selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
3092
3146
  onToggle: (e) => {
3093
3147
  const t = e.ids.join(",");
3094
- M((n) => ({
3148
+ Q((n) => ({
3095
3149
  ...n,
3096
3150
  at_risk_rule: n.at_risk_rule === t ? "" : t
3097
- })), D(1);
3151
+ })), O(1);
3098
3152
  },
3099
3153
  className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
3100
3154
  }
@@ -3104,37 +3158,37 @@ function Qc({
3104
3158
  ]
3105
3159
  }
3106
3160
  ) }) }) : q === "kanban" ? /* @__PURE__ */ a(
3107
- ai,
3161
+ ci,
3108
3162
  {
3109
3163
  items: F,
3110
3164
  onCardClick: (e) => Vt(e),
3111
- onDrop: (e, t) => Ya.mutate({ item: e, targetState: t }),
3112
- onClaim: (e) => Ee.mutate(e),
3113
- onRelease: (e) => We.mutate(e),
3165
+ onDrop: (e, t) => el.mutate({ item: e, targetState: t }),
3166
+ onClaim: (e) => Ae.mutate(e),
3167
+ onRelease: (e) => He.mutate(e),
3114
3168
  swimlaneBy: st,
3115
- stateLabels: vn,
3169
+ stateLabels: wn,
3116
3170
  laneLabel: st === "collection" ? gt : void 0,
3117
3171
  claimsEnabled: me,
3118
3172
  onDraggingChange: (e) => {
3119
- Vn.current = e;
3173
+ Hn.current = e;
3120
3174
  }
3121
3175
  }
3122
- ) : /* @__PURE__ */ a(oi, { queueId: l })
3176
+ ) : /* @__PURE__ */ a(ui, { queueId: l })
3123
3177
  ] }),
3124
- Dt && Z && /* @__PURE__ */ d(
3125
- ni,
3178
+ Dt && ee && /* @__PURE__ */ d(
3179
+ si,
3126
3180
  {
3127
3181
  count: Pe.length,
3128
3182
  claimsEnabled: me,
3129
- showClaim: sn("claim"),
3130
- showRelease: sn("release"),
3131
- showTransition: sn("transition"),
3132
- states: Nr((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
3183
+ showClaim: cn("claim"),
3184
+ showRelease: cn("release"),
3185
+ showTransition: cn("transition"),
3186
+ states: $r((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
3133
3187
  value: e,
3134
- label: Ae(e)
3188
+ label: Le(e)
3135
3189
  })),
3136
- busy: Dr,
3137
- onClaim: () => $n(
3190
+ busy: Qr,
3191
+ onClaim: () => Fn(
3138
3192
  "Claim",
3139
3193
  (e) => h.request(
3140
3194
  se(`/queues/${l}/claim`, {
@@ -3143,7 +3197,7 @@ function Qc({
3143
3197
  })
3144
3198
  )
3145
3199
  ),
3146
- onRelease: () => $n(
3200
+ onRelease: () => Fn(
3147
3201
  "Release",
3148
3202
  (e) => h.request(
3149
3203
  se(`/queues/${l}/release`, {
@@ -3152,63 +3206,63 @@ function Qc({
3152
3206
  })
3153
3207
  )
3154
3208
  ),
3155
- onTransition: (e) => $n("Transition", (t) => dr(t, e)),
3156
- onClear: () => Ze([]),
3209
+ onTransition: (e) => Fn("Transition", (t) => pr(t, e)),
3210
+ onClear: () => et([]),
3157
3211
  children: [
3158
3212
  Pe.length >= 2 && /* @__PURE__ */ a(
3159
3213
  "button",
3160
3214
  {
3161
3215
  type: "button",
3162
3216
  onClick: () => {
3163
- const e = ts(
3164
- F.filter((t) => Pe.includes(P(t)) && t.collection !== "tasks").map((t) => H.urlFor(Nn(t)))
3217
+ const e = as(
3218
+ F.filter((t) => Pe.includes(K(t)) && t.collection !== "tasks").map((t) => H.urlFor(Sn(t)))
3165
3219
  );
3166
- e.blocked > 0 || e.capped > 0 ? O.warning(ya(e)) : O.success(ya(e));
3220
+ e.blocked > 0 || e.capped > 0 ? D.warning(_a(e)) : D.success(_a(e));
3167
3221
  },
3168
3222
  "data-bulk-open-tabs": !0,
3169
- title: `Open the selected records in new tabs (up to ${es})`,
3223
+ title: `Open the selected records in new tabs (up to ${rs})`,
3170
3224
  className: "h-8 rounded-md border border-white/20 px-3 text-[12.5px] font-medium hover:bg-white/10 dark:border-border dark:hover:bg-muted",
3171
3225
  children: "Open in tabs"
3172
3226
  }
3173
3227
  ),
3174
3228
  /* @__PURE__ */ a(
3175
- _s,
3229
+ Cs,
3176
3230
  {
3177
- targets: F.filter((e) => Pe.includes(P(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3231
+ targets: F.filter((e) => Pe.includes(K(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3178
3232
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
3179
3233
  tone: "light",
3180
- disabled: Dr,
3234
+ disabled: Qr,
3181
3235
  onDone: (e) => {
3182
- e.failed === 0 && Ze([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
3236
+ e.failed === 0 && et([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
3183
3237
  }
3184
3238
  }
3185
3239
  )
3186
3240
  ]
3187
3241
  }
3188
3242
  ),
3189
- re != null && re.length ? /* @__PURE__ */ a(
3190
- Gs,
3243
+ ae != null && ae.length ? /* @__PURE__ */ a(
3244
+ Ys,
3191
3245
  {
3192
- collection: re[0].collection,
3193
- itemId: re[0].itemId,
3194
- layoutId: re[0].layoutId,
3195
- rootLayoutSlug: re[0].rootLayoutSlug,
3196
- width: re[0].width,
3197
- title: re[0].title,
3198
- stack: re,
3199
- onPush: (e) => _t.push([...re, e]),
3246
+ collection: ae[0].collection,
3247
+ itemId: ae[0].itemId,
3248
+ layoutId: ae[0].layoutId,
3249
+ rootLayoutSlug: ae[0].rootLayoutSlug,
3250
+ width: ae[0].width,
3251
+ title: ae[0].title,
3252
+ stack: ae,
3253
+ onPush: (e) => _t.push([...ae, e]),
3200
3254
  onPop: () => _t.back(),
3201
- onClose: () => _t.back(re.length)
3255
+ onClose: () => _t.back(ae.length)
3202
3256
  }
3203
3257
  ) : null,
3204
- Q && fa(
3258
+ B && ka(
3205
3259
  /* @__PURE__ */ d(
3206
3260
  "div",
3207
3261
  {
3208
3262
  style: {
3209
3263
  position: "fixed",
3210
- left: Math.min(Q.x, window.innerWidth - 200),
3211
- top: Math.min(Q.y, window.innerHeight - 260),
3264
+ left: Math.min(B.x, window.innerWidth - 200),
3265
+ top: Math.min(B.y, window.innerHeight - 260),
3212
3266
  zIndex: 125
3213
3267
  },
3214
3268
  className: "w-48 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 shadow-xl dark:border-slate-700 dark:bg-slate-900",
@@ -3216,20 +3270,20 @@ function Qc({
3216
3270
  "data-queue-row-menu": !0,
3217
3271
  children: [
3218
3272
  [
3219
- { label: "Open", run: () => Vt(Q.row) },
3273
+ { label: "Open", run: () => Vt(B.row) },
3220
3274
  {
3221
3275
  label: "Open full record",
3222
- run: () => xt(Q.row)
3276
+ run: () => xt(B.row)
3223
3277
  },
3224
- { label: "Peek", run: () => Le(Q.row) },
3278
+ { label: "Peek", run: () => Oe(B.row) },
3225
3279
  ...me ? [
3226
- ((ma = Q.row.claimed_by) == null ? void 0 : ma.id) === S ? { label: "Release claim", run: () => We.mutate(Q.row) } : { label: "Claim", run: () => Ee.mutate(Q.row) }
3280
+ ((fa = B.row.claimed_by) == null ? void 0 : fa.id) === S ? { label: "Release claim", run: () => He.mutate(B.row) } : { label: "Claim", run: () => Ae.mutate(B.row) }
3227
3281
  ] : [],
3228
3282
  {
3229
3283
  label: "Copy ID",
3230
3284
  run: () => {
3231
3285
  var e;
3232
- return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(Q.row.item_id));
3286
+ return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(B.row.item_id));
3233
3287
  }
3234
3288
  },
3235
3289
  {
@@ -3237,14 +3291,14 @@ function Qc({
3237
3291
  run: () => {
3238
3292
  var e;
3239
3293
  return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
3240
- `${window.location.origin}${H.urlFor(Nn(Q.row))}`
3294
+ `${window.location.origin}${H.urlFor(Sn(B.row))}`
3241
3295
  ));
3242
3296
  }
3243
3297
  },
3244
3298
  // Custom actions (#125): the record's registered actions, right here.
3245
- ...Qa(Q.row.collection).map((e) => ({
3299
+ ...Ia(B.row.collection).map((e) => ({
3246
3300
  label: e.label,
3247
- run: () => Ba(e, Q.row)
3301
+ run: () => Va(e, B.row)
3248
3302
  }))
3249
3303
  ].map((e) => /* @__PURE__ */ a(
3250
3304
  "button",
@@ -3258,16 +3312,16 @@ function Qc({
3258
3312
  },
3259
3313
  e.label
3260
3314
  )),
3261
- Q.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
3315
+ B.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
3262
3316
  /* @__PURE__ */ a("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
3263
- mn.slice(0, 8).map((e) => {
3264
- const t = (Q.row.labels ?? []).includes(e);
3317
+ pn.slice(0, 8).map((e) => {
3318
+ const t = (B.row.labels ?? []).includes(e);
3265
3319
  return /* @__PURE__ */ d(
3266
3320
  "button",
3267
3321
  {
3268
3322
  type: "button",
3269
3323
  onClick: () => {
3270
- tr(Q.row, e), yt(null);
3324
+ ar(B.row, e), yt(null);
3271
3325
  },
3272
3326
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
3273
3327
  children: [
@@ -3291,7 +3345,7 @@ function Qc({
3291
3345
  const n = e.target.elements.namedItem(
3292
3346
  "newlabel"
3293
3347
  ).value.trim();
3294
- n && (tr(Q.row, n), yt(null));
3348
+ n && (ar(B.row, n), yt(null));
3295
3349
  },
3296
3350
  className: "px-3 py-1",
3297
3351
  children: /* @__PURE__ */ a(
@@ -3312,50 +3366,50 @@ function Qc({
3312
3366
  ),
3313
3367
  document.body
3314
3368
  ),
3315
- er && fa(
3369
+ rr && ka(
3316
3370
  /* @__PURE__ */ a(
3317
- xi,
3371
+ _i,
3318
3372
  {
3319
3373
  queueId: l,
3320
- drill: er,
3321
- onClose: () => dn(null),
3374
+ drill: rr,
3375
+ onClose: () => un(null),
3322
3376
  onOpenRecord: (e, t) => {
3323
- dn(null), H.open({ collection: e, itemId: t, layoutSlug: null });
3377
+ un(null), H.open({ collection: e, itemId: t, layoutSlug: null });
3324
3378
  }
3325
3379
  }
3326
3380
  ),
3327
3381
  document.body
3328
3382
  ),
3329
3383
  /* @__PURE__ */ a(
3330
- ri,
3384
+ ii,
3331
3385
  {
3332
3386
  item: _e,
3333
- stateLabels: vn,
3387
+ stateLabels: wn,
3334
3388
  collectionLabel: gt,
3335
3389
  claimsEnabled: me,
3336
- columnFormats: Cl,
3390
+ columnFormats: Fl,
3337
3391
  width: u == null ? void 0 : u.sheet_width,
3338
3392
  itemLayout: u == null ? void 0 : u.item_layout,
3339
3393
  onOpenChange: (e) => {
3340
- e || (Le(null), _n(!1));
3394
+ e || (Oe(null), Nn(!1));
3341
3395
  },
3342
- onClaim: (e) => Ee.mutate(e),
3343
- onRelease: (e) => We.mutate(e),
3344
- workNextActive: dl,
3345
- onNext: () => _e && Sr(_e),
3396
+ onClaim: (e) => Ae.mutate(e),
3397
+ onRelease: (e) => He.mutate(e),
3398
+ workNextActive: bl,
3399
+ onNext: () => _e && qr(_e),
3346
3400
  refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
3347
3401
  }
3348
3402
  ),
3349
- Kt.dialog
3403
+ Pt.dialog
3350
3404
  ] });
3351
3405
  }
3352
- function xi({
3406
+ function _i({
3353
3407
  queueId: l,
3354
3408
  drill: y,
3355
3409
  onClose: L,
3356
- onOpenRecord: K
3410
+ onOpenRecord: P
3357
3411
  }) {
3358
- const G = _a(), { data: f, isLoading: h } = W({
3412
+ const G = $a(), { data: f, isLoading: h } = W({
3359
3413
  queryKey: ["queue-agg-rows", l, y.row.collection, y.row.item_id, y.path],
3360
3414
  queryFn: () => G.request(
3361
3415
  A(`/queues/${l}/aggregate-rows`, {
@@ -3402,7 +3456,7 @@ function xi({
3402
3456
  "button",
3403
3457
  {
3404
3458
  type: "button",
3405
- onClick: () => f.target && K(f.target, String(S.id)),
3459
+ onClick: () => f.target && P(f.target, String(S.id)),
3406
3460
  className: "min-w-0 truncate text-left text-[12.5px] underline decoration-dotted underline-offset-2 hover:text-nvr-navy dark:hover:text-nvr-cyan",
3407
3461
  children: S.label
3408
3462
  }
@@ -3416,5 +3470,5 @@ function xi({
3416
3470
  );
3417
3471
  }
3418
3472
  export {
3419
- Qc as QueueWorklist
3473
+ Wc as QueueWorklist
3420
3474
  };