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