@levo-so/site-runtime 0.3.19 → 0.3.21
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/BillingStep-ByiYjJ0S.js +251 -0
- package/BookingCard-DdwLHVGw.js +816 -0
- package/CollectionLabel-CmUFfc_7.js +35 -0
- package/DateTimeWidget-Bk2tk_CT.js +254 -0
- package/{KBChatWidget-GRi6sLpp.js → KBChatWidget-BXRRgelS.js} +223 -223
- package/PhoneWidget-FWE3jD_L.js +97 -0
- package/{Popover-C29yJ7rz.js → Popover-MSrVDAzg.js} +7 -7
- package/PopupBody-DWM55Zh5-B3ysApDM.js +158 -0
- package/PopupDialog-DwAAJ8JS-DkxjZaJL.js +260 -0
- package/PopupRenderer-BVtV4b9I-Dot4Syse.js +207 -0
- package/{RichTextWidget-DfakML79.js → RichTextWidget-KnIKESAD.js} +189 -190
- package/{RteThemeProvider-BQmfSXSl.js → RteThemeProvider-DtTXGcCT.js} +2 -3
- package/Sonner-BsE4Y_t4.js +21 -0
- package/blog-content.js +71 -72
- package/dist-BVFCdirT.js +4471 -0
- package/dist-DEXGyFeH.js +376 -0
- package/index.d.ts +21 -11
- package/index.js +1702 -1390
- package/{themeVars.cssm-ByhhC2Jm.js → inlineBaseTheme-DcNdMEYp.js} +35 -5
- package/{inlineCollectionTheme-CWcMCUti.js → inlineCollectionTheme-DjXuH3bK.js} +1 -1
- package/{inlineRteTheme-CRPtkNXy.js → inlineRteTheme-BYGIJM7P.js} +1 -1
- package/{kbChat-a2dXSeRc.js → kbChat-eFsau7hG.js} +27 -27
- package/package.json +23 -23
- package/{pillChrome-CEpWGNZB.js → pillChrome-Dy3ApFI5.js} +5 -5
- package/popups.js +1 -1
- package/{react-Cj_U6VZQ.js → react-CENbCy5d.js} +6 -5
- package/script.esm-D4nvz3-k.js +62 -0
- package/script.esm-uVCZU25S.js +62 -0
- package/start.js +1 -1
- package/styles.css +1 -1
- package/theme.cssm-iXnQwMCp.js +238 -0
- package/CollectionField-C-6a1ud4.js +0 -270
- package/CollectionInput-BJ__qcbk.js +0 -147
- package/DateTimeWidget-U3lD0q1q.js +0 -255
- package/Dialog-dT7y641z.js +0 -130
- package/LevoProvider-Bsjkcwc8.js +0 -20
- package/PhoneWidget-DQQa4bL6.js +0 -99
- package/PopupBody-BI-MJqmd-DgTQEzda.js +0 -159
- package/PopupRenderer-D66Gx63H-Cd9xJv33.js +0 -388
- package/ThemeProvider-DutrjSTF.js +0 -116
- package/Tooltip-CQB0LyxK.js +0 -67
- package/VerifyButton-BUT70lgz.js +0 -192
- package/createThemeExtension-4AUn51iJ.js +0 -15
- package/dist-6AIgW_iB.js +0 -79
- package/dist-CEdznbFW.js +0 -3668
- package/inlineBaseTheme-BB9e6h5f.js +0 -9
- package/popupState-JmpeKzgM-D_77LiAa.js +0 -229
- package/react-B9yvlbH0.js +0 -74
- package/theme.cssm-DUzmx76l.js +0 -4
- package/usePopupRedirect-CAAdcpaW-Ddjyf4KK.js +0 -82
- /package/{content.cssm-XdMsTGIB.js → content.cssm-D_LSloGW.js} +0 -0
- /package/{es-ByBbirnH.js → es-CK20DkgT.js} +0 -0
- /package/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
- /package/{routes-CyKmkoRM.js → routes-DO1BLfh9.js} +0 -0
- /package/{rteTheme.cssm-W4gTOijw.js → rteTheme.cssm-BRxusHY4.js} +0 -0
package/dist-CEdznbFW.js
DELETED
|
@@ -1,3668 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
3
|
-
import { a as t, i as n, r, t as i } from "./CollectionField-C-6a1ud4.js";
|
|
4
|
-
import { n as a, r as o, t as s } from "./ThemeProvider-DutrjSTF.js";
|
|
5
|
-
import { a as c, i as l, n as u, r as d, t as f } from "./VerifyButton-BUT70lgz.js";
|
|
6
|
-
import { n as p, r as m, t as h } from "./Tooltip-CQB0LyxK.js";
|
|
7
|
-
import { t as g } from "./LevoProvider-Bsjkcwc8.js";
|
|
8
|
-
import { i as _, n as v, r as y, t as b } from "./CollectionInput-BJ__qcbk.js";
|
|
9
|
-
import { i as x, n as S, o as C, t as w } from "./Dialog-dT7y641z.js";
|
|
10
|
-
import { n as T, t as E } from "./themeVars.cssm-ByhhC2Jm.js";
|
|
11
|
-
import { n as D, t as O } from "./inlineCollectionTheme-CWcMCUti.js";
|
|
12
|
-
import { t as k } from "./theme.cssm-DUzmx76l.js";
|
|
13
|
-
import { FieldInterfaces as A, LevoError as j, MediaKindList as M, defaultByKinds as N, getLevoError as P, mediaMimetypeByKind as F, operatorsByKind as I } from "@levo-so/core";
|
|
14
|
-
import L from "dayjs";
|
|
15
|
-
import "@theinternetfolks/snowflake";
|
|
16
|
-
import "react-phone-number-input";
|
|
17
|
-
import "yup";
|
|
18
|
-
import { FormProvider as ee, get as R, useController as z, useFieldArray as B, useForm as V, useFormContext as H, useWatch as U } from "react-hook-form";
|
|
19
|
-
import { c as W } from "react/compiler-runtime";
|
|
20
|
-
import G from "clsx";
|
|
21
|
-
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
22
|
-
import { createRuntimeFn as Y } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
23
|
-
import * as te from "react";
|
|
24
|
-
import X, { Suspense as Z, createContext as ne, lazy as re, useCallback as ie, useEffect as ae, useMemo as oe, useRef as se, useState as Q } from "react";
|
|
25
|
-
import { Tabs as ce } from "@base-ui/react/tabs";
|
|
26
|
-
import { IconArrowLeft as le, IconCheck as ue, IconChevronLeft as de, IconChevronRight as fe, IconChevronsLeft as pe, IconChevronsRight as me, IconFile as he, IconHash as ge, IconMail as _e, IconPencil as ve, IconPlus as ye, IconTrash as be, IconUpload as xe, IconX as Se } from "@tabler/icons-react";
|
|
27
|
-
import { Checkbox as Ce } from "@base-ui/react/checkbox";
|
|
28
|
-
import { NumericFormat as we } from "react-number-format";
|
|
29
|
-
import Te from "react-select";
|
|
30
|
-
import Ee from "react-select/async";
|
|
31
|
-
import { Radio as De } from "@base-ui/react/radio";
|
|
32
|
-
import { RadioGroup as Oe } from "@base-ui/react/radio-group";
|
|
33
|
-
import { Switch as ke } from "@base-ui/react/switch";
|
|
34
|
-
import { useDropzone as Ae } from "react-dropzone";
|
|
35
|
-
import { useDebouncedCallback as je } from "use-debounce";
|
|
36
|
-
//#region ../../libraries/react-collection/dist/utils/logic.js
|
|
37
|
-
var Me = (e) => e.combinator !== void 0, Ne = (e) => e == null ? !0 : typeof e == "string" ? e === "" : Array.isArray(e) ? e.length === 0 : !1, Pe = (e, t) => {
|
|
38
|
-
if (t == null) return t;
|
|
39
|
-
if (e === "date") {
|
|
40
|
-
if (t instanceof Date || typeof t == "string" || typeof t == "number") {
|
|
41
|
-
let e = L(t);
|
|
42
|
-
if (e.isValid()) return e.valueOf();
|
|
43
|
-
}
|
|
44
|
-
return NaN;
|
|
45
|
-
}
|
|
46
|
-
if (e === "number") {
|
|
47
|
-
if (typeof t == "number") return t;
|
|
48
|
-
if (typeof t == "string" && t !== "") {
|
|
49
|
-
let e = Number(t);
|
|
50
|
-
if (!Number.isNaN(e)) return e;
|
|
51
|
-
}
|
|
52
|
-
return NaN;
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
}, Fe = (e, t) => e === "collection" && t && typeof t == "object" && !Array.isArray(t) && "_id" in t ? t._id : t, Ie = (e, t, n) => Pe(e, Fe(e, t)) === Pe(e, Fe(e, n)), Le = (e, t) => e ? I[e]?.includes(t) ?? !1 : !1, Re = (e, t) => {
|
|
56
|
-
if (Me(e)) {
|
|
57
|
-
e.conditions.forEach((e) => {
|
|
58
|
-
Re(e, t);
|
|
59
|
-
});
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
t.add(e.source);
|
|
63
|
-
}, ze = (e, t) => {
|
|
64
|
-
if (!t?.length) return {};
|
|
65
|
-
let n = /* @__PURE__ */ new Set();
|
|
66
|
-
for (let e of t) Re(e.when, n);
|
|
67
|
-
let r = {};
|
|
68
|
-
for (let t of e.sections) for (let e of t.fields) n.has(e.key) && (r[e.key] = e.kind);
|
|
69
|
-
return r;
|
|
70
|
-
}, Be = (e, t) => Me(e) ? e.conditions.some((e) => Be(e, t)) : t[e.source] === void 0, Ve = (e, t) => {
|
|
71
|
-
if (Me(e)) {
|
|
72
|
-
for (let n of e.conditions) {
|
|
73
|
-
let e = Ve(n, t);
|
|
74
|
-
if (e) return e;
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
return Le(t[e.source], e.operator) ? null : e;
|
|
79
|
-
}, He = (e, t, n) => {
|
|
80
|
-
let r = n[e.source], i = t[e.source];
|
|
81
|
-
switch (e.operator) {
|
|
82
|
-
case "is_empty": return Ne(i);
|
|
83
|
-
case "is_not_empty": return !Ne(i);
|
|
84
|
-
case "equals": return Ie(r, i, e.value);
|
|
85
|
-
case "not": return !Ie(r, i, e.value);
|
|
86
|
-
case "gt":
|
|
87
|
-
case "gte":
|
|
88
|
-
case "lt":
|
|
89
|
-
case "lte": {
|
|
90
|
-
let t = Pe(r, i), n = Pe(r, e.value);
|
|
91
|
-
if (typeof t != "number" || typeof n != "number" || Number.isNaN(t) || Number.isNaN(n)) return !1;
|
|
92
|
-
switch (e.operator) {
|
|
93
|
-
case "gt": return t > n;
|
|
94
|
-
case "gte": return t >= n;
|
|
95
|
-
case "lt": return t < n;
|
|
96
|
-
case "lte": return t <= n;
|
|
97
|
-
default: return !1;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
case "contains":
|
|
101
|
-
case "not_contains":
|
|
102
|
-
if (r === "array-string" || r === "array-number" || r === "collection") {
|
|
103
|
-
if (!Array.isArray(i)) return e.operator === "not_contains";
|
|
104
|
-
let t = i.some((t) => Ie(r, t, e.value));
|
|
105
|
-
return e.operator === "contains" ? t : !t;
|
|
106
|
-
}
|
|
107
|
-
if (typeof i == "string" && typeof e.value == "string") {
|
|
108
|
-
let t = i.includes(e.value);
|
|
109
|
-
return e.operator === "contains" ? t : !t;
|
|
110
|
-
}
|
|
111
|
-
return e.operator === "not_contains";
|
|
112
|
-
case "starts_with":
|
|
113
|
-
case "not_starts_with":
|
|
114
|
-
case "ends_with":
|
|
115
|
-
case "not_ends_with":
|
|
116
|
-
if (typeof i != "string" || typeof e.value != "string") return !1;
|
|
117
|
-
switch (e.operator) {
|
|
118
|
-
case "starts_with": return i.startsWith(e.value);
|
|
119
|
-
case "not_starts_with": return !i.startsWith(e.value);
|
|
120
|
-
case "ends_with": return i.endsWith(e.value);
|
|
121
|
-
case "not_ends_with": return !i.endsWith(e.value);
|
|
122
|
-
default: return !1;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}, Ue = (e, t, n) => Me(e) ? e.conditions.length === 0 ? !1 : e.combinator === "AND" ? e.conditions.every((e) => Ue(e, t, n)) : e.conditions.some((e) => Ue(e, t, n)) : He(e, t, n), We = ({ logic: e, formValues: t, sourceKinds: n }) => {
|
|
126
|
-
if (!e?.length) return { visible: !0 };
|
|
127
|
-
let r = !e.some((e) => e.action === "show");
|
|
128
|
-
for (let { action: r, when: i } of e) if (r && !Be(i, n) && !Ve(i, n) && Ue(i, t, n)) return { visible: r === "show" };
|
|
129
|
-
return { visible: r };
|
|
130
|
-
}, Ge = (e, t, n) => {
|
|
131
|
-
if (t.hidden) return !0;
|
|
132
|
-
if (!t.logic?.length || !e) return !1;
|
|
133
|
-
let r = ze(e, t.logic);
|
|
134
|
-
return !We({
|
|
135
|
-
logic: t.logic,
|
|
136
|
-
formValues: n,
|
|
137
|
-
sourceKinds: r
|
|
138
|
-
}).visible;
|
|
139
|
-
}, Ke = (e, t) => e?.sections?.[0]?.id === t.id, qe = (e, t, n) => {
|
|
140
|
-
if (Ke(e, t) || !t.logic?.length || !e) return !0;
|
|
141
|
-
let r = ze(e, t.logic);
|
|
142
|
-
return We({
|
|
143
|
-
logic: t.logic,
|
|
144
|
-
formValues: n,
|
|
145
|
-
sourceKinds: r
|
|
146
|
-
}).visible;
|
|
147
|
-
}, Je = (e) => Array.isArray(e) ? e.map((e) => {
|
|
148
|
-
if (e && typeof e == "object") {
|
|
149
|
-
let t = e.value ?? e.label ?? "";
|
|
150
|
-
return {
|
|
151
|
-
value: String(t),
|
|
152
|
-
label: String(e.label ?? e.value ?? "")
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
return {
|
|
156
|
-
value: String(e),
|
|
157
|
-
label: String(e)
|
|
158
|
-
};
|
|
159
|
-
}) : [], Ye = (e) => Je(e).map((e) => e.value), Xe = (e) => {
|
|
160
|
-
let t = {};
|
|
161
|
-
for (let n of e) {
|
|
162
|
-
if (n.kind === "collection") {
|
|
163
|
-
let e = n.options?.current_have_many_connected, r = n.options?.connected_have_many_current;
|
|
164
|
-
e && r ? t[n.key] = N.collection.m2m : t[n.key] = N.collection.m2o;
|
|
165
|
-
} else t[n.key] = N?.[n?.kind];
|
|
166
|
-
n?.field_interface === A.RecordWidget && n?.fields?.length && (t[n.key] = Xe(n.fields));
|
|
167
|
-
}
|
|
168
|
-
return t;
|
|
169
|
-
}, Ze = (e) => e === void 0 ? null : e, Qe = (e) => {
|
|
170
|
-
if (!e?.sections) return {};
|
|
171
|
-
let t = {};
|
|
172
|
-
for (let n of e.sections) {
|
|
173
|
-
let e = Xe(n.fields ?? []);
|
|
174
|
-
for (let r of n.fields ?? []) {
|
|
175
|
-
let n = Ze(r?.default_value);
|
|
176
|
-
if (n != null && $e(r)) {
|
|
177
|
-
let e = Ye(r?.values);
|
|
178
|
-
Array.isArray(n) ? n = n.filter((t) => e.includes(t)) : typeof n == "string" && !e.includes(n) && (n = null);
|
|
179
|
-
}
|
|
180
|
-
t[r.key] = n ?? e[r.key];
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return t;
|
|
184
|
-
}, $e = (e) => Array.isArray(e?.values) && e?.values?.length > 0 && !e?.options?.custom_input, et = (e, t, n) => {
|
|
185
|
-
let r = n !== void 0;
|
|
186
|
-
if (!t) return {};
|
|
187
|
-
let i = (t?.sections ?? []).flatMap((n) => {
|
|
188
|
-
let i = r ? !qe(t, n, e) : !1;
|
|
189
|
-
return (n?.fields ?? []).map((e) => ({
|
|
190
|
-
field: e,
|
|
191
|
-
sectionHidden: i
|
|
192
|
-
}));
|
|
193
|
-
}), a = {};
|
|
194
|
-
for (let { field: o, sectionHidden: s } of i) {
|
|
195
|
-
let i = r && (s || Ge(t, o, e)) ? n[o.key] : e?.[o.key];
|
|
196
|
-
o.field_interface === "CollectionWidget" ? i && typeof i == "object" ? a[o.key] = Array.isArray(i) ? i.map((e) => e && typeof e == "object" ? e._id : e).filter(Boolean) : i._id : typeof i == "string" && i ? a[o.key] = i : a[o.key] = Xe([o])[o.key] : a[o.key] = i;
|
|
197
|
-
}
|
|
198
|
-
return a;
|
|
199
|
-
}, tt = (e) => e.every((e) => {
|
|
200
|
-
let { field_interface: t = "", key: n = "", hidden: r } = e;
|
|
201
|
-
return !t || !n || r;
|
|
202
|
-
}), nt = (e, t) => {
|
|
203
|
-
let n = W(12), r;
|
|
204
|
-
n[0] !== t || n[1] !== e ? (r = e ? ze(e, t) : {}, n[0] = t, n[1] = e, n[2] = r) : r = n[2];
|
|
205
|
-
let i = r, a;
|
|
206
|
-
n[3] === i ? a = n[4] : (a = Object.keys(i), n[3] = i, n[4] = a);
|
|
207
|
-
let o = a, s;
|
|
208
|
-
n[5] !== t || n[6] !== i || n[7] !== o ? (s = (e) => {
|
|
209
|
-
let n = e ?? [], r = {};
|
|
210
|
-
return o.forEach((e, t) => {
|
|
211
|
-
r[e] = n[t];
|
|
212
|
-
}), We({
|
|
213
|
-
logic: t,
|
|
214
|
-
formValues: r,
|
|
215
|
-
sourceKinds: i
|
|
216
|
-
});
|
|
217
|
-
}, n[5] = t, n[6] = i, n[7] = o, n[8] = s) : s = n[8];
|
|
218
|
-
let c;
|
|
219
|
-
return n[9] !== o || n[10] !== s ? (c = {
|
|
220
|
-
name: o,
|
|
221
|
-
exact: !0,
|
|
222
|
-
compute: s
|
|
223
|
-
}, n[9] = o, n[10] = s, n[11] = c) : c = n[11], U(c);
|
|
224
|
-
}, rt = (e, t) => {
|
|
225
|
-
let n = W(3), { visible: r } = nt(e, t.logic), i = t.hidden || !r, a;
|
|
226
|
-
return n[0] !== t || n[1] !== i ? (a = {
|
|
227
|
-
...t,
|
|
228
|
-
hidden: i
|
|
229
|
-
}, n[0] = t, n[1] = i, n[2] = a) : a = n[2], a;
|
|
230
|
-
}, it = (e, t) => nt(e, e?.sections?.[0]?.id === t.id ? void 0 : t.logic), at = "_1kzhxrs0", ot = "_1kzhxrs1", st = "_1kzhxrs2", ct = "_1kzhxrs3", lt = "_1kzhxrs4", ut = "_1kzhxrs5", dt = "_1kzhxrs6", ft = "_1kzhxrs7", pt = "_1kzhxrs8", mt = "_1kzhxrs9", ht = "_1kzhxrsa", gt = "_1kzhxrsb", _t = "ktjhuv0", vt = Y({
|
|
231
|
-
defaultClassName: "ktjhuv1",
|
|
232
|
-
variantClassNames: { variant: {
|
|
233
|
-
default: "ktjhuv2",
|
|
234
|
-
line: "ktjhuv3"
|
|
235
|
-
} },
|
|
236
|
-
defaultVariants: { variant: "default" },
|
|
237
|
-
compoundVariants: []
|
|
238
|
-
}), yt = "ktjhuv4", bt = "ktjhuv5", xt = "ktjhuv6", St = (e) => {
|
|
239
|
-
let t = W(10), n, r, i;
|
|
240
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, orientation: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
241
|
-
let a = i === void 0 ? "horizontal" : i, o;
|
|
242
|
-
t[4] === n ? o = t[5] : (o = G(_t, n), t[4] = n, t[5] = o);
|
|
243
|
-
let s;
|
|
244
|
-
return t[6] !== a || t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ q(ce.Root, {
|
|
245
|
-
"data-slot": "tabs",
|
|
246
|
-
"data-orientation": a,
|
|
247
|
-
className: o,
|
|
248
|
-
...r
|
|
249
|
-
}), t[6] = a, t[7] = r, t[8] = o, t[9] = s) : s = t[9], s;
|
|
250
|
-
}, Ct = (e) => {
|
|
251
|
-
let t = W(11), n, r, i;
|
|
252
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, variant: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
253
|
-
let a = i === void 0 ? "default" : i, o;
|
|
254
|
-
t[4] !== n || t[5] !== a ? (o = G(vt({ variant: a }), n), t[4] = n, t[5] = a, t[6] = o) : o = t[6];
|
|
255
|
-
let s;
|
|
256
|
-
return t[7] !== r || t[8] !== o || t[9] !== a ? (s = /* @__PURE__ */ q(ce.List, {
|
|
257
|
-
"data-slot": "tabs-list",
|
|
258
|
-
"data-variant": a,
|
|
259
|
-
className: o,
|
|
260
|
-
...r
|
|
261
|
-
}), t[7] = r, t[8] = o, t[9] = a, t[10] = s) : s = t[10], s;
|
|
262
|
-
}, wt = (e) => {
|
|
263
|
-
let t = W(8), n, r;
|
|
264
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
265
|
-
let i;
|
|
266
|
-
t[3] === n ? i = t[4] : (i = G(yt, bt, n), t[3] = n, t[4] = i);
|
|
267
|
-
let a;
|
|
268
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ q(ce.Tab, {
|
|
269
|
-
"data-slot": "tabs-trigger",
|
|
270
|
-
className: i,
|
|
271
|
-
...r
|
|
272
|
-
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
273
|
-
}, Tt = (e) => {
|
|
274
|
-
let t = W(8), n, r;
|
|
275
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
276
|
-
let i;
|
|
277
|
-
t[3] === n ? i = t[4] : (i = G(xt, n), t[3] = n, t[4] = i);
|
|
278
|
-
let a;
|
|
279
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ q(ce.Panel, {
|
|
280
|
-
"data-slot": "tabs-content",
|
|
281
|
-
className: i,
|
|
282
|
-
...r
|
|
283
|
-
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
284
|
-
}, Et = (e) => {
|
|
285
|
-
let t = W(36), i, a, s;
|
|
286
|
-
t[0] === e ? (i = t[1], a = t[2], s = t[3]) : ({field: i, schema: s, ...a} = e, t[0] = e, t[1] = i, t[2] = a, t[3] = s);
|
|
287
|
-
let { key: c, label: l, field_interface: u, fields: d } = i, f = c === void 0 ? "" : c, p = l === void 0 ? "" : l, m = u === void 0 ? "" : u, h;
|
|
288
|
-
t[4] === d ? h = t[5] : (h = d === void 0 ? [] : d, t[4] = d, t[5] = h);
|
|
289
|
-
let g = h, [_, v] = Q("0"), { formState: y } = H(), b;
|
|
290
|
-
t[6] === i ? b = t[7] : (b = r(i), t[6] = i, t[7] = b);
|
|
291
|
-
let x;
|
|
292
|
-
t[8] !== f || t[9] !== b ? (x = {
|
|
293
|
-
name: f,
|
|
294
|
-
rules: b
|
|
295
|
-
}, t[8] = f, t[9] = b, t[10] = x) : x = t[10];
|
|
296
|
-
let S = B(x), C, w;
|
|
297
|
-
t[11] === S ? (C = t[12], w = t[13]) : ({fields: w, ...C} = S, t[11] = S, t[12] = C, t[13] = w);
|
|
298
|
-
let T;
|
|
299
|
-
t[14] !== y.errors || t[15] !== f ? (T = R(y.errors, f)?.root?.message, t[14] = y.errors, t[15] = f, t[16] = T) : T = t[16];
|
|
300
|
-
let E = T;
|
|
301
|
-
if (!m || !f) return null;
|
|
302
|
-
let D = i?.required, O;
|
|
303
|
-
t[17] !== p || t[18] !== D ? (O = /* @__PURE__ */ q(n, {
|
|
304
|
-
label: p,
|
|
305
|
-
isRequired: D
|
|
306
|
-
}), t[17] = p, t[18] = D, t[19] = O) : O = t[19];
|
|
307
|
-
let k;
|
|
308
|
-
t[20] !== C || t[21] !== i.id || t[22] !== i.key || t[23] !== w || t[24] !== g || t[25] !== f || t[26] !== a || t[27] !== s || t[28] !== _ ? (k = w && Array.isArray(w) ? /* @__PURE__ */ J(St, {
|
|
309
|
-
value: _,
|
|
310
|
-
onValueChange: v,
|
|
311
|
-
className: ot,
|
|
312
|
-
children: [/* @__PURE__ */ J("div", {
|
|
313
|
-
className: st,
|
|
314
|
-
children: [w.length ? /* @__PURE__ */ q(Ct, {
|
|
315
|
-
className: ct,
|
|
316
|
-
children: w?.map((e, t) => /* @__PURE__ */ q(wt, {
|
|
317
|
-
id: `${i?.key}-${t}`,
|
|
318
|
-
value: t.toString(),
|
|
319
|
-
className: lt,
|
|
320
|
-
children: t + 1
|
|
321
|
-
}, `array-widget-tab-${i?.id}-${t}`))
|
|
322
|
-
}) : null, /* @__PURE__ */ J(o, {
|
|
323
|
-
variant: "ghost",
|
|
324
|
-
size: "xs",
|
|
325
|
-
className: ut,
|
|
326
|
-
onClick: () => {
|
|
327
|
-
C.append(Xe(g)), v((w?.length ?? 0).toString());
|
|
328
|
-
},
|
|
329
|
-
children: [/* @__PURE__ */ q(ye, { size: 14 }), "Add"]
|
|
330
|
-
})]
|
|
331
|
-
}), w?.map((e, t) => /* @__PURE__ */ J(Tt, {
|
|
332
|
-
className: dt,
|
|
333
|
-
value: t.toString(),
|
|
334
|
-
children: [/* @__PURE__ */ q("div", {
|
|
335
|
-
className: ft,
|
|
336
|
-
children: g.map((e) => /* @__PURE__ */ q(Ir, {
|
|
337
|
-
field: {
|
|
338
|
-
...e,
|
|
339
|
-
key: `${f}.${t}.${e?.key}`
|
|
340
|
-
},
|
|
341
|
-
schema: s ?? null,
|
|
342
|
-
...a
|
|
343
|
-
}, `common-fields-${e?.id}`))
|
|
344
|
-
}), /* @__PURE__ */ J("div", {
|
|
345
|
-
className: pt,
|
|
346
|
-
children: [
|
|
347
|
-
/* @__PURE__ */ q(o, {
|
|
348
|
-
onClick: () => {
|
|
349
|
-
v((t - 1).toString()), C.move(t, t - 1);
|
|
350
|
-
},
|
|
351
|
-
disabled: t === 0,
|
|
352
|
-
size: "icon",
|
|
353
|
-
className: mt,
|
|
354
|
-
children: /* @__PURE__ */ q(de, { size: 20 })
|
|
355
|
-
}),
|
|
356
|
-
/* @__PURE__ */ q(o, {
|
|
357
|
-
className: ht,
|
|
358
|
-
variant: "link",
|
|
359
|
-
onClick: () => {
|
|
360
|
-
v(Math.max(0, t - 1).toString()), C.remove(t);
|
|
361
|
-
},
|
|
362
|
-
children: "Remove Item"
|
|
363
|
-
}),
|
|
364
|
-
/* @__PURE__ */ q(o, {
|
|
365
|
-
className: mt,
|
|
366
|
-
onClick: () => {
|
|
367
|
-
v((t + 1).toString()), C.move(t, t + 1);
|
|
368
|
-
},
|
|
369
|
-
disabled: t >= w.length - 1,
|
|
370
|
-
size: "icon",
|
|
371
|
-
children: /* @__PURE__ */ q(fe, { size: 20 })
|
|
372
|
-
})
|
|
373
|
-
]
|
|
374
|
-
})]
|
|
375
|
-
}, `array-widget-tab-content-${i?.id}-${t}`))]
|
|
376
|
-
}) : /* @__PURE__ */ J(o, {
|
|
377
|
-
variant: "ghost",
|
|
378
|
-
size: "xs",
|
|
379
|
-
onClick: () => {
|
|
380
|
-
C.append(Xe(g)), v("0");
|
|
381
|
-
},
|
|
382
|
-
children: [/* @__PURE__ */ q(ye, { size: 14 }), "Add"]
|
|
383
|
-
}), t[20] = C, t[21] = i.id, t[22] = i.key, t[23] = w, t[24] = g, t[25] = f, t[26] = a, t[27] = s, t[28] = _, t[29] = k) : k = t[29];
|
|
384
|
-
let A;
|
|
385
|
-
t[30] === E ? A = t[31] : (A = !!E && /* @__PURE__ */ q("div", {
|
|
386
|
-
className: "_1kzhxrsc",
|
|
387
|
-
children: /* @__PURE__ */ q("p", {
|
|
388
|
-
className: "_1ompjs13",
|
|
389
|
-
children: E
|
|
390
|
-
})
|
|
391
|
-
}), t[30] = E, t[31] = A);
|
|
392
|
-
let j;
|
|
393
|
-
return t[32] !== O || t[33] !== k || t[34] !== A ? (j = /* @__PURE__ */ J("div", {
|
|
394
|
-
className: at,
|
|
395
|
-
children: [
|
|
396
|
-
O,
|
|
397
|
-
k,
|
|
398
|
-
A
|
|
399
|
-
]
|
|
400
|
-
}), t[32] = O, t[33] = k, t[34] = A, t[35] = j) : j = t[35], j;
|
|
401
|
-
}, Dt = "_8vx4f60 _1oiks600 _1ri7vba0", Ot = "_8vx4f61", kt = "_8vx4f62", At = "_8vx4f63", jt = "_8vx4f66", Mt = "_8vx4f67", Nt = "_8vx4f68", Pt = "_8vx4f69", Ft = "_8vx4f6a", It = "_8vx4f6b", Lt = "_8vx4f6c", Rt = "_8vx4f6d _6o7s4x0", zt = "_8vx4f6e", Bt = "_8vx4f6f", Vt = "_8vx4f6g", Ht = "_8vx4f6h", Ut = "_8vx4f6k", Wt = {
|
|
402
|
-
container: () => Ot,
|
|
403
|
-
control: ({ isFocused: e, isMulti: t, isDisabled: n }) => G(Dt, t ? At : kt, e && "_8vx4f64", n && "_8vx4f65"),
|
|
404
|
-
input: () => "",
|
|
405
|
-
valueContainer: () => jt,
|
|
406
|
-
loadingMessage: () => Nt,
|
|
407
|
-
singleValue: () => "",
|
|
408
|
-
multiValue: () => Pt,
|
|
409
|
-
multiValueRemove: () => Ft,
|
|
410
|
-
indicatorsContainer: () => Mt,
|
|
411
|
-
clearIndicator: () => It,
|
|
412
|
-
indicatorSeparator: () => "",
|
|
413
|
-
dropdownIndicator: () => Lt,
|
|
414
|
-
menu: () => Rt,
|
|
415
|
-
groupHeading: () => Bt,
|
|
416
|
-
placeholder: () => Vt,
|
|
417
|
-
option: ({ isSelected: e, isFocused: t }) => G(Ht, t && "_8vx4f6i", e && "_8vx4f6j"),
|
|
418
|
-
noOptionsMessage: () => Ut,
|
|
419
|
-
menuPortal: () => zt
|
|
420
|
-
}, Gt = X.lazy(() => import("react-select-async-paginate").then((e) => ({ default: e.AsyncPaginate }))), Kt = (e) => {
|
|
421
|
-
let { portalRef: t } = s();
|
|
422
|
-
return /* @__PURE__ */ q(Gt, {
|
|
423
|
-
isClearable: !0,
|
|
424
|
-
menuPlacement: "auto",
|
|
425
|
-
isSearchable: !0,
|
|
426
|
-
unstyled: !0,
|
|
427
|
-
classNames: Wt,
|
|
428
|
-
styles: { menuPortal: (e) => ({
|
|
429
|
-
...e,
|
|
430
|
-
zIndex: 99999999
|
|
431
|
-
}) },
|
|
432
|
-
menuPosition: "fixed",
|
|
433
|
-
menuPortalTarget: t?.current,
|
|
434
|
-
loadingMessage: () => /* @__PURE__ */ q(c, { size: 16 }),
|
|
435
|
-
...e
|
|
436
|
-
});
|
|
437
|
-
}, qt = { OR: [{ _original: "" }, { _original: null }] }, Jt = (e) => e ? e.replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) : "", Yt = "_1k5k6yj0", Xt = (e) => {
|
|
438
|
-
let t = P(e);
|
|
439
|
-
return t?.code === "REQUEST_TIMEOUT" || t?.code === "NETWORK_ERROR" || t?.status === 408 || t?.status === 0 || l(t?.message || "", t?.title || "Error", { id: `${t?.title || ""}-${t?.message || ""}` }), t;
|
|
440
|
-
}, Zt = ({ field: e }) => {
|
|
441
|
-
let { collection: t } = g(), [n, a] = Q(!1), [s, l] = Q(!1), [u, d] = Q([]), [f, _] = Q(1), [v, y] = Q(5), [b, x] = Q(0), [S, C] = Q(0), { key: w = "", label: T = "", helper_text: E = "", readonly: D = !1 } = e, O = w, k = e?.options?.collection_key || "", A = e?.options?.label_field_key || "", { field: { value: j, onChange: M, ref: N }, fieldState: P } = z({
|
|
442
|
-
name: O,
|
|
443
|
-
rules: r(e)
|
|
444
|
-
}), F = !!e?.required, I = P?.error?.message, L = async () => {
|
|
445
|
-
a(!0);
|
|
446
|
-
try {
|
|
447
|
-
let e = await t?.getCollectionContentList({
|
|
448
|
-
collection_key: k,
|
|
449
|
-
page: f,
|
|
450
|
-
limit: v,
|
|
451
|
-
where: { _id: { in: j } }
|
|
452
|
-
}), n = e?.content?.data ?? [], r = e?.content?.meta?.pages ?? 0;
|
|
453
|
-
x(e?.content?.meta?.total ?? 0), C(r), f > r && _(r), d(n);
|
|
454
|
-
} catch (e) {
|
|
455
|
-
Xt(e);
|
|
456
|
-
} finally {
|
|
457
|
-
a(!1);
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
return ae(() => {
|
|
461
|
-
j?.length > 0 && L();
|
|
462
|
-
}, [
|
|
463
|
-
j,
|
|
464
|
-
f,
|
|
465
|
-
v
|
|
466
|
-
]), /* @__PURE__ */ J("div", {
|
|
467
|
-
className: Yt,
|
|
468
|
-
children: [/* @__PURE__ */ q(i, {
|
|
469
|
-
ref: N,
|
|
470
|
-
error: I,
|
|
471
|
-
helperText: E,
|
|
472
|
-
readOnly: D,
|
|
473
|
-
label: T,
|
|
474
|
-
htmlFor: O,
|
|
475
|
-
isRequired: F,
|
|
476
|
-
children: /* @__PURE__ */ q(Kt, {
|
|
477
|
-
id: O,
|
|
478
|
-
value: [],
|
|
479
|
-
onChange: (e) => {
|
|
480
|
-
e?.value?._id && M([...Array.isArray(j) ? j : [], e?.value?._id]);
|
|
481
|
-
},
|
|
482
|
-
placeholder: Array.isArray(j) && j?.length > 0 ? "Select more" : "Select",
|
|
483
|
-
filterOption: (e) => !Array.isArray(j) || !j.includes(e?.value?._id),
|
|
484
|
-
loadOptions: async (e, n, { page: r = 1 }) => {
|
|
485
|
-
l(!0);
|
|
486
|
-
try {
|
|
487
|
-
let n = Array.isArray(j) && j.length > 0 ? { AND: [{ _id: { not_in: j } }, qt] } : qt, i = (await t?.getCollectionContentList({
|
|
488
|
-
collection_key: k,
|
|
489
|
-
page: r,
|
|
490
|
-
search: e,
|
|
491
|
-
limit: 10,
|
|
492
|
-
where: n
|
|
493
|
-
}))?.content?.data, a = (i || []).map((e) => ({
|
|
494
|
-
value: {
|
|
495
|
-
_id: e?._id,
|
|
496
|
-
slug: e?.slug,
|
|
497
|
-
[A]: e?.[A]
|
|
498
|
-
},
|
|
499
|
-
label: e?.[A] ? e?.[A] : Jt(e?.slug ?? "")
|
|
500
|
-
}));
|
|
501
|
-
return {
|
|
502
|
-
options: Array.isArray(a) ? a : [],
|
|
503
|
-
hasMore: i && !(i?.length < 10),
|
|
504
|
-
additional: { page: r + 1 }
|
|
505
|
-
};
|
|
506
|
-
} catch {
|
|
507
|
-
return {
|
|
508
|
-
options: [],
|
|
509
|
-
hasMore: !1,
|
|
510
|
-
additional: { page: r }
|
|
511
|
-
};
|
|
512
|
-
} finally {
|
|
513
|
-
l(!1);
|
|
514
|
-
}
|
|
515
|
-
},
|
|
516
|
-
debounceTimeout: 500,
|
|
517
|
-
getOptionLabel: (e) => e?.label,
|
|
518
|
-
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
519
|
-
isLoading: s,
|
|
520
|
-
additional: { page: 1 },
|
|
521
|
-
cacheUniqs: [k, j],
|
|
522
|
-
minMenuHeight: 250
|
|
523
|
-
})
|
|
524
|
-
}), Array.isArray(j) && j?.length > 0 && /* @__PURE__ */ J("div", {
|
|
525
|
-
className: "_1k5k6yj1",
|
|
526
|
-
children: [
|
|
527
|
-
/* @__PURE__ */ J("h4", {
|
|
528
|
-
className: "_1k5k6yj2",
|
|
529
|
-
children: [/* @__PURE__ */ q("span", { children: "Selected" }), n && u?.length > 0 && /* @__PURE__ */ q(c, { size: 16 })]
|
|
530
|
-
}),
|
|
531
|
-
/* @__PURE__ */ q("div", {
|
|
532
|
-
className: "_1k5k6yj4",
|
|
533
|
-
children: u.map((e) => /* @__PURE__ */ J("div", {
|
|
534
|
-
className: "_1k5k6yj5",
|
|
535
|
-
children: [/* @__PURE__ */ q("div", {
|
|
536
|
-
className: "_1k5k6yj6",
|
|
537
|
-
children: e?.[A] || Jt(e?.slug ?? "")
|
|
538
|
-
}), /* @__PURE__ */ q(o, {
|
|
539
|
-
disabled: n,
|
|
540
|
-
size: "icon-sm",
|
|
541
|
-
variant: "ghost",
|
|
542
|
-
onClick: () => {
|
|
543
|
-
M(j?.filter((t) => t !== e?._id));
|
|
544
|
-
},
|
|
545
|
-
children: /* @__PURE__ */ q(Se, { size: 16 })
|
|
546
|
-
})]
|
|
547
|
-
}, e?._id))
|
|
548
|
-
}),
|
|
549
|
-
n && u?.length === 0 && /* @__PURE__ */ q("div", {
|
|
550
|
-
className: "_1k5k6yj3",
|
|
551
|
-
children: /* @__PURE__ */ q(c, { size: 24 })
|
|
552
|
-
}),
|
|
553
|
-
j?.length > 5 && /* @__PURE__ */ J("div", {
|
|
554
|
-
className: "_1k5k6yj7",
|
|
555
|
-
children: [
|
|
556
|
-
/* @__PURE__ */ J("div", {
|
|
557
|
-
className: "_1k5k6yj8",
|
|
558
|
-
children: [
|
|
559
|
-
"Showing",
|
|
560
|
-
" ",
|
|
561
|
-
b ? /* @__PURE__ */ J(K, { children: [
|
|
562
|
-
v * (f - 1) + 1,
|
|
563
|
-
"-",
|
|
564
|
-
Math.min(v * f, b),
|
|
565
|
-
" of",
|
|
566
|
-
" "
|
|
567
|
-
] }) : null,
|
|
568
|
-
b,
|
|
569
|
-
" items"
|
|
570
|
-
]
|
|
571
|
-
}),
|
|
572
|
-
/* @__PURE__ */ J("select", {
|
|
573
|
-
className: "_1k5k6yjb",
|
|
574
|
-
value: v,
|
|
575
|
-
onChange: (e) => {
|
|
576
|
-
_(1), y(Number(e.target.value));
|
|
577
|
-
},
|
|
578
|
-
children: [
|
|
579
|
-
/* @__PURE__ */ q("option", {
|
|
580
|
-
value: 5,
|
|
581
|
-
children: "5"
|
|
582
|
-
}),
|
|
583
|
-
/* @__PURE__ */ q("option", {
|
|
584
|
-
value: 10,
|
|
585
|
-
children: "10"
|
|
586
|
-
}),
|
|
587
|
-
/* @__PURE__ */ q("option", {
|
|
588
|
-
value: 25,
|
|
589
|
-
children: "25"
|
|
590
|
-
}),
|
|
591
|
-
/* @__PURE__ */ q("option", {
|
|
592
|
-
value: 50,
|
|
593
|
-
children: "50"
|
|
594
|
-
})
|
|
595
|
-
]
|
|
596
|
-
}),
|
|
597
|
-
/* @__PURE__ */ q("div", {
|
|
598
|
-
className: "_1k5k6yj9",
|
|
599
|
-
children: /* @__PURE__ */ J("div", {
|
|
600
|
-
className: "_1k5k6yja",
|
|
601
|
-
children: [
|
|
602
|
-
/* @__PURE__ */ J(h, { children: [/* @__PURE__ */ q(p, {
|
|
603
|
-
variant: "ghost",
|
|
604
|
-
size: "icon-xs",
|
|
605
|
-
onClick: () => _(1),
|
|
606
|
-
disabled: f === 1,
|
|
607
|
-
children: /* @__PURE__ */ q(pe, { size: 14 })
|
|
608
|
-
}), /* @__PURE__ */ q(m, { children: "First page" })] }),
|
|
609
|
-
/* @__PURE__ */ J(h, { children: [/* @__PURE__ */ q(p, {
|
|
610
|
-
variant: "ghost",
|
|
611
|
-
size: "icon-xs",
|
|
612
|
-
disabled: f === 1,
|
|
613
|
-
onClick: () => _(f - 1),
|
|
614
|
-
children: /* @__PURE__ */ q(de, { size: 14 })
|
|
615
|
-
}), /* @__PURE__ */ q(m, { children: "Previous page" })] }),
|
|
616
|
-
/* @__PURE__ */ J(h, { children: [/* @__PURE__ */ q(p, {
|
|
617
|
-
variant: "ghost",
|
|
618
|
-
size: "icon-xs",
|
|
619
|
-
onClick: () => _(f + 1),
|
|
620
|
-
disabled: f === S,
|
|
621
|
-
children: /* @__PURE__ */ q(fe, { size: 14 })
|
|
622
|
-
}), /* @__PURE__ */ q(m, { children: "Next page" })] }),
|
|
623
|
-
/* @__PURE__ */ J(h, { children: [/* @__PURE__ */ q(p, {
|
|
624
|
-
variant: "ghost",
|
|
625
|
-
size: "icon-xs",
|
|
626
|
-
onClick: () => _(S),
|
|
627
|
-
disabled: f === S,
|
|
628
|
-
children: /* @__PURE__ */ q(me, { size: 14 })
|
|
629
|
-
}), /* @__PURE__ */ q(m, { children: "Last page" })] })
|
|
630
|
-
]
|
|
631
|
-
})
|
|
632
|
-
})
|
|
633
|
-
]
|
|
634
|
-
})
|
|
635
|
-
]
|
|
636
|
-
})]
|
|
637
|
-
});
|
|
638
|
-
}, Qt = ({ field: e }) => {
|
|
639
|
-
let { collection: t, logger: n } = g(), [a, o] = Q(!1), { key: s = "", label: c = "", helper_text: l = "", readonly: u = !1 } = e, d = s, f = e?.options?.collection_key || "", p = e?.options?.label_field_key || "", { field: { value: m, onBlur: h, onChange: _, ref: v, disabled: y, ...b }, fieldState: x } = z({
|
|
640
|
-
name: d,
|
|
641
|
-
rules: r(e)
|
|
642
|
-
}), { setValue: S } = H(), C = !!e?.required, w = x?.error?.message, T = se(null);
|
|
643
|
-
ae(() => {
|
|
644
|
-
typeof m != "string" || !m || T.current !== m && (T.current = m, o(!0), t?.getCollectionContentList({
|
|
645
|
-
collection_key: f,
|
|
646
|
-
where: { _id: m },
|
|
647
|
-
limit: 1
|
|
648
|
-
}).then((e) => {
|
|
649
|
-
let t = e?.content?.data?.[0];
|
|
650
|
-
t && S(d, {
|
|
651
|
-
_id: t._id,
|
|
652
|
-
slug: t.slug,
|
|
653
|
-
[p]: t[p]
|
|
654
|
-
}, { shouldDirty: !1 });
|
|
655
|
-
}).catch((e) => {
|
|
656
|
-
n?.error("Failed to resolve collection default value", e);
|
|
657
|
-
}).finally(() => {
|
|
658
|
-
o(!1);
|
|
659
|
-
}));
|
|
660
|
-
}, [
|
|
661
|
-
m,
|
|
662
|
-
t,
|
|
663
|
-
f,
|
|
664
|
-
p,
|
|
665
|
-
d
|
|
666
|
-
]);
|
|
667
|
-
let E = async (e, n, { page: r = 1 }) => {
|
|
668
|
-
o(!0);
|
|
669
|
-
try {
|
|
670
|
-
let n = (await t?.getCollectionContentList({
|
|
671
|
-
collection_key: f,
|
|
672
|
-
page: r,
|
|
673
|
-
search: e,
|
|
674
|
-
limit: 10,
|
|
675
|
-
where: qt
|
|
676
|
-
}))?.content?.data, i = (n || []).map((e) => {
|
|
677
|
-
let t = e?.[p] ? e?.[p] : Jt(e?.slug || "");
|
|
678
|
-
return {
|
|
679
|
-
value: {
|
|
680
|
-
_id: e?._id,
|
|
681
|
-
slug: e?.slug,
|
|
682
|
-
[p]: e?.[p]
|
|
683
|
-
},
|
|
684
|
-
label: t
|
|
685
|
-
};
|
|
686
|
-
});
|
|
687
|
-
return {
|
|
688
|
-
options: Array.isArray(i) ? i : [],
|
|
689
|
-
hasMore: n && !(n?.length < 10),
|
|
690
|
-
additional: { page: r + 1 }
|
|
691
|
-
};
|
|
692
|
-
} catch {
|
|
693
|
-
return {
|
|
694
|
-
options: [],
|
|
695
|
-
hasMore: !1,
|
|
696
|
-
additional: { page: r }
|
|
697
|
-
};
|
|
698
|
-
} finally {
|
|
699
|
-
o(!1);
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
return /* @__PURE__ */ q(i, {
|
|
703
|
-
ref: v,
|
|
704
|
-
error: w,
|
|
705
|
-
helperText: l,
|
|
706
|
-
readOnly: u,
|
|
707
|
-
label: c,
|
|
708
|
-
htmlFor: d,
|
|
709
|
-
isRequired: C,
|
|
710
|
-
children: /* @__PURE__ */ q(Kt, {
|
|
711
|
-
id: d,
|
|
712
|
-
value: m && typeof m == "object" ? {
|
|
713
|
-
label: m?.[p] ? m?.[p] : m?.slug ? Jt(m?.slug || "") : "",
|
|
714
|
-
value: {
|
|
715
|
-
_id: m?._id,
|
|
716
|
-
slug: m?.slug,
|
|
717
|
-
[p]: m?.[p]
|
|
718
|
-
}
|
|
719
|
-
} : null,
|
|
720
|
-
onChange: (e) => {
|
|
721
|
-
_(e?.value || null);
|
|
722
|
-
},
|
|
723
|
-
onBlur: () => h(),
|
|
724
|
-
loadOptions: E,
|
|
725
|
-
debounceTimeout: 500,
|
|
726
|
-
getOptionLabel: (e) => e?.label,
|
|
727
|
-
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
728
|
-
isLoading: a,
|
|
729
|
-
additional: { page: 1 },
|
|
730
|
-
cacheUniqs: [f],
|
|
731
|
-
minMenuHeight: 250,
|
|
732
|
-
isDisabled: y,
|
|
733
|
-
...b
|
|
734
|
-
})
|
|
735
|
-
});
|
|
736
|
-
}, $t = (e) => {
|
|
737
|
-
let t = W(4), { field: n } = e, { field_interface: r, key: i, options: a } = n, o = a === void 0 ? {} : a;
|
|
738
|
-
if (!r || !i) return null;
|
|
739
|
-
if (!o?.collection_key || !o?.label_field_key) return console.error("[LevoCollection]: Error while rendering collection widget. Collection key of label field key is required."), null;
|
|
740
|
-
if (o?.current_have_many_connected && !o?.connected_have_many_current) return console.error("[LevoCollection]: O2M is not supported"), null;
|
|
741
|
-
if (o?.current_have_many_connected && o?.connected_have_many_current) {
|
|
742
|
-
let n;
|
|
743
|
-
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ q(Zt, {
|
|
744
|
-
...e,
|
|
745
|
-
schema: null
|
|
746
|
-
}), t[0] = e, t[1] = n), n;
|
|
747
|
-
}
|
|
748
|
-
let s;
|
|
749
|
-
return t[2] === e ? s = t[3] : (s = /* @__PURE__ */ q(Qt, {
|
|
750
|
-
...e,
|
|
751
|
-
schema: null
|
|
752
|
-
}), t[2] = e, t[3] = s), s;
|
|
753
|
-
}, $ = (e) => X.memo(e), en = "_1vaa8ub0", tn = "_1vaa8ub2", nn = "_1vaa8ub3", rn = "_13kepqq0", an = "_13kepqq1", on = (e) => {
|
|
754
|
-
let t = W(9), n, r;
|
|
755
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
756
|
-
let i;
|
|
757
|
-
t[3] === n ? i = t[4] : (i = G(rn, n), t[3] = n, t[4] = i);
|
|
758
|
-
let a;
|
|
759
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ q(Ce.Indicator, {
|
|
760
|
-
"data-slot": "checkbox-indicator",
|
|
761
|
-
className: an,
|
|
762
|
-
children: /* @__PURE__ */ q(ue, {})
|
|
763
|
-
}), t[5] = a) : a = t[5];
|
|
764
|
-
let o;
|
|
765
|
-
return t[6] !== r || t[7] !== i ? (o = /* @__PURE__ */ q(Ce.Root, {
|
|
766
|
-
"data-slot": "checkbox",
|
|
767
|
-
className: i,
|
|
768
|
-
...r,
|
|
769
|
-
children: a
|
|
770
|
-
}), t[6] = r, t[7] = i, t[8] = o) : o = t[8], o;
|
|
771
|
-
}, sn = ({ field: e }) => {
|
|
772
|
-
let [n, a] = Q(""), [o, s] = Q(!1), { key: c = "", label: l = "", helper_text: u = "", readonly: d = !1, values: f = [], options: p = {} } = e, { field: { name: m, onBlur: h, onChange: g, value: _, ref: v, disabled: y }, fieldState: { error: x } } = z({
|
|
773
|
-
name: c,
|
|
774
|
-
rules: r(e)
|
|
775
|
-
}), S = (e) => {
|
|
776
|
-
let t = Array.isArray(_ || null) ? [..._] : [];
|
|
777
|
-
t.includes(e) ? t = t?.filter((t) => t !== e) : t.push(e), g(t);
|
|
778
|
-
}, C = !!p?.custom_input, w = oe(() => Je(f), [f]), T = oe(() => w.map((e) => e.value), [w]);
|
|
779
|
-
return ae(() => {
|
|
780
|
-
if (C) {
|
|
781
|
-
let e = !1;
|
|
782
|
-
(_ ?? []).forEach((t) => {
|
|
783
|
-
T.includes(t) || (e = !0, a(t));
|
|
784
|
-
}), s(!!e);
|
|
785
|
-
}
|
|
786
|
-
}, [
|
|
787
|
-
_,
|
|
788
|
-
T,
|
|
789
|
-
C
|
|
790
|
-
]), /* @__PURE__ */ J(i, {
|
|
791
|
-
error: x?.message,
|
|
792
|
-
helperText: u,
|
|
793
|
-
readOnly: d,
|
|
794
|
-
label: l,
|
|
795
|
-
htmlFor: m,
|
|
796
|
-
isRequired: e?.required,
|
|
797
|
-
children: [/* @__PURE__ */ q("div", {
|
|
798
|
-
ref: v,
|
|
799
|
-
className: G(en, d && "_1vaa8ub1"),
|
|
800
|
-
children: w.map((e, n) => /* @__PURE__ */ J("div", {
|
|
801
|
-
className: tn,
|
|
802
|
-
children: [/* @__PURE__ */ q(on, {
|
|
803
|
-
id: `${m}-${e.value}-${n}`,
|
|
804
|
-
name: m,
|
|
805
|
-
checked: _ ? _?.includes(e.value) : !1,
|
|
806
|
-
onCheckedChange: () => S(e.value),
|
|
807
|
-
onBlur: () => h(),
|
|
808
|
-
disabled: y
|
|
809
|
-
}), /* @__PURE__ */ q(t, {
|
|
810
|
-
htmlFor: `${m}-${e.value}-${n}`,
|
|
811
|
-
className: nn,
|
|
812
|
-
children: e.label
|
|
813
|
-
})]
|
|
814
|
-
}, `${e.value}-${n}`))
|
|
815
|
-
}), C && /* @__PURE__ */ J("div", {
|
|
816
|
-
className: "_1vaa8ub4",
|
|
817
|
-
children: [/* @__PURE__ */ J("div", {
|
|
818
|
-
className: "_1vaa8ub5",
|
|
819
|
-
children: [/* @__PURE__ */ q(on, {
|
|
820
|
-
name: `${m}-other`,
|
|
821
|
-
id: `${m}-other`,
|
|
822
|
-
disabled: y,
|
|
823
|
-
checked: o,
|
|
824
|
-
onCheckedChange: (e) => {
|
|
825
|
-
s(!!e), e ? Array.isArray(_) ? g?.([..._, n]) : g?.([n]) : g?.((_ ?? [])?.filter((e) => e !== n));
|
|
826
|
-
},
|
|
827
|
-
onBlur: () => h()
|
|
828
|
-
}), /* @__PURE__ */ J(t, {
|
|
829
|
-
htmlFor: `${m}-other`,
|
|
830
|
-
className: "_1vaa8ub3",
|
|
831
|
-
children: ["Other:", " "]
|
|
832
|
-
})]
|
|
833
|
-
}), /* @__PURE__ */ q(b, {
|
|
834
|
-
name: `other-checkbox-${m}`,
|
|
835
|
-
className: "_1vaa8ub6",
|
|
836
|
-
value: n,
|
|
837
|
-
onChange: (e) => {
|
|
838
|
-
let t = 0;
|
|
839
|
-
g?.(_?.map((r) => r === n && !t ? (t = 1, e.target.value) : r)), a(e.target.value);
|
|
840
|
-
},
|
|
841
|
-
disabled: !o || y,
|
|
842
|
-
placeholder: "Please specify"
|
|
843
|
-
})]
|
|
844
|
-
})]
|
|
845
|
-
});
|
|
846
|
-
}, cn = (e) => {
|
|
847
|
-
let t = W(39), n, a;
|
|
848
|
-
t[0] === e ? (n = t[1], a = t[2]) : ({field: n, ...a} = e, t[0] = e, t[1] = n, t[2] = a);
|
|
849
|
-
let { key: o, label: s, helper_text: c, readonly: l } = n, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p = l === void 0 ? !1 : l, m = u, h;
|
|
850
|
-
t[3] === n ? h = t[4] : (h = r(n), t[3] = n, t[4] = h);
|
|
851
|
-
let g;
|
|
852
|
-
t[5] !== m || t[6] !== h ? (g = {
|
|
853
|
-
name: m,
|
|
854
|
-
rules: h
|
|
855
|
-
}, t[5] = m, t[6] = h, t[7] = g) : g = t[7];
|
|
856
|
-
let { field: v, fieldState: b } = z(g), x, S, C, w, T;
|
|
857
|
-
t[8] === v ? (x = t[9], S = t[10], C = t[11], w = t[12], T = t[13]) : ({value: T, onBlur: x, onChange: S, ref: C, ...w} = v, t[8] = v, t[9] = x, t[10] = S, t[11] = C, t[12] = w, t[13] = T);
|
|
858
|
-
let E = !!n?.required, D = b?.error?.message, O = n?.options?.currency_code, k = `${O || "$"} `, A = `${O || "$"} 0`, j = O === "₹" ? "lakh" : "thousand", M;
|
|
859
|
-
t[14] === S ? M = t[15] : (M = (e, t) => {
|
|
860
|
-
if (!t?.event) return;
|
|
861
|
-
let { value: n } = e;
|
|
862
|
-
S && S(n);
|
|
863
|
-
}, t[14] = S, t[15] = M);
|
|
864
|
-
let N;
|
|
865
|
-
t[16] === x ? N = t[17] : (N = () => {
|
|
866
|
-
x && x();
|
|
867
|
-
}, t[16] = x, t[17] = N);
|
|
868
|
-
let P;
|
|
869
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (P = G(y, _), t[18] = P) : P = t[18];
|
|
870
|
-
let F;
|
|
871
|
-
t[19] !== m || t[20] !== a || t[21] !== p || t[22] !== C || t[23] !== w || t[24] !== j || t[25] !== M || t[26] !== N || t[27] !== k || t[28] !== A || t[29] !== T ? (F = /* @__PURE__ */ q(we, {
|
|
872
|
-
thousandSeparator: !0,
|
|
873
|
-
prefix: k,
|
|
874
|
-
placeholder: A,
|
|
875
|
-
thousandsGroupStyle: j,
|
|
876
|
-
suffix: "",
|
|
877
|
-
allowNegative: !1,
|
|
878
|
-
id: m,
|
|
879
|
-
getInputRef: C,
|
|
880
|
-
onValueChange: M,
|
|
881
|
-
onBlur: N,
|
|
882
|
-
value: T,
|
|
883
|
-
readOnly: p,
|
|
884
|
-
className: P,
|
|
885
|
-
...w,
|
|
886
|
-
...a
|
|
887
|
-
}), t[19] = m, t[20] = a, t[21] = p, t[22] = C, t[23] = w, t[24] = j, t[25] = M, t[26] = N, t[27] = k, t[28] = A, t[29] = T, t[30] = F) : F = t[30];
|
|
888
|
-
let I;
|
|
889
|
-
return t[31] !== D || t[32] !== f || t[33] !== E || t[34] !== d || t[35] !== m || t[36] !== p || t[37] !== F ? (I = /* @__PURE__ */ q(i, {
|
|
890
|
-
error: D,
|
|
891
|
-
helperText: f,
|
|
892
|
-
readOnly: p,
|
|
893
|
-
htmlFor: m,
|
|
894
|
-
isRequired: E,
|
|
895
|
-
label: d,
|
|
896
|
-
children: F
|
|
897
|
-
}), t[31] = D, t[32] = f, t[33] = E, t[34] = d, t[35] = m, t[36] = p, t[37] = F, t[38] = I) : I = t[38], I;
|
|
898
|
-
}, ln = {
|
|
899
|
-
label: "Other",
|
|
900
|
-
value: "other_internal"
|
|
901
|
-
}, un = ({ field: e, ...t }) => {
|
|
902
|
-
let { portalRef: n } = s(), [a, o] = Q([]), { key: c = "", label: l = "", helper_text: u = "", readonly: d = !1, values: f = [], options: p = {} } = e, m = c, { field: { value: h, onBlur: g, onChange: _, disabled: v, ...y }, fieldState: x } = z({
|
|
903
|
-
name: m,
|
|
904
|
-
rules: r(e)
|
|
905
|
-
}), [S, C] = Q(""), [w, T] = Q(!1), E = !!e?.required, D = x?.error?.message, O = !!p?.custom_input;
|
|
906
|
-
return ae(() => {
|
|
907
|
-
if (f?.length) {
|
|
908
|
-
let e = [...Je(f)];
|
|
909
|
-
O && e.push(ln), o(e);
|
|
910
|
-
}
|
|
911
|
-
}, [f, O]), ae(() => {
|
|
912
|
-
!t?.isMulti && O && typeof h == "string" && h && (a.some((e) => e.value !== ln.value && e.value === h) ? T(!1) : (T(!0), C(h)));
|
|
913
|
-
}, [
|
|
914
|
-
h,
|
|
915
|
-
a,
|
|
916
|
-
O
|
|
917
|
-
]), /* @__PURE__ */ J(i, {
|
|
918
|
-
error: D,
|
|
919
|
-
helperText: u,
|
|
920
|
-
readOnly: d,
|
|
921
|
-
label: l,
|
|
922
|
-
htmlFor: m,
|
|
923
|
-
isRequired: E,
|
|
924
|
-
children: [/* @__PURE__ */ q(Te, {
|
|
925
|
-
id: m,
|
|
926
|
-
value: w ? ln : h ? t?.isMulti ? a?.filter((e) => h?.includes(e?.value)) : a?.find((e) => e?.value === h) : null,
|
|
927
|
-
onChange: (e) => {
|
|
928
|
-
O && e?.value === ln.value && e?.label === ln.label ? (T(!0), C(""), _("")) : (T(!1), t?.isMulti ? _(e?.map((e) => e?.value)) : _(e?.value));
|
|
929
|
-
},
|
|
930
|
-
onBlur: () => g(),
|
|
931
|
-
options: a,
|
|
932
|
-
isDisabled: v,
|
|
933
|
-
menuPlacement: "auto",
|
|
934
|
-
isClearable: !0,
|
|
935
|
-
...y,
|
|
936
|
-
...t,
|
|
937
|
-
unstyled: !0,
|
|
938
|
-
classNames: Wt,
|
|
939
|
-
styles: { menuPortal: (e) => ({
|
|
940
|
-
...e,
|
|
941
|
-
zIndex: 99999999
|
|
942
|
-
}) },
|
|
943
|
-
menuPosition: "fixed",
|
|
944
|
-
menuPortalTarget: n?.current
|
|
945
|
-
}), w && /* @__PURE__ */ q("div", {
|
|
946
|
-
className: "ldp9z20",
|
|
947
|
-
children: /* @__PURE__ */ q(b, {
|
|
948
|
-
name: `select-other-${m}`,
|
|
949
|
-
value: S,
|
|
950
|
-
onChange: (e) => {
|
|
951
|
-
_?.(e.target.value), C(e.target.value);
|
|
952
|
-
},
|
|
953
|
-
placeholder: "Other, Please Specify"
|
|
954
|
-
})
|
|
955
|
-
})]
|
|
956
|
-
});
|
|
957
|
-
}, dn = "eviv4t0", fn = "eviv4t1", pn = "eviv4t3", mn = (e) => {
|
|
958
|
-
let t = W(50), n, a, o;
|
|
959
|
-
t[0] === e ? (n = t[1], a = t[2], o = t[3]) : ({field: n, settings: o, ...a} = e, t[0] = e, t[1] = n, t[2] = a, t[3] = o);
|
|
960
|
-
let { key: s, label: c, helper_text: l, readonly: u } = n, d = s === void 0 ? "" : s, p = c === void 0 ? "" : c, m = l === void 0 ? "" : l, h = u === void 0 ? !1 : u, g = d, _ = !!n.options?.verification && !!o?.enableVerification, [v, y] = Q(null), [x, S] = Q(!1), C;
|
|
961
|
-
t[4] !== x || t[5] !== _ || t[6] !== v ? (C = (e) => x ? !0 : _ && (!v || v !== e) ? "Email verification required" : !0, t[4] = x, t[5] = _, t[6] = v, t[7] = C) : C = t[7];
|
|
962
|
-
let w;
|
|
963
|
-
t[8] !== n || t[9] !== C ? (w = r(n, C), t[8] = n, t[9] = C, t[10] = w) : w = t[10];
|
|
964
|
-
let T = w, E;
|
|
965
|
-
t[11] !== g || t[12] !== T ? (E = {
|
|
966
|
-
name: g,
|
|
967
|
-
rules: T
|
|
968
|
-
}, t[11] = g, t[12] = T, t[13] = E) : E = t[13];
|
|
969
|
-
let { field: D, fieldState: O } = z(E), k, A, j, M;
|
|
970
|
-
t[14] === D ? (k = t[15], A = t[16], j = t[17], M = t[18]) : ({value: M, onBlur: A, onChange: j, ...k} = D, t[14] = D, t[15] = k, t[16] = A, t[17] = j, t[18] = M);
|
|
971
|
-
let N = !!n?.required, P = O?.error?.message, F = !!v && !!M && v === M?.trim()?.toLowerCase(), I;
|
|
972
|
-
t[19] === j ? I = t[20] : (I = (e) => {
|
|
973
|
-
y(e), j(e);
|
|
974
|
-
}, t[19] = j, t[20] = I);
|
|
975
|
-
let L = I, ee;
|
|
976
|
-
t[21] === Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ q(_e, { size: 20 }), t[21] = ee) : ee = t[21];
|
|
977
|
-
let R;
|
|
978
|
-
t[22] === F ? R = t[23] : (R = F ? /* @__PURE__ */ q("button", {
|
|
979
|
-
type: "button",
|
|
980
|
-
onClick: () => y(null),
|
|
981
|
-
className: pn,
|
|
982
|
-
title: "Change email",
|
|
983
|
-
children: /* @__PURE__ */ q(ve, { size: 14 })
|
|
984
|
-
}) : null, t[22] = F, t[23] = R);
|
|
985
|
-
let B = M || "", V;
|
|
986
|
-
t[24] === j ? V = t[25] : (V = (e) => j(e?.target?.value?.trim()?.toLocaleLowerCase()), t[24] = j, t[25] = V);
|
|
987
|
-
let H = h || F, U;
|
|
988
|
-
t[26] !== k || t[27] !== g || t[28] !== A || t[29] !== a || t[30] !== R || t[31] !== B || t[32] !== V || t[33] !== H ? (U = /* @__PURE__ */ q(b, {
|
|
989
|
-
className: fn,
|
|
990
|
-
id: g,
|
|
991
|
-
type: "email",
|
|
992
|
-
leftIcon: ee,
|
|
993
|
-
rightIcon: R,
|
|
994
|
-
value: B,
|
|
995
|
-
onChange: V,
|
|
996
|
-
onBlur: A,
|
|
997
|
-
readOnly: H,
|
|
998
|
-
...k,
|
|
999
|
-
...a
|
|
1000
|
-
}), t[26] = k, t[27] = g, t[28] = A, t[29] = a, t[30] = R, t[31] = B, t[32] = V, t[33] = H, t[34] = U) : U = t[34];
|
|
1001
|
-
let G;
|
|
1002
|
-
t[35] !== L || t[36] !== F || t[37] !== _ || t[38] !== M ? (G = _ && /* @__PURE__ */ q("div", {
|
|
1003
|
-
className: "eviv4t2",
|
|
1004
|
-
children: /* @__PURE__ */ q(f, {
|
|
1005
|
-
value: M,
|
|
1006
|
-
type: "email",
|
|
1007
|
-
isVerified: F,
|
|
1008
|
-
onVerifySuccess: L,
|
|
1009
|
-
onStateChange: S
|
|
1010
|
-
})
|
|
1011
|
-
}), t[35] = L, t[36] = F, t[37] = _, t[38] = M, t[39] = G) : G = t[39];
|
|
1012
|
-
let K;
|
|
1013
|
-
t[40] !== U || t[41] !== G ? (K = /* @__PURE__ */ J("div", {
|
|
1014
|
-
className: dn,
|
|
1015
|
-
children: [U, G]
|
|
1016
|
-
}), t[40] = U, t[41] = G, t[42] = K) : K = t[42];
|
|
1017
|
-
let Y;
|
|
1018
|
-
return t[43] !== P || t[44] !== m || t[45] !== N || t[46] !== p || t[47] !== g || t[48] !== K ? (Y = /* @__PURE__ */ q(i, {
|
|
1019
|
-
error: P,
|
|
1020
|
-
helperText: m,
|
|
1021
|
-
label: p,
|
|
1022
|
-
htmlFor: g,
|
|
1023
|
-
isRequired: N,
|
|
1024
|
-
children: K
|
|
1025
|
-
}), t[43] = P, t[44] = m, t[45] = N, t[46] = p, t[47] = g, t[48] = K, t[49] = Y) : Y = t[49], Y;
|
|
1026
|
-
}, hn = (e) => e ? {
|
|
1027
|
-
value: e,
|
|
1028
|
-
label: e?.place_name || e?.formatted_address || e?.name
|
|
1029
|
-
} : null, gn = ({ field: e }) => {
|
|
1030
|
-
let { portalRef: t } = s(), [n, a] = Q(!1), [o, c] = Q(!1), l = g(), { key: u = "", label: d = "", helper_text: f = "", readonly: p = !1 } = e, { field: { value: m, onBlur: h, onChange: _, disabled: v, ...y }, fieldState: b } = z({
|
|
1031
|
-
name: u,
|
|
1032
|
-
rules: r(e)
|
|
1033
|
-
}), x = !!e?.required, S = b?.error?.message, C = (e) => {
|
|
1034
|
-
e && e?.place_id !== m?.place_id ? (c(!0), l?.fetch.url(`/v1/bevy/content/location/${e?.place_id}/get-location-details`).get().json().then((e) => {
|
|
1035
|
-
_ && _(e?.content?.data);
|
|
1036
|
-
}).catch((e) => {
|
|
1037
|
-
console.log("Could not fetch location details:", P(e).message);
|
|
1038
|
-
}).finally(() => c(!1))) : _(null);
|
|
1039
|
-
}, w = (t, n) => {
|
|
1040
|
-
a(!0);
|
|
1041
|
-
let r = {};
|
|
1042
|
-
e?.options?.location_type && (r.location_type = e?.options?.location_type), e?.options?.country && (r.country = e?.options?.country), l?.fetch.url("/v1/bevy/content/location/search-location").post({
|
|
1043
|
-
search: t,
|
|
1044
|
-
where: r
|
|
1045
|
-
}).json().then((e) => {
|
|
1046
|
-
n(e?.content?.data?.map((e) => ({
|
|
1047
|
-
label: e?.description,
|
|
1048
|
-
value: e
|
|
1049
|
-
})));
|
|
1050
|
-
}).catch(() => {
|
|
1051
|
-
n([]);
|
|
1052
|
-
}).finally(() => a(!1));
|
|
1053
|
-
};
|
|
1054
|
-
return /* @__PURE__ */ q(i, {
|
|
1055
|
-
error: S,
|
|
1056
|
-
helperText: f,
|
|
1057
|
-
readOnly: p,
|
|
1058
|
-
label: d,
|
|
1059
|
-
htmlFor: u,
|
|
1060
|
-
isRequired: x,
|
|
1061
|
-
children: /* @__PURE__ */ q(Ee, {
|
|
1062
|
-
id: u,
|
|
1063
|
-
value: hn(m),
|
|
1064
|
-
defaultOptions: m ? [hn(m)] : void 0,
|
|
1065
|
-
onChange: (e) => {
|
|
1066
|
-
C(e?.value);
|
|
1067
|
-
},
|
|
1068
|
-
onBlur: h,
|
|
1069
|
-
isDisabled: v || o,
|
|
1070
|
-
menuPlacement: "auto",
|
|
1071
|
-
...y,
|
|
1072
|
-
unstyled: !0,
|
|
1073
|
-
classNames: Wt,
|
|
1074
|
-
styles: { menuPortal: (e) => ({
|
|
1075
|
-
...e,
|
|
1076
|
-
zIndex: 99999999
|
|
1077
|
-
}) },
|
|
1078
|
-
menuPosition: "fixed",
|
|
1079
|
-
menuPortalTarget: t?.current,
|
|
1080
|
-
loadOptions: w,
|
|
1081
|
-
isLoading: n || o,
|
|
1082
|
-
isClearable: !0,
|
|
1083
|
-
noOptionsMessage: ({ inputValue: e }) => e ? "No results found. Try searching something else" : "Start typing to search"
|
|
1084
|
-
})
|
|
1085
|
-
});
|
|
1086
|
-
}, _n = "xgv9uh0", vn = "xgv9uh1", yn = "xgv9uh2", bn = "xgv9uh3", xn = "xgv9uh4", Sn = "xgv9uh5", Cn = (e) => {
|
|
1087
|
-
let n = W(29), { field: r } = e, { key: i, label: a } = r, s = i === void 0 ? "" : i, c = a === void 0 ? "" : a, l;
|
|
1088
|
-
n[0] === s ? l = n[1] : (l = { name: s }, n[0] = s, n[1] = l);
|
|
1089
|
-
let u = B(l), d, f, p, m, h, g;
|
|
1090
|
-
if (n[2] !== r || n[3] !== s || n[4] !== c || n[5] !== u) {
|
|
1091
|
-
let { fields: e, ...i } = u;
|
|
1092
|
-
d = i, m = _n, h = s, n[12] !== s || n[13] !== c ? (g = c && /* @__PURE__ */ q(t, {
|
|
1093
|
-
htmlFor: s,
|
|
1094
|
-
className: "_1ompjs11",
|
|
1095
|
-
children: c
|
|
1096
|
-
}), n[12] = s, n[13] = c, n[14] = g) : g = n[14], f = vn, p = e?.map((e, t) => /* @__PURE__ */ J("div", {
|
|
1097
|
-
className: bn,
|
|
1098
|
-
children: [/* @__PURE__ */ q("div", {
|
|
1099
|
-
className: xn,
|
|
1100
|
-
children: /* @__PURE__ */ q(gn, { field: {
|
|
1101
|
-
...r,
|
|
1102
|
-
key: `${s}.${t}`,
|
|
1103
|
-
label: ""
|
|
1104
|
-
} })
|
|
1105
|
-
}), /* @__PURE__ */ q(o, {
|
|
1106
|
-
variant: "ghost",
|
|
1107
|
-
size: "icon-sm",
|
|
1108
|
-
className: Sn,
|
|
1109
|
-
onClick: () => d.remove(t),
|
|
1110
|
-
"aria-label": `Remove location ${t + 1}`,
|
|
1111
|
-
children: /* @__PURE__ */ q(be, { size: 14 })
|
|
1112
|
-
})]
|
|
1113
|
-
}, e.id)), n[2] = r, n[3] = s, n[4] = c, n[5] = u, n[6] = d, n[7] = f, n[8] = p, n[9] = m, n[10] = h, n[11] = g;
|
|
1114
|
-
} else d = n[6], f = n[7], p = n[8], m = n[9], h = n[10], g = n[11];
|
|
1115
|
-
let _;
|
|
1116
|
-
n[15] === d ? _ = n[16] : (_ = () => {
|
|
1117
|
-
d.append(null);
|
|
1118
|
-
}, n[15] = d, n[16] = _);
|
|
1119
|
-
let v;
|
|
1120
|
-
n[17] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ q(ye, { size: 14 }), n[17] = v) : v = n[17];
|
|
1121
|
-
let y;
|
|
1122
|
-
n[18] === _ ? y = n[19] : (y = /* @__PURE__ */ J(o, {
|
|
1123
|
-
variant: "ghost",
|
|
1124
|
-
size: "xs",
|
|
1125
|
-
className: yn,
|
|
1126
|
-
onClick: _,
|
|
1127
|
-
children: [v, "Add"]
|
|
1128
|
-
}), n[18] = _, n[19] = y);
|
|
1129
|
-
let b;
|
|
1130
|
-
n[20] !== y || n[21] !== f || n[22] !== p ? (b = /* @__PURE__ */ J("div", {
|
|
1131
|
-
className: f,
|
|
1132
|
-
children: [p, y]
|
|
1133
|
-
}), n[20] = y, n[21] = f, n[22] = p, n[23] = b) : b = n[23];
|
|
1134
|
-
let x;
|
|
1135
|
-
return n[24] !== b || n[25] !== m || n[26] !== h || n[27] !== g ? (x = /* @__PURE__ */ J("div", {
|
|
1136
|
-
className: m,
|
|
1137
|
-
children: [g, b]
|
|
1138
|
-
}, h), n[24] = b, n[25] = m, n[26] = h, n[27] = g, n[28] = x) : x = n[28], x;
|
|
1139
|
-
}, wn = "a22xph0", Tn = "a22xph2", En = "a22xph3", Dn = "a22xph5", On = /[\n\t,]+/, kn = ({ field: e }) => {
|
|
1140
|
-
let { key: t = "", label: n = "", helper_text: a = "", readonly: o = !1 } = e, s = t, { field: { value: c, onChange: l, onBlur: u, ref: d }, fieldState: f } = z({
|
|
1141
|
-
name: s,
|
|
1142
|
-
rules: r(e)
|
|
1143
|
-
}), p = !!e?.required, m = f?.error?.message, h = Array.isArray(c) ? c : [], [g, _] = Q(""), [v, y] = Q(-1), b = se(null), x = ie((e) => {
|
|
1144
|
-
b.current = e, typeof d == "function" && d(e);
|
|
1145
|
-
}, [d]), S = ie((e) => {
|
|
1146
|
-
l(h.filter((t, n) => n !== e));
|
|
1147
|
-
}, [h, l]), C = ie(() => {
|
|
1148
|
-
if (!g.trim()) return;
|
|
1149
|
-
let e = g.split(On), t = [...h];
|
|
1150
|
-
for (let n of e) {
|
|
1151
|
-
let e = n.trim();
|
|
1152
|
-
e && !t.includes(e) && t.push(e);
|
|
1153
|
-
}
|
|
1154
|
-
l(t), _("");
|
|
1155
|
-
}, [
|
|
1156
|
-
g,
|
|
1157
|
-
h,
|
|
1158
|
-
l
|
|
1159
|
-
]), w = ie((e) => {
|
|
1160
|
-
let t = e.currentTarget;
|
|
1161
|
-
switch (e.key) {
|
|
1162
|
-
case "Enter":
|
|
1163
|
-
g.trim() && (e.preventDefault(), C());
|
|
1164
|
-
break;
|
|
1165
|
-
case "Backspace":
|
|
1166
|
-
t.selectionStart === 0 && t.selectionEnd === 0 && h.length > 0 && (v >= 0 ? (S(v), y(v > 0 ? v - 1 : -1)) : y(h.length - 1));
|
|
1167
|
-
break;
|
|
1168
|
-
case "Delete":
|
|
1169
|
-
v >= 0 && v < h.length && (S(v), y(v < h.length - 1 ? v : -1));
|
|
1170
|
-
break;
|
|
1171
|
-
case "ArrowLeft":
|
|
1172
|
-
t.selectionStart === 0 && h.length > 0 && (e.preventDefault(), y(v > 0 ? v - 1 : v === -1 ? h.length - 1 : 0));
|
|
1173
|
-
break;
|
|
1174
|
-
case "ArrowRight":
|
|
1175
|
-
v >= 0 && (e.preventDefault(), v < h.length - 1 ? y(v + 1) : y(-1));
|
|
1176
|
-
break;
|
|
1177
|
-
case "Escape":
|
|
1178
|
-
y(-1);
|
|
1179
|
-
break;
|
|
1180
|
-
default:
|
|
1181
|
-
v >= 0 && y(-1);
|
|
1182
|
-
break;
|
|
1183
|
-
}
|
|
1184
|
-
}, [
|
|
1185
|
-
g,
|
|
1186
|
-
h,
|
|
1187
|
-
v,
|
|
1188
|
-
C,
|
|
1189
|
-
S
|
|
1190
|
-
]), T = ie((e) => {
|
|
1191
|
-
let t = e.clipboardData.getData("text");
|
|
1192
|
-
if (On.test(t)) {
|
|
1193
|
-
e.preventDefault();
|
|
1194
|
-
let n = t.split(On), r = [...h];
|
|
1195
|
-
for (let e of n) {
|
|
1196
|
-
let t = e.trim();
|
|
1197
|
-
t && !r.includes(t) && r.push(t);
|
|
1198
|
-
}
|
|
1199
|
-
l(r), _("");
|
|
1200
|
-
}
|
|
1201
|
-
}, [h, l]), E = ie(() => {
|
|
1202
|
-
b.current?.focus(), y(-1);
|
|
1203
|
-
}, []), D = ie(() => {
|
|
1204
|
-
C(), y(-1), u();
|
|
1205
|
-
}, [C, u]);
|
|
1206
|
-
return /* @__PURE__ */ q(i, {
|
|
1207
|
-
error: m,
|
|
1208
|
-
helperText: a,
|
|
1209
|
-
label: n,
|
|
1210
|
-
htmlFor: s,
|
|
1211
|
-
isRequired: p,
|
|
1212
|
-
children: /* @__PURE__ */ J("div", {
|
|
1213
|
-
className: wn,
|
|
1214
|
-
"data-readonly": o,
|
|
1215
|
-
onClick: E,
|
|
1216
|
-
children: [h.map((e, t) => /* @__PURE__ */ J("span", {
|
|
1217
|
-
className: Tn,
|
|
1218
|
-
"data-active": v === t,
|
|
1219
|
-
children: [/* @__PURE__ */ q("span", {
|
|
1220
|
-
className: En,
|
|
1221
|
-
children: e
|
|
1222
|
-
}), !o && /* @__PURE__ */ q("button", {
|
|
1223
|
-
type: "button",
|
|
1224
|
-
className: "a22xph4",
|
|
1225
|
-
onClick: (e) => {
|
|
1226
|
-
e.stopPropagation(), S(t), b.current?.focus();
|
|
1227
|
-
},
|
|
1228
|
-
"aria-label": `Remove ${e}`,
|
|
1229
|
-
tabIndex: -1,
|
|
1230
|
-
children: /* @__PURE__ */ q(Se, { size: 12 })
|
|
1231
|
-
})]
|
|
1232
|
-
}, `${e}-${t}`)), /* @__PURE__ */ q("input", {
|
|
1233
|
-
ref: x,
|
|
1234
|
-
id: s,
|
|
1235
|
-
className: Dn,
|
|
1236
|
-
type: "text",
|
|
1237
|
-
value: g,
|
|
1238
|
-
onChange: (e) => _(e.target.value),
|
|
1239
|
-
onKeyDown: w,
|
|
1240
|
-
onPaste: T,
|
|
1241
|
-
onBlur: D,
|
|
1242
|
-
placeholder: h.length === 0 ? e.placeholder || "Type and press Enter" : "",
|
|
1243
|
-
readOnly: o,
|
|
1244
|
-
disabled: o,
|
|
1245
|
-
autoComplete: "off"
|
|
1246
|
-
})]
|
|
1247
|
-
})
|
|
1248
|
-
});
|
|
1249
|
-
}, An = "jqes4z0", jn = "jqes4z2", Mn = "jqes4z3", Nn = "_1mrsmih0", Pn = "_1mrsmih1", Fn = "_1mrsmih2", In = "_1mrsmih3", Ln = (e) => {
|
|
1250
|
-
let t = W(8), n, r;
|
|
1251
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1252
|
-
let i;
|
|
1253
|
-
t[3] === n ? i = t[4] : (i = G(Nn, n), t[3] = n, t[4] = i);
|
|
1254
|
-
let a;
|
|
1255
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ q(Oe, {
|
|
1256
|
-
"data-slot": "radio-group",
|
|
1257
|
-
className: i,
|
|
1258
|
-
...r
|
|
1259
|
-
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1260
|
-
}, Rn = (e) => {
|
|
1261
|
-
let t = W(9), n, r;
|
|
1262
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1263
|
-
let i;
|
|
1264
|
-
t[3] === n ? i = t[4] : (i = G(Pn, n), t[3] = n, t[4] = i);
|
|
1265
|
-
let a;
|
|
1266
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ q(De.Indicator, {
|
|
1267
|
-
"data-slot": "radio-group-indicator",
|
|
1268
|
-
className: Fn,
|
|
1269
|
-
children: /* @__PURE__ */ q("span", { className: In })
|
|
1270
|
-
}), t[5] = a) : a = t[5];
|
|
1271
|
-
let o;
|
|
1272
|
-
return t[6] !== r || t[7] !== i ? (o = /* @__PURE__ */ q(De.Root, {
|
|
1273
|
-
"data-slot": "radio-group-item",
|
|
1274
|
-
className: i,
|
|
1275
|
-
...r,
|
|
1276
|
-
children: a
|
|
1277
|
-
}), t[6] = r, t[7] = i, t[8] = o) : o = t[8], o;
|
|
1278
|
-
}, zn = (e) => {
|
|
1279
|
-
let n = W(56), { field: a } = e, [o, s] = te.useState(""), [c, l] = te.useState(!1), { key: u, label: d, helper_text: f, readonly: p, values: m, options: h } = a, g = u === void 0 ? "" : u, _ = d === void 0 ? "" : d, v = f === void 0 ? "" : f, y = p === void 0 ? !1 : p, x;
|
|
1280
|
-
n[0] === m ? x = n[1] : (x = m === void 0 ? [] : m, n[0] = m, n[1] = x);
|
|
1281
|
-
let S = x, C;
|
|
1282
|
-
n[2] === h ? C = n[3] : (C = h === void 0 ? {} : h, n[2] = h, n[3] = C);
|
|
1283
|
-
let { custom_input: w } = C, T = g, E;
|
|
1284
|
-
n[4] === a ? E = n[5] : (E = r(a), n[4] = a, n[5] = E);
|
|
1285
|
-
let D;
|
|
1286
|
-
n[6] !== T || n[7] !== E ? (D = {
|
|
1287
|
-
name: T,
|
|
1288
|
-
rules: E
|
|
1289
|
-
}, n[6] = T, n[7] = E, n[8] = D) : D = n[8];
|
|
1290
|
-
let { field: O, fieldState: k } = z(D), A, j, M, N;
|
|
1291
|
-
n[9] === O ? (A = n[10], j = n[11], M = n[12], N = n[13]) : ({value: N, onBlur: A, onChange: j, ...M} = O, n[9] = O, n[10] = A, n[11] = j, n[12] = M, n[13] = N);
|
|
1292
|
-
let P = !!a?.required, F = k?.error?.message, I;
|
|
1293
|
-
n[14] === S ? I = n[15] : (I = Je(S), n[14] = S, n[15] = I);
|
|
1294
|
-
let L = I, ee, R;
|
|
1295
|
-
n[16] !== L || n[17] !== c || n[18] !== N ? (ee = () => {
|
|
1296
|
-
c || N && L.findIndex((e) => e.value === N) === -1 && (l(!0), s(N));
|
|
1297
|
-
}, R = [
|
|
1298
|
-
N,
|
|
1299
|
-
L,
|
|
1300
|
-
c
|
|
1301
|
-
], n[16] = L, n[17] = c, n[18] = N, n[19] = ee, n[20] = R) : (ee = n[19], R = n[20]), te.useEffect(ee, R);
|
|
1302
|
-
let B = y && "jqes4z1", V;
|
|
1303
|
-
n[21] === B ? V = n[22] : (V = G(An, B), n[21] = B, n[22] = V);
|
|
1304
|
-
let H;
|
|
1305
|
-
n[23] !== j || n[24] !== o ? (H = (e) => {
|
|
1306
|
-
j && (e === "Other" ? (l(!0), j(o)) : (l(!1), j(e)));
|
|
1307
|
-
}, n[23] = j, n[24] = o, n[25] = H) : H = n[25];
|
|
1308
|
-
let U;
|
|
1309
|
-
n[26] === A ? U = n[27] : (U = () => A(), n[26] = A, n[27] = U);
|
|
1310
|
-
let K = c ? "Other" : N ?? "", Y;
|
|
1311
|
-
if (n[28] !== L || n[29] !== T) {
|
|
1312
|
-
let e;
|
|
1313
|
-
n[31] === T ? e = n[32] : (e = (e, n) => /* @__PURE__ */ J("div", {
|
|
1314
|
-
className: jn,
|
|
1315
|
-
children: [/* @__PURE__ */ q(Rn, {
|
|
1316
|
-
id: `${T}-${e.value}-${n}`,
|
|
1317
|
-
value: e.value
|
|
1318
|
-
}), /* @__PURE__ */ q(t, {
|
|
1319
|
-
htmlFor: `${T}-${e.value}-${n}`,
|
|
1320
|
-
className: Mn,
|
|
1321
|
-
children: e.label
|
|
1322
|
-
})]
|
|
1323
|
-
}, `${e.value}-${n}`), n[31] = T, n[32] = e), Y = L.map(e), n[28] = L, n[29] = T, n[30] = Y;
|
|
1324
|
-
} else Y = n[30];
|
|
1325
|
-
let X;
|
|
1326
|
-
n[33] !== w || n[34] !== T || n[35] !== j || n[36] !== c || n[37] !== o ? (X = !!w && /* @__PURE__ */ J("div", {
|
|
1327
|
-
className: "jqes4z4",
|
|
1328
|
-
children: [
|
|
1329
|
-
/* @__PURE__ */ q(Rn, {
|
|
1330
|
-
id: `${T}-other`,
|
|
1331
|
-
value: "Other"
|
|
1332
|
-
}),
|
|
1333
|
-
/* @__PURE__ */ q(t, {
|
|
1334
|
-
className: "jqes4z3",
|
|
1335
|
-
htmlFor: `${T}-other`,
|
|
1336
|
-
children: "Other:"
|
|
1337
|
-
}),
|
|
1338
|
-
/* @__PURE__ */ q("div", {
|
|
1339
|
-
className: "jqes4z6",
|
|
1340
|
-
children: /* @__PURE__ */ q(b, {
|
|
1341
|
-
className: "jqes4z5",
|
|
1342
|
-
name: `radio-other-${T}`,
|
|
1343
|
-
value: o,
|
|
1344
|
-
onChange: (e) => {
|
|
1345
|
-
j?.(e?.target?.value), s(e.target.value);
|
|
1346
|
-
},
|
|
1347
|
-
disabled: !c,
|
|
1348
|
-
placeholder: "Please specify"
|
|
1349
|
-
})
|
|
1350
|
-
})
|
|
1351
|
-
]
|
|
1352
|
-
}), n[33] = w, n[34] = T, n[35] = j, n[36] = c, n[37] = o, n[38] = X) : X = n[38];
|
|
1353
|
-
let Z;
|
|
1354
|
-
n[39] !== T || n[40] !== M || n[41] !== V || n[42] !== H || n[43] !== U || n[44] !== K || n[45] !== Y || n[46] !== X ? (Z = /* @__PURE__ */ J(Ln, {
|
|
1355
|
-
id: T,
|
|
1356
|
-
className: V,
|
|
1357
|
-
onValueChange: H,
|
|
1358
|
-
onBlur: U,
|
|
1359
|
-
value: K,
|
|
1360
|
-
...M,
|
|
1361
|
-
children: [Y, X]
|
|
1362
|
-
}), n[39] = T, n[40] = M, n[41] = V, n[42] = H, n[43] = U, n[44] = K, n[45] = Y, n[46] = X, n[47] = Z) : Z = n[47];
|
|
1363
|
-
let ne;
|
|
1364
|
-
return n[48] !== F || n[49] !== v || n[50] !== P || n[51] !== _ || n[52] !== T || n[53] !== y || n[54] !== Z ? (ne = /* @__PURE__ */ q(i, {
|
|
1365
|
-
error: F,
|
|
1366
|
-
helperText: v,
|
|
1367
|
-
readOnly: y,
|
|
1368
|
-
label: _,
|
|
1369
|
-
htmlFor: T,
|
|
1370
|
-
isRequired: P,
|
|
1371
|
-
children: Z
|
|
1372
|
-
}), n[48] = F, n[49] = v, n[50] = P, n[51] = _, n[52] = T, n[53] = y, n[54] = Z, n[55] = ne) : ne = n[55], ne;
|
|
1373
|
-
}, Bn = "i9l98i0", Vn = Y({
|
|
1374
|
-
defaultClassName: "_193nrs70",
|
|
1375
|
-
variantClassNames: { size: {
|
|
1376
|
-
default: "_193nrs71",
|
|
1377
|
-
sm: "_193nrs72"
|
|
1378
|
-
} },
|
|
1379
|
-
defaultVariants: { size: "default" },
|
|
1380
|
-
compoundVariants: []
|
|
1381
|
-
}), Hn = "_193nrs73", Un = "_193nrs74", Wn = "_193nrs75", Gn = (e) => {
|
|
1382
|
-
let t = W(15), n, r, i;
|
|
1383
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, size: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1384
|
-
let a = i === void 0 ? "default" : i, o;
|
|
1385
|
-
t[4] !== n || t[5] !== a ? (o = G(Vn({ size: a }), n), t[4] = n, t[5] = a, t[6] = o) : o = t[6];
|
|
1386
|
-
let s = a === "sm" ? Wn : Un, c;
|
|
1387
|
-
t[7] === s ? c = t[8] : (c = G(Hn, s), t[7] = s, t[8] = c);
|
|
1388
|
-
let l;
|
|
1389
|
-
t[9] === c ? l = t[10] : (l = /* @__PURE__ */ q(ke.Thumb, {
|
|
1390
|
-
"data-slot": "switch-thumb",
|
|
1391
|
-
className: c
|
|
1392
|
-
}), t[9] = c, t[10] = l);
|
|
1393
|
-
let u;
|
|
1394
|
-
return t[11] !== r || t[12] !== o || t[13] !== l ? (u = /* @__PURE__ */ q(ke.Root, {
|
|
1395
|
-
"data-slot": "switch",
|
|
1396
|
-
className: o,
|
|
1397
|
-
...r,
|
|
1398
|
-
children: l
|
|
1399
|
-
}), t[11] = r, t[12] = o, t[13] = l, t[14] = u) : u = t[14], u;
|
|
1400
|
-
}, Kn = (e) => {
|
|
1401
|
-
let t = W(32), { field: a } = e, { key: o, label: s, helper_text: c, readonly: l } = a, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p = l === void 0 ? !1 : l, m = u, h;
|
|
1402
|
-
t[0] === a ? h = t[1] : (h = r(a), t[0] = a, t[1] = h);
|
|
1403
|
-
let g;
|
|
1404
|
-
t[2] !== m || t[3] !== h ? (g = {
|
|
1405
|
-
name: m,
|
|
1406
|
-
rules: h
|
|
1407
|
-
}, t[2] = m, t[3] = h, t[4] = g) : g = t[4];
|
|
1408
|
-
let { field: _, fieldState: v } = z(g), y, b, x, S;
|
|
1409
|
-
t[5] === _ ? (y = t[6], b = t[7], x = t[8], S = t[9]) : ({value: S, onBlur: y, onChange: b, ...x} = _, t[5] = _, t[6] = y, t[7] = b, t[8] = x, t[9] = S);
|
|
1410
|
-
let C = !!a?.required, w = v?.error?.message, T = !!S, E;
|
|
1411
|
-
t[10] === b ? E = t[11] : (E = (e) => b?.(e), t[10] = b, t[11] = E);
|
|
1412
|
-
let D;
|
|
1413
|
-
t[12] === y ? D = t[13] : (D = () => y?.(), t[12] = y, t[13] = D);
|
|
1414
|
-
let O;
|
|
1415
|
-
t[14] !== m || t[15] !== x || t[16] !== D || t[17] !== T || t[18] !== E ? (O = /* @__PURE__ */ q(Gn, {
|
|
1416
|
-
id: m,
|
|
1417
|
-
checked: T,
|
|
1418
|
-
onCheckedChange: E,
|
|
1419
|
-
onBlur: D,
|
|
1420
|
-
...x
|
|
1421
|
-
}), t[14] = m, t[15] = x, t[16] = D, t[17] = T, t[18] = E, t[19] = O) : O = t[19];
|
|
1422
|
-
let k;
|
|
1423
|
-
t[20] !== C || t[21] !== d || t[22] !== m ? (k = /* @__PURE__ */ q(n, {
|
|
1424
|
-
label: d,
|
|
1425
|
-
isRequired: C,
|
|
1426
|
-
htmlFor: m
|
|
1427
|
-
}), t[20] = C, t[21] = d, t[22] = m, t[23] = k) : k = t[23];
|
|
1428
|
-
let A;
|
|
1429
|
-
t[24] !== O || t[25] !== k ? (A = /* @__PURE__ */ J("div", {
|
|
1430
|
-
className: Bn,
|
|
1431
|
-
children: [O, k]
|
|
1432
|
-
}), t[24] = O, t[25] = k, t[26] = A) : A = t[26];
|
|
1433
|
-
let j;
|
|
1434
|
-
return t[27] !== w || t[28] !== f || t[29] !== p || t[30] !== A ? (j = /* @__PURE__ */ q(i, {
|
|
1435
|
-
error: w,
|
|
1436
|
-
helperText: f,
|
|
1437
|
-
readOnly: p,
|
|
1438
|
-
children: A
|
|
1439
|
-
}), t[27] = w, t[28] = f, t[29] = p, t[30] = A, t[31] = j) : j = t[31], j;
|
|
1440
|
-
}, qn = "gaaqp00", Jn = (e) => {
|
|
1441
|
-
let t = W(29), { field: n } = e, { key: a, label: o, helper_text: s, readonly: c } = n, l = a === void 0 ? "" : a, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? !1 : c, p = l, m = !!n?.required, h;
|
|
1442
|
-
t[0] === n ? h = t[1] : (h = r(n), t[0] = n, t[1] = h);
|
|
1443
|
-
let g;
|
|
1444
|
-
t[2] !== p || t[3] !== h ? (g = {
|
|
1445
|
-
name: p,
|
|
1446
|
-
rules: h
|
|
1447
|
-
}, t[2] = p, t[3] = h, t[4] = g) : g = t[4];
|
|
1448
|
-
let { field: _, fieldState: y } = z(g), b, x, S, C, w, T;
|
|
1449
|
-
t[5] === _ ? (b = t[6], x = t[7], S = t[8], C = t[9], w = t[10], T = t[11]) : ({value: T, onBlur: x, onChange: S, ref: C, disabled: b, ...w} = _, t[5] = _, t[6] = b, t[7] = x, t[8] = S, t[9] = C, t[10] = w, t[11] = T);
|
|
1450
|
-
let E = y?.error?.message, D;
|
|
1451
|
-
t[12] === Symbol.for("react.memo_cache_sentinel") ? (D = G(qn), t[12] = D) : D = t[12];
|
|
1452
|
-
let O = T || "", k;
|
|
1453
|
-
t[13] !== b || t[14] !== p || t[15] !== x || t[16] !== S || t[17] !== f || t[18] !== C || t[19] !== w || t[20] !== O ? (k = /* @__PURE__ */ q(v, {
|
|
1454
|
-
id: p,
|
|
1455
|
-
className: D,
|
|
1456
|
-
readOnly: f,
|
|
1457
|
-
value: O,
|
|
1458
|
-
onChange: S,
|
|
1459
|
-
onBlur: x,
|
|
1460
|
-
ref: C,
|
|
1461
|
-
disabled: b,
|
|
1462
|
-
...w
|
|
1463
|
-
}), t[13] = b, t[14] = p, t[15] = x, t[16] = S, t[17] = f, t[18] = C, t[19] = w, t[20] = O, t[21] = k) : k = t[21];
|
|
1464
|
-
let A;
|
|
1465
|
-
return t[22] !== E || t[23] !== d || t[24] !== m || t[25] !== u || t[26] !== p || t[27] !== k ? (A = /* @__PURE__ */ q(i, {
|
|
1466
|
-
error: E,
|
|
1467
|
-
helperText: d,
|
|
1468
|
-
label: u,
|
|
1469
|
-
htmlFor: p,
|
|
1470
|
-
isRequired: m,
|
|
1471
|
-
children: k
|
|
1472
|
-
}), t[22] = E, t[23] = d, t[24] = m, t[25] = u, t[26] = p, t[27] = k, t[28] = A) : A = t[28], A;
|
|
1473
|
-
}, Yn = (e) => {
|
|
1474
|
-
let t = W(36), n, a, o;
|
|
1475
|
-
t[0] === e ? (n = t[1], a = t[2], o = t[3]) : ({field: n, inputStyles: o, ...a} = e, t[0] = e, t[1] = n, t[2] = a, t[3] = o);
|
|
1476
|
-
let { key: s, label: c, helper_text: l, readonly: u } = n, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p = l === void 0 ? "" : l, m = u === void 0 ? !1 : u, h = d, g = !!n?.required, _;
|
|
1477
|
-
t[4] === n ? _ = t[5] : (_ = r(n), t[4] = n, t[5] = _);
|
|
1478
|
-
let v;
|
|
1479
|
-
t[6] !== h || t[7] !== _ ? (v = {
|
|
1480
|
-
name: h,
|
|
1481
|
-
rules: _
|
|
1482
|
-
}, t[6] = h, t[7] = _, t[8] = v) : v = t[8];
|
|
1483
|
-
let { field: y, fieldState: x } = z(v), S, C, w, T, E, D;
|
|
1484
|
-
t[9] === y ? (S = t[10], C = t[11], w = t[12], T = t[13], E = t[14], D = t[15]) : ({value: D, onBlur: C, onChange: w, ref: T, disabled: S, ...E} = y, t[9] = y, t[10] = S, t[11] = C, t[12] = w, t[13] = T, t[14] = E, t[15] = D);
|
|
1485
|
-
let O = x?.error?.message, k;
|
|
1486
|
-
t[16] === o ? k = t[17] : (k = G(o), t[16] = o, t[17] = k);
|
|
1487
|
-
let A = D || "", j;
|
|
1488
|
-
t[18] !== S || t[19] !== a || t[20] !== h || t[21] !== C || t[22] !== w || t[23] !== m || t[24] !== T || t[25] !== E || t[26] !== k || t[27] !== A ? (j = /* @__PURE__ */ q(b, {
|
|
1489
|
-
id: h,
|
|
1490
|
-
className: k,
|
|
1491
|
-
readOnly: m,
|
|
1492
|
-
value: A,
|
|
1493
|
-
onChange: w,
|
|
1494
|
-
onBlur: C,
|
|
1495
|
-
ref: T,
|
|
1496
|
-
disabled: S,
|
|
1497
|
-
...E,
|
|
1498
|
-
...a
|
|
1499
|
-
}), t[18] = S, t[19] = a, t[20] = h, t[21] = C, t[22] = w, t[23] = m, t[24] = T, t[25] = E, t[26] = k, t[27] = A, t[28] = j) : j = t[28];
|
|
1500
|
-
let M;
|
|
1501
|
-
return t[29] !== O || t[30] !== p || t[31] !== g || t[32] !== f || t[33] !== h || t[34] !== j ? (M = /* @__PURE__ */ q(i, {
|
|
1502
|
-
error: O,
|
|
1503
|
-
helperText: p,
|
|
1504
|
-
label: f,
|
|
1505
|
-
htmlFor: h,
|
|
1506
|
-
isRequired: g,
|
|
1507
|
-
children: j
|
|
1508
|
-
}), t[29] = O, t[30] = p, t[31] = g, t[32] = f, t[33] = h, t[34] = j, t[35] = M) : M = t[35], M;
|
|
1509
|
-
}, Xn = (e) => {
|
|
1510
|
-
let t = W(27), { field: n } = e, { key: a, label: o, helper_text: s, readonly: c } = n, l = a === void 0 ? "" : a, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? !1 : c, p = l, m;
|
|
1511
|
-
t[0] === n ? m = t[1] : (m = r(n), t[0] = n, t[1] = m);
|
|
1512
|
-
let h;
|
|
1513
|
-
t[2] !== p || t[3] !== m ? (h = {
|
|
1514
|
-
name: p,
|
|
1515
|
-
rules: m
|
|
1516
|
-
}, t[2] = p, t[3] = m, t[4] = h) : h = t[4];
|
|
1517
|
-
let { field: g, fieldState: _ } = z(h), { value: v, onBlur: y, onChange: x, ref: S } = g, C = !!n?.required, w = _?.error?.message, T = v || "", E;
|
|
1518
|
-
t[5] === x ? E = t[6] : (E = (e) => x(e.target.value || null), t[5] = x, t[6] = E);
|
|
1519
|
-
let D;
|
|
1520
|
-
t[7] !== x || t[8] !== f || t[9] !== v ? (D = v && !f ? /* @__PURE__ */ q("button", {
|
|
1521
|
-
type: "button",
|
|
1522
|
-
onClick: (e) => {
|
|
1523
|
-
e.preventDefault(), e.stopPropagation(), x(null);
|
|
1524
|
-
},
|
|
1525
|
-
style: {
|
|
1526
|
-
background: "none",
|
|
1527
|
-
border: "none",
|
|
1528
|
-
cursor: "pointer",
|
|
1529
|
-
display: "flex",
|
|
1530
|
-
padding: 0
|
|
1531
|
-
},
|
|
1532
|
-
"aria-label": "Clear time",
|
|
1533
|
-
children: /* @__PURE__ */ q(Se, { size: 16 })
|
|
1534
|
-
}) : void 0, t[7] = x, t[8] = f, t[9] = v, t[10] = D) : D = t[10];
|
|
1535
|
-
let O;
|
|
1536
|
-
t[11] !== p || t[12] !== y || t[13] !== f || t[14] !== S || t[15] !== D || t[16] !== T || t[17] !== E ? (O = /* @__PURE__ */ q(b, {
|
|
1537
|
-
id: p,
|
|
1538
|
-
ref: S,
|
|
1539
|
-
type: "time",
|
|
1540
|
-
value: T,
|
|
1541
|
-
onChange: E,
|
|
1542
|
-
onBlur: y,
|
|
1543
|
-
readOnly: f,
|
|
1544
|
-
rightIcon: D
|
|
1545
|
-
}), t[11] = p, t[12] = y, t[13] = f, t[14] = S, t[15] = D, t[16] = T, t[17] = E, t[18] = O) : O = t[18];
|
|
1546
|
-
let k;
|
|
1547
|
-
return t[19] !== w || t[20] !== d || t[21] !== C || t[22] !== u || t[23] !== p || t[24] !== f || t[25] !== O ? (k = /* @__PURE__ */ q(i, {
|
|
1548
|
-
helperText: d,
|
|
1549
|
-
readOnly: f,
|
|
1550
|
-
error: w,
|
|
1551
|
-
htmlFor: p,
|
|
1552
|
-
isRequired: C,
|
|
1553
|
-
label: u,
|
|
1554
|
-
children: O
|
|
1555
|
-
}), t[19] = w, t[20] = d, t[21] = C, t[22] = u, t[23] = p, t[24] = f, t[25] = O, t[26] = k) : k = t[26], k;
|
|
1556
|
-
}, Zn = "_3j2y9l0", Qn = (e) => {
|
|
1557
|
-
let n = W(28), { field: a } = e, { key: o, label: s, helper_text: c, readonly: l } = a, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p = l === void 0 ? !1 : l, m;
|
|
1558
|
-
n[0] === a ? m = n[1] : (m = r(a), n[0] = a, n[1] = m);
|
|
1559
|
-
let h;
|
|
1560
|
-
n[2] !== u || n[3] !== m ? (h = {
|
|
1561
|
-
name: u,
|
|
1562
|
-
rules: m
|
|
1563
|
-
}, n[2] = u, n[3] = m, n[4] = h) : h = n[4];
|
|
1564
|
-
let { field: g, fieldState: _ } = z(h), { name: v, onBlur: y, onChange: b, ref: x, value: S, disabled: C } = g, { error: w } = _, T = w?.message, E = !!S, D;
|
|
1565
|
-
n[5] === b ? D = n[6] : (D = (e) => b(e), n[5] = b, n[6] = D);
|
|
1566
|
-
let O;
|
|
1567
|
-
n[7] === y ? O = n[8] : (O = () => y(), n[7] = y, n[8] = O);
|
|
1568
|
-
let k;
|
|
1569
|
-
n[9] !== C || n[10] !== v || n[11] !== E || n[12] !== D || n[13] !== O ? (k = /* @__PURE__ */ q(on, {
|
|
1570
|
-
id: v,
|
|
1571
|
-
name: v,
|
|
1572
|
-
checked: E,
|
|
1573
|
-
onCheckedChange: D,
|
|
1574
|
-
onBlur: O,
|
|
1575
|
-
disabled: C
|
|
1576
|
-
}), n[9] = C, n[10] = v, n[11] = E, n[12] = D, n[13] = O, n[14] = k) : k = n[14];
|
|
1577
|
-
let A;
|
|
1578
|
-
n[15] !== a.required || n[16] !== d || n[17] !== v ? (A = d && /* @__PURE__ */ J(t, {
|
|
1579
|
-
htmlFor: v,
|
|
1580
|
-
className: "_3j2y9l1",
|
|
1581
|
-
children: [d, a?.required && /* @__PURE__ */ q("span", {
|
|
1582
|
-
className: "_1ompjs10",
|
|
1583
|
-
children: "*"
|
|
1584
|
-
})]
|
|
1585
|
-
}), n[15] = a.required, n[16] = d, n[17] = v, n[18] = A) : A = n[18];
|
|
1586
|
-
let j;
|
|
1587
|
-
n[19] !== x || n[20] !== k || n[21] !== A ? (j = /* @__PURE__ */ J("div", {
|
|
1588
|
-
className: Zn,
|
|
1589
|
-
ref: x,
|
|
1590
|
-
children: [k, A]
|
|
1591
|
-
}), n[19] = x, n[20] = k, n[21] = A, n[22] = j) : j = n[22];
|
|
1592
|
-
let M;
|
|
1593
|
-
return n[23] !== f || n[24] !== p || n[25] !== j || n[26] !== T ? (M = /* @__PURE__ */ q(i, {
|
|
1594
|
-
error: T,
|
|
1595
|
-
helperText: f,
|
|
1596
|
-
readOnly: p,
|
|
1597
|
-
children: j
|
|
1598
|
-
}), n[23] = f, n[24] = p, n[25] = j, n[26] = T, n[27] = M) : M = n[27], M;
|
|
1599
|
-
}, $n = [
|
|
1600
|
-
"pdf",
|
|
1601
|
-
"xls",
|
|
1602
|
-
"xlsx",
|
|
1603
|
-
"doc",
|
|
1604
|
-
"docx",
|
|
1605
|
-
"csv"
|
|
1606
|
-
], er = [
|
|
1607
|
-
"svg",
|
|
1608
|
-
"png",
|
|
1609
|
-
"jpg",
|
|
1610
|
-
"jpeg",
|
|
1611
|
-
"webp",
|
|
1612
|
-
"gif",
|
|
1613
|
-
"avif"
|
|
1614
|
-
], tr = ["mpeg", "mp4"], nr = [
|
|
1615
|
-
"mp3",
|
|
1616
|
-
"ogg",
|
|
1617
|
-
"oga"
|
|
1618
|
-
], rr = {
|
|
1619
|
-
audio: {
|
|
1620
|
-
"audio/mpeg": [".mp3"],
|
|
1621
|
-
"audio/ogg": [".oga"]
|
|
1622
|
-
},
|
|
1623
|
-
document: {
|
|
1624
|
-
"application/pdf": [".pdf"],
|
|
1625
|
-
"application/msword": [".doc"],
|
|
1626
|
-
"application/vnd.ms-excel": [".xls"],
|
|
1627
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
1628
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
1629
|
-
"text/csv": [".csv"]
|
|
1630
|
-
},
|
|
1631
|
-
image: {
|
|
1632
|
-
"image/jpeg": [".jpeg", ".jpg"],
|
|
1633
|
-
"image/png": [".png"],
|
|
1634
|
-
"image/gif": [".gif"],
|
|
1635
|
-
"image/svg+xml": [".svg"],
|
|
1636
|
-
"image/webp": [".webp"],
|
|
1637
|
-
"image/avif": [".avif"]
|
|
1638
|
-
},
|
|
1639
|
-
video: {
|
|
1640
|
-
"video/mp4": [".mp4"],
|
|
1641
|
-
"video/mpeg": [".mpeg"]
|
|
1642
|
-
}
|
|
1643
|
-
}, ir = {
|
|
1644
|
-
audio: nr,
|
|
1645
|
-
document: $n,
|
|
1646
|
-
image: er,
|
|
1647
|
-
video: tr
|
|
1648
|
-
};
|
|
1649
|
-
[
|
|
1650
|
-
...ir.audio,
|
|
1651
|
-
...ir.document,
|
|
1652
|
-
...ir.image,
|
|
1653
|
-
...ir.video
|
|
1654
|
-
], {
|
|
1655
|
-
...rr.audio,
|
|
1656
|
-
...rr.document,
|
|
1657
|
-
...rr.image,
|
|
1658
|
-
...rr.video
|
|
1659
|
-
};
|
|
1660
|
-
//#endregion
|
|
1661
|
-
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/MediaCard.cssm.js
|
|
1662
|
-
var ar = "_11lzwkh0", or = "_11lzwkh2", sr = "_11lzwkh3", cr = "_11lzwkh4", lr = "_11lzwkh5", ur = "_11lzwkh9", dr = "_11lzwkha", fr = (e) => {
|
|
1663
|
-
let t = W(31), { file: n, onDelete: r, onClick: i, showCheckbox: a, isSelected: s, showDelete: c } = e, l = a === void 0 ? !1 : a, u = s === void 0 ? !1 : s, d = c === void 0 ? !0 : c, f;
|
|
1664
|
-
t[0] !== n || t[1] !== r ? (f = (e) => {
|
|
1665
|
-
e.stopPropagation(), e.preventDefault(), r?.(n.id);
|
|
1666
|
-
}, t[0] = n, t[1] = r, t[2] = f) : f = t[2];
|
|
1667
|
-
let p = f, m;
|
|
1668
|
-
t[3] !== n || t[4] !== i ? (m = (e) => {
|
|
1669
|
-
if (i) {
|
|
1670
|
-
e.preventDefault(), i(n);
|
|
1671
|
-
return;
|
|
1672
|
-
}
|
|
1673
|
-
n?.location || e.preventDefault();
|
|
1674
|
-
}, t[3] = n, t[4] = i, t[5] = m) : m = t[5];
|
|
1675
|
-
let h = m, g;
|
|
1676
|
-
t[6] !== n?.filename || t[7] !== n?.location ? (g = n?.filename || n?.location?.split("/")?.[n?.location?.split("/").length - 1], t[6] = n?.filename, t[7] = n?.location, t[8] = g) : g = t[8];
|
|
1677
|
-
let _ = g, v = n?.location || void 0, y = u && "_11lzwkh1", b;
|
|
1678
|
-
t[9] === y ? b = t[10] : (b = G(ar, y), t[9] = y, t[10] = b);
|
|
1679
|
-
let x;
|
|
1680
|
-
t[11] !== n?.kind || t[12] !== n?.location ? (x = n?.kind === "image" ? /* @__PURE__ */ q("img", {
|
|
1681
|
-
alt: "uploaded-file-icon",
|
|
1682
|
-
className: cr,
|
|
1683
|
-
src: n?.location
|
|
1684
|
-
}) : /* @__PURE__ */ q("div", {
|
|
1685
|
-
className: or,
|
|
1686
|
-
children: /* @__PURE__ */ q(he, {
|
|
1687
|
-
size: 60,
|
|
1688
|
-
className: sr
|
|
1689
|
-
})
|
|
1690
|
-
}), t[11] = n?.kind, t[12] = n?.location, t[13] = x) : x = t[13];
|
|
1691
|
-
let S;
|
|
1692
|
-
t[14] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ q("div", { className: lr }), t[14] = S) : S = t[14];
|
|
1693
|
-
let C;
|
|
1694
|
-
t[15] !== u || t[16] !== l ? (C = l && /* @__PURE__ */ q("div", {
|
|
1695
|
-
className: "_11lzwkh8",
|
|
1696
|
-
onClick: pr,
|
|
1697
|
-
children: /* @__PURE__ */ q(on, { checked: u })
|
|
1698
|
-
}), t[15] = u, t[16] = l, t[17] = C) : C = t[17];
|
|
1699
|
-
let w;
|
|
1700
|
-
t[18] !== p || t[19] !== d ? (w = d && /* @__PURE__ */ q(o, {
|
|
1701
|
-
className: "_11lzwkh6",
|
|
1702
|
-
size: "sm",
|
|
1703
|
-
variant: "secondary",
|
|
1704
|
-
onClick: p,
|
|
1705
|
-
children: /* @__PURE__ */ q(Se, { className: "_11lzwkh7" })
|
|
1706
|
-
}), t[18] = p, t[19] = d, t[20] = w) : w = t[20];
|
|
1707
|
-
let T;
|
|
1708
|
-
t[21] === _ ? T = t[22] : (T = /* @__PURE__ */ q("div", {
|
|
1709
|
-
className: ur,
|
|
1710
|
-
children: /* @__PURE__ */ q("p", {
|
|
1711
|
-
className: dr,
|
|
1712
|
-
children: _
|
|
1713
|
-
})
|
|
1714
|
-
}), t[21] = _, t[22] = T);
|
|
1715
|
-
let E;
|
|
1716
|
-
return t[23] !== h || t[24] !== x || t[25] !== C || t[26] !== w || t[27] !== T || t[28] !== v || t[29] !== b ? (E = /* @__PURE__ */ J("a", {
|
|
1717
|
-
href: v,
|
|
1718
|
-
target: "_blank",
|
|
1719
|
-
rel: "noopener noreferrer",
|
|
1720
|
-
className: b,
|
|
1721
|
-
onClick: h,
|
|
1722
|
-
children: [
|
|
1723
|
-
x,
|
|
1724
|
-
S,
|
|
1725
|
-
C,
|
|
1726
|
-
w,
|
|
1727
|
-
T
|
|
1728
|
-
]
|
|
1729
|
-
}), t[23] = h, t[24] = x, t[25] = C, t[26] = w, t[27] = T, t[28] = v, t[29] = b, t[30] = E) : E = t[30], E;
|
|
1730
|
-
};
|
|
1731
|
-
function pr(e) {
|
|
1732
|
-
e.preventDefault(), e.stopPropagation();
|
|
1733
|
-
}
|
|
1734
|
-
//#endregion
|
|
1735
|
-
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/modal/FileUploadModal.cssm.js
|
|
1736
|
-
var mr = "vwpjhx0", hr = "vwpjhx1", gr = "vwpjhx2", _r = "vwpjhx5", vr = "vwpjhx6", yr = "vwpjhxb", br = (e) => {
|
|
1737
|
-
let t = W(57), { isOpen: n, setIsOpen: r, files: i, kind: a, allowedExtensions: s, isMultiple: d, isLoading: f, handleUploadFiles: p, handleChange: m } = e, h;
|
|
1738
|
-
t[0] === r ? h = t[1] : (h = () => r(!1), t[0] = r, t[1] = h);
|
|
1739
|
-
let g = h, _ = i.length, v;
|
|
1740
|
-
bb0: {
|
|
1741
|
-
let e;
|
|
1742
|
-
if (t[2] !== s || t[3] !== a) {
|
|
1743
|
-
let n = a.reduce(xr, {});
|
|
1744
|
-
if (!s || s.length === 0) {
|
|
1745
|
-
v = n;
|
|
1746
|
-
break bb0;
|
|
1747
|
-
}
|
|
1748
|
-
let r = s.map(Sr);
|
|
1749
|
-
e = {};
|
|
1750
|
-
for (let [t, i] of Object.entries(n)) {
|
|
1751
|
-
let n = i.filter((e) => r.includes(e));
|
|
1752
|
-
n.length > 0 && (e[t] = n);
|
|
1753
|
-
}
|
|
1754
|
-
t[2] = s, t[3] = a, t[4] = e, t[5] = v;
|
|
1755
|
-
} else e = t[4], v = t[5];
|
|
1756
|
-
v = e;
|
|
1757
|
-
}
|
|
1758
|
-
let y = v, b;
|
|
1759
|
-
t[6] === p ? b = t[7] : (b = (e) => {
|
|
1760
|
-
if (e.length === 0) {
|
|
1761
|
-
l("No file selected. Please select one file.");
|
|
1762
|
-
return;
|
|
1763
|
-
}
|
|
1764
|
-
p(e);
|
|
1765
|
-
}, t[6] = p, t[7] = b);
|
|
1766
|
-
let T = b, E;
|
|
1767
|
-
t[8] !== y || t[9] !== f || t[10] !== d || t[11] !== T ? (E = {
|
|
1768
|
-
onDrop: T,
|
|
1769
|
-
accept: y,
|
|
1770
|
-
multiple: d,
|
|
1771
|
-
maxSize: 26214400,
|
|
1772
|
-
disabled: f,
|
|
1773
|
-
onDropRejected: wr
|
|
1774
|
-
}, t[8] = y, t[9] = f, t[10] = d, t[11] = T, t[12] = E) : E = t[12];
|
|
1775
|
-
let { getRootProps: D, getInputProps: O, isDragActive: k } = Ae(E), A;
|
|
1776
|
-
t[13] === Symbol.for("react.memo_cache_sentinel") ? (A = G(mr, u), t[13] = A) : A = t[13];
|
|
1777
|
-
let j = a?.length > 1 ? "Upload file" : `Upload ${a?.[0]}`, M;
|
|
1778
|
-
t[14] === j ? M = t[15] : (M = /* @__PURE__ */ q(w, { children: /* @__PURE__ */ q(x, { children: j }) }), t[14] = j, t[15] = M);
|
|
1779
|
-
let N = f && "vwpjhx3", P;
|
|
1780
|
-
t[16] === N ? P = t[17] : (P = G(gr, N), t[16] = N, t[17] = P);
|
|
1781
|
-
let F;
|
|
1782
|
-
t[18] === D ? F = t[19] : (F = D(), t[18] = D, t[19] = F);
|
|
1783
|
-
let I;
|
|
1784
|
-
t[20] === f ? I = t[21] : (I = f && /* @__PURE__ */ q("div", {
|
|
1785
|
-
className: "vwpjhx4",
|
|
1786
|
-
children: /* @__PURE__ */ q(c, {})
|
|
1787
|
-
}), t[20] = f, t[21] = I);
|
|
1788
|
-
let L = k ? "Drop your files here..." : d && i.length > 0 ? "Drag & Drop here to upload more!" : i?.length > 0 ? "Drag & Drop here to upload another file!" : "Drag & Drop here to upload file!", ee;
|
|
1789
|
-
t[22] === L ? ee = t[23] : (ee = /* @__PURE__ */ q("p", {
|
|
1790
|
-
className: _r,
|
|
1791
|
-
children: L
|
|
1792
|
-
}), t[22] = L, t[23] = ee);
|
|
1793
|
-
let R = f && "vwpjhx7", z;
|
|
1794
|
-
t[24] === R ? z = t[25] : (z = G(vr, R), t[24] = R, t[25] = z);
|
|
1795
|
-
let B;
|
|
1796
|
-
t[26] === O ? B = t[27] : (B = O(), t[26] = O, t[27] = B);
|
|
1797
|
-
let V;
|
|
1798
|
-
t[28] === B ? V = t[29] : (V = /* @__PURE__ */ q("input", { ...B }), t[28] = B, t[29] = V);
|
|
1799
|
-
let H;
|
|
1800
|
-
t[30] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ q(xe, { size: 14 }), t[30] = H) : H = t[30];
|
|
1801
|
-
let U;
|
|
1802
|
-
t[31] === V ? U = t[32] : (U = /* @__PURE__ */ J(o, {
|
|
1803
|
-
variant: "ghost",
|
|
1804
|
-
size: "sm",
|
|
1805
|
-
children: [
|
|
1806
|
-
V,
|
|
1807
|
-
H,
|
|
1808
|
-
"Click to upload"
|
|
1809
|
-
]
|
|
1810
|
-
}), t[31] = V, t[32] = U);
|
|
1811
|
-
let K;
|
|
1812
|
-
t[33] !== z || t[34] !== U ? (K = /* @__PURE__ */ q("div", {
|
|
1813
|
-
className: z,
|
|
1814
|
-
children: U
|
|
1815
|
-
}), t[33] = z, t[34] = U, t[35] = K) : K = t[35];
|
|
1816
|
-
let Y;
|
|
1817
|
-
t[36] !== F || t[37] !== I || t[38] !== ee || t[39] !== K || t[40] !== P ? (Y = /* @__PURE__ */ q("div", {
|
|
1818
|
-
className: hr,
|
|
1819
|
-
children: /* @__PURE__ */ J("div", {
|
|
1820
|
-
className: P,
|
|
1821
|
-
...F,
|
|
1822
|
-
children: [
|
|
1823
|
-
I,
|
|
1824
|
-
ee,
|
|
1825
|
-
K
|
|
1826
|
-
]
|
|
1827
|
-
})
|
|
1828
|
-
}), t[36] = F, t[37] = I, t[38] = ee, t[39] = K, t[40] = P, t[41] = Y) : Y = t[41];
|
|
1829
|
-
let te;
|
|
1830
|
-
t[42] !== i || t[43] !== m ? (te = i.length > 0 && /* @__PURE__ */ J("div", {
|
|
1831
|
-
className: "vwpjhx8",
|
|
1832
|
-
children: [/* @__PURE__ */ q("h3", {
|
|
1833
|
-
className: "vwpjhx9",
|
|
1834
|
-
children: "Selected Files"
|
|
1835
|
-
}), /* @__PURE__ */ q("div", {
|
|
1836
|
-
className: "vwpjhxa",
|
|
1837
|
-
children: i.map((e) => /* @__PURE__ */ q(fr, {
|
|
1838
|
-
file: e,
|
|
1839
|
-
onDelete: (e) => {
|
|
1840
|
-
m(i.filter((t) => t.id !== e));
|
|
1841
|
-
}
|
|
1842
|
-
}, e.id))
|
|
1843
|
-
})]
|
|
1844
|
-
}), t[42] = i, t[43] = m, t[44] = te) : te = t[44];
|
|
1845
|
-
let X = _ === 1 ? `${_} file` : `${_} files`, Z;
|
|
1846
|
-
t[45] !== g || t[46] !== X ? (Z = /* @__PURE__ */ q("div", {
|
|
1847
|
-
className: yr,
|
|
1848
|
-
children: /* @__PURE__ */ J(o, {
|
|
1849
|
-
variant: "default",
|
|
1850
|
-
onClick: g,
|
|
1851
|
-
children: ["Save\xA0", X]
|
|
1852
|
-
})
|
|
1853
|
-
}), t[45] = g, t[46] = X, t[47] = Z) : Z = t[47];
|
|
1854
|
-
let ne;
|
|
1855
|
-
t[48] !== Y || t[49] !== te || t[50] !== Z || t[51] !== M ? (ne = /* @__PURE__ */ J(S, {
|
|
1856
|
-
className: A,
|
|
1857
|
-
children: [
|
|
1858
|
-
M,
|
|
1859
|
-
Y,
|
|
1860
|
-
te,
|
|
1861
|
-
Z
|
|
1862
|
-
]
|
|
1863
|
-
}), t[48] = Y, t[49] = te, t[50] = Z, t[51] = M, t[52] = ne) : ne = t[52];
|
|
1864
|
-
let re;
|
|
1865
|
-
return t[53] !== n || t[54] !== r || t[55] !== ne ? (re = /* @__PURE__ */ q(C, {
|
|
1866
|
-
open: n,
|
|
1867
|
-
onOpenChange: r,
|
|
1868
|
-
children: ne
|
|
1869
|
-
}), t[53] = n, t[54] = r, t[55] = ne, t[56] = re) : re = t[56], re;
|
|
1870
|
-
};
|
|
1871
|
-
function xr(e, t) {
|
|
1872
|
-
return {
|
|
1873
|
-
...e,
|
|
1874
|
-
...F[t]
|
|
1875
|
-
};
|
|
1876
|
-
}
|
|
1877
|
-
function Sr(e) {
|
|
1878
|
-
return `.${e}`;
|
|
1879
|
-
}
|
|
1880
|
-
function Cr(e) {
|
|
1881
|
-
e.errors.forEach((t) => {
|
|
1882
|
-
t.code === "file-too-large" && l(`${e.file.name} is bigger than 25MB`);
|
|
1883
|
-
});
|
|
1884
|
-
}
|
|
1885
|
-
function wr(e) {
|
|
1886
|
-
e.forEach(Cr);
|
|
1887
|
-
}
|
|
1888
|
-
//#endregion
|
|
1889
|
-
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/UploadWidget.cssm.js
|
|
1890
|
-
var Tr = "_156u72w0", Er = "_156u72w1", Dr = (e) => Array.isArray(e) && e.every((e) => typeof e == "object" && !!e && "location" in e), Or = ({ field: e, schema: t, kind: n = M, isMultiple: a, uploadContext: s }) => {
|
|
1891
|
-
let l = e.options?.allowed_upload_types, u = l && l.length > 0 ? n.filter((e) => l.includes(e)) : null, d = u && u.length > 0 ? u : n, [f, p] = Q(!1), [m, h] = Q(!1), { media: _ } = g(), { field: { onChange: v, value: y, onBlur: x, disabled: S, ref: C }, fieldState: w } = z({
|
|
1892
|
-
name: e?.key || "",
|
|
1893
|
-
rules: r(e)
|
|
1894
|
-
}), T = e.options?.allowed_extensions, E = oe(() => {
|
|
1895
|
-
let e = d.flatMap((e) => ir[e]);
|
|
1896
|
-
return T && T.length > 0 ? e.filter((e) => T.includes(e)) : e;
|
|
1897
|
-
}, [d, T]), D = Array.isArray(y) ? y : y ? [y] : [], O = s ?? (t?.key ? {
|
|
1898
|
-
module: "collection",
|
|
1899
|
-
identifier: t.key
|
|
1900
|
-
} : void 0), k = O ? {
|
|
1901
|
-
...O,
|
|
1902
|
-
field_key: e.key || void 0,
|
|
1903
|
-
field_label: e.label || void 0
|
|
1904
|
-
} : void 0, A = (e) => {
|
|
1905
|
-
v(a ? e : e?.[0]);
|
|
1906
|
-
}, j = async (e) => {
|
|
1907
|
-
let t = new FormData(), n = a ? e : e.slice(0, 1);
|
|
1908
|
-
if (n.length !== 0) {
|
|
1909
|
-
n.forEach((e) => {
|
|
1910
|
-
let n = e.name.split(".").pop()?.toLowerCase();
|
|
1911
|
-
n && E.includes(n) && t.append("media", e);
|
|
1912
|
-
}), h(!0);
|
|
1913
|
-
try {
|
|
1914
|
-
let e = await _?.mediaBulkUpload(t, {}, k);
|
|
1915
|
-
if (e?.content?.data && Dr(e.content.data)) {
|
|
1916
|
-
let t = e.content.data;
|
|
1917
|
-
A(a ? [...D, ...t] : t);
|
|
1918
|
-
}
|
|
1919
|
-
} catch (e) {
|
|
1920
|
-
Xt(e);
|
|
1921
|
-
} finally {
|
|
1922
|
-
h(!1);
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
|
-
}, { label: N = "", helper_text: P = "", readonly: F = !1 } = e;
|
|
1926
|
-
return /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J(i, {
|
|
1927
|
-
error: w?.error?.message,
|
|
1928
|
-
helperText: P,
|
|
1929
|
-
readOnly: F,
|
|
1930
|
-
htmlFor: e.key,
|
|
1931
|
-
isRequired: e?.required,
|
|
1932
|
-
label: N,
|
|
1933
|
-
children: [/* @__PURE__ */ J("div", {
|
|
1934
|
-
className: Tr,
|
|
1935
|
-
ref: C,
|
|
1936
|
-
children: [/* @__PURE__ */ q(o, {
|
|
1937
|
-
size: "icon",
|
|
1938
|
-
variant: "outline",
|
|
1939
|
-
disabled: S || F,
|
|
1940
|
-
onClick: () => p(!0),
|
|
1941
|
-
className: Er,
|
|
1942
|
-
children: /* @__PURE__ */ q(xe, { size: 15 })
|
|
1943
|
-
}), /* @__PURE__ */ q(b, {
|
|
1944
|
-
name: "pasteUrl",
|
|
1945
|
-
placeholder: "Paste your files here...",
|
|
1946
|
-
onBlur: () => x(),
|
|
1947
|
-
onPaste: (e) => {
|
|
1948
|
-
let t = [];
|
|
1949
|
-
Array.from(e.clipboardData.items).forEach((e) => {
|
|
1950
|
-
if (e?.kind === "file") {
|
|
1951
|
-
let n = e?.getAsFile();
|
|
1952
|
-
n && t.push(n);
|
|
1953
|
-
}
|
|
1954
|
-
}), t.length > 0 && j(t);
|
|
1955
|
-
},
|
|
1956
|
-
disabled: S,
|
|
1957
|
-
readOnly: F,
|
|
1958
|
-
rightIcon: m ? /* @__PURE__ */ q(c, { size: 16 }) : void 0
|
|
1959
|
-
})]
|
|
1960
|
-
}), D.length > 0 && /* @__PURE__ */ q("div", {
|
|
1961
|
-
className: "_156u72w2",
|
|
1962
|
-
children: /* @__PURE__ */ q("div", {
|
|
1963
|
-
className: "_156u72w3",
|
|
1964
|
-
children: D.map((e) => /* @__PURE__ */ q(fr, {
|
|
1965
|
-
file: e,
|
|
1966
|
-
onDelete: (e) => {
|
|
1967
|
-
A(D.filter((t) => t.id !== e));
|
|
1968
|
-
}
|
|
1969
|
-
}, e.id))
|
|
1970
|
-
})
|
|
1971
|
-
})]
|
|
1972
|
-
}), /* @__PURE__ */ q(br, {
|
|
1973
|
-
isOpen: f,
|
|
1974
|
-
setIsOpen: p,
|
|
1975
|
-
files: D,
|
|
1976
|
-
kind: d,
|
|
1977
|
-
allowedExtensions: T,
|
|
1978
|
-
isMultiple: a,
|
|
1979
|
-
isLoading: m,
|
|
1980
|
-
handleUploadFiles: j,
|
|
1981
|
-
handleChange: A
|
|
1982
|
-
})] });
|
|
1983
|
-
}, kr = (e) => {
|
|
1984
|
-
let t = W(3), n;
|
|
1985
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ q(ge, { size: 20 }), t[0] = n) : n = t[0];
|
|
1986
|
-
let r;
|
|
1987
|
-
return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ q(Yn, {
|
|
1988
|
-
leftIcon: n,
|
|
1989
|
-
...e
|
|
1990
|
-
}), t[1] = e, t[2] = r), r;
|
|
1991
|
-
}, Ar = re(() => import("./DateTimeWidget-U3lD0q1q.js")), jr = re(() => import("./PhoneWidget-DQQa4bL6.js")), Mr = re(() => import("./RichTextWidget-DfakML79.js")), Nr = {
|
|
1992
|
-
TextWidget: $((e) => /* @__PURE__ */ q(Yn, { ...e })),
|
|
1993
|
-
NumberWidget: $((e) => /* @__PURE__ */ q(Yn, {
|
|
1994
|
-
type: "number",
|
|
1995
|
-
step: "any",
|
|
1996
|
-
...e
|
|
1997
|
-
})),
|
|
1998
|
-
CurrencyWidget: $((e) => /* @__PURE__ */ q(cn, { ...e })),
|
|
1999
|
-
MultiTextWidget: $((e) => /* @__PURE__ */ q(kn, { ...e })),
|
|
2000
|
-
TextareaWidget: $((e) => /* @__PURE__ */ q(Jn, { ...e })),
|
|
2001
|
-
RichTextWidget: $((e) => /* @__PURE__ */ q(Mr, { ...e })),
|
|
2002
|
-
EmailWidget: $((e) => /* @__PURE__ */ q(mn, { ...e })),
|
|
2003
|
-
PhoneWidget: $((e) => /* @__PURE__ */ q(jr, { ...e })),
|
|
2004
|
-
URLWidget: $((e) => /* @__PURE__ */ q(kr, { ...e })),
|
|
2005
|
-
DropdownWidget: $((e) => /* @__PURE__ */ q(un, {
|
|
2006
|
-
isMulti: !1,
|
|
2007
|
-
...e
|
|
2008
|
-
})),
|
|
2009
|
-
MultiDropdownWidget: $((e) => /* @__PURE__ */ q(un, {
|
|
2010
|
-
isMulti: !0,
|
|
2011
|
-
...e
|
|
2012
|
-
})),
|
|
2013
|
-
RadioWidget: $((e) => /* @__PURE__ */ q(zn, { ...e })),
|
|
2014
|
-
CheckboxWidget: $((e) => /* @__PURE__ */ q(sn, { ...e })),
|
|
2015
|
-
ToggleCheckboxWidget: $((e) => /* @__PURE__ */ q(Qn, { ...e })),
|
|
2016
|
-
SwitchWidget: $((e) => /* @__PURE__ */ q(Kn, { ...e })),
|
|
2017
|
-
DateTimeWidget: $((e) => /* @__PURE__ */ q(Ar, { ...e })),
|
|
2018
|
-
DateWidget: $((e) => /* @__PURE__ */ q(Ar, { ...e })),
|
|
2019
|
-
TimeWidget: $((e) => /* @__PURE__ */ q(Xn, { ...e })),
|
|
2020
|
-
GeocoderWidget: $((e) => /* @__PURE__ */ q(gn, { ...e })),
|
|
2021
|
-
MultiGeocoderWidget: $((e) => /* @__PURE__ */ q(Cn, { ...e })),
|
|
2022
|
-
ImageUploadWidget: $((e) => /* @__PURE__ */ q(Or, {
|
|
2023
|
-
kind: ["image"],
|
|
2024
|
-
isMultiple: !1,
|
|
2025
|
-
...e
|
|
2026
|
-
})),
|
|
2027
|
-
MultiImageUploadWidget: $((e) => /* @__PURE__ */ q(Or, {
|
|
2028
|
-
kind: ["image"],
|
|
2029
|
-
isMultiple: !0,
|
|
2030
|
-
...e
|
|
2031
|
-
})),
|
|
2032
|
-
FileUploadWidget: $((e) => /* @__PURE__ */ q(Or, {
|
|
2033
|
-
kind: [
|
|
2034
|
-
"audio",
|
|
2035
|
-
"video",
|
|
2036
|
-
"image",
|
|
2037
|
-
"document"
|
|
2038
|
-
],
|
|
2039
|
-
isMultiple: !1,
|
|
2040
|
-
...e
|
|
2041
|
-
})),
|
|
2042
|
-
MultiFileUploadWidget: $((e) => /* @__PURE__ */ q(Or, {
|
|
2043
|
-
kind: [
|
|
2044
|
-
"audio",
|
|
2045
|
-
"video",
|
|
2046
|
-
"image",
|
|
2047
|
-
"document"
|
|
2048
|
-
],
|
|
2049
|
-
isMultiple: !0,
|
|
2050
|
-
...e
|
|
2051
|
-
}))
|
|
2052
|
-
}, Pr = (e) => {
|
|
2053
|
-
let t = W(9), n, r;
|
|
2054
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({widgets: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2055
|
-
let { field: i } = n, { field_interface: a, key: o } = i;
|
|
2056
|
-
if (!a || !o) return null;
|
|
2057
|
-
if (r) {
|
|
2058
|
-
let e = r[a];
|
|
2059
|
-
if (e) {
|
|
2060
|
-
let r;
|
|
2061
|
-
return t[3] !== e || t[4] !== n ? (r = /* @__PURE__ */ q(e, { ...n }), t[3] = e, t[4] = n, t[5] = r) : r = t[5], r;
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
let s = Nr[a];
|
|
2065
|
-
if (s) {
|
|
2066
|
-
let e;
|
|
2067
|
-
return t[6] !== s || t[7] !== n ? (e = /* @__PURE__ */ q(s, { ...n }), t[6] = s, t[7] = n, t[8] = e) : e = t[8], e;
|
|
2068
|
-
}
|
|
2069
|
-
return null;
|
|
2070
|
-
}, Fr = (e) => {
|
|
2071
|
-
let t = W(25), r, i, a;
|
|
2072
|
-
t[0] === e ? (r = t[1], i = t[2], a = t[3]) : ({field: r, schema: a, ...i} = e, t[0] = e, t[1] = r, t[2] = i, t[3] = a);
|
|
2073
|
-
let { key: o, label: s, field_interface: c, fields: l } = r, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p;
|
|
2074
|
-
t[4] === l ? p = t[5] : (p = l === void 0 ? [] : l, t[4] = l, t[5] = p);
|
|
2075
|
-
let m = p;
|
|
2076
|
-
if (!f || !u) return null;
|
|
2077
|
-
let h = r?.required, g;
|
|
2078
|
-
t[6] !== d || t[7] !== h ? (g = /* @__PURE__ */ q(n, {
|
|
2079
|
-
label: d,
|
|
2080
|
-
isRequired: h
|
|
2081
|
-
}), t[6] = d, t[7] = h, t[8] = g) : g = t[8];
|
|
2082
|
-
let _;
|
|
2083
|
-
if (t[9] !== r.id || t[10] !== m || t[11] !== u || t[12] !== i || t[13] !== a) {
|
|
2084
|
-
let e;
|
|
2085
|
-
t[15] !== r.id || t[16] !== u || t[17] !== i || t[18] !== a ? (e = (e) => /* @__PURE__ */ q(Ir, {
|
|
2086
|
-
field: {
|
|
2087
|
-
...e,
|
|
2088
|
-
key: `${u}.${e?.key}`
|
|
2089
|
-
},
|
|
2090
|
-
schema: a,
|
|
2091
|
-
...i
|
|
2092
|
-
}, `common-fields-${r?.id}-${e?.id}`), t[15] = r.id, t[16] = u, t[17] = i, t[18] = a, t[19] = e) : e = t[19], _ = m.map(e), t[9] = r.id, t[10] = m, t[11] = u, t[12] = i, t[13] = a, t[14] = _;
|
|
2093
|
-
} else _ = t[14];
|
|
2094
|
-
let v;
|
|
2095
|
-
t[20] === _ ? v = t[21] : (v = /* @__PURE__ */ q("div", {
|
|
2096
|
-
className: gt,
|
|
2097
|
-
children: _
|
|
2098
|
-
}), t[20] = _, t[21] = v);
|
|
2099
|
-
let y;
|
|
2100
|
-
return t[22] !== g || t[23] !== v ? (y = /* @__PURE__ */ J("div", {
|
|
2101
|
-
className: at,
|
|
2102
|
-
children: [g, v]
|
|
2103
|
-
}), t[22] = g, t[23] = v, t[24] = y) : y = t[24], y;
|
|
2104
|
-
}, Ir = (e) => {
|
|
2105
|
-
let t = W(16), n, r;
|
|
2106
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({widgets: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2107
|
-
let i = rt(n.schema, n.field), { field_interface: a, key: o, hidden: s } = i, c = a === void 0 ? "" : a;
|
|
2108
|
-
if (!c || !(o !== void 0 && o) || s) return null;
|
|
2109
|
-
switch (c) {
|
|
2110
|
-
case A.ArrayWidget: {
|
|
2111
|
-
let e;
|
|
2112
|
-
return t[3] !== i || t[4] !== n ? (e = /* @__PURE__ */ q(Et, {
|
|
2113
|
-
...n,
|
|
2114
|
-
field: i
|
|
2115
|
-
}), t[3] = i, t[4] = n, t[5] = e) : e = t[5], e;
|
|
2116
|
-
}
|
|
2117
|
-
case A.RecordWidget: {
|
|
2118
|
-
let e;
|
|
2119
|
-
return t[6] !== i || t[7] !== n ? (e = /* @__PURE__ */ q(Fr, {
|
|
2120
|
-
...n,
|
|
2121
|
-
field: i
|
|
2122
|
-
}), t[6] = i, t[7] = n, t[8] = e) : e = t[8], e;
|
|
2123
|
-
}
|
|
2124
|
-
case A.CollectionWidget: {
|
|
2125
|
-
let e;
|
|
2126
|
-
return t[9] !== i || t[10] !== n ? (e = /* @__PURE__ */ q($t, {
|
|
2127
|
-
...n,
|
|
2128
|
-
field: i
|
|
2129
|
-
}), t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
2130
|
-
}
|
|
2131
|
-
default: {
|
|
2132
|
-
let e;
|
|
2133
|
-
return t[12] !== i || t[13] !== n || t[14] !== r ? (e = /* @__PURE__ */ q(Pr, {
|
|
2134
|
-
widgets: r,
|
|
2135
|
-
...n,
|
|
2136
|
-
field: i
|
|
2137
|
-
}), t[12] = i, t[13] = n, t[14] = r, t[15] = e) : e = t[15], e;
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
};
|
|
2141
|
-
T(E.radius);
|
|
2142
|
-
//#endregion
|
|
2143
|
-
//#region ../../libraries/levocn/dist/utils/deep-merge.js
|
|
2144
|
-
function Lr(e) {
|
|
2145
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2146
|
-
}
|
|
2147
|
-
function Rr(e, t) {
|
|
2148
|
-
if (!Lr(e) || !Lr(t)) return t;
|
|
2149
|
-
let n = { ...e };
|
|
2150
|
-
return Object.keys(t).forEach((r) => {
|
|
2151
|
-
let i = r, a = e[i], o = t[i];
|
|
2152
|
-
Lr(a) && Lr(o) ? n[i] = Rr(a, o) : n[i] = o;
|
|
2153
|
-
}), n;
|
|
2154
|
-
}
|
|
2155
|
-
//#endregion
|
|
2156
|
-
//#region ../../libraries/levocn/dist/theme/utils/defineTheme.js
|
|
2157
|
-
var zr = ((e) => (t) => t ? Rr(e, t) : e)({
|
|
2158
|
-
form: {
|
|
2159
|
-
maxWidth: "100%",
|
|
2160
|
-
gap: "1.5rem",
|
|
2161
|
-
borderRadius: "6px",
|
|
2162
|
-
labelFontSize: "0.875rem",
|
|
2163
|
-
helpFontSize: "0.75rem"
|
|
2164
|
-
},
|
|
2165
|
-
input: {
|
|
2166
|
-
fontSize: "0.875rem",
|
|
2167
|
-
height: "2.25rem",
|
|
2168
|
-
borderRadius: "6px"
|
|
2169
|
-
},
|
|
2170
|
-
checkbox: { labelFontSize: "0.875rem" }
|
|
2171
|
-
}), Br = "_1g8bxz40", Vr = "r6cfdr0", Hr = ne({ themeClass: "" }), Ur = O(zr({
|
|
2172
|
-
form: {
|
|
2173
|
-
maxWidth: "800px",
|
|
2174
|
-
labelFontSize: "1.5rem",
|
|
2175
|
-
helpFontSize: "1rem",
|
|
2176
|
-
borderRadius: "4px"
|
|
2177
|
-
},
|
|
2178
|
-
input: {
|
|
2179
|
-
fontSize: "1.125rem",
|
|
2180
|
-
height: "3.5rem",
|
|
2181
|
-
borderRadius: "4px"
|
|
2182
|
-
},
|
|
2183
|
-
checkbox: { labelFontSize: "1.125rem" }
|
|
2184
|
-
})), Wr = (e) => {
|
|
2185
|
-
let t = W(30), n, r, i, o, s, c, l;
|
|
2186
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], o = t[4], s = t[5], c = t[6], l = t[7]) : ({children: n, className: r, style: c, cssReset: i, variant: l, portalToThemeRoot: o, ...s} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = o, t[5] = s, t[6] = c, t[7] = l);
|
|
2187
|
-
let u = l === "single-field" || l === "steps-2", d;
|
|
2188
|
-
t[8] === r ? d = t[9] : (d = G(k, Br, r), t[8] = r, t[9] = d);
|
|
2189
|
-
let f = d, p;
|
|
2190
|
-
t[10] !== u || t[11] !== c ? (p = u ? {
|
|
2191
|
-
...Ur,
|
|
2192
|
-
...c
|
|
2193
|
-
} : c, t[10] = u, t[11] = c, t[12] = p) : p = t[12];
|
|
2194
|
-
let m = p, h;
|
|
2195
|
-
t[13] !== f || t[14] !== m || t[15] !== i ? (h = {
|
|
2196
|
-
themeClass: f,
|
|
2197
|
-
style: m,
|
|
2198
|
-
cssReset: i
|
|
2199
|
-
}, t[13] = f, t[14] = m, t[15] = i, t[16] = h) : h = t[16];
|
|
2200
|
-
let g;
|
|
2201
|
-
t[17] !== n || t[18] !== u ? (g = u ? /* @__PURE__ */ q("div", {
|
|
2202
|
-
className: Vr,
|
|
2203
|
-
children: n
|
|
2204
|
-
}) : n, t[17] = n, t[18] = u, t[19] = g) : g = t[19];
|
|
2205
|
-
let _;
|
|
2206
|
-
t[20] !== h || t[21] !== g ? (_ = /* @__PURE__ */ q(Hr.Provider, {
|
|
2207
|
-
value: h,
|
|
2208
|
-
children: g
|
|
2209
|
-
}), t[20] = h, t[21] = g, t[22] = _) : _ = t[22];
|
|
2210
|
-
let v;
|
|
2211
|
-
return t[23] !== f || t[24] !== m || t[25] !== i || t[26] !== o || t[27] !== s || t[28] !== _ ? (v = /* @__PURE__ */ q(a, {
|
|
2212
|
-
...s,
|
|
2213
|
-
className: f,
|
|
2214
|
-
cssReset: i,
|
|
2215
|
-
style: m,
|
|
2216
|
-
portalToThemeRoot: o,
|
|
2217
|
-
children: _
|
|
2218
|
-
}), t[23] = f, t[24] = m, t[25] = i, t[26] = o, t[27] = s, t[28] = _, t[29] = v) : v = t[29], v;
|
|
2219
|
-
}, Gr = "_1dzarb20", Kr = "_1dzarb21", qr = "_1dzarb23", Jr = "_1dzarb24", Yr = "_1dzarb25", Xr = "_1dzarb26", Zr = ({ hiddenFields: e, isLoading: t, initialValues: n, onSubmit: r, schema: i, uiConfig: a, submitButtonConfig: s, containerStyles: c, isDisabled: l, theme: u, enableVerification: d = !0 }) => {
|
|
2220
|
-
let f = oe(() => {
|
|
2221
|
-
if (i) {
|
|
2222
|
-
let t = { ...i };
|
|
2223
|
-
return t.sections = t?.sections?.map((t) => (t.fields = t?.fields?.map((t) => ((e?.includes(t?.key) || e?.includes(t?.id)) && (t.hidden = !0), t)), t)), t;
|
|
2224
|
-
}
|
|
2225
|
-
return null;
|
|
2226
|
-
}, [i]), p = V({
|
|
2227
|
-
mode: "onTouched",
|
|
2228
|
-
disabled: l,
|
|
2229
|
-
defaultValues: {},
|
|
2230
|
-
resetOptions: { keepErrors: !0 }
|
|
2231
|
-
}), { formState: { isSubmitting: m } } = p, h = (e) => {
|
|
2232
|
-
r && r(e);
|
|
2233
|
-
};
|
|
2234
|
-
ae(() => {
|
|
2235
|
-
if (f) {
|
|
2236
|
-
let e = {
|
|
2237
|
-
...i ? Qe(i) : {},
|
|
2238
|
-
...n
|
|
2239
|
-
};
|
|
2240
|
-
p.reset(e);
|
|
2241
|
-
}
|
|
2242
|
-
}, [f]);
|
|
2243
|
-
let g = t || m;
|
|
2244
|
-
return f ? /* @__PURE__ */ q(ee, {
|
|
2245
|
-
...p,
|
|
2246
|
-
children: /* @__PURE__ */ q(Wr, {
|
|
2247
|
-
...u || {},
|
|
2248
|
-
children: /* @__PURE__ */ J("div", {
|
|
2249
|
-
className: Gr,
|
|
2250
|
-
children: [a?.hideFormHeading ? null : /* @__PURE__ */ q("h1", {
|
|
2251
|
-
className: G(Kr),
|
|
2252
|
-
children: "Create new"
|
|
2253
|
-
}), /* @__PURE__ */ q("div", {
|
|
2254
|
-
className: G(qr, c),
|
|
2255
|
-
children: /* @__PURE__ */ J("form", {
|
|
2256
|
-
className: G(Jr, t && "_1dzarb27"),
|
|
2257
|
-
id: "collection-form",
|
|
2258
|
-
onSubmit: p.handleSubmit(h),
|
|
2259
|
-
children: [i?.sections?.map((e) => tt(e?.fields || []) ? null : /* @__PURE__ */ J("div", {
|
|
2260
|
-
className: Yr,
|
|
2261
|
-
children: [!a?.hideSectionHeadings && /* @__PURE__ */ q("p", {
|
|
2262
|
-
className: "_1dzarb28",
|
|
2263
|
-
children: e?.label
|
|
2264
|
-
}), /* @__PURE__ */ q("div", {
|
|
2265
|
-
className: Xr,
|
|
2266
|
-
children: e?.fields?.map((e) => /* @__PURE__ */ q(Ir, {
|
|
2267
|
-
field: e,
|
|
2268
|
-
schema: i,
|
|
2269
|
-
settings: { enableVerification: d }
|
|
2270
|
-
}, e?.key))
|
|
2271
|
-
})]
|
|
2272
|
-
}, e.id)), s?.show && /* @__PURE__ */ q("div", {
|
|
2273
|
-
className: "_1dzarb29",
|
|
2274
|
-
children: /* @__PURE__ */ q(o, {
|
|
2275
|
-
className: s?.styles,
|
|
2276
|
-
disabled: l || g,
|
|
2277
|
-
type: "submit",
|
|
2278
|
-
children: g ? "Saving" : s?.text || "Save"
|
|
2279
|
-
})
|
|
2280
|
-
})]
|
|
2281
|
-
})
|
|
2282
|
-
})]
|
|
2283
|
-
})
|
|
2284
|
-
})
|
|
2285
|
-
}) : null;
|
|
2286
|
-
}, Qr = X.createContext({
|
|
2287
|
-
schema: null,
|
|
2288
|
-
submitButtonConfig: { show: !0 }
|
|
2289
|
-
}), $r = (e) => {
|
|
2290
|
-
let t = W(14), n, r, i, a;
|
|
2291
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({children: n, theme: i, variant: a, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
2292
|
-
let o;
|
|
2293
|
-
t[5] === r ? o = t[6] : (o = { ...r }, t[5] = r, t[6] = o);
|
|
2294
|
-
let s;
|
|
2295
|
-
t[7] !== n || t[8] !== i || t[9] !== a ? (s = /* @__PURE__ */ q(Wr, {
|
|
2296
|
-
...i,
|
|
2297
|
-
variant: a,
|
|
2298
|
-
children: n
|
|
2299
|
-
}), t[7] = n, t[8] = i, t[9] = a, t[10] = s) : s = t[10];
|
|
2300
|
-
let c;
|
|
2301
|
-
return t[11] !== o || t[12] !== s ? (c = /* @__PURE__ */ q(Qr.Provider, {
|
|
2302
|
-
value: o,
|
|
2303
|
-
children: s
|
|
2304
|
-
}), t[11] = o, t[12] = s, t[13] = c) : c = t[13], c;
|
|
2305
|
-
}, ei = () => X.useContext(Qr), ti = (e, t) => {
|
|
2306
|
-
if (Array.isArray(e) && e.length > 0) {
|
|
2307
|
-
let n = 0;
|
|
2308
|
-
for (let r of e) n += 1, r?.param && t && t(r?.param, {
|
|
2309
|
-
type: "server_error",
|
|
2310
|
-
message: r?.message
|
|
2311
|
-
}, { shouldFocus: n === 0 });
|
|
2312
|
-
}
|
|
2313
|
-
}, ni = {
|
|
2314
|
-
FORM_DIRTY: "form-dirty",
|
|
2315
|
-
FORM_VALUES: "form-values"
|
|
2316
|
-
}, ri = (e) => {
|
|
2317
|
-
let t = localStorage.getItem(`${e}-${ni.FORM_VALUES}`);
|
|
2318
|
-
return t ? JSON.parse(t) : {};
|
|
2319
|
-
}, ii = (e, t) => {
|
|
2320
|
-
localStorage.setItem(`${e}-${ni.FORM_VALUES}`, JSON.stringify(t));
|
|
2321
|
-
}, ai = (e) => {
|
|
2322
|
-
localStorage.removeItem(`${e}-${ni.FORM_VALUES}`);
|
|
2323
|
-
}, oi = ({ schema: e, originalSchema: t, onSubmitSuccess: n, onSubmitError: r, onInit: i, setFormErrorAfterSubmit: a = !0 }) => {
|
|
2324
|
-
let o = oe(() => e, [e]), s = oe(() => t || o, [t, o]), c = g(), { toastConfig: l, onSuccess: u, onError: f, isLoggedIn: p, isDisabled: m, externalInitialValues: h = {}, account: _, preview: v, uiConfig: y } = ei(), [b, x] = Q({
|
|
2325
|
-
contentId: null,
|
|
2326
|
-
publishedId: null
|
|
2327
|
-
}), [S, C] = Q(!1), [w, T] = Q(!1), [E, D] = Q(!1), O = se({}), k = se({}), A = (e) => {
|
|
2328
|
-
if (!o?.sections) return null;
|
|
2329
|
-
for (let t of o.sections) for (let n of t?.fields ?? []) if (n?.key === e) return n?.kind ?? null;
|
|
2330
|
-
return null;
|
|
2331
|
-
}, M = () => {
|
|
2332
|
-
let e = {};
|
|
2333
|
-
try {
|
|
2334
|
-
if (typeof window < "u") {
|
|
2335
|
-
let t = new URLSearchParams(window?.location?.search);
|
|
2336
|
-
for (let [n, r] of t.entries()) {
|
|
2337
|
-
let [t, i] = n.split("-");
|
|
2338
|
-
if (t === "lf" && i && r) try {
|
|
2339
|
-
let t = JSON.parse(r), n = A(i);
|
|
2340
|
-
e[i] = typeof t == "number" && !(n === "number" || n === "currency") ? r : t;
|
|
2341
|
-
} catch {
|
|
2342
|
-
e[i] = r;
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
} catch {}
|
|
2347
|
-
let t = o ? Qe(o) : {}, n = {};
|
|
2348
|
-
_ && o && (o.email_field && _.email && (n[o.email_field] = _.email), o.mobile_field && _.mobile && (n[o.mobile_field] = _.mobile));
|
|
2349
|
-
let r = {
|
|
2350
|
-
...h || {},
|
|
2351
|
-
...n,
|
|
2352
|
-
...e
|
|
2353
|
-
};
|
|
2354
|
-
O.current = {
|
|
2355
|
-
...t,
|
|
2356
|
-
...r,
|
|
2357
|
-
...O.current
|
|
2358
|
-
};
|
|
2359
|
-
}, N = V({
|
|
2360
|
-
mode: "onTouched",
|
|
2361
|
-
disabled: m
|
|
2362
|
-
}), { formState: F } = N, I = (e) => {
|
|
2363
|
-
O.current = {
|
|
2364
|
-
...O.current || {},
|
|
2365
|
-
...e
|
|
2366
|
-
};
|
|
2367
|
-
};
|
|
2368
|
-
return ae(() => {
|
|
2369
|
-
if (o && c?.collection) {
|
|
2370
|
-
if (M(), !b.contentId && !b.publishedId && !v) {
|
|
2371
|
-
let e = o?.allow_multiple === !1;
|
|
2372
|
-
if (o?.allow_draft) {
|
|
2373
|
-
if (p) {
|
|
2374
|
-
C(!0), c?.collection?.getDraftEntry(o?.key).then((t) => {
|
|
2375
|
-
let n = t?.content?.data;
|
|
2376
|
-
if (n === null) {
|
|
2377
|
-
T(!0);
|
|
2378
|
-
return;
|
|
2379
|
-
}
|
|
2380
|
-
T(!1);
|
|
2381
|
-
let r = e && Array.isArray(n) && n?.find((e) => e?._status === "published") || null;
|
|
2382
|
-
if (r?._id) O.current = {
|
|
2383
|
-
...O.current || {},
|
|
2384
|
-
...r
|
|
2385
|
-
}, x({
|
|
2386
|
-
contentId: null,
|
|
2387
|
-
publishedId: r._id
|
|
2388
|
-
});
|
|
2389
|
-
else {
|
|
2390
|
-
let e = Array.isArray(n) ? n?.filter((e) => e?._status === "draft") : [], t = e?.[e.length - 1] || null;
|
|
2391
|
-
t?._id && (O.current = {
|
|
2392
|
-
...O.current || {},
|
|
2393
|
-
...t
|
|
2394
|
-
}, x({
|
|
2395
|
-
contentId: t._id,
|
|
2396
|
-
publishedId: null
|
|
2397
|
-
}));
|
|
2398
|
-
}
|
|
2399
|
-
}).catch((e) => (c?.logger?.error("Failed to get draft entry", { exception: e }), null)).finally(() => {
|
|
2400
|
-
k.current = { ...O.current }, N.reset({ ...O?.current }), i?.(O.current), C(!1);
|
|
2401
|
-
});
|
|
2402
|
-
return;
|
|
2403
|
-
}
|
|
2404
|
-
let t = ri(o?.key);
|
|
2405
|
-
t && (O.current = {
|
|
2406
|
-
...O.current || {},
|
|
2407
|
-
...t
|
|
2408
|
-
});
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
k.current = { ...O.current }, N.reset({ ...O?.current }), i?.(O.current);
|
|
2412
|
-
}
|
|
2413
|
-
}, [o, p]), ae(() => {
|
|
2414
|
-
let { isSubmitSuccessful: e, isValid: t } = F;
|
|
2415
|
-
e && t && (k.current = { ...O.current }, N.reset({
|
|
2416
|
-
...O?.current,
|
|
2417
|
-
__captcha: "verified"
|
|
2418
|
-
}), i?.(O.current));
|
|
2419
|
-
}, [F]), ae(() => {
|
|
2420
|
-
o && (b.contentId || b.publishedId) && ai(o?.key);
|
|
2421
|
-
}, [b]), {
|
|
2422
|
-
methods: N,
|
|
2423
|
-
isLoading: S,
|
|
2424
|
-
isError: w,
|
|
2425
|
-
contentId: b.contentId,
|
|
2426
|
-
publishedId: b.publishedId,
|
|
2427
|
-
allFormValues: O.current,
|
|
2428
|
-
handleContentId: (e) => {
|
|
2429
|
-
e && e !== b.contentId && !b.publishedId && x({
|
|
2430
|
-
contentId: e,
|
|
2431
|
-
publishedId: null
|
|
2432
|
-
});
|
|
2433
|
-
},
|
|
2434
|
-
appendFormValues: I,
|
|
2435
|
-
submitToRemote: async (e) => {
|
|
2436
|
-
if (I(e), !(v || !c?.collection || !s)) try {
|
|
2437
|
-
let e = et(O?.current, s, k.current), t = null;
|
|
2438
|
-
if (t = b.publishedId ? await c?.collection?.editDraftEntry(s?.key, b.publishedId, e) : b.contentId ? await c?.collection?.submitDraftEntry(s?.key, e) : await c?.collection?.saveCollectionData({
|
|
2439
|
-
collection_id: s?.id,
|
|
2440
|
-
data: e
|
|
2441
|
-
}), t?.content?.data) {
|
|
2442
|
-
let e = t?.content?.meta?.booking_config?.enabled;
|
|
2443
|
-
l?.showSuccessToast && !(l?.suppressOnBooking && e) && d(l.successToastText || "Form submitted successfully."), O.current = {}, M(), ai(s?.key), x({
|
|
2444
|
-
contentId: null,
|
|
2445
|
-
publishedId: null
|
|
2446
|
-
}), y?.hideSuccessScreen || D(!0);
|
|
2447
|
-
try {
|
|
2448
|
-
u && u({
|
|
2449
|
-
schemaId: s?.id,
|
|
2450
|
-
response: t?.content?.data,
|
|
2451
|
-
meta: t?.content?.meta
|
|
2452
|
-
}), n && n();
|
|
2453
|
-
} catch (e) {
|
|
2454
|
-
c?.logger?.error("Form success callback threw after a saved entry", { exception: P(e) });
|
|
2455
|
-
}
|
|
2456
|
-
return;
|
|
2457
|
-
}
|
|
2458
|
-
throw Error("Failed to save form details, API response invalid");
|
|
2459
|
-
} catch (e) {
|
|
2460
|
-
Xt(e), e instanceof j ? (e?.hasFieldErrors && a && ti(e?.fieldErrors, N.setError), r && r(e.fieldErrors || []), f && f(e)) : f && f(e?.response?.data || e);
|
|
2461
|
-
}
|
|
2462
|
-
},
|
|
2463
|
-
showSuccessOverlay: E,
|
|
2464
|
-
dismissSuccessOverlay: () => D(!1)
|
|
2465
|
-
};
|
|
2466
|
-
}, si = "_1jed92w2", ci = "_1jed92w3 _1jed92w1", li = "_1jed92w4 _1jed92w1", ui = "_1jed92w5 _1jed92w1", di = "_1jed92w6 _1jed92w1", fi = () => {
|
|
2467
|
-
let e = W(1), t;
|
|
2468
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ J("div", {
|
|
2469
|
-
className: si,
|
|
2470
|
-
children: [
|
|
2471
|
-
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("div", { className: ci }), /* @__PURE__ */ q("div", { className: ui })] }),
|
|
2472
|
-
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("div", { className: li }), /* @__PURE__ */ q("div", { className: ui })] }),
|
|
2473
|
-
/* @__PURE__ */ q("div", { className: di })
|
|
2474
|
-
]
|
|
2475
|
-
}), e[0] = t) : t = e[0], t;
|
|
2476
|
-
}, pi = "a2n8870", mi = "a2n8871", hi = "a2n8872", gi = "a2n8873", _i = "a2n8874", vi = "a2n8875", yi = "a2n8876", bi = "https://static.levocdn.com/WLZ1TXTD/Levo-Logo-moxa93IxlVi0W.webp", xi = re(() => import("altcha").then(() => ({ default: function({ widgetRef: e, client: t, onStateChange: n }) {
|
|
2477
|
-
return ae(() => {
|
|
2478
|
-
let { current: t } = e;
|
|
2479
|
-
if (t) return t.addEventListener("statechange", n), () => t.removeEventListener("statechange", n);
|
|
2480
|
-
}, [n]), /* @__PURE__ */ q("altcha-widget", {
|
|
2481
|
-
ref: e,
|
|
2482
|
-
style: {
|
|
2483
|
-
"--altcha-max-width": "100%",
|
|
2484
|
-
"--altcha-border-width": "1px",
|
|
2485
|
-
"--altcha-border-radius": D.input.borderRadius,
|
|
2486
|
-
"--altcha-color-base": E.colors.input,
|
|
2487
|
-
"--altcha-color-border": E.colors.border,
|
|
2488
|
-
"--altcha-color-border-focus": E.colors.ring,
|
|
2489
|
-
"--altcha-color-text": E.colors.inputForeground
|
|
2490
|
-
},
|
|
2491
|
-
hidelogo: !0,
|
|
2492
|
-
auto: "onfocus",
|
|
2493
|
-
hidefooter: !0,
|
|
2494
|
-
challengeurl: `${t.apiUrl}/v1/identity/captcha/create-challenge`,
|
|
2495
|
-
verifyurl: `${t.apiUrl}/v1/identity/captcha/verify-challenge`
|
|
2496
|
-
});
|
|
2497
|
-
} }))), Si = () => {
|
|
2498
|
-
let e = W(1), t;
|
|
2499
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ J("div", {
|
|
2500
|
-
className: hi,
|
|
2501
|
-
children: [/* @__PURE__ */ q("img", {
|
|
2502
|
-
alt: "Levo",
|
|
2503
|
-
src: bi,
|
|
2504
|
-
width: 16,
|
|
2505
|
-
height: 16,
|
|
2506
|
-
className: gi
|
|
2507
|
-
}), /* @__PURE__ */ q("span", {
|
|
2508
|
-
className: _i,
|
|
2509
|
-
children: "Levo CAPTCHA"
|
|
2510
|
-
})]
|
|
2511
|
-
}), e[0] = t) : t = e[0], t;
|
|
2512
|
-
}, Ci = () => {
|
|
2513
|
-
let e = W(1), t;
|
|
2514
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ q("div", {
|
|
2515
|
-
className: vi,
|
|
2516
|
-
children: /* @__PURE__ */ q("span", {
|
|
2517
|
-
className: yi,
|
|
2518
|
-
children: "Loading verification..."
|
|
2519
|
-
})
|
|
2520
|
-
}), e[0] = t) : t = e[0], t;
|
|
2521
|
-
}, wi = () => {
|
|
2522
|
-
let e = W(19), { disableCaptcha: t } = ei(), n = g(), [r, a] = Q(!1), o = se(null), s = t ? !1 : "Verification is required", c;
|
|
2523
|
-
e[0] === s ? c = e[1] : (c = {
|
|
2524
|
-
name: "__captcha",
|
|
2525
|
-
rules: { required: s }
|
|
2526
|
-
}, e[0] = s, e[1] = c);
|
|
2527
|
-
let { field: l, fieldState: u } = z(c), { onChange: d } = l, { error: f } = u, p, m;
|
|
2528
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
|
|
2529
|
-
a(!0);
|
|
2530
|
-
}, m = [], e[2] = p, e[3] = m) : (p = e[2], m = e[3]), ae(p, m);
|
|
2531
|
-
let h;
|
|
2532
|
-
e[4] === d ? h = e[5] : (h = (e) => {
|
|
2533
|
-
"detail" in e && d(e.detail.state || null);
|
|
2534
|
-
}, e[4] = d, e[5] = h);
|
|
2535
|
-
let _ = h;
|
|
2536
|
-
if (!r) {
|
|
2537
|
-
let t = f?.message, n;
|
|
2538
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ J("div", {
|
|
2539
|
-
className: mi,
|
|
2540
|
-
children: [/* @__PURE__ */ q(Ci, {}), /* @__PURE__ */ q(Si, {})]
|
|
2541
|
-
}), e[6] = n) : n = e[6];
|
|
2542
|
-
let r;
|
|
2543
|
-
return e[7] === t ? r = e[8] : (r = /* @__PURE__ */ q(i, {
|
|
2544
|
-
error: t,
|
|
2545
|
-
className: pi,
|
|
2546
|
-
children: n
|
|
2547
|
-
}), e[7] = t, e[8] = r), r;
|
|
2548
|
-
}
|
|
2549
|
-
let v = f?.message, y;
|
|
2550
|
-
e[9] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ q(Ci, {}), e[9] = y) : y = e[9];
|
|
2551
|
-
let b;
|
|
2552
|
-
e[10] !== n || e[11] !== _ ? (b = /* @__PURE__ */ q(Z, {
|
|
2553
|
-
fallback: y,
|
|
2554
|
-
children: /* @__PURE__ */ q(xi, {
|
|
2555
|
-
widgetRef: o,
|
|
2556
|
-
client: n,
|
|
2557
|
-
onStateChange: _
|
|
2558
|
-
})
|
|
2559
|
-
}), e[10] = n, e[11] = _, e[12] = b) : b = e[12];
|
|
2560
|
-
let x;
|
|
2561
|
-
e[13] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ q(Si, {}), e[13] = x) : x = e[13];
|
|
2562
|
-
let S;
|
|
2563
|
-
e[14] === b ? S = e[15] : (S = /* @__PURE__ */ J("div", {
|
|
2564
|
-
className: mi,
|
|
2565
|
-
children: [b, x]
|
|
2566
|
-
}), e[14] = b, e[15] = S);
|
|
2567
|
-
let C;
|
|
2568
|
-
return e[16] !== S || e[17] !== v ? (C = /* @__PURE__ */ q(i, {
|
|
2569
|
-
error: v,
|
|
2570
|
-
className: pi,
|
|
2571
|
-
children: S
|
|
2572
|
-
}), e[16] = S, e[17] = v, e[18] = C) : C = e[18], C;
|
|
2573
|
-
}, Ti = {
|
|
2574
|
-
errors: {},
|
|
2575
|
-
isValid: !0,
|
|
2576
|
-
isDirty: !1,
|
|
2577
|
-
isSubmitted: !1,
|
|
2578
|
-
submitCount: 0,
|
|
2579
|
-
dirtyFields: {}
|
|
2580
|
-
}, Ei = () => {
|
|
2581
|
-
let e = W(22), t = U(), n = H(), [r, i] = Q(Ti), a, o;
|
|
2582
|
-
e[0] === n ? (a = e[1], o = e[2]) : (a = () => {
|
|
2583
|
-
if (n?.subscribe) return n.subscribe({
|
|
2584
|
-
formState: {
|
|
2585
|
-
errors: !0,
|
|
2586
|
-
isValid: !0,
|
|
2587
|
-
isDirty: !0,
|
|
2588
|
-
dirtyFields: !0,
|
|
2589
|
-
touchedFields: !0
|
|
2590
|
-
},
|
|
2591
|
-
callback: (e) => {
|
|
2592
|
-
i({
|
|
2593
|
-
errors: e.errors ?? {},
|
|
2594
|
-
isValid: !!e.isValid,
|
|
2595
|
-
isDirty: !!e.isDirty,
|
|
2596
|
-
isSubmitted: !!e.isSubmitted,
|
|
2597
|
-
submitCount: e.submitCount ?? 0,
|
|
2598
|
-
dirtyFields: e.dirtyFields ?? {}
|
|
2599
|
-
});
|
|
2600
|
-
}
|
|
2601
|
-
});
|
|
2602
|
-
}, o = [n], e[0] = n, e[1] = a, e[2] = o), ae(a, o);
|
|
2603
|
-
let { errors: s, isValid: c, isDirty: l, isSubmitted: u, submitCount: d, dirtyFields: f } = r, [p, m] = Q(!0), h;
|
|
2604
|
-
e[3] === s ? h = e[4] : (h = Object.entries(s).map(ki), e[3] = s, e[4] = h);
|
|
2605
|
-
let g = h, _;
|
|
2606
|
-
e[5] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
|
|
2607
|
-
position: "fixed",
|
|
2608
|
-
right: 12,
|
|
2609
|
-
bottom: 12,
|
|
2610
|
-
zIndex: 9999,
|
|
2611
|
-
width: 360,
|
|
2612
|
-
maxHeight: "60vh",
|
|
2613
|
-
background: "#0b1020",
|
|
2614
|
-
color: "#e4e7ef",
|
|
2615
|
-
border: "1px solid #2a3148",
|
|
2616
|
-
borderRadius: 8,
|
|
2617
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
2618
|
-
fontSize: 11,
|
|
2619
|
-
boxShadow: "0 12px 32px rgba(0,0,0,0.35)",
|
|
2620
|
-
overflow: "hidden",
|
|
2621
|
-
display: "flex",
|
|
2622
|
-
flexDirection: "column"
|
|
2623
|
-
}, e[5] = _) : _ = e[5];
|
|
2624
|
-
let v, y;
|
|
2625
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (v = () => {
|
|
2626
|
-
m(Ai);
|
|
2627
|
-
}, y = {
|
|
2628
|
-
padding: "8px 12px",
|
|
2629
|
-
background: "#141b33",
|
|
2630
|
-
color: "#e4e7ef",
|
|
2631
|
-
border: "none",
|
|
2632
|
-
borderBottom: "1px solid #2a3148",
|
|
2633
|
-
cursor: "pointer",
|
|
2634
|
-
textAlign: "left",
|
|
2635
|
-
fontSize: 11,
|
|
2636
|
-
fontWeight: 600,
|
|
2637
|
-
letterSpacing: .5,
|
|
2638
|
-
textTransform: "uppercase"
|
|
2639
|
-
}, e[6] = v, e[7] = y) : (v = e[6], y = e[7]);
|
|
2640
|
-
let b = p ? "▾" : "▸", x = String(c), S = String(l), C = String(u), w;
|
|
2641
|
-
e[8] !== d || e[9] !== b || e[10] !== x || e[11] !== S || e[12] !== C ? (w = /* @__PURE__ */ J("button", {
|
|
2642
|
-
type: "button",
|
|
2643
|
-
onClick: v,
|
|
2644
|
-
style: y,
|
|
2645
|
-
children: [
|
|
2646
|
-
"RHF Debug ",
|
|
2647
|
-
b,
|
|
2648
|
-
" · valid=",
|
|
2649
|
-
x,
|
|
2650
|
-
" · dirty=",
|
|
2651
|
-
S,
|
|
2652
|
-
" · submitted=",
|
|
2653
|
-
C,
|
|
2654
|
-
" · submits=",
|
|
2655
|
-
d
|
|
2656
|
-
]
|
|
2657
|
-
}), e[8] = d, e[9] = b, e[10] = x, e[11] = S, e[12] = C, e[13] = w) : w = e[13];
|
|
2658
|
-
let T;
|
|
2659
|
-
e[14] !== f || e[15] !== g || e[16] !== p || e[17] !== t ? (T = p && /* @__PURE__ */ J("div", {
|
|
2660
|
-
style: {
|
|
2661
|
-
overflow: "auto",
|
|
2662
|
-
padding: 10,
|
|
2663
|
-
display: "grid",
|
|
2664
|
-
gap: 10
|
|
2665
|
-
},
|
|
2666
|
-
children: [
|
|
2667
|
-
/* @__PURE__ */ q(Oi, {
|
|
2668
|
-
title: `Errors (${g.length})`,
|
|
2669
|
-
accent: "#ff6b6b",
|
|
2670
|
-
children: g.length === 0 ? /* @__PURE__ */ q("div", {
|
|
2671
|
-
style: { opacity: .6 },
|
|
2672
|
-
children: "none"
|
|
2673
|
-
}) : g.map(ji)
|
|
2674
|
-
}),
|
|
2675
|
-
/* @__PURE__ */ q(Oi, {
|
|
2676
|
-
title: "Values",
|
|
2677
|
-
accent: "#7ce5b1",
|
|
2678
|
-
children: /* @__PURE__ */ q("pre", {
|
|
2679
|
-
style: Di,
|
|
2680
|
-
children: JSON.stringify(t ?? {}, null, 2)
|
|
2681
|
-
})
|
|
2682
|
-
}),
|
|
2683
|
-
/* @__PURE__ */ q(Oi, {
|
|
2684
|
-
title: "Dirty fields",
|
|
2685
|
-
accent: "#7cb1e5",
|
|
2686
|
-
children: /* @__PURE__ */ q("pre", {
|
|
2687
|
-
style: Di,
|
|
2688
|
-
children: JSON.stringify(f ?? {}, null, 2)
|
|
2689
|
-
})
|
|
2690
|
-
})
|
|
2691
|
-
]
|
|
2692
|
-
}), e[14] = f, e[15] = g, e[16] = p, e[17] = t, e[18] = T) : T = e[18];
|
|
2693
|
-
let E;
|
|
2694
|
-
return e[19] !== w || e[20] !== T ? (E = /* @__PURE__ */ J("div", {
|
|
2695
|
-
style: _,
|
|
2696
|
-
children: [w, T]
|
|
2697
|
-
}), e[19] = w, e[20] = T, e[21] = E) : E = e[21], E;
|
|
2698
|
-
}, Di = {
|
|
2699
|
-
margin: 0,
|
|
2700
|
-
whiteSpace: "pre-wrap",
|
|
2701
|
-
wordBreak: "break-word",
|
|
2702
|
-
fontFamily: "inherit",
|
|
2703
|
-
fontSize: 11,
|
|
2704
|
-
lineHeight: 1.45
|
|
2705
|
-
}, Oi = (e) => {
|
|
2706
|
-
let t = W(11), { title: n, accent: r, children: i } = e, a;
|
|
2707
|
-
t[0] === r ? a = t[1] : (a = {
|
|
2708
|
-
fontSize: 10,
|
|
2709
|
-
textTransform: "uppercase",
|
|
2710
|
-
letterSpacing: .6,
|
|
2711
|
-
color: r,
|
|
2712
|
-
marginBottom: 4,
|
|
2713
|
-
fontWeight: 700
|
|
2714
|
-
}, t[0] = r, t[1] = a);
|
|
2715
|
-
let o;
|
|
2716
|
-
t[2] !== a || t[3] !== n ? (o = /* @__PURE__ */ q("div", {
|
|
2717
|
-
style: a,
|
|
2718
|
-
children: n
|
|
2719
|
-
}), t[2] = a, t[3] = n, t[4] = o) : o = t[4];
|
|
2720
|
-
let s;
|
|
2721
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
2722
|
-
background: "#070b1a",
|
|
2723
|
-
border: "1px solid #1c2340",
|
|
2724
|
-
borderRadius: 6,
|
|
2725
|
-
padding: 8
|
|
2726
|
-
}, t[5] = s) : s = t[5];
|
|
2727
|
-
let c;
|
|
2728
|
-
t[6] === i ? c = t[7] : (c = /* @__PURE__ */ q("div", {
|
|
2729
|
-
style: s,
|
|
2730
|
-
children: i
|
|
2731
|
-
}), t[6] = i, t[7] = c);
|
|
2732
|
-
let l;
|
|
2733
|
-
return t[8] !== o || t[9] !== c ? (l = /* @__PURE__ */ J("div", { children: [o, c] }), t[8] = o, t[9] = c, t[10] = l) : l = t[10], l;
|
|
2734
|
-
};
|
|
2735
|
-
function ki(e) {
|
|
2736
|
-
let [t, n] = e;
|
|
2737
|
-
return {
|
|
2738
|
-
key: t,
|
|
2739
|
-
message: n?.message ?? "(no message)",
|
|
2740
|
-
type: n?.type ?? "—"
|
|
2741
|
-
};
|
|
2742
|
-
}
|
|
2743
|
-
function Ai(e) {
|
|
2744
|
-
return !e;
|
|
2745
|
-
}
|
|
2746
|
-
function ji(e) {
|
|
2747
|
-
return /* @__PURE__ */ J("div", {
|
|
2748
|
-
style: { marginBottom: 4 },
|
|
2749
|
-
children: [
|
|
2750
|
-
/* @__PURE__ */ q("span", {
|
|
2751
|
-
style: { color: "#ffb86b" },
|
|
2752
|
-
children: e.key
|
|
2753
|
-
}),
|
|
2754
|
-
" ",
|
|
2755
|
-
/* @__PURE__ */ J("span", {
|
|
2756
|
-
style: { opacity: .7 },
|
|
2757
|
-
children: [
|
|
2758
|
-
"[",
|
|
2759
|
-
e.type,
|
|
2760
|
-
"]"
|
|
2761
|
-
]
|
|
2762
|
-
}),
|
|
2763
|
-
/* @__PURE__ */ q("div", {
|
|
2764
|
-
style: {
|
|
2765
|
-
paddingLeft: 8,
|
|
2766
|
-
opacity: .85
|
|
2767
|
-
},
|
|
2768
|
-
children: e.message
|
|
2769
|
-
})
|
|
2770
|
-
]
|
|
2771
|
-
}, e.key);
|
|
2772
|
-
}
|
|
2773
|
-
//#endregion
|
|
2774
|
-
//#region ../../libraries/react-collection/dist/lib/components/FormHeader/FormHeader.cssm.js
|
|
2775
|
-
var Mi = "_1vist8m0", Ni = (e) => {
|
|
2776
|
-
let t = W(4), { className: n } = e, { uiConfig: r } = ei();
|
|
2777
|
-
if (r?.hideFormHeading) return null;
|
|
2778
|
-
let i;
|
|
2779
|
-
t[0] === n ? i = t[1] : (i = G(Mi, n), t[0] = n, t[1] = i);
|
|
2780
|
-
let a;
|
|
2781
|
-
return t[2] === i ? a = t[3] : (a = /* @__PURE__ */ q("h1", {
|
|
2782
|
-
className: i,
|
|
2783
|
-
children: "Create new"
|
|
2784
|
-
}), t[2] = i, t[3] = a), a;
|
|
2785
|
-
}, Pi = "zx38wb0", Fi = (e) => {
|
|
2786
|
-
let t = W(5), { children: n, className: r } = e, { uiConfig: i } = ei();
|
|
2787
|
-
if (i?.hideSectionHeadings) return null;
|
|
2788
|
-
let a;
|
|
2789
|
-
t[0] === r ? a = t[1] : (a = G(Pi, r), t[0] = r, t[1] = a);
|
|
2790
|
-
let o;
|
|
2791
|
-
return t[2] !== n || t[3] !== a ? (o = /* @__PURE__ */ q("h3", {
|
|
2792
|
-
className: a,
|
|
2793
|
-
children: n
|
|
2794
|
-
}), t[2] = n, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2795
|
-
}, Ii = "q22d794", Li = "q22d795", Ri = "q22d796", zi = "q22d797", Bi = "q22d798", Vi = 5, Hi = "Thank you!", Ui = "Your response has been submitted successfully.", Wi = () => {
|
|
2796
|
-
let e = W(1), t;
|
|
2797
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ J("svg", {
|
|
2798
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2799
|
-
viewBox: "0 0 24 24",
|
|
2800
|
-
fill: "none",
|
|
2801
|
-
stroke: "currentColor",
|
|
2802
|
-
strokeWidth: "2.5",
|
|
2803
|
-
strokeLinecap: "round",
|
|
2804
|
-
strokeLinejoin: "round",
|
|
2805
|
-
children: [/* @__PURE__ */ q("title", { children: "Check Icon" }), /* @__PURE__ */ q("path", { d: "M20 6 9 17l-5-5" })]
|
|
2806
|
-
}), e[0] = t) : t = e[0], t;
|
|
2807
|
-
}, Gi = ({ onDismiss: e }) => {
|
|
2808
|
-
let { successConfig: t, schema: n } = ei(), r = n?.settings?.success_message, [i, a] = Q(Vi), s = (e) => !e || e.replace(/<[^>]*>/g, "").trim() === "", c = t?.title || r?.title || Hi, l = t?.message || r?.message, u = s(l) ? Ui : l, d = t?.action || r?.action, f = d?.type ?? "none", p = f === "redirect" ? d?.value : void 0, m = (() => {
|
|
2809
|
-
let e = p?.trim();
|
|
2810
|
-
if (e && !e.startsWith("//")) {
|
|
2811
|
-
if (e.startsWith("/")) return e;
|
|
2812
|
-
try {
|
|
2813
|
-
let t = new URL(e);
|
|
2814
|
-
if (t.protocol === "http:" || t.protocol === "https:") return e;
|
|
2815
|
-
} catch {}
|
|
2816
|
-
}
|
|
2817
|
-
})();
|
|
2818
|
-
ae(() => {
|
|
2819
|
-
if (!m) return;
|
|
2820
|
-
let e = setInterval(() => {
|
|
2821
|
-
a((t) => t <= 1 ? (clearInterval(e), window.location.href = m, 0) : t - 1);
|
|
2822
|
-
}, 1e3);
|
|
2823
|
-
return () => clearInterval(e);
|
|
2824
|
-
}, [m]);
|
|
2825
|
-
let h = ie(() => {
|
|
2826
|
-
m && (window.location.href = m);
|
|
2827
|
-
}, [m]);
|
|
2828
|
-
return /* @__PURE__ */ q("div", {
|
|
2829
|
-
className: Ii,
|
|
2830
|
-
children: /* @__PURE__ */ J("div", {
|
|
2831
|
-
className: Li,
|
|
2832
|
-
children: [
|
|
2833
|
-
/* @__PURE__ */ q("div", {
|
|
2834
|
-
className: Ri,
|
|
2835
|
-
children: /* @__PURE__ */ q(Wi, {})
|
|
2836
|
-
}),
|
|
2837
|
-
/* @__PURE__ */ q("h2", {
|
|
2838
|
-
className: zi,
|
|
2839
|
-
children: c
|
|
2840
|
-
}),
|
|
2841
|
-
/* @__PURE__ */ q("div", {
|
|
2842
|
-
className: Bi,
|
|
2843
|
-
dangerouslySetInnerHTML: { __html: u }
|
|
2844
|
-
}),
|
|
2845
|
-
f === "submit_another" && /* @__PURE__ */ q("div", {
|
|
2846
|
-
className: "q22d799",
|
|
2847
|
-
children: /* @__PURE__ */ q(o, {
|
|
2848
|
-
variant: "default",
|
|
2849
|
-
size: "sm",
|
|
2850
|
-
onClick: e,
|
|
2851
|
-
children: "Submit Another"
|
|
2852
|
-
})
|
|
2853
|
-
}),
|
|
2854
|
-
f === "redirect" && m && /* @__PURE__ */ J("div", {
|
|
2855
|
-
className: "q22d799",
|
|
2856
|
-
children: [/* @__PURE__ */ q(o, {
|
|
2857
|
-
variant: "default",
|
|
2858
|
-
size: "sm",
|
|
2859
|
-
onClick: h,
|
|
2860
|
-
children: "Continue"
|
|
2861
|
-
}), /* @__PURE__ */ J("span", {
|
|
2862
|
-
className: "q22d79a",
|
|
2863
|
-
children: [
|
|
2864
|
-
"Redirecting in ",
|
|
2865
|
-
i,
|
|
2866
|
-
"s…"
|
|
2867
|
-
]
|
|
2868
|
-
})]
|
|
2869
|
-
})
|
|
2870
|
-
]
|
|
2871
|
-
})
|
|
2872
|
-
});
|
|
2873
|
-
}, Ki = (e) => {
|
|
2874
|
-
let t = W(29), { isError: n, contentId: r, publishedId: i, getContentId: a, allFormValues: o } = e, { collection: s } = g(), { schema: c, isLoggedIn: l, preview: u } = ei(), { formState: d } = H(), f = U(), p;
|
|
2875
|
-
t[0] !== s || t[1] !== r || t[2] !== a || t[3] !== n || t[4] !== l || t[5] !== u || t[6] !== i || t[7] !== c?.allow_draft || t[8] !== c?.key ? (p = (e) => {
|
|
2876
|
-
u || i || c?.key && !n && c?.allow_draft && (l ? r ? s.editDraftEntry(c?.key, r, e).then((e) => {
|
|
2877
|
-
e?.content?.data?._id && a(e?.content?.data?._id);
|
|
2878
|
-
}).catch(qi) : s.saveDraftEntry(c?.key, e).then((e) => {
|
|
2879
|
-
e?.content?.data?._id && a(e?.content?.data?._id);
|
|
2880
|
-
}).catch(Ji) : ii(c?.key, e));
|
|
2881
|
-
}, t[0] = s, t[1] = r, t[2] = a, t[3] = n, t[4] = l, t[5] = u, t[6] = i, t[7] = c?.allow_draft, t[8] = c?.key, t[9] = p) : p = t[9];
|
|
2882
|
-
let m = je(p, 100), { isDirty: h, isSubmitting: _, isSubmitSuccessful: v } = d, y;
|
|
2883
|
-
t[10] !== o || t[11] !== m || t[12] !== f || t[13] !== h || t[14] !== n || t[15] !== v || t[16] !== _ || t[17] !== u ? (y = () => {
|
|
2884
|
-
if (!u) {
|
|
2885
|
-
if (_ || v) {
|
|
2886
|
-
m.cancel();
|
|
2887
|
-
return;
|
|
2888
|
-
}
|
|
2889
|
-
n || h && Object?.keys(f || {})?.length > 0 && (m.cancel(), m({
|
|
2890
|
-
...o || {},
|
|
2891
|
-
...f
|
|
2892
|
-
}));
|
|
2893
|
-
}
|
|
2894
|
-
}, t[10] = o, t[11] = m, t[12] = f, t[13] = h, t[14] = n, t[15] = v, t[16] = _, t[17] = u, t[18] = y) : y = t[18];
|
|
2895
|
-
let b;
|
|
2896
|
-
return t[19] !== r || t[20] !== f || t[21] !== h || t[22] !== n || t[23] !== l || t[24] !== v || t[25] !== _ || t[26] !== u || t[27] !== i ? (b = [
|
|
2897
|
-
h,
|
|
2898
|
-
r,
|
|
2899
|
-
i,
|
|
2900
|
-
n,
|
|
2901
|
-
l,
|
|
2902
|
-
f,
|
|
2903
|
-
_,
|
|
2904
|
-
v,
|
|
2905
|
-
u
|
|
2906
|
-
], t[19] = r, t[20] = f, t[21] = h, t[22] = n, t[23] = l, t[24] = v, t[25] = _, t[26] = u, t[27] = i, t[28] = b) : b = t[28], ae(y, b), null;
|
|
2907
|
-
};
|
|
2908
|
-
function qi() {
|
|
2909
|
-
console.error("saving entry failed");
|
|
2910
|
-
}
|
|
2911
|
-
function Ji() {
|
|
2912
|
-
console.error("saving entry failed");
|
|
2913
|
-
}
|
|
2914
|
-
//#endregion
|
|
2915
|
-
//#region ../../libraries/react-collection/dist/lib/variants/DefaultFormVariant/DefaultFormVariant.cssm.js
|
|
2916
|
-
var Yi = "fil1ri0", Xi = "fil1ri1", Zi = "fil1ri2", Qi = "fil1ri5", $i = () => {
|
|
2917
|
-
let e = W(51), { schema: t, containerStyles: n, submitButtonConfig: r, isDisabled: i, widgets: a, disableCaptcha: s, debug: c, enableVerification: l } = ei(), u;
|
|
2918
|
-
e[0] === t ? u = e[1] : (u = { schema: t }, e[0] = t, e[1] = u);
|
|
2919
|
-
let { methods: d, isError: f, isLoading: p, contentId: m, publishedId: h, handleContentId: g, submitToRemote: _, allFormValues: v, showSuccessOverlay: y, dismissSuccessOverlay: b } = oi(u), { handleSubmit: x, watch: S, formState: C } = d, { isSubmitting: w } = C, T;
|
|
2920
|
-
e[2] === S ? T = e[3] : (T = S("__captcha"), e[2] = S, e[3] = T);
|
|
2921
|
-
let E = T, D;
|
|
2922
|
-
e[4] === _ ? D = e[5] : (D = async (e) => {
|
|
2923
|
-
await _(e);
|
|
2924
|
-
}, e[4] = _, e[5] = D);
|
|
2925
|
-
let O;
|
|
2926
|
-
e[6] !== x || e[7] !== D ? (O = x(D), e[6] = x, e[7] = D, e[8] = O) : O = e[8];
|
|
2927
|
-
let k = O;
|
|
2928
|
-
if (y) {
|
|
2929
|
-
let t;
|
|
2930
|
-
return e[9] === b ? t = e[10] : (t = /* @__PURE__ */ q(Gi, { onDismiss: b }), e[9] = b, e[10] = t), t;
|
|
2931
|
-
}
|
|
2932
|
-
let A;
|
|
2933
|
-
e[11] === c ? A = e[12] : (A = c && /* @__PURE__ */ q(Ei, {}), e[11] = c, e[12] = A);
|
|
2934
|
-
let j = m || "", M = h || "", N;
|
|
2935
|
-
e[13] !== v || e[14] !== g || e[15] !== f || e[16] !== j || e[17] !== M ? (N = /* @__PURE__ */ q(Ki, {
|
|
2936
|
-
getContentId: g,
|
|
2937
|
-
isError: f,
|
|
2938
|
-
contentId: j,
|
|
2939
|
-
publishedId: M,
|
|
2940
|
-
allFormValues: v
|
|
2941
|
-
}), e[13] = v, e[14] = g, e[15] = f, e[16] = j, e[17] = M, e[18] = N) : N = e[18];
|
|
2942
|
-
let P;
|
|
2943
|
-
e[19] === n ? P = e[20] : (P = G(Yi, n), e[19] = n, e[20] = P);
|
|
2944
|
-
let F;
|
|
2945
|
-
e[21] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ q(Ni, {}), e[21] = F) : F = e[21];
|
|
2946
|
-
let I = p && "fil1ri3", L;
|
|
2947
|
-
e[22] === I ? L = e[23] : (L = G(Xi, I), e[22] = I, e[23] = L);
|
|
2948
|
-
let R;
|
|
2949
|
-
e[24] !== l || e[25] !== t || e[26] !== a ? (R = t?.sections?.map((e) => /* @__PURE__ */ q(ea, {
|
|
2950
|
-
schema: t,
|
|
2951
|
-
section: e,
|
|
2952
|
-
widgets: a,
|
|
2953
|
-
enableVerification: l
|
|
2954
|
-
}, e.id)), e[24] = l, e[25] = t, e[26] = a, e[27] = R) : R = e[27];
|
|
2955
|
-
let z;
|
|
2956
|
-
e[28] === s ? z = e[29] : (z = !s && /* @__PURE__ */ q(wi, {}), e[28] = s, e[29] = z);
|
|
2957
|
-
let B;
|
|
2958
|
-
e[30] !== E || e[31] !== i || e[32] !== w || e[33] !== r?.show || e[34] !== r?.styles || e[35] !== r?.text ? (B = r?.show && /* @__PURE__ */ q("div", {
|
|
2959
|
-
className: "fil1ri4",
|
|
2960
|
-
children: /* @__PURE__ */ q(o, {
|
|
2961
|
-
className: r?.styles,
|
|
2962
|
-
disabled: i || w,
|
|
2963
|
-
type: "submit",
|
|
2964
|
-
children: w ? "Saving..." : E === "verifying" ? "Verifying..." : r?.text || "Save"
|
|
2965
|
-
})
|
|
2966
|
-
}), e[30] = E, e[31] = i, e[32] = w, e[33] = r?.show, e[34] = r?.styles, e[35] = r?.text, e[36] = B) : B = e[36];
|
|
2967
|
-
let V;
|
|
2968
|
-
e[37] !== k || e[38] !== L || e[39] !== R || e[40] !== z || e[41] !== B ? (V = /* @__PURE__ */ J("form", {
|
|
2969
|
-
className: L,
|
|
2970
|
-
id: "collection-form",
|
|
2971
|
-
onSubmit: k,
|
|
2972
|
-
children: [
|
|
2973
|
-
R,
|
|
2974
|
-
z,
|
|
2975
|
-
B
|
|
2976
|
-
]
|
|
2977
|
-
}), e[37] = k, e[38] = L, e[39] = R, e[40] = z, e[41] = B, e[42] = V) : V = e[42];
|
|
2978
|
-
let H;
|
|
2979
|
-
e[43] !== V || e[44] !== P ? (H = /* @__PURE__ */ J("div", {
|
|
2980
|
-
className: P,
|
|
2981
|
-
children: [F, V]
|
|
2982
|
-
}), e[43] = V, e[44] = P, e[45] = H) : H = e[45];
|
|
2983
|
-
let U;
|
|
2984
|
-
return e[46] !== d || e[47] !== H || e[48] !== A || e[49] !== N ? (U = /* @__PURE__ */ J(ee, {
|
|
2985
|
-
...d,
|
|
2986
|
-
children: [
|
|
2987
|
-
A,
|
|
2988
|
-
N,
|
|
2989
|
-
H
|
|
2990
|
-
]
|
|
2991
|
-
}), e[46] = d, e[47] = H, e[48] = A, e[49] = N, e[50] = U) : U = e[50], U;
|
|
2992
|
-
}, ea = (e) => {
|
|
2993
|
-
let t = W(12), { schema: n, section: r, widgets: i, enableVerification: a } = e, { visible: o } = it(n, r);
|
|
2994
|
-
if (!o || tt(r?.fields || [])) return null;
|
|
2995
|
-
let s;
|
|
2996
|
-
t[0] === r ? s = t[1] : (s = r?.label && /* @__PURE__ */ q(Fi, { children: r.label }), t[0] = r, t[1] = s);
|
|
2997
|
-
let c;
|
|
2998
|
-
t[2] !== a || t[3] !== n || t[4] !== r?.fields || t[5] !== i ? (c = r?.fields?.map((e) => /* @__PURE__ */ q(Ir, {
|
|
2999
|
-
field: e,
|
|
3000
|
-
widgets: i,
|
|
3001
|
-
schema: n,
|
|
3002
|
-
settings: { enableVerification: a }
|
|
3003
|
-
}, e?.key)), t[2] = a, t[3] = n, t[4] = r?.fields, t[5] = i, t[6] = c) : c = t[6];
|
|
3004
|
-
let l;
|
|
3005
|
-
t[7] === c ? l = t[8] : (l = /* @__PURE__ */ q("div", {
|
|
3006
|
-
className: Qi,
|
|
3007
|
-
children: c
|
|
3008
|
-
}), t[7] = c, t[8] = l);
|
|
3009
|
-
let u;
|
|
3010
|
-
return t[9] !== s || t[10] !== l ? (u = /* @__PURE__ */ J("div", {
|
|
3011
|
-
className: Zi,
|
|
3012
|
-
children: [s, l]
|
|
3013
|
-
}), t[9] = s, t[10] = l, t[11] = u) : u = t[11], u;
|
|
3014
|
-
}, ta = "_1kah2gz0", na = "_1kah2gz1", ra = "_1kah2gz3", ia = (e) => {
|
|
3015
|
-
let t = W(12), { totalSteps: n, currentStepIndex: r, hasLevoErrors: i } = e, { formState: a } = H(), { errors: o } = a, s = Object.keys(o || {}).length > 0 || i, c = Math.floor((r + 1) * 100 / n), l = s && "_1kah2gz2", u;
|
|
3016
|
-
t[0] === l ? u = t[1] : (u = G(na, l), t[0] = l, t[1] = u);
|
|
3017
|
-
let d = s && "_1kah2gz4", f;
|
|
3018
|
-
t[2] === d ? f = t[3] : (f = G(ra, d), t[2] = d, t[3] = f);
|
|
3019
|
-
let p = `${c}%`, m;
|
|
3020
|
-
t[4] === p ? m = t[5] : (m = { width: p }, t[4] = p, t[5] = m);
|
|
3021
|
-
let h;
|
|
3022
|
-
t[6] !== f || t[7] !== m ? (h = /* @__PURE__ */ q("div", {
|
|
3023
|
-
className: f,
|
|
3024
|
-
style: m
|
|
3025
|
-
}), t[6] = f, t[7] = m, t[8] = h) : h = t[8];
|
|
3026
|
-
let g;
|
|
3027
|
-
return t[9] !== u || t[10] !== h ? (g = /* @__PURE__ */ q("div", {
|
|
3028
|
-
className: ta,
|
|
3029
|
-
children: /* @__PURE__ */ q("div", {
|
|
3030
|
-
className: u,
|
|
3031
|
-
children: h
|
|
3032
|
-
})
|
|
3033
|
-
}), t[9] = u, t[10] = h, t[11] = g) : g = t[11], g;
|
|
3034
|
-
}, aa = "_1ypxmcv0", oa = "_1ypxmcv1", sa = "_1ypxmcvb", ca = "_1ypxmcvc", la = (e, t) => e?.sections?.flatMap((n) => qe(e, n, t) ? (n.fields || []).filter((n) => !Ge(e, n, t)).map((e) => ({
|
|
3035
|
-
id: e.key,
|
|
3036
|
-
content: e,
|
|
3037
|
-
sectionId: n.id || "",
|
|
3038
|
-
sectionLabel: n.label
|
|
3039
|
-
})) : []) ?? [], ua = () => {
|
|
3040
|
-
let e = W(82), { disableCaptcha: t, schema: n, widgets: r, submitButtonConfig: i, containerStyles: a, enableVerification: s } = ei(), c;
|
|
3041
|
-
e[0] === n ? c = e[1] : (c = () => la(n, {}), e[0] = n, e[1] = c);
|
|
3042
|
-
let [l, u] = Q(c), [d, f] = Q(0), [p, m] = Q(0), h;
|
|
3043
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
3044
|
-
state: "entered",
|
|
3045
|
-
direction: "next"
|
|
3046
|
-
}, e[2] = h) : h = e[2];
|
|
3047
|
-
let [g, _] = Q(h), v;
|
|
3048
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[3] = v) : v = e[3];
|
|
3049
|
-
let [y, b] = Q(v), x = g.state === "exiting" ? d : p, S = p === l.length - 1, C = l[x], w;
|
|
3050
|
-
e[4] === n ? w = e[5] : (w = (e) => u(la(n, e)), e[4] = n, e[5] = w);
|
|
3051
|
-
let T;
|
|
3052
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (T = () => {
|
|
3053
|
-
b([]), m(0), _({
|
|
3054
|
-
state: "exiting",
|
|
3055
|
-
direction: "next"
|
|
3056
|
-
});
|
|
3057
|
-
}, e[6] = T) : T = e[6];
|
|
3058
|
-
let E;
|
|
3059
|
-
e[7] !== p || e[8] !== l ? (E = (e) => {
|
|
3060
|
-
b(e);
|
|
3061
|
-
let t = l.findIndex((t) => e.some((e) => e.param === t.content.key));
|
|
3062
|
-
t !== -1 && t !== p && (m(t), _({
|
|
3063
|
-
state: "exiting",
|
|
3064
|
-
direction: "next"
|
|
3065
|
-
}));
|
|
3066
|
-
}, e[7] = p, e[8] = l, e[9] = E) : E = e[9];
|
|
3067
|
-
let D;
|
|
3068
|
-
e[10] !== n || e[11] !== w || e[12] !== E ? (D = {
|
|
3069
|
-
schema: n,
|
|
3070
|
-
setFormErrorAfterSubmit: !1,
|
|
3071
|
-
onInit: w,
|
|
3072
|
-
onSubmitSuccess: T,
|
|
3073
|
-
onSubmitError: E
|
|
3074
|
-
}, e[10] = n, e[11] = w, e[12] = E, e[13] = D) : D = e[13];
|
|
3075
|
-
let { methods: O, submitToRemote: k, appendFormValues: A, handleContentId: j, isError: M, allFormValues: N, contentId: P, publishedId: F, isLoading: I, showSuccessOverlay: L, dismissSuccessOverlay: R } = oi(D), { handleSubmit: z, setFocus: B, setError: V, formState: H } = O, { isSubmitting: U } = H, K;
|
|
3076
|
-
e[14] !== A || e[15] !== C?.content?.key || e[16] !== C?.id || e[17] !== n || e[18] !== k ? (K = async (e) => {
|
|
3077
|
-
b((e) => e.filter((e) => e?.param !== C?.content?.key));
|
|
3078
|
-
let t = la(n, e), r = t.findIndex((e) => e.id === C?.id);
|
|
3079
|
-
r !== -1 && r + 1 < t.length ? (u(t), A(e), m(r + 1), _({
|
|
3080
|
-
state: "exiting",
|
|
3081
|
-
direction: "next"
|
|
3082
|
-
})) : await k(e);
|
|
3083
|
-
}, e[14] = A, e[15] = C?.content?.key, e[16] = C?.id, e[17] = n, e[18] = k, e[19] = K) : K = e[19];
|
|
3084
|
-
let Y;
|
|
3085
|
-
e[20] !== z || e[21] !== K ? (Y = z(K), e[20] = z, e[21] = K, e[22] = Y) : Y = e[22];
|
|
3086
|
-
let te = Y, X;
|
|
3087
|
-
e[23] !== g.state || e[24] !== p ? (X = () => {
|
|
3088
|
-
g.state === "entered" && (p <= 0 || (m(da), _({
|
|
3089
|
-
state: "exiting",
|
|
3090
|
-
direction: "prev"
|
|
3091
|
-
})));
|
|
3092
|
-
}, e[23] = g.state, e[24] = p, e[25] = X) : X = e[25];
|
|
3093
|
-
let Z = X, ne;
|
|
3094
|
-
e[26] !== g.direction || e[27] !== g.state || e[28] !== C || e[29] !== p || e[30] !== B ? (ne = () => {
|
|
3095
|
-
g.state === "exiting" ? (f(p), _({
|
|
3096
|
-
state: "entering",
|
|
3097
|
-
direction: g.direction
|
|
3098
|
-
})) : g.state === "entering" && (_({
|
|
3099
|
-
state: "entered",
|
|
3100
|
-
direction: g.direction
|
|
3101
|
-
}), C?.content?.key && B(C.content.key));
|
|
3102
|
-
}, e[26] = g.direction, e[27] = g.state, e[28] = C, e[29] = p, e[30] = B, e[31] = ne) : ne = e[31];
|
|
3103
|
-
let re = ne, ie, oe;
|
|
3104
|
-
if (e[32] !== C || e[33] !== y || e[34] !== V ? (ie = () => {
|
|
3105
|
-
if (C && y?.length > 0) {
|
|
3106
|
-
let e = y?.find((e) => e?.param === C?.content?.key);
|
|
3107
|
-
e && V(e?.param, {
|
|
3108
|
-
type: "server_error",
|
|
3109
|
-
message: e?.message
|
|
3110
|
-
});
|
|
3111
|
-
}
|
|
3112
|
-
}, oe = [
|
|
3113
|
-
C,
|
|
3114
|
-
y,
|
|
3115
|
-
V
|
|
3116
|
-
], e[32] = C, e[33] = y, e[34] = V, e[35] = ie, e[36] = oe) : (ie = e[35], oe = e[36]), ae(ie, oe), !n || l.length === 0) return null;
|
|
3117
|
-
if (L) {
|
|
3118
|
-
let t;
|
|
3119
|
-
return e[37] === R ? t = e[38] : (t = /* @__PURE__ */ q(Gi, { onDismiss: R }), e[37] = R, e[38] = t), t;
|
|
3120
|
-
}
|
|
3121
|
-
let se = U || I, ce = P || "", ue = F || "", de;
|
|
3122
|
-
e[39] !== N || e[40] !== j || e[41] !== M || e[42] !== ce || e[43] !== ue ? (de = /* @__PURE__ */ q(Ki, {
|
|
3123
|
-
getContentId: j,
|
|
3124
|
-
isError: M,
|
|
3125
|
-
contentId: ce,
|
|
3126
|
-
publishedId: ue,
|
|
3127
|
-
allFormValues: N
|
|
3128
|
-
}), e[39] = N, e[40] = j, e[41] = M, e[42] = ce, e[43] = ue, e[44] = de) : de = e[44];
|
|
3129
|
-
let fe;
|
|
3130
|
-
e[45] === Symbol.for("react.memo_cache_sentinel") ? (fe = /* @__PURE__ */ q(Ni, { className: ca }), e[45] = fe) : fe = e[45];
|
|
3131
|
-
let pe = C?.sectionLabel, me;
|
|
3132
|
-
e[46] === pe ? me = e[47] : (me = /* @__PURE__ */ q(Fi, {
|
|
3133
|
-
className: sa,
|
|
3134
|
-
children: pe
|
|
3135
|
-
}), e[46] = pe, e[47] = me);
|
|
3136
|
-
let he = l?.length || 1, ge = Array.isArray(y) && y?.length > 0, _e;
|
|
3137
|
-
e[48] !== p || e[49] !== he || e[50] !== ge ? (_e = /* @__PURE__ */ q(ia, {
|
|
3138
|
-
currentStepIndex: p,
|
|
3139
|
-
totalSteps: he,
|
|
3140
|
-
hasLevoErrors: ge
|
|
3141
|
-
}), e[48] = p, e[49] = he, e[50] = ge, e[51] = _e) : _e = e[51];
|
|
3142
|
-
let ve;
|
|
3143
|
-
e[52] !== me || e[53] !== _e ? (ve = /* @__PURE__ */ J("div", {
|
|
3144
|
-
className: aa,
|
|
3145
|
-
children: [
|
|
3146
|
-
fe,
|
|
3147
|
-
me,
|
|
3148
|
-
_e
|
|
3149
|
-
]
|
|
3150
|
-
}), e[52] = me, e[53] = _e, e[54] = ve) : ve = e[54];
|
|
3151
|
-
let ye;
|
|
3152
|
-
e[55] === a ? ye = e[56] : (ye = G(oa, a), e[55] = a, e[56] = ye);
|
|
3153
|
-
let be;
|
|
3154
|
-
e[57] !== g.direction || e[58] !== g.state || e[59] !== C || e[60] !== t || e[61] !== s || e[62] !== re || e[63] !== Z || e[64] !== se || e[65] !== S || e[66] !== p || e[67] !== te || e[68] !== n || e[69] !== i?.show || e[70] !== i?.styles || e[71] !== i?.text || e[72] !== r ? (be = C && /* @__PURE__ */ q("div", {
|
|
3155
|
-
className: "_1ypxmcv6",
|
|
3156
|
-
"data-state": g.state,
|
|
3157
|
-
"data-direction": g.direction,
|
|
3158
|
-
onAnimationEnd: re,
|
|
3159
|
-
children: /* @__PURE__ */ J("form", {
|
|
3160
|
-
onSubmit: te,
|
|
3161
|
-
className: "_1ypxmcv7",
|
|
3162
|
-
children: [
|
|
3163
|
-
/* @__PURE__ */ q(Ir, {
|
|
3164
|
-
field: C.content,
|
|
3165
|
-
schema: n,
|
|
3166
|
-
widgets: r,
|
|
3167
|
-
settings: { enableVerification: s }
|
|
3168
|
-
}),
|
|
3169
|
-
!t && S && /* @__PURE__ */ q(wi, {}),
|
|
3170
|
-
/* @__PURE__ */ J("div", {
|
|
3171
|
-
className: "_1ypxmcv8",
|
|
3172
|
-
children: [/* @__PURE__ */ q("div", { className: "_1ypxmcv9" }), /* @__PURE__ */ J("div", {
|
|
3173
|
-
className: "_1ypxmcva",
|
|
3174
|
-
children: [/* @__PURE__ */ J(o, {
|
|
3175
|
-
type: "button",
|
|
3176
|
-
onClick: Z,
|
|
3177
|
-
size: "lg",
|
|
3178
|
-
disabled: p === 0 || se || g.state !== "entered",
|
|
3179
|
-
variant: "ghost",
|
|
3180
|
-
children: [/* @__PURE__ */ q(le, {
|
|
3181
|
-
size: 18,
|
|
3182
|
-
className: "mr-2"
|
|
3183
|
-
}), "Prev"]
|
|
3184
|
-
}), (!S || i?.show !== !1) && /* @__PURE__ */ q(o, {
|
|
3185
|
-
type: "submit",
|
|
3186
|
-
size: "lg",
|
|
3187
|
-
className: i?.styles,
|
|
3188
|
-
disabled: se || g.state !== "entered",
|
|
3189
|
-
children: se ? "Saving..." : S ? i?.text || "Submit" : "Next"
|
|
3190
|
-
})]
|
|
3191
|
-
})]
|
|
3192
|
-
})
|
|
3193
|
-
]
|
|
3194
|
-
})
|
|
3195
|
-
}, C.id), e[57] = g.direction, e[58] = g.state, e[59] = C, e[60] = t, e[61] = s, e[62] = re, e[63] = Z, e[64] = se, e[65] = S, e[66] = p, e[67] = te, e[68] = n, e[69] = i?.show, e[70] = i?.styles, e[71] = i?.text, e[72] = r, e[73] = be) : be = e[73];
|
|
3196
|
-
let xe;
|
|
3197
|
-
e[74] !== ye || e[75] !== be ? (xe = /* @__PURE__ */ q("div", {
|
|
3198
|
-
className: ye,
|
|
3199
|
-
children: be
|
|
3200
|
-
}), e[74] = ye, e[75] = be, e[76] = xe) : xe = e[76];
|
|
3201
|
-
let Se;
|
|
3202
|
-
return e[77] !== O || e[78] !== de || e[79] !== ve || e[80] !== xe ? (Se = /* @__PURE__ */ J(ee, {
|
|
3203
|
-
...O,
|
|
3204
|
-
children: [
|
|
3205
|
-
de,
|
|
3206
|
-
ve,
|
|
3207
|
-
xe
|
|
3208
|
-
]
|
|
3209
|
-
}), e[77] = O, e[78] = de, e[79] = ve, e[80] = xe, e[81] = Se) : Se = e[81], Se;
|
|
3210
|
-
};
|
|
3211
|
-
function da(e) {
|
|
3212
|
-
return Math.max(e - 1, 0);
|
|
3213
|
-
}
|
|
3214
|
-
//#endregion
|
|
3215
|
-
//#region ../../libraries/react-collection/dist/lib/variants/StepFormVariant2/StepFormVariant2.cssm.js
|
|
3216
|
-
var fa = "zlgzzn0", pa = "zlgzzn1", ma = "zlgzznb", ha = "zlgzznc", ga = (e, t) => e?.sections ? e.sections.filter((n) => tt(n.fields || []) ? !1 : qe(e, n, t)) : [], _a = () => {
|
|
3217
|
-
let e = W(99), { disableCaptcha: t, schema: n, widgets: r, submitButtonConfig: i, containerStyles: a, enableVerification: s } = ei(), c;
|
|
3218
|
-
e[0] === n ? c = e[1] : (c = () => ga(n, {}), e[0] = n, e[1] = c);
|
|
3219
|
-
let [l, u] = Q(c), [d, f] = Q(0), [p, m] = Q(0), h;
|
|
3220
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
3221
|
-
state: "entered",
|
|
3222
|
-
direction: "next"
|
|
3223
|
-
}, e[2] = h) : h = e[2];
|
|
3224
|
-
let [g, _] = Q(h), v;
|
|
3225
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[3] = v) : v = e[3];
|
|
3226
|
-
let [y, b] = Q(v), x = g.state === "exiting" ? d : p, S = l[x], C = p === l.length - 1, w;
|
|
3227
|
-
bb0: {
|
|
3228
|
-
if (n) {
|
|
3229
|
-
let t;
|
|
3230
|
-
if (e[4] !== S || e[5] !== n) {
|
|
3231
|
-
if (t = { ...n }, S && t) {
|
|
3232
|
-
let n;
|
|
3233
|
-
e[7] === S ? n = e[8] : (n = [S], e[7] = S, e[8] = n), t.sections = n;
|
|
3234
|
-
}
|
|
3235
|
-
e[4] = S, e[5] = n, e[6] = t;
|
|
3236
|
-
} else t = e[6];
|
|
3237
|
-
w = t;
|
|
3238
|
-
break bb0;
|
|
3239
|
-
}
|
|
3240
|
-
w = null;
|
|
3241
|
-
}
|
|
3242
|
-
let T = w, E;
|
|
3243
|
-
e[9] === n ? E = e[10] : (E = (e) => u(ga(n, e)), e[9] = n, e[10] = E);
|
|
3244
|
-
let D;
|
|
3245
|
-
e[11] === Symbol.for("react.memo_cache_sentinel") ? (D = () => {
|
|
3246
|
-
b([]), m(0), _({
|
|
3247
|
-
state: "exiting",
|
|
3248
|
-
direction: "next"
|
|
3249
|
-
});
|
|
3250
|
-
}, e[11] = D) : D = e[11];
|
|
3251
|
-
let O;
|
|
3252
|
-
e[12] !== p || e[13] !== l ? (O = (e) => {
|
|
3253
|
-
if (b(e), Array.isArray(e) && e.length > 0) {
|
|
3254
|
-
let t = l.findIndex((t) => t.fields?.some((t) => e.some((e) => e.param === t.key)));
|
|
3255
|
-
t !== -1 && t !== p && (m(t), _({
|
|
3256
|
-
state: "exiting",
|
|
3257
|
-
direction: "next"
|
|
3258
|
-
}));
|
|
3259
|
-
}
|
|
3260
|
-
}, e[12] = p, e[13] = l, e[14] = O) : O = e[14];
|
|
3261
|
-
let k;
|
|
3262
|
-
e[15] !== n || e[16] !== T || e[17] !== E || e[18] !== O ? (k = {
|
|
3263
|
-
schema: T,
|
|
3264
|
-
originalSchema: n,
|
|
3265
|
-
setFormErrorAfterSubmit: !1,
|
|
3266
|
-
onInit: E,
|
|
3267
|
-
onSubmitSuccess: D,
|
|
3268
|
-
onSubmitError: O
|
|
3269
|
-
}, e[15] = n, e[16] = T, e[17] = E, e[18] = O, e[19] = k) : k = e[19];
|
|
3270
|
-
let { methods: A, submitToRemote: j, appendFormValues: M, handleContentId: N, isError: P, allFormValues: F, contentId: I, publishedId: L, isLoading: R, showSuccessOverlay: z, dismissSuccessOverlay: B } = oi(k), { handleSubmit: V, setFocus: H, setError: U, watch: K, formState: Y } = A, { isSubmitting: te } = Y, X;
|
|
3271
|
-
e[20] === K ? X = e[21] : (X = K("__captcha"), e[20] = K, e[21] = X);
|
|
3272
|
-
let Z = X, ne;
|
|
3273
|
-
e[22] !== F || e[23] !== g.state || e[24] !== M || e[25] !== S?.fields || e[26] !== p || e[27] !== n || e[28] !== j ? (ne = async (e) => {
|
|
3274
|
-
b((e) => {
|
|
3275
|
-
let t = S?.fields?.map(va) || [];
|
|
3276
|
-
return e.filter((e) => !t.includes(e.param));
|
|
3277
|
-
});
|
|
3278
|
-
let t = ga(n, {
|
|
3279
|
-
...F || {},
|
|
3280
|
-
...e
|
|
3281
|
-
});
|
|
3282
|
-
p >= t.length - 1 ? await j(e) : (M(e), u(t), g.state === "entered" && (m(Math.min(p + 1, t.length - 1)), _({
|
|
3283
|
-
state: "exiting",
|
|
3284
|
-
direction: "next"
|
|
3285
|
-
})));
|
|
3286
|
-
}, e[22] = F, e[23] = g.state, e[24] = M, e[25] = S?.fields, e[26] = p, e[27] = n, e[28] = j, e[29] = ne) : ne = e[29];
|
|
3287
|
-
let re;
|
|
3288
|
-
e[30] !== V || e[31] !== ne ? (re = V(ne), e[30] = V, e[31] = ne, e[32] = re) : re = e[32];
|
|
3289
|
-
let ie = re, oe;
|
|
3290
|
-
e[33] !== g.state || e[34] !== p ? (oe = () => {
|
|
3291
|
-
g.state === "entered" && (p <= 0 || (m(ya), _({
|
|
3292
|
-
state: "exiting",
|
|
3293
|
-
direction: "prev"
|
|
3294
|
-
})));
|
|
3295
|
-
}, e[33] = g.state, e[34] = p, e[35] = oe) : oe = e[35];
|
|
3296
|
-
let se = oe, ce;
|
|
3297
|
-
e[36] !== g.direction || e[37] !== g.state || e[38] !== S || e[39] !== p || e[40] !== H ? (ce = () => {
|
|
3298
|
-
g.state === "exiting" ? (f(p), _({
|
|
3299
|
-
state: "entering",
|
|
3300
|
-
direction: g.direction
|
|
3301
|
-
})) : g.state === "entering" && (_({
|
|
3302
|
-
state: "entered",
|
|
3303
|
-
direction: g.direction
|
|
3304
|
-
}), S?.fields?.[0]?.key && H(S.fields[0].key));
|
|
3305
|
-
}, e[36] = g.direction, e[37] = g.state, e[38] = S, e[39] = p, e[40] = H, e[41] = ce) : ce = e[41];
|
|
3306
|
-
let ue = ce, de;
|
|
3307
|
-
e[42] !== g.state || e[43] !== S || e[44] !== y || e[45] !== U ? (de = () => {
|
|
3308
|
-
y?.length > 0 && S?.fields && g?.state === "entered" && y.forEach((e) => {
|
|
3309
|
-
S.fields?.some((t) => t.key === e.param) && U(e?.param, {
|
|
3310
|
-
type: "server_error",
|
|
3311
|
-
message: e?.message
|
|
3312
|
-
});
|
|
3313
|
-
});
|
|
3314
|
-
}, e[42] = g.state, e[43] = S, e[44] = y, e[45] = U, e[46] = de) : de = e[46];
|
|
3315
|
-
let fe;
|
|
3316
|
-
if (e[47] !== g || e[48] !== S || e[49] !== y || e[50] !== U ? (fe = [
|
|
3317
|
-
y,
|
|
3318
|
-
U,
|
|
3319
|
-
S,
|
|
3320
|
-
g
|
|
3321
|
-
], e[47] = g, e[48] = S, e[49] = y, e[50] = U, e[51] = fe) : fe = e[51], ae(de, fe), !n || l.length === 0) return null;
|
|
3322
|
-
if (z) {
|
|
3323
|
-
let t;
|
|
3324
|
-
return e[52] === B ? t = e[53] : (t = /* @__PURE__ */ q(Gi, { onDismiss: B }), e[52] = B, e[53] = t), t;
|
|
3325
|
-
}
|
|
3326
|
-
let pe = te || R || Z === "verifying" && C, me = I || "", he = L || "", ge;
|
|
3327
|
-
e[54] !== F || e[55] !== N || e[56] !== P || e[57] !== me || e[58] !== he ? (ge = /* @__PURE__ */ q(Ki, {
|
|
3328
|
-
getContentId: N,
|
|
3329
|
-
isError: P,
|
|
3330
|
-
contentId: me,
|
|
3331
|
-
publishedId: he,
|
|
3332
|
-
allFormValues: F
|
|
3333
|
-
}), e[54] = F, e[55] = N, e[56] = P, e[57] = me, e[58] = he, e[59] = ge) : ge = e[59];
|
|
3334
|
-
let _e;
|
|
3335
|
-
e[60] === Symbol.for("react.memo_cache_sentinel") ? (_e = /* @__PURE__ */ q(Ni, { className: ha }), e[60] = _e) : _e = e[60];
|
|
3336
|
-
let ve = S?.label, ye;
|
|
3337
|
-
e[61] === ve ? ye = e[62] : (ye = /* @__PURE__ */ q(Fi, {
|
|
3338
|
-
className: ma,
|
|
3339
|
-
children: ve
|
|
3340
|
-
}), e[61] = ve, e[62] = ye);
|
|
3341
|
-
let be = l?.length || 1, xe = Array.isArray(y) && y?.length > 0, Se;
|
|
3342
|
-
e[63] !== p || e[64] !== be || e[65] !== xe ? (Se = /* @__PURE__ */ q(ia, {
|
|
3343
|
-
currentStepIndex: p,
|
|
3344
|
-
totalSteps: be,
|
|
3345
|
-
hasLevoErrors: xe
|
|
3346
|
-
}), e[63] = p, e[64] = be, e[65] = xe, e[66] = Se) : Se = e[66];
|
|
3347
|
-
let Ce;
|
|
3348
|
-
e[67] !== ye || e[68] !== Se ? (Ce = /* @__PURE__ */ J("div", {
|
|
3349
|
-
className: fa,
|
|
3350
|
-
children: [
|
|
3351
|
-
_e,
|
|
3352
|
-
ye,
|
|
3353
|
-
Se
|
|
3354
|
-
]
|
|
3355
|
-
}), e[67] = ye, e[68] = Se, e[69] = Ce) : Ce = e[69];
|
|
3356
|
-
let we;
|
|
3357
|
-
e[70] === a ? we = e[71] : (we = G(pa, a), e[70] = a, e[71] = we);
|
|
3358
|
-
let Te;
|
|
3359
|
-
e[72] !== g.direction || e[73] !== g.state || e[74] !== Z || e[75] !== S || e[76] !== t || e[77] !== x || e[78] !== s || e[79] !== ue || e[80] !== se || e[81] !== pe || e[82] !== C || e[83] !== p || e[84] !== ie || e[85] !== n || e[86] !== i?.show || e[87] !== i?.styles || e[88] !== i?.text || e[89] !== r ? (Te = S && /* @__PURE__ */ q("div", {
|
|
3360
|
-
className: "zlgzzn6",
|
|
3361
|
-
"data-state": g.state,
|
|
3362
|
-
"data-direction": g.direction,
|
|
3363
|
-
onAnimationEnd: ue,
|
|
3364
|
-
children: /* @__PURE__ */ J("form", {
|
|
3365
|
-
onSubmit: ie,
|
|
3366
|
-
className: "zlgzzn7",
|
|
3367
|
-
children: [
|
|
3368
|
-
S.fields?.map((e) => e.hidden ? null : /* @__PURE__ */ q(Ir, {
|
|
3369
|
-
field: e,
|
|
3370
|
-
schema: n,
|
|
3371
|
-
widgets: r,
|
|
3372
|
-
settings: { enableVerification: s }
|
|
3373
|
-
}, e.key)),
|
|
3374
|
-
!t && C && /* @__PURE__ */ q(wi, {}),
|
|
3375
|
-
/* @__PURE__ */ J("div", {
|
|
3376
|
-
className: "zlgzzn8",
|
|
3377
|
-
children: [/* @__PURE__ */ q("div", { className: "zlgzzn9" }), /* @__PURE__ */ J("div", {
|
|
3378
|
-
className: "zlgzzna",
|
|
3379
|
-
children: [/* @__PURE__ */ J(o, {
|
|
3380
|
-
type: "button",
|
|
3381
|
-
onClick: se,
|
|
3382
|
-
size: "lg",
|
|
3383
|
-
disabled: p === 0 || pe || g.state !== "entered",
|
|
3384
|
-
variant: "ghost",
|
|
3385
|
-
children: [/* @__PURE__ */ q(le, {
|
|
3386
|
-
size: 18,
|
|
3387
|
-
className: "mr-2"
|
|
3388
|
-
}), "Prev"]
|
|
3389
|
-
}), (!C || i?.show !== !1) && /* @__PURE__ */ q(o, {
|
|
3390
|
-
type: "submit",
|
|
3391
|
-
size: "lg",
|
|
3392
|
-
className: i?.styles,
|
|
3393
|
-
disabled: pe || g.state !== "entered",
|
|
3394
|
-
children: pe ? Z === "verifying" ? "Verifying..." : "Saving..." : C ? i?.text || "Save" : "Next"
|
|
3395
|
-
})]
|
|
3396
|
-
})]
|
|
3397
|
-
})
|
|
3398
|
-
]
|
|
3399
|
-
})
|
|
3400
|
-
}, S.id || x), e[72] = g.direction, e[73] = g.state, e[74] = Z, e[75] = S, e[76] = t, e[77] = x, e[78] = s, e[79] = ue, e[80] = se, e[81] = pe, e[82] = C, e[83] = p, e[84] = ie, e[85] = n, e[86] = i?.show, e[87] = i?.styles, e[88] = i?.text, e[89] = r, e[90] = Te) : Te = e[90];
|
|
3401
|
-
let Ee;
|
|
3402
|
-
e[91] !== we || e[92] !== Te ? (Ee = /* @__PURE__ */ q("div", {
|
|
3403
|
-
className: we,
|
|
3404
|
-
children: Te
|
|
3405
|
-
}), e[91] = we, e[92] = Te, e[93] = Ee) : Ee = e[93];
|
|
3406
|
-
let De;
|
|
3407
|
-
return e[94] !== A || e[95] !== ge || e[96] !== Ce || e[97] !== Ee ? (De = /* @__PURE__ */ J(ee, {
|
|
3408
|
-
...A,
|
|
3409
|
-
children: [
|
|
3410
|
-
ge,
|
|
3411
|
-
Ce,
|
|
3412
|
-
Ee
|
|
3413
|
-
]
|
|
3414
|
-
}), e[94] = A, e[95] = ge, e[96] = Ce, e[97] = Ee, e[98] = De) : De = e[98], De;
|
|
3415
|
-
};
|
|
3416
|
-
function va(e) {
|
|
3417
|
-
return e.key;
|
|
3418
|
-
}
|
|
3419
|
-
function ya(e) {
|
|
3420
|
-
return Math.max(e - 1, 0);
|
|
3421
|
-
}
|
|
3422
|
-
//#endregion
|
|
3423
|
-
//#region ../../libraries/react-collection/dist/lib/variants/StepsFormVariant/StepsFormVariant.cssm.js
|
|
3424
|
-
var ba = "_1f3ynb50", xa = "_1f3ynb54", Sa = "_1f3ynb55", Ca = (e, t) => e?.sections ? e.sections.filter((n) => tt(n.fields || []) ? !1 : qe(e, n, t)) : [], wa = () => {
|
|
3425
|
-
let e = W(15), { schema: t, containerStyles: n } = ei(), r;
|
|
3426
|
-
e[0] === t ? r = e[1] : (r = () => Ca(t, {}), e[0] = t, e[1] = r);
|
|
3427
|
-
let [i, a] = Q(r), [o, s] = Q(0), c;
|
|
3428
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
|
|
3429
|
-
s(Ea);
|
|
3430
|
-
}, e[2] = c) : c = e[2];
|
|
3431
|
-
let l = c, u;
|
|
3432
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
|
|
3433
|
-
s(Da);
|
|
3434
|
-
}, e[3] = u) : u = e[3];
|
|
3435
|
-
let d = u, f;
|
|
3436
|
-
e[4] === Symbol.for("react.memo_cache_sentinel") ? (f = (e) => {
|
|
3437
|
-
s(e);
|
|
3438
|
-
}, e[4] = f) : f = e[4];
|
|
3439
|
-
let p = f, m;
|
|
3440
|
-
e[5] === t ? m = e[6] : (m = (e) => {
|
|
3441
|
-
a(Ca(t, e)), d();
|
|
3442
|
-
}, e[5] = t, e[6] = m);
|
|
3443
|
-
let h;
|
|
3444
|
-
e[7] === t ? h = e[8] : (h = (e) => {
|
|
3445
|
-
a(Ca(t, e));
|
|
3446
|
-
}, e[7] = t, e[8] = h);
|
|
3447
|
-
let g;
|
|
3448
|
-
return e[9] !== n || e[10] !== o || e[11] !== m || e[12] !== h || e[13] !== i ? (g = /* @__PURE__ */ q(Ta, {
|
|
3449
|
-
currentSectionIndex: o,
|
|
3450
|
-
visibleSections: i,
|
|
3451
|
-
onAdvanceWithValues: m,
|
|
3452
|
-
handlePrev: l,
|
|
3453
|
-
goToIndex: p,
|
|
3454
|
-
onInit: h,
|
|
3455
|
-
containerStyles: n
|
|
3456
|
-
}), e[9] = n, e[10] = o, e[11] = m, e[12] = h, e[13] = i, e[14] = g) : g = e[14], g;
|
|
3457
|
-
}, Ta = (e) => {
|
|
3458
|
-
let t = W(82), { containerStyles: n, currentSectionIndex: r, visibleSections: i, onAdvanceWithValues: a, handlePrev: s, goToIndex: c, onInit: l } = e, { schema: u, disableCaptcha: d, isDisabled: f, submitButtonConfig: p, widgets: m, enableVerification: h } = ei(), g;
|
|
3459
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (g = [], t[0] = g) : g = t[0];
|
|
3460
|
-
let [_, v] = Q(g), y = i?.[r], b;
|
|
3461
|
-
bb0: {
|
|
3462
|
-
if (u) {
|
|
3463
|
-
let e;
|
|
3464
|
-
if (t[1] !== y || t[2] !== u) {
|
|
3465
|
-
if (e = { ...u }, y && e) {
|
|
3466
|
-
let n;
|
|
3467
|
-
t[4] === y ? n = t[5] : (n = [y], t[4] = y, t[5] = n), e.sections = n;
|
|
3468
|
-
}
|
|
3469
|
-
t[1] = y, t[2] = u, t[3] = e;
|
|
3470
|
-
} else e = t[3];
|
|
3471
|
-
b = e;
|
|
3472
|
-
break bb0;
|
|
3473
|
-
}
|
|
3474
|
-
b = null;
|
|
3475
|
-
}
|
|
3476
|
-
let x = b, S = r === Number(i?.length) - 1, C;
|
|
3477
|
-
t[6] === c ? C = t[7] : (C = () => {
|
|
3478
|
-
v([]), c(0);
|
|
3479
|
-
}, t[6] = c, t[7] = C);
|
|
3480
|
-
let w;
|
|
3481
|
-
t[8] !== c || t[9] !== i ? (w = (e) => {
|
|
3482
|
-
if (v(e), Array.isArray(e) && e.length > 0) {
|
|
3483
|
-
let t = i.findIndex((t) => t.fields?.some((t) => e.some((e) => e.param === t.key)));
|
|
3484
|
-
t !== -1 && c(t);
|
|
3485
|
-
}
|
|
3486
|
-
}, t[8] = c, t[9] = i, t[10] = w) : w = t[10];
|
|
3487
|
-
let T;
|
|
3488
|
-
t[11] !== l || t[12] !== u || t[13] !== x || t[14] !== C || t[15] !== w ? (T = {
|
|
3489
|
-
schema: x,
|
|
3490
|
-
originalSchema: u,
|
|
3491
|
-
setFormErrorAfterSubmit: !1,
|
|
3492
|
-
onInit: l,
|
|
3493
|
-
onSubmitSuccess: C,
|
|
3494
|
-
onSubmitError: w
|
|
3495
|
-
}, t[11] = l, t[12] = u, t[13] = x, t[14] = C, t[15] = w, t[16] = T) : T = t[16];
|
|
3496
|
-
let { methods: E, submitToRemote: D, appendFormValues: O, isLoading: k, handleContentId: A, isError: j, contentId: M, publishedId: N, allFormValues: P, showSuccessOverlay: F, dismissSuccessOverlay: I } = oi(T), { handleSubmit: L, setError: R, watch: z, formState: B } = E, { isSubmitting: V } = B, H;
|
|
3497
|
-
t[17] === z ? H = t[18] : (H = z("__captcha"), t[17] = z, t[18] = H);
|
|
3498
|
-
let U = H, K;
|
|
3499
|
-
t[19] !== P || t[20] !== O || t[21] !== y?.fields || t[22] !== r || t[23] !== a || t[24] !== u || t[25] !== D ? (K = async (e) => {
|
|
3500
|
-
v((e) => {
|
|
3501
|
-
let t = y?.fields?.map(Oa) || [];
|
|
3502
|
-
return e.filter((e) => !t.includes(e.param));
|
|
3503
|
-
});
|
|
3504
|
-
let t = {
|
|
3505
|
-
...P || {},
|
|
3506
|
-
...e
|
|
3507
|
-
};
|
|
3508
|
-
r >= Ca(u, t).length - 1 ? await D(e) : (O(e), a(t));
|
|
3509
|
-
}, t[19] = P, t[20] = O, t[21] = y?.fields, t[22] = r, t[23] = a, t[24] = u, t[25] = D, t[26] = K) : K = t[26];
|
|
3510
|
-
let Y;
|
|
3511
|
-
t[27] !== L || t[28] !== K ? (Y = L(K), t[27] = L, t[28] = K, t[29] = Y) : Y = t[29];
|
|
3512
|
-
let te = Y, X, Z;
|
|
3513
|
-
if (t[30] !== y || t[31] !== _ || t[32] !== R ? (Z = () => {
|
|
3514
|
-
_?.length > 0 && y?.fields && _.forEach((e) => {
|
|
3515
|
-
y.fields?.some((t) => t.key === e.param) && R(e?.param, {
|
|
3516
|
-
type: "server_error",
|
|
3517
|
-
message: e?.message
|
|
3518
|
-
});
|
|
3519
|
-
});
|
|
3520
|
-
}, X = [
|
|
3521
|
-
_,
|
|
3522
|
-
R,
|
|
3523
|
-
y
|
|
3524
|
-
], t[30] = y, t[31] = _, t[32] = R, t[33] = X, t[34] = Z) : (X = t[33], Z = t[34]), ae(Z, X), F) {
|
|
3525
|
-
let e;
|
|
3526
|
-
return t[35] === I ? e = t[36] : (e = /* @__PURE__ */ q(Gi, { onDismiss: I }), t[35] = I, t[36] = e), e;
|
|
3527
|
-
}
|
|
3528
|
-
let ne = V || U === "verifying" && S, re = M || "", ie = N || "", oe;
|
|
3529
|
-
t[37] !== P || t[38] !== A || t[39] !== j || t[40] !== re || t[41] !== ie ? (oe = /* @__PURE__ */ q(Ki, {
|
|
3530
|
-
getContentId: A,
|
|
3531
|
-
isError: j,
|
|
3532
|
-
contentId: re,
|
|
3533
|
-
publishedId: ie,
|
|
3534
|
-
allFormValues: P
|
|
3535
|
-
}), t[37] = P, t[38] = A, t[39] = j, t[40] = re, t[41] = ie, t[42] = oe) : oe = t[42];
|
|
3536
|
-
let se = k && "_1f3ynb51", ce;
|
|
3537
|
-
t[43] !== n || t[44] !== se ? (ce = G(ba, n, se), t[43] = n, t[44] = se, t[45] = ce) : ce = t[45];
|
|
3538
|
-
let le;
|
|
3539
|
-
t[46] === Symbol.for("react.memo_cache_sentinel") ? (le = /* @__PURE__ */ q(Ni, {}), t[46] = le) : le = t[46];
|
|
3540
|
-
let ue = y?.label || "Details", de;
|
|
3541
|
-
t[47] === ue ? de = t[48] : (de = /* @__PURE__ */ q(Fi, { children: /* @__PURE__ */ q("span", { children: ue }) }), t[47] = ue, t[48] = de);
|
|
3542
|
-
let fe;
|
|
3543
|
-
t[49] !== y?.fields || t[50] !== h || t[51] !== u || t[52] !== m ? (fe = y?.fields?.map((e) => e && !e.hidden ? /* @__PURE__ */ q(Ir, {
|
|
3544
|
-
field: e,
|
|
3545
|
-
widgets: m,
|
|
3546
|
-
schema: u,
|
|
3547
|
-
settings: { enableVerification: h }
|
|
3548
|
-
}, e?.key) : null), t[49] = y?.fields, t[50] = h, t[51] = u, t[52] = m, t[53] = fe) : fe = t[53];
|
|
3549
|
-
let pe;
|
|
3550
|
-
t[54] !== d || t[55] !== S ? (pe = !d && S && /* @__PURE__ */ q(wi, {}), t[54] = d, t[55] = S, t[56] = pe) : pe = t[56];
|
|
3551
|
-
let me;
|
|
3552
|
-
t[57] !== U || t[58] !== r || t[59] !== s || t[60] !== S ? (me = r === 0 ? /* @__PURE__ */ q("div", {}) : /* @__PURE__ */ q(o, {
|
|
3553
|
-
type: "button",
|
|
3554
|
-
size: "sm",
|
|
3555
|
-
variant: "secondary",
|
|
3556
|
-
disabled: U === "verifying" && S,
|
|
3557
|
-
onClick: () => {
|
|
3558
|
-
s();
|
|
3559
|
-
},
|
|
3560
|
-
children: "Prev"
|
|
3561
|
-
}), t[57] = U, t[58] = r, t[59] = s, t[60] = S, t[61] = me) : me = t[61];
|
|
3562
|
-
let he = f || ne, ge = p?.styles, _e = ne ? U === "verifying" ? "Verifying..." : "Saving..." : S ? p?.text || "Save" : "Next", ve;
|
|
3563
|
-
t[62] !== he || t[63] !== ge || t[64] !== _e ? (ve = /* @__PURE__ */ q(o, {
|
|
3564
|
-
type: "submit",
|
|
3565
|
-
size: "sm",
|
|
3566
|
-
disabled: he,
|
|
3567
|
-
className: ge,
|
|
3568
|
-
children: _e
|
|
3569
|
-
}), t[62] = he, t[63] = ge, t[64] = _e, t[65] = ve) : ve = t[65];
|
|
3570
|
-
let ye;
|
|
3571
|
-
t[66] !== me || t[67] !== ve ? (ye = /* @__PURE__ */ J("div", {
|
|
3572
|
-
className: xa,
|
|
3573
|
-
children: [me, ve]
|
|
3574
|
-
}), t[66] = me, t[67] = ve, t[68] = ye) : ye = t[68];
|
|
3575
|
-
let be;
|
|
3576
|
-
t[69] !== fe || t[70] !== pe || t[71] !== ye ? (be = /* @__PURE__ */ J("div", {
|
|
3577
|
-
className: Sa,
|
|
3578
|
-
children: [
|
|
3579
|
-
fe,
|
|
3580
|
-
pe,
|
|
3581
|
-
ye
|
|
3582
|
-
]
|
|
3583
|
-
}), t[69] = fe, t[70] = pe, t[71] = ye, t[72] = be) : be = t[72];
|
|
3584
|
-
let xe;
|
|
3585
|
-
t[73] !== te || t[74] !== ce || t[75] !== de || t[76] !== be ? (xe = /* @__PURE__ */ J("form", {
|
|
3586
|
-
className: ce,
|
|
3587
|
-
id: "collection-form",
|
|
3588
|
-
onSubmit: te,
|
|
3589
|
-
children: [
|
|
3590
|
-
le,
|
|
3591
|
-
de,
|
|
3592
|
-
be
|
|
3593
|
-
]
|
|
3594
|
-
}), t[73] = te, t[74] = ce, t[75] = de, t[76] = be, t[77] = xe) : xe = t[77];
|
|
3595
|
-
let Se;
|
|
3596
|
-
return t[78] !== E || t[79] !== oe || t[80] !== xe ? (Se = /* @__PURE__ */ J(ee, {
|
|
3597
|
-
...E,
|
|
3598
|
-
children: [oe, xe]
|
|
3599
|
-
}), t[78] = E, t[79] = oe, t[80] = xe, t[81] = Se) : Se = t[81], Se;
|
|
3600
|
-
};
|
|
3601
|
-
function Ea(e) {
|
|
3602
|
-
return Math.max(e - 1, 0);
|
|
3603
|
-
}
|
|
3604
|
-
function Da(e) {
|
|
3605
|
-
return e + 1;
|
|
3606
|
-
}
|
|
3607
|
-
function Oa(e) {
|
|
3608
|
-
return e.key;
|
|
3609
|
-
}
|
|
3610
|
-
//#endregion
|
|
3611
|
-
//#region ../../libraries/react-collection/dist/lib/FormBuilder/index.js
|
|
3612
|
-
var ka = (e) => {
|
|
3613
|
-
let t = W(12), n, r, i;
|
|
3614
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({formVariant: n, enableVerification: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
3615
|
-
let a = i === void 0 ? !0 : i, o;
|
|
3616
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ q(fi, {}), t[4] = o) : o = t[4];
|
|
3617
|
-
let s;
|
|
3618
|
-
t[5] === n ? s = t[6] : (s = /* @__PURE__ */ q(Z, {
|
|
3619
|
-
fallback: o,
|
|
3620
|
-
children: q(n === "single-field" ? ua : n === "steps" ? wa : n === "steps-2" ? _a : $i, {})
|
|
3621
|
-
}), t[5] = n, t[6] = s);
|
|
3622
|
-
let c;
|
|
3623
|
-
return t[7] !== a || t[8] !== n || t[9] !== r || t[10] !== s ? (c = /* @__PURE__ */ q($r, {
|
|
3624
|
-
...r,
|
|
3625
|
-
enableVerification: a,
|
|
3626
|
-
variant: n,
|
|
3627
|
-
children: s
|
|
3628
|
-
}), t[7] = a, t[8] = n, t[9] = r, t[10] = s, t[11] = c) : c = t[11], c;
|
|
3629
|
-
}, Aa = (e) => {
|
|
3630
|
-
let t = W(17), n, r, i, a;
|
|
3631
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({collection_id: n, hiddenFields: r, enableVerification: a, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
3632
|
-
let o = a === void 0 ? !0 : a, { collection: s } = g(), [c, l] = Q(!0), [u, d] = Q(null), f;
|
|
3633
|
-
t[5] !== s || t[6] !== n || t[7] !== r || t[8] !== i ? (f = () => {
|
|
3634
|
-
n ? s?.getCollectionByIDExpanded(n, { headers: { "Levo-Workspace": i.workspace_id } }).then((e) => {
|
|
3635
|
-
let t = e?.content?.data;
|
|
3636
|
-
if (t) t.sections = t?.sections?.map((e) => (e.fields = e?.fields?.map((e) => (r?.includes(e?.key) && (e.hidden = !0), e)), e)), d(t);
|
|
3637
|
-
else throw Error(`API response invalid: ${t}`);
|
|
3638
|
-
}).catch(ja).finally(() => {
|
|
3639
|
-
l(!1);
|
|
3640
|
-
}) : (console.error("[CollectionFormBuilder] Collection ID or Workspace ID is missing."), l(!1));
|
|
3641
|
-
}, t[5] = s, t[6] = n, t[7] = r, t[8] = i, t[9] = f) : f = t[9];
|
|
3642
|
-
let p;
|
|
3643
|
-
t[10] === n ? p = t[11] : (p = [n], t[10] = n, t[11] = p), ae(f, p);
|
|
3644
|
-
let m;
|
|
3645
|
-
return t[12] !== o || t[13] !== c || t[14] !== i || t[15] !== u ? (m = c ? /* @__PURE__ */ q(fi, {}) : u ? /* @__PURE__ */ q(ka, {
|
|
3646
|
-
schema: u,
|
|
3647
|
-
enableVerification: o,
|
|
3648
|
-
...i
|
|
3649
|
-
}) : null, t[12] = o, t[13] = c, t[14] = i, t[15] = u, t[16] = m) : m = t[16], m;
|
|
3650
|
-
};
|
|
3651
|
-
function ja(e) {
|
|
3652
|
-
console.error("Error fetching schema", e);
|
|
3653
|
-
}
|
|
3654
|
-
//#endregion
|
|
3655
|
-
//#region ../../libraries/react-collection/dist/lib/CollectionFormRenderer/index.js
|
|
3656
|
-
var Ma = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification: r = !0, ...i }) => {
|
|
3657
|
-
let a = oe(() => {
|
|
3658
|
-
let n = { ...t }, r = (t) => t?.map((t) => ((e?.includes(t.key) || e?.includes(t.id)) && (t.hidden = !0), t.fields = r(t.fields), t));
|
|
3659
|
-
return n.sections = n?.sections?.map((e) => (e.fields = r(e?.fields), e)), n;
|
|
3660
|
-
}, [t]);
|
|
3661
|
-
return n ? /* @__PURE__ */ q(fi, {}) : a ? /* @__PURE__ */ q(ka, {
|
|
3662
|
-
schema: a,
|
|
3663
|
-
enableVerification: r,
|
|
3664
|
-
...i
|
|
3665
|
-
}) : null;
|
|
3666
|
-
}, Na = /* @__PURE__ */ e({ CollectionFormBuilder: () => Aa });
|
|
3667
|
-
//#endregion
|
|
3668
|
-
export { Zr as i, Ma as n, Aa as r, Na as t };
|