@object-ui/fields 4.0.6 → 4.0.8

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.
package/dist/index.js CHANGED
@@ -1,34 +1,34 @@
1
1
  import e, { Suspense as t, lazy as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
2
2
  import { ComponentRegistry as u } from "@object-ui/core";
3
- import { Avatar as d, AvatarFallback as f, AvatarImage as p, Badge as m, Button as h, Checkbox as g, Dialog as _, DialogContent as v, DialogDescription as y, DialogFooter as b, DialogHeader as ee, DialogTitle as x, EmptyValue as S, Input as C, Label as w, Popover as T, PopoverContent as E, PopoverTrigger as te, Select as D, SelectContent as ne, SelectItem as re, SelectTrigger as ie, SelectValue as ae, Skeleton as O, Slider as k, Switch as oe, Table as se, TableBody as ce, TableCell as A, TableHead as le, TableHeader as j, TableRow as M, Textarea as N, cn as P } from "@object-ui/components";
4
- import { AlertCircle as ue, ArrowDown as de, ArrowUp as fe, ArrowUpDown as pe, Camera as F, Check as I, ChevronLeft as me, ChevronRight as he, Copy as L, Crop as ge, Crosshair as R, Eraser as z, ExternalLink as B, Eye as V, EyeOff as _e, File as ve, Image as ye, ImageIcon as H, Loader2 as be, MapPin as U, Maximize2 as W, Phone as xe, Plus as Se, QrCode as G, RotateCw as K, Search as Ce, SlidersHorizontal as we, Star as Te, TableProperties as Ee, Upload as De, X as Oe } from "lucide-react";
5
- import { Fragment as ke, jsx as q, jsxs as J } from "react/jsx-runtime";
6
- import { createSafeTranslation as Y } from "@object-ui/i18n";
7
- import { SchemaRendererContext as Ae } from "@object-ui/react";
8
- import { useUpload as je } from "@object-ui/providers";
3
+ import { Avatar as d, AvatarFallback as f, AvatarImage as p, Badge as m, Button as h, Checkbox as g, Dialog as _, DialogContent as v, DialogDescription as y, DialogFooter as b, DialogHeader as ee, DialogTitle as x, EmptyValue as S, Input as C, Label as w, Popover as te, PopoverContent as ne, PopoverTrigger as T, Select as E, SelectContent as re, SelectItem as ie, SelectTrigger as ae, SelectValue as oe, Skeleton as D, Slider as O, Switch as k, Table as se, TableBody as ce, TableCell as A, TableHead as le, TableHeader as j, TableRow as M, Textarea as N, cn as P } from "@object-ui/components";
4
+ import { AlertCircle as ue, ArrowDown as F, ArrowUp as de, ArrowUpDown as fe, Camera as pe, Check as I, ChevronLeft as me, ChevronRight as he, Copy as L, Crop as ge, Crosshair as R, Eraser as _e, ExternalLink as z, Eye as B, EyeOff as ve, File as ye, Image as V, ImageIcon as be, Loader2 as xe, MapPin as H, Maximize2 as U, Phone as Se, Plus as W, QrCode as G, RotateCw as K, Search as Ce, SlidersHorizontal as we, Star as Te, TableProperties as Ee, Upload as q, X as De } from "lucide-react";
5
+ import { SchemaRendererContext as Oe, useObjectTranslation as ke } from "@object-ui/react";
6
+ import { Fragment as Ae, jsx as J, jsxs as Y } from "react/jsx-runtime";
7
+ import { createSafeTranslation as je } from "@object-ui/i18n";
8
+ import { useUpload as Me } from "@object-ui/providers";
9
9
  //#region \0rolldown/runtime.js
10
- var Me = Object.defineProperty, X = (e, t) => () => (e && (t = e(e = 0)), t), Z = (e, t) => {
10
+ var Ne = Object.defineProperty, X = (e, t) => () => (e && (t = e(e = 0)), t), Z = (e, t) => {
11
11
  let n = {};
12
- for (var r in e) Me(n, r, {
12
+ for (var r in e) Ne(n, r, {
13
13
  get: e[r],
14
14
  enumerable: !0
15
15
  });
16
- return t || Me(n, Symbol.toStringTag, { value: "Module" }), n;
17
- }, Ne = /* @__PURE__ */ Z({ TextField: () => Pe });
18
- function Pe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
16
+ return t || Ne(n, Symbol.toStringTag, { value: "Module" }), n;
17
+ }, Pe = /* @__PURE__ */ Z({ TextField: () => Fe });
18
+ function Fe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
19
19
  let a = n || i.schema;
20
- if (r) return /* @__PURE__ */ q("span", {
20
+ if (r) return /* @__PURE__ */ J("span", {
21
21
  className: "text-sm",
22
- children: e || /* @__PURE__ */ q(S, {})
22
+ children: e || /* @__PURE__ */ J(S, {})
23
23
  });
24
24
  let o = a?.rows, { inputType: s, ...c } = i;
25
- return o && o > 1 ? /* @__PURE__ */ q(N, {
25
+ return o && o > 1 ? /* @__PURE__ */ J(N, {
26
26
  ...c,
27
27
  value: e || "",
28
28
  onChange: (e) => t(e.target.value),
29
29
  placeholder: a?.placeholder,
30
30
  disabled: r || c.disabled
31
- }) : /* @__PURE__ */ q(C, {
31
+ }) : /* @__PURE__ */ J(C, {
32
32
  ...c,
33
33
  type: a?.type === "password" ? "password" : "text",
34
34
  value: e || "",
@@ -37,14 +37,14 @@ function Pe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
37
37
  disabled: r || c.disabled
38
38
  });
39
39
  }
40
- var Fe = X((() => {})), Ie = /* @__PURE__ */ Z({ NumberField: () => Le });
41
- function Le({ value: e, onChange: t, field: n, readonly: r, ...i }) {
42
- if (r) return e == null ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
40
+ var Ie = X((() => {})), Le = /* @__PURE__ */ Z({ NumberField: () => Re });
41
+ function Re({ value: e, onChange: t, field: n, readonly: r, ...i }) {
42
+ if (r) return e == null ? /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ J("span", {
43
43
  className: "text-sm",
44
44
  children: e
45
45
  });
46
46
  let a = n || i.schema, o = a?.precision, { inputType: s, ...c } = i;
47
- return /* @__PURE__ */ q(C, {
47
+ return /* @__PURE__ */ J(C, {
48
48
  ...c,
49
49
  type: "number",
50
50
  value: e ?? "",
@@ -57,85 +57,85 @@ function Le({ value: e, onChange: t, field: n, readonly: r, ...i }) {
57
57
  step: o ? 10 ** -o : "any"
58
58
  });
59
59
  }
60
- var Re = X((() => {})), ze = /* @__PURE__ */ Z({ BooleanField: () => Be });
61
- function Be({ value: e, onChange: t, field: n, readonly: r, ...i }) {
60
+ var ze = X((() => {})), Be = /* @__PURE__ */ Z({ BooleanField: () => Ve });
61
+ function Ve({ value: e, onChange: t, field: n, readonly: r, ...i }) {
62
62
  let a = n || i.schema, s = a?.widget, c = o(), l = a?.name || c, u = a?.label || "Checkbox";
63
- if (r) return /* @__PURE__ */ q("span", {
63
+ if (r) return /* @__PURE__ */ J("span", {
64
64
  className: "text-sm",
65
65
  children: e ? "Yes" : "No"
66
66
  });
67
67
  let { inputType: d, ...f } = i;
68
- return s === "checkbox" ? /* @__PURE__ */ J("div", {
68
+ return s === "checkbox" ? /* @__PURE__ */ Y("div", {
69
69
  className: "flex items-center space-x-2",
70
- children: [/* @__PURE__ */ q(g, {
70
+ children: [/* @__PURE__ */ J(g, {
71
71
  ...f,
72
72
  id: l,
73
73
  checked: !!e,
74
74
  onCheckedChange: (e) => t(!!e),
75
75
  disabled: r || f.disabled
76
- }), /* @__PURE__ */ q(w, {
76
+ }), /* @__PURE__ */ J(w, {
77
77
  htmlFor: l,
78
78
  children: u
79
79
  })]
80
- }) : /* @__PURE__ */ J("div", {
80
+ }) : /* @__PURE__ */ Y("div", {
81
81
  className: "flex items-center space-x-2",
82
- children: [/* @__PURE__ */ q(oe, {
82
+ children: [/* @__PURE__ */ J(k, {
83
83
  ...f,
84
84
  id: l,
85
85
  checked: !!e,
86
86
  onCheckedChange: t,
87
87
  disabled: r || f.disabled
88
- }), /* @__PURE__ */ q(w, {
88
+ }), /* @__PURE__ */ J(w, {
89
89
  htmlFor: l,
90
90
  children: u
91
91
  })]
92
92
  });
93
93
  }
94
- var Ve = X((() => {})), He, Ue, We = X((() => {
95
- He = {
94
+ var He = X((() => {})), Ue, We, Ge = X((() => {
95
+ Ue = {
96
96
  "common.selectOption": "Select an option",
97
97
  "common.select": "Select...",
98
98
  "common.search": "Search",
99
99
  "table.selected": "{{count}} selected"
100
- }, Ue = Y(He, "common.selectOption");
101
- })), Ge = /* @__PURE__ */ Z({ SelectField: () => Ke });
102
- function Ke({ value: e, onChange: t, field: n, readonly: r, ...i }) {
103
- let a = n || i.schema, o = a?.options || [], { t: s } = Ue();
100
+ }, We = je(Ue, "common.selectOption");
101
+ })), Ke = /* @__PURE__ */ Z({ SelectField: () => qe });
102
+ function qe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
103
+ let a = n || i.schema, o = a?.options || [], { t: s } = We();
104
104
  if (r) {
105
105
  let t = o.find((t) => t.value === e)?.label || e;
106
- return t ? /* @__PURE__ */ q("span", {
106
+ return t ? /* @__PURE__ */ J("span", {
107
107
  className: "text-sm",
108
108
  children: t
109
- }) : /* @__PURE__ */ q(S, {});
109
+ }) : /* @__PURE__ */ J(S, {});
110
110
  }
111
- return /* @__PURE__ */ J(D, {
111
+ return /* @__PURE__ */ Y(E, {
112
112
  ...i,
113
113
  value: e,
114
114
  onValueChange: t,
115
115
  disabled: r || i.disabled,
116
- children: [/* @__PURE__ */ q(ie, {
116
+ children: [/* @__PURE__ */ J(ae, {
117
117
  className: i.className,
118
118
  id: i.id,
119
- children: /* @__PURE__ */ q(ae, { placeholder: a?.placeholder || s("common.selectOption") })
120
- }), /* @__PURE__ */ q(ne, {
119
+ children: /* @__PURE__ */ J(oe, { placeholder: a?.placeholder || s("common.selectOption") })
120
+ }), /* @__PURE__ */ J(re, {
121
121
  position: "popper",
122
- children: o.map((e) => /* @__PURE__ */ q(re, {
122
+ children: o.map((e) => /* @__PURE__ */ J(ie, {
123
123
  value: e.value,
124
124
  children: e.label
125
125
  }, e.value))
126
126
  })]
127
127
  });
128
128
  }
129
- var qe = X((() => {
130
- We();
131
- })), Je = /* @__PURE__ */ Z({ DateField: () => Ye });
132
- function Ye({ value: e, onChange: t, field: n, readonly: r, ...i }) {
133
- if (r) return e ? /* @__PURE__ */ q("span", {
129
+ var Je = X((() => {
130
+ Ge();
131
+ })), Ye = /* @__PURE__ */ Z({ DateField: () => Xe });
132
+ function Xe({ value: e, onChange: t, field: n, readonly: r, ...i }) {
133
+ if (r) return e ? /* @__PURE__ */ J("span", {
134
134
  className: "text-sm",
135
135
  children: new Date(e).toLocaleDateString()
136
- }) : /* @__PURE__ */ q(S, {});
136
+ }) : /* @__PURE__ */ J(S, {});
137
137
  let { inputType: a, ...o } = i;
138
- return /* @__PURE__ */ q(C, {
138
+ return /* @__PURE__ */ J(C, {
139
139
  ...o,
140
140
  type: "date",
141
141
  value: e || "",
@@ -143,16 +143,16 @@ function Ye({ value: e, onChange: t, field: n, readonly: r, ...i }) {
143
143
  disabled: r || o.disabled
144
144
  });
145
145
  }
146
- var Xe = X((() => {})), Ze = /* @__PURE__ */ Z({ EmailField: () => Qe });
147
- function Qe({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
146
+ var Ze = X((() => {})), Qe = /* @__PURE__ */ Z({ EmailField: () => $e });
147
+ function $e({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
148
148
  let o = n || a.schema;
149
- if (r) return e ? /* @__PURE__ */ q("a", {
149
+ if (r) return e ? /* @__PURE__ */ J("a", {
150
150
  href: `mailto:${e}`,
151
151
  className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
152
152
  children: e
153
- }) : /* @__PURE__ */ q(S, {});
153
+ }) : /* @__PURE__ */ J(S, {});
154
154
  let { inputType: s, ...c } = a;
155
- return /* @__PURE__ */ q(C, {
155
+ return /* @__PURE__ */ J(C, {
156
156
  ...c,
157
157
  type: "email",
158
158
  value: e || "",
@@ -162,16 +162,16 @@ function Qe({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
162
162
  "aria-invalid": !!i
163
163
  });
164
164
  }
165
- var $e = X((() => {})), et = /* @__PURE__ */ Z({ PhoneField: () => tt });
166
- function tt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
165
+ var et = X((() => {})), tt = /* @__PURE__ */ Z({ PhoneField: () => nt });
166
+ function nt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
167
167
  let o = n || a.schema;
168
- if (r) return e ? /* @__PURE__ */ q("a", {
168
+ if (r) return e ? /* @__PURE__ */ J("a", {
169
169
  href: `tel:${e}`,
170
170
  className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
171
171
  children: e
172
- }) : /* @__PURE__ */ q(S, {});
172
+ }) : /* @__PURE__ */ J(S, {});
173
173
  let { inputType: s, ...c } = a;
174
- return /* @__PURE__ */ q(C, {
174
+ return /* @__PURE__ */ J(C, {
175
175
  ...c,
176
176
  type: "tel",
177
177
  value: e || "",
@@ -181,21 +181,21 @@ function tt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
181
181
  "aria-invalid": !!i
182
182
  });
183
183
  }
184
- var nt = X((() => {})), rt = /* @__PURE__ */ Z({ UrlField: () => it });
185
- function it({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
184
+ var rt = X((() => {})), it = /* @__PURE__ */ Z({ UrlField: () => at });
185
+ function at({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
186
186
  let o = n || a.schema;
187
- if (r) return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ q("a", {
187
+ if (r) return e ? e.startsWith("http://") || e.startsWith("https://") ? /* @__PURE__ */ J("a", {
188
188
  href: e,
189
189
  target: "_blank",
190
190
  rel: "noopener noreferrer",
191
191
  className: "text-sm text-blue-600 hover:text-blue-800 hover:underline",
192
192
  children: e
193
- }) : /* @__PURE__ */ q("span", {
193
+ }) : /* @__PURE__ */ J("span", {
194
194
  className: "text-sm",
195
195
  children: e
196
- }) : /* @__PURE__ */ q(S, {});
196
+ }) : /* @__PURE__ */ J(S, {});
197
197
  let { inputType: s, ...c } = a;
198
- return /* @__PURE__ */ q(C, {
198
+ return /* @__PURE__ */ J(C, {
199
199
  ...c,
200
200
  type: "url",
201
201
  value: e || "",
@@ -205,33 +205,43 @@ function it({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
205
205
  "aria-invalid": !!i
206
206
  });
207
207
  }
208
- var at = X((() => {})), ot = /* @__PURE__ */ Z({ CurrencyField: () => ct });
209
- function st(e, t = "USD") {
210
- try {
208
+ var ot = X((() => {})), st = /* @__PURE__ */ Z({ CurrencyField: () => lt });
209
+ function ct(e, t, n) {
210
+ if (t) try {
211
211
  return new Intl.NumberFormat("en-US", {
212
212
  style: "currency",
213
- currency: t
213
+ currency: t,
214
+ minimumFractionDigits: n,
215
+ maximumFractionDigits: n
214
216
  }).format(e);
215
217
  } catch {
216
- return `${t} ${e.toFixed(2)}`;
218
+ return `${t} ${e.toFixed(n)}`;
219
+ }
220
+ try {
221
+ return new Intl.NumberFormat("en-US", {
222
+ minimumFractionDigits: n,
223
+ maximumFractionDigits: n
224
+ }).format(e);
225
+ } catch {
226
+ return e.toFixed(n);
217
227
  }
218
228
  }
219
- function ct({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
220
- let s = n || o.schema, c = s?.currency || "USD", l = s?.precision ?? 2;
221
- if (r) return e == null ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
229
+ function lt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
230
+ let s = n || o.schema, c = s?.currency, l = s?.precision ?? 2;
231
+ if (r) return e == null ? /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ J("span", {
222
232
  className: "text-sm font-medium tabular-nums",
223
- children: st(Number(e), c)
233
+ children: ct(Number(e), c, l)
224
234
  });
225
235
  let u = (e) => {
226
236
  let n = parseFloat(e.target.value);
227
237
  isNaN(n) || t(parseFloat(n.toFixed(l)));
228
- };
229
- return /* @__PURE__ */ J("div", {
238
+ }, d = c ? c === "USD" ? "$" : c : "";
239
+ return /* @__PURE__ */ Y("div", {
230
240
  className: "relative",
231
- children: [/* @__PURE__ */ q("span", {
241
+ children: [d && /* @__PURE__ */ J("span", {
232
242
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
233
- children: c === "USD" ? "$" : c
234
- }), /* @__PURE__ */ q(C, {
243
+ children: d
244
+ }), /* @__PURE__ */ J(C, {
235
245
  ...o,
236
246
  type: "number",
237
247
  value: e ?? "",
@@ -241,46 +251,46 @@ function ct({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
241
251
  onBlur: u,
242
252
  placeholder: s?.placeholder || "0.00",
243
253
  disabled: r || o.disabled,
244
- className: `pl-8 ${a || ""}`,
254
+ className: `${d ? "pl-8" : ""} ${a || ""}`,
245
255
  step: (10 ** -l).toFixed(l),
246
256
  "aria-invalid": !!i
247
257
  })]
248
258
  });
249
259
  }
250
- var lt = X((() => {})), ut = /* @__PURE__ */ Z({ TextAreaField: () => dt });
251
- function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
252
- if (r) return /* @__PURE__ */ q("div", {
260
+ var ut = X((() => {})), dt = /* @__PURE__ */ Z({ TextAreaField: () => ft });
261
+ function ft({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
262
+ if (r) return /* @__PURE__ */ J("div", {
253
263
  className: "text-sm whitespace-pre-wrap",
254
- children: e || /* @__PURE__ */ q(S, {})
264
+ children: e || /* @__PURE__ */ J(S, {})
255
265
  });
256
266
  let o = n || a.schema, s = o?.rows || 4, c = o?.max_length, u = !!(a.mobileFullscreen ?? o?.mobile_fullscreen ?? a.mobile_fullscreen ?? a.schema?.mobile_fullscreen), [d, f] = l(!1), [p, m] = l(e ?? ""), g = () => {
257
267
  m(e ?? ""), f(!0);
258
268
  }, y = () => f(!1), C = () => {
259
269
  t(p), f(!1);
260
- }, { inputType: w, mobileFullscreen: T, ...E } = a;
261
- return /* @__PURE__ */ J("div", {
270
+ }, { inputType: w, mobileFullscreen: te, ...ne } = a;
271
+ return /* @__PURE__ */ Y("div", {
262
272
  className: "relative",
263
273
  children: [
264
- /* @__PURE__ */ q(N, {
265
- ...E,
274
+ /* @__PURE__ */ J(N, {
275
+ ...ne,
266
276
  value: e || "",
267
277
  onChange: (e) => t(e.target.value),
268
278
  placeholder: o?.placeholder,
269
- disabled: r || E.disabled,
279
+ disabled: r || ne.disabled,
270
280
  rows: s,
271
281
  maxLength: c,
272
282
  "aria-invalid": !!i,
273
- className: E.className
283
+ className: ne.className
274
284
  }),
275
- u && /* @__PURE__ */ q("button", {
285
+ u && /* @__PURE__ */ J("button", {
276
286
  type: "button",
277
287
  onClick: g,
278
288
  className: "absolute top-1.5 right-1.5 inline-flex items-center justify-center size-7 rounded-md bg-background/80 text-muted-foreground hover:text-foreground hover:bg-background border shadow-sm transition-colors",
279
289
  "aria-label": `Edit ${o?.label ?? "text"} fullscreen`,
280
290
  "data-testid": "textarea-fullscreen-toggle",
281
- children: /* @__PURE__ */ q(W, { className: "size-3.5" })
291
+ children: /* @__PURE__ */ J(U, { className: "size-3.5" })
282
292
  }),
283
- c && /* @__PURE__ */ J("div", {
293
+ c && /* @__PURE__ */ Y("div", {
284
294
  className: "absolute bottom-2 right-2 text-xs text-gray-400",
285
295
  "aria-live": "polite",
286
296
  "aria-label": `Character count: ${(e || "").length} of ${c}`,
@@ -290,23 +300,23 @@ function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
290
300
  c
291
301
  ]
292
302
  }),
293
- u && /* @__PURE__ */ q(_, {
303
+ u && /* @__PURE__ */ J(_, {
294
304
  open: d,
295
305
  onOpenChange: f,
296
- children: /* @__PURE__ */ J(v, {
306
+ children: /* @__PURE__ */ Y(v, {
297
307
  className: "sm:max-w-3xl h-[100dvh] sm:h-[80vh] max-h-[100dvh] sm:max-h-[80vh] flex flex-col p-0 gap-0",
298
308
  "data-testid": "textarea-fullscreen-dialog",
299
309
  children: [
300
- /* @__PURE__ */ q(ee, {
310
+ /* @__PURE__ */ J(ee, {
301
311
  className: "p-4 border-b",
302
- children: /* @__PURE__ */ q(x, {
312
+ children: /* @__PURE__ */ J(x, {
303
313
  className: "text-base",
304
314
  children: o?.label ?? "Edit text"
305
315
  })
306
316
  }),
307
- /* @__PURE__ */ q("div", {
317
+ /* @__PURE__ */ J("div", {
308
318
  className: "flex-1 min-h-0 p-4",
309
- children: /* @__PURE__ */ q(N, {
319
+ children: /* @__PURE__ */ J(N, {
310
320
  autoFocus: !0,
311
321
  value: p,
312
322
  onChange: (e) => m(e.target.value),
@@ -316,27 +326,27 @@ function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
316
326
  "data-testid": "textarea-fullscreen-input"
317
327
  })
318
328
  }),
319
- /* @__PURE__ */ J(b, {
329
+ /* @__PURE__ */ Y(b, {
320
330
  className: "p-3 border-t flex-row justify-between sm:justify-end gap-2",
321
- children: [c && /* @__PURE__ */ J("span", {
331
+ children: [c && /* @__PURE__ */ Y("span", {
322
332
  className: "text-xs text-muted-foreground self-center",
323
333
  children: [
324
334
  p.length,
325
335
  "/",
326
336
  c
327
337
  ]
328
- }), /* @__PURE__ */ J("div", {
338
+ }), /* @__PURE__ */ Y("div", {
329
339
  className: "flex gap-2 ml-auto",
330
- children: [/* @__PURE__ */ J(h, {
340
+ children: [/* @__PURE__ */ Y(h, {
331
341
  type: "button",
332
342
  variant: "ghost",
333
343
  onClick: y,
334
- children: [/* @__PURE__ */ q(Oe, { className: "size-4 mr-1" }), " Cancel"]
335
- }), /* @__PURE__ */ J(h, {
344
+ children: [/* @__PURE__ */ J(De, { className: "size-4 mr-1" }), " Cancel"]
345
+ }), /* @__PURE__ */ Y(h, {
336
346
  type: "button",
337
347
  onClick: C,
338
348
  "data-testid": "textarea-fullscreen-save",
339
- children: [/* @__PURE__ */ q(I, { className: "size-4 mr-1" }), " Done"]
349
+ children: [/* @__PURE__ */ J(I, { className: "size-4 mr-1" }), " Done"]
340
350
  })]
341
351
  })]
342
352
  })
@@ -346,22 +356,22 @@ function dt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
346
356
  ]
347
357
  });
348
358
  }
349
- var ft = X((() => {})), pt = /* @__PURE__ */ Z({ RichTextField: () => mt });
350
- function mt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
351
- if (r) return /* @__PURE__ */ q("div", {
359
+ var pt = X((() => {})), mt = /* @__PURE__ */ Z({ RichTextField: () => ht });
360
+ function ht({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...a }) {
361
+ if (r) return /* @__PURE__ */ J("div", {
352
362
  className: "text-sm prose prose-sm max-w-none",
353
- children: e || /* @__PURE__ */ q(S, {})
363
+ children: e || /* @__PURE__ */ J(S, {})
354
364
  });
355
365
  let o = n || a.schema, s = o?.rows || 8;
356
- return /* @__PURE__ */ J("div", {
366
+ return /* @__PURE__ */ Y("div", {
357
367
  className: "space-y-2",
358
- children: [/* @__PURE__ */ J("div", {
368
+ children: [/* @__PURE__ */ Y("div", {
359
369
  className: "flex items-center justify-between text-xs text-gray-500",
360
- children: [/* @__PURE__ */ J("span", { children: ["Format: ", o?.format || "markdown"] }), /* @__PURE__ */ q("span", {
370
+ children: [/* @__PURE__ */ Y("span", { children: ["Format: ", o?.format || "markdown"] }), /* @__PURE__ */ J("span", {
361
371
  className: "italic",
362
372
  children: "Rich text editor (basic)"
363
373
  })]
364
- }), /* @__PURE__ */ q(N, {
374
+ }), /* @__PURE__ */ J(N, {
365
375
  value: e || "",
366
376
  onChange: (e) => t(e.target.value),
367
377
  placeholder: o?.placeholder || "Enter text...",
@@ -372,16 +382,16 @@ function mt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, ...
372
382
  })]
373
383
  });
374
384
  }
375
- var ht = X((() => {}));
385
+ var gt = X((() => {}));
376
386
  //#endregion
377
387
  //#region src/widgets/RecordPickerDialog.tsx
378
- function gt(e) {
388
+ function _t(e) {
379
389
  return typeof e == "string" ? { field: e } : e;
380
390
  }
381
- function _t(e) {
391
+ function vt(e) {
382
392
  return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (e) => e.toUpperCase());
383
393
  }
384
- function vt(e) {
394
+ function yt(e) {
385
395
  let t = {};
386
396
  for (let n of e) switch (n.operator) {
387
397
  case "eq":
@@ -414,7 +424,7 @@ function vt(e) {
414
424
  }
415
425
  return t;
416
426
  }
417
- function yt(e, t) {
427
+ function bt(e, t) {
418
428
  let n = {};
419
429
  for (let r of t) {
420
430
  let t = e[r.field];
@@ -422,17 +432,17 @@ function yt(e, t) {
422
432
  }
423
433
  return n;
424
434
  }
425
- function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i = !1, dataSource: o, objectName: u, columns: d, displayField: f = "name", idField: p = "id", pageSize: m = xt, value: y, onSelect: S, onSelectRecords: T, lookupFilters: E, cellRenderer: te, filterColumns: k, renderFilterBar: oe, renderGrid: N }) {
426
- let [F, L] = l([]), [ge, R] = l(!1), [z, B] = l(null), [V, _e] = l(0), [ve, ye] = l(""), [H, U] = l(1), W = c(null), [xe, Se] = l(null), [G, K] = l("asc"), [Te, Ee] = l(/* @__PURE__ */ new Set()), De = c(/* @__PURE__ */ new Map()), [Y, Ae] = l(-1), je = c(null), [Me, X] = l(!1), [Z, Ne] = l({}), [Pe, Fe] = l({}), Ie = c(null), [Le, Re] = l(""), ze = s(() => d && d.length > 0 ? d.map(gt) : [{
435
+ function xt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i = !1, dataSource: o, objectName: u, columns: d, displayField: f = "name", titleFormat: p, idField: m = "id", pageSize: y = St, value: S, onSelect: te, onSelectRecords: ne, lookupFilters: T, cellRenderer: O, filterColumns: k, renderFilterBar: N, renderGrid: pe }) {
436
+ let [L, ge] = l([]), [R, _e] = l(!1), [z, B] = l(null), [ve, ye] = l(0), [V, be] = l(""), [H, U] = l(1), Se = c(null), [W, G] = l(null), [K, Te] = l("asc"), [Ee, q] = l(/* @__PURE__ */ new Set()), Oe = c(/* @__PURE__ */ new Map()), [ke, je] = l(-1), Me = c(null), [Ne, X] = l(!1), [Z, Pe] = l({}), [Fe, Ie] = l({}), Le = c(null), [Re, ze] = l(""), Be = s(() => d && d.length > 0 ? d.map(_t) : [{
427
437
  field: f,
428
- label: _t(f)
429
- }], [d, f]), Be = s(() => {
438
+ label: vt(f)
439
+ }], [d, f]), Ve = s(() => {
430
440
  if (k && k.length > 0) return k;
431
- if (E && E.length > 0) return E.map((e) => {
441
+ if (T && T.length > 0) return T.map((e) => {
432
442
  let t = "text";
433
443
  return typeof e.value == "boolean" ? t = "boolean" : Array.isArray(e.value) ? t = "select" : typeof e.value == "number" || e.operator === "gt" || e.operator === "lt" || e.operator === "gte" || e.operator === "lte" ? t = "number" : (e.operator === "in" || e.operator === "notIn") && (t = "select"), {
434
444
  field: e.field,
435
- label: _t(e.field),
445
+ label: vt(e.field),
436
446
  type: t,
437
447
  ...Array.isArray(e.value) ? { options: e.value.map((e) => {
438
448
  if (typeof e == "object" && e) {
@@ -449,126 +459,136 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
449
459
  }) } : {}
450
460
  };
451
461
  });
452
- }, [k, E]), Ve = s(() => {
453
- let e = E?.length ? vt(E) : {}, t = Be?.length ? yt(Z, Be) : {}, n = {
462
+ }, [k, T]), He = s(() => {
463
+ let e = T?.length ? yt(T) : {}, t = Ve?.length ? bt(Z, Ve) : {}, n = {
454
464
  ...e,
455
465
  ...t
456
466
  };
457
467
  return Object.keys(n).length > 0 ? n : void 0;
458
468
  }, [
459
- E,
460
- Be,
469
+ T,
470
+ Ve,
461
471
  Z
462
- ]), He = Math.max(1, Math.ceil(V / m)), Ue = r(async (e, t = 1, n, r) => {
472
+ ]), Ue = Math.max(1, Math.ceil(ve / y)), We = r(async (e, t = 1, n, r) => {
463
473
  if (!(!o || !u)) {
464
- R(!0), B(null);
474
+ _e(!0), B(null);
465
475
  try {
466
476
  let i = {
467
- $top: m,
468
- $skip: (t - 1) * m
477
+ $top: y,
478
+ $skip: (t - 1) * y
469
479
  };
470
480
  e && e.trim() && (i.$search = e.trim()), n && (i.$orderby = { [n.field]: n.direction });
471
- let a = r === void 0 ? Ve : r;
481
+ let a = r === void 0 ? He : r;
472
482
  a && Object.keys(a).length > 0 && (i.$filter = a);
473
483
  let s = await o.find(u, i), c = s?.data ?? s ?? [];
474
- L(c), _e(s?.total ?? c.length), Ae(-1);
484
+ ge(c), ye(s?.total ?? c.length), je(-1);
475
485
  } catch (e) {
476
- B(e instanceof Error ? e.message : String(e)), L([]);
486
+ B(e instanceof Error ? e.message : String(e)), ge([]);
477
487
  } finally {
478
- R(!1);
488
+ _e(!1);
479
489
  }
480
490
  }
481
491
  }, [
482
492
  o,
483
493
  u,
484
- m,
485
- Ve
486
- ]), We = s(() => xe ? {
487
- field: xe,
488
- direction: G
489
- } : null, [xe, G]);
494
+ y,
495
+ He
496
+ ]), Ge = s(() => W ? {
497
+ field: W,
498
+ direction: K
499
+ } : null, [W, K]);
490
500
  a(() => {
491
- e || (ye(""), U(1), B(null), L([]), Se(null), K("asc"), Ae(-1), X(!1), Ne({}), Fe({}), Re(""), Ee(new Set(i && Array.isArray(y) ? y : [])), De.current.clear());
501
+ e || (be(""), U(1), B(null), ge([]), G(null), Te("asc"), je(-1), X(!1), Pe({}), Ie({}), ze(""), q(new Set(i && Array.isArray(S) ? S : [])), Oe.current.clear());
492
502
  }, [e]), a(() => {
493
- e && Ue(ve || void 0, H, We);
503
+ e && We(V || void 0, H, Ge);
494
504
  }, [
495
505
  e,
496
506
  H,
497
- We,
498
- Ve
507
+ Ge,
508
+ He
499
509
  ]), a(() => {
500
- e && i && Ee(new Set(Array.isArray(y) ? y : []));
510
+ e && i && q(new Set(Array.isArray(S) ? S : []));
501
511
  }, [
502
512
  e,
503
513
  i,
504
- y
514
+ S
505
515
  ]);
506
- let Ge = r((e) => {
507
- ye(e), U(1), W.current && clearTimeout(W.current), W.current = setTimeout(() => {
508
- Ue(e || void 0, 1, We);
516
+ let Ke = r((e) => {
517
+ be(e), U(1), Se.current && clearTimeout(Se.current), Se.current = setTimeout(() => {
518
+ We(e || void 0, 1, Ge);
509
519
  }, 300);
510
- }, [Ue, We]);
520
+ }, [We, Ge]);
511
521
  a(() => () => {
512
- W.current && clearTimeout(W.current);
522
+ Se.current && clearTimeout(Se.current);
513
523
  }, []);
514
- let Ke = r((e) => {
515
- Se((t) => t === e ? (K((e) => e === "asc" ? "desc" : "asc"), e) : (K("asc"), e)), U(1);
516
- }, []), qe = r((e) => e[p] ?? e.id ?? e._id, [p]), Je = r((e) => {
517
- let t = qe(e);
518
- return i ? Te.has(t) : y === t;
524
+ let qe = r((e) => {
525
+ G((t) => t === e ? (Te((e) => e === "asc" ? "desc" : "asc"), e) : (Te("asc"), e)), U(1);
526
+ }, []), Je = r((e) => e[m] ?? e.id ?? e._id, [m]), Ye = r((e) => {
527
+ let t = Je(e);
528
+ return i ? Ee.has(t) : S === t;
519
529
  }, [
520
530
  i,
521
- y,
522
- Te,
523
- qe
524
- ]), Ye = r((e) => {
525
- let n = qe(e);
526
- i ? Ee((t) => {
531
+ S,
532
+ Ee,
533
+ Je
534
+ ]), Xe = r((e) => {
535
+ let n = Je(e);
536
+ i ? q((t) => {
527
537
  let r = new Set(t);
528
- return r.has(n) ? (r.delete(n), De.current.delete(n)) : (r.add(n), De.current.set(n, e)), r;
529
- }) : (S(n), T?.([e]), t(!1));
538
+ return r.has(n) ? (r.delete(n), Oe.current.delete(n)) : (r.add(n), Oe.current.set(n, e)), r;
539
+ }) : (te(n), ne?.([e]), t(!1));
530
540
  }, [
531
541
  i,
532
- qe,
533
- S,
534
- T,
542
+ Je,
543
+ te,
544
+ ne,
535
545
  t
536
- ]), Xe = r(() => {
537
- let e = Array.from(Te);
538
- S(e);
539
- let n = e.map((e) => De.current.get(e)).filter(Boolean);
540
- T?.(n), t(!1);
546
+ ]), Ze = r(() => {
547
+ let e = Array.from(Ee);
548
+ te(e);
549
+ let n = e.map((e) => Oe.current.get(e)).filter(Boolean);
550
+ ne?.(n), t(!1);
541
551
  }, [
542
- Te,
543
- S,
544
- T,
552
+ Ee,
553
+ te,
554
+ ne,
545
555
  t
546
- ]), Ze = r(() => {
556
+ ]), Qe = r(() => {
547
557
  U((e) => Math.max(1, e - 1));
548
- }, []), Qe = r(() => {
549
- U((e) => Math.min(He, e + 1));
550
- }, [He]), $e = r((e) => {
558
+ }, []), $e = r(() => {
559
+ U((e) => Math.min(Ue, e + 1));
560
+ }, [Ue]), et = r((e) => {
551
561
  if (e.key !== "Enter") return;
552
- let t = parseInt(Le, 10);
553
- !isNaN(t) && t >= 1 && t <= He && U(t), Re("");
554
- }, [Le, He]), et = r((e) => {
555
- F.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), Ae((e) => Math.min(e + 1, F.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), Ae((e) => Math.max(e - 1, 0))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Y >= 0 && Y < F.length && Ye(F[Y])));
562
+ let t = parseInt(Re, 10);
563
+ !isNaN(t) && t >= 1 && t <= Ue && U(t), ze("");
564
+ }, [Re, Ue]), tt = r((e) => {
565
+ L.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), je((e) => Math.min(e + 1, L.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), je((e) => Math.max(e - 1, 0))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ke >= 0 && ke < L.length && Xe(L[ke])));
556
566
  }, [
557
- F,
558
- Y,
559
- Ye
567
+ L,
568
+ ke,
569
+ Xe
560
570
  ]);
561
571
  a(() => {
562
- if (Y >= 0 && je.current) {
563
- let e = je.current.querySelector(`[data-row-index="${Y}"]`);
572
+ if (ke >= 0 && Me.current) {
573
+ let e = Me.current.querySelector(`[data-row-index="${ke}"]`);
564
574
  e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
565
575
  }
566
- }, [Y]);
567
- let tt = r((e, t) => {
576
+ }, [ke]);
577
+ let nt = r((e, t) => {
578
+ if (p && t.field === f) {
579
+ let t = "[-\\u2013\\u2014|/·,:]", n = !1, r = p.replace(/\{([^{}]+)\}/g, (t, r) => {
580
+ let i = e[r.trim()];
581
+ return i != null && i !== "" ? (n = !0, String(i)) : "\0";
582
+ });
583
+ if (n) {
584
+ let e = r.replace(RegExp(`\\s*${t}\\s*`, "g"), "").replace(RegExp(`\\s*${t}\\s*`, "g"), "").replace(RegExp("\0", "g"), "").replace(/\s+/g, " ").trim();
585
+ if (e) return e;
586
+ }
587
+ }
568
588
  let n = e[t.field];
569
- if (t.type && te) {
570
- let e = te(t.type);
571
- if (e) return /* @__PURE__ */ q(e, {
589
+ if (t.type && O) {
590
+ let e = O(t.type);
591
+ if (e) return /* @__PURE__ */ J(e, {
572
592
  value: n,
573
593
  field: {
574
594
  name: t.field,
@@ -577,359 +597,363 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
577
597
  });
578
598
  }
579
599
  return n == null ? "" : typeof n == "object" ? n.$numberDecimal ? String(Number(n.$numberDecimal)) : n.$oid ? String(n.$oid) : n.$date ? new Date(n.$date).toLocaleDateString() : n.name || n.label ? String(n.name || n.label) : JSON.stringify(n) : typeof n == "boolean" ? n ? "Yes" : "No" : String(n);
580
- }, [te]), nt = r((e) => xe === e ? q(G === "asc" ? fe : de, { className: "ml-1 size-3" }) : /* @__PURE__ */ q(pe, { className: "ml-1 size-3 opacity-40" }), [xe, G]), rt = r((e, t, n) => {
581
- e.preventDefault(), e.stopPropagation(), Ie.current = {
600
+ }, [
601
+ O,
602
+ p,
603
+ f
604
+ ]), rt = r((e) => W === e ? J(K === "asc" ? de : F, { className: "ml-1 size-3" }) : /* @__PURE__ */ J(fe, { className: "ml-1 size-3 opacity-40" }), [W, K]), it = r((e, t, n) => {
605
+ e.preventDefault(), e.stopPropagation(), Le.current = {
582
606
  field: t,
583
607
  startX: e.clientX,
584
608
  startWidth: n
585
609
  };
586
610
  let r = (e) => {
587
- if (!Ie.current) return;
588
- let t = e.clientX - Ie.current.startX, n = Math.max(St, Ie.current.startWidth + t);
589
- Fe((e) => ({
611
+ if (!Le.current) return;
612
+ let t = e.clientX - Le.current.startX, n = Math.max(Ct, Le.current.startWidth + t);
613
+ Ie((e) => ({
590
614
  ...e,
591
- [Ie.current.field]: n
615
+ [Le.current.field]: n
592
616
  }));
593
617
  }, i = () => {
594
- Ie.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
618
+ Le.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
595
619
  };
596
620
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
597
- }, []), it = r((e, t) => {
598
- Ne((n) => ({
621
+ }, []), at = r((e, t) => {
622
+ Pe((n) => ({
599
623
  ...n,
600
624
  [e]: t
601
625
  })), U(1);
602
- }, []), at = r(() => {
603
- Ne({}), U(1);
604
- }, []), ot = s(() => Object.values(Z).filter((e) => e != null && e !== "").length, [Z]), st = r((e) => {
605
- let t = Z[e.field], n = e.label || _t(e.field);
626
+ }, []), ot = r(() => {
627
+ Pe({}), U(1);
628
+ }, []), st = s(() => Object.values(Z).filter((e) => e != null && e !== "").length, [Z]), ct = r((e) => {
629
+ let t = Z[e.field], n = e.label || vt(e.field);
606
630
  switch (e.type) {
607
- case "select": return /* @__PURE__ */ J("div", {
631
+ case "select": return /* @__PURE__ */ Y("div", {
608
632
  className: "space-y-1",
609
- children: [/* @__PURE__ */ q(w, {
633
+ children: [/* @__PURE__ */ J(w, {
610
634
  className: "text-xs text-muted-foreground",
611
635
  children: n
612
- }), /* @__PURE__ */ J(D, {
636
+ }), /* @__PURE__ */ Y(E, {
613
637
  value: t == null ? "" : String(t),
614
- onValueChange: (t) => it(e.field, t),
615
- children: [/* @__PURE__ */ q(ie, {
638
+ onValueChange: (t) => at(e.field, t),
639
+ children: [/* @__PURE__ */ J(ae, {
616
640
  className: "h-8 text-xs",
617
- children: /* @__PURE__ */ q(ae, { placeholder: `Filter ${n}` })
618
- }), /* @__PURE__ */ q(ne, { children: e.options?.map((e) => /* @__PURE__ */ q(re, {
641
+ children: /* @__PURE__ */ J(oe, { placeholder: `Filter ${n}` })
642
+ }), /* @__PURE__ */ J(re, { children: e.options?.map((e) => /* @__PURE__ */ J(ie, {
619
643
  value: String(e.value),
620
644
  children: e.label
621
645
  }, String(e.value))) })]
622
646
  })]
623
647
  });
624
- case "number": return /* @__PURE__ */ J("div", {
648
+ case "number": return /* @__PURE__ */ Y("div", {
625
649
  className: "space-y-1",
626
- children: [/* @__PURE__ */ q(w, {
650
+ children: [/* @__PURE__ */ J(w, {
627
651
  className: "text-xs text-muted-foreground",
628
652
  children: n
629
- }), /* @__PURE__ */ q(C, {
653
+ }), /* @__PURE__ */ J(C, {
630
654
  type: "number",
631
655
  className: "h-8 text-xs",
632
656
  value: t ?? "",
633
657
  placeholder: `Filter ${n}`,
634
658
  onChange: (t) => {
635
659
  let n = t.target.value;
636
- it(e.field, n === "" ? "" : Number(n));
660
+ at(e.field, n === "" ? "" : Number(n));
637
661
  }
638
662
  })]
639
663
  });
640
- case "date": return /* @__PURE__ */ J("div", {
664
+ case "date": return /* @__PURE__ */ Y("div", {
641
665
  className: "space-y-1",
642
- children: [/* @__PURE__ */ q(w, {
666
+ children: [/* @__PURE__ */ J(w, {
643
667
  className: "text-xs text-muted-foreground",
644
668
  children: n
645
- }), /* @__PURE__ */ q(C, {
669
+ }), /* @__PURE__ */ J(C, {
646
670
  type: "date",
647
671
  className: "h-8 text-xs",
648
672
  value: t ?? "",
649
- onChange: (t) => it(e.field, t.target.value)
673
+ onChange: (t) => at(e.field, t.target.value)
650
674
  })]
651
675
  });
652
- case "boolean": return /* @__PURE__ */ J("div", {
676
+ case "boolean": return /* @__PURE__ */ Y("div", {
653
677
  className: "space-y-1",
654
- children: [/* @__PURE__ */ q(w, {
678
+ children: [/* @__PURE__ */ J(w, {
655
679
  className: "text-xs text-muted-foreground",
656
680
  children: n
657
- }), /* @__PURE__ */ J("div", {
681
+ }), /* @__PURE__ */ Y("div", {
658
682
  className: "flex items-center gap-2 h-8",
659
- children: [/* @__PURE__ */ q(g, {
683
+ children: [/* @__PURE__ */ J(g, {
660
684
  checked: !!t,
661
- onCheckedChange: (t) => it(e.field, !!t)
662
- }), /* @__PURE__ */ q("span", {
685
+ onCheckedChange: (t) => at(e.field, !!t)
686
+ }), /* @__PURE__ */ J("span", {
663
687
  className: "text-xs text-muted-foreground",
664
688
  children: "Yes"
665
689
  })]
666
690
  })]
667
691
  });
668
- default: return /* @__PURE__ */ J("div", {
692
+ default: return /* @__PURE__ */ Y("div", {
669
693
  className: "space-y-1",
670
- children: [/* @__PURE__ */ q(w, {
694
+ children: [/* @__PURE__ */ J(w, {
671
695
  className: "text-xs text-muted-foreground",
672
696
  children: n
673
- }), /* @__PURE__ */ q(C, {
697
+ }), /* @__PURE__ */ J(C, {
674
698
  className: "h-8 text-xs",
675
699
  value: t ?? "",
676
700
  placeholder: `Filter ${n}`,
677
- onChange: (t) => it(e.field, t.target.value)
701
+ onChange: (t) => at(e.field, t.target.value)
678
702
  })]
679
703
  });
680
704
  }
681
- }, [Z, it]), ct = r((e, t) => e ? "bg-primary/5 hover:bg-primary/10" : t % 2 == 1 ? "bg-muted/20 hover:bg-accent/30" : "hover:bg-accent/30", []);
682
- return /* @__PURE__ */ q(_, {
705
+ }, [Z, at]), lt = r((e, t) => e ? "bg-primary/5 hover:bg-primary/10" : t % 2 == 1 ? "bg-muted/20 hover:bg-accent/30" : "hover:bg-accent/30", []);
706
+ return /* @__PURE__ */ J(_, {
683
707
  open: e,
684
708
  onOpenChange: t,
685
- children: /* @__PURE__ */ J(v, {
709
+ children: /* @__PURE__ */ Y(v, {
686
710
  className: "w-[95vw] sm:max-w-3xl lg:max-w-5xl max-h-[85vh] sm:max-h-[80vh] flex flex-col gap-0",
687
711
  "data-testid": "record-picker-dialog",
688
712
  children: [
689
- /* @__PURE__ */ q(ee, { children: /* @__PURE__ */ J(x, { children: [n, i && /* @__PURE__ */ q("span", {
713
+ /* @__PURE__ */ J(ee, { children: /* @__PURE__ */ Y(x, { children: [n, i && /* @__PURE__ */ J("span", {
690
714
  className: "sr-only",
691
715
  children: " (multiple selection)"
692
716
  })] }) }),
693
- /* @__PURE__ */ J("div", {
717
+ /* @__PURE__ */ Y("div", {
694
718
  className: "relative rounded-md border bg-muted/30 mb-3",
695
719
  children: [
696
- /* @__PURE__ */ q(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
697
- /* @__PURE__ */ q(C, {
720
+ /* @__PURE__ */ J(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
721
+ /* @__PURE__ */ J(C, {
698
722
  placeholder: "Search...",
699
- value: ve,
700
- onChange: (e) => Ge(e.target.value),
723
+ value: V,
724
+ onChange: (e) => Ke(e.target.value),
701
725
  className: "pl-9 border-0 bg-transparent shadow-none focus-visible:ring-0",
702
726
  "data-testid": "record-picker-search"
703
727
  }),
704
- ge && /* @__PURE__ */ q(be, {
728
+ R && /* @__PURE__ */ J(xe, {
705
729
  className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
706
730
  "data-testid": "record-picker-loading-indicator"
707
731
  })
708
732
  ]
709
733
  }),
710
- Be && Be.length > 0 && /* @__PURE__ */ q("div", {
734
+ Ve && Ve.length > 0 && /* @__PURE__ */ J("div", {
711
735
  className: "py-2",
712
- children: oe ? /* @__PURE__ */ q("div", {
736
+ children: N ? /* @__PURE__ */ J("div", {
713
737
  "data-testid": "record-picker-filter-bar",
714
- children: oe({
715
- filterColumns: Be,
738
+ children: N({
739
+ filterColumns: Ve,
716
740
  values: Z,
717
- onChange: it,
718
- onClear: at,
719
- activeCount: ot
741
+ onChange: at,
742
+ onClear: ot,
743
+ activeCount: st
720
744
  })
721
- }) : /* @__PURE__ */ J(ke, { children: [/* @__PURE__ */ J("div", {
745
+ }) : /* @__PURE__ */ Y(Ae, { children: [/* @__PURE__ */ Y("div", {
722
746
  className: "flex items-center gap-2",
723
747
  "data-testid": "record-picker-filter-bar",
724
- children: [/* @__PURE__ */ J(h, {
748
+ children: [/* @__PURE__ */ Y(h, {
725
749
  type: "button",
726
- variant: ot > 0 ? "secondary" : "outline",
750
+ variant: st > 0 ? "secondary" : "outline",
727
751
  size: "sm",
728
752
  className: "gap-1.5 shrink-0",
729
753
  onClick: () => X((e) => !e),
730
754
  children: [
731
- /* @__PURE__ */ q(we, { className: "size-3.5" }),
755
+ /* @__PURE__ */ J(we, { className: "size-3.5" }),
732
756
  "Filters",
733
- ot > 0 && /* @__PURE__ */ q("span", {
757
+ st > 0 && /* @__PURE__ */ J("span", {
734
758
  className: "inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary",
735
- children: ot
759
+ children: st
736
760
  })
737
761
  ]
738
- }), ot > 0 && /* @__PURE__ */ J(h, {
762
+ }), st > 0 && /* @__PURE__ */ Y(h, {
739
763
  type: "button",
740
764
  variant: "ghost",
741
765
  size: "sm",
742
766
  className: "gap-1 text-xs",
743
- onClick: at,
744
- children: [/* @__PURE__ */ q(Oe, { className: "size-3" }), "Clear"]
767
+ onClick: ot,
768
+ children: [/* @__PURE__ */ J(De, { className: "size-3" }), "Clear"]
745
769
  })]
746
- }), Me && /* @__PURE__ */ q("div", {
770
+ }), Ne && /* @__PURE__ */ J("div", {
747
771
  className: "mt-2 grid gap-3 sm:grid-cols-2 lg:grid-cols-3 border rounded-md p-3 bg-muted/30",
748
772
  "data-testid": "record-picker-filter-panel",
749
- children: Be.map((e) => /* @__PURE__ */ q("div", { children: st(e) }, e.field))
773
+ children: Ve.map((e) => /* @__PURE__ */ J("div", { children: ct(e) }, e.field))
750
774
  })] })
751
775
  }),
752
- z && /* @__PURE__ */ J("div", {
776
+ z && /* @__PURE__ */ Y("div", {
753
777
  className: "flex flex-col items-center gap-2 py-4",
754
778
  role: "alert",
755
779
  children: [
756
- /* @__PURE__ */ q(ue, { className: "size-5 text-destructive" }),
757
- /* @__PURE__ */ q("p", {
780
+ /* @__PURE__ */ J(ue, { className: "size-5 text-destructive" }),
781
+ /* @__PURE__ */ J("p", {
758
782
  className: "text-sm text-destructive",
759
783
  children: z
760
784
  }),
761
- /* @__PURE__ */ q(h, {
785
+ /* @__PURE__ */ J(h, {
762
786
  variant: "outline",
763
787
  size: "sm",
764
- onClick: () => Ue(ve || void 0, H, We),
788
+ onClick: () => We(V || void 0, H, Ge),
765
789
  type: "button",
766
790
  children: "Retry"
767
791
  })
768
792
  ]
769
793
  }),
770
- N ? /* @__PURE__ */ q("div", {
794
+ pe ? /* @__PURE__ */ J("div", {
771
795
  className: "flex-1 min-h-0",
772
796
  "data-testid": "record-picker-grid-slot",
773
- children: N({
774
- columns: ze,
775
- records: F,
776
- loading: ge,
777
- totalCount: V,
797
+ children: pe({
798
+ columns: Be,
799
+ records: L,
800
+ loading: R,
801
+ totalCount: ve,
778
802
  currentPage: H,
779
- pageSize: m,
780
- sortField: xe,
781
- sortDirection: G,
782
- onSort: Ke,
803
+ pageSize: y,
804
+ sortField: W,
805
+ sortDirection: K,
806
+ onSort: qe,
783
807
  onPageChange: U,
784
- onRowClick: Ye,
785
- isSelected: Je,
808
+ onRowClick: Xe,
809
+ isSelected: Ye,
786
810
  multiple: i,
787
- idField: p,
788
- cellRenderer: te
811
+ idField: m,
812
+ cellRenderer: O
789
813
  })
790
- }) : /* @__PURE__ */ J(ke, { children: [
791
- ge && F.length === 0 && !z && /* @__PURE__ */ q("div", {
814
+ }) : /* @__PURE__ */ Y(Ae, { children: [
815
+ R && L.length === 0 && !z && /* @__PURE__ */ J("div", {
792
816
  className: "flex-1 overflow-hidden min-h-0 border rounded-md",
793
817
  role: "status",
794
818
  "aria-live": "polite",
795
819
  "data-testid": "record-picker-skeleton",
796
- children: /* @__PURE__ */ J(se, { children: [/* @__PURE__ */ q(j, { children: /* @__PURE__ */ J(M, {
820
+ children: /* @__PURE__ */ Y(se, { children: [/* @__PURE__ */ J(j, { children: /* @__PURE__ */ Y(M, {
797
821
  className: "bg-muted/40",
798
- children: [i && /* @__PURE__ */ q(le, { className: "w-10" }), ze.map((e) => /* @__PURE__ */ q(le, { children: /* @__PURE__ */ q(O, { className: "h-4 w-20" }) }, e.field))]
799
- }) }), /* @__PURE__ */ q(ce, { children: Array.from({ length: Ct }, (e, t) => /* @__PURE__ */ J(M, { children: [i && /* @__PURE__ */ q(A, {
822
+ children: [i && /* @__PURE__ */ J(le, { className: "w-10" }), Be.map((e) => /* @__PURE__ */ J(le, { children: /* @__PURE__ */ J(D, { className: "h-4 w-20" }) }, e.field))]
823
+ }) }), /* @__PURE__ */ J(ce, { children: Array.from({ length: wt }, (e, t) => /* @__PURE__ */ Y(M, { children: [i && /* @__PURE__ */ J(A, {
800
824
  className: "w-10",
801
- children: /* @__PURE__ */ q(O, { className: "size-4 rounded" })
802
- }), ze.map((e) => /* @__PURE__ */ q(A, { children: /* @__PURE__ */ q(O, { className: "h-4 w-full" }) }, e.field))] }, t)) })] })
825
+ children: /* @__PURE__ */ J(D, { className: "size-4 rounded" })
826
+ }), Be.map((e) => /* @__PURE__ */ J(A, { children: /* @__PURE__ */ J(D, { className: "h-4 w-full" }) }, e.field))] }, t)) })] })
803
827
  }),
804
- !ge && !z && F.length === 0 && /* @__PURE__ */ q("div", {
828
+ !R && !z && L.length === 0 && /* @__PURE__ */ J("div", {
805
829
  className: "py-8 text-center",
806
- children: /* @__PURE__ */ q("p", {
830
+ children: /* @__PURE__ */ J("p", {
807
831
  className: "text-sm text-muted-foreground",
808
832
  children: "No records found"
809
833
  })
810
834
  }),
811
- !z && F.length > 0 && /* @__PURE__ */ J("div", {
835
+ !z && L.length > 0 && /* @__PURE__ */ Y("div", {
812
836
  className: "relative flex-1 overflow-auto min-h-0 border rounded-md",
813
837
  tabIndex: 0,
814
- onKeyDown: et,
838
+ onKeyDown: tt,
815
839
  role: "grid",
816
840
  "aria-label": "Records",
817
- children: [ge && /* @__PURE__ */ q("div", {
841
+ children: [R && /* @__PURE__ */ J("div", {
818
842
  className: "absolute inset-0 z-10 flex items-center justify-center bg-background/60",
819
843
  "data-testid": "record-picker-loading-overlay",
820
- children: /* @__PURE__ */ q(be, { className: "size-6 animate-spin text-muted-foreground" })
821
- }), /* @__PURE__ */ J(se, {
822
- style: Object.keys(Pe).length > 0 ? { tableLayout: "fixed" } : void 0,
823
- children: [/* @__PURE__ */ q(j, {
844
+ children: /* @__PURE__ */ J(xe, { className: "size-6 animate-spin text-muted-foreground" })
845
+ }), /* @__PURE__ */ Y(se, {
846
+ style: Object.keys(Fe).length > 0 ? { tableLayout: "fixed" } : void 0,
847
+ children: [/* @__PURE__ */ J(j, {
824
848
  className: "sticky top-0 z-[5] bg-muted/50 [&_tr]:border-b",
825
849
  "data-testid": "record-picker-sticky-header",
826
- children: /* @__PURE__ */ J(M, { children: [i && /* @__PURE__ */ q(le, { className: "w-10" }), ze.map((e) => {
827
- let t = Pe[e.field];
828
- return /* @__PURE__ */ J(le, {
850
+ children: /* @__PURE__ */ Y(M, { children: [i && /* @__PURE__ */ J(le, { className: "w-10" }), Be.map((e) => {
851
+ let t = Fe[e.field];
852
+ return /* @__PURE__ */ Y(le, {
829
853
  style: t ? {
830
854
  width: `${t}px`,
831
855
  minWidth: `${t}px`
832
856
  } : e.width ? { width: e.width } : void 0,
833
857
  className: "cursor-pointer select-none relative group text-xs font-semibold uppercase tracking-wider",
834
- onClick: () => Ke(e.field),
835
- "aria-sort": xe === e.field ? G === "asc" ? "ascending" : "descending" : "none",
836
- children: [/* @__PURE__ */ J("span", {
858
+ onClick: () => qe(e.field),
859
+ "aria-sort": W === e.field ? K === "asc" ? "ascending" : "descending" : "none",
860
+ children: [/* @__PURE__ */ Y("span", {
837
861
  className: "inline-flex items-center",
838
- children: [e.label || _t(e.field), nt(e.field)]
839
- }), /* @__PURE__ */ q("span", {
862
+ children: [e.label || vt(e.field), rt(e.field)]
863
+ }), /* @__PURE__ */ J("span", {
840
864
  role: "separator",
841
865
  "aria-orientation": "vertical",
842
866
  className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize opacity-0 group-hover:opacity-100 bg-border hover:bg-primary/50 transition-opacity",
843
867
  onMouseDown: (t) => {
844
868
  let n = t.currentTarget.parentElement?.getBoundingClientRect();
845
- rt(t, e.field, n?.width ?? 100);
869
+ it(t, e.field, n?.width ?? 100);
846
870
  },
847
871
  onClick: (e) => e.stopPropagation(),
848
872
  "data-testid": `resize-handle-${e.field}`
849
873
  })]
850
874
  }, e.field);
851
875
  })] })
852
- }), /* @__PURE__ */ q(ce, {
853
- ref: je,
854
- children: F.map((e, t) => {
855
- let n = qe(e), r = Je(e), a = t === Y;
856
- return /* @__PURE__ */ J(M, {
876
+ }), /* @__PURE__ */ J(ce, {
877
+ ref: Me,
878
+ children: L.map((e, t) => {
879
+ let n = Je(e), r = Ye(e), a = t === ke;
880
+ return /* @__PURE__ */ Y(M, {
857
881
  "data-row-index": t,
858
- className: P("cursor-pointer transition-colors", ct(r, t), a && "ring-2 ring-primary ring-inset"),
859
- onClick: () => Ye(e),
882
+ className: P("cursor-pointer transition-colors", lt(r, t), a && "ring-2 ring-primary ring-inset"),
883
+ onClick: () => Xe(e),
860
884
  "data-testid": `record-row-${n}`,
861
885
  "aria-selected": r,
862
- children: [i && /* @__PURE__ */ q(A, {
886
+ children: [i && /* @__PURE__ */ J(A, {
863
887
  className: "w-10",
864
- children: r && /* @__PURE__ */ q(I, { className: "size-4 text-primary" })
865
- }), ze.map((t) => /* @__PURE__ */ q(A, {
888
+ children: r && /* @__PURE__ */ J(I, { className: "size-4 text-primary" })
889
+ }), Be.map((t) => /* @__PURE__ */ J(A, {
866
890
  className: "py-2.5",
867
- children: tt(e, t)
891
+ children: nt(e, t)
868
892
  }, t.field))]
869
893
  }, n ?? t);
870
894
  })
871
895
  })]
872
896
  })]
873
897
  }),
874
- !z && V > 0 && /* @__PURE__ */ J("div", {
898
+ !z && ve > 0 && /* @__PURE__ */ Y("div", {
875
899
  className: "flex items-center justify-between text-sm text-muted-foreground border-t pt-3 mt-2 px-1",
876
900
  "data-testid": "record-picker-pagination",
877
- children: [/* @__PURE__ */ J("span", { children: [
878
- V,
901
+ children: [/* @__PURE__ */ Y("span", { children: [
902
+ ve,
879
903
  " ",
880
- V === 1 ? "record" : "records",
881
- He > 1 && ` · Page ${H} of ${He}`
882
- ] }), He > 1 && /* @__PURE__ */ J("div", {
904
+ ve === 1 ? "record" : "records",
905
+ Ue > 1 && ` · Page ${H} of ${Ue}`
906
+ ] }), Ue > 1 && /* @__PURE__ */ Y("div", {
883
907
  className: "flex items-center gap-1.5",
884
908
  children: [
885
- /* @__PURE__ */ q(h, {
909
+ /* @__PURE__ */ J(h, {
886
910
  variant: "outline",
887
911
  size: "icon",
888
912
  className: "size-7",
889
- onClick: Ze,
913
+ onClick: Qe,
890
914
  disabled: H <= 1,
891
915
  type: "button",
892
916
  "aria-label": "Previous page",
893
- children: /* @__PURE__ */ q(me, { className: "size-4" })
917
+ children: /* @__PURE__ */ J(me, { className: "size-4" })
894
918
  }),
895
- /* @__PURE__ */ q(C, {
919
+ /* @__PURE__ */ J(C, {
896
920
  className: "h-7 w-12 text-center text-xs px-1",
897
921
  placeholder: String(H),
898
- value: Le,
899
- onChange: (e) => Re(e.target.value),
900
- onKeyDown: $e,
922
+ value: Re,
923
+ onChange: (e) => ze(e.target.value),
924
+ onKeyDown: et,
901
925
  "aria-label": "Jump to page",
902
926
  "data-testid": "record-picker-page-jump"
903
927
  }),
904
- /* @__PURE__ */ q(h, {
928
+ /* @__PURE__ */ J(h, {
905
929
  variant: "outline",
906
930
  size: "icon",
907
931
  className: "size-7",
908
- onClick: Qe,
909
- disabled: H >= He,
932
+ onClick: $e,
933
+ disabled: H >= Ue,
910
934
  type: "button",
911
935
  "aria-label": "Next page",
912
- children: /* @__PURE__ */ q(he, { className: "size-4" })
936
+ children: /* @__PURE__ */ J(he, { className: "size-4" })
913
937
  })
914
938
  ]
915
939
  })]
916
940
  })
917
941
  ] }),
918
- i && /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("div", {
942
+ i && /* @__PURE__ */ J(b, { children: /* @__PURE__ */ Y("div", {
919
943
  className: "flex items-center gap-2 w-full justify-between",
920
- children: [/* @__PURE__ */ J("span", {
944
+ children: [/* @__PURE__ */ Y("span", {
921
945
  className: "text-sm text-muted-foreground",
922
- children: [Te.size, " selected"]
923
- }), /* @__PURE__ */ J("div", {
946
+ children: [Ee.size, " selected"]
947
+ }), /* @__PURE__ */ Y("div", {
924
948
  className: "flex gap-2",
925
- children: [/* @__PURE__ */ q(h, {
949
+ children: [/* @__PURE__ */ J(h, {
926
950
  variant: "outline",
927
951
  type: "button",
928
952
  onClick: () => t(!1),
929
953
  children: "Cancel"
930
- }), /* @__PURE__ */ q(h, {
954
+ }), /* @__PURE__ */ J(h, {
931
955
  type: "button",
932
- onClick: Xe,
956
+ onClick: Ze,
933
957
  children: "Confirm"
934
958
  })]
935
959
  })]
@@ -938,28 +962,36 @@ function bt({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i
938
962
  })
939
963
  });
940
964
  }
941
- var xt, St, Ct, wt = X((() => {
942
- xt = 10, St = 60, Ct = 5;
965
+ var St, Ct, wt, Tt = X((() => {
966
+ St = 10, Ct = 60, wt = 5;
943
967
  }));
944
968
  //#endregion
945
969
  //#region src/widgets/_cell-renderer-bridge.ts
946
- function Tt(e) {
947
- Dt = e;
970
+ function Et(e) {
971
+ Ot = e;
948
972
  }
949
- function Et() {
950
- return Dt;
973
+ function Dt() {
974
+ return Ot;
951
975
  }
952
- var Dt, Ot = X((() => {})), kt = /* @__PURE__ */ Z({ LookupField: () => Mt });
953
- function At(e, t, n, r) {
954
- let i = e[n] ?? e.id ?? e._id, a = e[t] ?? e.label ?? e.name ?? String(i), o = r ? e[r] : void 0;
976
+ var Ot, kt = X((() => {})), At = /* @__PURE__ */ Z({ LookupField: () => Pt });
977
+ function jt(e, t) {
978
+ if (!e || typeof e != "object" || !t) return null;
979
+ let n = "[-\\u2013\\u2014|/·,:]", r = !1, i = t.replace(/\{([^{}]+)\}/g, (t, n) => {
980
+ let i = e[n.trim()];
981
+ return i != null && i !== "" ? (r = !0, String(i)) : "\0";
982
+ });
983
+ return r && i.replace(RegExp(`\\s*${n}\\s*`, "g"), "").replace(RegExp(`\\s*${n}\\s*`, "g"), "").replace(RegExp("\0", "g"), "").replace(/\s+/g, " ").trim() || null;
984
+ }
985
+ function Mt(e, t, n, r, i) {
986
+ let a = e[n] ?? e.id ?? e._id, o = (i ? jt(e, i) : null) ?? e[t] ?? e.label ?? e.name ?? e.full_name ?? e.title ?? e.subject ?? String(a), s = r ? e[r] : void 0;
955
987
  return {
956
- value: i,
957
- label: String(a),
958
- description: o,
988
+ value: a,
989
+ label: String(o),
990
+ description: s,
959
991
  ...e
960
992
  };
961
993
  }
962
- function jt(e) {
994
+ function Nt(e) {
963
995
  return {
964
996
  text: "text",
965
997
  number: "number",
@@ -972,8 +1004,8 @@ function jt(e) {
972
1004
  boolean: "boolean"
973
1005
  }[e];
974
1006
  }
975
- function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
976
- let [d, f] = l(!1), [p, g] = l(""), { t: _ } = Ue(), [v, y] = l([]), [b, ee] = l(!1), [x, w] = l(null), [D, ne] = l(0), re = c(null), [ie, ae] = l([]), [O, k] = l(-1), oe = c(null), se = n || u.schema, ce = se?.field, A = ce && typeof ce == "object" && ("reference_to" in ce || "reference" in ce || "type" in ce) ? ce : se, le = A?.options || [], j = A?.multiple || !1, M = A?.display_field || A?.reference_field || "name", N = A?.description_field, P = A?.id_field || "id", de = A?.reference_to || A?.reference, fe = A?.lookup_columns, pe = A?.lookup_page_size, F = A?.lookup_filters, I = s(() => {
1007
+ function Pt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
1008
+ let [d, f] = l(!1), [p, g] = l(""), { t: _ } = We(), [v, y] = l([]), [b, ee] = l(!1), [x, w] = l(null), [E, re] = l(0), ie = c(null), [ae, oe] = l([]), [D, O] = l(-1), k = c(null), se = n || u.schema, ce = se?.field, A = ce && typeof ce == "object" && ("reference_to" in ce || "reference" in ce || "type" in ce) ? ce : se, le = A?.options || [], j = A?.multiple || !1, M = A?.display_field || A?.reference_field || "name", N = A?.description_field, P = A?.id_field || "id", F = A?.reference_to || A?.reference, de = A?.lookup_columns, fe = A?.lookup_page_size, pe = A?.lookup_filters, I = s(() => {
977
1009
  let e = A?.depends_on ?? A?.dependsOn;
978
1010
  return e && Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
979
1011
  field: e,
@@ -983,10 +1015,10 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
983
1015
  param: e.param ?? e.field
984
1016
  }) : [];
985
1017
  }, [A?.depends_on, A?.dependsOn]), me = u.dependentValues, he = s(() => {
986
- if (!fe) return;
1018
+ if (!de) return;
987
1019
  let e = [];
988
- for (let t of fe) if (typeof t == "object" && t.type) {
989
- let n = jt(t.type);
1020
+ for (let t of de) if (typeof t == "object" && t.type) {
1021
+ let n = Nt(t.type);
990
1022
  n && e.push({
991
1023
  field: t.field,
992
1024
  label: t.label,
@@ -994,44 +1026,59 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
994
1026
  });
995
1027
  }
996
1028
  return e.length > 0 ? e : void 0;
997
- }, [fe]), L = i(Pt), ge = L?.dataSource ?? null, R = u.dataSource ?? se?.dataSource ?? A?.dataSource ?? ge, z = s(() => me || (L?.formValues ?? L?.data ?? {}), [
1029
+ }, [de]), L = i(It), ge = L?.dataSource ?? null, R = u.dataSource ?? se?.dataSource ?? A?.dataSource ?? ge, _e = s(() => me || (L?.formValues ?? L?.data ?? {}), [
998
1030
  me,
999
1031
  L?.formValues,
1000
1032
  L?.data
1001
- ]), B = s(() => I.length === 0 ? !1 : I.some(({ field: e }) => {
1002
- let t = z[e];
1033
+ ]), z = s(() => I.length === 0 ? !1 : I.some(({ field: e }) => {
1034
+ let t = _e[e];
1003
1035
  return t == null || t === "" || Array.isArray(t) && t.length === 0;
1004
- }), [I, z]), V = R != null && typeof R.find == "function" && !!de, _e = u.onCreateNew ?? se?.onCreateNew, [ve, ye] = l(!1), H = V ? v : le, U = s(() => {
1005
- if (V || !p) return H;
1036
+ }), [I, _e]), B = R != null && typeof R.find == "function" && !!F, [ve, ye] = l(null);
1037
+ a(() => {
1038
+ if (!R || !F) return;
1039
+ let e = R.getObjectSchema;
1040
+ if (typeof e != "function") return;
1041
+ let t = !0;
1042
+ return Promise.resolve(e.call(R, F)).then((e) => {
1043
+ t && ye(e);
1044
+ }).catch(() => {}), () => {
1045
+ t = !1;
1046
+ };
1047
+ }, [R, F]);
1048
+ let V = s(() => {
1049
+ let e = ve?.titleFormat;
1050
+ return typeof e == "string" ? e : e && typeof e == "object" && typeof e.source == "string" ? e.source : null;
1051
+ }, [ve]), be = u.onCreateNew ?? se?.onCreateNew, [H, U] = l(!1), Se = B ? v : le, G = s(() => {
1052
+ if (B || !p) return Se;
1006
1053
  let e = p.toLowerCase();
1007
- return H.filter((t) => t.label.toLowerCase().includes(e) || t.description && t.description.toLowerCase().includes(e));
1054
+ return Se.filter((t) => t.label.toLowerCase().includes(e) || t.description && t.description.toLowerCase().includes(e));
1008
1055
  }, [
1009
- V,
1010
- H,
1056
+ B,
1057
+ Se,
1011
1058
  p
1012
1059
  ]);
1013
1060
  a(() => {
1014
- k(-1);
1015
- }, [U.length]);
1016
- let W = r(async (e) => {
1017
- if (!(!R || !de)) {
1018
- if (B) {
1019
- y([]), ne(0);
1061
+ O(-1);
1062
+ }, [G.length]);
1063
+ let K = r(async (e) => {
1064
+ if (!(!R || !F)) {
1065
+ if (z) {
1066
+ y([]), re(0);
1020
1067
  return;
1021
1068
  }
1022
1069
  ee(!0), w(null);
1023
1070
  try {
1024
- let t = { $top: Nt };
1071
+ let t = { $top: Ft };
1025
1072
  if (e && e.trim() && (t.$search = e.trim()), I.length > 0) {
1026
1073
  let e = {};
1027
1074
  for (let { field: t, param: n } of I) {
1028
- let r = z[t];
1075
+ let r = _e[t];
1029
1076
  r == null || r === "" || (e[n] = typeof r == "number" ? r : String(r));
1030
1077
  }
1031
1078
  Object.keys(e).length > 0 && (t.$filter = e);
1032
1079
  }
1033
- let n = await R.find(de, t), r = n?.data ?? n ?? [];
1034
- y(r.map((e) => At(e, M, P, N))), ne(n?.total ?? r.length);
1080
+ let n = await R.find(F, t), r = n?.data ?? n ?? [];
1081
+ y(r.map((e) => Mt(e, M, P, N, V))), re(n?.total ?? r.length);
1035
1082
  } catch (e) {
1036
1083
  w(e instanceof Error ? e.message : String(e)), y([]);
1037
1084
  } finally {
@@ -1040,32 +1087,70 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
1040
1087
  }
1041
1088
  }, [
1042
1089
  R,
1043
- de,
1090
+ F,
1044
1091
  M,
1045
1092
  P,
1046
1093
  N,
1047
- B,
1094
+ V,
1095
+ z,
1048
1096
  I,
1049
- z
1097
+ _e
1050
1098
  ]);
1051
1099
  a(() => {
1052
- d && V && I.length > 0 && W(p || void 0);
1053
- }, [s(() => I.map((e) => `${e.param}=${z[e.field] ?? ""}`).join("|"), [I, z])]), a(() => {
1054
- d && V && W(p || void 0), d || (g(""), w(null), k(-1));
1100
+ d && B && I.length > 0 && K(p || void 0);
1101
+ }, [s(() => I.map((e) => `${e.param}=${_e[e.field] ?? ""}`).join("|"), [I, _e])]), a(() => {
1102
+ d && B && K(p || void 0), d || (g(""), w(null), O(-1));
1055
1103
  }, [d]);
1056
- let xe = r((e) => {
1057
- g(e), V && (re.current && clearTimeout(re.current), re.current = setTimeout(() => {
1058
- W(e || void 0);
1104
+ let we = r((e) => {
1105
+ g(e), B && (ie.current && clearTimeout(ie.current), ie.current = setTimeout(() => {
1106
+ K(e || void 0);
1059
1107
  }, 300));
1060
- }, [V, W]);
1108
+ }, [B, K]);
1061
1109
  a(() => () => {
1062
- re.current && clearTimeout(re.current);
1063
- }, []);
1064
- let G = r((e) => le.find((t) => t.value === e) ?? v.find((t) => t.value === e) ?? ie.find((t) => t.value === e), [
1110
+ ie.current && clearTimeout(ie.current);
1111
+ }, []), a(() => {
1112
+ if (!B || !R || !F) return;
1113
+ let t = j ? Array.isArray(e) ? e : [] : e != null && e !== "" ? [e] : [];
1114
+ if (!t.length) return;
1115
+ let n = t.filter((e) => !Te(e));
1116
+ if (!n.length) return;
1117
+ let r = !1;
1118
+ return (async () => {
1119
+ try {
1120
+ let e = [];
1121
+ for (let t of n) if (typeof R.findOne == "function") {
1122
+ let n = await R.findOne(F, t);
1123
+ n && e.push(Mt(n, M, P, N, V));
1124
+ } else {
1125
+ let n = await R.find(F, {
1126
+ $filter: { [P]: t },
1127
+ $top: 1
1128
+ }), r = n?.data ?? n ?? [];
1129
+ r[0] && e.push(Mt(r[0], M, P, N, V));
1130
+ }
1131
+ !r && e.length && oe((t) => {
1132
+ let n = new Map(t.map((e) => [e.value, e]));
1133
+ for (let t of e) n.set(t.value, t);
1134
+ return Array.from(n.values());
1135
+ });
1136
+ } catch {}
1137
+ })(), () => {
1138
+ r = !0;
1139
+ };
1140
+ }, [
1141
+ e,
1142
+ B,
1143
+ F,
1144
+ M,
1145
+ P,
1146
+ N,
1147
+ j
1148
+ ]);
1149
+ let Te = r((e) => le.find((t) => t.value === e) ?? v.find((t) => t.value === e) ?? ae.find((t) => t.value === e), [
1065
1150
  le,
1066
1151
  v,
1067
- ie
1068
- ]), K = j ? (Array.isArray(e) ? e : []).map(G).filter(Boolean) : e ? [G(e)].filter(Boolean) : [], we = r((n) => {
1152
+ ae
1153
+ ]), q = j ? (Array.isArray(e) ? e : []).map(Te).filter(Boolean) : e ? [Te(e)].filter(Boolean) : [], Oe = r((n) => {
1069
1154
  if (j) {
1070
1155
  let r = Array.isArray(e) ? e : [];
1071
1156
  r.includes(n.value) ? t(r.filter((e) => e !== n.value)) : t([...r, n.value]);
@@ -1074,193 +1159,194 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
1074
1159
  j,
1075
1160
  e,
1076
1161
  t
1077
- ]), Te = (n) => {
1162
+ ]), ke = (n) => {
1078
1163
  t(j ? (Array.isArray(e) ? e : []).filter((e) => e !== n) : null);
1079
- }, De = r((e) => {
1080
- ae(e.map((e) => At(e, M, P, N)));
1164
+ }, je = r((e) => {
1165
+ oe(e.map((e) => Mt(e, M, P, N, V)));
1081
1166
  }, [
1082
1167
  M,
1083
1168
  P,
1084
- N
1085
- ]), Y = r((e) => {
1086
- e.key === "ArrowDown" ? (e.preventDefault(), k((e) => e < U.length - 1 ? e + 1 : e)) : e.key === "ArrowUp" ? (e.preventDefault(), k((e) => e > 0 ? e - 1 : 0)) : e.key === "Enter" && (e.preventDefault(), O >= 0 && O < U.length && we(U[O]));
1169
+ N,
1170
+ V
1171
+ ]), Me = r((e) => {
1172
+ e.key === "ArrowDown" ? (e.preventDefault(), O((e) => e < G.length - 1 ? e + 1 : e)) : e.key === "ArrowUp" ? (e.preventDefault(), O((e) => e > 0 ? e - 1 : 0)) : e.key === "Enter" && (e.preventDefault(), D >= 0 && D < G.length && Oe(G[D]));
1087
1173
  }, [
1088
- U,
1089
- O,
1090
- we
1174
+ G,
1175
+ D,
1176
+ Oe
1091
1177
  ]);
1092
1178
  return a(() => {
1093
- O >= 0 && oe.current && oe.current.querySelector(`[data-lookup-index="${O}"]`)?.scrollIntoView({ block: "nearest" });
1094
- }, [O]), o ? K.length ? j ? /* @__PURE__ */ q("div", {
1179
+ D >= 0 && k.current && k.current.querySelector(`[data-lookup-index="${D}"]`)?.scrollIntoView({ block: "nearest" });
1180
+ }, [D]), o ? q.length ? j ? /* @__PURE__ */ J("div", {
1095
1181
  className: "flex flex-wrap gap-1",
1096
- children: K.map((e, t) => /* @__PURE__ */ q(m, {
1182
+ children: q.map((e, t) => /* @__PURE__ */ J(m, {
1097
1183
  variant: "outline",
1098
- children: e?.[M] || e?.label
1184
+ children: e?.label || e?.[M]
1099
1185
  }, t))
1100
- }) : /* @__PURE__ */ q("span", {
1186
+ }) : /* @__PURE__ */ J("span", {
1101
1187
  className: "text-sm",
1102
- children: K[0]?.[M] || K[0]?.label
1103
- }) : /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ J("div", {
1188
+ children: q[0]?.label || q[0]?.[M]
1189
+ }) : /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ Y("div", {
1104
1190
  className: "space-y-2",
1105
1191
  children: [
1106
- K.length > 0 && /* @__PURE__ */ q("div", {
1192
+ q.length > 0 && /* @__PURE__ */ J("div", {
1107
1193
  className: "flex flex-wrap gap-1",
1108
- children: K.map((e, t) => /* @__PURE__ */ J(m, {
1194
+ children: q.map((e, t) => /* @__PURE__ */ Y(m, {
1109
1195
  variant: "outline",
1110
1196
  className: "gap-1",
1111
- children: [e?.[M] || e?.label, /* @__PURE__ */ q("button", {
1112
- onClick: () => Te(e?.value),
1197
+ children: [e?.label || e?.[M], /* @__PURE__ */ J("button", {
1198
+ onClick: () => ke(e?.value),
1113
1199
  className: "ml-1 hover:text-destructive",
1114
1200
  type: "button",
1115
- "aria-label": `Remove ${e?.[M] || e?.label}`,
1116
- children: /* @__PURE__ */ q(Oe, { className: "size-3" })
1201
+ "aria-label": `Remove ${e?.label || e?.[M]}`,
1202
+ children: /* @__PURE__ */ J(De, { className: "size-3" })
1117
1203
  })]
1118
1204
  }, t))
1119
1205
  }),
1120
- /* @__PURE__ */ J("div", {
1206
+ /* @__PURE__ */ Y("div", {
1121
1207
  className: "flex items-center gap-1.5",
1122
- children: [/* @__PURE__ */ J(T, {
1208
+ children: [/* @__PURE__ */ Y(te, {
1123
1209
  open: d,
1124
- onOpenChange: (e) => !B && f(e),
1125
- children: [/* @__PURE__ */ q(te, {
1210
+ onOpenChange: (e) => !z && f(e),
1211
+ children: [/* @__PURE__ */ J(T, {
1126
1212
  asChild: !0,
1127
- children: /* @__PURE__ */ J(h, {
1213
+ children: /* @__PURE__ */ Y(h, {
1128
1214
  variant: "outline",
1129
1215
  className: "min-w-0 flex-1 justify-start text-left font-normal",
1130
1216
  type: "button",
1131
- disabled: B || u.disabled,
1132
- "data-testid": B ? "lookup-trigger-gated" : void 0,
1133
- title: B ? `Select ${I.map((e) => e.field).join(", ")} first` : void 0,
1134
- children: [/* @__PURE__ */ q(Ce, { className: "mr-2 size-4" }), B ? `Select ${I.map((e) => e.field).join(", ")} first` : K.length === 0 ? se?.placeholder || _("common.select") : j ? _("table.selected", { count: K.length }) : _("common.select")]
1217
+ disabled: z || u.disabled,
1218
+ "data-testid": z ? "lookup-trigger-gated" : void 0,
1219
+ title: z ? `Select ${I.map((e) => e.field).join(", ")} first` : void 0,
1220
+ children: [/* @__PURE__ */ J(Ce, { className: "mr-2 size-4" }), z ? `Select ${I.map((e) => e.field).join(", ")} first` : q.length === 0 ? se?.placeholder || _("common.select") : j ? _("table.selected", { count: q.length }) : _("common.select")]
1135
1221
  })
1136
- }), /* @__PURE__ */ J(E, {
1222
+ }), /* @__PURE__ */ Y(ne, {
1137
1223
  className: "w-[var(--radix-popover-trigger-width)] p-0",
1138
1224
  align: "start",
1139
1225
  children: [
1140
- /* @__PURE__ */ q("div", {
1226
+ /* @__PURE__ */ J("div", {
1141
1227
  className: "p-2",
1142
- children: /* @__PURE__ */ J("div", {
1228
+ children: /* @__PURE__ */ Y("div", {
1143
1229
  className: "relative",
1144
1230
  children: [
1145
- /* @__PURE__ */ q(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
1146
- /* @__PURE__ */ q(C, {
1231
+ /* @__PURE__ */ J(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
1232
+ /* @__PURE__ */ J(C, {
1147
1233
  placeholder: _("common.search") + "...",
1148
1234
  value: p,
1149
- onChange: (e) => xe(e.target.value),
1150
- onKeyDown: Y,
1235
+ onChange: (e) => we(e.target.value),
1236
+ onKeyDown: Me,
1151
1237
  className: "w-full pl-9 h-8 text-sm"
1152
1238
  }),
1153
- b && /* @__PURE__ */ q(be, {
1239
+ b && /* @__PURE__ */ J(xe, {
1154
1240
  className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
1155
1241
  "data-testid": "lookup-loading"
1156
1242
  })
1157
1243
  ]
1158
1244
  })
1159
1245
  }),
1160
- x && /* @__PURE__ */ J("div", {
1246
+ x && /* @__PURE__ */ Y("div", {
1161
1247
  className: "flex flex-col items-center gap-2 py-4 px-2",
1162
1248
  role: "alert",
1163
1249
  children: [
1164
- /* @__PURE__ */ q(ue, { className: "size-5 text-destructive" }),
1165
- /* @__PURE__ */ q("p", {
1250
+ /* @__PURE__ */ J(ue, { className: "size-5 text-destructive" }),
1251
+ /* @__PURE__ */ J("p", {
1166
1252
  className: "text-sm text-destructive",
1167
1253
  children: x
1168
1254
  }),
1169
- /* @__PURE__ */ q(h, {
1255
+ /* @__PURE__ */ J(h, {
1170
1256
  variant: "outline",
1171
1257
  size: "sm",
1172
- onClick: () => W(p || void 0),
1258
+ onClick: () => K(p || void 0),
1173
1259
  type: "button",
1174
1260
  children: "Retry"
1175
1261
  })
1176
1262
  ]
1177
1263
  }),
1178
- b && U.length === 0 && !x && /* @__PURE__ */ J("div", {
1264
+ b && G.length === 0 && !x && /* @__PURE__ */ Y("div", {
1179
1265
  className: "flex flex-col items-center gap-2 py-6",
1180
1266
  role: "status",
1181
1267
  "aria-live": "polite",
1182
- children: [/* @__PURE__ */ q(be, { className: "size-6 animate-spin text-muted-foreground" }), /* @__PURE__ */ q("p", {
1268
+ children: [/* @__PURE__ */ J(xe, { className: "size-6 animate-spin text-muted-foreground" }), /* @__PURE__ */ J("p", {
1183
1269
  className: "text-sm text-muted-foreground",
1184
1270
  children: "Loading…"
1185
1271
  })]
1186
1272
  }),
1187
- !x && !(b && U.length === 0) && /* @__PURE__ */ q("div", {
1188
- ref: oe,
1273
+ !x && !(b && G.length === 0) && /* @__PURE__ */ J("div", {
1274
+ ref: k,
1189
1275
  className: "max-h-64 overflow-y-auto px-1 pb-1",
1190
1276
  role: "listbox",
1191
- children: U.length === 0 ? /* @__PURE__ */ J("div", {
1277
+ children: G.length === 0 ? /* @__PURE__ */ Y("div", {
1192
1278
  className: "py-4 text-center",
1193
- children: [/* @__PURE__ */ q("p", {
1279
+ children: [/* @__PURE__ */ J("p", {
1194
1280
  className: "text-sm text-muted-foreground",
1195
1281
  children: "No options found"
1196
- }), _e && /* @__PURE__ */ J(h, {
1282
+ }), be && /* @__PURE__ */ Y(h, {
1197
1283
  variant: "ghost",
1198
1284
  size: "sm",
1199
1285
  className: "mt-2 gap-1",
1200
1286
  type: "button",
1201
1287
  onClick: () => {
1202
- _e(p), f(!1);
1288
+ be(p), f(!1);
1203
1289
  },
1204
- children: [/* @__PURE__ */ q(Se, { className: "size-4" }), "Create new"]
1290
+ children: [/* @__PURE__ */ J(W, { className: "size-4" }), "Create new"]
1205
1291
  })]
1206
- }) : /* @__PURE__ */ J(ke, { children: [
1207
- U.map((t, n) => {
1292
+ }) : /* @__PURE__ */ Y(Ae, { children: [
1293
+ G.map((t, n) => {
1208
1294
  let r = j ? (Array.isArray(e) ? e : []).includes(t.value) : e === t.value;
1209
- return /* @__PURE__ */ J("button", {
1295
+ return /* @__PURE__ */ Y("button", {
1210
1296
  "data-lookup-index": n,
1211
1297
  role: "option",
1212
1298
  "aria-selected": r,
1213
- onClick: () => we(t),
1214
- className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${n === O ? "bg-accent text-accent-foreground" : r ? "bg-accent/50 text-accent-foreground" : ""}`,
1299
+ onClick: () => Oe(t),
1300
+ className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${n === D ? "bg-accent text-accent-foreground" : r ? "bg-accent/50 text-accent-foreground" : ""}`,
1215
1301
  type: "button",
1216
- children: [/* @__PURE__ */ J("div", {
1302
+ children: [/* @__PURE__ */ Y("div", {
1217
1303
  className: "min-w-0 flex-1",
1218
- children: [/* @__PURE__ */ q("span", {
1304
+ children: [/* @__PURE__ */ J("span", {
1219
1305
  className: "block truncate",
1220
1306
  children: t.label
1221
- }), t.description && /* @__PURE__ */ q("span", {
1307
+ }), t.description && /* @__PURE__ */ J("span", {
1222
1308
  className: "block truncate text-xs text-muted-foreground",
1223
1309
  children: t.description
1224
1310
  })]
1225
- }), r && /* @__PURE__ */ q(m, {
1311
+ }), r && /* @__PURE__ */ J(m, {
1226
1312
  variant: "default",
1227
1313
  className: "ml-2 shrink-0",
1228
1314
  children: "Selected"
1229
1315
  })]
1230
1316
  }, t.value);
1231
1317
  }),
1232
- V && D > U.length && /* @__PURE__ */ J("p", {
1318
+ B && E > G.length && /* @__PURE__ */ Y("p", {
1233
1319
  className: "text-xs text-muted-foreground text-center py-2",
1234
1320
  children: [
1235
1321
  "Showing ",
1236
- U.length,
1322
+ G.length,
1237
1323
  " of ",
1238
- D,
1324
+ E,
1239
1325
  " results."
1240
1326
  ]
1241
1327
  }),
1242
- V && D > U.length && /* @__PURE__ */ J("button", {
1328
+ B && E > G.length && /* @__PURE__ */ Y("button", {
1243
1329
  type: "button",
1244
1330
  className: "w-full text-center px-3 py-2 rounded-md text-sm font-medium text-primary hover:bg-accent flex items-center justify-center gap-1.5",
1245
1331
  onClick: () => {
1246
- f(!1), ye(!0);
1332
+ f(!1), U(!0);
1247
1333
  },
1248
1334
  "data-testid": "show-all-results",
1249
1335
  children: [
1250
- /* @__PURE__ */ q(Ee, { className: "size-3.5" }),
1336
+ /* @__PURE__ */ J(Ee, { className: "size-3.5" }),
1251
1337
  "Show All Results (",
1252
- D,
1338
+ E,
1253
1339
  ")"
1254
1340
  ]
1255
1341
  }),
1256
- _e && /* @__PURE__ */ J("button", {
1342
+ be && /* @__PURE__ */ Y("button", {
1257
1343
  type: "button",
1258
1344
  className: "w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center gap-1.5 text-muted-foreground",
1259
1345
  onClick: () => {
1260
- _e(p), f(!1);
1346
+ be(p), f(!1);
1261
1347
  },
1262
1348
  children: [
1263
- /* @__PURE__ */ q(Se, { className: "size-3.5" }),
1349
+ /* @__PURE__ */ J(W, { className: "size-3.5" }),
1264
1350
  "Create new",
1265
1351
  p ? ` "${p}"` : ""
1266
1352
  ]
@@ -1269,47 +1355,48 @@ function Mt({ value: e, onChange: t, field: n, readonly: o, ...u }) {
1269
1355
  })
1270
1356
  ]
1271
1357
  })]
1272
- }), V && /* @__PURE__ */ q(h, {
1358
+ }), B && /* @__PURE__ */ J(h, {
1273
1359
  variant: "outline",
1274
1360
  size: "icon",
1275
1361
  className: "shrink-0",
1276
1362
  type: "button",
1277
- onClick: () => ye(!0),
1363
+ onClick: () => U(!0),
1278
1364
  "aria-label": "Browse all records",
1279
1365
  title: "Browse all records",
1280
1366
  "data-testid": "browse-all-records",
1281
- children: /* @__PURE__ */ q(Ee, { className: "size-4" })
1367
+ children: /* @__PURE__ */ J(Ee, { className: "size-4" })
1282
1368
  })]
1283
1369
  }),
1284
- V && R && de && /* @__PURE__ */ q(bt, {
1285
- open: ve,
1286
- onOpenChange: ye,
1370
+ B && R && F && /* @__PURE__ */ J(xt, {
1371
+ open: H,
1372
+ onOpenChange: U,
1287
1373
  title: se?.label || "Select",
1288
1374
  multiple: j,
1289
1375
  dataSource: R,
1290
- objectName: de,
1291
- columns: fe,
1376
+ objectName: F,
1377
+ columns: de,
1292
1378
  displayField: M,
1379
+ titleFormat: V,
1293
1380
  idField: P,
1294
- pageSize: pe,
1381
+ pageSize: fe,
1295
1382
  value: e,
1296
1383
  onSelect: t,
1297
- onSelectRecords: De,
1298
- lookupFilters: F,
1299
- cellRenderer: Et(),
1384
+ onSelectRecords: je,
1385
+ lookupFilters: pe,
1386
+ cellRenderer: Dt(),
1300
1387
  filterColumns: he
1301
1388
  })
1302
1389
  ]
1303
1390
  });
1304
1391
  }
1305
- var Nt, Pt, Ft = X((() => {
1306
- wt(), Ot(), We(), Nt = 50, Pt = Ae;
1307
- })), It = /* @__PURE__ */ Z({ DateTimeField: () => Lt });
1308
- function Lt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1392
+ var Ft, It, Lt = X((() => {
1393
+ Tt(), kt(), Ge(), Ft = 50, It = Oe;
1394
+ })), Rt = /* @__PURE__ */ Z({ DateTimeField: () => zt });
1395
+ function zt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1309
1396
  if (r) {
1310
- if (!e) return /* @__PURE__ */ q(S, {});
1397
+ if (!e) return /* @__PURE__ */ J(S, {});
1311
1398
  let t = new Date(e);
1312
- return /* @__PURE__ */ J("span", {
1399
+ return /* @__PURE__ */ Y("span", {
1313
1400
  className: "text-sm",
1314
1401
  children: [
1315
1402
  t.toLocaleDateString(),
@@ -1319,7 +1406,7 @@ function Lt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1319
1406
  });
1320
1407
  }
1321
1408
  let { inputType: a, ...o } = i;
1322
- return /* @__PURE__ */ q(C, {
1409
+ return /* @__PURE__ */ J(C, {
1323
1410
  ...o,
1324
1411
  type: "datetime-local",
1325
1412
  value: e || "",
@@ -1327,14 +1414,14 @@ function Lt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1327
1414
  disabled: r || o.disabled
1328
1415
  });
1329
1416
  }
1330
- var Rt = X((() => {})), zt = /* @__PURE__ */ Z({ TimeField: () => Bt });
1331
- function Bt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1332
- if (r) return /* @__PURE__ */ q("span", {
1417
+ var Bt = X((() => {})), Vt = /* @__PURE__ */ Z({ TimeField: () => Ht });
1418
+ function Ht({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1419
+ if (r) return /* @__PURE__ */ J("span", {
1333
1420
  className: "text-sm",
1334
- children: e || /* @__PURE__ */ q(S, {})
1421
+ children: e || /* @__PURE__ */ J(S, {})
1335
1422
  });
1336
1423
  let { inputType: a, ...o } = i;
1337
- return /* @__PURE__ */ q(C, {
1424
+ return /* @__PURE__ */ J(C, {
1338
1425
  ...o,
1339
1426
  type: "time",
1340
1427
  value: e || "",
@@ -1342,10 +1429,10 @@ function Bt({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1342
1429
  disabled: r || o.disabled
1343
1430
  });
1344
1431
  }
1345
- var Vt = X((() => {})), Ht = /* @__PURE__ */ Z({ PercentField: () => Ut });
1346
- function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
1432
+ var Ut = X((() => {})), Wt = /* @__PURE__ */ Z({ PercentField: () => Gt });
1433
+ function Gt({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, className: a, ...o }) {
1347
1434
  let s = n || o.schema, c = s?.precision ?? 2;
1348
- if (r) return e == null ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ J("span", {
1435
+ if (r) return e == null ? /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ Y("span", {
1349
1436
  className: "text-sm font-medium tabular-nums",
1350
1437
  children: [(e * 100).toFixed(c), "%"]
1351
1438
  });
@@ -1365,11 +1452,11 @@ function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
1365
1452
  let n = e[0];
1366
1453
  t(typeof n == "number" ? n / 100 : null);
1367
1454
  }, p = 10 ** -c;
1368
- return /* @__PURE__ */ J("div", {
1455
+ return /* @__PURE__ */ Y("div", {
1369
1456
  className: "space-y-2",
1370
- children: [/* @__PURE__ */ J("div", {
1457
+ children: [/* @__PURE__ */ Y("div", {
1371
1458
  className: "relative",
1372
- children: [/* @__PURE__ */ q(C, {
1459
+ children: [/* @__PURE__ */ J(C, {
1373
1460
  ...o,
1374
1461
  type: "number",
1375
1462
  value: l,
@@ -1379,11 +1466,11 @@ function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
1379
1466
  className: `pr-8 ${a || ""}`,
1380
1467
  step: (10 ** -c).toFixed(c),
1381
1468
  "aria-invalid": !!i
1382
- }), /* @__PURE__ */ q("span", {
1469
+ }), /* @__PURE__ */ J("span", {
1383
1470
  className: "absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",
1384
1471
  children: "%"
1385
1472
  })]
1386
- }), /* @__PURE__ */ q(k, {
1473
+ }), /* @__PURE__ */ J(O, {
1387
1474
  value: [u],
1388
1475
  onValueChange: f,
1389
1476
  min: 0,
@@ -1396,17 +1483,17 @@ function Ut({ value: e, onChange: t, field: n, readonly: r, errorMessage: i, cla
1396
1483
  })]
1397
1484
  });
1398
1485
  }
1399
- var Wt = X((() => {})), Gt = /* @__PURE__ */ Z({ PasswordField: () => Kt });
1400
- function Kt({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
1486
+ var Kt = X((() => {})), qt = /* @__PURE__ */ Z({ PasswordField: () => Jt });
1487
+ function Jt({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
1401
1488
  let [o, s] = l(!1), c = n || a.schema;
1402
- if (r) return /* @__PURE__ */ q("span", {
1489
+ if (r) return /* @__PURE__ */ J("span", {
1403
1490
  className: "text-sm",
1404
1491
  children: "••••••••"
1405
1492
  });
1406
1493
  let { inputType: u, ...d } = a;
1407
- return /* @__PURE__ */ J("div", {
1494
+ return /* @__PURE__ */ Y("div", {
1408
1495
  className: "relative",
1409
- children: [/* @__PURE__ */ q(C, {
1496
+ children: [/* @__PURE__ */ J(C, {
1410
1497
  ...d,
1411
1498
  type: o ? "text" : "password",
1412
1499
  value: e || "",
@@ -1414,20 +1501,20 @@ function Kt({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
1414
1501
  placeholder: c?.placeholder,
1415
1502
  disabled: r || d.disabled,
1416
1503
  className: `pr-10 ${i || ""}`
1417
- }), /* @__PURE__ */ q(h, {
1504
+ }), /* @__PURE__ */ J(h, {
1418
1505
  type: "button",
1419
1506
  variant: "ghost",
1420
1507
  size: "sm",
1421
1508
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
1422
1509
  onClick: () => s(!o),
1423
1510
  tabIndex: -1,
1424
- children: q(o ? _e : V, { className: "size-4 text-gray-500" })
1511
+ children: J(o ? ve : B, { className: "size-4 text-gray-500" })
1425
1512
  })]
1426
1513
  });
1427
1514
  }
1428
- var qt = X((() => {})), Jt = /* @__PURE__ */ Z({ FileField: () => Yt });
1429
- function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1430
- let o = c(null), s = c(null), u = n || a.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : void 0, p = u?.maxSize, m = u?.capture ?? null, g = !f || f.split(",").some((e) => e.trim().startsWith("image/") || e.trim() === "image/*" || e.trim().startsWith(".jp") || e.trim().startsWith(".png") || e.trim().startsWith(".gif") || e.trim().startsWith(".webp")), _ = typeof navigator < "u" && (navigator.maxTouchPoints > 0 || /Mobi|Android/i.test(navigator.userAgent)), v = m === !1 ? !1 : m ?? (g && _ ? "environment" : null), [y, b] = l(!1), [ee, x] = l([]), { upload: C } = je(), [w, T] = l({}), [E, te] = l(!1), D = e ? Array.isArray(e) ? e : [e] : [], ne = r(async (e) => {
1515
+ var Yt = X((() => {})), Xt = /* @__PURE__ */ Z({ FileField: () => Zt });
1516
+ function Zt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1517
+ let o = c(null), s = c(null), u = n || a.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : void 0, p = u?.maxSize, m = u?.capture ?? null, g = !f || f.split(",").some((e) => e.trim().startsWith("image/") || e.trim() === "image/*" || e.trim().startsWith(".jp") || e.trim().startsWith(".png") || e.trim().startsWith(".gif") || e.trim().startsWith(".webp")), _ = typeof navigator < "u" && (navigator.maxTouchPoints > 0 || /Mobi|Android/i.test(navigator.userAgent)), v = m === !1 ? !1 : m ?? (g && _ ? "environment" : null), [y, b] = l(!1), [ee, x] = l([]), { upload: C } = Me(), [w, te] = l({}), [ne, T] = l(!1), E = e ? Array.isArray(e) ? e : [e] : [], re = r(async (e) => {
1431
1518
  if (e.length === 0) return;
1432
1519
  let n = [], r = e.filter((e) => {
1433
1520
  if (p && e.size > p) {
@@ -1437,11 +1524,11 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1437
1524
  return !0;
1438
1525
  });
1439
1526
  if (x(n), r.length !== 0) {
1440
- te(!0);
1527
+ T(!0);
1441
1528
  try {
1442
1529
  let e = (await Promise.all(r.map(async (e) => {
1443
1530
  try {
1444
- let t = await C(e, { onProgress: (t) => T((n) => ({
1531
+ let t = await C(e, { onProgress: (t) => te((n) => ({
1445
1532
  ...n,
1446
1533
  [e.name]: t
1447
1534
  })) });
@@ -1457,75 +1544,75 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1457
1544
  }
1458
1545
  }))).filter(Boolean);
1459
1546
  if (e.length === 0) return;
1460
- t(d ? [...D, ...e] : e[0]);
1547
+ t(d ? [...E, ...e] : e[0]);
1461
1548
  } finally {
1462
- te(!1), T({});
1549
+ T(!1), te({});
1463
1550
  }
1464
1551
  }
1465
1552
  }, [
1466
- D,
1553
+ E,
1467
1554
  d,
1468
1555
  t,
1469
1556
  p,
1470
1557
  C
1471
- ]), re = r((e) => {
1558
+ ]), ie = r((e) => {
1472
1559
  e.preventDefault(), e.stopPropagation(), b(!0);
1473
- }, []), ie = r((e) => {
1474
- e.preventDefault(), e.stopPropagation(), b(!1);
1475
1560
  }, []), ae = r((e) => {
1476
1561
  e.preventDefault(), e.stopPropagation(), b(!1);
1562
+ }, []), oe = r((e) => {
1563
+ e.preventDefault(), e.stopPropagation(), b(!1);
1477
1564
  let t = Array.from(e.dataTransfer.files);
1478
1565
  if (f) {
1479
1566
  let e = f.split(",").map((e) => e.trim().toLowerCase());
1480
- ne(t.filter((t) => {
1567
+ re(t.filter((t) => {
1481
1568
  let n = t.name.split("."), r = n.length > 1 ? "." + n.pop()?.toLowerCase() : "";
1482
1569
  return e.some((e) => e === t.type || r && e === r || e.endsWith("/*") && t.type.startsWith(e.replace("/*", "/")));
1483
1570
  }));
1484
- } else ne(t);
1485
- }, [f, ne]);
1486
- if (i) return e ? /* @__PURE__ */ q("div", {
1571
+ } else re(t);
1572
+ }, [f, re]);
1573
+ if (i) return e ? /* @__PURE__ */ J("div", {
1487
1574
  className: "flex flex-wrap gap-2",
1488
- children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ q("span", {
1575
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ J("span", {
1489
1576
  className: "text-sm truncate max-w-xs",
1490
1577
  children: e.name || e.original_name || "File"
1491
1578
  }, t))
1492
- }) : /* @__PURE__ */ q(S, {});
1493
- let O = (e) => {
1494
- ne(Array.from(e.target.files || []));
1495
- }, k = (e) => {
1579
+ }) : /* @__PURE__ */ J(S, {});
1580
+ let D = (e) => {
1581
+ re(Array.from(e.target.files || []));
1582
+ }, O = (e) => {
1496
1583
  if (d) {
1497
- let n = D.filter((t, n) => n !== e);
1584
+ let n = E.filter((t, n) => n !== e);
1498
1585
  t(n.length > 0 ? n : null);
1499
1586
  } else t(null);
1500
- }, oe = (e) => (e.mime_type || "").startsWith("image/");
1501
- return /* @__PURE__ */ J("div", {
1587
+ }, k = (e) => (e.mime_type || "").startsWith("image/");
1588
+ return /* @__PURE__ */ Y("div", {
1502
1589
  className: a.className,
1503
1590
  children: [
1504
- /* @__PURE__ */ q("input", {
1591
+ /* @__PURE__ */ J("input", {
1505
1592
  ref: o,
1506
1593
  type: "file",
1507
1594
  multiple: d,
1508
1595
  accept: f,
1509
- onChange: O,
1596
+ onChange: D,
1510
1597
  className: "hidden"
1511
1598
  }),
1512
- v && /* @__PURE__ */ q("input", {
1599
+ v && /* @__PURE__ */ J("input", {
1513
1600
  ref: s,
1514
1601
  type: "file",
1515
1602
  accept: "image/*",
1516
1603
  capture: v,
1517
- onChange: O,
1604
+ onChange: D,
1518
1605
  className: "hidden",
1519
1606
  "aria-label": "Camera capture",
1520
1607
  "data-testid": "file-field-camera-input"
1521
1608
  }),
1522
- /* @__PURE__ */ J("div", {
1609
+ /* @__PURE__ */ Y("div", {
1523
1610
  className: "space-y-2",
1524
1611
  children: [
1525
- /* @__PURE__ */ J("div", {
1526
- onDragOver: re,
1527
- onDragLeave: ie,
1528
- onDrop: ae,
1612
+ /* @__PURE__ */ Y("div", {
1613
+ onDragOver: ie,
1614
+ onDragLeave: ae,
1615
+ onDrop: oe,
1529
1616
  onClick: () => o.current?.click(),
1530
1617
  className: `
1531
1618
  flex flex-col items-center justify-center gap-2 p-6
@@ -1538,18 +1625,18 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1538
1625
  onKeyDown: (e) => {
1539
1626
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o.current?.click());
1540
1627
  },
1541
- children: [/* @__PURE__ */ q(De, { className: `size-8 ${y ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ J("div", {
1628
+ children: [/* @__PURE__ */ J(q, { className: `size-8 ${y ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ Y("div", {
1542
1629
  className: "text-center",
1543
- children: [/* @__PURE__ */ q("p", {
1630
+ children: [/* @__PURE__ */ J("p", {
1544
1631
  className: "text-sm font-medium",
1545
1632
  children: y ? "Drop files here" : "Drag & drop files here"
1546
- }), /* @__PURE__ */ J("p", {
1633
+ }), /* @__PURE__ */ Y("p", {
1547
1634
  className: "text-xs text-muted-foreground mt-1",
1548
1635
  children: ["or click to browse", v ? " • use the camera button below" : ""]
1549
1636
  })]
1550
1637
  })]
1551
1638
  }),
1552
- v && /* @__PURE__ */ J(h, {
1639
+ v && /* @__PURE__ */ Y(h, {
1553
1640
  type: "button",
1554
1641
  variant: "outline",
1555
1642
  size: "sm",
@@ -1558,37 +1645,37 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1558
1645
  e.stopPropagation(), s.current?.click();
1559
1646
  },
1560
1647
  "data-testid": "file-field-camera-button",
1561
- children: [/* @__PURE__ */ q(F, { className: "size-4 mr-2" }), v === "user" ? "Take selfie" : "Take photo"]
1648
+ children: [/* @__PURE__ */ J(pe, { className: "size-4 mr-2" }), v === "user" ? "Take selfie" : "Take photo"]
1562
1649
  }),
1563
- E && /* @__PURE__ */ J("div", {
1650
+ ne && /* @__PURE__ */ Y("div", {
1564
1651
  className: "flex items-center gap-2 text-xs text-muted-foreground",
1565
1652
  "data-testid": "file-field-uploading",
1566
- children: [/* @__PURE__ */ q(be, { className: "size-3 animate-spin" }), /* @__PURE__ */ J("span", { children: ["Uploading…", Object.keys(w).length > 0 && ` (${Math.round(Object.values(w).reduce((e, t) => e + t, 0) / Object.keys(w).length * 100)}%)`] })]
1653
+ children: [/* @__PURE__ */ J(xe, { className: "size-3 animate-spin" }), /* @__PURE__ */ Y("span", { children: ["Uploading…", Object.keys(w).length > 0 && ` (${Math.round(Object.values(w).reduce((e, t) => e + t, 0) / Object.keys(w).length * 100)}%)`] })]
1567
1654
  }),
1568
- ee.length > 0 && /* @__PURE__ */ q("div", {
1655
+ ee.length > 0 && /* @__PURE__ */ J("div", {
1569
1656
  className: "space-y-0.5",
1570
- children: ee.map((e, t) => /* @__PURE__ */ q("p", {
1657
+ children: ee.map((e, t) => /* @__PURE__ */ J("p", {
1571
1658
  className: "text-xs text-destructive",
1572
1659
  children: e
1573
1660
  }, t))
1574
1661
  }),
1575
- D.length > 0 && /* @__PURE__ */ q("div", {
1662
+ E.length > 0 && /* @__PURE__ */ J("div", {
1576
1663
  className: "space-y-1",
1577
- children: D.map((e, t) => /* @__PURE__ */ J("div", {
1664
+ children: E.map((e, t) => /* @__PURE__ */ Y("div", {
1578
1665
  className: "flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",
1579
- children: [/* @__PURE__ */ J("div", {
1666
+ children: [/* @__PURE__ */ Y("div", {
1580
1667
  className: "flex items-center gap-2 flex-1 min-w-0",
1581
1668
  children: [
1582
- oe(e) && e.url ? /* @__PURE__ */ q("img", {
1669
+ k(e) && e.url ? /* @__PURE__ */ J("img", {
1583
1670
  src: e.url,
1584
1671
  alt: e.name,
1585
1672
  className: "size-8 object-cover rounded shrink-0"
1586
- }) : oe(e) ? /* @__PURE__ */ q(H, { className: "size-4 text-muted-foreground shrink-0" }) : /* @__PURE__ */ q(ve, { className: "size-4 text-muted-foreground shrink-0" }),
1587
- /* @__PURE__ */ q("span", {
1673
+ }) : k(e) ? /* @__PURE__ */ J(be, { className: "size-4 text-muted-foreground shrink-0" }) : /* @__PURE__ */ J(ye, { className: "size-4 text-muted-foreground shrink-0" }),
1674
+ /* @__PURE__ */ J("span", {
1588
1675
  className: "text-sm truncate",
1589
1676
  children: e.name || e.original_name || "File"
1590
1677
  }),
1591
- e.size && /* @__PURE__ */ J("span", {
1678
+ e.size && /* @__PURE__ */ Y("span", {
1592
1679
  className: "text-xs text-muted-foreground",
1593
1680
  children: [
1594
1681
  "(",
@@ -1597,15 +1684,15 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1597
1684
  ]
1598
1685
  })
1599
1686
  ]
1600
- }), /* @__PURE__ */ q(h, {
1687
+ }), /* @__PURE__ */ J(h, {
1601
1688
  type: "button",
1602
1689
  variant: "ghost",
1603
1690
  size: "sm",
1604
1691
  onClick: (e) => {
1605
- e.stopPropagation(), k(t);
1692
+ e.stopPropagation(), O(t);
1606
1693
  },
1607
1694
  className: "h-6 w-6 p-0",
1608
- children: /* @__PURE__ */ q(Oe, { className: "size-3" })
1695
+ children: /* @__PURE__ */ J(De, { className: "size-3" })
1609
1696
  })]
1610
1697
  }, t))
1611
1698
  })
@@ -1614,17 +1701,17 @@ function Yt({ value: e, onChange: t, field: n, readonly: i, ...a }) {
1614
1701
  ]
1615
1702
  });
1616
1703
  }
1617
- var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt }), Qt, $t = X((() => {
1618
- Qt = ({ open: e, onOpenChange: t, src: n, outputType: i = "image/png", outputName: o = "cropped.png", onConfirm: s }) => {
1704
+ var Qt = X((() => {})), $t = /* @__PURE__ */ Z({ ImageCropperDialog: () => en }), en, tn = X((() => {
1705
+ en = ({ open: e, onOpenChange: t, src: n, outputType: i = "image/png", outputName: o = "cropped.png", onConfirm: s }) => {
1619
1706
  let u = c(null), d = c(null), [f, p] = l(0), [m, g] = l({
1620
1707
  x: 0,
1621
1708
  y: 0,
1622
1709
  width: 100,
1623
1710
  height: 100
1624
- }), [S, C] = l(null), [w, T] = l(!1);
1711
+ }), [S, C] = l(null), [w, te] = l(!1);
1625
1712
  a(() => {
1626
1713
  if (!e || !n) return;
1627
- T(!1);
1714
+ te(!1);
1628
1715
  let t = new Image();
1629
1716
  t.crossOrigin = "anonymous", t.onload = () => {
1630
1717
  d.current = t;
@@ -1634,8 +1721,8 @@ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt })
1634
1721
  y: (t.naturalHeight - n) / 2,
1635
1722
  width: e,
1636
1723
  height: n
1637
- }), p(0), T(!0);
1638
- }, t.onerror = () => T(!1), t.src = n;
1724
+ }), p(0), te(!0);
1725
+ }, t.onerror = () => te(!1), t.src = n;
1639
1726
  }, [e, n]), a(() => {
1640
1727
  if (!w || !d.current || !u.current) return;
1641
1728
  let e = d.current, t = u.current, n = t.getContext("2d");
@@ -1651,7 +1738,7 @@ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt })
1651
1738
  m,
1652
1739
  f
1653
1740
  ]);
1654
- let E = r((e) => {
1741
+ let ne = r((e) => {
1655
1742
  if (!d.current || !u.current) return;
1656
1743
  let t = u.current.getBoundingClientRect(), n = d.current.naturalWidth / t.width;
1657
1744
  C({
@@ -1660,7 +1747,7 @@ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt })
1660
1747
  cx: m.x,
1661
1748
  cy: m.y
1662
1749
  }), e.target.setPointerCapture(e.pointerId);
1663
- }, [m]), te = r((e) => {
1750
+ }, [m]), T = r((e) => {
1664
1751
  if (!S || !d.current || !u.current) return;
1665
1752
  let t = u.current.getBoundingClientRect(), n = d.current.naturalWidth / t.width, r = (e.clientX - t.left) * n - S.ox, i = (e.clientY - t.top) * n - S.oy, a = Math.max(0, Math.min(S.cx + r, d.current.naturalWidth - m.width)), o = Math.max(0, Math.min(S.cy + i, d.current.naturalHeight - m.height));
1666
1753
  g((e) => ({
@@ -1672,7 +1759,7 @@ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt })
1672
1759
  S,
1673
1760
  m.width,
1674
1761
  m.height
1675
- ]), D = r(() => C(null), []), ne = r(() => p((e) => (e + 90) % 360), []), re = r(async () => {
1762
+ ]), E = r(() => C(null), []), re = r(() => p((e) => (e + 90) % 360), []), ie = r(async () => {
1676
1763
  if (!d.current) return;
1677
1764
  let e = d.current, n = document.createElement("canvas"), r = m.width, a = m.height;
1678
1765
  n.width = f % 180 == 0 ? r : a, n.height = f % 180 == 0 ? a : r;
@@ -1689,64 +1776,64 @@ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt })
1689
1776
  s,
1690
1777
  t
1691
1778
  ]);
1692
- return /* @__PURE__ */ q(_, {
1779
+ return /* @__PURE__ */ J(_, {
1693
1780
  open: e,
1694
1781
  onOpenChange: t,
1695
- children: /* @__PURE__ */ J(v, {
1782
+ children: /* @__PURE__ */ Y(v, {
1696
1783
  className: "max-w-xl",
1697
1784
  children: [
1698
- /* @__PURE__ */ J(ee, { children: [/* @__PURE__ */ q(x, { children: "Crop & rotate image" }), /* @__PURE__ */ q(y, { children: "Drag the highlighted box to reposition the crop. Use the rotate button to spin the image in 90° increments." })] }),
1699
- /* @__PURE__ */ J("div", {
1785
+ /* @__PURE__ */ Y(ee, { children: [/* @__PURE__ */ J(x, { children: "Crop & rotate image" }), /* @__PURE__ */ J(y, { children: "Drag the highlighted box to reposition the crop. Use the rotate button to spin the image in 90° increments." })] }),
1786
+ /* @__PURE__ */ Y("div", {
1700
1787
  className: "flex flex-col items-center gap-3",
1701
- children: [w ? /* @__PURE__ */ q("canvas", {
1788
+ children: [w ? /* @__PURE__ */ J("canvas", {
1702
1789
  ref: u,
1703
1790
  "data-testid": "image-cropper-canvas",
1704
1791
  role: "img",
1705
1792
  "aria-label": "Image crop preview",
1706
1793
  className: "border rounded-md cursor-move touch-none max-w-full",
1707
- onPointerDown: E,
1708
- onPointerMove: te,
1709
- onPointerUp: D,
1710
- onPointerCancel: D
1711
- }) : /* @__PURE__ */ q("div", {
1794
+ onPointerDown: ne,
1795
+ onPointerMove: T,
1796
+ onPointerUp: E,
1797
+ onPointerCancel: E
1798
+ }) : /* @__PURE__ */ J("div", {
1712
1799
  className: "flex h-[270px] w-full items-center justify-center text-sm text-muted-foreground",
1713
1800
  children: "Loading image…"
1714
- }), /* @__PURE__ */ J("div", {
1801
+ }), /* @__PURE__ */ Y("div", {
1715
1802
  className: "flex w-full items-center justify-between text-xs text-muted-foreground",
1716
- children: [/* @__PURE__ */ J("span", { children: [
1803
+ children: [/* @__PURE__ */ Y("span", { children: [
1717
1804
  "Crop: ",
1718
1805
  Math.round(m.width),
1719
1806
  " × ",
1720
1807
  Math.round(m.height),
1721
1808
  " px"
1722
- ] }), /* @__PURE__ */ J("span", { children: [
1809
+ ] }), /* @__PURE__ */ Y("span", { children: [
1723
1810
  "Rotation: ",
1724
1811
  f,
1725
1812
  "°"
1726
1813
  ] })]
1727
1814
  })]
1728
1815
  }),
1729
- /* @__PURE__ */ J(b, {
1816
+ /* @__PURE__ */ Y(b, {
1730
1817
  className: "flex justify-between sm:justify-between",
1731
- children: [/* @__PURE__ */ J(h, {
1818
+ children: [/* @__PURE__ */ Y(h, {
1732
1819
  type: "button",
1733
1820
  variant: "outline",
1734
- onClick: ne,
1821
+ onClick: re,
1735
1822
  "data-testid": "image-cropper-rotate",
1736
- children: [/* @__PURE__ */ q(K, { className: "size-4 mr-2" }), "Rotate 90°"]
1737
- }), /* @__PURE__ */ J("div", {
1823
+ children: [/* @__PURE__ */ J(K, { className: "size-4 mr-2" }), "Rotate 90°"]
1824
+ }), /* @__PURE__ */ Y("div", {
1738
1825
  className: "flex gap-2",
1739
- children: [/* @__PURE__ */ q(h, {
1826
+ children: [/* @__PURE__ */ J(h, {
1740
1827
  type: "button",
1741
1828
  variant: "ghost",
1742
1829
  onClick: () => t(!1),
1743
1830
  children: "Cancel"
1744
- }), /* @__PURE__ */ J(h, {
1831
+ }), /* @__PURE__ */ Y(h, {
1745
1832
  type: "button",
1746
- onClick: re,
1833
+ onClick: ie,
1747
1834
  disabled: !w,
1748
1835
  "data-testid": "image-cropper-confirm",
1749
- children: [/* @__PURE__ */ q(ge, { className: "size-4 mr-2" }), "Apply crop"]
1836
+ children: [/* @__PURE__ */ J(ge, { className: "size-4 mr-2" }), "Apply crop"]
1750
1837
  })]
1751
1838
  })]
1752
1839
  })
@@ -1754,17 +1841,17 @@ var Xt = X((() => {})), Zt = /* @__PURE__ */ Z({ ImageCropperDialog: () => Qt })
1754
1841
  })
1755
1842
  });
1756
1843
  };
1757
- })), en = /* @__PURE__ */ Z({ ImageField: () => tn });
1758
- function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1759
- let s = c(null), u = i || o.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : "image/*", p = u?.crop !== !1, [m, g] = l(null), { upload: _ } = je(), [v, y] = l(!1);
1760
- if (a) return e ? /* @__PURE__ */ q("div", {
1844
+ })), nn = /* @__PURE__ */ Z({ ImageField: () => rn });
1845
+ function rn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1846
+ let s = c(null), u = i || o.schema, d = u?.multiple || !1, f = u?.accept ? u.accept.join(",") : "image/*", p = u?.crop !== !1, [m, g] = l(null), { upload: _ } = Me(), [v, y] = l(!1);
1847
+ if (a) return e ? /* @__PURE__ */ J("div", {
1761
1848
  className: "flex flex-wrap gap-2",
1762
- children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ q("img", {
1849
+ children: (Array.isArray(e) ? e : [e]).map((e, t) => /* @__PURE__ */ J("img", {
1763
1850
  src: e.url || "",
1764
1851
  alt: e.name || `Image ${t + 1}`,
1765
1852
  className: "size-20 rounded-md object-cover border border-gray-200"
1766
1853
  }, t))
1767
- }) : /* @__PURE__ */ q(S, {});
1854
+ }) : /* @__PURE__ */ J(S, {});
1768
1855
  let b = e ? Array.isArray(e) ? e : [e] : [], ee = async (e) => {
1769
1856
  let t = Array.from(e.target.files || []);
1770
1857
  if (t.length !== 0) {
@@ -1823,10 +1910,10 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1823
1910
  name: t.name || `image-${e}.png`
1824
1911
  });
1825
1912
  }, [b]);
1826
- return /* @__PURE__ */ J("div", {
1913
+ return /* @__PURE__ */ Y("div", {
1827
1914
  className: o.className,
1828
1915
  children: [
1829
- /* @__PURE__ */ q("input", {
1916
+ /* @__PURE__ */ J("input", {
1830
1917
  ref: s,
1831
1918
  type: "file",
1832
1919
  multiple: d,
@@ -1834,19 +1921,19 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1834
1921
  onChange: ee,
1835
1922
  className: "hidden"
1836
1923
  }),
1837
- /* @__PURE__ */ J("div", {
1924
+ /* @__PURE__ */ Y("div", {
1838
1925
  className: "space-y-2",
1839
- children: [b.length > 0 && /* @__PURE__ */ q("div", {
1926
+ children: [b.length > 0 && /* @__PURE__ */ J("div", {
1840
1927
  className: "grid grid-cols-4 gap-2",
1841
- children: b.map((e, t) => /* @__PURE__ */ J("div", {
1928
+ children: b.map((e, t) => /* @__PURE__ */ Y("div", {
1842
1929
  className: "relative group",
1843
- children: [/* @__PURE__ */ q("img", {
1930
+ children: [/* @__PURE__ */ J("img", {
1844
1931
  src: e.url || "",
1845
1932
  alt: e.name || `Image ${t + 1}`,
1846
1933
  className: "size-20 rounded-md object-cover border border-gray-200"
1847
- }), /* @__PURE__ */ J("div", {
1934
+ }), /* @__PURE__ */ Y("div", {
1848
1935
  className: "absolute top-1 right-1 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
1849
- children: [p && /* @__PURE__ */ q(h, {
1936
+ children: [p && /* @__PURE__ */ J(h, {
1850
1937
  type: "button",
1851
1938
  variant: "secondary",
1852
1939
  size: "sm",
@@ -1854,30 +1941,30 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1854
1941
  className: "h-6 w-6 p-0",
1855
1942
  "aria-label": `Crop image ${t + 1}`,
1856
1943
  "data-testid": `image-field-crop-${t}`,
1857
- children: /* @__PURE__ */ q(ge, { className: "size-3" })
1858
- }), /* @__PURE__ */ q(h, {
1944
+ children: /* @__PURE__ */ J(ge, { className: "size-3" })
1945
+ }), /* @__PURE__ */ J(h, {
1859
1946
  type: "button",
1860
1947
  variant: "destructive",
1861
1948
  size: "sm",
1862
1949
  onClick: () => x(t),
1863
1950
  className: "h-6 w-6 p-0",
1864
- children: /* @__PURE__ */ q(Oe, { className: "size-3" })
1951
+ children: /* @__PURE__ */ J(De, { className: "size-3" })
1865
1952
  })]
1866
1953
  })]
1867
1954
  }, t))
1868
- }), /* @__PURE__ */ J(h, {
1955
+ }), /* @__PURE__ */ Y(h, {
1869
1956
  type: "button",
1870
1957
  variant: "outline",
1871
1958
  onClick: () => s.current?.click(),
1872
1959
  className: "w-full",
1873
1960
  disabled: v,
1874
1961
  "data-testid": "image-field-upload-button",
1875
- children: [v ? /* @__PURE__ */ q(be, { className: "size-4 mr-2 animate-spin" }) : /* @__PURE__ */ q(ye, { className: "size-4 mr-2" }), v ? "Uploading…" : b.length > 0 ? "Add More Images" : "Upload Image"]
1962
+ children: [v ? /* @__PURE__ */ J(xe, { className: "size-4 mr-2 animate-spin" }) : /* @__PURE__ */ J(V, { className: "size-4 mr-2" }), v ? "Uploading…" : b.length > 0 ? "Add More Images" : "Upload Image"]
1876
1963
  })]
1877
1964
  }),
1878
- p && m && /* @__PURE__ */ q(t, {
1965
+ p && m && /* @__PURE__ */ J(t, {
1879
1966
  fallback: null,
1880
- children: /* @__PURE__ */ q(nn, {
1967
+ children: /* @__PURE__ */ J(an, {
1881
1968
  open: !0,
1882
1969
  onOpenChange: (e) => !e && g(null),
1883
1970
  src: m.src,
@@ -1888,15 +1975,15 @@ function tn({ value: e, onChange: n, field: i, readonly: a, ...o }) {
1888
1975
  ]
1889
1976
  });
1890
1977
  }
1891
- var nn, rn = X((() => {
1892
- nn = n(() => Promise.resolve().then(() => ($t(), Zt)).then((e) => ({ default: e.ImageCropperDialog })));
1893
- })), an = /* @__PURE__ */ Z({ LocationField: () => on });
1894
- function on({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1978
+ var an, on = X((() => {
1979
+ an = n(() => Promise.resolve().then(() => (tn(), $t)).then((e) => ({ default: e.ImageCropperDialog })));
1980
+ })), sn = /* @__PURE__ */ Z({ LocationField: () => cn });
1981
+ function cn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1895
1982
  let a = n || i.schema, o = e && typeof e == "object" ? `${e.latitude || 0}, ${e.longitude || 0}` : "";
1896
- return r ? /* @__PURE__ */ q("span", {
1983
+ return r ? /* @__PURE__ */ J("span", {
1897
1984
  className: "text-sm",
1898
- children: o || /* @__PURE__ */ q(S, {})
1899
- }) : /* @__PURE__ */ q(C, {
1985
+ children: o || /* @__PURE__ */ J(S, {})
1986
+ }) : /* @__PURE__ */ J(C, {
1900
1987
  type: "text",
1901
1988
  value: o,
1902
1989
  onChange: (e) => {
@@ -1919,59 +2006,59 @@ function on({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1919
2006
  className: i.className
1920
2007
  });
1921
2008
  }
1922
- var sn = X((() => {})), cn = /* @__PURE__ */ Z({ FormulaField: () => ln });
1923
- function ln({ value: e, field: t, ...n }) {
2009
+ var ln = X((() => {})), un = /* @__PURE__ */ Z({ FormulaField: () => dn });
2010
+ function dn({ value: e, field: t, ...n }) {
1924
2011
  let r = (t || n.schema)?.return_type || "text";
1925
- if (e == null) return /* @__PURE__ */ q(S, { className: n.className });
2012
+ if (e == null) return /* @__PURE__ */ J(S, { className: n.className });
1926
2013
  let i;
1927
- return i = r === "number" || r === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : r === "boolean" ? e ? "Yes" : "No" : r === "date" ? new Date(e).toLocaleDateString() : String(e), /* @__PURE__ */ q("span", {
2014
+ return i = r === "number" || r === "currency" ? typeof e == "number" ? e.toFixed(2) : String(e) : r === "boolean" ? e ? "Yes" : "No" : r === "date" ? new Date(e).toLocaleDateString() : String(e), /* @__PURE__ */ J("span", {
1928
2015
  className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
1929
2016
  children: i
1930
2017
  });
1931
2018
  }
1932
- var un = X((() => {})), dn = /* @__PURE__ */ Z({ SummaryField: () => fn });
1933
- function fn({ value: e, field: t, ...n }) {
2019
+ var fn = X((() => {})), pn = /* @__PURE__ */ Z({ SummaryField: () => mn });
2020
+ function mn({ value: e, field: t, ...n }) {
1934
2021
  let r = (t || n.schema)?.summary_type || "count";
1935
- if (e == null) return /* @__PURE__ */ q(S, { className: n.className });
2022
+ if (e == null) return /* @__PURE__ */ J(S, { className: n.className });
1936
2023
  let i;
1937
2024
  return i = r === "count" ? String(e) : [
1938
2025
  "sum",
1939
2026
  "avg",
1940
2027
  "min",
1941
2028
  "max"
1942
- ].includes(r) && typeof e == "number" ? e.toFixed(2) : String(e), /* @__PURE__ */ q("span", {
2029
+ ].includes(r) && typeof e == "number" ? e.toFixed(2) : String(e), /* @__PURE__ */ J("span", {
1943
2030
  className: `text-sm font-medium tabular-nums text-gray-700 ${n.className || ""}`,
1944
2031
  children: i
1945
2032
  });
1946
2033
  }
1947
- var pn = X((() => {})), mn = /* @__PURE__ */ Z({ AutoNumberField: () => hn });
1948
- function hn({ value: e, field: t, ...n }) {
1949
- return e == null ? /* @__PURE__ */ q(S, { className: n.className }) : /* @__PURE__ */ q("span", {
2034
+ var hn = X((() => {})), gn = /* @__PURE__ */ Z({ AutoNumberField: () => _n });
2035
+ function _n({ value: e, field: t, ...n }) {
2036
+ return e == null ? /* @__PURE__ */ J(S, { className: n.className }) : /* @__PURE__ */ J("span", {
1950
2037
  className: `text-sm font-mono text-gray-700 ${n.className || ""}`,
1951
2038
  children: String(e)
1952
2039
  });
1953
2040
  }
1954
- var gn = X((() => {})), _n = /* @__PURE__ */ Z({ UserField: () => vn });
1955
- function vn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2041
+ var vn = X((() => {})), yn = /* @__PURE__ */ Z({ UserField: () => bn });
2042
+ function bn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1956
2043
  let a = (n || i.schema)?.multiple || !1;
1957
2044
  if (r) {
1958
- if (!e) return /* @__PURE__ */ q(S, {});
2045
+ if (!e) return /* @__PURE__ */ J(S, {});
1959
2046
  let t = Array.isArray(e) ? e : [e];
1960
- return /* @__PURE__ */ J("div", {
2047
+ return /* @__PURE__ */ Y("div", {
1961
2048
  className: "flex -space-x-2",
1962
2049
  children: [t.slice(0, 3).map((e, t) => {
1963
2050
  let n = e.name || e.username || "User";
1964
- return /* @__PURE__ */ q(d, {
2051
+ return /* @__PURE__ */ J(d, {
1965
2052
  className: "size-8 border-2 border-white",
1966
2053
  title: n,
1967
- children: /* @__PURE__ */ q(f, {
2054
+ children: /* @__PURE__ */ J(f, {
1968
2055
  className: "bg-blue-500 text-white text-xs",
1969
2056
  children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
1970
2057
  })
1971
2058
  }, t);
1972
- }), t.length > 3 && /* @__PURE__ */ q(d, {
2059
+ }), t.length > 3 && /* @__PURE__ */ J(d, {
1973
2060
  className: "size-8 border-2 border-white",
1974
- children: /* @__PURE__ */ J(f, {
2061
+ children: /* @__PURE__ */ Y(f, {
1975
2062
  className: "bg-gray-200 text-gray-600 text-xs",
1976
2063
  children: ["+", t.length - 3]
1977
2064
  })
@@ -1984,44 +2071,44 @@ function vn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
1984
2071
  t(n.length > 0 ? n : null);
1985
2072
  } else t(null);
1986
2073
  };
1987
- return /* @__PURE__ */ J("div", {
2074
+ return /* @__PURE__ */ Y("div", {
1988
2075
  className: i.className,
1989
- children: [o.length > 0 && /* @__PURE__ */ q("div", {
2076
+ children: [o.length > 0 && /* @__PURE__ */ J("div", {
1990
2077
  className: "flex flex-wrap gap-2 mb-2",
1991
2078
  children: o.map((e, t) => {
1992
2079
  let n = e.name || e.username || "User";
1993
- return /* @__PURE__ */ J(m, {
2080
+ return /* @__PURE__ */ Y(m, {
1994
2081
  variant: "outline",
1995
2082
  className: "gap-2 pr-1",
1996
2083
  children: [
1997
- /* @__PURE__ */ q(d, {
2084
+ /* @__PURE__ */ J(d, {
1998
2085
  className: "size-5",
1999
- children: /* @__PURE__ */ q(f, {
2086
+ children: /* @__PURE__ */ J(f, {
2000
2087
  className: "bg-blue-500 text-white text-xs",
2001
2088
  children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
2002
2089
  })
2003
2090
  }),
2004
- /* @__PURE__ */ q("span", {
2091
+ /* @__PURE__ */ J("span", {
2005
2092
  className: "text-sm",
2006
2093
  children: n
2007
2094
  }),
2008
- /* @__PURE__ */ q("button", {
2095
+ /* @__PURE__ */ J("button", {
2009
2096
  type: "button",
2010
2097
  onClick: () => s(t),
2011
2098
  className: "ml-1 rounded-full hover:bg-gray-200 p-0.5",
2012
- children: /* @__PURE__ */ q(Oe, { className: "size-3" })
2099
+ children: /* @__PURE__ */ J(De, { className: "size-3" })
2013
2100
  })
2014
2101
  ]
2015
2102
  }, t);
2016
2103
  })
2017
- }), /* @__PURE__ */ q("div", {
2104
+ }), /* @__PURE__ */ J("div", {
2018
2105
  className: "text-sm text-gray-500 italic",
2019
2106
  children: "User selection component requires integration with user management system"
2020
2107
  })]
2021
2108
  });
2022
2109
  }
2023
- var yn = X((() => {})), bn = /* @__PURE__ */ Z({ ObjectField: () => xn });
2024
- function xn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2110
+ var xn = X((() => {})), Sn = /* @__PURE__ */ Z({ ObjectField: () => Cn });
2111
+ function Cn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2025
2112
  let o = n || i.schema, [s, c] = l(() => e == null ? "" : JSON.stringify(e, null, 2)), [u, d] = l(null);
2026
2113
  return a(() => {
2027
2114
  try {
@@ -2034,12 +2121,12 @@ function xn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2034
2121
  } catch {
2035
2122
  c(JSON.stringify(e, null, 2));
2036
2123
  }
2037
- }, [e, s]), r ? e ? /* @__PURE__ */ q("pre", {
2124
+ }, [e, s]), r ? e ? /* @__PURE__ */ J("pre", {
2038
2125
  className: P("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40", i.className),
2039
2126
  children: JSON.stringify(e, null, 2)
2040
- }) : /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ J("div", {
2127
+ }) : /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ Y("div", {
2041
2128
  className: "space-y-1",
2042
- children: [/* @__PURE__ */ q(N, {
2129
+ children: [/* @__PURE__ */ J(N, {
2043
2130
  value: s,
2044
2131
  onChange: (e) => {
2045
2132
  let n = e.target.value;
@@ -2057,30 +2144,30 @@ function xn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2057
2144
  disabled: r || i.disabled,
2058
2145
  className: P("font-mono text-xs", u ? "border-red-500 focus-visible:ring-red-500" : "", i.className),
2059
2146
  rows: 6
2060
- }), u && /* @__PURE__ */ q("p", {
2147
+ }), u && /* @__PURE__ */ J("p", {
2061
2148
  className: "text-xs text-red-500",
2062
2149
  children: u
2063
2150
  })]
2064
2151
  });
2065
2152
  }
2066
- var Sn = X((() => {})), Cn = /* @__PURE__ */ Z({ VectorField: () => wn });
2067
- function wn({ value: e, field: t, ...n }) {
2153
+ var wn = X((() => {})), Tn = /* @__PURE__ */ Z({ VectorField: () => En });
2154
+ function En({ value: e, field: t, ...n }) {
2068
2155
  let r = (t || n.schema)?.dimensions || (Array.isArray(e) ? e.length : 0);
2069
- if (!e || !Array.isArray(e)) return /* @__PURE__ */ q(S, {});
2156
+ if (!e || !Array.isArray(e)) return /* @__PURE__ */ J(S, {});
2070
2157
  let i = e.slice(0, 3).map((e) => {
2071
2158
  let t = Number(e);
2072
2159
  return isNaN(t) ? "0" : t.toFixed(4);
2073
2160
  }).join(", ");
2074
- return /* @__PURE__ */ J("div", {
2161
+ return /* @__PURE__ */ Y("div", {
2075
2162
  className: `text-sm ${n.className || ""}`,
2076
- children: [/* @__PURE__ */ J("span", {
2163
+ children: [/* @__PURE__ */ Y("span", {
2077
2164
  className: "font-mono text-gray-700",
2078
2165
  children: [
2079
2166
  "[",
2080
2167
  i,
2081
2168
  "...]"
2082
2169
  ]
2083
- }), /* @__PURE__ */ J("span", {
2170
+ }), /* @__PURE__ */ Y("span", {
2084
2171
  className: "text-gray-500 ml-2",
2085
2172
  children: [
2086
2173
  "(",
@@ -2090,39 +2177,39 @@ function wn({ value: e, field: t, ...n }) {
2090
2177
  })]
2091
2178
  });
2092
2179
  }
2093
- var Tn = X((() => {})), En = /* @__PURE__ */ Z({ GridField: () => Dn });
2094
- function Dn({ value: e, field: t, readonly: n, ...r }) {
2180
+ var Dn = X((() => {})), On = /* @__PURE__ */ Z({ GridField: () => kn });
2181
+ function kn({ value: e, field: t, readonly: n, ...r }) {
2095
2182
  let i = (t || r.schema)?.columns || [];
2096
- return !e || !Array.isArray(e) ? /* @__PURE__ */ q(S, {}) : n ? /* @__PURE__ */ q("div", {
2183
+ return !e || !Array.isArray(e) ? /* @__PURE__ */ J(S, {}) : n ? /* @__PURE__ */ J("div", {
2097
2184
  className: P("text-sm", r.className),
2098
- children: /* @__PURE__ */ J("span", {
2185
+ children: /* @__PURE__ */ Y("span", {
2099
2186
  className: "text-foreground",
2100
2187
  children: [e.length, " rows"]
2101
2188
  })
2102
- }) : /* @__PURE__ */ J("div", {
2189
+ }) : /* @__PURE__ */ Y("div", {
2103
2190
  className: P("border border-border rounded-lg overflow-hidden", r.className),
2104
- children: [/* @__PURE__ */ q("div", {
2191
+ children: [/* @__PURE__ */ J("div", {
2105
2192
  className: "overflow-auto max-h-60",
2106
- children: /* @__PURE__ */ J("table", {
2193
+ children: /* @__PURE__ */ Y("table", {
2107
2194
  className: "w-full text-sm",
2108
- children: [/* @__PURE__ */ q("thead", {
2195
+ children: [/* @__PURE__ */ J("thead", {
2109
2196
  className: "bg-muted border-b border-border",
2110
- children: /* @__PURE__ */ q("tr", { children: i.map((e, t) => /* @__PURE__ */ q("th", {
2197
+ children: /* @__PURE__ */ J("tr", { children: i.map((e, t) => /* @__PURE__ */ J("th", {
2111
2198
  className: "px-3 py-2 text-left text-xs font-medium text-muted-foreground",
2112
2199
  children: e.label || e.name
2113
2200
  }, t)) })
2114
- }), /* @__PURE__ */ q("tbody", {
2201
+ }), /* @__PURE__ */ J("tbody", {
2115
2202
  className: "divide-y divide-border",
2116
- children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ q("tr", {
2203
+ children: e.slice(0, 5).map((e, t) => /* @__PURE__ */ J("tr", {
2117
2204
  className: "hover:bg-muted/50 transition-colors",
2118
- children: i.map((t, n) => /* @__PURE__ */ q("td", {
2205
+ children: i.map((t, n) => /* @__PURE__ */ J("td", {
2119
2206
  className: "px-3 py-2 text-foreground",
2120
- children: e[t.name] == null ? /* @__PURE__ */ q(S, {}) : String(e[t.name])
2207
+ children: e[t.name] == null ? /* @__PURE__ */ J(S, {}) : String(e[t.name])
2121
2208
  }, n))
2122
2209
  }, t))
2123
2210
  })]
2124
2211
  })
2125
- }), e.length > 5 && /* @__PURE__ */ J("div", {
2212
+ }), e.length > 5 && /* @__PURE__ */ Y("div", {
2126
2213
  className: "bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",
2127
2214
  children: [
2128
2215
  "Showing 5 of ",
@@ -2132,27 +2219,27 @@ function Dn({ value: e, field: t, readonly: n, ...r }) {
2132
2219
  })]
2133
2220
  });
2134
2221
  }
2135
- var On = X((() => {})), kn = /* @__PURE__ */ Z({ ColorField: () => An });
2136
- function An({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2222
+ var An = X((() => {})), jn = /* @__PURE__ */ Z({ ColorField: () => Mn });
2223
+ function Mn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2137
2224
  let a = n || i.schema;
2138
- return r ? /* @__PURE__ */ J("div", {
2225
+ return r ? /* @__PURE__ */ Y("div", {
2139
2226
  className: "flex items-center gap-2",
2140
- children: [/* @__PURE__ */ q("div", {
2227
+ children: [/* @__PURE__ */ J("div", {
2141
2228
  className: "w-6 h-6 rounded border border-input",
2142
2229
  style: { backgroundColor: e || "#000000" }
2143
- }), /* @__PURE__ */ q("span", {
2230
+ }), /* @__PURE__ */ J("span", {
2144
2231
  className: "text-sm",
2145
- children: e || /* @__PURE__ */ q(S, {})
2232
+ children: e || /* @__PURE__ */ J(S, {})
2146
2233
  })]
2147
- }) : /* @__PURE__ */ J("div", {
2234
+ }) : /* @__PURE__ */ Y("div", {
2148
2235
  className: "flex items-center gap-2",
2149
- children: [/* @__PURE__ */ q("input", {
2236
+ children: [/* @__PURE__ */ J("input", {
2150
2237
  type: "color",
2151
2238
  value: e || "#000000",
2152
2239
  onChange: (e) => t(e.target.value),
2153
2240
  disabled: r || i.disabled,
2154
2241
  className: "w-10 h-10 rounded border border-input cursor-pointer"
2155
- }), /* @__PURE__ */ q(C, {
2242
+ }), /* @__PURE__ */ J(C, {
2156
2243
  type: "text",
2157
2244
  value: e || "",
2158
2245
  onChange: (e) => t(e.target.value),
@@ -2163,21 +2250,21 @@ function An({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2163
2250
  })]
2164
2251
  });
2165
2252
  }
2166
- var jn = X((() => {})), Mn = /* @__PURE__ */ Z({ SliderField: () => Nn });
2167
- function Nn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2253
+ var Nn = X((() => {})), Pn = /* @__PURE__ */ Z({ SliderField: () => Fn });
2254
+ function Fn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2168
2255
  let a = n || i.schema, o = a?.min ?? 0, s = a?.max ?? 100, c = a?.step ?? 1;
2169
- return r ? /* @__PURE__ */ J("div", {
2256
+ return r ? /* @__PURE__ */ Y("div", {
2170
2257
  className: "flex items-center gap-2",
2171
- children: [/* @__PURE__ */ q("span", {
2258
+ children: [/* @__PURE__ */ J("span", {
2172
2259
  className: "text-sm font-medium",
2173
2260
  children: e ?? o
2174
- }), /* @__PURE__ */ J("span", {
2261
+ }), /* @__PURE__ */ Y("span", {
2175
2262
  className: "text-xs text-muted-foreground",
2176
2263
  children: ["/ ", s]
2177
2264
  })]
2178
- }) : /* @__PURE__ */ J("div", {
2265
+ }) : /* @__PURE__ */ Y("div", {
2179
2266
  className: "flex items-center gap-4",
2180
- children: [/* @__PURE__ */ q(k, {
2267
+ children: [/* @__PURE__ */ J(O, {
2181
2268
  value: [e ?? o],
2182
2269
  onValueChange: (e) => t(e[0]),
2183
2270
  min: o,
@@ -2185,18 +2272,18 @@ function Nn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2185
2272
  step: c,
2186
2273
  disabled: r || i.disabled,
2187
2274
  className: i.className
2188
- }), /* @__PURE__ */ q("span", {
2275
+ }), /* @__PURE__ */ J("span", {
2189
2276
  className: "text-sm font-medium w-12 text-right",
2190
2277
  children: e ?? o
2191
2278
  })]
2192
2279
  });
2193
2280
  }
2194
- var Pn = X((() => {})), Fn = /* @__PURE__ */ Z({ RatingField: () => In });
2195
- function In({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }) {
2281
+ var In = X((() => {})), Ln = /* @__PURE__ */ Z({ RatingField: () => Rn });
2282
+ function Rn({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }) {
2196
2283
  let s = (r || o.schema)?.max ?? 5, c = t ?? 0, [l, u] = e.useState(null), d = l === null ? c : l;
2197
- return i ? /* @__PURE__ */ J("div", {
2284
+ return i ? /* @__PURE__ */ Y("div", {
2198
2285
  className: P("flex items-center gap-1", a),
2199
- children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ q(Te, { className: `w-5 h-5 ${t < c ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}` }, t)), /* @__PURE__ */ J("span", {
2286
+ children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ J(Te, { className: `w-5 h-5 ${t < c ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground"}` }, t)), /* @__PURE__ */ Y("span", {
2200
2287
  className: "ml-2 text-sm text-muted-foreground",
2201
2288
  children: [
2202
2289
  c,
@@ -2204,17 +2291,17 @@ function In({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }
2204
2291
  s
2205
2292
  ]
2206
2293
  })]
2207
- }) : /* @__PURE__ */ J("div", {
2294
+ }) : /* @__PURE__ */ Y("div", {
2208
2295
  className: P("flex items-center gap-1", a),
2209
- children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ q("button", {
2296
+ children: [Array.from({ length: s }, (e, t) => /* @__PURE__ */ J("button", {
2210
2297
  type: "button",
2211
2298
  onClick: () => n(t + 1),
2212
2299
  onMouseEnter: () => u(t + 1),
2213
2300
  onMouseLeave: () => u(null),
2214
2301
  className: "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",
2215
2302
  disabled: i || o.disabled,
2216
- children: /* @__PURE__ */ q(Te, { className: `w-5 h-5 transition-colors ${t < d ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}` })
2217
- }, t)), /* @__PURE__ */ J("span", {
2303
+ children: /* @__PURE__ */ J(Te, { className: `w-5 h-5 transition-colors ${t < d ? "fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500" : "text-muted-foreground hover:text-yellow-400"}` })
2304
+ }, t)), /* @__PURE__ */ Y("span", {
2218
2305
  className: "ml-2 text-sm text-muted-foreground",
2219
2306
  children: [
2220
2307
  c,
@@ -2224,13 +2311,13 @@ function In({ value: t, onChange: n, field: r, readonly: i, className: a, ...o }
2224
2311
  })]
2225
2312
  });
2226
2313
  }
2227
- var Ln = X((() => {})), Rn = /* @__PURE__ */ Z({ CodeField: () => zn });
2228
- function zn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2314
+ var zn = X((() => {})), Bn = /* @__PURE__ */ Z({ CodeField: () => Vn });
2315
+ function Vn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2229
2316
  let a = n || i.schema, o = a?.language ?? "javascript";
2230
- return r ? /* @__PURE__ */ q("pre", {
2317
+ return r ? /* @__PURE__ */ J("pre", {
2231
2318
  className: P("text-sm bg-muted p-2 rounded overflow-x-auto border", i.className),
2232
- children: /* @__PURE__ */ q("code", { children: e || /* @__PURE__ */ q(S, {}) })
2233
- }) : /* @__PURE__ */ q(N, {
2319
+ children: /* @__PURE__ */ J("code", { children: e || /* @__PURE__ */ J(S, {}) })
2320
+ }) : /* @__PURE__ */ J(N, {
2234
2321
  value: e || "",
2235
2322
  onChange: (e) => t(e.target.value),
2236
2323
  placeholder: a?.placeholder || `// Write ${o} code here...`,
@@ -2240,8 +2327,8 @@ function zn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2240
2327
  spellCheck: !1
2241
2328
  });
2242
2329
  }
2243
- var Bn = X((() => {})), Vn = /* @__PURE__ */ Z({ AvatarField: () => Hn });
2244
- function Hn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2330
+ var Hn = X((() => {})), Un = /* @__PURE__ */ Z({ AvatarField: () => Wn });
2331
+ function Wn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2245
2332
  let [o, s] = e.useState(!1), c = e.useRef(null), l = r || a.schema, u = (e) => {
2246
2333
  let t = e.target.files?.[0];
2247
2334
  if (!t) return;
@@ -2260,53 +2347,53 @@ function Hn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2260
2347
  }, m = () => {
2261
2348
  n("");
2262
2349
  }, g = () => (l?.defaultName || l?.label || "User").split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2);
2263
- return i ? /* @__PURE__ */ J(d, {
2350
+ return i ? /* @__PURE__ */ Y(d, {
2264
2351
  className: "w-16 h-16",
2265
- children: [t && /* @__PURE__ */ q(p, {
2352
+ children: [t && /* @__PURE__ */ J(p, {
2266
2353
  src: t,
2267
2354
  alt: l?.label
2268
- }), /* @__PURE__ */ q(f, { children: g() })]
2269
- }) : /* @__PURE__ */ J("div", {
2355
+ }), /* @__PURE__ */ J(f, { children: g() })]
2356
+ }) : /* @__PURE__ */ Y("div", {
2270
2357
  className: "flex items-center gap-4",
2271
- children: [/* @__PURE__ */ J("div", {
2358
+ children: [/* @__PURE__ */ Y("div", {
2272
2359
  className: "relative",
2273
2360
  onMouseEnter: () => s(!0),
2274
2361
  onMouseLeave: () => s(!1),
2275
- children: [/* @__PURE__ */ J(d, {
2362
+ children: [/* @__PURE__ */ Y(d, {
2276
2363
  className: "w-16 h-16",
2277
- children: [t && /* @__PURE__ */ q(p, {
2364
+ children: [t && /* @__PURE__ */ J(p, {
2278
2365
  src: t,
2279
2366
  alt: l?.label
2280
- }), /* @__PURE__ */ q(f, { children: g() })]
2281
- }), !i && o && t && /* @__PURE__ */ q("button", {
2367
+ }), /* @__PURE__ */ J(f, { children: g() })]
2368
+ }), !i && o && t && /* @__PURE__ */ J("button", {
2282
2369
  type: "button",
2283
2370
  onClick: m,
2284
2371
  className: "absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",
2285
- children: /* @__PURE__ */ q(Oe, { className: "w-3 h-3" })
2372
+ children: /* @__PURE__ */ J(De, { className: "w-3 h-3" })
2286
2373
  })]
2287
- }), /* @__PURE__ */ J("div", {
2374
+ }), /* @__PURE__ */ Y("div", {
2288
2375
  className: "flex flex-col gap-2",
2289
2376
  children: [
2290
- /* @__PURE__ */ q("input", {
2377
+ /* @__PURE__ */ J("input", {
2291
2378
  ref: c,
2292
2379
  type: "file",
2293
2380
  accept: "image/*",
2294
2381
  onChange: u,
2295
2382
  className: "hidden"
2296
2383
  }),
2297
- /* @__PURE__ */ J(h, {
2384
+ /* @__PURE__ */ Y(h, {
2298
2385
  type: "button",
2299
2386
  variant: "outline",
2300
2387
  size: "sm",
2301
2388
  onClick: () => c.current?.click(),
2302
2389
  disabled: i || a.disabled,
2303
2390
  children: [
2304
- /* @__PURE__ */ q(De, { className: "w-4 h-4 mr-2" }),
2391
+ /* @__PURE__ */ J(q, { className: "w-4 h-4 mr-2" }),
2305
2392
  t ? "Change" : "Upload",
2306
2393
  " Avatar"
2307
2394
  ]
2308
2395
  }),
2309
- /* @__PURE__ */ q("p", {
2396
+ /* @__PURE__ */ J("p", {
2310
2397
  className: "text-xs text-muted-foreground",
2311
2398
  children: "PNG, JPG up to 5MB"
2312
2399
  })
@@ -2314,8 +2401,8 @@ function Hn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2314
2401
  })]
2315
2402
  });
2316
2403
  }
2317
- var Un = X((() => {})), Wn = /* @__PURE__ */ Z({ AddressField: () => Gn });
2318
- function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2404
+ var Gn = X((() => {})), Kn = /* @__PURE__ */ Z({ AddressField: () => qn });
2405
+ function qn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2319
2406
  let a = e || {}, o = (e, n) => {
2320
2407
  t({
2321
2408
  ...a,
@@ -2329,19 +2416,19 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2329
2416
  ].filter(Boolean).join(", ");
2330
2417
  if (r) {
2331
2418
  let e = s(a);
2332
- return e ? /* @__PURE__ */ q("span", {
2419
+ return e ? /* @__PURE__ */ J("span", {
2333
2420
  className: "text-sm",
2334
2421
  children: e
2335
- }) : /* @__PURE__ */ q(S, {});
2422
+ }) : /* @__PURE__ */ J(S, {});
2336
2423
  }
2337
- return /* @__PURE__ */ J("div", {
2424
+ return /* @__PURE__ */ Y("div", {
2338
2425
  className: "space-y-3",
2339
2426
  children: [
2340
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2427
+ /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2341
2428
  htmlFor: "street",
2342
2429
  className: "text-xs",
2343
2430
  children: "Street Address"
2344
- }), /* @__PURE__ */ q(C, {
2431
+ }), /* @__PURE__ */ J(C, {
2345
2432
  id: "street",
2346
2433
  type: "text",
2347
2434
  value: a.street || "",
@@ -2350,24 +2437,24 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2350
2437
  disabled: r || i.disabled,
2351
2438
  className: i.className
2352
2439
  })] }),
2353
- /* @__PURE__ */ J("div", {
2440
+ /* @__PURE__ */ Y("div", {
2354
2441
  className: "grid grid-cols-2 gap-3",
2355
- children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2442
+ children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2356
2443
  htmlFor: "city",
2357
2444
  className: "text-xs",
2358
2445
  children: "City"
2359
- }), /* @__PURE__ */ q(C, {
2446
+ }), /* @__PURE__ */ J(C, {
2360
2447
  id: "city",
2361
2448
  type: "text",
2362
2449
  value: a.city || "",
2363
2450
  onChange: (e) => o("city", e.target.value),
2364
2451
  placeholder: "San Francisco",
2365
2452
  disabled: r || i.disabled
2366
- })] }), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2453
+ })] }), /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2367
2454
  htmlFor: "state",
2368
2455
  className: "text-xs",
2369
2456
  children: "State / Province"
2370
- }), /* @__PURE__ */ q(C, {
2457
+ }), /* @__PURE__ */ J(C, {
2371
2458
  id: "state",
2372
2459
  type: "text",
2373
2460
  value: a.state || "",
@@ -2376,24 +2463,24 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2376
2463
  disabled: r || i.disabled
2377
2464
  })] })]
2378
2465
  }),
2379
- /* @__PURE__ */ J("div", {
2466
+ /* @__PURE__ */ Y("div", {
2380
2467
  className: "grid grid-cols-2 gap-3",
2381
- children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2468
+ children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2382
2469
  htmlFor: "zipCode",
2383
2470
  className: "text-xs",
2384
2471
  children: "ZIP / Postal Code"
2385
- }), /* @__PURE__ */ q(C, {
2472
+ }), /* @__PURE__ */ J(C, {
2386
2473
  id: "zipCode",
2387
2474
  type: "text",
2388
2475
  value: a.zipCode || "",
2389
2476
  onChange: (e) => o("zipCode", e.target.value),
2390
2477
  placeholder: "94102",
2391
2478
  disabled: r || i.disabled
2392
- })] }), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2479
+ })] }), /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2393
2480
  htmlFor: "country",
2394
2481
  className: "text-xs",
2395
2482
  children: "Country"
2396
- }), /* @__PURE__ */ q(C, {
2483
+ }), /* @__PURE__ */ J(C, {
2397
2484
  id: "country",
2398
2485
  type: "text",
2399
2486
  value: a.country || "",
@@ -2405,8 +2492,8 @@ function Gn({ value: e, onChange: t, field: n, readonly: r, ...i }) {
2405
2492
  ]
2406
2493
  });
2407
2494
  }
2408
- var Kn = X((() => {})), qn = /* @__PURE__ */ Z({ GeolocationField: () => Jn });
2409
- function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2495
+ var Jn = X((() => {})), Yn = /* @__PURE__ */ Z({ GeolocationField: () => Xn });
2496
+ function Xn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2410
2497
  let [o, s] = e.useState(!1), c = t || {}, l = (e, t) => {
2411
2498
  n({
2412
2499
  ...c,
@@ -2437,15 +2524,15 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2437
2524
  };
2438
2525
  if (i) {
2439
2526
  let e = d(c);
2440
- return /* @__PURE__ */ J("div", {
2527
+ return /* @__PURE__ */ Y("div", {
2441
2528
  className: "flex items-center gap-2",
2442
2529
  children: [
2443
- /* @__PURE__ */ q(U, { className: "w-4 h-4 text-muted-foreground" }),
2444
- e ? /* @__PURE__ */ q("span", {
2530
+ /* @__PURE__ */ J(H, { className: "w-4 h-4 text-muted-foreground" }),
2531
+ e ? /* @__PURE__ */ J("span", {
2445
2532
  className: "text-sm",
2446
2533
  children: e
2447
- }) : /* @__PURE__ */ q(S, {}),
2448
- c.latitude && c.longitude && /* @__PURE__ */ q(h, {
2534
+ }) : /* @__PURE__ */ J(S, {}),
2535
+ c.latitude && c.longitude && /* @__PURE__ */ J(h, {
2449
2536
  type: "button",
2450
2537
  variant: "link",
2451
2538
  size: "sm",
@@ -2456,33 +2543,33 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2456
2543
  ]
2457
2544
  });
2458
2545
  }
2459
- return /* @__PURE__ */ J("div", {
2546
+ return /* @__PURE__ */ Y("div", {
2460
2547
  className: "space-y-3",
2461
2548
  children: [
2462
- /* @__PURE__ */ J("div", {
2549
+ /* @__PURE__ */ Y("div", {
2463
2550
  className: "flex items-center gap-2",
2464
- children: [/* @__PURE__ */ J(h, {
2551
+ children: [/* @__PURE__ */ Y(h, {
2465
2552
  type: "button",
2466
2553
  variant: "outline",
2467
2554
  size: "sm",
2468
2555
  onClick: u,
2469
2556
  disabled: i || o,
2470
- children: [/* @__PURE__ */ q(R, { className: "w-4 h-4 mr-2" }), o ? "Getting location..." : "Use Current Location"]
2471
- }), c.latitude && c.longitude && /* @__PURE__ */ J(h, {
2557
+ children: [/* @__PURE__ */ J(R, { className: "w-4 h-4 mr-2" }), o ? "Getting location..." : "Use Current Location"]
2558
+ }), c.latitude && c.longitude && /* @__PURE__ */ Y(h, {
2472
2559
  type: "button",
2473
2560
  variant: "link",
2474
2561
  size: "sm",
2475
2562
  onClick: f,
2476
- children: [/* @__PURE__ */ q(U, { className: "w-4 h-4 mr-2" }), "View on map"]
2563
+ children: [/* @__PURE__ */ J(H, { className: "w-4 h-4 mr-2" }), "View on map"]
2477
2564
  })]
2478
2565
  }),
2479
- /* @__PURE__ */ J("div", {
2566
+ /* @__PURE__ */ Y("div", {
2480
2567
  className: "grid grid-cols-2 gap-3",
2481
- children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2568
+ children: [/* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2482
2569
  htmlFor: "latitude",
2483
2570
  className: "text-xs",
2484
2571
  children: "Latitude"
2485
- }), /* @__PURE__ */ q(C, {
2572
+ }), /* @__PURE__ */ J(C, {
2486
2573
  id: "latitude",
2487
2574
  type: "number",
2488
2575
  value: c.latitude ?? "",
@@ -2491,11 +2578,11 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2491
2578
  disabled: i || a.disabled,
2492
2579
  step: "any",
2493
2580
  className: a.className
2494
- })] }), /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(w, {
2581
+ })] }), /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J(w, {
2495
2582
  htmlFor: "longitude",
2496
2583
  className: "text-xs",
2497
2584
  children: "Longitude"
2498
- }), /* @__PURE__ */ q(C, {
2585
+ }), /* @__PURE__ */ J(C, {
2499
2586
  id: "longitude",
2500
2587
  type: "number",
2501
2588
  value: c.longitude ?? "",
@@ -2505,7 +2592,7 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2505
2592
  step: "any"
2506
2593
  })] })]
2507
2594
  }),
2508
- c.accuracy && /* @__PURE__ */ J("p", {
2595
+ c.accuracy && /* @__PURE__ */ Y("p", {
2509
2596
  className: "text-xs text-muted-foreground",
2510
2597
  children: [
2511
2598
  "Accuracy: ±",
@@ -2516,8 +2603,8 @@ function Jn({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2516
2603
  ]
2517
2604
  });
2518
2605
  }
2519
- var Yn = X((() => {})), Xn = /* @__PURE__ */ Z({ SignatureField: () => Zn });
2520
- function Zn({ value: t, onChange: n, readonly: r }) {
2606
+ var Zn = X((() => {})), Qn = /* @__PURE__ */ Z({ SignatureField: () => $n });
2607
+ function $n({ value: t, onChange: n, readonly: r }) {
2521
2608
  let i = c(null), [o, s] = e.useState(!1), [l, u] = e.useState(!t);
2522
2609
  a(() => {
2523
2610
  if (t && i.current) {
@@ -2553,22 +2640,22 @@ function Zn({ value: t, onChange: n, readonly: r }) {
2553
2640
  let e = i.current;
2554
2641
  e && n(e.toDataURL("image/png"));
2555
2642
  };
2556
- return r && t ? /* @__PURE__ */ q("div", {
2643
+ return r && t ? /* @__PURE__ */ J("div", {
2557
2644
  className: "border rounded p-2 bg-white",
2558
- children: /* @__PURE__ */ q("img", {
2645
+ children: /* @__PURE__ */ J("img", {
2559
2646
  src: t,
2560
2647
  alt: "Signature",
2561
2648
  loading: "lazy",
2562
2649
  className: "max-w-full h-auto"
2563
2650
  })
2564
- }) : r && !t ? /* @__PURE__ */ q("span", {
2651
+ }) : r && !t ? /* @__PURE__ */ J("span", {
2565
2652
  className: "text-sm text-muted-foreground",
2566
2653
  children: "No signature"
2567
- }) : /* @__PURE__ */ J("div", {
2654
+ }) : /* @__PURE__ */ Y("div", {
2568
2655
  className: "space-y-2",
2569
- children: [/* @__PURE__ */ q("div", {
2656
+ children: [/* @__PURE__ */ J("div", {
2570
2657
  className: "border rounded bg-white",
2571
- children: /* @__PURE__ */ q("canvas", {
2658
+ children: /* @__PURE__ */ J("canvas", {
2572
2659
  ref: i,
2573
2660
  width: 400,
2574
2661
  height: 200,
@@ -2581,12 +2668,12 @@ function Zn({ value: t, onChange: n, readonly: r }) {
2581
2668
  onTouchMove: f,
2582
2669
  onTouchEnd: p
2583
2670
  })
2584
- }), /* @__PURE__ */ J("div", {
2671
+ }), /* @__PURE__ */ Y("div", {
2585
2672
  className: "flex justify-between items-center",
2586
- children: [/* @__PURE__ */ q("p", {
2673
+ children: [/* @__PURE__ */ J("p", {
2587
2674
  className: "text-xs text-muted-foreground",
2588
2675
  children: l ? "Sign above" : "Signature captured"
2589
- }), /* @__PURE__ */ J(h, {
2676
+ }), /* @__PURE__ */ Y(h, {
2590
2677
  type: "button",
2591
2678
  variant: "outline",
2592
2679
  size: "sm",
@@ -2597,67 +2684,67 @@ function Zn({ value: t, onChange: n, readonly: r }) {
2597
2684
  t && (t.clearRect(0, 0, e.width, e.height), u(!0), n(""));
2598
2685
  },
2599
2686
  disabled: r || l,
2600
- children: [/* @__PURE__ */ q(z, { className: "w-4 h-4 mr-2" }), "Clear"]
2687
+ children: [/* @__PURE__ */ J(_e, { className: "w-4 h-4 mr-2" }), "Clear"]
2601
2688
  })]
2602
2689
  })]
2603
2690
  });
2604
2691
  }
2605
- var Qn = X((() => {})), $n = /* @__PURE__ */ Z({ QRCodeField: () => er });
2606
- function er({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2692
+ var er = X((() => {})), tr = /* @__PURE__ */ Z({ QRCodeField: () => nr });
2693
+ function nr({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2607
2694
  let [o, s] = e.useState(!1), c = r || a.schema;
2608
- return i ? /* @__PURE__ */ J("div", {
2695
+ return i ? /* @__PURE__ */ Y("div", {
2609
2696
  className: "flex items-center gap-3",
2610
- children: [/* @__PURE__ */ q("span", {
2697
+ children: [/* @__PURE__ */ J("span", {
2611
2698
  className: "text-sm flex-1 truncate",
2612
- children: t || /* @__PURE__ */ q(S, {})
2613
- }), t && /* @__PURE__ */ J(h, {
2699
+ children: t || /* @__PURE__ */ J(S, {})
2700
+ }), t && /* @__PURE__ */ Y(h, {
2614
2701
  type: "button",
2615
2702
  variant: "outline",
2616
2703
  size: "sm",
2617
2704
  onClick: () => s(!o),
2618
2705
  children: [
2619
- /* @__PURE__ */ q(G, { className: "w-4 h-4 mr-2" }),
2706
+ /* @__PURE__ */ J(G, { className: "w-4 h-4 mr-2" }),
2620
2707
  o ? "Hide" : "Show",
2621
2708
  " QR"
2622
2709
  ]
2623
2710
  })]
2624
- }) : /* @__PURE__ */ J("div", {
2711
+ }) : /* @__PURE__ */ Y("div", {
2625
2712
  className: "space-y-3",
2626
2713
  children: [
2627
- /* @__PURE__ */ J("div", {
2714
+ /* @__PURE__ */ Y("div", {
2628
2715
  className: "flex items-center gap-2",
2629
- children: [/* @__PURE__ */ q(C, {
2716
+ children: [/* @__PURE__ */ J(C, {
2630
2717
  type: "text",
2631
2718
  value: t || "",
2632
2719
  onChange: (e) => n(e.target.value),
2633
2720
  placeholder: c?.placeholder || "Enter text for QR code",
2634
2721
  disabled: i || a.disabled,
2635
2722
  className: a.className
2636
- }), t && /* @__PURE__ */ J(ke, { children: [/* @__PURE__ */ q(h, {
2723
+ }), t && /* @__PURE__ */ Y(Ae, { children: [/* @__PURE__ */ J(h, {
2637
2724
  type: "button",
2638
2725
  variant: "outline",
2639
2726
  size: "sm",
2640
2727
  onClick: () => {
2641
2728
  t && navigator.clipboard.writeText(t);
2642
2729
  },
2643
- children: /* @__PURE__ */ q(L, { className: "w-4 h-4" })
2644
- }), /* @__PURE__ */ q(h, {
2730
+ children: /* @__PURE__ */ J(L, { className: "w-4 h-4" })
2731
+ }), /* @__PURE__ */ J(h, {
2645
2732
  type: "button",
2646
2733
  variant: "outline",
2647
2734
  size: "sm",
2648
2735
  onClick: () => s(!o),
2649
- children: /* @__PURE__ */ q(G, { className: "w-4 h-4" })
2736
+ children: /* @__PURE__ */ J(G, { className: "w-4 h-4" })
2650
2737
  })] })]
2651
2738
  }),
2652
- o && t && /* @__PURE__ */ q("div", {
2739
+ o && t && /* @__PURE__ */ J("div", {
2653
2740
  className: "border rounded p-4 bg-white flex justify-center",
2654
- children: /* @__PURE__ */ q("img", {
2741
+ children: /* @__PURE__ */ J("img", {
2655
2742
  src: ((e) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(e)}`)(t),
2656
2743
  alt: "QR Code",
2657
2744
  className: "w-48 h-48"
2658
2745
  })
2659
2746
  }),
2660
- t && /* @__PURE__ */ J("p", {
2747
+ t && /* @__PURE__ */ Y("p", {
2661
2748
  className: "text-xs text-muted-foreground",
2662
2749
  children: [
2663
2750
  "QR code contains: ",
@@ -2668,11 +2755,11 @@ function er({ value: t, onChange: n, field: r, readonly: i, ...a }) {
2668
2755
  ]
2669
2756
  });
2670
2757
  }
2671
- var tr = X((() => {}));
2758
+ var rr = X((() => {}));
2672
2759
  //#endregion
2673
2760
  //#region src/widgets/MasterDetailField.tsx
2674
- Fe(), Re(), Ve(), qe(), Xe(), $e(), nt(), at(), lt(), ft(), ht(), Ft(), Rt(), Vt(), Wt(), qt(), Xt(), rn(), sn(), un(), pn(), gn(), yn(), Sn(), Tn(), On(), jn(), Pn(), Ln(), Bn(), Un(), Kn(), Yn(), Qn(), tr(), $t();
2675
- function nr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
2761
+ Ie(), ze(), He(), Je(), Ze(), et(), rt(), ot(), ut(), pt(), gt(), Lt(), Bt(), Ut(), Kt(), Yt(), Qt(), on(), ln(), fn(), hn(), vn(), xn(), wn(), Dn(), An(), Nn(), In(), zn(), Hn(), Gn(), Jn(), Zn(), er(), rr(), tn();
2762
+ function ir({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }) {
2676
2763
  let o = e || [], s = n || a.schema, c = () => {
2677
2764
  let e = {
2678
2765
  id: `new-${Date.now()}`,
@@ -2684,24 +2771,24 @@ function nr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
2684
2771
  }, u = (e) => {
2685
2772
  console.log("View detail:", e);
2686
2773
  };
2687
- return r ? /* @__PURE__ */ J("div", {
2774
+ return r ? /* @__PURE__ */ Y("div", {
2688
2775
  className: P("space-y-2", i),
2689
- children: [o.length === 0 ? /* @__PURE__ */ q("span", {
2776
+ children: [o.length === 0 ? /* @__PURE__ */ J("span", {
2690
2777
  className: "text-sm text-muted-foreground",
2691
2778
  children: "No related records"
2692
- }) : o.map((e) => /* @__PURE__ */ J("div", {
2779
+ }) : o.map((e) => /* @__PURE__ */ Y("div", {
2693
2780
  className: "flex items-center justify-between p-2 border rounded hover:bg-muted/50",
2694
- children: [/* @__PURE__ */ q("span", {
2781
+ children: [/* @__PURE__ */ J("span", {
2695
2782
  className: "text-sm",
2696
2783
  children: e.label
2697
- }), /* @__PURE__ */ q(h, {
2784
+ }), /* @__PURE__ */ J(h, {
2698
2785
  type: "button",
2699
2786
  variant: "ghost",
2700
2787
  size: "sm",
2701
2788
  onClick: () => u(e),
2702
- children: /* @__PURE__ */ q(B, { className: "w-4 h-4" })
2789
+ children: /* @__PURE__ */ J(z, { className: "w-4 h-4" })
2703
2790
  })]
2704
- }, e.id)), /* @__PURE__ */ J("p", {
2791
+ }, e.id)), /* @__PURE__ */ Y("p", {
2705
2792
  className: "text-xs text-muted-foreground",
2706
2793
  children: [
2707
2794
  o.length,
@@ -2709,57 +2796,68 @@ function nr({ value: e, onChange: t, field: n, readonly: r, className: i, ...a }
2709
2796
  o.length === 1 ? "record" : "records"
2710
2797
  ]
2711
2798
  })]
2712
- }) : /* @__PURE__ */ J("div", {
2799
+ }) : /* @__PURE__ */ Y("div", {
2713
2800
  className: P("space-y-3", i),
2714
- children: [/* @__PURE__ */ J("div", {
2801
+ children: [/* @__PURE__ */ Y("div", {
2715
2802
  className: "space-y-2",
2716
- children: [o.map((e) => /* @__PURE__ */ J("div", {
2803
+ children: [o.map((e) => /* @__PURE__ */ Y("div", {
2717
2804
  className: "flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",
2718
- children: [/* @__PURE__ */ J("div", {
2805
+ children: [/* @__PURE__ */ Y("div", {
2719
2806
  className: "flex items-center gap-2 flex-1",
2720
- children: [/* @__PURE__ */ q(m, {
2807
+ children: [/* @__PURE__ */ J(m, {
2721
2808
  variant: "outline",
2722
2809
  children: e.id
2723
- }), /* @__PURE__ */ q("span", {
2810
+ }), /* @__PURE__ */ J("span", {
2724
2811
  className: "text-sm flex-1",
2725
2812
  children: e.label
2726
2813
  })]
2727
- }), /* @__PURE__ */ J("div", {
2814
+ }), /* @__PURE__ */ Y("div", {
2728
2815
  className: "flex items-center gap-1",
2729
- children: [/* @__PURE__ */ q(h, {
2816
+ children: [/* @__PURE__ */ J(h, {
2730
2817
  type: "button",
2731
2818
  variant: "ghost",
2732
2819
  size: "sm",
2733
2820
  onClick: () => u(e),
2734
- children: /* @__PURE__ */ q(B, { className: "w-4 h-4" })
2735
- }), /* @__PURE__ */ q(h, {
2821
+ children: /* @__PURE__ */ J(z, { className: "w-4 h-4" })
2822
+ }), /* @__PURE__ */ J(h, {
2736
2823
  type: "button",
2737
2824
  variant: "ghost",
2738
2825
  size: "sm",
2739
2826
  onClick: () => l(e.id),
2740
2827
  disabled: a.disabled,
2741
- children: /* @__PURE__ */ q(Oe, { className: "w-4 h-4" })
2828
+ children: /* @__PURE__ */ J(De, { className: "w-4 h-4" })
2742
2829
  })]
2743
2830
  })]
2744
- }, e.id)), o.length === 0 && /* @__PURE__ */ q("div", {
2831
+ }, e.id)), o.length === 0 && /* @__PURE__ */ J("div", {
2745
2832
  className: "text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20",
2746
2833
  children: "No related records"
2747
2834
  })]
2748
- }), /* @__PURE__ */ J(h, {
2835
+ }), /* @__PURE__ */ Y(h, {
2749
2836
  type: "button",
2750
2837
  variant: "outline",
2751
2838
  className: "w-full",
2752
2839
  onClick: c,
2753
2840
  disabled: a.disabled,
2754
2841
  children: [
2755
- /* @__PURE__ */ q(Se, { className: "w-4 h-4 mr-2" }),
2842
+ /* @__PURE__ */ J(W, { className: "w-4 h-4 mr-2" }),
2756
2843
  "Add ",
2757
2844
  s?.label || "Record"
2758
2845
  ]
2759
2846
  })]
2760
2847
  });
2761
2848
  }
2762
- Ot(), Fe(), Re(), Ve(), qe(), Xe(), Rt(), Vt(), $e(), nt(), at(), lt(), Wt(), qt(), ft(), ht(), Ft(), wt(), Xt(), rn(), sn(), un(), pn(), gn(), yn(), Sn(), Tn(), On(), jn(), Pn(), Ln(), Bn(), Un(), Kn(), Yn(), Qn(), tr();
2849
+ kt(), Ie(), ze(), He(), Je(), Ze(), Bt(), Ut(), et(), rt(), ot(), ut(), Kt(), Yt(), pt(), gt(), Lt(), Tt(), Qt(), on(), ln(), fn(), hn(), vn(), xn(), wn(), Dn(), An(), Nn(), In(), zn(), Hn(), Gn(), Jn(), Zn(), er(), rr();
2850
+ function ar() {
2851
+ try {
2852
+ let { t: e } = ke();
2853
+ return (t, n) => {
2854
+ let r = e(t);
2855
+ return !r || r === t ? n : r;
2856
+ };
2857
+ } catch {
2858
+ return (e, t) => t;
2859
+ }
2860
+ }
2763
2861
  function Q(e) {
2764
2862
  if (e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
2765
2863
  if (e instanceof Date) return e.toISOString();
@@ -2776,7 +2874,7 @@ function Q(e) {
2776
2874
  }
2777
2875
  return String(e);
2778
2876
  }
2779
- function rr(e, t = "USD") {
2877
+ function or(e, t = "USD") {
2780
2878
  try {
2781
2879
  return new Intl.NumberFormat("en-US", {
2782
2880
  style: "currency",
@@ -2786,7 +2884,7 @@ function rr(e, t = "USD") {
2786
2884
  return `${t} ${e.toFixed(2)}`;
2787
2885
  }
2788
2886
  }
2789
- function ir(e, t = "USD") {
2887
+ function sr(e, t = "USD") {
2790
2888
  try {
2791
2889
  return new Intl.NumberFormat("en-US", {
2792
2890
  style: "currency",
@@ -2798,39 +2896,49 @@ function ir(e, t = "USD") {
2798
2896
  return `${t} ${e}`;
2799
2897
  }
2800
2898
  }
2801
- function ar(e, t = 0) {
2899
+ function cr(e, t = 2) {
2900
+ try {
2901
+ return new Intl.NumberFormat("en-US", {
2902
+ minimumFractionDigits: t,
2903
+ maximumFractionDigits: t
2904
+ }).format(e);
2905
+ } catch {
2906
+ return e.toFixed(t);
2907
+ }
2908
+ }
2909
+ function lr(e, t = 0) {
2802
2910
  return `${(e > -1 && e < 1 ? e * 100 : e).toFixed(t)}%`;
2803
2911
  }
2804
- function or(e) {
2912
+ function ur(e) {
2805
2913
  return e.replace(/[_-]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
2806
2914
  }
2807
- function sr(e) {
2808
- if (!e) return "—";
2809
- let t = typeof e == "string" ? new Date(e) : e;
2810
- if (isNaN(t.getTime())) return "—";
2915
+ function dr(e) {
2916
+ if (e == null || e === "") return "—";
2917
+ let t = e instanceof Date ? e : new Date(e);
2918
+ if (!(t instanceof Date) || isNaN(t.getTime())) return "—";
2811
2919
  let n = /* @__PURE__ */ new Date(), r = new Date(n.getFullYear(), n.getMonth(), n.getDate()), i = new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() - r.getTime(), a = Math.round(i / (1e3 * 60 * 60 * 24));
2812
2920
  if (a === 0) return "Today";
2813
2921
  if (a === 1) return "Tomorrow";
2814
2922
  if (a === -1) return "Yesterday";
2815
2923
  if (a < -1) {
2816
2924
  let e = Math.abs(a);
2817
- return e <= 7 ? `Overdue ${e}d` : cr(t);
2925
+ return e <= 7 ? `Overdue ${e}d` : fr(t);
2818
2926
  }
2819
- return a > 1 && a <= 7 ? `In ${a} days` : cr(t);
2927
+ return a > 1 && a <= 7 ? `In ${a} days` : fr(t);
2820
2928
  }
2821
- function cr(e, t) {
2822
- if (!e) return "—";
2823
- let n = typeof e == "string" ? new Date(e) : e;
2824
- return isNaN(n.getTime()) ? "—" : t === "short" ? `${n.toLocaleDateString("en-US", { month: "short" })} ${n.getDate()}, '${String(n.getFullYear()).slice(-2)}` : t === "relative" ? sr(n) : n.toLocaleDateString(void 0, {
2929
+ function fr(e, t) {
2930
+ if (e == null || e === "") return "—";
2931
+ let n = e instanceof Date ? e : new Date(e);
2932
+ return !(n instanceof Date) || isNaN(n.getTime()) ? "—" : t === "short" ? `${n.toLocaleDateString("en-US", { month: "short" })} ${n.getDate()}, '${String(n.getFullYear()).slice(-2)}` : t === "relative" ? dr(n) : n.toLocaleDateString(void 0, {
2825
2933
  year: "numeric",
2826
2934
  month: "short",
2827
2935
  day: "numeric"
2828
2936
  });
2829
2937
  }
2830
- function lr(e) {
2831
- if (!e) return "—";
2832
- let t = typeof e == "string" ? new Date(e) : e;
2833
- return isNaN(t.getTime()) ? "—" : t.toLocaleDateString(void 0, {
2938
+ function pr(e) {
2939
+ if (e == null || e === "") return "—";
2940
+ let t = e instanceof Date ? e : new Date(e);
2941
+ return !(t instanceof Date) || isNaN(t.getTime()) ? "—" : t.toLocaleDateString(void 0, {
2834
2942
  year: "numeric",
2835
2943
  month: "short",
2836
2944
  day: "numeric",
@@ -2838,17 +2946,17 @@ function lr(e) {
2838
2946
  minute: "2-digit"
2839
2947
  });
2840
2948
  }
2841
- function ur({ value: e }) {
2949
+ function mr({ value: e }) {
2842
2950
  let t = Q(e);
2843
- return t == null || t === "" ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
2951
+ return t == null || t === "" ? /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ J("span", {
2844
2952
  className: "truncate",
2845
2953
  children: String(t)
2846
2954
  });
2847
2955
  }
2848
- function dr({ value: e, field: t }) {
2849
- if (e == null) return /* @__PURE__ */ q(S, {});
2956
+ function hr({ value: e, field: t }) {
2957
+ if (e == null) return /* @__PURE__ */ J(S, {});
2850
2958
  let n = Q(e), r = t.precision ?? 0, i = Number(n);
2851
- return /* @__PURE__ */ q("span", {
2959
+ return /* @__PURE__ */ J("span", {
2852
2960
  className: "tabular-nums",
2853
2961
  children: isNaN(i) ? String(n) : new Intl.NumberFormat("en-US", {
2854
2962
  minimumFractionDigits: r,
@@ -2856,42 +2964,42 @@ function dr({ value: e, field: t }) {
2856
2964
  }).format(i)
2857
2965
  });
2858
2966
  }
2859
- function fr({ value: e, field: t }) {
2860
- if (e == null) return /* @__PURE__ */ q(S, {});
2861
- let n = Q(e), r = t.currency || "USD", i = Number(n);
2862
- return /* @__PURE__ */ q("span", {
2967
+ function gr({ value: e, field: t }) {
2968
+ if (e == null) return /* @__PURE__ */ J(S, {});
2969
+ let n = Q(e), r = t, i = r.currency || r.defaultCurrency, a = Number(n), o = r.precision ?? r.scale ?? r.decimals ?? 2;
2970
+ return /* @__PURE__ */ J("span", {
2863
2971
  className: "tabular-nums font-medium whitespace-nowrap",
2864
- children: isNaN(i) ? String(n) : rr(i, r)
2972
+ children: isNaN(a) ? String(n) : i ? or(a, i) : cr(a, o)
2865
2973
  });
2866
2974
  }
2867
- var pr = /progress|completion/;
2868
- function mr({ value: e, field: t }) {
2869
- if (e == null) return /* @__PURE__ */ q(S, {});
2975
+ var _r = /progress|completion/;
2976
+ function vr({ value: e, field: t }) {
2977
+ if (e == null) return /* @__PURE__ */ J(S, {});
2870
2978
  let n = Q(e), r = t.precision ?? 0, i = Number(n);
2871
- if (isNaN(i)) return /* @__PURE__ */ q("span", {
2979
+ if (isNaN(i)) return /* @__PURE__ */ J("span", {
2872
2980
  className: "tabular-nums whitespace-nowrap",
2873
2981
  children: String(n)
2874
2982
  });
2875
- let a = pr.test(t?.name?.toLowerCase() || ""), o = a ? i : i > -1 && i < 1 ? i * 100 : i, s = a ? `${i.toFixed(r)}%` : ar(i, r), c = Math.max(0, Math.min(100, o));
2876
- return /* @__PURE__ */ J("div", {
2983
+ let a = _r.test(t?.name?.toLowerCase() || ""), o = a ? i : i > -1 && i < 1 ? i * 100 : i, s = a ? `${i.toFixed(r)}%` : lr(i, r), c = Math.max(0, Math.min(100, o));
2984
+ return /* @__PURE__ */ Y("div", {
2877
2985
  className: "flex items-center gap-2",
2878
- children: [/* @__PURE__ */ q("div", {
2986
+ children: [/* @__PURE__ */ J("div", {
2879
2987
  className: "h-1.5 w-16 rounded-full bg-muted overflow-hidden shrink-0",
2880
2988
  role: "progressbar",
2881
2989
  "aria-valuenow": c,
2882
2990
  "aria-valuemin": 0,
2883
2991
  "aria-valuemax": 100,
2884
- children: /* @__PURE__ */ q("div", {
2992
+ children: /* @__PURE__ */ J("div", {
2885
2993
  className: "h-full rounded-full bg-primary transition-all",
2886
2994
  style: { width: `${c}%` }
2887
2995
  })
2888
- }), /* @__PURE__ */ q("span", {
2996
+ }), /* @__PURE__ */ J("span", {
2889
2997
  className: "tabular-nums whitespace-nowrap",
2890
2998
  children: s
2891
2999
  })]
2892
3000
  });
2893
3001
  }
2894
- var hr = new Set([
3002
+ var yr = new Set([
2895
3003
  "active",
2896
3004
  "is_active",
2897
3005
  "enabled",
@@ -2899,55 +3007,55 @@ var hr = new Set([
2899
3007
  "verified",
2900
3008
  "is_verified"
2901
3009
  ]);
2902
- function gr({ value: e, field: t }) {
2903
- if (e == null) return /* @__PURE__ */ q("span", {
3010
+ function br({ value: e, field: t }) {
3011
+ if (e == null) return /* @__PURE__ */ J("span", {
2904
3012
  className: "flex items-center justify-center",
2905
- children: /* @__PURE__ */ q(S, {})
3013
+ children: /* @__PURE__ */ J(S, {})
2906
3014
  });
2907
3015
  let n = t?.name?.toLowerCase() || "";
2908
- return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */ q("div", {
3016
+ return n === "completed" || n === "is_completed" || n === "done" || n === "is_done" ? /* @__PURE__ */ J("div", {
2909
3017
  className: "flex items-center justify-center",
2910
- children: e ? /* @__PURE__ */ q("div", {
3018
+ children: e ? /* @__PURE__ */ J("div", {
2911
3019
  className: "size-5 rounded-full bg-green-500 flex items-center justify-center",
2912
3020
  role: "img",
2913
3021
  "aria-label": "Completed",
2914
3022
  "data-testid": "completion-indicator",
2915
- children: /* @__PURE__ */ q(I, { className: "size-3 text-white" })
2916
- }) : /* @__PURE__ */ q("div", {
3023
+ children: /* @__PURE__ */ J(I, { className: "size-3 text-white" })
3024
+ }) : /* @__PURE__ */ J("div", {
2917
3025
  className: "size-5 rounded-full border-2 border-muted-foreground/30",
2918
3026
  role: "img",
2919
3027
  "aria-label": "Not completed",
2920
3028
  "data-testid": "completion-indicator"
2921
3029
  })
2922
- }) : hr.has(n) && !e ? /* @__PURE__ */ J(m, {
3030
+ }) : yr.has(n) && !e ? /* @__PURE__ */ Y(m, {
2923
3031
  variant: "destructive",
2924
3032
  className: "text-xs",
2925
3033
  "data-testid": "boolean-warning-badge",
2926
- children: [t?.label || or(n), " — Off"]
2927
- }) : /* @__PURE__ */ q("div", {
2928
- className: "flex items-center justify-center",
2929
- children: /* @__PURE__ */ q(g, {
3034
+ children: [t?.label || ur(n), " — Off"]
3035
+ }) : /* @__PURE__ */ J("div", {
3036
+ className: "flex items-center justify-start",
3037
+ children: /* @__PURE__ */ J(g, {
2930
3038
  checked: !!e,
2931
3039
  disabled: !0,
2932
3040
  className: "pointer-events-none"
2933
3041
  })
2934
3042
  });
2935
3043
  }
2936
- function _r({ value: e, field: t }) {
2937
- if (!e) return /* @__PURE__ */ q(S, {});
2938
- let n = Q(e), r = t, i = cr(n, r.format || "relative"), a = typeof n == "string" ? new Date(n) : n, o = a instanceof Date && !isNaN(a.getTime()), s = /* @__PURE__ */ new Date();
3044
+ function xr({ value: e, field: t }) {
3045
+ if (!e) return /* @__PURE__ */ J(S, {});
3046
+ let n = Q(e), r = t, i = fr(n, r.format || "relative"), a = n == null ? null : new Date(n), o = a !== null && !isNaN(a.getTime()), s = /* @__PURE__ */ new Date();
2939
3047
  s.setHours(0, 0, 0, 0);
2940
3048
  let c = String(r?.name || r?.accessorKey || r?.key || "").toLowerCase(), l = (r?.dueLike === !0 || /(^|_)(due|deadline|expires?|expiry|expiration|expected_close|target_close|sla|return_by|renewal|next_action)(_|$)/.test(c)) && o && a < s, u = o ? a.toISOString() : String(n);
2941
- return /* @__PURE__ */ q("span", {
3049
+ return /* @__PURE__ */ J("span", {
2942
3050
  className: `tabular-nums${l ? " text-red-600" : ""}`,
2943
3051
  title: u,
2944
3052
  children: i
2945
3053
  });
2946
3054
  }
2947
- function vr({ value: e }) {
2948
- if (!e) return /* @__PURE__ */ q(S, {});
2949
- let t = Q(e), n = typeof t == "string" ? new Date(t) : t;
2950
- if (!(n instanceof Date) || isNaN(n.getTime())) return /* @__PURE__ */ q(S, {});
3055
+ function Sr({ value: e }) {
3056
+ if (!e) return /* @__PURE__ */ J(S, {});
3057
+ let t = Q(e), n = t == null ? null : new Date(t);
3058
+ if (n === null || isNaN(n.getTime())) return /* @__PURE__ */ J(S, {});
2951
3059
  let r = n.toLocaleDateString(void 0, {
2952
3060
  month: "numeric",
2953
3061
  day: "numeric",
@@ -2957,15 +3065,15 @@ function vr({ value: e }) {
2957
3065
  minute: "2-digit",
2958
3066
  hour12: !0
2959
3067
  }).toLowerCase();
2960
- return /* @__PURE__ */ J("span", {
3068
+ return /* @__PURE__ */ Y("span", {
2961
3069
  className: "tabular-nums text-sm whitespace-nowrap",
2962
- children: [/* @__PURE__ */ q("span", { children: r }), /* @__PURE__ */ q("span", {
3070
+ children: [/* @__PURE__ */ J("span", { children: r }), /* @__PURE__ */ J("span", {
2963
3071
  className: "ml-2 text-muted-foreground",
2964
3072
  children: i
2965
3073
  })]
2966
3074
  });
2967
3075
  }
2968
- var yr = {
3076
+ var Cr = {
2969
3077
  critical: "red",
2970
3078
  urgent: "red",
2971
3079
  high: "orange",
@@ -2996,8 +3104,51 @@ var yr = {
2996
3104
  failed: "red",
2997
3105
  overdue: "red",
2998
3106
  delivered: "purple",
2999
- archived: "indigo"
3000
- }, br = {
3107
+ archived: "indigo",
3108
+ contacted: "blue",
3109
+ qualified: "purple",
3110
+ converted: "green",
3111
+ won: "green",
3112
+ lost: "red",
3113
+ 紧急: "red",
3114
+ 严重: "red",
3115
+ 高: "orange",
3116
+ 中: "yellow",
3117
+ 普通: "blue",
3118
+ 低: "gray",
3119
+ 无: "gray",
3120
+ 新建: "gray",
3121
+ 草稿: "gray",
3122
+ 待处理: "yellow",
3123
+ 待审核: "yellow",
3124
+ 待联系: "yellow",
3125
+ 挂起: "yellow",
3126
+ 进行中: "blue",
3127
+ 处理中: "blue",
3128
+ 已联系: "blue",
3129
+ 跟进中: "blue",
3130
+ 已发货: "blue",
3131
+ 打开: "blue",
3132
+ 已确认: "green",
3133
+ 已审核: "green",
3134
+ 已通过: "green",
3135
+ 已完成: "green",
3136
+ 已支付: "green",
3137
+ 已签收: "green",
3138
+ 已转化: "green",
3139
+ 成单: "green",
3140
+ 赢得: "green",
3141
+ 已签约: "green",
3142
+ 已交付: "purple",
3143
+ 已归档: "indigo",
3144
+ 已关闭: "gray",
3145
+ 已取消: "red",
3146
+ 已拒绝: "red",
3147
+ 失败: "red",
3148
+ 逾期: "red",
3149
+ 流失: "red",
3150
+ 丢失: "red"
3151
+ }, wr = {
3001
3152
  gray: "bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-800/50 dark:text-gray-200 dark:border-gray-700/60",
3002
3153
  red: "bg-red-50 text-red-700 border-red-200 dark:bg-red-950/40 dark:text-red-300 dark:border-red-900/60",
3003
3154
  orange: "bg-orange-50 text-orange-700 border-orange-200 dark:bg-orange-950/40 dark:text-orange-300 dark:border-orange-900/60",
@@ -3007,7 +3158,7 @@ var yr = {
3007
3158
  indigo: "bg-indigo-50 text-indigo-700 border-indigo-200 dark:bg-indigo-950/40 dark:text-indigo-300 dark:border-indigo-900/60",
3008
3159
  purple: "bg-purple-50 text-purple-700 border-purple-200 dark:bg-purple-950/40 dark:text-purple-300 dark:border-purple-900/60",
3009
3160
  pink: "bg-pink-50 text-pink-700 border-pink-200 dark:bg-pink-950/40 dark:text-pink-300 dark:border-pink-900/60"
3010
- }, xr = [
3161
+ }, Tr = [
3011
3162
  "blue",
3012
3163
  "green",
3013
3164
  "purple",
@@ -3017,73 +3168,79 @@ var yr = {
3017
3168
  "yellow",
3018
3169
  "red"
3019
3170
  ];
3020
- function Sr(e) {
3171
+ function Er(e) {
3021
3172
  let t = 5381;
3022
3173
  for (let n = 0; n < e.length; n++) t = (t << 5) + t ^ e.charCodeAt(n);
3023
- return xr[Math.abs(t) % xr.length];
3174
+ return Tr[Math.abs(t) % Tr.length];
3024
3175
  }
3025
- function Cr(e, t) {
3026
- if (e && br[e]) return br[e];
3176
+ function Dr(e, t) {
3177
+ if (e && wr[e]) return wr[e];
3027
3178
  if (t == null || t === "") return "bg-muted text-muted-foreground border-border";
3028
- let n = String(t).toLowerCase().replace(/[\s-]/g, "_"), r = yr[n];
3029
- return r && br[r] ? br[r] : br[Sr(n)];
3179
+ let n = String(t).toLowerCase().replace(/[\s-]/g, "_"), r = Cr[n];
3180
+ return r && wr[r] ? wr[r] : wr[Er(n)];
3030
3181
  }
3031
- function wr({ value: e, field: t }) {
3182
+ function Or({ value: e, field: t }) {
3032
3183
  let n = t.options || [];
3033
- if (e == null || e === "") return /* @__PURE__ */ q(S, {});
3034
- if (Array.isArray(e)) return /* @__PURE__ */ q("div", {
3184
+ if (e == null || e === "") return /* @__PURE__ */ J(S, {});
3185
+ let r = (e) => {
3186
+ let t = n.find((t) => t.value === e);
3187
+ if (t) return t;
3188
+ let r = String(e).toLowerCase();
3189
+ return n.find((e) => String(e.value).toLowerCase() === r);
3190
+ };
3191
+ if (Array.isArray(e)) return /* @__PURE__ */ J("div", {
3035
3192
  className: "flex flex-wrap gap-1",
3036
3193
  children: e.map((e, t) => {
3037
- let r = n.find((t) => t.value === e), i = r?.label || or(String(e));
3038
- return /* @__PURE__ */ q(m, {
3194
+ let n = r(e), i = n?.label || ur(String(e));
3195
+ return /* @__PURE__ */ J(m, {
3039
3196
  variant: "outline",
3040
- className: Cr(r?.color, e),
3197
+ className: Dr(n?.color, e),
3041
3198
  children: i
3042
3199
  }, t);
3043
3200
  })
3044
3201
  });
3045
- let r = n.find((t) => t.value === e), i = r?.label || or(String(e));
3046
- return /* @__PURE__ */ q(m, {
3202
+ let i = r(e), a = i?.label || ur(String(e));
3203
+ return /* @__PURE__ */ J(m, {
3047
3204
  variant: "outline",
3048
- className: Cr(r?.color, e),
3049
- children: i
3205
+ className: Dr(i?.color, e),
3206
+ children: a
3050
3207
  });
3051
3208
  }
3052
- function Tr({ value: t }) {
3053
- if (!t) return /* @__PURE__ */ q(S, {});
3054
- let n = String(Q(t) ?? ""), [r, i] = e.useState(!1);
3055
- return /* @__PURE__ */ J("span", {
3209
+ function kr({ value: t }) {
3210
+ if (!t) return /* @__PURE__ */ J(S, {});
3211
+ let n = ar(), r = String(Q(t) ?? ""), [i, a] = e.useState(!1);
3212
+ return /* @__PURE__ */ Y("span", {
3056
3213
  className: "inline-flex items-center gap-1 group/email",
3057
- children: [/* @__PURE__ */ q(h, {
3214
+ children: [/* @__PURE__ */ J(h, {
3058
3215
  variant: "link",
3059
3216
  className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
3060
3217
  asChild: !0,
3061
- children: /* @__PURE__ */ q("a", {
3062
- href: `mailto:${n}`,
3218
+ children: /* @__PURE__ */ J("a", {
3219
+ href: `mailto:${r}`,
3063
3220
  onClick: (e) => e.stopPropagation(),
3064
- children: n
3221
+ children: r
3065
3222
  })
3066
- }), /* @__PURE__ */ q("button", {
3223
+ }), /* @__PURE__ */ J("button", {
3067
3224
  type: "button",
3068
3225
  className: "opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
3069
3226
  onClick: (e) => {
3070
- e.stopPropagation(), e.preventDefault(), navigator.clipboard.writeText(n).then(() => {
3071
- i(!0), setTimeout(() => i(!1), 2e3);
3227
+ e.stopPropagation(), e.preventDefault(), navigator.clipboard.writeText(r).then(() => {
3228
+ a(!0), setTimeout(() => a(!1), 2e3);
3072
3229
  }).catch(() => {});
3073
3230
  },
3074
- "aria-label": "Copy email",
3075
- children: r ? /* @__PURE__ */ q(I, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ q(L, { className: "h-3 w-3 text-muted-foreground" })
3231
+ "aria-label": n("detail.copyEmail", "Copy email"),
3232
+ children: i ? /* @__PURE__ */ J(I, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ J(L, { className: "h-3 w-3 text-muted-foreground" })
3076
3233
  })]
3077
3234
  });
3078
3235
  }
3079
- function Er({ value: e }) {
3080
- if (!e) return /* @__PURE__ */ q(S, {});
3236
+ function Ar({ value: e }) {
3237
+ if (!e) return /* @__PURE__ */ J(S, {});
3081
3238
  let t = String(Q(e) ?? "");
3082
- return /* @__PURE__ */ q(h, {
3239
+ return /* @__PURE__ */ J(h, {
3083
3240
  variant: "link",
3084
3241
  className: "p-0 h-auto font-normal text-blue-600 hover:text-blue-800",
3085
3242
  asChild: !0,
3086
- children: /* @__PURE__ */ q("a", {
3243
+ children: /* @__PURE__ */ J("a", {
3087
3244
  href: t,
3088
3245
  target: "_blank",
3089
3246
  rel: "noopener noreferrer",
@@ -3092,34 +3249,34 @@ function Er({ value: e }) {
3092
3249
  })
3093
3250
  });
3094
3251
  }
3095
- function Dr({ value: t }) {
3096
- if (!t) return /* @__PURE__ */ q(S, {});
3097
- let n = String(Q(t) ?? ""), [r, i] = e.useState(!1);
3098
- return /* @__PURE__ */ J("span", {
3252
+ function jr({ value: t }) {
3253
+ if (!t) return /* @__PURE__ */ J(S, {});
3254
+ let n = ar(), r = String(Q(t) ?? ""), [i, a] = e.useState(!1);
3255
+ return /* @__PURE__ */ Y("span", {
3099
3256
  className: "inline-flex items-center gap-1 group/phone",
3100
- children: [/* @__PURE__ */ J("a", {
3101
- href: `tel:${n}`,
3257
+ children: [/* @__PURE__ */ Y("a", {
3258
+ href: `tel:${r}`,
3102
3259
  className: "inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",
3103
3260
  onClick: (e) => e.stopPropagation(),
3104
- children: [/* @__PURE__ */ q(xe, { className: "h-3 w-3" }), n]
3105
- }), /* @__PURE__ */ q("button", {
3261
+ children: [/* @__PURE__ */ J(Se, { className: "h-3 w-3" }), r]
3262
+ }), /* @__PURE__ */ J("button", {
3106
3263
  type: "button",
3107
3264
  className: "opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",
3108
3265
  onClick: (e) => {
3109
- e.stopPropagation(), e.preventDefault(), navigator.clipboard.writeText(n).then(() => {
3110
- i(!0), setTimeout(() => i(!1), 2e3);
3266
+ e.stopPropagation(), e.preventDefault(), navigator.clipboard.writeText(r).then(() => {
3267
+ a(!0), setTimeout(() => a(!1), 2e3);
3111
3268
  }).catch(() => {});
3112
3269
  },
3113
- "aria-label": "Copy phone number",
3114
- children: r ? /* @__PURE__ */ q(I, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ q(L, { className: "h-3 w-3 text-muted-foreground" })
3270
+ "aria-label": n("detail.copyPhone", "Copy phone number"),
3271
+ children: i ? /* @__PURE__ */ J(I, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ J(L, { className: "h-3 w-3 text-muted-foreground" })
3115
3272
  })]
3116
3273
  });
3117
3274
  }
3118
- function Or({ value: e, field: t }) {
3119
- if (!e) return /* @__PURE__ */ q(S, {});
3275
+ function Mr({ value: e, field: t }) {
3276
+ if (!e) return /* @__PURE__ */ J(S, {});
3120
3277
  if (t.multiple, Array.isArray(e)) {
3121
3278
  let t = e.length;
3122
- return /* @__PURE__ */ J("span", {
3279
+ return /* @__PURE__ */ Y("span", {
3123
3280
  className: "text-sm text-gray-600",
3124
3281
  children: [
3125
3282
  t,
@@ -3128,30 +3285,30 @@ function Or({ value: e, field: t }) {
3128
3285
  ]
3129
3286
  });
3130
3287
  }
3131
- return /* @__PURE__ */ q("span", {
3288
+ return /* @__PURE__ */ J("span", {
3132
3289
  className: "text-sm truncate",
3133
3290
  children: e.name || e.original_name || "File"
3134
3291
  });
3135
3292
  }
3136
- function kr({ value: e }) {
3137
- return e ? Array.isArray(e) ? /* @__PURE__ */ J("div", {
3293
+ function Nr({ value: e }) {
3294
+ return e ? Array.isArray(e) ? /* @__PURE__ */ Y("div", {
3138
3295
  className: "flex -space-x-2",
3139
- children: [e.slice(0, 3).map((e, t) => /* @__PURE__ */ q("img", {
3296
+ children: [e.slice(0, 3).map((e, t) => /* @__PURE__ */ J("img", {
3140
3297
  src: e.url || "",
3141
3298
  alt: e.name || `Image ${t + 1}`,
3142
3299
  className: "size-8 rounded-md border-2 border-white object-cover"
3143
- }, t)), e.length > 3 && /* @__PURE__ */ J("div", {
3300
+ }, t)), e.length > 3 && /* @__PURE__ */ Y("div", {
3144
3301
  className: "size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",
3145
3302
  children: ["+", e.length - 3]
3146
3303
  })]
3147
- }) : /* @__PURE__ */ q("img", {
3304
+ }) : /* @__PURE__ */ J("img", {
3148
3305
  src: e.url || "",
3149
3306
  alt: e.name || "Image",
3150
3307
  className: "size-10 rounded-md object-cover"
3151
- }) : /* @__PURE__ */ q(S, {});
3308
+ }) : /* @__PURE__ */ J(S, {});
3152
3309
  }
3153
- function Ar({ value: e, field: t }) {
3154
- if (e == null || e === "") return /* @__PURE__ */ q(S, {});
3310
+ function Pr({ value: e, field: t }) {
3311
+ if (e == null || e === "") return /* @__PURE__ */ J(S, {});
3155
3312
  let n = t.options || [], r = (e) => {
3156
3313
  if (n.length > 0) {
3157
3314
  let t = n.find((t) => String(t.value) === String(e));
@@ -3159,124 +3316,149 @@ function Ar({ value: e, field: t }) {
3159
3316
  }
3160
3317
  return String(e);
3161
3318
  };
3162
- return Array.isArray(e) ? /* @__PURE__ */ q("div", {
3319
+ return Array.isArray(e) ? /* @__PURE__ */ J("div", {
3163
3320
  className: "flex flex-wrap gap-1",
3164
3321
  children: e.map((e, t) => {
3165
3322
  let n;
3166
- return n = typeof e == "object" && e ? e.name || e.label || e.id || e._id || String(e) : r(e), /* @__PURE__ */ q("span", {
3323
+ return n = typeof e == "object" && e ? e.name || e.label || e.id || e._id || String(e) : r(e), /* @__PURE__ */ J("span", {
3167
3324
  className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-50 text-gray-700 dark:bg-gray-800/50 dark:text-gray-200",
3168
3325
  children: n
3169
3326
  }, t);
3170
3327
  })
3171
- }) : typeof e == "object" && e ? /* @__PURE__ */ q("span", {
3328
+ }) : typeof e == "object" && e ? /* @__PURE__ */ J("span", {
3172
3329
  className: "truncate",
3173
3330
  children: e.name || e.label || e.id || e._id || "[Object]"
3174
- }) : /* @__PURE__ */ q("span", {
3331
+ }) : /* @__PURE__ */ J("span", {
3175
3332
  className: "truncate",
3176
3333
  children: r(e)
3177
3334
  });
3178
3335
  }
3179
- function jr({ value: e }) {
3336
+ function Fr({ value: e }) {
3180
3337
  let t = Q(e);
3181
- return t == null || t === "" ? /* @__PURE__ */ q(S, {}) : /* @__PURE__ */ q("span", {
3338
+ return t == null || t === "" ? /* @__PURE__ */ J(S, {}) : /* @__PURE__ */ J("span", {
3182
3339
  className: "text-gray-700 font-mono text-sm",
3183
3340
  children: String(t)
3184
3341
  });
3185
3342
  }
3186
- function Mr({ value: e }) {
3187
- if (!e) return /* @__PURE__ */ q(S, {});
3188
- if (typeof e != "object") return /* @__PURE__ */ q("span", {
3343
+ function Ir({ value: e }) {
3344
+ if (!e) return /* @__PURE__ */ J(S, {});
3345
+ if (typeof e != "object") return /* @__PURE__ */ J("span", {
3189
3346
  className: "truncate",
3190
3347
  children: String(e)
3191
3348
  });
3192
- if (Array.isArray(e)) return /* @__PURE__ */ J("div", {
3349
+ if (Array.isArray(e)) return /* @__PURE__ */ Y("div", {
3193
3350
  className: "flex -space-x-2",
3194
3351
  children: [e.slice(0, 3).map((e, t) => {
3195
- if (typeof e != "object" || !e) return /* @__PURE__ */ q("span", {
3352
+ if (typeof e != "object" || !e) return /* @__PURE__ */ J("span", {
3196
3353
  className: "truncate text-sm",
3197
3354
  children: String(e)
3198
3355
  }, t);
3199
3356
  let n = e.name || e.username || "User";
3200
- return /* @__PURE__ */ q(d, {
3357
+ return /* @__PURE__ */ J(d, {
3201
3358
  className: "size-8 border-2 border-white",
3202
3359
  title: n,
3203
- children: /* @__PURE__ */ q(f, {
3360
+ children: /* @__PURE__ */ J(f, {
3204
3361
  className: "bg-blue-500 text-white text-xs",
3205
3362
  children: n.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
3206
3363
  })
3207
3364
  }, t);
3208
- }), e.length > 3 && /* @__PURE__ */ q(d, {
3365
+ }), e.length > 3 && /* @__PURE__ */ J(d, {
3209
3366
  className: "size-8 border-2 border-white",
3210
- children: /* @__PURE__ */ J(f, {
3367
+ children: /* @__PURE__ */ Y(f, {
3211
3368
  className: "bg-gray-200 text-gray-600 text-xs",
3212
3369
  children: ["+", e.length - 3]
3213
3370
  })
3214
3371
  })]
3215
3372
  });
3216
3373
  let t = e.name || e.username || "User";
3217
- return /* @__PURE__ */ J("div", {
3374
+ return /* @__PURE__ */ Y("div", {
3218
3375
  className: "flex items-center gap-2",
3219
- children: [/* @__PURE__ */ q(d, {
3376
+ children: [/* @__PURE__ */ J(d, {
3220
3377
  className: "size-8",
3221
- children: /* @__PURE__ */ q(f, {
3378
+ children: /* @__PURE__ */ J(f, {
3222
3379
  className: "bg-blue-500 text-white text-xs",
3223
3380
  children: t.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2)
3224
3381
  })
3225
- }), /* @__PURE__ */ q("span", {
3382
+ }), /* @__PURE__ */ J("span", {
3226
3383
  className: "truncate",
3227
3384
  children: t
3228
3385
  })]
3229
3386
  });
3230
3387
  }
3231
- var Nr = /* @__PURE__ */ new Map();
3232
- function Pr(e, t) {
3233
- Nr.set(e, t);
3234
- }
3235
- function Fr(e) {
3236
- return Nr.has(e) ? Nr.get(e) : {
3237
- text: ur,
3238
- textarea: ur,
3239
- markdown: ur,
3240
- html: ur,
3241
- number: dr,
3242
- currency: fr,
3243
- percent: mr,
3244
- boolean: gr,
3245
- date: _r,
3246
- datetime: vr,
3247
- time: ur,
3248
- select: wr,
3249
- status: wr,
3250
- lookup: Ar,
3251
- master_detail: Ar,
3252
- email: Tr,
3253
- url: Er,
3254
- phone: Dr,
3255
- file: Or,
3256
- image: kr,
3257
- formula: jr,
3258
- summary: jr,
3259
- auto_number: ur,
3260
- user: Mr,
3261
- owner: Mr,
3262
- password: () => /* @__PURE__ */ q("span", { children: "••••••" }),
3263
- location: ur,
3264
- object: () => /* @__PURE__ */ q("span", {
3388
+ var Lr = /* @__PURE__ */ new Map();
3389
+ function Rr(e, t) {
3390
+ Lr.set(e, t);
3391
+ }
3392
+ var zr = {
3393
+ phone: "phone",
3394
+ tel: "phone",
3395
+ telephone: "phone",
3396
+ email: "email",
3397
+ url: "url",
3398
+ uri: "url",
3399
+ link: "url",
3400
+ currency: "currency",
3401
+ money: "currency",
3402
+ percent: "percent",
3403
+ percentage: "percent"
3404
+ }, Br = new Set([
3405
+ "text",
3406
+ "textarea",
3407
+ "string",
3408
+ "longtext",
3409
+ ""
3410
+ ]);
3411
+ function Vr(e) {
3412
+ if (!e) return "text";
3413
+ if (typeof e == "string") return e;
3414
+ let t = (e.type || "").toLowerCase(), n = e.format, r = typeof n == "string" ? n.toLowerCase() : "";
3415
+ return r && zr[r] && Br.has(t) ? zr[r] : e.type || "text";
3416
+ }
3417
+ function Hr(e) {
3418
+ return Lr.has(e) ? Lr.get(e) : {
3419
+ text: mr,
3420
+ textarea: mr,
3421
+ markdown: mr,
3422
+ html: mr,
3423
+ number: hr,
3424
+ currency: gr,
3425
+ percent: vr,
3426
+ boolean: br,
3427
+ date: xr,
3428
+ datetime: Sr,
3429
+ time: mr,
3430
+ select: Or,
3431
+ status: Or,
3432
+ lookup: Pr,
3433
+ master_detail: Pr,
3434
+ email: kr,
3435
+ url: Ar,
3436
+ phone: jr,
3437
+ file: Mr,
3438
+ image: Nr,
3439
+ formula: Fr,
3440
+ summary: Fr,
3441
+ auto_number: mr,
3442
+ user: Ir,
3443
+ owner: Ir,
3444
+ password: () => /* @__PURE__ */ J("span", { children: "••••••" }),
3445
+ location: mr,
3446
+ object: () => /* @__PURE__ */ J("span", {
3265
3447
  className: "text-gray-500 italic",
3266
3448
  children: "[Object]"
3267
3449
  }),
3268
- vector: () => /* @__PURE__ */ q("span", {
3450
+ vector: () => /* @__PURE__ */ J("span", {
3269
3451
  className: "text-gray-500 italic",
3270
3452
  children: "[Vector]"
3271
3453
  }),
3272
- grid: () => /* @__PURE__ */ q("span", {
3454
+ grid: () => /* @__PURE__ */ J("span", {
3273
3455
  className: "text-gray-500 italic",
3274
3456
  children: "[Grid]"
3275
3457
  })
3276
- }[e] || ur;
3458
+ }[e] || mr;
3277
3459
  }
3278
- Pr("lookup", Ar), Pr("master_detail", Ar), Pr("select", wr), Pr("status", wr), Pr("user", Mr), Pr("owner", Mr), Tt(Fr);
3279
- function Ir(e) {
3460
+ Rr("lookup", Pr), Rr("master_detail", Pr), Rr("select", Or), Rr("status", Or), Rr("user", Ir), Rr("owner", Ir), Et(Hr);
3461
+ function Ur(e) {
3280
3462
  return {
3281
3463
  text: "field:text",
3282
3464
  textarea: "field:textarea",
@@ -3304,7 +3486,7 @@ function Ir(e) {
3304
3486
  auto_number: "field:auto_number"
3305
3487
  }[e] || "field:text";
3306
3488
  }
3307
- function Lr(e) {
3489
+ function Wr(e) {
3308
3490
  if (e < 0 || !Number.isFinite(e) || e === 0) return "0 B";
3309
3491
  let t = [
3310
3492
  "B",
@@ -3316,7 +3498,7 @@ function Lr(e) {
3316
3498
  for (; n >= 1024 && r < t.length - 1;) n /= 1024, r++;
3317
3499
  return `${n.toFixed(+(r > 0))} ${t[r]}`;
3318
3500
  }
3319
- function Rr(e) {
3501
+ function Gr(e) {
3320
3502
  let t = {};
3321
3503
  return e.required && (t.required = typeof e.required_message == "string" ? e.required_message : `${e.label || e.name} is required`), e.min_length && (t.minLength = {
3322
3504
  value: e.min_length,
@@ -3341,7 +3523,7 @@ function Rr(e) {
3341
3523
  message: "Please enter a valid URL"
3342
3524
  }), e.validate && (t.validate = e.validate), Object.keys(t).length > 0 ? t : void 0;
3343
3525
  }
3344
- function zr(e, t) {
3526
+ function Kr(e, t) {
3345
3527
  if (!e) return !0;
3346
3528
  if (e.field && e.value !== void 0) {
3347
3529
  let n = t[e.field];
@@ -3353,7 +3535,7 @@ function zr(e, t) {
3353
3535
  if (e.operator === "<=") return n <= e.value;
3354
3536
  if (e.operator === "in") return Array.isArray(e.value) && e.value.includes(n);
3355
3537
  }
3356
- return e.and && Array.isArray(e.and) ? e.and.every((e) => zr(e, t)) : e.or && Array.isArray(e.or) ? e.or.some((e) => zr(e, t)) : !0;
3538
+ return e.and && Array.isArray(e.and) ? e.and.every((e) => Kr(e, t)) : e.or && Array.isArray(e.or) ? e.or.some((e) => Kr(e, t)) : !0;
3357
3539
  }
3358
3540
  function $(t) {
3359
3541
  let n = ({ schema: n, className: r, value: i, ...a }) => {
@@ -3371,24 +3553,24 @@ function $(t) {
3371
3553
  }, l = e.useCallback((e) => {
3372
3554
  s(e), a.onChange && a.onChange(e);
3373
3555
  }, [a]), u = n?.readonly || n?.readOnly || !1;
3374
- return /* @__PURE__ */ J("div", {
3556
+ return /* @__PURE__ */ Y("div", {
3375
3557
  className: "grid w-full items-center gap-1.5",
3376
3558
  "data-obj-id": n?.id,
3377
3559
  "data-obj-type": n?.type,
3378
3560
  children: [
3379
- n?.label && /* @__PURE__ */ q("label", {
3561
+ n?.label && /* @__PURE__ */ J("label", {
3380
3562
  htmlFor: n.id,
3381
3563
  className: n.required ? "after:content-['*'] after:ml-0.5 after:text-red-500" : "",
3382
3564
  children: n.label
3383
3565
  }),
3384
- /* @__PURE__ */ q(t, {
3566
+ /* @__PURE__ */ J(t, {
3385
3567
  value: o,
3386
3568
  onChange: l,
3387
3569
  field: c,
3388
3570
  readonly: u,
3389
3571
  className: r
3390
3572
  }),
3391
- n?.description && /* @__PURE__ */ q("p", {
3573
+ n?.description && /* @__PURE__ */ J("p", {
3392
3574
  className: "text-sm text-gray-500",
3393
3575
  children: n.description
3394
3576
  })
@@ -3397,48 +3579,48 @@ function $(t) {
3397
3579
  };
3398
3580
  return n.displayName = `FieldRenderer(${t.displayName || t.name || "Component"})`, n;
3399
3581
  }
3400
- var Br = {
3401
- text: () => Promise.resolve().then(() => (Fe(), Ne)).then((e) => ({ default: e.TextField })),
3402
- textarea: () => Promise.resolve().then(() => (ft(), ut)).then((e) => ({ default: e.TextAreaField })),
3403
- number: () => Promise.resolve().then(() => (Re(), Ie)).then((e) => ({ default: e.NumberField })),
3404
- boolean: () => Promise.resolve().then(() => (Ve(), ze)).then((e) => ({ default: e.BooleanField })),
3405
- select: () => Promise.resolve().then(() => (qe(), Ge)).then((e) => ({ default: e.SelectField })),
3406
- date: () => Promise.resolve().then(() => (Xe(), Je)).then((e) => ({ default: e.DateField })),
3407
- datetime: () => Promise.resolve().then(() => (Rt(), It)).then((e) => ({ default: e.DateTimeField })),
3408
- time: () => Promise.resolve().then(() => (Vt(), zt)).then((e) => ({ default: e.TimeField })),
3409
- email: () => Promise.resolve().then(() => ($e(), Ze)).then((e) => ({ default: e.EmailField })),
3410
- phone: () => Promise.resolve().then(() => (nt(), et)).then((e) => ({ default: e.PhoneField })),
3411
- url: () => Promise.resolve().then(() => (at(), rt)).then((e) => ({ default: e.UrlField })),
3412
- currency: () => Promise.resolve().then(() => (lt(), ot)).then((e) => ({ default: e.CurrencyField })),
3413
- percent: () => Promise.resolve().then(() => (Wt(), Ht)).then((e) => ({ default: e.PercentField })),
3414
- password: () => Promise.resolve().then(() => (qt(), Gt)).then((e) => ({ default: e.PasswordField })),
3415
- markdown: () => Promise.resolve().then(() => (ht(), pt)).then((e) => ({ default: e.RichTextField })),
3416
- html: () => Promise.resolve().then(() => (ht(), pt)).then((e) => ({ default: e.RichTextField })),
3417
- lookup: () => Promise.resolve().then(() => (Ft(), kt)).then((e) => ({ default: e.LookupField })),
3418
- master_detail: () => Promise.resolve().then(() => (Ft(), kt)).then((e) => ({ default: e.LookupField })),
3419
- file: () => Promise.resolve().then(() => (Xt(), Jt)).then((e) => ({ default: e.FileField })),
3420
- image: () => Promise.resolve().then(() => (rn(), en)).then((e) => ({ default: e.ImageField })),
3421
- location: () => Promise.resolve().then(() => (sn(), an)).then((e) => ({ default: e.LocationField })),
3422
- formula: () => Promise.resolve().then(() => (un(), cn)).then((e) => ({ default: e.FormulaField })),
3423
- summary: () => Promise.resolve().then(() => (pn(), dn)).then((e) => ({ default: e.SummaryField })),
3424
- auto_number: () => Promise.resolve().then(() => (gn(), mn)).then((e) => ({ default: e.AutoNumberField })),
3425
- user: () => Promise.resolve().then(() => (yn(), _n)).then((e) => ({ default: e.UserField })),
3426
- owner: () => Promise.resolve().then(() => (yn(), _n)).then((e) => ({ default: e.UserField })),
3427
- object: () => Promise.resolve().then(() => (Sn(), bn)).then((e) => ({ default: e.ObjectField })),
3428
- vector: () => Promise.resolve().then(() => (Tn(), Cn)).then((e) => ({ default: e.VectorField })),
3429
- grid: () => Promise.resolve().then(() => (On(), En)).then((e) => ({ default: e.GridField })),
3430
- color: () => Promise.resolve().then(() => (jn(), kn)).then((e) => ({ default: e.ColorField })),
3431
- slider: () => Promise.resolve().then(() => (Pn(), Mn)).then((e) => ({ default: e.SliderField })),
3432
- rating: () => Promise.resolve().then(() => (Ln(), Fn)).then((e) => ({ default: e.RatingField })),
3433
- code: () => Promise.resolve().then(() => (Bn(), Rn)).then((e) => ({ default: e.CodeField })),
3434
- avatar: () => Promise.resolve().then(() => (Un(), Vn)).then((e) => ({ default: e.AvatarField })),
3435
- address: () => Promise.resolve().then(() => (Kn(), Wn)).then((e) => ({ default: e.AddressField })),
3436
- geolocation: () => Promise.resolve().then(() => (Yn(), qn)).then((e) => ({ default: e.GeolocationField })),
3437
- signature: () => Promise.resolve().then(() => (Qn(), Xn)).then((e) => ({ default: e.SignatureField })),
3438
- qrcode: () => Promise.resolve().then(() => (tr(), $n)).then((e) => ({ default: e.QRCodeField }))
3582
+ var qr = {
3583
+ text: () => Promise.resolve().then(() => (Ie(), Pe)).then((e) => ({ default: e.TextField })),
3584
+ textarea: () => Promise.resolve().then(() => (pt(), dt)).then((e) => ({ default: e.TextAreaField })),
3585
+ number: () => Promise.resolve().then(() => (ze(), Le)).then((e) => ({ default: e.NumberField })),
3586
+ boolean: () => Promise.resolve().then(() => (He(), Be)).then((e) => ({ default: e.BooleanField })),
3587
+ select: () => Promise.resolve().then(() => (Je(), Ke)).then((e) => ({ default: e.SelectField })),
3588
+ date: () => Promise.resolve().then(() => (Ze(), Ye)).then((e) => ({ default: e.DateField })),
3589
+ datetime: () => Promise.resolve().then(() => (Bt(), Rt)).then((e) => ({ default: e.DateTimeField })),
3590
+ time: () => Promise.resolve().then(() => (Ut(), Vt)).then((e) => ({ default: e.TimeField })),
3591
+ email: () => Promise.resolve().then(() => (et(), Qe)).then((e) => ({ default: e.EmailField })),
3592
+ phone: () => Promise.resolve().then(() => (rt(), tt)).then((e) => ({ default: e.PhoneField })),
3593
+ url: () => Promise.resolve().then(() => (ot(), it)).then((e) => ({ default: e.UrlField })),
3594
+ currency: () => Promise.resolve().then(() => (ut(), st)).then((e) => ({ default: e.CurrencyField })),
3595
+ percent: () => Promise.resolve().then(() => (Kt(), Wt)).then((e) => ({ default: e.PercentField })),
3596
+ password: () => Promise.resolve().then(() => (Yt(), qt)).then((e) => ({ default: e.PasswordField })),
3597
+ markdown: () => Promise.resolve().then(() => (gt(), mt)).then((e) => ({ default: e.RichTextField })),
3598
+ html: () => Promise.resolve().then(() => (gt(), mt)).then((e) => ({ default: e.RichTextField })),
3599
+ lookup: () => Promise.resolve().then(() => (Lt(), At)).then((e) => ({ default: e.LookupField })),
3600
+ master_detail: () => Promise.resolve().then(() => (Lt(), At)).then((e) => ({ default: e.LookupField })),
3601
+ file: () => Promise.resolve().then(() => (Qt(), Xt)).then((e) => ({ default: e.FileField })),
3602
+ image: () => Promise.resolve().then(() => (on(), nn)).then((e) => ({ default: e.ImageField })),
3603
+ location: () => Promise.resolve().then(() => (ln(), sn)).then((e) => ({ default: e.LocationField })),
3604
+ formula: () => Promise.resolve().then(() => (fn(), un)).then((e) => ({ default: e.FormulaField })),
3605
+ summary: () => Promise.resolve().then(() => (hn(), pn)).then((e) => ({ default: e.SummaryField })),
3606
+ auto_number: () => Promise.resolve().then(() => (vn(), gn)).then((e) => ({ default: e.AutoNumberField })),
3607
+ user: () => Promise.resolve().then(() => (xn(), yn)).then((e) => ({ default: e.UserField })),
3608
+ owner: () => Promise.resolve().then(() => (xn(), yn)).then((e) => ({ default: e.UserField })),
3609
+ object: () => Promise.resolve().then(() => (wn(), Sn)).then((e) => ({ default: e.ObjectField })),
3610
+ vector: () => Promise.resolve().then(() => (Dn(), Tn)).then((e) => ({ default: e.VectorField })),
3611
+ grid: () => Promise.resolve().then(() => (An(), On)).then((e) => ({ default: e.GridField })),
3612
+ color: () => Promise.resolve().then(() => (Nn(), jn)).then((e) => ({ default: e.ColorField })),
3613
+ slider: () => Promise.resolve().then(() => (In(), Pn)).then((e) => ({ default: e.SliderField })),
3614
+ rating: () => Promise.resolve().then(() => (zn(), Ln)).then((e) => ({ default: e.RatingField })),
3615
+ code: () => Promise.resolve().then(() => (Hn(), Bn)).then((e) => ({ default: e.CodeField })),
3616
+ avatar: () => Promise.resolve().then(() => (Gn(), Un)).then((e) => ({ default: e.AvatarField })),
3617
+ address: () => Promise.resolve().then(() => (Jn(), Kn)).then((e) => ({ default: e.AddressField })),
3618
+ geolocation: () => Promise.resolve().then(() => (Zn(), Yn)).then((e) => ({ default: e.GeolocationField })),
3619
+ signature: () => Promise.resolve().then(() => (er(), Qn)).then((e) => ({ default: e.SignatureField })),
3620
+ qrcode: () => Promise.resolve().then(() => (rr(), tr)).then((e) => ({ default: e.QRCodeField }))
3439
3621
  };
3440
- function Vr(t) {
3441
- let n = Br[t];
3622
+ function Jr(t) {
3623
+ let n = qr[t];
3442
3624
  if (!n) {
3443
3625
  console.warn(`Unknown field type: ${t}`);
3444
3626
  return;
@@ -3446,14 +3628,14 @@ function Vr(t) {
3446
3628
  let r = e.lazy(n);
3447
3629
  u.register(t, r, { namespace: "field" });
3448
3630
  }
3449
- function Hr() {
3450
- Object.keys(Br).forEach((e) => {
3451
- Vr(e);
3631
+ function Yr() {
3632
+ Object.keys(qr).forEach((e) => {
3633
+ Jr(e);
3452
3634
  });
3453
3635
  }
3454
- function Ur() {
3455
- u.register("text", $(Pe), { namespace: "field" }), u.register("textarea", $(dt), { namespace: "field" }), u.register("number", $(Le), { namespace: "field" }), u.register("boolean", $(Be), { namespace: "field" }), u.register("select", $(Ke), { namespace: "field" }), u.register("date", $(Ye), { namespace: "field" }), u.register("datetime", $(Lt), { namespace: "field" }), u.register("time", $(Bt), { namespace: "field" }), u.register("email", $(Qe), { namespace: "field" }), u.register("phone", $(tt), { namespace: "field" }), u.register("url", $(it), { namespace: "field" }), u.register("currency", $(ct), { namespace: "field" }), u.register("percent", $(Ut), { namespace: "field" }), u.register("password", $(Kt), { namespace: "field" }), u.register("markdown", $(mt), { namespace: "field" }), u.register("html", $(mt), { namespace: "field" }), u.register("lookup", $(Mt), { namespace: "field" }), u.register("master_detail", $(Mt), { namespace: "field" }), u.register("file", $(Yt), { namespace: "field" }), u.register("image", $(tn), { namespace: "field" }), u.register("location", $(on), { namespace: "field" }), u.register("formula", $(ln), { namespace: "field" }), u.register("summary", $(fn), { namespace: "field" }), u.register("auto_number", $(hn), { namespace: "field" }), u.register("user", $(vn), { namespace: "field" }), u.register("owner", $(vn), { namespace: "field" }), u.register("object", $(xn), { namespace: "field" }), u.register("vector", $(wn), { namespace: "field" }), u.register("grid", $(Dn), { namespace: "field" }), u.register("color", $(An), { namespace: "field" }), u.register("slider", $(Nn), { namespace: "field" }), u.register("rating", $(In), { namespace: "field" }), u.register("code", $(zn), { namespace: "field" }), u.register("avatar", $(Hn), { namespace: "field" }), u.register("address", $(Gn), { namespace: "field" }), u.register("geolocation", $(Jn), { namespace: "field" }), u.register("signature", $(Zn), { namespace: "field" }), u.register("qrcode", $(er), { namespace: "field" });
3636
+ function Xr() {
3637
+ u.register("text", $(Fe), { namespace: "field" }), u.register("textarea", $(ft), { namespace: "field" }), u.register("number", $(Re), { namespace: "field" }), u.register("boolean", $(Ve), { namespace: "field" }), u.register("select", $(qe), { namespace: "field" }), u.register("date", $(Xe), { namespace: "field" }), u.register("datetime", $(zt), { namespace: "field" }), u.register("time", $(Ht), { namespace: "field" }), u.register("email", $($e), { namespace: "field" }), u.register("phone", $(nt), { namespace: "field" }), u.register("url", $(at), { namespace: "field" }), u.register("currency", $(lt), { namespace: "field" }), u.register("percent", $(Gt), { namespace: "field" }), u.register("password", $(Jt), { namespace: "field" }), u.register("markdown", $(ht), { namespace: "field" }), u.register("html", $(ht), { namespace: "field" }), u.register("lookup", $(Pt), { namespace: "field" }), u.register("master_detail", $(Pt), { namespace: "field" }), u.register("file", $(Zt), { namespace: "field" }), u.register("image", $(rn), { namespace: "field" }), u.register("location", $(cn), { namespace: "field" }), u.register("formula", $(dn), { namespace: "field" }), u.register("summary", $(mn), { namespace: "field" }), u.register("auto_number", $(_n), { namespace: "field" }), u.register("user", $(bn), { namespace: "field" }), u.register("owner", $(bn), { namespace: "field" }), u.register("object", $(Cn), { namespace: "field" }), u.register("vector", $(En), { namespace: "field" }), u.register("grid", $(kn), { namespace: "field" }), u.register("color", $(Mn), { namespace: "field" }), u.register("slider", $(Fn), { namespace: "field" }), u.register("rating", $(Rn), { namespace: "field" }), u.register("code", $(Vn), { namespace: "field" }), u.register("avatar", $(Wn), { namespace: "field" }), u.register("address", $(qn), { namespace: "field" }), u.register("geolocation", $(Xn), { namespace: "field" }), u.register("signature", $($n), { namespace: "field" }), u.register("qrcode", $(nr), { namespace: "field" });
3456
3638
  }
3457
- Hr();
3639
+ Yr();
3458
3640
  //#endregion
3459
- export { Gn as AddressField, hn as AutoNumberField, Hn as AvatarField, gr as BooleanCellRenderer, Be as BooleanField, zn as CodeField, An as ColorField, fr as CurrencyCellRenderer, ct as CurrencyField, _r as DateCellRenderer, Ye as DateField, vr as DateTimeCellRenderer, Lt as DateTimeField, Tr as EmailCellRenderer, Qe as EmailField, Or as FileCellRenderer, Yt as FileField, jr as FormulaCellRenderer, ln as FormulaField, Jn as GeolocationField, Dn as GridField, kr as ImageCellRenderer, Qt as ImageCropperDialog, tn as ImageField, on as LocationField, Ar as LookupCellRenderer, Mt as LookupField, nr as MasterDetailField, dr as NumberCellRenderer, Le as NumberField, xn as ObjectField, Kt as PasswordField, mr as PercentCellRenderer, Ut as PercentField, Dr as PhoneCellRenderer, tt as PhoneField, er as QRCodeField, In as RatingField, bt as RecordPickerDialog, mt as RichTextField, wr as SelectCellRenderer, Ke as SelectField, Zn as SignatureField, Nn as SliderField, fn as SummaryField, dt as TextAreaField, ur as TextCellRenderer, Pe as TextField, Bt as TimeField, Er as UrlCellRenderer, it as UrlField, Mr as UserCellRenderer, vn as UserField, wn as VectorField, Rr as buildValidationRules, Q as coerceToSafeValue, zr as evaluateCondition, ir as formatCompactCurrency, rr as formatCurrency, cr as formatDate, lr as formatDateTime, Lr as formatFileSize, ar as formatPercent, sr as formatRelativeDate, Fr as getCellRenderer, or as humanizeLabel, Ir as mapFieldTypeToFormType, Hr as registerAllFields, Vr as registerField, Pr as registerFieldRenderer, Ur as registerFields };
3641
+ export { qn as AddressField, _n as AutoNumberField, Wn as AvatarField, br as BooleanCellRenderer, Ve as BooleanField, Vn as CodeField, Mn as ColorField, gr as CurrencyCellRenderer, lt as CurrencyField, xr as DateCellRenderer, Xe as DateField, Sr as DateTimeCellRenderer, zt as DateTimeField, kr as EmailCellRenderer, $e as EmailField, Mr as FileCellRenderer, Zt as FileField, Fr as FormulaCellRenderer, dn as FormulaField, Xn as GeolocationField, kn as GridField, Nr as ImageCellRenderer, en as ImageCropperDialog, rn as ImageField, cn as LocationField, Pr as LookupCellRenderer, Pt as LookupField, ir as MasterDetailField, hr as NumberCellRenderer, Re as NumberField, Cn as ObjectField, Jt as PasswordField, vr as PercentCellRenderer, Gt as PercentField, jr as PhoneCellRenderer, nt as PhoneField, nr as QRCodeField, Rn as RatingField, xt as RecordPickerDialog, ht as RichTextField, Or as SelectCellRenderer, qe as SelectField, $n as SignatureField, Fn as SliderField, mn as SummaryField, ft as TextAreaField, mr as TextCellRenderer, Fe as TextField, Ht as TimeField, Ar as UrlCellRenderer, at as UrlField, Ir as UserCellRenderer, bn as UserField, En as VectorField, Gr as buildValidationRules, Q as coerceToSafeValue, Kr as evaluateCondition, sr as formatCompactCurrency, or as formatCurrency, fr as formatDate, pr as formatDateTime, Wr as formatFileSize, cr as formatNumber, lr as formatPercent, dr as formatRelativeDate, Hr as getCellRenderer, ur as humanizeLabel, Ur as mapFieldTypeToFormType, Yr as registerAllFields, Jr as registerField, Rr as registerFieldRenderer, Xr as registerFields, Vr as resolveCellRendererType };