@declarion/react 0.66.0 → 0.80.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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/api/auth.js +24 -14
  3. package/dist-lib/app.js +28 -23
  4. package/dist-lib/components/chrome/AssociationTabs.js +35 -38
  5. package/dist-lib/components/chrome/HighlightsStrip.js +2 -1
  6. package/dist-lib/components/chrome/RecordHeader.js +33 -38
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +10 -21
  8. package/dist-lib/components/detail-layout/ChildrenBlock.js +1 -8
  9. package/dist-lib/components/detail-layout/ChildrenCards.js +1 -8
  10. package/dist-lib/components/detail-layout/ChildrenList.js +1 -8
  11. package/dist-lib/components/detail-layout/ChildrenTable.js +1 -8
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +1 -8
  13. package/dist-lib/components/detail-layout/DetailAuditStrip.js +33 -29
  14. package/dist-lib/components/detail-layout/DetailHighlights.js +7 -2
  15. package/dist-lib/components/detail-layout/FieldsBlock.js +12 -9
  16. package/dist-lib/components/detail-layout/LayoutRenderer.js +10 -10
  17. package/dist-lib/components/detail-layout/LayoutTabs.js +49 -48
  18. package/dist-lib/components/detail-layout/SectionBlock.js +20 -28
  19. package/dist-lib/components/detail-layout/visibility.js +28 -0
  20. package/dist-lib/components/fields/IntArrayField.js +37 -33
  21. package/dist-lib/components/fields/NumberField.js +28 -55
  22. package/dist-lib/components/fields/RichTextField.js +1 -1
  23. package/dist-lib/components/fields/TimestampField.js +50 -89
  24. package/dist-lib/components/fields/cells/factories/date.js +13 -14
  25. package/dist-lib/components/fields/cells/factories/money.js +1 -1
  26. package/dist-lib/components/fields/cells/factories/number.js +4 -4
  27. package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
  28. package/dist-lib/components/file-widgets/Grid.js +153 -152
  29. package/dist-lib/components/file-widgets/ImageWidget.js +90 -91
  30. package/dist-lib/components/file-widgets/LabeledSlots.js +1 -0
  31. package/dist-lib/components/file-widgets/helpers.js +15 -19
  32. package/dist-lib/components/file-widgets/host.js +33 -32
  33. package/dist-lib/components/file-widgets/upload.js +10 -6
  34. package/dist-lib/components/layout/Layout.js +125 -123
  35. package/dist-lib/components/pages/NoScreensPage.impl.js +14 -0
  36. package/dist-lib/components/pages/NoScreensPage.js +12 -0
  37. package/dist-lib/components/pages/SmartDetailPage.impl.js +451 -451
  38. package/dist-lib/components/pages/auth/AuthShell.js +62 -61
  39. package/dist-lib/components/pages/auth/CodeInput.js +63 -0
  40. package/dist-lib/components/pages/auth/SignIn.js +12 -4
  41. package/dist-lib/components/pages/auth/SignUp.impl.js +80 -103
  42. package/dist-lib/components/pages/auth/SignUpCode.js +122 -0
  43. package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -55
  44. package/dist-lib/components/pages/list/cardProjection.js +135 -122
  45. package/dist-lib/components/pages/list/columns.js +58 -43
  46. package/dist-lib/components/pages/profile/Profile.impl.js +87 -104
  47. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -1
  48. package/dist-lib/components/params/ParamsBlock.js +6 -17
  49. package/dist-lib/components/params/param-editors.js +14 -10
  50. package/dist-lib/components/primitives/Fields.js +314 -236
  51. package/dist-lib/components/shared/MarkdownRenderer.js +44 -43
  52. package/dist-lib/declarion-react.css +1 -1
  53. package/dist-lib/hooks/useActiveTabFollowsRoute.js +49 -0
  54. package/dist-lib/hooks/useAuth.js +44 -37
  55. package/dist-lib/hooks/useDocumentTitle.js +20 -0
  56. package/dist-lib/hooks/useFollowAgentOpen.js +1 -0
  57. package/dist-lib/hooks/useTabTitle.js +1 -1
  58. package/dist-lib/index.d.ts +21 -7
  59. package/dist-lib/lib/date-text.js +57 -0
  60. package/dist-lib/lib/number-text.js +9 -0
  61. package/dist-lib/lib/timestamp.js +29 -29
  62. package/dist-lib/stores/tabs.js +7 -5
  63. package/dist-lib/testing.d.ts +1 -1
  64. package/dist-lib/testing.js +1 -0
  65. package/dist-lib/{useResponsiveMode-DmrpMbZX.d.ts → useResponsiveMode-D3SKz5z4.d.ts} +20 -9
  66. package/package.json +11 -11
