@declarion/react 0.48.1 → 0.49.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 (84) hide show
  1. package/dist-lib/Check-DAfMbQIw.js +38 -0
  2. package/dist-lib/{DraggableChildrenTable-p2ZSdwzj.js → DraggableChildrenTable-B98Md-Yq.js} +30 -30
  3. package/dist-lib/{Grid-CjLFAKMZ.js → Grid-BdtEd4R9.js} +2 -2
  4. package/dist-lib/{LayoutRenderer-DCscqXsv.js → LayoutRenderer-oVU3nEb5.js} +600 -597
  5. package/dist-lib/ListCardsBody-DYMt1H8l.js +287 -0
  6. package/dist-lib/{MarkdownRenderer-Sb7zcvj0.js → MarkdownRenderer-E9hbyoUn.js} +1 -1
  7. package/dist-lib/RefreshControl-B_2eW53M.js +430 -0
  8. package/dist-lib/{SmartDetailPage.impl-BAW-Tx_H.js → SmartDetailPage.impl-Dg22HOxb.js} +520 -515
  9. package/dist-lib/SmartListPage.impl-CPhhXT5S.js +2849 -0
  10. package/dist-lib/{SmartRecordListPage.impl-DtSSlGrI.js → SmartRecordListPage.impl-CF0UKgUj.js} +243 -240
  11. package/dist-lib/SortHeaderMenu-DodGvb7A.js +106 -0
  12. package/dist-lib/action-dispatch-CYOw7nkP.js +1984 -0
  13. package/dist-lib/api/batch.d.ts +5 -2
  14. package/dist-lib/api/data.d.ts +35 -4
  15. package/dist-lib/api/entities.d.ts +3 -3
  16. package/dist-lib/cardProjection-D-AufCh-.js +757 -0
  17. package/dist-lib/components/{shared → actions}/ObjectActionBar.d.ts +1 -1
  18. package/dist-lib/components/{shared → actions}/ResponsiveActionBar.d.ts +1 -1
  19. package/dist-lib/components/fields/cells/factories/date.d.ts +2 -0
  20. package/dist-lib/components/file-widgets/upload.d.ts +6 -1
  21. package/dist-lib/components/layout/Layout.d.ts +1 -1
  22. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  23. package/dist-lib/components/pages/SmartListPage.d.ts +2 -12
  24. package/dist-lib/components/pages/SmartListPage.impl.d.ts +4 -0
  25. package/dist-lib/components/pages/list/ListCardRow.d.ts +40 -0
  26. package/dist-lib/components/pages/list/ListCardsBody.d.ts +34 -0
  27. package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
  28. package/dist-lib/components/pages/list/ListFooter.d.ts +26 -0
  29. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
  30. package/dist-lib/components/pages/list/ListNoRows.d.ts +32 -0
  31. package/dist-lib/components/pages/list/ListTable.d.ts +34 -0
  32. package/dist-lib/components/pages/list/ListTableRow.d.ts +18 -0
  33. package/dist-lib/components/pages/list/ListToolbar.d.ts +43 -0
  34. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +14 -0
  35. package/dist-lib/components/pages/list/page-size.d.ts +3 -0
  36. package/dist-lib/components/pages/list/sortable-header.d.ts +2 -0
  37. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +37 -0
  38. package/dist-lib/components/pages/list/useListQuery.d.ts +66 -0
  39. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +61 -0
  40. package/dist-lib/components/pages/list/useListSelection.d.ts +31 -0
  41. package/dist-lib/components/pages/list/useListSort.d.ts +45 -0
  42. package/dist-lib/components/pages/list/useListViews.d.ts +46 -0
  43. package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
  44. package/dist-lib/components/shared/RefreshControl.d.ts +17 -4
  45. package/dist-lib/field-classification-DTgUnbzd.js +1134 -0
  46. package/dist-lib/format-count-DAHCcHZO.js +1551 -0
  47. package/dist-lib/hooks/useBrandingChrome.d.ts +17 -1
  48. package/dist-lib/hooks/useText.d.ts +3 -0
  49. package/dist-lib/hooks/useViews.d.ts +1 -1
  50. package/dist-lib/index.d.ts +17 -15
  51. package/dist-lib/index.js +1783 -6287
  52. package/dist-lib/lib/messages.d.ts +7 -1
  53. package/dist-lib/lib/rowClickGesture.d.ts +12 -0
  54. package/dist-lib/lib/timestamp.d.ts +8 -3
  55. package/dist-lib/peekDraftStore-CnxqkoWN.js +194 -0
  56. package/dist-lib/record-documents-key-DEFlLxnF.js +27 -0
  57. package/dist-lib/registry-WypUQQ7t.js +1768 -0
  58. package/dist-lib/testing.d.ts +17 -2
  59. package/dist-lib/testing.js +72 -58
  60. package/dist-lib/types/api.d.ts +54 -12
  61. package/dist-lib/types/schema.d.ts +22 -6
  62. package/dist-lib/{useCurrentScreen-BshVTPVq.js → useCurrentScreen-C5Oio-1G.js} +1125 -1068
  63. package/dist-lib/useListQuery-Dc2vbxqs.js +87 -0
  64. package/dist-lib/useProperties-C36ENFdY.js +81 -0
  65. package/dist-lib/{useProperties-DrHFr0A1.js → useTabSearchMirror-sIuYEFaq.js} +116 -194
  66. package/dist-lib/{value-B1O6QikE.js → value-igT4LsqW.js} +69 -69
  67. package/package.json +1 -1
  68. package/dist-lib/RefreshControl-Cnl9nE0x.js +0 -945
  69. package/dist-lib/registry-CCxnZW2b.js +0 -5281
  70. /package/dist-lib/components/{shared → actions}/ActionButton.d.ts +0 -0
  71. /package/dist-lib/components/{shared → actions}/ActionDialog.d.ts +0 -0
  72. /package/dist-lib/components/{shared → actions}/ActionResultDialog.d.ts +0 -0
  73. /package/dist-lib/components/{shared → actions}/ActionRunner.d.ts +0 -0
  74. /package/dist-lib/components/{mass-edit → actions}/PropertyGridEditor.d.ts +0 -0
  75. /package/dist-lib/components/{shared → actions}/RowActionsKebab.d.ts +0 -0
  76. /package/dist-lib/components/{shared → chrome}/AssociationTabs.d.ts +0 -0
  77. /package/dist-lib/components/{shared → chrome}/AuditMetaStrip.d.ts +0 -0
  78. /package/dist-lib/components/{shared → chrome}/Breadcrumbs.d.ts +0 -0
  79. /package/dist-lib/components/{shared → chrome}/HighlightsStrip.d.ts +0 -0
  80. /package/dist-lib/components/{shared → chrome}/PageHeader.d.ts +0 -0
  81. /package/dist-lib/components/{shared → chrome}/RecordHeader.d.ts +0 -0
  82. /package/dist-lib/components/{shell → layout}/CommandPalette.d.ts +0 -0
  83. /package/dist-lib/components/{columns → list}/ColumnPicker.d.ts +0 -0
  84. /package/dist-lib/components/{views → list}/ViewSwitcher.d.ts +0 -0
@@ -1,20 +1,25 @@
1
1
  import { s as e, t } from "./DynamicIcon-Dc2j-rg_.js";
