@declarion/react 0.59.0 → 0.60.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 (36) hide show
  1. package/dist-lib/{AgentChatPanel.impl-DBH1Ff4G.js → AgentChatPanel.impl-BY-Ir7Sh.js} +39 -39
  2. package/dist-lib/{DetailAuditStrip-GNRA_eP5.js → DetailAuditStrip-B9p1XhjC.js} +26 -27
  3. package/dist-lib/{DraggableChildrenTable-4RZC351U.js → DraggableChildrenTable-CtL7rdT6.js} +34 -34
  4. package/dist-lib/{Grid-CQabaBLx.js → Grid-CYERLdXO.js} +1 -1
  5. package/dist-lib/{LayoutRenderer-DGKWZKpW.js → LayoutRenderer-B08IJKsZ.js} +465 -465
  6. package/dist-lib/{ListCardsBody-DfGmyNIu.js → ListCardsBody-Dje_rays.js} +26 -26
  7. package/dist-lib/{MarkdownRenderer-BDbzDv_y.js → MarkdownRenderer-N0IWjTH5.js} +1 -1
  8. package/dist-lib/{RefreshControl-Bhoib0ZA.js → RefreshControl-BEWSHtAC.js} +26 -26
  9. package/dist-lib/{SmartDetailPage.impl-Ds2RGg6K.js → SmartDetailPage.impl-CYiM-ITJ.js} +467 -467
  10. package/dist-lib/SmartListPage.impl-Db_Pv9Xc.js +3051 -0
  11. package/dist-lib/SmartRecordListPage.impl-hbbLglC1.js +780 -0
  12. package/dist-lib/{SortHeaderMenu-Cijxk4cX.js → SortHeaderMenu-DKKeCGTH.js} +1 -1
  13. package/dist-lib/{action-dispatch-DY0c8U81.js → action-dispatch-DbiOpvd6.js} +187 -187
  14. package/dist-lib/api/data.d.ts +5 -1
  15. package/dist-lib/{cardProjection-Bkl2SSYz.js → cardProjection-nveYLvHR.js} +1 -1
  16. package/dist-lib/components/chrome/headerActionZone.d.ts +27 -0
  17. package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
  18. package/dist-lib/components/pages/list/useActiveView.d.ts +9 -2
  19. package/dist-lib/components/pages/list/useListViews.d.ts +3 -2
  20. package/dist-lib/{failure-v-uGSpbX.js → failure-BT54OLHy.js} +5 -5
  21. package/dist-lib/{format-count-DA4wmmWR.js → format-count-DLFCdtME.js} +246 -246
  22. package/dist-lib/hooks/useObject.d.ts +3 -2
  23. package/dist-lib/index.js +1083 -1091
  24. package/dist-lib/lib/field-classification.d.ts +10 -1
  25. package/dist-lib/{peekDraftStore-D-cTbiIr.js → peekDraftStore-DSExeoAh.js} +6 -6
  26. package/dist-lib/{registry-Cb3W-czW.js → registry-CRPxNbkk.js} +444 -438
  27. package/dist-lib/testing.js +2 -2
  28. package/dist-lib/{useAgentConversation-D97IqE-J.js → useAgentConversation-BavrHfrU.js} +14 -14
  29. package/dist-lib/{useCurrentScreen-BL5NZFCw.js → useCurrentScreen-BPq7HMF1.js} +1083 -1017
  30. package/dist-lib/{useListQuery-BG1GyKtJ.js → useListQuery-CG1WM4cv.js} +5 -5
  31. package/dist-lib/{field-classification-C28XE-_P.js → useOwnRefresh-C18iWRgr.js} +132 -158
  32. package/dist-lib/{useProperties-4Lg3odrt.js → useProperties-C35JrjwQ.js} +2 -2
  33. package/dist-lib/{useTabSearchMirror-ZVLlINBX.js → useTabSearchMirror-DKktWWLB.js} +1 -1
  34. package/package.json +1 -1
  35. package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +0 -3046
  36. package/dist-lib/SmartRecordListPage.impl-C1FJLr80.js +0 -780
@@ -1,26 +1,26 @@
1
1
  import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
2
- import { An as n, At as r, Cn as i, In as a, Ln as o, Lt as s, Rn as c, W as l, X as u, _n as d, b as f, ct as p, et as ee, gn as m, hn as h, i as g, jn as _, kn as v, mn as y, nn as te, on as b, ot as x, rt as S, ut as ne, vn as re, xn as ie, y as C, yn as ae } from "./useCurrentScreen-BL5NZFCw.js";
3
- import { r as oe, s as w, t as T } from "./RefreshControl-Bhoib0ZA.js";
4
- import { $ as se, D as ce, f as le, p as ue, t as E, u as de } from "./useText-BFDCTUSo.js";
5
- import { c as D, h as O, s as fe } from "./registry-Cb3W-czW.js";
6
- import { n as pe, r as me, t as he } from "./DetailAuditStrip-GNRA_eP5.js";
7
- import { a as ge, m as k, n as A, p as j, r as M, t as N, u as P } from "./failure-v-uGSpbX.js";
8
- import { C as _e, L as ve, M as ye, N as be, O as xe, f as Se, g as Ce, h as we, k as Te, l as Ee, m as De, y as Oe } from "./field-classification-C28XE-_P.js";
9
- import { c as ke, f as Ae, h as je, m as Me, o as Ne, p as Pe, r as Fe, t as Ie, u as Le } from "./action-dispatch-DY0c8U81.js";
10
- import { n as Re, r as ze, t as Be } from "./dataTableStyles-vwD1mVOP.js";
11
- import { a as Ve, i as He, o as Ue, r as We, s as Ge } from "./peekDraftStore-D-cTbiIr.js";
12
- import { n as Ke, t as qe } from "./LayoutRenderer-DGKWZKpW.js";
13
- import { t as Je } from "./cardProjection-Bkl2SSYz.js";
14
- import { Fragment as Ye, useCallback as F, useEffect as I, useMemo as L, useRef as Xe, useState as R } from "react";
2
+ import { Bn as n, Bt as r, Dn as i, En as a, Jn as o, Kn as s, Nn as c, On as l, Tn as u, Vn as d, W as f, X as p, b as m, ct as h, et as g, fn as _, gn as v, i as y, jn as b, kn as x, ot as S, qn as C, qt as ee, rt as te, ut as ne, wn as re, y as w, zn as ie } from "./useCurrentScreen-BPq7HMF1.js";
3
+ import { r as ae, s as T, t as E } from "./RefreshControl-BEWSHtAC.js";
4
+ import { $ as oe, D as se, f as ce, p as le, t as D, u as ue } from "./useText-BFDCTUSo.js";
5
+ import { c as O, h as k, s as de } from "./registry-CRPxNbkk.js";
6
+ import { i as fe, n as pe, t as me } from "./DetailAuditStrip-B9p1XhjC.js";
7
+ import { a as he, m as A, n as j, p as M, r as N, t as P, u as F } from "./failure-BT54OLHy.js";
8
+ import { A as ge, E as _e, S as ve, T as ye, a as be, c as xe, f as Se, g as Ce, l as we, n as Te, s as Ee, x as De } from "./useOwnRefresh-C18iWRgr.js";
9
+ 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-DbiOpvd6.js";
10
+ import { n as Le, r as Re, t as ze } from "./dataTableStyles-vwD1mVOP.js";
11
+ import { a as Be, i as Ve, o as He, r as Ue, s as We } from "./peekDraftStore-DSExeoAh.js";
12
+ import { n as Ge, t as Ke } from "./LayoutRenderer-B08IJKsZ.js";
13
+ import { t as qe } from "./cardProjection-nveYLvHR.js";
14
+ import { Fragment as Je, useCallback as Ye, useEffect as I, useMemo as L, useRef as Xe, useState as R } from "react";
15
15
  import { useLocation as Ze, useParams as Qe, useSearchParams as $e } from "react-router";
16
16
  import { useQuery as z, useQueryClient as et } from "@tanstack/react-query";
17
17
  import { Fragment as tt, jsx as B, jsxs as V } from "react/jsx-runtime";
18
18
  //#region src/components/chrome/AssociationTabs.tsx
19
19
  function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
20
- let a = E(), o = L(() => Object.entries(r), [r]), [s, c] = R(0);
20
+ let a = D(), o = L(() => Object.entries(r), [r]), [s, c] = R(0);
21
21
  if (o.length === 0) return null;
22
22
  let [l, u] = o[s];
