@overmap-ai/forms 1.0.17-file-viewer-updates.7 → 1.0.17-file-viewer-updates.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/forms.js CHANGED
@@ -1,93 +1,93 @@
1
- var nr = Object.defineProperty;
2
- var ir = (t, n, e) => n in t ? nr(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var w = (t, n, e) => ir(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { jsxs as y, jsx as s, Fragment as he } from "react/jsx-runtime";
5
- import { Popover as oe, IconButton as V, RiIcon as T, Badge as jt, Spinner as vt, ButtonGroup as Wt, Tooltip as xe, Separator as qt, Text as Ve, Checkbox as ot, Button as X, DayPicker as rr, useToast as Ht, Input as ue, Card as Ue, Menu as M, TextArea as Bn, useSize as Un, Heading as jn, useAlertDialog as or, Tabs as Ee, IconToggleButton as ar } from "@overmap-ai/blocks";
1
+ var ir = Object.defineProperty;
2
+ var rr = (t, n, e) => n in t ? ir(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var w = (t, n, e) => rr(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { jsxs as y, jsx as a, Fragment as he } from "react/jsx-runtime";
5
+ import { Popover as oe, IconButton as B, RiIcon as T, Badge as ot, Spinner as yt, ButtonGroup as bt, Tooltip as Ee, Separator as Ht, Text as ye, Checkbox as at, Button as X, DayPicker as or, useToast as Gt, Input as de, Card as Ue, Menu as M, TextArea as Un, useSize as jn, Heading as Wn, HoverCard as St, useAlertDialog as ar, Tabs as Ie, IconToggleButton as sr } from "@overmap-ai/blocks";
6
6
  import * as p from "react";
7
- import { memo as O, useCallback as N, useMemo as A, forwardRef as qe, createContext as sr, useContext as lr, useState as H, useRef as ne, useEffect as K, useLayoutEffect as cr, useReducer as dr, Fragment as ur } from "react";
8
- import { truncate as Gt, downloadFile as Wn, slugify as fr, Colors as qn, fileToBlob as Hn, hashFile as xn, DeferredPromise as mr } from "@overmap-ai/core";
9
- import { useField as Xt, useFormikContext as ye, useFormik as Kt, FormikProvider as Yt } from "formik";
10
- import * as hr from "react-dom";
11
- import pr from "react-dom";
12
- import { RiCheckboxCircleLine as gr, RiCalendarLine as vr, RiListCheck as yr, RiHashtag as br, RiQrCodeLine as wr, RiCheckboxLine as Cr, RiMenuFoldLine as xr, RiInputField as Er, RiAlignJustify as Ir, RiUpload2Line as Sr, RiFileCopyLine as Rr, RiDeleteBin2Line as Nr, RiImageLine as Tr, RiArrowDownLine as Lr, RiArrowUpLine as Fr } from "react-icons/ri";
7
+ import { memo as O, useCallback as N, useMemo as A, forwardRef as qe, createContext as lr, useContext as cr, useState as H, useRef as ne, useEffect as K, useLayoutEffect as dr, useReducer as ur, Fragment as fr } from "react";
8
+ import { truncate as Xt, downloadFile as qn, slugify as mr, Colors as Hn, fileToBlob as Gn, hashFile as En, DeferredPromise as hr } from "@overmap-ai/core";
9
+ import { useField as Kt, useFormikContext as be, useFormik as Yt, FormikProvider as Qt } from "formik";
10
+ import * as pr from "react-dom";
11
+ import gr from "react-dom";
12
+ import { RiCheckboxCircleLine as vr, RiCalendarLine as yr, RiListCheck as br, RiHashtag as wr, RiQrCodeLine as Cr, RiCheckboxLine as xr, RiMenuFoldLine as Er, RiInputField as Ir, RiAlignJustify as Sr, RiUpload2Line as Rr, RiFileCopyLine as Nr, RiDeleteBin7Fill as Tr, RiImageLine as Lr, RiArrowDownLine as Fr, RiArrowUpLine as Dr } from "react-icons/ri";
13
13
  import Y from "lodash.get";
14
- import Qt from "lodash.set";
15
- import { DragDropContext as Gn, Droppable as Jt, Draggable as Zt } from "@hello-pangea/dnd";
16
- import Dr from "qr-scanner";
17
- import Ar from "lodash.clonedeep";
18
- import { ReactSketchCanvas as Or } from "react-sketch-canvas";
19
- const Xn = O((t) => {
14
+ import Jt from "lodash.set";
15
+ import { DragDropContext as Xn, Droppable as Zt, Draggable as en } from "@hello-pangea/dnd";
16
+ import Ar from "qr-scanner";
17
+ import Or from "lodash.clonedeep";
18
+ import { ReactSketchCanvas as Pr } from "react-sketch-canvas";
19
+ const Kn = O((t) => {
20
20
  const { selectedColor: n, allColors: e, onFinish: i, trigger: r } = t, o = N(
21
- (a) => () => {
22
- i(a);
21
+ (s) => () => {
22
+ i(s);
23
23
  },
24
24
  [i]
25
25
  );
26
26
  return /* @__PURE__ */ y(oe.Root, { children: [
27
- /* @__PURE__ */ s(oe.Trigger, { children: r }),
28
- /* @__PURE__ */ s(oe.Content, { size: "sm", children: /* @__PURE__ */ s("div", { className: "grid w-max grid-cols-7 gap-x-1 gap-y-1", children: e.map((a) => /* @__PURE__ */ s(
29
- V,
27
+ /* @__PURE__ */ a(oe.Trigger, { children: r }),
28
+ /* @__PURE__ */ a(oe.Content, { size: "sm", children: /* @__PURE__ */ a("div", { className: "grid w-max grid-cols-7 gap-x-1 gap-y-1", children: e.map((s) => /* @__PURE__ */ a(
29
+ B,
30
30
  {
31
- onClick: o(a),
31
+ onClick: o(s),
32
32
  style: {
33
- backgroundColor: a
33
+ backgroundColor: s
34
34
  },
35
35
  type: "button",
36
36
  variant: "solid",
37
- "aria-label": a,
38
- children: n === a && /* @__PURE__ */ s(T, { icon: "RiCheckLine" })
37
+ "aria-label": s,
38
+ children: n === s && /* @__PURE__ */ a(T, { icon: "RiCheckLine" })
39
39
  },
40
- a
40
+ s
41
41
  )) }) })
42
42
  ] });
43
43
  });
44
- Xn.displayName = "ColorPicker";
45
- const Pr = ["image/jpeg", "image/png", "image/svg+xml"], kr = [
44
+ Kn.displayName = "ColorPicker";
45
+ const kr = ["image/jpeg", "image/png", "image/svg+xml"], Mr = [
46
46
  // .csv
47
47
  "text/csv",
48
48
  // .xlsx
49
49
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
50
50
  // .xls
51
51
  "application/vnd.ms-excel"
52
- ], Mr = ["application/pdf"], yt = O((t) => {
53
- const { fileType: n } = t, e = A(() => kr.includes(n) ? /* @__PURE__ */ s(T, { icon: "RiFileExcelLine" }) : Mr.includes(n) ? /* @__PURE__ */ s(T, { icon: "RiFilePdfLine" }) : Pr.includes(n) ? /* @__PURE__ */ s(T, { icon: "RiFileImageLine" }) : /* @__PURE__ */ s(T, { icon: "RiFileLine" }), [n]);
54
- return /* @__PURE__ */ s("div", { className: "h-max w-max", children: e });
52
+ ], zr = ["application/pdf"], wt = O((t) => {
53
+ const { fileType: n } = t, e = A(() => Mr.includes(n) ? /* @__PURE__ */ a(T, { icon: "RiFileExcelLine" }) : zr.includes(n) ? /* @__PURE__ */ a(T, { icon: "RiFilePdfLine" }) : kr.includes(n) ? /* @__PURE__ */ a(T, { icon: "RiFileImageLine" }) : /* @__PURE__ */ a(T, { icon: "RiFileLine" }), [n]);
54
+ return /* @__PURE__ */ a("div", { className: "h-max w-max", children: e });
55
55
  });
56
- yt.displayName = "FileIcon";
56
+ wt.displayName = "FileIcon";
57
57
  const _r = O((t) => {
58
58
  const { file: n, truncateLength: e, hideName: i = !1, ...r } = t, o = A(
59
- () => e !== void 0 ? Gt(n.name, e) : n.name,
59
+ () => e !== void 0 ? Xt(n.name, e) : n.name,
60
60
  [n.name, e]
61
61
  );
62
- return /* @__PURE__ */ y(jt, { ...r, children: [
63
- /* @__PURE__ */ s(yt, { fileType: n.type }),
62
+ return /* @__PURE__ */ y(ot, { ...r, children: [
63
+ /* @__PURE__ */ a(wt, { fileType: n.type }),
64
64
  !i && o
65
65
  ] });
66
66
  });
67
67
  _r.displayName = "FileBadge";
68
- function Kn(t) {
68
+ function Yn(t) {
69
69
  var n, e, i = "";
70
70
  if (typeof t == "string" || typeof t == "number") i += t;
71
71
  else if (typeof t == "object") if (Array.isArray(t)) {
72
72
  var r = t.length;
73
- for (n = 0; n < r; n++) t[n] && (e = Kn(t[n])) && (i && (i += " "), i += e);
73
+ for (n = 0; n < r; n++) t[n] && (e = Yn(t[n])) && (i && (i += " "), i += e);
74
74
  } else for (e in t) t[e] && (i && (i += " "), i += e);
75
75
  return i;
76
76
  }
77
- function zr() {
78
- for (var t, n, e = 0, i = "", r = arguments.length; e < r; e++) (t = arguments[e]) && (n = Kn(t)) && (i && (i += " "), i += n);
77
+ function $r() {
78
+ for (var t, n, e = 0, i = "", r = arguments.length; e < r; e++) (t = arguments[e]) && (n = Yn(t)) && (i && (i += " "), i += n);
79
79
  return i;
80
80
  }
81
- const Be = zr, Yn = O(
81
+ const Ve = $r, Qn = O(
82
82
  qe((t, n) => {
83
- const { file: e, className: i, error: r, truncateLength: o, rightSlot: a, ...l } = t, f = A(() => {
83
+ const { file: e, className: i, error: r, truncateLength: o, rightSlot: s, ...l } = t, f = A(() => {
84
84
  if (e)
85
- return o !== void 0 ? Gt(e.name, o) : e.name;
85
+ return o !== void 0 ? Xt(e.name, o) : e.name;
86
86
  }, [e, o]);
87
87
  return /* @__PURE__ */ y(
88
88
  "div",
89
89
  {
90
- className: Be(
90
+ className: Ve(
91
91
  i,
92
92
  "flex h-5 w-full items-center gap-2 rounded-md border border-(--base-a6) bg-(--base-2) text-sm py-1 px-2 h-max",
93
93
  {
@@ -97,22 +97,22 @@ const Be = zr, Yn = O(
97
97
  ref: n,
98
98
  ...l,
99
99
  children: [
100
- r ? /* @__PURE__ */ s(T, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ s(yt, { fileType: (e == null ? void 0 : e.type) ?? "" }),
101
- r || (e ? f : /* @__PURE__ */ s("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ s(vt, {}) })),
102
- a
100
+ r ? /* @__PURE__ */ a(T, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ a(wt, { fileType: (e == null ? void 0 : e.type) ?? "" }),
101
+ r || (e ? f : /* @__PURE__ */ a("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ a(yt, {}) })),
102
+ s
103
103
  ]
104
104
  }
105
105
  );
106
106
  })
107
107
  );
108
- Yn.displayName = "FileCard";
109
- const Ze = 500, _e = 1e4, ae = {
108
+ Qn.displayName = "FileCard";
109
+ const Ze = 500, _e = 1e4, ue = {
110
110
  danger: "danger",
111
111
  warning: "warning",
112
112
  info: "base",
113
113
  success: "success"
114
114
  };
115
- class Qn {
115
+ class Jn {
116
116
  constructor(n) {
117
117
  w(this, "type");
118
118
  w(this, "identifier");
@@ -141,9 +141,9 @@ const Q = {
141
141
  description: "",
142
142
  required: !1
143
143
  };
144
- class G extends Qn {
144
+ class G extends Jn {
145
145
  constructor(e) {
146
- const { label: i, required: r, image: o, fieldValidators: a = [], formValidators: l = [], ...f } = e;
146
+ const { label: i, required: r, image: o, fieldValidators: s = [], formValidators: l = [], ...f } = e;
147
147
  super(f);
148
148
  w(this, "required");
149
149
  w(this, "formValidators");
@@ -157,7 +157,7 @@ class G extends Qn {
157
157
  * which don't have a `onBlur` event (which is used to set the `touched` state).
158
158
  */
159
159
  w(this, "onlyValidateAfterTouched", !0);
160
- this.label = i, this.required = r, this.image = o, this.fieldValidators = a, this.formValidators = l;
160
+ this.label = i, this.required = r, this.image = o, this.fieldValidators = s, this.formValidators = l;
161
161
  }
162
162
  static getFieldCreationSchema() {
163
163
  return [];
@@ -205,7 +205,7 @@ class G extends Qn {
205
205
  }
206
206
  w(G, "fieldTypeName"), w(G, "fieldTypeDescription");
207
207
  const U = (t) => {
208
- const { id: n, field: e, formId: i, size: r, showInputOnly: o, internal: a, ...l } = t, [f, c, d] = Xt(e.getId()), { touched: u } = c, h = c.error ?? e.description, g = c.error ? "danger" : void 0, b = n ?? `${i}-${e.getId()}-input`, m = `${b}-label`, v = e.required ? `${e.label} *` : e.label, x = A(() => ({
208
+ const { id: n, field: e, formId: i, size: r, showInputOnly: o, internal: s, ...l } = t, [f, c, d] = Kt(e.getId()), { touched: u } = c, h = c.error ?? e.description, g = c.error ? "danger" : void 0, b = n ?? `${i}-${e.getId()}-input`, m = `${b}-label`, v = e.required ? `${e.label} *` : e.label, x = A(() => ({
209
209
  ...f,
210
210
  onChange: (C) => {
211
211
  const I = e.getValueFromChangeEvent(C);
@@ -224,55 +224,55 @@ const U = (t) => {
224
224
  labelId: m,
225
225
  label: v,
226
226
  showInputOnly: o,
227
- internal: a,
227
+ internal: s,
228
228
  fieldProps: x,
229
229
  helpers: d,
230
230
  field: e
231
231
  },
232
232
  { ...l, "aria-labelledby": m }
233
233
  ];
234
- }, Jn = sr(() => {
234
+ }, Zn = lr(() => {
235
235
  throw new Error("No ImageViewerProvider found");
236
- }), en = () => lr(Jn);
237
- function de(t, n, { checkForDefaultPrevented: e = !0 } = {}) {
236
+ }), tn = () => cr(Zn);
237
+ function ce(t, n, { checkForDefaultPrevented: e = !0 } = {}) {
238
238
  return function(r) {
239
239
  if (t == null || t(r), e === !1 || !r.defaultPrevented)
240
240
  return n == null ? void 0 : n(r);
241
241
  };
242
242
  }
243
- function En(t, n) {
243
+ function In(t, n) {
244
244
  if (typeof t == "function")
245
245
  return t(n);
246
246
  t != null && (t.current = n);
247
247
  }
248
- function Zn(...t) {
248
+ function ei(...t) {
249
249
  return (n) => {
250
250
  let e = !1;
251
251
  const i = t.map((r) => {
252
- const o = En(r, n);
252
+ const o = In(r, n);
253
253
  return !e && typeof o == "function" && (e = !0), o;
254
254
  });
255
255
  if (e)
256
256
  return () => {
257
257
  for (let r = 0; r < i.length; r++) {
258
258
  const o = i[r];
259
- typeof o == "function" ? o() : En(t[r], null);
259
+ typeof o == "function" ? o() : In(t[r], null);
260
260
  }
261
261
  };
262
262
  };
263
263
  }
264
- function be(...t) {
265
- return p.useCallback(Zn(...t), t);
264
+ function we(...t) {
265
+ return p.useCallback(ei(...t), t);
266
266
  }
267
- function $r(t, n) {
267
+ function Br(t, n) {
268
268
  const e = p.createContext(n), i = (o) => {
269
- const { children: a, ...l } = o, f = p.useMemo(() => l, Object.values(l));
270
- return /* @__PURE__ */ s(e.Provider, { value: f, children: a });
269
+ const { children: s, ...l } = o, f = p.useMemo(() => l, Object.values(l));
270
+ return /* @__PURE__ */ a(e.Provider, { value: f, children: s });
271
271
  };
272
272
  i.displayName = t + "Provider";
273
273
  function r(o) {
274
- const a = p.useContext(e);
275
- if (a) return a;
274
+ const s = p.useContext(e);
275
+ if (s) return s;
276
276
  if (n !== void 0) return n;
277
277
  throw new Error(`\`${o}\` must be used within \`${t}\``);
278
278
  }
@@ -280,26 +280,26 @@ function $r(t, n) {
280
280
  }
281
281
  function Vr(t, n = []) {
282
282
  let e = [];
283
- function i(o, a) {
284
- const l = p.createContext(a), f = e.length;
285
- e = [...e, a];
283
+ function i(o, s) {
284
+ const l = p.createContext(s), f = e.length;
285
+ e = [...e, s];
286
286
  const c = (u) => {
287
287
  var x;
288
288
  const { scope: h, children: g, ...b } = u, m = ((x = h == null ? void 0 : h[t]) == null ? void 0 : x[f]) || l, v = p.useMemo(() => b, Object.values(b));
289
- return /* @__PURE__ */ s(m.Provider, { value: v, children: g });
289
+ return /* @__PURE__ */ a(m.Provider, { value: v, children: g });
290
290
  };
291
291
  c.displayName = o + "Provider";
292
292
  function d(u, h) {
293
293
  var m;
294
294
  const g = ((m = h == null ? void 0 : h[t]) == null ? void 0 : m[f]) || l, b = p.useContext(g);
295
295
  if (b) return b;
296
- if (a !== void 0) return a;
296
+ if (s !== void 0) return s;
297
297
  throw new Error(`\`${u}\` must be used within \`${o}\``);
298
298
  }
299
299
  return [c, d];
300
300
  }
301
301
  const r = () => {
302
- const o = e.map((a) => p.createContext(a));
302
+ const o = e.map((s) => p.createContext(s));
303
303
  return function(l) {
304
304
  const f = (l == null ? void 0 : l[t]) || o;
305
305
  return p.useMemo(
@@ -308,9 +308,9 @@ function Vr(t, n = []) {
308
308
  );
309
309
  };
310
310
  };
311
- return r.scopeName = t, [i, Br(r, ...n)];
311
+ return r.scopeName = t, [i, Ur(r, ...n)];
312
312
  }
313
- function Br(...t) {
313
+ function Ur(...t) {
314
314
  const n = t[0];
315
315
  if (t.length === 1) return n;
316
316
  const e = () => {
@@ -319,22 +319,22 @@ function Br(...t) {
319
319
  scopeName: r.scopeName
320
320
  }));
321
321
  return function(o) {
322
- const a = i.reduce((l, { useScope: f, scopeName: c }) => {
322
+ const s = i.reduce((l, { useScope: f, scopeName: c }) => {
323
323
  const u = f(o)[`__scope${c}`];
324
324
  return { ...l, ...u };
325
325
  }, {});
326
- return p.useMemo(() => ({ [`__scope${n.scopeName}`]: a }), [a]);
326
+ return p.useMemo(() => ({ [`__scope${n.scopeName}`]: s }), [s]);
327
327
  };
328
328
  };
329
329
  return e.scopeName = n.scopeName, e;
330
330
  }
331
- var at = globalThis != null && globalThis.document ? p.useLayoutEffect : () => {
332
- }, Ur = p.useId || (() => {
333
- }), jr = 0;
334
- function Et(t) {
335
- const [n, e] = p.useState(Ur());
336
- return at(() => {
337
- e((i) => i ?? String(jr++));
331
+ var st = globalThis != null && globalThis.document ? p.useLayoutEffect : () => {
332
+ }, jr = p.useId || (() => {
333
+ }), Wr = 0;
334
+ function Rt(t) {
335
+ const [n, e] = p.useState(jr());
336
+ return st(() => {
337
+ e((i) => i ?? String(Wr++));
338
338
  }, [t]), t || (n ? `radix-${n}` : "");
339
339
  }
340
340
  function pe(t) {
@@ -346,13 +346,13 @@ function pe(t) {
346
346
  return (i = n.current) == null ? void 0 : i.call(n, ...e);
347
347
  }, []);
348
348
  }
349
- function Wr({
349
+ function qr({
350
350
  prop: t,
351
351
  defaultProp: n,
352
352
  onChange: e = () => {
353
353
  }
354
354
  }) {
355
- const [i, r] = qr({ defaultProp: n, onChange: e }), o = t !== void 0, a = o ? t : i, l = pe(e), f = p.useCallback(
355
+ const [i, r] = Hr({ defaultProp: n, onChange: e }), o = t !== void 0, s = o ? t : i, l = pe(e), f = p.useCallback(
356
356
  (c) => {
357
357
  if (o) {
358
358
  const u = typeof c == "function" ? c(t) : c;
@@ -362,9 +362,9 @@ function Wr({
362
362
  },
363
363
  [o, t, r, l]
364
364
  );
365
- return [a, f];
365
+ return [s, f];
366
366
  }
367
- function qr({
367
+ function Hr({
368
368
  defaultProp: t,
369
369
  onChange: n
370
370
  }) {
@@ -373,33 +373,33 @@ function qr({
373
373
  r.current !== i && (o(i), r.current = i);
374
374
  }, [i, r, o]), e;
375
375
  }
376
- var tn = p.forwardRef((t, n) => {
377
- const { children: e, ...i } = t, r = p.Children.toArray(e), o = r.find(Gr);
376
+ var nn = p.forwardRef((t, n) => {
377
+ const { children: e, ...i } = t, r = p.Children.toArray(e), o = r.find(Xr);
378
378
  if (o) {
379
- const a = o.props.children, l = r.map((f) => f === o ? p.Children.count(a) > 1 ? p.Children.only(null) : p.isValidElement(a) ? a.props.children : null : f);
380
- return /* @__PURE__ */ s(Dt, { ...i, ref: n, children: p.isValidElement(a) ? p.cloneElement(a, void 0, l) : null });
379
+ const s = o.props.children, l = r.map((f) => f === o ? p.Children.count(s) > 1 ? p.Children.only(null) : p.isValidElement(s) ? s.props.children : null : f);
380
+ return /* @__PURE__ */ a(Pt, { ...i, ref: n, children: p.isValidElement(s) ? p.cloneElement(s, void 0, l) : null });
381
381
  }
382
- return /* @__PURE__ */ s(Dt, { ...i, ref: n, children: e });
382
+ return /* @__PURE__ */ a(Pt, { ...i, ref: n, children: e });
383
383
  });
384
- tn.displayName = "Slot";
385
- var Dt = p.forwardRef((t, n) => {
384
+ nn.displayName = "Slot";
385
+ var Pt = p.forwardRef((t, n) => {
386
386
  const { children: e, ...i } = t;
387
387
  if (p.isValidElement(e)) {
388
- const r = Kr(e);
388
+ const r = Yr(e);
389
389
  return p.cloneElement(e, {
390
- ...Xr(i, e.props),
390
+ ...Kr(i, e.props),
391
391
  // @ts-ignore
392
- ref: n ? Zn(n, r) : r
392
+ ref: n ? ei(n, r) : r
393
393
  });
394
394
  }
395
395
  return p.Children.count(e) > 1 ? p.Children.only(null) : null;
396
396
  });
397
- Dt.displayName = "SlotClone";
398
- var Hr = ({ children: t }) => /* @__PURE__ */ s(he, { children: t });
399
- function Gr(t) {
400
- return p.isValidElement(t) && t.type === Hr;
397
+ Pt.displayName = "SlotClone";
398
+ var Gr = ({ children: t }) => /* @__PURE__ */ a(he, { children: t });
399
+ function Xr(t) {
400
+ return p.isValidElement(t) && t.type === Gr;
401
401
  }
402
- function Xr(t, n) {
402
+ function Kr(t, n) {
403
403
  const e = { ...n };
404
404
  for (const i in n) {
405
405
  const r = t[i], o = n[i];
@@ -409,12 +409,12 @@ function Xr(t, n) {
409
409
  }
410
410
  return { ...t, ...e };
411
411
  }
412
- function Kr(t) {
412
+ function Yr(t) {
413
413
  var i, r;
414
414
  let n = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, e = n && "isReactWarning" in n && n.isReactWarning;
415
415
  return e ? t.ref : (n = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
416
416
  }
417
- var Yr = [
417
+ var Qr = [
418
418
  "a",
419
419
  "button",
420
420
  "div",
@@ -431,17 +431,17 @@ var Yr = [
431
431
  "span",
432
432
  "svg",
433
433
  "ul"
434
- ], se = Yr.reduce((t, n) => {
434
+ ], ae = Qr.reduce((t, n) => {
435
435
  const e = p.forwardRef((i, r) => {
436
- const { asChild: o, ...a } = i, l = o ? tn : n;
437
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(l, { ...a, ref: r });
436
+ const { asChild: o, ...s } = i, l = o ? nn : n;
437
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(l, { ...s, ref: r });
438
438
  });
439
439
  return e.displayName = `Primitive.${n}`, { ...t, [n]: e };
440
440
  }, {});
441
- function Qr(t, n) {
442
- t && hr.flushSync(() => t.dispatchEvent(n));
441
+ function Jr(t, n) {
442
+ t && pr.flushSync(() => t.dispatchEvent(n));
443
443
  }
444
- function Jr(t, n = globalThis == null ? void 0 : globalThis.document) {
444
+ function Zr(t, n = globalThis == null ? void 0 : globalThis.document) {
445
445
  const e = pe(t);
446
446
  p.useEffect(() => {
447
447
  const i = (r) => {
@@ -450,41 +450,41 @@ function Jr(t, n = globalThis == null ? void 0 : globalThis.document) {
450
450
  return n.addEventListener("keydown", i, { capture: !0 }), () => n.removeEventListener("keydown", i, { capture: !0 });
451
451
  }, [e, n]);
452
452
  }
453
- var Zr = "DismissableLayer", At = "dismissableLayer.update", eo = "dismissableLayer.pointerDownOutside", to = "dismissableLayer.focusOutside", In, ei = p.createContext({
453
+ var eo = "DismissableLayer", kt = "dismissableLayer.update", to = "dismissableLayer.pointerDownOutside", no = "dismissableLayer.focusOutside", Sn, ti = p.createContext({
454
454
  layers: /* @__PURE__ */ new Set(),
455
455
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
456
456
  branches: /* @__PURE__ */ new Set()
457
- }), ti = p.forwardRef(
457
+ }), ni = p.forwardRef(
458
458
  (t, n) => {
459
459
  const {
460
460
  disableOutsidePointerEvents: e = !1,
461
461
  onEscapeKeyDown: i,
462
462
  onPointerDownOutside: r,
463
463
  onFocusOutside: o,
464
- onInteractOutside: a,
464
+ onInteractOutside: s,
465
465
  onDismiss: l,
466
466
  ...f
467
- } = t, c = p.useContext(ei), [d, u] = p.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = p.useState({}), b = be(n, (R) => u(R)), m = Array.from(c.layers), [v] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), x = m.indexOf(v), E = d ? m.indexOf(d) : -1, S = c.layersWithOutsidePointerEventsDisabled.size > 0, C = E >= x, I = ro((R) => {
468
- const F = R.target, B = [...c.branches].some((z) => z.contains(F));
469
- !C || B || (r == null || r(R), a == null || a(R), R.defaultPrevented || l == null || l());
470
- }, h), L = oo((R) => {
467
+ } = t, c = p.useContext(ti), [d, u] = p.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = p.useState({}), b = we(n, (R) => u(R)), m = Array.from(c.layers), [v] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), x = m.indexOf(v), E = d ? m.indexOf(d) : -1, S = c.layersWithOutsidePointerEventsDisabled.size > 0, C = E >= x, I = oo((R) => {
468
+ const F = R.target, V = [...c.branches].some((_) => _.contains(F));
469
+ !C || V || (r == null || r(R), s == null || s(R), R.defaultPrevented || l == null || l());
470
+ }, h), L = ao((R) => {
471
471
  const F = R.target;
472
- [...c.branches].some((z) => z.contains(F)) || (o == null || o(R), a == null || a(R), R.defaultPrevented || l == null || l());
472
+ [...c.branches].some((_) => _.contains(F)) || (o == null || o(R), s == null || s(R), R.defaultPrevented || l == null || l());
473
473
  }, h);
474
- return Jr((R) => {
474
+ return Zr((R) => {
475
475
  E === c.layers.size - 1 && (i == null || i(R), !R.defaultPrevented && l && (R.preventDefault(), l()));
476
476
  }, h), p.useEffect(() => {
477
477
  if (d)
478
- return e && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (In = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Sn(), () => {
479
- e && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = In);
478
+ return e && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Sn = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Rn(), () => {
479
+ e && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Sn);
480
480
  };
481
481
  }, [d, h, e, c]), p.useEffect(() => () => {
482
- d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Sn());
482
+ d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Rn());
483
483
  }, [d, c]), p.useEffect(() => {
484
484
  const R = () => g({});
485
- return document.addEventListener(At, R), () => document.removeEventListener(At, R);
486
- }, []), /* @__PURE__ */ s(
487
- se.div,
485
+ return document.addEventListener(kt, R), () => document.removeEventListener(kt, R);
486
+ }, []), /* @__PURE__ */ a(
487
+ ae.div,
488
488
  {
489
489
  ...f,
490
490
  ref: b,
@@ -492,9 +492,9 @@ var Zr = "DismissableLayer", At = "dismissableLayer.update", eo = "dismissableLa
492
492
  pointerEvents: S ? C ? "auto" : "none" : void 0,
493
493
  ...t.style
494
494
  },
495
- onFocusCapture: de(t.onFocusCapture, L.onFocusCapture),
496
- onBlurCapture: de(t.onBlurCapture, L.onBlurCapture),
497
- onPointerDownCapture: de(
495
+ onFocusCapture: ce(t.onFocusCapture, L.onFocusCapture),
496
+ onBlurCapture: ce(t.onBlurCapture, L.onBlurCapture),
497
+ onPointerDownCapture: ce(
498
498
  t.onPointerDownCapture,
499
499
  I.onPointerDownCapture
500
500
  )
@@ -502,27 +502,27 @@ var Zr = "DismissableLayer", At = "dismissableLayer.update", eo = "dismissableLa
502
502
  );
503
503
  }
504
504
  );
505
- ti.displayName = Zr;
506
- var no = "DismissableLayerBranch", io = p.forwardRef((t, n) => {
507
- const e = p.useContext(ei), i = p.useRef(null), r = be(n, i);
505
+ ni.displayName = eo;
506
+ var io = "DismissableLayerBranch", ro = p.forwardRef((t, n) => {
507
+ const e = p.useContext(ti), i = p.useRef(null), r = we(n, i);
508
508
  return p.useEffect(() => {
509
509
  const o = i.current;
510
510
  if (o)
511
511
  return e.branches.add(o), () => {
512
512
  e.branches.delete(o);
513
513
  };
514
- }, [e.branches]), /* @__PURE__ */ s(se.div, { ...t, ref: r });
514
+ }, [e.branches]), /* @__PURE__ */ a(ae.div, { ...t, ref: r });
515
515
  });
516
- io.displayName = no;
517
- function ro(t, n = globalThis == null ? void 0 : globalThis.document) {
516
+ ro.displayName = io;
517
+ function oo(t, n = globalThis == null ? void 0 : globalThis.document) {
518
518
  const e = pe(t), i = p.useRef(!1), r = p.useRef(() => {
519
519
  });
520
520
  return p.useEffect(() => {
521
521
  const o = (l) => {
522
522
  if (l.target && !i.current) {
523
523
  let f = function() {
524
- ni(
525
- eo,
524
+ ii(
525
+ to,
526
526
  e,
527
527
  c,
528
528
  { discrete: !0 }
@@ -533,22 +533,22 @@ function ro(t, n = globalThis == null ? void 0 : globalThis.document) {
533
533
  } else
534
534
  n.removeEventListener("click", r.current);
535
535
  i.current = !1;
536
- }, a = window.setTimeout(() => {
536
+ }, s = window.setTimeout(() => {
537
537
  n.addEventListener("pointerdown", o);
538
538
  }, 0);
539
539
  return () => {
540
- window.clearTimeout(a), n.removeEventListener("pointerdown", o), n.removeEventListener("click", r.current);
540
+ window.clearTimeout(s), n.removeEventListener("pointerdown", o), n.removeEventListener("click", r.current);
541
541
  };
542
542
  }, [n, e]), {
543
543
  // ensures we check React component tree (not just DOM tree)
544
544
  onPointerDownCapture: () => i.current = !0
545
545
  };
546
546
  }
547
- function oo(t, n = globalThis == null ? void 0 : globalThis.document) {
547
+ function ao(t, n = globalThis == null ? void 0 : globalThis.document) {
548
548
  const e = pe(t), i = p.useRef(!1);
549
549
  return p.useEffect(() => {
550
550
  const r = (o) => {
551
- o.target && !i.current && ni(to, e, { originalEvent: o }, {
551
+ o.target && !i.current && ii(no, e, { originalEvent: o }, {
552
552
  discrete: !1
553
553
  });
554
554
  };
@@ -558,22 +558,22 @@ function oo(t, n = globalThis == null ? void 0 : globalThis.document) {
558
558
  onBlurCapture: () => i.current = !1
559
559
  };
560
560
  }
561
- function Sn() {
562
- const t = new CustomEvent(At);
561
+ function Rn() {
562
+ const t = new CustomEvent(kt);
563
563
  document.dispatchEvent(t);
564
564
  }
565
- function ni(t, n, e, { discrete: i }) {
565
+ function ii(t, n, e, { discrete: i }) {
566
566
  const r = e.originalEvent.target, o = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: e });
567
- n && r.addEventListener(t, n, { once: !0 }), i ? Qr(r, o) : r.dispatchEvent(o);
567
+ n && r.addEventListener(t, n, { once: !0 }), i ? Jr(r, o) : r.dispatchEvent(o);
568
568
  }
569
- var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn = { bubbles: !1, cancelable: !0 }, ao = "FocusScope", ii = p.forwardRef((t, n) => {
569
+ var Nt = "focusScope.autoFocusOnMount", Tt = "focusScope.autoFocusOnUnmount", Nn = { bubbles: !1, cancelable: !0 }, so = "FocusScope", ri = p.forwardRef((t, n) => {
570
570
  const {
571
571
  loop: e = !1,
572
572
  trapped: i = !1,
573
573
  onMountAutoFocus: r,
574
574
  onUnmountAutoFocus: o,
575
- ...a
576
- } = t, [l, f] = p.useState(null), c = pe(r), d = pe(o), u = p.useRef(null), h = be(n, (m) => f(m)), g = p.useRef({
575
+ ...s
576
+ } = t, [l, f] = p.useState(null), c = pe(r), d = pe(o), u = p.useRef(null), h = we(n, (m) => f(m)), g = p.useRef({
577
577
  paused: !1,
578
578
  pause() {
579
579
  this.paused = !0;
@@ -587,15 +587,15 @@ var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn
587
587
  let m = function(S) {
588
588
  if (g.paused || !l) return;
589
589
  const C = S.target;
590
- l.contains(C) ? u.current = C : ce(u.current, { select: !0 });
590
+ l.contains(C) ? u.current = C : le(u.current, { select: !0 });
591
591
  }, v = function(S) {
592
592
  if (g.paused || !l) return;
593
593
  const C = S.relatedTarget;
594
- C !== null && (l.contains(C) || ce(u.current, { select: !0 }));
594
+ C !== null && (l.contains(C) || le(u.current, { select: !0 }));
595
595
  }, x = function(S) {
596
596
  if (document.activeElement === document.body)
597
597
  for (const I of S)
598
- I.removedNodes.length > 0 && ce(l);
598
+ I.removedNodes.length > 0 && le(l);
599
599
  };
600
600
  document.addEventListener("focusin", m), document.addEventListener("focusout", v);
601
601
  const E = new MutationObserver(x);
@@ -605,16 +605,16 @@ var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn
605
605
  }
606
606
  }, [i, l, g.paused]), p.useEffect(() => {
607
607
  if (l) {
608
- Tn.add(g);
608
+ Ln.add(g);
609
609
  const m = document.activeElement;
610
610
  if (!l.contains(m)) {
611
- const x = new CustomEvent(It, Rn);
612
- l.addEventListener(It, c), l.dispatchEvent(x), x.defaultPrevented || (so(mo(ri(l)), { select: !0 }), document.activeElement === m && ce(l));
611
+ const x = new CustomEvent(Nt, Nn);
612
+ l.addEventListener(Nt, c), l.dispatchEvent(x), x.defaultPrevented || (lo(ho(oi(l)), { select: !0 }), document.activeElement === m && le(l));
613
613
  }
614
614
  return () => {
615
- l.removeEventListener(It, c), setTimeout(() => {
616
- const x = new CustomEvent(St, Rn);
617
- l.addEventListener(St, d), l.dispatchEvent(x), x.defaultPrevented || ce(m ?? document.body, { select: !0 }), l.removeEventListener(St, d), Tn.remove(g);
615
+ l.removeEventListener(Nt, c), setTimeout(() => {
616
+ const x = new CustomEvent(Tt, Nn);
617
+ l.addEventListener(Tt, d), l.dispatchEvent(x), x.defaultPrevented || le(m ?? document.body, { select: !0 }), l.removeEventListener(Tt, d), Ln.remove(g);
618
618
  }, 0);
619
619
  };
620
620
  }
@@ -624,25 +624,25 @@ var It = "focusScope.autoFocusOnMount", St = "focusScope.autoFocusOnUnmount", Rn
624
624
  if (!e && !i || g.paused) return;
625
625
  const v = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, x = document.activeElement;
626
626
  if (v && x) {
627
- const E = m.currentTarget, [S, C] = lo(E);
628
- S && C ? !m.shiftKey && x === C ? (m.preventDefault(), e && ce(S, { select: !0 })) : m.shiftKey && x === S && (m.preventDefault(), e && ce(C, { select: !0 })) : x === E && m.preventDefault();
627
+ const E = m.currentTarget, [S, C] = co(E);
628
+ S && C ? !m.shiftKey && x === C ? (m.preventDefault(), e && le(S, { select: !0 })) : m.shiftKey && x === S && (m.preventDefault(), e && le(C, { select: !0 })) : x === E && m.preventDefault();
629
629
  }
630
630
  },
631
631
  [e, i, g.paused]
632
632
  );
633
- return /* @__PURE__ */ s(se.div, { tabIndex: -1, ...a, ref: h, onKeyDown: b });
633
+ return /* @__PURE__ */ a(ae.div, { tabIndex: -1, ...s, ref: h, onKeyDown: b });
634
634
  });
635
- ii.displayName = ao;
636
- function so(t, { select: n = !1 } = {}) {
635
+ ri.displayName = so;
636
+ function lo(t, { select: n = !1 } = {}) {
637
637
  const e = document.activeElement;
638
638
  for (const i of t)
639
- if (ce(i, { select: n }), document.activeElement !== e) return;
639
+ if (le(i, { select: n }), document.activeElement !== e) return;
640
640
  }
641
- function lo(t) {
642
- const n = ri(t), e = Nn(n, t), i = Nn(n.reverse(), t);
641
+ function co(t) {
642
+ const n = oi(t), e = Tn(n, t), i = Tn(n.reverse(), t);
643
643
  return [e, i];
644
644
  }
645
- function ri(t) {
645
+ function oi(t) {
646
646
  const n = [], e = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
647
647
  acceptNode: (i) => {
648
648
  const r = i.tagName === "INPUT" && i.type === "hidden";
@@ -652,11 +652,11 @@ function ri(t) {
652
652
  for (; e.nextNode(); ) n.push(e.currentNode);
653
653
  return n;
654
654
  }
655
- function Nn(t, n) {
655
+ function Tn(t, n) {
656
656
  for (const e of t)
657
- if (!co(e, { upTo: n })) return e;
657
+ if (!uo(e, { upTo: n })) return e;
658
658
  }
659
- function co(t, { upTo: n }) {
659
+ function uo(t, { upTo: n }) {
660
660
  if (getComputedStyle(t).visibility === "hidden") return !0;
661
661
  for (; t; ) {
662
662
  if (n !== void 0 && t === n) return !1;
@@ -665,54 +665,54 @@ function co(t, { upTo: n }) {
665
665
  }
666
666
  return !1;
667
667
  }
668
- function uo(t) {
668
+ function fo(t) {
669
669
  return t instanceof HTMLInputElement && "select" in t;
670
670
  }
671
- function ce(t, { select: n = !1 } = {}) {
671
+ function le(t, { select: n = !1 } = {}) {
672
672
  if (t && t.focus) {
673
673
  const e = document.activeElement;
674
- t.focus({ preventScroll: !0 }), t !== e && uo(t) && n && t.select();
674
+ t.focus({ preventScroll: !0 }), t !== e && fo(t) && n && t.select();
675
675
  }
676
676
  }
677
- var Tn = fo();
678
- function fo() {
677
+ var Ln = mo();
678
+ function mo() {
679
679
  let t = [];
680
680
  return {
681
681
  add(n) {
682
682
  const e = t[0];
683
- n !== e && (e == null || e.pause()), t = Ln(t, n), t.unshift(n);
683
+ n !== e && (e == null || e.pause()), t = Fn(t, n), t.unshift(n);
684
684
  },
685
685
  remove(n) {
686
686
  var e;
687
- t = Ln(t, n), (e = t[0]) == null || e.resume();
687
+ t = Fn(t, n), (e = t[0]) == null || e.resume();
688
688
  }
689
689
  };
690
690
  }
691
- function Ln(t, n) {
691
+ function Fn(t, n) {
692
692
  const e = [...t], i = e.indexOf(n);
693
693
  return i !== -1 && e.splice(i, 1), e;
694
694
  }
695
- function mo(t) {
695
+ function ho(t) {
696
696
  return t.filter((n) => n.tagName !== "A");
697
697
  }
698
- var ho = "Portal", oi = p.forwardRef((t, n) => {
698
+ var po = "Portal", ai = p.forwardRef((t, n) => {
699
699
  var l;
700
700
  const { container: e, ...i } = t, [r, o] = p.useState(!1);
701
- at(() => o(!0), []);
702
- const a = e || r && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
703
- return a ? pr.createPortal(/* @__PURE__ */ s(se.div, { ...i, ref: n }), a) : null;
701
+ st(() => o(!0), []);
702
+ const s = e || r && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
703
+ return s ? gr.createPortal(/* @__PURE__ */ a(ae.div, { ...i, ref: n }), s) : null;
704
704
  });
705
- oi.displayName = ho;
706
- function po(t, n) {
705
+ ai.displayName = po;
706
+ function go(t, n) {
707
707
  return p.useReducer((e, i) => n[e][i] ?? e, t);
708
708
  }
709
- var bt = (t) => {
710
- const { present: n, children: e } = t, i = go(n), r = typeof e == "function" ? e({ present: i.isPresent }) : p.Children.only(e), o = be(i.ref, vo(r));
709
+ var Ct = (t) => {
710
+ const { present: n, children: e } = t, i = vo(n), r = typeof e == "function" ? e({ present: i.isPresent }) : p.Children.only(e), o = we(i.ref, yo(r));
711
711
  return typeof e == "function" || i.isPresent ? p.cloneElement(r, { ref: o }) : null;
712
712
  };
713
- bt.displayName = "Presence";
714
- function go(t) {
715
- const [n, e] = p.useState(), i = p.useRef({}), r = p.useRef(t), o = p.useRef("none"), a = t ? "mounted" : "unmounted", [l, f] = po(a, {
713
+ Ct.displayName = "Presence";
714
+ function vo(t) {
715
+ const [n, e] = p.useState(), i = p.useRef({}), r = p.useRef(t), o = p.useRef("none"), s = t ? "mounted" : "unmounted", [l, f] = go(s, {
716
716
  mounted: {
717
717
  UNMOUNT: "unmounted",
718
718
  ANIMATION_OUT: "unmountSuspended"
@@ -728,13 +728,13 @@ function go(t) {
728
728
  return p.useEffect(() => {
729
729
  const c = Ge(i.current);
730
730
  o.current = l === "mounted" ? c : "none";
731
- }, [l]), at(() => {
731
+ }, [l]), st(() => {
732
732
  const c = i.current, d = r.current;
733
733
  if (d !== t) {
734
734
  const h = o.current, g = Ge(c);
735
735
  t ? f("MOUNT") : g === "none" || (c == null ? void 0 : c.display) === "none" ? f("UNMOUNT") : f(d && h !== g ? "ANIMATION_OUT" : "UNMOUNT"), r.current = t;
736
736
  }
737
- }, [t, f]), at(() => {
737
+ }, [t, f]), st(() => {
738
738
  if (n) {
739
739
  let c;
740
740
  const d = n.ownerDocument.defaultView ?? window, u = (g) => {
@@ -763,21 +763,21 @@ function go(t) {
763
763
  function Ge(t) {
764
764
  return (t == null ? void 0 : t.animationName) || "none";
765
765
  }
766
- function vo(t) {
766
+ function yo(t) {
767
767
  var i, r;
768
768
  let n = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, e = n && "isReactWarning" in n && n.isReactWarning;
769
769
  return e ? t.ref : (n = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
770
770
  }
771
- var Rt = 0;
772
- function yo() {
771
+ var Lt = 0;
772
+ function bo() {
773
773
  p.useEffect(() => {
774
774
  const t = document.querySelectorAll("[data-radix-focus-guard]");
775
- return document.body.insertAdjacentElement("afterbegin", t[0] ?? Fn()), document.body.insertAdjacentElement("beforeend", t[1] ?? Fn()), Rt++, () => {
776
- Rt === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), Rt--;
775
+ return document.body.insertAdjacentElement("afterbegin", t[0] ?? Dn()), document.body.insertAdjacentElement("beforeend", t[1] ?? Dn()), Lt++, () => {
776
+ Lt === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), Lt--;
777
777
  };
778
778
  }, []);
779
779
  }
780
- function Fn() {
780
+ function Dn() {
781
781
  const t = document.createElement("span");
782
782
  return t.setAttribute("data-radix-focus-guard", ""), t.tabIndex = 0, t.style.outline = "none", t.style.opacity = "0", t.style.position = "fixed", t.style.pointerEvents = "none", t;
783
783
  }
@@ -790,7 +790,7 @@ var te = function() {
790
790
  return n;
791
791
  }, te.apply(this, arguments);
792
792
  };
793
- function ai(t, n) {
793
+ function si(t, n) {
794
794
  var e = {};
795
795
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && n.indexOf(i) < 0 && (e[i] = t[i]);
796
796
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -798,16 +798,16 @@ function ai(t, n) {
798
798
  n.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (e[i[r]] = t[i[r]]);
799
799
  return e;
800
800
  }
801
- function bo(t, n, e) {
801
+ function wo(t, n, e) {
802
802
  if (e || arguments.length === 2) for (var i = 0, r = n.length, o; i < r; i++)
803
803
  (o || !(i in n)) && (o || (o = Array.prototype.slice.call(n, 0, i)), o[i] = n[i]);
804
804
  return t.concat(o || Array.prototype.slice.call(n));
805
805
  }
806
- var et = "right-scroll-bar-position", tt = "width-before-scroll-bar", wo = "with-scroll-bars-hidden", Co = "--removed-body-scroll-bar-size";
807
- function Nt(t, n) {
806
+ var et = "right-scroll-bar-position", tt = "width-before-scroll-bar", Co = "with-scroll-bars-hidden", xo = "--removed-body-scroll-bar-size";
807
+ function Ft(t, n) {
808
808
  return typeof t == "function" ? t(n) : t && (t.current = n), t;
809
809
  }
810
- function xo(t, n) {
810
+ function Eo(t, n) {
811
811
  var e = H(function() {
812
812
  return {
813
813
  // value
@@ -828,31 +828,31 @@ function xo(t, n) {
828
828
  })[0];
829
829
  return e.callback = n, e.facade;
830
830
  }
831
- var Eo = typeof window < "u" ? p.useLayoutEffect : p.useEffect, Dn = /* @__PURE__ */ new WeakMap();
832
- function Io(t, n) {
833
- var e = xo(null, function(i) {
831
+ var Io = typeof window < "u" ? p.useLayoutEffect : p.useEffect, An = /* @__PURE__ */ new WeakMap();
832
+ function So(t, n) {
833
+ var e = Eo(null, function(i) {
834
834
  return t.forEach(function(r) {
835
- return Nt(r, i);
835
+ return Ft(r, i);
836
836
  });
837
837
  });
838
- return Eo(function() {
839
- var i = Dn.get(e);
838
+ return Io(function() {
839
+ var i = An.get(e);
840
840
  if (i) {
841
- var r = new Set(i), o = new Set(t), a = e.current;
841
+ var r = new Set(i), o = new Set(t), s = e.current;
842
842
  r.forEach(function(l) {
843
- o.has(l) || Nt(l, null);
843
+ o.has(l) || Ft(l, null);
844
844
  }), o.forEach(function(l) {
845
- r.has(l) || Nt(l, a);
845
+ r.has(l) || Ft(l, s);
846
846
  });
847
847
  }
848
- Dn.set(e, t);
848
+ An.set(e, t);
849
849
  }, [t]), e;
850
850
  }
851
- function So(t) {
851
+ function Ro(t) {
852
852
  return t;
853
853
  }
854
- function Ro(t, n) {
855
- n === void 0 && (n = So);
854
+ function No(t, n) {
855
+ n === void 0 && (n = Ro);
856
856
  var e = [], i = !1, r = {
857
857
  read: function() {
858
858
  if (i)
@@ -860,17 +860,17 @@ function Ro(t, n) {
860
860
  return e.length ? e[e.length - 1] : t;
861
861
  },
862
862
  useMedium: function(o) {
863
- var a = n(o, i);
864
- return e.push(a), function() {
863
+ var s = n(o, i);
864
+ return e.push(s), function() {
865
865
  e = e.filter(function(l) {
866
- return l !== a;
866
+ return l !== s;
867
867
  });
868
868
  };
869
869
  },
870
870
  assignSyncMedium: function(o) {
871
871
  for (i = !0; e.length; ) {
872
- var a = e;
873
- e = [], a.forEach(o);
872
+ var s = e;
873
+ e = [], s.forEach(o);
874
874
  }
875
875
  e = {
876
876
  push: function(l) {
@@ -883,36 +883,36 @@ function Ro(t, n) {
883
883
  },
884
884
  assignMedium: function(o) {
885
885
  i = !0;
886
- var a = [];
886
+ var s = [];
887
887
  if (e.length) {
888
888
  var l = e;
889
- e = [], l.forEach(o), a = e;
889
+ e = [], l.forEach(o), s = e;
890
890
  }
891
891
  var f = function() {
892
- var d = a;
893
- a = [], d.forEach(o);
892
+ var d = s;
893
+ s = [], d.forEach(o);
894
894
  }, c = function() {
895
895
  return Promise.resolve().then(f);
896
896
  };
897
897
  c(), e = {
898
898
  push: function(d) {
899
- a.push(d), c();
899
+ s.push(d), c();
900
900
  },
901
901
  filter: function(d) {
902
- return a = a.filter(d), e;
902
+ return s = s.filter(d), e;
903
903
  }
904
904
  };
905
905
  }
906
906
  };
907
907
  return r;
908
908
  }
909
- function No(t) {
909
+ function To(t) {
910
910
  t === void 0 && (t = {});
911
- var n = Ro(null);
911
+ var n = No(null);
912
912
  return n.options = te({ async: !0, ssr: !1 }, t), n;
913
913
  }
914
- var si = function(t) {
915
- var n = t.sideCar, e = ai(t, ["sideCar"]);
914
+ var li = function(t) {
915
+ var n = t.sideCar, e = si(t, ["sideCar"]);
916
916
  if (!n)
917
917
  throw new Error("Sidecar: please provide `sideCar` property to import the right car");
918
918
  var i = n.read();
@@ -920,64 +920,64 @@ var si = function(t) {
920
920
  throw new Error("Sidecar medium not found");
921
921
  return p.createElement(i, te({}, e));
922
922
  };
923
- si.isSideCarExport = !0;
924
- function To(t, n) {
925
- return t.useMedium(n), si;
923
+ li.isSideCarExport = !0;
924
+ function Lo(t, n) {
925
+ return t.useMedium(n), li;
926
926
  }
927
- var li = No(), Tt = function() {
928
- }, wt = p.forwardRef(function(t, n) {
927
+ var ci = To(), Dt = function() {
928
+ }, xt = p.forwardRef(function(t, n) {
929
929
  var e = p.useRef(null), i = p.useState({
930
- onScrollCapture: Tt,
931
- onWheelCapture: Tt,
932
- onTouchMoveCapture: Tt
933
- }), r = i[0], o = i[1], a = t.forwardProps, l = t.children, f = t.className, c = t.removeScrollBar, d = t.enabled, u = t.shards, h = t.sideCar, g = t.noIsolation, b = t.inert, m = t.allowPinchZoom, v = t.as, x = v === void 0 ? "div" : v, E = t.gapMode, S = ai(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, I = Io([e, n]), L = te(te({}, S), r);
930
+ onScrollCapture: Dt,
931
+ onWheelCapture: Dt,
932
+ onTouchMoveCapture: Dt
933
+ }), r = i[0], o = i[1], s = t.forwardProps, l = t.children, f = t.className, c = t.removeScrollBar, d = t.enabled, u = t.shards, h = t.sideCar, g = t.noIsolation, b = t.inert, m = t.allowPinchZoom, v = t.as, x = v === void 0 ? "div" : v, E = t.gapMode, S = si(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, I = So([e, n]), L = te(te({}, S), r);
934
934
  return p.createElement(
935
935
  p.Fragment,
936
936
  null,
937
- d && p.createElement(C, { sideCar: li, removeScrollBar: c, shards: u, noIsolation: g, inert: b, setCallbacks: o, allowPinchZoom: !!m, lockRef: e, gapMode: E }),
938
- a ? p.cloneElement(p.Children.only(l), te(te({}, L), { ref: I })) : p.createElement(x, te({}, L, { className: f, ref: I }), l)
937
+ d && p.createElement(C, { sideCar: ci, removeScrollBar: c, shards: u, noIsolation: g, inert: b, setCallbacks: o, allowPinchZoom: !!m, lockRef: e, gapMode: E }),
938
+ s ? p.cloneElement(p.Children.only(l), te(te({}, L), { ref: I })) : p.createElement(x, te({}, L, { className: f, ref: I }), l)
939
939
  );
940
940
  });
941
- wt.defaultProps = {
941
+ xt.defaultProps = {
942
942
  enabled: !0,
943
943
  removeScrollBar: !0,
944
944
  inert: !1
945
945
  };
946
- wt.classNames = {
946
+ xt.classNames = {
947
947
  fullWidth: tt,
948
948
  zeroRight: et
949
949
  };
950
- var Lo = function() {
950
+ var Fo = function() {
951
951
  if (typeof __webpack_nonce__ < "u")
952
952
  return __webpack_nonce__;
953
953
  };
954
- function Fo() {
954
+ function Do() {
955
955
  if (!document)
956
956
  return null;
957
957
  var t = document.createElement("style");
958
958
  t.type = "text/css";
959
- var n = Lo();
959
+ var n = Fo();
960
960
  return n && t.setAttribute("nonce", n), t;
961
961
  }
962
- function Do(t, n) {
962
+ function Ao(t, n) {
963
963
  t.styleSheet ? t.styleSheet.cssText = n : t.appendChild(document.createTextNode(n));
964
964
  }
965
- function Ao(t) {
965
+ function Oo(t) {
966
966
  var n = document.head || document.getElementsByTagName("head")[0];
967
967
  n.appendChild(t);
968
968
  }
969
- var Oo = function() {
969
+ var Po = function() {
970
970
  var t = 0, n = null;
971
971
  return {
972
972
  add: function(e) {
973
- t == 0 && (n = Fo()) && (Do(n, e), Ao(n)), t++;
973
+ t == 0 && (n = Do()) && (Ao(n, e), Oo(n)), t++;
974
974
  },
975
975
  remove: function() {
976
976
  t--, !t && n && (n.parentNode && n.parentNode.removeChild(n), n = null);
977
977
  }
978
978
  };
979
- }, Po = function() {
980
- var t = Oo();
979
+ }, ko = function() {
980
+ var t = Po();
981
981
  return function(n, e) {
982
982
  p.useEffect(function() {
983
983
  return t.add(n), function() {
@@ -985,40 +985,40 @@ var Oo = function() {
985
985
  };
986
986
  }, [n && e]);
987
987
  };
988
- }, ci = function() {
989
- var t = Po(), n = function(e) {
988
+ }, di = function() {
989
+ var t = ko(), n = function(e) {
990
990
  var i = e.styles, r = e.dynamic;
991
991
  return t(i, r), null;
992
992
  };
993
993
  return n;
994
- }, ko = {
994
+ }, Mo = {
995
995
  left: 0,
996
996
  top: 0,
997
997
  right: 0,
998
998
  gap: 0
999
- }, Lt = function(t) {
999
+ }, At = function(t) {
1000
1000
  return parseInt(t || "", 10) || 0;
1001
- }, Mo = function(t) {
1001
+ }, zo = function(t) {
1002
1002
  var n = window.getComputedStyle(document.body), e = n[t === "padding" ? "paddingLeft" : "marginLeft"], i = n[t === "padding" ? "paddingTop" : "marginTop"], r = n[t === "padding" ? "paddingRight" : "marginRight"];
1003
- return [Lt(e), Lt(i), Lt(r)];
1003
+ return [At(e), At(i), At(r)];
1004
1004
  }, _o = function(t) {
1005
1005
  if (t === void 0 && (t = "margin"), typeof window > "u")
1006
- return ko;
1007
- var n = Mo(t), e = document.documentElement.clientWidth, i = window.innerWidth;
1006
+ return Mo;
1007
+ var n = zo(t), e = document.documentElement.clientWidth, i = window.innerWidth;
1008
1008
  return {
1009
1009
  left: n[0],
1010
1010
  top: n[1],
1011
1011
  right: n[2],
1012
1012
  gap: Math.max(0, i - e + n[2] - n[0])
1013
1013
  };
1014
- }, zo = ci(), ze = "data-scroll-locked", $o = function(t, n, e, i) {
1015
- var r = t.left, o = t.top, a = t.right, l = t.gap;
1014
+ }, $o = di(), $e = "data-scroll-locked", Bo = function(t, n, e, i) {
1015
+ var r = t.left, o = t.top, s = t.right, l = t.gap;
1016
1016
  return e === void 0 && (e = "margin"), `
1017
- .`.concat(wo, ` {
1017
+ .`.concat(Co, ` {
1018
1018
  overflow: hidden `).concat(i, `;
1019
1019
  padding-right: `).concat(l, "px ").concat(i, `;
1020
1020
  }
1021
- body[`).concat(ze, `] {
1021
+ body[`).concat($e, `] {
1022
1022
  overflow: hidden `).concat(i, `;
1023
1023
  overscroll-behavior: contain;
1024
1024
  `).concat([
@@ -1026,7 +1026,7 @@ var Oo = function() {
1026
1026
  e === "margin" && `
1027
1027
  padding-left: `.concat(r, `px;
1028
1028
  padding-top: `).concat(o, `px;
1029
- padding-right: `).concat(a, `px;
1029
+ padding-right: `).concat(s, `px;
1030
1030
  margin-left:0;
1031
1031
  margin-top:0;
1032
1032
  margin-right: `).concat(l, "px ").concat(i, `;
@@ -1051,92 +1051,92 @@ var Oo = function() {
1051
1051
  margin-right: 0 `).concat(i, `;
1052
1052
  }
1053
1053
 
1054
- body[`).concat(ze, `] {
1055
- `).concat(Co, ": ").concat(l, `px;
1054
+ body[`).concat($e, `] {
1055
+ `).concat(xo, ": ").concat(l, `px;
1056
1056
  }
1057
1057
  `);
1058
- }, An = function() {
1059
- var t = parseInt(document.body.getAttribute(ze) || "0", 10);
1058
+ }, On = function() {
1059
+ var t = parseInt(document.body.getAttribute($e) || "0", 10);
1060
1060
  return isFinite(t) ? t : 0;
1061
1061
  }, Vo = function() {
1062
1062
  p.useEffect(function() {
1063
- return document.body.setAttribute(ze, (An() + 1).toString()), function() {
1064
- var t = An() - 1;
1065
- t <= 0 ? document.body.removeAttribute(ze) : document.body.setAttribute(ze, t.toString());
1063
+ return document.body.setAttribute($e, (On() + 1).toString()), function() {
1064
+ var t = On() - 1;
1065
+ t <= 0 ? document.body.removeAttribute($e) : document.body.setAttribute($e, t.toString());
1066
1066
  };
1067
1067
  }, []);
1068
- }, Bo = function(t) {
1068
+ }, Uo = function(t) {
1069
1069
  var n = t.noRelative, e = t.noImportant, i = t.gapMode, r = i === void 0 ? "margin" : i;
1070
1070
  Vo();
1071
1071
  var o = p.useMemo(function() {
1072
1072
  return _o(r);
1073
1073
  }, [r]);
1074
- return p.createElement(zo, { styles: $o(o, !n, r, e ? "" : "!important") });
1075
- }, Ot = !1;
1074
+ return p.createElement($o, { styles: Bo(o, !n, r, e ? "" : "!important") });
1075
+ }, Mt = !1;
1076
1076
  if (typeof window < "u")
1077
1077
  try {
1078
1078
  var Xe = Object.defineProperty({}, "passive", {
1079
1079
  get: function() {
1080
- return Ot = !0, !0;
1080
+ return Mt = !0, !0;
1081
1081
  }
1082
1082
  });
1083
1083
  window.addEventListener("test", Xe, Xe), window.removeEventListener("test", Xe, Xe);
1084
1084
  } catch {
1085
- Ot = !1;
1085
+ Mt = !1;
1086
1086
  }
1087
- var Ie = Ot ? { passive: !1 } : !1, Uo = function(t) {
1087
+ var Se = Mt ? { passive: !1 } : !1, jo = function(t) {
1088
1088
  return t.tagName === "TEXTAREA";
1089
- }, di = function(t, n) {
1089
+ }, ui = function(t, n) {
1090
1090
  if (!(t instanceof Element))
1091
1091
  return !1;
1092
1092
  var e = window.getComputedStyle(t);
1093
1093
  return (
1094
1094
  // not-not-scrollable
1095
1095
  e[n] !== "hidden" && // contains scroll inside self
1096
- !(e.overflowY === e.overflowX && !Uo(t) && e[n] === "visible")
1096
+ !(e.overflowY === e.overflowX && !jo(t) && e[n] === "visible")
1097
1097
  );
1098
- }, jo = function(t) {
1099
- return di(t, "overflowY");
1100
1098
  }, Wo = function(t) {
1101
- return di(t, "overflowX");
1102
- }, On = function(t, n) {
1099
+ return ui(t, "overflowY");
1100
+ }, qo = function(t) {
1101
+ return ui(t, "overflowX");
1102
+ }, Pn = function(t, n) {
1103
1103
  var e = n.ownerDocument, i = n;
1104
1104
  do {
1105
1105
  typeof ShadowRoot < "u" && i instanceof ShadowRoot && (i = i.host);
1106
- var r = ui(t, i);
1106
+ var r = fi(t, i);
1107
1107
  if (r) {
1108
- var o = fi(t, i), a = o[1], l = o[2];
1109
- if (a > l)
1108
+ var o = mi(t, i), s = o[1], l = o[2];
1109
+ if (s > l)
1110
1110
  return !0;
1111
1111
  }
1112
1112
  i = i.parentNode;
1113
1113
  } while (i && i !== e.body);
1114
1114
  return !1;
1115
- }, qo = function(t) {
1115
+ }, Ho = function(t) {
1116
1116
  var n = t.scrollTop, e = t.scrollHeight, i = t.clientHeight;
1117
1117
  return [
1118
1118
  n,
1119
1119
  e,
1120
1120
  i
1121
1121
  ];
1122
- }, Ho = function(t) {
1122
+ }, Go = function(t) {
1123
1123
  var n = t.scrollLeft, e = t.scrollWidth, i = t.clientWidth;
1124
1124
  return [
1125
1125
  n,
1126
1126
  e,
1127
1127
  i
1128
1128
  ];
1129
- }, ui = function(t, n) {
1130
- return t === "v" ? jo(n) : Wo(n);
1131
1129
  }, fi = function(t, n) {
1132
- return t === "v" ? qo(n) : Ho(n);
1133
- }, Go = function(t, n) {
1130
+ return t === "v" ? Wo(n) : qo(n);
1131
+ }, mi = function(t, n) {
1132
+ return t === "v" ? Ho(n) : Go(n);
1133
+ }, Xo = function(t, n) {
1134
1134
  return t === "h" && n === "rtl" ? -1 : 1;
1135
- }, Xo = function(t, n, e, i, r) {
1136
- var o = Go(t, window.getComputedStyle(n).direction), a = o * i, l = e.target, f = n.contains(l), c = !1, d = a > 0, u = 0, h = 0;
1135
+ }, Ko = function(t, n, e, i, r) {
1136
+ var o = Xo(t, window.getComputedStyle(n).direction), s = o * i, l = e.target, f = n.contains(l), c = !1, d = s > 0, u = 0, h = 0;
1137
1137
  do {
1138
- var g = fi(t, l), b = g[0], m = g[1], v = g[2], x = m - v - o * b;
1139
- (b || x) && ui(t, l) && (u += x, h += b), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
1138
+ var g = mi(t, l), b = g[0], m = g[1], v = g[2], x = m - v - o * b;
1139
+ (b || x) && fi(t, l) && (u += x, h += b), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
1140
1140
  } while (
1141
1141
  // portaled content
1142
1142
  !f && l !== document.body || // self content
@@ -1145,26 +1145,26 @@ var Ie = Ot ? { passive: !1 } : !1, Uo = function(t) {
1145
1145
  return (d && Math.abs(u) < 1 || !d && Math.abs(h) < 1) && (c = !0), c;
1146
1146
  }, Ke = function(t) {
1147
1147
  return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
1148
- }, Pn = function(t) {
1149
- return [t.deltaX, t.deltaY];
1150
1148
  }, kn = function(t) {
1149
+ return [t.deltaX, t.deltaY];
1150
+ }, Mn = function(t) {
1151
1151
  return t && "current" in t ? t.current : t;
1152
- }, Ko = function(t, n) {
1152
+ }, Yo = function(t, n) {
1153
1153
  return t[0] === n[0] && t[1] === n[1];
1154
- }, Yo = function(t) {
1154
+ }, Qo = function(t) {
1155
1155
  return `
1156
1156
  .block-interactivity-`.concat(t, ` {pointer-events: none;}
1157
1157
  .allow-interactivity-`).concat(t, ` {pointer-events: all;}
1158
1158
  `);
1159
- }, Qo = 0, Se = [];
1160
- function Jo(t) {
1161
- var n = p.useRef([]), e = p.useRef([0, 0]), i = p.useRef(), r = p.useState(Qo++)[0], o = p.useState(ci)[0], a = p.useRef(t);
1159
+ }, Jo = 0, Re = [];
1160
+ function Zo(t) {
1161
+ var n = p.useRef([]), e = p.useRef([0, 0]), i = p.useRef(), r = p.useState(Jo++)[0], o = p.useState(di)[0], s = p.useRef(t);
1162
1162
  p.useEffect(function() {
1163
- a.current = t;
1163
+ s.current = t;
1164
1164
  }, [t]), p.useEffect(function() {
1165
1165
  if (t.inert) {
1166
1166
  document.body.classList.add("block-interactivity-".concat(r));
1167
- var m = bo([t.lockRef.current], (t.shards || []).map(kn), !0).filter(Boolean);
1167
+ var m = wo([t.lockRef.current], (t.shards || []).map(Mn), !0).filter(Boolean);
1168
1168
  return m.forEach(function(v) {
1169
1169
  return v.classList.add("allow-interactivity-".concat(r));
1170
1170
  }), function() {
@@ -1176,38 +1176,38 @@ function Jo(t) {
1176
1176
  }, [t.inert, t.lockRef.current, t.shards]);
1177
1177
  var l = p.useCallback(function(m, v) {
1178
1178
  if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
1179
- return !a.current.allowPinchZoom;
1179
+ return !s.current.allowPinchZoom;
1180
1180
  var x = Ke(m), E = e.current, S = "deltaX" in m ? m.deltaX : E[0] - x[0], C = "deltaY" in m ? m.deltaY : E[1] - x[1], I, L = m.target, R = Math.abs(S) > Math.abs(C) ? "h" : "v";
1181
1181
  if ("touches" in m && R === "h" && L.type === "range")
1182
1182
  return !1;
1183
- var F = On(R, L);
1183
+ var F = Pn(R, L);
1184
1184
  if (!F)
1185
1185
  return !0;
1186
- if (F ? I = R : (I = R === "v" ? "h" : "v", F = On(R, L)), !F)
1186
+ if (F ? I = R : (I = R === "v" ? "h" : "v", F = Pn(R, L)), !F)
1187
1187
  return !1;
1188
1188
  if (!i.current && "changedTouches" in m && (S || C) && (i.current = I), !I)
1189
1189
  return !0;
1190
- var B = i.current || I;
1191
- return Xo(B, v, m, B === "h" ? S : C);
1190
+ var V = i.current || I;
1191
+ return Ko(V, v, m, V === "h" ? S : C);
1192
1192
  }, []), f = p.useCallback(function(m) {
1193
1193
  var v = m;
1194
- if (!(!Se.length || Se[Se.length - 1] !== o)) {
1195
- var x = "deltaY" in v ? Pn(v) : Ke(v), E = n.current.filter(function(I) {
1196
- return I.name === v.type && (I.target === v.target || v.target === I.shadowParent) && Ko(I.delta, x);
1194
+ if (!(!Re.length || Re[Re.length - 1] !== o)) {
1195
+ var x = "deltaY" in v ? kn(v) : Ke(v), E = n.current.filter(function(I) {
1196
+ return I.name === v.type && (I.target === v.target || v.target === I.shadowParent) && Yo(I.delta, x);
1197
1197
  })[0];
1198
1198
  if (E && E.should) {
1199
1199
  v.cancelable && v.preventDefault();
1200
1200
  return;
1201
1201
  }
1202
1202
  if (!E) {
1203
- var S = (a.current.shards || []).map(kn).filter(Boolean).filter(function(I) {
1203
+ var S = (s.current.shards || []).map(Mn).filter(Boolean).filter(function(I) {
1204
1204
  return I.contains(v.target);
1205
- }), C = S.length > 0 ? l(v, S[0]) : !a.current.noIsolation;
1205
+ }), C = S.length > 0 ? l(v, S[0]) : !s.current.noIsolation;
1206
1206
  C && v.cancelable && v.preventDefault();
1207
1207
  }
1208
1208
  }
1209
1209
  }, []), c = p.useCallback(function(m, v, x, E) {
1210
- var S = { name: m, delta: v, target: x, should: E, shadowParent: Zo(x) };
1210
+ var S = { name: m, delta: v, target: x, should: E, shadowParent: ea(x) };
1211
1211
  n.current.push(S), setTimeout(function() {
1212
1212
  n.current = n.current.filter(function(C) {
1213
1213
  return C !== S;
@@ -1216,59 +1216,59 @@ function Jo(t) {
1216
1216
  }, []), d = p.useCallback(function(m) {
1217
1217
  e.current = Ke(m), i.current = void 0;
1218
1218
  }, []), u = p.useCallback(function(m) {
1219
- c(m.type, Pn(m), m.target, l(m, t.lockRef.current));
1219
+ c(m.type, kn(m), m.target, l(m, t.lockRef.current));
1220
1220
  }, []), h = p.useCallback(function(m) {
1221
1221
  c(m.type, Ke(m), m.target, l(m, t.lockRef.current));
1222
1222
  }, []);
1223
1223
  p.useEffect(function() {
1224
- return Se.push(o), t.setCallbacks({
1224
+ return Re.push(o), t.setCallbacks({
1225
1225
  onScrollCapture: u,
1226
1226
  onWheelCapture: u,
1227
1227
  onTouchMoveCapture: h
1228
- }), document.addEventListener("wheel", f, Ie), document.addEventListener("touchmove", f, Ie), document.addEventListener("touchstart", d, Ie), function() {
1229
- Se = Se.filter(function(m) {
1228
+ }), document.addEventListener("wheel", f, Se), document.addEventListener("touchmove", f, Se), document.addEventListener("touchstart", d, Se), function() {
1229
+ Re = Re.filter(function(m) {
1230
1230
  return m !== o;
1231
- }), document.removeEventListener("wheel", f, Ie), document.removeEventListener("touchmove", f, Ie), document.removeEventListener("touchstart", d, Ie);
1231
+ }), document.removeEventListener("wheel", f, Se), document.removeEventListener("touchmove", f, Se), document.removeEventListener("touchstart", d, Se);
1232
1232
  };
1233
1233
  }, []);
1234
1234
  var g = t.removeScrollBar, b = t.inert;
1235
1235
  return p.createElement(
1236
1236
  p.Fragment,
1237
1237
  null,
1238
- b ? p.createElement(o, { styles: Yo(r) }) : null,
1239
- g ? p.createElement(Bo, { gapMode: t.gapMode }) : null
1238
+ b ? p.createElement(o, { styles: Qo(r) }) : null,
1239
+ g ? p.createElement(Uo, { gapMode: t.gapMode }) : null
1240
1240
  );
1241
1241
  }
1242
- function Zo(t) {
1242
+ function ea(t) {
1243
1243
  for (var n = null; t !== null; )
1244
1244
  t instanceof ShadowRoot && (n = t.host, t = t.host), t = t.parentNode;
1245
1245
  return n;
1246
1246
  }
1247
- const ea = To(li, Jo);
1248
- var mi = p.forwardRef(function(t, n) {
1249
- return p.createElement(wt, te({}, t, { ref: n, sideCar: ea }));
1247
+ const ta = Lo(ci, Zo);
1248
+ var hi = p.forwardRef(function(t, n) {
1249
+ return p.createElement(xt, te({}, t, { ref: n, sideCar: ta }));
1250
1250
  });
1251
- mi.classNames = wt.classNames;
1252
- var ta = function(t) {
1251
+ hi.classNames = xt.classNames;
1252
+ var na = function(t) {
1253
1253
  if (typeof document > "u")
1254
1254
  return null;
1255
1255
  var n = Array.isArray(t) ? t[0] : t;
1256
1256
  return n.ownerDocument.body;
1257
- }, Re = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), Qe = {}, Ft = 0, hi = function(t) {
1258
- return t && (t.host || hi(t.parentNode));
1259
- }, na = function(t, n) {
1257
+ }, Ne = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), Qe = {}, Ot = 0, pi = function(t) {
1258
+ return t && (t.host || pi(t.parentNode));
1259
+ }, ia = function(t, n) {
1260
1260
  return n.map(function(e) {
1261
1261
  if (t.contains(e))
1262
1262
  return e;
1263
- var i = hi(e);
1263
+ var i = pi(e);
1264
1264
  return i && t.contains(i) ? i : (console.error("aria-hidden", e, "in not contained inside", t, ". Doing nothing"), null);
1265
1265
  }).filter(function(e) {
1266
1266
  return !!e;
1267
1267
  });
1268
- }, ia = function(t, n, e, i) {
1269
- var r = na(n, Array.isArray(t) ? t : [t]);
1268
+ }, ra = function(t, n, e, i) {
1269
+ var r = ia(n, Array.isArray(t) ? t : [t]);
1270
1270
  Qe[e] || (Qe[e] = /* @__PURE__ */ new WeakMap());
1271
- var o = Qe[e], a = [], l = /* @__PURE__ */ new Set(), f = new Set(r), c = function(u) {
1271
+ var o = Qe[e], s = [], l = /* @__PURE__ */ new Set(), f = new Set(r), c = function(u) {
1272
1272
  !u || l.has(u) || (l.add(u), c(u.parentNode));
1273
1273
  };
1274
1274
  r.forEach(c);
@@ -1278,99 +1278,99 @@ var ta = function(t) {
1278
1278
  d(h);
1279
1279
  else
1280
1280
  try {
1281
- var g = h.getAttribute(i), b = g !== null && g !== "false", m = (Re.get(h) || 0) + 1, v = (o.get(h) || 0) + 1;
1282
- Re.set(h, m), o.set(h, v), a.push(h), m === 1 && b && Ye.set(h, !0), v === 1 && h.setAttribute(e, "true"), b || h.setAttribute(i, "true");
1281
+ var g = h.getAttribute(i), b = g !== null && g !== "false", m = (Ne.get(h) || 0) + 1, v = (o.get(h) || 0) + 1;
1282
+ Ne.set(h, m), o.set(h, v), s.push(h), m === 1 && b && Ye.set(h, !0), v === 1 && h.setAttribute(e, "true"), b || h.setAttribute(i, "true");
1283
1283
  } catch (x) {
1284
1284
  console.error("aria-hidden: cannot operate on ", h, x);
1285
1285
  }
1286
1286
  });
1287
1287
  };
1288
- return d(n), l.clear(), Ft++, function() {
1289
- a.forEach(function(u) {
1290
- var h = Re.get(u) - 1, g = o.get(u) - 1;
1291
- Re.set(u, h), o.set(u, g), h || (Ye.has(u) || u.removeAttribute(i), Ye.delete(u)), g || u.removeAttribute(e);
1292
- }), Ft--, Ft || (Re = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), Qe = {});
1288
+ return d(n), l.clear(), Ot++, function() {
1289
+ s.forEach(function(u) {
1290
+ var h = Ne.get(u) - 1, g = o.get(u) - 1;
1291
+ Ne.set(u, h), o.set(u, g), h || (Ye.has(u) || u.removeAttribute(i), Ye.delete(u)), g || u.removeAttribute(e);
1292
+ }), Ot--, Ot || (Ne = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), Qe = {});
1293
1293
  };
1294
- }, ra = function(t, n, e) {
1294
+ }, oa = function(t, n, e) {
1295
1295
  e === void 0 && (e = "data-aria-hidden");
1296
- var i = Array.from(Array.isArray(t) ? t : [t]), r = ta(t);
1297
- return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))), ia(i, r, e, "aria-hidden")) : function() {
1296
+ var i = Array.from(Array.isArray(t) ? t : [t]), r = na(t);
1297
+ return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))), ra(i, r, e, "aria-hidden")) : function() {
1298
1298
  return null;
1299
1299
  };
1300
- }, nn = "Dialog", [pi, hs] = Vr(nn), [oa, J] = pi(nn), gi = (t) => {
1300
+ }, rn = "Dialog", [gi, ps] = Vr(rn), [aa, J] = gi(rn), vi = (t) => {
1301
1301
  const {
1302
1302
  __scopeDialog: n,
1303
1303
  children: e,
1304
1304
  open: i,
1305
1305
  defaultOpen: r,
1306
1306
  onOpenChange: o,
1307
- modal: a = !0
1308
- } = t, l = p.useRef(null), f = p.useRef(null), [c = !1, d] = Wr({
1307
+ modal: s = !0
1308
+ } = t, l = p.useRef(null), f = p.useRef(null), [c = !1, d] = qr({
1309
1309
  prop: i,
1310
1310
  defaultProp: r,
1311
1311
  onChange: o
1312
1312
  });
1313
- return /* @__PURE__ */ s(
1314
- oa,
1313
+ return /* @__PURE__ */ a(
1314
+ aa,
1315
1315
  {
1316
1316
  scope: n,
1317
1317
  triggerRef: l,
1318
1318
  contentRef: f,
1319
- contentId: Et(),
1320
- titleId: Et(),
1321
- descriptionId: Et(),
1319
+ contentId: Rt(),
1320
+ titleId: Rt(),
1321
+ descriptionId: Rt(),
1322
1322
  open: c,
1323
1323
  onOpenChange: d,
1324
1324
  onOpenToggle: p.useCallback(() => d((u) => !u), [d]),
1325
- modal: a,
1325
+ modal: s,
1326
1326
  children: e
1327
1327
  }
1328
1328
  );
1329
1329
  };
1330
- gi.displayName = nn;
1331
- var vi = "DialogTrigger", aa = p.forwardRef(
1330
+ vi.displayName = rn;
1331
+ var yi = "DialogTrigger", sa = p.forwardRef(
1332
1332
  (t, n) => {
1333
- const { __scopeDialog: e, ...i } = t, r = J(vi, e), o = be(n, r.triggerRef);
1334
- return /* @__PURE__ */ s(
1335
- se.button,
1333
+ const { __scopeDialog: e, ...i } = t, r = J(yi, e), o = we(n, r.triggerRef);
1334
+ return /* @__PURE__ */ a(
1335
+ ae.button,
1336
1336
  {
1337
1337
  type: "button",
1338
1338
  "aria-haspopup": "dialog",
1339
1339
  "aria-expanded": r.open,
1340
1340
  "aria-controls": r.contentId,
1341
- "data-state": an(r.open),
1341
+ "data-state": sn(r.open),
1342
1342
  ...i,
1343
1343
  ref: o,
1344
- onClick: de(t.onClick, r.onOpenToggle)
1344
+ onClick: ce(t.onClick, r.onOpenToggle)
1345
1345
  }
1346
1346
  );
1347
1347
  }
1348
1348
  );
1349
- aa.displayName = vi;
1350
- var rn = "DialogPortal", [sa, yi] = pi(rn, {
1349
+ sa.displayName = yi;
1350
+ var on = "DialogPortal", [la, bi] = gi(on, {
1351
1351
  forceMount: void 0
1352
- }), bi = (t) => {
1353
- const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o = J(rn, n);
1354
- return /* @__PURE__ */ s(sa, { scope: n, forceMount: e, children: p.Children.map(i, (a) => /* @__PURE__ */ s(bt, { present: e || o.open, children: /* @__PURE__ */ s(oi, { asChild: !0, container: r, children: a }) })) });
1352
+ }), wi = (t) => {
1353
+ const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o = J(on, n);
1354
+ return /* @__PURE__ */ a(la, { scope: n, forceMount: e, children: p.Children.map(i, (s) => /* @__PURE__ */ a(Ct, { present: e || o.open, children: /* @__PURE__ */ a(ai, { asChild: !0, container: r, children: s }) })) });
1355
1355
  };
1356
- bi.displayName = rn;
1357
- var st = "DialogOverlay", wi = p.forwardRef(
1356
+ wi.displayName = on;
1357
+ var lt = "DialogOverlay", Ci = p.forwardRef(
1358
1358
  (t, n) => {
1359
- const e = yi(st, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = J(st, t.__scopeDialog);
1360
- return o.modal ? /* @__PURE__ */ s(bt, { present: i || o.open, children: /* @__PURE__ */ s(la, { ...r, ref: n }) }) : null;
1359
+ const e = bi(lt, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = J(lt, t.__scopeDialog);
1360
+ return o.modal ? /* @__PURE__ */ a(Ct, { present: i || o.open, children: /* @__PURE__ */ a(ca, { ...r, ref: n }) }) : null;
1361
1361
  }
1362
1362
  );
1363
- wi.displayName = st;
1364
- var la = p.forwardRef(
1363
+ Ci.displayName = lt;
1364
+ var ca = p.forwardRef(
1365
1365
  (t, n) => {
1366
- const { __scopeDialog: e, ...i } = t, r = J(st, e);
1366
+ const { __scopeDialog: e, ...i } = t, r = J(lt, e);
1367
1367
  return (
1368
1368
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1369
1369
  // ie. when `Overlay` and `Content` are siblings
1370
- /* @__PURE__ */ s(mi, { as: tn, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ s(
1371
- se.div,
1370
+ /* @__PURE__ */ a(hi, { as: nn, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ a(
1371
+ ae.div,
1372
1372
  {
1373
- "data-state": an(r.open),
1373
+ "data-state": sn(r.open),
1374
1374
  ...i,
1375
1375
  ref: n,
1376
1376
  style: { pointerEvents: "auto", ...i.style }
@@ -1378,85 +1378,85 @@ var la = p.forwardRef(
1378
1378
  ) })
1379
1379
  );
1380
1380
  }
1381
- ), ge = "DialogContent", Ci = p.forwardRef(
1381
+ ), ge = "DialogContent", xi = p.forwardRef(
1382
1382
  (t, n) => {
1383
- const e = yi(ge, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = J(ge, t.__scopeDialog);
1384
- return /* @__PURE__ */ s(bt, { present: i || o.open, children: o.modal ? /* @__PURE__ */ s(ca, { ...r, ref: n }) : /* @__PURE__ */ s(da, { ...r, ref: n }) });
1383
+ const e = bi(ge, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = J(ge, t.__scopeDialog);
1384
+ return /* @__PURE__ */ a(Ct, { present: i || o.open, children: o.modal ? /* @__PURE__ */ a(da, { ...r, ref: n }) : /* @__PURE__ */ a(ua, { ...r, ref: n }) });
1385
1385
  }
1386
1386
  );
1387
- Ci.displayName = ge;
1388
- var ca = p.forwardRef(
1387
+ xi.displayName = ge;
1388
+ var da = p.forwardRef(
1389
1389
  (t, n) => {
1390
- const e = J(ge, t.__scopeDialog), i = p.useRef(null), r = be(n, e.contentRef, i);
1390
+ const e = J(ge, t.__scopeDialog), i = p.useRef(null), r = we(n, e.contentRef, i);
1391
1391
  return p.useEffect(() => {
1392
1392
  const o = i.current;
1393
- if (o) return ra(o);
1394
- }, []), /* @__PURE__ */ s(
1395
- xi,
1393
+ if (o) return oa(o);
1394
+ }, []), /* @__PURE__ */ a(
1395
+ Ei,
1396
1396
  {
1397
1397
  ...t,
1398
1398
  ref: r,
1399
1399
  trapFocus: e.open,
1400
1400
  disableOutsidePointerEvents: !0,
1401
- onCloseAutoFocus: de(t.onCloseAutoFocus, (o) => {
1402
- var a;
1403
- o.preventDefault(), (a = e.triggerRef.current) == null || a.focus();
1401
+ onCloseAutoFocus: ce(t.onCloseAutoFocus, (o) => {
1402
+ var s;
1403
+ o.preventDefault(), (s = e.triggerRef.current) == null || s.focus();
1404
1404
  }),
1405
- onPointerDownOutside: de(t.onPointerDownOutside, (o) => {
1406
- const a = o.detail.originalEvent, l = a.button === 0 && a.ctrlKey === !0;
1407
- (a.button === 2 || l) && o.preventDefault();
1405
+ onPointerDownOutside: ce(t.onPointerDownOutside, (o) => {
1406
+ const s = o.detail.originalEvent, l = s.button === 0 && s.ctrlKey === !0;
1407
+ (s.button === 2 || l) && o.preventDefault();
1408
1408
  }),
1409
- onFocusOutside: de(
1409
+ onFocusOutside: ce(
1410
1410
  t.onFocusOutside,
1411
1411
  (o) => o.preventDefault()
1412
1412
  )
1413
1413
  }
1414
1414
  );
1415
1415
  }
1416
- ), da = p.forwardRef(
1416
+ ), ua = p.forwardRef(
1417
1417
  (t, n) => {
1418
1418
  const e = J(ge, t.__scopeDialog), i = p.useRef(!1), r = p.useRef(!1);
1419
- return /* @__PURE__ */ s(
1420
- xi,
1419
+ return /* @__PURE__ */ a(
1420
+ Ei,
1421
1421
  {
1422
1422
  ...t,
1423
1423
  ref: n,
1424
1424
  trapFocus: !1,
1425
1425
  disableOutsidePointerEvents: !1,
1426
1426
  onCloseAutoFocus: (o) => {
1427
- var a, l;
1428
- (a = t.onCloseAutoFocus) == null || a.call(t, o), o.defaultPrevented || (i.current || (l = e.triggerRef.current) == null || l.focus(), o.preventDefault()), i.current = !1, r.current = !1;
1427
+ var s, l;
1428
+ (s = t.onCloseAutoFocus) == null || s.call(t, o), o.defaultPrevented || (i.current || (l = e.triggerRef.current) == null || l.focus(), o.preventDefault()), i.current = !1, r.current = !1;
1429
1429
  },
1430
1430
  onInteractOutside: (o) => {
1431
1431
  var f, c;
1432
1432
  (f = t.onInteractOutside) == null || f.call(t, o), o.defaultPrevented || (i.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
1433
- const a = o.target;
1434
- ((c = e.triggerRef.current) == null ? void 0 : c.contains(a)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
1433
+ const s = o.target;
1434
+ ((c = e.triggerRef.current) == null ? void 0 : c.contains(s)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
1435
1435
  }
1436
1436
  }
1437
1437
  );
1438
1438
  }
1439
- ), xi = p.forwardRef(
1439
+ ), Ei = p.forwardRef(
1440
1440
  (t, n) => {
1441
- const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...a } = t, l = J(ge, e), f = p.useRef(null), c = be(n, f);
1442
- return yo(), /* @__PURE__ */ y(he, { children: [
1443
- /* @__PURE__ */ s(
1444
- ii,
1441
+ const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...s } = t, l = J(ge, e), f = p.useRef(null), c = we(n, f);
1442
+ return bo(), /* @__PURE__ */ y(he, { children: [
1443
+ /* @__PURE__ */ a(
1444
+ ri,
1445
1445
  {
1446
1446
  asChild: !0,
1447
1447
  loop: !0,
1448
1448
  trapped: i,
1449
1449
  onMountAutoFocus: r,
1450
1450
  onUnmountAutoFocus: o,
1451
- children: /* @__PURE__ */ s(
1452
- ti,
1451
+ children: /* @__PURE__ */ a(
1452
+ ni,
1453
1453
  {
1454
1454
  role: "dialog",
1455
1455
  id: l.contentId,
1456
1456
  "aria-describedby": l.descriptionId,
1457
1457
  "aria-labelledby": l.titleId,
1458
- "data-state": an(l.open),
1459
- ...a,
1458
+ "data-state": sn(l.open),
1459
+ ...s,
1460
1460
  ref: c,
1461
1461
  onDismiss: () => l.onOpenChange(!1)
1462
1462
  }
@@ -1464,49 +1464,49 @@ var ca = p.forwardRef(
1464
1464
  }
1465
1465
  ),
1466
1466
  /* @__PURE__ */ y(he, { children: [
1467
- /* @__PURE__ */ s(ma, { titleId: l.titleId }),
1468
- /* @__PURE__ */ s(pa, { contentRef: f, descriptionId: l.descriptionId })
1467
+ /* @__PURE__ */ a(ha, { titleId: l.titleId }),
1468
+ /* @__PURE__ */ a(ga, { contentRef: f, descriptionId: l.descriptionId })
1469
1469
  ] })
1470
1470
  ] });
1471
1471
  }
1472
- ), on = "DialogTitle", ua = p.forwardRef(
1472
+ ), an = "DialogTitle", fa = p.forwardRef(
1473
1473
  (t, n) => {
1474
- const { __scopeDialog: e, ...i } = t, r = J(on, e);
1475
- return /* @__PURE__ */ s(se.h2, { id: r.titleId, ...i, ref: n });
1474
+ const { __scopeDialog: e, ...i } = t, r = J(an, e);
1475
+ return /* @__PURE__ */ a(ae.h2, { id: r.titleId, ...i, ref: n });
1476
1476
  }
1477
1477
  );
1478
- ua.displayName = on;
1479
- var Ei = "DialogDescription", fa = p.forwardRef(
1478
+ fa.displayName = an;
1479
+ var Ii = "DialogDescription", ma = p.forwardRef(
1480
1480
  (t, n) => {
1481
- const { __scopeDialog: e, ...i } = t, r = J(Ei, e);
1482
- return /* @__PURE__ */ s(se.p, { id: r.descriptionId, ...i, ref: n });
1481
+ const { __scopeDialog: e, ...i } = t, r = J(Ii, e);
1482
+ return /* @__PURE__ */ a(ae.p, { id: r.descriptionId, ...i, ref: n });
1483
1483
  }
1484
1484
  );
1485
- fa.displayName = Ei;
1486
- var Ii = "DialogClose", Si = p.forwardRef(
1485
+ ma.displayName = Ii;
1486
+ var Si = "DialogClose", Ri = p.forwardRef(
1487
1487
  (t, n) => {
1488
- const { __scopeDialog: e, ...i } = t, r = J(Ii, e);
1489
- return /* @__PURE__ */ s(
1490
- se.button,
1488
+ const { __scopeDialog: e, ...i } = t, r = J(Si, e);
1489
+ return /* @__PURE__ */ a(
1490
+ ae.button,
1491
1491
  {
1492
1492
  type: "button",
1493
1493
  ...i,
1494
1494
  ref: n,
1495
- onClick: de(t.onClick, () => r.onOpenChange(!1))
1495
+ onClick: ce(t.onClick, () => r.onOpenChange(!1))
1496
1496
  }
1497
1497
  );
1498
1498
  }
1499
1499
  );
1500
- Si.displayName = Ii;
1501
- function an(t) {
1500
+ Ri.displayName = Si;
1501
+ function sn(t) {
1502
1502
  return t ? "open" : "closed";
1503
1503
  }
1504
- var Ri = "DialogTitleWarning", [ps, Ni] = $r(Ri, {
1504
+ var Ni = "DialogTitleWarning", [gs, Ti] = Br(Ni, {
1505
1505
  contentName: ge,
1506
- titleName: on,
1506
+ titleName: an,
1507
1507
  docsSlug: "dialog"
1508
- }), ma = ({ titleId: t }) => {
1509
- const n = Ni(Ri), e = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
1508
+ }), ha = ({ titleId: t }) => {
1509
+ const n = Ti(Ni), e = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
1510
1510
 
1511
1511
  If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
1512
1512
 
@@ -1514,58 +1514,58 @@ For more information, see https://radix-ui.com/primitives/docs/components/${n.do
1514
1514
  return p.useEffect(() => {
1515
1515
  t && (document.getElementById(t) || console.error(e));
1516
1516
  }, [e, t]), null;
1517
- }, ha = "DialogDescriptionWarning", pa = ({ contentRef: t, descriptionId: n }) => {
1518
- const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ni(ha).contentName}}.`;
1517
+ }, pa = "DialogDescriptionWarning", ga = ({ contentRef: t, descriptionId: n }) => {
1518
+ const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ti(pa).contentName}}.`;
1519
1519
  return p.useEffect(() => {
1520
1520
  var o;
1521
1521
  const r = (o = t.current) == null ? void 0 : o.getAttribute("aria-describedby");
1522
1522
  n && r && (document.getElementById(n) || console.warn(i));
1523
1523
  }, [i, t, n]), null;
1524
- }, sn = gi, ln = bi, cn = wi, dn = Ci, ga = Si;
1525
- const Ti = O((t) => {
1524
+ }, ln = vi, cn = wi, dn = Ci, un = xi, va = Ri;
1525
+ const Li = O((t) => {
1526
1526
  const { file: n, onClose: e } = t, i = ne(null), r = N(() => {
1527
1527
  var l;
1528
1528
  if (!i.current) return;
1529
- const a = document.createElement("canvas");
1530
- a.width = i.current.width, a.height = i.current.height, (l = a.getContext("2d")) == null || l.drawImage(i.current, 0, 0, i.current.width, i.current.height), a.toBlob((f) => {
1529
+ const s = document.createElement("canvas");
1530
+ s.width = i.current.width, s.height = i.current.height, (l = s.getContext("2d")) == null || l.drawImage(i.current, 0, 0, i.current.width, i.current.height), s.toBlob((f) => {
1531
1531
  f && navigator.clipboard.write([new ClipboardItem({ "image/png": f })]);
1532
1532
  }, "image/png");
1533
1533
  }, []), o = N(() => {
1534
- Wn(n);
1534
+ qn(n);
1535
1535
  }, [n]);
1536
- return /* @__PURE__ */ s(sn, { open: !0, onOpenChange: e, children: /* @__PURE__ */ s(ln, { children: /* @__PURE__ */ s(
1537
- cn,
1536
+ return /* @__PURE__ */ a(ln, { open: !0, onOpenChange: e, children: /* @__PURE__ */ a(cn, { children: /* @__PURE__ */ a(
1537
+ dn,
1538
1538
  {
1539
1539
  className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
1540
1540
  "data-floating-content": "",
1541
1541
  children: /* @__PURE__ */ y(
1542
- dn,
1542
+ un,
1543
1543
  {
1544
1544
  className: "absolute inset-0 py-12",
1545
1545
  "data-floating-content": "",
1546
- onOpenAutoFocus: (a) => a.preventDefault(),
1546
+ onOpenAutoFocus: (s) => s.preventDefault(),
1547
1547
  children: [
1548
1548
  /* @__PURE__ */ y(
1549
- Wt,
1549
+ bt,
1550
1550
  {
1551
1551
  className: "flex gap-2 items-center top-0 absolute right-0 p-2",
1552
1552
  accentColor: "base",
1553
1553
  variant: "ghost",
1554
1554
  children: [
1555
- /* @__PURE__ */ y(xe.Root, { children: [
1556
- /* @__PURE__ */ s(xe.Trigger, { children: /* @__PURE__ */ s(V, { onClick: r, "aria-label": "copy to clipboard", children: /* @__PURE__ */ s(T, { icon: "RiFileCopyLine" }) }) }),
1557
- /* @__PURE__ */ s(xe.Content, { size: "sm", children: "Copy" })
1555
+ /* @__PURE__ */ y(Ee.Root, { children: [
1556
+ /* @__PURE__ */ a(Ee.Trigger, { children: /* @__PURE__ */ a(B, { onClick: r, "aria-label": "copy to clipboard", children: /* @__PURE__ */ a(T, { icon: "RiFileCopyLine" }) }) }),
1557
+ /* @__PURE__ */ a(Ee.Content, { size: "sm", children: "Copy" })
1558
1558
  ] }),
1559
- /* @__PURE__ */ y(xe.Root, { children: [
1560
- /* @__PURE__ */ s(xe.Trigger, { children: /* @__PURE__ */ s(V, { onClick: o, "aria-label": "download", children: /* @__PURE__ */ s(T, { icon: "RiDownload2Line" }) }) }),
1561
- /* @__PURE__ */ s(xe.Content, { size: "sm", children: "Download" })
1559
+ /* @__PURE__ */ y(Ee.Root, { children: [
1560
+ /* @__PURE__ */ a(Ee.Trigger, { children: /* @__PURE__ */ a(B, { onClick: o, "aria-label": "download", children: /* @__PURE__ */ a(T, { icon: "RiDownload2Line" }) }) }),
1561
+ /* @__PURE__ */ a(Ee.Content, { size: "sm", children: "Download" })
1562
1562
  ] }),
1563
- /* @__PURE__ */ s(qt, { orientation: "vertical", size: "sm" }),
1564
- /* @__PURE__ */ s(ga, { asChild: !0, children: /* @__PURE__ */ s(V, { onClick: e, "aria-label": "close", children: /* @__PURE__ */ s(T, { icon: "RiCloseLine" }) }) })
1563
+ /* @__PURE__ */ a(Ht, { orientation: "vertical", size: "sm" }),
1564
+ /* @__PURE__ */ a(va, { asChild: !0, children: /* @__PURE__ */ a(B, { onClick: e, "aria-label": "close", children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" }) }) })
1565
1565
  ]
1566
1566
  }
1567
1567
  ),
1568
- /* @__PURE__ */ s("figure", { className: "size-full overflow-hidden p-4 flex justify-center items-center", children: /* @__PURE__ */ s(
1568
+ /* @__PURE__ */ a("figure", { className: "size-full overflow-hidden p-4 flex justify-center items-center", children: /* @__PURE__ */ a(
1569
1569
  "img",
1570
1570
  {
1571
1571
  ref: i,
@@ -1580,8 +1580,8 @@ const Ti = O((t) => {
1580
1580
  }
1581
1581
  ) }) });
1582
1582
  });
1583
- Ti.displayName = "ImageViewer";
1584
- const va = O((t) => {
1583
+ Li.displayName = "ImageViewer";
1584
+ const ya = O((t) => {
1585
1585
  const { children: n } = t, [e, i] = H(null), r = N(() => {
1586
1586
  i(null);
1587
1587
  }, []), o = N(
@@ -1589,55 +1589,55 @@ const va = O((t) => {
1589
1589
  i(f(r));
1590
1590
  },
1591
1591
  [r]
1592
- ), a = N(() => {
1592
+ ), s = N(() => {
1593
1593
  e && (e.onClose && e.onClose(), r());
1594
1594
  }, [r, e]), l = A(() => o, [o]);
1595
- return /* @__PURE__ */ y(Jn.Provider, { value: l, children: [
1595
+ return /* @__PURE__ */ y(Zn.Provider, { value: l, children: [
1596
1596
  n,
1597
- e && /* @__PURE__ */ s(Ti, { file: e.file, onClose: a })
1597
+ e && /* @__PURE__ */ a(Li, { file: e.file, onClose: s })
1598
1598
  ] });
1599
1599
  });
1600
- va.displayName = "FileViewerProvider";
1600
+ ya.displayName = "FileViewerProvider";
1601
1601
  const ie = (t) => {
1602
- const { className: n, label: e, children: i, size: r, severity: o, inputId: a, labelId: l, image: f } = t, [c, d] = H(void 0), u = en(), h = o ? ae[o] : "base";
1602
+ const { className: n, label: e, children: i, severity: r, inputId: o, labelId: s, image: l } = t, [f, c] = H(void 0), d = tn(), u = r ? ue[r] : "base";
1603
1603
  K(() => {
1604
- f instanceof Promise ? f.then(d).catch(console.error) : d(f);
1605
- }, [f]);
1606
- const g = c ? URL.createObjectURL(c) : void 0, b = N(() => {
1607
- c && u(() => ({
1608
- file: c
1604
+ l instanceof Promise ? l.then(c).catch(console.error) : c(l);
1605
+ }, [l]);
1606
+ const h = f ? URL.createObjectURL(f) : void 0, g = N(() => {
1607
+ f && d(() => ({
1608
+ file: f
1609
1609
  }));
1610
- }, [u, c]);
1610
+ }, [d, f]);
1611
1611
  return /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
1612
- c && /* @__PURE__ */ s(
1612
+ f && /* @__PURE__ */ a(
1613
1613
  "img",
1614
1614
  {
1615
1615
  className: "h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",
1616
- src: g,
1617
- alt: c.name,
1618
- onClick: b
1616
+ src: h,
1617
+ alt: f.name,
1618
+ onClick: g
1619
1619
  }
1620
1620
  ),
1621
- /* @__PURE__ */ y("label", { className: Be(n, "flex flex-col gap-1"), htmlFor: a, children: [
1622
- /* @__PURE__ */ s(Ve, { accentColor: h, size: r, id: l, weight: "medium", children: e }),
1621
+ /* @__PURE__ */ y("label", { className: Ve(n, "flex flex-col gap-1"), htmlFor: o, children: [
1622
+ /* @__PURE__ */ a(ye, { accentColor: u, size: "sm", id: s, weight: "medium", children: e }),
1623
1623
  i
1624
1624
  ] })
1625
1625
  ] });
1626
- }, Li = (t) => {
1627
- const { helpText: n, children: e, severity: i } = t, r = i ? ae[i] : "base";
1626
+ }, Fi = (t) => {
1627
+ const { helpText: n, children: e, severity: i } = t, r = i ? ue[i] : "base";
1628
1628
  return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
1629
1629
  e,
1630
- /* @__PURE__ */ s("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ s(Ve, { accentColor: r, size: "xs", children: n }) })
1630
+ /* @__PURE__ */ a("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ a(ye, { accentColor: r, size: "xs", children: n }) })
1631
1631
  ] });
1632
1632
  }, re = (t) => {
1633
1633
  const { children: n, ...e } = t;
1634
- return /* @__PURE__ */ s(Li, { ...e, children: n });
1635
- }, ya = [!0, "true"], Fi = O((t) => {
1636
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t);
1634
+ return /* @__PURE__ */ a(Fi, { ...e, children: n });
1635
+ }, ba = [!0, "true"], Di = O((t) => {
1636
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
1637
1637
  let [{ helpText: c, label: d }] = U(t);
1638
1638
  c = o ? null : c, d = o ? "" : d;
1639
- const u = ya.includes(l.value);
1640
- return /* @__PURE__ */ s(re, { helpText: c, severity: r, children: /* @__PURE__ */ s(
1639
+ const u = ba.includes(l.value);
1640
+ return /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
1641
1641
  ie,
1642
1642
  {
1643
1643
  size: i,
@@ -1645,32 +1645,33 @@ const ie = (t) => {
1645
1645
  inputId: n,
1646
1646
  labelId: e,
1647
1647
  label: d,
1648
- image: o ? void 0 : a.image,
1649
- className: "align-center flex-row-reverse justify-end gap-2",
1650
- children: /* @__PURE__ */ s(
1651
- ot.Root,
1648
+ image: o ? void 0 : s.image,
1649
+ className: "items-center flex-row-reverse justify-end gap-2",
1650
+ children: /* @__PURE__ */ a(
1651
+ at.Root,
1652
1652
  {
1653
1653
  ...f,
1654
1654
  ...l,
1655
1655
  id: n,
1656
- accentColor: "base",
1656
+ size: "sm",
1657
+ accentColor: "primary",
1657
1658
  value: u.toString(),
1658
1659
  checked: u,
1659
1660
  onCheckedChange: l.onChange,
1660
1661
  onChange: void 0,
1661
1662
  onBlur: void 0,
1662
1663
  variant: "surface",
1663
- children: /* @__PURE__ */ s(ot.Indicator, { children: /* @__PURE__ */ s(T, { icon: "RiCheckLine" }) })
1664
+ children: /* @__PURE__ */ a(at.Indicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) })
1664
1665
  }
1665
1666
  )
1666
1667
  }
1667
1668
  ) });
1668
1669
  });
1669
- Fi.displayName = "BooleanInput";
1670
- const ba = {
1670
+ Di.displayName = "BooleanInput";
1671
+ const wa = {
1671
1672
  ...Q,
1672
1673
  type: "boolean"
1673
- }, Ne = class Ne extends G {
1674
+ }, Te = class Te extends G {
1674
1675
  constructor(e) {
1675
1676
  super({ ...e, type: "boolean" });
1676
1677
  w(this, "onlyValidateAfterTouched", !1);
@@ -1687,16 +1688,16 @@ const ba = {
1687
1688
  }
1688
1689
  static deserialize(e) {
1689
1690
  if (e.type !== "boolean") throw new Error("Type mismatch.");
1690
- return new Ne(e);
1691
+ return new Te(e);
1691
1692
  }
1692
1693
  getInput(e) {
1693
- return /* @__PURE__ */ s(Fi, { ...e, field: this });
1694
+ return /* @__PURE__ */ a(Di, { ...e, field: this });
1694
1695
  }
1695
1696
  };
1696
- w(Ne, "fieldTypeName", "Checkbox"), w(Ne, "fieldTypeDescription", "Perfect for both optional and required yes/no questions."), w(Ne, "Icon", gr);
1697
- let We = Ne;
1698
- const Di = O((t) => {
1699
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t);
1697
+ w(Te, "fieldTypeName", "Checkbox"), w(Te, "fieldTypeDescription", "Perfect for both optional and required yes/no questions."), w(Te, "Icon", vr);
1698
+ let We = Te;
1699
+ const Ai = O((t) => {
1700
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
1700
1701
  let [{ helpText: c, label: d }] = U(t);
1701
1702
  c = o ? null : c, d = o ? "" : d;
1702
1703
  const u = l.value ? new Date(l.value) : void 0, h = N(
@@ -1709,7 +1710,7 @@ const Di = O((t) => {
1709
1710
  },
1710
1711
  [l]
1711
1712
  );
1712
- return /* @__PURE__ */ s(re, { helpText: c, severity: r, children: /* @__PURE__ */ s(
1713
+ return /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
1713
1714
  ie,
1714
1715
  {
1715
1716
  size: i,
@@ -1717,9 +1718,9 @@ const Di = O((t) => {
1717
1718
  inputId: n,
1718
1719
  labelId: e,
1719
1720
  label: d,
1720
- image: o ? void 0 : a.image,
1721
+ image: o ? void 0 : s.image,
1721
1722
  children: /* @__PURE__ */ y(oe.Root, { children: [
1722
- /* @__PURE__ */ s(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ y(
1723
+ /* @__PURE__ */ a(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ y(
1723
1724
  X,
1724
1725
  {
1725
1726
  ...f,
@@ -1727,6 +1728,7 @@ const Di = O((t) => {
1727
1728
  type: "button",
1728
1729
  accentColor: "base",
1729
1730
  variant: "surface",
1731
+ size: "sm",
1730
1732
  id: n,
1731
1733
  children: [
1732
1734
  u ? u.toLocaleString(void 0, {
@@ -1734,12 +1736,12 @@ const Di = O((t) => {
1734
1736
  month: "2-digit",
1735
1737
  day: "2-digit"
1736
1738
  }) : "yyyy-mm-dd",
1737
- /* @__PURE__ */ s(T, { icon: "RiArrowDownSLine" })
1739
+ /* @__PURE__ */ a(T, { icon: "RiArrowDownSLine" })
1738
1740
  ]
1739
1741
  }
1740
1742
  ) }),
1741
- /* @__PURE__ */ s(oe.Content, { children: /* @__PURE__ */ s(
1742
- rr,
1743
+ /* @__PURE__ */ a(oe.Content, { children: /* @__PURE__ */ a(
1744
+ or,
1743
1745
  {
1744
1746
  required: !1,
1745
1747
  mode: "single",
@@ -1752,11 +1754,11 @@ const Di = O((t) => {
1752
1754
  }
1753
1755
  ) });
1754
1756
  });
1755
- Di.displayName = "DateInput";
1756
- const wa = {
1757
+ Ai.displayName = "DateInput";
1758
+ const Ca = {
1757
1759
  ...Q,
1758
1760
  type: "date"
1759
- }, Te = class Te extends G {
1761
+ }, Le = class Le extends G {
1760
1762
  constructor(e) {
1761
1763
  super({ ...e, type: "date" });
1762
1764
  w(this, "onlyValidateAfterTouched", !1);
@@ -1769,27 +1771,27 @@ const wa = {
1769
1771
  }
1770
1772
  static deserialize(e) {
1771
1773
  if (e.type !== "date") throw new Error("Type mismatch.");
1772
- return new Te(e);
1774
+ return new Le(e);
1773
1775
  }
1774
1776
  getInput(e) {
1775
- return /* @__PURE__ */ s(Di, { field: this, ...e });
1777
+ return /* @__PURE__ */ a(Ai, { field: this, ...e });
1776
1778
  }
1777
1779
  };
1778
- w(Te, "fieldTypeName", "Date"), w(Te, "fieldTypeDescription", "Allows specifying a date."), w(Te, "Icon", vr);
1779
- let Pt = Te;
1780
- const Ai = O((t) => {
1781
- const { field: n, ...e } = t, [{ value: i }] = Xt(n.options.clonedFieldIdentifier), r = A(() => {
1780
+ w(Le, "fieldTypeName", "Date"), w(Le, "fieldTypeDescription", "Allows specifying a date."), w(Le, "Icon", yr);
1781
+ let zt = Le;
1782
+ const Oi = O((t) => {
1783
+ const { field: n, ...e } = t, [{ value: i }] = Kt(n.options.clonedFieldIdentifier), r = A(() => {
1782
1784
  const o = n.options.getFieldToClone(i);
1783
- return o ? hn(o) : null;
1785
+ return o ? pn(o) : null;
1784
1786
  }, [n.options, i]);
1785
- return Oi(r, e);
1787
+ return Pi(r, e);
1786
1788
  });
1787
- Ai.displayName = "FieldInputCloner";
1788
- const Ca = {
1789
+ Oi.displayName = "FieldInputCloner";
1790
+ const xa = {
1789
1791
  ...Q,
1790
1792
  type: "custom"
1791
1793
  };
1792
- class lt extends G {
1794
+ class ct extends G {
1793
1795
  constructor(e, i) {
1794
1796
  super({ ...e, type: "custom" });
1795
1797
  w(this, "Component");
@@ -1802,119 +1804,119 @@ class lt extends G {
1802
1804
  }
1803
1805
  getInput(e) {
1804
1806
  const i = this.Component;
1805
- return /* @__PURE__ */ s(i, { field: this, ...e });
1807
+ return /* @__PURE__ */ a(i, { field: this, ...e });
1806
1808
  }
1807
1809
  }
1808
- w(lt, "fieldTypeName", "Custom"), w(lt, "fieldTypeDescription", "Allows re-rendering of field already in the form");
1809
- class xa extends lt {
1810
+ w(ct, "fieldTypeName", "Custom"), w(ct, "fieldTypeDescription", "Allows re-rendering of field already in the form");
1811
+ class Ea extends ct {
1810
1812
  constructor(n) {
1811
- super(n, Ai);
1813
+ super(n, Oi);
1812
1814
  }
1813
1815
  }
1814
- const Oi = (t, n) => A(() => !n || !t ? null : t.getInput(n), [t, n]), ct = (t, n) => {
1815
- const e = A(() => t.map((i) => /* @__PURE__ */ s("div", { children: i.getInput(n) }, i.getId())), [t, n]);
1816
- return /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: e });
1817
- }, dt = (t = "", n = []) => ({
1816
+ const Pi = (t, n) => A(() => !n || !t ? null : t.getInput(n), [t, n]), dt = (t, n) => {
1817
+ const e = A(() => t.map((i) => /* @__PURE__ */ a("div", { children: i.getInput(n) }, i.getId())), [t, n]);
1818
+ return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: e });
1819
+ }, ut = (t = "", n = []) => ({
1818
1820
  type: "section",
1819
1821
  fields: n,
1820
1822
  identifier: t,
1821
1823
  label: null,
1822
1824
  condition: null,
1823
1825
  conditional: !1
1824
- }), Ea = (t) => {
1826
+ }), Ia = (t) => {
1825
1827
  if (!t) return;
1826
1828
  const n = t.fields;
1827
1829
  let e = [];
1828
1830
  const i = [];
1829
1831
  for (const r of n)
1830
- r.type === "section" ? (e.length > 0 && (i.push(dt(`AUTO_section-${n.indexOf(r)}`, e)), e = []), i.push(r)) : e.push(r);
1831
- return e.length > 0 && i.push(dt("AUTO_section-last", e)), { ...t, fields: i, description: t.description ?? "" };
1832
+ r.type === "section" ? (e.length > 0 && (i.push(ut(`AUTO_section-${n.indexOf(r)}`, e)), e = []), i.push(r)) : e.push(r);
1833
+ return e.length > 0 && i.push(ut("AUTO_section-last", e)), { ...t, fields: i, description: t.description ?? "" };
1832
1834
  };
1833
- function kt(t, n, e) {
1835
+ function _t(t, n, e) {
1834
1836
  const i = Array.from(t), [r] = i.splice(n, 1);
1835
1837
  if (!r) throw new Error("Could not find field to reorder.");
1836
1838
  return i.splice(e, 0, r), i;
1837
1839
  }
1838
- function Pi(t, n, e) {
1840
+ function ki(t, n, e) {
1839
1841
  const i = Array.from(t ?? []);
1840
1842
  return i.splice(n, 0, e), i;
1841
1843
  }
1842
- function ut(t, n) {
1844
+ function ft(t, n) {
1843
1845
  const e = Array.from(t);
1844
1846
  return e.splice(n, 1), e;
1845
1847
  }
1846
- const un = (t, n) => {
1848
+ const fn = (t, n) => {
1847
1849
  const e = /* @__PURE__ */ new Date();
1848
- return `${fr(n)}-${e.getTime()}`;
1849
- }, ki = (t, n) => {
1850
+ return `${mr(n)}-${e.getTime()}`;
1851
+ }, Mi = (t, n) => {
1850
1852
  if (!n) return null;
1851
1853
  for (const e of t)
1852
1854
  if (e.type === "section") {
1853
- const i = ki(e.fields, n);
1855
+ const i = Mi(e.fields, n);
1854
1856
  if (i) return i;
1855
1857
  } else if (e.identifier === n)
1856
1858
  return e;
1857
1859
  return null;
1858
- }, Mi = (t, n) => t.filter((e, i) => i < n).flatMap((e) => e.fields), ft = (t, n, e, i, r) => {
1859
- const { label: o } = e, a = {
1860
+ }, zi = (t, n) => t.filter((e, i) => i < n).flatMap((e) => e.fields), mt = (t, n, e, i, r) => {
1861
+ const { label: o } = e, s = {
1860
1862
  ...e,
1861
- identifier: un(null, o)
1863
+ identifier: fn(null, o)
1862
1864
  }, l = Y(i, t);
1863
1865
  if (l === void 0)
1864
1866
  throw new Error("Parent path must point to an existing field.");
1865
1867
  if (!Array.isArray(l))
1866
1868
  throw new Error("Parent path must point to an array.");
1867
- const f = Pi(l, n, a);
1869
+ const f = ki(l, n, s);
1868
1870
  r(t, f).then();
1869
- }, Ia = (t, n, e) => {
1871
+ }, Sa = (t, n, e) => {
1870
1872
  const i = {
1871
- ...dt(),
1873
+ ...ut(),
1872
1874
  label: ""
1873
1875
  };
1874
- ft("fields", t, i, n, e);
1875
- }, fn = () => {
1876
- const { showError: t } = Ht(), n = N(
1877
- (i, r, o, a, l, f) => {
1876
+ mt("fields", t, i, n, e);
1877
+ }, mn = () => {
1878
+ const { showError: t } = Gt(), n = N(
1879
+ (i, r, o, s, l, f) => {
1878
1880
  const c = i[r];
1879
1881
  if (!c) throw new Error("Could not find section context.");
1880
1882
  let d = typeof c.conditionIndex < "u" ? (
1881
1883
  // cannot move a section with a condition before the condition's field
1882
- Math.max(c.conditionIndex + 1, a)
1883
- ) : a;
1884
+ Math.max(c.conditionIndex + 1, s)
1885
+ ) : s;
1884
1886
  for (const u of Object.values(i))
1885
1887
  u.conditionIndex === o && (d = Math.min(d, u.index - 1));
1886
- if (d !== a) {
1888
+ if (d !== s) {
1887
1889
  t({
1888
1890
  title: "Could not reorder sections",
1889
1891
  description: "Sections with conditions must be below the fields they reference."
1890
1892
  });
1891
1893
  return;
1892
1894
  }
1893
- f("fields", kt(l.fields, o, d));
1895
+ f("fields", _t(l.fields, o, d));
1894
1896
  },
1895
1897
  [t]
1896
1898
  ), e = N(
1897
- (i, r, o, a, l, f, c) => {
1899
+ (i, r, o, s, l, f, c) => {
1898
1900
  var d;
1899
- if (!(i != null && i.fields) || !a) throw new Error("Could not find section with fields.");
1900
- if (i.identifier === a.identifier)
1901
+ if (!(i != null && i.fields) || !s) throw new Error("Could not find section with fields.");
1902
+ if (i.identifier === s.identifier)
1901
1903
  c(
1902
1904
  `fields.${r}.fields`,
1903
- kt(i.fields, o, f)
1905
+ _t(i.fields, o, f)
1904
1906
  ).then();
1905
1907
  else {
1906
1908
  const u = i.fields[o];
1907
1909
  if (!u) throw new Error("Could not find field to reorder.");
1908
- if (((d = a.condition) == null ? void 0 : d.identifier) === u.identifier) {
1910
+ if (((d = s.condition) == null ? void 0 : d.identifier) === u.identifier) {
1909
1911
  t({
1910
1912
  title: "Could not reorder field",
1911
1913
  description: "Field must be above the section whose condition references it."
1912
1914
  });
1913
1915
  return;
1914
1916
  }
1915
- c(`fields.${r}.fields`, ut(i.fields, o)).then(), c(
1917
+ c(`fields.${r}.fields`, ft(i.fields, o)).then(), c(
1916
1918
  `fields.${l}.fields`,
1917
- Pi(a.fields, f, u)
1919
+ ki(s.fields, f, u)
1918
1920
  ).then();
1919
1921
  }
1920
1922
  },
@@ -1922,7 +1924,7 @@ const un = (t, n) => {
1922
1924
  );
1923
1925
  return { reorderSection: n, reorderField: e };
1924
1926
  }, _i = O((t) => {
1925
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t);
1927
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
1926
1928
  let [{ helpText: c, label: d }] = U(t);
1927
1929
  c = o ? null : c, d = o ? "" : d;
1928
1930
  const u = A(() => Array.isArray(l.value) ? l.value : [], [l.value]), { onChange: h, onBlur: g } = l, b = `${n}-droppable`, { disabled: m } = f, [v, x] = H(""), [E, S] = H(""), C = E || c, I = N(
@@ -1948,21 +1950,21 @@ const un = (t, n) => {
1948
1950
  P.key === "Enter" && (P.preventDefault(), R());
1949
1951
  },
1950
1952
  [R]
1951
- ), B = N(
1953
+ ), V = N(
1952
1954
  (P) => {
1953
- I(ut(u, P));
1955
+ I(ft(u, P));
1954
1956
  },
1955
1957
  [u, I]
1956
- ), z = N(
1958
+ ), _ = N(
1957
1959
  (P) => {
1958
1960
  if (!P.destination) return;
1959
- const $ = P.source.index, _ = P.destination.index;
1960
- I(kt(u, $, _));
1961
+ const $ = P.source.index, z = P.destination.index;
1962
+ I(_t(u, $, z));
1961
1963
  },
1962
1964
  [I, u]
1963
1965
  );
1964
- return /* @__PURE__ */ s(Gn, { onDragEnd: z, children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
1965
- /* @__PURE__ */ s(re, { helpText: C, severity: r, children: /* @__PURE__ */ s(
1966
+ return /* @__PURE__ */ a(Xn, { onDragEnd: _, children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
1967
+ /* @__PURE__ */ a(re, { helpText: C, severity: r, children: /* @__PURE__ */ a(
1966
1968
  ie,
1967
1969
  {
1968
1970
  size: i,
@@ -1970,10 +1972,10 @@ const un = (t, n) => {
1970
1972
  inputId: n,
1971
1973
  labelId: e,
1972
1974
  label: d,
1973
- image: o ? void 0 : a.image,
1975
+ image: o ? void 0 : s.image,
1974
1976
  children: (!m || u.length === 0) && /* @__PURE__ */ y("div", { className: "flex gap-2", children: [
1975
- /* @__PURE__ */ s("div", { className: "grow", children: /* @__PURE__ */ s(ue.Root, { accentColor: "base", variant: "surface", children: /* @__PURE__ */ s(
1976
- ue.Field,
1977
+ /* @__PURE__ */ a("div", { className: "grow", children: /* @__PURE__ */ a(de.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ a(
1978
+ de.Field,
1977
1979
  {
1978
1980
  ...f,
1979
1981
  ...l,
@@ -1981,64 +1983,65 @@ const un = (t, n) => {
1981
1983
  onChange: L,
1982
1984
  onKeyDown: F,
1983
1985
  id: n,
1984
- placeholder: a.placeholder,
1986
+ placeholder: s.placeholder,
1985
1987
  onBlur: void 0
1986
1988
  }
1987
1989
  ) }) }),
1988
- /* @__PURE__ */ s(
1989
- V,
1990
+ /* @__PURE__ */ a(
1991
+ B,
1990
1992
  {
1993
+ size: "sm",
1991
1994
  type: "button",
1992
1995
  "aria-label": "Add option",
1993
1996
  disabled: !!E || m,
1994
1997
  onClick: R,
1995
- children: /* @__PURE__ */ s(T, { icon: "RiAddLine" })
1998
+ children: /* @__PURE__ */ a(T, { icon: "RiAddLine" })
1996
1999
  }
1997
2000
  )
1998
2001
  ] })
1999
2002
  }
2000
2003
  ) }),
2001
- /* @__PURE__ */ s(Jt, { droppableId: b, children: (P) => /* @__PURE__ */ y(
2004
+ /* @__PURE__ */ a(Zt, { droppableId: b, children: (P) => /* @__PURE__ */ y(
2002
2005
  "div",
2003
2006
  {
2004
2007
  className: "flex flex-col",
2005
2008
  ...P.droppableProps,
2006
2009
  ref: P.innerRef,
2007
2010
  children: [
2008
- u.map(($, _) => /* @__PURE__ */ s(
2009
- Zt,
2011
+ u.map(($, z) => /* @__PURE__ */ a(
2012
+ en,
2010
2013
  {
2011
2014
  draggableId: `${$}-draggable`,
2012
- index: _,
2015
+ index: z,
2013
2016
  isDragDisabled: m,
2014
- children: ({ draggableProps: Z, dragHandleProps: we, innerRef: je }) => /* @__PURE__ */ y(
2015
- jt,
2017
+ children: ({ draggableProps: Z, dragHandleProps: Ce, innerRef: je }) => /* @__PURE__ */ y(
2018
+ ot,
2016
2019
  {
2017
- ...we,
2020
+ ...Ce,
2018
2021
  ...Z,
2019
2022
  ref: je,
2020
2023
  className: "mb-1 flex items-center justify-between gap-2",
2021
2024
  accentColor: "base",
2022
- size: "md",
2025
+ size: "sm",
2023
2026
  variant: "soft",
2024
2027
  children: [
2025
- /* @__PURE__ */ s("span", {
2028
+ /* @__PURE__ */ a("span", {
2026
2029
  // TODO: remove this, its just a saftey check for old compatibility of what was acceptable as a value for multi string
2027
2030
  children: typeof $ == "object" && "label" in $ ? $.label : $
2028
2031
  }),
2029
- /* @__PURE__ */ s(
2030
- V,
2032
+ /* @__PURE__ */ a(
2033
+ B,
2031
2034
  {
2032
- size: "sm",
2035
+ size: "xs",
2033
2036
  variant: "ghost",
2034
2037
  type: "button",
2035
2038
  "aria-label": "Delete option",
2036
2039
  accentColor: "base",
2037
2040
  disabled: m,
2038
2041
  onClick: () => {
2039
- B(_);
2042
+ V(z);
2040
2043
  },
2041
- children: /* @__PURE__ */ s(T, { icon: "RiCloseLargeLine" })
2044
+ children: /* @__PURE__ */ a(T, { icon: "RiCloseLargeLine" })
2042
2045
  }
2043
2046
  )
2044
2047
  ]
@@ -2054,15 +2057,15 @@ const un = (t, n) => {
2054
2057
  ] }) });
2055
2058
  });
2056
2059
  _i.displayName = "MultiStringInput";
2057
- const Sa = {
2060
+ const Ra = {
2058
2061
  ...Q,
2059
2062
  type: "multi-string",
2060
2063
  minimum_length: 0,
2061
2064
  maximum_length: null
2062
- }, Le = class Le extends G {
2065
+ }, Fe = class Fe extends G {
2063
2066
  constructor(e) {
2064
- const { minimum_length: i, maximum_length: r, placeholder: o, ...a } = e;
2065
- super({ ...a, type: "multi-string" });
2067
+ const { minimum_length: i, maximum_length: r, placeholder: o, ...s } = e;
2068
+ super({ ...s, type: "multi-string" });
2066
2069
  w(this, "minLength");
2067
2070
  w(this, "maxLength");
2068
2071
  w(this, "onlyValidateAfterTouched", !1);
@@ -2074,7 +2077,7 @@ const Sa = {
2074
2077
  throw new Error("Expected an array.");
2075
2078
  }
2076
2079
  getInput(e) {
2077
- return /* @__PURE__ */ s(_i, { field: this, ...e });
2080
+ return /* @__PURE__ */ a(_i, { field: this, ...e });
2078
2081
  }
2079
2082
  serialize() {
2080
2083
  return {
@@ -2099,15 +2102,15 @@ const Sa = {
2099
2102
  }
2100
2103
  static deserialize(e) {
2101
2104
  if (e.type !== "multi-string") throw new Error("Type mismatch.");
2102
- return new Le(e);
2105
+ return new Fe(e);
2103
2106
  }
2104
2107
  };
2105
- w(Le, "fieldTypeName", "Multi-string"), w(Le, "fieldTypeDescription", "Allows the user to provide multiple unique strings."), w(Le, "Icon", yr);
2106
- let mt = Le;
2107
- const zi = O((t) => {
2108
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t);
2108
+ w(Fe, "fieldTypeName", "Multi-string"), w(Fe, "fieldTypeDescription", "Allows the user to provide multiple unique strings."), w(Fe, "Icon", br);
2109
+ let ht = Fe;
2110
+ const $i = O((t) => {
2111
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
2109
2112
  let [{ helpText: c, label: d }] = U(t);
2110
- return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ s(re, { helpText: c, severity: r, children: /* @__PURE__ */ s(
2113
+ return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
2111
2114
  ie,
2112
2115
  {
2113
2116
  size: i,
@@ -2115,37 +2118,37 @@ const zi = O((t) => {
2115
2118
  inputId: n,
2116
2119
  labelId: e,
2117
2120
  label: d,
2118
- image: o ? void 0 : a.image,
2119
- children: /* @__PURE__ */ s(ue.Root, { accentColor: "base", variant: "surface", children: /* @__PURE__ */ s(
2120
- ue.Field,
2121
+ image: o ? void 0 : s.image,
2122
+ children: /* @__PURE__ */ a(de.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ a(
2123
+ de.Field,
2121
2124
  {
2122
2125
  ...f,
2123
2126
  ...l,
2124
2127
  type: "number",
2125
2128
  id: n,
2126
- placeholder: a.placeholder,
2127
- min: a.minimum,
2128
- max: a.maximum,
2129
- step: a.integers ? 1 : 0.1
2129
+ placeholder: s.placeholder,
2130
+ min: s.minimum,
2131
+ max: s.maximum,
2132
+ step: s.integers ? 1 : 0.1
2130
2133
  }
2131
2134
  ) })
2132
2135
  }
2133
2136
  ) });
2134
2137
  });
2135
- zi.displayName = "NumberInput";
2136
- const Ra = {
2138
+ $i.displayName = "NumberInput";
2139
+ const Na = {
2137
2140
  ...Q,
2138
2141
  type: "number",
2139
2142
  minimum: Number.MIN_SAFE_INTEGER,
2140
2143
  maximum: Number.MAX_SAFE_INTEGER,
2141
2144
  integers: !1
2142
- }, Mn = (t) => "fields" in t, ee = class ee extends G {
2145
+ }, zn = (t) => "fields" in t, ee = class ee extends G {
2143
2146
  constructor(e) {
2144
2147
  const {
2145
2148
  minimum: i = Number.MIN_SAFE_INTEGER,
2146
2149
  maximum: r = Number.MAX_SAFE_INTEGER,
2147
2150
  integers: o = !1,
2148
- placeholder: a = "Enter a number",
2151
+ placeholder: s = "Enter a number",
2149
2152
  ...l
2150
2153
  } = e;
2151
2154
  super({ ...l, type: "number" });
@@ -2153,7 +2156,7 @@ const Ra = {
2153
2156
  w(this, "maximum");
2154
2157
  w(this, "integers");
2155
2158
  w(this, "placeholder");
2156
- this.minimum = i, this.maximum = r, this.integers = o, this.placeholder = a;
2159
+ this.minimum = i, this.maximum = r, this.integers = o, this.placeholder = s;
2157
2160
  }
2158
2161
  getValueFromChangeEvent(e) {
2159
2162
  const i = Number.parseFloat(e.target.value);
@@ -2222,19 +2225,19 @@ const Ra = {
2222
2225
  return new ee(e);
2223
2226
  }
2224
2227
  getInput(e) {
2225
- return /* @__PURE__ */ s(zi, { field: this, ...e });
2228
+ return /* @__PURE__ */ a($i, { field: this, ...e });
2226
2229
  }
2227
2230
  };
2228
- w(ee, "fieldTypeName", "Number"), w(ee, "fieldTypeDescription", "Allows specifying a number within a given range."), w(ee, "Icon", br), w(ee, "_validateMin", (e) => (i, r) => {
2229
- const o = Mn(r) ? Y(r, e) : r;
2231
+ w(ee, "fieldTypeName", "Number"), w(ee, "fieldTypeDescription", "Allows specifying a number within a given range."), w(ee, "Icon", wr), w(ee, "_validateMin", (e) => (i, r) => {
2232
+ const o = zn(r) ? Y(r, e) : r;
2230
2233
  return typeof o.maximum == "number" && typeof i == "number" && o.maximum < i ? "Minimum cannot be greater than minimum." : null;
2231
2234
  }), w(ee, "_validateMax", (e) => (i, r) => {
2232
- const o = Mn(r) ? Y(r, e) : r;
2235
+ const o = zn(r) ? Y(r, e) : r;
2233
2236
  return typeof o.minimum == "number" && typeof i == "number" && o.minimum > i ? "Maximum cannot be less than minimum." : null;
2234
2237
  });
2235
2238
  let ve = ee;
2236
- const $i = O((t) => {
2237
- const [{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity: a, showInputOnly: l, field: f, fieldProps: c }, d] = U(t), [u, h] = H(!1), g = c.value, b = N(
2239
+ const Bi = O((t) => {
2240
+ const [{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity: s, showInputOnly: l, field: f, fieldProps: c }, d] = U(t), [u, h] = H(!1), g = c.value, b = N(
2238
2241
  (E) => {
2239
2242
  c.onChange({ target: { value: E } }), h(!1);
2240
2243
  },
@@ -2246,39 +2249,50 @@ const $i = O((t) => {
2246
2249
  }, []), x = N(() => {
2247
2250
  h(!1);
2248
2251
  }, []);
2249
- return /* @__PURE__ */ s(re, { helpText: r, severity: a, children: /* @__PURE__ */ y(
2252
+ return /* @__PURE__ */ a(re, { helpText: r, severity: s, children: /* @__PURE__ */ y(
2250
2253
  ie,
2251
2254
  {
2252
2255
  size: o,
2253
- severity: a,
2256
+ severity: s,
2254
2257
  inputId: n,
2255
2258
  labelId: e,
2256
2259
  label: i,
2257
2260
  image: l ? void 0 : f.image,
2258
2261
  className: "flex-col items-start justify-start gap-1",
2259
2262
  children: [
2260
- /* @__PURE__ */ s(sn, { open: u, onOpenChange: h, children: /* @__PURE__ */ y(ln, { children: [
2261
- /* @__PURE__ */ s(cn, { className: "light:bg-(--black-a6) fixed inset-0 dark:bg-(--black-a8)" }),
2262
- /* @__PURE__ */ s(dn, { className: "fixed inset-0", children: /* @__PURE__ */ s(Vi, { onQrScan: b, onClose: x }) })
2263
+ /* @__PURE__ */ a(ln, { open: u, onOpenChange: h, children: /* @__PURE__ */ y(cn, { children: [
2264
+ /* @__PURE__ */ a(dn, { className: "light:bg-(--black-a6) fixed inset-0 dark:bg-(--black-a8)" }),
2265
+ /* @__PURE__ */ a(un, { className: "fixed inset-0", children: /* @__PURE__ */ a(Vi, { onQrScan: b, onClose: x }) })
2263
2266
  ] }) }),
2264
2267
  /* @__PURE__ */ y("div", { className: "flex w-max items-center gap-1", children: [
2265
- /* @__PURE__ */ y(X, { ...d, variant: "soft", onClick: v, type: "button", children: [
2266
- /* @__PURE__ */ s(T, { icon: "RiQrCodeLine" }),
2267
- "Scan"
2268
- ] }),
2269
- g && /* @__PURE__ */ s("span", { className: "text-xs text-(--accent-a11)", "data-accent-color": "primary", children: /* @__PURE__ */ s(T, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
2268
+ /* @__PURE__ */ y(
2269
+ X,
2270
+ {
2271
+ ...d,
2272
+ variant: "soft",
2273
+ onClick: v,
2274
+ type: "button",
2275
+ size: "sm",
2276
+ accentColor: "base",
2277
+ children: [
2278
+ /* @__PURE__ */ a(T, { icon: "RiQrCodeLine" }),
2279
+ "Scan"
2280
+ ]
2281
+ }
2282
+ ),
2283
+ g && /* @__PURE__ */ a("span", { className: "text-xs text-(--accent-a11)", "data-accent-color": "primary", children: /* @__PURE__ */ a(T, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
2270
2284
  ] }),
2271
- !!g && /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ y("div", { className: "w-max items-center gap-2", children: [
2272
- /* @__PURE__ */ s("code", { className: "bg-(--base-a3)", children: g }),
2273
- /* @__PURE__ */ s(
2274
- V,
2285
+ !!g && /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ y("div", { className: "w-max items-center gap-2", children: [
2286
+ /* @__PURE__ */ a("code", { className: "bg-(--base-a3)", children: g }),
2287
+ /* @__PURE__ */ a(
2288
+ B,
2275
2289
  {
2276
2290
  accentColor: "base",
2277
2291
  variant: "ghost",
2278
2292
  "aria-label": "delete",
2279
2293
  size: "sm",
2280
2294
  onClick: m,
2281
- children: /* @__PURE__ */ s(T, { icon: "RiCloseLine" })
2295
+ children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" })
2282
2296
  }
2283
2297
  )
2284
2298
  ] }) })
@@ -2286,16 +2300,16 @@ const $i = O((t) => {
2286
2300
  }
2287
2301
  ) });
2288
2302
  });
2289
- $i.displayName = "QrInput";
2303
+ Bi.displayName = "QrInput";
2290
2304
  const Vi = O((t) => {
2291
2305
  const { onQrScan: n, onClose: e } = t, i = ne(null), [r, o] = H(!1);
2292
2306
  return K(() => {
2293
2307
  if (!i.current) return;
2294
- const a = new Dr(
2308
+ const s = new Ar(
2295
2309
  i.current,
2296
2310
  (l) => {
2297
2311
  const f = l.data;
2298
- n(f), a.destroy();
2312
+ n(f), s.destroy();
2299
2313
  },
2300
2314
  {
2301
2315
  highlightCodeOutline: !0,
@@ -2303,22 +2317,22 @@ const Vi = O((t) => {
2303
2317
  maxScansPerSecond: 1
2304
2318
  }
2305
2319
  );
2306
- o(!0), a.start().finally(() => {
2320
+ o(!0), s.start().finally(() => {
2307
2321
  o(!1);
2308
2322
  });
2309
2323
  }, [n]), /* @__PURE__ */ y("div", { className: "relative flex h-full w-full flex-col justify-center gap-2 bg-(--color-background)", children: [
2310
- /* @__PURE__ */ s("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ s(V, { "aria-label": "close", variant: "soft", accentColor: "base", onClick: e, children: /* @__PURE__ */ s(T, { icon: "RiCloseLine" }) }) }),
2324
+ /* @__PURE__ */ a("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ a(B, { "aria-label": "close", variant: "soft", accentColor: "base", onClick: e, children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" }) }) }),
2311
2325
  /* @__PURE__ */ y("div", { className: "relative max-h-full max-w-full", children: [
2312
- /* @__PURE__ */ s("video", { ref: i, style: { width: "100%", height: "100%" } }),
2313
- r && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center bg-(--color-background)", children: /* @__PURE__ */ s(vt, {}) })
2326
+ /* @__PURE__ */ a("video", { ref: i, style: { width: "100%", height: "100%" } }),
2327
+ r && /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center bg-(--color-background)", children: /* @__PURE__ */ a(yt, {}) })
2314
2328
  ] })
2315
2329
  ] });
2316
2330
  });
2317
2331
  Vi.displayName = "QrScanner";
2318
- const Na = {
2332
+ const Ta = {
2319
2333
  ...Q,
2320
2334
  type: "qr"
2321
- }, Fe = class Fe extends G {
2335
+ }, De = class De extends G {
2322
2336
  constructor(e) {
2323
2337
  super({ ...e, type: "qr" });
2324
2338
  w(this, "onlyValidateAfterTouched", !1);
@@ -2328,15 +2342,15 @@ const Na = {
2328
2342
  }
2329
2343
  static deserialize(e) {
2330
2344
  if (e.type !== "qr") throw new Error("Type mismatch.");
2331
- return new Fe(e);
2345
+ return new De(e);
2332
2346
  }
2333
2347
  getInput(e) {
2334
- return /* @__PURE__ */ s($i, { ...e, field: this });
2348
+ return /* @__PURE__ */ a(Bi, { ...e, field: this });
2335
2349
  }
2336
2350
  };
2337
- w(Fe, "fieldTypeName", "QR"), w(Fe, "fieldTypeDescription", "Used for scanning/reading QR codes."), w(Fe, "Icon", wr);
2338
- let Mt = Fe;
2339
- class Bi extends G {
2351
+ w(De, "fieldTypeName", "QR"), w(De, "fieldTypeDescription", "Used for scanning/reading QR codes."), w(De, "Icon", Cr);
2352
+ let $t = De;
2353
+ class Ui extends G {
2340
2354
  constructor(e) {
2341
2355
  const { placeholder: i = "", ...r } = e;
2342
2356
  super(r);
@@ -2345,7 +2359,7 @@ class Bi extends G {
2345
2359
  w(this, "placeholder");
2346
2360
  this.placeholder = i;
2347
2361
  const o = /* @__PURE__ */ new Set();
2348
- this.options = e.options.map((a) => (typeof a == "string" && (a = { label: a, value: a }), o.add(a.label), a)), o.size !== e.options.length && console.error(
2362
+ this.options = e.options.map((s) => (typeof s == "string" && (s = { label: s, value: s }), o.add(s.label), s)), o.size !== e.options.length && console.error(
2349
2363
  `${e.options.length - o.size} duplicate identifiers found in options. This may cause unexpected behavior. Options:`,
2350
2364
  e.options
2351
2365
  );
@@ -2361,7 +2375,7 @@ class Bi extends G {
2361
2375
  const i = e && `${e}.`;
2362
2376
  return [
2363
2377
  {
2364
- field: new mt({
2378
+ field: new ht({
2365
2379
  label: "Options",
2366
2380
  description: "List possible options for the user to select from.",
2367
2381
  required: !0,
@@ -2373,17 +2387,17 @@ class Bi extends G {
2373
2387
  ];
2374
2388
  }
2375
2389
  }
2376
- const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
2377
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t), { onChange: c, onBlur: d } = l;
2390
+ const La = (t) => t ? Array.isArray(t) ? t : [t] : [], ji = O((t) => {
2391
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t), { onChange: c, onBlur: d } = l;
2378
2392
  let [{ helpText: u, label: h }] = U(t);
2379
2393
  u = o ? null : u, h = o ? "" : h;
2380
- const g = A(() => Ta(l.value), [l.value]), b = N(
2394
+ const g = A(() => La(l.value), [l.value]), b = N(
2381
2395
  (m) => {
2382
2396
  c(m), d(m);
2383
2397
  },
2384
2398
  [c, d]
2385
2399
  );
2386
- return /* @__PURE__ */ s(re, { helpText: u, severity: r, children: /* @__PURE__ */ s(
2400
+ return /* @__PURE__ */ a(re, { helpText: u, severity: r, children: /* @__PURE__ */ a(
2387
2401
  ie,
2388
2402
  {
2389
2403
  size: i,
@@ -2391,9 +2405,9 @@ const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
2391
2405
  inputId: n,
2392
2406
  labelId: e,
2393
2407
  label: h,
2394
- image: o ? void 0 : a.image,
2408
+ image: o ? void 0 : s.image,
2395
2409
  children: /* @__PURE__ */ y(M.Root, { children: [
2396
- /* @__PURE__ */ s(M.ClickTrigger, { children: /* @__PURE__ */ y(
2410
+ /* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ y(
2397
2411
  X,
2398
2412
  {
2399
2413
  id: n,
@@ -2401,21 +2415,22 @@ const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
2401
2415
  name: l.name,
2402
2416
  variant: "surface",
2403
2417
  type: "button",
2418
+ size: "sm",
2404
2419
  accentColor: "base",
2405
2420
  ...f,
2406
2421
  children: [
2407
- g.length > 0 ? g.join(", ") : a.placeholder,
2408
- /* @__PURE__ */ s(T, { icon: "RiArrowDownSLine" })
2422
+ g.length > 0 ? g.join(", ") : s.placeholder,
2423
+ /* @__PURE__ */ a(T, { icon: "RiArrowDownSLine" })
2409
2424
  ]
2410
2425
  }
2411
2426
  ) }),
2412
- /* @__PURE__ */ s(M.Content, { children: /* @__PURE__ */ s(M.Scroll, { children: /* @__PURE__ */ y(M.MultiSelectGroup, { values: g, onValuesChange: b, children: [
2413
- /* @__PURE__ */ y(M.SelectAllItem, { allValues: a.options.map(({ value: m }) => m), children: [
2414
- /* @__PURE__ */ s(M.SelectAllIndicator, { children: (m) => m ? /* @__PURE__ */ s(T, { icon: "RiSubtractLine" }) : /* @__PURE__ */ s(T, { icon: "RiCheckLine" }) }),
2427
+ /* @__PURE__ */ a(M.Content, { children: /* @__PURE__ */ a(M.Scroll, { children: /* @__PURE__ */ y(M.MultiSelectGroup, { values: g, onValuesChange: b, children: [
2428
+ /* @__PURE__ */ y(M.SelectAllItem, { allValues: s.options.map(({ value: m }) => m), children: [
2429
+ /* @__PURE__ */ a(M.SelectAllIndicator, { children: (m) => m ? /* @__PURE__ */ a(T, { icon: "RiSubtractLine" }) : /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }),
2415
2430
  "Select all"
2416
2431
  ] }),
2417
- a.options.map((m) => /* @__PURE__ */ y(M.MultiSelectItem, { value: m.value, children: [
2418
- /* @__PURE__ */ s(M.SelectedIndicator, { children: /* @__PURE__ */ s(T, { icon: "RiCheckLine" }) }),
2432
+ s.options.map((m) => /* @__PURE__ */ y(M.MultiSelectItem, { value: m.value, children: [
2433
+ /* @__PURE__ */ a(M.SelectedIndicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }),
2419
2434
  m.label
2420
2435
  ] }, m.value))
2421
2436
  ] }) }) })
@@ -2423,12 +2438,12 @@ const Ta = (t) => t ? Array.isArray(t) ? t : [t] : [], Ui = O((t) => {
2423
2438
  }
2424
2439
  ) });
2425
2440
  });
2426
- Ui.displayName = "MultiSelectInput";
2427
- const La = {
2441
+ ji.displayName = "MultiSelectInput";
2442
+ const Fa = {
2428
2443
  ...Q,
2429
2444
  type: "multi-select",
2430
2445
  options: []
2431
- }, De = class De extends Bi {
2446
+ }, Ae = class Ae extends Ui {
2432
2447
  constructor(n) {
2433
2448
  const { placeholder: e = "Select one or more...", ...i } = n;
2434
2449
  super({ ...i, placeholder: e, type: "multi-select" });
@@ -2445,16 +2460,16 @@ const La = {
2445
2460
  }
2446
2461
  static deserialize(n) {
2447
2462
  if (n.type !== "multi-select") throw new Error("Type mismatch.");
2448
- return new De(n);
2463
+ return new Ae(n);
2449
2464
  }
2450
2465
  getInput(n) {
2451
- return /* @__PURE__ */ s(Ui, { field: this, ...n });
2466
+ return /* @__PURE__ */ a(ji, { field: this, ...n });
2452
2467
  }
2453
2468
  };
2454
- w(De, "fieldTypeName", "Multi-select"), w(De, "fieldTypeDescription", "Allows the user to select a multiple options from a list of options."), w(De, "Icon", Cr);
2455
- let ht = De;
2456
- const ji = O((t) => {
2457
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t), { onChange: c, onBlur: d } = l;
2469
+ w(Ae, "fieldTypeName", "Multi-select"), w(Ae, "fieldTypeDescription", "Allows the user to select a multiple options from a list of options."), w(Ae, "Icon", xr);
2470
+ let pt = Ae;
2471
+ const Wi = O((t) => {
2472
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t), { onChange: c, onBlur: d } = l;
2458
2473
  let [{ helpText: u, label: h }] = U(t);
2459
2474
  u = o ? null : u, h = o ? "" : h;
2460
2475
  const g = N(
@@ -2462,8 +2477,8 @@ const ji = O((t) => {
2462
2477
  c(m), d(m);
2463
2478
  },
2464
2479
  [c, d]
2465
- ), b = A(() => a.options.find((m) => m.value === l.value), [a.options, l.value]);
2466
- return /* @__PURE__ */ s(re, { helpText: u, severity: r, children: /* @__PURE__ */ s(
2480
+ ), b = A(() => s.options.find((m) => m.value === l.value), [s.options, l.value]);
2481
+ return /* @__PURE__ */ a(re, { helpText: u, severity: r, children: /* @__PURE__ */ a(
2467
2482
  ie,
2468
2483
  {
2469
2484
  size: i,
@@ -2471,9 +2486,9 @@ const ji = O((t) => {
2471
2486
  inputId: n,
2472
2487
  labelId: e,
2473
2488
  label: h,
2474
- image: o ? void 0 : a.image,
2489
+ image: o ? void 0 : s.image,
2475
2490
  children: /* @__PURE__ */ y(M.Root, { children: [
2476
- /* @__PURE__ */ s(M.ClickTrigger, { children: /* @__PURE__ */ y(
2491
+ /* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ y(
2477
2492
  X,
2478
2493
  {
2479
2494
  ...l,
@@ -2483,27 +2498,28 @@ const ji = O((t) => {
2483
2498
  accentColor: "base",
2484
2499
  variant: "surface",
2485
2500
  type: "button",
2501
+ size: "sm",
2486
2502
  ...f,
2487
2503
  children: [
2488
- b ? b.label : a.placeholder,
2489
- /* @__PURE__ */ s(T, { icon: "RiArrowDownSLine" })
2504
+ b ? b.label : s.placeholder,
2505
+ /* @__PURE__ */ a(T, { icon: "RiArrowDownSLine" })
2490
2506
  ]
2491
2507
  }
2492
2508
  ) }),
2493
- /* @__PURE__ */ s(M.Content, { children: /* @__PURE__ */ s(M.Scroll, { children: /* @__PURE__ */ s(M.SelectGroup, { value: l.value, onValueChange: g, children: a.options.map((m) => /* @__PURE__ */ y(M.SelectItem, { value: m.value, children: [
2494
- /* @__PURE__ */ s(M.SelectedIndicator, { children: /* @__PURE__ */ s(T, { icon: "RiCheckLine" }) }),
2509
+ /* @__PURE__ */ a(M.Content, { children: /* @__PURE__ */ a(M.Scroll, { children: /* @__PURE__ */ a(M.SelectGroup, { value: l.value, onValueChange: g, children: s.options.map((m) => /* @__PURE__ */ y(M.SelectItem, { value: m.value, children: [
2510
+ /* @__PURE__ */ a(M.SelectedIndicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }),
2495
2511
  m.label
2496
2512
  ] }, m.value)) }) }) })
2497
2513
  ] })
2498
2514
  }
2499
2515
  ) });
2500
2516
  });
2501
- ji.displayName = "SelectInput";
2502
- const Fa = {
2517
+ Wi.displayName = "SelectInput";
2518
+ const Da = {
2503
2519
  ...Q,
2504
2520
  type: "select",
2505
2521
  options: []
2506
- }, Ae = class Ae extends Bi {
2522
+ }, Oe = class Oe extends Ui {
2507
2523
  constructor(n) {
2508
2524
  const { placeholder: e = "Select one...", ...i } = n;
2509
2525
  super({ ...i, placeholder: e, type: "select" });
@@ -2516,19 +2532,19 @@ const Fa = {
2516
2532
  }
2517
2533
  static deserialize(n) {
2518
2534
  if (n.type !== "select") throw new Error("Type mismatch.");
2519
- return new Ae(n);
2535
+ return new Oe(n);
2520
2536
  }
2521
2537
  getInput(n) {
2522
- return /* @__PURE__ */ s(ji, { field: this, ...n });
2538
+ return /* @__PURE__ */ a(Wi, { field: this, ...n });
2523
2539
  }
2524
2540
  };
2525
- w(Ae, "fieldTypeName", "Dropdown"), w(Ae, "fieldTypeDescription", "Allows the user to select a single option from a list of options."), w(Ae, "Icon", xr);
2526
- let pt = Ae;
2541
+ w(Oe, "fieldTypeName", "Dropdown"), w(Oe, "fieldTypeDescription", "Allows the user to select a single option from a list of options."), w(Oe, "Icon", Er);
2542
+ let gt = Oe;
2527
2543
  const _n = (t) => "fields" in t;
2528
- class gt extends G {
2544
+ class vt extends G {
2529
2545
  constructor(e) {
2530
- const { minLength: i, maxLength: r, placeholder: o = "", ...a } = e;
2531
- super(a);
2546
+ const { minLength: i, maxLength: r, placeholder: o = "", ...s } = e;
2547
+ super(s);
2532
2548
  w(this, "minLength");
2533
2549
  w(this, "maxLength");
2534
2550
  w(this, "placeholder");
@@ -2595,22 +2611,22 @@ class gt extends G {
2595
2611
  * This function returns a function that validates that the value given for "minimum length" (when creating a new field) is less than or
2596
2612
  * equal to the value given for "maximum length".
2597
2613
  */
2598
- w(gt, "_validateMin", (e) => (i, r) => {
2614
+ w(vt, "_validateMin", (e) => (i, r) => {
2599
2615
  const o = _n(r) ? Y(r, e) : r;
2600
2616
  return typeof o.maximum_length == "number" && typeof i == "number" && o.maximum_length < i ? "Minimum cannot be greater than maximum." : null;
2601
2617
  }), /**
2602
2618
  * This function returns a function that validates that the value given for "maximum length" (when creating a new field) is greater than or
2603
2619
  * equal to the value given for "minimum length".
2604
2620
  */
2605
- w(gt, "_validateMax", (e) => (i, r) => {
2621
+ w(vt, "_validateMax", (e) => (i, r) => {
2606
2622
  if (typeof i != "number") return null;
2607
2623
  const { minimum_length: o } = _n(r) ? Y(r, e) : r;
2608
2624
  return typeof o != "number" ? null : o > i ? "Maximum cannot be less than minimum." : null;
2609
2625
  });
2610
- const Wi = O((t) => {
2611
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t);
2626
+ const qi = O((t) => {
2627
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
2612
2628
  let [{ helpText: c, label: d }] = U(t);
2613
- return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ s(re, { helpText: c, severity: r, children: /* @__PURE__ */ s(
2629
+ return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
2614
2630
  ie,
2615
2631
  {
2616
2632
  size: i,
@@ -2618,30 +2634,30 @@ const Wi = O((t) => {
2618
2634
  inputId: n,
2619
2635
  labelId: e,
2620
2636
  label: d,
2621
- image: o ? void 0 : a.image,
2622
- children: /* @__PURE__ */ s(ue.Root, { accentColor: "base", variant: "surface", children: /* @__PURE__ */ s(
2623
- ue.Field,
2637
+ image: o ? void 0 : s.image,
2638
+ children: /* @__PURE__ */ a(de.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ a(
2639
+ de.Field,
2624
2640
  {
2625
2641
  ...f,
2626
2642
  ...l,
2627
- type: a.inputType,
2643
+ type: s.inputType,
2628
2644
  id: n,
2629
- placeholder: a.placeholder
2645
+ placeholder: s.placeholder
2630
2646
  }
2631
2647
  ) })
2632
2648
  }
2633
2649
  ) });
2634
2650
  });
2635
- Wi.displayName = "StringInput";
2636
- const Da = {
2651
+ qi.displayName = "StringInput";
2652
+ const Aa = {
2637
2653
  ...Q,
2638
2654
  type: "string",
2639
2655
  maximum_length: Ze,
2640
2656
  input_type: "text"
2641
- }, Oe = class Oe extends gt {
2657
+ }, Pe = class Pe extends vt {
2642
2658
  constructor(e) {
2643
- const { inputType: i = "text", ...r } = e, o = e.maxLength ? Math.min(Ze, e.maxLength) : Ze, a = e.minLength ? Math.min(e.minLength, o) : void 0;
2644
- super({ ...r, maxLength: o, minLength: a, type: "string" });
2659
+ const { inputType: i = "text", ...r } = e, o = e.maxLength ? Math.min(Ze, e.maxLength) : Ze, s = e.minLength ? Math.min(e.minLength, o) : void 0;
2660
+ super({ ...r, maxLength: o, minLength: s, type: "string" });
2645
2661
  w(this, "inputType");
2646
2662
  this.inputType = i;
2647
2663
  }
@@ -2650,9 +2666,9 @@ const Da = {
2650
2666
  }
2651
2667
  static deserialize(e) {
2652
2668
  if (e.type !== "string") throw new Error("Type mismatch.");
2653
- const { maximum_length: i, minimum_length: r, input_type: o, ...a } = e;
2654
- return new Oe({
2655
- ...a,
2669
+ const { maximum_length: i, minimum_length: r, input_type: o, ...s } = e;
2670
+ return new Pe({
2671
+ ...s,
2656
2672
  maxLength: i,
2657
2673
  minLength: r,
2658
2674
  inputType: o,
@@ -2660,15 +2676,15 @@ const Da = {
2660
2676
  });
2661
2677
  }
2662
2678
  getInput(e) {
2663
- return /* @__PURE__ */ s(Wi, { field: this, ...e });
2679
+ return /* @__PURE__ */ a(qi, { field: this, ...e });
2664
2680
  }
2665
2681
  };
2666
- w(Oe, "fieldTypeName", "Short Text"), w(Oe, "fieldTypeDescription", `Short text fields can hold up to ${Ze} characters on a single line.`), w(Oe, "Icon", Er);
2667
- let _t = Oe;
2668
- const qi = O((t) => {
2669
- const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, fieldProps: l }, f] = U(t);
2682
+ w(Pe, "fieldTypeName", "Short Text"), w(Pe, "fieldTypeDescription", `Short text fields can hold up to ${Ze} characters on a single line.`), w(Pe, "Icon", Ir);
2683
+ let Bt = Pe;
2684
+ const Hi = O((t) => {
2685
+ const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: s, fieldProps: l }, f] = U(t);
2670
2686
  let [{ helpText: c, label: d }] = U(t);
2671
- return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ s(re, { helpText: c, severity: r, children: /* @__PURE__ */ s(
2687
+ return c = o ? null : c, d = o ? "" : d, /* @__PURE__ */ a(re, { helpText: c, severity: r, children: /* @__PURE__ */ a(
2672
2688
  ie,
2673
2689
  {
2674
2690
  size: i,
@@ -2676,29 +2692,30 @@ const qi = O((t) => {
2676
2692
  inputId: n,
2677
2693
  labelId: e,
2678
2694
  label: d,
2679
- image: o ? void 0 : a.image,
2680
- children: /* @__PURE__ */ s(
2681
- Bn,
2695
+ image: o ? void 0 : s.image,
2696
+ children: /* @__PURE__ */ a(
2697
+ Un,
2682
2698
  {
2683
2699
  ...f,
2684
2700
  ...l,
2685
2701
  className: "field-sizing-content",
2686
2702
  resize: "vertical",
2687
2703
  id: n,
2688
- placeholder: a.placeholder,
2704
+ placeholder: s.placeholder,
2689
2705
  accentColor: "base",
2690
- variant: "surface"
2706
+ variant: "surface",
2707
+ size: "sm"
2691
2708
  }
2692
2709
  )
2693
2710
  }
2694
2711
  ) });
2695
2712
  });
2696
- qi.displayName = "TextInput";
2697
- const Aa = {
2713
+ Hi.displayName = "TextInput";
2714
+ const Oa = {
2698
2715
  ...Q,
2699
2716
  type: "text",
2700
2717
  maximum_length: _e
2701
- }, Pe = class Pe extends gt {
2718
+ }, ke = class ke extends vt {
2702
2719
  constructor(n) {
2703
2720
  const e = n.maxLength ? Math.min(_e, n.maxLength) : _e, i = n.minLength ? Math.min(n.minLength, e) : void 0;
2704
2721
  super({ ...n, maxLength: e, minLength: i, type: "text" });
@@ -2709,7 +2726,7 @@ const Aa = {
2709
2726
  static deserialize(n) {
2710
2727
  if (n.type !== "text") throw new Error("Type mismatch.");
2711
2728
  const { maximum_length: e, minimum_length: i, ...r } = n;
2712
- return new Pe({
2729
+ return new ke({
2713
2730
  ...r,
2714
2731
  maxLength: e,
2715
2732
  minLength: i,
@@ -2717,17 +2734,17 @@ const Aa = {
2717
2734
  });
2718
2735
  }
2719
2736
  getInput(n) {
2720
- return /* @__PURE__ */ s(qi, { field: this, ...n });
2737
+ return /* @__PURE__ */ a(Hi, { field: this, ...n });
2721
2738
  }
2722
2739
  };
2723
- w(Pe, "fieldTypeName", "Paragraph"), w(Pe, "fieldTypeDescription", `Paragraph fields can hold up to ${_e} characters and can have multiple lines.`), w(Pe, "Icon", Ir);
2724
- let zt = Pe;
2725
- var Je = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, nt = { exports: {} }, Oa = nt.exports, zn;
2726
- function Pa() {
2727
- return zn || (zn = 1, function(t, n) {
2740
+ w(ke, "fieldTypeName", "Paragraph"), w(ke, "fieldTypeDescription", `Paragraph fields can hold up to ${_e} characters and can have multiple lines.`), w(ke, "Icon", Sr);
2741
+ let Vt = ke;
2742
+ var Je = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, nt = { exports: {} }, Pa = nt.exports, $n;
2743
+ function ka() {
2744
+ return $n || ($n = 1, function(t, n) {
2728
2745
  (function(e, i) {
2729
2746
  i();
2730
- })(Oa, function() {
2747
+ })(Pa, function() {
2731
2748
  function e(c, d) {
2732
2749
  return typeof d > "u" ? d = { autoBom: !1 } : typeof d != "object" && (console.warn("Deprecated: Expected third argument to be a object"), d = { autoBom: !d }), d.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type) ? new Blob(["\uFEFF", c], { type: c.type }) : c;
2733
2750
  }
@@ -2756,9 +2773,9 @@ function Pa() {
2756
2773
  d.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), c.dispatchEvent(d);
2757
2774
  }
2758
2775
  }
2759
- var a = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof Je == "object" && Je.global === Je ? Je : void 0, l = a.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), f = a.saveAs || (typeof window != "object" || window !== a ? function() {
2776
+ var s = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof Je == "object" && Je.global === Je ? Je : void 0, l = s.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), f = s.saveAs || (typeof window != "object" || window !== s ? function() {
2760
2777
  } : "download" in HTMLAnchorElement.prototype && !l ? function(c, d, u) {
2761
- var h = a.URL || a.webkitURL, g = document.createElement("a");
2778
+ var h = s.URL || s.webkitURL, g = document.createElement("a");
2762
2779
  d = d || c.name || "download", g.download = d, g.rel = "noopener", typeof c == "string" ? (g.href = c, g.origin === location.origin ? o(g) : r(g.href) ? i(c, d, u) : o(g, g.target = "_blank")) : (g.href = h.createObjectURL(c), setTimeout(function() {
2763
2780
  h.revokeObjectURL(g.href);
2764
2781
  }, 4e4), setTimeout(function() {
@@ -2775,7 +2792,7 @@ function Pa() {
2775
2792
  }
2776
2793
  } : function(c, d, u, h) {
2777
2794
  if (h = h || open("", "_blank"), h && (h.document.title = h.document.body.innerText = "downloading..."), typeof c == "string") return i(c, d, u);
2778
- var g = c.type === "application/octet-stream", b = /constructor/i.test(a.HTMLElement) || a.safari, m = /CriOS\/[\d]+/.test(navigator.userAgent);
2795
+ var g = c.type === "application/octet-stream", b = /constructor/i.test(s.HTMLElement) || s.safari, m = /CriOS\/[\d]+/.test(navigator.userAgent);
2779
2796
  if ((m || g && b || l) && typeof FileReader < "u") {
2780
2797
  var v = new FileReader();
2781
2798
  v.onloadend = function() {
@@ -2783,44 +2800,44 @@ function Pa() {
2783
2800
  S = m ? S : S.replace(/^data:[^;]*;/, "data:attachment/file;"), h ? h.location.href = S : location = S, h = null;
2784
2801
  }, v.readAsDataURL(c);
2785
2802
  } else {
2786
- var x = a.URL || a.webkitURL, E = x.createObjectURL(c);
2803
+ var x = s.URL || s.webkitURL, E = x.createObjectURL(c);
2787
2804
  h ? h.location = E : location.href = E, h = null, setTimeout(function() {
2788
2805
  x.revokeObjectURL(E);
2789
2806
  }, 4e4);
2790
2807
  }
2791
2808
  });
2792
- a.saveAs = f.saveAs = f, t.exports = f;
2809
+ s.saveAs = f.saveAs = f, t.exports = f;
2793
2810
  });
2794
2811
  }(nt)), nt.exports;
2795
2812
  }
2796
- var ka = Pa();
2797
- const Ma = O(
2813
+ var Ma = ka();
2814
+ const za = O(
2798
2815
  qe((t, n) => {
2799
- const { file: e, alt: i, error: r, rightSlot: o, className: a, truncateLength: l, ...f } = t, c = ne(null), d = ne(null), u = Un(c);
2800
- cr(() => {
2816
+ const { file: e, alt: i, error: r, rightSlot: o, className: s, truncateLength: l, ...f } = t, c = ne(null), d = ne(null), u = jn(c);
2817
+ dr(() => {
2801
2818
  !d.current || !u || (d.current.style.height = `${u.height * 4}px`);
2802
2819
  }, [u]);
2803
2820
  const h = A(() => {
2804
2821
  if (e)
2805
- return l !== void 0 ? Gt(e.name, l) : e.name;
2822
+ return l !== void 0 ? Xt(e.name, l) : e.name;
2806
2823
  }, [e, l]);
2807
2824
  return /* @__PURE__ */ y(
2808
2825
  "div",
2809
2826
  {
2810
- className: Be(
2811
- a,
2827
+ className: Ve(
2828
+ s,
2812
2829
  "relative flex h-max w-full flex-col gap-0 overflow-hidden rounded-md border items-center border-(--base-a6)"
2813
2830
  ),
2814
2831
  ref: n,
2815
2832
  ...f,
2816
2833
  children: [
2817
- !e && !r && /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ s(vt, {}) }),
2818
- /* @__PURE__ */ s(
2834
+ !e && !r && /* @__PURE__ */ a("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ a(yt, {}) }),
2835
+ /* @__PURE__ */ a(
2819
2836
  "div",
2820
2837
  {
2821
2838
  ref: d,
2822
2839
  className: "-m-4 flex max-w-full items-center justify-center overflow-hidden bg-clip-padding",
2823
- children: e && !r && /* @__PURE__ */ s(
2840
+ children: e && !r && /* @__PURE__ */ a(
2824
2841
  "img",
2825
2842
  {
2826
2843
  className: "max-w-full object-cover",
@@ -2833,13 +2850,13 @@ const Ma = O(
2833
2850
  /* @__PURE__ */ y(
2834
2851
  "div",
2835
2852
  {
2836
- className: Be("flex h-max w-full items-center gap-1 bg-(--base-2) px-2 py-1", {
2853
+ className: Ve("flex h-max w-full items-center gap-1 bg-(--base-2) px-2 py-1", {
2837
2854
  "bg-transparent": !e
2838
2855
  }),
2839
2856
  ref: c,
2840
2857
  children: [
2841
- r ? /* @__PURE__ */ s(T, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ s(yt, { fileType: e.type }),
2842
- r ?? h,
2858
+ r ? /* @__PURE__ */ a(T, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ a(wt, { fileType: e.type }),
2859
+ /* @__PURE__ */ a(ye, { className: "truncate", size: "sm", children: r ?? h }),
2843
2860
  o
2844
2861
  ]
2845
2862
  }
@@ -2859,12 +2876,12 @@ const Ma = O(
2859
2876
  style: "unit",
2860
2877
  unit: n[i]
2861
2878
  }).format(e);
2862
- }, Hi = O((t) => {
2879
+ }, Gi = O((t) => {
2863
2880
  var I;
2864
- const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: a, field: l, fieldProps: f }, c] = U(t), { onChange: d } = f;
2881
+ const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: s, field: l, fieldProps: f }, c] = U(t), { onChange: d } = f;
2865
2882
  let [{ label: u }] = U(t);
2866
- u = a ? "" : u;
2867
- const h = r ? ae[r] : void 0, g = ne(null), { value: b } = f, m = A(() => a ? null : o || (l.maxFileSize ? `Maximum file size: ${l.maxFileSize}MB` : null), [l.maxFileSize, o, a]), v = N(() => {
2883
+ u = s ? "" : u;
2884
+ const h = r ? ue[r] : void 0, g = ne(null), { value: b } = f, m = A(() => s ? null : o || (l.maxFileSize ? `Maximum file size: ${l.maxFileSize}MB` : null), [l.maxFileSize, o, s]), v = N(() => {
2868
2885
  var L;
2869
2886
  (L = g.current) == null || L.click();
2870
2887
  }, []), x = N(
@@ -2875,7 +2892,7 @@ const Ma = O(
2875
2892
  [b, d]
2876
2893
  ), E = b ? "Select new files" : "Select files", S = b ? "Select new file" : "Select a file", C = l.maxFiles > 1 ? E : S;
2877
2894
  return /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
2878
- /* @__PURE__ */ s(re, { helpText: m, severity: r, children: /* @__PURE__ */ y(
2895
+ /* @__PURE__ */ a(re, { helpText: m, severity: r, children: /* @__PURE__ */ y(
2879
2896
  ie,
2880
2897
  {
2881
2898
  size: i,
@@ -2883,25 +2900,27 @@ const Ma = O(
2883
2900
  inputId: n,
2884
2901
  labelId: e,
2885
2902
  label: u,
2886
- image: a ? void 0 : l.image,
2903
+ image: s ? void 0 : l.image,
2887
2904
  children: [
2888
- /* @__PURE__ */ s("div", { className: "flex gap-2", children: /* @__PURE__ */ y(
2905
+ /* @__PURE__ */ a("div", { className: "flex gap-2", children: /* @__PURE__ */ y(
2889
2906
  X,
2890
2907
  {
2891
2908
  ...c,
2892
2909
  className: "w-max",
2910
+ size: "sm",
2893
2911
  variant: "soft",
2912
+ accentColor: "base",
2894
2913
  onClick: v,
2895
2914
  id: "upload-input-upload-button",
2896
2915
  type: "button",
2897
2916
  children: [
2898
- /* @__PURE__ */ s(T, { icon: "RiUpload2Line" }),
2917
+ /* @__PURE__ */ a(T, { icon: "RiUpload2Line" }),
2899
2918
  " ",
2900
2919
  C
2901
2920
  ]
2902
2921
  }
2903
2922
  ) }),
2904
- /* @__PURE__ */ s(
2923
+ /* @__PURE__ */ a(
2905
2924
  "input",
2906
2925
  {
2907
2926
  ...c,
@@ -2919,8 +2938,8 @@ const Ma = O(
2919
2938
  ]
2920
2939
  }
2921
2940
  ) }),
2922
- Array.isArray(b) && b.length > 0 && /* @__PURE__ */ s("div", { className: "flex h-max flex-col gap-2", children: b.map((L, R) => /* @__PURE__ */ s(
2923
- Gi,
2941
+ Array.isArray(b) && b.length > 0 && /* @__PURE__ */ a("div", { className: "flex h-max flex-col gap-2", children: b.map((L, R) => /* @__PURE__ */ a(
2942
+ Xi,
2924
2943
  {
2925
2944
  field: l,
2926
2945
  file: L,
@@ -2933,21 +2952,21 @@ const Ma = O(
2933
2952
  )) })
2934
2953
  ] });
2935
2954
  });
2936
- Hi.displayName = "UploadInput";
2937
- const Gi = O((t) => {
2938
- const { file: n, field: e, onRemove: i, disabled: r } = t, [o, a] = H(null), l = en(), f = A(() => o && e.getError([o]), [e, o]), { url: c, name: d } = A(() => {
2955
+ Gi.displayName = "UploadInput";
2956
+ const Xi = O((t) => {
2957
+ const { file: n, field: e, onRemove: i, disabled: r } = t, [o, s] = H(null), l = tn(), f = A(() => o && e.getError([o]), [e, o]), { url: c, name: d } = A(() => {
2939
2958
  let m = null, v, x;
2940
2959
  return o != null && o.type.startsWith("image/") && (m = URL.createObjectURL(o)), o ? (v = o.name, x = _a(o.size)) : (v = "Downloading...", x = "..."), { url: m, name: v, size: x };
2941
2960
  }, [o]);
2942
2961
  K(() => {
2943
- n instanceof Promise ? n.then(a).catch(console.error) : a(n);
2962
+ n instanceof Promise ? n.then(s).catch(console.error) : s(n);
2944
2963
  }, [n]);
2945
2964
  const u = N(
2946
2965
  (m) => {
2947
2966
  if (m.stopPropagation(), !o)
2948
2967
  throw new Error("Cannot download a file that is not resolved.");
2949
2968
  const v = new Blob([o]);
2950
- ka.saveAs(v, d);
2969
+ Ma.saveAs(v, d);
2951
2970
  },
2952
2971
  [d, o]
2953
2972
  ), h = N(
@@ -2963,14 +2982,14 @@ const Gi = O((t) => {
2963
2982
  }
2964
2983
  }));
2965
2984
  }, [r, i, l, o]), b = A(
2966
- () => /* @__PURE__ */ y(Wt, { className: "flex w-full justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
2967
- /* @__PURE__ */ s(V, { "aria-label": `Download ${d}`, onClick: u, disabled: !o, children: /* @__PURE__ */ s(T, { icon: "RiDownload2Line" }) }),
2968
- !r && /* @__PURE__ */ s(V, { "aria-label": `Remove ${d}`, disabled: r, onClick: h, children: /* @__PURE__ */ s(T, { icon: "RiCloseLargeLine" }) })
2985
+ () => /* @__PURE__ */ y(bt, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
2986
+ /* @__PURE__ */ a(B, { "aria-label": `Download ${d}`, onClick: u, disabled: !o, children: /* @__PURE__ */ a(T, { icon: "RiDownload2Line" }) }),
2987
+ !r && /* @__PURE__ */ a(B, { "aria-label": `Remove ${d}`, disabled: r, onClick: h, children: /* @__PURE__ */ a(T, { icon: "RiDeleteBin7Fill" }) })
2969
2988
  ] }),
2970
2989
  [r, h, u, d, o]
2971
2990
  );
2972
- return c ? /* @__PURE__ */ s(
2973
- Ma,
2991
+ return c ? /* @__PURE__ */ a(
2992
+ za,
2974
2993
  {
2975
2994
  className: "cursor-pointer",
2976
2995
  onClick: g,
@@ -2978,19 +2997,19 @@ const Gi = O((t) => {
2978
2997
  error: f ?? void 0,
2979
2998
  rightSlot: b
2980
2999
  }
2981
- ) : /* @__PURE__ */ s(Yn, { file: o, error: f ?? void 0, rightSlot: b });
3000
+ ) : /* @__PURE__ */ a(Qn, { file: o, error: f ?? void 0, rightSlot: b });
2982
3001
  });
2983
- Gi.displayName = "DisplayFile";
2984
- const za = {
3002
+ Xi.displayName = "DisplayFile";
3003
+ const $a = {
2985
3004
  ...Q,
2986
3005
  type: "upload",
2987
3006
  extensions: [],
2988
3007
  maximum_size: void 0,
2989
3008
  maximum_files: 1
2990
- }, ke = class ke extends G {
3009
+ }, Me = class Me extends G {
2991
3010
  constructor(e) {
2992
- const { extensions: i, maximum_files: r, maximum_size: o, ...a } = e;
2993
- super({ ...a, type: "upload" });
3011
+ const { extensions: i, maximum_files: r, maximum_size: o, ...s } = e;
3012
+ super({ ...s, type: "upload" });
2994
3013
  w(this, "extensions");
2995
3014
  w(this, "maxFileSize");
2996
3015
  w(this, "maxFiles");
@@ -3032,7 +3051,7 @@ const za = {
3032
3051
  showDirectly: !1
3033
3052
  },
3034
3053
  {
3035
- field: new ht({
3054
+ field: new pt({
3036
3055
  label: "Accepted file types",
3037
3056
  description: "Types of allowed files to upload. If left blank, all files will be accepted.",
3038
3057
  required: !1,
@@ -3066,11 +3085,11 @@ const za = {
3066
3085
  }
3067
3086
  getFieldValidators() {
3068
3087
  const e = super.getFieldValidators(), i = this.maxFileSize ?? it, r = i * 1e3 * 1e3, o = this.maxFiles || 1;
3069
- return e.push((a) => {
3070
- if (a && a.some((l) => l.size > r))
3088
+ return e.push((s) => {
3089
+ if (s && s.some((l) => l.size > r))
3071
3090
  return `Files must be at most ${i}MB.`;
3072
- }), e.push((a) => {
3073
- if (a && a.length > o)
3091
+ }), e.push((s) => {
3092
+ if (s && s.length > o)
3074
3093
  return `You can only upload ${o} files.`;
3075
3094
  }), e;
3076
3095
  }
@@ -3084,54 +3103,54 @@ const za = {
3084
3103
  }
3085
3104
  static deserialize(e) {
3086
3105
  if (e.type !== "upload") throw new Error("Type mismatch.");
3087
- return new ke(e);
3106
+ return new Me(e);
3088
3107
  }
3089
3108
  getInput(e) {
3090
- return /* @__PURE__ */ s(Hi, { field: this, ...e });
3109
+ return /* @__PURE__ */ a(Gi, { field: this, ...e });
3091
3110
  }
3092
3111
  };
3093
- w(ke, "fieldTypeName", "Upload"), w(ke, "fieldTypeDescription", "Allows a file to be uploaded."), w(ke, "Icon", Sr);
3094
- let $t = ke;
3095
- const mn = {
3096
- date: Pt,
3112
+ w(Me, "fieldTypeName", "Upload"), w(Me, "fieldTypeDescription", "Allows a file to be uploaded."), w(Me, "Icon", Rr);
3113
+ let Ut = Me;
3114
+ const hn = {
3115
+ date: zt,
3097
3116
  number: ve,
3098
3117
  boolean: We,
3099
- select: pt,
3100
- string: _t,
3101
- text: zt,
3102
- custom: lt,
3103
- upload: $t,
3104
- qr: Mt,
3118
+ select: gt,
3119
+ string: Bt,
3120
+ text: Vt,
3121
+ custom: ct,
3122
+ upload: Ut,
3123
+ qr: $t,
3105
3124
  // TODO: Underscore
3106
- "multi-string": mt,
3107
- "multi-select": ht
3108
- }, $a = {
3109
- date: wa,
3110
- number: Ra,
3111
- boolean: ba,
3112
- select: Fa,
3113
- string: Da,
3114
- text: Aa,
3115
- custom: Ca,
3116
- upload: za,
3117
- qr: Na,
3125
+ "multi-string": ht,
3126
+ "multi-select": pt
3127
+ }, Ba = {
3128
+ date: Ca,
3129
+ number: Na,
3130
+ boolean: wa,
3131
+ select: Da,
3132
+ string: Aa,
3133
+ text: Oa,
3134
+ custom: xa,
3135
+ upload: $a,
3136
+ qr: Ta,
3118
3137
  // TODO: Underscore
3119
- "multi-string": Sa,
3120
- "multi-select": La
3121
- }, it = 50, Va = it * 1e3, Ba = Va * 1e3, Xi = (t) => {
3138
+ "multi-string": Ra,
3139
+ "multi-select": Fa
3140
+ }, it = 50, Va = it * 1e3, Ua = Va * 1e3, Ki = (t) => {
3122
3141
  const n = t.type;
3123
- return mn[n].deserialize(t);
3124
- }, hn = (t) => t.type === "section" ? q.deserialize(t) : Xi(t);
3125
- function Ua(t, n = {}) {
3142
+ return hn[n].deserialize(t);
3143
+ }, pn = (t) => t.type === "section" ? q.deserialize(t) : Ki(t);
3144
+ function ja(t, n = {}) {
3126
3145
  const { readonly: e = !1 } = n;
3127
3146
  return {
3128
3147
  title: t.title,
3129
3148
  description: t.description,
3130
- fields: t.fields.map((i) => hn(i)),
3149
+ fields: t.fields.map((i) => pn(i)),
3131
3150
  meta: { readonly: e }
3132
3151
  };
3133
3152
  }
3134
- function Ki(t) {
3153
+ function Yi(t) {
3135
3154
  const n = [];
3136
3155
  for (const e of t.fields)
3137
3156
  if (e instanceof q)
@@ -3144,28 +3163,28 @@ function Ki(t) {
3144
3163
  }
3145
3164
  return n;
3146
3165
  }
3147
- function gs(t, n) {
3148
- const e = Ki(t), i = {};
3166
+ function vs(t, n) {
3167
+ const e = Yi(t), i = {};
3149
3168
  for (const r of e) {
3150
3169
  const o = n[r.identifier] ?? null;
3151
3170
  o !== null ? i[r.identifier] = r.decodeJsonToValue(o) : i[r.identifier] = o;
3152
3171
  }
3153
3172
  return i;
3154
3173
  }
3155
- function vs(t, n) {
3156
- const e = Ki(t), i = {};
3174
+ function ys(t, n) {
3175
+ const e = Yi(t), i = {};
3157
3176
  for (const r of e) {
3158
3177
  const o = n[r.identifier];
3159
3178
  i[r.identifier] = r.encodeValueToJson(o);
3160
3179
  }
3161
3180
  return i;
3162
3181
  }
3163
- function Vt(t) {
3182
+ function jt(t) {
3164
3183
  return Array.isArray(t) && t.some((n) => n instanceof File || n instanceof Promise);
3165
3184
  }
3166
- function Yi(t, n) {
3185
+ function Qi(t, n) {
3167
3186
  if (!t) return !0;
3168
- if (Vt(n) || Vt(t.value)) throw new Error("Conditions do not support file uploads");
3187
+ if (jt(n) || jt(t.value)) throw new Error("Conditions do not support file uploads");
3169
3188
  const e = Array.isArray(n) ? n.map((r) => typeof r == "string" ? r : r.value) : n, i = Array.isArray(t.value) ? t.value.map((r) => typeof r == "string" ? r : r.value) : t.value;
3170
3189
  if (Array.isArray(i) && Array.isArray(e)) {
3171
3190
  for (const r of i)
@@ -3174,34 +3193,37 @@ function Yi(t, n) {
3174
3193
  }
3175
3194
  return i === n;
3176
3195
  }
3177
- const Qi = O((t) => {
3178
- const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: a } = n, { values: l, setFieldValue: f } = ye(), c = a != null && a.identifier ? Y(l, a.identifier) : void 0, d = A(
3179
- () => c === void 0 || Yi(a, c),
3180
- [a, c]
3196
+ const Ji = O((t) => {
3197
+ const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: s } = n, { values: l, setFieldValue: f } = be(), c = s != null && s.identifier ? Y(l, s.identifier) : void 0, d = A(
3198
+ () => c === void 0 || Qi(s, c),
3199
+ [s, c]
3181
3200
  );
3182
3201
  K(() => {
3183
3202
  if (!d)
3184
3203
  for (const h of o)
3185
3204
  f(h.getId(), "").then();
3186
3205
  }, [d, o, f]);
3187
- const u = ct(o, e);
3188
- return d ? /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-6", children: [
3189
- /* @__PURE__ */ y("div", { className: "flex flex-col", children: [
3190
- /* @__PURE__ */ s(jn, { size: "lg", children: i }),
3191
- /* @__PURE__ */ s(Ve, { accentColor: "base", children: r })
3206
+ const u = dt(o, e);
3207
+ return d ? /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-4", children: [
3208
+ (i || r) && /* @__PURE__ */ y(he, { children: [
3209
+ /* @__PURE__ */ y("div", { className: "flex flex-col", children: [
3210
+ /* @__PURE__ */ a(Wn, { size: "lg", children: i }),
3211
+ /* @__PURE__ */ a(ye, { accentColor: "base", children: r })
3212
+ ] }),
3213
+ /* @__PURE__ */ a(Ht, { size: "full" })
3192
3214
  ] }),
3193
3215
  u
3194
3216
  ] }) }) : null;
3195
3217
  });
3196
- Qi.displayName = "FieldSectionLayout";
3197
- const Me = class Me extends Qn {
3218
+ Ji.displayName = "FieldSectionLayout";
3219
+ const ze = class ze extends Jn {
3198
3220
  constructor(e) {
3199
- const { label: i = null, fields: r, condition: o = null, conditional: a, ...l } = e;
3221
+ const { label: i = null, fields: r, condition: o = null, conditional: s, ...l } = e;
3200
3222
  super({ ...l, type: "section" });
3201
3223
  w(this, "label");
3202
3224
  w(this, "fields");
3203
3225
  w(this, "condition");
3204
- this.fields = r, this.condition = o, this.label = i, a === !1 && (this.condition = null);
3226
+ this.fields = r, this.condition = o, this.label = i, s === !1 && (this.condition = null);
3205
3227
  }
3206
3228
  static getFieldCreationSchema(e, i = "") {
3207
3229
  if (e.length === 0) return [];
@@ -3217,7 +3239,7 @@ const Me = class Me extends Qn {
3217
3239
  },
3218
3240
  {
3219
3241
  // Declare a section that will hold options for the condition (if any).
3220
- field: new Me({
3242
+ field: new ze({
3221
3243
  label: "Conditional settings",
3222
3244
  identifier: `${r}conditional-settings`,
3223
3245
  // This section will only be rendered if the above "Conditional" field is checked.
@@ -3229,7 +3251,7 @@ const Me = class Me extends Qn {
3229
3251
  fields: [
3230
3252
  // Declare a select field that will be used to select the field against which we will check the
3231
3253
  // condition. This must be selected before the next field is rendered.
3232
- new pt({
3254
+ new gt({
3233
3255
  label: "Field",
3234
3256
  description: "The field to use for the condition.",
3235
3257
  // The options (for the field against which we will check the condition) are all the labels of
@@ -3246,7 +3268,7 @@ const Me = class Me extends Qn {
3246
3268
  // Declare a custom field that will be used to input a value for the condition. The value of the
3247
3269
  // conditional field selected in the previous step must be equal to the value the user inputs into
3248
3270
  // this field for the section to be rendered.
3249
- new xa({
3271
+ new Ea({
3250
3272
  label: "Value",
3251
3273
  identifier: `${r}condition.value`,
3252
3274
  required: !0,
@@ -3254,14 +3276,14 @@ const Me = class Me extends Qn {
3254
3276
  getFieldToClone(o) {
3255
3277
  if (!o)
3256
3278
  return null;
3257
- const a = e.find((l) => l.identifier === o);
3258
- return a ? {
3259
- ...a,
3279
+ const s = e.find((l) => l.identifier === o);
3280
+ return s ? {
3281
+ ...s,
3260
3282
  // Override some options to make it make sense in the context and to make it work with the framework.
3261
3283
  label: "Value",
3262
3284
  identifier: `${r}condition.value`,
3263
3285
  description: "The value to compare against.",
3264
- required: a.type !== "boolean"
3286
+ required: s.type !== "boolean"
3265
3287
  } : (console.error("Could not find field with identifier", o), null);
3266
3288
  }
3267
3289
  })
@@ -3274,8 +3296,8 @@ const Me = class Me extends Qn {
3274
3296
  static deserialize(e) {
3275
3297
  if (e.type !== "section") throw new Error("Invalid type");
3276
3298
  if (!Array.isArray(e.fields)) throw new Error(`Invalid fields: ${e.fields} (not an array)`);
3277
- const i = e.fields.map(Xi);
3278
- return new Me({ ...e, fields: i });
3299
+ const i = e.fields.map(Ki);
3300
+ return new ze({ ...e, fields: i });
3279
3301
  }
3280
3302
  conditional() {
3281
3303
  return this.condition !== null;
@@ -3292,24 +3314,24 @@ const Me = class Me extends Qn {
3292
3314
  getErrors(e) {
3293
3315
  const i = {};
3294
3316
  for (const r of this.fields) {
3295
- const o = r.getId(), a = r.getError(Y(e, o), e);
3296
- a && Qt(i, r.getId(), a);
3317
+ const o = r.getId(), s = r.getError(Y(e, o), e);
3318
+ s && Jt(i, r.getId(), s);
3297
3319
  }
3298
3320
  return i;
3299
3321
  }
3300
3322
  getInput(e) {
3301
- return /* @__PURE__ */ s(Qi, { field: this, ...e });
3323
+ return /* @__PURE__ */ a(Ji, { field: this, ...e });
3302
3324
  }
3303
3325
  };
3304
- w(Me, "fieldTypeName", "Section"), w(Me, "fieldTypeDescription", "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.");
3305
- let q = Me;
3306
- const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
3326
+ w(ze, "fieldTypeName", "Section"), w(ze, "fieldTypeDescription", "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.");
3327
+ let q = ze;
3328
+ const me = (t) => Object.keys(t).length > 0, gn = (t, n) => {
3307
3329
  const e = {};
3308
3330
  for (const i of t.fields)
3309
3331
  if (i instanceof q) {
3310
3332
  if (i.condition) {
3311
3333
  const { identifier: r } = i.condition;
3312
- if (!Yi(i.condition, Y(n, r)))
3334
+ if (!Qi(i.condition, Y(n, r)))
3313
3335
  continue;
3314
3336
  }
3315
3337
  Object.assign(e, i.getErrors(n));
@@ -3317,27 +3339,27 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
3317
3339
  if (!(i instanceof G))
3318
3340
  throw new Error("Invalid field type");
3319
3341
  const r = i.getId(), o = i.getError(Y(n, r), n);
3320
- o && Qt(e, r, o);
3342
+ o && Jt(e, r, o);
3321
3343
  }
3322
3344
  if (me(e)) return e;
3323
- }, ja = [null, void 0], gn = (t, n) => t.reduce(
3324
- (e, i) => i instanceof q ? { ...e, ...gn(i.fields, n) } : (ja.includes(Y(e, i.getId())) && Qt(e, i.getId(), ""), e),
3345
+ }, Wa = [null, void 0], vn = (t, n) => t.reduce(
3346
+ (e, i) => i instanceof q ? { ...e, ...vn(i.fields, n) } : (Wa.includes(Y(e, i.getId())) && Jt(e, i.getId(), ""), e),
3325
3347
  // TODO: Had to do this because of this error:
3326
3348
  // > Uncaught TypeError: can't define property "description":
3327
3349
  // > Object is not extensible"
3328
3350
  // This means that we can't mutate `acc` because it's frozen for some
3329
3351
  // unknown reason.
3330
- Ar(n)
3331
- ), Wa = () => {
3352
+ Or(n)
3353
+ ), qa = () => {
3332
3354
  throw new Error("onSubmit must be provided if form is not readonly.");
3333
- }, qa = O(
3355
+ }, Ha = O(
3334
3356
  qe((t, n) => {
3335
3357
  const {
3336
3358
  schema: e,
3337
3359
  values: i = {},
3338
- onSubmit: r = Wa,
3360
+ onSubmit: r = qa,
3339
3361
  submitText: o = "Submit",
3340
- cancelText: a,
3362
+ cancelText: s,
3341
3363
  onCancel: l,
3342
3364
  onDirty: f,
3343
3365
  onDirtyChange: c,
@@ -3346,51 +3368,51 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
3346
3368
  hideDescription: u,
3347
3369
  className: h,
3348
3370
  buttonProps: g
3349
- } = t, { readonly: b } = e.meta, m = A(() => crypto.randomUUID(), []), v = Kt({
3350
- initialValues: gn(e.fields, i),
3371
+ } = t, { readonly: b } = e.meta, m = A(() => crypto.randomUUID(), []), v = Yt({
3372
+ initialValues: vn(e.fields, i),
3351
3373
  onSubmit: r,
3352
- validate: (I) => pn(e, I),
3374
+ validate: (I) => gn(e, I),
3353
3375
  // only validate the entire form on submit
3354
3376
  validateOnBlur: !1,
3355
3377
  validateOnChange: !1
3356
3378
  }), { dirty: x } = v, E = A(
3357
- () => typeof e.title == "string" ? /* @__PURE__ */ s(jn, { size: "lg", children: e.title }) : e.title,
3379
+ () => typeof e.title == "string" ? /* @__PURE__ */ a(Wn, { size: "md", children: e.title }) : e.title,
3358
3380
  [e.title]
3359
3381
  ), S = A(
3360
- () => typeof e.description == "string" ? /* @__PURE__ */ s(Ve, { accentColor: "base", children: e.description }) : e.description,
3382
+ () => typeof e.description == "string" ? /* @__PURE__ */ a(ye, { accentColor: "base", children: e.description }) : e.description,
3361
3383
  [e.description]
3362
- ), C = ct(e.fields, { formId: m, disabled: b });
3384
+ ), C = dt(e.fields, { formId: m, disabled: b });
3363
3385
  return K(() => {
3364
3386
  x && f && f(), c && c(x);
3365
- }, [x, f, c]), /* @__PURE__ */ s(Yt, { value: v, children: /* @__PURE__ */ y(
3387
+ }, [x, f, c]), /* @__PURE__ */ a(Qt, { value: v, children: /* @__PURE__ */ y(
3366
3388
  "form",
3367
3389
  {
3368
3390
  id: m,
3369
3391
  ref: n,
3370
- className: Be(h, "flex flex-col gap-2"),
3392
+ className: Ve(h, "flex flex-col gap-2"),
3371
3393
  onSubmit: v.handleSubmit,
3372
3394
  children: [
3373
- !d && /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
3395
+ !d && /* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
3374
3396
  E,
3375
3397
  !u && S
3376
3398
  ] }) }),
3377
3399
  C,
3378
3400
  !b && /* @__PURE__ */ y("div", { className: "flex items-center justify-end gap-2", children: [
3379
- a && /* @__PURE__ */ y(
3401
+ s && /* @__PURE__ */ y(
3380
3402
  X,
3381
3403
  {
3382
- accentColor: ae.danger,
3404
+ accentColor: ue.danger,
3383
3405
  ...g,
3384
3406
  type: "button",
3385
3407
  onClick: l,
3386
3408
  children: [
3387
- /* @__PURE__ */ s(T, { icon: "RiCloseLine" }),
3388
- a
3409
+ /* @__PURE__ */ a(T, { icon: "RiCloseLine" }),
3410
+ s
3389
3411
  ]
3390
3412
  }
3391
3413
  ),
3392
3414
  /* @__PURE__ */ y(X, { ...g, type: "submit", disabled: !v.isValid, accentColor: "success", children: [
3393
- /* @__PURE__ */ s(T, { icon: "RiCheckLine" }),
3415
+ /* @__PURE__ */ a(T, { icon: "RiCheckLine" }),
3394
3416
  o
3395
3417
  ] })
3396
3418
  ] })
@@ -3398,10 +3420,10 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
3398
3420
  }
3399
3421
  ) });
3400
3422
  })
3401
- ), $e = O((t) => {
3402
- const { name: n, render: e } = t, { submitForm: i } = ye(), [r, o, a] = Xt(n), l = A(() => {
3423
+ ), Be = O((t) => {
3424
+ const { name: n, render: e } = t, { submitForm: i } = be(), [r, o, s] = Kt(n), l = A(() => {
3403
3425
  const f = (c) => {
3404
- a.setValue(c, !1);
3426
+ s.setValue(c, !1);
3405
3427
  };
3406
3428
  return e({
3407
3429
  value: r.value,
@@ -3411,13 +3433,13 @@ const me = (t) => Object.keys(t).length > 0, pn = (t, n) => {
3411
3433
  i();
3412
3434
  }
3413
3435
  });
3414
- }, [e, r.value, o, i, a]);
3415
- return /* @__PURE__ */ s(he, { children: l });
3436
+ }, [e, r.value, o, i, s]);
3437
+ return /* @__PURE__ */ a(he, { children: l });
3416
3438
  });
3417
- $e.displayName = "PatchField";
3418
- const ys = O(
3439
+ Be.displayName = "PatchField";
3440
+ const bs = O(
3419
3441
  qe((t, n) => {
3420
- const { children: e, schema: i, values: r, onPatch: o, onError: a, requiresDiff: l = !0, onDirtyChange: f, ...c } = t, d = A(() => gn(i.fields, r), [i.fields, r]), u = N(
3442
+ const { children: e, schema: i, values: r, onPatch: o, onError: s, requiresDiff: l = !0, onDirtyChange: f, ...c } = t, d = A(() => vn(i.fields, r), [i.fields, r]), u = N(
3421
3443
  (E) => {
3422
3444
  const S = {};
3423
3445
  for (const C in E) {
@@ -3435,15 +3457,15 @@ const ys = O(
3435
3457
  [u, o, l]
3436
3458
  ), g = N(
3437
3459
  (E) => {
3438
- const S = pn(i, E);
3439
- if (S && a(S), f) {
3460
+ const S = gn(i, E);
3461
+ if (S && s(S), f) {
3440
3462
  const C = u(E);
3441
3463
  f(me(C));
3442
3464
  }
3443
3465
  return S;
3444
3466
  },
3445
- [i, f, a, u]
3446
- ), b = Kt({
3467
+ [i, f, s, u]
3468
+ ), b = Yt({
3447
3469
  initialValues: d,
3448
3470
  onSubmit: h,
3449
3471
  validate: g,
@@ -3458,16 +3480,16 @@ const ys = O(
3458
3480
  }, [b.values, u, f]), { errors: v, resetForm: x } = b;
3459
3481
  return K(() => {
3460
3482
  me(v) && x({ values: d, errors: {} });
3461
- }, [v, d, x]), /* @__PURE__ */ s(Yt, { value: b, children: /* @__PURE__ */ s("form", { ...c, ref: n, onSubmit: b.handleSubmit, onChange: m, children: e }) });
3483
+ }, [v, d, x]), /* @__PURE__ */ a(Qt, { value: b, children: /* @__PURE__ */ a("form", { ...c, ref: n, onSubmit: b.handleSubmit, onChange: m, children: e }) });
3462
3484
  })
3463
- ), rt = "form-builder", Ha = [
3485
+ ), rt = "form-builder", Ga = [
3464
3486
  ["string", "text"],
3465
3487
  ["select", "multi-select", "upload", "qr"],
3466
3488
  ["boolean", "date", "number", "multi-string"]
3467
- ], Bt = {
3468
- ...mn,
3489
+ ], Wt = {
3490
+ ...hn,
3469
3491
  section: q
3470
- }, Ga = (t, n) => {
3492
+ }, Xa = (t, n) => {
3471
3493
  var i;
3472
3494
  const e = { ...t };
3473
3495
  switch (n.type) {
@@ -3482,7 +3504,7 @@ const ys = O(
3482
3504
  case "update":
3483
3505
  return n.state;
3484
3506
  }
3485
- }, Xa = (t, n) => {
3507
+ }, Ka = (t, n) => {
3486
3508
  if (n)
3487
3509
  for (let e = 0; e < t.length; e++) {
3488
3510
  const i = t[e];
@@ -3491,42 +3513,42 @@ const ys = O(
3491
3513
  if (r.identifier === n) return e;
3492
3514
  }
3493
3515
  }
3494
- }, $n = (t) => {
3516
+ }, Bn = (t) => {
3495
3517
  var e, i, r;
3496
3518
  const n = {};
3497
3519
  for (let o = 0; o < t.length; o++) {
3498
- const a = t[o];
3499
- if (!a) throw new Error("Field is undefined.");
3520
+ const s = t[o];
3521
+ if (!s) throw new Error("Field is undefined.");
3500
3522
  const l = o > 0 ? (e = n[t[o - 1].identifier]) == null ? void 0 : e.conditionFields : void 0, f = new Set(l);
3501
- (i = a.condition) != null && i.identifier && f.add(a.condition.identifier), n[a.identifier] = {
3523
+ (i = s.condition) != null && i.identifier && f.add(s.condition.identifier), n[s.identifier] = {
3502
3524
  disabled: !1,
3503
3525
  conditionFields: f,
3504
- conditionIndex: Xa(t, (r = a.condition) == null ? void 0 : r.identifier),
3526
+ conditionIndex: Ka(t, (r = s.condition) == null ? void 0 : r.identifier),
3505
3527
  index: o,
3506
- label: a.label
3528
+ label: s.label
3507
3529
  };
3508
3530
  }
3509
3531
  return n;
3510
- }, vn = O((t) => {
3511
- const { index: n, type: e, sectionIndex: i, remove: r, duplicate: o, move: a, upload: l } = t;
3532
+ }, yn = O((t) => {
3533
+ const { index: n, type: e, sectionIndex: i, remove: r, duplicate: o, move: s, upload: l } = t;
3512
3534
  if (e !== "section" && !l)
3513
3535
  throw new Error("Upload function prop must be defined for non-section fields.");
3514
- const { values: f } = ye(), c = ne(null), d = A(() => {
3536
+ const { values: f } = be(), c = ne(null), d = A(() => {
3515
3537
  const u = [
3516
3538
  {
3517
- Icon: Rr,
3539
+ Icon: Nr,
3518
3540
  key: "duplicate",
3519
3541
  text: "Duplicate",
3520
3542
  buttonProps: { onClick: o }
3521
3543
  }
3522
3544
  ];
3523
3545
  return u.push({
3524
- Icon: Nr,
3546
+ Icon: Tr,
3525
3547
  key: "delete",
3526
3548
  text: "Delete",
3527
3549
  buttonProps: { onClick: r }
3528
3550
  }), e !== "section" && u.unshift({
3529
- Icon: Tr,
3551
+ Icon: Lr,
3530
3552
  key: "upload",
3531
3553
  text: "Upload image",
3532
3554
  buttonProps: {
@@ -3536,86 +3558,86 @@ const ys = O(
3536
3558
  }
3537
3559
  }
3538
3560
  }), (i === void 0 && n !== f.fields.length - 1 || i !== void 0 && (i < f.fields.length - 1 || n !== f.fields[i].fields.length - 1)) && u.unshift({
3539
- Icon: Lr,
3561
+ Icon: Fr,
3540
3562
  key: "moveDown",
3541
3563
  text: "Move down",
3542
3564
  buttonProps: {
3543
3565
  onClick: () => {
3544
- a("down");
3566
+ s("down");
3545
3567
  }
3546
3568
  }
3547
3569
  }), (i === void 0 && n !== 0 || i !== void 0 && (i !== 0 || n !== 0)) && u.unshift({
3548
- Icon: Fr,
3570
+ Icon: Dr,
3549
3571
  key: "moveUp",
3550
3572
  text: "Move up",
3551
3573
  buttonProps: {
3552
3574
  onClick: () => {
3553
- a("up");
3575
+ s("up");
3554
3576
  }
3555
3577
  }
3556
3578
  }), u;
3557
- }, [o, n, a, r, i, e, f.fields]);
3579
+ }, [o, n, s, r, i, e, f.fields]);
3558
3580
  return /* @__PURE__ */ y(he, { children: [
3559
- /* @__PURE__ */ s("div", { className: "mx-2 hidden flex-col gap-5 sm:flex", children: d.map((u) => /* @__PURE__ */ s(
3560
- V,
3581
+ /* @__PURE__ */ a(bt, { className: "mx-2 hidden flex-col gap-0.5 sm:flex", variant: "ghost", accentColor: "base", size: "sm", children: d.map((u) => /* @__PURE__ */ a(
3582
+ B,
3561
3583
  {
3562
3584
  type: "button",
3563
- variant: "ghost",
3564
- accentColor: u.key.startsWith("move") ? "base" : void 0,
3565
3585
  "aria-label": u.text,
3566
3586
  ...u.buttonProps,
3567
- children: /* @__PURE__ */ s(u.Icon, {})
3587
+ children: /* @__PURE__ */ a(u.Icon, {})
3568
3588
  },
3569
3589
  u.key
3570
3590
  )) }),
3571
- /* @__PURE__ */ s("div", { className: "sm:hidden", children: /* @__PURE__ */ y(M.Root, { children: [
3572
- /* @__PURE__ */ s(M.ClickTrigger, { children: /* @__PURE__ */ s(V, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ s(T, { icon: "RiMore2Line" }) }) }),
3573
- /* @__PURE__ */ s(M.Content, { children: d.map((u) => {
3591
+ /* @__PURE__ */ a("div", { className: "sm:hidden", children: /* @__PURE__ */ y(M.Root, { children: [
3592
+ /* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ a(B, { variant: "ghost", accentColor: "base", "aria-label": "Actions menu", size: "sm", children: /* @__PURE__ */ a(T, { icon: "RiMore2Line" }) }) }),
3593
+ /* @__PURE__ */ a(M.Content, { children: d.map((u) => {
3574
3594
  var h;
3575
3595
  return /* @__PURE__ */ y(M.Item, { onClick: (h = u.buttonProps) == null ? void 0 : h.onClick, children: [
3576
- /* @__PURE__ */ s(u.Icon, {}),
3596
+ /* @__PURE__ */ a(u.Icon, {}),
3577
3597
  u.text
3578
3598
  ] }, u.key);
3579
3599
  }) })
3580
3600
  ] }) }),
3581
- e !== "section" && /* @__PURE__ */ s("input", { style: { display: "none" }, ref: c, type: "file", accept: "image/*", onChange: l })
3601
+ e !== "section" && /* @__PURE__ */ a("input", { style: { display: "none" }, ref: c, type: "file", accept: "image/*", onChange: l })
3582
3602
  ] });
3583
3603
  });
3584
- vn.displayName = "FieldActions";
3585
- const Ji = (t = () => null) => A(() => Ha.map((n) => n.map((e) => {
3586
- const i = mn[e], r = i.Icon;
3604
+ yn.displayName = "FieldActions";
3605
+ const Zi = (t = () => null) => A(() => Ga.map((n) => n.map((e) => {
3606
+ const i = hn[e], r = i.Icon;
3587
3607
  return {
3588
3608
  children: i.fieldTypeName,
3589
- icon: /* @__PURE__ */ s(r, {}),
3609
+ icon: /* @__PURE__ */ a(r, {}),
3590
3610
  value: e,
3591
3611
  onSelect: () => {
3592
3612
  t(e);
3593
3613
  }
3594
3614
  };
3595
- })), [t]), fe = (t) => t.type === "section", Ut = O((t) => {
3615
+ })), [t]), fe = (t) => t.type === "section", qt = O((t) => {
3596
3616
  const { popoverInputs: n, hasError: e } = t;
3597
3617
  return /* @__PURE__ */ y(oe.Root, { children: [
3598
- /* @__PURE__ */ s(oe.Trigger, { children: /* @__PURE__ */ y(
3618
+ /* @__PURE__ */ a(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ y(
3599
3619
  X,
3600
3620
  {
3601
3621
  variant: "soft",
3622
+ type: "button",
3602
3623
  size: "sm",
3603
3624
  "aria-label": "settings",
3604
- ...e && { color: ae.danger },
3625
+ accentColor: "base",
3626
+ ...e && { color: ue.danger },
3605
3627
  children: [
3606
- /* @__PURE__ */ s(T, { icon: "RiSettings2Line" }),
3607
- /* @__PURE__ */ s("span", { children: "Settings" })
3628
+ /* @__PURE__ */ a(T, { icon: "RiSettings2Line" }),
3629
+ /* @__PURE__ */ a("span", { children: "Settings" })
3608
3630
  ]
3609
3631
  },
3610
3632
  "settings"
3611
3633
  ) }),
3612
- /* @__PURE__ */ s(oe.Content, { size: "sm", children: /* @__PURE__ */ s("div", { className: "flex max-w-[240px] flex-col", children: n }) })
3634
+ /* @__PURE__ */ a(oe.Content, { size: "sm", children: /* @__PURE__ */ a("div", { className: "flex max-w-[240px] flex-col", children: n }) })
3613
3635
  ] });
3614
3636
  });
3615
- Ut.displayName = "FieldSettingsPopover";
3616
- const yn = O((t) => {
3617
- var He, xt, bn, wn, Cn;
3618
- const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: a, errors: l } = ye(), f = Ji(), c = en(), d = ne(null), u = 576, [h, g] = H(
3637
+ qt.displayName = "FieldSettingsPopover";
3638
+ const bn = O((t) => {
3639
+ var He, It, wn, Cn, xn;
3640
+ const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: s, errors: l } = be(), f = Zi(), c = tn(), d = ne(null), u = 576, [h, g] = H(
3619
3641
  d.current && d.current.getBoundingClientRect().width >= u
3620
3642
  );
3621
3643
  K(() => {
@@ -3637,31 +3659,31 @@ const yn = O((t) => {
3637
3659
  (D) => {
3638
3660
  D.stopPropagation();
3639
3661
  const { image: k, ...W } = i;
3640
- a(`${n}.${e}`, W).then();
3662
+ s(`${n}.${e}`, W).then();
3641
3663
  },
3642
- [e, i, n, a]
3664
+ [e, i, n, s]
3643
3665
  );
3644
3666
  K(() => {
3645
- fe(i) && !i.conditional && a(`${n}.${e}.condition`, null).then();
3646
- }, [e, i, n, a]);
3667
+ fe(i) && !i.conditional && s(`${n}.${e}.condition`, null).then();
3668
+ }, [e, i, n, s]);
3647
3669
  const E = A(
3648
3670
  () => {
3649
3671
  var D, k;
3650
- return fe(i) ? (k = ki(o.fields, (D = i.condition) == null ? void 0 : D.identifier)) == null ? void 0 : k.label : void 0;
3672
+ return fe(i) ? (k = Mi(o.fields, (D = i.condition) == null ? void 0 : D.identifier)) == null ? void 0 : k.label : void 0;
3651
3673
  },
3652
3674
  [i, o.fields]
3653
3675
  ), S = fe(i) ? Array.isArray((He = i.condition) == null ? void 0 : He.value) ? "contains all of" : "equals" : void 0;
3654
3676
  let C;
3655
3677
  if (fe(i)) {
3656
- if (Vt((xt = i.condition) == null ? void 0 : xt.value))
3678
+ if (jt((It = i.condition) == null ? void 0 : It.value))
3657
3679
  throw new Error("File values are not supported for conditions.");
3658
- C = Array.isArray((bn = i.condition) == null ? void 0 : bn.value) ? i.condition.value.map((D) => typeof D == "string" ? D : D.label).join(", ") : (Cn = (wn = i.condition) == null ? void 0 : wn.value) == null ? void 0 : Cn.toString();
3680
+ C = Array.isArray((wn = i.condition) == null ? void 0 : wn.value) ? i.condition.value.map((D) => typeof D == "string" ? D : D.label).join(", ") : (xn = (Cn = i.condition) == null ? void 0 : Cn.value) == null ? void 0 : xn.toString();
3659
3681
  }
3660
3682
  const I = N((D) => {
3661
3683
  D.target.parentNode instanceof HTMLElement && (D.target.parentNode.dataset.replicatedValue = D.target.value);
3662
3684
  }, []), L = N((D) => {
3663
3685
  D.target.parentNode instanceof HTMLElement && (D.target.parentNode.dataset.replicatedValue = D.target.value);
3664
- }, []), R = i.type, F = Bt[R], [B, z] = A(() => {
3686
+ }, []), R = i.type, F = Wt[R], [V, _] = A(() => {
3665
3687
  let D = [], k = [];
3666
3688
  if (F === q) {
3667
3689
  if (r === void 0)
@@ -3687,92 +3709,93 @@ const yn = O((t) => {
3687
3709
  ]) : k = [...k, ...W.map((j) => j.field)];
3688
3710
  }
3689
3711
  return [D, k];
3690
- }, [F, r, n, e, h]), P = ct(B, {
3712
+ }, [F, r, n, e, h]), P = dt(V, {
3691
3713
  formId: rt,
3692
3714
  disabled: !1,
3693
3715
  internal: !0,
3694
3716
  ...F === q && { size: "sm" }
3695
- }), $ = ct(z, {
3717
+ }), $ = dt(_, {
3696
3718
  formId: rt,
3697
3719
  disabled: !1
3698
3720
  });
3699
- let _ = z.length > 0;
3700
- fe(i) && z.length > 0 && (_ = i.conditional);
3701
- const Z = z.some((D) => {
3721
+ let z = _.length > 0;
3722
+ fe(i) && _.length > 0 && (z = i.conditional);
3723
+ const Z = _.some((D) => {
3702
3724
  const k = Y(l, F === q ? `${n}.${e}.condition` : D.getId());
3703
3725
  return k && (typeof k != "object" || me(k));
3704
- }), we = Z ? ae.danger : void 0, je = A(() => hn(i), [i]), Ct = Oi(je, { formId: rt, showInputOnly: !1 }), le = A(
3726
+ }), Ce = Z ? ue.danger : void 0, je = A(() => pn(i), [i]), Et = Pi(je, { formId: rt, showInputOnly: !1 }), se = A(
3705
3727
  () => f.flat().find((D) => D.value === R),
3706
3728
  [f, R]
3707
- ), Ce = N(() => {
3729
+ ), xe = N(() => {
3708
3730
  b && c(() => ({
3709
3731
  file: b
3710
3732
  }));
3711
3733
  }, [c, b]);
3712
- return /* @__PURE__ */ s("div", { className: "flex grow items-center w-full", ref: d, children: /* @__PURE__ */ y("div", { className: "flex w-full flex-col gap-4", children: [
3713
- F === q && /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
3714
- B.length > 0 && P,
3715
- /* @__PURE__ */ y("div", { className: "flex items-center gap-4", children: [
3716
- _ && /* @__PURE__ */ s(Ut, { popoverInputs: $, hasError: Z }),
3717
- fe(i) && i.conditional && /* @__PURE__ */ s("span", { className: "text-sm text-(--accent-a11)", "data-accent-color": we, children: /* @__PURE__ */ y("em", { children: [
3734
+ return /* @__PURE__ */ a("div", { className: "flex grow items-center w-full", ref: d, children: /* @__PURE__ */ y("div", { className: "flex w-full flex-col gap-2", children: [
3735
+ F === q && (V.length > 0 || z) && /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
3736
+ P,
3737
+ z && /* @__PURE__ */ y("div", { className: "flex items-center gap-4", children: [
3738
+ /* @__PURE__ */ a(qt, { popoverInputs: $, hasError: Z }),
3739
+ fe(i) && i.conditional && /* @__PURE__ */ a("span", { className: "text-sm text-(--accent-a11)", "data-accent-color": Ce, children: /* @__PURE__ */ y("em", { children: [
3718
3740
  "Display only if ",
3719
- /* @__PURE__ */ s("strong", { children: E }),
3741
+ /* @__PURE__ */ a("strong", { children: E }),
3720
3742
  " ",
3721
3743
  S,
3722
3744
  " ",
3723
- /* @__PURE__ */ s("strong", { children: C })
3745
+ /* @__PURE__ */ a("strong", { children: C })
3724
3746
  ] }) })
3725
3747
  ] })
3726
3748
  ] }),
3727
3749
  F !== q && /* @__PURE__ */ y("div", { className: "flex gap-2 w-full justify-between", children: [
3728
3750
  /* @__PURE__ */ y("div", { className: "flex gap-2 items-center", children: [
3729
- /* @__PURE__ */ y(jt, { accentColor: "base", variant: "soft", children: [
3730
- le == null ? void 0 : le.icon,
3731
- le == null ? void 0 : le.children
3751
+ /* @__PURE__ */ y(ot, { accentColor: "base", variant: "soft", size: "sm", children: [
3752
+ se == null ? void 0 : se.icon,
3753
+ se == null ? void 0 : se.children
3732
3754
  ] }),
3733
- /* @__PURE__ */ s(
3734
- $e,
3755
+ /* @__PURE__ */ a(
3756
+ Be,
3735
3757
  {
3736
3758
  name: `${n}.${e}.required`,
3737
3759
  render: ({ setValue: D, value: k }) => /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
3738
- /* @__PURE__ */ s(ot.Root, { checked: k, onCheckedChange: D, children: /* @__PURE__ */ s(ot.Indicator, { children: /* @__PURE__ */ s(T, { icon: "RiCheckLine" }) }) }),
3739
- /* @__PURE__ */ s(Ve, { size: "sm", accentColor: "base", children: "Required" })
3760
+ /* @__PURE__ */ a(at.Root, { checked: k, onCheckedChange: D, size: "sm", children: /* @__PURE__ */ a(at.Indicator, { children: /* @__PURE__ */ a(T, { icon: "RiCheckLine" }) }) }),
3761
+ /* @__PURE__ */ a(ye, { size: "sm", accentColor: "base", children: "Required" })
3740
3762
  ] })
3741
3763
  }
3742
3764
  )
3743
3765
  ] }),
3744
- _ && /* @__PURE__ */ s(Ut, { popoverInputs: $, hasError: Z })
3766
+ z && /* @__PURE__ */ a(qt, { popoverInputs: $, hasError: Z })
3745
3767
  ] }),
3746
3768
  b && /* @__PURE__ */ y("div", { className: "group relative inline-block w-full min-w-[300px]", children: [
3747
- /* @__PURE__ */ s(
3769
+ /* @__PURE__ */ a(
3748
3770
  "img",
3749
3771
  {
3750
3772
  className: "h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",
3751
3773
  src: v,
3752
3774
  alt: b.name,
3753
- onClick: Ce
3775
+ onClick: xe
3754
3776
  }
3755
3777
  ),
3756
- /* @__PURE__ */ s(
3757
- V,
3778
+ /* @__PURE__ */ a(
3779
+ B,
3758
3780
  {
3759
3781
  className: "absolute top-2 right-2 hidden group-hover:not-disabled:flex",
3760
3782
  variant: "solid",
3761
- accentColor: ae.danger,
3783
+ accentColor: "base",
3762
3784
  "aria-label": "delete",
3763
3785
  onClick: x,
3764
- children: /* @__PURE__ */ s(T, { icon: "RiDeleteBin2Line" })
3786
+ size: "sm",
3787
+ children: /* @__PURE__ */ a(T, { icon: "RiDeleteBin7Fill" })
3765
3788
  }
3766
3789
  )
3767
3790
  ] }),
3768
- /* @__PURE__ */ s(
3769
- $e,
3791
+ /* @__PURE__ */ a(
3792
+ Be,
3770
3793
  {
3771
3794
  name: `${n}.${e}.label`,
3772
- render: ({ setValue: D, value: k }) => /* @__PURE__ */ s(
3795
+ render: ({ setValue: D, value: k }) => /* @__PURE__ */ a(
3773
3796
  "input",
3774
3797
  {
3775
- className: "bg-transparent outline-none text-base",
3798
+ className: "bg-transparent outline-none text-sm",
3776
3799
  placeholder: R === "section" ? "Enter a section label (optional)" : "Enter your question",
3777
3800
  value: k,
3778
3801
  onChange: (W) => {
@@ -3784,14 +3807,14 @@ const yn = O((t) => {
3784
3807
  )
3785
3808
  }
3786
3809
  ),
3787
- /* @__PURE__ */ s(
3788
- $e,
3810
+ /* @__PURE__ */ a(
3811
+ Be,
3789
3812
  {
3790
3813
  name: `${n}.${e}.description`,
3791
- render: ({ setValue: D, value: k }) => /* @__PURE__ */ s(
3814
+ render: ({ setValue: D, value: k }) => /* @__PURE__ */ a(
3792
3815
  "textarea",
3793
3816
  {
3794
- className: "bg-transparent outline-none text-base field-sizing-content grow",
3817
+ className: "bg-transparent outline-none text-sm field-sizing-content grow",
3795
3818
  placeholder: `Enter a ${R === "section" ? "section" : "field"} description (optional)`,
3796
3819
  value: k,
3797
3820
  onChange: (W) => {
@@ -3803,19 +3826,19 @@ const yn = O((t) => {
3803
3826
  )
3804
3827
  }
3805
3828
  ),
3806
- F !== q && B.length > 0 && /* @__PURE__ */ s("div", { className: "w-full", children: P }),
3807
- F !== q && /* @__PURE__ */ y(he, { children: [
3808
- /* @__PURE__ */ s(qt, { size: "full" }),
3809
- /* @__PURE__ */ y(Ue, { className: "flex flex-col gap-2 bg-(--accent-a2)", children: [
3810
- /* @__PURE__ */ s(Ve, { accentColor: "base", children: "Field preview" }),
3811
- /* @__PURE__ */ s("div", { children: Ct })
3812
- ] })
3829
+ F !== q && V.length > 0 && /* @__PURE__ */ a("div", { className: "w-full", children: P }),
3830
+ F !== q && /* @__PURE__ */ y(Ue, { className: "flex gap-4 bg-(--accent-a2) items-center", children: [
3831
+ /* @__PURE__ */ y(St.Root, { children: [
3832
+ /* @__PURE__ */ a(St.Trigger, { asChild: !0, children: /* @__PURE__ */ a(ot, { icon: !0, size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ a(T, { icon: "RiEyeLine" }) }) }),
3833
+ /* @__PURE__ */ a(St.Content, { className: "w-[225px]", size: "sm", align: "start", children: "This is a preview of the field as it will be rendered in the form." })
3834
+ ] }),
3835
+ /* @__PURE__ */ a("div", { className: "grow", children: Et })
3813
3836
  ] })
3814
3837
  ] }) });
3815
3838
  });
3816
- yn.displayName = "FieldBuilder";
3817
- const Zi = O((t) => {
3818
- const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: a } = ye(), { reorderField: l } = fn(), { showError: f } = Ht(), c = `fields.${i}.fields`, d = A(
3839
+ bn.displayName = "FieldBuilder";
3840
+ const er = O((t) => {
3841
+ const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: s } = be(), { reorderField: l } = mn(), { showError: f } = Gt(), c = `fields.${i}.fields`, d = A(
3819
3842
  () => ({
3820
3843
  index: e,
3821
3844
  parentPath: c,
@@ -3827,13 +3850,13 @@ const Zi = O((t) => {
3827
3850
  ...n,
3828
3851
  label: b
3829
3852
  };
3830
- ft(c, e + 1, m, a, o);
3831
- }, [n, c, e, a, o]), h = N(
3853
+ mt(c, e + 1, m, s, o);
3854
+ }, [n, c, e, s, o]), h = N(
3832
3855
  (b) => {
3833
- const m = i, v = a.fields[m];
3856
+ const m = i, v = s.fields[m];
3834
3857
  let x = i, E = b === "up" ? e - 1 : e + 1;
3835
- b === "up" && e === 0 ? (x = i - 1, E = a.fields[x].fields.length) : b === "down" && e === v.fields.length - 1 && (x = i + 1, E = 0);
3836
- const S = a.fields[x];
3858
+ b === "up" && e === 0 ? (x = i - 1, E = s.fields[x].fields.length) : b === "down" && e === v.fields.length - 1 && (x = i + 1, E = 0);
3859
+ const S = s.fields[x];
3837
3860
  l(
3838
3861
  v,
3839
3862
  m,
@@ -3844,14 +3867,14 @@ const Zi = O((t) => {
3844
3867
  o
3845
3868
  );
3846
3869
  },
3847
- [i, a.fields, e, l, o]
3870
+ [i, s.fields, e, l, o]
3848
3871
  ), g = N(
3849
3872
  (b) => {
3850
3873
  const { files: m } = b.target;
3851
3874
  if (!m || m.length !== 1) return;
3852
3875
  const v = m.item(0);
3853
3876
  if (v) {
3854
- if (v.size > Ba) {
3877
+ if (v.size > Ua) {
3855
3878
  f({
3856
3879
  title: "File upload error",
3857
3880
  description: `The file ${v.name} exceeded the maximum file size`
@@ -3866,7 +3889,7 @@ const Zi = O((t) => {
3866
3889
  },
3867
3890
  [n, e, c, o, f]
3868
3891
  );
3869
- return /* @__PURE__ */ s(Zt, { draggableId: n.identifier, index: e, children: (b) => /* @__PURE__ */ s(
3892
+ return /* @__PURE__ */ a(en, { draggableId: n.identifier, index: e, children: (b) => /* @__PURE__ */ a(
3870
3893
  Ue,
3871
3894
  {
3872
3895
  ref: b.innerRef,
@@ -3874,9 +3897,9 @@ const Zi = O((t) => {
3874
3897
  ...b.dragHandleProps,
3875
3898
  className: "mb-4",
3876
3899
  children: /* @__PURE__ */ y("div", { className: "flex items-center justify-between gap-4 w-full", children: [
3877
- /* @__PURE__ */ s(yn, { ...d }),
3878
- /* @__PURE__ */ s(
3879
- vn,
3900
+ /* @__PURE__ */ a(bn, { ...d }),
3901
+ /* @__PURE__ */ a(
3902
+ yn,
3880
3903
  {
3881
3904
  index: e,
3882
3905
  type: n.type,
@@ -3891,17 +3914,17 @@ const Zi = O((t) => {
3891
3914
  }
3892
3915
  ) });
3893
3916
  });
3894
- Zi.displayName = "FieldWithActions";
3895
- const er = O((t) => {
3917
+ er.displayName = "FieldWithActions";
3918
+ const tr = O((t) => {
3896
3919
  var S;
3897
- const { field: n, index: e, dropState: i, fieldsOnly: r } = t, o = (S = i[n.identifier]) == null ? void 0 : S.disabled, { setFieldValue: a, values: l } = ye(), f = or(), { reorderSection: c } = fn(), d = N(
3920
+ const { field: n, index: e, dropState: i, fieldsOnly: r } = t, o = (S = i[n.identifier]) == null ? void 0 : S.disabled, { setFieldValue: s, values: l } = be(), f = ar(), { reorderSection: c } = mn(), d = N(
3898
3921
  (C, I) => {
3899
3922
  for (const L of C) {
3900
3923
  const R = I.indexOf(L);
3901
- a(`fields.${R}.condition`, null).then(), a(`fields.${R}.conditional`, !1).then();
3924
+ s(`fields.${R}.condition`, null).then(), s(`fields.${R}.conditional`, !1).then();
3902
3925
  }
3903
3926
  },
3904
- [a]
3927
+ [s]
3905
3928
  ), u = N(
3906
3929
  (C) => {
3907
3930
  var R;
@@ -3913,20 +3936,20 @@ const er = O((t) => {
3913
3936
  return {
3914
3937
  removing: I,
3915
3938
  affectedSections: L,
3916
- action: () => a(`fields.${e}.fields`, ut(n.fields, C))
3939
+ action: () => s(`fields.${e}.fields`, ft(n.fields, C))
3917
3940
  };
3918
3941
  },
3919
- [n.fields, l.fields, a, e]
3942
+ [n.fields, l.fields, s, e]
3920
3943
  ), h = N(
3921
3944
  (C) => {
3922
3945
  const { affectedSections: I, action: L, removing: R } = u(C), F = () => {
3923
3946
  L().then(), d(I, l.fields);
3924
3947
  };
3925
3948
  if (I.length > 0) {
3926
- const B = I.map((z) => z.label).join(", ");
3949
+ const V = I.map((_) => _.label).join(", ");
3927
3950
  f({
3928
3951
  title: "Remove condition?",
3929
- description: `${R.label} is being used as a condition, deleting it will remove the condition from the ${B} section(s).`,
3952
+ description: `${R.label} is being used as a condition, deleting it will remove the condition from the ${V} section(s).`,
3930
3953
  action: "Remove",
3931
3954
  onAction: F
3932
3955
  });
@@ -3936,15 +3959,15 @@ const er = O((t) => {
3936
3959
  },
3937
3960
  [u, d, l.fields, f]
3938
3961
  ), g = N(() => {
3939
- const I = n.fields.map(($, _) => u(_)).flatMap(($) => $.affectedSections), L = I.length ? "Remove fields and conditions?" : "Remove fields?", R = n.fields.length, F = I.map(($) => $.label).join(", "), B = I.length ? `Deleting this section will remove the ${R} field(s) it contains and will remove the conditions from following sections: ${F}` : `Deleting this section will remove the ${R} field(s) it contains.`, z = ut(l.fields, e), P = () => a("fields", z);
3962
+ const I = n.fields.map(($, z) => u(z)).flatMap(($) => $.affectedSections), L = I.length ? "Remove fields and conditions?" : "Remove fields?", R = n.fields.length, F = I.map(($) => $.label).join(", "), V = I.length ? `Deleting this section will remove the ${R} field(s) it contains and will remove the conditions from following sections: ${F}` : `Deleting this section will remove the ${R} field(s) it contains.`, _ = ft(l.fields, e), P = () => s("fields", _);
3940
3963
  if (I.length > 0) {
3941
3964
  f({
3942
3965
  title: L,
3943
- description: B,
3966
+ description: V,
3944
3967
  action: "Remove",
3945
3968
  onAction: () => {
3946
3969
  P().then(() => {
3947
- d(I, z);
3970
+ d(I, _);
3948
3971
  });
3949
3972
  }
3950
3973
  });
@@ -3956,42 +3979,42 @@ const er = O((t) => {
3956
3979
  l.fields,
3957
3980
  e,
3958
3981
  u,
3959
- a,
3982
+ s,
3960
3983
  f,
3961
3984
  d
3962
3985
  ]), b = N(
3963
3986
  (C) => {
3964
3987
  const I = C === "up" ? e - 1 : e + 1;
3965
- c(i, n.identifier, e, I, l, a);
3988
+ c(i, n.identifier, e, I, l, s);
3966
3989
  },
3967
- [e, c, i, n.identifier, l, a]
3990
+ [e, c, i, n.identifier, l, s]
3968
3991
  ), m = A(
3969
3992
  () => ({
3970
3993
  index: e,
3971
3994
  parentPath: "fields",
3972
3995
  initial: n,
3973
- conditionalSourceFields: Mi(l.fields, e)
3996
+ conditionalSourceFields: zi(l.fields, e)
3974
3997
  }),
3975
3998
  [n, e, l.fields]
3976
3999
  ), v = N(() => {
3977
4000
  const C = n.label ?? "Untitled section", I = n.fields.map((R) => ({
3978
4001
  ...R,
3979
- identifier: un(null, R.label)
4002
+ identifier: fn(null, R.label)
3980
4003
  })), L = { ...n, label: C, fields: I };
3981
- ft("fields", e + 1, L, l, a);
3982
- }, [n, e, l, a]), x = N(
4004
+ mt("fields", e + 1, L, l, s);
4005
+ }, [n, e, l, s]), x = N(
3983
4006
  (C) => {
3984
- ft(
4007
+ mt(
3985
4008
  `fields.${e}.fields`,
3986
4009
  n.fields.length,
3987
- $a[C],
4010
+ Ba[C],
3988
4011
  l,
3989
- a
4012
+ s
3990
4013
  );
3991
4014
  },
3992
- [e, n.fields.length, l, a]
3993
- ), E = Ji(x);
3994
- return /* @__PURE__ */ s(Zt, { draggableId: n.identifier, index: e, children: (C) => /* @__PURE__ */ s(
4015
+ [e, n.fields.length, l, s]
4016
+ ), E = Zi(x);
4017
+ return /* @__PURE__ */ a(en, { draggableId: n.identifier, index: e, children: (C) => /* @__PURE__ */ a(
3995
4018
  Ue,
3996
4019
  {
3997
4020
  ref: C.innerRef,
@@ -4001,9 +4024,9 @@ const er = O((t) => {
4001
4024
  className: "mb-4 w-full",
4002
4025
  children: /* @__PURE__ */ y("div", { className: "flex items-center justify-between gap-3 w-full", children: [
4003
4026
  /* @__PURE__ */ y("div", { className: "flex grow flex-col gap-2 w-full", children: [
4004
- !r && /* @__PURE__ */ s(yn, { ...m }),
4005
- /* @__PURE__ */ s(
4006
- Jt,
4027
+ !r && /* @__PURE__ */ a(bn, { ...m }),
4028
+ /* @__PURE__ */ a(
4029
+ Zt,
4007
4030
  {
4008
4031
  droppableId: n.identifier,
4009
4032
  type: "SECTION",
@@ -4015,8 +4038,8 @@ const er = O((t) => {
4015
4038
  ref: I.innerRef,
4016
4039
  ...I.droppableProps,
4017
4040
  children: [
4018
- n.fields.map((L, R) => /* @__PURE__ */ s(
4019
- Zi,
4041
+ n.fields.map((L, R) => /* @__PURE__ */ a(
4042
+ er,
4020
4043
  {
4021
4044
  field: L,
4022
4045
  index: R,
@@ -4029,11 +4052,11 @@ const er = O((t) => {
4029
4052
  )),
4030
4053
  I.placeholder,
4031
4054
  /* @__PURE__ */ y(M.Root, { children: [
4032
- /* @__PURE__ */ s(M.ClickTrigger, { children: /* @__PURE__ */ y(X, { type: "button", variant: "solid", children: [
4033
- /* @__PURE__ */ s(T, { icon: "RiAddLine" }),
4055
+ /* @__PURE__ */ a(M.ClickTrigger, { children: /* @__PURE__ */ y(X, { type: "button", variant: "soft", children: [
4056
+ /* @__PURE__ */ a(T, { icon: "RiAddLine" }),
4034
4057
  " Add field"
4035
4058
  ] }) }),
4036
- /* @__PURE__ */ s(M.Content, { children: E.flat().map((L) => /* @__PURE__ */ y(M.Item, { onSelect: L.onSelect, children: [
4059
+ /* @__PURE__ */ a(M.Content, { children: E.flat().map((L) => /* @__PURE__ */ y(M.Item, { onSelect: L.onSelect, children: [
4037
4060
  L.icon,
4038
4061
  L.children
4039
4062
  ] }, L.value)) })
@@ -4044,8 +4067,8 @@ const er = O((t) => {
4044
4067
  }
4045
4068
  )
4046
4069
  ] }),
4047
- !r && /* @__PURE__ */ s(
4048
- vn,
4070
+ !r && /* @__PURE__ */ a(
4071
+ yn,
4049
4072
  {
4050
4073
  index: e,
4051
4074
  type: n.type,
@@ -4058,14 +4081,14 @@ const er = O((t) => {
4058
4081
  }
4059
4082
  ) });
4060
4083
  });
4061
- er.displayName = "FieldSectionWithActions";
4084
+ tr.displayName = "FieldSectionWithActions";
4062
4085
  const Vn = (t, n) => {
4063
4086
  for (const [e, i] of Object.entries(t))
4064
4087
  if (i.identifier === n) return [i, e];
4065
- }, tr = O((t) => {
4066
- const { fieldsOnly: n } = t, { values: e, setFieldValue: i } = ye(), [r, o] = dr(Ga, e.fields, $n), { reorderSection: a, reorderField: l } = fn();
4088
+ }, nr = O((t) => {
4089
+ const { fieldsOnly: n } = t, { values: e, setFieldValue: i } = be(), [r, o] = ur(Xa, e.fields, Bn), { reorderSection: s, reorderField: l } = mn();
4067
4090
  K(() => {
4068
- o({ type: "update", state: $n(e.fields) });
4091
+ o({ type: "update", state: Bn(e.fields) });
4069
4092
  }, [o, e.fields]);
4070
4093
  const f = N((u) => {
4071
4094
  u.type === "SECTION" && o({ type: "hold", fieldId: u.draggableId });
@@ -4074,7 +4097,7 @@ const Vn = (t, n) => {
4074
4097
  const { source: h, destination: g, type: b, reason: m, draggableId: v } = u;
4075
4098
  if (o({ type: "release" }), !g || m === "CANCEL") return;
4076
4099
  if (b === "ROOT") {
4077
- a(r, v, h.index, g.index, e, i);
4100
+ s(r, v, h.index, g.index, e, i);
4078
4101
  return;
4079
4102
  }
4080
4103
  if (b !== "SECTION") throw new Error("Unexpected droppable type.");
@@ -4089,23 +4112,23 @@ const Vn = (t, n) => {
4089
4112
  i
4090
4113
  );
4091
4114
  },
4092
- [e, l, i, a, r]
4115
+ [e, l, i, s, r]
4093
4116
  ), d = N(
4094
4117
  (u) => {
4095
- Ia(u + 1, e, i);
4118
+ Sa(u + 1, e, i);
4096
4119
  },
4097
4120
  [e, i]
4098
4121
  );
4099
- return /* @__PURE__ */ s(Gn, { onDragStart: f, onDragEnd: c, children: /* @__PURE__ */ s(Jt, { droppableId: "droppable", type: "ROOT", children: (u) => /* @__PURE__ */ y(
4122
+ return /* @__PURE__ */ a(Xn, { onDragStart: f, onDragEnd: c, children: /* @__PURE__ */ a(Zt, { droppableId: "droppable", type: "ROOT", children: (u) => /* @__PURE__ */ y(
4100
4123
  "div",
4101
4124
  {
4102
4125
  className: "flex flex-col gap-0",
4103
4126
  ref: u.innerRef,
4104
4127
  ...u.droppableProps,
4105
4128
  children: [
4106
- e.fields.map((h, g) => /* @__PURE__ */ y(ur, { children: [
4107
- /* @__PURE__ */ s(
4108
- er,
4129
+ e.fields.map((h, g) => /* @__PURE__ */ y(fr, { children: [
4130
+ /* @__PURE__ */ a(
4131
+ tr,
4109
4132
  {
4110
4133
  field: h,
4111
4134
  index: g,
@@ -4124,7 +4147,7 @@ const Vn = (t, n) => {
4124
4147
  d(g);
4125
4148
  },
4126
4149
  children: [
4127
- /* @__PURE__ */ s(T, { icon: "RiAddLine" }),
4150
+ /* @__PURE__ */ a(T, { icon: "RiAddLine" }),
4128
4151
  " Add section"
4129
4152
  ]
4130
4153
  }
@@ -4141,7 +4164,7 @@ const Vn = (t, n) => {
4141
4164
  d(e.fields.length);
4142
4165
  },
4143
4166
  children: [
4144
- /* @__PURE__ */ s(T, { icon: "RiAddLine" }),
4167
+ /* @__PURE__ */ a(T, { icon: "RiAddLine" }),
4145
4168
  " Add section"
4146
4169
  ]
4147
4170
  }
@@ -4151,39 +4174,39 @@ const Vn = (t, n) => {
4151
4174
  }
4152
4175
  ) }) });
4153
4176
  });
4154
- tr.displayName = "FieldsEditor";
4155
- const Ka = () => {
4177
+ nr.displayName = "FieldsEditor";
4178
+ const Ya = () => {
4156
4179
  alert("This is a form preview, your data will not be saved.");
4157
- }, bs = O(
4180
+ }, ws = O(
4158
4181
  qe((t, n) => {
4159
4182
  const {
4160
4183
  onCancel: e,
4161
4184
  onSave: i,
4162
4185
  revision: r,
4163
4186
  initialTitle: o,
4164
- showExplainerText: a = !0,
4187
+ showExplainerText: s = !0,
4165
4188
  showFormTitle: l = !0,
4166
4189
  fieldsOnly: f = !1,
4167
4190
  showTabs: c = !0,
4168
4191
  tabsListClassName: d,
4169
4192
  hydrateRevisionWithImages: u
4170
- } = t, { showError: h } = Ht(), g = N(
4193
+ } = t, { showError: h } = Gt(), g = N(
4171
4194
  (E) => {
4172
4195
  const S = {};
4173
4196
  E.title || (S.title = "Title is required."), (!E.fields || E.fields.length === 0) && (S.fields = "At least one field is required.");
4174
4197
  let C = [];
4175
4198
  for (const [L, R] of E.fields.entries()) {
4176
- const B = Bt.section.getFieldCreationSchema(
4177
- Mi(E.fields, L),
4199
+ const V = Wt.section.getFieldCreationSchema(
4200
+ zi(E.fields, L),
4178
4201
  `fields.${L}`
4179
- ).map((z) => z.field);
4180
- C = [...C, ...B];
4181
- for (const [z, P] of R.fields.entries()) {
4182
- const _ = Bt[P.type].getFieldCreationSchema(`fields.${L}.fields.${z}`).map((Z) => Z.field);
4183
- C = [...C, ..._];
4202
+ ).map((_) => _.field);
4203
+ C = [...C, ...V];
4204
+ for (const [_, P] of R.fields.entries()) {
4205
+ const z = Wt[P.type].getFieldCreationSchema(`fields.${L}.fields.${_}`).map((Z) => Z.field);
4206
+ C = [...C, ...z];
4184
4207
  }
4185
4208
  }
4186
- const I = pn(
4209
+ const I = gn(
4187
4210
  {
4188
4211
  fields: C
4189
4212
  },
@@ -4200,57 +4223,57 @@ const Ka = () => {
4200
4223
  () => ({
4201
4224
  title: o ?? "",
4202
4225
  description: "",
4203
- fields: [{ ...dt(un(null, "")), label: "" }]
4226
+ fields: [{ ...ut(fn(null, "")), label: "" }]
4204
4227
  }),
4205
4228
  [o]
4206
- ), m = r ? u(r) : void 0, v = Kt({
4207
- initialValues: Ea(m) ?? b,
4229
+ ), m = r ? u(r) : void 0, v = Yt({
4230
+ initialValues: Ia(m) ?? b,
4208
4231
  validate: g,
4209
4232
  onSubmit: i,
4210
4233
  validateOnChange: !1,
4211
4234
  validateOnBlur: !1
4212
- }), x = A(() => Ua(v.values), [v.values]);
4213
- return /* @__PURE__ */ s(Ee.Root, { ref: n, defaultValue: "edit", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
4235
+ }), x = A(() => ja(v.values), [v.values]);
4236
+ return /* @__PURE__ */ a(Ie.Root, { ref: n, defaultValue: "edit", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
4214
4237
  c && /* @__PURE__ */ y(
4215
- Ee.List,
4238
+ Ie.List,
4216
4239
  {
4217
- className: Be("sticky top-0 z-[2000] flex bg-(--color-background)", d),
4240
+ className: Ve("sticky top-0 z-[2000] flex bg-(--color-background)", d),
4218
4241
  children: [
4219
- /* @__PURE__ */ s(Ee.Trigger, { className: "grow", value: "edit", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
4220
- /* @__PURE__ */ s(T, { icon: "RiPencilLine" }),
4242
+ /* @__PURE__ */ a(Ie.Trigger, { className: "grow", value: "edit", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
4243
+ /* @__PURE__ */ a(T, { icon: "RiPencilLine" }),
4221
4244
  "Edit form"
4222
4245
  ] }) }),
4223
- /* @__PURE__ */ s(Ee.Trigger, { className: "grow", value: "preview", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
4224
- /* @__PURE__ */ s(T, { icon: "RiEyeLine" }),
4246
+ /* @__PURE__ */ a(Ie.Trigger, { className: "grow", value: "preview", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
4247
+ /* @__PURE__ */ a(T, { icon: "RiEyeLine" }),
4225
4248
  "Preview form"
4226
4249
  ] }) })
4227
4250
  ]
4228
4251
  }
4229
4252
  ),
4230
- /* @__PURE__ */ y(Ee.Content, { value: "edit", children: [
4231
- a && /* @__PURE__ */ y("span", { children: [
4253
+ /* @__PURE__ */ y(Ie.Content, { value: "edit", children: [
4254
+ s && /* @__PURE__ */ y(ye, { children: [
4232
4255
  "Create your form using various field types. Sections can be",
4233
4256
  " ",
4234
- /* @__PURE__ */ s("strong", { children: "conditionally rendered" }),
4257
+ /* @__PURE__ */ a("strong", { children: "conditionally rendered" }),
4235
4258
  " based on",
4236
4259
  " ",
4237
- /* @__PURE__ */ s("strong", { children: "answers to fields in preceding sections. " })
4260
+ /* @__PURE__ */ a("strong", { children: "answers to fields in preceding sections. " })
4238
4261
  ] }),
4239
4262
  /* @__PURE__ */ y("form", { className: "mt-3 flex flex-col gap-2", id: rt, onSubmit: v.handleSubmit, children: [
4240
- /* @__PURE__ */ y(Yt, { value: v, children: [
4263
+ /* @__PURE__ */ y(Qt, { value: v, children: [
4241
4264
  l && /* @__PURE__ */ y(he, { children: [
4242
- /* @__PURE__ */ s(
4243
- $e,
4265
+ /* @__PURE__ */ a(
4266
+ Be,
4244
4267
  {
4245
4268
  name: "title",
4246
- render: ({ setValue: E, value: S, meta: C }) => /* @__PURE__ */ s(Li, { severity: "danger", helpText: C.error ?? null, children: /* @__PURE__ */ s(
4247
- ue.Root,
4269
+ render: ({ setValue: E, value: S, meta: C }) => /* @__PURE__ */ a(Fi, { severity: "danger", helpText: C.error ?? null, children: /* @__PURE__ */ a(
4270
+ de.Root,
4248
4271
  {
4249
4272
  variant: "outline",
4250
- size: "lg",
4251
- accentColor: C.error ? ae.danger : "primary",
4252
- children: /* @__PURE__ */ s(
4253
- ue.Field,
4273
+ size: "md",
4274
+ accentColor: C.error ? ue.danger : "primary",
4275
+ children: /* @__PURE__ */ a(
4276
+ de.Field,
4254
4277
  {
4255
4278
  placeholder: "Form title",
4256
4279
  value: S,
@@ -4264,12 +4287,12 @@ const Ka = () => {
4264
4287
  ) })
4265
4288
  }
4266
4289
  ),
4267
- /* @__PURE__ */ s(
4268
- $e,
4290
+ /* @__PURE__ */ a(
4291
+ Be,
4269
4292
  {
4270
4293
  name: "description",
4271
- render: ({ setValue: E, value: S }) => /* @__PURE__ */ s(
4272
- Bn,
4294
+ render: ({ setValue: E, value: S }) => /* @__PURE__ */ a(
4295
+ Un,
4273
4296
  {
4274
4297
  className: "field-sizing-content",
4275
4298
  placeholder: "Explain the purpose of this form",
@@ -4278,97 +4301,98 @@ const Ka = () => {
4278
4301
  E(C.target.value);
4279
4302
  },
4280
4303
  resize: "vertical",
4281
- maxLength: 1e3
4304
+ maxLength: 1e3,
4305
+ size: "md"
4282
4306
  }
4283
4307
  )
4284
4308
  }
4285
4309
  )
4286
4310
  ] }),
4287
- /* @__PURE__ */ s(tr, { fieldsOnly: f }),
4288
- /* @__PURE__ */ s(
4311
+ /* @__PURE__ */ a(nr, { fieldsOnly: f }),
4312
+ /* @__PURE__ */ a(
4289
4313
  "span",
4290
4314
  {
4291
- "data-accent-color": ae.danger,
4315
+ "data-accent-color": ue.danger,
4292
4316
  className: "text-xs text-(--accent-a11)",
4293
4317
  children: typeof v.errors.fields == "string" && v.errors.fields
4294
4318
  }
4295
4319
  )
4296
4320
  ] }),
4297
4321
  /* @__PURE__ */ y("div", { className: "flex items-center justify-end gap-2", children: [
4298
- e && /* @__PURE__ */ s(X, { type: "button", variant: "solid", accentColor: "base", onClick: e, children: "Cancel" }),
4299
- /* @__PURE__ */ s(X, { type: "submit", children: "Save form" })
4322
+ e && /* @__PURE__ */ a(X, { type: "button", variant: "solid", accentColor: "base", onClick: e, children: "Cancel" }),
4323
+ /* @__PURE__ */ a(X, { type: "submit", children: "Save form" })
4300
4324
  ] })
4301
4325
  ] })
4302
4326
  ] }),
4303
- /* @__PURE__ */ s(Ee.Content, { value: "preview", children: /* @__PURE__ */ s(qa, { schema: x, onSubmit: Ka, hideTitle: !l }) })
4327
+ /* @__PURE__ */ a(Ie.Content, { value: "preview", children: /* @__PURE__ */ a(Ha, { schema: x, onSubmit: Ya, hideTitle: !l }) })
4304
4328
  ] }) });
4305
4329
  })
4306
- ), Ya = Object.values(qn), Qa = 1;
4307
- async function Ja(t, n, e, i) {
4308
- const r = t.getContext("2d", {}), o = new Image(i.width, i.height), a = new Image(i.width, i.height), l = new mr();
4330
+ ), Qa = Object.values(Hn), Ja = 1;
4331
+ async function Za(t, n, e, i) {
4332
+ const r = t.getContext("2d", {}), o = new Image(i.width, i.height), s = new Image(i.width, i.height), l = new hr();
4309
4333
  return o.onload = function() {
4310
- r.drawImage(o, 0, 0, i.width, i.height), a.src = URL.createObjectURL(e), a.onload = async function() {
4311
- r.drawImage(a, 0, 0, i.width, i.height);
4312
- const f = t.toDataURL("image/jpeg", Qa), c = await Hn(f), d = new File([c], n.name, { type: "image/jpeg" });
4334
+ r.drawImage(o, 0, 0, i.width, i.height), s.src = URL.createObjectURL(e), s.onload = async function() {
4335
+ r.drawImage(s, 0, 0, i.width, i.height);
4336
+ const f = t.toDataURL("image/jpeg", Ja), c = await Gn(f), d = new File([c], n.name, { type: "image/jpeg" });
4313
4337
  l.resolve(d);
4314
4338
  };
4315
4339
  }, o.src = URL.createObjectURL(n), l;
4316
4340
  }
4317
- const Za = O((t) => {
4318
- const { file: n, onClose: e, onSave: i, onDelete: r, dirty: o, onDirty: a } = t;
4341
+ const es = O((t) => {
4342
+ const { file: n, onClose: e, onSave: i, onDelete: r, dirty: o, onDirty: s } = t;
4319
4343
  n.objectURL || (n.objectURL = URL.createObjectURL(n));
4320
- const l = ne(null), f = ne(null), [c, d] = H(qn.red), [u, h] = H(null), [g, b] = H(!1), [m, v] = H(!1), x = ne(null), E = Un(x);
4344
+ const l = ne(null), f = ne(null), [c, d] = H(Hn.red), [u, h] = H(null), [g, b] = H(!1), [m, v] = H(!1), x = ne(null), E = jn(x);
4321
4345
  K(() => {
4322
- const _ = new Image();
4323
- _.onload = function() {
4324
- h({ width: _.naturalWidth, height: _.naturalHeight });
4325
- }, _.src = URL.createObjectURL(n);
4346
+ const z = new Image();
4347
+ z.onload = function() {
4348
+ h({ width: z.naturalWidth, height: z.naturalHeight });
4349
+ }, z.src = URL.createObjectURL(n);
4326
4350
  }, [n]), K(() => {
4327
4351
  !m && (E != null && E.width) && E.height && v(!0);
4328
4352
  }, [E, m]);
4329
4353
  const S = N(async () => {
4330
4354
  o || e();
4331
- const _ = l.current;
4332
- if (!_) return;
4355
+ const z = l.current;
4356
+ if (!z) return;
4333
4357
  if (!u)
4334
4358
  throw new Error("Original image size not loaded yet");
4335
- const Z = await _.exportImage("png"), we = new Image(u.width, u.height);
4336
- we.onload = async function() {
4337
- const je = await Hn(Z), Ct = new File([je], n.name, { type: n.type }), le = f.current, Ce = await Ja(le, n, Ct, u);
4338
- Ce.objectURL = URL.createObjectURL(Ce);
4339
- const He = await xn(n);
4340
- await xn(Ce) !== He && i(Ce), b(!1), e();
4341
- }, b(!0), we.src = Z;
4359
+ const Z = await z.exportImage("png"), Ce = new Image(u.width, u.height);
4360
+ Ce.onload = async function() {
4361
+ const je = await Gn(Z), Et = new File([je], n.name, { type: n.type }), se = f.current, xe = await Za(se, n, Et, u);
4362
+ xe.objectURL = URL.createObjectURL(xe);
4363
+ const He = await En(n);
4364
+ await En(xe) !== He && i(xe), b(!1), e();
4365
+ }, b(!0), Ce.src = Z;
4342
4366
  }, [o, n, e, i, u]), C = N(() => {
4343
4367
  r(n);
4344
4368
  }, [n, r]), I = N(() => {
4345
4369
  e();
4346
4370
  }, [e]), L = N(() => {
4347
- a(!0);
4348
- }, [a]), R = N(() => {
4371
+ s(!0);
4372
+ }, [s]), R = N(() => {
4349
4373
  l.current && l.current.redo();
4350
4374
  }, []), F = N(() => {
4351
4375
  l.current && l.current.undo();
4352
- }, []), B = N(() => {
4353
- l.current && (a(!1), l.current.clearCanvas());
4354
- }, [a]), z = N((_) => {
4355
- l.current && l.current.eraseMode(_);
4376
+ }, []), V = N(() => {
4377
+ l.current && (s(!1), l.current.clearCanvas());
4378
+ }, [s]), _ = N((z) => {
4379
+ l.current && l.current.eraseMode(z);
4356
4380
  }, []), P = N(() => {
4357
4381
  S();
4358
4382
  }, [S]), $ = N(() => {
4359
- Wn(n);
4383
+ qn(n);
4360
4384
  }, [n]);
4361
- return /* @__PURE__ */ s(sn, { open: !0, onOpenChange: e, children: /* @__PURE__ */ y(ln, { children: [
4362
- /* @__PURE__ */ s(
4363
- cn,
4385
+ return /* @__PURE__ */ a(ln, { open: !0, onOpenChange: e, children: /* @__PURE__ */ y(cn, { children: [
4386
+ /* @__PURE__ */ a(
4387
+ dn,
4364
4388
  {
4365
4389
  className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
4366
4390
  "data-floating-content": ""
4367
4391
  }
4368
4392
  ),
4369
- /* @__PURE__ */ y(dn, { className: "absolute inset-0 py-12", "data-floating-content": "", children: [
4370
- /* @__PURE__ */ s(
4371
- Wt,
4393
+ /* @__PURE__ */ y(un, { className: "absolute inset-0 py-12", "data-floating-content": "", children: [
4394
+ /* @__PURE__ */ a(
4395
+ bt,
4372
4396
  {
4373
4397
  className: "flex w-full gap-2 items-center top-0 absolute right-0 p-2",
4374
4398
  accentColor: "base",
@@ -4376,18 +4400,18 @@ const Za = O((t) => {
4376
4400
  variant: "soft",
4377
4401
  children: /* @__PURE__ */ y("div", { className: "grid w-full grid-cols-3", children: [
4378
4402
  /* @__PURE__ */ y("div", { className: "flex gap-2", children: [
4379
- /* @__PURE__ */ s(V, { "aria-label": "close", onClick: I, children: /* @__PURE__ */ s(T, { icon: "RiCloseLine" }) }),
4380
- /* @__PURE__ */ s(V, { "aria-label": `Download ${n.name}`, onClick: $, children: /* @__PURE__ */ s(T, { icon: "RiDownload2Line" }) })
4403
+ /* @__PURE__ */ a(B, { "aria-label": "close", onClick: I, children: /* @__PURE__ */ a(T, { icon: "RiCloseLine" }) }),
4404
+ /* @__PURE__ */ a(B, { "aria-label": `Download ${n.name}`, onClick: $, children: /* @__PURE__ */ a(T, { icon: "RiDownload2Line" }) })
4381
4405
  ] }),
4382
4406
  /* @__PURE__ */ y("div", { className: "flex items-center justify-center gap-2", children: [
4383
- /* @__PURE__ */ s(
4384
- Xn,
4407
+ /* @__PURE__ */ a(
4408
+ Kn,
4385
4409
  {
4386
4410
  selectedColor: c,
4387
- allColors: Ya,
4411
+ allColors: Qa,
4388
4412
  onFinish: d,
4389
- trigger: /* @__PURE__ */ s(
4390
- V,
4413
+ trigger: /* @__PURE__ */ a(
4414
+ B,
4391
4415
  {
4392
4416
  "aria-label": "Markup color picker",
4393
4417
  type: "button",
@@ -4400,28 +4424,28 @@ const Za = O((t) => {
4400
4424
  )
4401
4425
  }
4402
4426
  ),
4403
- /* @__PURE__ */ s(
4404
- ar,
4427
+ /* @__PURE__ */ a(
4428
+ sr,
4405
4429
  {
4406
4430
  defaultPressed: !1,
4407
4431
  "aria-label": "erase",
4408
- onPressedChange: z,
4409
- children: /* @__PURE__ */ s(T, { icon: "RiEraserFill" })
4432
+ onPressedChange: _,
4433
+ children: /* @__PURE__ */ a(T, { icon: "RiEraserFill" })
4410
4434
  }
4411
4435
  ),
4412
- /* @__PURE__ */ s(qt, { orientation: "vertical", size: "full" }),
4413
- /* @__PURE__ */ s(V, { "aria-label": "undo", onClick: F, children: /* @__PURE__ */ s(T, { icon: "RiArrowGoBackLine" }) }),
4414
- /* @__PURE__ */ s(V, { "aria-label": "undo", onClick: R, children: /* @__PURE__ */ s(T, { icon: "RiArrowGoForwardLine" }) }),
4415
- /* @__PURE__ */ s(V, { "aria-label": "undo all", onClick: B, children: /* @__PURE__ */ s(T, { icon: "RiLoopLeftLine" }) })
4436
+ /* @__PURE__ */ a(Ht, { orientation: "vertical", size: "full" }),
4437
+ /* @__PURE__ */ a(B, { "aria-label": "undo", onClick: F, children: /* @__PURE__ */ a(T, { icon: "RiArrowGoBackLine" }) }),
4438
+ /* @__PURE__ */ a(B, { "aria-label": "undo", onClick: R, children: /* @__PURE__ */ a(T, { icon: "RiArrowGoForwardLine" }) }),
4439
+ /* @__PURE__ */ a(B, { "aria-label": "undo all", onClick: V, children: /* @__PURE__ */ a(T, { icon: "RiLoopLeftLine" }) })
4416
4440
  ] }),
4417
4441
  /* @__PURE__ */ y("div", { className: "flex justify-end gap-2", children: [
4418
- /* @__PURE__ */ s(V, { "aria-label": "Save markup", accentColor: "primary", onClick: P, children: /* @__PURE__ */ s(T, { icon: "RiSaveLine" }) }),
4419
- /* @__PURE__ */ s(V, { "aria-label": "Delete attachment", onClick: C, children: /* @__PURE__ */ s(T, { icon: "RiDeleteBin2Line" }) })
4442
+ /* @__PURE__ */ a(B, { "aria-label": "Save markup", accentColor: "primary", onClick: P, children: /* @__PURE__ */ a(T, { icon: "RiSaveLine" }) }),
4443
+ /* @__PURE__ */ a(B, { "aria-label": "Delete attachment", onClick: C, children: /* @__PURE__ */ a(T, { icon: "RiDeleteBin2Line" }) })
4420
4444
  ] })
4421
4445
  ] })
4422
4446
  }
4423
4447
  ),
4424
- u && /* @__PURE__ */ s(
4448
+ u && /* @__PURE__ */ a(
4425
4449
  "canvas",
4426
4450
  {
4427
4451
  id: "attachment-markup-canvas",
@@ -4432,7 +4456,7 @@ const Za = O((t) => {
4432
4456
  }
4433
4457
  ),
4434
4458
  /* @__PURE__ */ y("div", { className: "relative size-full flex items-center justify-center p-4 overflow-hidden", children: [
4435
- /* @__PURE__ */ s(
4459
+ /* @__PURE__ */ a(
4436
4460
  "img",
4437
4461
  {
4438
4462
  className: "max-w-full max-h-full invisible absolute",
@@ -4441,8 +4465,8 @@ const Za = O((t) => {
4441
4465
  src: n.objectURL
4442
4466
  }
4443
4467
  ),
4444
- g ? /* @__PURE__ */ s(vt, {}) : /* @__PURE__ */ s(
4445
- Or,
4468
+ g ? /* @__PURE__ */ a(yt, {}) : /* @__PURE__ */ a(
4469
+ Pr,
4446
4470
  {
4447
4471
  className: "max-w-full max-h-full aspect-square",
4448
4472
  backgroundImage: n.objectURL,
@@ -4456,70 +4480,70 @@ const Za = O((t) => {
4456
4480
  ] })
4457
4481
  ] }) });
4458
4482
  });
4459
- Za.displayName = "AttachmentEditor";
4483
+ es.displayName = "AttachmentEditor";
4460
4484
  export {
4461
4485
  G as BaseField,
4462
- Qn as BaseFormElement,
4486
+ Jn as BaseFormElement,
4463
4487
  We as BooleanField,
4464
- Fi as BooleanInput,
4465
- Xn as ColorPicker,
4466
- Pt as DateField,
4467
- Di as DateInput,
4488
+ Di as BooleanInput,
4489
+ Kn as ColorPicker,
4490
+ zt as DateField,
4491
+ Ai as DateInput,
4468
4492
  q as FieldSection,
4469
4493
  _r as FileBadge,
4470
- Yn as FileCard,
4471
- yt as FileIcon,
4472
- bs as FormBuilder,
4473
- qa as FormRenderer,
4474
- Ma as ImageCard,
4475
- Za as ImageMarkup,
4476
- Ti as ImageViewer,
4477
- va as ImageViewerProvider,
4478
- Li as InputWithHelpText,
4494
+ Qn as FileCard,
4495
+ wt as FileIcon,
4496
+ ws as FormBuilder,
4497
+ Ha as FormRenderer,
4498
+ za as ImageCard,
4499
+ es as ImageMarkup,
4500
+ Li as ImageViewer,
4501
+ ya as ImageViewerProvider,
4502
+ Fi as InputWithHelpText,
4479
4503
  ie as InputWithLabel,
4480
4504
  re as InputWithLabelAndHelpText,
4481
- ht as MultiSelectField,
4482
- Ui as MultiSelectInput,
4483
- mt as MultiStringField,
4505
+ pt as MultiSelectField,
4506
+ ji as MultiSelectInput,
4507
+ ht as MultiStringField,
4484
4508
  _i as MultiStringInput,
4485
4509
  ve as NumberField,
4486
- zi as NumberInput,
4487
- $e as PatchField,
4488
- ys as PatchFormProvider,
4489
- Mt as QrField,
4490
- $i as QrInput,
4510
+ $i as NumberInput,
4511
+ Be as PatchField,
4512
+ bs as PatchFormProvider,
4513
+ $t as QrField,
4514
+ Bi as QrInput,
4491
4515
  Vi as QrScanner,
4492
- Pr as SUPPORTED_IMAGE_FILE_TYPES,
4493
- Mr as SUPPORTED_PDF_FILE_TYPES,
4494
- kr as SUPPORTED_SPREADSHEET_FILE_EXTENSIONS,
4495
- pt as SelectField,
4496
- ji as SelectInput,
4497
- _t as StringField,
4498
- Wi as StringInput,
4499
- zt as TextField,
4500
- qi as TextInput,
4501
- gs as decodeFormValues,
4502
- hn as deserialize,
4503
- Xi as deserializeField,
4516
+ kr as SUPPORTED_IMAGE_FILE_TYPES,
4517
+ zr as SUPPORTED_PDF_FILE_TYPES,
4518
+ Mr as SUPPORTED_SPREADSHEET_FILE_EXTENSIONS,
4519
+ gt as SelectField,
4520
+ Wi as SelectInput,
4521
+ Bt as StringField,
4522
+ qi as StringInput,
4523
+ Vt as TextField,
4524
+ Hi as TextInput,
4525
+ vs as decodeFormValues,
4526
+ pn as deserialize,
4527
+ Ki as deserializeField,
4504
4528
  Q as emptyBaseField,
4505
- ba as emptyBooleanField,
4506
- wa as emptyDateField,
4507
- La as emptyMultiSelectField,
4508
- Sa as emptyMultiStringField,
4509
- Ra as emptyNumberField,
4510
- Na as emptyQrField,
4511
- Fa as emptySelectField,
4512
- Da as emptyStringField,
4513
- Aa as emptyTextField,
4514
- vs as encodeFormValues,
4515
- Ki as flattenFields,
4516
- Ua as formRevisionToSchema,
4517
- gn as initialFormValues,
4518
- Yi as isConditionMet,
4519
- Oi as useFieldInput,
4520
- ct as useFieldInputs,
4529
+ wa as emptyBooleanField,
4530
+ Ca as emptyDateField,
4531
+ Fa as emptyMultiSelectField,
4532
+ Ra as emptyMultiStringField,
4533
+ Na as emptyNumberField,
4534
+ Ta as emptyQrField,
4535
+ Da as emptySelectField,
4536
+ Aa as emptyStringField,
4537
+ Oa as emptyTextField,
4538
+ ys as encodeFormValues,
4539
+ Yi as flattenFields,
4540
+ ja as formRevisionToSchema,
4541
+ vn as initialFormValues,
4542
+ Qi as isConditionMet,
4543
+ Pi as useFieldInput,
4544
+ dt as useFieldInputs,
4521
4545
  U as useFormikInput,
4522
- en as useImageViewer,
4523
- pn as validateForm,
4524
- Vt as valueIsFile
4546
+ tn as useImageViewer,
4547
+ gn as validateForm,
4548
+ jt as valueIsFile
4525
4549
  };