@declarion/react 0.52.0 → 0.54.0

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 (65) hide show
  1. package/dist-lib/{DraggableChildrenTable-CJCjc_cd.js → DraggableChildrenTable-CPoUY99R.js} +35 -35
  2. package/dist-lib/{Grid-DUjbQg3r.js → Grid--QAEby8k.js} +28 -28
  3. package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-BxZ7Nd9b.js} +920 -922
  4. package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-BPV4GPrv.js} +14 -14
  5. package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-CIKuh_0i.js} +10 -10
  6. package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
  7. package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-DMLkZP3R.js} +120 -122
  8. package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-SnNu6Ug-.js} +376 -377
  9. package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-C73pR7Iw.js} +1098 -1099
  10. package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-rJjQZe1V.js} +183 -183
  11. package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-DQ_KrkWk.js} +1 -1
  12. package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DsuUS7ae.js} +382 -382
  13. package/dist-lib/api/agents.d.ts +0 -1
  14. package/dist-lib/api/events.d.ts +27 -5
  15. package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-BadzqyeQ.js} +146 -204
  16. package/dist-lib/components/actions/ObjectActionBar.d.ts +1 -1
  17. package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
  18. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -1
  19. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -1
  20. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -1
  21. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +1 -1
  22. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +1 -1
  23. package/dist-lib/components/file-widgets/host.d.ts +1 -1
  24. package/dist-lib/components/layout/Layout.d.ts +1 -1
  25. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  26. package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
  27. package/dist-lib/components/list/PeekFieldCell.d.ts +1 -1
  28. package/dist-lib/components/list/QuickPeek.d.ts +1 -1
  29. package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
  30. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
  31. package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
  32. package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -1
  33. package/dist-lib/components/pages/list/ListCardsBody.d.ts +1 -1
  34. package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
  35. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
  36. package/dist-lib/components/pages/list/columns.d.ts +1 -1
  37. package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
  38. package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +1 -1
  39. package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
  40. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +1 -1
  41. package/dist-lib/components/pages/list/useListViews.d.ts +1 -1
  42. package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
  43. package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
  44. package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
  45. package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-sMkkAEg9.js} +301 -320
  46. package/dist-lib/{format-count-C3N-WxEy.js → format-count-B5SLlNOb.js} +245 -245
  47. package/dist-lib/hooks/useMutations.d.ts +1 -1
  48. package/dist-lib/hooks/useSSE.d.ts +24 -4
  49. package/dist-lib/index.js +1586 -1858
  50. package/dist-lib/lib/action-dispatch.d.ts +1 -1
  51. package/dist-lib/lib/document-templates.d.ts +1 -1
  52. package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
  53. package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-CbHFwz_F.js} +36 -36
  54. package/dist-lib/{registry-p6CejATt.js → registry-D0RhCnEL.js} +507 -507
  55. package/dist-lib/stores/realtime.d.ts +20 -0
  56. package/dist-lib/testing.js +35 -35
  57. package/dist-lib/types/api.d.ts +8 -4
  58. package/dist-lib/types/schema.d.ts +6 -0
  59. package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-DVTXCj_K.js} +2508 -1557
  60. package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-C2nq58YV.js} +13 -10
  61. package/dist-lib/{useProperties-C5fZp12D.js → useProperties-BcIz-MyO.js} +25 -25
  62. package/dist-lib/useTabSearchMirror-UYCsopxP.js +177 -0
  63. package/dist-lib/{value-DKekzcjz.js → value-CQzGOI0F.js} +25 -25
  64. package/package.json +14 -14
  65. package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
@@ -1,28 +1,28 @@
1
1
  import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
- import { $n as t, A as n, An as r, At as i, Cn as a, Ct as o, Dn as s, En as c, F as l, M as u, N as d, Pn as f, S as p, Sn as m, Tn as h, Zn as g, _, _n as v, bn as y, bt as b, cr as x, dr as S, er as C, fr as w, gt as T, h as E, i as D, jt as ee, lr as te, m as O, mt as k, pt as ne, q as re, rr as ie, rt as A, tt as ae, un as j, ur as oe, v as M, vn as se, w as ce, wn as le, x as N, xt as P, y as ue, zn as F } from "./useCurrentScreen-74x5yJNb.js";
3
- import { a as de, i as fe, m as pe, s as me, t as he } from "./RefreshControl-C-8UCyau.js";
4
- import { t as ge } from "./Check-DAfMbQIw.js";
5
- import { E as _e, F as ve, L as ye, O as be, c as xe, f as Se, j as Ce, l as we, m as Te, n as Ee, p as De, w as Oe } from "./field-classification-CeYJlsNq.js";
6
- import { a as ke, c as Ae, f as je, h as Me, l as Ne, m as Pe, n as Fe, o as Ie, p as Le, r as Re, t as ze } from "./action-dispatch-C28UhXXA.js";
7
- import { a as Be, c as Ve, f as He, i as Ue, l as We, m as Ge, n as Ke, o as qe, p as Je, r as Ye, s as Xe, t as Ze, u as I } from "./cardProjection-Bp_ZPLUE.js";
8
- import { l as Qe, m as $e, n as et, t as tt } from "./useTabSearchMirror-D_wzoYRz.js";
9
- import { a as nt, c as rt, d as it, f as at, l as ot, o as st, p as ct, s as lt, t as ut, u as dt } from "./format-count-C3N-WxEy.js";
10
- import { a as ft, c as pt, i as mt, n as L, o as R, s as ht, t as gt } from "./peekDraftStore-D3sowXga.js";
11
- import { t as _t } from "./useListQuery-D75bgLLz.js";
12
- import { Suspense as vt, createElement as z, lazy as yt, memo as B, useCallback as V, useEffect as H, useMemo as U, useRef as W, useState as G } from "react";
13
- import { useSearchParams as bt } from "react-router";
14
- import { useQueries as xt, useQueryClient as St } from "@tanstack/react-query";
15
- import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
16
- import { columnResizingFeature as Ct, columnSizingFeature as wt, columnVisibilityFeature as Tt, flexRender as Et, rowSelectionFeature as Dt, rowSortingFeature as Ot, tableFeatures as kt, useTable as At } from "@tanstack/react-table";
17
- import { useVirtualizer as jt } from "@tanstack/react-virtual";
2
+ import { B as t, Cr as n, Dr as r, Dt as i, Fn as a, Fr as o, G as s, Gt as c, Hn as l, Ht as u, Ir as d, J as f, Jn as p, Kn as m, Mr as h, Mt as g, Nr as _, Pr as v, Qt as y, U as b, Ut as x, V as S, Vn as C, W as w, Wn as T, X as E, Xn as D, Xt as O, Yn as k, Yt as A, Zn as j, an as ee, at as te, d as ne, er as re, f as M, h as ie, i as N, ir as P, it as ae, l as oe, lr as F, m as se, nt as ce, on as le, p as ue, q as de, qn as fe, st as pe, u as me, wr as I, xr as he, yt as ge } from "./useCurrentScreen-DVTXCj_K.js";
3
+ import { a as _e, i as ve, m as ye, s as be, t as xe } from "./RefreshControl-DMLkZP3R.js";
4
+ import { t as Se } from "./Check-DAfMbQIw.js";
5
+ import { C as Ce, M as we, O as Te, P as Ee, T as De, l as Oe, n as ke, p as Ae, u as je, x as Me } from "./field-classification-sMkkAEg9.js";
6
+ import { a as Ne, c as Pe, f as Fe, h as Ie, l as Le, m as Re, n as ze, o as Be, p as Ve, r as He, t as Ue } from "./action-dispatch-DsuUS7ae.js";
7
+ import { c as We, i as Ge, n as Ke, o as qe, r as L, s as Je, t as Ye } from "./cardProjection-BadzqyeQ.js";
8
+ import { a as Xe, c as Ze, d as Qe, f as $e, l as et, o as tt, p as nt, s as rt, t as it, u as R } from "./format-count-B5SLlNOb.js";
9
+ import { l as at, m as ot, n as st, t as ct } from "./useTabSearchMirror-UYCsopxP.js";
10
+ import { a as lt, c as ut, i as dt, n as z, o as B, s as ft, t as pt } from "./peekDraftStore-CbHFwz_F.js";
11
+ import { t as mt } from "./useListQuery-C2nq58YV.js";
12
+ import { Suspense as ht, createElement as V, lazy as gt, memo as H, useCallback as U, useEffect as W, useMemo as G, useRef as K, useState as q } from "react";
13
+ import { useSearchParams as _t } from "react-router";
14
+ import { useQueries as vt, useQueryClient as yt } from "@tanstack/react-query";
15
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
16
+ import { columnResizingFeature as bt, columnSizingFeature as xt, columnVisibilityFeature as St, flexRender as Ct, rowSelectionFeature as wt, rowSortingFeature as Tt, tableFeatures as Et, useTable as Dt } from "@tanstack/react-table";
17
+ import { useVirtualizer as Ot } from "@tanstack/react-virtual";
18
18
  //#region src/components/pages/list/table-features.ts