23
- return /* @__PURE__ */ B(O, {
23
+ return /* @__PURE__ */ B(k, {
24
24
  title: /* @__PURE__ */ B("div", {
25
25
  style: {
26
26
  display: "flex",
@@ -68,108 +68,108 @@ function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
68
68
  })
69
69
  });
70
70
  }
71
- function H({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a }) {
72
- let o = E(), s = E("errors"), l = be(), f = `${t}.${r}`, { data: p, isLoading: ee } = z({
71
+ function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: s }) {
72
+ let c = D(), l = D("errors"), u = _e(), d = `${t}.${r}`, { data: f, isLoading: m } = z({
73
73
  queryKey: [
74
74
  "association",
75
- f,
75
+ d,
76
76
  n
77
77
  ],
78
- queryFn: () => k(f, [n])
79
- }), m = p?.target_entity ?? i.target, h = a.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: te } = z({
78
+ queryFn: () => A(d, [n])
79
+ }), h = f?.target_entity ?? a.target, g = s.entities[h], _ = L(() => f?.ids ?? [], [f?.ids]), v = L(() => g?.fields.names().find((e) => g.fields.get(e)?.primary) ?? "id", [g]), y = L(() => _.slice(0, 50), [_]), { data: b, isLoading: x } = z({
80
80
  queryKey: [
81
81
  "association-records",
82
- m,
83
- v
82
+ h,
83
+ y
84
84
  ],
85
- queryFn: () => j(m, {
85
+ queryFn: () => M(h, {
86
86
  per_page: 50,
87
87
  filters: [{
88
- field: _,
88
+ field: v,
89
89
  op: "in",
90
- value: v
90
+ value: y
91
91
  }]
92
92
  }),
93
- enabled: v.length > 0 && !!h
94
- }), b = y?.data ?? [], x = y?.$refs, ne = L(() => h ? h.fields.names().filter((e) => {
95
- let t = h.fields.get(e);
93
+ enabled: y.length > 0 && !!g
94
+ }), S = b?.data ?? [], C = b?.$refs, ee = L(() => g ? g.fields.names().filter((e) => {
95
+ let t = g.fields.get(e);
96
96
  return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
97
- }).slice(0, 6) : [], [h]), re = () => {
98
- let e = u(a, m);
97
+ }).slice(0, 6) : [], [g]), ne = () => {
98
+ let e = p(s, h);
99
99
  if (!e) return;
100
- let t = o(i.display?.name) || r, n = new URLSearchParams();
100
+ let t = c(a.display?.name) || r, n = new URLSearchParams();
101
101
  n.set("filters", JSON.stringify([{
102
- field: _,
102
+ field: v,
103
103
  op: "in",
104
- value: g
105
- }])), l(e.route, {
104
+ value: _
105
+ }])), u(e.route, {
106
106
  title: t,
107
- icon: i.display?.icon || e.icon,
107
+ icon: a.display?.icon || e.icon,
108
108
  search: n.toString()
109
109
  });
110
- }, ie = {
110
+ }, re = {
111
111
  fontSize: 12.5,
112
112
  color: "var(--text-3)",
113
113
  padding: "14px 16px"
114
114
  };
115
- if (ee || te) return /* @__PURE__ */ B("div", {
116
- style: ie,
117
- children: o("shell.loading", "Loading…")
115
+ if (m || x) return /* @__PURE__ */ B("div", {
116
+ style: re,
117
+ children: c("shell.loading", "Loading…")
118
118
  });
119
- if (!h) return /* @__PURE__ */ B("div", {
120
- style: ie,
121
- children: s("record.related_entity_not_found", "The related record type is not declared in this deployment.")
119
+ if (!g) return /* @__PURE__ */ B("div", {
120
+ style: re,
121
+ children: l("record.related_entity_not_found", "The related record type is not declared in this deployment.")
122
122
  });
123
- if (g.length === 0) return /* @__PURE__ */ B("div", {
124
- style: ie,
125
- children: o("shell.association.empty", "No related records.")
123
+ if (_.length === 0) return /* @__PURE__ */ B("div", {
124
+ style: re,
125
+ children: c("shell.association.empty", "No related records.")
126
126
  });
127
- let C = u(a, m);
127
+ let w = p(s, h);
128
128
  return /* @__PURE__ */ V("div", {
129
129
  style: { padding: "8px 0" },
130
130
  children: [
131
131
  /* @__PURE__ */ V("table", {
132
- style: ze,
133
- children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: ne.map((e) => /* @__PURE__ */ B("th", {
134
- style: Re,
135
- children: d(o, h.fields.get(e), e, a.entities)
136
- }, e)) }) }), /* @__PURE__ */ B("tbody", { children: b.map((e, t) => /* @__PURE__ */ B("tr", { children: ne.map((t) => {
137
- let n = h.fields.get(t);
132
+ style: Re,
133
+ children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: ee.map((e) => /* @__PURE__ */ B("th", {
134
+ style: Le,
135
+ children: i(c, g.fields.get(e), e, s.entities)
136
+ }, e)) }) }), /* @__PURE__ */ B("tbody", { children: S.map((e, t) => /* @__PURE__ */ B("tr", { children: ee.map((t) => {
137
+ let n = g.fields.get(t);
138
138
  return n ? /* @__PURE__ */ B("td", {
139
- style: Be,
140
- children: S({
139
+ style: ze,
140
+ children: te({
141
141
  field: n,
142
142
  fieldName: t,
143
143
  value: e[t],
144
144
  mode: "display",
145
145
  record: e,
146
- refs: x,
147
- t: o
146
+ refs: C,
147
+ t: c
148
148
  })
149
149
  }, t) : /* @__PURE__ */ B("td", {}, t);
150
150
  }) }, t)) })]
151
151
  }),
152
- C && p && p.count > b.length && /* @__PURE__ */ B("div", {
152
+ w && f && f.count > S.length && /* @__PURE__ */ B("div", {
153
153
  style: {
154
154
  padding: "10px 16px",
155
155
  textAlign: "center"
156
156
  },
157
- children: /* @__PURE__ */ B(c, {
157
+ children: /* @__PURE__ */ B(o, {
158
158
  icon: /* @__PURE__ */ B(e.external, { size: 12 }),
159
- onClick: re,
160
- children: o("shell.association.view_all", "View all {count} records", { count: p.count })
159
+ onClick: ne,
160
+ children: c("shell.association.view_all", "View all {count} records", { count: f.count })
161
161
  })
162
162
  }),
163
- C && b.length > 0 && p && p.count <= b.length && /* @__PURE__ */ B("div", {
163
+ w && S.length > 0 && f && f.count <= S.length && /* @__PURE__ */ B("div", {
164
164
  style: {
165
165
  padding: "10px 16px",
166
166
  textAlign: "center"
167
167
  },
168
- children: /* @__PURE__ */ B(c, {
168
+ children: /* @__PURE__ */ B(o, {
169
169
  kind: "ghost",
170
170
  icon: /* @__PURE__ */ B(e.external, { size: 12 }),
171
- onClick: re,
172
- children: o("shell.association.open_list", "Open in list view")
171
+ onClick: ne,
172
+ children: c("shell.association.open_list", "Open in list view")
173
173
  })
174
174
  })
175
175
  ]
@@ -182,20 +182,20 @@ function it(e) {
182
182
  return e?.some((e) => e.status === "pending") ? rt : !1;
183
183
  }
184
184
  function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
185
- let a = E(), o = E("errors"), { data: s, isLoading: c, error: l } = z({
185
+ let a = D(), o = D("errors"), { data: s, isLoading: c, error: l } = z({
186
186
  queryKey: [
187
- C,
187
+ w,
188
188
  t,
189
189
  n
190
190
  ],
191
- queryFn: async () => (await P("document.object_links", {
191
+ queryFn: async () => (await F("document.object_links", {
192
192
  entity: t,
193
193
  object_id: n
194
194
  })).result?.documents ?? [],
195
195
  enabled: !!(t && n) && (!!r || !!i),
196
196
  refetchInterval: (e) => it(e.state.data)
197
197
  }), u = (s?.length ?? 0) > 0;
198
- return !r && !u ? null : /* @__PURE__ */ V(O, {
198
+ return !r && !u ? null : /* @__PURE__ */ V(k, {
199
199
  title: /* @__PURE__ */ B(W, {}),
200
200
  collapsible: !1,
201
201
  padding: "0",
@@ -206,7 +206,7 @@ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
206
206
  }),
207
207
  l && /* @__PURE__ */ B(G, {
208
208
  icon: /* @__PURE__ */ B(e.warning, { size: 14 }),
209
- text: N(o, l)
209
+ text: P(o, l)
210
210
  }),
211
211
  !c && !l && (s?.length ?? 0) === 0 && /* @__PURE__ */ B(G, {
212
212
  icon: /* @__PURE__ */ B(e.file, { size: 14 }),
@@ -227,7 +227,7 @@ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
227
227
  });
228
228
  }
229
229
  function W() {
230
- let t = E();
230
+ let t = D();
231
231
  return /* @__PURE__ */ V("div", {
232
232
  style: {
233
233
  display: "flex",
@@ -243,50 +243,50 @@ function W() {
243
243
  });
244
244
  }
245
245
  function ot({ entityCode: t, objectId: n, doc: r }) {
246
- let i = E(), { data: a } = le(), o = i(a?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === r.status)?.name) || r.status, s = E("errors"), l = et(), [u, d] = R(!1), [f, p] = R(!1), [ee, m] = R(!1), [h, g] = R(!1), [_, v] = R(null), y = i(r.title) || r.filename || r.template_code, te = r.status === "ready" && r.download_url && !h;
247
- async function b() {
248
- d(!0), v(null);
246
+ let i = D(), { data: a } = ce(), s = i(a?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === r.status)?.name) || r.status, c = D("errors"), l = et(), [u, d] = R(!1), [f, p] = R(!1), [m, h] = R(!1), [g, _] = R(!1), [v, y] = R(null), b = i(r.title) || r.filename || r.template_code, x = r.status === "ready" && r.download_url && !g;
247
+ async function S() {
248
+ d(!0), y(null);
249
249
  try {
250
- let e = (await P("document.download_format", {
250
+ let e = (await F("document.download_format", {
251
251
  generated_document_id: r.generated_document_id,
252
252
  format: U
253
253
  })).result;
254
- e?.download_url && await A(s, e.download_url, e.filename);
254
+ e?.download_url && await j(c, e.download_url, e.filename);
255
255
  } catch (e) {
256
- M(e) ? (g(!0), v(s("document.artifact_unavailable", "This generated file is not available."))) : v(N(s, e));
256
+ N(e) ? (_(!0), y(c("document.artifact_unavailable", "This generated file is not available."))) : y(P(c, e));
257
257
  } finally {
258
258
  d(!1);
259
259
  }
260
260
  }
261
- async function x() {
261
+ async function C() {
262
262
  if (r.download_url) {
263
- p(!0), v(null);
263
+ p(!0), y(null);
264
264
  try {
265
- await A(s, r.download_url, r.filename);
265
+ await j(c, r.download_url, r.filename);
266
266
  } catch (e) {
267
- M(e) ? (g(!0), v(s("document.artifact_unavailable", "This generated file is not available."))) : v(N(s, e));
267
+ N(e) ? (_(!0), y(c("document.artifact_unavailable", "This generated file is not available."))) : y(P(c, e));
268
268
  } finally {
269
269
  p(!1);
270
270
  }
271
271
  }
272
272
  }
273
- async function S() {
274
- m(!0), v(null);
273
+ async function ee() {
274
+ h(!0), y(null);
275
275
  try {
276
- await P("document.generate", {
276
+ await F("document.generate", {
277
277
  ...r.input ?? {},
278
278
  template_code: r.template_code,
279
279
  template_source: r.template_source,
280
280
  output_format: r.output_format
281
281
  }), await l.invalidateQueries({ queryKey: [
282
- C,
282
+ w,
283
283
  t,
284
284
  n
285
285
  ] });
286
286
  } catch (e) {
287
- v(N(s, e));
287
+ y(P(c, e));
288
288
  } finally {
289
- m(!1);
289
+ h(!1);
290
290
  }
291
291
  }
292
292
  return /* @__PURE__ */ V("div", {
@@ -310,7 +310,7 @@ function ot({ entityCode: t, objectId: n, doc: r }) {
310
310
  textOverflow: "ellipsis",
311
311
  whiteSpace: "nowrap"
312
312
  },
313
- children: y
313
+ children: b
314
314
  }),
315
315
  /* @__PURE__ */ V("div", {
316
316
  style: {
@@ -323,7 +323,7 @@ function ot({ entityCode: t, objectId: n, doc: r }) {
323
323
  },
324
324
  children: [
325
325
  /* @__PURE__ */ B("span", { children: r.output_format.toUpperCase() }),
326
- /* @__PURE__ */ B("span", { children: h ? i("document.row.artifact_missing", "artifact unavailable") : o }),
326
+ /* @__PURE__ */ B("span", { children: g ? i("document.row.artifact_missing", "artifact unavailable") : s }),
327
327
  /* @__PURE__ */ B("span", { children: r.ready_at || r.created_at })
328
328
  ]
329
329
  }),
@@ -335,43 +335,43 @@ function ot({ entityCode: t, objectId: n, doc: r }) {
335
335
  },
336
336
  children: r.error_text
337
337
  }),
338
- _ && /* @__PURE__ */ B("div", {
338
+ v && /* @__PURE__ */ B("div", {
339
339
  style: {
340
340
  marginTop: 5,
341
341
  color: "var(--danger)",
342
342
  fontSize: 12
343
343
  },
344
- children: _
344
+ children: v
345
345
  })
346
346
  ]
347
- }), te ? /* @__PURE__ */ V("div", {
347
+ }), x ? /* @__PURE__ */ V("div", {
348
348
  style: {
349
349
  display: "flex",
350
350
  gap: 6
351
351
  },
352
- children: [/* @__PURE__ */ B(c, {
352
+ children: [/* @__PURE__ */ B(o, {
353
353
  kind: "ghost",
354
354
  size: "sm",
355
355
  icon: B(u ? e.loader : e.file, { size: 12 }),
356
- onClick: b,
356
+ onClick: S,
357
357
  disabled: u,
358
358
  children: U.toUpperCase()
359
- }), /* @__PURE__ */ B(c, {
359
+ }), /* @__PURE__ */ B(o, {
360
360
  kind: "default",
361
361
  size: "sm",
362
362
  icon: B(f ? e.loader : e.download, { size: 12 }),
363
- onClick: x,
363
+ onClick: C,
364
364
  disabled: f,
365
365
  children: i("document.result.download", "Download")
366
366
  })]
367
- }) : h ? /* @__PURE__ */ B(c, {
367
+ }) : g ? /* @__PURE__ */ B(o, {
368
368
  kind: "ghost",
369
369
  size: "sm",
370
- icon: B(ee ? e.loader : e.file, { size: 12 }),
371
- onClick: S,
372
- disabled: ee,
370
+ icon: B(m ? e.loader : e.file, { size: 12 }),
371
+ onClick: ee,
372
+ disabled: m,
373
373
  children: i("document.row.regenerate", "Regenerate")
374
- }) : /* @__PURE__ */ B(c, {
374
+ }) : /* @__PURE__ */ B(o, {
375
375
  kind: "ghost",
376
376
  size: "sm",
377
377
  disabled: !0,
@@ -395,7 +395,7 @@ function G({ icon: e, text: t }) {
395
395
  //#endregion
396
396
  //#region src/components/detail-layout/ErrorSummary.tsx
397
397
  function st({ errors: t, onJump: n }) {
398
- let r = E();
398
+ let r = D();
399
399
  return t.length === 0 ? null : /* @__PURE__ */ V("div", {
400
400
  role: "alert",
401
401
  style: {
@@ -426,7 +426,7 @@ function st({ errors: t, onJump: n }) {
426
426
  fontWeight: 600,
427
427
  marginBottom: 4
428
428
  },
429
- children: de(r, "record.errors.summary", t.length, {
429
+ children: ue(r, "record.errors.summary", t.length, {
430
430
  one: "{count} field needs attention",
431
431
  other: "{count} fields need attention"
432
432
  })
@@ -487,7 +487,7 @@ function K({ items: e }) {
487
487
  gap: "6px 0",
488
488
  fontSize: 12
489
489
  },
490
- children: e.map((e, t) => /* @__PURE__ */ V(Ye, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
490
+ children: e.map((e, t) => /* @__PURE__ */ V(Je, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
491
491
  width: 1,
492
492
  height: 12,
493
493
  background: "var(--divider)",
@@ -514,17 +514,17 @@ function K({ items: e }) {
514
514
  }
515
515
  //#endregion
516
516
  //#region src/components/detail-layout/DetailHighlights.tsx
517
- function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: o, schema: s }) {
518
- let c = E(), l = e.highlights;
517
+ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o }) {
518
+ let c = D(), l = e.highlights;
519
519
  if (!l || l.length === 0) return null;
520
520
  let u = [];
521
521
  for (let e of l) {
522
522
  let l = t.status_groups?.[e];
523
523
  if (l) {
524
- let t = o?.find((t) => t.group_code === e), n = t ? l.statuses.find((e) => e.code === t.status_code) : void 0;
524
+ let t = a?.find((t) => t.group_code === e), n = t ? l.statuses.find((e) => e.code === t.status_code) : void 0;
525
525
  u.push({
526
526
  label: c(l.name),
527
- value: n ? /* @__PURE__ */ B(a, {
527
+ value: n ? /* @__PURE__ */ B(s, {
528
528
  tone: n.color ?? "slate",
529
529
  size: "xs",
530
530
  children: c(n.name)
@@ -536,20 +536,20 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
536
536
  continue;
537
537
  }
538
538
  if (t.fields.get(e) || t.files?.get(e)) {
539
- let a = Pe({
539
+ let a = Ne({
540
540
  entity: t,
541
541
  entityCode: n,
542
542
  fieldName: e,
543
543
  record: r,
544
544
  mode: "display",
545
545
  refs: i,
546
- entities: s.entities,
547
- screens: s.screens,
546
+ entities: o.entities,
547
+ screens: o.screens,
548
548
  surface: "list",
549
549
  t: c
550
550
  });
551
551
  u.push({
552
- label: Me(c, t, e, s.entities),
552
+ label: je(c, t, e, o.entities),
553
553
  value: a
554
554
  });
555
555
  continue;
@@ -565,7 +565,7 @@ function lt(e, t) {
565
565
  if (!Number.isNaN(n.getTime())) return n.toLocaleString(t);
566
566
  }
567
567
  function ut({ evidence: e }) {
568
- let t = E(), n = e?.verdict ?? "unverified", r = lt(e?.verified_at, t.language), i = [];
568
+ let t = D(), n = e?.verdict ?? "unverified", r = lt(e?.verified_at, t.language), i = [];
569
569
  return r && i.push(t("record.evidence.verified", "Verified {when}", { when: r })), e?.seq && i.push(t("record.evidence.chain", "chain #{seq}", { seq: e.seq })), e?.checkpoint_number && i.push(t("record.evidence.checkpoint", "checkpoint {number}", { number: e.checkpoint_number })), e?.generation && i.push(t("record.evidence.generation", "generation {number}", { number: e.generation })), /* @__PURE__ */ V("div", {
570
570
  style: {
571
571
  display: "flex",
@@ -588,11 +588,11 @@ function ut({ evidence: e }) {
588
588
  },
589
589
  children: t("record.evidence.title", "Evidence")
590
590
  }),
591
- /* @__PURE__ */ B(a, {
592
- tone: Ve(n),
591
+ /* @__PURE__ */ B(s, {
592
+ tone: Be(n),
593
593
  size: "sm",
594
594
  dot: !0,
595
- children: He(t, n)
595
+ children: Ve(t, n)
596
596
  }),
597
597
  i.length > 0 && /* @__PURE__ */ B("span", {
598
598
  style: {
@@ -664,52 +664,52 @@ function ht(e, t) {
664
664
  }
665
665
  //#endregion
666
666
  //#region src/components/pages/SmartDetailPage.impl.tsx
667
- var gt = () => {};
668
- function _t(e, t) {
667
+ var gt = () => {}, _t = { expand: ["evidence"] };
668
+ function vt(e, t) {
669
669
  return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
670
670
  }
671
- function vt(e, t) {
671
+ function yt(e, t) {
672
672
  if (e) {
673
- let n = m(e, t), r = i(n);
673
+ let n = a(e, t), r = c(n);
674
674
  if (r.replace(/^\|+|\|+$/g, "")) return r;
675
675
  }
676
- return t.id == null ? crypto.randomUUID() : _(t.id);
676
+ return t.id == null ? crypto.randomUUID() : d(t.id);
677
677
  }
678
678
  function q({ screenCode: e }) {
679
- return /* @__PURE__ */ B(x, { children: /* @__PURE__ */ B(yt, { screenCode: e }) });
679
+ return /* @__PURE__ */ B(S, { children: /* @__PURE__ */ B(bt, { screenCode: e }) });
680
680
  }
681
- function yt({ screenCode: t }) {
682
- let a = E(), c = E("errors"), { id: l } = Qe(), u = r(), [ee, g] = $e(), { data: _ } = le(), te = ue((e) => e.user), x = p(), S = b(), C = _?.screens[t], w = C?.entity ? _?.entities[C.entity] : void 0, T = C?.entity, de = h(w, "create"), O = h(w, "update"), pe = h(w, "restore"), ge = (() => {
683
- if (!w || !w.singleton || !w.prefilter) return;
684
- let e = ae(w);
681
+ function bt({ screenCode: t }) {
682
+ let o = D(), s = D("errors"), { id: d } = Qe(), f = r(), [p, g] = $e(), { data: _ } = ce(), y = le((e) => e.user), S = h(), te = v(), w = _?.screens[t], T = w?.entity ? _?.entities[w.entity] : void 0, E = w?.entity, ue = u(T, "create"), k = u(T, "update"), pe = u(T, "restore"), he = (() => {
683
+ if (!T || !T.singleton || !T.prefilter) return;
684
+ let e = x(T);
685
685
  if (e.length !== 1) return;
686
- let t = w.prefilter[e[0]];
687
- if (t === "$caller.user_id") return te?.id;
688
- if (t === "$caller.tenant_id") return te?.tenant?.id;
689
- })(), k = ge !== void 0, A = k ? ge : l, j = !k && A === "new", M = L(() => {
690
- if (!A || j) return;
691
- if (!w) return A;
692
- let e = ae(w);
693
- if (e.length === 1) return { [e[0]]: A };
694
- let t = ie(A, e.length);
686
+ let t = T.prefilter[e[0]];
687
+ if (t === "$caller.user_id") return y?.id;
688
+ if (t === "$caller.tenant_id") return y?.tenant?.id;
689
+ })(), A = he !== void 0, j = A ? he : d, M = !A && j === "new", N = L(() => {
690
+ if (!j || M) return;
691
+ if (!T) return j;
692
+ let e = x(T);
693
+ if (e.length === 1) return { [e[0]]: j };
694
+ let t = b(j, e.length);
695
695
  if (!t) return;
696
696
  let n = {};
697
697
  for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
698
698
  return n;
699
699
  }, [
700
- A,
701
700
  j,
702
- w
703
- ]), N = L(() => {
704
- if (M) return typeof M == "string" ? M : i(M);
705
- }, [M]), P = D(T, M), { data: be, isLoading: ke, error: Me } = P, Ne = f(w?.realtime, T ?? ""), Pe = T ? Ne : !1;
706
- Oe(fe(T, M), !j);
707
- let Ie = Se(T ?? ""), Re = we(T ?? ""), ze = De(T ?? ""), Be = Object.keys(w?.status_groups ?? {}).length > 0, Ve = be?.data, He = Ve?.$statuses, Ge = Ve?.$properties, Ye = ee.get("edit") === "true", [z, et] = R(j || Ye), [H, rt] = R({}), [U, it] = R({}), [W, ot] = R({}), [G, K] = R(void 0), [lt, ft] = R(!1), [mt, q] = R(void 0), [yt, xt] = R(!1), St = j ? de : O, J = z && St, wt = ce();
708
- s(J && !j, wt.enabled);
701
+ M,
702
+ T
703
+ ]), P = L(() => {
704
+ if (N) return typeof N == "string" ? N : c(N);
705
+ }, [N]), F = O(E, N, _t), { data: _e, isLoading: Oe, error: je } = F, Me = m(T?.realtime, E ?? ""), Ne = E ? Me : !1;
706
+ Se(de(E, N, _t), !M);
707
+ let Fe = be(E ?? ""), Le = xe(E ?? ""), Re = Ee(E ?? ""), ze = Object.keys(T?.status_groups ?? {}).length > 0, Be = _e?.data, Ve = Be?.$statuses, We = Be?.$properties, Je = p.get("edit") === "true", [z, et] = R(M || Je), [H, rt] = R({}), [U, it] = R({}), [W, ot] = R({}), [G, K] = R(void 0), [lt, ft] = R(!1), [mt, q] = R(void 0), [bt, J] = R(!1), St = M ? ue : k, Y = z && St, wt = se();
708
+ ee(Y && !M, wt.enabled);
709
709
  let [Tt, Et] = R(() => {
710
- let e = parseInt(C?.sidebar_width || "380", 10);
710
+ let e = parseInt(w?.sidebar_width || "380", 10);
711
711
  return isNaN(e) ? 380 : e;
712
- }), Dt = Xe(null), Ot = Xe(null), kt = F((e) => {
712
+ }), Dt = Xe(null), Ot = Xe(null), kt = Ye((e) => {
713
713
  e.preventDefault();
714
714
  let t = Dt.current;
715
715
  if (!t) return;
@@ -726,80 +726,80 @@ function yt({ screenCode: t }) {
726
726
  Ot.current && t && Et(parseInt(t.style.width, 10) || Ot.current.startW), Ot.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
727
727
  };
728
728
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
729
- }, []), Y = be?.data, X = Fe(w, C, Y ?? {});
729
+ }, []), X = _e?.data, Z = Pe(T, w, X ?? {});
730
730
  I(() => {
731
- let e = parseInt(X?.sidebar_width || "380", 10);
731
+ let e = parseInt(Z?.sidebar_width || "380", 10);
732
732
  Et(Number.isNaN(e) ? 380 : e);
733
- }, [X?.sidebar_width]);
734
- let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, At = Y?.$refs, jt = Xe(Z);
733
+ }, [Z?.sidebar_width]);
734
+ let Q = typeof X?.$row_version == "string" ? X.$row_version : void 0, At = X?.$refs, jt = Xe(Q);
735
735
  I(() => {
736
- if (!Z) return;
736
+ if (!Q) return;
737
737
  let e = jt.current;
738
- jt.current = Z, e && e !== Z && z && ft(!0);
739
- }, [z, Z]);
740
- let Mt = !!w?.soft_delete && Y != null && Y[w.soft_delete] != null, Nt = Ze(), Pt = Xe(null);
741
- oe({ scrollElementRef: Pt });
742
- let Ft = !j && Me instanceof se && Me.status === 404, It = j && !y(w), Lt = Xe(null);
738
+ jt.current = Q, e && e !== Q && z && ft(!0);
739
+ }, [z, Q]);
740
+ let Mt = !!T?.soft_delete && X != null && X[T.soft_delete] != null, Nt = Ze(), Pt = Xe(null);
741
+ ae({ scrollElementRef: Pt });
742
+ let Ft = !M && je instanceof oe && je.status === 404, It = M && !re(T), Lt = Xe(null);
743
743
  I(() => {
744
744
  if (!Ft) return;
745
- let e = _e(Nt);
745
+ let e = Ce(Nt);
746
746
  Lt.current !== e && (Lt.current = e, ye.getState().kill(e));
747
747
  }, [Ft, Nt]);
748
- let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = ve();
748
+ let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = ge();
749
749
  I(() => {
750
- if (!w || k || wt.enabled) return;
751
- let e = Nt.pathname, t = a(X?.display?.name) || a(w.display.name), n = X?.display?.icon || w.display.icon;
750
+ if (!T || A || wt.enabled) return;
751
+ let e = Nt.pathname, t = o(Z?.display?.name) || o(T.display.name), n = Z?.display?.icon || T.display.icon;
752
752
  Bt(e) || Rt({
753
753
  pathname: e,
754
754
  search: "",
755
- title: j ? a("record.new_title", "New {name}", { name: t }) : t,
756
- derivedTitle: !j,
755
+ title: M ? o("record.new_title", "New {name}", { name: t }) : t,
756
+ derivedTitle: !M,
757
757
  icon: n,
758
758
  closable: !0
759
759
  });
760
760
  }, [
761
761
  Nt.pathname,
762
- a,
763
- X?.display?.icon,
764
- w?.display.icon,
765
- j,
766
- k,
762
+ o,
763
+ Z?.display?.icon,
764
+ T?.display.icon,
765
+ M,
766
+ A,
767
767
  wt.enabled
768
768
  ]), I(() => {
769
- if (!Y || !w || k || wt.enabled) return;
769
+ if (!X || !T || A || wt.enabled) return;
770
770
  let e = Bt(Nt.pathname);
771
771
  if (e) {
772
- let t = a(X?.display?.name) || a(w.display.name), n = re(a, Y, w), r = n && !String(n).startsWith("/") ? String(n) : t;
772
+ let t = o(Z?.display?.name) || o(T.display.name), n = l(o, X, T), r = n && !String(n).startsWith("/") ? String(n) : t;
773
773
  zt(e.id, r, r === t);
774
774
  }
775
775
  }, [
776
- Y,
777
- a,
778
- w?.display.display_field,
776
+ X,
777
+ o,
778
+ T?.display.display_field,
779
779
  Nt.pathname,
780
- k,
780
+ A,
781
781
  wt.enabled
782
782
  ]);
783
783
  let Vt = L(() => {
784
- if (!w || !St) return /* @__PURE__ */ new Set();
784
+ if (!T || !St) return /* @__PURE__ */ new Set();
785
785
  let e = /* @__PURE__ */ new Set();
786
- for (let [t, n] of w.fields) !n.auto && !n.primary && e.add(t);
787
- for (let [t] of w.files ?? []) e.add(t);
786
+ for (let [t, n] of T.fields) !n.auto && !n.primary && e.add(t);
787
+ for (let [t] of T.files ?? []) e.add(t);
788
788
  return e;
789
- }, [w, St]);
789
+ }, [T, St]);
790
790
  I(() => {
791
- if (Ye && Y && w && O) {
791
+ if (Je && X && T && k) {
792
792
  if (z || et(!0), Object.keys(H).length === 0) {
793
- let e = A ? We(A) : null;
793
+ let e = j ? Ue(j) : null;
794
794
  if (e) {
795
- let t = xe({
796
- entity: w,
795
+ let t = De({
796
+ entity: T,
797
797
  formData: e,
798
798
  record: void 0,
799
799
  isNew: !0
800
800
  });
801
- Te(t).forEach((e) => {
802
- x.registerDraft({
801
+ ve(t).forEach((e) => {
802
+ S.registerDraft({
803
803
  fileId: e,
804
804
  discard: () => ne(e)
805
805
  });
@@ -812,19 +812,19 @@ function yt({ screenCode: t }) {
812
812
  t[n] = r;
813
813
  return;
814
814
  }
815
- let i = Ae(w, Y, n);
816
- t[n] = Le(w, n) ? i ?? null : i ?? "";
815
+ let i = ke(T, X, n);
816
+ t[n] = Ie(T, n) ? i ?? null : i ?? "";
817
817
  }), rt(t);
818
818
  }
819
- if (w.children !== void 0 && w.children.length > 0 && G === void 0) {
820
- let e = Y.$children;
819
+ if (T.children !== void 0 && T.children.length > 0 && G === void 0) {
820
+ let e = X.$children;
821
821
  if (e && Object.keys(e).length > 0) {
822
822
  let t = {};
823
823
  for (let [n, r] of Object.entries(e)) {
824
824
  let e = _?.entities[n];
825
825
  t[n] = r.map((t) => ({
826
826
  ...t,
827
- _key: vt(e, t)
827
+ _key: yt(e, t)
828
828
  }));
829
829
  }
830
830
  K(t), q(e);
@@ -836,84 +836,84 @@ function yt({ screenCode: t }) {
836
836
  }, { replace: !0 });
837
837
  }
838
838
  }, [
839
- Ye,
840
- Y,
839
+ Je,
840
+ X,
841
841
  Vt,
842
- O,
843
- w,
842
+ k,
843
+ T,
844
844
  G,
845
845
  _
846
846
  ]), I(() => {
847
- j && de && w?.children && w.children.length !== 0 && G === void 0 && (K({}), q({}));
847
+ M && ue && T?.children && T.children.length !== 0 && G === void 0 && (K({}), q({}));
848
848
  }, [
849
- j,
850
- de,
851
- w?.children
849
+ M,
850
+ ue,
851
+ T?.children
852
852
  ]);
853
- let Ht = F(async () => {
854
- if (await x.flushAllDrafts(), j) {
855
- let e = X?.route?.replace("/:id", "") ?? "/";
856
- u(e);
857
- } else et(!1), rt({}), it({}), ot({}), K(void 0), q(void 0), xt(!1);
853
+ let Ht = Ye(async () => {
854
+ if (await S.flushAllDrafts(), M) {
855
+ let e = Z?.route?.replace("/:id", "") ?? "/";
856
+ f(e);
857
+ } else et(!1), rt({}), it({}), ot({}), K(void 0), q(void 0), J(!1);
858
858
  }, [
859
- x,
860
- j,
861
- X,
862
- u
863
- ]), Ut = F((e, t) => {
859
+ S,
860
+ M,
861
+ Z,
862
+ f
863
+ ]), Ut = Ye((e, t) => {
864
864
  rt((n) => ({
865
865
  ...n,
866
866
  [e]: t
867
867
  }));
868
- }, []), Q = L(() => {
869
- if (!X?.route) return "/";
870
- let e = X.route.split("/");
868
+ }, []), $ = L(() => {
869
+ if (!Z?.route) return "/";
870
+ let e = Z.route.split("/");
871
871
  return e.pop(), e.join("/") || "/";
872
- }, [X]), Wt = L(() => !_?.screens || !Q || Q === "/" ? !1 : Object.values(_.screens).some((e) => e.route === Q), [_, Q]), Gt = F(() => {
872
+ }, [Z]), Wt = L(() => !_?.screens || !$ || $ === "/" ? !1 : Object.values(_.screens).some((e) => e.route === $), [_, $]), Gt = Ye(() => {
873
873
  if (!Wt) {
874
- u("/");
874
+ f("/");
875
875
  return;
876
876
  }
877
- let e = Bt(Q)?.search ?? "";
878
- u(e ? `${Q}?${e}` : Q);
877
+ let e = Bt($)?.search ?? "";
878
+ f(e ? `${$}?${e}` : $);
879
879
  }, [
880
880
  Wt,
881
- Q,
881
+ $,
882
882
  Bt,
883
- u
884
- ]), Kt = Ce({ fallback: Gt }), qt = !k && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = L(() => {
885
- if (!w) return {};
883
+ f
884
+ ]), Kt = we({ fallback: Gt }), qt = !A && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = L(() => {
885
+ if (!T) return {};
886
886
  let e = {};
887
- for (let t of dt(w, H, j)) Vt.has(t) && (e[t] = a("record.field.required", "Required"));
888
- for (let t of pt(w, H)) Vt.has(t) && (e[t] = c("record.email_invalid", "This is not a valid email address."));
887
+ for (let t of dt(T, H, M)) Vt.has(t) && (e[t] = o("record.field.required", "Required"));
888
+ for (let t of pt(T, H)) Vt.has(t) && (e[t] = s("record.email_invalid", "This is not a valid email address."));
889
889
  return e;
890
890
  }, [
891
- a,
892
- c,
893
- w,
891
+ o,
892
+ s,
893
+ T,
894
894
  H,
895
- j,
895
+ M,
896
896
  Vt
897
- ]), Yt = Object.keys(Jt).length > 0, Xt = F(() => {
898
- if (!T || !w || j && !de || !j && !O || (xt(!0), Yt)) return;
899
- let e = {}, t = xe({
900
- entity: w,
897
+ ]), Yt = Object.keys(Jt).length > 0, Xt = Ye(() => {
898
+ if (!E || !T || M && !ue || !M && !k || (J(!0), Yt)) return;
899
+ let e = {}, t = De({
900
+ entity: T,
901
901
  formData: H,
902
- record: Y,
903
- isNew: j
904
- }), n = Te(t);
905
- if (j) for (let [t, n] of Object.entries(H)) {
906
- if (w.files?.has(t)) continue;
907
- let r = je(w, t, n);
902
+ record: X,
903
+ isNew: M
904
+ }), n = ve(t);
905
+ if (M) for (let [t, n] of Object.entries(H)) {
906
+ if (T.files?.has(t)) continue;
907
+ let r = Ae(T, t, n);
908
908
  r !== "" && r != null && (e[t] = r);
909
909
  }
910
910
  else {
911
911
  for (let [t, n] of Object.entries(H)) {
912
- if (w.files?.has(t)) continue;
913
- let r = Y ? Ae(w, Y, t) : void 0, i = je(w, t, n), a = je(w, t, r);
912
+ if (T.files?.has(t)) continue;
913
+ let r = X ? ke(T, X, t) : void 0, i = Ae(T, t, n), a = Ae(T, t, r);
914
914
  (i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
915
915
  }
916
- Z && (e.$row_version = Z);
916
+ Q && (e.$row_version = Q);
917
917
  }
918
918
  if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(U).length > 0 && (e.$statuses = Object.entries(U).map(([e, t]) => ({
919
919
  status_group_code: e,
@@ -928,67 +928,67 @@ function yt({ screenCode: t }) {
928
928
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
929
929
  return i;
930
930
  }), i = mt?.[e] ?? [];
931
- (j || !_t(r, i)) && (t[e] = r);
931
+ (M || !vt(r, i)) && (t[e] = r);
932
932
  }
933
933
  Object.keys(t).length > 0 && (e.$children = t);
934
934
  }
935
- if (!j && Object.keys(e).length === 0) {
936
- et(!1), it({}), ot({}), K(void 0), q(void 0), xt(!1);
935
+ if (!M && Object.keys(e).length === 0) {
936
+ et(!1), it({}), ot({}), K(void 0), q(void 0), J(!1);
937
937
  return;
938
938
  }
939
939
  let r = () => {
940
- et(!1), ft(!1), xt(!1), it({}), ot({}), K(void 0), q(void 0);
940
+ et(!1), ft(!1), J(!1), it({}), ot({}), K(void 0), q(void 0);
941
941
  };
942
- j ? Ie.mutate(e, { onSuccess: (e) => {
943
- n.forEach((e) => x.markCommitted(e));
944
- let t = e.data, a = w ? m(w, t) : {}, o = i(a);
945
- u(o ? `${Q}/${encodeURIComponent(o)}` : Q, { replace: !0 }), r();
946
- } }) : M && Re.mutate({
947
- pkValues: M,
942
+ M ? Fe.mutate(e, { onSuccess: (e) => {
943
+ n.forEach((e) => S.markCommitted(e));
944
+ let t = e.data, i = T ? a(T, t) : {}, o = c(i);
945
+ f(o ? `${$}/${encodeURIComponent(o)}` : $, { replace: !0 }), r();
946
+ } }) : N && Le.mutate({
947
+ pkValues: N,
948
948
  data: e
949
949
  }, {
950
950
  onSuccess: () => {
951
- n.forEach((e) => x.markCommitted(e)), r();
951
+ n.forEach((e) => S.markCommitted(e)), r();
952
952
  },
953
953
  onError: (e) => {
954
- e instanceof se && e.code === "entity.stale_object" && ft(!0);
954
+ e instanceof oe && e.code === "entity.stale_object" && ft(!0);
955
955
  }
956
956
  });
957
957
  }, [
958
- x,
959
- j,
960
- de,
961
- O,
962
- T,
958
+ S,
959
+ M,
960
+ ue,
961
+ k,
962
+ E,
963
963
  H,
964
964
  Yt,
965
965
  U,
966
966
  W,
967
967
  G,
968
968
  mt,
969
- Ie,
970
- Re,
971
- w,
972
- u,
969
+ Fe,
970
+ Le,
971
+ T,
972
+ f,
973
+ $,
974
+ X,
973
975
  Q,
974
- Y,
975
- Z,
976
- M
977
- ]), Zt = F((e, t) => {
976
+ N
977
+ ]), Zt = Ye((e, t) => {
978
978
  K((n) => ({
979
979
  ...n ?? {},
980
980
  [e]: t
981
981
  }));
982
- }, []), Qt = F(() => {
983
- M && !j && pe && ze.mutate(M);
982
+ }, []), Qt = Ye(() => {
983
+ N && !M && pe && Re.mutate(N);
984
984
  }, [
985
+ N,
985
986
  M,
986
- j,
987
987
  pe,
988
- ze
988
+ Re
989
989
  ]), $t = L(() => ht(G, _), [G, _]), en = Object.keys($t).length > 0;
990
- if (!X || !w) return null;
991
- if (!j && ke) return /* @__PURE__ */ B(Ee, {});
990
+ if (!Z || !T) return null;
991
+ if (!M && Oe) return /* @__PURE__ */ B(Te, {});
992
992
  if (It) return /* @__PURE__ */ V("div", {
993
993
  style: { padding: 24 },
994
994
  children: [/* @__PURE__ */ V("div", {
@@ -998,10 +998,10 @@ function yt({ screenCode: t }) {
998
998
  gap: 8,
999
999
  marginBottom: 8
1000
1000
  },
1001
- children: [qt && /* @__PURE__ */ B(o, {
1001
+ children: [qt && /* @__PURE__ */ B(C, {
1002
1002
  icon: /* @__PURE__ */ B(e.back, { size: 14 }),
1003
1003
  onClick: Kt.goBack,
1004
- title: a("record.back", "Back")
1004
+ title: o("record.back", "Back")
1005
1005
  }), /* @__PURE__ */ B("h1", {
1006
1006
  style: {
1007
1007
  margin: 0,
@@ -1009,14 +1009,14 @@ function yt({ screenCode: t }) {
1009
1009
  fontWeight: 600,
1010
1010
  color: "var(--text)"
1011
1011
  },
1012
- children: a("record.create_closed.title", "Not Available")
1012
+ children: o("record.create_closed.title", "Not Available")
1013
1013
  })]
1014
1014
  }), /* @__PURE__ */ B("p", {
1015
1015
  style: { color: "var(--text-3)" },
1016
- children: a("record.create_closed.body", "This record type is not created from a form.")
1016
+ children: o("record.create_closed.body", "This record type is not created from a form.")
1017
1017
  })]
1018
1018
  });
1019
- if (!j && !Y || Ft) return /* @__PURE__ */ V("div", {
1019
+ if (!M && !X || Ft) return /* @__PURE__ */ V("div", {
1020
1020
  style: { padding: 24 },
1021
1021
  children: [/* @__PURE__ */ V("div", {
1022
1022
  style: {
@@ -1025,10 +1025,10 @@ function yt({ screenCode: t }) {
1025
1025
  gap: 8,
1026
1026
  marginBottom: 8
1027
1027
  },
1028
- children: [qt && /* @__PURE__ */ B(o, {
1028
+ children: [qt && /* @__PURE__ */ B(C, {
1029
1029
  icon: /* @__PURE__ */ B(e.back, { size: 14 }),
1030
1030
  onClick: Kt.goBack,
1031
- title: a("record.back", "Back")
1031
+ title: o("record.back", "Back")
1032
1032
  }), /* @__PURE__ */ B("h1", {
1033
1033
  style: {
1034
1034
  margin: 0,
@@ -1036,32 +1036,32 @@ function yt({ screenCode: t }) {
1036
1036
  fontWeight: 600,
1037
1037
  color: "var(--text)"
1038
1038
  },
1039
- children: a("record.missing.title", "Not Found")
1039
+ children: o("record.missing.title", "Not Found")
1040
1040
  })]
1041
1041
  }), /* @__PURE__ */ B("p", {
1042
1042
  style: { color: "var(--text-3)" },
1043
- children: c("entity.not_found", "This record does not exist.")
1043
+ children: s("entity.not_found", "This record does not exist.")
1044
1044
  })]
1045
1045
  });
1046
- let tn = w.display, nn = a(X.display?.name) || a(tn.name), rn = re(a, Y, w), an = j ? a("record.new_title", "New {name}", { name: nn }) : rn ? String(rn) : nn, on = Ie.isPending || Re.isPending, sn = X.responsive?.[S.category]?.layout, cn = sn?.tabs ?? (S.isPhone ? "sections" : void 0), ln = sn?.header_card === !0 ? Je({
1047
- entity: w,
1048
- screen: X
1049
- }) : void 0, $ = {
1046
+ let tn = T.display, nn = o(Z.display?.name) || o(tn.name), rn = l(o, X, T), an = M ? o("record.new_title", "New {name}", { name: nn }) : rn ? String(rn) : nn, on = Fe.isPending || Le.isPending, sn = Z.responsive?.[te.category]?.layout, cn = sn?.tabs ?? (te.isPhone ? "sections" : void 0), ln = sn?.header_card === !0 ? qe({
1047
+ entity: T,
1048
+ screen: Z
1049
+ }) : void 0, un = {
1050
1050
  schema: _,
1051
- entity: w,
1052
- entityCode: T,
1053
- recordId: N ?? A ?? "",
1054
- record: J ? {
1055
- ...Y ?? {},
1051
+ entity: T,
1052
+ entityCode: E,
1053
+ recordId: P ?? j ?? "",
1054
+ record: Y ? {
1055
+ ...X ?? {},
1056
1056
  ...H
1057
- } : Y ?? {},
1058
- isNew: j,
1059
- mode: J ? "edit" : "display",
1060
- onFieldChange: J ? Ut : void 0,
1057
+ } : X ?? {},
1058
+ isNew: M,
1059
+ mode: Y ? "edit" : "display",
1060
+ onFieldChange: Y ? Ut : void 0,
1061
1061
  refs: At,
1062
1062
  objectProperties: (() => {
1063
- let e = Ge ?? [];
1064
- if (!J || Object.keys(W).length === 0) return e.length > 0 ? e : void 0;
1063
+ let e = We ?? [];
1064
+ if (!Y || Object.keys(W).length === 0) return e.length > 0 ? e : void 0;
1065
1065
  let t = e.map((e) => W[e.property_code] === void 0 ? e : {
1066
1066
  ...e,
1067
1067
  value: W[e.property_code]
@@ -1074,14 +1074,14 @@ function yt({ screenCode: t }) {
1074
1074
  });
1075
1075
  return t;
1076
1076
  })(),
1077
- onSetProperty: j || !O ? void 0 : J ? (e, t) => ot((n) => ({
1077
+ onSetProperty: M || !k ? void 0 : Y ? (e, t) => ot((n) => ({
1078
1078
  ...n,
1079
1079
  [e]: t
1080
1080
  })) : void 0,
1081
1081
  isPropertyPending: !1,
1082
1082
  objectStatuses: (() => {
1083
- let e = He ?? [];
1084
- if (!J || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
1083
+ let e = Ve ?? [];
1084
+ if (!Y || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
1085
1085
  let t = e.map((e) => U[e.group_code] === void 0 ? e : {
1086
1086
  ...e,
1087
1087
  status_code: U[e.group_code]
@@ -1094,59 +1094,59 @@ function yt({ screenCode: t }) {
1094
1094
  });
1095
1095
  return t;
1096
1096
  })(),
1097
- onSetStatus: j || !O ? void 0 : J ? (e, t) => it((n) => ({
1097
+ onSetStatus: M || !k ? void 0 : Y ? (e, t) => it((n) => ({
1098
1098
  ...n,
1099
1099
  [e]: t
1100
1100
  })) : void 0,
1101
1101
  isStatusPending: !1,
1102
- pendingChildren: J ? G : void 0,
1103
- onChildrenChange: J ? Zt : void 0,
1104
- childValidationErrors: J ? $t : void 0,
1105
- fieldErrors: J && yt ? Jt : void 0,
1102
+ pendingChildren: Y ? G : void 0,
1103
+ onChildrenChange: Y ? Zt : void 0,
1104
+ childValidationErrors: Y ? $t : void 0,
1105
+ fieldErrors: Y && bt ? Jt : void 0,
1106
1106
  detailTabsPresentation: cn,
1107
1107
  relatedRecordsPresentation: sn?.related_records
1108
- }, un = !!X.sidebar && X.sidebar.length > 0, dn = sn?.sidebar === "hidden", fn = un && !dn && !S.isDesktop, pn = un && !dn && S.isDesktop, mn = !j && Y ? /* @__PURE__ */ B(ct, {
1109
- screen: X,
1110
- entity: w,
1111
- entityCode: T,
1112
- record: Y,
1108
+ }, dn = !!Z.sidebar && Z.sidebar.length > 0, fn = sn?.sidebar === "hidden", pn = dn && !fn && !te.isDesktop, mn = dn && !fn && te.isDesktop, hn = !M && X ? /* @__PURE__ */ B(ct, {
1109
+ screen: Z,
1110
+ entity: T,
1111
+ entityCode: E,
1112
+ record: X,
1113
1113
  refs: At,
1114
- objectStatuses: He,
1114
+ objectStatuses: Ve,
1115
1115
  schema: _
1116
- }) : void 0, hn = /* @__PURE__ */ B(Ct, {
1116
+ }) : void 0, gn = /* @__PURE__ */ B(Ct, {
1117
1117
  title: an,
1118
- recordId: A,
1119
- editing: J,
1120
- isNew: j,
1118
+ recordId: j,
1119
+ editing: Y,
1120
+ isNew: M,
1121
1121
  isRecordDeleted: Mt,
1122
1122
  dirty: z,
1123
1123
  isSaving: on,
1124
1124
  hasChildErrors: en,
1125
- hasFieldErrors: yt && Yt,
1125
+ hasFieldErrors: bt && Yt,
1126
1126
  canRestore: pe,
1127
- entity: w,
1128
- screen: X,
1127
+ entity: T,
1128
+ screen: Z,
1129
1129
  globalActions: _?.actions,
1130
- entityCode: T,
1131
- record: Y,
1132
- id: A,
1133
- listRoute: Q,
1130
+ entityCode: E,
1131
+ record: X,
1132
+ id: j,
1133
+ listRoute: $,
1134
1134
  listRouteExists: !!Wt,
1135
- highlights: mn,
1135
+ highlights: hn,
1136
1136
  showBack: qt,
1137
1137
  onBack: Kt.goBack,
1138
1138
  onCancelEdit: Ht,
1139
1139
  onSave: Xt,
1140
1140
  onRestore: Qt,
1141
- isRestoring: ze.isPending,
1141
+ isRestoring: Re.isPending,
1142
1142
  refreshControl: {
1143
- refetch: P.refetch,
1144
- isLoading: P.isLoading,
1145
- isLive: Pe
1143
+ refetch: F.refetch,
1144
+ isLoading: F.isLoading,
1145
+ isLive: Ne
1146
1146
  },
1147
- isRealtimeEntity: w?.realtime === !0,
1148
- canManageTemplates: Ue(_)
1149
- }), gn = Mt && /* @__PURE__ */ V("div", {
1147
+ isRealtimeEntity: T?.realtime === !0,
1148
+ canManageTemplates: He(_)
1149
+ }), _n = Mt && /* @__PURE__ */ V("div", {
1150
1150
  style: {
1151
1151
  display: "flex",
1152
1152
  alignItems: "center",
@@ -1159,8 +1159,8 @@ function yt({ screenCode: t }) {
1159
1159
  color: "var(--danger)",
1160
1160
  fontSize: 12.5
1161
1161
  },
1162
- children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: a("record.deleted_banner", "This record was deleted on {date}", { date: v(String(Y[w.soft_delete])) }) })]
1163
- }), _n = lt && /* @__PURE__ */ V("div", {
1162
+ children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: o("record.deleted_banner", "This record was deleted on {date}", { date: ie(String(X[T.soft_delete])) }) })]
1163
+ }), vn = lt && /* @__PURE__ */ V("div", {
1164
1164
  style: {
1165
1165
  display: "flex",
1166
1166
  alignItems: "center",
@@ -1173,79 +1173,79 @@ function yt({ screenCode: t }) {
1173
1173
  color: "var(--warn)",
1174
1174
  fontSize: 12.5
1175
1175
  },
1176
- children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: a("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
1177
- }), vn = J && yt && Yt && /* @__PURE__ */ B(st, {
1176
+ children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: o("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
1177
+ }), yn = Y && bt && Yt && /* @__PURE__ */ B(st, {
1178
1178
  errors: Object.entries(Jt).map(([e, t]) => {
1179
- let n = w.fields.get(e);
1179
+ let n = T.fields.get(e);
1180
1180
  return {
1181
1181
  name: e,
1182
- label: n ? d(a, n, e, _?.entities) : e,
1182
+ label: n ? i(o, n, e, _?.entities) : e,
1183
1183
  message: t
1184
1184
  };
1185
1185
  }),
1186
1186
  onJump: (e) => {
1187
- let t = document.getElementById(`${T}-${e}`);
1187
+ let t = document.getElementById(`${E}-${e}`);
1188
1188
  t && (t.scrollIntoView({
1189
1189
  block: "center",
1190
1190
  behavior: "smooth"
1191
1191
  }), t.focus?.());
1192
1192
  }
1193
- }), yn = Be && !j && !(X.items && X.items.length > 0) && /* @__PURE__ */ B("div", {
1193
+ }), bn = ze && !M && !(Z.items && Z.items.length > 0) && /* @__PURE__ */ B("div", {
1194
1194
  className: "mb-4",
1195
- children: /* @__PURE__ */ B(Ke, {
1196
- statusGroups: w.status_groups ?? {},
1197
- objectStatuses: $.objectStatuses,
1198
- onSetStatus: O && J ? (e, t) => it((n) => ({
1195
+ children: /* @__PURE__ */ B(Ge, {
1196
+ statusGroups: T.status_groups ?? {},
1197
+ objectStatuses: un.objectStatuses,
1198
+ onSetStatus: k && Y ? (e, t) => it((n) => ({
1199
1199
  ...n,
1200
1200
  [e]: t
1201
1201
  })) : gt,
1202
1202
  isPending: !1,
1203
- mode: J ? "edit" : "display"
1203
+ mode: Y ? "edit" : "display"
1204
1204
  })
1205
- }), bn = w.evidence_covered && !j && Y && /* @__PURE__ */ B("div", {
1205
+ }), xn = T.evidence_covered && !M && X && /* @__PURE__ */ B("div", {
1206
1206
  className: "mb-4",
1207
- children: /* @__PURE__ */ B(ut, { evidence: Y.$evidence })
1208
- }), xn = /* @__PURE__ */ V(tt, { children: [
1209
- ln && (Y || j) && /* @__PURE__ */ B(bt, {
1207
+ children: /* @__PURE__ */ B(ut, { evidence: X.$evidence })
1208
+ }), Sn = /* @__PURE__ */ V(tt, { children: [
1209
+ ln && (X || M) && /* @__PURE__ */ B(xt, {
1210
1210
  card: ln,
1211
- entity: w,
1212
- record: $.record,
1213
- objectStatuses: $.objectStatuses,
1214
- objectProperties: $.objectProperties
1211
+ entity: T,
1212
+ record: un.record,
1213
+ objectStatuses: un.objectStatuses,
1214
+ objectProperties: un.objectProperties
1215
1215
  }),
1216
- X.items && X.items.length > 0 && (Y || j) && _ && /* @__PURE__ */ B(qe, {
1217
- nodes: X.items,
1218
- ctx: $
1216
+ Z.items && Z.items.length > 0 && (X || M) && _ && /* @__PURE__ */ B(Ke, {
1217
+ nodes: Z.items,
1218
+ ctx: un
1219
1219
  }),
1220
- !j && A && T && w.associations && Object.keys(w.associations).length > 0 && _ && /* @__PURE__ */ B(nt, {
1221
- entityCode: T,
1222
- recordId: N ?? A ?? "",
1223
- associations: w.associations,
1220
+ !M && j && E && T.associations && Object.keys(T.associations).length > 0 && _ && /* @__PURE__ */ B(nt, {
1221
+ entityCode: E,
1222
+ recordId: P ?? j ?? "",
1223
+ associations: T.associations,
1224
1224
  schema: _
1225
1225
  }),
1226
- !j && A && T && /* @__PURE__ */ B(at, {
1227
- entityCode: T,
1228
- objectId: N ?? A,
1229
- canGenerateOne: !!w?.documents?.generate_one,
1230
- canManageTemplates: Ue(_)
1226
+ !M && j && E && /* @__PURE__ */ B(at, {
1227
+ entityCode: E,
1228
+ objectId: P ?? j,
1229
+ canGenerateOne: !!T?.documents?.generate_one,
1230
+ canManageTemplates: He(_)
1231
1231
  }),
1232
- !j && Y && _ && /* @__PURE__ */ B(he, {
1233
- screen: X,
1234
- entity: w,
1235
- entityCode: T,
1236
- record: Y,
1232
+ !M && X && _ && /* @__PURE__ */ B(me, {
1233
+ screen: Z,
1234
+ entity: T,
1235
+ entityCode: E,
1236
+ record: X,
1237
1237
  refs: At,
1238
1238
  schema: _
1239
1239
  })
1240
- ] }), Sn = /* @__PURE__ */ V(tt, { children: [
1241
- hn,
1242
- _n,
1240
+ ] }), Cn = /* @__PURE__ */ V(tt, { children: [
1243
1241
  gn,
1244
1242
  vn,
1243
+ _n,
1245
1244
  yn,
1246
- bn
1245
+ bn,
1246
+ xn
1247
1247
  ] });
1248
- return pn ? /* @__PURE__ */ V("div", {
1248
+ return mn ? /* @__PURE__ */ V("div", {
1249
1249
  style: {
1250
1250
  height: "100%",
1251
1251
  display: "flex",
@@ -1259,16 +1259,16 @@ function yt({ screenCode: t }) {
1259
1259
  minWidth: 0,
1260
1260
  height: "100%"
1261
1261
  },
1262
- children: /* @__PURE__ */ B(me, {
1262
+ children: /* @__PURE__ */ B(fe, {
1263
1263
  scrollRef: Pt,
1264
- header: Sn,
1265
- children: xn
1264
+ header: Cn,
1265
+ children: Sn
1266
1266
  })
1267
1267
  }),
1268
1268
  /* @__PURE__ */ B("div", {
1269
1269
  className: "detail-resize-handle",
1270
1270
  onMouseDown: kt,
1271
- title: a("record.layout.drag_to_resize", "Drag to resize"),
1271
+ title: o("record.layout.drag_to_resize", "Drag to resize"),
1272
1272
  children: /* @__PURE__ */ B("div", { style: {
1273
1273
  position: "absolute",
1274
1274
  top: 0,
@@ -1286,16 +1286,16 @@ function yt({ screenCode: t }) {
1286
1286
  height: "100%",
1287
1287
  width: `${Tt}px`
1288
1288
  },
1289
- children: (Y || j) && _ && /* @__PURE__ */ B(qe, {
1290
- nodes: X.sidebar,
1291
- ctx: $
1289
+ children: (X || M) && _ && /* @__PURE__ */ B(Ke, {
1290
+ nodes: Z.sidebar,
1291
+ ctx: un
1292
1292
  })
1293
1293
  })
1294
1294
  ]
1295
- }) : /* @__PURE__ */ V(me, {
1295
+ }) : /* @__PURE__ */ V(fe, {
1296
1296
  scrollRef: Pt,
1297
- header: Sn,
1298
- children: [xn, fn && (Y || j) && _ && /* @__PURE__ */ B("div", {
1297
+ header: Cn,
1298
+ children: [Sn, pn && (X || M) && _ && /* @__PURE__ */ B("div", {
1299
1299
  "data-testid": "detail-sidebar-inline",
1300
1300
  style: {
1301
1301
  display: "flex",
@@ -1303,24 +1303,24 @@ function yt({ screenCode: t }) {
1303
1303
  gap: 16,
1304
1304
  minWidth: 0
1305
1305
  },
1306
- children: /* @__PURE__ */ B(qe, {
1307
- nodes: X.sidebar,
1308
- ctx: $
1306
+ children: /* @__PURE__ */ B(Ke, {
1307
+ nodes: Z.sidebar,
1308
+ ctx: un
1309
1309
  })
1310
1310
  })]
1311
1311
  });
1312
1312
  }
1313
- function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1314
- let a = E(), o = (e) => {
1315
- let o = xt(a, t, e, n, r, i);
1316
- return o != null && _(o) !== "";
1313
+ function xt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1314
+ let a = D(), o = (e) => {
1315
+ let o = J(a, t, e, n, r, i);
1316
+ return o != null && d(o) !== "";
1317
1317
  }, s = (e) => {
1318
- let o = xt(a, t, e, n, r, i);
1319
- return _(o) || /* @__PURE__ */ B("span", {
1318
+ let o = J(a, t, e, n, r, i);
1319
+ return d(o) || /* @__PURE__ */ B("span", {
1320
1320
  style: { color: "var(--text-3)" },
1321
1321
  children: "-"
1322
1322
  });
1323
- }, c = e.titleUsesDisplay ? re(a, n, t) : e.titleField ? xt(a, t, e.titleField, n, r, i) : void 0, l = _(c) || a(t.display?.name) || a("record.fallback_title", "Record"), u = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
1323
+ }, c = e.titleUsesDisplay ? l(a, n, t) : e.titleField ? J(a, t, e.titleField, n, r, i) : void 0, u = d(c) || a(t.display?.name) || a("record.fallback_title", "Record"), f = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), p = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), m = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
1324
1324
  return /* @__PURE__ */ V("section", {
1325
1325
  "data-testid": "detail-header-card",
1326
1326
  style: {
@@ -1344,7 +1344,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1344
1344
  color: "var(--text)",
1345
1345
  overflowWrap: "anywhere"
1346
1346
  },
1347
- children: l
1347
+ children: u
1348
1348
  }), e.subtitleField && /* @__PURE__ */ B("div", {
1349
1349
  style: {
1350
1350
  marginTop: 4,
@@ -1356,14 +1356,14 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1356
1356
  children: s(e.subtitleField)
1357
1357
  })]
1358
1358
  }),
1359
- u.length > 0 && /* @__PURE__ */ B("div", {
1359
+ f.length > 0 && /* @__PURE__ */ B("div", {
1360
1360
  style: {
1361
1361
  display: "flex",
1362
1362
  flexWrap: "wrap",
1363
1363
  gap: 6,
1364
1364
  marginTop: 10
1365
1365
  },
1366
- children: u.map((e) => /* @__PURE__ */ B("span", {
1366
+ children: f.map((e) => /* @__PURE__ */ B("span", {
1367
1367
  style: {
1368
1368
  minWidth: 0,
1369
1369
  maxWidth: "100%",
@@ -1378,7 +1378,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1378
1378
  children: s(e)
1379
1379
  }, e))
1380
1380
  }),
1381
- d.length > 0 && /* @__PURE__ */ B("dl", {
1381
+ p.length > 0 && /* @__PURE__ */ B("dl", {
1382
1382
  style: {
1383
1383
  display: "grid",
1384
1384
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -1387,7 +1387,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1387
1387
  fontSize: 12.5,
1388
1388
  lineHeight: 1.35
1389
1389
  },
1390
- children: d.map((e) => /* @__PURE__ */ V("div", {
1390
+ children: p.map((e) => /* @__PURE__ */ V("div", {
1391
1391
  style: { display: "contents" },
1392
1392
  children: [/* @__PURE__ */ B("dt", {
1393
1393
  style: { color: "var(--text-3)" },
@@ -1403,7 +1403,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1403
1403
  })]
1404
1404
  }, e))
1405
1405
  }),
1406
- f.length > 0 && /* @__PURE__ */ B("div", {
1406
+ m.length > 0 && /* @__PURE__ */ B("div", {
1407
1407
  style: {
1408
1408
  display: "flex",
1409
1409
  flexWrap: "wrap",
@@ -1412,7 +1412,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1412
1412
  color: "var(--text-3)",
1413
1413
  fontSize: 11.5
1414
1414
  },
1415
- children: f.map((e) => /* @__PURE__ */ V("span", {
1415
+ children: m.map((e) => /* @__PURE__ */ V("span", {
1416
1416
  style: {
1417
1417
  minWidth: 0,
1418
1418
  overflowWrap: "anywhere"
@@ -1427,7 +1427,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1427
1427
  ]
1428
1428
  });
1429
1429
  }
1430
- function xt(e, t, n, r, i, a) {
1430
+ function J(e, t, n, r, i, a) {
1431
1431
  if (n.startsWith("$status.")) {
1432
1432
  let t = n.slice(8), r = i?.find((e) => e.group_code === t);
1433
1433
  return e(r?.status_name) || r?.status_code;
@@ -1436,67 +1436,67 @@ function xt(e, t, n, r, i, a) {
1436
1436
  let e = n.slice(10);
1437
1437
  return a?.find((t) => t.property_code === e)?.value;
1438
1438
  }
1439
- return Ae(t, r, n);
1439
+ return ke(t, r, n);
1440
1440
  }
1441
1441
  function St(e, t, n) {
1442
1442
  if (n.startsWith("$status.")) return n.slice(8);
1443
1443
  if (n.startsWith("$property.")) return n.slice(10);
1444
1444
  let r = t.fields.get(n);
1445
- return r ? d(e, r, n) : n;
1445
+ return r ? i(e, r, n) : n;
1446
1446
  }
1447
- function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: u, isSaving: d, hasChildErrors: f, hasFieldErrors: p, canRestore: m, entity: h, screen: _, globalActions: v, entityCode: y, record: b, id: x, listRoute: S, listRouteExists: ne, highlights: re, showBack: ie, onBack: C, onCancelEdit: ae, onSave: oe, onRestore: se, isRestoring: ce, refreshControl: le, isRealtimeEntity: ue, canManageTemplates: de }) {
1448
- let D = E(), O = E("errors"), { run: fe } = g(), me = w("detail"), he = be(), k = r(), A = ee(_?.action_layout, h?.action_layout, h?.actions, v, "detail_toolbar"), j = ee(_?.action_layout, h?.action_layout, h?.actions, v, "detail"), M = l(D, j, h?.actions, v, b ?? {}, [], Ne(h, b ?? {})), N = l(D, A, h?.actions, v, b ?? {}, [], Ne(h, b ?? {})), ve = L(() => {
1447
+ function Ct({ title: n, recordId: i, editing: a, isNew: s, isRecordDeleted: c, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: p, canRestore: m, entity: h, screen: v, globalActions: b, entityCode: x, record: S, id: C, listRoute: ee, listRouteExists: te, highlights: ne, showBack: re, onBack: w, onCancelEdit: ie, onSave: ae, onRestore: oe, isRestoring: se, refreshControl: ce, isRealtimeEntity: le, canManageTemplates: ue }) {
1448
+ let O = D(), k = D("errors"), { run: de } = y(), fe = T("detail"), me = _e(), A = r(), j = g(v?.action_layout, h?.action_layout, h?.actions, b, "detail_toolbar"), M = g(v?.action_layout, h?.action_layout, h?.actions, b, "detail"), N = f(O, M, h?.actions, b, S ?? {}, [], Me(h, S ?? {})), P = f(O, j, h?.actions, b, S ?? {}, [], Me(h, S ?? {})), ge = L(() => {
1449
1449
  if (!h) return;
1450
- let e = x ? [x] : [];
1450
+ let e = C ? [C] : [];
1451
1451
  return {
1452
1452
  entity: h,
1453
- entityCode: y ?? "",
1454
- screen: _,
1455
- screenRoute: _?.route ?? "",
1456
- selectedRows: b ? [b] : [],
1453
+ entityCode: x ?? "",
1454
+ screen: v,
1455
+ screenRoute: v?.route ?? "",
1456
+ selectedRows: S ? [S] : [],
1457
1457
  selectedIds: e,
1458
- t: D,
1459
- tabNavigate: (e, t) => he(e, {
1458
+ t: O,
1459
+ tabNavigate: (e, t) => me(e, {
1460
1460
  title: t?.title,
1461
1461
  icon: t?.icon,
1462
1462
  search: t?.search
1463
1463
  }),
1464
- runActionApi: (e, t) => P(e, t)
1464
+ runActionApi: (e, t) => F(e, t)
1465
1465
  };
1466
1466
  }, [
1467
1467
  h,
1468
- y,
1469
- _,
1470
1468
  x,
1471
- b,
1472
- D,
1473
- he
1474
- ]), xe = (e, t) => {
1475
- let n = Ie(O, e, t, { row: b ?? void 0 });
1469
+ v,
1470
+ C,
1471
+ S,
1472
+ O,
1473
+ me
1474
+ ]), ve = (e, t) => {
1475
+ let n = Fe(k, e, t, { row: S ?? void 0 });
1476
1476
  if (n === null) return;
1477
- let r = x ? [x] : [], i = e === "__delete" && ne ? S : null;
1478
- return fe({
1477
+ let r = C ? [C] : [], i = e === "__delete" && te ? ee : null;
1478
+ return de({
1479
1479
  action: t,
1480
- title: D(t.display?.name) || e,
1481
- row: b ?? void 0,
1482
- execute: (e) => P(n, ge(e, r)),
1480
+ title: O(t.display?.name) || e,
1481
+ row: S ?? void 0,
1482
+ execute: (e) => F(n, he(e, r)),
1483
1483
  onSuccess: i ? () => {
1484
- ye.getState().kill(_e(location)), k(i, { replace: !0 });
1484
+ ye.getState().kill(Ce(location)), A(i, { replace: !0 });
1485
1485
  } : void 0
1486
1486
  });
1487
- }, Se = me.isVisible("show_actions") && !o && x && M.length > 0 ? /* @__PURE__ */ B(ke, {
1488
- layout: M,
1489
- row: b,
1490
- onRun: xe,
1487
+ }, be = fe.isVisible("show_actions") && !s && C && N.length > 0 ? /* @__PURE__ */ B(Oe, {
1488
+ layout: N,
1489
+ row: S,
1490
+ onRun: ve,
1491
1491
  kind: "detail",
1492
1492
  entityActions: h?.actions,
1493
- globalActions: v,
1493
+ globalActions: b,
1494
1494
  reservedRightWidth: 0,
1495
- widgetContext: ve
1496
- }) : null, Ce = !o && x ? /* @__PURE__ */ B(T, {
1497
- liveObject: le,
1498
- realtime: ue
1499
- }) : null, we = me.isVisible("show_actions") && !o && x && N.length > 0 ? /* @__PURE__ */ V("div", {
1495
+ widgetContext: ge
1496
+ }) : null, xe = !s && C ? /* @__PURE__ */ B(E, {
1497
+ liveObject: ce,
1498
+ realtime: le
1499
+ }) : null, Se = fe.isVisible("show_actions") && !s && C && P.length > 0 ? /* @__PURE__ */ V("div", {
1500
1500
  style: {
1501
1501
  display: "flex",
1502
1502
  justifyContent: "flex-end",
@@ -1504,62 +1504,62 @@ function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
1504
1504
  gap: 8,
1505
1505
  marginTop: 10
1506
1506
  },
1507
- children: [Se ? null : Ce, /* @__PURE__ */ B(ke, {
1508
- layout: N,
1509
- row: b,
1510
- onRun: xe,
1507
+ children: [be ? null : xe, /* @__PURE__ */ B(Oe, {
1508
+ layout: P,
1509
+ row: S,
1510
+ onRun: ve,
1511
1511
  kind: "detail",
1512
1512
  entityActions: h?.actions,
1513
- globalActions: v,
1513
+ globalActions: b,
1514
1514
  reservedRightWidth: 0,
1515
- widgetContext: ve,
1516
- ariaLabel: Se ? D("record.toolbar_actions", "Detail toolbar actions") : D("record.page_actions", "Page actions")
1515
+ widgetContext: ge,
1516
+ ariaLabel: be ? O("record.toolbar_actions", "Detail toolbar actions") : O("record.page_actions", "Page actions")
1517
1517
  })]
1518
- }) : null, Te = me.isVisible("show_actions") && !o && x && y ? /* @__PURE__ */ B(Ge, {
1519
- entityCode: y,
1518
+ }) : null, we = fe.isVisible("show_actions") && !s && C && x ? /* @__PURE__ */ B(We, {
1519
+ entityCode: x,
1520
1520
  scope: "detail",
1521
- objectIds: [x],
1521
+ objectIds: [C],
1522
1522
  capability: h?.documents,
1523
- canManageTemplates: de
1524
- }) : null, Ee = s ? m ? /* @__PURE__ */ B(c, {
1523
+ canManageTemplates: ue
1524
+ }) : null, Te = c ? m ? /* @__PURE__ */ B(o, {
1525
1525
  kind: "primary",
1526
- icon: B(ce ? te : e.refresh, { size: 13 }),
1527
- onClick: se,
1528
- disabled: ce,
1529
- children: ce ? D("record.restoring", "Restoring…") : D("record.restore", "Restore")
1530
- }) : null : a ? /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(c, {
1526
+ icon: B(se ? _ : e.refresh, { size: 13 }),
1527
+ onClick: oe,
1528
+ disabled: se,
1529
+ children: se ? O("record.restoring", "Restoring…") : O("record.restore", "Restore")
1530
+ }) : null : a ? /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(o, {
1531
1531
  icon: /* @__PURE__ */ B(e.x, { size: 13 }),
1532
- onClick: ae,
1533
- disabled: d,
1534
- children: D("dialog.cancel", "Cancel")
1535
- }), /* @__PURE__ */ B(c, {
1532
+ onClick: ie,
1533
+ disabled: u,
1534
+ children: O("dialog.cancel", "Cancel")
1535
+ }), /* @__PURE__ */ B(o, {
1536
1536
  kind: "primary",
1537
- icon: B(d ? te : e.save, { size: 13 }),
1538
- onClick: oe,
1539
- disabled: d || f || p,
1540
- title: f ? D("record.save.fix_child_rows", "Fix errors in child rows") : p ? D("record.save.fix_fields", "Fix the highlighted fields") : void 0,
1541
- children: d ? D("dialog.saving", "Saving…") : D("dialog.save", "Save")
1542
- })] }) : !o && x ? Se ? /* @__PURE__ */ V("span", {
1537
+ icon: B(u ? _ : e.save, { size: 13 }),
1538
+ onClick: ae,
1539
+ disabled: u || d || p,
1540
+ title: d ? O("record.save.fix_child_rows", "Fix errors in child rows") : p ? O("record.save.fix_fields", "Fix the highlighted fields") : void 0,
1541
+ children: u ? O("dialog.saving", "Saving…") : O("dialog.save", "Save")
1542
+ })] }) : !s && C ? be ? /* @__PURE__ */ V("span", {
1543
1543
  style: { display: "contents" },
1544
- children: [Te, Se]
1545
- }) : Te : null;
1544
+ children: [we, be]
1545
+ }) : we : null;
1546
1546
  return /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(pe, {
1547
1547
  icon: h?.display.icon ? /* @__PURE__ */ B(t, {
1548
1548
  name: h.display.icon,
1549
1549
  size: 16
1550
1550
  }) : void 0,
1551
1551
  title: n,
1552
- description: D(_?.display?.description) || D(h?.display?.description),
1552
+ description: O(v?.display?.description) || O(h?.display?.description),
1553
1553
  recordId: i,
1554
- highlights: re,
1555
- identityControls: !s && !a && !o ? Ce : null,
1556
- mode: o ? "create" : a ? "edit" : "display",
1557
- dirty: u,
1558
- showBack: ie,
1559
- onBack: C,
1560
- right: Ee,
1561
- showTitle: me.isVisible("show_title")
1562
- }), we] });
1554
+ highlights: ne,
1555
+ identityControls: !c && !a && !s ? xe : null,
1556
+ mode: s ? "create" : a ? "edit" : "display",
1557
+ dirty: l,
1558
+ showBack: re,
1559
+ onBack: w,
1560
+ right: Te,
1561
+ showTitle: fe.isVisible("show_title")
1562
+ }), Se] });
1563
1563
  }
1564
1564
  //#endregion
1565
1565
  export { q as SmartDetailPage };