2
- import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, Dn as l, F as u, Fn as d, In as f, L as p, Ln as m, N as h, Q as g, Sn as _, Tn as v, Zn as y, _ as b, bn as x, bt as S, cr as C, dt as ee, gt as w, i as T, it as te, j as ne, jt as re, kn as ie, lr as ae, pt as oe, tr as se, un as ce, ur as E, wn as le, wt as D, xn as ue, yn as de } from "./useCurrentScreen-BshVTPVq.js";
3
- import { D as fe, H as O, R as k, T as pe, c as me, d as he, f as A, h as ge, n as j, o as _e, r as ve, t as ye, v as M, x as be, z as xe } from "./RefreshControl-Cnl9nE0x.js";
4
- import { $ as Se, A as Ce, D as we, H as Te, L as Ee, M as De, P as Oe, Q as ke, St as Ae, T as je, U as Me, X as Ne, Z as Pe, a as Fe, dt as Ie, et as Le, ft as Re, i as ze, k as Be, nt as Ve, s as He, tt as Ue, v as We, vt as Ge, z as Ke } from "./registry-CCxnZW2b.js";
5
- import { n as qe, r as Je, t as N } from "./dataTableStyles-vwD1mVOP.js";
6
- import { n as Ye, t as Xe } from "./LayoutRenderer-DCscqXsv.js";
7
- import { Fragment as Ze, useCallback as P, useEffect as F, useMemo as I, useRef as Qe, useState as L } from "react";
8
- import { useLocation as $e, useParams as et, useSearchParams as tt } from "react-router";
9
- import { useQuery as R, useQueryClient as nt } from "@tanstack/react-query";
10
- import { Fragment as rt, jsx as z, jsxs as B } from "react/jsx-runtime";
11
- //#region src/components/shared/AssociationTabs.tsx
12
- function it({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
- let a = I(() => Object.entries(r), [r]), [o, s] = L(0);
2
+ import { $ as n, $n as r, A as i, At as a, C as o, Cn as s, Ct as c, D as l, Dn as u, En as d, F as f, L as p, Ln as ee, N as m, Q as h, Rn as g, Sn as _, Tn as v, _ as y, bt as b, dr as x, dt as S, fr as C, gt as w, i as T, it as te, j as E, jn as D, jt as ne, kn as re, pt as ie, rr as ae, un as oe, ur as O, wn as se, wt as ce, xn as le, zn as k } from "./useCurrentScreen-C5Oio-1G.js";
3
+ import { _ as A, m as j, r as ue, s as M, t as de } from "./RefreshControl-B_2eW53M.js";
4
+ import { a as fe, f as N, i as pe } from "./registry-WypUQQ7t.js";
5
+ import { n as me, t as he } from "./record-documents-key-DEFlLxnF.js";
6
+ import { A as ge, C as _e, F as ve, O as ye, c as be, d as xe, f as Se, j as Ce, l as we, m as Te, p as Ee, y as De } from "./field-classification-DTgUnbzd.js";
7
+ import { c as Oe, f as ke, h as Ae, m as je, o as Me, p as Ne, r as Pe, t as Fe, u as Ie } from "./action-dispatch-CYOw7nkP.js";
8
+ import { d as Le, m as Re, p as ze, t as Be } from "./cardProjection-D-AufCh-.js";
9
+ import { n as Ve, r as He, t as Ue } from "./dataTableStyles-vwD1mVOP.js";
10
+ import { a as We, i as Ge, o as Ke, r as qe, s as P } from "./peekDraftStore-CnxqkoWN.js";
11
+ import { n as Je, t as Ye } from "./LayoutRenderer-oVU3nEb5.js";
12
+ import { Fragment as Xe, useCallback as F, useEffect as I, useMemo as L, useRef as Ze, useState as R } from "react";
13
+ import { useLocation as Qe, useParams as $e, useSearchParams as et } from "react-router";
14
+ import { useQuery as z, useQueryClient as tt } from "@tanstack/react-query";
15
+ import { Fragment as nt, jsx as B, jsxs as V } from "react/jsx-runtime";
16
+ //#region src/components/chrome/AssociationTabs.tsx
17
+ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
18
+ let a = L(() => Object.entries(r), [r]), [o, s] = R(0);
14
19
  if (a.length === 0) return null;
15
20
  let [c, l] = a[o];
16
- return /* @__PURE__ */ z(Ae, {
17
- title: /* @__PURE__ */ z("div", {
21
+ return /* @__PURE__ */ B(N, {
22
+ title: /* @__PURE__ */ B("div", {
18
23
  style: {
19
24
  display: "flex",
20
25
  alignItems: "center",
@@ -25,7 +30,7 @@ function it({ entityCode: e, recordId: n, associations: r, schema: i }) {
25
30
  },
26
31
  children: a.map(([e, n], r) => {
27
32
  let i = r === o;
28
- return /* @__PURE__ */ B("button", {
33
+ return /* @__PURE__ */ V("button", {
29
34
  onClick: (e) => {
30
35
  e.stopPropagation(), s(r);
31
36
  },
@@ -43,16 +48,16 @@ function it({ entityCode: e, recordId: n, associations: r, schema: i }) {
43
48
  cursor: "pointer",
44
49
  fontWeight: i ? 600 : 500
45
50
  },
46
- children: [n.display?.icon && /* @__PURE__ */ z(t, {
51
+ children: [n.display?.icon && /* @__PURE__ */ B(t, {
47
52
  name: n.display.icon,
48
53
  size: 13
49
- }), v(n.display?.name) || e]
54
+ }), u(n.display?.name) || e]
50
55
  }, e);
51
56
  })
52
57
  }),
53
58
  collapsible: !1,
54
59
  padding: "0",
55
- children: /* @__PURE__ */ z(V, {
60
+ children: /* @__PURE__ */ B(H, {
56
61
  entityCode: e,
57
62
  recordId: n,
58
63
  assocKey: c,
@@ -61,43 +66,43 @@ function it({ entityCode: e, recordId: n, associations: r, schema: i }) {
61
66
  })
62
67
  });
63
68
  }
64
- function V({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c }) {
65
- let l = Re(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } = R({
69
+ function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: s }) {
70
+ let l = Ce(), d = i(), f = `${t}.${r}`, { data: p, isLoading: ee } = z({
66
71
  queryKey: [
67
72
  "association",
68
- d,
73
+ f,
69
74
  n
70
75
  ],
71
- queryFn: () => D(d, [n])
72
- }), m = f?.target_entity ?? o.target, h = c.entities[m], g = I(() => f?.ids ?? [], [f?.ids]), y = I(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), b = I(() => g.slice(0, 50), [g]), { data: x, isLoading: S } = R({
76
+ queryFn: () => ce(f, [n])
77
+ }), m = p?.target_entity ?? a.target, h = s.entities[m], g = L(() => p?.ids ?? [], [p?.ids]), _ = L(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), v = L(() => g.slice(0, 50), [g]), { data: y, isLoading: b } = z({
73
78
  queryKey: [
74
79
  "association-records",
75
80
  m,
76
- b
81
+ v
77
82
  ],
78
- queryFn: () => s(m, {
83
+ queryFn: () => c(m, {
79
84
  per_page: 50,
80
85
  filters: [{
81
- field: y,
86
+ field: _,
82
87
  op: "in",
83
- value: b
88
+ value: v
84
89
  }]
85
90
  }),
86
- enabled: b.length > 0 && !!h
87
- }), C = x?.data ?? [], ee = x?.$refs, w = I(() => h ? h.fields.names().filter((e) => {
91
+ enabled: v.length > 0 && !!h
92
+ }), x = y?.data ?? [], S = y?.$refs, w = L(() => h ? h.fields.names().filter((e) => {
88
93
  let t = h.fields.get(e);
89
94
  return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
90
95
  }).slice(0, 6) : [], [h]), T = () => {
91
- let e = a(c, m);
96
+ let e = o(s, m);
92
97
  if (!e) return;
93
- let t = v(o.display?.name) || i, n = new URLSearchParams();
98
+ let t = u(a.display?.name) || r, n = new URLSearchParams();
94
99
  n.set("filters", JSON.stringify([{
95
- field: y,
100
+ field: _,
96
101
  op: "in",
97
102
  value: g
98
103
  }])), l(e.route, {
99
104
  title: t,
100
- icon: o.display?.icon || e.icon,
105
+ icon: a.display?.icon || e.icon,
101
106
  search: n.toString()
102
107
  });
103
108
  }, te = {
@@ -105,66 +110,66 @@ function V({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
105
110
  color: "var(--text-3)",
106
111
  padding: "14px 16px"
107
112
  };
108
- if (p || S) return /* @__PURE__ */ z("div", {
113
+ if (ee || b) return /* @__PURE__ */ B("div", {
109
114
  style: te,
110
115
  children: "Loading…"
111
116
  });
112
- if (!h) return /* @__PURE__ */ z("div", {
117
+ if (!h) return /* @__PURE__ */ B("div", {
113
118
  style: te,
114
119
  children: "Entity not found."
115
120
  });
116
- if (g.length === 0) return /* @__PURE__ */ z("div", {
121
+ if (g.length === 0) return /* @__PURE__ */ B("div", {
117
122
  style: te,
118
123
  children: "No related records."
119
124
  });
120
- let re = a(c, m);
121
- return /* @__PURE__ */ B("div", {
125
+ let D = o(s, m);
126
+ return /* @__PURE__ */ V("div", {
122
127
  style: { padding: "8px 0" },
123
128
  children: [
124
- /* @__PURE__ */ B("table", {
125
- style: Je,
126
- children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", { children: w.map((e) => /* @__PURE__ */ z("th", {
127
- style: qe,
128
- children: _(h.fields.get(e), e, c.entities)
129
- }, e)) }) }), /* @__PURE__ */ z("tbody", { children: C.map((e, t) => /* @__PURE__ */ z("tr", { children: w.map((t) => {
129
+ /* @__PURE__ */ V("table", {
130
+ style: He,
131
+ children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: w.map((e) => /* @__PURE__ */ B("th", {
132
+ style: Ve,
133
+ children: se(h.fields.get(e), e, s.entities)
134
+ }, e)) }) }), /* @__PURE__ */ B("tbody", { children: x.map((e, t) => /* @__PURE__ */ B("tr", { children: w.map((t) => {
130
135
  let n = h.fields.get(t);
131
- return n ? /* @__PURE__ */ z("td", {
132
- style: N,
133
- children: ne({
136
+ return n ? /* @__PURE__ */ B("td", {
137
+ style: Ue,
138
+ children: E({
134
139
  field: n,
135
140
  fieldName: t,
136
141
  value: e[t],
137
142
  mode: "display",
138
143
  record: e,
139
- refs: ee,
140
- locale: u
144
+ refs: S,
145
+ locale: d
141
146
  })
142
- }, t) : /* @__PURE__ */ z("td", {}, t);
147
+ }, t) : /* @__PURE__ */ B("td", {}, t);
143
148
  }) }, t)) })]
144
149
  }),
145
- re && f && f.count > C.length && /* @__PURE__ */ z("div", {
150
+ D && p && p.count > x.length && /* @__PURE__ */ B("div", {
146
151
  style: {
147
152
  padding: "10px 16px",
148
153
  textAlign: "center"
149
154
  },
150
- children: /* @__PURE__ */ B(E, {
151
- icon: /* @__PURE__ */ z(e.external, { size: 12 }),
155
+ children: /* @__PURE__ */ V(C, {
156
+ icon: /* @__PURE__ */ B(e.external, { size: 12 }),
152
157
  onClick: T,
153
158
  children: [
154
159
  "View all ",
155
- f.count,
160
+ p.count,
156
161
  " records"
157
162
  ]
158
163
  })
159
164
  }),
160
- re && C.length > 0 && f && f.count <= C.length && /* @__PURE__ */ z("div", {
165
+ D && x.length > 0 && p && p.count <= x.length && /* @__PURE__ */ B("div", {
161
166
  style: {
162
167
  padding: "10px 16px",
163
168
  textAlign: "center"
164
169
  },
165
- children: /* @__PURE__ */ z(E, {
170
+ children: /* @__PURE__ */ B(C, {
166
171
  kind: "ghost",
167
- icon: /* @__PURE__ */ z(e.external, { size: 12 }),
172
+ icon: /* @__PURE__ */ B(e.external, { size: 12 }),
168
173
  onClick: T,
169
174
  children: "Open in list view"
170
175
  })
@@ -174,47 +179,47 @@ function V({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
174
179
  }
175
180
  //#endregion
176
181
  //#region src/components/pages/RecordDocumentsPanel.tsx
177
- var H = 4e3;
182
+ var it = 4e3;
178
183
  function U(e) {
179
- return e?.some((e) => e.status === "pending") ? H : !1;
184
+ return e?.some((e) => e.status === "pending") ? it : !1;
180
185
  }
181
186
  function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
182
- let { data: a, isLoading: o, error: s } = R({
187
+ let { data: a, isLoading: o, error: s } = z({
183
188
  queryKey: [
184
- M,
189
+ he,
185
190
  t,
186
191
  n
187
192
  ],
188
- queryFn: async () => (await S("document.object_links", {
193
+ queryFn: async () => (await b("document.object_links", {
189
194
  entity: t,
190
195
  object_id: n
191
196
  })).result?.documents ?? [],
192
197
  enabled: !!(t && n) && (!!r || !!i),
193
198
  refetchInterval: (e) => U(e.state.data)
194
199
  }), c = (a?.length ?? 0) > 0;
195
- return !r && !c ? null : /* @__PURE__ */ B(Ae, {
196
- title: /* @__PURE__ */ z(ot, {}),
200
+ return !r && !c ? null : /* @__PURE__ */ V(N, {
201
+ title: /* @__PURE__ */ B(ot, {}),
197
202
  collapsible: !1,
198
203
  padding: "0",
199
204
  children: [
200
- o && /* @__PURE__ */ z(G, {
201
- icon: /* @__PURE__ */ z(e.loader, { size: 14 }),
205
+ o && /* @__PURE__ */ B(G, {
206
+ icon: /* @__PURE__ */ B(e.loader, { size: 14 }),
202
207
  text: "Loading documents..."
203
208
  }),
204
- s && /* @__PURE__ */ z(G, {
205
- icon: /* @__PURE__ */ z(e.warning, { size: 14 }),
209
+ s && /* @__PURE__ */ B(G, {
210
+ icon: /* @__PURE__ */ B(e.warning, { size: 14 }),
206
211
  text: s instanceof Error ? s.message : String(s)
207
212
  }),
208
- !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ z(G, {
209
- icon: /* @__PURE__ */ z(e.file, { size: 14 }),
213
+ !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ B(G, {
214
+ icon: /* @__PURE__ */ B(e.file, { size: 14 }),
210
215
  text: "No generated documents"
211
216
  }),
212
- !o && !s && a && a.length > 0 && /* @__PURE__ */ z("div", {
217
+ !o && !s && a && a.length > 0 && /* @__PURE__ */ B("div", {
213
218
  style: {
214
219
  display: "flex",
215
220
  flexDirection: "column"
216
221
  },
217
- children: a.map((e) => /* @__PURE__ */ z(W, {
222
+ children: a.map((e) => /* @__PURE__ */ B(W, {
218
223
  entityCode: t,
219
224
  objectId: n,
220
225
  doc: e
@@ -224,7 +229,7 @@ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
224
229
  });
225
230
  }
226
231
  function ot() {
227
- return /* @__PURE__ */ B("div", {
232
+ return /* @__PURE__ */ V("div", {
228
233
  style: {
229
234
  display: "flex",
230
235
  alignItems: "center",
@@ -235,57 +240,57 @@ function ot() {
235
240
  fontWeight: 600,
236
241
  color: "var(--text)"
237
242
  },
238
- children: [/* @__PURE__ */ z(e.file, { size: 13 }), "Documents"]
243
+ children: [/* @__PURE__ */ B(e.file, { size: 13 }), "Documents"]
239
244
  });
240
245
  }
241
246
  function W({ entityCode: t, objectId: r, doc: i }) {
242
- let a = nt(), [o, s] = L(!1), [c, l] = L(!1), [u, d] = L(!1), [f, p] = L(!1), [m, h] = L(null), _ = v(i.title) || i.filename || i.template_code, y = i.status === "ready" && i.download_url && !f;
243
- async function b() {
244
- s(!0), h(null);
247
+ let a = tt(), [o, s] = R(!1), [c, l] = R(!1), [d, f] = R(!1), [p, ee] = R(!1), [m, g] = R(null), _ = u(i.title) || i.filename || i.template_code, v = i.status === "ready" && i.download_url && !p;
248
+ async function y() {
249
+ s(!0), g(null);
245
250
  try {
246
- let e = (await S("document.download_format", {
251
+ let e = (await b("document.download_format", {
247
252
  generated_document_id: i.generated_document_id,
248
253
  format: "pdf"
249
254
  })).result;
250
- e?.download_url && await g(e.download_url, e.filename);
255
+ e?.download_url && await h(e.download_url, e.filename);
251
256
  } catch (e) {
252
- n(e) ? (p(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
257
+ n(e) ? (ee(!0), g("Artifact unavailable")) : g(e instanceof Error ? e.message : String(e));
253
258
  } finally {
254
259
  s(!1);
255
260
  }
256
261
  }
257
262
  async function x() {
258
263
  if (i.download_url) {
259
- l(!0), h(null);
264
+ l(!0), g(null);
260
265
  try {
261
- await g(i.download_url, i.filename);
266
+ await h(i.download_url, i.filename);
262
267
  } catch (e) {
263
- n(e) ? (p(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
268
+ n(e) ? (ee(!0), g("Artifact unavailable")) : g(e instanceof Error ? e.message : String(e));
264
269
  } finally {
265
270
  l(!1);
266
271
  }
267
272
  }
268
273
  }
269
- async function C() {
270
- d(!0), h(null);
274
+ async function S() {
275
+ f(!0), g(null);
271
276
  try {
272
- await S("document.generate", {
277
+ await b("document.generate", {
273
278
  ...i.input ?? {},
274
279
  template_code: i.template_code,
275
280
  template_source: i.template_source,
276
281
  output_format: i.output_format
277
282
  }), await a.invalidateQueries({ queryKey: [
278
- M,
283
+ he,
279
284
  t,
280
285
  r
281
286
  ] });
282
287
  } catch (e) {
283
- h(e instanceof Error ? e.message : String(e));
288
+ g(e instanceof Error ? e.message : String(e));
284
289
  } finally {
285
- d(!1);
290
+ f(!1);
286
291
  }
287
292
  }
288
- return /* @__PURE__ */ B("div", {
293
+ return /* @__PURE__ */ V("div", {
289
294
  style: {
290
295
  display: "grid",
291
296
  gridTemplateColumns: "minmax(0, 1fr) auto",
@@ -294,10 +299,10 @@ function W({ entityCode: t, objectId: r, doc: i }) {
294
299
  padding: "11px 14px",
295
300
  borderTop: "1px solid var(--divider)"
296
301
  },
297
- children: [/* @__PURE__ */ B("div", {
302
+ children: [/* @__PURE__ */ V("div", {
298
303
  style: { minWidth: 0 },
299
304
  children: [
300
- /* @__PURE__ */ z("div", {
305
+ /* @__PURE__ */ B("div", {
301
306
  style: {
302
307
  fontSize: 13,
303
308
  fontWeight: 600,
@@ -308,7 +313,7 @@ function W({ entityCode: t, objectId: r, doc: i }) {
308
313
  },
309
314
  children: _
310
315
  }),
311
- /* @__PURE__ */ B("div", {
316
+ /* @__PURE__ */ V("div", {
312
317
  style: {
313
318
  marginTop: 3,
314
319
  display: "flex",
@@ -318,12 +323,12 @@ function W({ entityCode: t, objectId: r, doc: i }) {
318
323
  fontSize: 11.5
319
324
  },
320
325
  children: [
321
- /* @__PURE__ */ z("span", { children: i.output_format.toUpperCase() }),
322
- /* @__PURE__ */ z("span", { children: f ? "artifact unavailable" : i.status }),
323
- /* @__PURE__ */ z("span", { children: i.ready_at || i.created_at })
326
+ /* @__PURE__ */ B("span", { children: i.output_format.toUpperCase() }),
327
+ /* @__PURE__ */ B("span", { children: p ? "artifact unavailable" : i.status }),
328
+ /* @__PURE__ */ B("span", { children: i.ready_at || i.created_at })
324
329
  ]
325
330
  }),
326
- i.status === "failed" && i.error_text && /* @__PURE__ */ z("div", {
331
+ i.status === "failed" && i.error_text && /* @__PURE__ */ B("div", {
327
332
  style: {
328
333
  marginTop: 5,
329
334
  color: "var(--danger)",
@@ -331,7 +336,7 @@ function W({ entityCode: t, objectId: r, doc: i }) {
331
336
  },
332
337
  children: i.error_text
333
338
  }),
334
- m && /* @__PURE__ */ z("div", {
339
+ m && /* @__PURE__ */ B("div", {
335
340
  style: {
336
341
  marginTop: 5,
337
342
  color: "var(--danger)",
@@ -340,34 +345,34 @@ function W({ entityCode: t, objectId: r, doc: i }) {
340
345
  children: m
341
346
  })
342
347
  ]
343
- }), y ? /* @__PURE__ */ B("div", {
348
+ }), v ? /* @__PURE__ */ V("div", {
344
349
  style: {
345
350
  display: "flex",
346
351
  gap: 6
347
352
  },
348
- children: [/* @__PURE__ */ z(E, {
353
+ children: [/* @__PURE__ */ B(C, {
349
354
  kind: "ghost",
350
355
  size: "sm",
351
- icon: z(o ? e.loader : e.file, { size: 12 }),
352
- onClick: b,
356
+ icon: B(o ? e.loader : e.file, { size: 12 }),
357
+ onClick: y,
353
358
  disabled: o,
354
359
  children: "PDF"
355
- }), /* @__PURE__ */ z(E, {
360
+ }), /* @__PURE__ */ B(C, {
356
361
  kind: "default",
357
362
  size: "sm",
358
- icon: z(c ? e.loader : e.download, { size: 12 }),
363
+ icon: B(c ? e.loader : e.download, { size: 12 }),
359
364
  onClick: x,
360
365
  disabled: c,
361
366
  children: "Download"
362
367
  })]
363
- }) : f ? /* @__PURE__ */ z(E, {
368
+ }) : p ? /* @__PURE__ */ B(C, {
364
369
  kind: "ghost",
365
370
  size: "sm",
366
- icon: z(u ? e.loader : e.file, { size: 12 }),
367
- onClick: C,
368
- disabled: u,
371
+ icon: B(d ? e.loader : e.file, { size: 12 }),
372
+ onClick: S,
373
+ disabled: d,
369
374
  children: "Regenerate"
370
- }) : /* @__PURE__ */ z(E, {
375
+ }) : /* @__PURE__ */ B(C, {
371
376
  kind: "ghost",
372
377
  size: "sm",
373
378
  disabled: !0,
@@ -376,7 +381,7 @@ function W({ entityCode: t, objectId: r, doc: i }) {
376
381
  });
377
382
  }
378
383
  function G({ icon: e, text: t }) {
379
- return /* @__PURE__ */ B("div", {
384
+ return /* @__PURE__ */ V("div", {
380
385
  style: {
381
386
  display: "flex",
382
387
  alignItems: "center",
@@ -393,7 +398,7 @@ function G({ icon: e, text: t }) {
393
398
  function st({ errors: t, onJump: n }) {
394
399
  if (t.length === 0) return null;
395
400
  let r = t.length !== 1;
396
- return /* @__PURE__ */ B("div", {
401
+ return /* @__PURE__ */ V("div", {
397
402
  role: "alert",
398
403
  style: {
399
404
  display: "flex",
@@ -405,19 +410,19 @@ function st({ errors: t, onJump: n }) {
405
410
  border: "1px solid var(--danger-border)",
406
411
  color: "var(--text)"
407
412
  },
408
- children: [/* @__PURE__ */ z("span", {
413
+ children: [/* @__PURE__ */ B("span", {
409
414
  style: {
410
415
  color: "var(--danger)",
411
416
  marginTop: 1,
412
417
  display: "flex"
413
418
  },
414
- children: /* @__PURE__ */ z(e.warning, { size: 14 })
415
- }), /* @__PURE__ */ B("div", {
419
+ children: /* @__PURE__ */ B(e.warning, { size: 14 })
420
+ }), /* @__PURE__ */ V("div", {
416
421
  style: {
417
422
  flex: 1,
418
423
  minWidth: 0
419
424
  },
420
- children: [/* @__PURE__ */ B("div", {
425
+ children: [/* @__PURE__ */ V("div", {
421
426
  style: {
422
427
  fontSize: 12.5,
423
428
  fontWeight: 600,
@@ -429,7 +434,7 @@ function st({ errors: t, onJump: n }) {
429
434
  r ? "fields need" : "field needs",
430
435
  " attention"
431
436
  ]
432
- }), /* @__PURE__ */ z("ul", {
437
+ }), /* @__PURE__ */ B("ul", {
433
438
  style: {
434
439
  margin: 0,
435
440
  padding: 0,
@@ -438,7 +443,7 @@ function st({ errors: t, onJump: n }) {
438
443
  flexDirection: "column",
439
444
  gap: 2
440
445
  },
441
- children: t.map((e) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {
446
+ children: t.map((e) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V("button", {
442
447
  type: "button",
443
448
  onClick: n ? () => n(e.name) : void 0,
444
449
  style: {
@@ -451,21 +456,21 @@ function st({ errors: t, onJump: n }) {
451
456
  fontFamily: "inherit"
452
457
  },
453
458
  children: [
454
- /* @__PURE__ */ z("span", {
459
+ /* @__PURE__ */ B("span", {
455
460
  style: {
456
461
  color: "var(--danger)",
457
462
  marginRight: 6
458
463
  },
459
464
  children: "•"
460
465
  }),
461
- /* @__PURE__ */ z("span", {
466
+ /* @__PURE__ */ B("span", {
462
467
  style: {
463
468
  fontWeight: 500,
464
469
  color: "var(--text-2)"
465
470
  },
466
471
  children: e.label
467
472
  }),
468
- /* @__PURE__ */ B("span", {
473
+ /* @__PURE__ */ V("span", {
469
474
  style: { color: "var(--text-3)" },
470
475
  children: [" - ", e.message]
471
476
  })
@@ -476,9 +481,9 @@ function st({ errors: t, onJump: n }) {
476
481
  });
477
482
  }
478
483
  //#endregion
479
- //#region src/components/shared/HighlightsStrip.tsx
484
+ //#region src/components/chrome/HighlightsStrip.tsx
480
485
  function ct({ items: e }) {
481
- return e.length === 0 ? null : /* @__PURE__ */ z("div", {
486
+ return e.length === 0 ? null : /* @__PURE__ */ B("div", {
482
487
  style: {
483
488
  display: "flex",
484
489
  alignItems: "center",
@@ -486,25 +491,25 @@ function ct({ items: e }) {
486
491
  gap: "6px 0",
487
492
  fontSize: 12
488
493
  },
489
- children: e.map((e, t) => /* @__PURE__ */ B(Ze, { children: [t > 0 && /* @__PURE__ */ z("span", { style: {
494
+ children: e.map((e, t) => /* @__PURE__ */ V(Xe, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
490
495
  width: 1,
491
496
  height: 12,
492
497
  background: "var(--divider)",
493
498
  marginInline: 12
494
- } }), /* @__PURE__ */ B("span", {
499
+ } }), /* @__PURE__ */ V("span", {
495
500
  style: {
496
501
  display: "inline-flex",
497
502
  alignItems: "center",
498
503
  gap: 6,
499
504
  lineHeight: 1.3
500
505
  },
501
- children: [/* @__PURE__ */ z("span", {
506
+ children: [/* @__PURE__ */ B("span", {
502
507
  style: {
503
508
  color: "var(--text-3)",
504
509
  fontSize: 11.5
505
510
  },
506
511
  children: e.label
507
- }), /* @__PURE__ */ z("span", {
512
+ }), /* @__PURE__ */ B("span", {
508
513
  style: { color: "var(--text)" },
509
514
  children: e.value
510
515
  })]
@@ -522,12 +527,12 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
522
527
  if (c) {
523
528
  let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
524
529
  l.push({
525
- label: v(c.name),
526
- value: n ? /* @__PURE__ */ z(C, {
530
+ label: u(c.name),
531
+ value: n ? /* @__PURE__ */ B(O, {
527
532
  tone: n.color ?? "slate",
528
533
  size: "xs",
529
- children: v(n.name)
530
- }) : /* @__PURE__ */ z("span", {
534
+ children: u(n.name)
535
+ }) : /* @__PURE__ */ B("span", {
531
536
  style: { color: "var(--text-4)" },
532
537
  children: "—"
533
538
  })
@@ -535,7 +540,7 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
535
540
  continue;
536
541
  }
537
542
  if (t.fields.get(e) || t.files?.get(e)) {
538
- let a = Le({
543
+ let a = Ne({
539
544
  entity: t,
540
545
  entityCode: n,
541
546
  fieldName: e,
@@ -548,22 +553,22 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
548
553
  locale: s
549
554
  });
550
555
  l.push({
551
- label: Ue(t, e, o.entities),
556
+ label: je(t, e, o.entities),
552
557
  value: a
553
558
  });
554
559
  continue;
555
560
  }
556
561
  }
557
- return l.length === 0 ? null : /* @__PURE__ */ z(ct, { items: l });
562
+ return l.length === 0 ? null : /* @__PURE__ */ B(ct, { items: l });
558
563
  }
559
564
  //#endregion
560
- //#region src/components/shared/AuditMetaStrip.tsx
565
+ //#region src/components/chrome/AuditMetaStrip.tsx
561
566
  function ut(e) {
562
567
  return e.by != null || e.at != null;
563
568
  }
564
569
  function dt({ lines: e }) {
565
570
  let t = e.filter(ut);
566
- return t.length === 0 ? null : /* @__PURE__ */ z("div", {
571
+ return t.length === 0 ? null : /* @__PURE__ */ B("div", {
567
572
  style: {
568
573
  display: "flex",
569
574
  flexWrap: "wrap",
@@ -575,18 +580,18 @@ function dt({ lines: e }) {
575
580
  fontSize: 11.5,
576
581
  color: "var(--text-3)"
577
582
  },
578
- children: t.map((e, t) => /* @__PURE__ */ z(K, { line: e }, t))
583
+ children: t.map((e, t) => /* @__PURE__ */ B(K, { line: e }, t))
579
584
  });
580
585
  }
581
586
  function K({ line: e }) {
582
- return /* @__PURE__ */ B("div", {
587
+ return /* @__PURE__ */ V("div", {
583
588
  style: {
584
589
  display: "flex",
585
590
  alignItems: "center",
586
591
  gap: 8,
587
592
  minWidth: 0
588
593
  },
589
- children: [/* @__PURE__ */ z("span", {
594
+ children: [/* @__PURE__ */ B("span", {
590
595
  style: {
591
596
  fontSize: 11,
592
597
  fontWeight: 600,
@@ -594,7 +599,7 @@ function K({ line: e }) {
594
599
  flexShrink: 0
595
600
  },
596
601
  children: e.label
597
- }), /* @__PURE__ */ B("span", {
602
+ }), /* @__PURE__ */ V("span", {
598
603
  style: {
599
604
  display: "inline-flex",
600
605
  alignItems: "center",
@@ -602,15 +607,15 @@ function K({ line: e }) {
602
607
  minWidth: 0
603
608
  },
604
609
  children: [
605
- e.by != null && /* @__PURE__ */ z("span", {
610
+ e.by != null && /* @__PURE__ */ B("span", {
606
611
  style: { color: "var(--text-2)" },
607
612
  children: e.by
608
613
  }),
609
- e.by != null && e.at != null && /* @__PURE__ */ z("span", {
614
+ e.by != null && e.at != null && /* @__PURE__ */ B("span", {
610
615
  style: { color: "var(--text-4)" },
611
616
  children: "·"
612
617
  }),
613
- e.at != null && /* @__PURE__ */ z("span", {
618
+ e.at != null && /* @__PURE__ */ B("span", {
614
619
  className: "num",
615
620
  children: e.at
616
621
  })
@@ -626,7 +631,7 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
626
631
  let c = (e) => {
627
632
  if (!e || !t.fields.get(e)) return;
628
633
  let s = r[e];
629
- if (s != null && s !== "") return Le({
634
+ if (s != null && s !== "") return Ne({
630
635
  entity: t,
631
636
  entityCode: n,
632
637
  fieldName: e,
@@ -639,7 +644,7 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
639
644
  locale: o
640
645
  });
641
646
  }, l = s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
642
- label: v(e.label),
647
+ label: u(e.label),
643
648
  at: c(e.at),
644
649
  by: c(e.by)
645
650
  })) : [{
@@ -651,7 +656,7 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
651
656
  at: c("updated_at"),
652
657
  by: c("updated_by")
653
658
  }];
654
- return /* @__PURE__ */ z(dt, { lines: l });
659
+ return /* @__PURE__ */ B(dt, { lines: l });
655
660
  }
656
661
  //#endregion
657
662
  //#region src/components/detail-layout/EvidenceBlock.tsx
@@ -662,13 +667,13 @@ function pt(e) {
662
667
  }
663
668
  function mt({ evidence: e }) {
664
669
  let t = e?.verdict ?? "unverified", n = pt(e?.verified_at), r = [];
665
- return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ B("div", {
670
+ return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ V("div", {
666
671
  style: {
667
672
  display: "flex",
668
673
  flexDirection: "column",
669
674
  gap: 6
670
675
  },
671
- children: [/* @__PURE__ */ B("div", {
676
+ children: [/* @__PURE__ */ V("div", {
672
677
  style: {
673
678
  display: "flex",
674
679
  alignItems: "center",
@@ -676,7 +681,7 @@ function mt({ evidence: e }) {
676
681
  flexWrap: "wrap"
677
682
  },
678
683
  children: [
679
- /* @__PURE__ */ z("span", {
684
+ /* @__PURE__ */ B("span", {
680
685
  style: {
681
686
  fontSize: 12,
682
687
  fontWeight: 600,
@@ -684,13 +689,13 @@ function mt({ evidence: e }) {
684
689
  },
685
690
  children: "Evidence"
686
691
  }),
687
- /* @__PURE__ */ z(C, {
688
- tone: ve(t),
692
+ /* @__PURE__ */ B(O, {
693
+ tone: We(t),
689
694
  size: "sm",
690
695
  dot: !0,
691
- children: j(t)
696
+ children: Ge(t)
692
697
  }),
693
- r.length > 0 && /* @__PURE__ */ z("span", {
698
+ r.length > 0 && /* @__PURE__ */ B("span", {
694
699
  style: {
695
700
  fontSize: 12,
696
701
  color: "var(--muted-foreground)"
@@ -698,7 +703,7 @@ function mt({ evidence: e }) {
698
703
  children: r.join(" · ")
699
704
  })
700
705
  ]
701
- }), e?.reason && /* @__PURE__ */ z("span", {
706
+ }), e?.reason && /* @__PURE__ */ B("span", {
702
707
  style: {
703
708
  fontSize: 12,
704
709
  color: "var(--destructive)"
@@ -708,10 +713,10 @@ function mt({ evidence: e }) {
708
713
  });
709
714
  }
710
715
  //#endregion
711
- //#region src/components/shared/RecordHeader.tsx
716
+ //#region src/components/chrome/RecordHeader.tsx
712
717
  var ht = 180, gt = 160;
713
718
  function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: l = !1, onBack: u, right: d, identityControls: f, showTitle: p = !0 }) {
714
- return /* @__PURE__ */ B("div", {
719
+ return /* @__PURE__ */ V("div", {
715
720
  style: {
716
721
  display: "flex",
717
722
  alignItems: "flex-start",
@@ -720,27 +725,27 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
720
725
  minWidth: 0
721
726
  },
722
727
  children: [
723
- p && l && /* @__PURE__ */ z("div", {
728
+ p && l && /* @__PURE__ */ B("div", {
724
729
  style: {
725
730
  paddingTop: 4,
726
731
  flexShrink: 0
727
732
  },
728
- children: /* @__PURE__ */ z(ae, {
733
+ children: /* @__PURE__ */ B(x, {
729
734
  size: 26,
730
- icon: /* @__PURE__ */ z(e.back, { size: 14 }),
735
+ icon: /* @__PURE__ */ B(e.back, { size: 14 }),
731
736
  title: "Back",
732
737
  onClick: u
733
738
  })
734
739
  }),
735
- p && (n || t) && /* @__PURE__ */ z("div", {
740
+ p && (n || t) && /* @__PURE__ */ B("div", {
736
741
  style: {
737
742
  flexShrink: 0,
738
743
  paddingTop: 2
739
744
  },
740
- children: n ? /* @__PURE__ */ z(O, {
745
+ children: n ? /* @__PURE__ */ B(A, {
741
746
  name: n,
742
747
  size: 32
743
- }) : /* @__PURE__ */ z("span", {
748
+ }) : /* @__PURE__ */ B("span", {
744
749
  style: {
745
750
  width: 32,
746
751
  height: 32,
@@ -754,8 +759,8 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
754
759
  children: t
755
760
  })
756
761
  }),
757
- p && /* @__PURE__ */ B(rt, { children: [
758
- /* @__PURE__ */ z("h1", {
762
+ p && /* @__PURE__ */ V(nt, { children: [
763
+ /* @__PURE__ */ B("h1", {
759
764
  style: {
760
765
  margin: 0,
761
766
  fontSize: "var(--page-title-size, var(--page-title-size-detail))",
@@ -775,13 +780,13 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
775
780
  },
776
781
  children: r
777
782
  }),
778
- i && /* @__PURE__ */ z(k, { value: i }),
779
- a && /* @__PURE__ */ z(xe, {
783
+ i && /* @__PURE__ */ B(me, { value: i }),
784
+ a && /* @__PURE__ */ B(j, {
780
785
  label: a,
781
786
  "data-testid": "detail-description-info"
782
787
  }),
783
788
  f,
784
- s === "edit" && c && /* @__PURE__ */ B("span", {
789
+ s === "edit" && c && /* @__PURE__ */ V("span", {
785
790
  style: {
786
791
  display: "inline-flex",
787
792
  alignItems: "center",
@@ -789,21 +794,21 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
789
794
  fontSize: 11,
790
795
  color: "var(--warn)"
791
796
  },
792
- children: [/* @__PURE__ */ z("span", { style: {
797
+ children: [/* @__PURE__ */ B("span", { style: {
793
798
  width: 6,
794
799
  height: 6,
795
800
  borderRadius: 999,
796
801
  background: "var(--warn)"
797
802
  } }), "Unsaved"]
798
803
  }),
799
- s === "create" && /* @__PURE__ */ z(C, {
804
+ s === "create" && /* @__PURE__ */ B(O, {
800
805
  tone: "violet",
801
806
  size: "xs",
802
807
  dot: !0,
803
808
  children: "New record"
804
809
  })
805
810
  ] }),
806
- d && /* @__PURE__ */ z("div", {
811
+ d && /* @__PURE__ */ B("div", {
807
812
  role: "toolbar",
808
813
  "aria-label": "Page actions",
809
814
  style: {
@@ -820,7 +825,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
820
825
  },
821
826
  children: d
822
827
  }),
823
- o && s === "display" && /* @__PURE__ */ z("div", {
828
+ o && s === "display" && /* @__PURE__ */ B("div", {
824
829
  style: {
825
830
  flexBasis: "100%",
826
831
  minWidth: 0
@@ -889,46 +894,46 @@ function Ct(e, t) {
889
894
  }
890
895
  function wt(e, t) {
891
896
  if (e) {
892
- let n = ue(e, t), r = ie(n);
897
+ let n = s(e, t), r = D(n);
893
898
  if (r.replace(/^\|+|\|+$/g, "")) return r;
894
899
  }
895
- return t.id == null ? crypto.randomUUID() : m(t.id);
900
+ return t.id == null ? crypto.randomUUID() : k(t.id);
896
901
  }
897
902
  function Tt({ screenCode: e }) {
898
- return /* @__PURE__ */ z(h, { children: /* @__PURE__ */ z(Et, { screenCode: e }) });
903
+ return /* @__PURE__ */ B(m, { children: /* @__PURE__ */ B(Et, { screenCode: e }) });
899
904
  }
900
905
  function Et({ screenCode: t }) {
901
- let { id: n } = et(), a = te(), [s, c] = tt(), { data: m } = i(), h = re((e) => e.user), g = u(), y = se(), b = m?.screens[t], S = b?.entity ? m?.entities[b.entity] : void 0, C = b?.entity, w = x(S, "create"), T = x(S, "update"), ne = x(S, "restore"), E = (() => {
902
- if (!S || !S.singleton || !S.prefilter) return;
903
- let e = le(S);
906
+ let { id: n } = $e(), r = te(), [o, c] = et(), { data: l } = a(), m = ne((e) => e.user), h = f(), y = ae(), b = l?.screens[t], C = b?.entity ? l?.entities[b.entity] : void 0, w = b?.entity, T = _(C, "create"), E = _(C, "update"), O = _(C, "restore"), ce = (() => {
907
+ if (!C || !C.singleton || !C.prefilter) return;
908
+ let e = d(C);
904
909
  if (e.length !== 1) return;
905
- let t = S.prefilter[e[0]];
906
- if (t === "$caller.user_id") return h?.id;
907
- if (t === "$caller.tenant_id") return h?.tenant?.id;
908
- })(), D = E !== void 0, O = D ? E : n, k = !D && O === "new", A = I(() => {
909
- if (!O || k) return;
910
- if (!S) return O;
911
- let e = le(S);
912
- if (e.length === 1) return { [e[0]]: O };
913
- let t = l(O, e.length);
910
+ let t = C.prefilter[e[0]];
911
+ if (t === "$caller.user_id") return m?.id;
912
+ if (t === "$caller.tenant_id") return m?.tenant?.id;
913
+ })(), k = ce !== void 0, A = k ? ce : n, j = !k && A === "new", M = L(() => {
914
+ if (!A || j) return;
915
+ if (!C) return A;
916
+ let e = d(C);
917
+ if (e.length === 1) return { [e[0]]: A };
918
+ let t = re(A, e.length);
914
919
  if (!t) return;
915
920
  let n = {};
916
921
  for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
917
922
  return n;
918
923
  }, [
919
- O,
920
- k,
921
- S
922
- ]), ge = I(() => {
923
- if (A) return typeof A == "string" ? A : ie(A);
924
- }, [A]), j = Fe(C, A), { data: ve, isLoading: ye, error: M } = j, xe = Me((e) => e.degradedEntities), Ee = C ? Te(S?.realtime, xe, C) : !1;
925
- be(ze(C, A), !k);
926
- let De = we(C ?? ""), Ae = Ce(C ?? ""), Le = Be(C ?? ""), Re = Object.keys(S?.status_groups ?? {}).length > 0, Ue = ve?.data, Ke = Ue?.$statuses, qe = Ue?.$properties, Je = s.get("edit") === "true", [N, Ze] = L(k || Je), [R, nt] = L({}), [V, H] = L({}), [U, ot] = L({}), [W, G] = L(void 0), [ct, ut] = L(!1), [dt, K] = L(void 0), [pt, ht] = L(!1), gt = k ? w : T, q = N && gt, vt = oe();
927
- ee(q && !k, vt.enabled);
928
- let [bt, Tt] = L(() => {
924
+ A,
925
+ j,
926
+ C
927
+ ]), de = L(() => {
928
+ if (M) return typeof M == "string" ? M : D(M);
929
+ }, [M]), N = fe(w, M), { data: me, isLoading: he, error: Ce } = N, Oe = Te((e) => e.degradedEntities), je = w ? Ee(C?.realtime, Oe, w) : !1;
930
+ De(pe(w, M), !j);
931
+ let Me = we(w ?? ""), Ne = Se(w ?? ""), Fe = xe(w ?? ""), Ve = Object.keys(C?.status_groups ?? {}).length > 0, He = me?.data, Ue = He?.$statuses, We = He?.$properties, Ge = o.get("edit") === "true", [P, Xe] = R(j || Ge), [z, tt] = R({}), [H, it] = R({}), [U, ot] = R({}), [W, G] = R(void 0), [ct, ut] = R(!1), [dt, K] = R(void 0), [pt, ht] = R(!1), gt = j ? T : E, q = P && gt, vt = ie();
932
+ S(q && !j, vt.enabled);
933
+ let [bt, Tt] = R(() => {
929
934
  let e = parseInt(b?.sidebar_width || "380", 10);
930
935
  return isNaN(e) ? 380 : e;
931
- }), Et = Qe(null), J = Qe(null), Ot = P((e) => {
936
+ }), Et = Ze(null), J = Ze(null), Ot = F((e) => {
932
937
  e.preventDefault();
933
938
  let t = Et.current;
934
939
  if (!t) return;
@@ -945,80 +950,80 @@ function Et({ screenCode: t }) {
945
950
  J.current && t && Tt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
946
951
  };
947
952
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
948
- }, []), Y = ve?.data, X = Oe(S, b, Y ?? {});
949
- F(() => {
953
+ }, []), Y = me?.data, X = Pe(C, b, Y ?? {});
954
+ I(() => {
950
955
  let e = parseInt(X?.sidebar_width || "380", 10);
951
956
  Tt(Number.isNaN(e) ? 380 : e);
952
957
  }, [X?.sidebar_width]);
953
- let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, At = Y?.$refs, jt = Qe(Z);
954
- F(() => {
958
+ let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, At = Y?.$refs, jt = Ze(Z);
959
+ I(() => {
955
960
  if (!Z) return;
956
961
  let e = jt.current;
957
- jt.current = Z, e && e !== Z && N && ut(!0);
958
- }, [N, Z]);
959
- let Mt = !!S?.soft_delete && Y != null && Y[S.soft_delete] != null, Nt = $e(), Pt = Qe(null);
960
- me({ scrollElementRef: Pt });
961
- let Ft = !k && M instanceof ce && M.status === 404, It = k && !de(S), Lt = Qe(null);
962
- F(() => {
962
+ jt.current = Z, e && e !== Z && P && ut(!0);
963
+ }, [P, Z]);
964
+ let Mt = !!C?.soft_delete && Y != null && Y[C.soft_delete] != null, Nt = Qe(), Pt = Ze(null);
965
+ ue({ scrollElementRef: Pt });
966
+ let Ft = !j && Ce instanceof oe && Ce.status === 404, It = j && !le(C), Lt = Ze(null);
967
+ I(() => {
963
968
  if (!Ft) return;
964
- let e = pe(Nt);
965
- Lt.current !== e && (Lt.current = e, fe.getState().kill(e));
969
+ let e = _e(Nt);
970
+ Lt.current !== e && (Lt.current = e, ge.getState().kill(e));
966
971
  }, [Ft, Nt]);
967
- let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = Ge();
968
- F(() => {
969
- if (!S || D || vt.enabled) return;
970
- let e = Nt.pathname, t = v(X?.display?.name) || v(S.display.name), n = X?.display?.icon || S.display.icon;
972
+ let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = ve();
973
+ I(() => {
974
+ if (!C || k || vt.enabled) return;
975
+ let e = Nt.pathname, t = u(X?.display?.name) || u(C.display.name), n = X?.display?.icon || C.display.icon;
971
976
  Bt(e) || Rt({
972
977
  pathname: e,
973
978
  search: "",
974
- title: k ? `New ${t}` : t,
979
+ title: j ? `New ${t}` : t,
975
980
  icon: n,
976
981
  closable: !0
977
982
  });
978
983
  }, [
979
984
  Nt.pathname,
980
985
  X?.display?.name?.en,
981
- S?.display.name?.en,
986
+ C?.display.name?.en,
982
987
  X?.display?.icon,
983
- S?.display.icon,
988
+ C?.display.icon,
989
+ j,
984
990
  k,
985
- D,
986
991
  vt.enabled
987
- ]), F(() => {
988
- if (!Y || !S || D || vt.enabled) return;
992
+ ]), I(() => {
993
+ if (!Y || !C || k || vt.enabled) return;
989
994
  let e = Bt(Nt.pathname);
990
995
  if (e) {
991
- let t = v(X?.display?.name) || v(S.display.name), n = o(Y, S), r = n && !String(n).startsWith("/") ? String(n) : t;
996
+ let t = u(X?.display?.name) || u(C.display.name), n = v(Y, C), r = n && !String(n).startsWith("/") ? String(n) : t;
992
997
  zt(e.id, r);
993
998
  }
994
999
  }, [
995
1000
  Y,
996
- S?.display.name?.en,
997
- S?.display.display_field,
1001
+ C?.display.name?.en,
1002
+ C?.display.display_field,
998
1003
  Nt.pathname,
999
- D,
1004
+ k,
1000
1005
  vt.enabled
1001
1006
  ]);
1002
- let Vt = I(() => {
1003
- if (!S || !gt) return /* @__PURE__ */ new Set();
1007
+ let Vt = L(() => {
1008
+ if (!C || !gt) return /* @__PURE__ */ new Set();
1004
1009
  let e = /* @__PURE__ */ new Set();
1005
- for (let [t, n] of S.fields) !n.auto && !n.primary && e.add(t);
1006
- for (let [t] of S.files ?? []) e.add(t);
1010
+ for (let [t, n] of C.fields) !n.auto && !n.primary && e.add(t);
1011
+ for (let [t] of C.files ?? []) e.add(t);
1007
1012
  return e;
1008
- }, [S, gt]);
1009
- F(() => {
1010
- if (!(!Je || !Y || !S || !T)) {
1011
- if (N || Ze(!0), Object.keys(R).length === 0) {
1012
- let e = O ? _e(O) : null;
1013
+ }, [C, gt]);
1014
+ I(() => {
1015
+ if (!(!Ge || !Y || !C || !E)) {
1016
+ if (P || Xe(!0), Object.keys(z).length === 0) {
1017
+ let e = A ? qe(A) : null;
1013
1018
  if (e) {
1014
- let t = Ne({
1015
- entity: S,
1019
+ let t = ze({
1020
+ entity: C,
1016
1021
  formData: e,
1017
1022
  record: void 0,
1018
1023
  isNew: !0
1019
1024
  });
1020
- Pe(t).forEach((e) => {
1021
- g.registerDraft({
1025
+ Re(t).forEach((e) => {
1026
+ h.registerDraft({
1022
1027
  fileId: e,
1023
1028
  discard: () => p(e)
1024
1029
  });
@@ -1031,16 +1036,16 @@ function Et({ screenCode: t }) {
1031
1036
  t[n] = r;
1032
1037
  return;
1033
1038
  }
1034
- let i = Se(S, Y, n);
1035
- t[n] = ke(S, n) ? i ?? null : i ?? "";
1036
- }), nt(t);
1039
+ let i = ke(C, Y, n);
1040
+ t[n] = Ie(C, n) ? i ?? null : i ?? "";
1041
+ }), tt(t);
1037
1042
  }
1038
- if (S.children !== void 0 && S.children.length > 0 && W === void 0) {
1043
+ if (C.children !== void 0 && C.children.length > 0 && W === void 0) {
1039
1044
  let e = Y.$children;
1040
1045
  if (e && Object.keys(e).length > 0) {
1041
1046
  let t = {};
1042
1047
  for (let [n, r] of Object.entries(e)) {
1043
- let e = m?.entities[n];
1048
+ let e = l?.entities[n];
1044
1049
  t[n] = r.map((t) => ({
1045
1050
  ...t,
1046
1051
  _key: wt(e, t)
@@ -1055,84 +1060,84 @@ function Et({ screenCode: t }) {
1055
1060
  }, { replace: !0 });
1056
1061
  }
1057
1062
  }, [
1058
- Je,
1063
+ Ge,
1059
1064
  Y,
1060
1065
  Vt,
1061
- T,
1062
- S,
1066
+ E,
1067
+ C,
1063
1068
  W,
1064
- m
1065
- ]), F(() => {
1066
- !k || !w || !S?.children || S.children.length === 0 || W === void 0 && (G({}), K({}));
1069
+ l
1070
+ ]), I(() => {
1071
+ !j || !T || !C?.children || C.children.length === 0 || W === void 0 && (G({}), K({}));
1067
1072
  }, [
1068
- k,
1069
- w,
1070
- S?.children
1073
+ j,
1074
+ T,
1075
+ C?.children
1071
1076
  ]);
1072
- let Ht = P(async () => {
1073
- if (await g.flushAllDrafts(), k) {
1077
+ let Ht = F(async () => {
1078
+ if (await h.flushAllDrafts(), j) {
1074
1079
  let e = X?.route?.replace("/:id", "") ?? "/";
1075
- a(e);
1076
- } else Ze(!1), nt({}), H({}), ot({}), G(void 0), K(void 0), ht(!1);
1080
+ r(e);
1081
+ } else Xe(!1), tt({}), it({}), ot({}), G(void 0), K(void 0), ht(!1);
1077
1082
  }, [
1078
- g,
1079
- k,
1083
+ h,
1084
+ j,
1080
1085
  X,
1081
- a
1082
- ]), Ut = P((e, t) => {
1083
- nt((n) => ({
1086
+ r
1087
+ ]), Ut = F((e, t) => {
1088
+ tt((n) => ({
1084
1089
  ...n,
1085
1090
  [e]: t
1086
1091
  }));
1087
- }, []), Q = I(() => {
1092
+ }, []), Q = L(() => {
1088
1093
  if (!X?.route) return "/";
1089
1094
  let e = X.route.split("/");
1090
1095
  return e.pop(), e.join("/") || "/";
1091
- }, [X]), Wt = I(() => !m?.screens || !Q || Q === "/" ? !1 : Object.values(m.screens).some((e) => e.route === Q), [m, Q]), Gt = P(() => {
1096
+ }, [X]), Wt = L(() => !l?.screens || !Q || Q === "/" ? !1 : Object.values(l.screens).some((e) => e.route === Q), [l, Q]), Gt = F(() => {
1092
1097
  if (!Wt) {
1093
- a("/");
1098
+ r("/");
1094
1099
  return;
1095
1100
  }
1096
1101
  let e = Bt(Q)?.search ?? "";
1097
- a(e ? `${Q}?${e}` : Q);
1102
+ r(e ? `${Q}?${e}` : Q);
1098
1103
  }, [
1099
1104
  Wt,
1100
1105
  Q,
1101
1106
  Bt,
1102
- a
1103
- ]), Kt = We({ fallback: Gt }), qt = !D && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = r(), Yt = I(() => {
1104
- if (!S) return {};
1107
+ r
1108
+ ]), Kt = be({ fallback: Gt }), qt = !k && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = i(), Yt = L(() => {
1109
+ if (!C) return {};
1105
1110
  let e = {};
1106
- for (let t of _t(S, R, k)) Vt.has(t) && (e[t] = "Required");
1107
- for (let t of yt(S, R)) Vt.has(t) && (e[t] = "Invalid email address");
1111
+ for (let t of _t(C, z, j)) Vt.has(t) && (e[t] = "Required");
1112
+ for (let t of yt(C, z)) Vt.has(t) && (e[t] = "Invalid email address");
1108
1113
  return e;
1109
1114
  }, [
1110
- S,
1111
- R,
1112
- k,
1115
+ C,
1116
+ z,
1117
+ j,
1113
1118
  Vt
1114
- ]), Xt = Object.keys(Yt).length > 0, Zt = P(() => {
1115
- if (!C || !S || k && !w || !k && !T || (ht(!0), Xt)) return;
1116
- let e = {}, t = Ne({
1117
- entity: S,
1118
- formData: R,
1119
+ ]), Xt = Object.keys(Yt).length > 0, Zt = F(() => {
1120
+ if (!w || !C || j && !T || !j && !E || (ht(!0), Xt)) return;
1121
+ let e = {}, t = ze({
1122
+ entity: C,
1123
+ formData: z,
1119
1124
  record: Y,
1120
- isNew: k
1121
- }), n = Pe(t);
1122
- if (k) for (let [t, n] of Object.entries(R)) {
1123
- if (S.files?.has(t)) continue;
1124
- let r = Ve(S, t, n);
1125
+ isNew: j
1126
+ }), n = Re(t);
1127
+ if (j) for (let [t, n] of Object.entries(z)) {
1128
+ if (C.files?.has(t)) continue;
1129
+ let r = Ae(C, t, n);
1125
1130
  r !== "" && r != null && (e[t] = r);
1126
1131
  }
1127
1132
  else {
1128
- for (let [t, n] of Object.entries(R)) {
1129
- if (S.files?.has(t)) continue;
1130
- let r = Y ? Se(S, Y, t) : void 0, i = Ve(S, t, n), a = Ve(S, t, r);
1133
+ for (let [t, n] of Object.entries(z)) {
1134
+ if (C.files?.has(t)) continue;
1135
+ let r = Y ? ke(C, Y, t) : void 0, i = Ae(C, t, n), a = Ae(C, t, r);
1131
1136
  (i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
1132
1137
  }
1133
1138
  Z && (e.$row_version = Z);
1134
1139
  }
1135
- if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(V).length > 0 && (e.$statuses = Object.entries(V).map(([e, t]) => ({
1140
+ if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(H).length > 0 && (e.$statuses = Object.entries(H).map(([e, t]) => ({
1136
1141
  status_group_code: e,
1137
1142
  status_code: t
1138
1143
  }))), Object.keys(U).length > 0 && (e.$properties = Object.entries(U).map(([e, t]) => ({
@@ -1145,81 +1150,81 @@ function Et({ screenCode: t }) {
1145
1150
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
1146
1151
  return i;
1147
1152
  }), i = dt?.[e] ?? [];
1148
- (k || !Ct(r, i)) && (t[e] = r);
1153
+ (j || !Ct(r, i)) && (t[e] = r);
1149
1154
  }
1150
1155
  Object.keys(t).length > 0 && (e.$children = t);
1151
1156
  }
1152
- if (!k && Object.keys(e).length === 0) {
1153
- Ze(!1), H({}), ot({}), G(void 0), K(void 0), ht(!1);
1157
+ if (!j && Object.keys(e).length === 0) {
1158
+ Xe(!1), it({}), ot({}), G(void 0), K(void 0), ht(!1);
1154
1159
  return;
1155
1160
  }
1156
- let r = () => {
1157
- Ze(!1), ut(!1), ht(!1), H({}), ot({}), G(void 0), K(void 0);
1161
+ let i = () => {
1162
+ Xe(!1), ut(!1), ht(!1), it({}), ot({}), G(void 0), K(void 0);
1158
1163
  };
1159
- k ? De.mutate(e, { onSuccess: (e) => {
1160
- n.forEach((e) => g.markCommitted(e));
1161
- let t = e.data, i = S ? ue(S, t) : {}, o = ie(i);
1162
- a(o ? `${Q}/${encodeURIComponent(o)}` : Q, { replace: !0 }), r();
1163
- } }) : A && Ae.mutate({
1164
- pkValues: A,
1164
+ j ? Me.mutate(e, { onSuccess: (e) => {
1165
+ n.forEach((e) => h.markCommitted(e));
1166
+ let t = e.data, a = C ? s(C, t) : {}, o = D(a);
1167
+ r(o ? `${Q}/${encodeURIComponent(o)}` : Q, { replace: !0 }), i();
1168
+ } }) : M && Ne.mutate({
1169
+ pkValues: M,
1165
1170
  data: e
1166
1171
  }, {
1167
1172
  onSuccess: () => {
1168
- n.forEach((e) => g.markCommitted(e)), r();
1173
+ n.forEach((e) => h.markCommitted(e)), i();
1169
1174
  },
1170
1175
  onError: (e) => {
1171
- e instanceof ce && e.code === "STALE_OBJECT" && ut(!0);
1176
+ e instanceof oe && e.code === "entity.stale_object" && ut(!0);
1172
1177
  }
1173
1178
  });
1174
1179
  }, [
1175
- g,
1176
- k,
1177
- w,
1180
+ h,
1181
+ j,
1178
1182
  T,
1179
- C,
1180
- R,
1183
+ E,
1184
+ w,
1185
+ z,
1181
1186
  Xt,
1182
- V,
1187
+ H,
1183
1188
  U,
1184
1189
  W,
1185
1190
  dt,
1186
- De,
1187
- Ae,
1188
- S,
1189
- a,
1191
+ Me,
1192
+ Ne,
1193
+ C,
1194
+ r,
1190
1195
  Q,
1191
1196
  Y,
1192
1197
  Z,
1193
- A
1194
- ]), Qt = P((e, t) => {
1198
+ M
1199
+ ]), Qt = F((e, t) => {
1195
1200
  G((n) => ({
1196
1201
  ...n ?? {},
1197
1202
  [e]: t
1198
1203
  }));
1199
- }, []), $t = P(() => {
1200
- !A || k || !ne || Le.mutate(A);
1204
+ }, []), $t = F(() => {
1205
+ !M || j || !O || Fe.mutate(M);
1201
1206
  }, [
1202
- A,
1203
- k,
1204
- ne,
1205
- Le
1206
- ]), en = I(() => xt(W, m), [W, m]), tn = Object.keys(en).length > 0;
1207
- if (!X || !S) return null;
1208
- if (!k && ye) return /* @__PURE__ */ z(je, {});
1209
- if (It) return /* @__PURE__ */ B("div", {
1207
+ M,
1208
+ j,
1209
+ O,
1210
+ Fe
1211
+ ]), en = L(() => xt(W, l), [W, l]), tn = Object.keys(en).length > 0;
1212
+ if (!X || !C) return null;
1213
+ if (!j && he) return /* @__PURE__ */ B(Le, {});
1214
+ if (It) return /* @__PURE__ */ V("div", {
1210
1215
  style: { padding: 24 },
1211
- children: [/* @__PURE__ */ B("div", {
1216
+ children: [/* @__PURE__ */ V("div", {
1212
1217
  style: {
1213
1218
  display: "flex",
1214
1219
  alignItems: "center",
1215
1220
  gap: 8,
1216
1221
  marginBottom: 8
1217
1222
  },
1218
- children: [qt && /* @__PURE__ */ z(ae, {
1219
- icon: /* @__PURE__ */ z(e.back, { size: 14 }),
1223
+ children: [qt && /* @__PURE__ */ B(x, {
1224
+ icon: /* @__PURE__ */ B(e.back, { size: 14 }),
1220
1225
  onClick: Kt.goBack,
1221
1226
  title: "Back"
1222
- }), /* @__PURE__ */ z("h1", {
1227
+ }), /* @__PURE__ */ B("h1", {
1223
1228
  style: {
1224
1229
  margin: 0,
1225
1230
  fontSize: 18,
@@ -1228,25 +1233,25 @@ function Et({ screenCode: t }) {
1228
1233
  },
1229
1234
  children: "Not Available"
1230
1235
  })]
1231
- }), /* @__PURE__ */ z("p", {
1236
+ }), /* @__PURE__ */ B("p", {
1232
1237
  style: { color: "var(--text-3)" },
1233
1238
  children: "This record type is not created from a form."
1234
1239
  })]
1235
1240
  });
1236
- if (!k && !Y || Ft) return /* @__PURE__ */ B("div", {
1241
+ if (!j && !Y || Ft) return /* @__PURE__ */ V("div", {
1237
1242
  style: { padding: 24 },
1238
- children: [/* @__PURE__ */ B("div", {
1243
+ children: [/* @__PURE__ */ V("div", {
1239
1244
  style: {
1240
1245
  display: "flex",
1241
1246
  alignItems: "center",
1242
1247
  gap: 8,
1243
1248
  marginBottom: 8
1244
1249
  },
1245
- children: [qt && /* @__PURE__ */ z(ae, {
1246
- icon: /* @__PURE__ */ z(e.back, { size: 14 }),
1250
+ children: [qt && /* @__PURE__ */ B(x, {
1251
+ icon: /* @__PURE__ */ B(e.back, { size: 14 }),
1247
1252
  onClick: Kt.goBack,
1248
1253
  title: "Back"
1249
- }), /* @__PURE__ */ z("h1", {
1254
+ }), /* @__PURE__ */ B("h1", {
1250
1255
  style: {
1251
1256
  margin: 0,
1252
1257
  fontSize: 18,
@@ -1255,29 +1260,29 @@ function Et({ screenCode: t }) {
1255
1260
  },
1256
1261
  children: "Not Found"
1257
1262
  })]
1258
- }), /* @__PURE__ */ z("p", {
1263
+ }), /* @__PURE__ */ B("p", {
1259
1264
  style: { color: "var(--text-3)" },
1260
1265
  children: "Record not found."
1261
1266
  })]
1262
1267
  });
1263
- let nn = S.display, rn = v(X.display?.name) || v(nn.name), an = o(Y, S), on = k ? `New ${rn}` : an ? String(an) : rn, sn = De.isPending || Ae.isPending, cn = X.responsive?.[y.category]?.layout, ln = cn?.tabs ?? (y.isPhone ? "sections" : void 0), un = cn?.header_card === !0 ? He({
1264
- entity: S,
1268
+ let nn = C.display, rn = u(X.display?.name) || u(nn.name), an = v(Y, C), on = j ? `New ${rn}` : an ? String(an) : rn, sn = Me.isPending || Ne.isPending, cn = X.responsive?.[y.category]?.layout, ln = cn?.tabs ?? (y.isPhone ? "sections" : void 0), un = cn?.header_card === !0 ? Be({
1269
+ entity: C,
1265
1270
  screen: X
1266
1271
  }) : void 0, $ = {
1267
- schema: m,
1268
- entity: S,
1269
- entityCode: C,
1270
- recordId: ge ?? O ?? "",
1272
+ schema: l,
1273
+ entity: C,
1274
+ entityCode: w,
1275
+ recordId: de ?? A ?? "",
1271
1276
  record: q ? {
1272
1277
  ...Y ?? {},
1273
- ...R
1278
+ ...z
1274
1279
  } : Y ?? {},
1275
- isNew: k,
1280
+ isNew: j,
1276
1281
  mode: q ? "edit" : "display",
1277
1282
  onFieldChange: q ? Ut : void 0,
1278
1283
  refs: At,
1279
1284
  objectProperties: (() => {
1280
- let e = qe ?? [];
1285
+ let e = We ?? [];
1281
1286
  if (!q || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
1282
1287
  let t = e.map((e) => U[e.property_code] === void 0 ? e : {
1283
1288
  ...e,
@@ -1291,27 +1296,27 @@ function Et({ screenCode: t }) {
1291
1296
  });
1292
1297
  return t;
1293
1298
  })(),
1294
- onSetProperty: k || !T ? void 0 : q ? (e, t) => ot((n) => ({
1299
+ onSetProperty: j || !E ? void 0 : q ? (e, t) => ot((n) => ({
1295
1300
  ...n,
1296
1301
  [e]: t
1297
1302
  })) : void 0,
1298
1303
  isPropertyPending: !1,
1299
1304
  objectStatuses: (() => {
1300
- let e = Ke ?? [];
1301
- if (!q || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
1302
- let t = e.map((e) => V[e.group_code] === void 0 ? e : {
1305
+ let e = Ue ?? [];
1306
+ if (!q || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
1307
+ let t = e.map((e) => H[e.group_code] === void 0 ? e : {
1303
1308
  ...e,
1304
- status_code: V[e.group_code]
1309
+ status_code: H[e.group_code]
1305
1310
  });
1306
- for (let [n, r] of Object.entries(V)) e.some((e) => e.group_code === n) || t.push({
1311
+ for (let [n, r] of Object.entries(H)) e.some((e) => e.group_code === n) || t.push({
1307
1312
  group_code: n,
1308
1313
  status_code: r,
1309
1314
  status_name: {},
1310
- set_at: f()
1315
+ set_at: g()
1311
1316
  });
1312
1317
  return t;
1313
1318
  })(),
1314
- onSetStatus: k || !T ? void 0 : q ? (e, t) => H((n) => ({
1319
+ onSetStatus: j || !E ? void 0 : q ? (e, t) => it((n) => ({
1315
1320
  ...n,
1316
1321
  [e]: t
1317
1322
  })) : void 0,
@@ -1322,32 +1327,32 @@ function Et({ screenCode: t }) {
1322
1327
  fieldErrors: q && pt ? Yt : void 0,
1323
1328
  detailTabsPresentation: ln,
1324
1329
  relatedRecordsPresentation: cn?.related_records
1325
- }, dn = !!X.sidebar && X.sidebar.length > 0, fn = cn?.sidebar === "hidden", pn = dn && !fn && !y.isDesktop, mn = dn && !fn && y.isDesktop, hn = !k && Y ? /* @__PURE__ */ z(lt, {
1330
+ }, dn = !!X.sidebar && X.sidebar.length > 0, fn = cn?.sidebar === "hidden", pn = dn && !fn && !y.isDesktop, mn = dn && !fn && y.isDesktop, hn = !j && Y ? /* @__PURE__ */ B(lt, {
1326
1331
  screen: X,
1327
- entity: S,
1328
- entityCode: C,
1332
+ entity: C,
1333
+ entityCode: w,
1329
1334
  record: Y,
1330
1335
  refs: At,
1331
- objectStatuses: Ke,
1332
- schema: m,
1336
+ objectStatuses: Ue,
1337
+ schema: l,
1333
1338
  locale: Jt
1334
- }) : void 0, gn = /* @__PURE__ */ z(kt, {
1339
+ }) : void 0, gn = /* @__PURE__ */ B(kt, {
1335
1340
  title: on,
1336
- recordId: O,
1341
+ recordId: A,
1337
1342
  editing: q,
1338
- isNew: k,
1343
+ isNew: j,
1339
1344
  isRecordDeleted: Mt,
1340
- dirty: N,
1345
+ dirty: P,
1341
1346
  isSaving: sn,
1342
1347
  hasChildErrors: tn,
1343
1348
  hasFieldErrors: pt && Xt,
1344
- canRestore: ne,
1345
- entity: S,
1349
+ canRestore: O,
1350
+ entity: C,
1346
1351
  screen: X,
1347
- globalActions: m?.actions,
1348
- entityCode: C,
1352
+ globalActions: l?.actions,
1353
+ entityCode: w,
1349
1354
  record: Y,
1350
- id: O,
1355
+ id: A,
1351
1356
  listRoute: Q,
1352
1357
  listRouteExists: !!Wt,
1353
1358
  highlights: hn,
@@ -1356,16 +1361,16 @@ function Et({ screenCode: t }) {
1356
1361
  onCancelEdit: Ht,
1357
1362
  onSave: Zt,
1358
1363
  onRestore: $t,
1359
- isRestoring: Le.isPending,
1364
+ isRestoring: Fe.isPending,
1360
1365
  refreshControl: {
1361
- refetch: j.refetch,
1362
- isFetching: j.isFetching,
1363
- isLoading: j.isLoading,
1364
- isLive: Ee
1366
+ refetch: N.refetch,
1367
+ isFetching: N.isFetching,
1368
+ isLoading: N.isLoading,
1369
+ isLive: je
1365
1370
  },
1366
- isRealtimeEntity: S?.realtime === !0,
1367
- canManageTemplates: he(m)
1368
- }), _n = Mt && /* @__PURE__ */ B("div", {
1371
+ isRealtimeEntity: C?.realtime === !0,
1372
+ canManageTemplates: Ke(l)
1373
+ }), _n = Mt && /* @__PURE__ */ V("div", {
1369
1374
  style: {
1370
1375
  display: "flex",
1371
1376
  alignItems: "center",
@@ -1378,8 +1383,8 @@ function Et({ screenCode: t }) {
1378
1383
  color: "var(--danger)",
1379
1384
  fontSize: 12.5
1380
1385
  },
1381
- children: [/* @__PURE__ */ z(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: ["This record was deleted on ", d(String(Y[S.soft_delete]))] })]
1382
- }), vn = ct && /* @__PURE__ */ B("div", {
1386
+ children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ", ee(String(Y[C.soft_delete]))] })]
1387
+ }), vn = ct && /* @__PURE__ */ V("div", {
1383
1388
  style: {
1384
1389
  display: "flex",
1385
1390
  alignItems: "center",
@@ -1392,73 +1397,73 @@ function Et({ screenCode: t }) {
1392
1397
  color: "var(--warn)",
1393
1398
  fontSize: 12.5
1394
1399
  },
1395
- children: [/* @__PURE__ */ z(e.warning, { size: 14 }), /* @__PURE__ */ z("span", { children: "This record changed on the server while you were viewing or editing it." })]
1396
- }), yn = q && pt && Xt && /* @__PURE__ */ z(st, {
1400
+ children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: "This record changed on the server while you were viewing or editing it." })]
1401
+ }), yn = q && pt && Xt && /* @__PURE__ */ B(st, {
1397
1402
  errors: Object.entries(Yt).map(([e, t]) => {
1398
- let n = S.fields.get(e);
1403
+ let n = C.fields.get(e);
1399
1404
  return {
1400
1405
  name: e,
1401
- label: n ? _(n, e, m?.entities) : e,
1406
+ label: n ? se(n, e, l?.entities) : e,
1402
1407
  message: t
1403
1408
  };
1404
1409
  }),
1405
1410
  onJump: (e) => {
1406
- let t = document.getElementById(`${C}-${e}`);
1411
+ let t = document.getElementById(`${w}-${e}`);
1407
1412
  t && (t.scrollIntoView({
1408
1413
  block: "center",
1409
1414
  behavior: "smooth"
1410
1415
  }), t.focus?.());
1411
1416
  }
1412
- }), bn = Re && !k && !(X.items && X.items.length > 0) && /* @__PURE__ */ z("div", {
1417
+ }), bn = Ve && !j && !(X.items && X.items.length > 0) && /* @__PURE__ */ B("div", {
1413
1418
  className: "mb-4",
1414
- children: /* @__PURE__ */ z(Ye, {
1415
- statusGroups: S.status_groups ?? {},
1419
+ children: /* @__PURE__ */ B(Je, {
1420
+ statusGroups: C.status_groups ?? {},
1416
1421
  objectStatuses: $.objectStatuses,
1417
- onSetStatus: T && q ? (e, t) => H((n) => ({
1422
+ onSetStatus: E && q ? (e, t) => it((n) => ({
1418
1423
  ...n,
1419
1424
  [e]: t
1420
1425
  })) : St,
1421
1426
  isPending: !1,
1422
1427
  mode: q ? "edit" : "display"
1423
1428
  })
1424
- }), xn = S.evidence_covered && !k && Y && /* @__PURE__ */ z("div", {
1429
+ }), xn = C.evidence_covered && !j && Y && /* @__PURE__ */ B("div", {
1425
1430
  className: "mb-4",
1426
- children: /* @__PURE__ */ z(mt, { evidence: Y.$evidence })
1427
- }), Sn = /* @__PURE__ */ B(rt, { children: [
1428
- un && (Y || k) && /* @__PURE__ */ z(Dt, {
1431
+ children: /* @__PURE__ */ B(mt, { evidence: Y.$evidence })
1432
+ }), Sn = /* @__PURE__ */ V(nt, { children: [
1433
+ un && (Y || j) && /* @__PURE__ */ B(Dt, {
1429
1434
  card: un,
1430
- entity: S,
1435
+ entity: C,
1431
1436
  record: $.record,
1432
1437
  objectStatuses: $.objectStatuses,
1433
1438
  objectProperties: $.objectProperties
1434
1439
  }),
1435
- X.items && X.items.length > 0 && (Y || k) && m && /* @__PURE__ */ z(Xe, {
1440
+ X.items && X.items.length > 0 && (Y || j) && l && /* @__PURE__ */ B(Ye, {
1436
1441
  nodes: X.items,
1437
1442
  ctx: $
1438
1443
  }),
1439
- !k && O && C && S.associations && Object.keys(S.associations).length > 0 && m && /* @__PURE__ */ z(it, {
1440
- entityCode: C,
1441
- recordId: ge ?? O ?? "",
1442
- associations: S.associations,
1443
- schema: m
1444
+ !j && A && w && C.associations && Object.keys(C.associations).length > 0 && l && /* @__PURE__ */ B(rt, {
1445
+ entityCode: w,
1446
+ recordId: de ?? A ?? "",
1447
+ associations: C.associations,
1448
+ schema: l
1444
1449
  }),
1445
- !k && O && C && /* @__PURE__ */ z(at, {
1446
- entityCode: C,
1447
- objectId: ge ?? O,
1448
- canGenerateOne: !!S?.documents?.generate_one,
1449
- canManageTemplates: he(m)
1450
+ !j && A && w && /* @__PURE__ */ B(at, {
1451
+ entityCode: w,
1452
+ objectId: de ?? A,
1453
+ canGenerateOne: !!C?.documents?.generate_one,
1454
+ canManageTemplates: Ke(l)
1450
1455
  }),
1451
- !k && Y && m && /* @__PURE__ */ z(ft, {
1456
+ !j && Y && l && /* @__PURE__ */ B(ft, {
1452
1457
  screen: X,
1453
- entity: S,
1454
- entityCode: C,
1458
+ entity: C,
1459
+ entityCode: w,
1455
1460
  record: Y,
1456
1461
  refs: At,
1457
- schema: m,
1462
+ schema: l,
1458
1463
  locale: Jt
1459
1464
  })
1460
1465
  ] });
1461
- if (mn) return /* @__PURE__ */ B("div", {
1466
+ if (mn) return /* @__PURE__ */ V("div", {
1462
1467
  style: {
1463
1468
  height: "100%",
1464
1469
  display: "flex",
@@ -1466,7 +1471,7 @@ function Et({ screenCode: t }) {
1466
1471
  background: "var(--background)"
1467
1472
  },
1468
1473
  children: [
1469
- /* @__PURE__ */ B("div", {
1474
+ /* @__PURE__ */ V("div", {
1470
1475
  style: {
1471
1476
  flex: 1,
1472
1477
  minWidth: 0,
@@ -1474,7 +1479,7 @@ function Et({ screenCode: t }) {
1474
1479
  flexDirection: "column",
1475
1480
  height: "100%"
1476
1481
  },
1477
- children: [/* @__PURE__ */ B("div", {
1482
+ children: [/* @__PURE__ */ V("div", {
1478
1483
  style: {
1479
1484
  flexShrink: 0,
1480
1485
  padding: "14px 20px 8px"
@@ -1487,7 +1492,7 @@ function Et({ screenCode: t }) {
1487
1492
  bn,
1488
1493
  xn
1489
1494
  ]
1490
- }), /* @__PURE__ */ z("div", {
1495
+ }), /* @__PURE__ */ B("div", {
1491
1496
  ref: Pt,
1492
1497
  style: {
1493
1498
  flex: 1,
@@ -1501,11 +1506,11 @@ function Et({ screenCode: t }) {
1501
1506
  children: Sn
1502
1507
  })]
1503
1508
  }),
1504
- /* @__PURE__ */ z("div", {
1509
+ /* @__PURE__ */ B("div", {
1505
1510
  className: "detail-resize-handle",
1506
1511
  onMouseDown: Ot,
1507
1512
  title: "Drag to resize",
1508
- children: /* @__PURE__ */ z("div", { style: {
1513
+ children: /* @__PURE__ */ B("div", { style: {
1509
1514
  position: "absolute",
1510
1515
  top: 0,
1511
1516
  bottom: 0,
@@ -1515,25 +1520,25 @@ function Et({ screenCode: t }) {
1515
1520
  background: "var(--border)"
1516
1521
  } })
1517
1522
  }),
1518
- /* @__PURE__ */ z("div", {
1523
+ /* @__PURE__ */ B("div", {
1519
1524
  ref: Et,
1520
1525
  style: {
1521
1526
  flexShrink: 0,
1522
1527
  height: "100%",
1523
1528
  width: `${bt}px`
1524
1529
  },
1525
- children: (Y || k) && m && /* @__PURE__ */ z(Xe, {
1530
+ children: (Y || j) && l && /* @__PURE__ */ B(Ye, {
1526
1531
  nodes: X.sidebar,
1527
1532
  ctx: $
1528
1533
  })
1529
1534
  })
1530
1535
  ]
1531
1536
  });
1532
- let Cn = y.isPhone ? Ie(12) : {
1537
+ let Cn = y.isPhone ? ye(12) : {
1533
1538
  paddingLeft: "24px",
1534
1539
  paddingRight: "24px"
1535
1540
  };
1536
- return /* @__PURE__ */ B("div", {
1541
+ return /* @__PURE__ */ V("div", {
1537
1542
  style: {
1538
1543
  height: "100%",
1539
1544
  display: "flex",
@@ -1541,7 +1546,7 @@ function Et({ screenCode: t }) {
1541
1546
  overflow: "hidden",
1542
1547
  background: "var(--background)"
1543
1548
  },
1544
- children: [/* @__PURE__ */ B("div", {
1549
+ children: [/* @__PURE__ */ V("div", {
1545
1550
  style: {
1546
1551
  flexShrink: 0,
1547
1552
  paddingTop: y.isPhone ? 14 : 24,
@@ -1556,7 +1561,7 @@ function Et({ screenCode: t }) {
1556
1561
  bn,
1557
1562
  xn
1558
1563
  ]
1559
- }), /* @__PURE__ */ B("div", {
1564
+ }), /* @__PURE__ */ V("div", {
1560
1565
  ref: Pt,
1561
1566
  style: {
1562
1567
  flex: 1,
@@ -1571,7 +1576,7 @@ function Et({ screenCode: t }) {
1571
1576
  minWidth: 0,
1572
1577
  WebkitOverflowScrolling: "touch"
1573
1578
  },
1574
- children: [Sn, pn && (Y || k) && m && /* @__PURE__ */ z("div", {
1579
+ children: [Sn, pn && (Y || j) && l && /* @__PURE__ */ B("div", {
1575
1580
  "data-testid": "detail-sidebar-inline",
1576
1581
  style: {
1577
1582
  display: "flex",
@@ -1579,7 +1584,7 @@ function Et({ screenCode: t }) {
1579
1584
  gap: 16,
1580
1585
  minWidth: 0
1581
1586
  },
1582
- children: /* @__PURE__ */ z(Xe, {
1587
+ children: /* @__PURE__ */ B(Ye, {
1583
1588
  nodes: X.sidebar,
1584
1589
  ctx: $
1585
1590
  })
@@ -1590,15 +1595,15 @@ function Et({ screenCode: t }) {
1590
1595
  function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1591
1596
  let a = (e) => {
1592
1597
  let a = J(t, e, n, r, i);
1593
- return a != null && m(a) !== "";
1594
- }, s = (e) => {
1598
+ return a != null && k(a) !== "";
1599
+ }, o = (e) => {
1595
1600
  let a = J(t, e, n, r, i);
1596
- return m(a) || /* @__PURE__ */ z("span", {
1601
+ return k(a) || /* @__PURE__ */ B("span", {
1597
1602
  style: { color: "var(--text-3)" },
1598
1603
  children: "-"
1599
1604
  });
1600
- }, c = e.titleUsesDisplay ? o(n, t) : e.titleField ? J(t, e.titleField, n, r, i) : void 0, l = m(c) || v(t.display?.name) || "Record", u = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1601
- return /* @__PURE__ */ B("section", {
1605
+ }, s = e.titleUsesDisplay ? v(n, t) : e.titleField ? J(t, e.titleField, n, r, i) : void 0, c = k(s) || u(t.display?.name) || "Record", l = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1606
+ return /* @__PURE__ */ V("section", {
1602
1607
  "data-testid": "detail-header-card",
1603
1608
  style: {
1604
1609
  width: "100%",
@@ -1611,9 +1616,9 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1611
1616
  boxSizing: "border-box"
1612
1617
  },
1613
1618
  children: [
1614
- /* @__PURE__ */ B("div", {
1619
+ /* @__PURE__ */ V("div", {
1615
1620
  style: { minWidth: 0 },
1616
- children: [/* @__PURE__ */ z("div", {
1621
+ children: [/* @__PURE__ */ B("div", {
1617
1622
  style: {
1618
1623
  fontSize: 15,
1619
1624
  lineHeight: 1.25,
@@ -1621,8 +1626,8 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1621
1626
  color: "var(--text)",
1622
1627
  overflowWrap: "anywhere"
1623
1628
  },
1624
- children: l
1625
- }), e.subtitleField && /* @__PURE__ */ z("div", {
1629
+ children: c
1630
+ }), e.subtitleField && /* @__PURE__ */ B("div", {
1626
1631
  style: {
1627
1632
  marginTop: 4,
1628
1633
  fontSize: 12.5,
@@ -1630,17 +1635,17 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1630
1635
  color: "var(--text-3)",
1631
1636
  overflowWrap: "anywhere"
1632
1637
  },
1633
- children: s(e.subtitleField)
1638
+ children: o(e.subtitleField)
1634
1639
  })]
1635
1640
  }),
1636
- u.length > 0 && /* @__PURE__ */ z("div", {
1641
+ l.length > 0 && /* @__PURE__ */ B("div", {
1637
1642
  style: {
1638
1643
  display: "flex",
1639
1644
  flexWrap: "wrap",
1640
1645
  gap: 6,
1641
1646
  marginTop: 10
1642
1647
  },
1643
- children: u.map((e) => /* @__PURE__ */ z("span", {
1648
+ children: l.map((e) => /* @__PURE__ */ B("span", {
1644
1649
  style: {
1645
1650
  minWidth: 0,
1646
1651
  maxWidth: "100%",
@@ -1652,10 +1657,10 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1652
1657
  lineHeight: 1.4,
1653
1658
  overflowWrap: "anywhere"
1654
1659
  },
1655
- children: s(e)
1660
+ children: o(e)
1656
1661
  }, e))
1657
1662
  }),
1658
- d.length > 0 && /* @__PURE__ */ z("dl", {
1663
+ d.length > 0 && /* @__PURE__ */ B("dl", {
1659
1664
  style: {
1660
1665
  display: "grid",
1661
1666
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -1664,23 +1669,23 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1664
1669
  fontSize: 12.5,
1665
1670
  lineHeight: 1.35
1666
1671
  },
1667
- children: d.map((e) => /* @__PURE__ */ B("div", {
1672
+ children: d.map((e) => /* @__PURE__ */ V("div", {
1668
1673
  style: { display: "contents" },
1669
- children: [/* @__PURE__ */ z("dt", {
1674
+ children: [/* @__PURE__ */ B("dt", {
1670
1675
  style: { color: "var(--text-3)" },
1671
1676
  children: Ot(t, e)
1672
- }), /* @__PURE__ */ z("dd", {
1677
+ }), /* @__PURE__ */ B("dd", {
1673
1678
  style: {
1674
1679
  margin: 0,
1675
1680
  color: "var(--text-2)",
1676
1681
  minWidth: 0,
1677
1682
  overflowWrap: "anywhere"
1678
1683
  },
1679
- children: s(e)
1684
+ children: o(e)
1680
1685
  })]
1681
1686
  }, e))
1682
1687
  }),
1683
- f.length > 0 && /* @__PURE__ */ z("div", {
1688
+ f.length > 0 && /* @__PURE__ */ B("div", {
1684
1689
  style: {
1685
1690
  display: "flex",
1686
1691
  flexWrap: "wrap",
@@ -1689,7 +1694,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1689
1694
  color: "var(--text-3)",
1690
1695
  fontSize: 11.5
1691
1696
  },
1692
- children: f.map((e) => /* @__PURE__ */ B("span", {
1697
+ children: f.map((e) => /* @__PURE__ */ V("span", {
1693
1698
  style: {
1694
1699
  minWidth: 0,
1695
1700
  overflowWrap: "anywhere"
@@ -1697,7 +1702,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1697
1702
  children: [
1698
1703
  Ot(t, e),
1699
1704
  ": ",
1700
- s(e)
1705
+ o(e)
1701
1706
  ]
1702
1707
  }, e))
1703
1708
  })
@@ -1707,73 +1712,73 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1707
1712
  function J(e, t, n, r, i) {
1708
1713
  if (t.startsWith("$status.")) {
1709
1714
  let e = t.slice(8), n = r?.find((t) => t.group_code === e);
1710
- return v(n?.status_name) || n?.status_code;
1715
+ return u(n?.status_name) || n?.status_code;
1711
1716
  }
1712
1717
  if (t.startsWith("$property.")) {
1713
1718
  let e = t.slice(10);
1714
1719
  return i?.find((t) => t.property_code === e)?.value;
1715
1720
  }
1716
- return Se(e, n, t);
1721
+ return ke(e, n, t);
1717
1722
  }
1718
1723
  function Ot(e, t) {
1719
1724
  if (t.startsWith("$status.")) return t.slice(8);
1720
1725
  if (t.startsWith("$property.")) return t.slice(10);
1721
1726
  let n = e.fields.get(t);
1722
- return n ? _(n, t) : t;
1727
+ return n ? se(n, t) : t;
1723
1728
  }
1724
- function kt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: m, screen: h, globalActions: g, entityCode: _, record: x, id: C, listRoute: ee, listRouteExists: ne, highlights: re, showBack: ie, onBack: ae, onCancelEdit: oe, onSave: se, onRestore: ce, isRestoring: le, refreshControl: D, isRealtimeEntity: ue, canManageTemplates: de }) {
1725
- let { run: O } = T(), k = ge("detail"), me = Re(), he = te(), j = r(), _e = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), ve = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), M = b(ve, m?.actions, g, x ?? {}, [], Ee(m, x ?? {})), be = b(_e, m?.actions, g, x ?? {}, [], Ee(m, x ?? {})), xe = I(() => {
1726
- if (!m) return;
1727
- let e = C ? [C] : [];
1729
+ function kt({ title: n, recordId: a, editing: o, isNew: s, isRecordDeleted: c, dirty: d, isSaving: f, hasChildErrors: p, hasFieldErrors: ee, canRestore: m, entity: h, screen: g, globalActions: _, entityCode: v, record: x, id: S, listRoute: E, listRouteExists: D, highlights: ne, showBack: re, onBack: ie, onCancelEdit: ae, onSave: oe, onRestore: O, isRestoring: se, refreshControl: ce, isRealtimeEntity: le, canManageTemplates: k }) {
1730
+ let { run: A } = T(), j = M("detail"), ue = Ce(), fe = te(), N = i(), pe = l(g?.action_layout, h?.action_layout, h?.actions, _, "detail_toolbar"), me = l(g?.action_layout, h?.action_layout, h?.actions, _, "detail"), he = y(me, h?.actions, _, x ?? {}, [], Me(h, x ?? {})), ve = y(pe, h?.actions, _, x ?? {}, [], Me(h, x ?? {})), ye = L(() => {
1731
+ if (!h) return;
1732
+ let e = S ? [S] : [];
1728
1733
  return {
1729
- entity: m,
1730
- entityCode: _ ?? "",
1731
- screen: h,
1732
- screenRoute: h?.route ?? "",
1734
+ entity: h,
1735
+ entityCode: v ?? "",
1736
+ screen: g,
1737
+ screenRoute: g?.route ?? "",
1733
1738
  selectedRows: x ? [x] : [],
1734
1739
  selectedIds: e,
1735
- locale: j,
1736
- tabNavigate: (e, t) => me(e, {
1740
+ locale: N,
1741
+ tabNavigate: (e, t) => ue(e, {
1737
1742
  title: t?.title,
1738
1743
  icon: t?.icon,
1739
1744
  search: t?.search
1740
1745
  }),
1741
- runActionApi: (e, t) => S(e, t)
1746
+ runActionApi: (e, t) => b(e, t)
1742
1747
  };
1743
1748
  }, [
1744
- m,
1745
- _,
1746
1749
  h,
1747
- C,
1750
+ v,
1751
+ g,
1752
+ S,
1748
1753
  x,
1749
- j,
1750
- me
1751
- ]), Se = (e, t) => {
1752
- let n = De(e, t, { row: x ?? void 0 });
1754
+ N,
1755
+ ue
1756
+ ]), be = (e, t) => {
1757
+ let n = Fe(e, t, { row: x ?? void 0 });
1753
1758
  if (n === null) return;
1754
- let r = C ? [C] : [], i = e === "__delete" && ne ? ee : null;
1755
- return O({
1759
+ let r = S ? [S] : [], i = e === "__delete" && D ? E : null;
1760
+ return A({
1756
1761
  action: t,
1757
- title: v(t.display?.name) || e,
1762
+ title: u(t.display?.name) || e,
1758
1763
  row: x ?? void 0,
1759
- execute: (e) => S(n, w(e, r)),
1764
+ execute: (e) => b(n, w(e, r)),
1760
1765
  onSuccess: i ? () => {
1761
- fe.getState().kill(pe(location)), he(i, { replace: !0 });
1766
+ ge.getState().kill(_e(location)), fe(i, { replace: !0 });
1762
1767
  } : void 0
1763
1768
  });
1764
- }, Ce = k.isVisible("show_actions") && !o && C && M.length > 0 ? /* @__PURE__ */ z(Ke, {
1765
- layout: M,
1769
+ }, xe = j.isVisible("show_actions") && !s && S && he.length > 0 ? /* @__PURE__ */ B(Oe, {
1770
+ layout: he,
1766
1771
  row: x,
1767
- onRun: Se,
1772
+ onRun: be,
1768
1773
  kind: "detail",
1769
- entityActions: m?.actions,
1770
- globalActions: g,
1774
+ entityActions: h?.actions,
1775
+ globalActions: _,
1771
1776
  reservedRightWidth: 0,
1772
- widgetContext: xe
1773
- }) : null, we = !o && C ? /* @__PURE__ */ z(ye, {
1774
- liveObject: D,
1775
- realtime: ue
1776
- }) : null, Te = k.isVisible("show_actions") && !o && C && be.length > 0 ? /* @__PURE__ */ B("div", {
1777
+ widgetContext: ye
1778
+ }) : null, Se = !s && S ? /* @__PURE__ */ B(de, {
1779
+ liveObject: ce,
1780
+ realtime: le
1781
+ }) : null, we = j.isVisible("show_actions") && !s && S && ve.length > 0 ? /* @__PURE__ */ V("div", {
1777
1782
  style: {
1778
1783
  display: "flex",
1779
1784
  justifyContent: "flex-end",
@@ -1781,62 +1786,62 @@ function kt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1781
1786
  gap: 8,
1782
1787
  marginTop: 10
1783
1788
  },
1784
- children: [Ce ? null : we, /* @__PURE__ */ z(Ke, {
1785
- layout: be,
1789
+ children: [xe ? null : Se, /* @__PURE__ */ B(Oe, {
1790
+ layout: ve,
1786
1791
  row: x,
1787
- onRun: Se,
1792
+ onRun: be,
1788
1793
  kind: "detail",
1789
- entityActions: m?.actions,
1790
- globalActions: g,
1794
+ entityActions: h?.actions,
1795
+ globalActions: _,
1791
1796
  reservedRightWidth: 0,
1792
- widgetContext: xe,
1793
- ariaLabel: Ce ? "Detail toolbar actions" : "Page actions"
1797
+ widgetContext: ye,
1798
+ ariaLabel: xe ? "Detail toolbar actions" : "Page actions"
1794
1799
  })]
1795
- }) : null, Oe = k.isVisible("show_actions") && !o && C && _ ? /* @__PURE__ */ z(A, {
1796
- entityCode: _,
1800
+ }) : null, Te = j.isVisible("show_actions") && !s && S && v ? /* @__PURE__ */ B(P, {
1801
+ entityCode: v,
1797
1802
  scope: "detail",
1798
- objectIds: [C],
1799
- capability: m?.documents,
1800
- canManageTemplates: de
1801
- }) : null, ke = s ? p ? /* @__PURE__ */ z(E, {
1803
+ objectIds: [S],
1804
+ capability: h?.documents,
1805
+ canManageTemplates: k
1806
+ }) : null, Ee = c ? m ? /* @__PURE__ */ B(C, {
1802
1807
  kind: "primary",
1803
- icon: z(le ? y : e.refresh, { size: 13 }),
1804
- onClick: ce,
1805
- disabled: le,
1806
- children: le ? "Restoring…" : "Restore"
1807
- }) : null : a ? /* @__PURE__ */ B(rt, { children: [/* @__PURE__ */ z(E, {
1808
- icon: /* @__PURE__ */ z(e.x, { size: 13 }),
1809
- onClick: oe,
1810
- disabled: u,
1808
+ icon: B(se ? r : e.refresh, { size: 13 }),
1809
+ onClick: O,
1810
+ disabled: se,
1811
+ children: se ? "Restoring…" : "Restore"
1812
+ }) : null : o ? /* @__PURE__ */ V(nt, { children: [/* @__PURE__ */ B(C, {
1813
+ icon: /* @__PURE__ */ B(e.x, { size: 13 }),
1814
+ onClick: ae,
1815
+ disabled: f,
1811
1816
  children: "Cancel"
1812
- }), /* @__PURE__ */ z(E, {
1817
+ }), /* @__PURE__ */ B(C, {
1813
1818
  kind: "primary",
1814
- icon: z(u ? y : e.save, { size: 13 }),
1815
- onClick: se,
1816
- disabled: u || d || f,
1817
- title: d ? "Fix errors in child rows" : f ? "Fix the highlighted fields" : void 0,
1818
- children: u ? "Saving…" : "Save"
1819
- })] }) : !o && C ? Ce ? /* @__PURE__ */ B("span", {
1819
+ icon: B(f ? r : e.save, { size: 13 }),
1820
+ onClick: oe,
1821
+ disabled: f || p || ee,
1822
+ title: p ? "Fix errors in child rows" : ee ? "Fix the highlighted fields" : void 0,
1823
+ children: f ? "Saving…" : "Save"
1824
+ })] }) : !s && S ? xe ? /* @__PURE__ */ V("span", {
1820
1825
  style: { display: "contents" },
1821
- children: [Oe, Ce]
1822
- }) : Oe : null;
1823
- return /* @__PURE__ */ B(rt, { children: [/* @__PURE__ */ z(q, {
1824
- icon: m?.display.icon ? /* @__PURE__ */ z(t, {
1825
- name: m.display.icon,
1826
+ children: [Te, xe]
1827
+ }) : Te : null;
1828
+ return /* @__PURE__ */ V(nt, { children: [/* @__PURE__ */ B(q, {
1829
+ icon: h?.display.icon ? /* @__PURE__ */ B(t, {
1830
+ name: h.display.icon,
1826
1831
  size: 16
1827
1832
  }) : void 0,
1828
1833
  title: n,
1829
- description: v(h?.display?.description) || v(m?.display?.description),
1830
- recordId: i,
1831
- highlights: re,
1832
- identityControls: !s && !a && !o ? we : null,
1833
- mode: o ? "create" : a ? "edit" : "display",
1834
- dirty: l,
1835
- showBack: ie,
1836
- onBack: ae,
1837
- right: ke,
1838
- showTitle: k.isVisible("show_title")
1839
- }), Te] });
1834
+ description: u(g?.display?.description) || u(h?.display?.description),
1835
+ recordId: a,
1836
+ highlights: ne,
1837
+ identityControls: !c && !o && !s ? Se : null,
1838
+ mode: s ? "create" : o ? "edit" : "display",
1839
+ dirty: d,
1840
+ showBack: re,
1841
+ onBack: ie,
1842
+ right: Ee,
1843
+ showTitle: j.isVisible("show_title")
1844
+ }), we] });
1840
1845
  }
1841
1846
  //#endregion
1842
1847
  export { Tt as SmartDetailPage };