19
- var Mt = kt({
20
- rowSortingFeature: Ot,
21
- rowSelectionFeature: Dt,
22
- columnSizingFeature: wt,
23
- columnResizingFeature: Ct,
24
- columnVisibilityFeature: Tt
25
- }), Nt = [
19
+ var kt = Et({
20
+ rowSortingFeature: Tt,
21
+ rowSelectionFeature: wt,
22
+ columnSizingFeature: xt,
23
+ columnResizingFeature: bt,
24
+ columnVisibilityFeature: St
25
+ }), At = [
26
26
  25,
27
27
  50,
28
28
  100,
@@ -32,7 +32,7 @@ var Mt = kt({
32
32
  ];
33
33
  //#endregion
34
34
  //#region src/components/pages/list/filter-meta.ts
35
- function Pt(e, t, n) {
35
+ function jt(e, t, n) {
36
36
  if (!e || !t) return [];
37
37
  let r = e.filters ?? t.fields.names(), i = e.filter_operators ?? {}, a = [];
38
38
  for (let o of r) {
@@ -43,12 +43,12 @@ function Pt(e, t, n) {
43
43
  if (!n) continue;
44
44
  a.push({
45
45
  code: o,
46
- label: s(n.name) || e,
46
+ label: j(n.name) || e,
47
47
  type: "status",
48
48
  operators: r,
49
49
  options: n.statuses.map((e) => ({
50
50
  value: e.code,
51
- label: s(e.name) || e.code,
51
+ label: j(e.name) || e.code,
52
52
  color: e.color
53
53
  }))
54
54
  });
@@ -59,44 +59,44 @@ function Pt(e, t, n) {
59
59
  if (!n) continue;
60
60
  a.push({
61
61
  code: o,
62
- label: s(n.name) || e,
62
+ label: j(n.name) || e,
63
63
  type: "property",
64
64
  operators: r
65
65
  });
66
66
  continue;
67
67
  }
68
- let c = t.fields.get(o);
69
- if (!c) continue;
70
- let l = le(c, o, n), u = c.values?.map((e) => ({
68
+ let s = t.fields.get(o);
69
+ if (!s) continue;
70
+ let c = p(s, o, n), l = s.values?.map((e) => ({
71
71
  value: e.code,
72
- label: s(e.name) || e.code,
72
+ label: j(e.name) || e.code,
73
73
  color: e.color
74
- })), d = y(c.filter_special_values, e?.filter_special_values?.[o]);
74
+ })), u = T(s.filter_special_values, e?.filter_special_values?.[o]);
75
75
  a.push({
76
76
  code: o,
77
- label: l,
78
- type: c.type,
77
+ label: c,
78
+ type: s.type,
79
79
  operators: r,
80
- options: u,
81
- ref: c.ref,
82
- specialValues: d.length > 0 ? d : void 0
80
+ options: l,
81
+ ref: s.ref,
82
+ specialValues: u.length > 0 ? u : void 0
83
83
  });
84
84
  }
85
85
  return a;
86
86
  }
87
87
  //#endregion
88
88
  //#region src/components/pages/list/useListSort.ts
89
- function Ft({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitScreenTabSearch: r }) {
90
- let i = e.get("sort") ?? n ?? "", a = U(() => Xe(i), [i]), o = U(() => {
89
+ function Mt({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitScreenTabSearch: r }) {
90
+ let i = e.get("sort") ?? n ?? "", a = G(() => M(i), [i]), o = G(() => {
91
91
  let e = /* @__PURE__ */ new Map();
92
92
  for (let t of a) t.nulls && e.set(t.field, t.nulls);
93
93
  return e;
94
- }, [a]), s = U(() => I(i), [i]), c = U(() => a.map((e) => ({
94
+ }, [a]), s = G(() => ie(i), [i]), c = G(() => a.map((e) => ({
95
95
  id: e.field,
96
96
  desc: e.dir === "desc"
97
- })), [a]), l = V((n) => {
97
+ })), [a]), l = U((n) => {
98
98
  let i = n.slice(0, 5), a = new URLSearchParams(e);
99
- i.length === 0 ? a.delete("sort") : a.set("sort", We(i)), a.set("page", "1"), r(a.toString()), t(a);
99
+ i.length === 0 ? a.delete("sort") : a.set("sort", se(i)), a.set("page", "1"), r(a.toString()), t(a);
100
100
  }, [
101
101
  e,
102
102
  r,
@@ -108,38 +108,38 @@ function Ft({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitS
108
108
  forRequest: s,
109
109
  tableSorting: c,
110
110
  write: l,
111
- applyColumn: V((e, t, n) => l([{
111
+ applyColumn: U((e, t, n) => l([{
112
112
  field: e,
113
113
  dir: t,
114
114
  ...n ? { nulls: n } : {}
115
115
  }]), [l]),
116
- shiftClickColumn: V((e) => l(qe(a, e)), [a, l]),
117
- appendColumn: V((e, t, n) => l(Be(a, {
116
+ shiftClickColumn: U((e) => l(ne(a, e)), [a, l]),
117
+ appendColumn: U((e, t, n) => l(me(a, {
118
118
  field: e,
119
119
  dir: t,
120
120
  ...n ? { nulls: n } : {}
121
121
  })), [a, l]),
122
- clearColumn: V((e) => l(Ve(a, e)), [a, l]),
123
- clearAll: V(() => l([]), [l])
122
+ clearColumn: U((e) => l(ue(a, e)), [a, l]),
123
+ clearAll: U(() => l([]), [l])
124
124
  };
125
125
  }
126
126
  //#endregion
127
127
  //#region src/components/pages/list/useListSelection.ts
128
- var It = {};
129
- function Lt(e, t) {
130
- return r(e, a(e, t));
128
+ var Nt = {};
129
+ function Pt(e, t) {
130
+ return re(e, fe(e, t));
131
131
  }
132
- function Rt(e, t, n) {
132
+ function Ft(e, t, n) {
133
133
  if (!e || n.length === 0) return [];
134
134
  let r = new Set(n);
135
- return t.filter((t) => r.has(Lt(e, t))).map((t) => a(e, t));
135
+ return t.filter((t) => r.has(Pt(e, t))).map((t) => fe(e, t));
136
136
  }
137
- function zt(e, t, n) {
138
- let [r, i] = it("selection", It, { scope: "path" }), a = U(() => e?.fields.names().find((t) => e.fields.get(t)?.primary) ?? "id", [e]), o = V((t) => e ? Lt(e, t) : F(t[a]), [e, a]), s = U(() => Object.keys(r).filter((e) => r[e]), [r]), c = U(() => Rt(e, t, s), [
137
+ function It(e, t, n) {
138
+ let [r, i] = Qe("selection", Nt, { scope: "path" }), a = G(() => e?.fields.names().find((t) => e.fields.get(t)?.primary) ?? "id", [e]), o = U((t) => e ? Pt(e, t) : F(t[a]), [e, a]), s = G(() => Object.keys(r).filter((e) => r[e]), [r]), c = G(() => Ft(e, t, s), [
139
139
  e,
140
140
  t,
141
141
  s
142
- ]), l = U(() => {
142
+ ]), l = G(() => {
143
143
  if (s.length === 0) return [];
144
144
  let e = /* @__PURE__ */ new Map();
145
145
  for (let n of t) e.set(o(n), n);
@@ -149,7 +149,7 @@ function zt(e, t, n) {
149
149
  t,
150
150
  o
151
151
  ]);
152
- return H(() => {
152
+ return W(() => {
153
153
  n || i((e) => {
154
154
  let n = Object.keys(e);
155
155
  if (n.length === 0) return e;
@@ -173,23 +173,23 @@ function zt(e, t, n) {
173
173
  }
174
174
  //#endregion
175
175
  //#region src/components/pages/list/useListColumnLayout.ts
176
- function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
177
- let i = U(() => {
176
+ function Lt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
177
+ let i = G(() => {
178
178
  let e = n.get("columns");
179
179
  return e ? e.split(",").filter(Boolean) : t?.default_columns ?? t?.columns ?? [];
180
180
  }, [
181
181
  n,
182
182
  t?.default_columns,
183
183
  t?.columns
184
- ]), { widths: a, prune: o, setWidths: s, resetWidths: c, resizeEduShown: l, markResizeEduShown: u } = _e(e), [d, f] = G(() => a);
185
- H(() => {
184
+ ]), { widths: a, prune: o, setWidths: s, resetWidths: c, resizeEduShown: l, markResizeEduShown: u } = Ce(e), [d, f] = q(() => a);
185
+ W(() => {
186
186
  f(a);
187
187
  }, [a]);
188
- let p = U(() => t?.columns ?? [], [t?.columns]);
189
- H(() => {
188
+ let p = G(() => t?.columns ?? [], [t?.columns]);
189
+ W(() => {
190
190
  p.length > 0 && o(p);
191
191
  }, [p, o]);
192
- let m = V((e) => {
192
+ let m = U((e) => {
193
193
  if (e.length === 0) return;
194
194
  let t = new URLSearchParams(n);
195
195
  t.set("columns", e.join(",")), r(t);
@@ -199,11 +199,11 @@ function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
199
199
  sizing: d,
200
200
  setSizing: f,
201
201
  apply: m,
202
- clear: V(() => {
202
+ clear: U(() => {
203
203
  let e = new URLSearchParams(n);
204
204
  e.delete("columns"), r(e);
205
205
  }, [n, r]),
206
- move: V((e, t) => {
206
+ move: U((e, t) => {
207
207
  let n = i.indexOf(e);
208
208
  if (n === -1) return;
209
209
  let r = t === "up" ? n - 1 : n + 1;
@@ -211,8 +211,8 @@ function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
211
211
  let a = [...i];
212
212
  [a[n], a[r]] = [a[r], a[n]], m(a);
213
213
  }, [i, m]),
214
- commitResize: V((e) => {
215
- s(e), !l && (u(), A.info("Column width saved on this device", "Widths are personal and never shared. Column order, sort and filters can be saved into a view."));
214
+ commitResize: U((e) => {
215
+ s(e), !l && (u(), g.info("Column width saved on this device", "Widths are personal and never shared. Column order, sort and filters can be saved into a view."));
216
216
  }, [
217
217
  s,
218
218
  l,
@@ -221,7 +221,7 @@ function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
221
221
  resetWidths: c
222
222
  };
223
223
  }
224
- function Vt(e, t, n = 10) {
224
+ function Rt(e, t, n = 10) {
225
225
  switch (t.type) {
226
226
  case "down": return {
227
227
  origin: {
@@ -253,27 +253,27 @@ function Vt(e, t, n = 10) {
253
253
  };
254
254
  }
255
255
  }
256
- function Ht(e) {
256
+ function zt(e) {
257
257
  return e instanceof Element && e.closest("a, button, input, select, [role='button'], [role='menuitem']") !== null;
258
258
  }
259
- function Ut(e, t) {
259
+ function Bt(e, t) {
260
260
  return e != null && e.rowId === t ? "double" : "single";
261
261
  }
262
262
  //#endregion
263
263
  //#region src/hooks/useLongPress.ts
264
- function Wt(e) {
265
- let t = W(null), n = W(null), r = W(!1), i = V(() => {
264
+ function Vt(e) {
265
+ let t = K(null), n = K(null), r = K(!1), i = U(() => {
266
266
  n.current !== null && clearTimeout(n.current), n.current = null;
267
267
  }, []);
268
- H(() => i, [i]);
269
- let a = V((e) => {
270
- let n = Vt(t.current, e);
268
+ W(() => i, [i]);
269
+ let a = U((e) => {
270
+ let n = Rt(t.current, e);
271
271
  return t.current = n.origin, n.outcome !== "pending" && i(), n;
272
272
  }, [i]);
273
273
  return {
274
274
  handlers: {
275
275
  onPointerDown: (o) => {
276
- if (o.pointerType === "mouse" || Ht(o.target)) return;
276
+ if (o.pointerType === "mouse" || zt(o.target)) return;
277
277
  r.current = !1, i();
278
278
  let s = {
279
279
  x: o.clientX,
@@ -283,7 +283,7 @@ function Wt(e) {
283
283
  type: "down",
284
284
  ...s
285
285
  }), n.current = setTimeout(() => {
286
- let i = Vt(t.current, { type: "held" });
286
+ let i = Rt(t.current, { type: "held" });
287
287
  t.current = i.origin, n.current = null, i.outcome === "fire" && (r.current = !0, e(s));
288
288
  }, 500);
289
289
  },
@@ -298,7 +298,7 @@ function Wt(e) {
298
298
  onPointerCancel: () => void a({ type: "release" }),
299
299
  onPointerLeave: () => void a({ type: "release" })
300
300
  },
301
- consumePressFired: V(() => {
301
+ consumePressFired: U(() => {
302
302
  let e = r.current;
303
303
  return r.current = !1, e;
304
304
  }, [])
@@ -306,128 +306,128 @@ function Wt(e) {
306
306
  }
307
307
  //#endregion
308
308
  //#region src/components/pages/list/useListRowInteraction.ts
309
- function Gt({ entity: e, screen: t, screens: n, entities: i, searchParams: o, tabNavigate: c, commitScreenTabSearch: l, isPhone: u, canUpdate: d }) {
310
- let [f, p] = G(null), [m, g] = G(null), _ = W(null), v = W(null);
311
- H(() => () => {
312
- v.current && clearTimeout(v.current.timer);
309
+ function Ht({ entity: e, screen: t, screens: n, entities: r, searchParams: i, tabNavigate: a, commitScreenTabSearch: o, isPhone: s, canUpdate: u }) {
310
+ let [d, f] = q(null), [m, h] = q(null), g = K(null), _ = K(null);
311
+ W(() => () => {
312
+ _.current && clearTimeout(_.current.timer);
313
313
  }, []);
314
- let y = t?.on_row_click === "peek" && t.quick_peek?.enabled !== !1 && !u, x = V((i, u) => {
314
+ let v = t?.on_row_click === "peek" && t.quick_peek?.enabled !== !1 && !s, y = U((r, s) => {
315
315
  if (!e || !t) return;
316
- let d = a(e, i), f = r(e, d), p = se(t, e, n, d);
317
- if (!p) return;
318
- if (u?.draft) {
319
- L(f, u.draft);
320
- let [e, t] = p.split("?", 2), n = new URLSearchParams(t ?? "");
321
- n.set("edit", "true"), p = `${e}?${n.toString()}`;
316
+ let c = fe(e, r), u = re(e, c), d = l(t, e, n, c);
317
+ if (!d) return;
318
+ if (s?.draft) {
319
+ z(u, s.draft);
320
+ let [e, t] = d.split("?", 2), n = new URLSearchParams(t ?? "");
321
+ n.set("edit", "true"), d = `${e}?${n.toString()}`;
322
322
  }
323
- let m = h(i, e) ?? s(e.display.name), g = t.display?.icon || e.display.icon;
324
- l(o.toString()), c(p, {
325
- title: m,
326
- icon: g
323
+ let f = k(r, e) ?? j(e.display.name), p = t.display?.icon || e.display.icon;
324
+ o(i.toString()), a(d, {
325
+ title: f,
326
+ icon: p
327
327
  });
328
328
  }, [
329
329
  e,
330
330
  t,
331
331
  n,
332
- o,
333
- c,
334
- l
335
- ]), S = Wt(V((e) => {
336
- let t = _.current;
337
- t && g({
332
+ i,
333
+ a,
334
+ o
335
+ ]), b = Vt(U((e) => {
336
+ let t = g.current;
337
+ t && h({
338
338
  x: e.x,
339
339
  y: e.y,
340
340
  row: t
341
341
  });
342
- }, [])), C = V((t, n) => {
343
- if (S.consumePressFired() || Ht(t.target)) return;
344
- if (!y || !e) {
345
- x(n);
342
+ }, [])), x = U((t, n) => {
343
+ if (b.consumePressFired() || zt(t.target)) return;
344
+ if (!v || !e) {
345
+ y(n);
346
346
  return;
347
347
  }
348
- let r = Lt(e, n);
349
- if (Ut(v.current, r) === "double") {
350
- clearTimeout(v.current.timer), v.current = null, p(null), x(n);
348
+ let r = Pt(e, n);
349
+ if (Bt(_.current, r) === "double") {
350
+ clearTimeout(_.current.timer), _.current = null, f(null), y(n);
351
351
  return;
352
352
  }
353
- v.current && clearTimeout(v.current.timer);
353
+ _.current && clearTimeout(_.current.timer);
354
354
  let i = setTimeout(() => {
355
- v.current = null, p(n);
355
+ _.current = null, f(n);
356
356
  }, 250);
357
- v.current = {
357
+ _.current = {
358
358
  rowId: r,
359
359
  timer: i
360
360
  };
361
361
  }, [
362
362
  e,
363
+ v,
363
364
  y,
364
- x,
365
- S
365
+ b
366
366
  ]);
367
367
  return {
368
- peekAllowed: y,
369
- peekRow: f,
370
- setPeekRow: p,
371
- peekFields: U(() => {
372
- if (!y || !e || !f) return [];
373
- let r = Re(e, t, f);
374
- return Ye(e, r, n).map((t) => {
368
+ peekAllowed: v,
369
+ peekRow: d,
370
+ setPeekRow: f,
371
+ peekFields: G(() => {
372
+ if (!v || !e || !d) return [];
373
+ let i = He(e, t, d);
374
+ return L(e, i, n).map((t) => {
375
375
  if (e.files?.get(t)) return {
376
376
  key: t,
377
- label: Pe(e, t, i),
377
+ label: Re(e, t, r),
378
378
  kind: "file",
379
- readOnly: !d
379
+ readOnly: !u
380
380
  };
381
- let n = e.fields.get(t), r = d && !n.primary && !n.auto && !n.ref && n.files?.mode !== "rich_text_inline";
381
+ let n = e.fields.get(t), i = u && !n.primary && !n.auto && !n.ref && n.files?.mode !== "rich_text_inline";
382
382
  return {
383
383
  key: t,
384
- label: le(n, t, i),
384
+ label: p(n, t, r),
385
385
  kind: "field",
386
386
  field: n,
387
- readOnly: !r
387
+ readOnly: !i
388
388
  };
389
389
  });
390
390
  }, [
391
- y,
392
- f,
391
+ v,
392
+ d,
393
393
  e,
394
394
  t,
395
- i,
395
+ r,
396
396
  n,
397
- d
397
+ u
398
398
  ]),
399
- peekActions: U(() => e?.actions ?? {}, [e?.actions]),
400
- peekExecute: V(async (t, n, r) => {
401
- let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i && f ? [F(f[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
402
- return b(o, T(r, a));
403
- }, [e, f]),
399
+ peekActions: G(() => e?.actions ?? {}, [e?.actions]),
400
+ peekExecute: U(async (t, n, r) => {
401
+ let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i && d ? [F(d[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
402
+ return A(o, c(r, a));
403
+ }, [e, d]),
404
404
  contextMenu: m,
405
- setContextMenu: g,
406
- pressedRow: _,
407
- longPress: S,
408
- onRowClick: C,
409
- navigateToDetail: x
405
+ setContextMenu: h,
406
+ pressedRow: g,
407
+ longPress: b,
408
+ onRowClick: x,
409
+ navigateToDetail: y
410
410
  };
411
411
  }
412
412
  //#endregion
413
413
  //#region src/components/pages/list/column-sizing.ts
414
- function Kt(e) {
414
+ function Ut(e) {
415
415
  return `--header-${e}-size`;
416
416
  }
417
- function qt(e) {
417
+ function Wt(e) {
418
418
  return `--col-${e}-size`;
419
419
  }
420
- function Jt(e) {
420
+ function Gt(e) {
421
421
  return `calc(var(${e}) * 1px)`;
422
422
  }
423
- function Yt(e) {
423
+ function Kt(e) {
424
424
  let t = e.getFlatHeaders(), n = {};
425
- for (let e of t) n[Kt(e.id)] = e.getSize(), n[qt(e.column.id)] = e.column.getSize();
425
+ for (let e of t) n[Ut(e.id)] = e.getSize(), n[Wt(e.column.id)] = e.column.getSize();
426
426
  return n;
427
427
  }
428
428
  //#endregion
429
429
  //#region src/components/pages/list/sortable-header.ts
430
- var Xt = /* @__PURE__ */ new Set([
430
+ var qt = /* @__PURE__ */ new Set([
431
431
  "secret",
432
432
  "password",
433
433
  "json",
@@ -435,29 +435,29 @@ var Xt = /* @__PURE__ */ new Set([
435
435
  "int_array",
436
436
  "uuid_array"
437
437
  ]);
438
- function Zt(e, t) {
438
+ function Jt(e, t) {
439
439
  if (e === "_actions" || e === "_select" || e.startsWith("$property.") || e.startsWith("$refs.")) return !1;
440
440
  if (e.startsWith("$status.")) return !0;
441
441
  let n = t?.fields.get(e);
442
- return !n || t?.list_pagination === "cursor" && n.cross_store_sortable === !1 ? !1 : !Xt.has(n.type);
442
+ return !n || t?.list_pagination === "cursor" && n.cross_store_sortable === !1 ? !1 : !qt.has(n.type);
443
443
  }
444
444
  //#endregion
445
445
  //#region src/components/pages/list/ListTable.tsx
446
- var Qt = yt(() => import("./SortHeaderMenu-CbihbEGd.js").then((e) => ({ default: e.SortHeaderMenu }))), $t = B(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a }) {
447
- return /* @__PURE__ */ J("tbody", { children: [
448
- e.length > 0 && /* @__PURE__ */ q("tr", { children: /* @__PURE__ */ q("td", {
446
+ var Yt = gt(() => import("./SortHeaderMenu-DQ_KrkWk.js").then((e) => ({ default: e.SortHeaderMenu }))), Xt = H(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a }) {
447
+ return /* @__PURE__ */ X("tbody", { children: [
448
+ e.length > 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
449
449
  style: { height: t },
450
450
  colSpan: r
451
451
  }) }),
452
452
  e.map((e) => a(i[e.index], e.index)),
453
- e.length > 0 && /* @__PURE__ */ q("tr", { children: /* @__PURE__ */ q("td", {
453
+ e.length > 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
454
454
  style: { height: n },
455
455
  colSpan: r
456
456
  }) })
457
457
  ] });
458
458
  }, (e, t) => t.isResizing);
459
- function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, totalColumnsWidth: o, theadRef: s, virtualizer: c, visibleCols: l, headerReorder: u, sortCols: d, sortNullsMap: f, shiftClickColumn: p, applyColumnSort: m, appendColumnSort: h, clearColumnSort: g, clearAllSorts: _, renderRow: v, isResizingColumn: y }) {
460
- return /* @__PURE__ */ J("table", {
459
+ function Zt({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, totalColumnsWidth: o, theadRef: s, virtualizer: c, visibleCols: l, headerReorder: u, sortCols: d, sortNullsMap: f, shiftClickColumn: p, applyColumnSort: m, appendColumnSort: h, clearColumnSort: g, clearAllSorts: _, renderRow: v, isResizingColumn: y }) {
460
+ return /* @__PURE__ */ X("table", {
461
461
  "data-virtual-rows": "true",
462
462
  style: {
463
463
  ...a,
@@ -469,22 +469,22 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
469
469
  fontSize: 12.5,
470
470
  color: "var(--text)"
471
471
  },
472
- children: [/* @__PURE__ */ q("thead", {
472
+ children: [/* @__PURE__ */ Y("thead", {
473
473
  ref: s,
474
- children: t.getHeaderGroups().map((t) => /* @__PURE__ */ J("tr", {
474
+ children: t.getHeaderGroups().map((t) => /* @__PURE__ */ X("tr", {
475
475
  style: {
476
476
  height: 32,
477
477
  background: "var(--surface-2)"
478
478
  },
479
479
  children: [t.headers.map((t) => {
480
- let n = Zt(t.id, i), r = t.column.getIsSorted(), a = t.id === "_select", o = t.id === "_actions", s = r ? d.findIndex((e) => e.field === t.id) + 1 : 0, c = d.length > 1 && s > 0, v = s > 0, y = d.length < 5, b = n ? t.column.getToggleSortingHandler() : void 0, x = n ? (e) => {
480
+ let n = Jt(t.id, i), r = t.column.getIsSorted(), a = t.id === "_select", o = t.id === "_actions", s = r ? d.findIndex((e) => e.field === t.id) + 1 : 0, c = d.length > 1 && s > 0, v = s > 0, y = d.length < 5, b = n ? t.column.getToggleSortingHandler() : void 0, x = n ? (e) => {
481
481
  if (e.shiftKey) {
482
482
  e.preventDefault(), p(t.id);
483
483
  return;
484
484
  }
485
485
  b?.(e);
486
486
  } : void 0, S = !a && !o, C = S ? l.indexOf(t.id) : -1, w = u.dragColId === t.id, T = u.isDragging && C !== -1 && u.dropIndex === C, E = u.isDragging && C !== -1 && C === l.length - 1 && u.dropIndex === l.length;
487
- return /* @__PURE__ */ J("th", {
487
+ return /* @__PURE__ */ X("th", {
488
488
  "data-col-id": S ? t.id : void 0,
489
489
  onMouseDown: S ? (e) => u.onHeaderMouseDown(t.id, e) : void 0,
490
490
  onClick: (e) => {
@@ -501,8 +501,8 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
501
501
  cursor: n ? "pointer" : "default",
502
502
  opacity: w ? .4 : 1,
503
503
  boxShadow: T ? "inset 2px 0 0 0 var(--accent)" : E ? "inset -2px 0 0 0 var(--accent)" : void 0,
504
- width: Jt(Kt(t.id)),
505
- minWidth: Jt(Kt(t.id)),
504
+ width: Gt(Ut(t.id)),
505
+ minWidth: Gt(Ut(t.id)),
506
506
  borderBottom: "1px solid var(--border)",
507
507
  background: "var(--surface-2)",
508
508
  position: "sticky",
@@ -510,7 +510,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
510
510
  left: a ? 0 : "auto",
511
511
  zIndex: a ? 3 : 2
512
512
  },
513
- children: [t.isPlaceholder ? null : n ? /* @__PURE__ */ J("span", {
513
+ children: [t.isPlaceholder ? null : n ? /* @__PURE__ */ X("span", {
514
514
  style: {
515
515
  display: "inline-flex",
516
516
  alignItems: "center",
@@ -520,18 +520,18 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
520
520
  letterSpacing: "0.04em"
521
521
  },
522
522
  children: [
523
- Et(t.column.columnDef.header, t.getContext()),
524
- /* @__PURE__ */ J("span", {
523
+ Ct(t.column.columnDef.header, t.getContext()),
524
+ /* @__PURE__ */ X("span", {
525
525
  style: {
526
526
  display: "inline-flex",
527
527
  flexDirection: "column",
528
528
  alignItems: "center",
529
529
  lineHeight: 0
530
530
  },
531
- children: [r === "asc" ? /* @__PURE__ */ q(e.arrowUp, { size: 11 }) : r === "desc" ? /* @__PURE__ */ q(e.arrowDown, { size: 11 }) : /* @__PURE__ */ q(e.sort, {
531
+ children: [r === "asc" ? /* @__PURE__ */ Y(e.arrowUp, { size: 11 }) : r === "desc" ? /* @__PURE__ */ Y(e.arrowDown, { size: 11 }) : /* @__PURE__ */ Y(e.sort, {
532
532
  size: 11,
533
533
  style: { opacity: .35 }
534
- }), r && f.get(t.id) === "first" ? /* @__PURE__ */ q("span", {
534
+ }), r && f.get(t.id) === "first" ? /* @__PURE__ */ Y("span", {
535
535
  "aria-hidden": "true",
536
536
  style: {
537
537
  width: 4,
@@ -542,7 +542,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
542
542
  }
543
543
  }) : null]
544
544
  }),
545
- c ? /* @__PURE__ */ q("span", {
545
+ c ? /* @__PURE__ */ Y("span", {
546
546
  "aria-label": `Sort rank ${s}`,
547
547
  style: {
548
548
  fontSize: 10,
@@ -553,9 +553,9 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
553
553
  },
554
554
  children: s
555
555
  }) : null,
556
- /* @__PURE__ */ q(vt, {
556
+ /* @__PURE__ */ Y(ht, {
557
557
  fallback: null,
558
- children: /* @__PURE__ */ q(Qt, {
558
+ children: /* @__PURE__ */ Y(Yt, {
559
559
  field: t.id,
560
560
  activeDir: r,
561
561
  activeNulls: f.get(t.id),
@@ -568,7 +568,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
568
568
  })
569
569
  })
570
570
  ]
571
- }) : Et(t.column.columnDef.header, t.getContext()), t.column.getCanResize() && /* @__PURE__ */ q("div", {
571
+ }) : Ct(t.column.columnDef.header, t.getContext()), t.column.getCanResize() && /* @__PURE__ */ Y("div", {
572
572
  "data-testid": "col-resize-handle",
573
573
  "aria-hidden": "true",
574
574
  onMouseDown: (e) => {
@@ -591,7 +591,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
591
591
  userSelect: "none",
592
592
  zIndex: 3
593
593
  },
594
- children: /* @__PURE__ */ q("span", { style: {
594
+ children: /* @__PURE__ */ Y("span", { style: {
595
595
  width: 2,
596
596
  height: "60%",
597
597
  alignSelf: "center",
@@ -600,7 +600,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
600
600
  } })
601
601
  })]
602
602
  }, t.id);
603
- }), /* @__PURE__ */ q("th", {
603
+ }), /* @__PURE__ */ Y("th", {
604
604
  "aria-hidden": "true",
605
605
  style: {
606
606
  borderBottom: "1px solid var(--border)",
@@ -611,7 +611,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
611
611
  }
612
612
  })]
613
613
  }, t.id))
614
- }), /* @__PURE__ */ q($t, {
614
+ }), /* @__PURE__ */ Y(Xt, {
615
615
  virtualItems: c.getVirtualItems(),
616
616
  topPad: c.getVirtualItems()[0]?.start ?? 0,
617
617
  bottomPad: c.getTotalSize() - (c.getVirtualItems().at(-1)?.end ?? 0),
@@ -624,19 +624,19 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
624
624
  }
625
625
  //#endregion
626
626
  //#region src/components/pages/list/DataCell.tsx
627
- function tn({ cell: e }) {
627
+ function Qt({ cell: e }) {
628
628
  let t = e.column.id === "_select", n = e.column.id === "_actions", r = e.column.columnDef.cell, i = typeof r == "function" ? r(e.getContext()) : r;
629
- return /* @__PURE__ */ q("td", {
629
+ return /* @__PURE__ */ Y("td", {
630
630
  title: typeof i == "string" ? i : void 0,
631
631
  style: {
632
632
  padding: t ? "0 6px 0 12px" : n ? "0 6px" : "0 10px",
633
633
  verticalAlign: "middle",
634
634
  borderBottom: "1px solid var(--divider)",
635
- width: Jt(qt(e.column.id)),
635
+ width: Gt(Wt(e.column.id)),
636
636
  whiteSpace: "nowrap",
637
637
  overflow: "hidden",
638
638
  textOverflow: "ellipsis",
639
- maxWidth: Jt(qt(e.column.id)),
639
+ maxWidth: Gt(Wt(e.column.id)),
640
640
  color: "var(--text)",
641
641
  position: t ? "sticky" : "static",
642
642
  left: t ? 0 : "auto",
@@ -648,9 +648,9 @@ function tn({ cell: e }) {
648
648
  }
649
649
  //#endregion
650
650
  //#region src/components/pages/list/ListTableRow.tsx
651
- function nn({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDetailTarget: a, interaction: o, measureElement: s }) {
651
+ function $t({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDetailTarget: a, interaction: o, measureElement: s }) {
652
652
  let c = e.original, l = r && c[n.soft_delete] != null, u = e.getIsSelected(), d = i && t % 2 == 1;
653
- return /* @__PURE__ */ J("tr", {
653
+ return /* @__PURE__ */ X("tr", {
654
654
  "data-index": t,
655
655
  "data-row-stripe": d ? "" : void 0,
656
656
  "aria-selected": u,
@@ -674,7 +674,7 @@ function nn({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDet
674
674
  onPointerDown: (e) => {
675
675
  o.pressedRow.current = c, o.longPress.handlers.onPointerDown(e);
676
676
  },
677
- children: [e.getVisibleCells().map((e) => /* @__PURE__ */ q(tn, { cell: e }, e.id)), /* @__PURE__ */ q("td", {
677
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ Y(Qt, { cell: e }, e.id)), /* @__PURE__ */ Y("td", {
678
678
  "aria-hidden": "true",
679
679
  style: { borderBottom: "1px solid var(--divider)" }
680
680
  })]
@@ -682,69 +682,69 @@ function nn({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDet
682
682
  }
683
683
  //#endregion
684
684
  //#region src/components/pages/list/ListNoRows.tsx
685
- function rn(e) {
686
- if (e instanceof j) {
685
+ function en(e) {
686
+ if (e instanceof a) {
687
687
  let t = e.ext("field"), n = e.ext("value");
688
688
  return t && n !== void 0 ? `${e.message} ${t}: "${n}"` : t ? `${e.message} ${t}` : e.message;
689
689
  }
690
690
  return e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.";
691
691
  }
692
- function an({ isLoading: e, tableLoadingStale: t, isError: n, error: r, rowCount: i, entity: a, screen: o, screenName: c, screenIcon: l, isFiltered: u, canCreate: d, toolbarActions: f, onRetry: p }) {
693
- let m = a.display;
694
- return e && t ? /* @__PURE__ */ q("div", {
692
+ function tn({ isLoading: e, tableLoadingStale: t, isError: n, error: r, rowCount: a, entity: o, screen: s, screenName: c, screenIcon: l, isFiltered: u, canCreate: f, toolbarActions: p, onRetry: m }) {
693
+ let h = o.display;
694
+ return e && t ? /* @__PURE__ */ Y("div", {
695
695
  style: { padding: "0 20px" },
696
- children: /* @__PURE__ */ q(dt, {
696
+ children: /* @__PURE__ */ Y(R, {
697
697
  icon: "alert-circle",
698
698
  title: "Still loading data",
699
699
  description: "This table is taking longer than expected. Retry the request or check network and server health.",
700
- action: /* @__PURE__ */ q(w, {
700
+ action: /* @__PURE__ */ Y(d, {
701
701
  kind: "primary",
702
702
  size: "sm",
703
- onClick: p,
703
+ onClick: m,
704
704
  children: "Retry"
705
705
  })
706
706
  })
707
- }) : e ? /* @__PURE__ */ q(He, { cols: o.columns?.length ?? 4 }) : n ? /* @__PURE__ */ q("div", {
707
+ }) : e ? /* @__PURE__ */ Y(qe, { cols: s.columns?.length ?? 4 }) : n ? /* @__PURE__ */ Y("div", {
708
708
  style: { padding: "0 20px" },
709
- children: /* @__PURE__ */ q(dt, {
709
+ children: /* @__PURE__ */ Y(R, {
710
710
  icon: "alert-circle",
711
711
  title: "Failed to load data",
712
- description: rn(r),
713
- action: /* @__PURE__ */ q(w, {
712
+ description: en(r),
713
+ action: /* @__PURE__ */ Y(d, {
714
714
  kind: "primary",
715
715
  size: "sm",
716
- onClick: p,
716
+ onClick: m,
717
717
  children: "Retry"
718
718
  })
719
719
  })
720
- }) : i === 0 ? /* @__PURE__ */ q("div", {
720
+ }) : a === 0 ? /* @__PURE__ */ Y("div", {
721
721
  style: { padding: "0 20px" },
722
722
  children: (() => {
723
- let e = m.empty_state, t = s(e?.title), n = s(e?.body), r = ae(e?.learn_more_url), i = u ? "No results found" : t || `No ${s(m.name_plural).toLowerCase() || c.toLowerCase()} yet`, a = d && f.some(({ code: e }) => e === "__new" || e === "__create"), o;
724
- return o = u ? "Try adjusting your search or filters" : n ? /* @__PURE__ */ J(K, { children: [n, r && /* @__PURE__ */ J(K, { children: [" ", /* @__PURE__ */ q("a", {
723
+ let e = h.empty_state, t = j(e?.title), n = j(e?.body), r = i(e?.learn_more_url), a = u ? "No results found" : t || `No ${j(h.name_plural).toLowerCase() || c.toLowerCase()} yet`, o = f && p.some(({ code: e }) => e === "__new" || e === "__create"), s;
724
+ return s = u ? "Try adjusting your search or filters" : n ? /* @__PURE__ */ X(J, { children: [n, r && /* @__PURE__ */ X(J, { children: [" ", /* @__PURE__ */ Y("a", {
725
725
  href: r,
726
726
  target: "_blank",
727
727
  rel: "noopener noreferrer",
728
728
  children: "Learn more"
729
- })] })] }) : a ? `Create your first ${s(m.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ q(dt, {
729
+ })] })] }) : o ? `Create your first ${j(h.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Y(R, {
730
730
  icon: l,
731
- title: i,
732
- description: o
731
+ title: a,
732
+ description: s
733
733
  });
734
734
  })()
735
735
  }) : null;
736
736
  }
737
737
  //#endregion
738
738
  //#region src/components/pages/list/ListFooter.tsx
739
- function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o, countTotal: s, countStrategy: c, countLoading: l, countError: u, page: d, totalPages: f, goToPage: p, perPage: m, setPerPage: h, hasMorePages: g, fetchNextPage: _, isFetchingNextPage: v }) {
740
- let y = me("list");
741
- return !n && !r ? null : /* @__PURE__ */ J("div", {
739
+ function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s, countTotal: c, countStrategy: l, countLoading: u, countError: d, page: f, totalPages: p, goToPage: m, perPage: h, setPerPage: g, hasMorePages: _, fetchNextPage: v, isFetchingNextPage: y }) {
740
+ let b = be("list");
741
+ return !t && !r ? null : /* @__PURE__ */ X("div", {
742
742
  style: {
743
743
  display: "flex",
744
744
  alignItems: "center",
745
745
  paddingTop: 8,
746
746
  paddingBottom: 8,
747
- ...i ? be(12) : {
747
+ ...i ? De(12) : {
748
748
  paddingLeft: 14,
749
749
  paddingRight: 14
750
750
  },
@@ -756,7 +756,7 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
756
756
  flexWrap: "wrap"
757
757
  },
758
758
  children: [
759
- y.isVisible("show_count") && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("span", {
759
+ b.isVisible("show_count") && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
760
760
  className: "num",
761
761
  "data-testid": "list-footer-count",
762
762
  style: {
@@ -764,40 +764,40 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
764
764
  alignItems: "center",
765
765
  gap: 5
766
766
  },
767
- children: s === void 0 ? l && !u ? /* @__PURE__ */ q("span", {
767
+ children: c === void 0 ? u && !d ? /* @__PURE__ */ Y("span", {
768
768
  "data-testid": "list-footer-count-pending",
769
769
  style: { display: "inline-flex" },
770
- children: /* @__PURE__ */ q(t, { size: 11 })
771
- }) : /* @__PURE__ */ J(K, { children: [
770
+ children: /* @__PURE__ */ Y(n, { size: 11 })
771
+ }) : /* @__PURE__ */ X(J, { children: [
772
772
  a,
773
773
  " ",
774
774
  a === 1 ? "record" : "records"
775
- ] }) : /* @__PURE__ */ J(K, { children: [
775
+ ] }) : /* @__PURE__ */ X(J, { children: [
776
776
  a,
777
777
  " of ",
778
- ut(s, c ?? "exact"),
778
+ it(c, l ?? "exact"),
779
779
  " ",
780
- s === 1 ? "record" : "records"
780
+ c === 1 ? "record" : "records"
781
781
  ] })
782
- }), /* @__PURE__ */ q("span", { children: "·" })] }),
783
- /* @__PURE__ */ J("span", { children: [
782
+ }), /* @__PURE__ */ Y("span", { children: "·" })] }),
783
+ /* @__PURE__ */ X("span", { children: [
784
784
  "Selected:",
785
785
  " ",
786
- /* @__PURE__ */ q("span", {
786
+ /* @__PURE__ */ Y("span", {
787
787
  className: "num",
788
788
  style: {
789
789
  color: "var(--text-2)",
790
790
  fontWeight: 500
791
791
  },
792
- children: o
792
+ children: s
793
793
  })
794
794
  ] }),
795
- /* @__PURE__ */ q("div", { style: { flex: i ? "1 1 100%" : 1 } }),
796
- !i && /* @__PURE__ */ q("span", { children: "Rows per page" }),
797
- /* @__PURE__ */ q("select", {
795
+ /* @__PURE__ */ Y("div", { style: { flex: i ? "1 1 100%" : 1 } }),
796
+ !i && /* @__PURE__ */ Y("span", { children: "Rows per page" }),
797
+ /* @__PURE__ */ Y("select", {
798
798
  "aria-label": "Rows per page",
799
- value: m,
800
- onChange: (e) => h(parseInt(e.target.value, 10)),
799
+ value: h,
800
+ onChange: (e) => g(parseInt(e.target.value, 10)),
801
801
  style: {
802
802
  fontSize: 11.5,
803
803
  padding: "2px 4px",
@@ -807,17 +807,17 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
807
807
  color: "var(--text-2)",
808
808
  cursor: "pointer"
809
809
  },
810
- children: Nt.map((e) => /* @__PURE__ */ q("option", {
810
+ children: At.map((e) => /* @__PURE__ */ Y("option", {
811
811
  value: e,
812
812
  children: e
813
813
  }, e))
814
814
  }),
815
- r ? g && /* @__PURE__ */ J("button", {
815
+ r ? _ && /* @__PURE__ */ X("button", {
816
816
  type: "button",
817
817
  className: "num",
818
818
  "data-testid": "list-footer-load-more",
819
- onClick: _,
820
- disabled: v,
819
+ onClick: v,
820
+ disabled: y,
821
821
  style: {
822
822
  display: "inline-flex",
823
823
  alignItems: "center",
@@ -827,36 +827,36 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
827
827
  border: "1px solid var(--border)",
828
828
  borderRadius: 4,
829
829
  color: "var(--text-2)",
830
- cursor: v ? "default" : "pointer"
830
+ cursor: y ? "default" : "pointer"
831
831
  },
832
- children: [v ? /* @__PURE__ */ q(t, { size: 11 }) : null, "Load more"]
833
- }) : (g || d > 1) && /* @__PURE__ */ J("div", {
832
+ children: [y ? /* @__PURE__ */ Y(n, { size: 11 }) : null, "Load more"]
833
+ }) : (_ || f > 1) && /* @__PURE__ */ X("div", {
834
834
  style: {
835
835
  display: "flex",
836
836
  alignItems: "center",
837
837
  gap: 4
838
838
  },
839
839
  children: [
840
- /* @__PURE__ */ q(S, {
840
+ /* @__PURE__ */ Y(o, {
841
841
  size: 22,
842
- icon: /* @__PURE__ */ q(e.left, { size: 12 }),
843
- onClick: () => p(d - 1),
844
- disabled: d <= 1
842
+ icon: /* @__PURE__ */ Y(e.left, { size: 12 }),
843
+ onClick: () => m(f - 1),
844
+ disabled: f <= 1
845
845
  }),
846
- /* @__PURE__ */ J("span", {
846
+ /* @__PURE__ */ X("span", {
847
847
  className: "num",
848
848
  style: { padding: "0 6px" },
849
849
  children: [
850
850
  "Page ",
851
- d,
852
- f === void 0 ? "" : ` of ${f}`
851
+ f,
852
+ p === void 0 ? "" : ` of ${p}`
853
853
  ]
854
854
  }),
855
- /* @__PURE__ */ q(S, {
855
+ /* @__PURE__ */ Y(o, {
856
856
  size: 22,
857
- icon: /* @__PURE__ */ q(e.right, { size: 12 }),
858
- onClick: () => p(d + 1),
859
- disabled: f === void 0 ? !g : d >= f
857
+ icon: /* @__PURE__ */ Y(e.right, { size: 12 }),
858
+ onClick: () => m(f + 1),
859
+ disabled: p === void 0 ? !_ : f >= p
860
860
  })
861
861
  ]
862
862
  })
@@ -865,94 +865,94 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
865
865
  }
866
866
  //#endregion
867
867
  //#region src/components/pages/ExportMenu.tsx
868
- function sn(e) {
868
+ function rn(e) {
869
869
  return !(e && e.enabled === !1);
870
870
  }
871
- function cn(e) {
871
+ function an(e) {
872
872
  return e == null ? "all matching rows" : `${e.toLocaleString()} ${e === 1 ? "row" : "rows"}`;
873
873
  }
874
- function ln(t) {
875
- let { isPhone: n } = ie(), { entityCode: r, entity: i, screen: a, viewState: o, visibleColumns: s, selectedRowPKs: c, totalRows: l, pageSize: u, locale: d, align: f = "end", variant: p = "toolbar", onBeforeOpen: m } = t, [h, g] = G(!1), [_, v] = G(!1), [y, b] = G(null), S = W(null), T = sn(i.export), E = sn(a?.export);
876
- if (!T || !E) return null;
877
- async function D(e) {
878
- b(null), v(!0);
874
+ function on(t) {
875
+ let { isPhone: n } = r(), { entityCode: i, entity: o, screen: s, viewState: c, visibleColumns: l, selectedRowPKs: u, totalRows: f, pageSize: p, locale: m, align: g = "end", variant: _ = "toolbar", onBeforeOpen: v } = t, [y, b] = q(!1), [x, S] = q(!1), [C, w] = q(null), T = K(null), E = rn(o.export), D = rn(s?.export);
876
+ if (!E || !D) return null;
877
+ async function k(e) {
878
+ w(null), S(!0);
879
879
  try {
880
- let t = pt(o, {
880
+ let t = ut(c, {
881
881
  scope: e,
882
- visibleColumns: s,
883
- selectedRowPKs: e === "selected_rows" ? c : void 0,
884
- locale: d
885
- }), { blob: n, filename: i } = await P(r, t);
886
- dn(n, i || `${r}-${un()}.csv`), g(!1);
882
+ visibleColumns: l,
883
+ selectedRowPKs: e === "selected_rows" ? u : void 0,
884
+ locale: m
885
+ }), { blob: n, filename: r } = await O(i, t);
886
+ cn(n, r || `${i}-${sn()}.csv`), b(!1);
887
887
  } catch (e) {
888
- let t = e instanceof j ? {
888
+ let t = e instanceof a ? {
889
889
  code: e.code,
890
890
  message: e.message
891
891
  } : {
892
892
  code: "",
893
893
  message: String(e)
894
894
  };
895
- b(t);
895
+ w(t);
896
896
  } finally {
897
- v(!1);
897
+ S(!1);
898
898
  }
899
899
  }
900
- if (p === "selection-menu-item") {
901
- let t = _ || c.length === 0;
902
- return /* @__PURE__ */ q(C, {
903
- icon: /* @__PURE__ */ q(e.download, { size: 12 }),
900
+ if (_ === "selection-menu-item") {
901
+ let t = x || u.length === 0;
902
+ return /* @__PURE__ */ Y(I, {
903
+ icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
904
904
  "data-testid": "export-selection-menu-item",
905
905
  onClick: t ? void 0 : () => {
906
- m?.(), D("selected_rows");
906
+ v?.(), k("selected_rows");
907
907
  },
908
- children: _ ? "Exporting…" : "Export selection (CSV)"
908
+ children: x ? "Exporting…" : "Export selection (CSV)"
909
909
  });
910
910
  }
911
- let ee = c.length > 0, te = i.list_pagination === "cursor";
912
- return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(w, {
913
- ref: S,
911
+ let A = u.length > 0, j = o.list_pagination === "cursor";
912
+ return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(d, {
913
+ ref: T,
914
914
  kind: "ghost",
915
915
  size: "sm",
916
- icon: /* @__PURE__ */ q(e.download, { size: 12 }),
916
+ icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
917
917
  onClick: () => {
918
- m?.(), g((e) => !e);
918
+ v?.(), b((e) => !e);
919
919
  },
920
- disabled: _,
920
+ disabled: x,
921
921
  "aria-label": "Export",
922
922
  title: "Export",
923
- children: n ? null : _ ? "Exporting…" : "Export"
924
- }), /* @__PURE__ */ J(x, {
925
- open: h,
926
- anchor: S.current,
927
- onClose: () => g(!1),
928
- align: f,
923
+ children: n ? null : x ? "Exporting…" : "Export"
924
+ }), /* @__PURE__ */ X(h, {
925
+ open: y,
926
+ anchor: T.current,
927
+ onClose: () => b(!1),
928
+ align: g,
929
929
  width: 260,
930
930
  children: [
931
- /* @__PURE__ */ J(C, {
932
- icon: /* @__PURE__ */ q(e.download, { size: 12 }),
933
- onClick: _ ? void 0 : () => void D("current_view"),
934
- children: ["Current view (CSV) · ", cn(l)]
931
+ /* @__PURE__ */ X(I, {
932
+ icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
933
+ onClick: x ? void 0 : () => void k("current_view"),
934
+ children: ["Current view (CSV) · ", an(f)]
935
935
  }),
936
- ee && /* @__PURE__ */ J(C, {
937
- icon: /* @__PURE__ */ q(e.check, { size: 12 }),
938
- onClick: _ ? void 0 : () => void D("selected_rows"),
939
- children: ["Selected rows (CSV) · ", c.length]
936
+ A && /* @__PURE__ */ X(I, {
937
+ icon: /* @__PURE__ */ Y(e.check, { size: 12 }),
938
+ onClick: x ? void 0 : () => void k("selected_rows"),
939
+ children: ["Selected rows (CSV) · ", u.length]
940
940
  }),
941
- te ? /* @__PURE__ */ q(C, {
942
- icon: /* @__PURE__ */ q(e.columns, { size: 12 }),
941
+ j ? /* @__PURE__ */ Y(I, {
942
+ icon: /* @__PURE__ */ Y(e.columns, { size: 12 }),
943
943
  "data-testid": "export-current-page-disabled",
944
944
  disabled: !0,
945
945
  children: "Current page · n/a (infinite scroll)"
946
- }) : /* @__PURE__ */ J(C, {
947
- icon: /* @__PURE__ */ q(e.columns, { size: 12 }),
948
- onClick: _ ? void 0 : () => void D("current_page"),
949
- children: ["Current page (CSV) · ", u ? `${u} rows` : "page window"]
946
+ }) : /* @__PURE__ */ X(I, {
947
+ icon: /* @__PURE__ */ Y(e.columns, { size: 12 }),
948
+ onClick: x ? void 0 : () => void k("current_page"),
949
+ children: ["Current page (CSV) · ", p ? `${p} rows` : "page window"]
950
950
  }),
951
- /* @__PURE__ */ q(C, {
952
- icon: /* @__PURE__ */ q(e.grid, { size: 12 }),
951
+ /* @__PURE__ */ Y(I, {
952
+ icon: /* @__PURE__ */ Y(e.grid, { size: 12 }),
953
953
  children: "XLSX (coming soon)"
954
954
  }),
955
- y && /* @__PURE__ */ q("div", {
955
+ C && /* @__PURE__ */ Y("div", {
956
956
  role: "alert",
957
957
  style: {
958
958
  padding: "6px 10px",
@@ -961,69 +961,69 @@ function ln(t) {
961
961
  color: "var(--destructive)",
962
962
  borderTop: "1px solid var(--border)"
963
963
  },
964
- children: y.message
964
+ children: C.message
965
965
  })
966
966
  ]
967
967
  })] });
968
968
  }
969
- function un() {
969
+ function sn() {
970
970
  let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
971
971
  return `${e.getUTCFullYear()}${t(e.getUTCMonth() + 1)}${t(e.getUTCDate())}-${t(e.getUTCHours())}${t(e.getUTCMinutes())}`;
972
972
  }
973
- function dn(e, t) {
973
+ function cn(e, t) {
974
974
  let n = URL.createObjectURL(e), r = document.createElement("a");
975
975
  r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 0);
976
976
  }
977
977
  //#endregion
978
978
  //#region src/components/pages/list/ListToolbar.tsx
979
- function fn({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, screenName: o, locale: c, isPhone: l, isCardsPresentation: u, sort: d, columns: f, views: p, query: m, selection: h, filters: _, searchValue: v, onSearchChange: y, onSaveView: b, page: T, perPage: E, includeDeleted: D, canViewDeleted: ee, onToggleDeleted: O, isLive: k }) {
980
- let [ne, re] = G(!1), [ie, A] = G(!1), [ae, j] = G(!1), M = W(null), se = W(null), ce = ye((e) => e.density), le = () => {
981
- let e = ce === "compact" ? "comfortable" : ce === "comfortable" ? "cozy" : "compact";
982
- ye.getState().setMany({ density: e });
983
- }, N = !l || ne || v !== "", P = (e) => {
979
+ function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, screenName: s, locale: c, isPhone: l, isCardsPresentation: u, sort: f, columns: p, views: m, query: g, selection: y, filters: b, searchValue: x, onSearchChange: S, onSaveView: C, page: w, perPage: T, includeDeleted: E, canViewDeleted: D, onToggleDeleted: O, isLive: k }) {
980
+ let [A, ee] = q(!1), [te, ne] = q(!1), [re, M] = q(!1), ie = K(null), N = K(null), P = Ee((e) => e.density), ae = () => {
981
+ let e = P === "compact" ? "comfortable" : P === "comfortable" ? "cozy" : "compact";
982
+ Ee.getState().setMany({ density: e });
983
+ }, oe = !l || A || x !== "", F = (e) => {
984
984
  if (e.startsWith("$status.")) {
985
985
  let t = e.slice(8), r = n.status_groups?.[t];
986
- return r ? s(r.name) || t : e;
986
+ return r ? j(r.name) || t : e;
987
987
  }
988
988
  if (e.startsWith("$property.")) {
989
989
  let t = e.slice(10), r = n.properties?.[t];
990
- return r ? s(r.name) || t : e;
990
+ return r ? j(r.name) || t : e;
991
991
  }
992
- return Pe(n, e, i?.entities);
993
- }, ue = (t.columns ?? []).filter((e) => Zt(e, n));
994
- return /* @__PURE__ */ J("div", {
992
+ return Re(n, e, i?.entities);
993
+ }, se = (t.columns ?? []).filter((e) => Jt(e, n));
994
+ return /* @__PURE__ */ X("div", {
995
995
  style: {
996
996
  display: "flex",
997
997
  alignItems: "center",
998
998
  gap: l ? 6 : 8,
999
999
  paddingTop: 0,
1000
1000
  paddingBottom: 10,
1001
- ...l ? be(12) : {
1001
+ ...l ? De(12) : {
1002
1002
  paddingLeft: 20,
1003
1003
  paddingRight: 20
1004
1004
  },
1005
1005
  flexWrap: "wrap"
1006
1006
  },
1007
1007
  children: [
1008
- /* @__PURE__ */ q(st, {
1009
- views: p.all,
1010
- activeViewId: p.activeId,
1011
- isDirty: p.isDirty,
1012
- onSelect: p.apply,
1013
- onSaveAs: b
1008
+ /* @__PURE__ */ Y(tt, {
1009
+ views: m.all,
1010
+ activeViewId: m.activeId,
1011
+ isDirty: m.isDirty,
1012
+ onSelect: m.apply,
1013
+ onSaveAs: C
1014
1014
  }),
1015
- N ? /* @__PURE__ */ J("div", {
1015
+ oe ? /* @__PURE__ */ X("div", {
1016
1016
  style: {
1017
1017
  position: "relative",
1018
1018
  width: l ? "100%" : 260,
1019
1019
  order: l ? -1 : 0
1020
1020
  },
1021
- children: [/* @__PURE__ */ q(g, {
1022
- value: v,
1023
- onChange: y,
1024
- placeholder: `Search ${o.toLowerCase()}…`,
1025
- prefix: /* @__PURE__ */ q(e.search, { size: 13 })
1026
- }), /* @__PURE__ */ q("span", {
1021
+ children: [/* @__PURE__ */ Y(he, {
1022
+ value: x,
1023
+ onChange: S,
1024
+ placeholder: `Search ${s.toLowerCase()}…`,
1025
+ prefix: /* @__PURE__ */ Y(e.search, { size: 13 })
1026
+ }), /* @__PURE__ */ Y("span", {
1027
1027
  style: {
1028
1028
  position: "absolute",
1029
1029
  right: 6,
@@ -1031,43 +1031,43 @@ function fn({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
1031
1031
  transform: "translateY(-50%)",
1032
1032
  pointerEvents: "none"
1033
1033
  },
1034
- children: /* @__PURE__ */ q(te, { children: "/" })
1034
+ children: /* @__PURE__ */ Y(_, { children: "/" })
1035
1035
  })]
1036
- }) : /* @__PURE__ */ q(S, {
1037
- icon: /* @__PURE__ */ q(e.search, { size: 14 }),
1038
- title: `Search ${o.toLowerCase()}`,
1039
- onClick: () => re(!0)
1036
+ }) : /* @__PURE__ */ Y(o, {
1037
+ icon: /* @__PURE__ */ Y(e.search, { size: 14 }),
1038
+ title: `Search ${s.toLowerCase()}`,
1039
+ onClick: () => ee(!0)
1040
1040
  }),
1041
- /* @__PURE__ */ J(w, {
1042
- icon: /* @__PURE__ */ q(e.filter, { size: 13 }),
1043
- onClick: _.onOpen,
1044
- active: _.count > 0,
1045
- children: ["Filters", _.count > 0 && /* @__PURE__ */ q(oe, {
1041
+ /* @__PURE__ */ X(d, {
1042
+ icon: /* @__PURE__ */ Y(e.filter, { size: 13 }),
1043
+ onClick: b.onOpen,
1044
+ active: b.count > 0,
1045
+ children: ["Filters", b.count > 0 && /* @__PURE__ */ Y(v, {
1046
1046
  tone: "violet",
1047
1047
  size: "xs",
1048
1048
  style: { marginLeft: 4 },
1049
- children: _.count
1049
+ children: b.count
1050
1050
  })]
1051
1051
  }),
1052
- u && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J(w, {
1053
- ref: M,
1054
- icon: /* @__PURE__ */ q(e.sort, { size: 13 }),
1055
- onClick: () => A((e) => !e),
1056
- active: ie || d.cols.length > 0,
1057
- children: ["Sort", d.cols.length > 0 && /* @__PURE__ */ q(oe, {
1052
+ u && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(d, {
1053
+ ref: ie,
1054
+ icon: /* @__PURE__ */ Y(e.sort, { size: 13 }),
1055
+ onClick: () => ne((e) => !e),
1056
+ active: te || f.cols.length > 0,
1057
+ children: ["Sort", f.cols.length > 0 && /* @__PURE__ */ Y(v, {
1058
1058
  tone: "slate",
1059
1059
  size: "xs",
1060
1060
  style: { marginLeft: 4 },
1061
- children: d.cols.length
1061
+ children: f.cols.length
1062
1062
  })]
1063
- }), /* @__PURE__ */ J(x, {
1064
- open: ie,
1065
- anchor: M.current,
1066
- onClose: () => A(!1),
1063
+ }), /* @__PURE__ */ X(h, {
1064
+ open: te,
1065
+ anchor: ie.current,
1066
+ onClose: () => ne(!1),
1067
1067
  align: "start",
1068
1068
  width: 280,
1069
1069
  children: [
1070
- /* @__PURE__ */ q("div", {
1070
+ /* @__PURE__ */ Y("div", {
1071
1071
  style: {
1072
1072
  padding: "6px 8px 4px",
1073
1073
  fontSize: 10,
@@ -1078,131 +1078,130 @@ function fn({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
1078
1078
  },
1079
1079
  children: "Sort by"
1080
1080
  }),
1081
- ue.map((t) => {
1082
- let n = d.cols.find((e) => e.field === t);
1083
- return /* @__PURE__ */ q(C, {
1084
- icon: n ? n.dir === "desc" ? /* @__PURE__ */ q(e.arrowDown, { size: 12 }) : /* @__PURE__ */ q(e.arrowUp, { size: 12 }) : /* @__PURE__ */ q("span", { style: {
1081
+ se.map((t) => {
1082
+ let n = f.cols.find((e) => e.field === t);
1083
+ return /* @__PURE__ */ Y(I, {
1084
+ icon: n ? n.dir === "desc" ? /* @__PURE__ */ Y(e.arrowDown, { size: 12 }) : /* @__PURE__ */ Y(e.arrowUp, { size: 12 }) : /* @__PURE__ */ Y("span", { style: {
1085
1085
  width: 12,
1086
1086
  display: "inline-block"
1087
1087
  } }),
1088
1088
  active: !!n,
1089
1089
  onClick: () => {
1090
- d.applyColumn(t, n?.dir === "asc" ? "desc" : "asc", void 0), A(!1);
1090
+ f.applyColumn(t, n?.dir === "asc" ? "desc" : "asc", void 0), ne(!1);
1091
1091
  },
1092
- children: P(t)
1092
+ children: F(t)
1093
1093
  }, t);
1094
1094
  }),
1095
- d.cols.length > 0 && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(C, { divider: !0 }), /* @__PURE__ */ q(C, {
1096
- icon: /* @__PURE__ */ q(e.x, { size: 12 }),
1095
+ f.cols.length > 0 && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(I, { divider: !0 }), /* @__PURE__ */ Y(I, {
1096
+ icon: /* @__PURE__ */ Y(e.x, { size: 12 }),
1097
1097
  onClick: () => {
1098
- d.clearAll(), A(!1);
1098
+ f.clearAll(), ne(!1);
1099
1099
  },
1100
1100
  children: "Clear sort"
1101
1101
  })] })
1102
1102
  ]
1103
1103
  })] }),
1104
- !u && /* @__PURE__ */ q(lt, {
1104
+ !u && /* @__PURE__ */ Y(rt, {
1105
1105
  availableColumns: t.columns ?? [],
1106
- visibleColumns: f.visible,
1106
+ visibleColumns: p.visible,
1107
1107
  onToggle: (e) => {
1108
- let t = f.visible.includes(e) ? f.visible.filter((t) => t !== e) : [...f.visible, e];
1109
- f.apply(t);
1108
+ let t = p.visible.includes(e) ? p.visible.filter((t) => t !== e) : [...p.visible, e];
1109
+ p.apply(t);
1110
1110
  },
1111
- onMove: f.move,
1112
- onReset: f.clear,
1113
- onShowAll: () => f.apply(t.columns ?? []),
1114
- onResetWidths: f.resetWidths,
1115
- columnLabel: P
1111
+ onMove: p.move,
1112
+ onReset: p.clear,
1113
+ onShowAll: () => p.apply(t.columns ?? []),
1114
+ onResetWidths: p.resetWidths,
1115
+ columnLabel: F
1116
1116
  }),
1117
- !l && /* @__PURE__ */ q("span", { style: {
1117
+ !l && /* @__PURE__ */ Y("span", { style: {
1118
1118
  width: 1,
1119
1119
  height: 20,
1120
1120
  background: "var(--divider)"
1121
1121
  } }),
1122
- !l && /* @__PURE__ */ q(S, {
1123
- icon: /* @__PURE__ */ q(e.grid, { size: 14 }),
1122
+ !l && /* @__PURE__ */ Y(o, {
1123
+ icon: /* @__PURE__ */ Y(e.grid, { size: 14 }),
1124
1124
  title: "Density",
1125
- active: ce !== "compact",
1126
- onClick: le
1125
+ active: P !== "compact",
1126
+ onClick: ae
1127
1127
  }),
1128
- /* @__PURE__ */ q(he, {
1128
+ /* @__PURE__ */ Y(xe, {
1129
1129
  liveObject: {
1130
- refetch: m.retry,
1131
- isFetching: m.isFetching,
1132
- isLoading: m.isLoading,
1130
+ refetch: g.retry,
1131
+ isLoading: g.isLoading,
1133
1132
  isLive: k
1134
1133
  },
1135
1134
  realtime: k
1136
1135
  }),
1137
- !l && /* @__PURE__ */ q("div", { style: { flex: 1 } }),
1138
- !l && ee && /* @__PURE__ */ q(w, {
1136
+ !l && /* @__PURE__ */ Y("div", { style: { flex: 1 } }),
1137
+ !l && D && /* @__PURE__ */ Y(d, {
1139
1138
  kind: "ghost",
1140
1139
  size: "sm",
1141
- icon: q(D ? e.eyeOff : e.eye, { size: 12 }),
1140
+ icon: Y(E ? e.eyeOff : e.eye, { size: 12 }),
1142
1141
  onClick: O,
1143
- active: D,
1144
- children: D ? "Hide deleted" : "Show deleted"
1142
+ active: E,
1143
+ children: E ? "Hide deleted" : "Show deleted"
1145
1144
  }),
1146
- l && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(S, {
1147
- ref: se,
1148
- icon: /* @__PURE__ */ q(e.more, { size: 14 }),
1145
+ l && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(o, {
1146
+ ref: N,
1147
+ icon: /* @__PURE__ */ Y(e.more, { size: 14 }),
1149
1148
  title: "More",
1150
- active: ae,
1151
- onClick: () => j((e) => !e)
1152
- }), /* @__PURE__ */ J(x, {
1153
- open: ae,
1154
- anchor: se.current,
1155
- onClose: () => j(!1),
1149
+ active: re,
1150
+ onClick: () => M((e) => !e)
1151
+ }), /* @__PURE__ */ X(h, {
1152
+ open: re,
1153
+ anchor: N.current,
1154
+ onClose: () => M(!1),
1156
1155
  align: "end",
1157
1156
  width: 220,
1158
- children: [/* @__PURE__ */ q(C, {
1159
- icon: /* @__PURE__ */ q(e.grid, { size: 13 }),
1157
+ children: [/* @__PURE__ */ Y(I, {
1158
+ icon: /* @__PURE__ */ Y(e.grid, { size: 13 }),
1160
1159
  onClick: () => {
1161
- le(), j(!1);
1160
+ ae(), M(!1);
1162
1161
  },
1163
1162
  children: "Density"
1164
- }), ee && /* @__PURE__ */ q(C, {
1165
- icon: q(D ? e.eyeOff : e.eye, { size: 13 }),
1163
+ }), D && /* @__PURE__ */ Y(I, {
1164
+ icon: Y(E ? e.eyeOff : e.eye, { size: 13 }),
1166
1165
  onClick: () => {
1167
- O(), j(!1);
1166
+ O(), M(!1);
1168
1167
  },
1169
- children: D ? "Hide deleted" : "Show deleted"
1168
+ children: E ? "Hide deleted" : "Show deleted"
1170
1169
  })]
1171
1170
  })] }),
1172
- r && n && /* @__PURE__ */ q(ht, {
1171
+ r && n && /* @__PURE__ */ Y(ft, {
1173
1172
  entityCode: r,
1174
1173
  scope: "list",
1175
- selectedIds: h.ids,
1174
+ selectedIds: y.ids,
1176
1175
  viewState: {
1177
1176
  screenCode: a,
1178
- jsonFilters: _.json,
1179
- search: _.debouncedSearch,
1180
- sort: d.forRequest,
1181
- includeDeleted: D || void 0,
1182
- page: T,
1183
- perPage: E
1177
+ jsonFilters: b.json,
1178
+ search: b.debouncedSearch,
1179
+ sort: f.forRequest,
1180
+ includeDeleted: E || void 0,
1181
+ page: w,
1182
+ perPage: T
1184
1183
  },
1185
1184
  locale: c,
1186
1185
  capability: n.documents,
1187
- canManageTemplates: R(i)
1186
+ canManageTemplates: B(i)
1188
1187
  }),
1189
- r && n && /* @__PURE__ */ q(ln, {
1188
+ r && n && /* @__PURE__ */ Y(on, {
1190
1189
  entityCode: r,
1191
1190
  entity: n,
1192
1191
  screen: t,
1193
1192
  viewState: {
1194
1193
  screenCode: a,
1195
- jsonFilters: _.json,
1196
- search: _.debouncedSearch,
1197
- sort: d.forRequest,
1198
- includeDeleted: D || void 0,
1199
- page: T,
1200
- perPage: E
1194
+ jsonFilters: b.json,
1195
+ search: b.debouncedSearch,
1196
+ sort: f.forRequest,
1197
+ includeDeleted: E || void 0,
1198
+ page: w,
1199
+ perPage: T
1201
1200
  },
1202
- visibleColumns: f.visible,
1203
- selectedRowPKs: h.pkValues,
1204
- totalRows: m.countTotal,
1205
- pageSize: E,
1201
+ visibleColumns: p.visible,
1202
+ selectedRowPKs: y.pkValues,
1203
+ totalRows: g.countTotal,
1204
+ pageSize: T,
1206
1205
  locale: c
1207
1206
  })
1208
1207
  ]
@@ -1210,53 +1209,53 @@ function fn({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
1210
1209
  }
1211
1210
  //#endregion
1212
1211
  //#region src/components/pages/list/useListViews.ts
1213
- function pn(e) {
1212
+ function un(e) {
1214
1213
  let t = new URLSearchParams(), n = e.get("search");
1215
1214
  n && t.set("search", n);
1216
- for (let n of k) {
1215
+ for (let n of x) {
1217
1216
  let r = e.get(n);
1218
1217
  r !== null && t.set(n, r);
1219
1218
  }
1220
1219
  return t;
1221
1220
  }
1222
- function mn(e, t) {
1221
+ function dn(e, t) {
1223
1222
  let n = F(t.id);
1224
1223
  n && e.setQueriesData({ queryKey: ["entity-data", "view"] }, (e) => !e || e.data.some((e) => F(e.id) === n) ? e : {
1225
1224
  ...e,
1226
1225
  data: [t, ...e.data]
1227
1226
  });
1228
1227
  }
1229
- function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, userId: i, tenantId: a, filterError: o, filters: s, visibleColumns: c, sort: l }) {
1230
- let u = St(), d = at(e, i), f = n.get("view"), p = U(() => d.find((e) => e.id === f), [d, f]), m = we("view"), h = Se("view"), g = `dcl:smartlist:default-view-cleared:${e}`, _ = W(!1);
1231
- H(() => {
1232
- if (_.current) return;
1228
+ function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, userId: i, tenantId: a, filterError: o, filters: s, visibleColumns: c, sort: l }) {
1229
+ let u = yt(), d = $e(e, i), f = n.get("view"), p = G(() => d.find((e) => e.id === f), [d, f]), m = je("view"), h = Ae("view"), _ = `dcl:smartlist:default-view-cleared:${e}`, v = K(!1);
1230
+ W(() => {
1231
+ if (v.current) return;
1233
1232
  if (o) {
1234
- _.current = !0;
1233
+ v.current = !0;
1235
1234
  return;
1236
1235
  }
1237
1236
  if (!d || d.length === 0) return;
1238
1237
  if (n.get("view")) {
1239
- _.current = !0;
1238
+ v.current = !0;
1240
1239
  return;
1241
1240
  }
1242
- if (typeof window < "u" && window.sessionStorage?.getItem(g)) {
1243
- _.current = !0;
1241
+ if (typeof window < "u" && window.sessionStorage?.getItem(_)) {
1242
+ v.current = !0;
1244
1243
  return;
1245
1244
  }
1246
1245
  let e = d.find((e) => e.source === "personal" && e.is_default) ?? (t?.default_view ? d.find((e) => e.source === "system" && e.id === t.default_view) : void 0);
1247
1246
  if (!e || !e.id) return;
1248
- _.current = !0;
1249
- let i = pn(n);
1247
+ v.current = !0;
1248
+ let i = un(n);
1250
1249
  i.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && i.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && i.set("columns", e.columns.join(",")), e.sort && i.set("sort", e.sort), r(i, { replace: !0 });
1251
1250
  }, [
1252
1251
  d,
1253
1252
  o,
1254
1253
  n,
1255
1254
  r,
1256
- g,
1255
+ _,
1257
1256
  t?.default_view
1258
1257
  ]);
1259
- let v = U(() => {
1258
+ let y = G(() => {
1260
1259
  if (!f || !p) return !1;
1261
1260
  let e = p.filters ?? [], n = p.columns?.length ? p.columns : t?.default_columns ?? t?.columns ?? [], r = p.sort ?? t?.sort_default ?? "";
1262
1261
  return JSON.stringify(s) !== JSON.stringify(e) || c.join(",") !== n.join(",") || (l ?? "") !== r;
@@ -1269,22 +1268,22 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
1269
1268
  t?.default_columns,
1270
1269
  t?.columns,
1271
1270
  t?.sort_default
1272
- ]), y = V((e) => {
1273
- let i = new URLSearchParams(n), a = pn(n);
1274
- e.id ? (a.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && a.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && a.set("columns", e.columns.join(",")), e.sort && a.set("sort", e.sort), a.set("page", "1")) : typeof window < "u" && window.sessionStorage?.setItem(g, "1"), r(a);
1271
+ ]), b = U((e) => {
1272
+ let i = new URLSearchParams(n), a = un(n);
1273
+ e.id ? (a.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && a.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && a.set("columns", e.columns.join(",")), e.sort && a.set("sort", e.sort), a.set("page", "1")) : typeof window < "u" && window.sessionStorage?.setItem(_, "1"), r(a);
1275
1274
  let o = i.get("view"), s = o ? d.find((e) => e.id === o) : void 0, c = (s?.columns?.length ? s.columns : t?.default_columns ?? t?.columns ?? []).join(",");
1276
- (i.get("columns") ?? c) !== c && A.info("View applied", "Your unsaved column changes were replaced.", { action: {
1275
+ (i.get("columns") ?? c) !== c && g.info("View applied", "Your unsaved column changes were replaced.", { action: {
1277
1276
  label: "Undo",
1278
1277
  onClick: () => r(i)
1279
1278
  } });
1280
1279
  }, [
1281
1280
  n,
1282
1281
  r,
1283
- g,
1282
+ _,
1284
1283
  d,
1285
1284
  t?.default_columns,
1286
1285
  t?.columns
1287
- ]), b = V(async () => {
1286
+ ]), x = U(async () => {
1288
1287
  !p?.id || p.source !== "personal" || (await h.mutateAsync({
1289
1288
  pkValues: p.id,
1290
1289
  data: {
@@ -1305,9 +1304,9 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
1305
1304
  all: d,
1306
1305
  activeId: f,
1307
1306
  active: p,
1308
- isDirty: v,
1309
- apply: y,
1310
- saveAsNew: V(async (t) => {
1307
+ isDirty: y,
1308
+ apply: b,
1309
+ saveAsNew: U(async (t) => {
1311
1310
  if (!i || !a) return;
1312
1311
  let o = await m.mutateAsync({
1313
1312
  tenant_id: a,
@@ -1321,7 +1320,7 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
1321
1320
  is_default: !1
1322
1321
  }), d = F(o.data.id);
1323
1322
  if (!d) return;
1324
- mn(u, o.data), await u.invalidateQueries({ queryKey: ["entity-data", "view"] });
1323
+ dn(u, o.data), await u.invalidateQueries({ queryKey: ["entity-data", "view"] });
1325
1324
  let f = new URLSearchParams(n);
1326
1325
  f.set("view", d), r(f);
1327
1326
  }, [
@@ -1336,20 +1335,20 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
1336
1335
  n,
1337
1336
  r
1338
1337
  ]),
1339
- overwriteActive: b,
1338
+ overwriteActive: x,
1340
1339
  isSaving: m.isPending || h.isPending
1341
1340
  };
1342
1341
  }
1343
- function gn(e) {
1344
- return e && e.source === "personal" ? s(e.name) : null;
1342
+ function pn(e) {
1343
+ return e && e.source === "personal" ? j(e.name) : null;
1345
1344
  }
1346
1345
  //#endregion
1347
1346
  //#region src/components/pages/list/use-filter-value-labels.ts
1348
- var _n = 200;
1349
- function vn(e, t, n, r) {
1350
- let i = new Map(e.map((e) => [e.code, e])), a = Y(i, t, n, r), c = xt({ queries: a.map((e) => {
1347
+ var Z = 200;
1348
+ function mn(e, t, n, r) {
1349
+ let i = new Map(e.map((e) => [e.code, e])), a = hn(i, t, n, r), o = vt({ queries: a.map((e) => {
1351
1350
  let t = {
1352
- per_page: _n,
1351
+ per_page: Z,
1353
1352
  filters: [{
1354
1353
  field: e.lookupField,
1355
1354
  op: "in",
@@ -1363,24 +1362,24 @@ function vn(e, t, n, r) {
1363
1362
  e.entity,
1364
1363
  t
1365
1364
  ],
1366
- queryFn: ({ signal: n }) => o(e.entity, t, { signal: n }),
1365
+ queryFn: ({ signal: n }) => y(e.entity, t, { signal: n }),
1367
1366
  staleTime: 6e4
1368
1367
  };
1369
- }) }), l = {};
1370
- if (n) for (let [e, t] of Object.entries(n)) l[e] = { ...t };
1371
- let u = /* @__PURE__ */ new Set();
1372
- return c.forEach((e, t) => {
1368
+ }) }), s = {};
1369
+ if (n) for (let [e, t] of Object.entries(n)) s[e] = { ...t };
1370
+ let c = /* @__PURE__ */ new Set();
1371
+ return o.forEach((e, t) => {
1373
1372
  let n = a[t];
1374
1373
  if (!n) return;
1375
1374
  let r = e.data?.data;
1376
1375
  if (r) {
1377
- let e = l[n.entity] ??= {};
1376
+ let e = s[n.entity] ??= {};
1378
1377
  for (let t of r) {
1379
1378
  let r = F(t[n.lookupField]);
1380
1379
  r && (e[r] = t);
1381
1380
  }
1382
1381
  }
1383
- if (e.isLoading) for (let e of n.values) l[n.entity]?.[e] || u.add(`${n.entity}::${e}`);
1382
+ if (e.isLoading) for (let e of n.values) s[n.entity]?.[e] || c.add(`${n.entity}::${e}`);
1384
1383
  }), {
1385
1384
  labelFor: (e, t) => {
1386
1385
  let n = F(t), a = i.get(e);
@@ -1391,7 +1390,7 @@ function vn(e, t, n, r) {
1391
1390
  let o = a.specialValues?.find((e) => e.code === n);
1392
1391
  if (o) return {
1393
1392
  status: "special",
1394
- label: s(o.label) || n,
1393
+ label: j(o.label) || n,
1395
1394
  raw: n
1396
1395
  };
1397
1396
  if (a.options) {
@@ -1403,16 +1402,16 @@ function vn(e, t, n, r) {
1403
1402
  };
1404
1403
  }
1405
1404
  if (a.type === "ref" && a.ref?.entity) {
1406
- let e = a.ref.entity, t = l[e]?.[n];
1405
+ let e = a.ref.entity, t = s[e]?.[n];
1407
1406
  if (t) {
1408
1407
  let i = a.ref.display?.field ?? r?.[e]?.display?.display_field;
1409
1408
  return {
1410
1409
  status: "resolved",
1411
- label: f(t, i, n),
1410
+ label: P(t, i, n),
1412
1411
  raw: n
1413
1412
  };
1414
1413
  }
1415
- return u.has(`${e}::${n}`) ? {
1414
+ return c.has(`${e}::${n}`) ? {
1416
1415
  status: "loading",
1417
1416
  raw: n
1418
1417
  } : {
@@ -1425,24 +1424,24 @@ function vn(e, t, n, r) {
1425
1424
  raw: n
1426
1425
  };
1427
1426
  },
1428
- refs: l
1427
+ refs: s
1429
1428
  };
1430
1429
  }
1431
- function Y(e, t, n, r) {
1430
+ function hn(e, t, n, r) {
1432
1431
  let i = /* @__PURE__ */ new Map();
1433
- for (let a of Qe(t)) {
1432
+ for (let a of at(t)) {
1434
1433
  if (!a.field) continue;
1435
1434
  let t = e.get(a.field);
1436
1435
  if (!t || t.type !== "ref" || !t.ref?.entity) continue;
1437
- let o = t.ref.entity, s = r?.[o], l = t.ref.field || (s ? c(s)[0] : "id") || "id", u = Array.isArray(a.value) ? a.value : [a.value];
1438
- for (let e of u) {
1436
+ let o = t.ref.entity, s = r?.[o], c = t.ref.field || (s ? D(s)[0] : "id") || "id", l = Array.isArray(a.value) ? a.value : [a.value];
1437
+ for (let e of l) {
1439
1438
  let r = F(e);
1440
1439
  if (!r || t.specialValues?.some((e) => e.code === r) || n?.[o]?.[r]) continue;
1441
- let a = `${o}::${l}`, s = i.get(a);
1440
+ let a = `${o}::${c}`, s = i.get(a);
1442
1441
  s || (s = {
1443
1442
  key: a,
1444
1443
  entity: o,
1445
- lookupField: l,
1444
+ lookupField: c,
1446
1445
  values: []
1447
1446
  }, i.set(a, s)), s.values.includes(r) || s.values.push(r);
1448
1447
  }
@@ -1453,13 +1452,13 @@ function Y(e, t, n, r) {
1453
1452
  }
1454
1453
  //#endregion
1455
1454
  //#region src/components/pages/list/SaveViewDialog.tsx
1456
- function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i, onOverwrite: a }) {
1457
- let [o, s] = G(""), c = !!(i && a);
1458
- if (H(() => {
1455
+ function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i, onOverwrite: a }) {
1456
+ let [o, s] = q(""), c = !!(i && a);
1457
+ if (W(() => {
1459
1458
  e && s("");
1460
1459
  }, [e]), !e) return null;
1461
1460
  let l = o.trim();
1462
- return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("div", {
1461
+ return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
1463
1462
  onClick: n,
1464
1463
  style: {
1465
1464
  position: "fixed",
@@ -1467,7 +1466,7 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
1467
1466
  background: "var(--scrim)",
1468
1467
  zIndex: 70
1469
1468
  }
1470
- }), /* @__PURE__ */ J("div", {
1469
+ }), /* @__PURE__ */ X("div", {
1471
1470
  role: "dialog",
1472
1471
  "aria-label": "Save view",
1473
1472
  "aria-modal": "true",
@@ -1489,14 +1488,14 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
1489
1488
  gap: 12
1490
1489
  },
1491
1490
  children: [
1492
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("h3", {
1491
+ /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h3", {
1493
1492
  style: {
1494
1493
  margin: 0,
1495
1494
  fontSize: 14,
1496
1495
  color: "var(--text)"
1497
1496
  },
1498
1497
  children: "Save view"
1499
- }), /* @__PURE__ */ q("p", {
1498
+ }), /* @__PURE__ */ Y("p", {
1500
1499
  style: {
1501
1500
  margin: "4px 0 0",
1502
1501
  fontSize: 12,
@@ -1504,20 +1503,20 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
1504
1503
  },
1505
1504
  children: "Views save columns, order, filters, and sort. Widths stay personal to this device and are never part of a view."
1506
1505
  })] }),
1507
- /* @__PURE__ */ J("label", {
1506
+ /* @__PURE__ */ X("label", {
1508
1507
  style: {
1509
1508
  display: "flex",
1510
1509
  flexDirection: "column",
1511
1510
  gap: 4
1512
1511
  },
1513
- children: [/* @__PURE__ */ q("span", {
1512
+ children: [/* @__PURE__ */ Y("span", {
1514
1513
  style: {
1515
1514
  fontSize: 11.5,
1516
1515
  color: "var(--text-3)",
1517
1516
  fontWeight: 500
1518
1517
  },
1519
1518
  children: "Name"
1520
- }), /* @__PURE__ */ q(g, {
1519
+ }), /* @__PURE__ */ Y(he, {
1521
1520
  autoFocus: !0,
1522
1521
  "aria-label": "View name",
1523
1522
  value: o,
@@ -1528,19 +1527,19 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
1528
1527
  }
1529
1528
  })]
1530
1529
  }),
1531
- /* @__PURE__ */ J("div", {
1530
+ /* @__PURE__ */ X("div", {
1532
1531
  style: {
1533
1532
  display: "flex",
1534
1533
  justifyContent: "flex-end",
1535
1534
  gap: 8
1536
1535
  },
1537
1536
  children: [
1538
- /* @__PURE__ */ q(w, {
1537
+ /* @__PURE__ */ Y(d, {
1539
1538
  onClick: n,
1540
1539
  disabled: t,
1541
1540
  children: "Cancel"
1542
1541
  }),
1543
- c && /* @__PURE__ */ J(w, {
1542
+ c && /* @__PURE__ */ X(d, {
1544
1543
  onClick: () => void a(),
1545
1544
  disabled: t,
1546
1545
  children: [
@@ -1549,7 +1548,7 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
1549
1548
  "”"
1550
1549
  ]
1551
1550
  }),
1552
- /* @__PURE__ */ q(w, {
1551
+ /* @__PURE__ */ Y(d, {
1553
1552
  kind: "primary",
1554
1553
  onClick: () => void r(l),
1555
1554
  disabled: !l || t,
@@ -1562,73 +1561,73 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
1562
1561
  }
1563
1562
  //#endregion
1564
1563
  //#region src/components/pages/list/ListHeader.tsx
1565
- function bn({ title: t, description: n, toolbarActions: r, screenActionLayout: i, entityActionLayout: a, selectedIds: o, data: c, rowKey: l, onActionSuccess: u, widgetContext: d }) {
1566
- let { run: f } = D(), { isPhone: p } = ie(), m = me("list"), h = m.isVisible("show_title"), g = m.isVisible("show_actions"), v = xe(), y = U(() => {
1564
+ function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a, entityActionLayout: l, selectedIds: u, data: d, rowKey: f, onActionSuccess: p, widgetContext: m }) {
1565
+ let { run: h } = N(), { isPhone: g } = r(), _ = be("list"), v = _.isVisible("show_title"), y = _.isVisible("show_actions"), x = Oe(), C = G(() => {
1567
1566
  let e = {};
1568
- for (let { code: t, action: n } of r) e[t] = n;
1567
+ for (let { code: t, action: n } of i) e[t] = n;
1569
1568
  return e;
1570
- }, [r]), x = U(() => N((i ?? a) || M(y, "list_toolbar"), y, void 0, "list_toolbar"), [
1571
- i,
1569
+ }, [i]), T = G(() => de((a ?? l) || w(C, "list_toolbar"), C, void 0, "list_toolbar"), [
1572
1570
  a,
1573
- y
1574
- ]), C = U(() => ue(x, y, void 0, E, "Select one or more rows first"), [x, y]), w = U(() => {
1575
- if (o.length === 0) return [];
1571
+ l,
1572
+ C
1573
+ ]), E = G(() => s(T, C, void 0, S, "Select one or more rows first"), [T, C]), D = G(() => {
1574
+ if (u.length === 0) return [];
1576
1575
  let e = /* @__PURE__ */ new Map();
1577
- for (let t of c) e.set(l(t), t);
1578
- return o.map((t) => e.get(t)).filter((e) => e !== void 0);
1576
+ for (let t of d) e.set(f(t), t);
1577
+ return u.map((t) => e.get(t)).filter((e) => e !== void 0);
1579
1578
  }, [
1580
- o,
1581
- c,
1582
- l
1583
- ]), ee = U(() => _(x, y, void 0, {}, w), [
1584
- x,
1585
- y,
1586
- w
1587
- ]), te = o.length > 0 ? ee : C, O = (e, t) => {
1588
- let n = ze(e, t, {});
1579
+ u,
1580
+ d,
1581
+ f
1582
+ ]), O = G(() => b(T, C, void 0, {}, D), [
1583
+ T,
1584
+ C,
1585
+ D
1586
+ ]), k = u.length > 0 ? O : E, ee = (e, t) => {
1587
+ let n = Ue(e, t, {});
1589
1588
  if (n === null) return;
1590
- let r = s(t.display?.name) || e;
1591
- return f({
1589
+ let r = j(t.display?.name) || e;
1590
+ return h({
1592
1591
  action: t,
1593
1592
  title: r,
1594
- bulkSelection: w.length > 0 ? w : void 0,
1593
+ bulkSelection: D.length > 0 ? D : void 0,
1595
1594
  execute: async (e) => {
1596
- let t = o.length > 0 ? o : void 0, r = await b(n, T(e, t));
1597
- return t && t.length > 0 && u(), r;
1595
+ let t = u.length > 0 ? u : void 0, r = await A(n, c(e, t));
1596
+ return t && t.length > 0 && p(), r;
1598
1597
  }
1599
1598
  });
1600
1599
  };
1601
- return !h && !g ? null : /* @__PURE__ */ J("div", {
1600
+ return !v && !y ? null : /* @__PURE__ */ X("div", {
1602
1601
  style: {
1603
1602
  display: "flex",
1604
1603
  alignItems: "center",
1605
1604
  gap: 8,
1606
- flexWrap: p ? "wrap" : "nowrap",
1607
- paddingTop: p ? 12 : 16,
1605
+ flexWrap: g ? "wrap" : "nowrap",
1606
+ paddingTop: g ? 12 : 16,
1608
1607
  paddingBottom: 10,
1609
- ...p ? be(12) : {
1608
+ ...g ? De(12) : {
1610
1609
  paddingLeft: 20,
1611
1610
  paddingRight: 20
1612
1611
  }
1613
1612
  },
1614
1613
  children: [
1615
- h && v.hasOriginBack && /* @__PURE__ */ q(S, {
1616
- icon: /* @__PURE__ */ q(e.back, { size: 14 }),
1614
+ v && x.hasOriginBack && /* @__PURE__ */ Y(o, {
1615
+ icon: /* @__PURE__ */ Y(e.back, { size: 14 }),
1617
1616
  title: "Back",
1618
- onClick: v.goBack
1617
+ onClick: x.goBack
1619
1618
  }),
1620
- h && /* @__PURE__ */ q("div", {
1619
+ v && /* @__PURE__ */ Y("div", {
1621
1620
  style: {
1622
- flex: p ? "1 1 100%" : "1 1 auto",
1621
+ flex: g ? "1 1 100%" : "1 1 auto",
1623
1622
  minWidth: 0
1624
1623
  },
1625
- children: /* @__PURE__ */ J("div", {
1624
+ children: /* @__PURE__ */ X("div", {
1626
1625
  style: {
1627
1626
  display: "flex",
1628
1627
  alignItems: "baseline",
1629
1628
  gap: 10
1630
1629
  },
1631
- children: [/* @__PURE__ */ q("h1", {
1630
+ children: [/* @__PURE__ */ Y("h1", {
1632
1631
  style: {
1633
1632
  margin: 0,
1634
1633
  minWidth: 0,
@@ -1642,18 +1641,18 @@ function bn({ title: t, description: n, toolbarActions: r, screenActionLayout: i
1642
1641
  color: "var(--text)"
1643
1642
  },
1644
1643
  children: t
1645
- }), n && /* @__PURE__ */ q(pe, {
1644
+ }), n && /* @__PURE__ */ Y(ye, {
1646
1645
  label: n,
1647
1646
  "data-testid": "list-description-info"
1648
1647
  })]
1649
1648
  })
1650
1649
  }),
1651
- g && te.length > 0 && /* @__PURE__ */ q(Ae, {
1652
- layout: te,
1650
+ y && k.length > 0 && /* @__PURE__ */ Y(Pe, {
1651
+ layout: k,
1653
1652
  kind: "toolbar",
1654
- entityActions: y,
1655
- onRun: O,
1656
- widgetContext: d,
1653
+ entityActions: C,
1654
+ onRun: ee,
1655
+ widgetContext: m,
1657
1656
  ariaLabel: "List toolbar actions"
1658
1657
  })
1659
1658
  ]
@@ -1661,12 +1660,12 @@ function bn({ title: t, description: n, toolbarActions: r, screenActionLayout: i
1661
1660
  }
1662
1661
  //#endregion
1663
1662
  //#region src/components/pages/list/ListFloatbar.tsx
1664
- function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: c, entity: l, screen: u, onClear: d, onActionSuccess: f, widgetContext: p }) {
1665
- let { run: m } = D(), h = U(() => {
1663
+ function vn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: s, entity: l, screen: u, onClear: d, onActionSuccess: f, widgetContext: p }) {
1664
+ let { run: m } = N(), h = G(() => {
1666
1665
  let e = {};
1667
1666
  for (let { code: t, action: r } of n) e[t] = r;
1668
1667
  return e;
1669
- }, [n]), g = U(() => {
1668
+ }, [n]), g = G(() => {
1670
1669
  if (t.length === 0) return [];
1671
1670
  let e = /* @__PURE__ */ new Map();
1672
1671
  for (let t of a) e.set(o(t), t);
@@ -1675,26 +1674,26 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
1675
1674
  t,
1676
1675
  a,
1677
1676
  o
1678
- ]), v = U(() => {
1677
+ ]), _ = G(() => {
1679
1678
  if (!l || !u || g.length === 0) return r;
1680
- let e = g.map((e) => ke(l, u, e));
1681
- return e.some((t) => t !== e[0]) ? r : Re(l, u, g[0])?.action_layout;
1679
+ let e = g.map((e) => Ne(l, u, e));
1680
+ return e.some((t) => t !== e[0]) ? r : He(l, u, g[0])?.action_layout;
1682
1681
  }, [
1683
1682
  l,
1684
1683
  u,
1685
1684
  g,
1686
1685
  r
1687
- ]), y = U(() => N((v ?? i) || M(h, "list_floatbar"), h, void 0, "list_floatbar"), [
1688
- v,
1686
+ ]), v = G(() => de((_ ?? i) || w(h, "list_floatbar"), h, void 0, "list_floatbar"), [
1687
+ _,
1689
1688
  i,
1690
1689
  h
1691
- ]), x = U(() => _(y, h, void 0, {}, g, Fe(l, g)), [
1692
- y,
1690
+ ]), y = G(() => b(v, h, void 0, {}, g, ze(l, g)), [
1691
+ v,
1693
1692
  h,
1694
1693
  g,
1695
1694
  l
1696
1695
  ]);
1697
- return x.length === 0 ? null : /* @__PURE__ */ J("div", {
1696
+ return y.length === 0 ? null : /* @__PURE__ */ X("div", {
1698
1697
  style: {
1699
1698
  position: "fixed",
1700
1699
  left: "50%",
@@ -1715,13 +1714,13 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
1715
1714
  animation: "floatbarIn .15s ease-out"
1716
1715
  },
1717
1716
  children: [
1718
- /* @__PURE__ */ q("style", { children: "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}" }),
1719
- /* @__PURE__ */ J("span", {
1717
+ /* @__PURE__ */ Y("style", { children: "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}" }),
1718
+ /* @__PURE__ */ X("span", {
1720
1719
  style: {
1721
1720
  fontSize: 12.5,
1722
1721
  fontWeight: 600
1723
1722
  },
1724
- children: [/* @__PURE__ */ q("span", {
1723
+ children: [/* @__PURE__ */ Y("span", {
1725
1724
  style: {
1726
1725
  padding: "1px 7px",
1727
1726
  borderRadius: 4,
@@ -1733,20 +1732,20 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
1733
1732
  children: t.length
1734
1733
  }), "selected"]
1735
1734
  }),
1736
- /* @__PURE__ */ q(Ae, {
1737
- layout: x,
1735
+ /* @__PURE__ */ Y(Pe, {
1736
+ layout: y,
1738
1737
  kind: "toolbar",
1739
1738
  entityActions: h,
1740
1739
  rowSelection: g,
1741
1740
  onRun: (e, n) => {
1742
- let r = ze(e, n, {}, c);
1741
+ let r = Ue(e, n, {}, s);
1743
1742
  if (r !== null) return m({
1744
1743
  action: n,
1745
- title: s(n.display?.name) || e,
1744
+ title: j(n.display?.name) || e,
1746
1745
  bulkSelection: g,
1747
- entity: c,
1746
+ entity: s,
1748
1747
  execute: async (e) => {
1749
- let n = await b(r, T(e, t));
1748
+ let n = await A(r, c(e, t));
1750
1749
  return f(), n;
1751
1750
  }
1752
1751
  });
@@ -1755,7 +1754,7 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
1755
1754
  ariaLabel: "Floating action bar",
1756
1755
  constrain: !1
1757
1756
  }),
1758
- /* @__PURE__ */ q("button", {
1757
+ /* @__PURE__ */ Y("button", {
1759
1758
  onClick: d,
1760
1759
  style: {
1761
1760
  background: "none",
@@ -1767,20 +1766,20 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
1767
1766
  borderRadius: 6
1768
1767
  },
1769
1768
  title: "Clear selection",
1770
- children: /* @__PURE__ */ q(e.x, { size: 14 })
1769
+ children: /* @__PURE__ */ Y(e.x, { size: 14 })
1771
1770
  })
1772
1771
  ]
1773
1772
  });
1774
1773
  }
1775
1774
  //#endregion
1776
1775
  //#region src/components/pages/list/useRowMenu.ts
1777
- function X(e, t) {
1776
+ function yn(e, t) {
1778
1777
  let n = (e) => e === "__peek" && !t.peek || e === "__open" && !t.open, r = [];
1779
1778
  for (let i of e) if (i.kind === "action") {
1780
1779
  if (n(i.code)) continue;
1781
1780
  r.push(i);
1782
1781
  } else {
1783
- let e = X(i.items, t);
1782
+ let e = yn(i.items, t);
1784
1783
  e.length > 0 && r.push({
1785
1784
  ...i,
1786
1785
  items: e
@@ -1788,99 +1787,99 @@ function X(e, t) {
1788
1787
  }
1789
1788
  return r;
1790
1789
  }
1791
- function Sn(e, t) {
1790
+ function bn(e, t) {
1792
1791
  for (let n of e) if (n.kind === "action") {
1793
1792
  if (n.code === t) return !0;
1794
- } else if (Sn(n.items, t)) return !0;
1793
+ } else if (bn(n.items, t)) return !0;
1795
1794
  return !1;
1796
1795
  }
1797
- function Cn({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode: a, rowActions: o, tabNavigate: c, locale: l, peekAllowed: u, hasDetailTarget: d, onPeek: f }) {
1798
- let { run: p } = D(), m = r.detail_screen === void 0 && n.detail_screen !== void 0 ? {
1799
- ...r,
1800
- detail_screen: n.detail_screen
1801
- } : r, h = Re(i, m, e) ?? m, g = U(() => {
1802
- let e = {}, t = h.row_actions === void 0 ? void 0 : new Set(h.row_actions);
1803
- for (let { code: n, action: r } of o) (!t || t.has(n)) && (e[n] = r);
1796
+ function xn({ row: e, rowId: n, screen: r, fullScreen: i, entity: a, entityCode: o, rowActions: s, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget: f, onPeek: p }) {
1797
+ let { run: m } = N(), h = i.detail_screen === void 0 && r.detail_screen !== void 0 ? {
1798
+ ...i,
1799
+ detail_screen: r.detail_screen
1800
+ } : i, g = He(a, h, e) ?? h, _ = G(() => {
1801
+ let e = {}, t = g.row_actions === void 0 ? void 0 : new Set(g.row_actions);
1802
+ for (let { code: n, action: r } of s) (!t || t.has(n)) && (e[n] = r);
1804
1803
  return e;
1805
- }, [o, h.row_actions]), v = U(() => ({
1806
- entity: i,
1807
- entityCode: a ?? "",
1808
- screen: h,
1809
- screenRoute: h.route,
1804
+ }, [s, g.row_actions]), v = G(() => ({
1805
+ entity: a,
1806
+ entityCode: o ?? "",
1807
+ screen: g,
1808
+ screenRoute: g.route,
1810
1809
  selectedRows: [],
1811
1810
  selectedIds: [],
1812
- locale: l,
1813
- tabNavigate: (e, t) => c(e, {
1811
+ locale: u,
1812
+ tabNavigate: (e, t) => l(e, {
1814
1813
  title: t?.title,
1815
1814
  icon: t?.icon,
1816
1815
  search: t?.search
1817
1816
  }),
1818
- runActionApi: (e, t) => b(e, t),
1819
- openPeek: (t) => f(t ?? e)
1817
+ runActionApi: (e, t) => A(e, t),
1818
+ openPeek: (t) => p(t ?? e)
1820
1819
  }), [
1821
- i,
1822
1820
  a,
1823
- h,
1821
+ o,
1822
+ g,
1823
+ u,
1824
1824
  l,
1825
- c,
1826
- f,
1825
+ p,
1827
1826
  e
1828
- ]), y = U(() => {
1829
- let e = h.action_layout ?? null, t = i.action_layout ?? null, n = e ?? t ?? M(g, "list_row");
1830
- return N(n, g, void 0, "list_row");
1827
+ ]), y = G(() => {
1828
+ let e = g.action_layout ?? null, t = a.action_layout ?? null, n = e ?? t ?? w(_, "list_row");
1829
+ return de(n, _, void 0, "list_row");
1831
1830
  }, [
1832
- h,
1833
- i,
1834
- g
1835
- ]), x = U(() => X(_(y, g, void 0, e, [], Ie(i, e)), {
1836
- peek: u,
1837
- open: d
1831
+ g,
1832
+ a,
1833
+ _
1834
+ ]), x = G(() => yn(b(y, _, void 0, e, [], Be(a, e)), {
1835
+ peek: d,
1836
+ open: f
1838
1837
  }), [
1839
1838
  y,
1840
- g,
1839
+ _,
1841
1840
  e,
1842
- i,
1843
- u,
1844
- d
1841
+ a,
1842
+ d,
1843
+ f
1845
1844
  ]);
1846
1845
  return {
1847
1846
  layout: x,
1848
- entityActions: g,
1849
- runRowAction: V((n, r) => {
1850
- let i = ze(n, r, { row: e });
1851
- if (i !== null) return p({
1847
+ entityActions: _,
1848
+ runRowAction: U((t, r) => {
1849
+ let i = Ue(t, r, { row: e });
1850
+ if (i !== null) return m({
1852
1851
  action: r,
1853
- title: s(r.display?.name) || n,
1852
+ title: j(r.display?.name) || t,
1854
1853
  row: e,
1855
- execute: (e) => b(i, T(e, [t]))
1854
+ execute: (e) => A(i, c(e, [n]))
1856
1855
  });
1857
1856
  }, [
1858
- p,
1859
- t,
1857
+ m,
1858
+ n,
1860
1859
  e
1861
1860
  ]),
1862
1861
  widgetContext: v,
1863
- hasPeek: U(() => Sn(x, O), [x])
1862
+ hasPeek: G(() => bn(x, t), [x])
1864
1863
  };
1865
1864
  }
1866
1865
  //#endregion
1867
1866
  //#region src/components/pages/list/RowActionsCell.tsx
1868
- function wn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode: o, rowActions: s, tabNavigate: c, peekAllowed: l, hasDetailTarget: u, onPeek: d, locale: f }) {
1869
- let { layout: p, entityActions: m, runRowAction: h, widgetContext: g, hasPeek: _ } = Cn({
1867
+ function Sn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode: s, rowActions: c, tabNavigate: l, peekAllowed: u, hasDetailTarget: d, onPeek: f, locale: p }) {
1868
+ let { layout: m, entityActions: h, runRowAction: g, widgetContext: _, hasPeek: v } = xn({
1870
1869
  row: t,
1871
1870
  rowId: n,
1872
1871
  screen: r,
1873
1872
  fullScreen: i,
1874
1873
  entity: a,
1875
- entityCode: o,
1876
- rowActions: s,
1877
- tabNavigate: c,
1878
- locale: f,
1879
- peekAllowed: l,
1880
- hasDetailTarget: u,
1881
- onPeek: d
1874
+ entityCode: s,
1875
+ rowActions: c,
1876
+ tabNavigate: l,
1877
+ locale: p,
1878
+ peekAllowed: u,
1879
+ hasDetailTarget: d,
1880
+ onPeek: f
1882
1881
  });
1883
- return /* @__PURE__ */ J("div", {
1882
+ return /* @__PURE__ */ X("div", {
1884
1883
  className: "sl-row-actions",
1885
1884
  style: {
1886
1885
  display: "flex",
@@ -1888,56 +1887,56 @@ function wn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode:
1888
1887
  gap: 2,
1889
1888
  justifyContent: "flex-end"
1890
1889
  },
1891
- children: [_ && /* @__PURE__ */ q(S, {
1890
+ children: [v && /* @__PURE__ */ Y(o, {
1892
1891
  size: 22,
1893
- icon: /* @__PURE__ */ q(e.eye, { size: 12 }),
1892
+ icon: /* @__PURE__ */ Y(e.eye, { size: 12 }),
1894
1893
  onClick: (e) => {
1895
- e.stopPropagation(), d(t);
1894
+ e.stopPropagation(), f(t);
1896
1895
  },
1897
1896
  title: "Peek"
1898
- }), p.length > 0 && /* @__PURE__ */ q(Ae, {
1899
- layout: p,
1897
+ }), m.length > 0 && /* @__PURE__ */ Y(Pe, {
1898
+ layout: m,
1900
1899
  row: t,
1901
1900
  kind: "row",
1902
- entityActions: m,
1903
- onRun: h,
1904
- widgetContext: g,
1901
+ entityActions: h,
1902
+ onRun: g,
1903
+ widgetContext: _,
1905
1904
  ariaLabel: "Row actions"
1906
1905
  })]
1907
1906
  });
1908
1907
  }
1909
1908
  //#endregion
1910
1909
  //#region src/components/pages/list/columns.ts
1911
- function Z(t, n, r, i) {
1912
- let a = Ee(n, r);
1913
- if (!a || a.read !== "denied") return i ? z("span", { title: i }, t) : t;
1910
+ function Cn(t, n, r, i) {
1911
+ let a = ke(n, r);
1912
+ if (!a || a.read !== "denied") return i ? V("span", { title: i }, t) : t;
1914
1913
  let o = a.required_permission ? `Locked column: requires "${a.required_permission}"` : `Locked column: ${a.classification} classification`;
1915
- return z("span", {
1914
+ return V("span", {
1916
1915
  title: o,
1917
1916
  "aria-label": o,
1918
1917
  className: "inline-flex items-center gap-1"
1919
- }, z(e.lock, { size: 12 }), t);
1918
+ }, V(e.lock, { size: 12 }), t);
1920
1919
  }
1921
- function Tn(e) {
1920
+ function Q(e) {
1922
1921
  return {
1923
1922
  minSize: Math.min(60, e),
1924
- maxSize: Math.max(Oe, e)
1923
+ maxSize: Math.max(Me, e)
1925
1924
  };
1926
1925
  }
1927
- function En(e) {
1928
- let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions: c, hasExplicitRowActions: l, canUpdate: d, canDelete: f, peekEnabled: p, hasDetailTarget: m, userLocale: h, tabNavigate: g, refsRef: _, rowSelectionKey: v, setPeekRow: y } = e;
1926
+ function wn(e) {
1927
+ let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions: s, hasExplicitRowActions: c, canUpdate: l, canDelete: u, peekEnabled: d, hasDetailTarget: f, userLocale: m, tabNavigate: h, refsRef: g, rowSelectionKey: _, setPeekRow: y } = e;
1929
1928
  if (t.length === 0 || !n) return [];
1930
1929
  let b = [];
1931
- c && b.push({
1930
+ s && b.push({
1932
1931
  id: "_select",
1933
1932
  enableResizing: !1,
1934
- header: ({ table: e }) => z(ge, {
1933
+ header: ({ table: e }) => V(Se, {
1935
1934
  checked: e.getIsAllRowsSelected(),
1936
1935
  indeterminate: e.getIsSomeRowsSelected(),
1937
1936
  onChange: () => e.toggleAllRowsSelected()
1938
1937
  }),
1939
1938
  size: 34,
1940
- cell: ({ row: e }) => z("span", { "data-testid": "row-select-checkbox" }, z(ge, {
1939
+ cell: ({ row: e }) => V("span", { "data-testid": "row-select-checkbox" }, V(Se, {
1941
1940
  checked: e.getIsSelected(),
1942
1941
  onChange: () => e.toggleSelected()
1943
1942
  }))
@@ -1949,17 +1948,17 @@ function En(e) {
1949
1948
  let i = new Map(r.statuses.map((e) => [e.code, e]));
1950
1949
  b.push({
1951
1950
  id: e,
1952
- header: s(r.name) || t,
1951
+ header: j(r.name) || t,
1953
1952
  size: 140,
1954
- ...Tn(140),
1953
+ ...Q(140),
1955
1954
  cell: ({ row: e }) => {
1956
1955
  let n = e.original.$statuses?.find((e) => e.group_code === t);
1957
- if (!n) return z("span", { className: "text-sm text-muted-foreground" }, "-");
1956
+ if (!n) return V("span", { className: "text-sm text-muted-foreground" }, "-");
1958
1957
  let r = i.get(n.status_code);
1959
- return z(oe, {
1958
+ return V(v, {
1960
1959
  tone: r?.color ?? "slate",
1961
1960
  size: "xs"
1962
- }, s(r?.name) || n.status_code);
1961
+ }, j(r?.name) || n.status_code);
1963
1962
  }
1964
1963
  });
1965
1964
  continue;
@@ -1969,13 +1968,13 @@ function En(e) {
1969
1968
  if (!r) continue;
1970
1969
  b.push({
1971
1970
  id: e,
1972
- header: () => Z(s(r.name) || t, n, t, s(r.description) || void 0),
1971
+ header: () => Cn(j(r.name) || t, n, t, j(r.description) || void 0),
1973
1972
  size: 150,
1974
- ...Tn(150),
1973
+ ...Q(150),
1975
1974
  enableSorting: !1,
1976
1975
  cell: ({ row: e }) => {
1977
1976
  let n = e.original.$properties?.find((e) => e.property_code === t);
1978
- return !n || n.value == null ? z("span", { className: "text-sm text-muted-foreground" }, "-") : z("span", { className: "text-sm" }, F(n.value));
1977
+ return !n || n.value == null ? V("span", { className: "text-sm text-muted-foreground" }, "-") : V("span", { className: "text-sm" }, F(n.value));
1979
1978
  }
1980
1979
  });
1981
1980
  continue;
@@ -1985,15 +1984,15 @@ function En(e) {
1985
1984
  id: e,
1986
1985
  header: "Evidence",
1987
1986
  size: 140,
1988
- ...Tn(140),
1987
+ ...Q(140),
1989
1988
  enableSorting: !1,
1990
1989
  cell: ({ row: e }) => {
1991
1990
  let t = e.original.$evidence?.verdict ?? "unverified";
1992
- return z(oe, {
1993
- tone: ft(t),
1991
+ return V(v, {
1992
+ tone: lt(t),
1994
1993
  size: "xs",
1995
1994
  dot: !0
1996
- }, mt(t));
1995
+ }, dt(t));
1997
1996
  }
1998
1997
  });
1999
1998
  continue;
@@ -2002,69 +2001,69 @@ function En(e) {
2002
2001
  b.push({
2003
2002
  id: e,
2004
2003
  accessorFn: (t) => t.$files?.[e] ?? null,
2005
- header: () => Z(Pe(n, e, i?.entities), n, e),
2004
+ header: () => Cn(Re(n, e, i?.entities), n, e),
2006
2005
  size: 150,
2007
- ...Tn(150),
2008
- cell: ({ row: t }) => Le({
2006
+ ...Q(150),
2007
+ cell: ({ row: t }) => Ve({
2009
2008
  entity: n,
2010
2009
  entityCode: a,
2011
2010
  fieldName: e,
2012
2011
  record: t.original,
2013
2012
  mode: "display",
2014
2013
  surface: "list",
2015
- refs: _.current,
2016
- locale: h
2014
+ refs: g.current,
2015
+ locale: m
2017
2016
  })
2018
2017
  });
2019
2018
  continue;
2020
2019
  }
2021
2020
  let t = n.fields.get(e);
2022
2021
  if (!t) continue;
2023
- let r = le(t, e, i?.entities), o = t.display?.width, c = u({
2022
+ let r = p(t, e, i?.entities), o = t.display?.width, s = ae({
2024
2023
  field: t,
2025
2024
  fieldName: e,
2026
2025
  surface: "list",
2027
2026
  entity: n,
2028
2027
  entities: i?.entities,
2029
2028
  screens: i?.screens,
2030
- refs: () => _.current,
2031
- locale: h
2029
+ refs: () => g.current,
2030
+ locale: m
2032
2031
  });
2033
2032
  b.push({
2034
2033
  id: e,
2035
2034
  accessorKey: e,
2036
- header: () => Z(r, n, e, s(t.display?.description) || void 0),
2035
+ header: () => Cn(r, n, e, j(t.display?.description) || void 0),
2037
2036
  enableSorting: t.type !== "json",
2038
2037
  size: o ?? 150,
2039
- ...Tn(o ?? 150),
2040
- cell: ({ getValue: e, row: t }) => c(e(), t.original)
2038
+ ...Q(o ?? 150),
2039
+ cell: ({ getValue: e, row: t }) => s(e(), t.original)
2041
2040
  });
2042
2041
  }
2043
- return (!l && d || !l && f || o.length > 0) && b.push({
2042
+ return (!c && l || !c && u || o.length > 0) && b.push({
2044
2043
  id: "_actions",
2045
2044
  enableResizing: !1,
2046
2045
  header: "",
2047
2046
  size: 40,
2048
- cell: ({ row: e }) => z(wn, {
2047
+ cell: ({ row: e }) => V(Sn, {
2049
2048
  row: e.original,
2050
- rowId: v(n, e.original),
2049
+ rowId: _(n, e.original),
2051
2050
  screen: r,
2052
2051
  fullScreen: r,
2053
2052
  entity: n,
2054
2053
  entityCode: a,
2055
2054
  rowActions: o,
2056
- tabNavigate: g,
2057
- peekAllowed: p,
2058
- hasDetailTarget: m,
2055
+ tabNavigate: h,
2056
+ peekAllowed: d,
2057
+ hasDetailTarget: f,
2059
2058
  onPeek: y,
2060
- locale: h
2059
+ locale: m
2061
2060
  })
2062
2061
  }), b;
2063
2062
  }
2064
2063
  //#endregion
2065
2064
  //#region src/components/pages/list/RowContextMenu.tsx
2066
- function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o, entityCode: s, rowActions: c, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget: f, onPeek: p, onClose: m }) {
2067
- let { layout: h, entityActions: g, runRowAction: _, widgetContext: v } = Cn({
2065
+ function Tn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o, entityCode: s, rowActions: c, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget: f, onPeek: p, onClose: m }) {
2066
+ let { layout: g, entityActions: _, runRowAction: v, widgetContext: y } = xn({
2068
2067
  row: n,
2069
2068
  rowId: r,
2070
2069
  screen: i,
@@ -2077,8 +2076,8 @@ function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
2077
2076
  peekAllowed: d,
2078
2077
  hasDetailTarget: f,
2079
2078
  onPeek: p
2080
- }), [y, b] = G(null), S = V((e, t) => (m(), _(e, t)), [m, _]);
2081
- return h.length === 0 ? null : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("div", {
2079
+ }), [b, x] = q(null), S = U((e, t) => (m(), v(e, t)), [m, v]);
2080
+ return g.length === 0 ? null : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
2082
2081
  onClick: m,
2083
2082
  onContextMenu: (e) => {
2084
2083
  e.preventDefault(), m();
@@ -2088,7 +2087,7 @@ function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
2088
2087
  inset: 0,
2089
2088
  zIndex: 190
2090
2089
  }
2091
- }), /* @__PURE__ */ q(x, {
2090
+ }), /* @__PURE__ */ Y(h, {
2092
2091
  open: !0,
2093
2092
  anchor: null,
2094
2093
  anchorPoint: {
@@ -2097,57 +2096,57 @@ function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
2097
2096
  },
2098
2097
  onClose: m,
2099
2098
  width: 220,
2100
- children: /* @__PURE__ */ q("div", {
2099
+ children: /* @__PURE__ */ Y("div", {
2101
2100
  onClick: m,
2102
- children: /* @__PURE__ */ q(Ne, {
2103
- layout: h,
2104
- entityActions: g,
2101
+ children: /* @__PURE__ */ Y(Le, {
2102
+ layout: g,
2103
+ entityActions: _,
2105
2104
  onRun: S,
2106
- loading: y,
2107
- onLoadingChange: b,
2105
+ loading: b,
2106
+ onLoadingChange: x,
2108
2107
  row: n,
2109
- widgetContext: v
2108
+ widgetContext: y
2110
2109
  })
2111
2110
  })
2112
2111
  })] });
2113
2112
  }
2114
2113
  //#endregion
2115
2114
  //#region src/components/pages/list/useHeaderReorder.ts
2116
- var On = 5, Q = 48, $ = 18;
2117
- function kn({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
2118
- let [i, a] = G(null), [o, s] = G(null), [c, l] = G(!1), u = W(null), d = W(!1), f = W(!1), p = W([]), m = W(null), h = W(0), g = W(null), _ = W(0), v = V(() => {
2115
+ var En = 5, $ = 48, Dn = 18;
2116
+ function On({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
2117
+ let [i, a] = q(null), [o, s] = q(null), [c, l] = q(!1), u = K(null), d = K(!1), f = K(!1), p = K([]), m = K(null), h = K(0), g = K(null), _ = K(0), v = U(() => {
2119
2118
  g.current !== null && (cancelAnimationFrame(g.current), g.current = null);
2120
- }, []), y = V(() => {
2119
+ }, []), y = U(() => {
2121
2120
  u.current = null, d.current = !1, p.current = [], m.current = null, v(), a(null), s(null), l(!1);
2122
- }, [v]), b = V((e) => {
2121
+ }, [v]), b = U((e) => {
2123
2122
  let t = p.current, r = e + ((n.current?.scrollLeft ?? 0) - _.current);
2124
2123
  for (let e = 0; e < t.length; e++) if (r < (t[e].left + t[e].right) / 2) return e;
2125
2124
  return t.length;
2126
- }, [n]), x = V(() => {
2125
+ }, [n]), x = U(() => {
2127
2126
  let e = n.current;
2128
2127
  if (!d.current || !e) {
2129
2128
  g.current = null;
2130
2129
  return;
2131
2130
  }
2132
2131
  let t = e.getBoundingClientRect(), r = h.current, i = 0;
2133
- if (r < t.left + Q ? i = -Math.ceil((t.left + Q - r) / Q * $) : r > t.right - Q && (i = Math.ceil((r - (t.right - Q)) / Q * $)), i !== 0) {
2132
+ if (r < t.left + $ ? i = -Math.ceil((t.left + $ - r) / $ * Dn) : r > t.right - $ && (i = Math.ceil((r - (t.right - $)) / $ * Dn)), i !== 0) {
2134
2133
  e.scrollLeft += i;
2135
2134
  let t = b(h.current);
2136
2135
  m.current = t, s(t);
2137
2136
  }
2138
2137
  g.current = requestAnimationFrame(x);
2139
- }, [n, b]), S = V((e, t) => {
2138
+ }, [n, b]), S = U((e, t) => {
2140
2139
  t.button === 0 && (u.current = {
2141
2140
  colId: e,
2142
2141
  x: t.clientX
2143
2142
  }, d.current = !1, f.current = !1);
2144
- }, []), C = V(() => f.current ? (f.current = !1, !0) : !1, []);
2145
- return H(() => {
2143
+ }, []), C = U(() => f.current ? (f.current = !1, !0) : !1, []);
2144
+ return W(() => {
2146
2145
  let i = (t) => {
2147
2146
  let i = u.current;
2148
2147
  if (!i) return;
2149
2148
  if (h.current = t.clientX, !d.current) {
2150
- if (Math.abs(t.clientX - i.x) < On) return;
2149
+ if (Math.abs(t.clientX - i.x) < En) return;
2151
2150
  let o = r.current, s = [];
2152
2151
  if (o) for (let t of e) {
2153
2152
  let e = o.querySelector(`[data-col-id="${CSS.escape(t)}"]`);
@@ -2194,7 +2193,7 @@ function kn({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
2194
2193
  b,
2195
2194
  x,
2196
2195
  y
2197
- ]), H(() => y, [y]), {
2196
+ ]), W(() => y, [y]), {
2198
2197
  dragColId: i,
2199
2198
  dropIndex: o,
2200
2199
  isDragging: c,
@@ -2204,331 +2203,331 @@ function kn({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
2204
2203
  }
2205
2204
  //#endregion
2206
2205
  //#region src/components/pages/SmartListPage.impl.tsx
2207
- var An = yt(() => import("./ListCardsBody-C8ofksQb.js").then((e) => ({ default: e.ListCardsBody })));
2208
- function jn({ screenCode: e }) {
2209
- return /* @__PURE__ */ q(d, { children: /* @__PURE__ */ q(Mn, { screenCode: e }) });
2206
+ var kn = gt(() => import("./ListCardsBody-BPV4GPrv.js").then((e) => ({ default: e.ListCardsBody })));
2207
+ function An({ screenCode: e }) {
2208
+ return /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(jn, { screenCode: e }) });
2210
2209
  }
2211
- function Mn({ screenCode: e }) {
2212
- let t = Ce(), [a, o] = bt(), { data: c } = i(), d = n(), [f, h] = G(!1), [g, _] = G(!1), { filters: y, filterError: x, activeCount: S, setFilters: C, clearFilters: T } = ct(), E = ee((e) => e.user), D = ee((e) => e.activeTenant), te = l(), O = c?.screens[e], k = O?.entity ? c?.entities[O.entity] : void 0, A = O?.entity, ae = m(k, "create"), j = m(k, "update"), oe = m(k, "delete"), M = c?.actions, se = U(() => p(ce(k?.actions, O?.actions, "list_toolbar", M), k), [
2213
- k,
2214
- O?.actions,
2210
+ function jn({ screenCode: e }) {
2211
+ let t = Te(), [n, i] = _t(), { data: a } = ee(), o = ce(), [s, c] = q(!1), [l, h] = q(!1), { filters: g, filterError: _, activeCount: v, setFilters: y, clearFilters: b } = nt(), x = le((e) => e.user), S = le((e) => e.activeTenant), w = pe(), T = a?.screens[e], D = T?.entity ? a?.entities[T.entity] : void 0, O = T?.entity, k = m(D, "create"), te = m(D, "update"), ne = m(D, "delete"), M = a?.actions, ie = G(() => f(E(D?.actions, T?.actions, "list_toolbar", M), D), [
2212
+ D,
2213
+ T?.actions,
2215
2214
  M
2216
- ]), N = U(() => p(ce(k?.actions, void 0, "list_floatbar", M), k), [k, M]), P = U(() => {
2215
+ ]), N = G(() => f(E(D?.actions, void 0, "list_floatbar", M), D), [D, M]), P = G(() => {
2217
2216
  let e = /* @__PURE__ */ new Map(), t = (t) => {
2218
- for (let n of ce(k?.actions, t, "list_row", M)) e.set(n.code, n);
2217
+ for (let n of E(D?.actions, t, "list_row", M)) e.set(n.code, n);
2219
2218
  };
2220
- t(O?.row_actions);
2221
- for (let e of O?.variants?.items() ?? []) e.row_actions !== void 0 && t(e.row_actions);
2222
- return p([...e.values()], k);
2219
+ t(T?.row_actions);
2220
+ for (let e of T?.variants?.items() ?? []) e.row_actions !== void 0 && t(e.row_actions);
2221
+ return f([...e.values()], D);
2223
2222
  }, [
2224
- k,
2225
- O,
2223
+ D,
2224
+ T,
2226
2225
  M
2227
- ]), ue = O?.row_actions !== void 0, pe = U(() => N.length > 0 || k?.export?.enabled !== !1 && O?.export?.enabled !== !1, [
2226
+ ]), se = T?.row_actions !== void 0, ue = G(() => N.length > 0 || D?.export?.enabled !== !1 && T?.export?.enabled !== !1, [
2228
2227
  N,
2229
- k?.export?.enabled,
2230
- O?.export?.enabled
2231
- ]), me = !!k?.soft_delete, he = me && (E?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), ge = he && a.get("include_deleted") === "true", _e = ne(), { openTab: be, updateTabSearch: xe, findTabByPathname: we } = ve();
2232
- et(O, k, a.toString()), tt(O?.route);
2233
- let Ee = V((e) => {
2234
- if (!O?.route || !k || _e.enabled) return;
2235
- let t = we(O.route);
2228
+ D?.export?.enabled,
2229
+ T?.export?.enabled
2230
+ ]), de = !!D?.soft_delete, fe = de && (x?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), me = fe && n.get("include_deleted") === "true", I = u(), { openTab: he, updateTabSearch: ye, findTabByPathname: be } = we();
2231
+ st(T, D, n.toString()), ct(T?.route);
2232
+ let xe = U((e) => {
2233
+ if (!T?.route || !D || I.enabled) return;
2234
+ let t = be(T.route);
2236
2235
  if (t) {
2237
- xe(t.id, e);
2236
+ ye(t.id, e);
2238
2237
  return;
2239
2238
  }
2240
- be({
2241
- pathname: O.route,
2239
+ he({
2240
+ pathname: T.route,
2242
2241
  search: e,
2243
- title: s(O.display?.name) || s(k.display.name_plural),
2244
- icon: O.display?.icon || k.display.icon,
2242
+ title: j(T.display?.name) || j(D.display.name_plural),
2243
+ icon: T.display?.icon || D.display.icon,
2245
2244
  closable: !0
2246
2245
  });
2247
2246
  }, [
2248
- O,
2249
- k,
2250
- _e.enabled,
2251
- we,
2252
- xe,
2253
- be
2254
- ]), Oe = parseInt(a.get("page") ?? "1", 10), ke = (() => {
2255
- let e = parseInt(a.get("per_page") ?? "", 10);
2247
+ T,
2248
+ D,
2249
+ I.enabled,
2250
+ be,
2251
+ ye,
2252
+ he
2253
+ ]), Se = parseInt(n.get("page") ?? "1", 10), Ce = (() => {
2254
+ let e = parseInt(n.get("per_page") ?? "", 10);
2256
2255
  return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
2257
- })(), Ae = a.get("search") ?? "", Ne = Ft({
2258
- searchParams: a,
2259
- setSearchParams: o,
2260
- screenSortDefault: O?.sort_default,
2261
- commitScreenTabSearch: Ee
2262
- }), { cols: Pe, nullsByField: Fe, forRequest: Ie, tableSorting: Le, write: ze, applyColumn: Be, shiftClickColumn: Ve, appendColumn: He, clearColumn: We, clearAll: qe } = Ne, Ye = U(() => Pt(O, k, c?.entities), [
2263
- O,
2264
- k,
2265
- c?.entities
2266
- ]), Xe = Bt({
2256
+ })(), De = n.get("search") ?? "", Oe = Mt({
2257
+ searchParams: n,
2258
+ setSearchParams: i,
2259
+ screenSortDefault: T?.sort_default,
2260
+ commitScreenTabSearch: xe
2261
+ }), { cols: ke, nullsByField: je, forRequest: Me, tableSorting: Ne, write: Pe, applyColumn: Le, shiftClickColumn: Re, appendColumn: ze, clearColumn: Be, clearAll: Ve } = Oe, Ue = G(() => jt(T, D, a?.entities), [
2262
+ T,
2263
+ D,
2264
+ a?.entities
2265
+ ]), qe = Lt({
2267
2266
  screenCode: e,
2268
- screen: O,
2269
- searchParams: a,
2270
- setSearchParams: o
2271
- }), { visible: I, sizing: Qe, setSizing: it, apply: at, commitResize: st } = Xe, lt = hn({
2267
+ screen: T,
2268
+ searchParams: n,
2269
+ setSearchParams: i
2270
+ }), { visible: L, sizing: Qe, setSizing: $e, apply: tt, commitResize: rt } = qe, it = fn({
2272
2271
  screenCode: e,
2273
- screen: O,
2274
- searchParams: a,
2275
- setSearchParams: o,
2276
- userId: E?.id,
2277
- tenantId: D?.id,
2278
- filterError: !!x,
2279
- filters: y,
2280
- visibleColumns: I,
2281
- sort: Ie
2282
- }), { active: ut, saveAsNew: dt, overwriteActive: ft, isSaving: pt } = lt, mt = re(Ae, 300), L = ie(), R = U(() => {
2283
- let e = O?.responsive?.[L.category]?.presentation;
2284
- return e === "table" || e === "cards" ? e : L.category === "phone" ? "cards" : "table";
2285
- }, [O?.responsive, L.category]), ht = U(() => Ze({
2286
- entity: k,
2287
- screen: O,
2288
- savedViewColumns: ut?.columns
2272
+ screen: T,
2273
+ searchParams: n,
2274
+ setSearchParams: i,
2275
+ userId: x?.id,
2276
+ tenantId: S?.id,
2277
+ filterError: !!_,
2278
+ filters: g,
2279
+ visibleColumns: L,
2280
+ sort: Me
2281
+ }), { active: R, saveAsNew: at, overwriteActive: lt, isSaving: ut } = it, dt = ge(De, 300), z = r(), B = G(() => {
2282
+ let e = T?.responsive?.[z.category]?.presentation;
2283
+ return e === "table" || e === "cards" ? e : z.category === "phone" ? "cards" : "table";
2284
+ }, [T?.responsive, z.category]), ft = G(() => Ye({
2285
+ entity: D,
2286
+ screen: T,
2287
+ savedViewColumns: R?.columns
2289
2288
  }), [
2290
- k,
2291
- O,
2292
- ut?.columns
2293
- ]), z = U(() => Ke({
2294
- entity: k,
2295
- screen: O,
2296
- presentation: R,
2297
- visibleColumns: I,
2298
- card: ht,
2289
+ D,
2290
+ T,
2291
+ R?.columns
2292
+ ]), V = G(() => Ke({
2293
+ entity: D,
2294
+ screen: T,
2295
+ presentation: B,
2296
+ visibleColumns: L,
2297
+ card: ft,
2299
2298
  rowActions: P,
2300
- toolbarActions: se,
2299
+ toolbarActions: ie,
2301
2300
  bulkActions: N,
2302
- sort: Pe,
2303
- screens: c?.screens
2301
+ sort: ke,
2302
+ screens: a?.screens
2304
2303
  }), [
2305
- k,
2306
- O,
2307
- R,
2308
- I,
2309
- ht,
2304
+ D,
2305
+ T,
2306
+ B,
2307
+ L,
2308
+ ft,
2310
2309
  P,
2311
- se,
2310
+ ie,
2312
2311
  N,
2313
- Pe,
2314
- c?.screens
2315
- ]), yt = _t({
2316
- entity: k,
2317
- entityCode: A,
2318
- screen: O,
2312
+ ke,
2313
+ a?.screens
2314
+ ]), gt = mt({
2315
+ entity: D,
2316
+ entityCode: O,
2317
+ screen: T,
2319
2318
  screenCode: e,
2320
- page: Oe,
2321
- perPage: ke,
2322
- sortForRequest: Ie,
2323
- debouncedSearch: mt,
2324
- filters: y,
2325
- filterError: !!x,
2326
- includeDeleted: ge,
2327
- expand: z.expandFields,
2328
- select: z.selectFields,
2319
+ page: Se,
2320
+ perPage: Ce,
2321
+ sortForRequest: Me,
2322
+ debouncedSearch: dt,
2323
+ filters: g,
2324
+ filterError: !!_,
2325
+ includeDeleted: me,
2326
+ expand: V.expandFields,
2327
+ select: V.selectFields,
2329
2328
  runCountQuery: !0,
2330
- urlKey: `${A ?? ""}|${a.toString()}`
2331
- }), { rows: B, meta: xt, refs: St, isLoading: Ct, isFetching: wt, isError: Tt, error: Et, isLoadingStale: Dt, retry: Ot, countTotal: kt, countStrategy: Nt, countLoading: It, countError: Rt, totalPages: Vt, hasMorePages: Ht, isCursor: Ut, fetchNextPage: Wt, isFetchingNextPage: Kt } = yt, qt = zt(k, B, wt), { state: Jt, setState: Xt, ids: Zt, pkValues: Qt, rows: $t, keyOf: tn } = qt, rn = Te((e) => e.degradedEntities), sn = De(k?.realtime, rn, A ?? ""), cn = Se(A ?? ""), ln = W(St);
2332
- ln.current = St;
2333
- let un = U(() => {
2329
+ urlKey: `${O ?? ""}|${n.toString()}`
2330
+ }), { rows: H, meta: vt, refs: yt, isLoading: bt, isFetching: xt, isError: St, error: Ct, isLoadingStale: wt, retry: Tt, countTotal: Et, countStrategy: At, countLoading: Nt, countError: Ft, totalPages: Rt, hasMorePages: zt, isCursor: Bt, fetchNextPage: Vt, isFetchingNextPage: Ut } = gt, Wt = It(D, H, xt), { state: Gt, setState: qt, ids: Jt, pkValues: Yt, rows: Xt, keyOf: Qt } = Wt, en = oe(D?.realtime, O ?? ""), rn = Ae(O ?? ""), an = K(yt);
2331
+ an.current = yt;
2332
+ let on = G(() => {
2334
2333
  let e = /* @__PURE__ */ new Map();
2335
- if (!k) return e;
2336
- for (let t of Ue(k, O, ut?.columns)) {
2337
- if (t.startsWith("$") || k.files?.get(t)) continue;
2338
- let n = k.fields.get(t);
2339
- n && e.set(t, u({
2334
+ if (!D) return e;
2335
+ for (let t of Ge(D, T, R?.columns)) {
2336
+ if (t.startsWith("$") || D.files?.get(t)) continue;
2337
+ let n = D.fields.get(t);
2338
+ n && e.set(t, ae({
2340
2339
  field: n,
2341
2340
  fieldName: t,
2342
2341
  surface: "list",
2343
- entity: k,
2344
- entities: c?.entities,
2345
- screens: c?.screens,
2346
- refs: () => ln.current,
2347
- locale: d
2342
+ entity: D,
2343
+ entities: a?.entities,
2344
+ screens: a?.screens,
2345
+ refs: () => an.current,
2346
+ locale: o
2348
2347
  }));
2349
2348
  }
2350
2349
  return e;
2351
2350
  }, [
2352
- k,
2353
- O,
2354
- ut?.columns,
2355
- c?.entities,
2356
- c?.screens,
2357
- ln,
2358
- d
2359
- ]), { labelFor: dn, refs: pn } = vn(Ye, y, St, c?.entities), mn = Gt({
2360
- entity: k,
2361
- screen: O,
2362
- screens: c?.screens,
2363
- entities: c?.entities,
2364
- searchParams: a,
2351
+ D,
2352
+ T,
2353
+ R?.columns,
2354
+ a?.entities,
2355
+ a?.screens,
2356
+ an,
2357
+ o
2358
+ ]), { labelFor: sn, refs: cn } = mn(Ue, g, yt, a?.entities), un = Ht({
2359
+ entity: D,
2360
+ screen: T,
2361
+ screens: a?.screens,
2362
+ entities: a?.entities,
2363
+ searchParams: n,
2365
2364
  tabNavigate: t,
2366
- commitScreenTabSearch: Ee,
2367
- isPhone: L.category === "phone",
2368
- canUpdate: j
2369
- }), { peekAllowed: _n, peekRow: Y, setPeekRow: X, peekFields: Sn, peekActions: Cn, peekExecute: wn, contextMenu: Z, setContextMenu: Tn } = mn, On = U(() => !O || !k ? !1 : v(O, "_", k, c?.screens) !== null, [
2370
- O,
2371
- k,
2372
- c?.screens
2373
- ]), Q = U(() => En({
2374
- visibleCols: I,
2375
- entity: k,
2376
- screen: O,
2377
- schema: c,
2378
- entityCode: A,
2365
+ commitScreenTabSearch: xe,
2366
+ isPhone: z.category === "phone",
2367
+ canUpdate: te
2368
+ }), { peekAllowed: dn, peekRow: Z, setPeekRow: hn, peekFields: yn, peekActions: bn, peekExecute: xn, contextMenu: Sn, setContextMenu: Cn } = un, Q = G(() => !T || !D ? !1 : C(T, "_", D, a?.screens) !== null, [
2369
+ T,
2370
+ D,
2371
+ a?.screens
2372
+ ]), En = G(() => wn({
2373
+ visibleCols: L,
2374
+ entity: D,
2375
+ screen: T,
2376
+ schema: a,
2377
+ entityCode: O,
2379
2378
  rowActions: P,
2380
- hasBatchActions: pe,
2381
- hasExplicitRowActions: ue,
2382
- canUpdate: j,
2383
- canDelete: oe,
2384
- peekEnabled: _n,
2385
- hasDetailTarget: On,
2386
- userLocale: d,
2379
+ hasBatchActions: ue,
2380
+ hasExplicitRowActions: se,
2381
+ canUpdate: te,
2382
+ canDelete: ne,
2383
+ peekEnabled: dn,
2384
+ hasDetailTarget: Q,
2385
+ userLocale: o,
2387
2386
  tabNavigate: t,
2388
- refsRef: ln,
2389
- rowSelectionKey: Lt,
2390
- setPeekRow: X
2387
+ refsRef: an,
2388
+ rowSelectionKey: Pt,
2389
+ setPeekRow: hn
2391
2390
  }), [
2392
- O,
2393
- k,
2394
- I,
2391
+ T,
2392
+ D,
2393
+ L,
2395
2394
  t,
2396
- pe,
2397
- P,
2398
2395
  ue,
2399
- A,
2400
- _n,
2401
- On,
2402
- c,
2403
- d,
2404
- j,
2405
- oe,
2406
- ln,
2407
- X
2408
- ]), $ = At({
2409
- features: Mt,
2410
- data: B,
2411
- columns: Q,
2396
+ P,
2397
+ se,
2398
+ O,
2399
+ dn,
2400
+ Q,
2401
+ a,
2402
+ o,
2403
+ te,
2404
+ ne,
2405
+ an,
2406
+ hn
2407
+ ]), $ = Dt({
2408
+ features: kt,
2409
+ data: H,
2410
+ columns: En,
2412
2411
  manualSorting: !0,
2413
2412
  enableColumnResizing: !0,
2414
2413
  columnResizeMode: "onChange",
2415
- onColumnSizingChange: it,
2414
+ onColumnSizingChange: $e,
2416
2415
  state: {
2417
- sorting: Le,
2418
- rowSelection: Jt,
2416
+ sorting: Ne,
2417
+ rowSelection: Gt,
2419
2418
  columnSizing: Qe
2420
2419
  },
2421
2420
  onSortingChange: (e) => {
2422
- let t = (typeof e == "function" ? e(Le) : e).slice(0, 5);
2421
+ let t = (typeof e == "function" ? e(Ne) : e).slice(0, 5);
2423
2422
  if (t.length === 0) {
2424
- ze([]);
2423
+ Pe([]);
2425
2424
  return;
2426
2425
  }
2427
2426
  let n = t.map((e) => {
2428
- let t = Fe.get(e.id);
2427
+ let t = je.get(e.id);
2429
2428
  return {
2430
2429
  field: e.id,
2431
2430
  dir: e.desc ? "desc" : "asc",
2432
2431
  ...t ? { nulls: t } : {}
2433
2432
  };
2434
2433
  });
2435
- ze(n);
2434
+ Pe(n);
2436
2435
  },
2437
- onRowSelectionChange: Xt,
2438
- getRowId: tn
2439
- }), jn = $.state.columnResizing.isResizingColumn, Mn = W(!1);
2440
- H(() => {
2441
- let e = !!Mn.current && !jn;
2442
- Mn.current = jn, e && st($.state.columnSizing);
2436
+ onRowSelectionChange: qt,
2437
+ getRowId: Qt
2438
+ }), Dn = $.state.columnResizing.isResizingColumn, An = K(!1);
2439
+ W(() => {
2440
+ let e = !!An.current && !Dn;
2441
+ An.current = Dn, e && rt($.state.columnSizing);
2443
2442
  }, [
2444
- jn,
2445
- st,
2443
+ Dn,
2444
+ rt,
2446
2445
  $
2447
2446
  ]);
2448
- let Nn = Yt($), Pn = $.getTotalSize();
2449
- H(() => {
2447
+ let jn = Kt($), Mn = $.getTotalSize();
2448
+ W(() => {
2450
2449
  let e = (e) => {
2451
2450
  let t = e.target?.tagName;
2452
2451
  if (t === "INPUT" || t === "TEXTAREA" || t === "SELECT") {
2453
- e.key === "Escape" && (e.target.blur(), h(!1));
2452
+ e.key === "Escape" && (e.target.blur(), c(!1));
2454
2453
  return;
2455
2454
  }
2456
- e.key === "/" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), document.querySelector("[placeholder*=\"Search\"]")?.focus()), e.key === "f" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), h((e) => !e)), e.key === "Escape" && h(!1);
2455
+ e.key === "/" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), document.querySelector("[placeholder*=\"Search\"]")?.focus()), e.key === "f" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), c((e) => !e)), e.key === "Escape" && c(!1);
2457
2456
  };
2458
2457
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2459
2458
  }, []);
2460
- let Fn = W(null), { rows: In } = $.getRowModel(), Ln = W(null), Rn = kn({
2461
- visibleCols: I,
2462
- onReorder: at,
2463
- scrollElRef: Fn,
2464
- theadRef: Ln
2465
- }), zn = ye((e) => e.density), Bn = ye((e) => e.zebra), Vn = fe(), Hn = jt({
2466
- count: In.length,
2467
- getScrollElement: () => Fn.current,
2468
- estimateSize: () => R === "cards" ? 142 : 48,
2459
+ let Nn = K(null), { rows: Pn } = $.getRowModel(), Fn = K(null), In = On({
2460
+ visibleCols: L,
2461
+ onReorder: tt,
2462
+ scrollElRef: Nn,
2463
+ theadRef: Fn
2464
+ }), Ln = Ee((e) => e.density), Rn = Ee((e) => e.zebra), zn = ve(), Bn = Ot({
2465
+ count: Pn.length,
2466
+ getScrollElement: () => Nn.current,
2467
+ estimateSize: () => B === "cards" ? 142 : 48,
2469
2468
  overscan: 10,
2470
- initialOffset: Vn
2471
- }), Un = U(() => In.map((e) => e.id), [In]);
2472
- de({
2473
- virtualizer: Hn,
2474
- scrollElementRef: Fn,
2475
- rowKeys: Un
2476
- }), H(() => {
2477
- Hn.measure();
2478
- }, [zn, Hn]), H(() => {
2479
- Hn.measure();
2469
+ initialOffset: zn
2470
+ }), Vn = G(() => Pn.map((e) => e.id), [Pn]);
2471
+ _e({
2472
+ virtualizer: Bn,
2473
+ scrollElementRef: Nn,
2474
+ rowKeys: Vn
2475
+ }), W(() => {
2476
+ Bn.measure();
2477
+ }, [Ln, Bn]), W(() => {
2478
+ Bn.measure();
2480
2479
  }, [
2481
- L.width,
2482
- L.height,
2483
- R,
2484
- Hn
2480
+ z.width,
2481
+ z.height,
2482
+ B,
2483
+ Bn
2485
2484
  ]);
2486
- let Wn = V((e) => {
2487
- o((t) => {
2485
+ let Hn = U((e) => {
2486
+ i((t) => {
2488
2487
  let n = new URLSearchParams(t);
2489
2488
  return e ? n.set("search", e) : n.delete("search"), n.set("page", "1"), n;
2490
2489
  });
2491
- }, [o]), Gn = V(() => {
2492
- o((e) => {
2490
+ }, [i]), Un = U(() => {
2491
+ i((e) => {
2493
2492
  let t = new URLSearchParams(e);
2494
2493
  return t.get("include_deleted") ? t.delete("include_deleted") : t.set("include_deleted", "true"), t.set("page", "1"), t;
2495
2494
  });
2496
- }, [o]), Kn = V((e) => {
2497
- o((t) => {
2495
+ }, [i]), Wn = U((e) => {
2496
+ i((t) => {
2498
2497
  let n = new URLSearchParams(t);
2499
2498
  return n.set("page", String(e)), n;
2500
2499
  });
2501
- }, [o]);
2502
- H(() => {
2503
- Vt !== void 0 && Oe > Vt && Kn(Vt);
2500
+ }, [i]);
2501
+ W(() => {
2502
+ Rt !== void 0 && Se > Rt && Wn(Rt);
2504
2503
  }, [
2505
- Vt,
2506
- Oe,
2507
- Kn
2504
+ Rt,
2505
+ Se,
2506
+ Wn
2508
2507
  ]);
2509
- let qn = V((e) => {
2510
- o((t) => {
2508
+ let Gn = U((e) => {
2509
+ i((t) => {
2511
2510
  let n = new URLSearchParams(t);
2512
2511
  return n.set("per_page", String(e)), n.set("page", "1"), n;
2513
2512
  });
2514
- }, [o]);
2515
- if (!O || !k) return null;
2516
- let Jn = k.display, Yn = s(O.display?.name) || s(Jn.name), Xn = O.display?.icon || Jn.icon, Zn = s(O.display?.description) || s(Jn.description), Qn = L.category === "phone", $n = R === "cards", er = Qt.map((e) => r(k, e)), tr = {
2517
- entity: k,
2518
- entityCode: A ?? "",
2519
- screen: O,
2520
- screenRoute: O.route,
2521
- selectedRows: $t,
2522
- selectedIds: er,
2523
- locale: d,
2513
+ }, [i]);
2514
+ if (!T || !D) return null;
2515
+ let Kn = D.display, qn = j(T.display?.name) || j(Kn.name), Jn = T.display?.icon || Kn.icon, Yn = j(T.display?.description) || j(Kn.description), Xn = z.category === "phone", Zn = B === "cards", Qn = Yt.map((e) => re(D, e)), $n = {
2516
+ entity: D,
2517
+ entityCode: O ?? "",
2518
+ screen: T,
2519
+ screenRoute: T.route,
2520
+ selectedRows: Xt,
2521
+ selectedIds: Qn,
2522
+ locale: o,
2524
2523
  tabNavigate: (e, n) => t(e, {
2525
2524
  title: n?.title,
2526
2525
  icon: n?.icon,
2527
2526
  search: n?.search
2528
2527
  }),
2529
- runActionApi: (e, t) => b(e, t)
2528
+ runActionApi: (e, t) => A(e, t)
2530
2529
  };
2531
- return /* @__PURE__ */ J("div", {
2530
+ return /* @__PURE__ */ X("div", {
2532
2531
  style: {
2533
2532
  display: "flex",
2534
2533
  flexDirection: "column",
@@ -2536,51 +2535,51 @@ function Mn({ screenCode: e }) {
2536
2535
  background: "var(--background)"
2537
2536
  },
2538
2537
  children: [
2539
- /* @__PURE__ */ J(K, { children: [
2540
- /* @__PURE__ */ q(bn, {
2541
- title: Yn,
2542
- description: Zn,
2543
- toolbarActions: se,
2544
- screenActionLayout: O.action_layout,
2545
- entityActionLayout: k.action_layout,
2546
- selectedIds: Zt,
2547
- data: B,
2548
- rowKey: tn,
2549
- onActionSuccess: () => Xt({}),
2550
- widgetContext: tr
2538
+ /* @__PURE__ */ X(J, { children: [
2539
+ /* @__PURE__ */ Y(_n, {
2540
+ title: qn,
2541
+ description: Yn,
2542
+ toolbarActions: ie,
2543
+ screenActionLayout: T.action_layout,
2544
+ entityActionLayout: D.action_layout,
2545
+ selectedIds: Jt,
2546
+ data: H,
2547
+ rowKey: Qt,
2548
+ onActionSuccess: () => qt({}),
2549
+ widgetContext: $n
2551
2550
  }),
2552
- /* @__PURE__ */ q(fn, {
2553
- screen: O,
2554
- entity: k,
2555
- entityCode: A,
2556
- schema: c,
2551
+ /* @__PURE__ */ Y(ln, {
2552
+ screen: T,
2553
+ entity: D,
2554
+ entityCode: O,
2555
+ schema: a,
2557
2556
  screenCode: e,
2558
- screenName: Yn,
2559
- locale: d,
2560
- isPhone: Qn,
2561
- isCardsPresentation: $n,
2562
- sort: Ne,
2563
- columns: Xe,
2564
- views: lt,
2565
- query: yt,
2566
- selection: qt,
2557
+ screenName: qn,
2558
+ locale: o,
2559
+ isPhone: Xn,
2560
+ isCardsPresentation: Zn,
2561
+ sort: Oe,
2562
+ columns: qe,
2563
+ views: it,
2564
+ query: gt,
2565
+ selection: Wt,
2567
2566
  filters: {
2568
- json: y,
2569
- debouncedSearch: mt,
2570
- count: S,
2571
- onOpen: () => h(!0)
2567
+ json: g,
2568
+ debouncedSearch: dt,
2569
+ count: v,
2570
+ onOpen: () => c(!0)
2572
2571
  },
2573
- searchValue: Ae,
2574
- onSearchChange: Wn,
2575
- onSaveView: () => _(!0),
2576
- page: Oe,
2577
- perPage: ke,
2578
- includeDeleted: ge,
2579
- canViewDeleted: he,
2580
- onToggleDeleted: Gn,
2581
- isLive: sn
2572
+ searchValue: De,
2573
+ onSearchChange: Hn,
2574
+ onSaveView: () => h(!0),
2575
+ page: Se,
2576
+ perPage: Ce,
2577
+ includeDeleted: me,
2578
+ canViewDeleted: fe,
2579
+ onToggleDeleted: Un,
2580
+ isLive: en
2582
2581
  }),
2583
- x && /* @__PURE__ */ J("div", {
2582
+ _ && /* @__PURE__ */ X("div", {
2584
2583
  role: "alert",
2585
2584
  "data-testid": "filter-url-error",
2586
2585
  style: {
@@ -2594,52 +2593,52 @@ function Mn({ screenCode: e }) {
2594
2593
  alignItems: "center",
2595
2594
  gap: 8
2596
2595
  },
2597
- children: [/* @__PURE__ */ J("span", { children: [x, " Showing this list without URL filters."] }), /* @__PURE__ */ q(w, {
2596
+ children: [/* @__PURE__ */ X("span", { children: [_, " Showing this list without URL filters."] }), /* @__PURE__ */ Y(d, {
2598
2597
  kind: "ghost",
2599
2598
  size: "xs",
2600
- onClick: T,
2599
+ onClick: b,
2601
2600
  children: "Clear"
2602
2601
  })]
2603
2602
  }),
2604
- y.length > 0 && /* @__PURE__ */ q("div", {
2603
+ g.length > 0 && /* @__PURE__ */ Y("div", {
2605
2604
  style: { padding: "0 20px 10px" },
2606
- children: /* @__PURE__ */ q(rt, {
2607
- filters: y,
2608
- resolveValue: dn,
2609
- onRemove: (e) => C($e(y, e)),
2610
- onClearAll: T,
2611
- onChipClick: () => h(!0),
2605
+ children: /* @__PURE__ */ Y(Ze, {
2606
+ filters: g,
2607
+ resolveValue: sn,
2608
+ onRemove: (e) => y(ot(g, e)),
2609
+ onClearAll: b,
2610
+ onChipClick: () => c(!0),
2612
2611
  fieldLabel: (e) => {
2613
2612
  if (e.startsWith("$status.")) {
2614
- let t = e.slice(8), n = k.status_groups?.[t];
2615
- return n ? s(n.name) || t : e;
2613
+ let t = e.slice(8), n = D.status_groups?.[t];
2614
+ return n ? j(n.name) || t : e;
2616
2615
  }
2617
2616
  if (e.startsWith("$property.")) {
2618
- let t = e.slice(10), n = k.properties?.[t];
2619
- return n ? s(n.name) || t : e;
2617
+ let t = e.slice(10), n = D.properties?.[t];
2618
+ return n ? j(n.name) || t : e;
2620
2619
  }
2621
- let t = k.fields.get(e);
2622
- return t ? le(t, e, c?.entities) : e;
2620
+ let t = D.fields.get(e);
2621
+ return t ? p(t, e, a?.entities) : e;
2623
2622
  }
2624
2623
  })
2625
2624
  })
2626
2625
  ] }),
2627
- /* @__PURE__ */ q(an, {
2628
- isLoading: Ct,
2629
- tableLoadingStale: Dt,
2630
- isError: Tt,
2631
- error: Et,
2632
- rowCount: B.length,
2633
- entity: k,
2634
- screen: O,
2635
- screenName: Yn,
2636
- screenIcon: Xn,
2637
- isFiltered: !!mt || S > 0,
2638
- canCreate: ae,
2639
- toolbarActions: se,
2640
- onRetry: Ot
2626
+ /* @__PURE__ */ Y(tn, {
2627
+ isLoading: bt,
2628
+ tableLoadingStale: wt,
2629
+ isError: St,
2630
+ error: Ct,
2631
+ rowCount: H.length,
2632
+ entity: D,
2633
+ screen: T,
2634
+ screenName: qn,
2635
+ screenIcon: Jn,
2636
+ isFiltered: !!dt || v > 0,
2637
+ canCreate: k,
2638
+ toolbarActions: ie,
2639
+ onRetry: Tt
2641
2640
  }),
2642
- Ct || Tt || B.length === 0 ? null : /* @__PURE__ */ q("div", {
2641
+ bt || St || H.length === 0 ? null : /* @__PURE__ */ Y("div", {
2643
2642
  style: {
2644
2643
  flex: 1,
2645
2644
  minHeight: 0,
@@ -2647,7 +2646,7 @@ function Mn({ screenCode: e }) {
2647
2646
  display: "flex",
2648
2647
  flexDirection: "column"
2649
2648
  },
2650
- children: /* @__PURE__ */ J("div", {
2649
+ children: /* @__PURE__ */ X("div", {
2651
2650
  style: {
2652
2651
  background: "var(--surface)",
2653
2652
  border: "1px solid var(--border)",
@@ -2659,191 +2658,191 @@ function Mn({ screenCode: e }) {
2659
2658
  flex: 1,
2660
2659
  minHeight: 0
2661
2660
  },
2662
- children: [/* @__PURE__ */ q("div", {
2663
- ref: Fn,
2661
+ children: [/* @__PURE__ */ Y("div", {
2662
+ ref: Nn,
2664
2663
  "data-testid": "list-scroll",
2665
- "data-presentation": R,
2664
+ "data-presentation": B,
2666
2665
  style: {
2667
2666
  overflow: "auto",
2668
2667
  flex: 1,
2669
2668
  minHeight: 0
2670
2669
  },
2671
- children: R === "cards" ? /* @__PURE__ */ q(vt, {
2670
+ children: B === "cards" ? /* @__PURE__ */ Y(ht, {
2672
2671
  fallback: null,
2673
- children: /* @__PURE__ */ q(An, {
2674
- rows: In,
2675
- virtualizer: Hn,
2676
- entity: k,
2677
- screen: O,
2678
- entityCode: A,
2679
- entities: c?.entities,
2680
- savedViewColumns: ut?.columns,
2681
- refs: ln.current,
2682
- locale: d,
2683
- renderers: un,
2672
+ children: /* @__PURE__ */ Y(kn, {
2673
+ rows: Pn,
2674
+ virtualizer: Bn,
2675
+ entity: D,
2676
+ screen: T,
2677
+ entityCode: O,
2678
+ entities: a?.entities,
2679
+ savedViewColumns: R?.columns,
2680
+ refs: an.current,
2681
+ locale: o,
2682
+ renderers: on,
2684
2683
  rowActions: P,
2685
2684
  tabNavigate: t,
2686
- interaction: mn,
2687
- hasSoftDelete: me,
2688
- zebra: Bn,
2689
- hasBatchActions: pe,
2690
- hasDetailTarget: On,
2691
- rowKey: tn
2685
+ interaction: un,
2686
+ hasSoftDelete: de,
2687
+ zebra: Rn,
2688
+ hasBatchActions: ue,
2689
+ hasDetailTarget: Q,
2690
+ rowKey: Qt
2692
2691
  })
2693
- }) : /* @__PURE__ */ q(en, {
2692
+ }) : /* @__PURE__ */ Y(Zt, {
2694
2693
  table: $,
2695
- columns: Q,
2696
- rows: In,
2697
- entity: k,
2698
- columnSizeVars: Nn,
2699
- totalColumnsWidth: Pn,
2700
- theadRef: Ln,
2701
- virtualizer: Hn,
2702
- visibleCols: I,
2703
- headerReorder: Rn,
2704
- sortCols: Pe,
2705
- sortNullsMap: Fe,
2706
- shiftClickColumn: Ve,
2707
- applyColumnSort: Be,
2708
- appendColumnSort: He,
2709
- clearColumnSort: We,
2710
- clearAllSorts: qe,
2711
- renderRow: (e, t) => /* @__PURE__ */ q(nn, {
2694
+ columns: En,
2695
+ rows: Pn,
2696
+ entity: D,
2697
+ columnSizeVars: jn,
2698
+ totalColumnsWidth: Mn,
2699
+ theadRef: Fn,
2700
+ virtualizer: Bn,
2701
+ visibleCols: L,
2702
+ headerReorder: In,
2703
+ sortCols: ke,
2704
+ sortNullsMap: je,
2705
+ shiftClickColumn: Re,
2706
+ applyColumnSort: Le,
2707
+ appendColumnSort: ze,
2708
+ clearColumnSort: Be,
2709
+ clearAllSorts: Ve,
2710
+ renderRow: (e, t) => /* @__PURE__ */ Y($t, {
2712
2711
  row: e,
2713
2712
  rowIndex: t,
2714
- entity: k,
2715
- hasSoftDelete: me,
2716
- zebra: Bn,
2717
- hasDetailTarget: On,
2718
- interaction: mn,
2719
- measureElement: Hn.measureElement
2713
+ entity: D,
2714
+ hasSoftDelete: de,
2715
+ zebra: Rn,
2716
+ hasDetailTarget: Q,
2717
+ interaction: un,
2718
+ measureElement: Bn.measureElement
2720
2719
  }, e.id),
2721
- isResizingColumn: jn
2720
+ isResizingColumn: Dn
2722
2721
  })
2723
- }), /* @__PURE__ */ q(on, {
2724
- meta: xt,
2725
- isCursor: Ut,
2726
- isPhone: Qn,
2727
- rowsLoaded: B.length,
2728
- selectedCount: Zt.length,
2729
- countTotal: kt,
2730
- countStrategy: Nt,
2731
- countLoading: It,
2732
- countError: Rt,
2733
- page: Oe,
2734
- totalPages: Vt,
2735
- goToPage: Kn,
2736
- perPage: ke,
2737
- setPerPage: qn,
2738
- hasMorePages: Ht,
2739
- fetchNextPage: Wt,
2740
- isFetchingNextPage: Kt
2722
+ }), /* @__PURE__ */ Y(nn, {
2723
+ meta: vt,
2724
+ isCursor: Bt,
2725
+ isPhone: Xn,
2726
+ rowsLoaded: H.length,
2727
+ selectedCount: Jt.length,
2728
+ countTotal: Et,
2729
+ countStrategy: At,
2730
+ countLoading: Nt,
2731
+ countError: Ft,
2732
+ page: Se,
2733
+ totalPages: Rt,
2734
+ goToPage: Wn,
2735
+ perPage: Ce,
2736
+ setPerPage: Gn,
2737
+ hasMorePages: zt,
2738
+ fetchNextPage: Vt,
2739
+ isFetchingNextPage: Ut
2741
2740
  })]
2742
2741
  })
2743
2742
  }),
2744
- /* @__PURE__ */ q(ot, {
2745
- open: f,
2746
- onClose: () => h(!1),
2747
- filters: y,
2748
- onApply: C,
2749
- availableFields: Ye,
2750
- defaultFilters: O?.default_filters,
2751
- refs: pn
2743
+ /* @__PURE__ */ Y(et, {
2744
+ open: s,
2745
+ onClose: () => c(!1),
2746
+ filters: g,
2747
+ onApply: y,
2748
+ availableFields: Ue,
2749
+ defaultFilters: T?.default_filters,
2750
+ refs: cn
2752
2751
  }),
2753
- /* @__PURE__ */ q(yn, {
2754
- open: g,
2755
- pending: pt,
2756
- onClose: () => _(!1),
2757
- overwriteViewName: gn(ut),
2752
+ /* @__PURE__ */ Y(gn, {
2753
+ open: l,
2754
+ pending: ut,
2755
+ onClose: () => h(!1),
2756
+ overwriteViewName: pn(R),
2758
2757
  onOverwrite: async () => {
2759
- await ft(), _(!1);
2758
+ await lt(), h(!1);
2760
2759
  },
2761
2760
  onSave: async (e) => {
2762
- await dt(e), _(!1);
2761
+ await at(e), h(!1);
2763
2762
  }
2764
2763
  }),
2765
- Zt.length > 0 && /* @__PURE__ */ q(xn, {
2766
- selectedIds: Zt,
2764
+ Jt.length > 0 && /* @__PURE__ */ Y(vn, {
2765
+ selectedIds: Jt,
2767
2766
  floatbarActions: N,
2768
- screenActionLayout: O.action_layout,
2769
- entityActionLayout: k.action_layout,
2770
- data: B,
2771
- rowKey: tn,
2772
- entityCode: A,
2773
- entity: k,
2774
- screen: O,
2775
- onClear: () => Xt({}),
2776
- onActionSuccess: () => Xt({}),
2777
- widgetContext: tr
2767
+ screenActionLayout: T.action_layout,
2768
+ entityActionLayout: D.action_layout,
2769
+ data: H,
2770
+ rowKey: Qt,
2771
+ entityCode: O,
2772
+ entity: D,
2773
+ screen: T,
2774
+ onClear: () => qt({}),
2775
+ onActionSuccess: () => qt({}),
2776
+ widgetContext: $n
2778
2777
  }),
2779
- Z && k && O && /* @__PURE__ */ q(Dn, {
2780
- x: Z.x,
2781
- y: Z.y,
2782
- row: Z.row,
2783
- rowId: tn(Z.row),
2784
- screen: O,
2785
- fullScreen: O,
2786
- entity: k,
2787
- entityCode: A,
2778
+ Sn && D && T && /* @__PURE__ */ Y(Tn, {
2779
+ x: Sn.x,
2780
+ y: Sn.y,
2781
+ row: Sn.row,
2782
+ rowId: Qt(Sn.row),
2783
+ screen: T,
2784
+ fullScreen: T,
2785
+ entity: D,
2786
+ entityCode: O,
2788
2787
  rowActions: P,
2789
2788
  tabNavigate: t,
2790
- locale: d,
2791
- peekAllowed: _n,
2792
- hasDetailTarget: On,
2793
- onPeek: X,
2794
- onClose: () => Tn(null)
2789
+ locale: o,
2790
+ peekAllowed: dn,
2791
+ hasDetailTarget: Q,
2792
+ onPeek: hn,
2793
+ onClose: () => Cn(null)
2795
2794
  }),
2796
- _n && Y && k && /* @__PURE__ */ q(nt, {
2797
- entity: k,
2798
- entityCode: A,
2799
- record: Y,
2795
+ dn && Z && D && /* @__PURE__ */ Y(Xe, {
2796
+ entity: D,
2797
+ entityCode: O,
2798
+ record: Z,
2800
2799
  title: (() => {
2801
- let e = O.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
2802
- return e ? F(Y[e] ?? s(k.display.name)) : s(k.display.name);
2800
+ let e = T.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
2801
+ return e ? F(Z[e] ?? j(D.display.name)) : j(D.display.name);
2803
2802
  })(),
2804
2803
  recordId: (() => {
2805
- let e = k.fields.names()?.find((e) => k.fields.get(e)?.primary);
2806
- return e ? F(Y[e]) : void 0;
2804
+ let e = D.fields.names()?.find((e) => D.fields.get(e)?.primary);
2805
+ return e ? F(Z[e]) : void 0;
2807
2806
  })(),
2808
- fields: Sn,
2809
- screen: Re(k, O, Y),
2810
- actions: Cn,
2811
- screenActionLayout: Re(k, O, Y)?.action_layout,
2812
- entityActionLayout: k.action_layout,
2813
- executeAction: wn,
2807
+ fields: yn,
2808
+ screen: He(D, T, Z),
2809
+ actions: bn,
2810
+ screenActionLayout: He(D, T, Z)?.action_layout,
2811
+ entityActionLayout: D.action_layout,
2812
+ executeAction: xn,
2814
2813
  onClose: () => {
2815
- if (k && Y) {
2816
- let e = k.fields.names()?.find((e) => k.fields.get(e)?.primary);
2817
- e && gt(F(Y[e]));
2814
+ if (D && Z) {
2815
+ let e = D.fields.names()?.find((e) => D.fields.get(e)?.primary);
2816
+ e && pt(F(Z[e]));
2818
2817
  }
2819
- X(null);
2818
+ hn(null);
2820
2819
  },
2821
2820
  onOpen: (e) => {
2822
- let t = Y;
2823
- X(null), mn.navigateToDetail(t, { draft: e });
2821
+ let t = Z;
2822
+ hn(null), un.navigateToDetail(t, { draft: e });
2824
2823
  },
2825
2824
  onSave: (e) => {
2826
- X(e);
2827
- let t = k.fields.names()?.find((e) => k.fields.get(e)?.primary);
2825
+ hn(e);
2826
+ let t = D.fields.names()?.find((e) => D.fields.get(e)?.primary);
2828
2827
  if (!t) return;
2829
2828
  let n = F(e[t]), r = {};
2830
- for (let t of k.fields.names()) {
2831
- let n = je(k, e, t), i = je(k, Y, t), a = Me(k, t, n), o = Me(k, t, i);
2829
+ for (let t of D.fields.names()) {
2830
+ let n = Fe(D, e, t), i = Fe(D, Z, t), a = Ie(D, t, n), o = Ie(D, t, i);
2832
2831
  (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (r[t] = a);
2833
2832
  }
2834
2833
  let i = Je({
2835
- entity: k,
2834
+ entity: D,
2836
2835
  formData: e,
2837
- record: Y,
2836
+ record: Z,
2838
2837
  isNew: !1
2839
2838
  });
2840
2839
  if (Object.keys(i).length > 0 && (r.$files = i), Object.keys(r).length === 0) return;
2841
- let a = Ge(i);
2842
- cn.mutate({
2840
+ let a = We(i);
2841
+ rn.mutate({
2843
2842
  pkValues: n,
2844
2843
  data: r
2845
2844
  }, { onSuccess: () => {
2846
- a.forEach((e) => te.markCommitted(e));
2845
+ a.forEach((e) => w.markCommitted(e));
2847
2846
  } });
2848
2847
  }
2849
2848
  })
@@ -2851,4 +2850,4 @@ function Mn({ screenCode: e }) {
2851
2850
  });
2852
2851
  }
2853
2852
  //#endregion
2854
- export { jn as SmartListPage, wn as t };
2853
+ export { An as SmartListPage, Sn as t };