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