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