@declarion/react 0.40.0 → 0.40.1

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.
@@ -1,6 +1,6 @@
1
1
  import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
2
- import { A as n, At as r, B as i, C as a, Ct as o, Dn as s, E as c, Et as l, Fn as u, I as d, In as f, Jn as p, K as m, Kn as h, Kt as g, L as _, Nn as v, O as y, P as b, R as x, Sn as S, T as C, Tn as w, Tt as T, U as E, Un as D, V as O, W as k, X as A, Yn as j, _ as M, _t as N, ar as P, b as F, bn as I, bt as ee, ct as L, d as te, er as ne, g as R, hn as z, i as re, it as B, j as V, jn as ie, jt as ae, mt as oe, or as H, rr as se, sr as U, st as ce, u as le, v as ue, vt as de, wn as fe, xn as pe, xt as me, yt as he, z as ge } from "./useCurrentScreen-mw8TfE8q.js";
3
- import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke } from "./value-t9ETvWIJ.js";
2
+ import { A as n, At as r, B as i, C as a, Ct as o, Dn as s, E as c, Et as l, Fn as u, I as d, In as f, K as p, Kt as m, L as h, Nn as g, O as _, P as v, R as y, Sn as b, T as x, Tn as S, Tt as C, U as w, V as T, W as E, Wn as D, X as O, Xn as k, Yn as A, _ as j, _t as M, b as N, bn as P, bt as F, cr as I, ct as L, d as R, g as ee, hn as te, i as ne, ir as z, it as B, j as V, jn as re, jt as H, mt as ie, or as ae, qn as oe, sr as U, st as se, tr as ce, u as le, v as ue, vt as de, wn as fe, xn as pe, xt as me, yt as he, z as ge } from "./useCurrentScreen-C33VZcNn.js";
3
+ import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke } from "./value-VOi8Svry.js";
4
4
  import { n as Ae, r as je, t as Me } from "./dataTableStyles-vwD1mVOP.js";
5
5
  import { Component as Ne, Suspense as Pe, lazy as Fe, useCallback as W, useEffect as G, useId as Ie, useLayoutEffect as Le, useMemo as K, useRef as q, useState as J } from "react";
6
6
  import { parsePath as Re, useNavigate as ze } from "react-router-dom";
@@ -119,14 +119,14 @@ function Je({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
119
119
  ]
120
120
  })
121
121
  }),
