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