@@ -5,78 +5,78 @@ import { entityAllowsCreateRoute as i, entityAllowsMutation as a, extractPkValue
5
5
  import { useEmbed as f } from "../../embed/EmbedContext.js";
6
6
  import { useFirstScreenSettled as p } from "../../lib/capabilityPrefetch.js";
7
7
  import { useAuthStore as m } from "../../stores/auth.js";
8
- import { useSchema as h } from "../../hooks/useSchema.js";
9
- import { Icon as g } from "../primitives/Icons.js";
10
- import { Btn as _ } from "../primitives/Btn.js";
11
- import { IconBtn as ee } from "../primitives/IconBtn.js";
12
- import { useText as v } from "../../hooks/useText.js";
13
- import { useResponsiveMode as te } from "../../hooks/useResponsiveMode.js";
14
- import { Spinner as ne } from "../primitives/Spinner.js";
15
- import { DynamicIcon as re } from "../shared/DynamicIcon.js";
16
- import { buildActionBody as y, executeAction as ie } from "../../api/data.js";
17
- import { useTabStore as ae } from "../../stores/tabs.js";
18
- import { useReportEmbedDirty as oe } from "../../embed/embed-dirty.js";
19
- import { useEmbedNavigate as se } from "../../embed/useEmbedNavigate.js";
20
- import { useTabNavigate as ce } from "../../hooks/useTabNavigate.js";
21
- import { usePageStateStore as le } from "../../stores/page-state.js";
22
- import { applyRowState as b, resolveActionLayoutForSlot as ue } from "../../lib/actions.js";
23
- import { useScreenIsLive as de } from "../../stores/realtime.js";
24
- import { useActionRunner as x } from "../actions/ActionRunner.js";
25
- import { canonicalUrl as fe } from "../../lib/canonical-url.js";
26
- import { useRegisterRetainedQuery as pe } from "../../hooks/usePageStateRuntime.js";
27
- import { useBrandingChrome as me } from "../../hooks/useBrandingChrome.js";
28
- import { objectQueryKey as he, useObject as ge } from "../../hooks/useObject.js";
29
- import { discardFile as _e } from "../file-widgets/upload.js";
30
- import { FileDraftScope as S, useFileDraftScope as ve } from "../file-widgets/draft-scope.js";
31
- import { getEntityFileField as ye, getSchemaFieldValue as C, serializeSchemaFieldValue as w } from "../file-widgets/host.js";
32
- import { buildFilesPayload as be, collectCommittedFileIds as T } from "../file-widgets/payload.js";
33
- import { useCreateObject as xe, useRestoreEntity as Se, useUpdateObject as Ce } from "../../hooks/useMutations.js";
34
- import { useScreenBack as we } from "../../hooks/useScreenBack.js";
35
- import { usePlainScrollRestoration as Te } from "../../lib/scroll-restoration.js";
36
- import { DetailSkeleton as Ee } from "../shared/LoadingSkeleton.js";
37
- import { dispatchAction as E } from "../../lib/action-dispatch.js";
38
- import { ResponsiveActionBar as D } from "../actions/ResponsiveActionBar.js";
39
- import { effectiveScreenForRecord as De, variantActionCodesForRecord as O } from "../../lib/variants.js";
40
- import { RefreshControl as Oe } from "../shared/RefreshControl.js";
41
- import { useUnsavedInput as ke } from "../../hooks/useUnsavedInput.js";
42
- import { AssociationTabs as Ae } from "../chrome/AssociationTabs.js";
43
- import { DocumentsMenu as je } from "./DocumentsMenu.js";
44
- import { canManageDocumentTemplates as Me } from "../../lib/document-templates.js";
45
- import { RecordPanels as Ne } from "./RecordPanels.js";
46
- import { StatusGroupsDisplay as Pe } from "../shared/StatusGroupsDisplay.js";
47
- import { LayoutRenderer as Fe } from "../detail-layout/LayoutRenderer.js";
48
- import { ErrorSummary as Ie } from "../detail-layout/ErrorSummary.js";
49
- import { DetailHighlights as Le } from "../detail-layout/DetailHighlights.js";
50
- import { DetailAuditStrip as Re } from "../detail-layout/DetailAuditStrip.js";
51
- import { EvidenceBlock as ze } from "../detail-layout/EvidenceBlock.js";
52
- import { RecordHeader as k } from "../chrome/RecordHeader.js";
53
- import { PageShell as Be } from "../chrome/PageShell.js";
54
- import { findInvalidEmailFields as Ve, findMissingRequiredFields as He, validatePendingChildren as Ue } from "../../lib/children-validation.js";
55
- import { takePeekDraft as We } from "../list/peekDraftStore.js";
56
- import { resolveCard as Ge } from "./list/cardProjection.js";
57
- import { useCallback as A, useEffect as j, useMemo as M, useRef as Ke, useState as N } from "react";
58
- import { Fragment as qe, jsx as P, jsxs as F } from "react/jsx-runtime";
59
- import { useLocation as Je, useParams as Ye, useSearchParams as Xe } from "react-router";
8
+ import { useSchema as ee } from "../../hooks/useSchema.js";
9
+ import { Icon as h } from "../primitives/Icons.js";
10
+ import { Btn as g } from "../primitives/Btn.js";
11
+ import { IconBtn as te } from "../primitives/IconBtn.js";
12
+ import { useText as ne } from "../../hooks/useText.js";
13
+ import { useResponsiveMode as re } from "../../hooks/useResponsiveMode.js";
14
+ import { Spinner as _ } from "../primitives/Spinner.js";
15
+ import { DynamicIcon as ie } from "../shared/DynamicIcon.js";
16
+ import { buildActionBody as v, executeAction as ae } from "../../api/data.js";
17
+ import { useTabStore as oe } from "../../stores/tabs.js";
18
+ import { useReportEmbedDirty as se } from "../../embed/embed-dirty.js";
19
+ import { useEmbedNavigate as ce } from "../../embed/useEmbedNavigate.js";
20
+ import { useTabNavigate as le } from "../../hooks/useTabNavigate.js";
21
+ import { usePageStateStore as ue } from "../../stores/page-state.js";
22
+ import { applyRowState as y, resolveActionLayoutForSlot as de } from "../../lib/actions.js";
23
+ import { useScreenIsLive as fe } from "../../stores/realtime.js";
24
+ import { useActionRunner as b } from "../actions/ActionRunner.js";
25
+ import { canonicalUrl as pe } from "../../lib/canonical-url.js";
26
+ import { useRegisterRetainedQuery as me } from "../../hooks/usePageStateRuntime.js";
27
+ import { useBrandingChrome as he } from "../../hooks/useBrandingChrome.js";
28
+ import { objectQueryKey as ge, useObject as _e } from "../../hooks/useObject.js";
29
+ import { discardFile as ve } from "../file-widgets/upload.js";
30
+ import { FileDraftScope as x, useFileDraftScope as ye } from "../file-widgets/draft-scope.js";
31
+ import { getEntityFileField as S, getSchemaFieldValue as be, serializeSchemaFieldValue as C } from "../file-widgets/host.js";
32
+ import { buildFilesPayload as w, collectCommittedFileIds as xe } from "../file-widgets/payload.js";
33
+ import { useCreateObject as Se, useRestoreEntity as Ce, useUpdateObject as we } from "../../hooks/useMutations.js";
34
+ import { useScreenBack as Te } from "../../hooks/useScreenBack.js";
35
+ import { usePlainScrollRestoration as Ee } from "../../lib/scroll-restoration.js";
36
+ import { DetailSkeleton as De } from "../shared/LoadingSkeleton.js";
37
+ import { dispatchAction as T } from "../../lib/action-dispatch.js";
38
+ import { ResponsiveActionBar as E } from "../actions/ResponsiveActionBar.js";
39
+ import { effectiveScreenForRecord as Oe, variantActionCodesForRecord as D } from "../../lib/variants.js";
40
+ import { RefreshControl as ke } from "../shared/RefreshControl.js";
41
+ import { useUnsavedInput as Ae } from "../../hooks/useUnsavedInput.js";
42
+ import { AssociationTabs as je } from "../chrome/AssociationTabs.js";
43
+ import { DocumentsMenu as Me } from "./DocumentsMenu.js";
44
+ import { canManageDocumentTemplates as Ne } from "../../lib/document-templates.js";
45
+ import { RecordPanels as Pe } from "./RecordPanels.js";
46
+ import { StatusGroupsDisplay as Fe } from "../shared/StatusGroupsDisplay.js";
47
+ import { LayoutRenderer as Ie } from "../detail-layout/LayoutRenderer.js";
48
+ import { ErrorSummary as Le } from "../detail-layout/ErrorSummary.js";
49
+ import { DetailHighlights as Re, highlightedFieldCodes as ze } from "../detail-layout/DetailHighlights.js";
50
+ import { DetailAuditStrip as Be } from "../detail-layout/DetailAuditStrip.js";
51
+ import { EvidenceBlock as Ve } from "../detail-layout/EvidenceBlock.js";
52
+ import { RecordHeader as O } from "../chrome/RecordHeader.js";
53
+ import { PageShell as He } from "../chrome/PageShell.js";
54
+ import { findInvalidEmailFields as Ue, findMissingRequiredFields as We, validatePendingChildren as Ge } from "../../lib/children-validation.js";
55
+ import { takePeekDraft as Ke } from "../list/peekDraftStore.js";
56
+ import { resolveCard as qe } from "./list/cardProjection.js";
57
+ import { useCallback as k, useEffect as A, useMemo as j, useRef as Je, useState as M } from "react";
58
+ import { Fragment as Ye, jsx as N, jsxs as P } from "react/jsx-runtime";
59
+ import { useLocation as Xe, useParams as Ze, useSearchParams as Qe } from "react-router";
60
60
  //#region src/components/pages/SmartDetailPage.impl.tsx
61
- var Ze = () => {}, Qe = { expand: ["evidence"] };
62
- function I(e, t) {
61
+ var $e = () => {}, et = { expand: ["evidence"] };
62
+ function F(e, t) {
63
63
  return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
64
64
  }
65
- function $e({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
66
- let c = {}, l = be({
65
+ function tt({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
66
+ let c = {}, l = w({
67
67
  entity: e,
68
68
  formData: t,
69
69
  record: n,
70
70
  isNew: r
71
- }), u = T(l);
71
+ }), u = xe(l);
72
72
  if (r) for (let [n, r] of Object.entries(t)) {
73
73
  if (e.files?.has(n)) continue;
74
- let t = w(e, n, r);
74
+ let t = C(e, n, r);
75
75
  t !== "" && t != null && (c[n] = t);
76
76
  }
77
77
  else for (let [r, i] of Object.entries(t)) {
78
78
  if (e.files?.has(r)) continue;
79
- let t = n ? C(e, n, r) : void 0, a = w(e, r, i), o = w(e, r, t);
79
+ let t = n ? be(e, n, r) : void 0, a = C(e, r, i), o = C(e, r, t);
80
80
  (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (c[r] = a);
81
81
  }
82
82
  if (Object.keys(l).length > 0 && (c.$files = l), Object.keys(i).length > 0 && (c.$statuses = Object.entries(i).map(([e, t]) => ({
@@ -92,7 +92,7 @@ function $e({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, p
92
92
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
93
93
  return i;
94
94
  }), a = s?.[t] ?? [];
95
- (r || !I(i, a)) && (e[t] = i);
95
+ (r || !F(i, a)) && (e[t] = i);
96
96
  }
97
97
  Object.keys(e).length > 0 && (c.$children = e);
98
98
  }
@@ -101,52 +101,52 @@ function $e({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, p
101
101
  committedFileIds: u
102
102
  };
103
103
  }
104
- function et(e, n) {
104
+ function nt(e, n) {
105
105
  if (e) {
106
106
  let t = o(e, n), r = d(t);
107
107
  if (r.replace(/^\|+|\|+$/g, "")) return r;
108
108
  }
109
109
  return n.id == null ? crypto.randomUUID() : t(n.id);
110
110
  }
111
- function L({ screenCode: e }) {
112
- return /* @__PURE__ */ P(S, { children: /* @__PURE__ */ P(R, { screenCode: e }) });
111
+ function I({ screenCode: e }) {
112
+ return /* @__PURE__ */ N(x, { children: /* @__PURE__ */ N(L, { screenCode: e }) });
113
113
  }
114
- function R({ screenCode: t }) {
115
- let _ = v(), ne = v("errors"), { id: re } = Ye(), y = se(), [ie, ce] = Xe(), { data: b } = h(), ue = m((e) => e.user), x = ve(), me = te(), S = b?.screens[t], w = S?.entity ? b?.entities[S.entity] : void 0, E = S?.entity, D = a(w, "create"), O = a(w, "update"), Oe = a(w, "restore"), je = (() => {
116
- if (!w || !w.singleton || !w.prefilter) return;
117
- let e = l(w);
114
+ function L({ screenCode: t }) {
115
+ let g = ne(), _ = ne("errors"), { id: ie } = Ze(), v = ce(), [ae, le] = Qe(), { data: y } = ee(), de = m((e) => e.user), b = ye(), he = re(), x = y?.screens[t], C = x?.entity ? y?.entities[x.entity] : void 0, T = x?.entity, E = a(C, "create"), D = a(C, "update"), ke = a(C, "restore"), Me = (() => {
116
+ if (!C || !C.singleton || !C.prefilter) return;
117
+ let e = l(C);
118
118
  if (e.length !== 1) return;
119
- let t = w.prefilter[e[0]];
120
- if (t === "$caller.user_id") return ue?.id;
121
- if (t === "$caller.tenant_id") return ue?.tenant?.id;
122
- })(), k = je !== void 0, I = k ? je : re, L = !k && I === "new", R = M(() => {
123
- if (!I || L) return;
124
- if (!w) return I;
125
- let e = l(w);
126
- if (e.length === 1) return { [e[0]]: I };
127
- let t = u(I, e.length);
119
+ let t = C.prefilter[e[0]];
120
+ if (t === "$caller.user_id") return de?.id;
121
+ if (t === "$caller.tenant_id") return de?.tenant?.id;
122
+ })(), O = Me !== void 0, F = O ? Me : ie, I = !O && F === "new", L = j(() => {
123
+ if (!F || I) return;
124
+ if (!C) return F;
125
+ let e = l(C);
126
+ if (e.length === 1) return { [e[0]]: F };
127
+ let t = u(F, e.length);
128
128
  if (!t) return;
129
129
  let n = {};
130
130
  for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
131
131
  return n;
132
132
  }, [
133
+ F,
133
134
  I,
134
- L,
135
- w
136
- ]), z = M(() => {
137
- if (R) return typeof R == "string" ? R : d(R);
138
- }, [R]), nt = ge(E, R, Qe), { data: it, isLoading: at, error: ot } = nt;
139
- p(!at);
140
- let st = de(w?.realtime, E ?? ""), ct = E ? st : !1;
141
- pe(he(E, R, Qe), !L);
142
- let lt = xe(E ?? ""), ut = Ce(E ?? ""), dt = Se(E ?? ""), ft = Object.keys(w?.status_groups ?? {}).length > 0, pt = it?.data, mt = pt?.$statuses, ht = pt?.$properties, gt = ie.get("edit") === "true", [_t, vt] = N(L || gt), [B, yt] = N({}), [V, bt] = N({}), [H, xt] = N({}), [U, W] = N(void 0), [St, Ct] = N(!1), [wt, G] = N(void 0), [Tt, Et] = N(!1), Dt = L ? D : O, K = _t && Dt, Ot = f();
143
- oe(K && !L, Ot.enabled);
144
- let [kt, At] = N(() => {
145
- let e = parseInt(S?.sidebar_width || "380", 10);
135
+ C
136
+ ]), R = j(() => {
137
+ if (L) return typeof L == "string" ? L : d(L);
138
+ }, [L]), z = _e(T, L, et), { data: at, isLoading: ot, error: st } = z;
139
+ p(!ot);
140
+ let ct = fe(C?.realtime, T ?? ""), lt = T ? ct : !1;
141
+ me(ge(T, L, et), !I);
142
+ let ut = Se(T ?? ""), dt = we(T ?? ""), ft = Ce(T ?? ""), pt = Object.keys(C?.status_groups ?? {}).length > 0, mt = at?.data, ht = mt?.$statuses, gt = mt?.$properties, _t = ae.get("edit") === "true", [vt, yt] = M(I || _t), [B, bt] = M({}), [V, xt] = M({}), [H, St] = M({}), [U, W] = M(void 0), [Ct, wt] = M(!1), [Tt, G] = M(void 0), [Et, Dt] = M(!1), Ot = I ? E : D, K = vt && Ot, kt = f();
143
+ se(K && !I, kt.enabled);
144
+ let [At, jt] = M(() => {
145
+ let e = parseInt(x?.sidebar_width || "380", 10);
146
146
  return isNaN(e) ? 380 : e;
147
- }), jt = Ke(null), q = Ke(null), Mt = A((e) => {
147
+ }), Mt = Je(null), q = Je(null), Nt = k((e) => {
148
148
  e.preventDefault();
149
- let t = jt.current;
149
+ let t = Mt.current;
150
150
  if (!t) return;
151
151
  let n = t.offsetWidth;
152
152
  q.current = {
@@ -158,329 +158,330 @@ function R({ screenCode: t }) {
158
158
  let n = q.current.startX - e.clientX, r = Math.max(280, Math.min(800, q.current.startW + n));
159
159
  t.style.width = `${r}px`;
160
160
  }, i = () => {
161
- q.current && t && At(parseInt(t.style.width, 10) || q.current.startW), q.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
161
+ q.current && t && jt(parseInt(t.style.width, 10) || q.current.startW), q.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
162
162
  };
163
163
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
164
- }, []), J = it?.data, Y = De(w, S, J ?? {});
165
- j(() => {
164
+ }, []), J = at?.data, Y = Oe(C, x, J ?? {});
165
+ A(() => {
166
166
  let e = parseInt(Y?.sidebar_width || "380", 10);
167
- At(Number.isNaN(e) ? 380 : e);
167
+ jt(Number.isNaN(e) ? 380 : e);
168
168
  }, [Y?.sidebar_width]);
169
- let X = typeof J?.$row_version == "string" ? J.$row_version : void 0, Nt = J?.$refs, Pt = Ke(X);
170
- j(() => {
169
+ let X = typeof J?.$row_version == "string" ? J.$row_version : void 0, Pt = J?.$refs, Ft = Je(X);
170
+ A(() => {
171
171
  if (!X) return;
172
- let e = Pt.current;
173
- Pt.current = X, e && e !== X && _t && Ct(!0);
174
- }, [_t, X]);
175
- let Ft = !!w?.soft_delete && J != null && J[w.soft_delete] != null, Z = Je(), It = Ke(null);
176
- Te({ scrollElementRef: It });
177
- let Lt = !L && ot instanceof e && ot.status === 404, Rt = L && !i(w), zt = Ke(null);
178
- j(() => {
179
- if (!Lt) return;
180
- let e = fe(Z);
181
- zt.current !== e && (zt.current = e, le.getState().kill(e));
182
- }, [Lt, Z]);
183
- let { openTab: Bt, updateTabTitle: Vt, findTabByPathname: Ht } = ae();
184
- j(() => {
185
- if (!w || k || Ot.enabled) return;
186
- let e = Z.pathname, t = _(Y?.display?.name) || _(w.display.name), n = Y?.display?.icon || w.display.icon;
187
- Bt({
172
+ let e = Ft.current;
173
+ Ft.current = X, e && e !== X && vt && wt(!0);
174
+ }, [vt, X]);
175
+ let It = !!C?.soft_delete && J != null && J[C.soft_delete] != null, Z = Xe(), Lt = Je(null);
176
+ Ee({ scrollElementRef: Lt });
177
+ let Rt = !I && st instanceof e && st.status === 404, zt = I && !i(C), Bt = Je(null);
178
+ A(() => {
179
+ if (!Rt) return;
180
+ let e = pe(Z);
181
+ Bt.current !== e && (Bt.current = e, ue.getState().kill(e));
182
+ }, [Rt, Z]);
183
+ let { openTab: Vt, updateTabTitle: Ht, findTabByPathname: Ut } = oe();
184
+ A(() => {
185
+ if (!C || O || kt.enabled) return;
186
+ let e = Z.pathname, t = g(Y?.display?.name) || g(C.display.name), n = Y?.display?.icon || C.display.icon;
187
+ Vt({
188
188
  pathname: e,
189
189
  search: "",
190
- title: L ? _("record.new_title", "New {name}", { name: t }) : t,
191
- derivedTitle: !L,
190
+ title: I ? g("record.new_title", "New {name}", { name: t }) : t,
191
+ derivedTitle: !I,
192
192
  icon: n,
193
193
  closable: !0
194
194
  });
195
195
  }, [
196
196
  Z.pathname,
197
- _,
197
+ g,
198
198
  Y?.display?.icon,
199
- w?.display.icon,
200
- L,
201
- k,
202
- Ot.enabled
203
- ]), j(() => {
204
- if (!J || !w || k || Ot.enabled) return;
205
- let e = Ht(Z.pathname);
199
+ C?.display.icon,
200
+ I,
201
+ O,
202
+ kt.enabled
203
+ ]), A(() => {
204
+ if (!J || !C || O || kt.enabled) return;
205
+ let e = Ut(Z.pathname);
206
206
  if (e) {
207
- let t = _(Y?.display?.name) || _(w.display.name), n = c(_, J, w), r = n && !String(n).startsWith("/") ? String(n) : t;
208
- Vt(e.id, r, r === t);
207
+ let t = g(Y?.display?.name) || g(C.display.name), n = c(g, J, C), r = n && !String(n).startsWith("/") ? String(n) : t;
208
+ Ht(e.id, r, r === t);
209
209
  }
210
210
  }, [
211
211
  J,
212
- _,
213
- w?.display.display_field,
212
+ g,
213
+ C?.display.display_field,
214
214
  Z.pathname,
215
- k,
216
- Ot.enabled
215
+ O,
216
+ kt.enabled
217
217
  ]);
218
- let Ut = M(() => {
219
- if (!w || !Dt) return /* @__PURE__ */ new Set();
218
+ let Wt = j(() => {
219
+ if (!C || !Ot) return /* @__PURE__ */ new Set();
220
220
  let e = /* @__PURE__ */ new Set();
221
- for (let [t, n] of w.fields) !n.auto && !n.primary && e.add(t);
222
- for (let [t] of w.files ?? []) e.add(t);
221
+ for (let [t, n] of C.fields) !n.auto && !n.primary && e.add(t);
222
+ for (let [t] of C.files ?? []) e.add(t);
223
223
  return e;
224
- }, [w, Dt]);
225
- j(() => {
226
- if (gt && J && w && O) {
227
- if (_t || vt(!0), Object.keys(B).length === 0) {
228
- let e = I ? We(I) : null;
224
+ }, [C, Ot]);
225
+ A(() => {
226
+ if (_t && J && C && D) {
227
+ if (vt || yt(!0), Object.keys(B).length === 0) {
228
+ let e = F ? Ke(F) : null;
229
229
  if (e) {
230
- let t = be({
231
- entity: w,
230
+ let t = w({
231
+ entity: C,
232
232
  formData: e,
233
233
  record: void 0,
234
234
  isNew: !0
235
235
  });
236
- T(t).forEach((e) => {
237
- x.registerDraft({
236
+ xe(t).forEach((e) => {
237
+ b.registerDraft({
238
238
  fileId: e,
239
- discard: () => _e(e)
239
+ discard: () => ve(e)
240
240
  });
241
241
  });
242
242
  }
243
243
  let t = {};
244
- Ut.forEach((n) => {
244
+ Wt.forEach((n) => {
245
245
  let r = e ? e[n] : void 0;
246
246
  if (r !== void 0) {
247
247
  t[n] = r;
248
248
  return;
249
249
  }
250
- let i = C(w, J, n);
251
- t[n] = ye(w, n) ? i ?? null : i ?? "";
252
- }), yt(t);
250
+ let i = be(C, J, n);
251
+ t[n] = S(C, n) ? i ?? null : i ?? "";
252
+ }), bt(t);
253
253
  }
254
- if (w.children !== void 0 && w.children.length > 0 && U === void 0) {
254
+ if (C.children !== void 0 && C.children.length > 0 && U === void 0) {
255
255
  let e = J.$children;
256
256
  if (e && Object.keys(e).length > 0) {
257
257
  let t = {};
258
258
  for (let [n, r] of Object.entries(e)) {
259
- let e = b?.entities[n];
259
+ let e = y?.entities[n];
260
260
  t[n] = r.map((t) => ({
261
261
  ...t,
262
- _key: et(e, t)
262
+ _key: nt(e, t)
263
263
  }));
264
264
  }
265
265
  W(t), G(e);
266
266
  } else W({}), G({});
267
267
  }
268
- ce((e) => {
268
+ le((e) => {
269
269
  let t = new URLSearchParams(e);
270
270
  return t.delete("edit"), t;
271
271
  }, { replace: !0 });
272
272
  }
273
273
  }, [
274
- gt,
274
+ _t,
275
275
  J,
276
- Ut,
277
- O,
278
- w,
276
+ Wt,
277
+ D,
278
+ C,
279
279
  U,
280
- b
281
- ]), j(() => {
282
- L && D && w?.children && w.children.length !== 0 && U === void 0 && (W({}), G({}));
280
+ y
281
+ ]), A(() => {
282
+ I && E && C?.children && C.children.length !== 0 && U === void 0 && (W({}), G({}));
283
283
  }, [
284
- L,
285
- D,
286
- w?.children
284
+ I,
285
+ E,
286
+ C?.children
287
287
  ]);
288
- let Wt = A(async () => {
289
- if (await x.flushAllDrafts(), L) {
288
+ let Gt = k(async () => {
289
+ if (await b.flushAllDrafts(), I) {
290
290
  let e = Y?.route?.replace("/:id", "") ?? "/";
291
- y(e);
292
- } else vt(!1), yt({}), bt({}), xt({}), W(void 0), G(void 0), Et(!1);
291
+ v(e);
292
+ } else yt(!1), bt({}), xt({}), St({}), W(void 0), G(void 0), Dt(!1);
293
293
  }, [
294
- x,
295
- L,
294
+ b,
295
+ I,
296
296
  Y,
297
- y
298
- ]), Gt = A((e, t) => {
299
- yt((n) => ({
297
+ v
298
+ ]), Kt = k((e, t) => {
299
+ bt((n) => ({
300
300
  ...n,
301
301
  [e]: t
302
302
  }));
303
- }, []), Q = M(() => {
303
+ }, []), Q = j(() => {
304
304
  if (!Y?.route) return "/";
305
305
  let e = Y.route.split("/");
306
306
  return e.pop(), e.join("/") || "/";
307
- }, [Y]), Kt = M(() => !b?.screens || !Q || Q === "/" ? !1 : Object.values(b.screens).some((e) => e.route === Q), [b, Q]), qt = A(() => {
308
- if (!Kt) {
309
- y("/");
307
+ }, [Y]), qt = j(() => !y?.screens || !Q || Q === "/" ? !1 : Object.values(y.screens).some((e) => e.route === Q), [y, Q]), Jt = k(() => {
308
+ if (!qt) {
309
+ v("/");
310
310
  return;
311
311
  }
312
- let e = Ht(Q)?.search ?? "";
313
- y(e ? `${Q}?${e}` : Q);
312
+ let e = Ut(Q)?.search ?? "";
313
+ v(e ? `${Q}?${e}` : Q);
314
314
  }, [
315
- Kt,
315
+ qt,
316
316
  Q,
317
- Ht,
318
- y
319
- ]), Jt = we({ fallback: qt }), Yt = !k && (Jt.hasOriginBack || Jt.allowFallbackBack && !!Kt), Xt = M(() => {
320
- if (!w) return {};
317
+ Ut,
318
+ v
319
+ ]), Yt = Te({ fallback: Jt }), Xt = !O && (Yt.hasOriginBack || Yt.allowFallbackBack && !!qt), Zt = j(() => {
320
+ if (!C) return {};
321
321
  let e = {};
322
- for (let t of He(w, B, L)) Ut.has(t) && (e[t] = _("record.field.required", "Required"));
323
- for (let t of Ve(w, B)) Ut.has(t) && (e[t] = ne("record.email_invalid", "This is not a valid email address."));
322
+ for (let t of We(C, B, I)) Wt.has(t) && (e[t] = g("record.field.required", "Required"));
323
+ for (let t of Ue(C, B)) Wt.has(t) && (e[t] = _("record.email_invalid", "This is not a valid email address."));
324
324
  return e;
325
325
  }, [
326
+ g,
326
327
  _,
327
- ne,
328
- w,
328
+ C,
329
329
  B,
330
- L,
331
- Ut
332
- ]), Zt = Object.keys(Xt).length > 0, Qt = M(() => w ? $e({
333
- entity: w,
330
+ I,
331
+ Wt
332
+ ]), Qt = Object.keys(Zt).length > 0, $t = j(() => C ? tt({
333
+ entity: C,
334
334
  formData: B,
335
335
  record: J,
336
- isNew: L,
336
+ isNew: I,
337
337
  pendingStatuses: V,
338
338
  pendingProperties: H,
339
339
  pendingChildren: U,
340
- childrenSnapshot: wt
340
+ childrenSnapshot: Tt
341
341
  }) : {
342
342
  payload: {},
343
343
  committedFileIds: []
344
344
  }, [
345
- w,
345
+ C,
346
346
  B,
347
347
  J,
348
- L,
348
+ I,
349
349
  V,
350
350
  H,
351
351
  U,
352
- wt
353
- ]), $t = Object.keys(Qt.payload).length > 0, en = K && (L || $t);
354
- ke(en);
355
- let tn = A(() => {
356
- if (!E || !w || L && !D || !L && !O || (Et(!0), Zt)) return;
357
- let t = { ...Qt.payload }, { committedFileIds: n } = Qt;
358
- if (!L && !$t) {
359
- vt(!1), bt({}), xt({}), W(void 0), G(void 0), Et(!1);
352
+ Tt
353
+ ]), en = Object.keys($t.payload).length > 0, tn = K && (I || en);
354
+ Ae(tn);
355
+ let nn = k(() => {
356
+ if (!T || !C || I && !E || !I && !D || (Dt(!0), Qt)) return;
357
+ let t = { ...$t.payload }, { committedFileIds: n } = $t;
358
+ if (!I && !en) {
359
+ yt(!1), xt({}), St({}), W(void 0), G(void 0), Dt(!1);
360
360
  return;
361
361
  }
362
- !L && X && (t.$row_version = X);
362
+ !I && X && (t.$row_version = X);
363
363
  let r = () => {
364
- vt(!1), Ct(!1), Et(!1), bt({}), xt({}), W(void 0), G(void 0);
364
+ yt(!1), wt(!1), Dt(!1), xt({}), St({}), W(void 0), G(void 0);
365
365
  };
366
- L ? lt.mutate(t, { onSuccess: (e) => {
367
- n.forEach((e) => x.markCommitted(e));
368
- let t = e.data, i = w ? o(w, t) : {}, a = d(i);
369
- y(a ? `${Q}/${encodeURIComponent(a)}` : Q, { replace: !0 }), r();
370
- } }) : R && ut.mutate({
371
- pkValues: R,
366
+ I ? ut.mutate(t, { onSuccess: (e) => {
367
+ n.forEach((e) => b.markCommitted(e));
368
+ let t = e.data, i = C ? o(C, t) : {}, a = d(i);
369
+ v(a ? `${Q}/${encodeURIComponent(a)}` : Q, { replace: !0 }), r();
370
+ } }) : L && dt.mutate({
371
+ pkValues: L,
372
372
  data: t
373
373
  }, {
374
374
  onSuccess: () => {
375
- n.forEach((e) => x.markCommitted(e)), r();
375
+ n.forEach((e) => b.markCommitted(e)), r();
376
376
  },
377
377
  onError: (t) => {
378
- t instanceof e && t.code === "entity.stale_object" && Ct(!0);
378
+ t instanceof e && t.code === "entity.stale_object" && wt(!0);
379
379
  }
380
380
  });
381
381
  }, [
382
- x,
383
- L,
384
- D,
385
- O,
382
+ b,
383
+ I,
386
384
  E,
387
- Zt,
385
+ D,
386
+ T,
388
387
  Qt,
389
388
  $t,
390
- lt,
389
+ en,
391
390
  ut,
392
- w,
393
- y,
391
+ dt,
392
+ C,
393
+ v,
394
394
  Q,
395
395
  X,
396
- R
397
- ]), nn = A((e, t) => {
396
+ L
397
+ ]), rn = k((e, t) => {
398
398
  W((n) => ({
399
399
  ...n ?? {},
400
400
  [e]: t
401
401
  }));
402
- }, []), rn = A(() => {
403
- R && !L && Oe && dt.mutate(R);
402
+ }, []), an = k(() => {
403
+ L && !I && ke && ft.mutate(L);
404
404
  }, [
405
- R,
406
405
  L,
407
- Oe,
408
- dt
409
- ]), an = M(() => Ue(U, b), [U, b]), on = Object.keys(an).length > 0;
410
- if (!Y || !w) return null;
411
- if (!L && at) return /* @__PURE__ */ P(Ee, {});
412
- if (Rt) return /* @__PURE__ */ F("div", {
406
+ I,
407
+ ke,
408
+ ft
409
+ ]), on = j(() => Ge(U, y), [U, y]), sn = Object.keys(on).length > 0;
410
+ if (!Y || !C) return null;
411
+ if (!I && ot) return /* @__PURE__ */ N(De, {});
412
+ if (zt) return /* @__PURE__ */ P("div", {
413
413
  style: { padding: 24 },
414
- children: [/* @__PURE__ */ F("div", {
414
+ children: [/* @__PURE__ */ P("div", {
415
415
  style: {
416
416
  display: "flex",
417
417
  alignItems: "center",
418
418
  gap: 8,
419
419
  marginBottom: 8
420
420
  },
421
- children: [Yt && /* @__PURE__ */ P(ee, {
422
- icon: /* @__PURE__ */ P(g.back, { size: 14 }),
423
- onClick: Jt.goBack,
424
- title: _("record.back", "Back")
425
- }), /* @__PURE__ */ P("h1", {
421
+ children: [Xt && /* @__PURE__ */ N(te, {
422
+ icon: /* @__PURE__ */ N(h.back, { size: 14 }),
423
+ onClick: Yt.goBack,
424
+ title: g("record.back", "Back")
425
+ }), /* @__PURE__ */ N("h1", {
426
426
  style: {
427
427
  margin: 0,
428
428
  fontSize: 18,
429
429
  fontWeight: 600,
430
430
  color: "var(--text)"
431
431
  },
432
- children: _("record.create_closed.title", "Not Available")
432
+ children: g("record.create_closed.title", "Not Available")
433
433
  })]
434
- }), /* @__PURE__ */ P("p", {
434
+ }), /* @__PURE__ */ N("p", {
435
435
  style: { color: "var(--text-3)" },
436
- children: _("record.create_closed.body", "This record type is not created from a form.")
436
+ children: g("record.create_closed.body", "This record type is not created from a form.")
437
437
  })]
438
438
  });
439
- if (!L && !J || Lt) return /* @__PURE__ */ F("div", {
439
+ if (!I && !J || Rt) return /* @__PURE__ */ P("div", {
440
440
  style: { padding: 24 },
441
- children: [/* @__PURE__ */ F("div", {
441
+ children: [/* @__PURE__ */ P("div", {
442
442
  style: {
443
443
  display: "flex",
444
444
  alignItems: "center",
445
445
  gap: 8,
446
446
  marginBottom: 8
447
447
  },
448
- children: [Yt && /* @__PURE__ */ P(ee, {
449
- icon: /* @__PURE__ */ P(g.back, { size: 14 }),
450
- onClick: Jt.goBack,
451
- title: _("record.back", "Back")
452
- }), /* @__PURE__ */ P("h1", {
448
+ children: [Xt && /* @__PURE__ */ N(te, {
449
+ icon: /* @__PURE__ */ N(h.back, { size: 14 }),
450
+ onClick: Yt.goBack,
451
+ title: g("record.back", "Back")
452
+ }), /* @__PURE__ */ N("h1", {
453
453
  style: {
454
454
  margin: 0,
455
455
  fontSize: 18,
456
456
  fontWeight: 600,
457
457
  color: "var(--text)"
458
458
  },
459
- children: _("record.missing.title", "Not Found")
459
+ children: g("record.missing.title", "Not Found")
460
460
  })]
461
- }), /* @__PURE__ */ P("p", {
461
+ }), /* @__PURE__ */ N("p", {
462
462
  style: { color: "var(--text-3)" },
463
- children: ne("entity.not_found", "This record does not exist.")
463
+ children: _("entity.not_found", "This record does not exist.")
464
464
  })]
465
465
  });
466
- let sn = w.display, cn = _(Y.display?.name) || _(sn.name), ln = c(_, J, w), un = L ? _("record.new_title", "New {name}", { name: cn }) : ln ? String(ln) : cn, dn = lt.isPending || ut.isPending, fn = Y.responsive?.[me.category]?.layout, pn = fn?.tabs ?? (me.isPhone ? "sections" : void 0), mn = fn?.header_card === !0 ? Ge({
467
- entity: w,
466
+ let cn = C.display, ln = g(Y.display?.name) || g(cn.name), un = c(g, J, C), dn = I ? g("record.new_title", "New {name}", { name: ln }) : un ? String(un) : ln, fn = ut.isPending || dt.isPending, pn = Y.responsive?.[he.category]?.layout, mn = pn?.tabs ?? (he.isPhone ? "sections" : void 0), hn = pn?.header_card === !0 ? qe({
467
+ entity: C,
468
468
  screen: Y
469
469
  }) : void 0, $ = {
470
- schema: b,
471
- entity: w,
472
- entityCode: E,
473
- recordId: z ?? I ?? "",
470
+ schema: y,
471
+ entity: C,
472
+ entityCode: T,
473
+ recordId: R ?? F ?? "",
474
474
  record: K ? {
475
475
  ...J ?? {},
476
476
  ...B
477
477
  } : J ?? {},
478
- isNew: L,
478
+ isNew: I,
479
479
  mode: K ? "edit" : "display",
480
- onFieldChange: K ? Gt : void 0,
481
- refs: Nt,
480
+ onFieldChange: K ? Kt : void 0,
481
+ refs: Pt,
482
+ headerFields: !I && J ? ze(Y, C) : void 0,
482
483
  objectProperties: (() => {
483
- let e = ht ?? [];
484
+ let e = gt ?? [];
484
485
  if (!K || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
485
486
  let t = e.map((e) => H[e.property_code] === void 0 ? e : {
486
487
  ...e,
@@ -494,13 +495,13 @@ function R({ screenCode: t }) {
494
495
  });
495
496
  return t;
496
497
  })(),
497
- onSetProperty: L || !O ? void 0 : K ? (e, t) => xt((n) => ({
498
+ onSetProperty: I || !D ? void 0 : K ? (e, t) => St((n) => ({
498
499
  ...n,
499
500
  [e]: t
500
501
  })) : void 0,
501
502
  isPropertyPending: !1,
502
503
  objectStatuses: (() => {
503
- let e = mt ?? [];
504
+ let e = ht ?? [];
504
505
  if (!K || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
505
506
  let t = e.map((e) => V[e.group_code] === void 0 ? e : {
506
507
  ...e,
@@ -514,59 +515,58 @@ function R({ screenCode: t }) {
514
515
  });
515
516
  return t;
516
517
  })(),
517
- onSetStatus: L || !O ? void 0 : K ? (e, t) => bt((n) => ({
518
+ onSetStatus: I || !D ? void 0 : K ? (e, t) => xt((n) => ({
518
519
  ...n,
519
520
  [e]: t
520
521
  })) : void 0,
521
522
  isStatusPending: !1,
522
523
  pendingChildren: K ? U : void 0,
523
- onChildrenChange: K ? nn : void 0,
524
- childValidationErrors: K ? an : void 0,
525
- fieldErrors: K && Tt ? Xt : void 0,
526
- detailTabsPresentation: pn,
527
- relatedRecordsPresentation: fn?.related_records
528
- }, hn = !!Y.sidebar && Y.sidebar.length > 0, gn = fn?.sidebar === "hidden", _n = hn && !gn && !me.isDesktop, vn = hn && !gn && me.isDesktop, yn = !L && J ? /* @__PURE__ */ P(Le, {
524
+ onChildrenChange: K ? rn : void 0,
525
+ childValidationErrors: K ? on : void 0,
526
+ fieldErrors: K && Et ? Zt : void 0,
527
+ detailTabsPresentation: mn,
528
+ relatedRecordsPresentation: pn?.related_records
529
+ }, gn = !!Y.sidebar && Y.sidebar.length > 0, _n = pn?.sidebar === "hidden", vn = gn && !_n && !he.isDesktop, yn = gn && !_n && he.isDesktop, bn = !I && J ? /* @__PURE__ */ N(Re, {
529
530
  screen: Y,
530
- entity: w,
531
- entityCode: E,
531
+ entity: C,
532
+ entityCode: T,
532
533
  record: J,
533
- refs: Nt,
534
- objectStatuses: mt,
535
- schema: b
536
- }) : void 0, bn = /* @__PURE__ */ P(rt, {
537
- title: un,
538
- recordId: I,
534
+ refs: Pt,
535
+ objectStatuses: ht,
536
+ schema: y
537
+ }) : void 0, xn = /* @__PURE__ */ N(it, {
538
+ title: dn,
539
539
  editing: K,
540
- isNew: L,
541
- isRecordDeleted: Ft,
542
- dirty: en,
543
- isSaving: dn,
544
- hasChildErrors: on,
545
- hasFieldErrors: Tt && Zt,
546
- canRestore: Oe,
547
- entity: w,
540
+ isNew: I,
541
+ isRecordDeleted: It,
542
+ dirty: tn,
543
+ isSaving: fn,
544
+ hasChildErrors: sn,
545
+ hasFieldErrors: Et && Qt,
546
+ canRestore: ke,
547
+ entity: C,
548
548
  screen: Y,
549
- globalActions: b?.actions,
550
- entityCode: E,
549
+ globalActions: y?.actions,
550
+ entityCode: T,
551
551
  record: J,
552
- id: I,
552
+ id: F,
553
553
  listRoute: Q,
554
- listRouteExists: !!Kt,
555
- highlights: yn,
556
- showBack: Yt,
557
- onBack: Jt.goBack,
558
- onCancelEdit: Wt,
559
- onSave: tn,
560
- onRestore: rn,
561
- isRestoring: dt.isPending,
554
+ listRouteExists: !!qt,
555
+ highlights: bn,
556
+ showBack: Xt,
557
+ onBack: Yt.goBack,
558
+ onCancelEdit: Gt,
559
+ onSave: nn,
560
+ onRestore: an,
561
+ isRestoring: ft.isPending,
562
562
  refreshControl: {
563
- refetch: nt.refetch,
564
- isLoading: nt.isLoading,
565
- isLive: ct
563
+ refetch: z.refetch,
564
+ isLoading: z.isLoading,
565
+ isLive: lt
566
566
  },
567
- isRealtimeEntity: w?.realtime === !0,
568
- canManageTemplates: Me(b)
569
- }), xn = Ft && /* @__PURE__ */ F("div", {
567
+ isRealtimeEntity: C?.realtime === !0,
568
+ canManageTemplates: Ne(y)
569
+ }), Sn = It && /* @__PURE__ */ P("div", {
570
570
  style: {
571
571
  display: "flex",
572
572
  alignItems: "center",
@@ -579,8 +579,8 @@ function R({ screenCode: t }) {
579
579
  color: "var(--danger)",
580
580
  fontSize: 12.5
581
581
  },
582
- children: [/* @__PURE__ */ P(g.warning, { size: 14 }), /* @__PURE__ */ P("span", { children: _("record.deleted_banner", "This record was deleted on {date}", { date: n(String(J[w.soft_delete])) }) })]
583
- }), Sn = St && /* @__PURE__ */ F("div", {
582
+ children: [/* @__PURE__ */ N(h.warning, { size: 14 }), /* @__PURE__ */ N("span", { children: g("record.deleted_banner", "This record was deleted on {date}", { date: n(String(J[C.soft_delete])) }) })]
583
+ }), Cn = Ct && /* @__PURE__ */ P("div", {
584
584
  style: {
585
585
  display: "flex",
586
586
  alignItems: "center",
@@ -593,79 +593,80 @@ function R({ screenCode: t }) {
593
593
  color: "var(--warn)",
594
594
  fontSize: 12.5
595
595
  },
596
- children: [/* @__PURE__ */ P(g.warning, { size: 14 }), /* @__PURE__ */ P("span", { children: _("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
597
- }), Cn = K && Tt && Zt && /* @__PURE__ */ P(Ie, {
598
- errors: Object.entries(Xt).map(([e, t]) => {
599
- let n = w.fields.get(e);
596
+ children: [/* @__PURE__ */ N(h.warning, { size: 14 }), /* @__PURE__ */ N("span", { children: g("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
597
+ }), wn = K && Et && Qt && /* @__PURE__ */ N(Le, {
598
+ errors: Object.entries(Zt).map(([e, t]) => {
599
+ let n = C.fields.get(e);
600
600
  return {
601
601
  name: e,
602
- label: n ? s(_, n, e, b?.entities) : e,
602
+ label: n ? s(g, n, e, y?.entities) : e,
603
603
  message: t
604
604
  };
605
605
  }),
606
606
  onJump: (e) => {
607
- let t = document.getElementById(`${E}-${e}`);
607
+ let t = document.getElementById(`${T}-${e}`);
608
608
  t && (t.scrollIntoView({
609
609
  block: "center",
610
610
  behavior: "smooth"
611
611
  }), t.focus?.());
612
612
  }
613
- }), wn = ft && !L && !(Y.items && Y.items.length > 0) && /* @__PURE__ */ P("div", {
613
+ }), Tn = pt && !I && !(Y.items && Y.items.length > 0) && /* @__PURE__ */ N("div", {
614
614
  className: "mb-4",
615
- children: /* @__PURE__ */ P(Pe, {
616
- statusGroups: w.status_groups ?? {},
615
+ children: /* @__PURE__ */ N(Fe, {
616
+ statusGroups: C.status_groups ?? {},
617
617
  objectStatuses: $.objectStatuses,
618
- onSetStatus: O && K ? (e, t) => bt((n) => ({
618
+ onSetStatus: D && K ? (e, t) => xt((n) => ({
619
619
  ...n,
620
620
  [e]: t
621
- })) : Ze,
621
+ })) : $e,
622
622
  isPending: !1,
623
623
  mode: K ? "edit" : "display"
624
624
  })
625
- }), Tn = w.evidence_covered && !L && J && /* @__PURE__ */ P("div", {
625
+ }), En = C.evidence_covered && !I && J && /* @__PURE__ */ N("div", {
626
626
  className: "mb-4",
627
- children: /* @__PURE__ */ P(ze, { evidence: J.$evidence })
628
- }), En = /* @__PURE__ */ F(qe, { children: [
629
- mn && (J || L) && /* @__PURE__ */ P(tt, {
630
- card: mn,
631
- entity: w,
627
+ children: /* @__PURE__ */ N(Ve, { evidence: J.$evidence })
628
+ }), Dn = /* @__PURE__ */ P(Ye, { children: [
629
+ hn && (J || I) && /* @__PURE__ */ N(rt, {
630
+ card: hn,
631
+ entity: C,
632
632
  record: $.record,
633
633
  objectStatuses: $.objectStatuses,
634
634
  objectProperties: $.objectProperties
635
635
  }),
636
- Y.items && Y.items.length > 0 && (J || L) && b && /* @__PURE__ */ P(Fe, {
636
+ Y.items && Y.items.length > 0 && (J || I) && y && /* @__PURE__ */ N(Ie, {
637
637
  nodes: Y.items,
638
638
  ctx: $
639
639
  }),
640
- !L && I && E && w.associations && Object.keys(w.associations).length > 0 && b && /* @__PURE__ */ P(Ae, {
641
- entityCode: E,
642
- recordId: z ?? I ?? "",
643
- associations: w.associations,
644
- schema: b
640
+ !I && F && T && C.associations && Object.keys(C.associations).length > 0 && y && /* @__PURE__ */ N(je, {
641
+ entityCode: T,
642
+ recordId: R ?? F ?? "",
643
+ associations: C.associations,
644
+ schema: y
645
645
  }),
646
- !L && I && E && /* @__PURE__ */ P(Ne, {
647
- entity: w,
648
- entityCode: E,
649
- objectId: z ?? I,
650
- schema: b
646
+ !I && F && T && /* @__PURE__ */ N(Pe, {
647
+ entity: C,
648
+ entityCode: T,
649
+ objectId: R ?? F,
650
+ schema: y
651
651
  }),
652
- !L && J && b && /* @__PURE__ */ P(Re, {
652
+ !I && J && y && /* @__PURE__ */ N(Be, {
653
653
  screen: Y,
654
- entity: w,
655
- entityCode: E,
654
+ entity: C,
655
+ entityCode: T,
656
656
  record: J,
657
- refs: Nt,
658
- schema: b
657
+ recordId: R ?? F,
658
+ refs: Pt,
659
+ schema: y
659
660
  })
660
- ] }), Dn = /* @__PURE__ */ F(qe, { children: [
661
- bn,
662
- Sn,
661
+ ] }), On = /* @__PURE__ */ P(Ye, { children: [
663
662
  xn,
664
663
  Cn,
664
+ Sn,
665
665
  wn,
666
- Tn
666
+ Tn,
667
+ En
667
668
  ] });
668
- return vn ? /* @__PURE__ */ F("div", {
669
+ return yn ? /* @__PURE__ */ P("div", {
669
670
  style: {
670
671
  height: "100%",
671
672
  display: "flex",
@@ -673,23 +674,23 @@ function R({ screenCode: t }) {
673
674
  background: "var(--background)"
674
675
  },
675
676
  children: [
676
- /* @__PURE__ */ P("div", {
677
+ /* @__PURE__ */ N("div", {
677
678
  style: {
678
679
  flex: 1,
679
680
  minWidth: 0,
680
681
  height: "100%"
681
682
  },
682
- children: /* @__PURE__ */ P(Be, {
683
- scrollRef: It,
684
- header: Dn,
685
- children: En
683
+ children: /* @__PURE__ */ N(He, {
684
+ scrollRef: Lt,
685
+ header: On,
686
+ children: Dn
686
687
  })
687
688
  }),
688
- /* @__PURE__ */ P("div", {
689
+ /* @__PURE__ */ N("div", {
689
690
  className: "detail-resize-handle",
690
- onMouseDown: Mt,
691
- title: _("record.layout.drag_to_resize", "Drag to resize"),
692
- children: /* @__PURE__ */ P("div", { style: {
691
+ onMouseDown: Nt,
692
+ title: g("record.layout.drag_to_resize", "Drag to resize"),
693
+ children: /* @__PURE__ */ N("div", { style: {
693
694
  position: "absolute",
694
695
  top: 0,
695
696
  bottom: 0,
@@ -699,23 +700,23 @@ function R({ screenCode: t }) {
699
700
  background: "var(--border)"
700
701
  } })
701
702
  }),
702
- /* @__PURE__ */ P("div", {
703
- ref: jt,
703
+ /* @__PURE__ */ N("div", {
704
+ ref: Mt,
704
705
  style: {
705
706
  flexShrink: 0,
706
707
  height: "100%",
707
- width: `${kt}px`
708
+ width: `${At}px`
708
709
  },
709
- children: (J || L) && b && /* @__PURE__ */ P(Fe, {
710
+ children: (J || I) && y && /* @__PURE__ */ N(Ie, {
710
711
  nodes: Y.sidebar,
711
712
  ctx: $
712
713
  })
713
714
  })
714
715
  ]
715
- }) : /* @__PURE__ */ F(Be, {
716
- scrollRef: It,
717
- header: Dn,
718
- children: [En, _n && (J || L) && b && /* @__PURE__ */ P("div", {
716
+ }) : /* @__PURE__ */ P(He, {
717
+ scrollRef: Lt,
718
+ header: On,
719
+ children: [Dn, vn && (J || I) && y && /* @__PURE__ */ N("div", {
719
720
  "data-testid": "detail-sidebar-inline",
720
721
  style: {
721
722
  display: "flex",
@@ -723,25 +724,25 @@ function R({ screenCode: t }) {
723
724
  gap: 16,
724
725
  minWidth: 0
725
726
  },
726
- children: /* @__PURE__ */ P(Fe, {
727
+ children: /* @__PURE__ */ N(Ie, {
727
728
  nodes: Y.sidebar,
728
729
  ctx: $
729
730
  })
730
731
  })]
731
732
  });
732
733
  }
733
- function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties: a }) {
734
- let o = v(), s = (e) => {
735
- let s = z(o, n, e, r, i, a);
734
+ function rt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties: a }) {
735
+ let o = ne(), s = (e) => {
736
+ let s = R(o, n, e, r, i, a);
736
737
  return s != null && t(s) !== "";
737
738
  }, l = (e) => {
738
- let s = z(o, n, e, r, i, a);
739
- return t(s) || /* @__PURE__ */ P("span", {
739
+ let s = R(o, n, e, r, i, a);
740
+ return t(s) || /* @__PURE__ */ N("span", {
740
741
  style: { color: "var(--text-3)" },
741
742
  children: "-"
742
743
  });
743
- }, u = e.titleUsesDisplay ? c(o, r, n) : e.titleField ? z(o, n, e.titleField, r, i, a) : void 0, d = t(u) || o(n.display?.name) || o("record.fallback_title", "Record"), f = e.badgeFields.filter((t) => !e.hideEmptyFields || s(t)), p = e.bodyFields.filter((t) => !e.hideEmptyFields || s(t)), m = e.metaFields.filter((t) => !e.hideEmptyFields || s(t));
744
- return /* @__PURE__ */ F("section", {
744
+ }, u = e.titleUsesDisplay ? c(o, r, n) : e.titleField ? R(o, n, e.titleField, r, i, a) : void 0, d = t(u) || o(n.display?.name) || o("record.fallback_title", "Record"), f = e.badgeFields.filter((t) => !e.hideEmptyFields || s(t)), p = e.bodyFields.filter((t) => !e.hideEmptyFields || s(t)), m = e.metaFields.filter((t) => !e.hideEmptyFields || s(t));
745
+ return /* @__PURE__ */ P("section", {
745
746
  "data-testid": "detail-header-card",
746
747
  style: {
747
748
  width: "100%",
@@ -754,9 +755,9 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
754
755
  boxSizing: "border-box"
755
756
  },
756
757
  children: [
757
- /* @__PURE__ */ F("div", {
758
+ /* @__PURE__ */ P("div", {
758
759
  style: { minWidth: 0 },
759
- children: [/* @__PURE__ */ P("div", {
760
+ children: [/* @__PURE__ */ N("div", {
760
761
  style: {
761
762
  fontSize: 15,
762
763
  lineHeight: 1.25,
@@ -765,7 +766,7 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
765
766
  overflowWrap: "anywhere"
766
767
  },
767
768
  children: d
768
- }), e.subtitleField && /* @__PURE__ */ P("div", {
769
+ }), e.subtitleField && /* @__PURE__ */ N("div", {
769
770
  style: {
770
771
  marginTop: 4,
771
772
  fontSize: 12.5,
@@ -776,14 +777,14 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
776
777
  children: l(e.subtitleField)
777
778
  })]
778
779
  }),
779
- f.length > 0 && /* @__PURE__ */ P("div", {
780
+ f.length > 0 && /* @__PURE__ */ N("div", {
780
781
  style: {
781
782
  display: "flex",
782
783
  flexWrap: "wrap",
783
784
  gap: 6,
784
785
  marginTop: 10
785
786
  },
786
- children: f.map((e) => /* @__PURE__ */ P("span", {
787
+ children: f.map((e) => /* @__PURE__ */ N("span", {
787
788
  style: {
788
789
  minWidth: 0,
789
790
  maxWidth: "100%",
@@ -798,7 +799,7 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
798
799
  children: l(e)
799
800
  }, e))
800
801
  }),
801
- p.length > 0 && /* @__PURE__ */ P("dl", {
802
+ p.length > 0 && /* @__PURE__ */ N("dl", {
802
803
  style: {
803
804
  display: "grid",
804
805
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -807,12 +808,12 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
807
808
  fontSize: 12.5,
808
809
  lineHeight: 1.35
809
810
  },
810
- children: p.map((e) => /* @__PURE__ */ F("div", {
811
+ children: p.map((e) => /* @__PURE__ */ P("div", {
811
812
  style: { display: "contents" },
812
- children: [/* @__PURE__ */ P("dt", {
813
+ children: [/* @__PURE__ */ N("dt", {
813
814
  style: { color: "var(--text-3)" },
814
- children: nt(o, n, e)
815
- }), /* @__PURE__ */ P("dd", {
815
+ children: z(o, n, e)
816
+ }), /* @__PURE__ */ N("dd", {
816
817
  style: {
817
818
  margin: 0,
818
819
  color: "var(--text-2)",
@@ -823,7 +824,7 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
823
824
  })]
824
825
  }, e))
825
826
  }),
826
- m.length > 0 && /* @__PURE__ */ P("div", {
827
+ m.length > 0 && /* @__PURE__ */ N("div", {
827
828
  style: {
828
829
  display: "flex",
829
830
  flexWrap: "wrap",
@@ -832,13 +833,13 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
832
833
  color: "var(--text-3)",
833
834
  fontSize: 11.5
834
835
  },
835
- children: m.map((e) => /* @__PURE__ */ F("span", {
836
+ children: m.map((e) => /* @__PURE__ */ P("span", {
836
837
  style: {
837
838
  minWidth: 0,
838
839
  overflowWrap: "anywhere"
839
840
  },
840
841
  children: [
841
- nt(o, n, e),
842
+ z(o, n, e),
842
843
  ": ",
843
844
  l(e)
844
845
  ]
@@ -847,7 +848,7 @@ function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties
847
848
  ]
848
849
  });
849
850
  }
850
- function z(e, t, n, r, i, a) {
851
+ function R(e, t, n, r, i, a) {
851
852
  if (n.startsWith("$status.")) {
852
853
  let t = n.slice(8), r = i?.find((e) => e.group_code === t);
853
854
  return e(r?.status_name) || r?.status_code;
@@ -856,68 +857,68 @@ function z(e, t, n, r, i, a) {
856
857
  let e = n.slice(10);
857
858
  return a?.find((t) => t.property_code === e)?.value;
858
859
  }
859
- return C(t, r, n);
860
+ return be(t, r, n);
860
861
  }
861
- function nt(e, t, n) {
862
+ function z(e, t, n) {
862
863
  if (n.startsWith("$status.")) return n.slice(8);
863
864
  if (n.startsWith("$property.")) return n.slice(10);
864
865
  let r = t.fields.get(n);
865
866
  return r ? s(e, r, n) : n;
866
867
  }
867
- function rt({ title: e, recordId: t, editing: n, isNew: r, isRecordDeleted: i, dirty: a, isSaving: o, hasChildErrors: s, hasFieldErrors: c, canRestore: l, entity: u, screen: d, globalActions: f, entityCode: p, record: m, id: h, listRoute: ee, listRouteExists: te, highlights: ae, showBack: oe, onBack: de, onCancelEdit: pe, onSave: he, onRestore: ge, isRestoring: _e, refreshControl: S, isRealtimeEntity: ve, canManageTemplates: ye }) {
868
- let C = v(), w = v("errors"), { run: be } = x(), T = me("detail"), xe = ce(), Se = se(), Ce = ue(d?.action_layout, u?.action_layout, u?.actions, f, "detail_toolbar"), we = ue(d?.action_layout, u?.action_layout, u?.actions, f, "detail"), Te = b(C, we, u?.actions, f, m ?? {}, [], O(u, m ?? {})), Ee = b(C, Ce, u?.actions, f, m ?? {}, [], O(u, m ?? {})), De = M(() => {
869
- if (!u) return;
870
- let e = h ? [h] : [];
868
+ function it({ title: e, editing: t, isNew: n, isRecordDeleted: r, dirty: i, isSaving: a, hasChildErrors: o, hasFieldErrors: s, canRestore: c, entity: l, screen: u, globalActions: d, entityCode: f, record: p, id: m, listRoute: ee, listRouteExists: te, highlights: re, showBack: oe, onBack: se, onCancelEdit: fe, onSave: me, onRestore: ge, isRestoring: _e, refreshControl: ve, isRealtimeEntity: x, canManageTemplates: ye }) {
869
+ let S = ne(), be = ne("errors"), { run: C } = b(), w = he("detail"), xe = le(), Se = ce(), Ce = de(u?.action_layout, l?.action_layout, l?.actions, d, "detail_toolbar"), we = de(u?.action_layout, l?.action_layout, l?.actions, d, "detail"), Te = y(S, we, l?.actions, d, p ?? {}, [], D(l, p ?? {})), Ee = y(S, Ce, l?.actions, d, p ?? {}, [], D(l, p ?? {})), De = j(() => {
870
+ if (!l) return;
871
+ let e = m ? [m] : [];
871
872
  return {
872
- entity: u,
873
- entityCode: p ?? "",
874
- screen: d,
875
- screenRoute: d?.route ?? "",
876
- selectedRows: m ? [m] : [],
873
+ entity: l,
874
+ entityCode: f ?? "",
875
+ screen: u,
876
+ screenRoute: u?.route ?? "",
877
+ selectedRows: p ? [p] : [],
877
878
  selectedIds: e,
878
- t: C,
879
+ t: S,
879
880
  tabNavigate: (e, t) => xe(e, {
880
881
  title: t?.title,
881
882
  icon: t?.icon,
882
883
  search: t?.search
883
884
  }),
884
- runActionApi: (e, t) => ie(e, t),
885
- recordHref: (e) => e === h && d?.route ? d.route.replace(":id", encodeURIComponent(e)) : null
885
+ runActionApi: (e, t) => ae(e, t),
886
+ recordHref: (e) => e === m && u?.route ? u.route.replace(":id", encodeURIComponent(e)) : null
886
887
  };
887
888
  }, [
889
+ l,
890
+ f,
888
891
  u,
889
- p,
890
- d,
891
- h,
892
892
  m,
893
- C,
893
+ p,
894
+ S,
894
895
  xe
895
- ]), ke = (e, t) => {
896
- let n = E(w, e, t, { row: m ?? void 0 });
896
+ ]), Oe = (e, t) => {
897
+ let n = T(be, e, t, { row: p ?? void 0 });
897
898
  if (n === null) return;
898
- let r = h ? [h] : [], i = e === "__delete" && te ? ee : null;
899
- return be({
899
+ let r = m ? [m] : [], i = e === "__delete" && te ? ee : null;
900
+ return C({
900
901
  action: t,
901
- title: C(t.display?.name) || e,
902
- row: m ?? void 0,
903
- execute: (e) => ie(n, y(e, r)),
902
+ title: S(t.display?.name) || e,
903
+ row: p ?? void 0,
904
+ execute: (e) => ae(n, v(e, r)),
904
905
  onSuccess: i ? () => {
905
- le.getState().kill(fe(location)), Se(i, { replace: !0 });
906
+ ue.getState().kill(pe(location)), Se(i, { replace: !0 });
906
907
  } : void 0
907
908
  });
908
- }, Ae = T.isVisible("show_actions") && !r && h && Te.length > 0 ? /* @__PURE__ */ P(D, {
909
+ }, Ae = w.isVisible("show_actions") && !n && m && Te.length > 0 ? /* @__PURE__ */ N(E, {
909
910
  layout: Te,
910
- row: m,
911
- onRun: ke,
911
+ row: p,
912
+ onRun: Oe,
912
913
  kind: "detail",
913
- entityActions: u?.actions,
914
- globalActions: f,
914
+ entityActions: l?.actions,
915
+ globalActions: d,
915
916
  reservedRightWidth: 0,
916
917
  widgetContext: De
917
- }) : null, Me = !r && h ? /* @__PURE__ */ P(Oe, {
918
- liveObject: S,
919
- realtime: ve
920
- }) : null, Ne = T.isVisible("show_actions") && !r && h && Ee.length > 0 ? /* @__PURE__ */ F("div", {
918
+ }) : null, je = !n && m ? /* @__PURE__ */ N(ke, {
919
+ liveObject: ve,
920
+ realtime: x
921
+ }) : null, Ne = w.isVisible("show_actions") && !n && m && Ee.length > 0 ? /* @__PURE__ */ P("div", {
921
922
  style: {
922
923
  display: "flex",
923
924
  justifyContent: "flex-end",
@@ -925,62 +926,61 @@ function rt({ title: e, recordId: t, editing: n, isNew: r, isRecordDeleted: i, d
925
926
  gap: 8,
926
927
  marginTop: 10
927
928
  },
928
- children: [Ae ? null : Me, /* @__PURE__ */ P(D, {
929
+ children: [Ae ? null : je, /* @__PURE__ */ N(E, {
929
930
  layout: Ee,
930
- row: m,
931
- onRun: ke,
931
+ row: p,
932
+ onRun: Oe,
932
933
  kind: "detail",
933
- entityActions: u?.actions,
934
- globalActions: f,
934
+ entityActions: l?.actions,
935
+ globalActions: d,
935
936
  reservedRightWidth: 0,
936
937
  widgetContext: De,
937
- ariaLabel: Ae ? C("record.toolbar_actions", "Detail toolbar actions") : C("record.page_actions", "Page actions")
938
+ ariaLabel: Ae ? S("record.toolbar_actions", "Detail toolbar actions") : S("record.page_actions", "Page actions")
938
939
  })]
939
- }) : null, Pe = T.isVisible("show_actions") && !r && h && p ? /* @__PURE__ */ P(je, {
940
- entityCode: p,
940
+ }) : null, Pe = w.isVisible("show_actions") && !n && m && f ? /* @__PURE__ */ N(Me, {
941
+ entityCode: f,
941
942
  scope: "detail",
942
- objectIds: [h],
943
- capability: u?.documents,
943
+ objectIds: [m],
944
+ capability: l?.documents,
944
945
  canManageTemplates: ye
945
- }) : null, Fe = i ? l ? /* @__PURE__ */ P(_, {
946
+ }) : null, Fe = r ? c ? /* @__PURE__ */ N(g, {
946
947
  kind: "primary",
947
- icon: P(_e ? ne : g.refresh, { size: 13 }),
948
+ icon: N(_e ? _ : h.refresh, { size: 13 }),
948
949
  onClick: ge,
949
950
  disabled: _e,
950
- children: _e ? C("record.restoring", "Restoring…") : C("record.restore", "Restore")
951
- }) : null : n ? /* @__PURE__ */ F(qe, { children: [/* @__PURE__ */ P(_, {
952
- icon: /* @__PURE__ */ P(g.x, { size: 13 }),
953
- onClick: pe,
954
- disabled: o,
955
- children: C("dialog.cancel", "Cancel")
956
- }), /* @__PURE__ */ P(_, {
951
+ children: _e ? S("record.restoring", "Restoring…") : S("record.restore", "Restore")
952
+ }) : null : t ? /* @__PURE__ */ P(Ye, { children: [/* @__PURE__ */ N(g, {
953
+ icon: /* @__PURE__ */ N(h.x, { size: 13 }),
954
+ onClick: fe,
955
+ disabled: a,
956
+ children: S("dialog.cancel", "Cancel")
957
+ }), /* @__PURE__ */ N(g, {
957
958
  kind: "primary",
958
- icon: P(o ? ne : g.save, { size: 13 }),
959
- onClick: he,
960
- disabled: o || s || c,
961
- title: s ? C("record.save.fix_child_rows", "Fix errors in child rows") : c ? C("record.save.fix_fields", "Fix the highlighted fields") : void 0,
962
- children: o ? C("dialog.saving", "Saving…") : C("dialog.save", "Save")
963
- })] }) : !r && h ? Ae ? /* @__PURE__ */ F("span", {
959
+ icon: N(a ? _ : h.save, { size: 13 }),
960
+ onClick: me,
961
+ disabled: a || o || s,
962
+ title: o ? S("record.save.fix_child_rows", "Fix errors in child rows") : s ? S("record.save.fix_fields", "Fix the highlighted fields") : void 0,
963
+ children: a ? S("dialog.saving", "Saving…") : S("dialog.save", "Save")
964
+ })] }) : !n && m ? Ae ? /* @__PURE__ */ P("span", {
964
965
  style: { display: "contents" },
965
966
  children: [Pe, Ae]
966
967
  }) : Pe : null;
967
- return /* @__PURE__ */ F(qe, { children: [/* @__PURE__ */ P(k, {
968
- icon: u?.display.icon ? /* @__PURE__ */ P(re, {
969
- name: u.display.icon,
968
+ return /* @__PURE__ */ P(Ye, { children: [/* @__PURE__ */ N(O, {
969
+ icon: l?.display.icon ? /* @__PURE__ */ N(ie, {
970
+ name: l.display.icon,
970
971
  size: 16
971
972
  }) : void 0,
972
973
  title: e,
973
- description: C(d?.display?.description) || C(u?.display?.description),
974
- recordId: t,
975
- highlights: ae,
976
- identityControls: !i && !n && !r ? Me : null,
977
- mode: r ? "create" : n ? "edit" : "display",
978
- dirty: a,
974
+ description: S(u?.display?.description) || S(l?.display?.description),
975
+ highlights: re,
976
+ identityControls: !r && !t && !n ? je : null,
977
+ mode: n ? "create" : t ? "edit" : "display",
978
+ dirty: i,
979
979
  showBack: oe,
980
- onBack: de,
980
+ onBack: se,
981
981
  right: Fe,
982
- showTitle: T.isVisible("show_title")
982
+ showTitle: w.isVisible("show_title")
983
983
  }), Ne] });
984
984
  }
985
985
  //#endregion
986
- export { L as SmartDetailPage };
986
+ export { I as SmartDetailPage };