122
- i && /* @__PURE__ */ X(P, {
122
+ i && /* @__PURE__ */ X(ae, {
123
123
  tone: i.tone ?? "violet",
124
124
  size: "xs",
125
125
  dot: i.dot,
126
126
  children: i.text
127
127
  }),
128
128
  r,
129
- c && /* @__PURE__ */ X(H, {
129
+ c && /* @__PURE__ */ X(U, {
130
130
  size: 24,
131
131
  icon: X(m ? e.up : e.down, { size: 14 }),
132
132
  onClick: () => h((e) => !e),
@@ -579,7 +579,7 @@ function zt(e) {
579
579
  if (!(!e || e === "?")) return e.startsWith("?") ? e : `?${e}`;
580
580
  }
581
581
  function Bt() {
582
- let e = ze(), { data: t } = ae(), n = oe(), r = L();
582
+ let e = ze(), { data: t } = H(), n = ie(), r = L();
583
583
  return W((i, a) => {
584
584
  let { pathname: o, search: s, hash: c } = Rt(i, a?.search);
585
585
  if (n.enabled) {
@@ -614,12 +614,12 @@ function Bt() {
614
614
  }, { replace: a?.replace });
615
615
  return;
616
616
  }
617
- let m = a?.title ? void 0 : v(o, t?.screens, t?.entities), h = a?.title ?? m?.title ?? o, g = a?.icon ?? m?.icon;
617
+ let m = a?.title ? void 0 : g(o, t?.screens, t?.entities), h = a?.title ?? m?.title ?? o, _ = a?.icon ?? m?.icon;
618
618
  l.openTab({
619
619
  pathname: o,
620
620
  search: d,
621
621
  title: h,
622
- icon: g,
622
+ icon: _,
623
623
  closable: !0,
624
624
  returnTo: u ? null : f
625
625
  }), e({
@@ -669,7 +669,7 @@ function Xt(e) {
669
669
  return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
670
670
  }
671
671
  function Zt(e) {
672
- let { field: t, fieldName: n, value: r, onChange: a, mode: o, alt: s, disabled: c, visual: l, uploadFieldCode: u, uploadSlotCode: f } = e, p = Ce(r), [m, h] = J("idle"), [g, v] = J(null), [y, x] = J(null), [S, C] = J(null), [w, T] = J(!1), E = q(null), D = q(!1), O = q(null), { register: k, unregister: A, isDraft: j } = b();
672
+ let { field: t, fieldName: n, value: r, onChange: a, mode: o, alt: s, disabled: c, visual: l, uploadFieldCode: u, uploadSlotCode: f } = e, p = Ce(r), [m, g] = J("idle"), [_, y] = J(null), [b, x] = J(null), [S, C] = J(null), [w, T] = J(!1), E = q(null), D = q(!1), O = q(null), { register: k, unregister: A, isDraft: j } = v();
673
673
  G(() => () => {
674
674
  E.current && E.current.abort();
675
675
  }, []);
@@ -681,7 +681,7 @@ function Zt(e) {
681
681
  ]), N = (t.accepts ?? ["image/*"]).join(","), P = W(async (r) => {
682
682
  let o = i(r, t.accepts, t.max_size_bytes);
683
683
  if (o) {
684
- x(o), h("error");
684
+ x(o), g("error");
685
685
  return;
686
686
  }
687
687
  let s = r;
@@ -695,10 +695,10 @@ function Zt(e) {
695
695
  x({
696
696
  code: "CROP_FAILED",
697
697
  message: e instanceof Error ? e.message : "Crop failed"
698
- }), h("error");
698
+ }), g("error");
699
699
  return;
700
700
  }
701
- x(null), D.current = !1, h("uploading"), v({
701
+ x(null), D.current = !1, g("uploading"), y({
702
702
  loaded: 0,
703
703
  total: s.size,
704
704
  pct: 0
@@ -712,13 +712,13 @@ function Zt(e) {
712
712
  fieldCode: u ?? n,
713
713
  slotCode: f,
714
714
  signal: c.signal,
715
- onProgress: v
715
+ onProgress: y
716
716
  });
717
717
  if (D.current) {
718
- _(r.id).catch(() => {}), A(r.id);
718
+ h(r.id).catch(() => {}), A(r.id);
719
719
  return;
720
720
  }
721
- p && j(p.id) && (_(p.id).catch(() => {}), A(p.id)), k(r.id, () => _(r.id)), C(r.id), h("idle"), v(null);
721
+ p && j(p.id) && (h(p.id).catch(() => {}), A(p.id)), k(r.id, () => h(r.id)), C(r.id), g("idle"), y(null);
722
722
  let i = {
723
723
  id: r.id,
724
724
  filename: r.filename,
@@ -740,7 +740,7 @@ function Zt(e) {
740
740
  code: "UNKNOWN",
741
741
  message: e instanceof Error ? e.message : "Upload failed"
742
742
  };
743
- x(t), h("error"), v(null);
743
+ x(t), g("error"), y(null);
744
744
  }
745
745
  }, [
746
746
  t.accepts,
@@ -758,28 +758,28 @@ function Zt(e) {
758
758
  u,
759
759
  f
760
760
  ]), F = W(() => {
761
- m === "uploading" && E.current && (D.current = !0, E.current.abort(), E.current = null, h("idle"), v(null)), S && (_(S).catch(() => {}), A(S), C(null));
761
+ m === "uploading" && E.current && (D.current = !0, E.current.abort(), E.current = null, g("idle"), y(null)), S && (h(S).catch(() => {}), A(S), C(null));
762
762
  }, [
763
763
  m,
764
764
  S,
765
765
  A
766
766
  ]), I = W(() => {
767
- p && j(p.id) && (_(p.id).catch(() => {}), A(p.id), C(null)), a?.(t.mode === "array" ? [] : null);
767
+ p && j(p.id) && (h(p.id).catch(() => {}), A(p.id), C(null)), a?.(t.mode === "array" ? [] : null);
768
768
  }, [
769
769
  p,
770
770
  t.mode,
771
771
  j,
772
772
  a,
773
773
  A
774
- ]), ee = W(() => {
775
- x(null), h("idle"), O.current?.click();
776
- }, []), L = W(() => {
774
+ ]), L = W(() => {
775
+ x(null), g("idle"), O.current?.click();
776
+ }, []), R = W(() => {
777
777
  c || O.current?.click();
778
- }, [c]), te = W((e) => {
779
- c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), L());
780
- }, [c, L]), ne = W((e) => {
778
+ }, [c]), ee = W((e) => {
779
+ c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), R());
780
+ }, [c, R]), te = W((e) => {
781
781
  c || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
782
- }, [c]), R = W((e) => {
782
+ }, [c]), ne = W((e) => {
783
783
  if (c) return;
784
784
  e.preventDefault();
785
785
  let t = e.dataTransfer.files?.[0];
@@ -787,10 +787,10 @@ function Zt(e) {
787
787
  }, [c, P]), z = W((e) => {
788
788
  let t = e.target.files?.[0];
789
789
  e.target.value = "", t && P(t);
790
- }, [P]), re = l.aspectRatio ?? en(l.shape, t.display?.aspect_ratio), B = ye(p), V = {
791
- aspectRatio: re,
790
+ }, [P]), B = l.aspectRatio ?? en(l.shape, t.display?.aspect_ratio), V = ye(p), re = {
791
+ aspectRatio: B,
792
792
  width: l.width ?? (l.shape === "wide" ? "100%" : "120px")
793
- }, ie = !!p, ae = Yt(p, t.display?.listable_thumbnail), oe = Se(p, t.display?.listable_thumbnail), H = xe(p?.id, oe, ae), se = o === "display", U = W((e) => {
793
+ }, H = !!p, ie = Yt(p, t.display?.listable_thumbnail), ae = Se(p, t.display?.listable_thumbnail), oe = xe(p?.id, ae, ie), U = o === "display", se = W((e) => {
794
794
  e.stopPropagation(), T((e) => !e);
795
795
  }, []), ce = W((e) => {
796
796
  if (!p || !w) return;
@@ -805,15 +805,15 @@ function Zt(e) {
805
805
  w,
806
806
  a
807
807
  ]);
808
- return se ? /* @__PURE__ */ X("div", {
808
+ return U ? /* @__PURE__ */ X("div", {
809
809
  className: Qt(l.shape, !1),
810
- style: V,
810
+ style: re,
811
811
  "aria-label": M,
812
- children: ie && H ? /* @__PURE__ */ X("img", {
813
- src: H,
812
+ children: H && oe ? /* @__PURE__ */ X("img", {
813
+ src: oe,
814
814
  alt: M,
815
815
  className: $t(l.shape),
816
- style: { objectPosition: De(B) },
816
+ style: { objectPosition: De(V) },
817
817
  loading: "lazy"
818
818
  }) : /* @__PURE__ */ X(nn, {
819
819
  shape: l.shape,
@@ -822,18 +822,18 @@ function Zt(e) {
822
822
  })
823
823
  }) : /* @__PURE__ */ Z("div", {
824
824
  className: Qt(l.shape, !c),
825
- style: V,
825
+ style: re,
826
826
  tabIndex: c ? -1 : 0,
827
827
  role: "button",
828
828
  "aria-label": M,
829
829
  "aria-disabled": c || void 0,
830
830
  "aria-busy": m === "uploading" || void 0,
831
831
  "aria-invalid": m === "error" || void 0,
832
- onClick: m === "idle" && !ie ? L : void 0,
832
+ onClick: m === "idle" && !H ? R : void 0,
833
833
  onMouseDown: w ? ce : void 0,
834
- onKeyDown: te,
835
- onDragOver: ne,
836
- onDrop: R,
834
+ onKeyDown: ee,
835
+ onDragOver: te,
836
+ onDrop: ne,
837
837
  "data-testid": w ? "focal-point-target" : `file-widget-${n}`,
838
838
  children: [
839
839
  /* @__PURE__ */ X("input", {
@@ -844,30 +844,30 @@ function Zt(e) {
844
844
  style: { display: "none" },
845
845
  "data-testid": `file-input-${n}`
846
846
  }),
847
- ie && H ? /* @__PURE__ */ X("img", {
848
- src: H,
847
+ H && oe ? /* @__PURE__ */ X("img", {
848
+ src: oe,
849
849
  alt: M,
850
850
  className: $t(l.shape),
851
- style: { objectPosition: De(B) },
851
+ style: { objectPosition: De(V) },
852
852
  loading: "lazy"
853
853
  }) : m === "uploading" ? null : /* @__PURE__ */ X(nn, {
854
854
  shape: l.shape,
855
855
  label: M,
856
856
  placeholder: t.display?.placeholder
857
857
  }),
858
- m === "uploading" && /* @__PURE__ */ X(rn, { pct: g?.pct ?? 0 }),
858
+ m === "uploading" && /* @__PURE__ */ X(rn, { pct: _?.pct ?? 0 }),
859
859
  S && /* @__PURE__ */ X("span", {
860
860
  className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
861
861
  "aria-hidden": "true",
862
862
  "data-testid": "draft-indicator"
863
863
  }),
864
- ie && m === "idle" && !c && /* @__PURE__ */ Z("div", {
864
+ H && m === "idle" && !c && /* @__PURE__ */ Z("div", {
865
865
  className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/40 opacity-0 transition-opacity hover:opacity-100 focus-within:opacity-100",
866
866
  children: [
867
867
  t.display?.focal_point && /* @__PURE__ */ X("button", {
868
868
  type: "button",
869
869
  className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
870
- onClick: U,
870
+ onClick: se,
871
871
  "data-testid": "focal-point-toggle",
872
872
  children: w ? "Cancel focus" : "Set focus"
873
873
  }),
@@ -875,7 +875,7 @@ function Zt(e) {
875
875
  type: "button",
876
876
  className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
877
877
  onClick: (e) => {
878
- e.stopPropagation(), L();
878
+ e.stopPropagation(), R();
879
879
  },
880
880
  children: "Change"
881
881
  }),
@@ -889,11 +889,11 @@ function Zt(e) {
889
889
  })
890
890
  ]
891
891
  }),
892
- B && ie && /* @__PURE__ */ X("span", {
892
+ V && H && /* @__PURE__ */ X("span", {
893
893
  className: "absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border border-white bg-black/70",
894
894
  style: {
895
- left: `${B.x * 100}%`,
896
- top: `${B.y * 100}%`
895
+ left: `${V.x * 100}%`,
896
+ top: `${V.y * 100}%`
897
897
  },
898
898
  "data-testid": "focal-point-marker"
899
899
  }),
@@ -906,18 +906,18 @@ function Zt(e) {
906
906
  "data-testid": "cancel-upload",
907
907
  children: "Cancel"
908
908
  }),
909
- m === "error" && y && /* @__PURE__ */ Z("div", {
909
+ m === "error" && b && /* @__PURE__ */ Z("div", {
910
910
  className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-destructive-soft px-2 py-1 text-xs text-destructive",
911
911
  role: "alert",
912
912
  children: [/* @__PURE__ */ X("span", {
913
913
  className: "truncate",
914
- title: y.message,
915
- children: y.message
914
+ title: b.message,
915
+ children: b.message
916
916
  }), /* @__PURE__ */ X("button", {
917
917
  type: "button",
918
918
  className: "underline",
919
919
  onClick: (e) => {
920
- e.stopPropagation(), ee();
920
+ e.stopPropagation(), L();
921
921
  },
922
922
  "data-testid": "retry-upload",
923
923
  children: "Retry"
@@ -1029,7 +1029,7 @@ function sn(e) {
1029
1029
  }
1030
1030
  //#endregion
1031
1031
  //#region src/components/file-widgets/GridLazy.tsx
1032
- var cn = Fe(() => import("./Grid-BsIkTp3u.js").then((e) => ({ default: e.Grid })));
1032
+ var cn = Fe(() => import("./Grid-CTxov4x2.js").then((e) => ({ default: e.Grid })));
1033
1033
  function ln() {
1034
1034
  return /* @__PURE__ */ X("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
1035
1035
  }
@@ -1048,7 +1048,7 @@ function dn({ contentType: e }) {
1048
1048
  });
1049
1049
  }
1050
1050
  function fn(e) {
1051
- let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s, uploadFieldCode: c, uploadSlotCode: l } = e, u = Ce(r), [f, p] = J("idle"), [m, h] = J(null), [g, v] = J(null), [y, S] = J(!1), [C, w] = J(u?.filename ?? ""), T = q(null), E = q(!1), D = q(null), { register: O, unregister: k, isDraft: A } = b(), { open: j } = Ee();
1051
+ let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s, uploadFieldCode: c, uploadSlotCode: l } = e, u = Ce(r), [f, p] = J("idle"), [m, g] = J(null), [_, b] = J(null), [x, S] = J(!1), [C, w] = J(u?.filename ?? ""), T = q(null), E = q(!1), D = q(null), { register: O, unregister: k, isDraft: A } = v(), { open: j } = Ee();
1052
1052
  G(() => () => {
1053
1053
  T.current && T.current.abort();
1054
1054
  }, []), G(() => {
@@ -1057,10 +1057,10 @@ function fn(e) {
1057
1057
  let M = (t.accepts ?? []).join(","), N = W(async (r) => {
1058
1058
  let o = i(r, t.accepts, t.max_size_bytes);
1059
1059
  if (o) {
1060
- v(o), p("error");
1060
+ b(o), p("error");
1061
1061
  return;
1062
1062
  }
1063
- v(null), E.current = !1, p("uploading"), h({
1063
+ b(null), E.current = !1, p("uploading"), g({
1064
1064
  loaded: 0,
1065
1065
  total: r.size,
1066
1066
  pct: 0
@@ -1074,13 +1074,13 @@ function fn(e) {
1074
1074
  fieldCode: c ?? n,
1075
1075
  slotCode: l,
1076
1076
  signal: s.signal,
1077
- onProgress: h
1077
+ onProgress: g
1078
1078
  });
1079
1079
  if (E.current) {
1080
- _(i.id).catch(() => {}), k(i.id);
1080
+ h(i.id).catch(() => {}), k(i.id);
1081
1081
  return;
1082
1082
  }
1083
- u && A(u.id) && (_(u.id).catch(() => {}), k(u.id)), O(i.id, () => _(i.id)), p("idle"), h(null);
1083
+ u && A(u.id) && (h(u.id).catch(() => {}), k(u.id)), O(i.id, () => h(i.id)), p("idle"), g(null);
1084
1084
  let o = {
1085
1085
  id: i.id,
1086
1086
  filename: i.filename,
@@ -1102,7 +1102,7 @@ function fn(e) {
1102
1102
  code: "UNKNOWN",
1103
1103
  message: e instanceof Error ? e.message : "Upload failed"
1104
1104
  };
1105
- v(t), p("error"), h(null);
1105
+ b(t), p("error"), g(null);
1106
1106
  }
1107
1107
  }, [
1108
1108
  t.accepts,
@@ -1123,20 +1123,20 @@ function fn(e) {
1123
1123
  let t = e.target.files?.[0];
1124
1124
  e.target.value = "", t && N(t);
1125
1125
  }, [N]), I = W(() => {
1126
- u && A(u.id) && (_(u.id).catch(() => {}), k(u.id)), a?.(t.mode === "array" ? [] : null);
1126
+ u && A(u.id) && (h(u.id).catch(() => {}), k(u.id)), a?.(t.mode === "array" ? [] : null);
1127
1127
  }, [
1128
1128
  u,
1129
1129
  t.mode,
1130
1130
  A,
1131
1131
  a,
1132
1132
  k
1133
- ]), ee = W(() => {
1134
- f === "uploading" && T.current && (E.current = !0, T.current.abort(), T.current = null, p("idle"), h(null));
1135
- }, [f]), L = W(() => {
1133
+ ]), L = W(() => {
1134
+ f === "uploading" && T.current && (E.current = !0, T.current.abort(), T.current = null, p("idle"), g(null));
1135
+ }, [f]), R = W(() => {
1136
1136
  u && j(u.id, "download", we(u));
1137
- }, [u, j]), te = u ? _e(u) : !1, ne = W(() => {
1137
+ }, [u, j]), ee = u ? _e(u) : !1, te = W(() => {
1138
1138
  !u || !_e(u) || j(u.id, "preview", ke(u));
1139
- }, [u, j]), R = W(() => {
1139
+ }, [u, j]), ne = W(() => {
1140
1140
  if (!u) {
1141
1141
  S(!1);
1142
1142
  return;
@@ -1184,10 +1184,10 @@ function fn(e) {
1184
1184
  style: { display: "none" },
1185
1185
  "data-testid": `file-input-${n}`
1186
1186
  }),
1187
- f === "error" && g && /* @__PURE__ */ X("div", {
1187
+ f === "error" && _ && /* @__PURE__ */ X("div", {
1188
1188
  className: "ml-auto text-xs text-destructive",
1189
1189
  role: "alert",
1190
- children: g.message
1190
+ children: _.message
1191
1191
  })
1192
1192
  ]
1193
1193
  }) : /* @__PURE__ */ Z("div", {
@@ -1200,15 +1200,15 @@ function fn(e) {
1200
1200
  /* @__PURE__ */ Z("div", {
1201
1201
  className: "flex min-w-0 flex-1 flex-col gap-1",
1202
1202
  children: [
1203
- y && u ? /* @__PURE__ */ X("input", {
1203
+ x && u ? /* @__PURE__ */ X("input", {
1204
1204
  type: "text",
1205
1205
  className: "rounded-sm border border-border bg-card px-1 py-0.5 text-sm text-foreground",
1206
1206
  value: C,
1207
1207
  autoFocus: !0,
1208
1208
  onChange: (e) => w(e.target.value),
1209
- onBlur: R,
1209
+ onBlur: ne,
1210
1210
  onKeyDown: (e) => {
1211
- e.key === "Enter" ? R() : e.key === "Escape" && (S(!1), w(u.filename));
1211
+ e.key === "Enter" ? ne() : e.key === "Escape" && (S(!1), w(u.filename));
1212
1212
  },
1213
1213
  "data-testid": "filename-input"
1214
1214
  }) : /* @__PURE__ */ X("button", {
@@ -1223,7 +1223,7 @@ function fn(e) {
1223
1223
  /* @__PURE__ */ Z("div", {
1224
1224
  className: "flex flex-wrap gap-2 text-xs text-muted-foreground",
1225
1225
  children: [
1226
- u && /* @__PURE__ */ X("span", { children: x(u.size_bytes) }),
1226
+ u && /* @__PURE__ */ X("span", { children: y(u.size_bytes) }),
1227
1227
  u?.page_count != null && /* @__PURE__ */ Z("span", { children: [u.page_count, " pages"] }),
1228
1228
  u?.uploaded_at && /* @__PURE__ */ X("span", { children: pn(u.uploaded_at) }),
1229
1229
  u?.uploaded_by && /* @__PURE__ */ Z("span", { children: ["by ", u.uploaded_by] }),
@@ -1246,10 +1246,10 @@ function fn(e) {
1246
1246
  "%"
1247
1247
  ]
1248
1248
  }),
1249
- f === "error" && g && /* @__PURE__ */ X("div", {
1249
+ f === "error" && _ && /* @__PURE__ */ X("div", {
1250
1250
  className: "text-xs text-destructive",
1251
1251
  role: "alert",
1252
- children: g.message
1252
+ children: _.message
1253
1253
  })
1254
1254
  ]
1255
1255
  }),
@@ -1259,16 +1259,16 @@ function fn(e) {
1259
1259
  /* @__PURE__ */ X("button", {
1260
1260
  type: "button",
1261
1261
  className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
1262
- onClick: L,
1262
+ onClick: R,
1263
1263
  "data-testid": "download",
1264
1264
  children: "Download"
1265
1265
  }),
1266
1266
  /* @__PURE__ */ X("button", {
1267
1267
  type: "button",
1268
1268
  className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",
1269
- onClick: ne,
1270
- disabled: !te,
1271
- title: te ? void 0 : "Preview is available only for images and PDFs",
1269
+ onClick: te,
1270
+ disabled: !ee,
1271
+ title: ee ? void 0 : "Preview is available only for images and PDFs",
1272
1272
  "data-testid": "preview",
1273
1273
  children: "Preview"
1274
1274
  }),
@@ -1290,7 +1290,7 @@ function fn(e) {
1290
1290
  ] }), f === "uploading" && /* @__PURE__ */ X("button", {
1291
1291
  type: "button",
1292
1292
  className: "rounded-sm border border-border bg-card px-2 py-1 text-xs",
1293
- onClick: ee,
1293
+ onClick: L,
1294
1294
  "data-testid": "cancel-upload",
1295
1295
  children: "Cancel"
1296
1296
  })]
@@ -1316,13 +1316,13 @@ function mn(e) {
1316
1316
  return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
1317
1317
  }
1318
1318
  function hn(e) {
1319
- let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s } = e, c = Oe(r), [l, u] = J([]), { register: f, unregister: p, isDraft: m } = b(), h = q(c);
1320
- h.current = c;
1321
- let g = q(null), v = q(/* @__PURE__ */ new Set()), y = q([]);
1322
- y.current = l;
1319
+ let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s } = e, c = Oe(r), [l, u] = J([]), { register: f, unregister: p, isDraft: m } = v(), g = q(c);
1320
+ g.current = c;
1321
+ let _ = q(null), b = q(/* @__PURE__ */ new Set()), x = q([]);
1322
+ x.current = l;
1323
1323
  let { open: S } = Ee();
1324
1324
  G(() => () => {
1325
- y.current.forEach((e) => e.abort());
1325
+ x.current.forEach((e) => e.abort());
1326
1326
  }, []);
1327
1327
  let C = (t.accepts ?? []).join(","), w = o === "display", T = W(async (r) => {
1328
1328
  let o = i(r, t.accepts, t.max_size_bytes), s = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, c = new AbortController();
@@ -1358,11 +1358,11 @@ function hn(e) {
1358
1358
  progress: e
1359
1359
  } : t))
1360
1360
  });
1361
- if (v.current.delete(s)) {
1362
- _(t.id).catch(() => {}), p(t.id);
1361
+ if (b.current.delete(s)) {
1362
+ h(t.id).catch(() => {}), p(t.id);
1363
1363
  return;
1364
1364
  }
1365
- f(t.id, () => _(t.id));
1365
+ f(t.id, () => h(t.id));
1366
1366
  let i = {
1367
1367
  id: t.id,
1368
1368
  filename: t.filename,
@@ -1373,8 +1373,8 @@ function hn(e) {
1373
1373
  height: t.height,
1374
1374
  url: t.url,
1375
1375
  metadata: t.metadata
1376
- }, o = [...h.current, i];
1377
- h.current = o, a?.(o), u((e) => e.filter((e) => e.localId !== s));
1376
+ }, o = [...g.current, i];
1377
+ g.current = o, a?.(o), u((e) => e.filter((e) => e.localId !== s));
1378
1378
  } catch (e) {
1379
1379
  if (e instanceof d && e.code === "ABORTED") {
1380
1380
  u((e) => e.filter((e) => e.localId !== s));
@@ -1405,12 +1405,12 @@ function hn(e) {
1405
1405
  ]), E = W((e) => {
1406
1406
  Array.from(e).forEach((e) => void T(e));
1407
1407
  }, [T]), D = W(() => {
1408
- s || g.current?.click();
1408
+ s || _.current?.click();
1409
1409
  }, [s]), O = W((e) => {
1410
1410
  let t = e.target.files;
1411
1411
  e.target.value = "", t && t.length > 0 && E(t);
1412
1412
  }, [E]), k = W((e) => {
1413
- m(e) && (_(e).catch(() => {}), p(e)), a?.(c.filter((t) => t.id !== e));
1413
+ m(e) && (h(e).catch(() => {}), p(e)), a?.(c.filter((t) => t.id !== e));
1414
1414
  }, [
1415
1415
  m,
1416
1416
  c,
@@ -1446,7 +1446,7 @@ function hn(e) {
1446
1446
  }),
1447
1447
  /* @__PURE__ */ X("span", {
1448
1448
  className: "flex-none text-xs text-muted-foreground",
1449
- children: x(e.size_bytes)
1449
+ children: y(e.size_bytes)
1450
1450
  }),
1451
1451
  /* @__PURE__ */ X("button", {
1452
1452
  type: "button",
@@ -1493,7 +1493,7 @@ function hn(e) {
1493
1493
  type: "button",
1494
1494
  className: "flex-none rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
1495
1495
  onClick: () => {
1496
- e.abort(), v.current.add(e.localId), u((t) => t.filter((t) => t.localId !== e.localId));
1496
+ e.abort(), b.current.add(e.localId), u((t) => t.filter((t) => t.localId !== e.localId));
1497
1497
  },
1498
1498
  children: e.error ? "Dismiss" : "Cancel"
1499
1499
  })
@@ -1508,7 +1508,7 @@ function hn(e) {
1508
1508
  "data-testid": "add-files",
1509
1509
  children: "Add files"
1510
1510
  }), /* @__PURE__ */ X("input", {
1511
- ref: g,
1511
+ ref: _,
1512
1512
  type: "file",
1513
1513
  accept: C || void 0,
1514
1514
  multiple: !0,
@@ -1623,17 +1623,17 @@ function wn(e, t) {
1623
1623
  function Tn(e, t, n) {
1624
1624
  if (Cn(e, n)) return wn(t, n);
1625
1625
  let r = e.fields.get(n);
1626
- return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? O(t[n], wn(t, n)) : t[n];
1626
+ return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? T(t[n], wn(t, n)) : t[n];
1627
1627
  }
1628
1628
  function En(e, t, n) {
1629
1629
  let r = e.fields.get(t);
1630
- return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? k(n) : n;
1630
+ return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? E(n) : n;
1631
1631
  }
1632
1632
  function Dn(e, t, n) {
1633
1633
  let r = Cn(e, t);
1634
1634
  if (r) return r.name || t;
1635
1635
  let i = e.fields.get(t);
1636
- return i ? S(i, t, n) : t;
1636
+ return i ? b(i, t, n) : t;
1637
1637
  }
1638
1638
  function On(e) {
1639
1639
  let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m } = e, h = Cn(t, r);
@@ -1749,7 +1749,7 @@ function Ln(e) {
1749
1749
  }
1750
1750
  function Rn(e, t) {
1751
1751
  if (e.mode !== "rich_text_inline") return { clear: !0 };
1752
- let n = E(k(t));
1752
+ let n = w(E(t));
1753
1753
  return n.length === 0 ? { clear: !0 } : { set: n.map((e, t) => ({
1754
1754
  file_id: e,
1755
1755
  position: t
@@ -1951,7 +1951,7 @@ function nr(e, t, n, r, i, a) {
1951
1951
  op: "eq",
1952
1952
  value: c[t]
1953
1953
  }));
1954
- return e.set("filters", JSON.stringify(t)), e.set("preview", "true"), i && e.set("sort", i), a && e.set("limit", String(a)), g(`/api/data/${n}?${e.toString()}`);
1954
+ return e.set("filters", JSON.stringify(t)), e.set("preview", "true"), i && e.set("sort", i), a && e.set("limit", String(a)), m(`/api/data/${n}?${e.toString()}`);
1955
1955
  },
1956
1956
  enabled: !!e && !!t && !!n && !!r && c !== null
1957
1957
  });
@@ -1994,7 +1994,7 @@ function ar(e, t, n, r, i, a, o, s) {
1994
1994
  op: "eq",
1995
1995
  value: t
1996
1996
  });
1997
- return c.set("filters", JSON.stringify(l)), i && c.set("sort", i), a && c.set("limit", String(a)), o && c.set("search", o), e && c.set("after", e), g(`/api/data/${n}?${c.toString()}`);
1997
+ return c.set("filters", JSON.stringify(l)), i && c.set("sort", i), a && c.set("limit", String(a)), o && c.set("search", o), e && c.set("after", e), m(`/api/data/${n}?${c.toString()}`);
1998
1998
  },
1999
1999
  getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
2000
2000
  initialPageParam: void 0,
@@ -2004,16 +2004,16 @@ function ar(e, t, n, r, i, a, o, s) {
2004
2004
  //#endregion
2005
2005
  //#region src/components/shared/ActionButton.tsx
2006
2006
  function or({ actionCode: n, action: r, entityCode: i, objectIds: o = [], row: s, variant: c = "outline", size: l = "default", onSuccess: u }) {
2007
- let [d, f] = J(!1), [p, m] = J(!1), { data: h } = ae(), g = Bt(), { run: _ } = re(), v = C(r), b = !s || F(r.conditions, s), x = W(async () => {
2007
+ let [d, f] = J(!1), [p, m] = J(!1), { data: h } = H(), g = Bt(), { run: v } = ne(), y = x(r), b = !s || N(r.conditions, s), w = W(async () => {
2008
2008
  if (!(!r.association || o.length === 0)) {
2009
2009
  f(!0);
2010
2010
  try {
2011
- let e = await T(i ? `${i}.${r.association}` : r.association, o), t = a(h, e.target_entity);
2011
+ let e = await C(i ? `${i}.${r.association}` : r.association, o), t = a(h, e.target_entity);
2012
2012
  if (!t) {
2013
2013
  B.error(`No list screen found for ${e.target_entity}`);
2014
2014
  return;
2015
2015
  }
2016
- let n = h?.entities[e.target_entity], s = w(r.display?.name) || e.target_entity;
2016
+ let n = h?.entities[e.target_entity], s = S(r.display?.name) || e.target_entity;
2017
2017
  if (e.ids.length === 0) {
2018
2018
  B.info(`No related ${s} found`);
2019
2019
  return;
@@ -2037,37 +2037,37 @@ function or({ actionCode: n, action: r, entityCode: i, objectIds: o = [], row: s
2037
2037
  h,
2038
2038
  g,
2039
2039
  u
2040
- ]), S = r.entity ? `${r.entity}.${n}` : n, E = o.length > 0 ? o : void 0, D = W(() => {
2041
- m(!0), _({
2040
+ ]), T = r.entity ? `${r.entity}.${n}` : n, E = o.length > 0 ? o : void 0, D = W(() => {
2041
+ m(!0), v({
2042
2042
  action: r,
2043
- title: w(r.display?.name) || n,
2043
+ title: S(r.display?.name) || n,
2044
2044
  row: s,
2045
2045
  entity: i,
2046
- execute: (e) => me(S, N(e, E)),
2046
+ execute: (e) => me(T, M(e, E)),
2047
2047
  onSuccess: () => u?.()
2048
2048
  }).finally(() => m(!1));
2049
2049
  }, [
2050
- _,
2050
+ v,
2051
2051
  r,
2052
2052
  n,
2053
2053
  s,
2054
2054
  i,
2055
- S,
2055
+ T,
2056
2056
  E,
2057
2057
  u
2058
2058
  ]), O = W(() => {
2059
- if (te(r)) {
2059
+ if (R(r)) {
2060
2060
  le(r.ui_steps, { row: s }).then(() => u?.());
2061
2061
  return;
2062
2062
  }
2063
- if (v) {
2064
- x();
2063
+ if (y) {
2064
+ w();
2065
2065
  return;
2066
2066
  }
2067
2067
  if (r.href && !r.handler && !r.association) {
2068
- let e = y(s, i ? h?.entities[i] : void 0), t = r.href;
2068
+ let e = _(s, i ? h?.entities[i] : void 0), t = r.href;
2069
2069
  i && (t = t.replaceAll("${entity}", i)), e && (t = t.replaceAll("${id}", encodeURIComponent(e))), g(t, {
2070
- title: w(r.display?.name) || n,
2070
+ title: S(r.display?.name) || n,
2071
2071
  icon: r.display?.icon
2072
2072
  }), u?.();
2073
2073
  return;
@@ -2080,25 +2080,25 @@ function or({ actionCode: n, action: r, entityCode: i, objectIds: o = [], row: s
2080
2080
  h?.entities,
2081
2081
  n,
2082
2082
  g,
2083
- v,
2084
- x,
2083
+ y,
2084
+ w,
2085
2085
  D,
2086
2086
  u
2087
- ]), k = w(r.display?.name), A = r.display?.icon, j = A && e[A], M = j ? /* @__PURE__ */ X(j, { size: 13 }) : A ? /* @__PURE__ */ X(t, {
2087
+ ]), k = S(r.display?.name), A = r.display?.icon, j = A && e[A], P = j ? /* @__PURE__ */ X(j, { size: 13 }) : A ? /* @__PURE__ */ X(t, {
2088
2088
  name: A,
2089
2089
  size: 13
2090
- }) : null, P = !b || p || d;
2091
- return l === "icon" ? /* @__PURE__ */ X(H, {
2092
- icon: M ?? /* @__PURE__ */ X(e.bolt, { size: 13 }),
2090
+ }) : null, F = !b || p || d;
2091
+ return l === "icon" ? /* @__PURE__ */ X(U, {
2092
+ icon: P ?? /* @__PURE__ */ X(e.bolt, { size: 13 }),
2093
2093
  onClick: O,
2094
2094
  title: k
2095
- }) : /* @__PURE__ */ X(U, {
2095
+ }) : /* @__PURE__ */ X(I, {
2096
2096
  kind: c === "default" ? "primary" : c === "ghost" ? "ghost" : "default",
2097
2097
  size: "sm",
2098
- icon: M,
2098
+ icon: P,
2099
2099
  danger: r.destructive,
2100
2100
  onClick: O,
2101
- disabled: P,
2101
+ disabled: F,
2102
2102
  title: k,
2103
2103
  "aria-label": k,
2104
2104
  children: k
@@ -2113,7 +2113,7 @@ function cr(e) {
2113
2113
  return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
2114
2114
  }
2115
2115
  function lr(e, t, n, r, i) {
2116
- let a = cr(t), o = y(n, r?.entity), s = r?.entityCode ?? "";
2116
+ let a = cr(t), o = _(n, r?.entity), s = r?.entityCode ?? "";
2117
2117
  if (e === "__peek") return i?.({
2118
2118
  code: e,
2119
2119
  entity: s,
@@ -2181,7 +2181,7 @@ function pr(e, t, n) {
2181
2181
  if (n && e in n) return n[e];
2182
2182
  }
2183
2183
  function mr(e, t, n) {
2184
- return w(pr(e, t, n)?.display?.name) || e;
2184
+ return S(pr(e, t, n)?.display?.name) || e;
2185
2185
  }
2186
2186
  function hr(e, t, n) {
2187
2187
  return pr(e, t, n)?.display?.icon || void 0;
@@ -2190,8 +2190,8 @@ function gr(e) {
2190
2190
  return `action-tooltip-${e}`;
2191
2191
  }
2192
2192
  function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, measureRef: s, style: c, row: l, widgetContext: u, onActionClick: d }) {
2193
- let f = pr(e.code, n, r), m = mr(e.code, n, r), h = hr(e.code, n, r), g = f?.destructive ?? !1, _ = !g && f?.display?.primary === !0, v = !e.enabled, y = v ? gr(e.code) : void 0, b = W(async () => {
2194
- if (!(!f || v || a)) {
2193
+ let f = pr(e.code, n, r), p = mr(e.code, n, r), m = hr(e.code, n, r), h = f?.destructive ?? !1, g = !h && f?.display?.primary === !0, _ = !e.enabled, v = _ ? gr(e.code) : void 0, y = W(async () => {
2194
+ if (!(!f || _ || a)) {
2195
2195
  o(!0);
2196
2196
  try {
2197
2197
  lr(e.code, f, l, u, d) || await Promise.resolve(i(e.code, f));
@@ -2201,7 +2201,7 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
2201
2201
  }
2202
2202
  }, [
2203
2203
  f,
2204
- v,
2204
+ _,
2205
2205
  a,
2206
2206
  i,
2207
2207
  e.code,
@@ -2209,12 +2209,12 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
2209
2209
  l,
2210
2210
  u,
2211
2211
  d
2212
- ]), x = a ? /* @__PURE__ */ X(p, { size: 12 }) : h ? /* @__PURE__ */ X(t, {
2213
- name: h,
2212
+ ]), b = a ? /* @__PURE__ */ X(A, { size: 12 }) : m ? /* @__PURE__ */ X(t, {
2213
+ name: m,
2214
2214
  size: 12
2215
2215
  }) : null;
2216
- return /* @__PURE__ */ Z(Y, { children: [y && e.reason && /* @__PURE__ */ X("span", {
2217
- id: y,
2216
+ return /* @__PURE__ */ Z(Y, { children: [v && e.reason && /* @__PURE__ */ X("span", {
2217
+ id: v,
2218
2218
  role: "tooltip",
2219
2219
  style: {
2220
2220
  position: "absolute",
@@ -2224,52 +2224,52 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
2224
2224
  clip: "rect(0,0,0,0)"
2225
2225
  },
2226
2226
  children: e.reason
2227
- }), /* @__PURE__ */ X(U, {
2227
+ }), /* @__PURE__ */ X(I, {
2228
2228
  ref: s,
2229
- kind: _ ? "primary" : "default",
2230
- danger: g,
2231
- icon: x,
2232
- disabled: v || a,
2233
- "aria-disabled": v ? "true" : void 0,
2234
- "aria-describedby": y,
2235
- title: R(f, m, v, e.reason),
2236
- onClick: b,
2229
+ kind: g ? "primary" : "default",
2230
+ danger: h,
2231
+ icon: b,
2232
+ disabled: _ || a,
2233
+ "aria-disabled": _ ? "true" : void 0,
2234
+ "aria-describedby": v,
2235
+ title: ee(f, p, _, e.reason),
2236
+ onClick: y,
2237
2237
  style: c,
2238
- children: m
2238
+ children: p
2239
2239
  })] });
2240
2240
  }
2241
2241
  function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o, onLoadingChange: s, measureRef: c, style: l, row: u, widgetContext: d, onActionClick: f }) {
2242
- let m = q(null), [h, g] = J(!1), _ = n.name ? w(n.name) : "Actions", v = W((e) => {
2243
- m.current = e, c?.(e);
2244
- }, [c]), y = W((e, t) => (g(!1), a(e, t)), [a]);
2245
- return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(U, {
2246
- ref: v,
2242
+ let p = q(null), [m, h] = J(!1), g = n.name ? S(n.name) : "Actions", _ = W((e) => {
2243
+ p.current = e, c?.(e);
2244
+ }, [c]), v = W((e, t) => (h(!1), a(e, t)), [a]);
2245
+ return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(I, {
2246
+ ref: _,
2247
2247
  kind: "default",
2248
2248
  icon: o == null ? n.icon ? /* @__PURE__ */ X(t, {
2249
2249
  name: n.icon,
2250
2250
  size: 12
2251
- }) : void 0 : /* @__PURE__ */ X(p, { size: 12 }),
2251
+ }) : void 0 : /* @__PURE__ */ X(A, { size: 12 }),
2252
2252
  iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
2253
2253
  "aria-haspopup": "menu",
2254
- "aria-expanded": h ? "true" : "false",
2255
- title: _,
2256
- onClick: () => g((e) => !e),
2254
+ "aria-expanded": m ? "true" : "false",
2255
+ title: g,
2256
+ onClick: () => h((e) => !e),
2257
2257
  style: l,
2258
- children: _
2259
- }), /* @__PURE__ */ X(se, {
2260
- open: h,
2261
- anchor: m.current,
2262
- onClose: () => g(!1),
2258
+ children: g
2259
+ }), /* @__PURE__ */ X(z, {
2260
+ open: m,
2261
+ anchor: p.current,
2262
+ onClose: () => h(!1),
2263
2263
  align: "start",
2264
2264
  width: 200,
2265
2265
  children: /* @__PURE__ */ X("div", {
2266
2266
  role: "menu",
2267
- "aria-label": _,
2267
+ "aria-label": g,
2268
2268
  children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ X(yr, {
2269
2269
  leaf: e,
2270
2270
  entityActions: r,
2271
2271
  globalActions: i,
2272
- onRun: y,
2272
+ onRun: v,
2273
2273
  loading: o === e.code,
2274
2274
  onLoadingChange: (t) => s(t ? e.code : null),
2275
2275
  row: u,
@@ -2279,7 +2279,7 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
2279
2279
  group: e,
2280
2280
  entityActions: r,
2281
2281
  globalActions: i,
2282
- onRun: y,
2282
+ onRun: v,
2283
2283
  loading: o,
2284
2284
  onLoadingChange: s,
2285
2285
  row: u,
@@ -2290,12 +2290,12 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
2290
2290
  })] });
2291
2291
  }
2292
2292
  function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, row: s, widgetContext: c, onActionClick: l }) {
2293
- let u = pr(e.code, n, r), d = mr(e.code, n, r), f = hr(e.code, n, r), m = u?.destructive ?? !1, h = !e.enabled, g = h ? gr(e.code) : void 0, _ = a ? /* @__PURE__ */ X(p, { size: 12 }) : f ? /* @__PURE__ */ X(t, {
2293
+ let u = pr(e.code, n, r), d = mr(e.code, n, r), f = hr(e.code, n, r), p = u?.destructive ?? !1, m = !e.enabled, h = m ? gr(e.code) : void 0, g = a ? /* @__PURE__ */ X(A, { size: 12 }) : f ? /* @__PURE__ */ X(t, {
2294
2294
  name: f,
2295
2295
  size: 12
2296
2296
  }) : null;
2297
- return /* @__PURE__ */ Z(Y, { children: [g && e.reason && /* @__PURE__ */ X("span", {
2298
- id: g,
2297
+ return /* @__PURE__ */ Z(Y, { children: [h && e.reason && /* @__PURE__ */ X("span", {
2298
+ id: h,
2299
2299
  role: "tooltip",
2300
2300
  style: {
2301
2301
  position: "absolute",
@@ -2307,11 +2307,11 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
2307
2307
  children: e.reason
2308
2308
  }), /* @__PURE__ */ Z("div", {
2309
2309
  role: "menuitem",
2310
- "aria-disabled": h ? "true" : void 0,
2311
- "aria-describedby": g,
2312
- title: R(u, d, h, e.reason),
2310
+ "aria-disabled": m ? "true" : void 0,
2311
+ "aria-describedby": h,
2312
+ title: ee(u, d, m, e.reason),
2313
2313
  onClick: async () => {
2314
- if (!(!u || h || a)) {
2314
+ if (!(!u || m || a)) {
2315
2315
  o(!0);
2316
2316
  try {
2317
2317
  lr(e.code, u, s, c, l) || await Promise.resolve(i(e.code, u));
@@ -2327,22 +2327,22 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
2327
2327
  padding: "6px 10px",
2328
2328
  borderRadius: 5,
2329
2329
  fontSize: 12.5,
2330
- color: m ? "var(--danger)" : h ? "var(--text-3)" : "var(--text-2)",
2331
- cursor: h ? "not-allowed" : "pointer",
2332
- opacity: h ? .6 : 1
2330
+ color: p ? "var(--danger)" : m ? "var(--text-3)" : "var(--text-2)",
2331
+ cursor: m ? "not-allowed" : "pointer",
2332
+ opacity: m ? .6 : 1
2333
2333
  },
2334
2334
  onMouseEnter: (e) => {
2335
- h || (e.currentTarget.style.background = "var(--surface-3)");
2335
+ m || (e.currentTarget.style.background = "var(--surface-3)");
2336
2336
  },
2337
2337
  onMouseLeave: (e) => {
2338
2338
  e.currentTarget.style.background = "transparent";
2339
2339
  },
2340
- children: [_ && /* @__PURE__ */ X("span", {
2340
+ children: [g && /* @__PURE__ */ X("span", {
2341
2341
  style: {
2342
- color: m ? "var(--danger)" : "var(--text-3)",
2342
+ color: p ? "var(--danger)" : "var(--text-3)",
2343
2343
  display: "flex"
2344
2344
  },
2345
- children: _
2345
+ children: g
2346
2346
  }), /* @__PURE__ */ X("span", {
2347
2347
  style: { flex: 1 },
2348
2348
  children: d
@@ -2350,7 +2350,7 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
2350
2350
  })] });
2351
2351
  }
2352
2352
  function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
2353
- let l = e.name ? w(e.name) : void 0;
2353
+ let l = e.name ? S(e.name) : void 0;
2354
2354
  return /* @__PURE__ */ Z(Y, { children: [l && /* @__PURE__ */ X("div", {
2355
2355
  style: {
2356
2356
  padding: "4px 10px 2px",
@@ -2384,19 +2384,19 @@ function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
2384
2384
  }, e.icon ?? "nested"))] });
2385
2385
  }
2386
2386
  function xr({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, widgetContext: o, onActionClick: s }) {
2387
- let c = q(null), [l, u] = J(!1), [d, f] = J(null), m = W((e, t) => (u(!1), i(e, t)), [i]);
2387
+ let c = q(null), [l, u] = J(!1), [d, f] = J(null), p = W((e, t) => (u(!1), i(e, t)), [i]);
2388
2388
  return ur(t) === 0 ? null : /* @__PURE__ */ Z("div", {
2389
2389
  style: {
2390
2390
  display: "inline-flex",
2391
2391
  alignItems: "center"
2392
2392
  },
2393
- children: [/* @__PURE__ */ X(H, {
2393
+ children: [/* @__PURE__ */ X(U, {
2394
2394
  ref: c,
2395
- icon: X(d == null ? e.more : p, { size: 14 }),
2395
+ icon: X(d == null ? e.more : A, { size: 14 }),
2396
2396
  title: "Actions",
2397
2397
  size: 28,
2398
2398
  onClick: () => u((e) => !e)
2399
- }), /* @__PURE__ */ X(se, {
2399
+ }), /* @__PURE__ */ X(z, {
2400
2400
  open: l,
2401
2401
  anchor: c.current,
2402
2402
  onClose: () => u(!1),
@@ -2406,7 +2406,7 @@ function xr({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, w
2406
2406
  layout: t,
2407
2407
  entityActions: n,
2408
2408
  globalActions: r,
2409
- onRun: m,
2409
+ onRun: p,
2410
2410
  loading: d,
2411
2411
  onLoadingChange: f,
2412
2412
  row: a,
@@ -2439,7 +2439,7 @@ function Cr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
2439
2439
  "aria-label": l,
2440
2440
  children: [
2441
2441
  p.map((e) => e.kind === "action" ? _(e) : null),
2442
- p.length > 0 && g && /* @__PURE__ */ X(j, { divider: !0 }),
2442
+ p.length > 0 && g && /* @__PURE__ */ X(k, { divider: !0 }),
2443
2443
  m.map((e) => e.kind === "action" ? _(e) : /* @__PURE__ */ X(br, {
2444
2444
  group: e,
2445
2445
  entityActions: t,
@@ -2451,7 +2451,7 @@ function Cr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
2451
2451
  widgetContext: s,
2452
2452
  onActionClick: c
2453
2453
  }, e.icon ?? "group")),
2454
- h && /* @__PURE__ */ X(j, { divider: !0 }),
2454
+ h && /* @__PURE__ */ X(k, { divider: !0 }),
2455
2455
  d.map((e) => _(e))
2456
2456
  ]
2457
2457
  });
@@ -2479,10 +2479,10 @@ function Or(e, t, n, r, i, a, o, s) {
2479
2479
  };
2480
2480
  }
2481
2481
  function Q(e) {
2482
- return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? w(e.name) : ""}`;
2482
+ return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? S(e.name) : ""}`;
2483
2483
  }
2484
2484
  function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedRightWidth: o = 0, measurementOverride: s, ariaLabel: c = "Actions", align: l = "trailing", constrain: u = !0, row: d, widgetContext: f, onActionClick: p }) {
2485
- let m = q(null), h = q(null), [g, _] = J(0), [v, y] = J(/* @__PURE__ */ new Map()), [b, x] = J(!1), [S, C] = J(null), [T, E] = J(() => typeof document < "u" && document.documentElement.dir === "rtl");
2485
+ let m = q(null), h = q(null), [g, _] = J(0), [v, y] = J(/* @__PURE__ */ new Map()), [b, x] = J(!1), [C, w] = J(null), [T, E] = J(() => typeof document < "u" && document.documentElement.dir === "rtl");
2486
2486
  G(() => {
2487
2487
  if (typeof MutationObserver > "u") return;
2488
2488
  let e = new MutationObserver((e) => {
@@ -2555,7 +2555,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2555
2555
  G(() => {
2556
2556
  F.current = void 0;
2557
2557
  }, [P]);
2558
- let I = K(() => M || !u ? Or(n, 2 ** 53 - 1, o, v, r, i, s) : b ? g === 0 ? Or(n, 2 ** 53 - 1, o, v, r, i, s) : Or(n, g, o, v, r, i, s, F.current) : {
2558
+ let L = K(() => M || !u ? Or(n, 2 ** 53 - 1, o, v, r, i, s) : b ? g === 0 ? Or(n, 2 ** 53 - 1, o, v, r, i, s) : Or(n, g, o, v, r, i, s, F.current) : {
2559
2559
  primaryInline: [],
2560
2560
  inline: [],
2561
2561
  overflow: [],
@@ -2573,9 +2573,9 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2573
2573
  s
2574
2574
  ]);
2575
2575
  if (G(() => {
2576
- F.current = new Set([...I.inline, ...I.primaryInline].map(Q));
2577
- }, [I]), j === 0) return null;
2578
- let ee = I.overflow.length > 0;
2576
+ F.current = new Set([...L.inline, ...L.primaryInline].map(Q));
2577
+ }, [L]), j === 0) return null;
2578
+ let R = L.overflow.length > 0;
2579
2579
  return /* @__PURE__ */ Z("div", {
2580
2580
  ref: m,
2581
2581
  role: "toolbar",
@@ -2605,7 +2605,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2605
2605
  top: 0,
2606
2606
  left: 0
2607
2607
  },
2608
- children: [/* @__PURE__ */ X(U, {
2608
+ children: [/* @__PURE__ */ X(I, {
2609
2609
  "data-node-key": wr,
2610
2610
  iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
2611
2611
  tabIndex: -1,
@@ -2614,7 +2614,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2614
2614
  let a = Q(n);
2615
2615
  if (n.kind === "action") {
2616
2616
  let e = pr(n.code, r, i), o = mr(n.code, r, i), s = hr(n.code, r, i);
2617
- return /* @__PURE__ */ X(U, {
2617
+ return /* @__PURE__ */ X(I, {
2618
2618
  "data-node-key": a,
2619
2619
  icon: s ? /* @__PURE__ */ X(t, {
2620
2620
  name: s,
@@ -2625,8 +2625,8 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2625
2625
  children: o
2626
2626
  }, a);
2627
2627
  } else {
2628
- let t = n.name ? w(n.name) : "Actions";
2629
- return /* @__PURE__ */ X(U, {
2628
+ let t = n.name ? S(n.name) : "Actions";
2629
+ return /* @__PURE__ */ X(I, {
2630
2630
  "data-node-key": a,
2631
2631
  iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
2632
2632
  tabIndex: -1,
@@ -2635,26 +2635,26 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2635
2635
  }
2636
2636
  })]
2637
2637
  }),
2638
- I.primaryInline.map((e) => /* @__PURE__ */ X(_r, {
2638
+ L.primaryInline.map((e) => /* @__PURE__ */ X(_r, {
2639
2639
  leaf: e,
2640
2640
  entityActions: r,
2641
2641
  globalActions: i,
2642
2642
  onRun: a,
2643
- loading: S === e.code,
2644
- onLoadingChange: (t) => C(t ? e.code : null),
2643
+ loading: C === e.code,
2644
+ onLoadingChange: (t) => w(t ? e.code : null),
2645
2645
  row: d,
2646
2646
  widgetContext: f,
2647
2647
  onActionClick: p
2648
2648
  }, Q(e))),
2649
- I.inline.map((e) => {
2649
+ L.inline.map((e) => {
2650
2650
  let t = Q(e);
2651
2651
  return e.kind === "action" ? /* @__PURE__ */ X(_r, {
2652
2652
  leaf: e,
2653
2653
  entityActions: r,
2654
2654
  globalActions: i,
2655
2655
  onRun: a,
2656
- loading: S === e.code,
2657
- onLoadingChange: (t) => C(t ? e.code : null),
2656
+ loading: C === e.code,
2657
+ onLoadingChange: (t) => w(t ? e.code : null),
2658
2658
  row: d,
2659
2659
  widgetContext: f,
2660
2660
  onActionClick: p
@@ -2663,14 +2663,14 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2663
2663
  entityActions: r,
2664
2664
  globalActions: i,
2665
2665
  onRun: a,
2666
- loading: S,
2667
- onLoadingChange: C,
2666
+ loading: C,
2667
+ onLoadingChange: w,
2668
2668
  row: d,
2669
2669
  widgetContext: f,
2670
2670
  onActionClick: p
2671
2671
  }, t);
2672
2672
  }),
2673
- ee && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(U, {
2673
+ R && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(I, {
2674
2674
  ref: D,
2675
2675
  kind: "default",
2676
2676
  iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
@@ -2678,7 +2678,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2678
2678
  "aria-expanded": O ? "true" : "false",
2679
2679
  onClick: () => k((e) => !e),
2680
2680
  children: "Actions"
2681
- }), /* @__PURE__ */ X(se, {
2681
+ }), /* @__PURE__ */ X(z, {
2682
2682
  open: O,
2683
2683
  anchor: D.current,
2684
2684
  onClose: () => k(!1),
@@ -2687,13 +2687,13 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2687
2687
  children: /* @__PURE__ */ X("div", {
2688
2688
  role: "menu",
2689
2689
  "aria-label": "More actions",
2690
- children: I.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ X(yr, {
2690
+ children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ X(yr, {
2691
2691
  leaf: e,
2692
2692
  entityActions: r,
2693
2693
  globalActions: i,
2694
2694
  onRun: A,
2695
- loading: S === e.code,
2696
- onLoadingChange: (t) => C(t ? e.code : null),
2695
+ loading: C === e.code,
2696
+ onLoadingChange: (t) => w(t ? e.code : null),
2697
2697
  row: d,
2698
2698
  widgetContext: f,
2699
2699
  onActionClick: p
@@ -2702,21 +2702,21 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
2702
2702
  entityActions: r,
2703
2703
  globalActions: i,
2704
2704
  onRun: A,
2705
- loading: S,
2706
- onLoadingChange: C,
2705
+ loading: C,
2706
+ onLoadingChange: w,
2707
2707
  row: d,
2708
2708
  widgetContext: f,
2709
2709
  onActionClick: p
2710
2710
  }, Q(e)))
2711
2711
  })
2712
2712
  })] }),
2713
- I.destructiveInline.map((e) => /* @__PURE__ */ X(_r, {
2713
+ L.destructiveInline.map((e) => /* @__PURE__ */ X(_r, {
2714
2714
  leaf: e,
2715
2715
  entityActions: r,
2716
2716
  globalActions: i,
2717
2717
  onRun: a,
2718
- loading: S === e.code,
2719
- onLoadingChange: (t) => C(t ? e.code : null),
2718
+ loading: C === e.code,
2719
+ onLoadingChange: (t) => w(t ? e.code : null),
2720
2720
  row: d,
2721
2721
  widgetContext: f,
2722
2722
  onActionClick: p
@@ -2789,7 +2789,7 @@ function jr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
2789
2789
  //#endregion
2790
2790
  //#region src/components/shared/RowActionsKebab.tsx
2791
2791
  function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divider: o, size: s = 22, align: c = "end" }) {
2792
- let l = q(null), [u, d] = J(!1), [f, p] = J(null), { run: m } = re(), h = K(() => {
2792
+ let l = q(null), [u, d] = J(!1), [f, p] = J(null), { run: m } = ne(), h = K(() => {
2793
2793
  let e = {};
2794
2794
  for (let { code: n, action: r } of t) e[n] = r;
2795
2795
  return e;
@@ -2800,7 +2800,7 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
2800
2800
  enabled: !0,
2801
2801
  reason: null
2802
2802
  }));
2803
- return r ? M(e, h, void 0, r, []) : e;
2803
+ return r ? j(e, h, void 0, r, []) : e;
2804
2804
  }, [
2805
2805
  t,
2806
2806
  h,
@@ -2810,10 +2810,10 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
2810
2810
  let a = t.entity ? `${t.entity}.${e}` : e;
2811
2811
  return m({
2812
2812
  action: t,
2813
- title: w(t.display?.name) || e,
2813
+ title: S(t.display?.name) || e,
2814
2814
  row: r,
2815
2815
  execute: async (e) => {
2816
- let t = await me(a, N(e, n));
2816
+ let t = await me(a, M(e, n));
2817
2817
  return i?.(), t;
2818
2818
  }
2819
2819
  });
@@ -2831,13 +2831,13 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
2831
2831
  alignItems: "center",
2832
2832
  justifyContent: "flex-end"
2833
2833
  },
2834
- children: [/* @__PURE__ */ X(H, {
2834
+ children: [/* @__PURE__ */ X(U, {
2835
2835
  ref: l,
2836
2836
  size: s,
2837
2837
  icon: /* @__PURE__ */ X(e.more, { size: Math.round(s * .55) }),
2838
2838
  onClick: () => d((e) => !e),
2839
2839
  title: "Actions"
2840
- }), /* @__PURE__ */ Z(se, {
2840
+ }), /* @__PURE__ */ Z(z, {
2841
2841
  open: u,
2842
2842
  anchor: l.current,
2843
2843
  onClose: () => d(!1),
@@ -2845,7 +2845,7 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
2845
2845
  align: c,
2846
2846
  children: [
2847
2847
  a,
2848
- a && o && g.length > 0 && /* @__PURE__ */ X(j, { divider: !0 }),
2848
+ a && o && g.length > 0 && /* @__PURE__ */ X(k, { divider: !0 }),
2849
2849
  /* @__PURE__ */ X(Cr, {
2850
2850
  layout: g,
2851
2851
  entityActions: h,
@@ -2874,7 +2874,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
2874
2874
  flex: 1,
2875
2875
  maxWidth: 220
2876
2876
  },
2877
- children: /* @__PURE__ */ X(h, {
2877
+ children: /* @__PURE__ */ X(oe, {
2878
2878
  value: i,
2879
2879
  onChange: a,
2880
2880
  placeholder: "Search…",
@@ -2883,7 +2883,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
2883
2883
  }), u && r.map((e) => {
2884
2884
  let n = t.fields.get(e);
2885
2885
  if (!n) return null;
2886
- let r = o[e] ?? "__all__", i = S(n, e, c);
2886
+ let r = o[e] ?? "__all__", i = b(n, e, c);
2887
2887
  return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ X(Pr, {
2888
2888
  field: n,
2889
2889
  label: i,
@@ -2898,7 +2898,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
2898
2898
  label: `All ${i}`
2899
2899
  }, ...n.values.map((e) => ({
2900
2900
  value: e.code,
2901
- label: w(e.name) || e.code
2901
+ label: S(e.name) || e.code
2902
2902
  }))],
2903
2903
  onChange: (t) => s(e, t),
2904
2904
  placeholder: i
@@ -2908,7 +2908,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
2908
2908
  });
2909
2909
  }
2910
2910
  function Pr({ field: e, label: t, value: n, onChange: r }) {
2911
- let i = m(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = K(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = A(e.ref?.entity, {
2911
+ let i = p(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = K(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = O(e.ref?.entity, {
2912
2912
  per_page: 200,
2913
2913
  sort: a ? `${a}:asc` : void 0
2914
2914
  }), c = s?.data ?? [], l = (e) => {
@@ -2927,7 +2927,7 @@ function Pr({ field: e, label: t, value: n, onChange: r }) {
2927
2927
  value: "__all__",
2928
2928
  label: `All ${t}`
2929
2929
  }, ...c.map((e) => {
2930
- let t = String(e[o]), n = e[z];
2930
+ let t = String(e[o]), n = e[te];
2931
2931
  return {
2932
2932
  value: t,
2933
2933
  label: typeof n == "string" && n !== "" ? n : a ? l(e[a] ?? t) : t
@@ -2941,7 +2941,7 @@ function Pr({ field: e, label: t, value: n, onChange: r }) {
2941
2941
  //#endregion
2942
2942
  //#region src/lib/action-dispatch.ts
2943
2943
  function Fr(e, t, n, r) {
2944
- return te(t) ? (le(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
2944
+ return R(t) ? (le(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
2945
2945
  }
2946
2946
  //#endregion
2947
2947
  //#region src/components/detail-layout/AssociatedBlock.tsx
@@ -3065,7 +3065,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
3065
3065
  if (e === s) return !1;
3066
3066
  let t = o.fields.get(e);
3067
3067
  return !(!t || t.primary || t.display?.is_listable === !1);
3068
- }), l = I(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = w(o.display?.name_plural) || w(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m = K(() => Lr(o.actions, s, i.recordId), [
3068
+ }), l = P(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = S(o.display?.name_plural) || S(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m = K(() => Lr(o.actions, s, i.recordId), [
3069
3069
  o.actions,
3070
3070
  s,
3071
3071
  i.recordId
@@ -3073,7 +3073,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
3073
3073
  let e = {};
3074
3074
  for (let { code: t, action: n } of m) e[t] = n;
3075
3075
  return e;
3076
- }, [m]), g = K(() => M(o.action_layout ?? null ?? ue(h, "list_toolbar"), h, void 0, {}, []), [o.action_layout, h]), { run: _ } = re(), v = Bt(), y = n(), b = K(() => ({
3076
+ }, [m]), g = K(() => j(o.action_layout ?? null ?? ue(h, "list_toolbar"), h, void 0, {}, []), [o.action_layout, h]), { run: _ } = ne(), v = Bt(), y = n(), b = K(() => ({
3077
3077
  entity: o,
3078
3078
  entityCode: a,
3079
3079
  screenRoute: typeof window < "u" ? window.location.pathname : "",
@@ -3091,25 +3091,25 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
3091
3091
  a,
3092
3092
  y,
3093
3093
  v
3094
- ]), x = Ue(), S = W(() => {
3094
+ ]), x = Ue(), C = W(() => {
3095
3095
  x.invalidateQueries({ predicate: (e) => {
3096
3096
  let t = e.queryKey;
3097
3097
  return t[0] === "entity-children" && t[3] === a;
3098
3098
  } });
3099
- }, [x, a]), C = W((e, t) => {
3099
+ }, [x, a]), w = W((e, t) => {
3100
3100
  let n = Fr(e, t, {}, a);
3101
3101
  if (n !== null) return _({
3102
3102
  action: t,
3103
- title: w(t.display?.name) || e,
3103
+ title: S(t.display?.name) || e,
3104
3104
  execute: async (e) => {
3105
- let t = await me(n, N(e, void 0));
3106
- return S(), t;
3105
+ let t = await me(n, M(e, void 0));
3106
+ return C(), t;
3107
3107
  }
3108
3108
  });
3109
3109
  }, [
3110
3110
  _,
3111
3111
  a,
3112
- S
3112
+ C
3113
3113
  ]), [T, E] = J(0), D = /* @__PURE__ */ Z("div", {
3114
3114
  style: {
3115
3115
  display: "flex",
@@ -3123,7 +3123,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
3123
3123
  kind: "toolbar",
3124
3124
  layout: g,
3125
3125
  entityActions: h,
3126
- onRun: C,
3126
+ onRun: w,
3127
3127
  widgetContext: b,
3128
3128
  ariaLabel: `${f} toolbar actions`
3129
3129
  }) : m.map(({ code: e, action: t }) => /* @__PURE__ */ X(or, {
@@ -3132,8 +3132,8 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
3132
3132
  entityCode: a,
3133
3133
  variant: "ghost",
3134
3134
  size: "sm",
3135
- onSuccess: S
3136
- }, e)), d && /* @__PURE__ */ X(U, {
3135
+ onSuccess: C
3136
+ }, e)), d && /* @__PURE__ */ X(I, {
3137
3137
  kind: "ghost",
3138
3138
  size: "xs",
3139
3139
  icon: /* @__PURE__ */ X(e.plus, { size: 12 }),
@@ -3216,14 +3216,14 @@ function Wr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
3216
3216
  });
3217
3217
  }
3218
3218
  function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: l, filterFields: u, sort: d, startDraftSignal: f }) {
3219
- let m = Ue(), [h, g] = J(""), [_, v] = J(""), [y, b] = J({}), x = q(void 0);
3220
- G(() => (x.current && clearTimeout(x.current), x.current = setTimeout(() => {
3221
- v(h);
3219
+ let p = Ue(), [m, h] = J(""), [g, _] = J(""), [v, y] = J({}), b = q(void 0);
3220
+ G(() => (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
3221
+ _(m);
3222
3222
  }, 300), () => {
3223
- x.current && clearTimeout(x.current);
3224
- }), [h]);
3225
- let S = W((e, t) => {
3226
- b((n) => {
3223
+ b.current && clearTimeout(b.current);
3224
+ }), [m]);
3225
+ let x = W((e, t) => {
3226
+ y((n) => {
3227
3227
  if (t === "__all__") {
3228
3228
  let { [e]: t, ...r } = n;
3229
3229
  return r;
@@ -3233,13 +3233,13 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
3233
3233
  [e]: t
3234
3234
  };
3235
3235
  });
3236
- }, []), C = K(() => Object.keys(y).length > 0 ? y : void 0, [y]), { data: w, isLoading: T, isError: E, hasNextPage: D, fetchNextPage: O, isFetchingNextPage: k } = ar(n, r, e, i, d, void 0, _ || void 0, C), { rows: A, refs: j } = K(() => {
3237
- if (!w?.pages) return {
3236
+ }, []), S = K(() => Object.keys(v).length > 0 ? v : void 0, [v]), { data: C, isLoading: w, isError: T, hasNextPage: E, fetchNextPage: D, isFetchingNextPage: O } = ar(n, r, e, i, d, void 0, g || void 0, S), { rows: k, refs: j } = K(() => {
3237
+ if (!C?.pages) return {
3238
3238
  rows: [],
3239
3239
  refs: void 0
3240
3240
  };
3241
3241
  let e = [], t;
3242
- for (let n of w.pages) if (e.push(...n.data), n.$refs) if (!t) t = { ...n.$refs };
3242
+ for (let n of C.pages) if (e.push(...n.data), n.$refs) if (!t) t = { ...n.$refs };
3243
3243
  else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
3244
3244
  ...t[e],
3245
3245
  ...r
@@ -3248,21 +3248,21 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
3248
3248
  rows: e,
3249
3249
  refs: t
3250
3250
  };
3251
- }, [w]), M = W(() => {
3252
- m.invalidateQueries({ predicate: (t) => {
3251
+ }, [C]), M = W(() => {
3252
+ p.invalidateQueries({ predicate: (t) => {
3253
3253
  let n = t.queryKey;
3254
3254
  return n[0] === "entity-children" && n[3] === e;
3255
3255
  } });
3256
- }, [m, e]);
3256
+ }, [p, e]);
3257
3257
  return /* @__PURE__ */ Z("div", { children: [
3258
3258
  /* @__PURE__ */ X(Nr, {
3259
3259
  entity: t,
3260
3260
  searchable: l,
3261
3261
  filterFields: u,
3262
- searchValue: h,
3263
- onSearchChange: g,
3264
- filters: y,
3265
- onFilterChange: S,
3262
+ searchValue: m,
3263
+ onSearchChange: h,
3264
+ filters: v,
3265
+ onFilterChange: x,
3266
3266
  allEntities: c.schema.entities
3267
3267
  }),
3268
3268
  /* @__PURE__ */ X(Kr, {
@@ -3274,28 +3274,28 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
3274
3274
  editable: o,
3275
3275
  interaction: s,
3276
3276
  ctx: c,
3277
- rows: A,
3277
+ rows: k,
3278
3278
  refs: j,
3279
- isLoading: T,
3280
- isError: E,
3279
+ isLoading: w,
3280
+ isError: T,
3281
3281
  invalidateQuery: M,
3282
3282
  startDraftSignal: f
3283
3283
  }),
3284
- D && /* @__PURE__ */ X("div", {
3284
+ E && /* @__PURE__ */ X("div", {
3285
3285
  style: { marginTop: 4 },
3286
- children: /* @__PURE__ */ X(U, {
3286
+ children: /* @__PURE__ */ X(I, {
3287
3287
  kind: "ghost",
3288
3288
  size: "xs",
3289
- icon: k ? /* @__PURE__ */ X(p, { size: 12 }) : void 0,
3290
- onClick: () => O(),
3291
- disabled: k,
3289
+ icon: O ? /* @__PURE__ */ X(A, { size: 12 }) : void 0,
3290
+ onClick: () => D(),
3291
+ disabled: O,
3292
3292
  children: "Load more"
3293
3293
  })
3294
3294
  })
3295
3295
  ] });
3296
3296
  }
3297
3297
  function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, rows: l, refs: u, isLoading: d, isError: f, invalidateQuery: p, startDraftSignal: m }) {
3298
- let h = ne(), g = h.isPhone && c.relatedRecordsPresentation === "table", _ = a.find((e) => e !== i), v = K(() => s === "navigate" ? ie(void 0, t, c.schema.screens) : null, [
3298
+ let h = ce(), g = h.isPhone && c.relatedRecordsPresentation === "table", _ = a.find((e) => e !== i), v = K(() => s === "navigate" ? re(void 0, t, c.schema.screens) : null, [
3299
3299
  s,
3300
3300
  t,
3301
3301
  c.schema.screens
@@ -3304,34 +3304,34 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3304
3304
  i,
3305
3305
  t,
3306
3306
  o
3307
- ]), b = K(() => Br(t, a, i), [
3307
+ ]), x = K(() => Br(t, a, i), [
3308
3308
  a,
3309
3309
  i,
3310
3310
  t
3311
- ]), x = K(() => {
3311
+ ]), C = K(() => {
3312
3312
  let e = /* @__PURE__ */ new Map();
3313
3313
  for (let n of l) {
3314
3314
  let r = pe(t, n);
3315
- e.set(ee(r), r);
3315
+ e.set(F(r), r);
3316
3316
  }
3317
3317
  return e;
3318
- }, [l, t]), C = K(() => {
3318
+ }, [l, t]), w = K(() => {
3319
3319
  let e = /* @__PURE__ */ new Map();
3320
3320
  for (let n of l) {
3321
3321
  let r = n.$row_version;
3322
- typeof r == "string" && r !== "" && e.set(ee(pe(t, n)), r);
3322
+ typeof r == "string" && r !== "" && e.set(F(pe(t, n)), r);
3323
3323
  }
3324
3324
  return e;
3325
3325
  }, [l, t]), T = K(() => Ir(t.actions), [t.actions]), [E, D] = J(null), [O, k] = J(null), [A, j] = J([]), [M, N] = J({}), P = q(M);
3326
3326
  P.current = M;
3327
- let F = q({});
3327
+ let I = q({});
3328
3328
  G(() => {
3329
- let e = F.current;
3329
+ let e = I.current;
3330
3330
  return () => {
3331
3331
  for (let t of Object.values(e)) clearTimeout(t);
3332
3332
  };
3333
3333
  }, []);
3334
- let [I, L] = J(null), [te, R] = J([]), [z, B] = J(!1), { run: V } = re(), [ae, oe] = J(/* @__PURE__ */ new Set()), H = W(async (t, n, i) => {
3334
+ let [L, R] = J(null), [ee, te] = J([]), [z, B] = J(!1), { run: V } = ne(), [H, ie] = J(/* @__PURE__ */ new Set()), ae = W(async (t, n, i) => {
3335
3335
  N((e) => ({
3336
3336
  ...e,
3337
3337
  [t]: {
@@ -3341,11 +3341,11 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3341
3341
  }
3342
3342
  }));
3343
3343
  try {
3344
- let a = C.get(t), o = a ? {
3344
+ let a = w.get(t), o = a ? {
3345
3345
  ...n,
3346
3346
  $row_version: a
3347
3347
  } : n;
3348
- return await r(e, x.get(t) ?? t, o), N((e) => {
3348
+ return await r(e, C.get(t) ?? t, o), N((e) => {
3349
3349
  let n = e[t];
3350
3350
  if (!n) return e;
3351
3351
  if (n.ver > i) return {
@@ -3372,9 +3372,9 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3372
3372
  }, [
3373
3373
  e,
3374
3374
  p,
3375
- x,
3376
- C
3377
- ]), se = W((e, t, n) => {
3375
+ C,
3376
+ w
3377
+ ]), oe = W((e, t, n) => {
3378
3378
  N((r) => {
3379
3379
  let i = r[e] ?? {
3380
3380
  buffer: {},
@@ -3392,49 +3392,49 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3392
3392
  ver: a
3393
3393
  }
3394
3394
  };
3395
- }), s === "inline_edit" && (F.current[e] && clearTimeout(F.current[e]), F.current[e] = setTimeout(() => {
3395
+ }), s === "inline_edit" && (I.current[e] && clearTimeout(I.current[e]), I.current[e] = setTimeout(() => {
3396
3396
  let t = P.current[e];
3397
- t && Object.keys(t.buffer).length > 0 && H(e, { ...t.buffer }, t.ver);
3397
+ t && Object.keys(t.buffer).length > 0 && ae(e, { ...t.buffer }, t.ver);
3398
3398
  }, 500));
3399
- }, [H, s]), U = W(() => {
3399
+ }, [ae, s]), U = W(() => {
3400
3400
  let e = {};
3401
3401
  e[i] = n;
3402
3402
  for (let n of a) {
3403
3403
  let r = t.fields.get(n);
3404
3404
  r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
3405
3405
  }
3406
- L(e), R([]);
3406
+ R(e), te([]);
3407
3407
  }, [
3408
3408
  i,
3409
3409
  n,
3410
3410
  a,
3411
3411
  t.fields
3412
- ]), ce = q(m);
3412
+ ]), se = q(m);
3413
3413
  G(() => {
3414
- m !== void 0 && m !== ce.current && (ce.current = m, !I && U());
3414
+ m !== void 0 && m !== se.current && (se.current = m, !L && U());
3415
3415
  }, [
3416
3416
  m,
3417
- I,
3417
+ L,
3418
3418
  U
3419
3419
  ]);
3420
3420
  let le = W(async () => {
3421
- if (!I) return;
3422
- let n = Vr(I, a, t, i);
3421
+ if (!L) return;
3422
+ let n = Vr(L, a, t, i);
3423
3423
  if (n.length > 0) {
3424
- R(n);
3424
+ te(n);
3425
3425
  return;
3426
3426
  }
3427
3427
  B(!0);
3428
3428
  try {
3429
- await de(e, I), L(null), R([]), p();
3429
+ await de(e, L), R(null), te([]), p();
3430
3430
  } catch (e) {
3431
3431
  let t = e instanceof Error ? e.message : "Create failed";
3432
- R([`_error:${t}`]);
3432
+ te([`_error:${t}`]);
3433
3433
  } finally {
3434
3434
  B(!1);
3435
3435
  }
3436
3436
  }, [
3437
- I,
3437
+ L,
3438
3438
  a,
3439
3439
  t,
3440
3440
  i,
@@ -3449,20 +3449,20 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3449
3449
  return;
3450
3450
  }
3451
3451
  let o = Vr({
3452
- ...l.find((n) => ee(pe(t, n)) === e) ?? {},
3452
+ ...l.find((n) => F(pe(t, n)) === e) ?? {},
3453
3453
  ...r
3454
3454
  }, a, t, i);
3455
3455
  if (o.length > 0) {
3456
3456
  j(o);
3457
3457
  return;
3458
3458
  }
3459
- await H(e, { ...r }, n?.ver ?? 0) && (k(null), j([]));
3459
+ await ae(e, { ...r }, n?.ver ?? 0) && (k(null), j([]));
3460
3460
  }, [
3461
3461
  l,
3462
3462
  t,
3463
3463
  a,
3464
3464
  i,
3465
- H
3465
+ ae
3466
3466
  ]), me = W((e) => {
3467
3467
  N((t) => {
3468
3468
  if (!t[e]) return t;
@@ -3470,19 +3470,19 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3470
3470
  return r;
3471
3471
  }), j([]), k(null);
3472
3472
  }, []), ge = W((n, r) => {
3473
- let i = x.get(n) ?? n;
3473
+ let i = C.get(n) ?? n;
3474
3474
  return V({
3475
3475
  action: t.actions?.__delete,
3476
3476
  destructive: !0,
3477
- title: w(t.display?.name) || "Delete",
3477
+ title: S(t.display?.name) || "Delete",
3478
3478
  row: r,
3479
3479
  entity: e,
3480
3480
  execute: async () => {
3481
- oe((e) => new Set(e).add(n));
3481
+ ie((e) => new Set(e).add(n));
3482
3482
  try {
3483
3483
  return await he(e, i);
3484
3484
  } finally {
3485
- oe((e) => {
3485
+ ie((e) => {
3486
3486
  let t = new Set(e);
3487
3487
  return t.delete(n), t;
3488
3488
  });
@@ -3495,7 +3495,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3495
3495
  t,
3496
3496
  e,
3497
3497
  p,
3498
- x
3498
+ C
3499
3499
  ]);
3500
3500
  if (f) return /* @__PURE__ */ X("div", {
3501
3501
  style: {
@@ -3522,7 +3522,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3522
3522
  borderRadius: 6
3523
3523
  } })]
3524
3524
  });
3525
- let _e = l.length === 0 && !I;
3525
+ let _e = l.length === 0 && !L;
3526
3526
  return h.isPhone && !g ? /* @__PURE__ */ Z("div", { children: [_e && !o && /* @__PURE__ */ X("div", {
3527
3527
  style: {
3528
3528
  fontSize: 12.5,
@@ -3537,7 +3537,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3537
3537
  gap: 10
3538
3538
  },
3539
3539
  children: [l.map((n) => {
3540
- let r = ee(pe(t, n)), i = ae.has(r), l = M[r], d = v && r ? v.replace(/:\w+/, r) : void 0;
3540
+ let r = F(pe(t, n)), i = H.has(r), l = M[r], d = v && r ? v.replace(/:\w+/, r) : void 0;
3541
3541
  return /* @__PURE__ */ X(qr, {
3542
3542
  rowId: r,
3543
3543
  row: n,
@@ -3554,7 +3554,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3554
3554
  activeCell: E,
3555
3555
  setActiveCell: D,
3556
3556
  rowState: l,
3557
- onCellChange: se,
3557
+ onCellChange: oe,
3558
3558
  onDeleteClick: (e) => void ge(e, n),
3559
3559
  onStartEdit: ue,
3560
3560
  onConfirmEdit: fe,
@@ -3566,21 +3566,21 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3566
3566
  entityCode: e,
3567
3567
  onRowActionSuccess: p
3568
3568
  }, r);
3569
- }), I && /* @__PURE__ */ X(Qr, {
3570
- draftRow: I,
3569
+ }), L && /* @__PURE__ */ X(Qr, {
3570
+ draftRow: L,
3571
3571
  entity: t,
3572
3572
  columns: a,
3573
- editableColumns: b,
3573
+ editableColumns: x,
3574
3574
  foreignKey: i,
3575
- draftErrors: te,
3575
+ draftErrors: ee,
3576
3576
  draftSaving: z,
3577
- onChange: (e, t) => L((n) => n && {
3577
+ onChange: (e, t) => R((n) => n && {
3578
3578
  ...n,
3579
3579
  [e]: t
3580
3580
  }),
3581
3581
  onConfirm: le,
3582
3582
  onCancel: () => {
3583
- L(null), R([]);
3583
+ R(null), te([]);
3584
3584
  },
3585
3585
  refs: u
3586
3586
  })]
@@ -3600,7 +3600,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3600
3600
  let n = t.fields.get(e);
3601
3601
  return /* @__PURE__ */ X("th", {
3602
3602
  style: Ae,
3603
- children: n ? S(n, e, c.schema.entities) : e
3603
+ children: n ? b(n, e, c.schema.entities) : e
3604
3604
  }, e);
3605
3605
  }),
3606
3606
  o && /* @__PURE__ */ X("th", { style: {
@@ -3612,7 +3612,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3612
3612
  width: 40
3613
3613
  } })
3614
3614
  ] }) }), /* @__PURE__ */ Z("tbody", { children: [l.map((n) => {
3615
- let r = ee(pe(t, n)), i = ae.has(r), l = M[r], d = v && r ? v.replace(/:\w+/, r) : void 0;
3615
+ let r = F(pe(t, n)), i = H.has(r), l = M[r], d = v && r ? v.replace(/:\w+/, r) : void 0;
3616
3616
  return /* @__PURE__ */ X(Jr, {
3617
3617
  rowId: r,
3618
3618
  row: n,
@@ -3629,7 +3629,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3629
3629
  activeCell: E,
3630
3630
  setActiveCell: D,
3631
3631
  rowState: l,
3632
- onCellChange: se,
3632
+ onCellChange: oe,
3633
3633
  onDeleteClick: (e) => void ge(e, n),
3634
3634
  onStartEdit: ue,
3635
3635
  onConfirmEdit: fe,
@@ -3641,49 +3641,49 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
3641
3641
  entityCode: e,
3642
3642
  onRowActionSuccess: p
3643
3643
  }, r);
3644
- }), I && /* @__PURE__ */ X(Zr, {
3645
- draftRow: I,
3644
+ }), L && /* @__PURE__ */ X(Zr, {
3645
+ draftRow: L,
3646
3646
  entity: t,
3647
3647
  columns: a,
3648
- editableColumns: b,
3648
+ editableColumns: x,
3649
3649
  foreignKey: i,
3650
- draftErrors: te,
3650
+ draftErrors: ee,
3651
3651
  draftSaving: z,
3652
- onChange: (e, t) => L((n) => n && {
3652
+ onChange: (e, t) => R((n) => n && {
3653
3653
  ...n,
3654
3654
  [e]: t
3655
3655
  }),
3656
3656
  onConfirm: le,
3657
3657
  onCancel: () => {
3658
- L(null), R([]);
3658
+ R(null), te([]);
3659
3659
  },
3660
3660
  refs: u
3661
3661
  })] })]
3662
3662
  })
3663
3663
  })] });
3664
3664
  }
3665
- function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: m, isDeleting: h, rowState: g, onCellChange: _, onDeleteClick: v, onStartEdit: y, onConfirmEdit: b, onCancelEdit: x, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
3666
- let O = n(), k = Ie(), A = K(() => !g || Object.keys(g.buffer).length === 0 ? r : {
3665
+ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: p, isDeleting: m, rowState: h, onCellChange: g, onDeleteClick: _, onStartEdit: v, onConfirmEdit: y, onCancelEdit: x, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
3666
+ let D = n(), O = Ie(), k = K(() => !h || Object.keys(h.buffer).length === 0 ? r : {
3667
3667
  ...r,
3668
- ...g.buffer
3669
- }, [r, g]);
3668
+ ...h.buffer
3669
+ }, [r, h]);
3670
3670
  return d === "row_edit" && f ? /* @__PURE__ */ X(Xr, {
3671
- values: A,
3671
+ values: k,
3672
3672
  entity: i,
3673
3673
  columns: s,
3674
3674
  editableColumns: c,
3675
- errors: g?.error ? [...m, `_error:${g.error}`] : m,
3676
- saving: g?.saving ?? !1,
3677
- onChange: (e, n) => _(t, e, n),
3678
- onConfirm: () => b(t),
3675
+ errors: h?.error ? [...p, `_error:${h.error}`] : p,
3676
+ saving: h?.saving ?? !1,
3677
+ onChange: (e, n) => g(t, e, n),
3678
+ onConfirm: () => y(t),
3679
3679
  onCancel: () => x(t),
3680
- refs: C
3680
+ refs: S
3681
3681
  }) : /* @__PURE__ */ Z("div", {
3682
3682
  style: {
3683
3683
  border: "1px solid var(--border)",
3684
3684
  borderRadius: 8,
3685
3685
  background: "var(--surface)",
3686
- opacity: h ? .58 : 1,
3686
+ opacity: m ? .58 : 1,
3687
3687
  overflow: "hidden"
3688
3688
  },
3689
3689
  children: [/* @__PURE__ */ X("div", {
@@ -3694,26 +3694,26 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
3694
3694
  gap: 12
3695
3695
  },
3696
3696
  children: s.map((e) => {
3697
- let n = i.fields.get(e), r = l && d === "inline_edit" && c.has(e), s = T && e === w, f = n ? S(n, e, a) : e, p = `${k}-${t}-${e}`, m = `${p}-label`, h = {
3697
+ let n = i.fields.get(e), r = l && d === "inline_edit" && c.has(e), s = w && e === C, f = n ? b(n, e, a) : e, p = `${O}-${t}-${e}`, m = `${p}-label`, h = {
3698
3698
  fontSize: 11.5,
3699
3699
  fontWeight: 600,
3700
3700
  color: "var(--text-3)"
3701
- }, g = n ? V({
3701
+ }, _ = n ? V({
3702
3702
  field: n,
3703
3703
  fieldName: e,
3704
- value: A[e],
3704
+ value: k[e],
3705
3705
  mode: r ? "edit" : "display",
3706
- onChange: r ? (n) => _(t, e, n) : void 0,
3707
- record: A,
3708
- refs: C,
3706
+ onChange: r ? (n) => g(t, e, n) : void 0,
3707
+ record: k,
3708
+ refs: S,
3709
3709
  compact: r,
3710
3710
  entity: i,
3711
3711
  entities: a,
3712
3712
  screens: s ? void 0 : o,
3713
3713
  fieldId: p,
3714
3714
  labelId: m,
3715
- locale: O
3716
- }) : u(A[e]);
3715
+ locale: D
3716
+ }) : u(k[e]);
3717
3717
  return /* @__PURE__ */ Z("div", {
3718
3718
  style: {
3719
3719
  display: "flex",
@@ -3733,18 +3733,18 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
3733
3733
  }), /* @__PURE__ */ X("div", {
3734
3734
  style: { minWidth: 0 },
3735
3735
  children: s && !r ? /* @__PURE__ */ X("a", {
3736
- href: T,
3736
+ href: w,
3737
3737
  style: {
3738
3738
  color: "var(--accent)",
3739
3739
  textDecoration: "none",
3740
3740
  fontWeight: 500
3741
3741
  },
3742
- children: g
3743
- }) : g
3742
+ children: _
3743
+ }) : _
3744
3744
  })]
3745
3745
  }, e);
3746
3746
  })
3747
- }), (l || E && E.length > 0) && /* @__PURE__ */ Z("div", {
3747
+ }), (l || T && T.length > 0) && /* @__PURE__ */ Z("div", {
3748
3748
  style: {
3749
3749
  minHeight: 42,
3750
3750
  padding: "6px 8px",
@@ -3755,52 +3755,52 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
3755
3755
  gap: 6
3756
3756
  },
3757
3757
  children: [l && /* @__PURE__ */ Z(Y, { children: [
3758
- g?.saving && /* @__PURE__ */ X(p, { size: 12 }),
3759
- g?.error && /* @__PURE__ */ X("span", {
3758
+ h?.saving && /* @__PURE__ */ X(A, { size: 12 }),
3759
+ h?.error && /* @__PURE__ */ X("span", {
3760
3760
  style: {
3761
3761
  fontSize: 11,
3762
3762
  color: "var(--danger)"
3763
3763
  },
3764
- title: g.error,
3764
+ title: h.error,
3765
3765
  children: "!"
3766
3766
  }),
3767
- d === "row_edit" && /* @__PURE__ */ X(H, {
3767
+ d === "row_edit" && /* @__PURE__ */ X(U, {
3768
3768
  size: 32,
3769
3769
  icon: /* @__PURE__ */ X(e.edit, { size: 14 }),
3770
- onClick: () => y(t),
3770
+ onClick: () => v(t),
3771
3771
  title: "Edit row"
3772
3772
  }),
3773
- /* @__PURE__ */ X(H, {
3773
+ /* @__PURE__ */ X(U, {
3774
3774
  size: 32,
3775
3775
  icon: /* @__PURE__ */ X(e.trash, { size: 14 }),
3776
- onClick: () => v(t),
3776
+ onClick: () => _(t),
3777
3777
  title: "Delete row"
3778
3778
  })
3779
- ] }), !l && E && E.length > 0 && /* @__PURE__ */ X(Mr, {
3780
- actions: E,
3779
+ ] }), !l && T && T.length > 0 && /* @__PURE__ */ X(Mr, {
3780
+ actions: T,
3781
3781
  objectIds: [t],
3782
- row: A,
3783
- onSuccess: D
3782
+ row: k,
3783
+ onSuccess: E
3784
3784
  })]
3785
3785
  })]
3786
3786
  });
3787
3787
  }
3788
- function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: m, isDeleting: h, activeCell: g, setActiveCell: _, rowState: v, onCellChange: y, onDeleteClick: b, onStartEdit: x, onConfirmEdit: S, onCancelEdit: C, refs: w, identityCol: T, href: E, rowActions: D, onRowActionSuccess: O }) {
3789
- let k = n(), A = K(() => !v || Object.keys(v.buffer).length === 0 ? r : {
3788
+ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: p, isDeleting: m, activeCell: h, setActiveCell: g, rowState: _, onCellChange: v, onDeleteClick: y, onStartEdit: b, onConfirmEdit: x, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
3789
+ let O = n(), k = K(() => !_ || Object.keys(_.buffer).length === 0 ? r : {
3790
3790
  ...r,
3791
- ...v.buffer
3792
- }, [r, v]);
3791
+ ..._.buffer
3792
+ }, [r, _]);
3793
3793
  if (d === "row_edit" && f) return /* @__PURE__ */ X(Yr, {
3794
- values: A,
3794
+ values: k,
3795
3795
  entity: i,
3796
3796
  columns: s,
3797
3797
  editableColumns: c,
3798
- errors: v?.error ? [...m, `_error:${v.error}`] : m,
3799
- saving: v?.saving ?? !1,
3800
- onChange: (e, n) => y(t, e, n),
3801
- onConfirm: () => S(t),
3802
- onCancel: () => C(t),
3803
- refs: w
3798
+ errors: _?.error ? [...p, `_error:${_.error}`] : p,
3799
+ saving: _?.saving ?? !1,
3800
+ onChange: (e, n) => v(t, e, n),
3801
+ onConfirm: () => x(t),
3802
+ onCancel: () => S(t),
3803
+ refs: C
3804
3804
  });
3805
3805
  let j = Me, M = {
3806
3806
  padding: "4px 4px",
@@ -3808,47 +3808,47 @@ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
3808
3808
  verticalAlign: "middle"
3809
3809
  }, N = d === "inline_edit";
3810
3810
  return /* @__PURE__ */ Z("tr", {
3811
- style: { opacity: h ? .5 : 1 },
3811
+ style: { opacity: m ? .5 : 1 },
3812
3812
  children: [
3813
3813
  s.map((e) => {
3814
3814
  let n = i.fields.get(e), r = c.has(e);
3815
- if (N && g?.rowId === t && g?.col === e && r) return /* @__PURE__ */ X("td", {
3815
+ if (N && h?.rowId === t && h?.col === e && r) return /* @__PURE__ */ X("td", {
3816
3816
  style: M,
3817
3817
  children: n ? V({
3818
3818
  field: n,
3819
3819
  fieldName: e,
3820
- value: A[e],
3820
+ value: k[e],
3821
3821
  mode: "edit",
3822
- onChange: (n) => y(t, e, n),
3823
- record: A,
3824
- refs: w,
3822
+ onChange: (n) => v(t, e, n),
3823
+ record: k,
3824
+ refs: C,
3825
3825
  compact: !0,
3826
- locale: k
3827
- }) : u(A[e])
3826
+ locale: O
3827
+ }) : u(k[e])
3828
3828
  }, e);
3829
- let s = E && e === T, l = n ? V({
3829
+ let s = T && e === w, l = n ? V({
3830
3830
  field: n,
3831
3831
  fieldName: e,
3832
- value: A[e],
3832
+ value: k[e],
3833
3833
  mode: "display",
3834
- record: A,
3835
- refs: w,
3834
+ record: k,
3835
+ refs: C,
3836
3836
  entity: i,
3837
3837
  entities: a,
3838
3838
  screens: s ? void 0 : o,
3839
- locale: k
3840
- }) : u(A[e]), d = N && r && !h;
3839
+ locale: O
3840
+ }) : u(k[e]), d = N && r && !m;
3841
3841
  return /* @__PURE__ */ X("td", {
3842
3842
  style: {
3843
3843
  ...j,
3844
3844
  cursor: d ? "pointer" : "default"
3845
3845
  },
3846
- onClick: d ? () => _({
3846
+ onClick: d ? () => g({
3847
3847
  rowId: t,
3848
3848
  col: e
3849
3849
  }) : void 0,
3850
3850
  children: s ? /* @__PURE__ */ X("a", {
3851
- href: E,
3851
+ href: T,
3852
3852
  style: {
3853
3853
  color: "var(--accent)",
3854
3854
  textDecoration: "none",
@@ -3873,75 +3873,75 @@ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
3873
3873
  gap: 4
3874
3874
  },
3875
3875
  children: [
3876
- v?.saving && /* @__PURE__ */ X(p, { size: 12 }),
3877
- v?.error && /* @__PURE__ */ X("span", {
3876
+ _?.saving && /* @__PURE__ */ X(A, { size: 12 }),
3877
+ _?.error && /* @__PURE__ */ X("span", {
3878
3878
  style: {
3879
3879
  fontSize: 11,
3880
3880
  color: "var(--danger)"
3881
3881
  },
3882
- title: v.error,
3882
+ title: _.error,
3883
3883
  children: "!"
3884
3884
  }),
3885
- d === "row_edit" && /* @__PURE__ */ X(H, {
3885
+ d === "row_edit" && /* @__PURE__ */ X(U, {
3886
3886
  size: 24,
3887
3887
  icon: /* @__PURE__ */ X(e.edit, { size: 12 }),
3888
- onClick: () => x(t),
3888
+ onClick: () => b(t),
3889
3889
  title: "Edit row"
3890
3890
  }),
3891
- /* @__PURE__ */ X(H, {
3891
+ /* @__PURE__ */ X(U, {
3892
3892
  size: 24,
3893
3893
  icon: /* @__PURE__ */ X(e.trash, { size: 12 }),
3894
- onClick: () => b(t),
3894
+ onClick: () => y(t),
3895
3895
  title: "Delete row"
3896
3896
  })
3897
3897
  ]
3898
3898
  })
3899
3899
  }),
3900
- !l && D && D.length > 0 && /* @__PURE__ */ X("td", {
3900
+ !l && E && E.length > 0 && /* @__PURE__ */ X("td", {
3901
3901
  style: {
3902
3902
  padding: "4px 8px",
3903
3903
  borderBottom: "1px solid var(--divider)",
3904
3904
  verticalAlign: "middle"
3905
3905
  },
3906
3906
  children: /* @__PURE__ */ X(Mr, {
3907
- actions: D,
3907
+ actions: E,
3908
3908
  objectIds: [t],
3909
- row: A,
3910
- onSuccess: O
3909
+ row: k,
3910
+ onSuccess: D
3911
3911
  })
3912
3912
  })
3913
3913
  ]
3914
3914
  });
3915
3915
  }
3916
- function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: m }) {
3917
- let h = n(), g = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:"))), v = {
3916
+ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: p }) {
3917
+ let m = n(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:"))), _ = {
3918
3918
  padding: "6px 12px",
3919
3919
  borderBottom: "1px solid var(--divider)",
3920
3920
  verticalAlign: "middle",
3921
3921
  height: 40,
3922
3922
  minWidth: 0
3923
- }, y = {
3923
+ }, v = {
3924
3924
  display: "block",
3925
3925
  width: "100%",
3926
3926
  maxWidth: "100%",
3927
3927
  minWidth: 0
3928
3928
  };
3929
3929
  return /* @__PURE__ */ Z("tr", {
3930
- style: m ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
3930
+ style: p ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
3931
3931
  onKeyDown: (e) => {
3932
3932
  e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), d());
3933
3933
  },
3934
3934
  children: [i.map((e) => {
3935
- let n = r.fields.get(e), i = a.has(e), o = _.has(e);
3935
+ let n = r.fields.get(e), i = a.has(e), o = g.has(e);
3936
3936
  return i ? /* @__PURE__ */ X("td", {
3937
3937
  style: {
3938
- ...v,
3938
+ ..._,
3939
3939
  outline: o ? "1px solid var(--danger)" : "none",
3940
3940
  outlineOffset: -1
3941
3941
  },
3942
3942
  title: o ? `${e} is required` : void 0,
3943
3943
  children: /* @__PURE__ */ X("div", {
3944
- style: y,
3944
+ style: v,
3945
3945
  children: n ? V({
3946
3946
  field: n,
3947
3947
  fieldName: e,
@@ -3951,18 +3951,18 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
3951
3951
  record: t,
3952
3952
  refs: f,
3953
3953
  compact: !0,
3954
- locale: h
3954
+ locale: m
3955
3955
  }) : u(t[e])
3956
3956
  })
3957
3957
  }, e) : /* @__PURE__ */ X("td", {
3958
3958
  style: {
3959
- ...v,
3959
+ ..._,
3960
3960
  color: "var(--text-3)"
3961
3961
  },
3962
3962
  children: n?.auto ? "—" : u(t[e])
3963
3963
  }, e);
3964
3964
  }), /* @__PURE__ */ X("td", {
3965
- style: v,
3965
+ style: _,
3966
3966
  children: /* @__PURE__ */ Z("div", {
3967
3967
  style: {
3968
3968
  display: "flex",
@@ -3971,21 +3971,21 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
3971
3971
  justifyContent: "flex-end"
3972
3972
  },
3973
3973
  children: [
3974
- g && /* @__PURE__ */ X("span", {
3974
+ h && /* @__PURE__ */ X("span", {
3975
3975
  style: {
3976
3976
  fontSize: 11,
3977
3977
  color: "var(--danger)"
3978
3978
  },
3979
- title: g.slice(7),
3979
+ title: h.slice(7),
3980
3980
  children: "!"
3981
3981
  }),
3982
- /* @__PURE__ */ X(H, {
3982
+ /* @__PURE__ */ X(U, {
3983
3983
  size: 24,
3984
- icon: X(s ? p : e.check, { size: 12 }),
3984
+ icon: X(s ? A : e.check, { size: 12 }),
3985
3985
  onClick: l,
3986
3986
  title: "Confirm (Enter)"
3987
3987
  }),
3988
- /* @__PURE__ */ X(H, {
3988
+ /* @__PURE__ */ X(U, {
3989
3989
  size: 24,
3990
3990
  icon: /* @__PURE__ */ X(e.x, { size: 12 }),
3991
3991
  onClick: d,
@@ -3996,15 +3996,15 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
3996
3996
  })]
3997
3997
  });
3998
3998
  }
3999
- function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: m }) {
4000
- let h = n(), g = Ie(), _ = o.find((e) => e.startsWith("_error:")), v = new Set(o.filter((e) => !e.startsWith("_error:")));
3999
+ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: p }) {
4000
+ let m = n(), h = Ie(), g = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:")));
4001
4001
  return /* @__PURE__ */ Z("div", {
4002
4002
  style: {
4003
4003
  border: "1px solid var(--border)",
4004
4004
  borderRadius: 8,
4005
4005
  background: "var(--surface)",
4006
4006
  overflow: "hidden",
4007
- boxShadow: m ? "inset 3px 0 0 var(--accent)" : void 0
4007
+ boxShadow: p ? "inset 3px 0 0 var(--accent)" : void 0
4008
4008
  },
4009
4009
  onKeyDown: (e) => {
4010
4010
  e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), d());
@@ -4017,7 +4017,7 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
4017
4017
  gap: 12
4018
4018
  },
4019
4019
  children: i.map((e) => {
4020
- let n = r.fields.get(e), i = a.has(e), o = v.has(e), s = n ? S(n, e) : e, l = `${g}-${e}`, d = `${l}-label`, p = {
4020
+ let n = r.fields.get(e), i = a.has(e), o = _.has(e), s = n ? b(n, e) : e, l = `${h}-${e}`, d = `${l}-label`, p = {
4021
4021
  fontSize: 11.5,
4022
4022
  fontWeight: 600,
4023
4023
  color: "var(--text-3)"
@@ -4057,7 +4057,7 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
4057
4057
  compact: !0,
4058
4058
  fieldId: l,
4059
4059
  labelId: d,
4060
- locale: h
4060
+ locale: m
4061
4061
  }) : u(t[e]) : n?.auto ? "—" : u(t[e])
4062
4062
  })]
4063
4063
  }, e);
@@ -4073,21 +4073,21 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
4073
4073
  gap: 6
4074
4074
  },
4075
4075
  children: [
4076
- _ && /* @__PURE__ */ X("span", {
4076
+ g && /* @__PURE__ */ X("span", {
4077
4077
  style: {
4078
4078
  fontSize: 11,
4079
4079
  color: "var(--danger)"
4080
4080
  },
4081
- title: _.slice(7),
4081
+ title: g.slice(7),
4082
4082
  children: "!"
4083
4083
  }),
4084
- /* @__PURE__ */ X(H, {
4084
+ /* @__PURE__ */ X(U, {
4085
4085
  size: 32,
4086
- icon: X(s ? p : e.check, { size: 14 }),
4086
+ icon: X(s ? A : e.check, { size: 14 }),
4087
4087
  onClick: l,
4088
4088
  title: "Confirm (Enter)"
4089
4089
  }),
4090
- /* @__PURE__ */ X(H, {
4090
+ /* @__PURE__ */ X(U, {
4091
4091
  size: 32,
4092
4092
  icon: /* @__PURE__ */ X(e.x, { size: 14 }),
4093
4093
  onClick: d,
@@ -4364,7 +4364,7 @@ function hi(e, t) {
4364
4364
  //#endregion
4365
4365
  //#region src/hooks/useScreenBack.ts
4366
4366
  function gi(e) {
4367
- let t = ze(), n = oe(), r = ce(), i = At((e) => e.depth), { data: a } = ae(), o = e?.fallback, s = kt((e) => {
4367
+ let t = ze(), n = ie(), r = se(), i = At((e) => e.depth), { data: a } = H(), o = e?.fallback, s = kt((e) => {
4368
4368
  let t = e.tabs.find((t) => t.id === e.activeTabId);
4369
4369
  return t ? t.returnTo : void 0;
4370
4370
  }), { hasOriginBack: c, allowFallbackBack: l } = K(() => It(s, n.enabled), [s, n.enabled]), u = W(() => {
@@ -4379,7 +4379,7 @@ function gi(e) {
4379
4379
  }
4380
4380
  if (i.kind === "live" && i.tabId) e.commitTabNavigation(i.tabId, { search: i.search ?? "" });
4381
4381
  else if (i.kind === "reopen") {
4382
- let t = i.title ? void 0 : v(i.pathname, a?.screens, a?.entities);
4382
+ let t = i.title ? void 0 : g(i.pathname, a?.screens, a?.entities);
4383
4383
  e.openTab({
4384
4384
  pathname: i.pathname,
4385
4385
  search: i.search ?? "",
@@ -4949,7 +4949,7 @@ var $ = class {
4949
4949
  },
4950
4950
  children: this.state.error?.message || "An unexpected error occurred."
4951
4951
  }),
4952
- /* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(U, {
4952
+ /* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(I, {
4953
4953
  onClick: this.handleRetry,
4954
4954
  children: "Try again"
4955
4955
  }) })