@overmap-ai/forms 1.1.1 → 1.1.3
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/Scanner/ScannerProvider.d.ts +4 -1
- package/dist/Scanner/context.d.ts +7 -2
- package/dist/Scanner/hooks.d.ts +2 -1
- package/dist/Scanner/typings.d.ts +1 -1
- package/dist/forms.js +602 -584
- package/dist/forms.umd.cjs +42 -42
- package/package.json +3 -2
package/dist/forms.js
CHANGED
|
@@ -2,22 +2,22 @@ var Ir = Object.defineProperty;
|
|
|
2
2
|
var Ar = (i, t, e) => t in i ? Ir(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var y = (i, t, e) => Ar(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { jsxs as u, Fragment as H, jsx as r } from "react/jsx-runtime";
|
|
5
|
-
import { Card as fe, LuIcon as p, Text as D, Spinner as Wi, Overlay as pe, preventDefault as Tr, ButtonGroup as $, Tooltip as Ie, IconButton as
|
|
5
|
+
import { Card as fe, LuIcon as p, Text as D, Spinner as Wi, Overlay as pe, preventDefault as Tr, ButtonGroup as $, Tooltip as Ie, IconButton as E, Separator as xe, Input as L, Badge as P, Checkbox as hi, CheckboxGroup as Li, Popover as j, Button as w, DayPicker as Ht, Menu as V, OneTimePasswordField as Bi, stopPropagation as Ve, RadioGroup as Ae, TextArea as Je, Rating as zt, Heading as Er, toast as ie, ToggleGroup as ji, useAlertDialog as _r } from "@overmap-ai/blocks";
|
|
6
6
|
import { cx as ke, cva as Ki } from "class-variance-authority";
|
|
7
|
-
import { forwardRef as Xi, createElement as Gi, memo as F, createContext as gi, useState as te, useLayoutEffect as
|
|
7
|
+
import { forwardRef as Xi, createElement as Gi, memo as F, createContext as gi, useState as te, useLayoutEffect as Jt, useContext as Rr, useCallback as f, useEffect as ye, Fragment as Yi, use as R, useMemo as _, useRef as Vi } from "react";
|
|
8
8
|
import "@xyflow/react/dist/style.css";
|
|
9
|
-
import { getBezierPath as $r, Position as ge, BaseEdge as Dr, EdgeLabelRenderer as Lr, NodeToolbar as Br, Handle as
|
|
10
|
-
import { willCreateCycle as
|
|
11
|
-
import { useController as Hr, useWatch as
|
|
9
|
+
import { getBezierPath as $r, Position as ge, BaseEdge as Dr, EdgeLabelRenderer as Lr, NodeToolbar as Br, Handle as St, MarkerType as jr, useNodesState as Pr, useEdgesState as Ur, ReactFlow as Gr, Panel as Pi } from "@xyflow/react";
|
|
10
|
+
import { willCreateCycle as Wt } from "graphology-dag";
|
|
11
|
+
import { useController as Hr, useWatch as Kt, useFormState as Xt, useFormContext as Yt, useForm as Zt, FormProvider as Qt } from "react-hook-form";
|
|
12
12
|
import { v4 as M } from "uuid";
|
|
13
13
|
import { DragDropContext as Jr, Droppable as Wr, Draggable as Kr } from "@hello-pangea/dnd";
|
|
14
|
-
import { saveAs as
|
|
14
|
+
import { saveAs as en } from "file-saver";
|
|
15
15
|
import { useActiveEffect as Xr } from "@overmap-ai/hooks";
|
|
16
16
|
import { useZxing as Yr } from "react-zxing";
|
|
17
|
-
import
|
|
17
|
+
import xt from "@dagrejs/dagre";
|
|
18
18
|
import { DirectedGraph as Zr } from "graphology";
|
|
19
19
|
import { bfsFromNode as Qr } from "graphology-traversal";
|
|
20
|
-
import
|
|
20
|
+
import tn from "lodash.get";
|
|
21
21
|
import es from "lodash.set";
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.542.0 - ISC
|
|
@@ -28,10 +28,10 @@ import es from "lodash.set";
|
|
|
28
28
|
const is = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ts = (i) => i.replace(
|
|
29
29
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
30
30
|
(t, e, n) => n ? n.toUpperCase() : e.toLowerCase()
|
|
31
|
-
),
|
|
31
|
+
), wt = (i) => {
|
|
32
32
|
const t = ts(i);
|
|
33
33
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
34
|
-
},
|
|
34
|
+
}, nn = (...i) => i.filter((t, e, n) => !!t && t.trim() !== "" && n.indexOf(t) === e).join(" ").trim(), ns = (i) => {
|
|
35
35
|
for (const t in i)
|
|
36
36
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
37
37
|
return !0;
|
|
@@ -78,7 +78,7 @@ const ss = Xi(
|
|
|
78
78
|
height: t,
|
|
79
79
|
stroke: i,
|
|
80
80
|
strokeWidth: n ? Number(e) * 24 / Number(t) : e,
|
|
81
|
-
className:
|
|
81
|
+
className: nn("lucide", s),
|
|
82
82
|
...!o && !ns(c) && { "aria-hidden": "true" },
|
|
83
83
|
...c
|
|
84
84
|
},
|
|
@@ -99,15 +99,15 @@ const q = (i, t) => {
|
|
|
99
99
|
({ className: n, ...s }, o) => Gi(ss, {
|
|
100
100
|
ref: o,
|
|
101
101
|
iconNode: t,
|
|
102
|
-
className:
|
|
103
|
-
`lucide-${is(
|
|
102
|
+
className: nn(
|
|
103
|
+
`lucide-${is(wt(i))}`,
|
|
104
104
|
`lucide-${i}`,
|
|
105
105
|
n
|
|
106
106
|
),
|
|
107
107
|
...s
|
|
108
108
|
})
|
|
109
109
|
);
|
|
110
|
-
return e.displayName =
|
|
110
|
+
return e.displayName = wt(i), e;
|
|
111
111
|
};
|
|
112
112
|
/**
|
|
113
113
|
* @license lucide-react v0.542.0 - ISC
|
|
@@ -229,7 +229,7 @@ const Ss = [
|
|
|
229
229
|
* This source code is licensed under the ISC license.
|
|
230
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
231
231
|
*/
|
|
232
|
-
const ws = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]],
|
|
232
|
+
const ws = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], rn = q("circle", ws);
|
|
233
233
|
/**
|
|
234
234
|
* @license lucide-react v0.542.0 - ISC
|
|
235
235
|
*
|
|
@@ -242,7 +242,7 @@ const Ns = [
|
|
|
242
242
|
["path", { d: "M16 4h2a2 2 0 0 1 2 2v4", key: "3hqy98" }],
|
|
243
243
|
["path", { d: "M21 14H11", key: "1bme5i" }],
|
|
244
244
|
["path", { d: "m15 10-4 4 4 4", key: "5dvupr" }]
|
|
245
|
-
],
|
|
245
|
+
], sn = q("clipboard-copy", Ns);
|
|
246
246
|
/**
|
|
247
247
|
* @license lucide-react v0.542.0 - ISC
|
|
248
248
|
*
|
|
@@ -275,7 +275,7 @@ const Ms = [
|
|
|
275
275
|
["path", { d: "m17 18 4-4-4-4", key: "z2g111" }],
|
|
276
276
|
["path", { d: "M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113", key: "bjbb7m" }],
|
|
277
277
|
["rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", key: "ublpy" }]
|
|
278
|
-
],
|
|
278
|
+
], on = q("clipboard-paste", Ms);
|
|
279
279
|
/**
|
|
280
280
|
* @license lucide-react v0.542.0 - ISC
|
|
281
281
|
*
|
|
@@ -307,7 +307,7 @@ const As = [
|
|
|
307
307
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
308
308
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
309
309
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
310
|
-
],
|
|
310
|
+
], ln = q("download", As);
|
|
311
311
|
/**
|
|
312
312
|
* @license lucide-react v0.542.0 - ISC
|
|
313
313
|
*
|
|
@@ -318,18 +318,18 @@ const Ts = [
|
|
|
318
318
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
319
319
|
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
320
320
|
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
321
|
-
],
|
|
321
|
+
], an = q("ellipsis", Ts);
|
|
322
322
|
/**
|
|
323
323
|
* @license lucide-react v0.542.0 - ISC
|
|
324
324
|
*
|
|
325
325
|
* This source code is licensed under the ISC license.
|
|
326
326
|
* See the LICENSE file in the root directory of this source tree.
|
|
327
327
|
*/
|
|
328
|
-
const
|
|
328
|
+
const Es = [
|
|
329
329
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
330
330
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
331
331
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
332
|
-
],
|
|
332
|
+
], _s = q("external-link", Es);
|
|
333
333
|
/**
|
|
334
334
|
* @license lucide-react v0.542.0 - ISC
|
|
335
335
|
*
|
|
@@ -374,7 +374,7 @@ const Ps = [
|
|
|
374
374
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
375
375
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
376
376
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
377
|
-
],
|
|
377
|
+
], dn = q("image", Ps);
|
|
378
378
|
/**
|
|
379
379
|
* @license lucide-react v0.542.0 - ISC
|
|
380
380
|
*
|
|
@@ -385,7 +385,7 @@ const Us = [
|
|
|
385
385
|
["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
|
|
386
386
|
["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
|
|
387
387
|
["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
|
|
388
|
-
],
|
|
388
|
+
], cn = q("layout-panel-top", Us);
|
|
389
389
|
/**
|
|
390
390
|
* @license lucide-react v0.542.0 - ISC
|
|
391
391
|
*
|
|
@@ -464,7 +464,7 @@ const io = [["path", { d: "M5 12h14", key: "1ays0h" }]], fi = q("minus", io);
|
|
|
464
464
|
const to = [
|
|
465
465
|
["path", { d: "M8 18L12 22L16 18", key: "cskvfv" }],
|
|
466
466
|
["path", { d: "M12 2V22", key: "r89rzk" }]
|
|
467
|
-
],
|
|
467
|
+
], un = q("move-down", to);
|
|
468
468
|
/**
|
|
469
469
|
* @license lucide-react v0.542.0 - ISC
|
|
470
470
|
*
|
|
@@ -474,7 +474,7 @@ const to = [
|
|
|
474
474
|
const no = [
|
|
475
475
|
["path", { d: "M8 6L12 2L16 6", key: "1yvkyx" }],
|
|
476
476
|
["path", { d: "M12 2V22", key: "r89rzk" }]
|
|
477
|
-
],
|
|
477
|
+
], hn = q("move-up", no);
|
|
478
478
|
/**
|
|
479
479
|
* @license lucide-react v0.542.0 - ISC
|
|
480
480
|
*
|
|
@@ -569,7 +569,7 @@ const go = [
|
|
|
569
569
|
key: "r04s7s"
|
|
570
570
|
}
|
|
571
571
|
]
|
|
572
|
-
],
|
|
572
|
+
], fn = q("star", go);
|
|
573
573
|
/**
|
|
574
574
|
* @license lucide-react v0.542.0 - ISC
|
|
575
575
|
*
|
|
@@ -641,7 +641,7 @@ const So = [
|
|
|
641
641
|
const wo = [
|
|
642
642
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
643
643
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
644
|
-
], ve = q("x", wo),
|
|
644
|
+
], ve = q("x", wo), mn = F((i) => {
|
|
645
645
|
const { ref: t, file: e, className: n, error: s, rightSlot: o, size: l, ...c } = i, a = () => s ? /* @__PURE__ */ u(H, { children: [
|
|
646
646
|
/* @__PURE__ */ r(p, { icon: Zi, color: "var(--base-a11)" }),
|
|
647
647
|
/* @__PURE__ */ r(D, { accentColor: "base", className: "truncate", size: l, children: s })
|
|
@@ -654,7 +654,7 @@ const wo = [
|
|
|
654
654
|
o
|
|
655
655
|
] });
|
|
656
656
|
});
|
|
657
|
-
|
|
657
|
+
mn.displayName = "FileCard";
|
|
658
658
|
function mi(i) {
|
|
659
659
|
return Array.isArray(i) ? i.every((t) => typeof t == "string") : !1;
|
|
660
660
|
}
|
|
@@ -672,7 +672,7 @@ class bi {
|
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
class
|
|
675
|
+
class pn extends bi {
|
|
676
676
|
constructor(e) {
|
|
677
677
|
const { identifier: n } = e;
|
|
678
678
|
super();
|
|
@@ -694,7 +694,7 @@ class mn extends bi {
|
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
class oe extends
|
|
697
|
+
class oe extends pn {
|
|
698
698
|
constructor(e) {
|
|
699
699
|
const { label: n, description: s = null, required: o, image: l, ...c } = e;
|
|
700
700
|
super(c);
|
|
@@ -758,24 +758,24 @@ class oe extends mn {
|
|
|
758
758
|
return [];
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
const G = gi({}),
|
|
761
|
+
const G = gi({}), gn = (i) => {
|
|
762
762
|
const [t, e] = te(null);
|
|
763
|
-
return
|
|
763
|
+
return Jt(() => {
|
|
764
764
|
const n = URL.createObjectURL(i);
|
|
765
765
|
return e(n), () => {
|
|
766
766
|
URL.revokeObjectURL(n);
|
|
767
767
|
};
|
|
768
768
|
}, [i]), t;
|
|
769
769
|
}, ri = F((i) => {
|
|
770
|
-
const { file: t, ...e } = i, n =
|
|
770
|
+
const { file: t, ...e } = i, n = gn(t);
|
|
771
771
|
return /* @__PURE__ */ r("img", { src: n ?? void 0, alt: t.name, ...e });
|
|
772
772
|
});
|
|
773
773
|
ri.displayName = "ImageFile";
|
|
774
|
-
const
|
|
774
|
+
const Vn = gi(() => {
|
|
775
775
|
throw new Error("No ImageViewerProvider found");
|
|
776
|
-
}), it = () => Rr(
|
|
776
|
+
}), it = () => Rr(Vn), yn = F((i) => {
|
|
777
777
|
const { file: t, onClose: e } = i, n = f(() => {
|
|
778
|
-
|
|
778
|
+
en(t, t.name);
|
|
779
779
|
}, [t]);
|
|
780
780
|
return /* @__PURE__ */ r(pe.Root, { open: !0, onOpenChange: e, children: /* @__PURE__ */ u(pe.Content, { onOpenAutoFocus: Tr, children: [
|
|
781
781
|
/* @__PURE__ */ u(
|
|
@@ -786,18 +786,18 @@ const gn = gi(() => {
|
|
|
786
786
|
variant: "ghost",
|
|
787
787
|
children: [
|
|
788
788
|
/* @__PURE__ */ u(Ie.Root, { children: [
|
|
789
|
-
/* @__PURE__ */ r(Ie.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
789
|
+
/* @__PURE__ */ r(Ie.Trigger, { asChild: !0, children: /* @__PURE__ */ r(E, { onClick: n, "aria-label": "download", children: /* @__PURE__ */ r(p, { icon: ln }) }) }),
|
|
790
790
|
/* @__PURE__ */ r(Ie.Content, { size: "sm", children: "Download" })
|
|
791
791
|
] }),
|
|
792
792
|
/* @__PURE__ */ r(xe, { orientation: "vertical", size: "sm" }),
|
|
793
|
-
/* @__PURE__ */ r(pe.Close, { asChild: !0, children: /* @__PURE__ */ r(
|
|
793
|
+
/* @__PURE__ */ r(pe.Close, { asChild: !0, children: /* @__PURE__ */ r(E, { onClick: e, "aria-label": "close", children: /* @__PURE__ */ r(p, { icon: ve }) }) })
|
|
794
794
|
]
|
|
795
795
|
}
|
|
796
796
|
),
|
|
797
797
|
/* @__PURE__ */ r("figure", { className: "flex size-full items-center justify-center overflow-hidden p-4", children: /* @__PURE__ */ r(ri, { className: "max-h-full max-w-full", file: t }) })
|
|
798
798
|
] }) });
|
|
799
799
|
});
|
|
800
|
-
|
|
800
|
+
yn.displayName = "ImageViewer";
|
|
801
801
|
const No = F((i) => {
|
|
802
802
|
const { children: t } = i, [e, n] = te(null), s = f(() => {
|
|
803
803
|
n(null);
|
|
@@ -809,9 +809,9 @@ const No = F((i) => {
|
|
|
809
809
|
), l = f(() => {
|
|
810
810
|
e && (e.onClose && e.onClose(), s());
|
|
811
811
|
}, [s, e]);
|
|
812
|
-
return /* @__PURE__ */ u(
|
|
812
|
+
return /* @__PURE__ */ u(Vn.Provider, { value: o, children: [
|
|
813
813
|
t,
|
|
814
|
-
e && /* @__PURE__ */ r(
|
|
814
|
+
e && /* @__PURE__ */ r(yn, { file: e.file, onClose: l })
|
|
815
815
|
] });
|
|
816
816
|
});
|
|
817
817
|
No.displayName = "FileViewerProvider";
|
|
@@ -859,7 +859,7 @@ const Fo = (i) => i.map((t) => /* @__PURE__ */ r(Yi, { children: t.render() }, t
|
|
|
859
859
|
onChange: s,
|
|
860
860
|
onBlur: o
|
|
861
861
|
};
|
|
862
|
-
},
|
|
862
|
+
}, bn = F((i) => {
|
|
863
863
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), [d, h] = te(""), [m, g] = te(""), b = f(
|
|
864
864
|
(S) => {
|
|
865
865
|
l(S), o();
|
|
@@ -925,7 +925,7 @@ const Fo = (i) => i.map((t) => /* @__PURE__ */ r(Yi, { children: t.render() }, t
|
|
|
925
925
|
}
|
|
926
926
|
) }),
|
|
927
927
|
/* @__PURE__ */ r(
|
|
928
|
-
|
|
928
|
+
E,
|
|
929
929
|
{
|
|
930
930
|
size: e,
|
|
931
931
|
accentColor: "base",
|
|
@@ -969,7 +969,7 @@ const Fo = (i) => i.map((t) => /* @__PURE__ */ r(Yi, { children: t.render() }, t
|
|
|
969
969
|
children: typeof k == "object" && "label" in k ? k.label : k
|
|
970
970
|
}),
|
|
971
971
|
/* @__PURE__ */ r(
|
|
972
|
-
|
|
972
|
+
E,
|
|
973
973
|
{
|
|
974
974
|
className: "bg-transparent!",
|
|
975
975
|
size: e,
|
|
@@ -998,8 +998,8 @@ const Fo = (i) => i.map((t) => /* @__PURE__ */ r(Yi, { children: t.render() }, t
|
|
|
998
998
|
}
|
|
999
999
|
) });
|
|
1000
1000
|
});
|
|
1001
|
-
|
|
1002
|
-
class
|
|
1001
|
+
bn.displayName = "MultiStringFieldInput";
|
|
1002
|
+
class Ee extends oe {
|
|
1003
1003
|
constructor(e) {
|
|
1004
1004
|
const { minimum_length: n, maximum_length: s, placeholder: o, ...l } = e;
|
|
1005
1005
|
super(l);
|
|
@@ -1010,7 +1010,7 @@ class _e extends oe {
|
|
|
1010
1010
|
this.minLength = n ?? 0, this.maxLength = s ?? 1 / 0, this.placeholder = o ?? "Press enter to add a new option";
|
|
1011
1011
|
}
|
|
1012
1012
|
render() {
|
|
1013
|
-
return /* @__PURE__ */ r(
|
|
1013
|
+
return /* @__PURE__ */ r(bn, { field: this });
|
|
1014
1014
|
}
|
|
1015
1015
|
serialize() {
|
|
1016
1016
|
return {
|
|
@@ -1029,7 +1029,7 @@ class _e extends oe {
|
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
1031
|
duplicate(e) {
|
|
1032
|
-
return new
|
|
1032
|
+
return new Ee({
|
|
1033
1033
|
...this.getOptions(),
|
|
1034
1034
|
identifier: e
|
|
1035
1035
|
});
|
|
@@ -1055,7 +1055,7 @@ class _e extends oe {
|
|
|
1055
1055
|
}), e;
|
|
1056
1056
|
}
|
|
1057
1057
|
static deserialize(e) {
|
|
1058
|
-
return new
|
|
1058
|
+
return new Ee(e);
|
|
1059
1059
|
}
|
|
1060
1060
|
isSerializedValue(e) {
|
|
1061
1061
|
return mi(e);
|
|
@@ -1105,7 +1105,7 @@ class Ci extends oe {
|
|
|
1105
1105
|
const n = e && `${e}.`;
|
|
1106
1106
|
return [
|
|
1107
1107
|
{
|
|
1108
|
-
field: new
|
|
1108
|
+
field: new Ee({
|
|
1109
1109
|
label: "Options",
|
|
1110
1110
|
description: "List possible options for the user to select from.",
|
|
1111
1111
|
required: !0,
|
|
@@ -1117,7 +1117,7 @@ class Ci extends oe {
|
|
|
1117
1117
|
];
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
const
|
|
1120
|
+
const Cn = F((i) => {
|
|
1121
1121
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
1122
1122
|
(m) => {
|
|
1123
1123
|
l(!!m), o();
|
|
@@ -1154,8 +1154,8 @@ const bn = F((i) => {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
);
|
|
1156
1156
|
});
|
|
1157
|
-
|
|
1158
|
-
class
|
|
1157
|
+
Cn.displayName = "BooleanFieldInput";
|
|
1158
|
+
class _e extends oe {
|
|
1159
1159
|
constructor(e) {
|
|
1160
1160
|
super(e);
|
|
1161
1161
|
y(this, "type", "boolean");
|
|
@@ -1170,13 +1170,13 @@ class Ee extends oe {
|
|
|
1170
1170
|
super.setOptions(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
duplicate(e) {
|
|
1173
|
-
return new
|
|
1173
|
+
return new _e({
|
|
1174
1174
|
...this.getOptions(),
|
|
1175
1175
|
identifier: e
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
static deserialize(e) {
|
|
1179
|
-
return new
|
|
1179
|
+
return new _e(e);
|
|
1180
1180
|
}
|
|
1181
1181
|
serializeValue(e) {
|
|
1182
1182
|
return e;
|
|
@@ -1185,7 +1185,7 @@ class Ee extends oe {
|
|
|
1185
1185
|
return e;
|
|
1186
1186
|
}
|
|
1187
1187
|
render() {
|
|
1188
|
-
return /* @__PURE__ */ r(
|
|
1188
|
+
return /* @__PURE__ */ r(Cn, { field: this });
|
|
1189
1189
|
}
|
|
1190
1190
|
isSerializedValue(e) {
|
|
1191
1191
|
return typeof e == "boolean";
|
|
@@ -1206,7 +1206,7 @@ class Ee extends oe {
|
|
|
1206
1206
|
return e === n;
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
const
|
|
1209
|
+
const vn = F((i) => {
|
|
1210
1210
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
1211
1211
|
(g) => {
|
|
1212
1212
|
const b = g.target.valueAsNumber, N = isNaN(b) ? null : b;
|
|
@@ -1248,7 +1248,7 @@ const Cn = F((i) => {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
);
|
|
1250
1250
|
});
|
|
1251
|
-
|
|
1251
|
+
vn.displayName = "NumberFieldInput";
|
|
1252
1252
|
class re extends oe {
|
|
1253
1253
|
constructor(e) {
|
|
1254
1254
|
const {
|
|
@@ -1290,7 +1290,7 @@ class re extends oe {
|
|
|
1290
1290
|
showDirectly: !1
|
|
1291
1291
|
},
|
|
1292
1292
|
{
|
|
1293
|
-
field: new
|
|
1293
|
+
field: new _e({
|
|
1294
1294
|
label: "Integers",
|
|
1295
1295
|
description: "Whole numbers only",
|
|
1296
1296
|
required: !1,
|
|
@@ -1351,7 +1351,7 @@ class re extends oe {
|
|
|
1351
1351
|
return e;
|
|
1352
1352
|
}
|
|
1353
1353
|
render() {
|
|
1354
|
-
return /* @__PURE__ */ r(
|
|
1354
|
+
return /* @__PURE__ */ r(vn, { field: this });
|
|
1355
1355
|
}
|
|
1356
1356
|
isSerializedValue(e) {
|
|
1357
1357
|
return this.isValue(e);
|
|
@@ -1373,7 +1373,7 @@ class re extends oe {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
1375
|
const pi = 1e4;
|
|
1376
|
-
class
|
|
1376
|
+
class zn extends oe {
|
|
1377
1377
|
constructor(e) {
|
|
1378
1378
|
const { minLength: n, maxLength: s, placeholder: o = "", ...l } = e;
|
|
1379
1379
|
super(l);
|
|
@@ -1468,7 +1468,7 @@ class vn extends oe {
|
|
|
1468
1468
|
return e === n;
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
|
-
const
|
|
1471
|
+
const Sn = F((i) => {
|
|
1472
1472
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
1473
1473
|
(m) => {
|
|
1474
1474
|
l(m), o();
|
|
@@ -1515,7 +1515,7 @@ const zn = F((i) => {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
);
|
|
1517
1517
|
});
|
|
1518
|
-
|
|
1518
|
+
Sn.displayName = "CheckboxListFieldInput";
|
|
1519
1519
|
class Re extends Ci {
|
|
1520
1520
|
constructor(e) {
|
|
1521
1521
|
super(e);
|
|
@@ -1543,7 +1543,7 @@ class Re extends Ci {
|
|
|
1543
1543
|
return e;
|
|
1544
1544
|
}
|
|
1545
1545
|
render() {
|
|
1546
|
-
return /* @__PURE__ */ r(
|
|
1546
|
+
return /* @__PURE__ */ r(Sn, { field: this });
|
|
1547
1547
|
}
|
|
1548
1548
|
isSerializedValue(e) {
|
|
1549
1549
|
if (!mi(e)) return !1;
|
|
@@ -1568,7 +1568,7 @@ class Re extends Ci {
|
|
|
1568
1568
|
return s.size === o.size && s.isSubsetOf(o);
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
|
-
const
|
|
1571
|
+
const xn = F((i) => {
|
|
1572
1572
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), [d, h] = te(!1), m = f(
|
|
1573
1573
|
(b) => {
|
|
1574
1574
|
l(b ?? null), o(), h(!1);
|
|
@@ -1613,7 +1613,7 @@ const Sn = F((i) => {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
) }),
|
|
1615
1615
|
/* @__PURE__ */ r(j.Content, { align: "start", size: e, children: /* @__PURE__ */ r(
|
|
1616
|
-
|
|
1616
|
+
Ht,
|
|
1617
1617
|
{
|
|
1618
1618
|
size: e,
|
|
1619
1619
|
required: !1,
|
|
@@ -1627,7 +1627,7 @@ const Sn = F((i) => {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
);
|
|
1629
1629
|
});
|
|
1630
|
-
|
|
1630
|
+
xn.displayName = "DateFieldInput";
|
|
1631
1631
|
class Qe extends oe {
|
|
1632
1632
|
constructor(e) {
|
|
1633
1633
|
super(e);
|
|
@@ -1658,7 +1658,7 @@ class Qe extends oe {
|
|
|
1658
1658
|
return e ? new Date(e) : null;
|
|
1659
1659
|
}
|
|
1660
1660
|
render() {
|
|
1661
|
-
return /* @__PURE__ */ r(
|
|
1661
|
+
return /* @__PURE__ */ r(xn, { field: this });
|
|
1662
1662
|
}
|
|
1663
1663
|
isSerializedValue(e) {
|
|
1664
1664
|
return typeof e != "string" && e !== null ? !1 : this.isValue(this.deserializeValue(e));
|
|
@@ -1680,7 +1680,7 @@ class Qe extends oe {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
var T = /* @__PURE__ */ ((i) => (i.Text = "text", i.Selection = "selection", i.Numeric = "numeric", i.Temporal = "temporal", i.Capture = "capture", i.Assessment = "assessment", i.Verification = "verification", i))(T || {});
|
|
1683
|
-
const
|
|
1683
|
+
const wn = F((i) => {
|
|
1684
1684
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
1685
1685
|
(m) => {
|
|
1686
1686
|
l(m), o();
|
|
@@ -1741,7 +1741,7 @@ const xn = F((i) => {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
);
|
|
1743
1743
|
});
|
|
1744
|
-
|
|
1744
|
+
wn.displayName = "MultiSelectFieldInput";
|
|
1745
1745
|
class Ce extends Ci {
|
|
1746
1746
|
constructor(e) {
|
|
1747
1747
|
const { placeholder: n, ...s } = e;
|
|
@@ -1779,7 +1779,7 @@ class Ce extends Ci {
|
|
|
1779
1779
|
return e;
|
|
1780
1780
|
}
|
|
1781
1781
|
render() {
|
|
1782
|
-
return /* @__PURE__ */ r(
|
|
1782
|
+
return /* @__PURE__ */ r(wn, { field: this });
|
|
1783
1783
|
}
|
|
1784
1784
|
isSerializedValue(e) {
|
|
1785
1785
|
if (!mi(e)) return !1;
|
|
@@ -1804,7 +1804,7 @@ class Ce extends Ci {
|
|
|
1804
1804
|
return s.size === o.size && s.isSubsetOf(o);
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
|
-
const
|
|
1807
|
+
const Nn = F((i) => {
|
|
1808
1808
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
1809
1809
|
(g) => {
|
|
1810
1810
|
l(g ?? null), o();
|
|
@@ -1815,7 +1815,7 @@ const wn = F((i) => {
|
|
|
1815
1815
|
g || o();
|
|
1816
1816
|
},
|
|
1817
1817
|
[o]
|
|
1818
|
-
), m =
|
|
1818
|
+
), m = _(() => t.options.find((g) => g.value === n), [t.options, n]);
|
|
1819
1819
|
return /* @__PURE__ */ r(
|
|
1820
1820
|
W,
|
|
1821
1821
|
{
|
|
@@ -1859,7 +1859,7 @@ const wn = F((i) => {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
);
|
|
1861
1861
|
});
|
|
1862
|
-
|
|
1862
|
+
Nn.displayName = "SelectFieldInput";
|
|
1863
1863
|
class we extends Ci {
|
|
1864
1864
|
constructor(e) {
|
|
1865
1865
|
const { placeholder: n, ...s } = e;
|
|
@@ -1897,7 +1897,7 @@ class we extends Ci {
|
|
|
1897
1897
|
return e;
|
|
1898
1898
|
}
|
|
1899
1899
|
render() {
|
|
1900
|
-
return /* @__PURE__ */ r(
|
|
1900
|
+
return /* @__PURE__ */ r(Nn, { field: this });
|
|
1901
1901
|
}
|
|
1902
1902
|
isSerializedValue(e) {
|
|
1903
1903
|
return typeof e != "string" && e !== null ? !1 : (/* @__PURE__ */ new Set([null, ...this.options.map(({ value: s }) => s)])).has(e);
|
|
@@ -1918,7 +1918,7 @@ class we extends Ci {
|
|
|
1918
1918
|
return e === n;
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
|
-
const
|
|
1921
|
+
const Fn = F((i) => {
|
|
1922
1922
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
1923
1923
|
(g) => {
|
|
1924
1924
|
l(g);
|
|
@@ -1926,7 +1926,7 @@ const Nn = F((i) => {
|
|
|
1926
1926
|
[l]
|
|
1927
1927
|
), h = f(() => {
|
|
1928
1928
|
o();
|
|
1929
|
-
}, [o]), m =
|
|
1929
|
+
}, [o]), m = _(() => Array.from({ length: t.length }, () => M()), [t.length]);
|
|
1930
1930
|
return /* @__PURE__ */ r(
|
|
1931
1931
|
W,
|
|
1932
1932
|
{
|
|
@@ -1966,7 +1966,7 @@ const Nn = F((i) => {
|
|
|
1966
1966
|
}
|
|
1967
1967
|
);
|
|
1968
1968
|
});
|
|
1969
|
-
|
|
1969
|
+
Fn.displayName = "OTPFieldInput";
|
|
1970
1970
|
class $e extends oe {
|
|
1971
1971
|
constructor(e) {
|
|
1972
1972
|
const { length: n, validationType: s, ...o } = e;
|
|
@@ -2060,7 +2060,7 @@ class $e extends oe {
|
|
|
2060
2060
|
return e;
|
|
2061
2061
|
}
|
|
2062
2062
|
render() {
|
|
2063
|
-
return /* @__PURE__ */ r(
|
|
2063
|
+
return /* @__PURE__ */ r(Fn, { field: this });
|
|
2064
2064
|
}
|
|
2065
2065
|
isSerializedValue(e) {
|
|
2066
2066
|
return typeof e == "string";
|
|
@@ -2146,7 +2146,7 @@ function tt(i, t) {
|
|
|
2146
2146
|
const e = new Set(i.map(({ uuid: s }) => s)), n = new Set(t.map(({ uuid: s }) => s));
|
|
2147
2147
|
return e.size === n.size && e.isSubsetOf(n);
|
|
2148
2148
|
}
|
|
2149
|
-
const
|
|
2149
|
+
const kn = F((i) => {
|
|
2150
2150
|
const { ref: t, file: e, error: n, rightSlot: s, className: o, size: l, ...c } = i;
|
|
2151
2151
|
return /* @__PURE__ */ u(
|
|
2152
2152
|
fe,
|
|
@@ -2162,7 +2162,7 @@ const Fn = F((i) => {
|
|
|
2162
2162
|
(!!e || !!n) && /* @__PURE__ */ u(H, { children: [
|
|
2163
2163
|
/* @__PURE__ */ r(xe, { size: "full" }),
|
|
2164
2164
|
/* @__PURE__ */ u("div", { className: "flex w-full shrink-0 items-center gap-2 self-end p-3", children: [
|
|
2165
|
-
n ? /* @__PURE__ */ r(p, { color: "var(--base-11)", icon: Zi }) : e && /* @__PURE__ */ r(p, { color: "var(--base-11)", icon:
|
|
2165
|
+
n ? /* @__PURE__ */ r(p, { color: "var(--base-11)", icon: Zi }) : e && /* @__PURE__ */ r(p, { color: "var(--base-11)", icon: dn }),
|
|
2166
2166
|
/* @__PURE__ */ r(D, { className: "truncate", size: l, children: n ?? (e == null ? void 0 : e.name) }),
|
|
2167
2167
|
s
|
|
2168
2168
|
] })
|
|
@@ -2171,13 +2171,13 @@ const Fn = F((i) => {
|
|
|
2171
2171
|
}
|
|
2172
2172
|
);
|
|
2173
2173
|
});
|
|
2174
|
-
|
|
2175
|
-
const
|
|
2176
|
-
const { file: t, ...e } = i, n =
|
|
2174
|
+
kn.displayName = "ImageCard";
|
|
2175
|
+
const Mn = F((i) => {
|
|
2176
|
+
const { file: t, ...e } = i, n = gn(t);
|
|
2177
2177
|
return /* @__PURE__ */ r("video", { src: n ?? void 0, ...e });
|
|
2178
2178
|
});
|
|
2179
|
-
|
|
2180
|
-
const
|
|
2179
|
+
Mn.displayName = "VideoFile";
|
|
2180
|
+
const qn = F((i) => {
|
|
2181
2181
|
const { ref: t, file: e, className: n, error: s, rightSlot: o, size: l, ...c } = i;
|
|
2182
2182
|
return /* @__PURE__ */ u(
|
|
2183
2183
|
fe,
|
|
@@ -2188,7 +2188,7 @@ const Mn = F((i) => {
|
|
|
2188
2188
|
...c,
|
|
2189
2189
|
children: [
|
|
2190
2190
|
!e && !s && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex grow items-center justify-center", children: /* @__PURE__ */ r(Wi, { size: l }) }),
|
|
2191
|
-
!!e && !s && /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-hidden p-3", children: /* @__PURE__ */ r(
|
|
2191
|
+
!!e && !s && /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-hidden p-3", children: /* @__PURE__ */ r(Mn, { className: "block size-full max-w-full object-cover", file: e, controls: !0 }) }),
|
|
2192
2192
|
!!s && /* @__PURE__ */ r("div", { className: "grow" }),
|
|
2193
2193
|
(!!e || !!s) && /* @__PURE__ */ u(H, { children: [
|
|
2194
2194
|
/* @__PURE__ */ r(xe, { size: "full" }),
|
|
@@ -2202,7 +2202,7 @@ const Mn = F((i) => {
|
|
|
2202
2202
|
}
|
|
2203
2203
|
);
|
|
2204
2204
|
});
|
|
2205
|
-
|
|
2205
|
+
qn.displayName = "VideoCard";
|
|
2206
2206
|
const nt = F((i) => {
|
|
2207
2207
|
const { fileOrPromise: t, onRemove: e, disabled: n, size: s } = i, [o, l] = te(
|
|
2208
2208
|
t instanceof De ? null : t
|
|
@@ -2224,7 +2224,7 @@ const nt = F((i) => {
|
|
|
2224
2224
|
const h = f(() => {
|
|
2225
2225
|
if (!o) return;
|
|
2226
2226
|
const v = new Blob([o]);
|
|
2227
|
-
|
|
2227
|
+
en(v, o.name);
|
|
2228
2228
|
}, [o]), m = f(() => {
|
|
2229
2229
|
e(t);
|
|
2230
2230
|
}, [e, t]), g = f(() => {
|
|
@@ -2238,22 +2238,22 @@ const nt = F((i) => {
|
|
|
2238
2238
|
m(), v();
|
|
2239
2239
|
}
|
|
2240
2240
|
}));
|
|
2241
|
-
}, [n, m, d, o]), N =
|
|
2241
|
+
}, [n, m, d, o]), N = _(
|
|
2242
2242
|
() => /* @__PURE__ */ r("div", { className: "flex grow justify-end", children: /* @__PURE__ */ u(V.Root, { modal: !0, children: [
|
|
2243
2243
|
/* @__PURE__ */ r(V.ClickTrigger, { children: /* @__PURE__ */ r(
|
|
2244
|
-
|
|
2244
|
+
E,
|
|
2245
2245
|
{
|
|
2246
2246
|
onClick: Ve,
|
|
2247
2247
|
type: "button",
|
|
2248
2248
|
variant: "ghost",
|
|
2249
2249
|
accentColor: "base",
|
|
2250
2250
|
size: s,
|
|
2251
|
-
children: /* @__PURE__ */ r(p, { icon:
|
|
2251
|
+
children: /* @__PURE__ */ r(p, { icon: an })
|
|
2252
2252
|
}
|
|
2253
2253
|
) }),
|
|
2254
2254
|
/* @__PURE__ */ u(V.Content, { size: s, children: [
|
|
2255
2255
|
/* @__PURE__ */ u(V.Item, { onSelect: h, disabled: !o, children: [
|
|
2256
|
-
/* @__PURE__ */ r(p, { icon:
|
|
2256
|
+
/* @__PURE__ */ r(p, { icon: ln }),
|
|
2257
2257
|
" Download"
|
|
2258
2258
|
] }),
|
|
2259
2259
|
n ? null : /* @__PURE__ */ u(H, { children: [
|
|
@@ -2268,7 +2268,7 @@ const nt = F((i) => {
|
|
|
2268
2268
|
[n, m, h, o, s]
|
|
2269
2269
|
), x = !!(o != null && o.type.startsWith("image/")), z = !!(o != null && o.type.startsWith("video/"));
|
|
2270
2270
|
return x ? /* @__PURE__ */ r(
|
|
2271
|
-
|
|
2271
|
+
kn,
|
|
2272
2272
|
{
|
|
2273
2273
|
className: "cursor-pointer",
|
|
2274
2274
|
onClick: b,
|
|
@@ -2278,7 +2278,7 @@ const nt = F((i) => {
|
|
|
2278
2278
|
size: s
|
|
2279
2279
|
}
|
|
2280
2280
|
) : z ? /* @__PURE__ */ r(
|
|
2281
|
-
|
|
2281
|
+
qn,
|
|
2282
2282
|
{
|
|
2283
2283
|
className: "cursor-pointer",
|
|
2284
2284
|
onClick: b,
|
|
@@ -2288,7 +2288,7 @@ const nt = F((i) => {
|
|
|
2288
2288
|
size: s
|
|
2289
2289
|
}
|
|
2290
2290
|
) : /* @__PURE__ */ r(
|
|
2291
|
-
|
|
2291
|
+
mn,
|
|
2292
2292
|
{
|
|
2293
2293
|
className: "cursor-pointer",
|
|
2294
2294
|
file: o,
|
|
@@ -2300,7 +2300,7 @@ const nt = F((i) => {
|
|
|
2300
2300
|
);
|
|
2301
2301
|
});
|
|
2302
2302
|
nt.displayName = "DisplayFile";
|
|
2303
|
-
const
|
|
2303
|
+
const On = F((i) => {
|
|
2304
2304
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = Vi(null), h = f(
|
|
2305
2305
|
(S) => {
|
|
2306
2306
|
const k = t.cleanValue({
|
|
@@ -2385,7 +2385,7 @@ const qn = F((i) => {
|
|
|
2385
2385
|
children: ei.map((S) => {
|
|
2386
2386
|
const { label: k } = Te[S];
|
|
2387
2387
|
return /* @__PURE__ */ u("label", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2388
|
-
/* @__PURE__ */ r(Ae.Item, { value: S, children: /* @__PURE__ */ r(Ae.Indicator, { children: /* @__PURE__ */ r(p, { icon:
|
|
2388
|
+
/* @__PURE__ */ r(Ae.Item, { value: S, children: /* @__PURE__ */ r(Ae.Indicator, { children: /* @__PURE__ */ r(p, { icon: rn, className: "fill-current" }) }) }),
|
|
2389
2389
|
/* @__PURE__ */ r(D, { size: e, accentColor: "base", className: "truncate", children: k })
|
|
2390
2390
|
] }, `${t.identifier}-${S}`);
|
|
2391
2391
|
})
|
|
@@ -2455,8 +2455,8 @@ const qn = F((i) => {
|
|
|
2455
2455
|
}
|
|
2456
2456
|
);
|
|
2457
2457
|
});
|
|
2458
|
-
|
|
2459
|
-
const
|
|
2458
|
+
On.displayName = "PassFailFieldInput";
|
|
2459
|
+
const In = (i) => typeof i == "string" && ei.includes(i), Mo = (i) => !(i === null || typeof i != "object" || !("status" in i) || !In(i.status) || !("notes" in i) || typeof i.notes != "string" || !("files" in i) || !(Array.isArray(i.files) && i.files.length === 0)), qo = (i) => !(i === null || typeof i != "object" || !("status" in i) || !In(i.status) || !("notes" in i) || typeof i.notes != "string" || !("files" in i) || !ko(i.files)), Oo = (i) => ({
|
|
2460
2460
|
status: i.status,
|
|
2461
2461
|
notes: i.notes,
|
|
2462
2462
|
files: []
|
|
@@ -2539,7 +2539,7 @@ class Le extends oe {
|
|
|
2539
2539
|
return Io(e);
|
|
2540
2540
|
}
|
|
2541
2541
|
render() {
|
|
2542
|
-
return /* @__PURE__ */ r(
|
|
2542
|
+
return /* @__PURE__ */ r(On, { field: this });
|
|
2543
2543
|
}
|
|
2544
2544
|
isSerializedValue(e) {
|
|
2545
2545
|
return Mo(e);
|
|
@@ -2578,7 +2578,7 @@ class Le extends oe {
|
|
|
2578
2578
|
return To(e, n);
|
|
2579
2579
|
}
|
|
2580
2580
|
}
|
|
2581
|
-
const
|
|
2581
|
+
const An = F((i) => {
|
|
2582
2582
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
2583
2583
|
(g) => {
|
|
2584
2584
|
l(g), o();
|
|
@@ -2617,7 +2617,7 @@ const In = F((i) => {
|
|
|
2617
2617
|
{
|
|
2618
2618
|
className: "flex min-w-0 items-center gap-2",
|
|
2619
2619
|
children: [
|
|
2620
|
-
/* @__PURE__ */ r(Ae.Item, { value: g.value, onBlur: h, children: /* @__PURE__ */ r(Ae.Indicator, { children: /* @__PURE__ */ r(p, { icon:
|
|
2620
|
+
/* @__PURE__ */ r(Ae.Item, { value: g.value, onBlur: h, children: /* @__PURE__ */ r(Ae.Indicator, { children: /* @__PURE__ */ r(p, { icon: rn, className: "fill-current" }) }) }),
|
|
2621
2621
|
/* @__PURE__ */ r(D, { size: e, accentColor: "base", className: "truncate", children: g.label })
|
|
2622
2622
|
]
|
|
2623
2623
|
},
|
|
@@ -2644,7 +2644,7 @@ const In = F((i) => {
|
|
|
2644
2644
|
}
|
|
2645
2645
|
);
|
|
2646
2646
|
});
|
|
2647
|
-
|
|
2647
|
+
An.displayName = "RadioFieldInput";
|
|
2648
2648
|
class Be extends Ci {
|
|
2649
2649
|
constructor(e) {
|
|
2650
2650
|
super(e);
|
|
@@ -2675,7 +2675,7 @@ class Be extends Ci {
|
|
|
2675
2675
|
return e;
|
|
2676
2676
|
}
|
|
2677
2677
|
render() {
|
|
2678
|
-
return /* @__PURE__ */ r(
|
|
2678
|
+
return /* @__PURE__ */ r(An, { field: this });
|
|
2679
2679
|
}
|
|
2680
2680
|
isSerializedValue(e) {
|
|
2681
2681
|
return typeof e != "string" && e !== null ? !1 : (/* @__PURE__ */ new Set([null, ...this.options.map(({ value: s }) => s)])).has(e);
|
|
@@ -2696,7 +2696,7 @@ class Be extends Ci {
|
|
|
2696
2696
|
return e === n;
|
|
2697
2697
|
}
|
|
2698
2698
|
}
|
|
2699
|
-
const
|
|
2699
|
+
const Eo = Ki(
|
|
2700
2700
|
[
|
|
2701
2701
|
"group flex cursor-pointer items-center justify-center text-yellow-500 transition-colors disabled:pointer-events-none disabled:opacity-50"
|
|
2702
2702
|
],
|
|
@@ -2711,7 +2711,7 @@ const _o = Ki(
|
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
2713
|
}
|
|
2714
|
-
),
|
|
2714
|
+
), Tn = F((i) => {
|
|
2715
2715
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
2716
2716
|
(g) => {
|
|
2717
2717
|
l(g), o();
|
|
@@ -2732,7 +2732,7 @@ const _o = Ki(
|
|
|
2732
2732
|
image: t.image,
|
|
2733
2733
|
children: /* @__PURE__ */ u("div", { className: "flex flex-row items-center gap-1", children: [
|
|
2734
2734
|
/* @__PURE__ */ r(
|
|
2735
|
-
|
|
2735
|
+
zt.Root,
|
|
2736
2736
|
{
|
|
2737
2737
|
id: t.identifier,
|
|
2738
2738
|
name: s,
|
|
@@ -2741,22 +2741,22 @@ const _o = Ki(
|
|
|
2741
2741
|
onValueChange: d,
|
|
2742
2742
|
disabled: a,
|
|
2743
2743
|
children: m.map((g) => /* @__PURE__ */ r(
|
|
2744
|
-
|
|
2744
|
+
zt.Item,
|
|
2745
2745
|
{
|
|
2746
2746
|
value: g,
|
|
2747
|
-
className:
|
|
2748
|
-
children: /* @__PURE__ */ r(p, { icon:
|
|
2747
|
+
className: Eo({ size: e }),
|
|
2748
|
+
children: /* @__PURE__ */ r(p, { icon: fn, className: "size-full group-data-[active=true]:fill-current" })
|
|
2749
2749
|
},
|
|
2750
2750
|
`${t.identifier}-${g}`
|
|
2751
2751
|
))
|
|
2752
2752
|
}
|
|
2753
2753
|
),
|
|
2754
|
-
!a && n !== null && /* @__PURE__ */ r(
|
|
2754
|
+
!a && n !== null && /* @__PURE__ */ r(E, { onClick: h, type: "button", variant: "ghost", accentColor: "base", size: e, children: /* @__PURE__ */ r(p, { icon: ve }) })
|
|
2755
2755
|
] })
|
|
2756
2756
|
}
|
|
2757
2757
|
);
|
|
2758
2758
|
});
|
|
2759
|
-
|
|
2759
|
+
Tn.displayName = "RatingFieldInput";
|
|
2760
2760
|
class je extends oe {
|
|
2761
2761
|
constructor(e) {
|
|
2762
2762
|
const { maxRating: n, ...s } = e;
|
|
@@ -2821,7 +2821,7 @@ class je extends oe {
|
|
|
2821
2821
|
return e;
|
|
2822
2822
|
}
|
|
2823
2823
|
render() {
|
|
2824
|
-
return /* @__PURE__ */ r(
|
|
2824
|
+
return /* @__PURE__ */ r(Tn, { field: this });
|
|
2825
2825
|
}
|
|
2826
2826
|
isSerializedValue(e) {
|
|
2827
2827
|
return this.isValue(e);
|
|
@@ -2842,9 +2842,17 @@ class je extends oe {
|
|
|
2842
2842
|
return e === n;
|
|
2843
2843
|
}
|
|
2844
2844
|
}
|
|
2845
|
-
const
|
|
2846
|
-
|
|
2847
|
-
|
|
2845
|
+
const rt = gi(null), _o = () => {
|
|
2846
|
+
const i = R(rt);
|
|
2847
|
+
if (!i)
|
|
2848
|
+
throw new Error("useScannerContext must be used within a component tree wrapped by ScannerProvider.");
|
|
2849
|
+
return i;
|
|
2850
|
+
}, ga = () => {
|
|
2851
|
+
const i = R(rt);
|
|
2852
|
+
if (!i)
|
|
2853
|
+
throw new Error("useScanner must be used within a component tree wrapped by ScannerProvider.");
|
|
2854
|
+
return i.openScanner;
|
|
2855
|
+
}, st = F((i) => {
|
|
2848
2856
|
const {
|
|
2849
2857
|
children: t,
|
|
2850
2858
|
open: e,
|
|
@@ -2859,43 +2867,52 @@ const Tn = gi(() => {
|
|
|
2859
2867
|
/* @__PURE__ */ u(pe.Content, { children: [
|
|
2860
2868
|
/* @__PURE__ */ r(pe.Title, { className: "sr-only", children: "Scanner" }),
|
|
2861
2869
|
/* @__PURE__ */ r(pe.Description, { className: "sr-only", children: "Scan a barcode or a qr code." }),
|
|
2862
|
-
/* @__PURE__ */ r(
|
|
2870
|
+
/* @__PURE__ */ r(En, { ...l })
|
|
2863
2871
|
] })
|
|
2864
2872
|
] });
|
|
2865
2873
|
});
|
|
2866
|
-
|
|
2867
|
-
const
|
|
2868
|
-
const { paused: t,
|
|
2874
|
+
st.displayName = "Scanner";
|
|
2875
|
+
const En = F((i) => {
|
|
2876
|
+
const { paused: t, formats: e, timeBetweenDecodingAttempts: n, trySkew: s, onDecodeResult: o, onDecodeError: l, onError: c } = i, { wasmUrl: a } = _o(), { ref: d } = Yr({
|
|
2877
|
+
wasmUrl: a,
|
|
2869
2878
|
paused: t,
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2879
|
+
formats: e,
|
|
2880
|
+
timeBetweenDecodingAttempts: n,
|
|
2881
|
+
trySkew: s,
|
|
2882
|
+
onDecodeResult: o,
|
|
2883
|
+
onDecodeError: l,
|
|
2884
|
+
onError: c
|
|
2874
2885
|
});
|
|
2875
2886
|
return /* @__PURE__ */ u("div", { className: "bg-(--color-background) flex size-full flex-col justify-center overflow-hidden", children: [
|
|
2876
|
-
/* @__PURE__ */ r("div", { className: "flex w-full justify-end p-4", children: /* @__PURE__ */ r(pe.Close, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2877
|
-
/* @__PURE__ */ r("div", { className: "max-h-full w-full grow overflow-hidden p-4", children: /* @__PURE__ */ r("video", { className: "size-full", ref:
|
|
2887
|
+
/* @__PURE__ */ r("div", { className: "flex w-full justify-end p-4", children: /* @__PURE__ */ r(pe.Close, { asChild: !0, children: /* @__PURE__ */ r(E, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ r(p, { icon: ve }) }) }) }),
|
|
2888
|
+
/* @__PURE__ */ r("div", { className: "max-h-full w-full grow overflow-hidden p-4", children: /* @__PURE__ */ r("video", { className: "size-full", ref: d, muted: !0, playsInline: !0 }) })
|
|
2878
2889
|
] });
|
|
2879
2890
|
});
|
|
2880
|
-
|
|
2881
|
-
const
|
|
2882
|
-
const { children: t } = i, [
|
|
2883
|
-
|
|
2884
|
-
}, []),
|
|
2885
|
-
(
|
|
2886
|
-
|
|
2891
|
+
En.displayName = "ScannerInternal";
|
|
2892
|
+
const Ro = F((i) => {
|
|
2893
|
+
const { children: t, wasmUrl: e } = i, [n, s] = te(null), o = f(() => {
|
|
2894
|
+
s(null);
|
|
2895
|
+
}, []), l = f(
|
|
2896
|
+
(d) => {
|
|
2897
|
+
s(d(o));
|
|
2887
2898
|
},
|
|
2888
|
-
[
|
|
2889
|
-
),
|
|
2890
|
-
|
|
2891
|
-
}, [
|
|
2892
|
-
|
|
2899
|
+
[o]
|
|
2900
|
+
), c = f(() => {
|
|
2901
|
+
n && (n.onClose && n.onClose(), o());
|
|
2902
|
+
}, [o, n]), a = _(
|
|
2903
|
+
() => ({
|
|
2904
|
+
wasmUrl: e,
|
|
2905
|
+
openScanner: l
|
|
2906
|
+
}),
|
|
2907
|
+
[e, l]
|
|
2908
|
+
);
|
|
2909
|
+
return /* @__PURE__ */ u(rt, { value: a, children: [
|
|
2893
2910
|
t,
|
|
2894
|
-
|
|
2911
|
+
n && /* @__PURE__ */ r(st, { open: !0, onOpenChange: c, ...n })
|
|
2895
2912
|
] });
|
|
2896
2913
|
});
|
|
2897
|
-
|
|
2898
|
-
const
|
|
2914
|
+
Ro.displayName = "ScannerProvider";
|
|
2915
|
+
const _n = F((i) => {
|
|
2899
2916
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), [d, h] = te(!1), m = f(
|
|
2900
2917
|
(z) => {
|
|
2901
2918
|
const v = z.target.value;
|
|
@@ -2906,7 +2923,7 @@ const En = F((i) => {
|
|
|
2906
2923
|
o();
|
|
2907
2924
|
}, [o]), b = f(
|
|
2908
2925
|
(z) => {
|
|
2909
|
-
l(z.rawValue), o(), h(!1);
|
|
2926
|
+
l(z.rawValue.trim()), o(), h(!1);
|
|
2910
2927
|
},
|
|
2911
2928
|
[l, o]
|
|
2912
2929
|
), N = f(() => {
|
|
@@ -2957,12 +2974,12 @@ const En = F((i) => {
|
|
|
2957
2974
|
]
|
|
2958
2975
|
}
|
|
2959
2976
|
),
|
|
2960
|
-
/* @__PURE__ */ r(
|
|
2977
|
+
/* @__PURE__ */ r(st, { open: d, onDecodeResult: b, onOpenChange: x })
|
|
2961
2978
|
]
|
|
2962
2979
|
}
|
|
2963
2980
|
);
|
|
2964
2981
|
});
|
|
2965
|
-
|
|
2982
|
+
_n.displayName = "ScanFieldInput";
|
|
2966
2983
|
class ii extends oe {
|
|
2967
2984
|
constructor(e) {
|
|
2968
2985
|
super(e);
|
|
@@ -2993,7 +3010,7 @@ class ii extends oe {
|
|
|
2993
3010
|
return e;
|
|
2994
3011
|
}
|
|
2995
3012
|
render() {
|
|
2996
|
-
return /* @__PURE__ */ r(
|
|
3013
|
+
return /* @__PURE__ */ r(_n, { field: this });
|
|
2997
3014
|
}
|
|
2998
3015
|
isSerializedValue(e) {
|
|
2999
3016
|
return typeof e == "string";
|
|
@@ -3014,7 +3031,7 @@ class ii extends oe {
|
|
|
3014
3031
|
return e === n;
|
|
3015
3032
|
}
|
|
3016
3033
|
}
|
|
3017
|
-
const
|
|
3034
|
+
const Nt = 500, Rn = F((i) => {
|
|
3018
3035
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t }), d = f(
|
|
3019
3036
|
(g) => {
|
|
3020
3037
|
const b = g.target.value;
|
|
@@ -3055,9 +3072,9 @@ const wt = 500, Rn = F((i) => {
|
|
|
3055
3072
|
);
|
|
3056
3073
|
});
|
|
3057
3074
|
Rn.displayName = "StringFieldInput";
|
|
3058
|
-
class Pe extends
|
|
3075
|
+
class Pe extends zn {
|
|
3059
3076
|
constructor(e) {
|
|
3060
|
-
const { ...n } = e, s = e.maxLength ? Math.min(
|
|
3077
|
+
const { ...n } = e, s = e.maxLength ? Math.min(Nt, e.maxLength) : Nt, o = e.minLength ? Math.min(e.minLength, s) : void 0;
|
|
3061
3078
|
super({ ...n, maxLength: s, minLength: o });
|
|
3062
3079
|
y(this, "type", "string");
|
|
3063
3080
|
}
|
|
@@ -3130,7 +3147,7 @@ const $n = F((i) => {
|
|
|
3130
3147
|
);
|
|
3131
3148
|
});
|
|
3132
3149
|
$n.displayName = "TextFieldInput";
|
|
3133
|
-
class Ue extends
|
|
3150
|
+
class Ue extends zn {
|
|
3134
3151
|
constructor(e) {
|
|
3135
3152
|
const n = e.maxLength ? Math.min(pi, e.maxLength) : pi, s = e.minLength ? Math.min(e.minLength, n) : void 0;
|
|
3136
3153
|
super({ ...e, maxLength: n, minLength: s });
|
|
@@ -3164,8 +3181,8 @@ class Ue extends vn {
|
|
|
3164
3181
|
return /* @__PURE__ */ r($n, { field: this });
|
|
3165
3182
|
}
|
|
3166
3183
|
}
|
|
3167
|
-
const Dn =
|
|
3168
|
-
function
|
|
3184
|
+
const Dn = Do(), $o = new Set(Dn);
|
|
3185
|
+
function Do(i = !0) {
|
|
3169
3186
|
const t = /* @__PURE__ */ new Set();
|
|
3170
3187
|
for (let e = -12; e <= 14; e++) {
|
|
3171
3188
|
const n = e >= 0 ? "+" : "-", s = Math.abs(e).toString().padStart(2, "0");
|
|
@@ -3178,40 +3195,40 @@ function $o(i = !0) {
|
|
|
3178
3195
|
t.add(`${s}${o}:30`);
|
|
3179
3196
|
}
|
|
3180
3197
|
}
|
|
3181
|
-
return Array.from(t).sort((e, n) =>
|
|
3198
|
+
return Array.from(t).sort((e, n) => Ft(e) - Ft(n));
|
|
3182
3199
|
}
|
|
3183
|
-
function
|
|
3200
|
+
function Ft(i) {
|
|
3184
3201
|
const t = i[0] === "+" ? 1 : -1, e = Number(i.slice(1, 3)), n = Number(i.slice(4, 6));
|
|
3185
3202
|
return t * (e * 60 + n);
|
|
3186
3203
|
}
|
|
3187
|
-
const
|
|
3204
|
+
const Lo = "+00:00", Bo = /^T([01]\d|2[0-3]):([0-5]\d):00([+-]\d{2}:\d{2})$/, ot = (i) => typeof i == "string" && $o.has(i), jo = () => {
|
|
3188
3205
|
const i = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), t = i >= 0 ? "+" : "-", e = Math.abs(i), n = Math.floor(e / 60), s = e % 60, o = `${t}${n.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
|
|
3189
|
-
return
|
|
3206
|
+
return ot(o) ? o : Lo;
|
|
3190
3207
|
};
|
|
3191
|
-
function
|
|
3208
|
+
function Po(i) {
|
|
3192
3209
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(i);
|
|
3193
3210
|
if (!t) throw new Error(`Invalid UTC offset: ${i}`);
|
|
3194
3211
|
return (t[1] === "+" ? 1 : -1) * (Number(t[2]) * 60 + Number(t[3]));
|
|
3195
3212
|
}
|
|
3196
3213
|
const vi = (i) => {
|
|
3197
|
-
const t =
|
|
3214
|
+
const t = Bo.exec(i);
|
|
3198
3215
|
if (!t) return null;
|
|
3199
3216
|
const e = t[3];
|
|
3200
|
-
return
|
|
3217
|
+
return ot(e) ? {
|
|
3201
3218
|
hours: Number(t[1]),
|
|
3202
3219
|
minutes: Number(t[2]),
|
|
3203
3220
|
utcOffset: e
|
|
3204
3221
|
} : null;
|
|
3205
|
-
}, J = (i) => typeof i == "string" && vi(i) !== null,
|
|
3222
|
+
}, J = (i) => typeof i == "string" && vi(i) !== null, kt = (i, t, e = jo()) => {
|
|
3206
3223
|
if (!Number.isInteger(i) || i < 0 || i > 23) throw new Error(`Invalid hour: ${i}`);
|
|
3207
3224
|
if (!Number.isInteger(t) || t < 0 || t > 59) throw new Error(`Invalid minute: ${t}`);
|
|
3208
|
-
if (!
|
|
3225
|
+
if (!ot(e)) throw new Error("Unsupported UTC offset");
|
|
3209
3226
|
const n = i.toString().padStart(2, "0"), s = t.toString().padStart(2, "0");
|
|
3210
3227
|
return `T${n}:${s}:00${e}`;
|
|
3211
3228
|
}, Ji = (i) => `UTC${i}`, ze = (i) => {
|
|
3212
3229
|
const t = vi(i);
|
|
3213
3230
|
if (!t) throw new Error(`Invalid time value: ${i}`);
|
|
3214
|
-
return (t.hours * 60 + t.minutes -
|
|
3231
|
+
return (t.hours * 60 + t.minutes - Po(t.utcOffset) + 1440) % 1440;
|
|
3215
3232
|
}, Ui = (i, t = !0) => {
|
|
3216
3233
|
const e = vi(i);
|
|
3217
3234
|
if (!e) throw new Error(`Invalid time value: ${i}`);
|
|
@@ -3220,7 +3237,7 @@ const vi = (i) => {
|
|
|
3220
3237
|
}, di = (i) => typeof i == "object" && (J(i.from) || J(i.to)), Ln = (i, t) => {
|
|
3221
3238
|
const e = ze(i), n = t.from ? ze(t.from) : null, s = t.to ? ze(t.to) : null;
|
|
3222
3239
|
return n === null && s === null ? !0 : n === null ? e <= s : s === null ? e >= n : n <= s ? e >= n && e <= s : e >= n || e <= s;
|
|
3223
|
-
},
|
|
3240
|
+
}, lt = F((i) => {
|
|
3224
3241
|
const { value: t, onChange: e, onBlur: n, disabled: s, size: o = "md", id: l, name: c, compact: a = !1 } = i, d = t ? vi(t) : null, h = d ? `${d.hours.toString().padStart(2, "0")}:${d.minutes.toString().padStart(2, "0")}` : "", m = f(
|
|
3225
3242
|
(N) => {
|
|
3226
3243
|
const x = N.target.value;
|
|
@@ -3229,12 +3246,12 @@ const vi = (i) => {
|
|
|
3229
3246
|
return;
|
|
3230
3247
|
}
|
|
3231
3248
|
const [z, v] = x.split(":").map(Number);
|
|
3232
|
-
e(
|
|
3249
|
+
e(kt(z, v, d == null ? void 0 : d.utcOffset));
|
|
3233
3250
|
},
|
|
3234
3251
|
[e, d == null ? void 0 : d.utcOffset]
|
|
3235
3252
|
), g = f(
|
|
3236
3253
|
(N) => {
|
|
3237
|
-
d && (e(
|
|
3254
|
+
d && (e(kt(d.hours, d.minutes, N)), n == null || n());
|
|
3238
3255
|
},
|
|
3239
3256
|
[n, e, d]
|
|
3240
3257
|
), b = f(
|
|
@@ -3294,7 +3311,7 @@ const vi = (i) => {
|
|
|
3294
3311
|
] })
|
|
3295
3312
|
] });
|
|
3296
3313
|
});
|
|
3297
|
-
|
|
3314
|
+
lt.displayName = "TimeFieldControl";
|
|
3298
3315
|
const Bn = F((i) => {
|
|
3299
3316
|
const { field: t } = i, { size: e } = R(G), { value: n, name: s, onBlur: o, onChange: l, error: c, disabled: a } = Z({ field: t });
|
|
3300
3317
|
return /* @__PURE__ */ r(
|
|
@@ -3308,7 +3325,7 @@ const Bn = F((i) => {
|
|
|
3308
3325
|
error: c,
|
|
3309
3326
|
image: t.image,
|
|
3310
3327
|
children: /* @__PURE__ */ r(
|
|
3311
|
-
|
|
3328
|
+
lt,
|
|
3312
3329
|
{
|
|
3313
3330
|
id: t.identifier,
|
|
3314
3331
|
name: s,
|
|
@@ -3643,7 +3660,7 @@ const Pn = F((i) => {
|
|
|
3643
3660
|
}
|
|
3644
3661
|
) }),
|
|
3645
3662
|
/* @__PURE__ */ r(
|
|
3646
|
-
|
|
3663
|
+
E,
|
|
3647
3664
|
{
|
|
3648
3665
|
size: e,
|
|
3649
3666
|
variant: "soft",
|
|
@@ -3651,7 +3668,7 @@ const Pn = F((i) => {
|
|
|
3651
3668
|
type: "button",
|
|
3652
3669
|
disabled: n === null,
|
|
3653
3670
|
onClick: g,
|
|
3654
|
-
children: /* @__PURE__ */ r(p, { icon:
|
|
3671
|
+
children: /* @__PURE__ */ r(p, { icon: _s })
|
|
3655
3672
|
}
|
|
3656
3673
|
)
|
|
3657
3674
|
] })
|
|
@@ -3724,21 +3741,21 @@ const Un = {
|
|
|
3724
3741
|
date: Qe,
|
|
3725
3742
|
time: ti,
|
|
3726
3743
|
number: re,
|
|
3727
|
-
boolean:
|
|
3744
|
+
boolean: _e,
|
|
3728
3745
|
select: we,
|
|
3729
3746
|
string: Pe,
|
|
3730
3747
|
url: ni,
|
|
3731
3748
|
text: Ue,
|
|
3732
3749
|
upload: Ge,
|
|
3733
3750
|
qr: ii,
|
|
3734
|
-
"multi-string":
|
|
3751
|
+
"multi-string": Ee,
|
|
3735
3752
|
"multi-select": Ce,
|
|
3736
3753
|
radio: Be,
|
|
3737
3754
|
"checkbox-list": Re,
|
|
3738
3755
|
"pass-fail": Le,
|
|
3739
3756
|
otp: $e,
|
|
3740
3757
|
rating: je
|
|
3741
|
-
},
|
|
3758
|
+
}, Uo = Object.keys(Un), U = {
|
|
3742
3759
|
"checkbox-list": {
|
|
3743
3760
|
description: "Allows the user to select a multiple options from a list.",
|
|
3744
3761
|
group: T.Selection,
|
|
@@ -3808,7 +3825,7 @@ const Un = {
|
|
|
3808
3825
|
rating: {
|
|
3809
3826
|
description: "Allows users to select a rating value.",
|
|
3810
3827
|
group: T.Assessment,
|
|
3811
|
-
icon:
|
|
3828
|
+
icon: fn,
|
|
3812
3829
|
name: "Rating"
|
|
3813
3830
|
},
|
|
3814
3831
|
select: {
|
|
@@ -3841,7 +3858,7 @@ const Un = {
|
|
|
3841
3858
|
icon: Hs,
|
|
3842
3859
|
name: "URL"
|
|
3843
3860
|
}
|
|
3844
|
-
},
|
|
3861
|
+
}, Go = {
|
|
3845
3862
|
[T.Assessment]: { name: "Assessment" },
|
|
3846
3863
|
[T.Capture]: { name: "Capture" },
|
|
3847
3864
|
[T.Numeric]: { name: "Numeric" },
|
|
@@ -3849,7 +3866,7 @@ const Un = {
|
|
|
3849
3866
|
[T.Temporal]: { name: "Temporal" },
|
|
3850
3867
|
[T.Text]: { name: "Text" },
|
|
3851
3868
|
[T.Verification]: { name: "Verification" }
|
|
3852
|
-
}, Ye = 50,
|
|
3869
|
+
}, Ye = 50, Ho = Ye * 1e3, Jo = Ho * 1e3, K = "Unlabelled", Gn = "Unlabelled";
|
|
3853
3870
|
class O {
|
|
3854
3871
|
constructor(t) {
|
|
3855
3872
|
y(this, "id");
|
|
@@ -3864,43 +3881,43 @@ class O {
|
|
|
3864
3881
|
return new O(t);
|
|
3865
3882
|
}
|
|
3866
3883
|
}
|
|
3867
|
-
const
|
|
3884
|
+
const Wo = O.create({
|
|
3868
3885
|
id: "nullable-boolean-equals",
|
|
3869
3886
|
label: "is",
|
|
3870
3887
|
getApplyFn: (i) => (t) => t === i,
|
|
3871
3888
|
serialize: (i) => i,
|
|
3872
3889
|
deserialize: (i) => i
|
|
3873
|
-
}),
|
|
3890
|
+
}), Ko = O.create({
|
|
3874
3891
|
id: "nullable-boolean-not-equals",
|
|
3875
3892
|
label: "is not",
|
|
3876
3893
|
getApplyFn: (i) => (t) => t !== i,
|
|
3877
3894
|
serialize: (i) => i,
|
|
3878
3895
|
deserialize: (i) => i
|
|
3879
|
-
}),
|
|
3896
|
+
}), Xo = O.create({
|
|
3880
3897
|
id: "date-equals",
|
|
3881
3898
|
getApplyFn: (i) => (t) => t.getTime() === i.getTime(),
|
|
3882
3899
|
label: "is",
|
|
3883
3900
|
serialize: (i) => i.toISOString(),
|
|
3884
3901
|
deserialize: (i) => new Date(i)
|
|
3885
|
-
}),
|
|
3902
|
+
}), Yo = O.create({
|
|
3886
3903
|
id: "date-not-equals",
|
|
3887
3904
|
getApplyFn: (i) => (t) => t.getTime() !== i.getTime(),
|
|
3888
3905
|
label: "is not",
|
|
3889
3906
|
serialize: (i) => i.toISOString(),
|
|
3890
3907
|
deserialize: (i) => new Date(i)
|
|
3891
|
-
}),
|
|
3908
|
+
}), Zo = O.create({
|
|
3892
3909
|
id: "date-before",
|
|
3893
3910
|
getApplyFn: (i) => (t) => t.getTime() < i.getTime(),
|
|
3894
3911
|
label: "before",
|
|
3895
3912
|
serialize: (i) => i.toISOString(),
|
|
3896
3913
|
deserialize: (i) => new Date(i)
|
|
3897
|
-
}),
|
|
3914
|
+
}), Qo = O.create({
|
|
3898
3915
|
id: "date-after",
|
|
3899
3916
|
label: "after",
|
|
3900
3917
|
getApplyFn: (i) => (t) => t.getTime() > i.getTime(),
|
|
3901
3918
|
serialize: (i) => i.toISOString(),
|
|
3902
3919
|
deserialize: (i) => new Date(i)
|
|
3903
|
-
}),
|
|
3920
|
+
}), el = O.create({
|
|
3904
3921
|
id: "date-range-in",
|
|
3905
3922
|
label: "in between",
|
|
3906
3923
|
getApplyFn: (i) => (t) => !(i != null && i.from && i.from.getTime() > t.getTime() || i != null && i.to && i.to.getTime() < t.getTime()),
|
|
@@ -3915,7 +3932,7 @@ const Jo = O.create({
|
|
|
3915
3932
|
from: i.from ? new Date(i.from) : void 0,
|
|
3916
3933
|
to: i.to ? new Date(i.to) : void 0
|
|
3917
3934
|
})
|
|
3918
|
-
}),
|
|
3935
|
+
}), il = O.create({
|
|
3919
3936
|
id: "date-range-not-in",
|
|
3920
3937
|
label: "not in between",
|
|
3921
3938
|
getApplyFn: (i) => (t) => !!(i != null && i.from && i.from.getTime() > t.getTime() || i != null && i.to && i.to.getTime() < t.getTime()),
|
|
@@ -3930,13 +3947,13 @@ const Jo = O.create({
|
|
|
3930
3947
|
from: i.from ? new Date(i.from) : void 0,
|
|
3931
3948
|
to: i.to ? new Date(i.to) : void 0
|
|
3932
3949
|
})
|
|
3933
|
-
}),
|
|
3950
|
+
}), tl = O.create({
|
|
3934
3951
|
id: "has-files",
|
|
3935
3952
|
label: "is",
|
|
3936
3953
|
getApplyFn: (i) => (t) => t.length > 0,
|
|
3937
3954
|
serialize: (i) => i,
|
|
3938
3955
|
deserialize: (i) => i
|
|
3939
|
-
}),
|
|
3956
|
+
}), nl = O.create({
|
|
3940
3957
|
id: "does-not-have-files",
|
|
3941
3958
|
label: "is not",
|
|
3942
3959
|
getApplyFn: (i) => (t) => t.length === 0,
|
|
@@ -3990,19 +4007,19 @@ const Jo = O.create({
|
|
|
3990
4007
|
label: "is not between",
|
|
3991
4008
|
serialize: (i) => i,
|
|
3992
4009
|
deserialize: (i) => i
|
|
3993
|
-
}),
|
|
4010
|
+
}), rl = O.create({
|
|
3994
4011
|
id: "pass-fail-equals",
|
|
3995
4012
|
getApplyFn: (i) => (t) => t === i,
|
|
3996
4013
|
label: "is",
|
|
3997
4014
|
serialize: (i) => i,
|
|
3998
4015
|
deserialize: (i) => i
|
|
3999
|
-
}),
|
|
4016
|
+
}), sl = O.create({
|
|
4000
4017
|
id: "pass-fail-not-equals",
|
|
4001
4018
|
getApplyFn: (i) => (t) => t !== i,
|
|
4002
4019
|
label: "is not",
|
|
4003
4020
|
serialize: (i) => i,
|
|
4004
4021
|
deserialize: (i) => i
|
|
4005
|
-
}),
|
|
4022
|
+
}), ol = O.create({
|
|
4006
4023
|
id: "pass-fail-array-includes",
|
|
4007
4024
|
getApplyFn: (i) => {
|
|
4008
4025
|
const t = new Set(i);
|
|
@@ -4011,7 +4028,7 @@ const Jo = O.create({
|
|
|
4011
4028
|
label: "is any of",
|
|
4012
4029
|
serialize: (i) => i,
|
|
4013
4030
|
deserialize: (i) => i
|
|
4014
|
-
}),
|
|
4031
|
+
}), ll = O.create({
|
|
4015
4032
|
id: "pass-fail-array-excludes",
|
|
4016
4033
|
getApplyFn: (i) => {
|
|
4017
4034
|
const t = new Set(i);
|
|
@@ -4062,7 +4079,7 @@ const Jo = O.create({
|
|
|
4062
4079
|
label: "is none of",
|
|
4063
4080
|
serialize: (i) => i,
|
|
4064
4081
|
deserialize: (i) => i
|
|
4065
|
-
}),
|
|
4082
|
+
}), at = O.create({
|
|
4066
4083
|
id: "string-array-every",
|
|
4067
4084
|
getApplyFn: (i) => {
|
|
4068
4085
|
const t = new Set(i);
|
|
@@ -4074,7 +4091,7 @@ const Jo = O.create({
|
|
|
4074
4091
|
label: "has all of",
|
|
4075
4092
|
serialize: (i) => i,
|
|
4076
4093
|
deserialize: (i) => i
|
|
4077
|
-
}),
|
|
4094
|
+
}), dt = O.create({
|
|
4078
4095
|
id: "string-array-some",
|
|
4079
4096
|
getApplyFn: (i) => {
|
|
4080
4097
|
const t = new Set(i);
|
|
@@ -4086,7 +4103,7 @@ const Jo = O.create({
|
|
|
4086
4103
|
label: "has any of",
|
|
4087
4104
|
serialize: (i) => i,
|
|
4088
4105
|
deserialize: (i) => i
|
|
4089
|
-
}),
|
|
4106
|
+
}), ct = O.create({
|
|
4090
4107
|
id: "string-array-none",
|
|
4091
4108
|
getApplyFn: (i) => {
|
|
4092
4109
|
const t = new Set(i);
|
|
@@ -4098,7 +4115,7 @@ const Jo = O.create({
|
|
|
4098
4115
|
label: "has none of",
|
|
4099
4116
|
serialize: (i) => i,
|
|
4100
4117
|
deserialize: (i) => i
|
|
4101
|
-
}),
|
|
4118
|
+
}), ut = O.create({
|
|
4102
4119
|
id: "string-array-equals",
|
|
4103
4120
|
getApplyFn: (i) => {
|
|
4104
4121
|
const t = new Set(i);
|
|
@@ -4110,7 +4127,7 @@ const Jo = O.create({
|
|
|
4110
4127
|
label: "is",
|
|
4111
4128
|
serialize: (i) => i,
|
|
4112
4129
|
deserialize: (i) => i
|
|
4113
|
-
}),
|
|
4130
|
+
}), ht = O.create({
|
|
4114
4131
|
id: "string-array-not-equals",
|
|
4115
4132
|
getApplyFn: (i) => {
|
|
4116
4133
|
const t = new Set(i);
|
|
@@ -4122,37 +4139,37 @@ const Jo = O.create({
|
|
|
4122
4139
|
label: "is not",
|
|
4123
4140
|
serialize: (i) => i,
|
|
4124
4141
|
deserialize: (i) => i
|
|
4125
|
-
}),
|
|
4142
|
+
}), al = O.create({
|
|
4126
4143
|
id: "time-equals",
|
|
4127
4144
|
label: "is",
|
|
4128
4145
|
getApplyFn: (i) => (t) => t === i,
|
|
4129
4146
|
serialize: (i) => i,
|
|
4130
4147
|
deserialize: (i) => i
|
|
4131
|
-
}),
|
|
4148
|
+
}), dl = O.create({
|
|
4132
4149
|
id: "time-not-equals",
|
|
4133
4150
|
label: "is not",
|
|
4134
4151
|
getApplyFn: (i) => (t) => t !== i,
|
|
4135
4152
|
serialize: (i) => i,
|
|
4136
4153
|
deserialize: (i) => i
|
|
4137
|
-
}),
|
|
4154
|
+
}), cl = O.create({
|
|
4138
4155
|
id: "time-before",
|
|
4139
4156
|
label: "before",
|
|
4140
4157
|
getApplyFn: (i) => (t) => ze(t) < ze(i),
|
|
4141
4158
|
serialize: (i) => i,
|
|
4142
4159
|
deserialize: (i) => i
|
|
4143
|
-
}),
|
|
4160
|
+
}), ul = O.create({
|
|
4144
4161
|
id: "time-after",
|
|
4145
4162
|
label: "after",
|
|
4146
4163
|
getApplyFn: (i) => (t) => ze(t) > ze(i),
|
|
4147
4164
|
serialize: (i) => i,
|
|
4148
4165
|
deserialize: (i) => i
|
|
4149
|
-
}),
|
|
4166
|
+
}), hl = O.create({
|
|
4150
4167
|
id: "time-range-in",
|
|
4151
4168
|
label: "in between",
|
|
4152
4169
|
getApplyFn: (i) => (t) => Ln(t, i),
|
|
4153
4170
|
serialize: (i) => i,
|
|
4154
4171
|
deserialize: (i) => i
|
|
4155
|
-
}),
|
|
4172
|
+
}), fl = O.create({
|
|
4156
4173
|
id: "time-range-not-in",
|
|
4157
4174
|
label: "not in between",
|
|
4158
4175
|
getApplyFn: (i) => (t) => !Ln(t, i),
|
|
@@ -4226,7 +4243,7 @@ const tr = F, Fe = tr(function(i) {
|
|
|
4226
4243
|
[e]
|
|
4227
4244
|
);
|
|
4228
4245
|
return /* @__PURE__ */ r(V.MultiSelectItem, { ref: t, ...n, children: s });
|
|
4229
|
-
}),
|
|
4246
|
+
}), ft = F((i) => {
|
|
4230
4247
|
const { ref: t, children: e, ...n } = i, s = f(
|
|
4231
4248
|
(o) => typeof e == "function" ? /* @__PURE__ */ u(H, { children: [
|
|
4232
4249
|
e(o),
|
|
@@ -4239,7 +4256,7 @@ const tr = F, Fe = tr(function(i) {
|
|
|
4239
4256
|
);
|
|
4240
4257
|
return /* @__PURE__ */ r(V.SelectAllItem, { ref: t, ...n, children: s });
|
|
4241
4258
|
});
|
|
4242
|
-
|
|
4259
|
+
ft.displayName = "SelectAllItemTemplate";
|
|
4243
4260
|
const ee = (i) => {
|
|
4244
4261
|
const { children: t, condition: e, size: n = "sm", variant: s, accentColor: o, radius: l } = i, c = f(
|
|
4245
4262
|
(a) => {
|
|
@@ -4255,7 +4272,7 @@ const ee = (i) => {
|
|
|
4255
4272
|
const { children: t, open: e, onOpenChange: n, defaultOpen: s, modal: o, size: l, align: c, accentColor: a = "base", ...d } = i;
|
|
4256
4273
|
return /* @__PURE__ */ u(j.Root, { open: e, onOpenChange: n, defaultOpen: s, modal: o, children: [
|
|
4257
4274
|
/* @__PURE__ */ r(j.Trigger, { asChild: !0, children: t }),
|
|
4258
|
-
/* @__PURE__ */ r(j.Content, { size: l, align: c, children: /* @__PURE__ */ r(
|
|
4275
|
+
/* @__PURE__ */ r(j.Content, { size: l, align: c, children: /* @__PURE__ */ r(Ht, { size: l, accentColor: a, ...d }) })
|
|
4259
4276
|
] });
|
|
4260
4277
|
});
|
|
4261
4278
|
ci.displayName = "DayPickerPopover";
|
|
@@ -4303,7 +4320,7 @@ const rr = F((i) => {
|
|
|
4303
4320
|
}
|
|
4304
4321
|
) }),
|
|
4305
4322
|
/* @__PURE__ */ r(
|
|
4306
|
-
|
|
4323
|
+
E,
|
|
4307
4324
|
{
|
|
4308
4325
|
size: "sm",
|
|
4309
4326
|
accentColor: "base",
|
|
@@ -4324,7 +4341,7 @@ const rr = F((i) => {
|
|
|
4324
4341
|
children: [
|
|
4325
4342
|
/* @__PURE__ */ r("span", { className: "truncate", children: I }),
|
|
4326
4343
|
/* @__PURE__ */ r(
|
|
4327
|
-
|
|
4344
|
+
E,
|
|
4328
4345
|
{
|
|
4329
4346
|
size: "xs",
|
|
4330
4347
|
variant: "ghost",
|
|
@@ -4390,24 +4407,24 @@ const X = (i) => {
|
|
|
4390
4407
|
const { condition: t, onClick: e, ...n } = i, s = f(() => {
|
|
4391
4408
|
e(t);
|
|
4392
4409
|
}, [t, e]);
|
|
4393
|
-
return /* @__PURE__ */ r(
|
|
4410
|
+
return /* @__PURE__ */ r(E, { onClick: s, ...n, children: /* @__PURE__ */ r(p, { icon: ve }) });
|
|
4394
4411
|
};
|
|
4395
4412
|
X.displayName = "RemoveConditionButton";
|
|
4396
4413
|
const li = F((i) => {
|
|
4397
|
-
const { ref: t, selectFieldOptions: e, ...n } = i, s =
|
|
4414
|
+
const { ref: t, selectFieldOptions: e, ...n } = i, s = _(() => e.map(
|
|
4398
4415
|
(o) => typeof o == "string" ? {
|
|
4399
4416
|
value: o,
|
|
4400
4417
|
label: o
|
|
4401
4418
|
} : o
|
|
4402
4419
|
), [e]);
|
|
4403
4420
|
return /* @__PURE__ */ u(V.MultiSelectGroup, { ref: t, ...n, children: [
|
|
4404
|
-
/* @__PURE__ */ r(
|
|
4421
|
+
/* @__PURE__ */ r(ft, { children: "Select all" }),
|
|
4405
4422
|
s.map((o) => /* @__PURE__ */ r(nr, { value: o.value, children: /* @__PURE__ */ r("span", { className: "truncate", children: o.label }) }, o.value))
|
|
4406
4423
|
] });
|
|
4407
4424
|
});
|
|
4408
4425
|
li.displayName = "SelectFieldOptionMultiSelectGroup";
|
|
4409
|
-
const
|
|
4410
|
-
const { ref: t, selectFieldOptions: e, ...n } = i, s =
|
|
4426
|
+
const mt = F((i) => {
|
|
4427
|
+
const { ref: t, selectFieldOptions: e, ...n } = i, s = _(() => e.map(
|
|
4411
4428
|
(o) => typeof o == "string" ? {
|
|
4412
4429
|
value: o,
|
|
4413
4430
|
label: o
|
|
@@ -4415,7 +4432,7 @@ const ft = F((i) => {
|
|
|
4415
4432
|
), [e]);
|
|
4416
4433
|
return /* @__PURE__ */ r(V.SelectGroup, { ref: t, ...n, children: s.map((o) => /* @__PURE__ */ r(Fe, { value: o.value, children: /* @__PURE__ */ r("span", { className: "truncate", children: o.label }) }, o.value)) });
|
|
4417
4434
|
});
|
|
4418
|
-
|
|
4435
|
+
mt.displayName = "SelectFieldOptionSelectGroup";
|
|
4419
4436
|
const We = F((i) => {
|
|
4420
4437
|
const {
|
|
4421
4438
|
children: t,
|
|
@@ -4470,11 +4487,11 @@ const ui = F((i) => {
|
|
|
4470
4487
|
} = i;
|
|
4471
4488
|
return /* @__PURE__ */ u(j.Root, { open: e, onOpenChange: n, defaultOpen: s, modal: o, children: [
|
|
4472
4489
|
/* @__PURE__ */ r(j.Trigger, { asChild: !0, children: t }),
|
|
4473
|
-
/* @__PURE__ */ r(j.Content, { size: l, onClick: Ve, accentColor: c, ...h, children: /* @__PURE__ */ r(
|
|
4490
|
+
/* @__PURE__ */ r(j.Content, { size: l, onClick: Ve, accentColor: c, ...h, children: /* @__PURE__ */ r(lt, { compact: !0, size: l, value: a, onChange: d }) })
|
|
4474
4491
|
] });
|
|
4475
4492
|
});
|
|
4476
4493
|
ui.displayName = "TimeInputPopover";
|
|
4477
|
-
const
|
|
4494
|
+
const ml = (i) => {
|
|
4478
4495
|
const { condition: t, onRemove: e } = i, n = t.getConditionValue(), s = t.getConditionModifier(), o = () => {
|
|
4479
4496
|
switch (n) {
|
|
4480
4497
|
case void 0:
|
|
@@ -4510,15 +4527,15 @@ const fl = (i) => {
|
|
|
4510
4527
|
] }),
|
|
4511
4528
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
4512
4529
|
] });
|
|
4513
|
-
},
|
|
4530
|
+
}, Mt = {
|
|
4514
4531
|
equals: C({
|
|
4515
|
-
modifier:
|
|
4532
|
+
modifier: Wo,
|
|
4516
4533
|
isValueValid: (i) => !0,
|
|
4517
4534
|
isConditionValueValid: (i) => !0,
|
|
4518
4535
|
isSerializedValueValid: (i) => !0
|
|
4519
4536
|
}),
|
|
4520
4537
|
notEquals: C({
|
|
4521
|
-
modifier:
|
|
4538
|
+
modifier: Ko,
|
|
4522
4539
|
isValueValid: (i) => !0,
|
|
4523
4540
|
isConditionValueValid: (i) => !0,
|
|
4524
4541
|
isSerializedValueValid: (i) => !0
|
|
@@ -4527,18 +4544,18 @@ const fl = (i) => {
|
|
|
4527
4544
|
class zi extends Q {
|
|
4528
4545
|
constructor(e) {
|
|
4529
4546
|
super(e);
|
|
4530
|
-
y(this, "modifiers",
|
|
4547
|
+
y(this, "modifiers", Mt);
|
|
4531
4548
|
}
|
|
4532
4549
|
static deserialize(e, n) {
|
|
4533
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
4550
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Mt[o];
|
|
4534
4551
|
let a;
|
|
4535
4552
|
return s !== void 0 && (a = c.modifier.deserialize(s)), new zi({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
4536
4553
|
}
|
|
4537
4554
|
render(e) {
|
|
4538
|
-
return /* @__PURE__ */ r(
|
|
4555
|
+
return /* @__PURE__ */ r(ml, { condition: this, ...e }, this.id);
|
|
4539
4556
|
}
|
|
4540
4557
|
}
|
|
4541
|
-
const Ke = [],
|
|
4558
|
+
const Ke = [], pl = (i) => {
|
|
4542
4559
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = f(
|
|
4543
4560
|
(a) => {
|
|
4544
4561
|
a.length > 0 ? t.setConditionValue(a) : t.setConditionValue(void 0);
|
|
@@ -4573,33 +4590,33 @@ const Ke = [], ml = (i) => {
|
|
|
4573
4590
|
] }),
|
|
4574
4591
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
4575
4592
|
] });
|
|
4576
|
-
},
|
|
4593
|
+
}, qt = {
|
|
4577
4594
|
equals: C({
|
|
4578
|
-
modifier:
|
|
4595
|
+
modifier: ut,
|
|
4579
4596
|
isValueValid: (i) => !0,
|
|
4580
4597
|
isConditionValueValid: (i) => !0,
|
|
4581
4598
|
isSerializedValueValid: (i) => !0
|
|
4582
4599
|
}),
|
|
4583
4600
|
notEquals: C({
|
|
4584
|
-
modifier:
|
|
4601
|
+
modifier: ht,
|
|
4585
4602
|
isValueValid: (i) => !0,
|
|
4586
4603
|
isConditionValueValid: (i) => !0,
|
|
4587
4604
|
isSerializedValueValid: (i) => !0
|
|
4588
4605
|
}),
|
|
4589
4606
|
every: C({
|
|
4590
|
-
modifier:
|
|
4607
|
+
modifier: at,
|
|
4591
4608
|
isValueValid: (i) => !0,
|
|
4592
4609
|
isConditionValueValid: (i) => !0,
|
|
4593
4610
|
isSerializedValueValid: (i) => !0
|
|
4594
4611
|
}),
|
|
4595
4612
|
some: C({
|
|
4596
|
-
modifier:
|
|
4613
|
+
modifier: dt,
|
|
4597
4614
|
isValueValid: (i) => !0,
|
|
4598
4615
|
isConditionValueValid: (i) => !0,
|
|
4599
4616
|
isSerializedValueValid: (i) => !0
|
|
4600
4617
|
}),
|
|
4601
4618
|
none: C({
|
|
4602
|
-
modifier:
|
|
4619
|
+
modifier: ct,
|
|
4603
4620
|
isValueValid: (i) => !0,
|
|
4604
4621
|
isConditionValueValid: (i) => !0,
|
|
4605
4622
|
isSerializedValueValid: (i) => !0
|
|
@@ -4608,17 +4625,17 @@ const Ke = [], ml = (i) => {
|
|
|
4608
4625
|
class Si extends Q {
|
|
4609
4626
|
constructor(e) {
|
|
4610
4627
|
super(e);
|
|
4611
|
-
y(this, "modifiers",
|
|
4628
|
+
y(this, "modifiers", qt);
|
|
4612
4629
|
}
|
|
4613
4630
|
static deserialize(e, n) {
|
|
4614
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
4631
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = qt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
4615
4632
|
return new Si({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
4616
4633
|
}
|
|
4617
4634
|
render(e) {
|
|
4618
|
-
return /* @__PURE__ */ r(
|
|
4635
|
+
return /* @__PURE__ */ r(pl, { condition: this, ...e }, this.id);
|
|
4619
4636
|
}
|
|
4620
4637
|
}
|
|
4621
|
-
class
|
|
4638
|
+
class pt extends bi {
|
|
4622
4639
|
constructor(e) {
|
|
4623
4640
|
super();
|
|
4624
4641
|
y(this, "conditions");
|
|
@@ -4651,10 +4668,10 @@ class mt extends bi {
|
|
|
4651
4668
|
return this.conditions.length === 0 ? !0 : this.conditions.map((s) => [s.getApplyFn(), s.accessorFn]).every(([s, o]) => s(o(e)));
|
|
4652
4669
|
}
|
|
4653
4670
|
}
|
|
4654
|
-
const
|
|
4655
|
-
const e = new
|
|
4671
|
+
const Va = (i, t) => _(() => {
|
|
4672
|
+
const e = new pt(i);
|
|
4656
4673
|
return e.observe((n) => t(n.getConditions())), e;
|
|
4657
|
-
}, [i, t]),
|
|
4674
|
+
}, [i, t]), gl = (i) => {
|
|
4658
4675
|
const { condition: t, onRemove: e } = i, n = t.getConditionValue(), s = t.getConditionModifier(), o = () => {
|
|
4659
4676
|
var l, c;
|
|
4660
4677
|
switch (s) {
|
|
@@ -4714,39 +4731,39 @@ const ga = (i, t) => E(() => {
|
|
|
4714
4731
|
o(),
|
|
4715
4732
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
4716
4733
|
] });
|
|
4717
|
-
},
|
|
4734
|
+
}, Ot = {
|
|
4718
4735
|
equals: C({
|
|
4719
|
-
modifier:
|
|
4736
|
+
modifier: Xo,
|
|
4720
4737
|
isValueValid: (i) => i instanceof Date,
|
|
4721
4738
|
isConditionValueValid: (i) => i instanceof Date,
|
|
4722
4739
|
isSerializedValueValid: (i) => typeof i == "string"
|
|
4723
4740
|
}),
|
|
4724
4741
|
notEquals: C({
|
|
4725
|
-
modifier:
|
|
4742
|
+
modifier: Yo,
|
|
4726
4743
|
isValueValid: (i) => i instanceof Date,
|
|
4727
4744
|
isConditionValueValid: (i) => i instanceof Date,
|
|
4728
4745
|
isSerializedValueValid: (i) => typeof i == "string"
|
|
4729
4746
|
}),
|
|
4730
4747
|
before: C({
|
|
4731
|
-
modifier:
|
|
4748
|
+
modifier: Zo,
|
|
4732
4749
|
isValueValid: (i) => i instanceof Date,
|
|
4733
4750
|
isConditionValueValid: (i) => i instanceof Date,
|
|
4734
4751
|
isSerializedValueValid: (i) => typeof i == "string"
|
|
4735
4752
|
}),
|
|
4736
4753
|
after: C({
|
|
4737
|
-
modifier:
|
|
4754
|
+
modifier: Qo,
|
|
4738
4755
|
isValueValid: (i) => i instanceof Date,
|
|
4739
4756
|
isConditionValueValid: (i) => i instanceof Date,
|
|
4740
4757
|
isSerializedValueValid: (i) => typeof i == "string"
|
|
4741
4758
|
}),
|
|
4742
4759
|
in: C({
|
|
4743
|
-
modifier:
|
|
4760
|
+
modifier: el,
|
|
4744
4761
|
isValueValid: (i) => i instanceof Date,
|
|
4745
4762
|
isConditionValueValid: (i) => "to" in (i ?? {}) && "from" in (i ?? {}),
|
|
4746
4763
|
isSerializedValueValid: (i) => typeof i == "object" && "to" in i && "from" in i
|
|
4747
4764
|
}),
|
|
4748
4765
|
notIn: C({
|
|
4749
|
-
modifier:
|
|
4766
|
+
modifier: il,
|
|
4750
4767
|
isValueValid: (i) => i instanceof Date,
|
|
4751
4768
|
isConditionValueValid: (i) => "to" in (i ?? {}) && "from" in (i ?? {}),
|
|
4752
4769
|
isSerializedValueValid: (i) => typeof i == "object" && "to" in i && "from" in i
|
|
@@ -4755,20 +4772,20 @@ const ga = (i, t) => E(() => {
|
|
|
4755
4772
|
class xi extends Q {
|
|
4756
4773
|
constructor(e) {
|
|
4757
4774
|
super(e);
|
|
4758
|
-
y(this, "modifiers",
|
|
4775
|
+
y(this, "modifiers", Ot);
|
|
4759
4776
|
}
|
|
4760
4777
|
static deserialize(e, n) {
|
|
4761
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
4778
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Ot[o], a = s !== void 0 && c.isSerializedValueValid(s) ? (
|
|
4762
4779
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
4763
4780
|
c.modifier.deserialize(s)
|
|
4764
4781
|
) : void 0;
|
|
4765
4782
|
return new xi({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
4766
4783
|
}
|
|
4767
4784
|
render(e) {
|
|
4768
|
-
return /* @__PURE__ */ r(
|
|
4785
|
+
return /* @__PURE__ */ r(gl, { condition: this, ...e }, this.id);
|
|
4769
4786
|
}
|
|
4770
4787
|
}
|
|
4771
|
-
const
|
|
4788
|
+
const Vl = (i) => {
|
|
4772
4789
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = f(
|
|
4773
4790
|
(a) => {
|
|
4774
4791
|
a.length > 0 ? t.setConditionValue(a) : t.setConditionValue(void 0);
|
|
@@ -4803,33 +4820,33 @@ const gl = (i) => {
|
|
|
4803
4820
|
] }),
|
|
4804
4821
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
4805
4822
|
] });
|
|
4806
|
-
},
|
|
4823
|
+
}, It = {
|
|
4807
4824
|
equals: C({
|
|
4808
|
-
modifier:
|
|
4825
|
+
modifier: ut,
|
|
4809
4826
|
isValueValid: (i) => !0,
|
|
4810
4827
|
isConditionValueValid: (i) => !0,
|
|
4811
4828
|
isSerializedValueValid: (i) => !0
|
|
4812
4829
|
}),
|
|
4813
4830
|
notEquals: C({
|
|
4814
|
-
modifier:
|
|
4831
|
+
modifier: ht,
|
|
4815
4832
|
isValueValid: (i) => !0,
|
|
4816
4833
|
isConditionValueValid: (i) => !0,
|
|
4817
4834
|
isSerializedValueValid: (i) => !0
|
|
4818
4835
|
}),
|
|
4819
4836
|
every: C({
|
|
4820
|
-
modifier:
|
|
4837
|
+
modifier: at,
|
|
4821
4838
|
isValueValid: (i) => !0,
|
|
4822
4839
|
isConditionValueValid: (i) => !0,
|
|
4823
4840
|
isSerializedValueValid: (i) => !0
|
|
4824
4841
|
}),
|
|
4825
4842
|
some: C({
|
|
4826
|
-
modifier:
|
|
4843
|
+
modifier: dt,
|
|
4827
4844
|
isValueValid: (i) => !0,
|
|
4828
4845
|
isConditionValueValid: (i) => !0,
|
|
4829
4846
|
isSerializedValueValid: (i) => !0
|
|
4830
4847
|
}),
|
|
4831
4848
|
none: C({
|
|
4832
|
-
modifier:
|
|
4849
|
+
modifier: ct,
|
|
4833
4850
|
isValueValid: (i) => !0,
|
|
4834
4851
|
isConditionValueValid: (i) => !0,
|
|
4835
4852
|
isSerializedValueValid: (i) => !0
|
|
@@ -4838,17 +4855,17 @@ const gl = (i) => {
|
|
|
4838
4855
|
class wi extends Q {
|
|
4839
4856
|
constructor(e) {
|
|
4840
4857
|
super(e);
|
|
4841
|
-
y(this, "modifiers",
|
|
4858
|
+
y(this, "modifiers", It);
|
|
4842
4859
|
}
|
|
4843
4860
|
static deserialize(e, n) {
|
|
4844
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
4861
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = It[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
4845
4862
|
return new wi({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
4846
4863
|
}
|
|
4847
4864
|
render(e) {
|
|
4848
|
-
return /* @__PURE__ */ r(
|
|
4865
|
+
return /* @__PURE__ */ r(Vl, { condition: this, ...e }, this.id);
|
|
4849
4866
|
}
|
|
4850
4867
|
}
|
|
4851
|
-
const
|
|
4868
|
+
const yl = (i) => {
|
|
4852
4869
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = f(
|
|
4853
4870
|
(a) => {
|
|
4854
4871
|
t.setConditionValue(a.length > 0 ? a : void 0);
|
|
@@ -4875,33 +4892,33 @@ const Vl = (i) => {
|
|
|
4875
4892
|
/* @__PURE__ */ r(rr, { values: s ?? Ke, onValuesChange: l, children: /* @__PURE__ */ r(w, { type: "button", className: "truncate", children: c() }) }),
|
|
4876
4893
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
4877
4894
|
] });
|
|
4878
|
-
},
|
|
4895
|
+
}, At = {
|
|
4879
4896
|
equals: C({
|
|
4880
|
-
modifier:
|
|
4897
|
+
modifier: ut,
|
|
4881
4898
|
isValueValid: (i) => !0,
|
|
4882
4899
|
isConditionValueValid: (i) => !0,
|
|
4883
4900
|
isSerializedValueValid: (i) => !0
|
|
4884
4901
|
}),
|
|
4885
4902
|
notEquals: C({
|
|
4886
|
-
modifier:
|
|
4903
|
+
modifier: ht,
|
|
4887
4904
|
isValueValid: (i) => !0,
|
|
4888
4905
|
isConditionValueValid: (i) => !0,
|
|
4889
4906
|
isSerializedValueValid: (i) => !0
|
|
4890
4907
|
}),
|
|
4891
4908
|
every: C({
|
|
4892
|
-
modifier:
|
|
4909
|
+
modifier: at,
|
|
4893
4910
|
isValueValid: (i) => !0,
|
|
4894
4911
|
isConditionValueValid: (i) => !0,
|
|
4895
4912
|
isSerializedValueValid: (i) => !0
|
|
4896
4913
|
}),
|
|
4897
4914
|
some: C({
|
|
4898
|
-
modifier:
|
|
4915
|
+
modifier: dt,
|
|
4899
4916
|
isValueValid: (i) => !0,
|
|
4900
4917
|
isConditionValueValid: (i) => !0,
|
|
4901
4918
|
isSerializedValueValid: (i) => !0
|
|
4902
4919
|
}),
|
|
4903
4920
|
none: C({
|
|
4904
|
-
modifier:
|
|
4921
|
+
modifier: ct,
|
|
4905
4922
|
isValueValid: (i) => !0,
|
|
4906
4923
|
isConditionValueValid: (i) => !0,
|
|
4907
4924
|
isSerializedValueValid: (i) => !0
|
|
@@ -4910,17 +4927,17 @@ const Vl = (i) => {
|
|
|
4910
4927
|
class Ni extends Q {
|
|
4911
4928
|
constructor(e) {
|
|
4912
4929
|
super(e);
|
|
4913
|
-
y(this, "modifiers",
|
|
4930
|
+
y(this, "modifiers", At);
|
|
4914
4931
|
}
|
|
4915
4932
|
static deserialize(e, n) {
|
|
4916
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
4933
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = At[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
4917
4934
|
return new Ni({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
4918
4935
|
}
|
|
4919
4936
|
render(e) {
|
|
4920
|
-
return /* @__PURE__ */ r(
|
|
4937
|
+
return /* @__PURE__ */ r(yl, { condition: this, ...e }, this.id);
|
|
4921
4938
|
}
|
|
4922
4939
|
}
|
|
4923
|
-
const
|
|
4940
|
+
const bl = (i) => {
|
|
4924
4941
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = f(
|
|
4925
4942
|
(a) => {
|
|
4926
4943
|
t.setConditionValue(a ?? void 0);
|
|
@@ -4989,7 +5006,7 @@ const yl = (i) => {
|
|
|
4989
5006
|
c(),
|
|
4990
5007
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
4991
5008
|
] });
|
|
4992
|
-
},
|
|
5009
|
+
}, Tt = {
|
|
4993
5010
|
equals: C({
|
|
4994
5011
|
modifier: Hn,
|
|
4995
5012
|
isValueValid: (i) => typeof i == "number",
|
|
@@ -5042,20 +5059,20 @@ const yl = (i) => {
|
|
|
5042
5059
|
class Fi extends Q {
|
|
5043
5060
|
constructor(e) {
|
|
5044
5061
|
super(e);
|
|
5045
|
-
y(this, "modifiers",
|
|
5062
|
+
y(this, "modifiers", Tt);
|
|
5046
5063
|
}
|
|
5047
5064
|
static deserialize(e, n) {
|
|
5048
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5065
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Tt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? (
|
|
5049
5066
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
5050
5067
|
c.modifier.deserialize(s)
|
|
5051
5068
|
) : void 0;
|
|
5052
5069
|
return new Fi({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5053
5070
|
}
|
|
5054
5071
|
render(e) {
|
|
5055
|
-
return /* @__PURE__ */ r(
|
|
5072
|
+
return /* @__PURE__ */ r(bl, { condition: this, ...e }, this.id);
|
|
5056
5073
|
}
|
|
5057
5074
|
}
|
|
5058
|
-
const
|
|
5075
|
+
const Cl = (i) => {
|
|
5059
5076
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5060
5077
|
switch (o) {
|
|
5061
5078
|
case "equals":
|
|
@@ -5082,7 +5099,7 @@ const bl = (i) => {
|
|
|
5082
5099
|
l(),
|
|
5083
5100
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5084
5101
|
] });
|
|
5085
|
-
},
|
|
5102
|
+
}, Et = {
|
|
5086
5103
|
equals: C({
|
|
5087
5104
|
modifier: qe,
|
|
5088
5105
|
isValueValid: (i) => !0,
|
|
@@ -5111,17 +5128,17 @@ const bl = (i) => {
|
|
|
5111
5128
|
class ki extends Q {
|
|
5112
5129
|
constructor(e) {
|
|
5113
5130
|
super(e);
|
|
5114
|
-
y(this, "modifiers",
|
|
5131
|
+
y(this, "modifiers", Et);
|
|
5115
5132
|
}
|
|
5116
5133
|
static deserialize(e, n) {
|
|
5117
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5134
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Et[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
5118
5135
|
return new ki({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5119
5136
|
}
|
|
5120
5137
|
render(e) {
|
|
5121
|
-
return /* @__PURE__ */ r(
|
|
5138
|
+
return /* @__PURE__ */ r(Cl, { condition: this, ...e }, this.id);
|
|
5122
5139
|
}
|
|
5123
5140
|
}
|
|
5124
|
-
const
|
|
5141
|
+
const vl = (i) => {
|
|
5125
5142
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5126
5143
|
switch (o) {
|
|
5127
5144
|
case "equals":
|
|
@@ -5154,7 +5171,7 @@ const Cl = (i) => {
|
|
|
5154
5171
|
values: a ?? Ke,
|
|
5155
5172
|
onValuesChange: t.setConditionValue,
|
|
5156
5173
|
children: [
|
|
5157
|
-
/* @__PURE__ */ r(
|
|
5174
|
+
/* @__PURE__ */ r(ft, { children: "Select all" }),
|
|
5158
5175
|
ei.map((d) => {
|
|
5159
5176
|
const { label: h, icon: m } = Te[d];
|
|
5160
5177
|
return /* @__PURE__ */ u(nr, { value: d, children: [
|
|
@@ -5180,25 +5197,25 @@ const Cl = (i) => {
|
|
|
5180
5197
|
] });
|
|
5181
5198
|
}, _t = {
|
|
5182
5199
|
equals: C({
|
|
5183
|
-
modifier:
|
|
5200
|
+
modifier: rl,
|
|
5184
5201
|
isValueValid: (i) => i !== null,
|
|
5185
5202
|
isConditionValueValid: (i) => typeof i == "string",
|
|
5186
5203
|
isSerializedValueValid: (i) => typeof i == "string"
|
|
5187
5204
|
}),
|
|
5188
5205
|
notEquals: C({
|
|
5189
|
-
modifier:
|
|
5206
|
+
modifier: sl,
|
|
5190
5207
|
isValueValid: (i) => i !== null,
|
|
5191
5208
|
isConditionValueValid: (i) => typeof i == "string",
|
|
5192
5209
|
isSerializedValueValid: (i) => typeof i == "string"
|
|
5193
5210
|
}),
|
|
5194
5211
|
includes: C({
|
|
5195
|
-
modifier:
|
|
5212
|
+
modifier: ol,
|
|
5196
5213
|
isValueValid: (i) => i !== null,
|
|
5197
5214
|
isConditionValueValid: (i) => Array.isArray(i),
|
|
5198
5215
|
isSerializedValueValid: (i) => Array.isArray(i)
|
|
5199
5216
|
}),
|
|
5200
5217
|
excludes: C({
|
|
5201
|
-
modifier:
|
|
5218
|
+
modifier: ll,
|
|
5202
5219
|
isValueValid: (i) => i !== null,
|
|
5203
5220
|
isConditionValueValid: (i) => Array.isArray(i),
|
|
5204
5221
|
isSerializedValueValid: (i) => Array.isArray(i)
|
|
@@ -5220,16 +5237,16 @@ class Mi extends Q {
|
|
|
5220
5237
|
return e.status;
|
|
5221
5238
|
}
|
|
5222
5239
|
render(e) {
|
|
5223
|
-
return /* @__PURE__ */ r(
|
|
5240
|
+
return /* @__PURE__ */ r(vl, { condition: this, ...e }, this.id);
|
|
5224
5241
|
}
|
|
5225
5242
|
}
|
|
5226
|
-
const
|
|
5227
|
-
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l =
|
|
5243
|
+
const zl = (i) => {
|
|
5244
|
+
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = _(() => n.options.map(
|
|
5228
5245
|
(d) => typeof d == "string" ? {
|
|
5229
5246
|
value: d,
|
|
5230
5247
|
label: d
|
|
5231
5248
|
} : d
|
|
5232
|
-
), [n.options]), c =
|
|
5249
|
+
), [n.options]), c = _(() => {
|
|
5233
5250
|
const d = {};
|
|
5234
5251
|
for (const h of l)
|
|
5235
5252
|
d[h.value] = h.label;
|
|
@@ -5242,7 +5259,7 @@ const vl = (i) => {
|
|
|
5242
5259
|
return /* @__PURE__ */ u(V.Root, { children: [
|
|
5243
5260
|
/* @__PURE__ */ r(V.ClickTrigger, { children: /* @__PURE__ */ r(w, { type: "button", className: "shrink-1 min-w-0 grow", children: /* @__PURE__ */ r("span", { className: "truncate", children: h !== void 0 ? h ? c[h] : "empty" : "..." }) }) }),
|
|
5244
5261
|
/* @__PURE__ */ r(V.Content, { size: "sm", children: /* @__PURE__ */ r(
|
|
5245
|
-
|
|
5262
|
+
mt,
|
|
5246
5263
|
{
|
|
5247
5264
|
required: !0,
|
|
5248
5265
|
selectFieldOptions: n.options,
|
|
@@ -5278,7 +5295,7 @@ const vl = (i) => {
|
|
|
5278
5295
|
a(),
|
|
5279
5296
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5280
5297
|
] });
|
|
5281
|
-
},
|
|
5298
|
+
}, Rt = {
|
|
5282
5299
|
equals: C({
|
|
5283
5300
|
modifier: qe,
|
|
5284
5301
|
isValueValid: (i) => typeof i == "string",
|
|
@@ -5307,20 +5324,20 @@ const vl = (i) => {
|
|
|
5307
5324
|
class qi extends Q {
|
|
5308
5325
|
constructor(e) {
|
|
5309
5326
|
super(e);
|
|
5310
|
-
y(this, "modifiers",
|
|
5327
|
+
y(this, "modifiers", Rt);
|
|
5311
5328
|
}
|
|
5312
5329
|
static deserialize(e, n) {
|
|
5313
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5330
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Rt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? (
|
|
5314
5331
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
5315
5332
|
c.modifier.deserialize(s)
|
|
5316
5333
|
) : void 0;
|
|
5317
5334
|
return new qi({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5318
5335
|
}
|
|
5319
5336
|
render(e) {
|
|
5320
|
-
return /* @__PURE__ */ r(
|
|
5337
|
+
return /* @__PURE__ */ r(zl, { condition: this, ...e }, this.id);
|
|
5321
5338
|
}
|
|
5322
5339
|
}
|
|
5323
|
-
const
|
|
5340
|
+
const Sl = (i) => {
|
|
5324
5341
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5325
5342
|
switch (o) {
|
|
5326
5343
|
case "equals":
|
|
@@ -5385,7 +5402,7 @@ const zl = (i) => {
|
|
|
5385
5402
|
l(),
|
|
5386
5403
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5387
5404
|
] });
|
|
5388
|
-
},
|
|
5405
|
+
}, $t = {
|
|
5389
5406
|
equals: C({
|
|
5390
5407
|
modifier: Hn,
|
|
5391
5408
|
isValueValid: (i) => typeof i == "number",
|
|
@@ -5438,20 +5455,20 @@ const zl = (i) => {
|
|
|
5438
5455
|
class Oi extends Q {
|
|
5439
5456
|
constructor(e) {
|
|
5440
5457
|
super(e);
|
|
5441
|
-
y(this, "modifiers",
|
|
5458
|
+
y(this, "modifiers", $t);
|
|
5442
5459
|
}
|
|
5443
5460
|
static deserialize(e, n) {
|
|
5444
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5461
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = $t[o], a = s !== void 0 && c.isSerializedValueValid(s) ? (
|
|
5445
5462
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
5446
5463
|
c.modifier.deserialize(s)
|
|
5447
5464
|
) : void 0;
|
|
5448
5465
|
return new Oi({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5449
5466
|
}
|
|
5450
5467
|
render(e) {
|
|
5451
|
-
return /* @__PURE__ */ r(
|
|
5468
|
+
return /* @__PURE__ */ r(Sl, { condition: this, ...e }, this.id);
|
|
5452
5469
|
}
|
|
5453
5470
|
}
|
|
5454
|
-
const
|
|
5471
|
+
const xl = (i) => {
|
|
5455
5472
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5456
5473
|
switch (o) {
|
|
5457
5474
|
case "equals":
|
|
@@ -5478,7 +5495,7 @@ const Sl = (i) => {
|
|
|
5478
5495
|
l(),
|
|
5479
5496
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5480
5497
|
] });
|
|
5481
|
-
},
|
|
5498
|
+
}, Dt = {
|
|
5482
5499
|
equals: C({
|
|
5483
5500
|
modifier: qe,
|
|
5484
5501
|
isValueValid: (i) => !0,
|
|
@@ -5507,23 +5524,23 @@ const Sl = (i) => {
|
|
|
5507
5524
|
class Ii extends Q {
|
|
5508
5525
|
constructor(e) {
|
|
5509
5526
|
super(e);
|
|
5510
|
-
y(this, "modifiers",
|
|
5527
|
+
y(this, "modifiers", Dt);
|
|
5511
5528
|
}
|
|
5512
5529
|
static deserialize(e, n) {
|
|
5513
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5530
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Dt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
5514
5531
|
return new Ii({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5515
5532
|
}
|
|
5516
5533
|
render(e) {
|
|
5517
|
-
return /* @__PURE__ */ r(
|
|
5534
|
+
return /* @__PURE__ */ r(xl, { condition: this, ...e }, this.id);
|
|
5518
5535
|
}
|
|
5519
5536
|
}
|
|
5520
|
-
const
|
|
5521
|
-
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l =
|
|
5537
|
+
const wl = (i) => {
|
|
5538
|
+
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = _(() => n.options.map(
|
|
5522
5539
|
(h) => typeof h == "string" ? {
|
|
5523
5540
|
value: h,
|
|
5524
5541
|
label: h
|
|
5525
5542
|
} : h
|
|
5526
|
-
), [n.options]), c =
|
|
5543
|
+
), [n.options]), c = _(() => {
|
|
5527
5544
|
const h = {};
|
|
5528
5545
|
for (const m of l)
|
|
5529
5546
|
h[m.value] = m.label;
|
|
@@ -5541,7 +5558,7 @@ const xl = (i) => {
|
|
|
5541
5558
|
return /* @__PURE__ */ u(V.Root, { children: [
|
|
5542
5559
|
/* @__PURE__ */ r(V.ClickTrigger, { children: /* @__PURE__ */ r(w, { type: "button", className: "shrink-1 min-w-0 grow", children: /* @__PURE__ */ r("span", { className: "truncate", children: m !== void 0 ? m ? c[m] : "empty" : "..." }) }) }),
|
|
5543
5560
|
/* @__PURE__ */ r(V.Content, { size: "sm", children: /* @__PURE__ */ r(
|
|
5544
|
-
|
|
5561
|
+
mt,
|
|
5545
5562
|
{
|
|
5546
5563
|
required: !1,
|
|
5547
5564
|
selectFieldOptions: n.options,
|
|
@@ -5577,7 +5594,7 @@ const xl = (i) => {
|
|
|
5577
5594
|
d(),
|
|
5578
5595
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5579
5596
|
] });
|
|
5580
|
-
},
|
|
5597
|
+
}, Lt = {
|
|
5581
5598
|
equals: C({
|
|
5582
5599
|
modifier: qe,
|
|
5583
5600
|
isValueValid: (i) => typeof i == "string",
|
|
@@ -5606,20 +5623,20 @@ const xl = (i) => {
|
|
|
5606
5623
|
class Ai extends Q {
|
|
5607
5624
|
constructor(e) {
|
|
5608
5625
|
super(e);
|
|
5609
|
-
y(this, "modifiers",
|
|
5626
|
+
y(this, "modifiers", Lt);
|
|
5610
5627
|
}
|
|
5611
5628
|
static deserialize(e, n) {
|
|
5612
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5629
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Lt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? (
|
|
5613
5630
|
// @ts-expect-error calling isSerializedValueValid means conditionValue is of appropriate type
|
|
5614
5631
|
c.modifier.deserialize(s)
|
|
5615
5632
|
) : void 0;
|
|
5616
5633
|
return new Ai({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5617
5634
|
}
|
|
5618
5635
|
render(e) {
|
|
5619
|
-
return /* @__PURE__ */ r(
|
|
5636
|
+
return /* @__PURE__ */ r(wl, { condition: this, ...e }, this.id);
|
|
5620
5637
|
}
|
|
5621
5638
|
}
|
|
5622
|
-
const
|
|
5639
|
+
const Nl = (i) => {
|
|
5623
5640
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5624
5641
|
switch (o) {
|
|
5625
5642
|
case "equals":
|
|
@@ -5646,7 +5663,7 @@ const wl = (i) => {
|
|
|
5646
5663
|
l(),
|
|
5647
5664
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5648
5665
|
] });
|
|
5649
|
-
},
|
|
5666
|
+
}, Bt = {
|
|
5650
5667
|
equals: C({
|
|
5651
5668
|
modifier: qe,
|
|
5652
5669
|
isValueValid: (i) => !0,
|
|
@@ -5675,17 +5692,17 @@ const wl = (i) => {
|
|
|
5675
5692
|
class Ti extends Q {
|
|
5676
5693
|
constructor(e) {
|
|
5677
5694
|
super(e);
|
|
5678
|
-
y(this, "modifiers",
|
|
5695
|
+
y(this, "modifiers", Bt);
|
|
5679
5696
|
}
|
|
5680
5697
|
static deserialize(e, n) {
|
|
5681
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5698
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Bt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
5682
5699
|
return new Ti({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5683
5700
|
}
|
|
5684
5701
|
render(e) {
|
|
5685
|
-
return /* @__PURE__ */ r(
|
|
5702
|
+
return /* @__PURE__ */ r(Nl, { condition: this, ...e }, this.id);
|
|
5686
5703
|
}
|
|
5687
5704
|
}
|
|
5688
|
-
const
|
|
5705
|
+
const Fl = (i) => {
|
|
5689
5706
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5690
5707
|
switch (o) {
|
|
5691
5708
|
case "equals":
|
|
@@ -5712,7 +5729,7 @@ const Nl = (i) => {
|
|
|
5712
5729
|
l(),
|
|
5713
5730
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5714
5731
|
] });
|
|
5715
|
-
},
|
|
5732
|
+
}, jt = {
|
|
5716
5733
|
equals: C({
|
|
5717
5734
|
modifier: qe,
|
|
5718
5735
|
isValueValid: (i) => !0,
|
|
@@ -5738,20 +5755,20 @@ const Nl = (i) => {
|
|
|
5738
5755
|
isSerializedValueValid: (i) => !0
|
|
5739
5756
|
})
|
|
5740
5757
|
};
|
|
5741
|
-
class
|
|
5758
|
+
class Ei extends Q {
|
|
5742
5759
|
constructor(e) {
|
|
5743
5760
|
super(e);
|
|
5744
|
-
y(this, "modifiers",
|
|
5761
|
+
y(this, "modifiers", jt);
|
|
5745
5762
|
}
|
|
5746
5763
|
static deserialize(e, n) {
|
|
5747
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5748
|
-
return new
|
|
5764
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = jt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
5765
|
+
return new Ei({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5749
5766
|
}
|
|
5750
5767
|
render(e) {
|
|
5751
|
-
return /* @__PURE__ */ r(
|
|
5768
|
+
return /* @__PURE__ */ r(Fl, { condition: this, ...e }, this.id);
|
|
5752
5769
|
}
|
|
5753
5770
|
}
|
|
5754
|
-
const
|
|
5771
|
+
const kl = (i) => {
|
|
5755
5772
|
const { condition: t, onRemove: e } = i, n = t.getConditionValue(), s = t.getConditionModifier(), o = () => {
|
|
5756
5773
|
switch (s) {
|
|
5757
5774
|
case "equals":
|
|
@@ -5806,61 +5823,61 @@ const Fl = (i) => {
|
|
|
5806
5823
|
o(),
|
|
5807
5824
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5808
5825
|
] });
|
|
5809
|
-
},
|
|
5826
|
+
}, Pt = {
|
|
5810
5827
|
equals: C({
|
|
5811
|
-
modifier:
|
|
5828
|
+
modifier: al,
|
|
5812
5829
|
isValueValid: (i) => J(i),
|
|
5813
5830
|
isConditionValueValid: (i) => J(i),
|
|
5814
5831
|
isSerializedValueValid: (i) => J(i)
|
|
5815
5832
|
}),
|
|
5816
5833
|
notEquals: C({
|
|
5817
|
-
modifier:
|
|
5834
|
+
modifier: dl,
|
|
5818
5835
|
isValueValid: (i) => J(i),
|
|
5819
5836
|
isConditionValueValid: (i) => J(i),
|
|
5820
5837
|
isSerializedValueValid: (i) => J(i)
|
|
5821
5838
|
}),
|
|
5822
5839
|
before: C({
|
|
5823
|
-
modifier:
|
|
5840
|
+
modifier: cl,
|
|
5824
5841
|
isValueValid: (i) => J(i),
|
|
5825
5842
|
isConditionValueValid: (i) => J(i),
|
|
5826
5843
|
isSerializedValueValid: (i) => J(i)
|
|
5827
5844
|
}),
|
|
5828
5845
|
after: C({
|
|
5829
|
-
modifier:
|
|
5846
|
+
modifier: ul,
|
|
5830
5847
|
isValueValid: (i) => J(i),
|
|
5831
5848
|
isConditionValueValid: (i) => J(i),
|
|
5832
5849
|
isSerializedValueValid: (i) => J(i)
|
|
5833
5850
|
}),
|
|
5834
5851
|
in: C({
|
|
5835
|
-
modifier:
|
|
5852
|
+
modifier: hl,
|
|
5836
5853
|
isValueValid: (i) => J(i),
|
|
5837
5854
|
isConditionValueValid: (i) => di(i),
|
|
5838
5855
|
isSerializedValueValid: (i) => di(i)
|
|
5839
5856
|
}),
|
|
5840
5857
|
notIn: C({
|
|
5841
|
-
modifier:
|
|
5858
|
+
modifier: fl,
|
|
5842
5859
|
isValueValid: (i) => J(i),
|
|
5843
5860
|
isConditionValueValid: (i) => di(i),
|
|
5844
5861
|
isSerializedValueValid: (i) => di(i)
|
|
5845
5862
|
})
|
|
5846
5863
|
};
|
|
5847
|
-
class
|
|
5864
|
+
class _i extends Q {
|
|
5848
5865
|
constructor(e) {
|
|
5849
5866
|
super(e);
|
|
5850
|
-
y(this, "modifiers",
|
|
5867
|
+
y(this, "modifiers", Pt);
|
|
5851
5868
|
}
|
|
5852
5869
|
static deserialize(e, n) {
|
|
5853
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5870
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Pt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? (
|
|
5854
5871
|
// @ts-expect-error validation narrows the value for the selected modifier
|
|
5855
5872
|
c.modifier.deserialize(s)
|
|
5856
5873
|
) : void 0;
|
|
5857
|
-
return new
|
|
5874
|
+
return new _i({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5858
5875
|
}
|
|
5859
5876
|
render(e) {
|
|
5860
|
-
return /* @__PURE__ */ r(
|
|
5877
|
+
return /* @__PURE__ */ r(kl, { condition: this, ...e }, this.id);
|
|
5861
5878
|
}
|
|
5862
5879
|
}
|
|
5863
|
-
const
|
|
5880
|
+
const Ml = (i) => {
|
|
5864
5881
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5865
5882
|
switch (s) {
|
|
5866
5883
|
case void 0:
|
|
@@ -5896,15 +5913,15 @@ const kl = (i) => {
|
|
|
5896
5913
|
] }),
|
|
5897
5914
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5898
5915
|
] });
|
|
5899
|
-
},
|
|
5916
|
+
}, Ut = {
|
|
5900
5917
|
equals: C({
|
|
5901
|
-
modifier:
|
|
5918
|
+
modifier: tl,
|
|
5902
5919
|
isValueValid: (i) => !0,
|
|
5903
5920
|
isConditionValueValid: (i) => !0,
|
|
5904
5921
|
isSerializedValueValid: (i) => !0
|
|
5905
5922
|
}),
|
|
5906
5923
|
notEquals: C({
|
|
5907
|
-
modifier:
|
|
5924
|
+
modifier: nl,
|
|
5908
5925
|
isValueValid: (i) => !0,
|
|
5909
5926
|
isConditionValueValid: (i) => !0,
|
|
5910
5927
|
isSerializedValueValid: (i) => !0
|
|
@@ -5913,17 +5930,17 @@ const kl = (i) => {
|
|
|
5913
5930
|
class Ri extends Q {
|
|
5914
5931
|
constructor(e) {
|
|
5915
5932
|
super(e);
|
|
5916
|
-
y(this, "modifiers",
|
|
5933
|
+
y(this, "modifiers", Ut);
|
|
5917
5934
|
}
|
|
5918
5935
|
static deserialize(e, n) {
|
|
5919
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
5936
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Ut[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
5920
5937
|
return new Ri({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5921
5938
|
}
|
|
5922
5939
|
render(e) {
|
|
5923
|
-
return /* @__PURE__ */ r(
|
|
5940
|
+
return /* @__PURE__ */ r(Ml, { condition: this, ...e }, this.id);
|
|
5924
5941
|
}
|
|
5925
5942
|
}
|
|
5926
|
-
const
|
|
5943
|
+
const ql = (i) => {
|
|
5927
5944
|
const { condition: t, onRemove: e } = i, n = t.field, s = t.getConditionValue(), o = t.getConditionModifier(), l = () => {
|
|
5928
5945
|
switch (o) {
|
|
5929
5946
|
case "equals":
|
|
@@ -5950,7 +5967,7 @@ const Ml = (i) => {
|
|
|
5950
5967
|
l(),
|
|
5951
5968
|
/* @__PURE__ */ r(X, { condition: t, onClick: e })
|
|
5952
5969
|
] });
|
|
5953
|
-
},
|
|
5970
|
+
}, Gt = {
|
|
5954
5971
|
equals: C({
|
|
5955
5972
|
modifier: qe,
|
|
5956
5973
|
isValueValid: (i) => !0,
|
|
@@ -5979,28 +5996,28 @@ const Ml = (i) => {
|
|
|
5979
5996
|
class $i extends Q {
|
|
5980
5997
|
constructor(e) {
|
|
5981
5998
|
super(e);
|
|
5982
|
-
y(this, "modifiers",
|
|
5999
|
+
y(this, "modifiers", Gt);
|
|
5983
6000
|
}
|
|
5984
6001
|
transformValue(e) {
|
|
5985
6002
|
return (e == null ? void 0 : e.toString()) ?? "";
|
|
5986
6003
|
}
|
|
5987
6004
|
static deserialize(e, n) {
|
|
5988
|
-
const { conditionValue: s, conditionModifier: o, ...l } = e, c =
|
|
6005
|
+
const { conditionValue: s, conditionModifier: o, ...l } = e, c = Gt[o], a = s !== void 0 && c.isSerializedValueValid(s) ? c.modifier.deserialize(s) : void 0;
|
|
5989
6006
|
return new $i({ field: n, conditionModifier: o, conditionValue: a, ...l });
|
|
5990
6007
|
}
|
|
5991
6008
|
render(e) {
|
|
5992
|
-
return /* @__PURE__ */ r(
|
|
6009
|
+
return /* @__PURE__ */ r(ql, { condition: this, ...e }, this.id);
|
|
5993
6010
|
}
|
|
5994
6011
|
}
|
|
5995
|
-
const
|
|
6012
|
+
const Ol = {
|
|
5996
6013
|
date: xi,
|
|
5997
|
-
time:
|
|
6014
|
+
time: _i,
|
|
5998
6015
|
number: Fi,
|
|
5999
6016
|
boolean: zi,
|
|
6000
6017
|
select: Ai,
|
|
6001
6018
|
string: Ti,
|
|
6002
6019
|
url: $i,
|
|
6003
|
-
text:
|
|
6020
|
+
text: Ei,
|
|
6004
6021
|
upload: Ri,
|
|
6005
6022
|
qr: Ii,
|
|
6006
6023
|
"multi-string": Ni,
|
|
@@ -6010,32 +6027,32 @@ const ql = {
|
|
|
6010
6027
|
"pass-fail": Mi,
|
|
6011
6028
|
otp: ki,
|
|
6012
6029
|
rating: Oi
|
|
6013
|
-
},
|
|
6030
|
+
}, Il = (i, t) => {
|
|
6014
6031
|
if (i.type !== t.type)
|
|
6015
6032
|
throw new Error(`field and condition type mismatch ${i.type} !== ${t.type}`);
|
|
6016
|
-
return
|
|
6033
|
+
return Ol[t.type].deserialize(t, i);
|
|
6017
6034
|
}, sr = (i, t) => {
|
|
6018
6035
|
const e = or(i, t), n = {};
|
|
6019
6036
|
for (const s of i)
|
|
6020
6037
|
n[s.identifier] = s;
|
|
6021
6038
|
return e.map(
|
|
6022
|
-
(s) =>
|
|
6039
|
+
(s) => Il(n[s.fieldId], s)
|
|
6023
6040
|
);
|
|
6024
|
-
},
|
|
6041
|
+
}, Al = (i, t) => lr(i, t).map((n) => n.serialize()), or = (i, t) => {
|
|
6025
6042
|
const e = new Set(i.map((n) => n.identifier));
|
|
6026
6043
|
return t.filter((n) => e.has(n.fieldId));
|
|
6027
6044
|
}, lr = (i, t) => {
|
|
6028
6045
|
const e = new Set(i.map((n) => n.identifier));
|
|
6029
6046
|
return t.filter((n) => e.has(n.field.identifier));
|
|
6030
|
-
},
|
|
6031
|
-
function Va(i) {
|
|
6032
|
-
return i.map(Al);
|
|
6033
|
-
}
|
|
6034
|
-
const Al = (i) => i.type === "section" ? ae.deserialize(i) : pt(i);
|
|
6047
|
+
}, gt = (i) => Un[i.type].deserialize(i);
|
|
6035
6048
|
function ya(i) {
|
|
6036
|
-
return i.map(
|
|
6049
|
+
return i.map(Tl);
|
|
6037
6050
|
}
|
|
6051
|
+
const Tl = (i) => i.type === "section" ? ae.deserialize(i) : gt(i);
|
|
6038
6052
|
function ba(i) {
|
|
6053
|
+
return i.map(gt);
|
|
6054
|
+
}
|
|
6055
|
+
function Ca(i) {
|
|
6039
6056
|
const t = [];
|
|
6040
6057
|
for (const e of i)
|
|
6041
6058
|
if (e instanceof ae)
|
|
@@ -6045,14 +6062,14 @@ function ba(i) {
|
|
|
6045
6062
|
t.push(e);
|
|
6046
6063
|
return t;
|
|
6047
6064
|
}
|
|
6048
|
-
function
|
|
6065
|
+
function va(i) {
|
|
6049
6066
|
const t = {};
|
|
6050
6067
|
for (const e of i)
|
|
6051
6068
|
t[e.identifier] = e;
|
|
6052
6069
|
return t;
|
|
6053
6070
|
}
|
|
6054
|
-
function
|
|
6055
|
-
const n = e ?
|
|
6071
|
+
function El(i, t, e = !0) {
|
|
6072
|
+
const n = e ? Vt(i, t) : t, s = {};
|
|
6056
6073
|
for (const o of i) {
|
|
6057
6074
|
if (!(o.identifier in n)) continue;
|
|
6058
6075
|
const l = n[o.identifier];
|
|
@@ -6069,7 +6086,7 @@ function _l(i, t, e = !0) {
|
|
|
6069
6086
|
}
|
|
6070
6087
|
return s;
|
|
6071
6088
|
}
|
|
6072
|
-
function
|
|
6089
|
+
function Vt(i, t) {
|
|
6073
6090
|
const e = {};
|
|
6074
6091
|
for (const n of i) {
|
|
6075
6092
|
if (!(n.identifier in t)) continue;
|
|
@@ -6087,8 +6104,8 @@ function ar(i, t) {
|
|
|
6087
6104
|
}
|
|
6088
6105
|
return e;
|
|
6089
6106
|
}
|
|
6090
|
-
function
|
|
6091
|
-
const e =
|
|
6107
|
+
function Rl(i, t) {
|
|
6108
|
+
const e = Vt(i, t), n = {}, s = {};
|
|
6092
6109
|
for (const o of i) {
|
|
6093
6110
|
if (!(o.identifier in e)) continue;
|
|
6094
6111
|
const l = e[o.identifier];
|
|
@@ -6110,7 +6127,7 @@ function El(i, t) {
|
|
|
6110
6127
|
}
|
|
6111
6128
|
return [n, s];
|
|
6112
6129
|
}
|
|
6113
|
-
function
|
|
6130
|
+
function $l(i, t, e) {
|
|
6114
6131
|
const n = {};
|
|
6115
6132
|
for (const s of i) {
|
|
6116
6133
|
if (!(s.identifier in t)) continue;
|
|
@@ -6134,21 +6151,21 @@ function Rl(i, t, e) {
|
|
|
6134
6151
|
}
|
|
6135
6152
|
return n;
|
|
6136
6153
|
}
|
|
6137
|
-
const
|
|
6154
|
+
const Dl = (i, t) => {
|
|
6138
6155
|
const e = {};
|
|
6139
6156
|
for (const n of i) {
|
|
6140
6157
|
const s = t[n.identifier];
|
|
6141
6158
|
e[n.identifier] = s !== void 0 ? s : n.blankValue();
|
|
6142
6159
|
}
|
|
6143
6160
|
return e;
|
|
6144
|
-
},
|
|
6161
|
+
}, Ll = (i, t, e) => {
|
|
6145
6162
|
const n = {};
|
|
6146
6163
|
for (const s of i) {
|
|
6147
6164
|
const o = t[s.identifier], l = e[s.identifier];
|
|
6148
6165
|
s.areValuesEqual(o, l) || (n[s.identifier] = l);
|
|
6149
6166
|
}
|
|
6150
6167
|
return n;
|
|
6151
|
-
},
|
|
6168
|
+
}, Bl = (i, t, e) => {
|
|
6152
6169
|
const n = {};
|
|
6153
6170
|
for (const s of i) {
|
|
6154
6171
|
const o = t[s.identifier], l = e[s.identifier];
|
|
@@ -6163,7 +6180,7 @@ const $l = (i, t) => {
|
|
|
6163
6180
|
for (const e of i)
|
|
6164
6181
|
t[e.identifier] = e.blankValue();
|
|
6165
6182
|
return t;
|
|
6166
|
-
},
|
|
6183
|
+
}, jl = (i, t) => dr(i, t, cr(i)), Pl = Ki(["flex", "flex-col"], {
|
|
6167
6184
|
variants: {
|
|
6168
6185
|
size: {
|
|
6169
6186
|
xs: ["gap-2"],
|
|
@@ -6173,7 +6190,7 @@ const $l = (i, t) => {
|
|
|
6173
6190
|
xl: ["gap-10"]
|
|
6174
6191
|
}
|
|
6175
6192
|
}
|
|
6176
|
-
}),
|
|
6193
|
+
}), yt = Ki(["flex", "flex-col"], {
|
|
6177
6194
|
variants: {
|
|
6178
6195
|
size: {
|
|
6179
6196
|
xs: ["gap-2"],
|
|
@@ -6184,23 +6201,23 @@ const $l = (i, t) => {
|
|
|
6184
6201
|
}
|
|
6185
6202
|
}
|
|
6186
6203
|
}), ur = F((i) => {
|
|
6187
|
-
const { fieldSection: t } = i, { label: e, description: n } = t, s =
|
|
6204
|
+
const { fieldSection: t } = i, { label: e, description: n } = t, s = Kt(), { fieldSchema: o, size: l } = R(G), c = _(() => o.getFieldSections(), [o]), a = _(() => c.findIndex(({ identifier: g }) => g === t.identifier), [c, t.identifier]), d = _(() => c.filter((g) => t.identifier in g.conditions), [c, t.identifier]), h = _(() => d.length === 0 ? !0 : d.some((g) => {
|
|
6188
6205
|
const b = g.getConditions(t.identifier);
|
|
6189
|
-
return new
|
|
6206
|
+
return new pt(b).applyConditions(s);
|
|
6190
6207
|
}), [d, t, s]), m = Hi(t.fields);
|
|
6191
6208
|
return h ? /* @__PURE__ */ u(H, { children: [
|
|
6192
6209
|
a !== 0 ? /* @__PURE__ */ r(xe, { size: "full" }) : null,
|
|
6193
6210
|
/* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
6194
6211
|
(e || n) && /* @__PURE__ */ r(H, { children: /* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
|
|
6195
|
-
/* @__PURE__ */ r(
|
|
6212
|
+
/* @__PURE__ */ r(Er, { size: l, children: e }),
|
|
6196
6213
|
n && /* @__PURE__ */ r(D, { accentColor: "base", size: l, children: n })
|
|
6197
6214
|
] }) }),
|
|
6198
|
-
/* @__PURE__ */ r("div", { className:
|
|
6215
|
+
/* @__PURE__ */ r("div", { className: yt({ size: l }), children: m })
|
|
6199
6216
|
] })
|
|
6200
6217
|
] }) : null;
|
|
6201
6218
|
});
|
|
6202
6219
|
ur.displayName = "FieldSectionLayout";
|
|
6203
|
-
const Ze = class Ze extends
|
|
6220
|
+
const Ze = class Ze extends pn {
|
|
6204
6221
|
constructor(e) {
|
|
6205
6222
|
const { label: n = null, description: s = null, fields: o, conditions: l = {}, ...c } = e;
|
|
6206
6223
|
super(c);
|
|
@@ -6333,14 +6350,14 @@ const Ze = class Ze extends mn {
|
|
|
6333
6350
|
}
|
|
6334
6351
|
};
|
|
6335
6352
|
y(Ze, "deserialize", (e) => {
|
|
6336
|
-
const n = e.fields.map(
|
|
6353
|
+
const n = e.fields.map(gt), s = {};
|
|
6337
6354
|
for (const [o, l] of Object.entries(e.conditions))
|
|
6338
6355
|
s[o] = sr(n, l);
|
|
6339
6356
|
return new Ze({ ...e, fields: n, conditions: s });
|
|
6340
6357
|
});
|
|
6341
6358
|
let ae = Ze;
|
|
6342
6359
|
const me = gi({}), Di = F((i) => {
|
|
6343
|
-
const { children: t, variant: e, size: n, accentColor: s, onSelectFieldType: o, ...l } = i, c =
|
|
6360
|
+
const { children: t, variant: e, size: n, accentColor: s, onSelectFieldType: o, ...l } = i, c = _(() => {
|
|
6344
6361
|
const a = {
|
|
6345
6362
|
[T.Assessment]: [],
|
|
6346
6363
|
[T.Capture]: [],
|
|
@@ -6350,7 +6367,7 @@ const me = gi({}), Di = F((i) => {
|
|
|
6350
6367
|
[T.Text]: [],
|
|
6351
6368
|
[T.Verification]: []
|
|
6352
6369
|
};
|
|
6353
|
-
for (const d of
|
|
6370
|
+
for (const d of Uo) {
|
|
6354
6371
|
const { group: h } = U[d];
|
|
6355
6372
|
a[h].push(d);
|
|
6356
6373
|
}
|
|
@@ -6359,7 +6376,7 @@ const me = gi({}), Di = F((i) => {
|
|
|
6359
6376
|
return /* @__PURE__ */ u(V.Root, { ...l, children: [
|
|
6360
6377
|
/* @__PURE__ */ r(V.ClickTrigger, { children: t }),
|
|
6361
6378
|
/* @__PURE__ */ r(V.Content, { variant: e, size: n, accentColor: s, children: /* @__PURE__ */ r(V.Scroll, { children: Object.entries(c).map(([a, d]) => {
|
|
6362
|
-
const { name: h } =
|
|
6379
|
+
const { name: h } = Go[a];
|
|
6363
6380
|
return d.length === 0 ? null : /* @__PURE__ */ u(V.Group, { children: [
|
|
6364
6381
|
/* @__PURE__ */ r(V.Label, { children: h }),
|
|
6365
6382
|
d.map((m) => /* @__PURE__ */ r(
|
|
@@ -6385,12 +6402,12 @@ const hr = F((i) => {
|
|
|
6385
6402
|
] });
|
|
6386
6403
|
});
|
|
6387
6404
|
hr.displayName = "CreateFieldDropdownMenuItem";
|
|
6388
|
-
const
|
|
6405
|
+
const bt = (i) => {
|
|
6389
6406
|
switch (i) {
|
|
6390
6407
|
case "text":
|
|
6391
6408
|
return new Ue({ label: "", required: !1, identifier: M() });
|
|
6392
6409
|
case "boolean":
|
|
6393
|
-
return new
|
|
6410
|
+
return new _e({
|
|
6394
6411
|
label: "",
|
|
6395
6412
|
required: !1,
|
|
6396
6413
|
identifier: M()
|
|
@@ -6433,7 +6450,7 @@ const yt = (i) => {
|
|
|
6433
6450
|
identifier: M()
|
|
6434
6451
|
});
|
|
6435
6452
|
case "multi-string":
|
|
6436
|
-
return new
|
|
6453
|
+
return new Ee({
|
|
6437
6454
|
label: "",
|
|
6438
6455
|
required: !1,
|
|
6439
6456
|
identifier: M()
|
|
@@ -6500,7 +6517,7 @@ const yt = (i) => {
|
|
|
6500
6517
|
}, fr = (i) => {
|
|
6501
6518
|
switch (i.type) {
|
|
6502
6519
|
case "text":
|
|
6503
|
-
return new
|
|
6520
|
+
return new Ei({ id: M(), conditionValue: void 0, conditionModifier: "equals", field: i });
|
|
6504
6521
|
case "boolean":
|
|
6505
6522
|
return new zi({
|
|
6506
6523
|
id: M(),
|
|
@@ -6523,7 +6540,7 @@ const yt = (i) => {
|
|
|
6523
6540
|
field: i
|
|
6524
6541
|
});
|
|
6525
6542
|
case "time":
|
|
6526
|
-
return new
|
|
6543
|
+
return new _i({
|
|
6527
6544
|
id: M(),
|
|
6528
6545
|
conditionValue: void 0,
|
|
6529
6546
|
conditionModifier: "equals",
|
|
@@ -6648,7 +6665,7 @@ const yt = (i) => {
|
|
|
6648
6665
|
/* @__PURE__ */ r(p, { icon: uo }),
|
|
6649
6666
|
"Settings"
|
|
6650
6667
|
] }) }),
|
|
6651
|
-
/* @__PURE__ */ r(j.Content, { size: "sm", ...e, children: /* @__PURE__ */ r("div", { className: ke("flex w-full max-w-[350px] flex-col",
|
|
6668
|
+
/* @__PURE__ */ r(j.Content, { size: "sm", ...e, children: /* @__PURE__ */ r("div", { className: ke("flex w-full max-w-[350px] flex-col", yt({ size: "sm" })), children: t }) })
|
|
6652
6669
|
] });
|
|
6653
6670
|
});
|
|
6654
6671
|
pr.displayName = "FieldSettingsPopover";
|
|
@@ -6659,7 +6676,7 @@ const gr = F((i) => {
|
|
|
6659
6676
|
}, [n]);
|
|
6660
6677
|
const a = f(() => {
|
|
6661
6678
|
n.setOptions({ image: void 0 });
|
|
6662
|
-
}, [n]), [d, h] =
|
|
6679
|
+
}, [n]), [d, h] = _(() => {
|
|
6663
6680
|
const S = [], k = [], B = mr(n.type, `${t}.${e}`) ?? [];
|
|
6664
6681
|
for (const Y of B)
|
|
6665
6682
|
Y.showDirectly ? S.push(Y.field) : k.push(Y.field);
|
|
@@ -6716,7 +6733,7 @@ const gr = F((i) => {
|
|
|
6716
6733
|
}
|
|
6717
6734
|
),
|
|
6718
6735
|
/* @__PURE__ */ r(
|
|
6719
|
-
|
|
6736
|
+
E,
|
|
6720
6737
|
{
|
|
6721
6738
|
type: "button",
|
|
6722
6739
|
className: "group-hover:not-disabled:flex absolute right-2 top-2 hidden",
|
|
@@ -6752,14 +6769,14 @@ const gr = F((i) => {
|
|
|
6752
6769
|
}
|
|
6753
6770
|
)
|
|
6754
6771
|
] }),
|
|
6755
|
-
d.length > 0 && /* @__PURE__ */ r("div", { className: ke("w-full",
|
|
6772
|
+
d.length > 0 && /* @__PURE__ */ r("div", { className: ke("w-full", yt({ size: "sm" })), children: m })
|
|
6756
6773
|
] });
|
|
6757
6774
|
});
|
|
6758
6775
|
gr.displayName = "FieldBuilder";
|
|
6759
|
-
const
|
|
6776
|
+
const Ct = F((i) => {
|
|
6760
6777
|
const { field: t, fieldSection: e, fieldIndex: n, sectionIndex: s } = i, o = Vi(null), l = `fields.${s}.fields`, c = f(
|
|
6761
6778
|
(x) => {
|
|
6762
|
-
e.addField(
|
|
6779
|
+
e.addField(bt(x), n + 1);
|
|
6763
6780
|
},
|
|
6764
6781
|
[n, e]
|
|
6765
6782
|
), a = f(() => {
|
|
@@ -6776,7 +6793,7 @@ const bt = F((i) => {
|
|
|
6776
6793
|
if (!z || z.length !== 1) return;
|
|
6777
6794
|
const v = z.item(0);
|
|
6778
6795
|
if (v) {
|
|
6779
|
-
if (v.size >
|
|
6796
|
+
if (v.size > Jo) {
|
|
6780
6797
|
ie.error({
|
|
6781
6798
|
title: "File upload error",
|
|
6782
6799
|
description: `The file ${v.name} exceeded the maximum file size`
|
|
@@ -6802,25 +6819,25 @@ const bt = F((i) => {
|
|
|
6802
6819
|
return /* @__PURE__ */ u(fe, { className: "flex w-full items-center justify-between gap-4", size: "sm", children: [
|
|
6803
6820
|
/* @__PURE__ */ r(gr, { fieldIndex: n, field: t, parentPath: l }),
|
|
6804
6821
|
/* @__PURE__ */ u($, { className: "flex flex-col gap-0.5", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
6805
|
-
/* @__PURE__ */ r(Di, { onSelectFieldType: c, size: "sm", children: /* @__PURE__ */ r(
|
|
6806
|
-
/* @__PURE__ */ r(
|
|
6807
|
-
/* @__PURE__ */ r(
|
|
6808
|
-
/* @__PURE__ */ r(
|
|
6809
|
-
/* @__PURE__ */ r(
|
|
6810
|
-
/* @__PURE__ */ r(
|
|
6822
|
+
/* @__PURE__ */ r(Di, { onSelectFieldType: c, size: "sm", children: /* @__PURE__ */ r(E, { type: "button", children: /* @__PURE__ */ r(p, { icon: ce }) }) }),
|
|
6823
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: m, children: /* @__PURE__ */ r(p, { icon: hn }) }),
|
|
6824
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: g, children: /* @__PURE__ */ r(p, { icon: un }) }),
|
|
6825
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: a, children: /* @__PURE__ */ r(p, { icon: Qi }) }),
|
|
6826
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: b, children: /* @__PURE__ */ r(p, { icon: dn }) }),
|
|
6827
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: N, children: /* @__PURE__ */ r(p, { icon: Me }) })
|
|
6811
6828
|
] }),
|
|
6812
6829
|
/* @__PURE__ */ r("input", { className: "hidden", ref: o, type: "file", accept: "image/*", onChange: h })
|
|
6813
6830
|
] });
|
|
6814
6831
|
});
|
|
6815
|
-
|
|
6816
|
-
const
|
|
6832
|
+
Ct.displayName = "FieldBuilderWithActions";
|
|
6833
|
+
const vt = F((i) => {
|
|
6817
6834
|
const { children: t, variant: e, size: n, accentColor: s, fields: o, onSelectField: l, ...c } = i;
|
|
6818
6835
|
return /* @__PURE__ */ u(V.Root, { ...c, children: [
|
|
6819
6836
|
/* @__PURE__ */ r(V.ClickTrigger, { children: t }),
|
|
6820
6837
|
/* @__PURE__ */ r(V.Content, { variant: e, size: n, accentColor: s, children: /* @__PURE__ */ r(V.Scroll, { children: o.map((a) => /* @__PURE__ */ r(Vr, { field: a, onSelectField: l }, a.identifier)) }) })
|
|
6821
6838
|
] });
|
|
6822
6839
|
});
|
|
6823
|
-
|
|
6840
|
+
vt.displayName = "FieldDropdownMenu";
|
|
6824
6841
|
const Vr = F((i) => {
|
|
6825
6842
|
const { field: t, onSelectField: e } = i, n = f(() => {
|
|
6826
6843
|
e(t);
|
|
@@ -6851,13 +6868,13 @@ const br = F((i) => {
|
|
|
6851
6868
|
e(t);
|
|
6852
6869
|
}, [t, e]);
|
|
6853
6870
|
return /* @__PURE__ */ u(V.Item, { onSelect: n, children: [
|
|
6854
|
-
/* @__PURE__ */ r(p, { icon:
|
|
6871
|
+
/* @__PURE__ */ r(p, { icon: cn }),
|
|
6855
6872
|
t.label || Gn
|
|
6856
6873
|
] });
|
|
6857
6874
|
});
|
|
6858
6875
|
br.displayName = "FieldSectionDropdownMenuItem";
|
|
6859
6876
|
const Cr = F((i) => {
|
|
6860
|
-
const { id: t, sourceX: e, sourceY: n, targetX: s, targetY: o, style: l, markerEnd: c, data: a } = i, { targetSection: d, sourceSection: h, layoutDirection: m } = a, g =
|
|
6877
|
+
const { id: t, sourceX: e, sourceY: n, targetX: s, targetY: o, style: l, markerEnd: c, data: a } = i, { targetSection: d, sourceSection: h, layoutDirection: m } = a, g = _(() => h.getConditions(d.identifier), [h, d.identifier]), b = f(() => {
|
|
6861
6878
|
h.removeConditional(d.identifier);
|
|
6862
6879
|
}, [h, d.identifier]), N = f(
|
|
6863
6880
|
(A) => {
|
|
@@ -6893,8 +6910,8 @@ const Cr = F((i) => {
|
|
|
6893
6910
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
6894
6911
|
/* @__PURE__ */ r(D, { size: "xs", className: "max-w-[280px] truncate", children: h.label || "Untitled section" }),
|
|
6895
6912
|
/* @__PURE__ */ u("div", { className: "ml-auto flex items-center gap-1", children: [
|
|
6896
|
-
/* @__PURE__ */ r(
|
|
6897
|
-
|
|
6913
|
+
/* @__PURE__ */ r(vt, { fields: h.fields, onSelectField: N, children: /* @__PURE__ */ r(
|
|
6914
|
+
E,
|
|
6898
6915
|
{
|
|
6899
6916
|
"aria-label": "Add condition",
|
|
6900
6917
|
type: "button",
|
|
@@ -6906,7 +6923,7 @@ const Cr = F((i) => {
|
|
|
6906
6923
|
) }),
|
|
6907
6924
|
/* @__PURE__ */ u(Ie.Root, { children: [
|
|
6908
6925
|
/* @__PURE__ */ r(Ie.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
6909
|
-
|
|
6926
|
+
E,
|
|
6910
6927
|
{
|
|
6911
6928
|
"aria-label": "Remove conditional logic",
|
|
6912
6929
|
type: "button",
|
|
@@ -6936,7 +6953,7 @@ const vr = F((i) => {
|
|
|
6936
6953
|
l.removeFieldSection(n);
|
|
6937
6954
|
}, [l, n]), a = f(
|
|
6938
6955
|
(b) => {
|
|
6939
|
-
n.addField(
|
|
6956
|
+
n.addField(bt(b));
|
|
6940
6957
|
},
|
|
6941
6958
|
[n]
|
|
6942
6959
|
), d = f(() => {
|
|
@@ -6995,7 +7012,7 @@ const vr = F((i) => {
|
|
|
6995
7012
|
] }) })
|
|
6996
7013
|
] }),
|
|
6997
7014
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3", children: n.fields.map((b, N) => /* @__PURE__ */ r(
|
|
6998
|
-
|
|
7015
|
+
Ct,
|
|
6999
7016
|
{
|
|
7000
7017
|
field: b,
|
|
7001
7018
|
fieldSection: n,
|
|
@@ -7013,14 +7030,14 @@ const vr = F((i) => {
|
|
|
7013
7030
|
size: "xs",
|
|
7014
7031
|
onClick: Ve,
|
|
7015
7032
|
children: /* @__PURE__ */ u($, { className: "flex flex-col gap-2", variant: "surface", size: "xs", accentColor: "base", children: [
|
|
7016
|
-
/* @__PURE__ */ r(
|
|
7017
|
-
/* @__PURE__ */ r(
|
|
7018
|
-
/* @__PURE__ */ r(
|
|
7033
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: d, children: /* @__PURE__ */ r(p, { icon: Ls }) }),
|
|
7034
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: h, children: /* @__PURE__ */ r(p, { icon: Qi }) }),
|
|
7035
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: c, children: /* @__PURE__ */ r(p, { icon: Me }) })
|
|
7019
7036
|
] })
|
|
7020
7037
|
}
|
|
7021
7038
|
) }),
|
|
7022
7039
|
/* @__PURE__ */ r(
|
|
7023
|
-
|
|
7040
|
+
St,
|
|
7024
7041
|
{
|
|
7025
7042
|
type: "target",
|
|
7026
7043
|
className: "size-4! bg-(--base-3)! border-(--base-7)!",
|
|
@@ -7028,7 +7045,7 @@ const vr = F((i) => {
|
|
|
7028
7045
|
}
|
|
7029
7046
|
),
|
|
7030
7047
|
/* @__PURE__ */ r(
|
|
7031
|
-
|
|
7048
|
+
St,
|
|
7032
7049
|
{
|
|
7033
7050
|
type: "source",
|
|
7034
7051
|
className: "size-4! bg-(--base-3)! border-(--base-7)!",
|
|
@@ -7040,12 +7057,12 @@ const vr = F((i) => {
|
|
|
7040
7057
|
);
|
|
7041
7058
|
});
|
|
7042
7059
|
vr.displayName = "CustomNode";
|
|
7043
|
-
const
|
|
7060
|
+
const Ul = {
|
|
7044
7061
|
fieldSection: vr
|
|
7045
|
-
},
|
|
7062
|
+
}, Gl = {
|
|
7046
7063
|
fieldSectionCondition: Cr
|
|
7047
|
-
},
|
|
7048
|
-
const n = new
|
|
7064
|
+
}, Hl = (i, t, e) => {
|
|
7065
|
+
const n = new xt.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
|
|
7049
7066
|
return n.setGraph({ rankdir: e, nodesep: 200, edgesep: 500, ranksep: 500 }), t.forEach(
|
|
7050
7067
|
(s) => n.setEdge(s.source, s.target, {
|
|
7051
7068
|
// TODO: Measure edges
|
|
@@ -7062,7 +7079,7 @@ const Pl = {
|
|
|
7062
7079
|
height: ((l = s.measured) == null ? void 0 : l.height) ?? 0
|
|
7063
7080
|
});
|
|
7064
7081
|
}
|
|
7065
|
-
),
|
|
7082
|
+
), xt.layout(n), [
|
|
7066
7083
|
i.map((s) => {
|
|
7067
7084
|
var a, d;
|
|
7068
7085
|
const o = n.node(s.id), l = o.x - (((a = s.measured) == null ? void 0 : a.width) ?? 0) / 2, c = o.y - (((d = s.measured) == null ? void 0 : d.height) ?? 0) / 2;
|
|
@@ -7070,15 +7087,15 @@ const Pl = {
|
|
|
7070
7087
|
}),
|
|
7071
7088
|
t
|
|
7072
7089
|
];
|
|
7073
|
-
},
|
|
7090
|
+
}, Jl = {
|
|
7074
7091
|
hideAttribution: !0
|
|
7075
7092
|
}, zr = F(() => {
|
|
7076
7093
|
var de;
|
|
7077
|
-
const { errors: i } =
|
|
7078
|
-
|
|
7094
|
+
const { errors: i } = Xt(), { handleSubmit: t } = Yt(), { onSave: e, onCancel: n } = R(me), { fieldSchema: s } = R(me), o = Vi(null), [l, c] = te(), [a, d] = te("TB");
|
|
7095
|
+
Jt(() => {
|
|
7079
7096
|
o.current && o.current.classList.remove("light");
|
|
7080
7097
|
}, []);
|
|
7081
|
-
const h =
|
|
7098
|
+
const h = _(
|
|
7082
7099
|
() => s.fieldSections.map((ne, le) => ({
|
|
7083
7100
|
id: ne.identifier,
|
|
7084
7101
|
position: { x: 0, y: 0 },
|
|
@@ -7091,7 +7108,7 @@ const Pl = {
|
|
|
7091
7108
|
type: "fieldSection"
|
|
7092
7109
|
})),
|
|
7093
7110
|
[s.fieldSections, a]
|
|
7094
|
-
), m =
|
|
7111
|
+
), m = _(() => {
|
|
7095
7112
|
const ne = [], le = {};
|
|
7096
7113
|
for (const he of s.fieldSections)
|
|
7097
7114
|
le[he.identifier] = he;
|
|
@@ -7120,7 +7137,7 @@ const Pl = {
|
|
|
7120
7137
|
}, [h, b]), ye(() => {
|
|
7121
7138
|
z(m);
|
|
7122
7139
|
}, [m, z]);
|
|
7123
|
-
const [I, A] =
|
|
7140
|
+
const [I, A] = _(() => Hl(g, x, a), [x, a, g]), S = f(() => {
|
|
7124
7141
|
s.addFieldSection(new ae({ identifier: M(), fields: [] }));
|
|
7125
7142
|
}, [s]), k = f(
|
|
7126
7143
|
(ne) => {
|
|
@@ -7136,7 +7153,7 @@ const Pl = {
|
|
|
7136
7153
|
), B = f(
|
|
7137
7154
|
(ne) => {
|
|
7138
7155
|
const le = s.getSectionDependencyGraph();
|
|
7139
|
-
return !
|
|
7156
|
+
return !Wt(le, ne.source, ne.target);
|
|
7140
7157
|
},
|
|
7141
7158
|
[s]
|
|
7142
7159
|
), Y = f(() => {
|
|
@@ -7157,14 +7174,14 @@ const Pl = {
|
|
|
7157
7174
|
onNodesChange: N,
|
|
7158
7175
|
edges: A,
|
|
7159
7176
|
onEdgesChange: v,
|
|
7160
|
-
nodeTypes:
|
|
7161
|
-
edgeTypes:
|
|
7177
|
+
nodeTypes: Ul,
|
|
7178
|
+
edgeTypes: Gl,
|
|
7162
7179
|
onConnect: k,
|
|
7163
7180
|
attributionPosition: "bottom-left",
|
|
7164
7181
|
fitView: !0,
|
|
7165
7182
|
minZoom: 0,
|
|
7166
7183
|
isValidConnection: B,
|
|
7167
|
-
proOptions:
|
|
7184
|
+
proOptions: Jl
|
|
7168
7185
|
}
|
|
7169
7186
|
),
|
|
7170
7187
|
/* @__PURE__ */ r(Pi, { position: "top-left", children: /* @__PURE__ */ r($, { className: "flex items-center justify-end gap-2", size: "sm", children: /* @__PURE__ */ u(w, { type: "button", variant: "surface", onClick: S, children: [
|
|
@@ -7189,9 +7206,9 @@ const Pl = {
|
|
|
7189
7206
|
),
|
|
7190
7207
|
/* @__PURE__ */ r(xe, { size: "sm" }),
|
|
7191
7208
|
/* @__PURE__ */ u($, { className: "flex flex-col", size: "sm", accentColor: "base", variant: "soft", children: [
|
|
7192
|
-
/* @__PURE__ */ r(
|
|
7193
|
-
/* @__PURE__ */ r(
|
|
7194
|
-
/* @__PURE__ */ r(
|
|
7209
|
+
/* @__PURE__ */ r(E, { className: "rounded-b-none", onClick: ue, type: "button", children: /* @__PURE__ */ r(p, { icon: ce }) }),
|
|
7210
|
+
/* @__PURE__ */ r(E, { onClick: Y, radius: "none", type: "button", children: /* @__PURE__ */ r(p, { icon: fi }) }),
|
|
7211
|
+
/* @__PURE__ */ r(E, { className: "rounded-t-none", onClick: be, type: "button", children: /* @__PURE__ */ r(p, { icon: po }) })
|
|
7195
7212
|
] })
|
|
7196
7213
|
] }),
|
|
7197
7214
|
/* @__PURE__ */ r(Pi, { position: "bottom-right", children: /* @__PURE__ */ u($, { className: "flex items-center justify-end gap-2", size: "sm", children: [
|
|
@@ -7203,7 +7220,7 @@ const Pl = {
|
|
|
7203
7220
|
] });
|
|
7204
7221
|
});
|
|
7205
7222
|
zr.displayName = "FormBuilderFlowBuilder";
|
|
7206
|
-
const
|
|
7223
|
+
const Wl = (i, t, e = {}) => {
|
|
7207
7224
|
const { conditions: n = !1 } = e, s = i.get(t.identifier);
|
|
7208
7225
|
if (!s)
|
|
7209
7226
|
throw new Error(
|
|
@@ -7236,11 +7253,11 @@ const Jl = (i, t, e = {}) => {
|
|
|
7236
7253
|
conditions: c,
|
|
7237
7254
|
fields: l
|
|
7238
7255
|
};
|
|
7239
|
-
},
|
|
7256
|
+
}, Kl = (i, t = {}) => {
|
|
7240
7257
|
const e = new Map(
|
|
7241
7258
|
i.map((n) => [n.identifier, M()])
|
|
7242
7259
|
);
|
|
7243
|
-
return i.map((n) =>
|
|
7260
|
+
return i.map((n) => Wl(e, n, t));
|
|
7244
7261
|
}, Sr = (i, t) => {
|
|
7245
7262
|
const e = {}, n = i.filter((s) => s instanceof ae);
|
|
7246
7263
|
for (const s of i)
|
|
@@ -7248,7 +7265,7 @@ const Jl = (i, t, e = {}) => {
|
|
|
7248
7265
|
const o = n.filter((c) => s.identifier in c.conditions);
|
|
7249
7266
|
if (o.length > 0 && !o.some((c) => {
|
|
7250
7267
|
const a = c.getConditions(s.identifier);
|
|
7251
|
-
return new
|
|
7268
|
+
return new pt(a).applyConditions(t);
|
|
7252
7269
|
}))
|
|
7253
7270
|
continue;
|
|
7254
7271
|
const l = s.getErrors(t);
|
|
@@ -7256,11 +7273,11 @@ const Jl = (i, t, e = {}) => {
|
|
|
7256
7273
|
} else {
|
|
7257
7274
|
if (!(s instanceof oe))
|
|
7258
7275
|
throw new Error("Invalid field type");
|
|
7259
|
-
const o = s.identifier, l = s.getError(
|
|
7276
|
+
const o = s.identifier, l = s.getError(tn(t, o));
|
|
7260
7277
|
l && es(e, o, l);
|
|
7261
7278
|
}
|
|
7262
7279
|
return e;
|
|
7263
|
-
},
|
|
7280
|
+
}, za = async (i) => {
|
|
7264
7281
|
const t = {}, e = [];
|
|
7265
7282
|
for (const n of i) {
|
|
7266
7283
|
const { fields: s } = n, o = [];
|
|
@@ -7282,7 +7299,7 @@ const Jl = (i, t, e = {}) => {
|
|
|
7282
7299
|
}
|
|
7283
7300
|
return { fields: e, images: t };
|
|
7284
7301
|
};
|
|
7285
|
-
async function
|
|
7302
|
+
async function Sa(i) {
|
|
7286
7303
|
const t = {};
|
|
7287
7304
|
for (const [e, n] of Object.entries(i))
|
|
7288
7305
|
t[e] = await Promise.all(n);
|
|
@@ -7309,7 +7326,7 @@ class He extends bi {
|
|
|
7309
7326
|
return new He(e.map(ae.deserialize));
|
|
7310
7327
|
}
|
|
7311
7328
|
static reseedFieldSections(e, n) {
|
|
7312
|
-
return
|
|
7329
|
+
return Kl(e, n);
|
|
7313
7330
|
}
|
|
7314
7331
|
getFields() {
|
|
7315
7332
|
return this.fieldSections.flatMap((e) => e.getFields());
|
|
@@ -7353,7 +7370,7 @@ class He extends bi {
|
|
|
7353
7370
|
}
|
|
7354
7371
|
// Field Values methods
|
|
7355
7372
|
cleanValues(e) {
|
|
7356
|
-
return
|
|
7373
|
+
return Vt(this.getFields(), e);
|
|
7357
7374
|
}
|
|
7358
7375
|
cleanSerializedValues(e) {
|
|
7359
7376
|
return ar(this.getFields(), e);
|
|
@@ -7362,10 +7379,10 @@ class He extends bi {
|
|
|
7362
7379
|
return _l(this.getFields(), e, n);
|
|
7363
7380
|
}
|
|
7364
7381
|
serializeValues(e, n) {
|
|
7365
|
-
return
|
|
7382
|
+
return El(this.getFields(), e, n);
|
|
7366
7383
|
}
|
|
7367
7384
|
initializeValues(e) {
|
|
7368
|
-
return
|
|
7385
|
+
return Dl(this.getFields(), e);
|
|
7369
7386
|
}
|
|
7370
7387
|
validateValues(e) {
|
|
7371
7388
|
return Sr(this.getFieldSections(), e);
|
|
@@ -7380,35 +7397,35 @@ class He extends bi {
|
|
|
7380
7397
|
return lr(this.getFields(), e);
|
|
7381
7398
|
}
|
|
7382
7399
|
serializeConditions(e) {
|
|
7383
|
-
return
|
|
7400
|
+
return Al(this.getFields(), e);
|
|
7384
7401
|
}
|
|
7385
7402
|
cleanSerializedConditions(e) {
|
|
7386
7403
|
return or(this.getFields(), e);
|
|
7387
7404
|
}
|
|
7388
7405
|
changedFieldValues(e, n) {
|
|
7389
|
-
return
|
|
7406
|
+
return Ll(this.getFields(), e, n);
|
|
7390
7407
|
}
|
|
7391
7408
|
unchangedFieldValues(e, n) {
|
|
7392
|
-
return
|
|
7409
|
+
return Bl(this.getFields(), e, n);
|
|
7393
7410
|
}
|
|
7394
7411
|
areValuesEqual(e, n) {
|
|
7395
7412
|
return dr(this.getFields(), e, n);
|
|
7396
7413
|
}
|
|
7397
7414
|
areValuesBlank(e) {
|
|
7398
|
-
return
|
|
7415
|
+
return jl(this.getFields(), e);
|
|
7399
7416
|
}
|
|
7400
7417
|
blankValues() {
|
|
7401
7418
|
return cr(this.getFields());
|
|
7402
7419
|
}
|
|
7403
7420
|
extractFilesAndPromisesFromFieldValues(e) {
|
|
7404
|
-
return
|
|
7421
|
+
return Rl(this.getFields(), e);
|
|
7405
7422
|
}
|
|
7406
7423
|
insertFilesAndPromisesToFieldValues(e, n) {
|
|
7407
|
-
return
|
|
7424
|
+
return $l(this.getFields(), e, n);
|
|
7408
7425
|
}
|
|
7409
7426
|
}
|
|
7410
7427
|
const xr = F((i) => {
|
|
7411
|
-
const { sourceFieldSection: t, targetFieldSection: e } = i, n =
|
|
7428
|
+
const { sourceFieldSection: t, targetFieldSection: e } = i, n = _(() => t.getConditions(e.identifier), [t, e.identifier]), s = f(() => {
|
|
7412
7429
|
t.removeConditional(e.identifier);
|
|
7413
7430
|
}, [t, e.identifier]), o = f(
|
|
7414
7431
|
(c) => {
|
|
@@ -7424,22 +7441,22 @@ const xr = F((i) => {
|
|
|
7424
7441
|
return /* @__PURE__ */ u(fe, { className: "flex flex-col gap-2", size: "sm", children: [
|
|
7425
7442
|
/* @__PURE__ */ u($, { className: "flex justify-between gap-2", size: "sm", accentColor: "base", variant: "soft", children: [
|
|
7426
7443
|
/* @__PURE__ */ u(P, { accentColor: "base", variant: "soft", size: "sm", children: [
|
|
7427
|
-
/* @__PURE__ */ r(p, { icon:
|
|
7444
|
+
/* @__PURE__ */ r(p, { icon: cn }),
|
|
7428
7445
|
t.label ?? Gn
|
|
7429
7446
|
] }),
|
|
7430
|
-
/* @__PURE__ */ r(
|
|
7447
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: s, variant: "ghost", children: /* @__PURE__ */ r(p, { icon: Me }) })
|
|
7431
7448
|
] }),
|
|
7432
7449
|
/* @__PURE__ */ u("div", { className: "flex h-max w-full flex-wrap gap-2", children: [
|
|
7433
7450
|
n.map((c) => c.render({
|
|
7434
7451
|
onRemove: l
|
|
7435
7452
|
})),
|
|
7436
|
-
/* @__PURE__ */ r(
|
|
7453
|
+
/* @__PURE__ */ r(vt, { fields: t.fields, onSelectField: o, align: "start", children: /* @__PURE__ */ r(E, { type: "button", size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ r(p, { icon: ce }) }) })
|
|
7437
7454
|
] })
|
|
7438
7455
|
] });
|
|
7439
7456
|
});
|
|
7440
7457
|
xr.displayName = "FieldSectionConditionalItem";
|
|
7441
7458
|
const wr = F((i) => {
|
|
7442
|
-
const { fieldSection: t } = i, { fieldSchema: e } = R(me), n =
|
|
7459
|
+
const { fieldSection: t } = i, { fieldSchema: e } = R(me), n = _(() => e.fieldSections.filter((a) => t.identifier in a.conditions), [e.fieldSections, t.identifier]), s = f(
|
|
7443
7460
|
(a) => {
|
|
7444
7461
|
a.addConditional(t.identifier);
|
|
7445
7462
|
},
|
|
@@ -7454,10 +7471,10 @@ const wr = F((i) => {
|
|
|
7454
7471
|
t.setOptions({ description: a.target.value });
|
|
7455
7472
|
},
|
|
7456
7473
|
[t]
|
|
7457
|
-
), c =
|
|
7474
|
+
), c = _(() => {
|
|
7458
7475
|
const a = e.getSectionDependencyGraph();
|
|
7459
7476
|
return e.fieldSections.filter(
|
|
7460
|
-
(d) => !
|
|
7477
|
+
(d) => !Wt(a, d.identifier, t.identifier)
|
|
7461
7478
|
);
|
|
7462
7479
|
}, [t.identifier, e]);
|
|
7463
7480
|
return /* @__PURE__ */ u("div", { className: "flex w-full grow flex-col gap-4", children: [
|
|
@@ -7514,7 +7531,7 @@ const wr = F((i) => {
|
|
|
7514
7531
|
});
|
|
7515
7532
|
wr.displayName = "FieldSectionBuilder";
|
|
7516
7533
|
const Nr = F((i) => {
|
|
7517
|
-
const { fieldSection: t, sectionIndex: e } = i, { fieldSchema: n } = R(me), s =
|
|
7534
|
+
const { fieldSection: t, sectionIndex: e } = i, { fieldSchema: n } = R(me), s = _r(), o = f(() => {
|
|
7518
7535
|
n.removeFieldSection(t);
|
|
7519
7536
|
}, [n, t]), l = f(
|
|
7520
7537
|
(x) => {
|
|
@@ -7526,7 +7543,7 @@ const Nr = F((i) => {
|
|
|
7526
7543
|
n.addFieldSection(t.duplicate(M()));
|
|
7527
7544
|
}, [n, t]), a = f(
|
|
7528
7545
|
(x) => {
|
|
7529
|
-
t.addField(
|
|
7546
|
+
t.addField(bt(x));
|
|
7530
7547
|
},
|
|
7531
7548
|
[t]
|
|
7532
7549
|
), d = f(() => {
|
|
@@ -7611,7 +7628,7 @@ const Nr = F((i) => {
|
|
|
7611
7628
|
] }) })
|
|
7612
7629
|
] }),
|
|
7613
7630
|
t.fields.map((x, z) => /* @__PURE__ */ r(
|
|
7614
|
-
|
|
7631
|
+
Ct,
|
|
7615
7632
|
{
|
|
7616
7633
|
field: x,
|
|
7617
7634
|
fieldSection: t,
|
|
@@ -7623,21 +7640,21 @@ const Nr = F((i) => {
|
|
|
7623
7640
|
] })
|
|
7624
7641
|
] }),
|
|
7625
7642
|
/* @__PURE__ */ u($, { className: "flex flex-col gap-0.5", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
7626
|
-
/* @__PURE__ */ r(
|
|
7627
|
-
/* @__PURE__ */ r(
|
|
7643
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: d, children: /* @__PURE__ */ r(p, { icon: hn }) }),
|
|
7644
|
+
/* @__PURE__ */ r(E, { type: "button", onClick: h, children: /* @__PURE__ */ r(p, { icon: un }) }),
|
|
7628
7645
|
/* @__PURE__ */ u(V.Root, { align: "end", children: [
|
|
7629
|
-
/* @__PURE__ */ r(V.ClickTrigger, { children: /* @__PURE__ */ r(
|
|
7646
|
+
/* @__PURE__ */ r(V.ClickTrigger, { children: /* @__PURE__ */ r(E, { type: "button", children: /* @__PURE__ */ r(p, { icon: an }) }) }),
|
|
7630
7647
|
/* @__PURE__ */ u(V.Content, { size: "sm", children: [
|
|
7631
7648
|
/* @__PURE__ */ u(V.Item, { onSelect: c, children: [
|
|
7632
7649
|
/* @__PURE__ */ r(p, { icon: Qi }),
|
|
7633
7650
|
"Duplicate section"
|
|
7634
7651
|
] }),
|
|
7635
7652
|
/* @__PURE__ */ u(V.Item, { onSelect: b, children: [
|
|
7636
|
-
/* @__PURE__ */ r(p, { icon:
|
|
7653
|
+
/* @__PURE__ */ r(p, { icon: sn }),
|
|
7637
7654
|
"Copy JSON"
|
|
7638
7655
|
] }),
|
|
7639
7656
|
/* @__PURE__ */ u(V.Item, { onSelect: N, children: [
|
|
7640
|
-
/* @__PURE__ */ r(p, { icon:
|
|
7657
|
+
/* @__PURE__ */ r(p, { icon: on }),
|
|
7641
7658
|
"Paste JSON"
|
|
7642
7659
|
] }),
|
|
7643
7660
|
/* @__PURE__ */ u(V.Item, { onSelect: o, children: [
|
|
@@ -7652,7 +7669,7 @@ const Nr = F((i) => {
|
|
|
7652
7669
|
Nr.displayName = "FieldSectionWithActions";
|
|
7653
7670
|
const Fr = F(() => {
|
|
7654
7671
|
var a;
|
|
7655
|
-
const { handleSubmit: i } =
|
|
7672
|
+
const { handleSubmit: i } = Yt(), { errors: t } = Xt(), { onSave: e, onCancel: n } = R(me), { fieldSchema: s } = R(me), o = f(() => {
|
|
7656
7673
|
s.addFieldSection(new ae({ identifier: M(), fields: [] }));
|
|
7657
7674
|
}, [s]), l = f(async () => {
|
|
7658
7675
|
try {
|
|
@@ -7712,11 +7729,11 @@ const Fr = F(() => {
|
|
|
7712
7729
|
/* @__PURE__ */ u("div", { className: "flex flex-col gap-4", children: [
|
|
7713
7730
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-end gap-2", children: [
|
|
7714
7731
|
/* @__PURE__ */ u(w, { type: "button", variant: "soft", size: "sm", onClick: l, children: [
|
|
7715
|
-
/* @__PURE__ */ r(p, { icon:
|
|
7732
|
+
/* @__PURE__ */ r(p, { icon: sn }),
|
|
7716
7733
|
" Copy JSON"
|
|
7717
7734
|
] }),
|
|
7718
7735
|
/* @__PURE__ */ u(w, { type: "button", variant: "soft", size: "sm", onClick: c, children: [
|
|
7719
|
-
/* @__PURE__ */ r(p, { icon:
|
|
7736
|
+
/* @__PURE__ */ r(p, { icon: on }),
|
|
7720
7737
|
" Paste JSON"
|
|
7721
7738
|
] })
|
|
7722
7739
|
] }),
|
|
@@ -7764,7 +7781,7 @@ function kr(i) {
|
|
|
7764
7781
|
};
|
|
7765
7782
|
return t(i);
|
|
7766
7783
|
}
|
|
7767
|
-
const
|
|
7784
|
+
const Xl = F(
|
|
7768
7785
|
Xi((i, t) => {
|
|
7769
7786
|
const {
|
|
7770
7787
|
disabled: e = !1,
|
|
@@ -7783,12 +7800,12 @@ const Kl = F(
|
|
|
7783
7800
|
cancelIcon: x,
|
|
7784
7801
|
submitIcon: z,
|
|
7785
7802
|
size: v = "md"
|
|
7786
|
-
} = i, I =
|
|
7803
|
+
} = i, I = _(() => n.initializeValues(s), [n, s]), A = f(
|
|
7787
7804
|
(de) => {
|
|
7788
7805
|
l == null || l(de);
|
|
7789
7806
|
},
|
|
7790
7807
|
[l]
|
|
7791
|
-
), S =
|
|
7808
|
+
), S = Zt({
|
|
7792
7809
|
values: I,
|
|
7793
7810
|
mode: "onBlur",
|
|
7794
7811
|
criteriaMode: "all",
|
|
@@ -7817,21 +7834,21 @@ const Kl = F(
|
|
|
7817
7834
|
de();
|
|
7818
7835
|
};
|
|
7819
7836
|
}, [S, k]);
|
|
7820
|
-
const B = Fo(n.getFieldSections()), Y =
|
|
7837
|
+
const B = Fo(n.getFieldSections()), Y = _(
|
|
7821
7838
|
() => ({
|
|
7822
7839
|
fieldSchema: n,
|
|
7823
7840
|
size: v
|
|
7824
7841
|
}),
|
|
7825
7842
|
[n, v]
|
|
7826
7843
|
), ue = !m && !!h, be = !a;
|
|
7827
|
-
return /* @__PURE__ */ r(
|
|
7844
|
+
return /* @__PURE__ */ r(Qt, { ...S, children: /* @__PURE__ */ r(G, { value: Y, children: /* @__PURE__ */ u(
|
|
7828
7845
|
"form",
|
|
7829
7846
|
{
|
|
7830
7847
|
ref: t,
|
|
7831
7848
|
className: ke(g, "flex flex-col gap-4"),
|
|
7832
7849
|
onSubmit: S.handleSubmit(A),
|
|
7833
7850
|
children: [
|
|
7834
|
-
/* @__PURE__ */ r("div", { className:
|
|
7851
|
+
/* @__PURE__ */ r("div", { className: Pl({ size: v }), children: B }),
|
|
7835
7852
|
!e && (ue || be) ? /* @__PURE__ */ u($, { className: "flex items-center justify-end gap-2", size: v, children: [
|
|
7836
7853
|
ue ? /* @__PURE__ */ u(
|
|
7837
7854
|
w,
|
|
@@ -7867,7 +7884,7 @@ const Kl = F(
|
|
|
7867
7884
|
})
|
|
7868
7885
|
), Mr = F(() => {
|
|
7869
7886
|
const { fieldSchema: i } = R(me);
|
|
7870
|
-
return /* @__PURE__ */ r(
|
|
7887
|
+
return /* @__PURE__ */ r(Xl, { fieldSchema: i, disabled: !1 });
|
|
7871
7888
|
});
|
|
7872
7889
|
Mr.displayName = "FormBuilderPreview";
|
|
7873
7890
|
const qr = F((i) => {
|
|
@@ -7885,18 +7902,18 @@ const qr = F((i) => {
|
|
|
7885
7902
|
}
|
|
7886
7903
|
const v = {};
|
|
7887
7904
|
for (const S of z)
|
|
7888
|
-
v[S.identifier] =
|
|
7905
|
+
v[S.identifier] = tn(N, S.identifier);
|
|
7889
7906
|
const I = Sr(z, v);
|
|
7890
7907
|
return Object.keys(I).length > 0 && (x.fields = I.fields), Object.keys(x).length > 0 && ie.error({
|
|
7891
7908
|
title: "Some form settings are invalid",
|
|
7892
7909
|
description: "Please check settings highlighted in red."
|
|
7893
7910
|
}), x;
|
|
7894
|
-
}, []), c =
|
|
7911
|
+
}, []), c = _(
|
|
7895
7912
|
() => ({
|
|
7896
7913
|
fields: e ?? []
|
|
7897
7914
|
}),
|
|
7898
7915
|
[e]
|
|
7899
|
-
), a =
|
|
7916
|
+
), a = Zt({
|
|
7900
7917
|
values: c,
|
|
7901
7918
|
mode: "onSubmit",
|
|
7902
7919
|
criteriaMode: "all",
|
|
@@ -7916,28 +7933,28 @@ const qr = F((i) => {
|
|
|
7916
7933
|
a.setValue("fields", N.serialize());
|
|
7917
7934
|
},
|
|
7918
7935
|
[a]
|
|
7919
|
-
), h =
|
|
7936
|
+
), h = Kt({
|
|
7920
7937
|
control: a.control,
|
|
7921
7938
|
compute: (N) => N.fields
|
|
7922
|
-
}), m =
|
|
7939
|
+
}), m = _(() => {
|
|
7923
7940
|
const N = He.deserialize(h);
|
|
7924
7941
|
return N.observe(d), N;
|
|
7925
|
-
}, [h, d]), g =
|
|
7942
|
+
}, [h, d]), g = _(() => ({
|
|
7926
7943
|
fieldSchema: m,
|
|
7927
7944
|
disableRequiredFields: o,
|
|
7928
7945
|
onSave: n,
|
|
7929
7946
|
onCancel: s
|
|
7930
|
-
}), [o, n, s, m]), b =
|
|
7947
|
+
}), [o, n, s, m]), b = _(
|
|
7931
7948
|
() => ({
|
|
7932
7949
|
fieldSchema: m,
|
|
7933
7950
|
size: "sm"
|
|
7934
7951
|
}),
|
|
7935
7952
|
[m]
|
|
7936
7953
|
);
|
|
7937
|
-
return /* @__PURE__ */ r(me, { value: g, children: /* @__PURE__ */ r(G, { value: b, children: /* @__PURE__ */ r(
|
|
7954
|
+
return /* @__PURE__ */ r(me, { value: g, children: /* @__PURE__ */ r(G, { value: b, children: /* @__PURE__ */ r(Qt, { ...a, children: t }) }) });
|
|
7938
7955
|
});
|
|
7939
7956
|
qr.displayName = "FormBuilderRoot";
|
|
7940
|
-
const
|
|
7957
|
+
const xa = {
|
|
7941
7958
|
Root: qr,
|
|
7942
7959
|
FlowBuilder: zr,
|
|
7943
7960
|
ListBuilder: Fr,
|
|
@@ -7946,60 +7963,60 @@ const Sa = {
|
|
|
7946
7963
|
export {
|
|
7947
7964
|
Q as BaseCondition,
|
|
7948
7965
|
oe as BaseField,
|
|
7949
|
-
|
|
7966
|
+
pn as BaseFormElement,
|
|
7950
7967
|
Ci as BaseOptionsField,
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7968
|
+
zn as BaseStringField,
|
|
7969
|
+
Wo as BooleanEqualsConditionModifier,
|
|
7970
|
+
_e as BooleanField,
|
|
7954
7971
|
zi as BooleanFieldCondition,
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7972
|
+
ml as BooleanFieldConditionCell,
|
|
7973
|
+
Cn as BooleanFieldInput,
|
|
7974
|
+
Ko as BooleanNotEqualsConditionModifier,
|
|
7958
7975
|
Re as CheckboxListField,
|
|
7959
7976
|
Si as CheckboxListFieldCondition,
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7977
|
+
pl as CheckboxListFieldConditionCell,
|
|
7978
|
+
Sn as CheckboxListFieldInput,
|
|
7979
|
+
pt as ConditionManager,
|
|
7980
|
+
Qo as DateAfterConditionModifier,
|
|
7981
|
+
Zo as DateBeforeConditionModifier,
|
|
7982
|
+
Xo as DateEqualsConditionModifier,
|
|
7966
7983
|
Qe as DateField,
|
|
7967
7984
|
xi as DateFieldCondition,
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7985
|
+
gl as DateFieldConditionCell,
|
|
7986
|
+
xn as DateFieldInput,
|
|
7987
|
+
Yo as DateNotEqualsConditionModifier,
|
|
7988
|
+
el as DateRangeInConditionModifier,
|
|
7989
|
+
il as DateRangeNotInConditionModifier,
|
|
7990
|
+
nl as DoesNotHaveFilesConditionModifier,
|
|
7991
|
+
Uo as FIELD_TYPES,
|
|
7975
7992
|
He as FieldSchema,
|
|
7976
7993
|
ae as FieldSection,
|
|
7977
7994
|
ur as FieldSectionLayout,
|
|
7978
7995
|
T as FieldTypeGroup,
|
|
7979
7996
|
Un as FieldTypeToClsMapping,
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7997
|
+
Xl as FieldsRenderer,
|
|
7998
|
+
mn as FileCard,
|
|
7999
|
+
xa as FormBuilder,
|
|
8000
|
+
tl as HasFilesConditionModifier,
|
|
8001
|
+
kn as ImageCard,
|
|
7985
8002
|
ri as ImageFile,
|
|
7986
|
-
|
|
8003
|
+
yn as ImageViewer,
|
|
7987
8004
|
No as ImageViewerProvider,
|
|
7988
8005
|
W as InputWithLabel,
|
|
7989
8006
|
pi as LONG_TEXT_FIELD_MAX_LENGTH,
|
|
7990
8007
|
Ce as MultiSelectField,
|
|
7991
8008
|
wi as MultiSelectFieldCondition,
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
8009
|
+
Vl as MultiSelectFieldConditionCell,
|
|
8010
|
+
wn as MultiSelectFieldInput,
|
|
8011
|
+
Ee as MultiStringField,
|
|
7995
8012
|
Ni as MultiStringFieldCondition,
|
|
7996
|
-
|
|
7997
|
-
|
|
8013
|
+
yl as MultiStringFieldConditionCell,
|
|
8014
|
+
bn as MultiStringFieldInput,
|
|
7998
8015
|
Hn as NumberEqualsConditionModifier,
|
|
7999
8016
|
re as NumberField,
|
|
8000
8017
|
Fi as NumberFieldCondition,
|
|
8001
|
-
|
|
8002
|
-
|
|
8018
|
+
bl as NumberFieldConditionCell,
|
|
8019
|
+
vn as NumberFieldInput,
|
|
8003
8020
|
Xn as NumberGreaterThanConditionModifier,
|
|
8004
8021
|
Yn as NumberGreaterThanOrEqualsConditionModifier,
|
|
8005
8022
|
Wn as NumberLessThanConditionModifier,
|
|
@@ -8009,145 +8026,146 @@ export {
|
|
|
8009
8026
|
Qn as NumberRangeNotInConditionModifier,
|
|
8010
8027
|
$e as OTPField,
|
|
8011
8028
|
ki as OTPFieldCondition,
|
|
8012
|
-
|
|
8013
|
-
|
|
8029
|
+
Cl as OTPFieldConditionCell,
|
|
8030
|
+
Fn as OTPFieldInput,
|
|
8014
8031
|
bi as Observable,
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8032
|
+
ll as PassFailArrayExcludesConditionModifier,
|
|
8033
|
+
ol as PassFailArrayIncludesConditionModifier,
|
|
8034
|
+
rl as PassFailEqualsConditionModifier,
|
|
8018
8035
|
Le as PassFailField,
|
|
8019
8036
|
Mi as PassFailFieldCondition,
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8037
|
+
vl as PassFailFieldConditionCell,
|
|
8038
|
+
On as PassFailFieldInput,
|
|
8039
|
+
sl as PassFailNotEqualsConditionModifier,
|
|
8023
8040
|
Be as RadioField,
|
|
8024
8041
|
qi as RadioFieldCondition,
|
|
8025
|
-
|
|
8026
|
-
|
|
8042
|
+
zl as RadioFieldConditionCell,
|
|
8043
|
+
An as RadioFieldInput,
|
|
8027
8044
|
je as RatingField,
|
|
8028
8045
|
Oi as RatingFieldCondition,
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8046
|
+
Sl as RatingFieldConditionCell,
|
|
8047
|
+
Tn as RatingFieldInput,
|
|
8048
|
+
Nt as SHORT_TEXT_FIELD_MAX_LENGTH,
|
|
8032
8049
|
ii as ScanField,
|
|
8033
8050
|
Ii as ScanFieldCondition,
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8051
|
+
xl as ScanFieldConditionCell,
|
|
8052
|
+
_n as ScanFieldInput,
|
|
8053
|
+
st as Scanner,
|
|
8054
|
+
Ro as ScannerProvider,
|
|
8038
8055
|
we as SelectField,
|
|
8039
8056
|
Ai as SelectFieldCondition,
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8057
|
+
wl as SelectFieldConditionCell,
|
|
8058
|
+
Nn as SelectFieldInput,
|
|
8059
|
+
ut as StringArrayEqualsConditionModifier,
|
|
8060
|
+
at as StringArrayEveryConditionModifier,
|
|
8044
8061
|
ir as StringArrayExcludesConditionModifier,
|
|
8045
8062
|
er as StringArrayIncludesConditionModifier,
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8063
|
+
ct as StringArrayNoneConditionModifier,
|
|
8064
|
+
ht as StringArrayNotEqualsConditionModifier,
|
|
8065
|
+
dt as StringArraySomeConditionModifier,
|
|
8049
8066
|
qe as StringEqualsConditionModifier,
|
|
8050
8067
|
oi as StringExcludesConditionModifier,
|
|
8051
8068
|
Pe as StringField,
|
|
8052
8069
|
Ti as StringFieldCondition,
|
|
8053
|
-
|
|
8070
|
+
Nl as StringFieldConditionCell,
|
|
8054
8071
|
Rn as StringFieldInput,
|
|
8055
8072
|
si as StringIncludesConditionModifier,
|
|
8056
8073
|
Oe as StringNotEqualsConditionModifier,
|
|
8057
8074
|
Ue as TextField,
|
|
8058
|
-
|
|
8059
|
-
|
|
8075
|
+
Ei as TextFieldCondition,
|
|
8076
|
+
Fl as TextFieldConditionCell,
|
|
8060
8077
|
$n as TextFieldInput,
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8078
|
+
ul as TimeAfterConditionModifier,
|
|
8079
|
+
cl as TimeBeforeConditionModifier,
|
|
8080
|
+
al as TimeEqualsConditionModifier,
|
|
8064
8081
|
ti as TimeField,
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8082
|
+
_i as TimeFieldCondition,
|
|
8083
|
+
kl as TimeFieldConditionCell,
|
|
8084
|
+
lt as TimeFieldControl,
|
|
8068
8085
|
Bn as TimeFieldInput,
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8086
|
+
dl as TimeNotEqualsConditionModifier,
|
|
8087
|
+
hl as TimeRangeInConditionModifier,
|
|
8088
|
+
fl as TimeRangeNotInConditionModifier,
|
|
8072
8089
|
K as UNLABELLED_FIELD_LABEL,
|
|
8073
8090
|
Gn as UNLABELLED_SECTION_LABEL,
|
|
8074
8091
|
ni as URLField,
|
|
8075
8092
|
$i as URLFieldCondition,
|
|
8076
|
-
|
|
8093
|
+
ql as URLFieldConditionCell,
|
|
8077
8094
|
Pn as URLFieldInput,
|
|
8078
8095
|
Dn as UTC_OFFSETS,
|
|
8079
|
-
|
|
8096
|
+
$o as UTC_OFFSETS_SET,
|
|
8080
8097
|
Ne as UUIDFile,
|
|
8081
8098
|
De as UUIDPromise,
|
|
8082
8099
|
Ge as UploadField,
|
|
8083
8100
|
Ri as UploadFieldCondition,
|
|
8084
|
-
|
|
8101
|
+
Ml as UploadFieldConditionCell,
|
|
8085
8102
|
jn as UploadFieldInput,
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8103
|
+
qn as VideoCard,
|
|
8104
|
+
Mn as VideoFile,
|
|
8105
|
+
jl as areFieldValuesBlank,
|
|
8089
8106
|
dr as areFieldValuesEqual,
|
|
8090
8107
|
tt as areFileAndPromiseArraysEqual,
|
|
8091
8108
|
Ao as arePassFieldValuesEqual,
|
|
8092
8109
|
To as areSerializedPassFailFieldValuesEqual,
|
|
8093
|
-
|
|
8110
|
+
Sa as awaitFilesAndPromises,
|
|
8094
8111
|
cr as blankFieldValues,
|
|
8095
|
-
|
|
8112
|
+
Ll as changedFieldValues,
|
|
8096
8113
|
lr as cleanConditions,
|
|
8097
|
-
|
|
8114
|
+
Vt as cleanFieldValues,
|
|
8098
8115
|
or as cleanSerializedConditions,
|
|
8099
8116
|
ar as cleanSerializedFieldValues,
|
|
8100
8117
|
fr as createCondition,
|
|
8101
8118
|
C as createConditionModifierConfig,
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8119
|
+
bt as createField,
|
|
8120
|
+
kt as createTime,
|
|
8121
|
+
Tl as deserialize,
|
|
8122
|
+
Il as deserializeCondition,
|
|
8106
8123
|
sr as deserializeConditions,
|
|
8107
|
-
|
|
8124
|
+
gt as deserializeField,
|
|
8108
8125
|
_l as deserializeFieldValues,
|
|
8109
|
-
|
|
8110
|
-
|
|
8126
|
+
ya as deserializeFields,
|
|
8127
|
+
ba as deserializeOnlyFields,
|
|
8111
8128
|
Io as deserializePassFailFieldValue,
|
|
8112
|
-
|
|
8129
|
+
Rl as extractFilesAndPromisesFromFieldValues,
|
|
8113
8130
|
U as fieldDataMapping,
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8131
|
+
yt as fieldSpacingCva,
|
|
8132
|
+
Go as fieldTypeGroupDataMapping,
|
|
8133
|
+
Ca as flattenFields,
|
|
8117
8134
|
Ui as formatTime,
|
|
8118
8135
|
Ji as formatUTCOffset,
|
|
8119
|
-
|
|
8120
|
-
|
|
8136
|
+
jo as getCurrentUTCOffset,
|
|
8137
|
+
va as getFieldsMapping,
|
|
8121
8138
|
ze as getUTCMinuteOfDay,
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8139
|
+
Po as getUTCOffsetMinutes,
|
|
8140
|
+
Dl as initializeFieldValues,
|
|
8141
|
+
$l as insertFilesAndPromisesToFieldValues,
|
|
8125
8142
|
ko as isFileAndPromiseArray,
|
|
8126
|
-
|
|
8143
|
+
In as isPassFailFieldStatus,
|
|
8127
8144
|
qo as isPassFailFieldValue,
|
|
8128
8145
|
Mo as isSerializedPassFailFieldValue,
|
|
8129
8146
|
mi as isStringArray,
|
|
8130
8147
|
J as isTime,
|
|
8131
8148
|
Ln as isTimeInRange,
|
|
8132
8149
|
di as isTimeRange,
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8150
|
+
ot as isUTCOffset,
|
|
8151
|
+
Jo as maxFileSizeB,
|
|
8152
|
+
Ho as maxFileSizeKB,
|
|
8136
8153
|
Ye as maxFileSizeMB,
|
|
8137
8154
|
vi as parseTime,
|
|
8138
8155
|
Te as passFailFieldStatusMapping,
|
|
8139
8156
|
ei as passFailFieldStatuses,
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8157
|
+
za as separateImagesFromFields,
|
|
8158
|
+
Al as serializeConditions,
|
|
8159
|
+
El as serializeFieldValues,
|
|
8143
8160
|
Oo as serializePassFailFieldValue,
|
|
8144
|
-
|
|
8145
|
-
|
|
8161
|
+
Bl as unchangedFieldValues,
|
|
8162
|
+
Va as useConditionManager,
|
|
8146
8163
|
Z as useFieldInput,
|
|
8147
8164
|
Hi as useFieldInputs,
|
|
8148
8165
|
Fo as useFieldSectionInputs,
|
|
8149
8166
|
it as useImageViewer,
|
|
8150
|
-
|
|
8151
|
-
|
|
8167
|
+
gn as useObjectUrl,
|
|
8168
|
+
ga as useScanner,
|
|
8169
|
+
_o as useScannerContext,
|
|
8152
8170
|
Sr as validateFieldValues
|
|
8153
8171
|
};
|