@arudovwen/form-builder-react 1.9.11 → 1.9.12
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as i, Fragment as ge, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import me, { createContext as Pn, useState as G, useEffect as j, useRef as fe, useMemo as ue, forwardRef as un, createElement as Ni, useCallback as ae, Fragment as Ze, useContext as Pe, memo as li, Suspense as Dn } from "react";
|
|
3
3
|
import { v4 as Ce } from "uuid";
|
|
4
4
|
import { toast as Ae, Toaster as tn } from "sonner";
|
|
5
|
-
import { createPortal as
|
|
5
|
+
import { createPortal as Rn } from "react-dom";
|
|
6
6
|
import { appendErrors as In, useForm as Ei, useFieldArray as ci, useWatch as On, FormProvider as Kn } from "react-hook-form";
|
|
7
7
|
import { validateFieldsNatively as Gn, toNestErrors as jn } from "@hookform/resolvers";
|
|
8
8
|
import * as O from "yup";
|
|
9
9
|
import di from "react-currency-input-field";
|
|
10
|
-
import { Listbox as
|
|
10
|
+
import { Listbox as be, Transition as je, Combobox as Le, Popover as mi, ComboboxInput as Fn, ComboboxButton as Hn, ComboboxOptions as Vn, ComboboxOption as Un } from "@headlessui/react";
|
|
11
11
|
import Fe from "axios";
|
|
12
12
|
import Wn from "papaparse";
|
|
13
13
|
import * as Fi from "xlsx";
|
|
@@ -56,47 +56,47 @@ const we = Pn(void 0), Hi = {
|
|
|
56
56
|
console.warn("Could not save editor_future to sessionStorage", T);
|
|
57
57
|
}
|
|
58
58
|
}, [f]);
|
|
59
|
-
const S =
|
|
59
|
+
const S = fe(Date.now()), N = me.useCallback((T) => {
|
|
60
60
|
b((K) => {
|
|
61
61
|
const L = typeof T == "function" ? T(K) : T;
|
|
62
62
|
if (JSON.stringify(K) !== JSON.stringify(L)) {
|
|
63
|
-
const
|
|
63
|
+
const R = Date.now();
|
|
64
64
|
x((P) => {
|
|
65
65
|
if (P.length > 0 && JSON.stringify(P[P.length - 1]) === JSON.stringify(K))
|
|
66
66
|
return P;
|
|
67
|
-
if (
|
|
68
|
-
return S.current =
|
|
69
|
-
S.current =
|
|
70
|
-
const
|
|
71
|
-
return
|
|
67
|
+
if (R - S.current < 800 && P.length > 0)
|
|
68
|
+
return S.current = R, P;
|
|
69
|
+
S.current = R;
|
|
70
|
+
const V = [...P, K];
|
|
71
|
+
return V.length > 20 ? V.slice(V.length - 20) : V;
|
|
72
72
|
}), p([]);
|
|
73
73
|
}
|
|
74
74
|
return L;
|
|
75
75
|
});
|
|
76
|
-
}, []), g =
|
|
76
|
+
}, []), g = me.useCallback(() => {
|
|
77
77
|
if (h.length === 0) return;
|
|
78
78
|
const T = h[h.length - 1], K = h.slice(0, h.length - 1);
|
|
79
79
|
x(K), p([t, ...f]), b(T), a == null || a("UNDO", null);
|
|
80
|
-
}, [h, f, t, a]), v =
|
|
80
|
+
}, [h, f, t, a]), v = me.useCallback(() => {
|
|
81
81
|
if (f.length === 0) return;
|
|
82
82
|
const T = f[0], K = f.slice(1);
|
|
83
83
|
p(K), x([...h, t]), b(T), a == null || a("REDO", null);
|
|
84
|
-
}, [h, f, t, a]), w = t, M = h.length > 0, y = f.length > 0, [A, k] = G(!1), [C, E] = G(null), [B,
|
|
84
|
+
}, [h, f, t, a]), w = t, M = h.length > 0, y = f.length > 0, [A, k] = G(!1), [C, E] = G(null), [B, D] = G([
|
|
85
85
|
0
|
|
86
|
-
]), [Z, Q] = G(""), [
|
|
87
|
-
}, []), X =
|
|
86
|
+
]), [Z, Q] = G(""), [H, ie] = G(0), U = me.useCallback(() => {
|
|
87
|
+
}, []), X = me.useCallback(() => {
|
|
88
88
|
const T = Ce();
|
|
89
|
-
N((K) => [...K, { ...Hi, id: T }]), E(T),
|
|
90
|
-
}, [w, a, N]), Y =
|
|
89
|
+
N((K) => [...K, { ...Hi, id: T }]), E(T), D([w.length]), a == null || a("ADD_SECTION", { sectionId: T });
|
|
90
|
+
}, [w, a, N]), Y = me.useCallback(
|
|
91
91
|
(T) => {
|
|
92
92
|
N(
|
|
93
93
|
s === "isDeleted" || s === "soft" ? (K) => K.map(
|
|
94
94
|
(L) => {
|
|
95
|
-
var
|
|
95
|
+
var R;
|
|
96
96
|
return L.id === T ? {
|
|
97
97
|
...L,
|
|
98
98
|
isDeleted: !0,
|
|
99
|
-
questionData: (
|
|
99
|
+
questionData: (R = L == null ? void 0 : L.questionData) == null ? void 0 : R.map((P) => ({
|
|
100
100
|
...P,
|
|
101
101
|
isDeleted: !0
|
|
102
102
|
}))
|
|
@@ -106,103 +106,103 @@ const we = Pn(void 0), Hi = {
|
|
|
106
106
|
), E(null), a == null || a("REMOVE_SECTION", { sectionId: T });
|
|
107
107
|
},
|
|
108
108
|
[s, a, N]
|
|
109
|
-
), ke =
|
|
109
|
+
), ke = me.useCallback(
|
|
110
110
|
(T, K) => {
|
|
111
|
-
const L = w.find((P) => P.id === K),
|
|
111
|
+
const L = w.find((P) => P.id === K), R = L == null ? void 0 : L.questionData.find(
|
|
112
112
|
(P) => P.id === T
|
|
113
113
|
);
|
|
114
|
-
|
|
115
|
-
(P) => P == null ? void 0 : P.map((
|
|
114
|
+
R && (N(
|
|
115
|
+
(P) => P == null ? void 0 : P.map((V) => {
|
|
116
116
|
var I;
|
|
117
|
-
return
|
|
118
|
-
...
|
|
119
|
-
questionData: (I =
|
|
120
|
-
if (
|
|
121
|
-
if (
|
|
122
|
-
return { ...
|
|
123
|
-
} else if (
|
|
124
|
-
return { ...
|
|
125
|
-
return
|
|
117
|
+
return V.id !== K ? V : s === "isDeleted" || s === "soft" ? {
|
|
118
|
+
...V,
|
|
119
|
+
questionData: (I = V == null ? void 0 : V.questionData) == null ? void 0 : I.map((F) => {
|
|
120
|
+
if (R.type === "grid") {
|
|
121
|
+
if (F.gridId === R.id || F.id === R.id)
|
|
122
|
+
return { ...F, isDeleted: !0 };
|
|
123
|
+
} else if (F.id === T)
|
|
124
|
+
return { ...F, isDeleted: !0 };
|
|
125
|
+
return F;
|
|
126
126
|
})
|
|
127
127
|
} : {
|
|
128
|
-
...
|
|
129
|
-
questionData:
|
|
128
|
+
...V,
|
|
129
|
+
questionData: V == null ? void 0 : V.questionData.filter((F) => R.type === "grid" ? F.gridId !== R.id && F.id !== R.id : F.id !== T)
|
|
130
130
|
};
|
|
131
131
|
})
|
|
132
132
|
), a == null || a("REMOVE_ELEMENT", { sectionId: K, elementId: T }));
|
|
133
133
|
},
|
|
134
134
|
[w, s, N, a]
|
|
135
|
-
),
|
|
135
|
+
), pe = me.useCallback(
|
|
136
136
|
(T, K) => {
|
|
137
137
|
const L = w.find((I) => I.id === K);
|
|
138
138
|
if (!L) return;
|
|
139
|
-
const
|
|
139
|
+
const R = L == null ? void 0 : L.questionData.findIndex(
|
|
140
140
|
(I) => I.id === T
|
|
141
141
|
);
|
|
142
|
-
if (
|
|
143
|
-
const P = L == null ? void 0 : L.questionData[
|
|
142
|
+
if (R === -1) return;
|
|
143
|
+
const P = L == null ? void 0 : L.questionData[R], V = (I, F = {}) => ({
|
|
144
144
|
...JSON.parse(JSON.stringify(I)),
|
|
145
145
|
id: Ce(),
|
|
146
|
-
...
|
|
146
|
+
...F
|
|
147
147
|
});
|
|
148
148
|
N(
|
|
149
|
-
(I) => I == null ? void 0 : I.map((
|
|
150
|
-
var
|
|
151
|
-
if (
|
|
152
|
-
const
|
|
149
|
+
(I) => I == null ? void 0 : I.map((F) => {
|
|
150
|
+
var oe;
|
|
151
|
+
if (F.id !== K) return F;
|
|
152
|
+
const z = [...F.questionData];
|
|
153
153
|
if (P.type === "grid") {
|
|
154
|
-
const
|
|
154
|
+
const ne = (oe = z == null ? void 0 : z.map((Be, Ee) => ({ e: Be, i: Ee })).filter(
|
|
155
155
|
({ e: Be }) => Be.id === P.id || Be.gridId === P.id
|
|
156
|
-
)) == null ? void 0 :
|
|
157
|
-
He.id =
|
|
158
|
-
const
|
|
159
|
-
(Be) =>
|
|
156
|
+
)) == null ? void 0 : oe.map(({ i: Be }) => Be), le = ne.length ? Math.max(...ne) + 1 : R + 1, se = Ce(), He = V(P, {});
|
|
157
|
+
He.id = se;
|
|
158
|
+
const de = z.filter((Be) => Be.gridId === P.id), ee = de == null ? void 0 : de.map(
|
|
159
|
+
(Be) => V(Be, { gridId: se })
|
|
160
160
|
), Oe = [
|
|
161
|
-
...
|
|
161
|
+
...z.slice(0, le),
|
|
162
162
|
He,
|
|
163
|
-
...
|
|
164
|
-
...
|
|
163
|
+
...ee,
|
|
164
|
+
...z.slice(le)
|
|
165
165
|
];
|
|
166
|
-
return { ...
|
|
166
|
+
return { ...F, questionData: Oe };
|
|
167
167
|
} else if (P.gridId) {
|
|
168
|
-
const
|
|
169
|
-
delete
|
|
170
|
-
const
|
|
171
|
-
(
|
|
172
|
-
|
|
168
|
+
const ne = { ...P };
|
|
169
|
+
delete ne.gridId, delete ne.gridPosition;
|
|
170
|
+
const le = V(ne, {}), se = z.reduce(
|
|
171
|
+
(de, ee, Oe) => ee.id === P.gridId || ee.gridId === P.gridId ? Oe : de,
|
|
172
|
+
R
|
|
173
173
|
), He = [
|
|
174
|
-
...
|
|
175
|
-
|
|
176
|
-
...
|
|
174
|
+
...z.slice(0, se + 1),
|
|
175
|
+
le,
|
|
176
|
+
...z.slice(se + 1)
|
|
177
177
|
];
|
|
178
|
-
return { ...
|
|
178
|
+
return { ...F, questionData: He };
|
|
179
179
|
} else {
|
|
180
|
-
const
|
|
181
|
-
...
|
|
182
|
-
|
|
183
|
-
...
|
|
180
|
+
const ne = V(P, {}), le = [
|
|
181
|
+
...z.slice(0, R + 1),
|
|
182
|
+
ne,
|
|
183
|
+
...z.slice(R + 1)
|
|
184
184
|
];
|
|
185
|
-
return { ...
|
|
185
|
+
return { ...F, questionData: le };
|
|
186
186
|
}
|
|
187
187
|
})
|
|
188
188
|
), a == null || a("DUPLICATE_ELEMENT", { sectionId: K, elementId: T });
|
|
189
189
|
},
|
|
190
190
|
[w, N, a]
|
|
191
|
-
),
|
|
191
|
+
), ce = me.useCallback(
|
|
192
192
|
(T, K) => {
|
|
193
193
|
const L = w.find((I) => I.id === K);
|
|
194
194
|
if (!L) return;
|
|
195
|
-
const
|
|
195
|
+
const R = L == null ? void 0 : L.questionData.findIndex(
|
|
196
196
|
(I) => I.id === T
|
|
197
197
|
);
|
|
198
|
-
if (
|
|
199
|
-
const P = L == null ? void 0 : L.questionData[
|
|
200
|
-
let
|
|
198
|
+
if (R === -1) return;
|
|
199
|
+
const P = L == null ? void 0 : L.questionData[R];
|
|
200
|
+
let V = null;
|
|
201
201
|
if (P.type === "grid") {
|
|
202
202
|
const I = L.questionData.filter(
|
|
203
|
-
(
|
|
203
|
+
(F) => F.gridId === P.id
|
|
204
204
|
);
|
|
205
|
-
|
|
205
|
+
V = {
|
|
206
206
|
type: "FORM_BUILDER_CLIPBOARD",
|
|
207
207
|
element: P,
|
|
208
208
|
children: I,
|
|
@@ -210,44 +210,44 @@ const we = Pn(void 0), Hi = {
|
|
|
210
210
|
};
|
|
211
211
|
} else if (P.gridId) {
|
|
212
212
|
const I = { ...P };
|
|
213
|
-
delete I.gridId, delete I.gridPosition,
|
|
213
|
+
delete I.gridId, delete I.gridPosition, V = {
|
|
214
214
|
type: "FORM_BUILDER_CLIPBOARD",
|
|
215
215
|
element: I,
|
|
216
216
|
timestamp: Date.now()
|
|
217
217
|
};
|
|
218
218
|
} else
|
|
219
|
-
|
|
219
|
+
V = {
|
|
220
220
|
type: "FORM_BUILDER_CLIPBOARD",
|
|
221
221
|
element: P,
|
|
222
222
|
timestamp: Date.now()
|
|
223
223
|
};
|
|
224
|
-
if (
|
|
225
|
-
const I = JSON.stringify(
|
|
224
|
+
if (V) {
|
|
225
|
+
const I = JSON.stringify(V);
|
|
226
226
|
try {
|
|
227
227
|
localStorage.setItem("form_builder_clipboard", I), navigator.clipboard && navigator.clipboard.writeText && navigator.clipboard.writeText(I).catch(() => {
|
|
228
228
|
}), Ae.success("Element copied to clipboard"), a == null || a("COPY_ELEMENT", { sectionId: K, elementId: T });
|
|
229
|
-
} catch (
|
|
230
|
-
console.warn("Could not copy element to clipboard",
|
|
229
|
+
} catch (F) {
|
|
230
|
+
console.warn("Could not copy element to clipboard", F), Ae.error("Failed to copy element");
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
234
|
[w, a]
|
|
235
|
-
), W =
|
|
235
|
+
), W = me.useCallback(
|
|
236
236
|
async (T, K, L) => {
|
|
237
|
-
let
|
|
238
|
-
if (L && L.includes("FORM_BUILDER_CLIPBOARD") && (
|
|
237
|
+
let R = "";
|
|
238
|
+
if (L && L.includes("FORM_BUILDER_CLIPBOARD") && (R = L), !R && navigator.clipboard && navigator.clipboard.readText)
|
|
239
239
|
try {
|
|
240
240
|
const P = await navigator.clipboard.readText();
|
|
241
|
-
P && P.includes("FORM_BUILDER_CLIPBOARD") && (
|
|
241
|
+
P && P.includes("FORM_BUILDER_CLIPBOARD") && (R = P);
|
|
242
242
|
} catch (P) {
|
|
243
243
|
console.warn("Could not parse clipboard data", P);
|
|
244
244
|
}
|
|
245
|
-
if (
|
|
245
|
+
if (R || (R = localStorage.getItem("form_builder_clipboard") || ""), !R) {
|
|
246
246
|
Ae.error("Nothing to paste. Copy an element first.");
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
249
|
try {
|
|
250
|
-
const P = JSON.parse(
|
|
250
|
+
const P = JSON.parse(R);
|
|
251
251
|
if ((P == null ? void 0 : P.type) !== "FORM_BUILDER_CLIPBOARD" || !(P != null && P.element)) {
|
|
252
252
|
Ae.error("Invalid clipboard data.");
|
|
253
253
|
return;
|
|
@@ -256,25 +256,25 @@ const we = Pn(void 0), Hi = {
|
|
|
256
256
|
Ae.error("Copied element has expired (1 minute limit)."), localStorage.removeItem("form_builder_clipboard");
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const V = (I, F = {}) => ({
|
|
260
260
|
...JSON.parse(JSON.stringify(I)),
|
|
261
261
|
id: Ce(),
|
|
262
|
-
...
|
|
262
|
+
...F
|
|
263
263
|
});
|
|
264
264
|
N(
|
|
265
|
-
(I) => I == null ? void 0 : I.map((
|
|
266
|
-
if (
|
|
267
|
-
const
|
|
265
|
+
(I) => I == null ? void 0 : I.map((F) => {
|
|
266
|
+
if (F.id !== T) return F;
|
|
267
|
+
const oe = [...[...F.questionData]];
|
|
268
268
|
if (P.element.type === "grid") {
|
|
269
|
-
const
|
|
270
|
-
(He) =>
|
|
269
|
+
const ne = Ce(), le = V(P.element, { id: ne, sectionId: T }), se = (P.children || []).map(
|
|
270
|
+
(He) => V(He, { gridId: ne, sectionId: T })
|
|
271
271
|
);
|
|
272
|
-
K !== void 0 ?
|
|
272
|
+
K !== void 0 ? oe.splice(K, 0, le, ...se) : oe.push(le, ...se);
|
|
273
273
|
} else {
|
|
274
|
-
const
|
|
275
|
-
K !== void 0 ?
|
|
274
|
+
const ne = V(P.element, { sectionId: T });
|
|
275
|
+
K !== void 0 ? oe.splice(K, 0, ne) : oe.push(ne);
|
|
276
276
|
}
|
|
277
|
-
return { ...
|
|
277
|
+
return { ...F, questionData: oe };
|
|
278
278
|
})
|
|
279
279
|
), Ae.success("Element pasted successfully"), a == null || a("PASTE_ELEMENT", { sectionId: T });
|
|
280
280
|
} catch (P) {
|
|
@@ -282,31 +282,31 @@ const we = Pn(void 0), Hi = {
|
|
|
282
282
|
}
|
|
283
283
|
},
|
|
284
284
|
[N, a]
|
|
285
|
-
),
|
|
285
|
+
), he = me.useCallback(
|
|
286
286
|
(T, K) => {
|
|
287
287
|
N(
|
|
288
288
|
(L) => L == null ? void 0 : L.map(
|
|
289
|
-
(
|
|
289
|
+
(R) => R.id === K ? { ...R, questionData: T } : R
|
|
290
290
|
)
|
|
291
291
|
), a == null || a("UPDATE_ELEMENT_POSITION", { sectionId: K });
|
|
292
292
|
},
|
|
293
293
|
[N, a]
|
|
294
|
-
),
|
|
294
|
+
), xe = me.useCallback(
|
|
295
295
|
(T, K) => {
|
|
296
296
|
N(
|
|
297
297
|
(L) => L == null ? void 0 : L.map(
|
|
298
|
-
(
|
|
299
|
-
...
|
|
300
|
-
questionData: [...(
|
|
301
|
-
} :
|
|
298
|
+
(R) => R.id === K ? {
|
|
299
|
+
...R,
|
|
300
|
+
questionData: [...(R == null ? void 0 : R.questionData) || [], T]
|
|
301
|
+
} : R
|
|
302
302
|
)
|
|
303
303
|
), a == null || a("ADD_ELEMENT", { sectionId: K, element: T });
|
|
304
304
|
},
|
|
305
305
|
[N, a]
|
|
306
|
-
),
|
|
306
|
+
), te = me.useCallback(
|
|
307
307
|
(T, K, L) => {
|
|
308
308
|
N(
|
|
309
|
-
(
|
|
309
|
+
(R) => R == null ? void 0 : R.map(
|
|
310
310
|
(P) => P.id === K ? {
|
|
311
311
|
...P,
|
|
312
312
|
questionData: [
|
|
@@ -319,24 +319,24 @@ const we = Pn(void 0), Hi = {
|
|
|
319
319
|
), a == null || a("ADD_ELEMENT_IN_POSITION", { sectionId: K, element: T, index: L });
|
|
320
320
|
},
|
|
321
321
|
[N, a]
|
|
322
|
-
), Te =
|
|
322
|
+
), Te = me.useCallback(
|
|
323
323
|
(T, K, L) => {
|
|
324
324
|
N(
|
|
325
|
-
(
|
|
325
|
+
(R) => R == null ? void 0 : R.map(
|
|
326
326
|
(P) => {
|
|
327
|
-
var
|
|
327
|
+
var V;
|
|
328
328
|
return P.id === L ? {
|
|
329
329
|
...P,
|
|
330
|
-
questionData: (
|
|
330
|
+
questionData: (V = P == null ? void 0 : P.questionData) == null ? void 0 : V.map(
|
|
331
331
|
(I) => {
|
|
332
|
-
var
|
|
332
|
+
var F;
|
|
333
333
|
return I.type === "grid" && I.gridData ? {
|
|
334
334
|
...I,
|
|
335
|
-
gridData: (
|
|
336
|
-
(
|
|
337
|
-
...
|
|
335
|
+
gridData: (F = I.gridData) == null ? void 0 : F.map(
|
|
336
|
+
(z, oe) => oe === T ? {
|
|
337
|
+
...z,
|
|
338
338
|
...K
|
|
339
|
-
} :
|
|
339
|
+
} : z
|
|
340
340
|
).concat(
|
|
341
341
|
T >= I.gridData.length ? { ...K } : []
|
|
342
342
|
)
|
|
@@ -349,154 +349,154 @@ const we = Pn(void 0), Hi = {
|
|
|
349
349
|
), a == null || a("UPDATE_GRID_ELEMENT", { sectionId: L, gridIndex: T, element: K });
|
|
350
350
|
},
|
|
351
351
|
[N, a]
|
|
352
|
-
),
|
|
352
|
+
), De = me.useCallback(
|
|
353
353
|
(T, K) => {
|
|
354
354
|
N(
|
|
355
355
|
(L) => L == null ? void 0 : L.map(
|
|
356
|
-
(
|
|
356
|
+
(R) => {
|
|
357
357
|
var P;
|
|
358
|
-
return
|
|
359
|
-
...
|
|
360
|
-
questionData: (P =
|
|
361
|
-
(
|
|
358
|
+
return R.id === K ? {
|
|
359
|
+
...R,
|
|
360
|
+
questionData: (P = R == null ? void 0 : R.questionData) == null ? void 0 : P.map(
|
|
361
|
+
(V) => V.id === T.id ? { ...V, ...T } : V
|
|
362
362
|
)
|
|
363
|
-
} :
|
|
363
|
+
} : R;
|
|
364
364
|
}
|
|
365
365
|
)
|
|
366
366
|
), a == null || a("UPDATE_ELEMENT", { sectionId: K, value: T });
|
|
367
367
|
},
|
|
368
368
|
[N, a]
|
|
369
|
-
),
|
|
369
|
+
), Re = me.useCallback(
|
|
370
370
|
(T) => {
|
|
371
371
|
const {
|
|
372
372
|
draggedId: K,
|
|
373
373
|
sectionId: L,
|
|
374
|
-
targetIndex:
|
|
374
|
+
targetIndex: R,
|
|
375
375
|
targetId: P,
|
|
376
|
-
targetGridId:
|
|
376
|
+
targetGridId: V,
|
|
377
377
|
targetCol: I
|
|
378
378
|
} = T;
|
|
379
|
-
N((
|
|
379
|
+
N((F) => {
|
|
380
380
|
var He;
|
|
381
|
-
let
|
|
382
|
-
for (const
|
|
383
|
-
const
|
|
381
|
+
let z = null, oe = [], ne = null, le = -1;
|
|
382
|
+
for (const de of F) {
|
|
383
|
+
const ee = (He = de.questionData) == null ? void 0 : He.findIndex(
|
|
384
384
|
(Oe) => Oe.id === K
|
|
385
385
|
);
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
(Oe) => Oe.gridId ===
|
|
386
|
+
if (ee !== -1) {
|
|
387
|
+
z = de.questionData[ee], ne = de.id, le = ee, z.type === "grid" && (oe = de.questionData.filter(
|
|
388
|
+
(Oe) => Oe.gridId === z.id
|
|
389
389
|
));
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
if (!
|
|
394
|
-
return
|
|
395
|
-
const
|
|
396
|
-
return
|
|
393
|
+
if (!z || V !== void 0 && z.type === "grid")
|
|
394
|
+
return F;
|
|
395
|
+
const se = { ...z, sectionId: L };
|
|
396
|
+
return F.map((de) => {
|
|
397
397
|
var Oe, Be;
|
|
398
|
-
let
|
|
399
|
-
if (
|
|
400
|
-
return
|
|
401
|
-
if (
|
|
402
|
-
const Ee =
|
|
403
|
-
if (
|
|
404
|
-
const Me =
|
|
405
|
-
(
|
|
398
|
+
let ee = [...de.questionData || []];
|
|
399
|
+
if (de.id !== ne && de.id !== L)
|
|
400
|
+
return de;
|
|
401
|
+
if (ne === L && de.id === L) {
|
|
402
|
+
const Ee = le;
|
|
403
|
+
if (V !== void 0 && I !== void 0) {
|
|
404
|
+
const Me = ee.findIndex(
|
|
405
|
+
(Se) => {
|
|
406
406
|
var Ne;
|
|
407
|
-
return
|
|
407
|
+
return Se.id !== K && Se.gridId === V && ((Ne = Se.gridPosition) == null ? void 0 : Ne.col) === I;
|
|
408
408
|
}
|
|
409
409
|
);
|
|
410
|
-
let
|
|
411
|
-
(
|
|
412
|
-
...
|
|
413
|
-
gridId:
|
|
410
|
+
let ve = ee.map(
|
|
411
|
+
(Se) => Se.id === K ? {
|
|
412
|
+
...se,
|
|
413
|
+
gridId: V,
|
|
414
414
|
gridPosition: { col: I }
|
|
415
|
-
} :
|
|
415
|
+
} : Se
|
|
416
416
|
);
|
|
417
|
-
return Me !== -1 && (
|
|
418
|
-
if (Ne !== Me) return
|
|
419
|
-
const We = { ...
|
|
417
|
+
return Me !== -1 && (ve = ve.map((Se, Ne) => {
|
|
418
|
+
if (Ne !== Me) return Se;
|
|
419
|
+
const We = { ...Se };
|
|
420
420
|
return delete We.gridId, delete We.gridPosition, We;
|
|
421
|
-
})), { ...
|
|
421
|
+
})), { ...de, questionData: ve };
|
|
422
422
|
}
|
|
423
|
-
if (
|
|
424
|
-
const Me = { ...
|
|
423
|
+
if (se.gridId && R !== void 0 && V === void 0) {
|
|
424
|
+
const Me = { ...se };
|
|
425
425
|
delete Me.gridId, delete Me.gridPosition;
|
|
426
|
-
const
|
|
426
|
+
const ve = ((Be = (Oe = F.find(
|
|
427
427
|
(Ne) => Ne.id === L
|
|
428
|
-
)) == null ? void 0 : Oe.questionData) == null ? void 0 : Be.filter((Ne) => Ne.gridId !== K)) || [],
|
|
429
|
-
return
|
|
428
|
+
)) == null ? void 0 : Oe.questionData) == null ? void 0 : Be.filter((Ne) => Ne.gridId !== K)) || [], Se = Math.min(R, ve.length);
|
|
429
|
+
return ve.splice(Se, 0, Me), { ...de, questionData: ve };
|
|
430
430
|
}
|
|
431
|
-
if (!
|
|
432
|
-
|
|
433
|
-
const Me = Math.min(
|
|
434
|
-
return
|
|
431
|
+
if (!se.gridId && R !== void 0 && V === void 0 && !P) {
|
|
432
|
+
ee.splice(Ee, 1);
|
|
433
|
+
const Me = Math.min(R, ee.length);
|
|
434
|
+
return ee.splice(Me, 0, se), { ...de, questionData: ee };
|
|
435
435
|
}
|
|
436
436
|
if (P) {
|
|
437
|
-
const Me =
|
|
438
|
-
return Me === -1 ?
|
|
437
|
+
const Me = ee.findIndex((ve) => ve.id === P);
|
|
438
|
+
return Me === -1 ? de : (ee.splice(Ee, 1), ee.splice(Me, 0, se), { ...de, questionData: ee });
|
|
439
439
|
}
|
|
440
|
-
return
|
|
440
|
+
return de;
|
|
441
441
|
}
|
|
442
|
-
if (
|
|
443
|
-
return
|
|
444
|
-
if (
|
|
445
|
-
const Ee =
|
|
446
|
-
...
|
|
442
|
+
if (de.id === ne && de.id !== L)
|
|
443
|
+
return ee.splice(le, 1), oe.length > 0 && (ee = ee.filter((Ee) => Ee.gridId !== z.id)), { ...de, questionData: ee };
|
|
444
|
+
if (de.id === L && de.id !== ne) {
|
|
445
|
+
const Ee = oe.map((ve) => ({
|
|
446
|
+
...ve,
|
|
447
447
|
sectionId: L
|
|
448
448
|
}));
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
449
|
+
if (V !== void 0 && I !== void 0) {
|
|
450
|
+
const ve = ee.findIndex(
|
|
451
451
|
(Ne) => {
|
|
452
452
|
var We;
|
|
453
|
-
return Ne.gridId ===
|
|
453
|
+
return Ne.gridId === V && ((We = Ne.gridPosition) == null ? void 0 : We.col) === I;
|
|
454
454
|
}
|
|
455
|
-
),
|
|
456
|
-
...
|
|
457
|
-
gridId:
|
|
455
|
+
), Se = {
|
|
456
|
+
...se,
|
|
457
|
+
gridId: V,
|
|
458
458
|
gridPosition: { col: I }
|
|
459
459
|
};
|
|
460
|
-
if (
|
|
461
|
-
const Ne = { ...
|
|
462
|
-
delete Ne.gridId, delete Ne.gridPosition,
|
|
460
|
+
if (ve !== -1) {
|
|
461
|
+
const Ne = { ...ee[ve] };
|
|
462
|
+
delete Ne.gridId, delete Ne.gridPosition, ee[ve] = Ne, ee.push(Se, ...Ee);
|
|
463
463
|
} else
|
|
464
|
-
|
|
465
|
-
return { ...
|
|
464
|
+
ee.push(Se, ...Ee);
|
|
465
|
+
return { ...de, questionData: ee };
|
|
466
466
|
}
|
|
467
|
-
if (
|
|
468
|
-
const
|
|
469
|
-
delete
|
|
470
|
-
const
|
|
471
|
-
return
|
|
467
|
+
if (R !== void 0 && V === void 0 && !P) {
|
|
468
|
+
const ve = { ...se };
|
|
469
|
+
delete ve.gridId, delete ve.gridPosition;
|
|
470
|
+
const Se = Math.min(R, ee.length);
|
|
471
|
+
return ee.splice(Se, 0, ve, ...Ee), { ...de, questionData: ee };
|
|
472
472
|
}
|
|
473
473
|
if (P) {
|
|
474
|
-
const
|
|
475
|
-
delete
|
|
476
|
-
const
|
|
477
|
-
return
|
|
474
|
+
const ve = { ...se };
|
|
475
|
+
delete ve.gridId, delete ve.gridPosition;
|
|
476
|
+
const Se = ee.findIndex((Ne) => Ne.id === P);
|
|
477
|
+
return Se !== -1 ? ee.splice(Se, 0, ve, ...Ee) : ee.push(ve, ...Ee), { ...de, questionData: ee };
|
|
478
478
|
}
|
|
479
|
-
const Me = { ...
|
|
480
|
-
return delete Me.gridId, delete Me.gridPosition,
|
|
479
|
+
const Me = { ...se };
|
|
480
|
+
return delete Me.gridId, delete Me.gridPosition, ee.push(Me, ...Ee), { ...de, questionData: ee };
|
|
481
481
|
}
|
|
482
|
-
return
|
|
482
|
+
return de;
|
|
483
483
|
});
|
|
484
484
|
}), a == null || a("MOVE_ELEMENT", T);
|
|
485
485
|
},
|
|
486
486
|
[N, a]
|
|
487
|
-
), Ie =
|
|
487
|
+
), Ie = me.useCallback(
|
|
488
488
|
(T, K) => {
|
|
489
489
|
N(
|
|
490
490
|
(L) => L == null ? void 0 : L.map(
|
|
491
|
-
(
|
|
492
|
-
...
|
|
491
|
+
(R) => R.id === K ? {
|
|
492
|
+
...R,
|
|
493
493
|
...T
|
|
494
|
-
} :
|
|
494
|
+
} : R
|
|
495
495
|
)
|
|
496
496
|
), a == null || a("UPDATE_SECTION", { sectionId: K, value: T });
|
|
497
497
|
},
|
|
498
498
|
[N, a]
|
|
499
|
-
),
|
|
499
|
+
), q = ue(
|
|
500
500
|
() => ({
|
|
501
501
|
deleteMode: s,
|
|
502
502
|
formData: w,
|
|
@@ -505,10 +505,10 @@ const we = Pn(void 0), Hi = {
|
|
|
505
505
|
removeElement: ke,
|
|
506
506
|
elementData: m,
|
|
507
507
|
setElementData: r,
|
|
508
|
-
updateElementPosition:
|
|
509
|
-
addElement:
|
|
510
|
-
addElementInPosition:
|
|
511
|
-
updateElement:
|
|
508
|
+
updateElementPosition: he,
|
|
509
|
+
addElement: xe,
|
|
510
|
+
addElementInPosition: te,
|
|
511
|
+
updateElement: De,
|
|
512
512
|
addSection: X,
|
|
513
513
|
removeSection: Y,
|
|
514
514
|
updateSection: Ie,
|
|
@@ -517,23 +517,23 @@ const we = Pn(void 0), Hi = {
|
|
|
517
517
|
selectedSection: C,
|
|
518
518
|
setSelectedSection: E,
|
|
519
519
|
activeSections: B,
|
|
520
|
-
setActiveSections:
|
|
520
|
+
setActiveSections: D,
|
|
521
521
|
updateGridElement: Te,
|
|
522
522
|
answerData: d,
|
|
523
523
|
setAnswerData: u,
|
|
524
524
|
uploadUrl: Z,
|
|
525
525
|
setUploadUrl: Q,
|
|
526
|
-
apiActivityCount:
|
|
527
|
-
setApiActivityCount:
|
|
528
|
-
duplicateElement:
|
|
529
|
-
moveElement:
|
|
526
|
+
apiActivityCount: H,
|
|
527
|
+
setApiActivityCount: ie,
|
|
528
|
+
duplicateElement: pe,
|
|
529
|
+
moveElement: Re,
|
|
530
530
|
showPreview: o,
|
|
531
531
|
setShowPreview: l,
|
|
532
532
|
undo: g,
|
|
533
533
|
redo: v,
|
|
534
534
|
canUndo: M,
|
|
535
535
|
canRedo: y,
|
|
536
|
-
copyElement:
|
|
536
|
+
copyElement: ce,
|
|
537
537
|
pasteElement: W
|
|
538
538
|
}),
|
|
539
539
|
[
|
|
@@ -542,10 +542,10 @@ const we = Pn(void 0), Hi = {
|
|
|
542
542
|
U,
|
|
543
543
|
ke,
|
|
544
544
|
m,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
545
|
+
he,
|
|
546
|
+
xe,
|
|
547
|
+
te,
|
|
548
|
+
De,
|
|
549
549
|
X,
|
|
550
550
|
Y,
|
|
551
551
|
Ie,
|
|
@@ -555,19 +555,19 @@ const we = Pn(void 0), Hi = {
|
|
|
555
555
|
Te,
|
|
556
556
|
d,
|
|
557
557
|
Z,
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
558
|
+
H,
|
|
559
|
+
pe,
|
|
560
|
+
Re,
|
|
561
561
|
o,
|
|
562
562
|
g,
|
|
563
563
|
v,
|
|
564
564
|
M,
|
|
565
565
|
y,
|
|
566
|
-
|
|
566
|
+
ce,
|
|
567
567
|
W
|
|
568
568
|
]
|
|
569
569
|
);
|
|
570
|
-
return /* @__PURE__ */ i(we.Provider, { value:
|
|
570
|
+
return /* @__PURE__ */ i(we.Provider, { value: q, children: e });
|
|
571
571
|
};
|
|
572
572
|
function cn(e) {
|
|
573
573
|
var n, a, s = "";
|
|
@@ -896,15 +896,15 @@ function Pi(e) {
|
|
|
896
896
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
897
897
|
};
|
|
898
898
|
}
|
|
899
|
-
const
|
|
899
|
+
const Di = /* @__PURE__ */ Object.create(null), $e = ["https://api.simplesvg.com", "https://api.unisvg.com"], ai = [];
|
|
900
900
|
for (; $e.length > 0; ) $e.length === 1 || Math.random() > 0.5 ? ai.push($e.shift()) : ai.push($e.pop());
|
|
901
|
-
|
|
901
|
+
Di[""] = Pi({ resources: ["https://api.iconify.design"].concat(ai) });
|
|
902
902
|
function ba(e, n) {
|
|
903
903
|
const a = Pi(n);
|
|
904
|
-
return a === null ? !1 : (
|
|
904
|
+
return a === null ? !1 : (Di[e] = a, !0);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
return
|
|
906
|
+
function Ri(e) {
|
|
907
|
+
return Di[e];
|
|
908
908
|
}
|
|
909
909
|
const va = () => {
|
|
910
910
|
let e;
|
|
@@ -915,7 +915,7 @@ const va = () => {
|
|
|
915
915
|
};
|
|
916
916
|
let Ji = va();
|
|
917
917
|
function pa(e, n) {
|
|
918
|
-
const a =
|
|
918
|
+
const a = Ri(e);
|
|
919
919
|
if (!a) return 0;
|
|
920
920
|
let s;
|
|
921
921
|
if (!a.maxURL) s = 0;
|
|
@@ -951,7 +951,7 @@ const ga = (e, n, a) => {
|
|
|
951
951
|
};
|
|
952
952
|
function fa(e) {
|
|
953
953
|
if (typeof e == "string") {
|
|
954
|
-
const n =
|
|
954
|
+
const n = Ri(e);
|
|
955
955
|
if (n) return n.path;
|
|
956
956
|
}
|
|
957
957
|
return "/";
|
|
@@ -1225,7 +1225,7 @@ function qi() {
|
|
|
1225
1225
|
const vi = /* @__PURE__ */ Object.create(null);
|
|
1226
1226
|
function Ta(e) {
|
|
1227
1227
|
if (!vi[e]) {
|
|
1228
|
-
const n =
|
|
1228
|
+
const n = Ri(e);
|
|
1229
1229
|
if (!n) return;
|
|
1230
1230
|
const a = Sn(n), s = {
|
|
1231
1231
|
config: n,
|
|
@@ -1333,7 +1333,7 @@ function Pa(e, n) {
|
|
|
1333
1333
|
});
|
|
1334
1334
|
}));
|
|
1335
1335
|
}
|
|
1336
|
-
const
|
|
1336
|
+
const Da = (e, n) => {
|
|
1337
1337
|
const a = ka(e, !0, gn()), s = Ca(a);
|
|
1338
1338
|
if (!s.pending.length) {
|
|
1339
1339
|
let m = !0;
|
|
@@ -1359,7 +1359,7 @@ const Ra = (e, n) => {
|
|
|
1359
1359
|
r.length && Pa(m, r);
|
|
1360
1360
|
}), n ? Aa(n, s, l) : _i;
|
|
1361
1361
|
};
|
|
1362
|
-
function
|
|
1362
|
+
function Ra(e, n) {
|
|
1363
1363
|
const a = { ...e };
|
|
1364
1364
|
for (const s in n) {
|
|
1365
1365
|
const o = n[s], l = typeof o;
|
|
@@ -1466,7 +1466,7 @@ function Qi(e) {
|
|
|
1466
1466
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1467
1467
|
}
|
|
1468
1468
|
const qa = (e, n, a) => {
|
|
1469
|
-
const s = n.inline ? Ja : Nn, o =
|
|
1469
|
+
const s = n.inline ? Ja : Nn, o = Ra(s, n), l = n.mode || "svg", d = {}, u = n.style || {}, m = {
|
|
1470
1470
|
...l === "svg" ? Wa : {}
|
|
1471
1471
|
};
|
|
1472
1472
|
if (a) {
|
|
@@ -1635,7 +1635,7 @@ function Cn(e) {
|
|
|
1635
1635
|
data: p
|
|
1636
1636
|
}))
|
|
1637
1637
|
if (p === void 0) {
|
|
1638
|
-
const S =
|
|
1638
|
+
const S = Da([f], t);
|
|
1639
1639
|
o({
|
|
1640
1640
|
callback: S
|
|
1641
1641
|
});
|
|
@@ -1659,11 +1659,11 @@ un((e, n) => Cn({
|
|
|
1659
1659
|
...e,
|
|
1660
1660
|
_ref: n
|
|
1661
1661
|
}));
|
|
1662
|
-
function
|
|
1662
|
+
function J({
|
|
1663
1663
|
icon: e,
|
|
1664
1664
|
iconClass: n
|
|
1665
1665
|
}) {
|
|
1666
|
-
return /* @__PURE__ */ i(
|
|
1666
|
+
return /* @__PURE__ */ i(ge, { children: /* @__PURE__ */ i(kn, { icon: e, className: n }) });
|
|
1667
1667
|
}
|
|
1668
1668
|
function Ii(e, n, a) {
|
|
1669
1669
|
return n === void 0 && (n = {}), a === void 0 && (a = {}), function(s, o, l) {
|
|
@@ -1730,7 +1730,7 @@ const _a = ({
|
|
|
1730
1730
|
u.key
|
|
1731
1731
|
);
|
|
1732
1732
|
}) });
|
|
1733
|
-
},
|
|
1733
|
+
}, _ = ({
|
|
1734
1734
|
label: e,
|
|
1735
1735
|
name: n,
|
|
1736
1736
|
register: a,
|
|
@@ -1812,7 +1812,7 @@ const _a = ({
|
|
|
1812
1812
|
peer-disabled:cursor-not-allowed
|
|
1813
1813
|
`,
|
|
1814
1814
|
children: C && /* @__PURE__ */ i(
|
|
1815
|
-
|
|
1815
|
+
J,
|
|
1816
1816
|
{
|
|
1817
1817
|
icon: "bi:check-lg",
|
|
1818
1818
|
iconClass: "w-4 h-4 text-white"
|
|
@@ -1908,7 +1908,7 @@ const _a = ({
|
|
|
1908
1908
|
label: e,
|
|
1909
1909
|
value: n,
|
|
1910
1910
|
id: Ce()
|
|
1911
|
-
}),
|
|
1911
|
+
}), re = (e) => ({
|
|
1912
1912
|
...Ya,
|
|
1913
1913
|
...e
|
|
1914
1914
|
}), Za = oi == null ? void 0 : oi.map((e) => ({
|
|
@@ -1916,28 +1916,28 @@ const _a = ({
|
|
|
1916
1916
|
value: e.name,
|
|
1917
1917
|
id: e.code || e.name
|
|
1918
1918
|
})), Qa = [
|
|
1919
|
-
|
|
1919
|
+
re({
|
|
1920
1920
|
type: "basicText",
|
|
1921
1921
|
label: "Basic Text",
|
|
1922
1922
|
icon: "majesticons:text",
|
|
1923
1923
|
inputLabel: "",
|
|
1924
1924
|
inputType: "basicText"
|
|
1925
1925
|
}),
|
|
1926
|
-
|
|
1926
|
+
re({
|
|
1927
1927
|
type: "textField",
|
|
1928
1928
|
label: "Text Input",
|
|
1929
1929
|
icon: "fluent:text-16-filled",
|
|
1930
1930
|
inputLabel: "Text Label",
|
|
1931
1931
|
inputType: "text"
|
|
1932
1932
|
}),
|
|
1933
|
-
|
|
1933
|
+
re({
|
|
1934
1934
|
type: "longText",
|
|
1935
1935
|
label: "Long Text",
|
|
1936
1936
|
icon: "dashicons:text",
|
|
1937
1937
|
inputLabel: "Long Text Label",
|
|
1938
1938
|
inputType: "text"
|
|
1939
1939
|
}),
|
|
1940
|
-
|
|
1940
|
+
re({
|
|
1941
1941
|
type: "selectField",
|
|
1942
1942
|
label: "List",
|
|
1943
1943
|
icon: "tabler:select",
|
|
@@ -1955,7 +1955,7 @@ const _a = ({
|
|
|
1955
1955
|
// options: [option("Parent", "")],
|
|
1956
1956
|
// options2: [option("Child", "")],
|
|
1957
1957
|
// }),
|
|
1958
|
-
|
|
1958
|
+
re({
|
|
1959
1959
|
type: "multiSelect",
|
|
1960
1960
|
label: "Multi List",
|
|
1961
1961
|
icon: "fluent-mdl2:multi-select",
|
|
@@ -1965,7 +1965,7 @@ const _a = ({
|
|
|
1965
1965
|
requireAllChecked: !1,
|
|
1966
1966
|
options: [Ke("Placeholder 1", "placeholder_1")]
|
|
1967
1967
|
}),
|
|
1968
|
-
|
|
1968
|
+
re({
|
|
1969
1969
|
type: "dataLookup",
|
|
1970
1970
|
label: "Data Lookup",
|
|
1971
1971
|
icon: "iconoir:www",
|
|
@@ -1975,7 +1975,7 @@ const _a = ({
|
|
|
1975
1975
|
method: "GET",
|
|
1976
1976
|
responseType: "string"
|
|
1977
1977
|
}),
|
|
1978
|
-
|
|
1978
|
+
re({
|
|
1979
1979
|
type: "numberField",
|
|
1980
1980
|
label: "Number",
|
|
1981
1981
|
icon: "octicon:number-16",
|
|
@@ -1983,7 +1983,7 @@ const _a = ({
|
|
|
1983
1983
|
inputType: "number",
|
|
1984
1984
|
inputMode: "decimal"
|
|
1985
1985
|
}),
|
|
1986
|
-
|
|
1986
|
+
re({
|
|
1987
1987
|
type: "amountField",
|
|
1988
1988
|
label: "Amount",
|
|
1989
1989
|
icon: "carbon:currency",
|
|
@@ -1991,7 +1991,7 @@ const _a = ({
|
|
|
1991
1991
|
inputType: "amount",
|
|
1992
1992
|
prefix: null
|
|
1993
1993
|
}),
|
|
1994
|
-
|
|
1994
|
+
re({
|
|
1995
1995
|
type: "date",
|
|
1996
1996
|
label: "Date",
|
|
1997
1997
|
icon: "bx:calendar",
|
|
@@ -2004,7 +2004,7 @@ const _a = ({
|
|
|
2004
2004
|
canHaveDateRange: !1,
|
|
2005
2005
|
allowYearPicker: !1
|
|
2006
2006
|
}),
|
|
2007
|
-
|
|
2007
|
+
re({
|
|
2008
2008
|
type: "time",
|
|
2009
2009
|
label: "Time",
|
|
2010
2010
|
icon: "mdi:clock-outline",
|
|
@@ -2012,21 +2012,21 @@ const _a = ({
|
|
|
2012
2012
|
inputType: "time",
|
|
2013
2013
|
is24Hour: !1
|
|
2014
2014
|
}),
|
|
2015
|
-
|
|
2015
|
+
re({
|
|
2016
2016
|
type: "url",
|
|
2017
2017
|
label: "Link",
|
|
2018
2018
|
icon: "iconamoon:link",
|
|
2019
2019
|
inputLabel: "Url Link",
|
|
2020
2020
|
inputType: "url"
|
|
2021
2021
|
}),
|
|
2022
|
-
|
|
2022
|
+
re({
|
|
2023
2023
|
type: "password",
|
|
2024
2024
|
label: "Password",
|
|
2025
2025
|
icon: "ic:round-password",
|
|
2026
2026
|
inputLabel: "Password Label",
|
|
2027
2027
|
inputType: "password"
|
|
2028
2028
|
}),
|
|
2029
|
-
|
|
2029
|
+
re({
|
|
2030
2030
|
type: "checkbox",
|
|
2031
2031
|
label: "Checkbox",
|
|
2032
2032
|
icon: "mingcute:checkbox-line",
|
|
@@ -2036,7 +2036,7 @@ const _a = ({
|
|
|
2036
2036
|
requireAllChecked: !1,
|
|
2037
2037
|
options: [Ke("Checkbox Option", "option")]
|
|
2038
2038
|
}),
|
|
2039
|
-
|
|
2039
|
+
re({
|
|
2040
2040
|
type: "phoneField",
|
|
2041
2041
|
label: "Phone",
|
|
2042
2042
|
icon: "fluent-mdl2:add-phone",
|
|
@@ -2044,7 +2044,7 @@ const _a = ({
|
|
|
2044
2044
|
inputType: "tel",
|
|
2045
2045
|
pattern: "^\\+?[0-9]{7,15}$"
|
|
2046
2046
|
}),
|
|
2047
|
-
|
|
2047
|
+
re({
|
|
2048
2048
|
type: "radio",
|
|
2049
2049
|
label: "Radio",
|
|
2050
2050
|
icon: "ri:checkbox-circle-line",
|
|
@@ -2052,14 +2052,14 @@ const _a = ({
|
|
|
2052
2052
|
inputType: "radio",
|
|
2053
2053
|
options: [Ke("Radio Option", "")]
|
|
2054
2054
|
}),
|
|
2055
|
-
|
|
2055
|
+
re({
|
|
2056
2056
|
type: "email",
|
|
2057
2057
|
label: "Email",
|
|
2058
2058
|
icon: "mdi:email-outline",
|
|
2059
2059
|
inputLabel: "Email Label",
|
|
2060
2060
|
inputType: "email"
|
|
2061
2061
|
}),
|
|
2062
|
-
|
|
2062
|
+
re({
|
|
2063
2063
|
type: "file",
|
|
2064
2064
|
label: "File",
|
|
2065
2065
|
icon: "ion:attach-sharp",
|
|
@@ -2069,7 +2069,7 @@ const _a = ({
|
|
|
2069
2069
|
acceptedFiles: [],
|
|
2070
2070
|
maxFileSize: 5
|
|
2071
2071
|
}),
|
|
2072
|
-
|
|
2072
|
+
re({
|
|
2073
2073
|
type: "country",
|
|
2074
2074
|
label: "Country",
|
|
2075
2075
|
icon: "fluent:globe-16-regular",
|
|
@@ -2078,14 +2078,14 @@ const _a = ({
|
|
|
2078
2078
|
options: Za,
|
|
2079
2079
|
showState: !1
|
|
2080
2080
|
}),
|
|
2081
|
-
|
|
2081
|
+
re({
|
|
2082
2082
|
type: "rating",
|
|
2083
2083
|
label: "Ratings",
|
|
2084
2084
|
icon: "streamline-ultimate:rating-star-ribbon",
|
|
2085
2085
|
inputLabel: "Rating Label",
|
|
2086
2086
|
inputType: "rating"
|
|
2087
2087
|
}),
|
|
2088
|
-
|
|
2088
|
+
re({
|
|
2089
2089
|
type: "dataGrid",
|
|
2090
2090
|
label: "Table",
|
|
2091
2091
|
icon: "carbon:data-table",
|
|
@@ -2112,14 +2112,14 @@ const _a = ({
|
|
|
2112
2112
|
// inputType: "tableInput",
|
|
2113
2113
|
// value: [],
|
|
2114
2114
|
// }),
|
|
2115
|
-
|
|
2115
|
+
re({
|
|
2116
2116
|
type: "divider",
|
|
2117
2117
|
label: "Divider",
|
|
2118
2118
|
icon: "pixel:divider",
|
|
2119
2119
|
inputLabel: "",
|
|
2120
2120
|
inputType: "divider"
|
|
2121
2121
|
}),
|
|
2122
|
-
|
|
2122
|
+
re({
|
|
2123
2123
|
type: "spacer",
|
|
2124
2124
|
label: "Spacer",
|
|
2125
2125
|
icon: "fluent-mdl2:spacer",
|
|
@@ -2133,7 +2133,7 @@ const _a = ({
|
|
|
2133
2133
|
// inputLabel: "",
|
|
2134
2134
|
// inputType: "section",
|
|
2135
2135
|
// }),
|
|
2136
|
-
|
|
2136
|
+
re({
|
|
2137
2137
|
type: "grid",
|
|
2138
2138
|
label: "Grid",
|
|
2139
2139
|
icon: "cuida:grid-outline",
|
|
@@ -2141,7 +2141,7 @@ const _a = ({
|
|
|
2141
2141
|
inputType: "grid",
|
|
2142
2142
|
columns: 2
|
|
2143
2143
|
}),
|
|
2144
|
-
|
|
2144
|
+
re({
|
|
2145
2145
|
type: "matrix",
|
|
2146
2146
|
label: "Likert Scale",
|
|
2147
2147
|
icon: "pepicons-pop:list",
|
|
@@ -2156,7 +2156,7 @@ const _a = ({
|
|
|
2156
2156
|
{ id: "c5", label: "Strongly Agree", value: "strongly_agree" }
|
|
2157
2157
|
]
|
|
2158
2158
|
}),
|
|
2159
|
-
|
|
2159
|
+
re({
|
|
2160
2160
|
type: "calculatedField",
|
|
2161
2161
|
label: "Calculated Field",
|
|
2162
2162
|
icon: "material-symbols:functions",
|
|
@@ -2164,7 +2164,7 @@ const _a = ({
|
|
|
2164
2164
|
inputType: "calculatedField",
|
|
2165
2165
|
formula: ""
|
|
2166
2166
|
}),
|
|
2167
|
-
|
|
2167
|
+
re({
|
|
2168
2168
|
type: "polling",
|
|
2169
2169
|
label: "Polling",
|
|
2170
2170
|
icon: "mdi:poll",
|
|
@@ -2174,7 +2174,7 @@ const _a = ({
|
|
|
2174
2174
|
fetchExternalResults: !1,
|
|
2175
2175
|
externalApiUrl: ""
|
|
2176
2176
|
}),
|
|
2177
|
-
|
|
2177
|
+
re({
|
|
2178
2178
|
type: "nps",
|
|
2179
2179
|
label: "NPS Score (0-10)",
|
|
2180
2180
|
icon: "tabler:hash",
|
|
@@ -2183,7 +2183,7 @@ const _a = ({
|
|
|
2183
2183
|
minLabel: "Not at all likely",
|
|
2184
2184
|
maxLabel: "Extremely likely"
|
|
2185
2185
|
}),
|
|
2186
|
-
|
|
2186
|
+
re({
|
|
2187
2187
|
type: "ranking",
|
|
2188
2188
|
label: "Ranking Poll",
|
|
2189
2189
|
icon: "fluent:re-order-16-regular",
|
|
@@ -2191,7 +2191,7 @@ const _a = ({
|
|
|
2191
2191
|
inputType: "ranking",
|
|
2192
2192
|
options: [Ke("Option 1", "option_1"), Ke("Option 2", "option_2")]
|
|
2193
2193
|
}),
|
|
2194
|
-
|
|
2194
|
+
re({
|
|
2195
2195
|
type: "imageChoice",
|
|
2196
2196
|
label: "Image Choice",
|
|
2197
2197
|
icon: "ic:outline-image",
|
|
@@ -2388,7 +2388,7 @@ const _a = ({
|
|
|
2388
2388
|
}) => {
|
|
2389
2389
|
const [p, S] = G(
|
|
2390
2390
|
r ? [] : null
|
|
2391
|
-
), N =
|
|
2391
|
+
), N = fe(!1), g = ue(() => !u || !e || e.length === 0 ? r ? [] : null : r ? Array.isArray(u) ? e.filter(
|
|
2392
2392
|
(y) => u.some(
|
|
2393
2393
|
(A) => {
|
|
2394
2394
|
var k;
|
|
@@ -2398,7 +2398,7 @@ const _a = ({
|
|
|
2398
2398
|
) : [] : e.find((y) => {
|
|
2399
2399
|
var A;
|
|
2400
2400
|
return typeof y.value == "string" && typeof u == "string" ? y.value.toLowerCase() === u.toLowerCase() : typeof y.value == "object" && typeof u == "object" ? ((A = y.value) == null ? void 0 : A.id) === (u == null ? void 0 : u.id) : y.value === u;
|
|
2401
|
-
}) || null, [u, e, r]), v =
|
|
2401
|
+
}) || null, [u, e, r]), v = ue(() => u == null || u === "" || !e || e.length === 0 ? !1 : r ? !Array.isArray(u) || u.length === 0 ? !1 : (g == null ? void 0 : g.length) < u.length : g === null, [u, e, g, r]);
|
|
2402
2402
|
j(() => {
|
|
2403
2403
|
if (N.current) {
|
|
2404
2404
|
N.current = !1;
|
|
@@ -2411,7 +2411,7 @@ const _a = ({
|
|
|
2411
2411
|
JSON.stringify(y) !== JSON.stringify(A) && S(g);
|
|
2412
2412
|
} else (g == null ? void 0 : g.value) !== (p == null ? void 0 : p.value) && S(g);
|
|
2413
2413
|
}, [g, r]);
|
|
2414
|
-
const w =
|
|
2414
|
+
const w = ae(
|
|
2415
2415
|
(y) => {
|
|
2416
2416
|
var A;
|
|
2417
2417
|
if (N.current = !0, S(y), o) {
|
|
@@ -2421,7 +2421,7 @@ const _a = ({
|
|
|
2421
2421
|
s && !N.current && s(l);
|
|
2422
2422
|
},
|
|
2423
2423
|
[o, l, m, s, r]
|
|
2424
|
-
), M =
|
|
2424
|
+
), M = ue(() => x ? "Fetching data..." : p ? r && Array.isArray(p) ? p.length > 0 ? p == null ? void 0 : p.map((y) => y.label).join(", ") : n : (p == null ? void 0 : p.label) || n : n, [p, x, n, r]);
|
|
2425
2425
|
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2426
2426
|
!t && d && /* @__PURE__ */ i("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
|
|
2427
2427
|
t && d && /* @__PURE__ */ i(
|
|
@@ -2435,7 +2435,7 @@ const _a = ({
|
|
|
2435
2435
|
}
|
|
2436
2436
|
),
|
|
2437
2437
|
/* @__PURE__ */ i(
|
|
2438
|
-
|
|
2438
|
+
be,
|
|
2439
2439
|
{
|
|
2440
2440
|
value: p,
|
|
2441
2441
|
onChange: w,
|
|
@@ -2443,7 +2443,7 @@ const _a = ({
|
|
|
2443
2443
|
disabled: f || x,
|
|
2444
2444
|
children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2445
2445
|
/* @__PURE__ */ c(
|
|
2446
|
-
|
|
2446
|
+
be.Button,
|
|
2447
2447
|
{
|
|
2448
2448
|
className: "field-control",
|
|
2449
2449
|
disabled: f || x,
|
|
@@ -2457,7 +2457,7 @@ const _a = ({
|
|
|
2457
2457
|
children: M
|
|
2458
2458
|
}
|
|
2459
2459
|
),
|
|
2460
|
-
/* @__PURE__ */ i("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ i(
|
|
2460
|
+
/* @__PURE__ */ i("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
|
|
2461
2461
|
]
|
|
2462
2462
|
}
|
|
2463
2463
|
),
|
|
@@ -2468,7 +2468,7 @@ const _a = ({
|
|
|
2468
2468
|
leaveFrom: "opacity-100",
|
|
2469
2469
|
leaveTo: "opacity-0",
|
|
2470
2470
|
children: /* @__PURE__ */ i(
|
|
2471
|
-
|
|
2471
|
+
be.Options,
|
|
2472
2472
|
{
|
|
2473
2473
|
anchor: "bottom start",
|
|
2474
2474
|
className: "select-button-options",
|
|
@@ -2476,7 +2476,7 @@ const _a = ({
|
|
|
2476
2476
|
children: e.length === 0 ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No options available" }) : e == null ? void 0 : e.map((y, A) => {
|
|
2477
2477
|
var k;
|
|
2478
2478
|
return /* @__PURE__ */ i(
|
|
2479
|
-
|
|
2479
|
+
be.Option,
|
|
2480
2480
|
{
|
|
2481
2481
|
value: y,
|
|
2482
2482
|
className: ({ active: C }) => $("select-option", { active: C }),
|
|
@@ -2600,7 +2600,7 @@ const bo = () => /* @__PURE__ */ i("blockquote", { className: "bg-gray-100 p-4 r
|
|
|
2600
2600
|
"}"
|
|
2601
2601
|
] }) })
|
|
2602
2602
|
] })
|
|
2603
|
-
] }) }),
|
|
2603
|
+
] }) }), ye = (e) => {
|
|
2604
2604
|
const n = typeof window != "undefined" ? localStorage.getItem(e) : "";
|
|
2605
2605
|
try {
|
|
2606
2606
|
return JSON.parse(n);
|
|
@@ -2643,7 +2643,7 @@ const bo = () => /* @__PURE__ */ i("blockquote", { className: "bg-gray-100 p-4 r
|
|
|
2643
2643
|
label: a,
|
|
2644
2644
|
type: s
|
|
2645
2645
|
}) => {
|
|
2646
|
-
const [o, l] = G(""), d =
|
|
2646
|
+
const [o, l] = G(""), d = ye("config");
|
|
2647
2647
|
return /* @__PURE__ */ c("div", { children: [
|
|
2648
2648
|
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2649
2649
|
/* @__PURE__ */ i(
|
|
@@ -2751,7 +2751,7 @@ const bo = () => /* @__PURE__ */ i("blockquote", { className: "bg-gray-100 p-4 r
|
|
|
2751
2751
|
] })
|
|
2752
2752
|
] }) });
|
|
2753
2753
|
function fo({ type: e = "calendar", className: n }) {
|
|
2754
|
-
return /* @__PURE__ */ i(
|
|
2754
|
+
return /* @__PURE__ */ i(ge, { children: e === "calendar" ? /* @__PURE__ */ c(
|
|
2755
2755
|
"svg",
|
|
2756
2756
|
{
|
|
2757
2757
|
width: "20",
|
|
@@ -2995,21 +2995,21 @@ function Oi({
|
|
|
2995
2995
|
var E, B;
|
|
2996
2996
|
f(!0);
|
|
2997
2997
|
try {
|
|
2998
|
-
const
|
|
2999
|
-
...
|
|
2998
|
+
const D = ye("token"), Z = {
|
|
2999
|
+
...D ? { headers: { Authorization: `Bearer ${D}` } } : {},
|
|
3000
3000
|
signal: A.signal,
|
|
3001
3001
|
params: r ? { search: r } : {}
|
|
3002
3002
|
};
|
|
3003
|
-
let
|
|
3004
|
-
if (
|
|
3005
|
-
const
|
|
3003
|
+
let H = (await Fe.get(p, Z)).data;
|
|
3004
|
+
if (H && !Array.isArray(H) && (H.data && Array.isArray(H.data) ? H = H.data : (E = H.data) != null && E.data && Array.isArray(H.data.data) ? H = H.data.data : H.results && Array.isArray(H.results) ? H = H.results : (B = H.data) != null && B.results && Array.isArray(H.data.results) ? H = H.data.results : H.items && Array.isArray(H.items) && (H = H.items)), Array.isArray(H)) {
|
|
3005
|
+
const ie = H.map((U) => typeof U == "string" ? { label: U, value: U } : {
|
|
3006
3006
|
label: U.label || U.name || String(U.id || U.value),
|
|
3007
3007
|
value: String(U.value || U.id || U.name)
|
|
3008
3008
|
});
|
|
3009
|
-
h(
|
|
3009
|
+
h(ie);
|
|
3010
3010
|
}
|
|
3011
|
-
} catch (
|
|
3012
|
-
Fe.isCancel(
|
|
3011
|
+
} catch (D) {
|
|
3012
|
+
Fe.isCancel(D) || console.error("Failed to fetch options", D);
|
|
3013
3013
|
} finally {
|
|
3014
3014
|
A.signal.aborted || f(!1);
|
|
3015
3015
|
}
|
|
@@ -3036,7 +3036,7 @@ function Oi({
|
|
|
3036
3036
|
return (k = A.unsubscribe) == null ? void 0 : k.call(A);
|
|
3037
3037
|
};
|
|
3038
3038
|
}, [d, e.id, S]);
|
|
3039
|
-
const w =
|
|
3039
|
+
const w = ue(() => {
|
|
3040
3040
|
if (r === "") return S;
|
|
3041
3041
|
const A = r.toLowerCase();
|
|
3042
3042
|
return S.filter(
|
|
@@ -3071,7 +3071,7 @@ function Oi({
|
|
|
3071
3071
|
type: "button",
|
|
3072
3072
|
onClick: (C) => M(A, C),
|
|
3073
3073
|
className: "custom-select__chip-remove",
|
|
3074
|
-
children: /* @__PURE__ */ i(
|
|
3074
|
+
children: /* @__PURE__ */ i(J, { icon: "mdi:close", iconClass: "w-3 h-3" })
|
|
3075
3075
|
}
|
|
3076
3076
|
)
|
|
3077
3077
|
] }, k)),
|
|
@@ -3089,7 +3089,7 @@ function Oi({
|
|
|
3089
3089
|
]
|
|
3090
3090
|
}
|
|
3091
3091
|
) }),
|
|
3092
|
-
!l && /* @__PURE__ */ i(Le.Button, { className: "select-icon", children: x ? /* @__PURE__ */ i("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) : /* @__PURE__ */ i(
|
|
3092
|
+
!l && /* @__PURE__ */ i(Le.Button, { className: "select-icon", children: x ? /* @__PURE__ */ i("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) : /* @__PURE__ */ i(J, { icon: "lucide:chevron-down", iconClass: "text-gray-400" }) }),
|
|
3093
3093
|
/* @__PURE__ */ i(
|
|
3094
3094
|
je,
|
|
3095
3095
|
{
|
|
@@ -3117,7 +3117,7 @@ function Oi({
|
|
|
3117
3117
|
children: A.label
|
|
3118
3118
|
}
|
|
3119
3119
|
),
|
|
3120
|
-
C ? /* @__PURE__ */ i("span", { className: "text-blue-600", children: /* @__PURE__ */ i(
|
|
3120
|
+
C ? /* @__PURE__ */ i("span", { className: "text-blue-600", children: /* @__PURE__ */ i(J, { icon: "mdi:check", iconClass: "w-5 h-5" }) }) : null
|
|
3121
3121
|
] })
|
|
3122
3122
|
},
|
|
3123
3123
|
k
|
|
@@ -3138,7 +3138,7 @@ function xo({
|
|
|
3138
3138
|
watch: s,
|
|
3139
3139
|
id: o
|
|
3140
3140
|
}) {
|
|
3141
|
-
const { formData: l } = Pe(we), d = s("visibilityDependentFields") || [], u =
|
|
3141
|
+
const { formData: l } = Pe(we), d = s("visibilityDependentFields") || [], u = ue(() => {
|
|
3142
3142
|
var r;
|
|
3143
3143
|
return (r = en(l).filter((t) => t.id !== o)) == null ? void 0 : r.map((t) => {
|
|
3144
3144
|
const b = d.find(
|
|
@@ -3211,14 +3211,14 @@ function xo({
|
|
|
3211
3211
|
}
|
|
3212
3212
|
) }),
|
|
3213
3213
|
/* @__PURE__ */ i("div", { className: "w-[110px]", children: /* @__PURE__ */ i("div", { className: "relative", children: /* @__PURE__ */ c(
|
|
3214
|
-
|
|
3214
|
+
be,
|
|
3215
3215
|
{
|
|
3216
3216
|
value: r.fieldType,
|
|
3217
3217
|
onChange: (g) => m(t, "fieldType", g),
|
|
3218
3218
|
children: [
|
|
3219
|
-
/* @__PURE__ */ c(
|
|
3219
|
+
/* @__PURE__ */ c(be.Button, { className: "w-full flex items-center justify-between px-3 py-2 bg-white border border-slate-200/80 rounded-lg text-sm text-slate-700 font-medium hover:bg-slate-50 hover:border-slate-300 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-500/20 focus:border-gray-500 shadow-sm", children: [
|
|
3220
3220
|
/* @__PURE__ */ i("span", { className: "block truncate capitalize", children: r.fieldType }),
|
|
3221
|
-
/* @__PURE__ */ i(
|
|
3221
|
+
/* @__PURE__ */ i(J, { icon: "lucide:chevron-down", iconClass: "w-4 h-4 text-slate-400" })
|
|
3222
3222
|
] }),
|
|
3223
3223
|
/* @__PURE__ */ i(
|
|
3224
3224
|
je,
|
|
@@ -3228,12 +3228,12 @@ function xo({
|
|
|
3228
3228
|
leaveFrom: "opacity-100",
|
|
3229
3229
|
leaveTo: "opacity-0",
|
|
3230
3230
|
children: /* @__PURE__ */ i(
|
|
3231
|
-
|
|
3231
|
+
be.Options,
|
|
3232
3232
|
{
|
|
3233
3233
|
className: "absolute z-[9999] w-[var(--button-width)] min-w-[120px] mt-2 bg-white/95 backdrop-blur-xl border border-slate-200/80 rounded-lg shadow-lg max-h-60 overflow-auto focus:outline-none py-1",
|
|
3234
3234
|
anchor: "bottom start",
|
|
3235
3235
|
children: hi == null ? void 0 : hi.map((g) => /* @__PURE__ */ i(
|
|
3236
|
-
|
|
3236
|
+
be.Option,
|
|
3237
3237
|
{
|
|
3238
3238
|
value: g,
|
|
3239
3239
|
className: ({ active: v }) => `px-4 py-2 text-sm cursor-pointer capitalize transition-colors ${v ? "bg-gray-50/80 text-gray-700 font-medium" : "text-slate-700 hover:bg-slate-50"}`,
|
|
@@ -3249,14 +3249,14 @@ function xo({
|
|
|
3249
3249
|
}
|
|
3250
3250
|
) }) }),
|
|
3251
3251
|
/* @__PURE__ */ i("div", { className: "w-[140px]", children: /* @__PURE__ */ i("div", { className: "relative", children: /* @__PURE__ */ c(
|
|
3252
|
-
|
|
3252
|
+
be,
|
|
3253
3253
|
{
|
|
3254
3254
|
value: r.operator,
|
|
3255
3255
|
onChange: (g) => m(t, "operator", g),
|
|
3256
3256
|
children: [
|
|
3257
|
-
/* @__PURE__ */ c(
|
|
3257
|
+
/* @__PURE__ */ c(be.Button, { className: "w-full flex items-center justify-between px-3 py-2 bg-white border border-slate-200/80 rounded-lg text-sm text-slate-700 font-medium hover:bg-slate-50 hover:border-slate-300 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-500/20 focus:border-gray-500 shadow-sm", children: [
|
|
3258
3258
|
/* @__PURE__ */ i("span", { className: "block truncate capitalize", children: r.operator.replace("_", " ") }),
|
|
3259
|
-
/* @__PURE__ */ i(
|
|
3259
|
+
/* @__PURE__ */ i(J, { icon: "lucide:chevron-down", iconClass: "w-4 h-4 text-slate-400" })
|
|
3260
3260
|
] }),
|
|
3261
3261
|
/* @__PURE__ */ i(
|
|
3262
3262
|
je,
|
|
@@ -3266,12 +3266,12 @@ function xo({
|
|
|
3266
3266
|
leaveFrom: "opacity-100",
|
|
3267
3267
|
leaveTo: "opacity-0",
|
|
3268
3268
|
children: /* @__PURE__ */ i(
|
|
3269
|
-
|
|
3269
|
+
be.Options,
|
|
3270
3270
|
{
|
|
3271
3271
|
className: "absolute z-[9999] w-[var(--button-width)] min-w-[150px] mt-2 bg-white/95 backdrop-blur-xl border border-slate-200/80 rounded-lg shadow-lg max-h-60 overflow-auto focus:outline-none py-1",
|
|
3272
3272
|
anchor: "bottom start",
|
|
3273
3273
|
children: (f = r.fieldType === "number" ? [...nn, ...yo] : nn) == null ? void 0 : f.map((g) => /* @__PURE__ */ i(
|
|
3274
|
-
|
|
3274
|
+
be.Option,
|
|
3275
3275
|
{
|
|
3276
3276
|
value: g,
|
|
3277
3277
|
className: ({ active: v }) => `px-4 py-2 text-sm cursor-pointer capitalize transition-colors ${v ? "bg-gray-50/80 text-gray-700 font-medium" : "text-slate-700 hover:bg-slate-50"}`,
|
|
@@ -3287,14 +3287,14 @@ function xo({
|
|
|
3287
3287
|
}
|
|
3288
3288
|
) }) }),
|
|
3289
3289
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-[140px]", children: h && x.length > 0 ? /* @__PURE__ */ i("div", { className: "relative", children: /* @__PURE__ */ c(
|
|
3290
|
-
|
|
3290
|
+
be,
|
|
3291
3291
|
{
|
|
3292
3292
|
value: (p = r.fieldValue) != null ? p : "",
|
|
3293
3293
|
onChange: (g) => m(t, "fieldValue", g),
|
|
3294
3294
|
children: [
|
|
3295
|
-
/* @__PURE__ */ c(
|
|
3295
|
+
/* @__PURE__ */ c(be.Button, { className: "w-full flex items-center justify-between px-3 py-2 bg-white border border-slate-200/80 rounded-lg text-sm text-slate-700 font-medium hover:bg-slate-50 hover:border-slate-300 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-500/20 focus:border-gray-500 shadow-sm", children: [
|
|
3296
3296
|
/* @__PURE__ */ i("span", { className: "block truncate pr-2", children: ((S = x.find((g) => g.value === r.fieldValue)) == null ? void 0 : S.label) || "Select value" }),
|
|
3297
|
-
/* @__PURE__ */ i(
|
|
3297
|
+
/* @__PURE__ */ i(J, { icon: "lucide:chevron-down", iconClass: "w-4 h-4 flex-shrink-0 text-slate-400" })
|
|
3298
3298
|
] }),
|
|
3299
3299
|
/* @__PURE__ */ i(
|
|
3300
3300
|
je,
|
|
@@ -3304,12 +3304,12 @@ function xo({
|
|
|
3304
3304
|
leaveFrom: "opacity-100",
|
|
3305
3305
|
leaveTo: "opacity-0",
|
|
3306
3306
|
children: /* @__PURE__ */ i(
|
|
3307
|
-
|
|
3307
|
+
be.Options,
|
|
3308
3308
|
{
|
|
3309
3309
|
className: "absolute z-[9999] w-[var(--button-width)] min-w-[160px] mt-2 bg-white/95 backdrop-blur-xl border border-slate-200/80 rounded-lg max-h-60 overflow-auto focus:outline-none py-1",
|
|
3310
3310
|
anchor: "bottom start",
|
|
3311
3311
|
children: x.map((g, v) => /* @__PURE__ */ i(
|
|
3312
|
-
|
|
3312
|
+
be.Option,
|
|
3313
3313
|
{
|
|
3314
3314
|
value: g.value,
|
|
3315
3315
|
className: ({ active: w }) => `px-4 py-2 text-sm cursor-pointer transition-colors ${w ? "bg-gray-50/80 text-gray-700 font-medium" : "text-slate-700 hover:bg-slate-50"}`,
|
|
@@ -3333,14 +3333,14 @@ function xo({
|
|
|
3333
3333
|
className: "w-full px-3 py-2 bg-white border border-slate-200/80 rounded-lg text-sm text-slate-700 font-medium focus:outline-none focus:ring-2 focus:ring-gray-500/20 focus:border-gray-500 transition-colors shadow-sm placeholder-slate-400"
|
|
3334
3334
|
}
|
|
3335
3335
|
) : /* @__PURE__ */ i("div", { className: "relative", children: /* @__PURE__ */ c(
|
|
3336
|
-
|
|
3336
|
+
be,
|
|
3337
3337
|
{
|
|
3338
3338
|
value: (N = r.fieldValue) != null ? N : "",
|
|
3339
3339
|
onChange: (g) => m(t, "fieldValue", g),
|
|
3340
3340
|
children: [
|
|
3341
|
-
/* @__PURE__ */ c(
|
|
3341
|
+
/* @__PURE__ */ c(be.Button, { className: "w-full flex items-center justify-between px-3 py-2 bg-white border border-slate-200/80 rounded-lg text-sm text-slate-700 font-medium hover:bg-slate-50 hover:border-slate-300 transition-colors focus:outline-none focus:ring-2 focus:ring-gray-500/20 focus:border-gray-500 shadow-sm", children: [
|
|
3342
3342
|
/* @__PURE__ */ i("span", { className: "block truncate", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
|
|
3343
|
-
/* @__PURE__ */ i(
|
|
3343
|
+
/* @__PURE__ */ i(J, { icon: "lucide:chevron-down", iconClass: "w-4 h-4 text-slate-400" })
|
|
3344
3344
|
] }),
|
|
3345
3345
|
/* @__PURE__ */ i(
|
|
3346
3346
|
je,
|
|
@@ -3350,13 +3350,13 @@ function xo({
|
|
|
3350
3350
|
leaveFrom: "opacity-100",
|
|
3351
3351
|
leaveTo: "opacity-0",
|
|
3352
3352
|
children: /* @__PURE__ */ c(
|
|
3353
|
-
|
|
3353
|
+
be.Options,
|
|
3354
3354
|
{
|
|
3355
3355
|
className: "absolute z-[9999] w-[var(--button-width)] min-w-[150px] mt-2 bg-white/95 backdrop-blur-xl border border-slate-200/80 rounded-lg shadow-lg max-h-60 overflow-auto focus:outline-none py-1",
|
|
3356
3356
|
anchor: "bottom start",
|
|
3357
3357
|
children: [
|
|
3358
|
-
/* @__PURE__ */ i(
|
|
3359
|
-
/* @__PURE__ */ i(
|
|
3358
|
+
/* @__PURE__ */ i(be.Option, { value: !0, className: ({ active: g }) => `px-4 py-2 text-sm cursor-pointer transition-colors ${g ? "bg-gray-50/80 text-gray-700 font-medium" : "text-slate-700 hover:bg-slate-50"}`, children: "True" }),
|
|
3359
|
+
/* @__PURE__ */ i(be.Option, { value: !1, className: ({ active: g }) => `px-4 py-2 text-sm cursor-pointer transition-colors ${g ? "bg-gray-50/80 text-gray-700 font-medium" : "text-slate-700 hover:bg-slate-50"}`, children: "False" })
|
|
3360
3360
|
]
|
|
3361
3361
|
}
|
|
3362
3362
|
)
|
|
@@ -3394,12 +3394,12 @@ function No({
|
|
|
3394
3394
|
fields: a,
|
|
3395
3395
|
placeholder: s
|
|
3396
3396
|
}) {
|
|
3397
|
-
const [o, l] = G(() => an(e)), [d, u] = G(null), [m, r] = G(!1), [t, b] = G(""), [h, x] = G(null), f =
|
|
3397
|
+
const [o, l] = G(() => an(e)), [d, u] = G(null), [m, r] = G(!1), [t, b] = G(""), [h, x] = G(null), f = fe(null), p = fe(null), S = fe(/* @__PURE__ */ new Map());
|
|
3398
3398
|
j(() => {
|
|
3399
3399
|
const C = an(e);
|
|
3400
3400
|
l(C);
|
|
3401
3401
|
}, []);
|
|
3402
|
-
const N =
|
|
3402
|
+
const N = ae(
|
|
3403
3403
|
(C) => {
|
|
3404
3404
|
n(So(C));
|
|
3405
3405
|
},
|
|
@@ -3408,17 +3408,17 @@ function No({
|
|
|
3408
3408
|
const B = [...o];
|
|
3409
3409
|
B[C] = { type: "operator", value: E }, l(B), N(B);
|
|
3410
3410
|
}, v = (C) => {
|
|
3411
|
-
const E = o.filter((B,
|
|
3411
|
+
const E = o.filter((B, D) => D !== C);
|
|
3412
3412
|
l(E), N(E);
|
|
3413
3413
|
}, w = (C) => {
|
|
3414
3414
|
x(C), b(""), r(!0);
|
|
3415
3415
|
}, M = (C, E) => {
|
|
3416
|
-
const B = E !== void 0 ? E : h != null ? h : o.length,
|
|
3416
|
+
const B = E !== void 0 ? E : h != null ? h : o.length, D = [...o], Z = D.slice(0, B), Q = D.slice(B), H = [
|
|
3417
3417
|
...Z,
|
|
3418
3418
|
{ type: "field", id: C.id, display: C.display },
|
|
3419
3419
|
...Q
|
|
3420
|
-
],
|
|
3421
|
-
l(
|
|
3420
|
+
], ie = y(H);
|
|
3421
|
+
l(ie), N(ie), r(!1), x(null);
|
|
3422
3422
|
};
|
|
3423
3423
|
function y(C) {
|
|
3424
3424
|
const E = [];
|
|
@@ -3511,7 +3511,7 @@ function No({
|
|
|
3511
3511
|
/* @__PURE__ */ i("span", { className: "font-sans font-semibold text-blue-500 uppercase tracking-wide mr-1", children: "Preview:" }),
|
|
3512
3512
|
o.map((C) => C.type === "field" ? `[${C.display}]` : C.value).join("")
|
|
3513
3513
|
] }),
|
|
3514
|
-
m && /* @__PURE__ */ c(
|
|
3514
|
+
m && /* @__PURE__ */ c(ge, { children: [
|
|
3515
3515
|
/* @__PURE__ */ i(
|
|
3516
3516
|
"div",
|
|
3517
3517
|
{
|
|
@@ -3643,8 +3643,8 @@ function Tn({
|
|
|
3643
3643
|
className: "!flex items-center rounded cursor-pointer gap-x-3",
|
|
3644
3644
|
title: `Click to preview ${b}`,
|
|
3645
3645
|
children: [
|
|
3646
|
-
l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(
|
|
3647
|
-
l !== "image" && /* @__PURE__ */ i(
|
|
3646
|
+
l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(J, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
|
|
3647
|
+
l !== "image" && /* @__PURE__ */ i(J, { icon: ko[l], iconClass: "text-4xl" }),
|
|
3648
3648
|
/* @__PURE__ */ i("span", { className: "text-sm font-semibold text-center text-gray-700 truncate max-w-[300px]", children: b })
|
|
3649
3649
|
]
|
|
3650
3650
|
}
|
|
@@ -3657,7 +3657,7 @@ function Tn({
|
|
|
3657
3657
|
className: "p-2",
|
|
3658
3658
|
onClick: () => h(u || e, n),
|
|
3659
3659
|
title: `Download ${b}`,
|
|
3660
|
-
children: /* @__PURE__ */ i(
|
|
3660
|
+
children: /* @__PURE__ */ i(J, { icon: "streamline-flex:download-tray-solid" })
|
|
3661
3661
|
}
|
|
3662
3662
|
),
|
|
3663
3663
|
a && /* @__PURE__ */ i(
|
|
@@ -3666,7 +3666,7 @@ function Tn({
|
|
|
3666
3666
|
type: "button",
|
|
3667
3667
|
className: "p-2 text-lg text-red-500",
|
|
3668
3668
|
onClick: a,
|
|
3669
|
-
children: /* @__PURE__ */ i(
|
|
3669
|
+
children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone" })
|
|
3670
3670
|
}
|
|
3671
3671
|
)
|
|
3672
3672
|
] }),
|
|
@@ -3722,20 +3722,20 @@ function Bn({
|
|
|
3722
3722
|
accept: l = [],
|
|
3723
3723
|
maxFileSize: d = 5
|
|
3724
3724
|
}) {
|
|
3725
|
-
const { uploadUrl: u, setApiActivityCount: m } = Pe(we), r =
|
|
3725
|
+
const { uploadUrl: u, setApiActivityCount: m } = Pe(we), r = fe(null), [t, b] = G(o), [h, x] = G(!1);
|
|
3726
3726
|
j(() => {
|
|
3727
3727
|
b(o);
|
|
3728
3728
|
}, [o]);
|
|
3729
|
-
const f =
|
|
3729
|
+
const f = ue(
|
|
3730
3730
|
() => l == null ? void 0 : l.map((y) => y.value).join(", "),
|
|
3731
3731
|
[l]
|
|
3732
|
-
), p =
|
|
3732
|
+
), p = ue(
|
|
3733
3733
|
() => l == null ? void 0 : l.map((y) => y.label).join(", "),
|
|
3734
3734
|
[l]
|
|
3735
|
-
), S =
|
|
3735
|
+
), S = ae(
|
|
3736
3736
|
async (y) => {
|
|
3737
3737
|
var C, E;
|
|
3738
|
-
const A =
|
|
3738
|
+
const A = ye("token"), k = ((C = ye("orgData")) == null ? void 0 : C.id) || ye("organizationId");
|
|
3739
3739
|
try {
|
|
3740
3740
|
const { data: B } = await Fe.post(
|
|
3741
3741
|
u,
|
|
@@ -3757,7 +3757,7 @@ function Bn({
|
|
|
3757
3757
|
}
|
|
3758
3758
|
},
|
|
3759
3759
|
[u]
|
|
3760
|
-
), N =
|
|
3760
|
+
), N = ae(
|
|
3761
3761
|
(y) => new Promise((A, k) => {
|
|
3762
3762
|
const C = new FileReader();
|
|
3763
3763
|
C.onloadend = async () => {
|
|
@@ -3781,7 +3781,7 @@ function Bn({
|
|
|
3781
3781
|
}, C.onerror = () => k(new Error("File read failed")), C.readAsDataURL(y);
|
|
3782
3782
|
}),
|
|
3783
3783
|
[u, S]
|
|
3784
|
-
), g =
|
|
3784
|
+
), g = ae(
|
|
3785
3785
|
(y) => {
|
|
3786
3786
|
var C;
|
|
3787
3787
|
const A = f ? (C = f.split(",")) == null ? void 0 : C.map((E) => E.trim()) : [], k = d * 1024 * 1024;
|
|
@@ -3792,8 +3792,8 @@ function Bn({
|
|
|
3792
3792
|
), !1;
|
|
3793
3793
|
if (A.length && !A.some((B) => {
|
|
3794
3794
|
if (B.endsWith("/*")) {
|
|
3795
|
-
const
|
|
3796
|
-
return E.type.startsWith(`${
|
|
3795
|
+
const D = B.split("/")[0];
|
|
3796
|
+
return E.type.startsWith(`${D}/`);
|
|
3797
3797
|
}
|
|
3798
3798
|
return E.type === B || E.name.toLowerCase().endsWith(B.replace("*", ""));
|
|
3799
3799
|
}))
|
|
@@ -3804,7 +3804,7 @@ function Bn({
|
|
|
3804
3804
|
return !0;
|
|
3805
3805
|
},
|
|
3806
3806
|
[f, p, d]
|
|
3807
|
-
), v =
|
|
3807
|
+
), v = ae(
|
|
3808
3808
|
async (y) => {
|
|
3809
3809
|
const A = Array.from(y.target.files || []);
|
|
3810
3810
|
if (!(!A.length || h)) {
|
|
@@ -3832,7 +3832,7 @@ function Bn({
|
|
|
3832
3832
|
t,
|
|
3833
3833
|
m
|
|
3834
3834
|
]
|
|
3835
|
-
), w =
|
|
3835
|
+
), w = ae(
|
|
3836
3836
|
(y) => {
|
|
3837
3837
|
h || (r.current && (r.current.value = ""), b((A) => {
|
|
3838
3838
|
const k = y === void 0 ? null : (A == null ? void 0 : A.filter((C, E) => E !== y)) || null;
|
|
@@ -3867,7 +3867,7 @@ function Bn({
|
|
|
3867
3867
|
onClick: () => w(),
|
|
3868
3868
|
disabled: h,
|
|
3869
3869
|
"aria-label": "Remove all files",
|
|
3870
|
-
children: /* @__PURE__ */ i(
|
|
3870
|
+
children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone" })
|
|
3871
3871
|
}
|
|
3872
3872
|
)
|
|
3873
3873
|
] }),
|
|
@@ -3990,12 +3990,12 @@ const wo = O.object().shape({
|
|
|
3990
3990
|
onClose: n,
|
|
3991
3991
|
element: a
|
|
3992
3992
|
}) => {
|
|
3993
|
-
var Te,
|
|
3993
|
+
var Te, De, Re, Ie;
|
|
3994
3994
|
const s = Mo.filter(
|
|
3995
|
-
(
|
|
3996
|
-
), { updateElement: o, formData: l } =
|
|
3997
|
-
var
|
|
3998
|
-
return ((
|
|
3995
|
+
(q) => !ii.includes(a.inputType) || q.key !== "validation"
|
|
3996
|
+
), { updateElement: o, formData: l } = me.useContext(we), [d, u] = G("basic"), [m, r] = G(!1), [t, b] = G("manual"), h = ((Re = (De = (Te = l == null ? void 0 : l.filter((q) => !(q != null && q.isDeleted))) == null ? void 0 : Te.flatMap((q) => (q == null ? void 0 : q.questionData) || [])) == null ? void 0 : De.filter((q) => !(q != null && q.isDeleted))) == null ? void 0 : Re.length) || 0, x = me.useMemo(() => {
|
|
3997
|
+
var q;
|
|
3998
|
+
return ((q = l == null ? void 0 : l.filter((T) => !(T != null && T.isDeleted))) == null ? void 0 : q.flatMap((T) => (T == null ? void 0 : T.questionData) || []).filter(
|
|
3999
3999
|
(T) => {
|
|
4000
4000
|
var K;
|
|
4001
4001
|
return !(T != null && T.isDeleted) && T.id !== (a == null ? void 0 : a.id) && !["spacer", "divider", "section", "grid"].includes(
|
|
@@ -4006,7 +4006,7 @@ const wo = O.object().shape({
|
|
|
4006
4006
|
id: T.id,
|
|
4007
4007
|
display: T.inputLabel || T.label || "Unnamed"
|
|
4008
4008
|
}))) || [];
|
|
4009
|
-
}, [h, a == null ? void 0 : a.id]), f =
|
|
4009
|
+
}, [h, a == null ? void 0 : a.id]), f = ye("config"), {
|
|
4010
4010
|
register: p,
|
|
4011
4011
|
handleSubmit: S,
|
|
4012
4012
|
control: N,
|
|
@@ -4021,18 +4021,18 @@ const wo = O.object().shape({
|
|
|
4021
4021
|
...a,
|
|
4022
4022
|
options: a.options || []
|
|
4023
4023
|
}
|
|
4024
|
-
}), C = v(), { fields: E, append: B, remove:
|
|
4024
|
+
}), C = v(), { fields: E, append: B, remove: D } = ci({
|
|
4025
4025
|
control: N,
|
|
4026
4026
|
name: "options"
|
|
4027
4027
|
}), {
|
|
4028
4028
|
fields: Z,
|
|
4029
4029
|
append: Q,
|
|
4030
|
-
remove:
|
|
4030
|
+
remove: H
|
|
4031
4031
|
} = ci({
|
|
4032
4032
|
control: N,
|
|
4033
4033
|
name: "options1"
|
|
4034
4034
|
}), {
|
|
4035
|
-
fields:
|
|
4035
|
+
fields: ie,
|
|
4036
4036
|
append: U,
|
|
4037
4037
|
remove: X
|
|
4038
4038
|
} = ci({
|
|
@@ -4042,49 +4042,49 @@ const wo = O.object().shape({
|
|
|
4042
4042
|
j(() => {
|
|
4043
4043
|
e || k();
|
|
4044
4044
|
}, [e, k]);
|
|
4045
|
-
const Y = (
|
|
4046
|
-
o(
|
|
4047
|
-
}, ke =
|
|
4045
|
+
const Y = (q) => {
|
|
4046
|
+
o(q, a.sectionId), n();
|
|
4047
|
+
}, ke = fe(null), pe = ae(async () => {
|
|
4048
4048
|
var T;
|
|
4049
4049
|
if (!C.apiUrl || !/^https?:\/\//.test(C.apiUrl)) {
|
|
4050
4050
|
Ae.info("Please provide a valid API URL");
|
|
4051
4051
|
return;
|
|
4052
4052
|
}
|
|
4053
4053
|
ke.current && ke.current.abort();
|
|
4054
|
-
const
|
|
4055
|
-
ke.current =
|
|
4054
|
+
const q = new AbortController();
|
|
4055
|
+
ke.current = q;
|
|
4056
4056
|
try {
|
|
4057
4057
|
r(!0);
|
|
4058
4058
|
const L = {
|
|
4059
4059
|
headers: {
|
|
4060
|
-
Authorization: `Bearer ${
|
|
4060
|
+
Authorization: `Bearer ${ye("token")}`
|
|
4061
4061
|
},
|
|
4062
|
-
signal:
|
|
4062
|
+
signal: q.signal,
|
|
4063
4063
|
defaultMessage: "Unable to load options"
|
|
4064
|
-
}, { status:
|
|
4065
|
-
if (
|
|
4064
|
+
}, { status: R, data: P } = await Fe.get(C.apiUrl, L);
|
|
4065
|
+
if (R !== 200 || !P) {
|
|
4066
4066
|
Ae.error("Unexpected response from server.");
|
|
4067
4067
|
return;
|
|
4068
4068
|
}
|
|
4069
|
-
const
|
|
4070
|
-
if (!Array.isArray(
|
|
4069
|
+
const V = P.data || P.record || P.result;
|
|
4070
|
+
if (!Array.isArray(V)) {
|
|
4071
4071
|
Ae.error("Expected an array in response (data, record, or result).");
|
|
4072
4072
|
return;
|
|
4073
4073
|
}
|
|
4074
|
-
((T = a.type) == null ? void 0 : T.toLowerCase()) === "datagrid" ? g("dataColumns", Ti(
|
|
4074
|
+
((T = a.type) == null ? void 0 : T.toLowerCase()) === "datagrid" ? g("dataColumns", Ti(V)) : g("options", Mi(V));
|
|
4075
4075
|
} catch (K) {
|
|
4076
4076
|
Fe.isCancel(K) || console.error(K);
|
|
4077
4077
|
} finally {
|
|
4078
|
-
ke.current ===
|
|
4078
|
+
ke.current === q && r(!1);
|
|
4079
4079
|
}
|
|
4080
|
-
}, [a.type, g, C.apiUrl]),
|
|
4080
|
+
}, [a.type, g, C.apiUrl]), ce = ["manual", "api", "sheet"];
|
|
4081
4081
|
function W() {
|
|
4082
|
-
t === "api" &&
|
|
4082
|
+
t === "api" && pe();
|
|
4083
4083
|
}
|
|
4084
|
-
const
|
|
4085
|
-
var
|
|
4084
|
+
const he = () => {
|
|
4085
|
+
var q, T;
|
|
4086
4086
|
return /* @__PURE__ */ c("div", { className: "flex flex-col justify-start gap-y-1", children: [
|
|
4087
|
-
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children:
|
|
4087
|
+
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: ce == null ? void 0 : ce.map((K) => /* @__PURE__ */ c("label", { className: "items-center text-base capitalize gap-x-3", children: [
|
|
4088
4088
|
/* @__PURE__ */ i(
|
|
4089
4089
|
"input",
|
|
4090
4090
|
{
|
|
@@ -4104,7 +4104,7 @@ const wo = O.object().shape({
|
|
|
4104
4104
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-2", children: [
|
|
4105
4105
|
/* @__PURE__ */ c("div", { className: "relative flex items-center w-full mb-2", children: [
|
|
4106
4106
|
/* @__PURE__ */ i(
|
|
4107
|
-
|
|
4107
|
+
_,
|
|
4108
4108
|
{
|
|
4109
4109
|
watch: v,
|
|
4110
4110
|
label: "Load Options from Api",
|
|
@@ -4140,7 +4140,7 @@ const wo = O.object().shape({
|
|
|
4140
4140
|
}
|
|
4141
4141
|
) }),
|
|
4142
4142
|
t === "manual" && /* @__PURE__ */ c("div", { children: [
|
|
4143
|
-
/* @__PURE__ */ i("h3", { className: "mb-4 text-sm text-gray-500 font-semibold", children: ((
|
|
4143
|
+
/* @__PURE__ */ i("h3", { className: "mb-4 text-sm text-gray-500 font-semibold", children: ((q = a == null ? void 0 : a.type) == null ? void 0 : q.toLowerCase()) === "matrix" ? "Rows Options" : "Parent Options" }),
|
|
4144
4144
|
E == null ? void 0 : E.map((K, L) => /* @__PURE__ */ c(
|
|
4145
4145
|
"div",
|
|
4146
4146
|
{
|
|
@@ -4148,7 +4148,7 @@ const wo = O.object().shape({
|
|
|
4148
4148
|
children: [
|
|
4149
4149
|
/* @__PURE__ */ c("div", { className: "flex items-start gap-x-4", children: [
|
|
4150
4150
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4151
|
-
|
|
4151
|
+
_,
|
|
4152
4152
|
{
|
|
4153
4153
|
watch: v,
|
|
4154
4154
|
label: L === 0 ? "Label" : "",
|
|
@@ -4157,9 +4157,9 @@ const wo = O.object().shape({
|
|
|
4157
4157
|
errors: M,
|
|
4158
4158
|
element: a,
|
|
4159
4159
|
placeholder: "Label",
|
|
4160
|
-
onChange: (
|
|
4161
|
-
const
|
|
4162
|
-
g(`options.${L}.value`,
|
|
4160
|
+
onChange: (R) => {
|
|
4161
|
+
const V = R.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
4162
|
+
g(`options.${L}.value`, V, {
|
|
4163
4163
|
shouldValidate: !0,
|
|
4164
4164
|
shouldDirty: !0
|
|
4165
4165
|
});
|
|
@@ -4167,7 +4167,7 @@ const wo = O.object().shape({
|
|
|
4167
4167
|
}
|
|
4168
4168
|
) }),
|
|
4169
4169
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4170
|
-
|
|
4170
|
+
_,
|
|
4171
4171
|
{
|
|
4172
4172
|
watch: v,
|
|
4173
4173
|
label: L === 0 ? "Value" : "",
|
|
@@ -4184,9 +4184,9 @@ const wo = O.object().shape({
|
|
|
4184
4184
|
disabled: E.length === 1,
|
|
4185
4185
|
type: "button",
|
|
4186
4186
|
className: `outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed ${L === 0 ? "mt-[34px]" : "mt-[10px]"}`,
|
|
4187
|
-
onClick: () =>
|
|
4187
|
+
onClick: () => D(L),
|
|
4188
4188
|
children: /* @__PURE__ */ i(
|
|
4189
|
-
|
|
4189
|
+
J,
|
|
4190
4190
|
{
|
|
4191
4191
|
icon: "iconamoon:sign-times-fill",
|
|
4192
4192
|
iconClass: "text-gray-400 hover:text-red-500 text-lg transition-colors"
|
|
@@ -4210,8 +4210,8 @@ const wo = O.object().shape({
|
|
|
4210
4210
|
{ value: "image/webp", label: "WebP" },
|
|
4211
4211
|
{ value: "image/svg+xml", label: "SVG" }
|
|
4212
4212
|
],
|
|
4213
|
-
onFileLoaded: (
|
|
4214
|
-
|
|
4213
|
+
onFileLoaded: (R) => {
|
|
4214
|
+
R && R.length > 0 ? g(`options.${L}.imageUrl`, R[0].base64, {
|
|
4215
4215
|
shouldDirty: !0,
|
|
4216
4216
|
shouldValidate: !0
|
|
4217
4217
|
}) : g(`options.${L}.imageUrl`, "", {
|
|
@@ -4229,7 +4229,7 @@ const wo = O.object().shape({
|
|
|
4229
4229
|
}
|
|
4230
4230
|
),
|
|
4231
4231
|
/* @__PURE__ */ i("div", { className: "flex-1 hidden", children: /* @__PURE__ */ i(
|
|
4232
|
-
|
|
4232
|
+
_,
|
|
4233
4233
|
{
|
|
4234
4234
|
watch: v,
|
|
4235
4235
|
label: "",
|
|
@@ -4255,14 +4255,14 @@ const wo = O.object().shape({
|
|
|
4255
4255
|
className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
|
|
4256
4256
|
onClick: () => B({ label: "", value: "", id: Ce() }),
|
|
4257
4257
|
children: [
|
|
4258
|
-
/* @__PURE__ */ i(
|
|
4258
|
+
/* @__PURE__ */ i(J, { icon: "qlementine-icons:plus-16" }),
|
|
4259
4259
|
" Add Option"
|
|
4260
4260
|
]
|
|
4261
4261
|
}
|
|
4262
4262
|
)
|
|
4263
4263
|
] })
|
|
4264
4264
|
] }),
|
|
4265
|
-
["cascadeselect", "matrix"].includes(a.type.toLowerCase()) && /* @__PURE__ */ c(
|
|
4265
|
+
["cascadeselect", "matrix"].includes(a.type.toLowerCase()) && /* @__PURE__ */ c(ge, { children: [
|
|
4266
4266
|
/* @__PURE__ */ i("hr", { className: "my-5" }),
|
|
4267
4267
|
/* @__PURE__ */ c("div", { children: [
|
|
4268
4268
|
" ",
|
|
@@ -4273,7 +4273,7 @@ const wo = O.object().shape({
|
|
|
4273
4273
|
className: "flex items-center mb-1 gap-x-4 last:mb-0",
|
|
4274
4274
|
children: [
|
|
4275
4275
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4276
|
-
|
|
4276
|
+
_,
|
|
4277
4277
|
{
|
|
4278
4278
|
watch: v,
|
|
4279
4279
|
label: L === 0 ? "Label" : "",
|
|
@@ -4282,9 +4282,9 @@ const wo = O.object().shape({
|
|
|
4282
4282
|
errors: M,
|
|
4283
4283
|
element: a,
|
|
4284
4284
|
placeholder: "Label",
|
|
4285
|
-
onChange: (
|
|
4286
|
-
const
|
|
4287
|
-
g(`options1.${L}.value`,
|
|
4285
|
+
onChange: (R) => {
|
|
4286
|
+
const V = R.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
4287
|
+
g(`options1.${L}.value`, V, {
|
|
4288
4288
|
shouldValidate: !0,
|
|
4289
4289
|
shouldDirty: !0
|
|
4290
4290
|
});
|
|
@@ -4292,7 +4292,7 @@ const wo = O.object().shape({
|
|
|
4292
4292
|
}
|
|
4293
4293
|
) }),
|
|
4294
4294
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4295
|
-
|
|
4295
|
+
_,
|
|
4296
4296
|
{
|
|
4297
4297
|
watch: v,
|
|
4298
4298
|
label: L === 0 ? "Value" : "",
|
|
@@ -4304,7 +4304,7 @@ const wo = O.object().shape({
|
|
|
4304
4304
|
}
|
|
4305
4305
|
) }),
|
|
4306
4306
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4307
|
-
|
|
4307
|
+
_,
|
|
4308
4308
|
{
|
|
4309
4309
|
watch: v,
|
|
4310
4310
|
label: L === 0 ? "Key" : "",
|
|
@@ -4321,8 +4321,8 @@ const wo = O.object().shape({
|
|
|
4321
4321
|
disabled: Z.length === 1,
|
|
4322
4322
|
type: "button",
|
|
4323
4323
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
4324
|
-
onClick: () =>
|
|
4325
|
-
children: /* @__PURE__ */ i(
|
|
4324
|
+
onClick: () => H(L),
|
|
4325
|
+
children: /* @__PURE__ */ i(J, { icon: "iconamoon:sign-times-fill" })
|
|
4326
4326
|
}
|
|
4327
4327
|
)
|
|
4328
4328
|
]
|
|
@@ -4338,7 +4338,7 @@ const wo = O.object().shape({
|
|
|
4338
4338
|
className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
|
|
4339
4339
|
onClick: () => Q({ label: "", value: "", key: "", id: Ce() }),
|
|
4340
4340
|
children: [
|
|
4341
|
-
/* @__PURE__ */ i(
|
|
4341
|
+
/* @__PURE__ */ i(J, { icon: "qlementine-icons:plus-16" }),
|
|
4342
4342
|
" Add Option"
|
|
4343
4343
|
]
|
|
4344
4344
|
}
|
|
@@ -4347,29 +4347,29 @@ const wo = O.object().shape({
|
|
|
4347
4347
|
] })
|
|
4348
4348
|
] })
|
|
4349
4349
|
] });
|
|
4350
|
-
},
|
|
4351
|
-
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children:
|
|
4350
|
+
}, xe = () => /* @__PURE__ */ c("div", { className: "flex flex-col justify-start gap-y-1", children: [
|
|
4351
|
+
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: ce == null ? void 0 : ce.map((q) => /* @__PURE__ */ c("label", { className: "items-center text-base capitalize gap-x-3", children: [
|
|
4352
4352
|
/* @__PURE__ */ i(
|
|
4353
4353
|
"input",
|
|
4354
4354
|
{
|
|
4355
4355
|
type: "radio",
|
|
4356
4356
|
name: "optionType",
|
|
4357
4357
|
onChange: (T) => b(T.target.value),
|
|
4358
|
-
value:
|
|
4359
|
-
checked:
|
|
4358
|
+
value: q,
|
|
4359
|
+
checked: q === t
|
|
4360
4360
|
}
|
|
4361
4361
|
),
|
|
4362
4362
|
" ",
|
|
4363
4363
|
/* @__PURE__ */ c("span", { children: [
|
|
4364
|
-
|
|
4364
|
+
q,
|
|
4365
4365
|
" options"
|
|
4366
4366
|
] })
|
|
4367
|
-
] },
|
|
4367
|
+
] }, q)) }),
|
|
4368
4368
|
t === "api" && /* @__PURE__ */ c("div", { className: "mb-4", children: [
|
|
4369
4369
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-2", children: [
|
|
4370
4370
|
/* @__PURE__ */ c("div", { className: "relative flex items-center w-full mb-2", children: [
|
|
4371
4371
|
/* @__PURE__ */ i(
|
|
4372
|
-
|
|
4372
|
+
_,
|
|
4373
4373
|
{
|
|
4374
4374
|
watch: v,
|
|
4375
4375
|
label: "Load Columns from Api",
|
|
@@ -4404,7 +4404,7 @@ const wo = O.object().shape({
|
|
|
4404
4404
|
name: "dataColumns"
|
|
4405
4405
|
}
|
|
4406
4406
|
) }),
|
|
4407
|
-
/* @__PURE__ */ i("div", { className: "grid gap-y-3", children:
|
|
4407
|
+
/* @__PURE__ */ i("div", { className: "grid gap-y-3", children: ie == null ? void 0 : ie.map((q, T) => {
|
|
4408
4408
|
var K, L;
|
|
4409
4409
|
return /* @__PURE__ */ c(
|
|
4410
4410
|
"div",
|
|
@@ -4442,15 +4442,15 @@ const wo = O.object().shape({
|
|
|
4442
4442
|
}
|
|
4443
4443
|
) }),
|
|
4444
4444
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4445
|
-
|
|
4445
|
+
_,
|
|
4446
4446
|
{
|
|
4447
4447
|
watch: v,
|
|
4448
4448
|
label: T === 0 ? "Display header" : "",
|
|
4449
4449
|
name: `dataColumns.${T}.headerName`,
|
|
4450
4450
|
register: p,
|
|
4451
|
-
onChange: (
|
|
4452
|
-
const
|
|
4453
|
-
g(`dataColumns.${T}.field`,
|
|
4451
|
+
onChange: (R) => {
|
|
4452
|
+
const V = R.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
4453
|
+
g(`dataColumns.${T}.field`, V, {
|
|
4454
4454
|
shouldValidate: !0,
|
|
4455
4455
|
shouldDirty: !0
|
|
4456
4456
|
});
|
|
@@ -4461,7 +4461,7 @@ const wo = O.object().shape({
|
|
|
4461
4461
|
}
|
|
4462
4462
|
) }),
|
|
4463
4463
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4464
|
-
|
|
4464
|
+
_,
|
|
4465
4465
|
{
|
|
4466
4466
|
watch: v,
|
|
4467
4467
|
label: T === 0 ? "Field key" : "",
|
|
@@ -4476,16 +4476,16 @@ const wo = O.object().shape({
|
|
|
4476
4476
|
/* @__PURE__ */ i(
|
|
4477
4477
|
"button",
|
|
4478
4478
|
{
|
|
4479
|
-
disabled:
|
|
4479
|
+
disabled: ie.length === 1,
|
|
4480
4480
|
type: "button",
|
|
4481
4481
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
4482
4482
|
onClick: () => X(T),
|
|
4483
|
-
children: /* @__PURE__ */ i(
|
|
4483
|
+
children: /* @__PURE__ */ i(J, { icon: "iconamoon:sign-times-fill" })
|
|
4484
4484
|
}
|
|
4485
4485
|
)
|
|
4486
4486
|
] }),
|
|
4487
4487
|
((L = (K = C.dataColumns) == null ? void 0 : K[T]) == null ? void 0 : L.type) === "select" && /* @__PURE__ */ i("div", { className: "flex items-center gap-x-4", children: /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4488
|
-
|
|
4488
|
+
_,
|
|
4489
4489
|
{
|
|
4490
4490
|
watch: v,
|
|
4491
4491
|
label: "Options API URL",
|
|
@@ -4498,7 +4498,7 @@ const wo = O.object().shape({
|
|
|
4498
4498
|
) }) })
|
|
4499
4499
|
]
|
|
4500
4500
|
},
|
|
4501
|
-
|
|
4501
|
+
q.id
|
|
4502
4502
|
);
|
|
4503
4503
|
}) }),
|
|
4504
4504
|
/* @__PURE__ */ c("div", { children: [
|
|
@@ -4517,20 +4517,20 @@ const wo = O.object().shape({
|
|
|
4517
4517
|
validate: !1
|
|
4518
4518
|
}),
|
|
4519
4519
|
children: [
|
|
4520
|
-
/* @__PURE__ */ i(
|
|
4520
|
+
/* @__PURE__ */ i(J, { icon: "qlementine-icons:plus-16" }),
|
|
4521
4521
|
" Add column"
|
|
4522
4522
|
]
|
|
4523
4523
|
}
|
|
4524
4524
|
)
|
|
4525
4525
|
] })
|
|
4526
|
-
] }),
|
|
4526
|
+
] }), te = /* @__PURE__ */ i(
|
|
4527
4527
|
"div",
|
|
4528
4528
|
{
|
|
4529
4529
|
className: "fixed inset-0 bg-gray-800/40 backdrop-blur-sm flex items-center justify-end z-[999] cursor-default",
|
|
4530
|
-
onMouseDown: (
|
|
4531
|
-
onPointerDown: (
|
|
4532
|
-
onDragStart: (
|
|
4533
|
-
|
|
4530
|
+
onMouseDown: (q) => q.stopPropagation(),
|
|
4531
|
+
onPointerDown: (q) => q.stopPropagation(),
|
|
4532
|
+
onDragStart: (q) => {
|
|
4533
|
+
q.preventDefault(), q.stopPropagation();
|
|
4534
4534
|
},
|
|
4535
4535
|
children: /* @__PURE__ */ c("div", { className: "w-full lg:w-2/3 xl:w-2/5 bg-white h-screen shadow-xl relative flex flex-col items-center", children: [
|
|
4536
4536
|
/* @__PURE__ */ i(
|
|
@@ -4538,7 +4538,7 @@ const wo = O.object().shape({
|
|
|
4538
4538
|
{
|
|
4539
4539
|
className: "bg-white h-10 w-10 flex justify-center items-center absolute top-1 -left-12 rounded-lg hover:bg-gray-50",
|
|
4540
4540
|
onClick: n,
|
|
4541
|
-
children: /* @__PURE__ */ i(
|
|
4541
|
+
children: /* @__PURE__ */ i(J, { icon: "tabler:x", iconClass: "text-xl" })
|
|
4542
4542
|
}
|
|
4543
4543
|
),
|
|
4544
4544
|
/* @__PURE__ */ i("div", { className: "w-full pt-4", children: /* @__PURE__ */ i(
|
|
@@ -4562,8 +4562,8 @@ const wo = O.object().shape({
|
|
|
4562
4562
|
" ",
|
|
4563
4563
|
/* @__PURE__ */ c("div", { className: "config_box max-h-[83vh] overflow-y-auto flex-1", children: [
|
|
4564
4564
|
d === "basic" && /* @__PURE__ */ c("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
|
|
4565
|
-
pi.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4566
|
-
|
|
4565
|
+
pi.includes(a.inputType) && /* @__PURE__ */ i(ge, { children: /* @__PURE__ */ i(
|
|
4566
|
+
_,
|
|
4567
4567
|
{
|
|
4568
4568
|
watch: v,
|
|
4569
4569
|
label: "Value",
|
|
@@ -4573,9 +4573,9 @@ const wo = O.object().shape({
|
|
|
4573
4573
|
element: a
|
|
4574
4574
|
}
|
|
4575
4575
|
) }),
|
|
4576
|
-
!pi.includes(a.inputType) && !ii.includes(a.inputType) && /* @__PURE__ */ c(
|
|
4576
|
+
!pi.includes(a.inputType) && !ii.includes(a.inputType) && /* @__PURE__ */ c(ge, { children: [
|
|
4577
4577
|
/* @__PURE__ */ i(
|
|
4578
|
-
|
|
4578
|
+
_,
|
|
4579
4579
|
{
|
|
4580
4580
|
watch: v,
|
|
4581
4581
|
label: "Label",
|
|
@@ -4587,7 +4587,7 @@ const wo = O.object().shape({
|
|
|
4587
4587
|
),
|
|
4588
4588
|
" ",
|
|
4589
4589
|
a.type.toLowerCase() === "cascadeselect" && /* @__PURE__ */ i(
|
|
4590
|
-
|
|
4590
|
+
_,
|
|
4591
4591
|
{
|
|
4592
4592
|
watch: v,
|
|
4593
4593
|
label: "Child Label",
|
|
@@ -4597,9 +4597,9 @@ const wo = O.object().shape({
|
|
|
4597
4597
|
element: a
|
|
4598
4598
|
}
|
|
4599
4599
|
),
|
|
4600
|
-
a.inputType === "nps" && /* @__PURE__ */ c(
|
|
4600
|
+
a.inputType === "nps" && /* @__PURE__ */ c(ge, { children: [
|
|
4601
4601
|
/* @__PURE__ */ i(
|
|
4602
|
-
|
|
4602
|
+
_,
|
|
4603
4603
|
{
|
|
4604
4604
|
watch: v,
|
|
4605
4605
|
label: "Low Rating Label (e.g. Not at all likely)",
|
|
@@ -4611,7 +4611,7 @@ const wo = O.object().shape({
|
|
|
4611
4611
|
}
|
|
4612
4612
|
),
|
|
4613
4613
|
/* @__PURE__ */ i(
|
|
4614
|
-
|
|
4614
|
+
_,
|
|
4615
4615
|
{
|
|
4616
4616
|
watch: v,
|
|
4617
4617
|
label: "High Rating Label (e.g. Extremely likely)",
|
|
@@ -4625,7 +4625,7 @@ const wo = O.object().shape({
|
|
|
4625
4625
|
] })
|
|
4626
4626
|
] }),
|
|
4627
4627
|
oo.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4628
|
-
|
|
4628
|
+
_,
|
|
4629
4629
|
{
|
|
4630
4630
|
watch: v,
|
|
4631
4631
|
label: "Placeholder",
|
|
@@ -4636,7 +4636,7 @@ const wo = O.object().shape({
|
|
|
4636
4636
|
}
|
|
4637
4637
|
),
|
|
4638
4638
|
no.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4639
|
-
|
|
4639
|
+
_,
|
|
4640
4640
|
{
|
|
4641
4641
|
watch: v,
|
|
4642
4642
|
label: "Prefix",
|
|
@@ -4666,9 +4666,9 @@ const wo = O.object().shape({
|
|
|
4666
4666
|
Ve,
|
|
4667
4667
|
{
|
|
4668
4668
|
label: "Source Field",
|
|
4669
|
-
options: x.map((
|
|
4670
|
-
label:
|
|
4671
|
-
value:
|
|
4669
|
+
options: x.map((q) => ({
|
|
4670
|
+
label: q.display,
|
|
4671
|
+
value: q.id
|
|
4672
4672
|
})),
|
|
4673
4673
|
register: p,
|
|
4674
4674
|
name: "sourceFieldId",
|
|
@@ -4681,7 +4681,7 @@ const wo = O.object().shape({
|
|
|
4681
4681
|
uo.includes(a.inputType) && /* @__PURE__ */ c("div", { className: "grid gap-y-4", children: [
|
|
4682
4682
|
/* @__PURE__ */ i(bo, {}),
|
|
4683
4683
|
/* @__PURE__ */ i(
|
|
4684
|
-
|
|
4684
|
+
_,
|
|
4685
4685
|
{
|
|
4686
4686
|
watch: v,
|
|
4687
4687
|
label: "Api Url",
|
|
@@ -4737,14 +4737,14 @@ const wo = O.object().shape({
|
|
|
4737
4737
|
to.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4738
4738
|
mo,
|
|
4739
4739
|
{
|
|
4740
|
-
onChange: (
|
|
4741
|
-
g("denominators",
|
|
4740
|
+
onChange: (q) => {
|
|
4741
|
+
g("denominators", q);
|
|
4742
4742
|
},
|
|
4743
4743
|
value: v("denominators")
|
|
4744
4744
|
}
|
|
4745
4745
|
),
|
|
4746
4746
|
!pi.includes(a.inputType) && !ii.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4747
|
-
|
|
4747
|
+
_,
|
|
4748
4748
|
{
|
|
4749
4749
|
watch: v,
|
|
4750
4750
|
label: "Short Description",
|
|
@@ -4754,7 +4754,7 @@ const wo = O.object().shape({
|
|
|
4754
4754
|
element: a
|
|
4755
4755
|
}
|
|
4756
4756
|
),
|
|
4757
|
-
a.type.toLowerCase() === "date" && /* @__PURE__ */ c(
|
|
4757
|
+
a.type.toLowerCase() === "date" && /* @__PURE__ */ c(ge, { children: [
|
|
4758
4758
|
/* @__PURE__ */ i(
|
|
4759
4759
|
Ve,
|
|
4760
4760
|
{
|
|
@@ -4768,7 +4768,7 @@ const wo = O.object().shape({
|
|
|
4768
4768
|
}
|
|
4769
4769
|
),
|
|
4770
4770
|
/* @__PURE__ */ i(
|
|
4771
|
-
|
|
4771
|
+
_,
|
|
4772
4772
|
{
|
|
4773
4773
|
watch: v,
|
|
4774
4774
|
label: "Allow Range",
|
|
@@ -4802,7 +4802,7 @@ const wo = O.object().shape({
|
|
|
4802
4802
|
)
|
|
4803
4803
|
] }),
|
|
4804
4804
|
/* @__PURE__ */ i(
|
|
4805
|
-
|
|
4805
|
+
_,
|
|
4806
4806
|
{
|
|
4807
4807
|
watch: v,
|
|
4808
4808
|
label: "Allow Year Picker",
|
|
@@ -4816,7 +4816,7 @@ const wo = O.object().shape({
|
|
|
4816
4816
|
)
|
|
4817
4817
|
] }),
|
|
4818
4818
|
a.type.toLowerCase() === "time" && /* @__PURE__ */ i(
|
|
4819
|
-
|
|
4819
|
+
_,
|
|
4820
4820
|
{
|
|
4821
4821
|
watch: v,
|
|
4822
4822
|
label: "24 Hour Format",
|
|
@@ -4829,7 +4829,7 @@ const wo = O.object().shape({
|
|
|
4829
4829
|
}
|
|
4830
4830
|
),
|
|
4831
4831
|
a.type.toLowerCase() === "country" && /* @__PURE__ */ i(
|
|
4832
|
-
|
|
4832
|
+
_,
|
|
4833
4833
|
{
|
|
4834
4834
|
watch: v,
|
|
4835
4835
|
label: "Allow States",
|
|
@@ -4864,9 +4864,9 @@ const wo = O.object().shape({
|
|
|
4864
4864
|
),
|
|
4865
4865
|
["multiselect", "checkbox"].includes(
|
|
4866
4866
|
a.type.toLowerCase()
|
|
4867
|
-
) && /* @__PURE__ */ c(
|
|
4867
|
+
) && /* @__PURE__ */ c(ge, { children: [
|
|
4868
4868
|
/* @__PURE__ */ i(
|
|
4869
|
-
|
|
4869
|
+
_,
|
|
4870
4870
|
{
|
|
4871
4871
|
watch: v,
|
|
4872
4872
|
label: "Minimum Options Checked",
|
|
@@ -4878,7 +4878,7 @@ const wo = O.object().shape({
|
|
|
4878
4878
|
}
|
|
4879
4879
|
),
|
|
4880
4880
|
/* @__PURE__ */ i("div", { className: "w-[250px]", children: /* @__PURE__ */ i(
|
|
4881
|
-
|
|
4881
|
+
_,
|
|
4882
4882
|
{
|
|
4883
4883
|
watch: v,
|
|
4884
4884
|
label: "Require All Checked",
|
|
@@ -4892,7 +4892,7 @@ const wo = O.object().shape({
|
|
|
4892
4892
|
) })
|
|
4893
4893
|
] }),
|
|
4894
4894
|
a.type.toLowerCase() === "grid" && /* @__PURE__ */ i(
|
|
4895
|
-
|
|
4895
|
+
_,
|
|
4896
4896
|
{
|
|
4897
4897
|
watch: v,
|
|
4898
4898
|
label: "Number of columns (max: 4)",
|
|
@@ -4907,7 +4907,7 @@ const wo = O.object().shape({
|
|
|
4907
4907
|
a.type.toLowerCase() === "document" && /* @__PURE__ */ c("div", { className: "grid gap-y-6", children: [
|
|
4908
4908
|
/* @__PURE__ */ c("div", { className: "grid gap-y-1", children: [
|
|
4909
4909
|
/* @__PURE__ */ i(
|
|
4910
|
-
|
|
4910
|
+
_,
|
|
4911
4911
|
{
|
|
4912
4912
|
watch: v,
|
|
4913
4913
|
label: "Document Options Url",
|
|
@@ -4922,7 +4922,7 @@ const wo = O.object().shape({
|
|
|
4922
4922
|
] }),
|
|
4923
4923
|
/* @__PURE__ */ c("div", { className: "grid gap-y-1", children: [
|
|
4924
4924
|
/* @__PURE__ */ i(
|
|
4925
|
-
|
|
4925
|
+
_,
|
|
4926
4926
|
{
|
|
4927
4927
|
watch: v,
|
|
4928
4928
|
label: "Document Validation Url",
|
|
@@ -4935,7 +4935,7 @@ const wo = O.object().shape({
|
|
|
4935
4935
|
/* @__PURE__ */ i(go, {})
|
|
4936
4936
|
] }),
|
|
4937
4937
|
/* @__PURE__ */ i("div", { className: "grid gap-y-1", children: /* @__PURE__ */ i(
|
|
4938
|
-
|
|
4938
|
+
_,
|
|
4939
4939
|
{
|
|
4940
4940
|
watch: v,
|
|
4941
4941
|
label: "Signature Page Url",
|
|
@@ -4946,10 +4946,10 @@ const wo = O.object().shape({
|
|
|
4946
4946
|
}
|
|
4947
4947
|
) })
|
|
4948
4948
|
] }),
|
|
4949
|
-
a.type.toLowerCase() === "datagrid" &&
|
|
4950
|
-
a.type.toLowerCase() === "file" && /* @__PURE__ */ c(
|
|
4949
|
+
a.type.toLowerCase() === "datagrid" && xe(),
|
|
4950
|
+
a.type.toLowerCase() === "file" && /* @__PURE__ */ c(ge, { children: [
|
|
4951
4951
|
/* @__PURE__ */ i(
|
|
4952
|
-
|
|
4952
|
+
_,
|
|
4953
4953
|
{
|
|
4954
4954
|
watch: v,
|
|
4955
4955
|
label: "Allow Multiple Uploads",
|
|
@@ -4974,7 +4974,7 @@ const wo = O.object().shape({
|
|
|
4974
4974
|
}
|
|
4975
4975
|
),
|
|
4976
4976
|
/* @__PURE__ */ i(
|
|
4977
|
-
|
|
4977
|
+
_,
|
|
4978
4978
|
{
|
|
4979
4979
|
watch: v,
|
|
4980
4980
|
label: "Max File Size (MB)",
|
|
@@ -4986,12 +4986,12 @@ const wo = O.object().shape({
|
|
|
4986
4986
|
}
|
|
4987
4987
|
)
|
|
4988
4988
|
] }),
|
|
4989
|
-
lo.includes(a.inputType) &&
|
|
4989
|
+
lo.includes(a.inputType) && he(),
|
|
4990
4990
|
!["spacer", "divider", "section", "grid"].includes(
|
|
4991
4991
|
(Ie = a.type) == null ? void 0 : Ie.toLowerCase()
|
|
4992
4992
|
) && /* @__PURE__ */ c("div", { className: "flex items-center gap-x-6 mb-4", children: [
|
|
4993
4993
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
4994
|
-
|
|
4994
|
+
_,
|
|
4995
4995
|
{
|
|
4996
4996
|
watch: v,
|
|
4997
4997
|
label: "Disabled",
|
|
@@ -5004,7 +5004,7 @@ const wo = O.object().shape({
|
|
|
5004
5004
|
}
|
|
5005
5005
|
) }),
|
|
5006
5006
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
5007
|
-
|
|
5007
|
+
_,
|
|
5008
5008
|
{
|
|
5009
5009
|
watch: v,
|
|
5010
5010
|
label: "Read Only",
|
|
@@ -5019,7 +5019,7 @@ const wo = O.object().shape({
|
|
|
5019
5019
|
] }),
|
|
5020
5020
|
/* @__PURE__ */ c("div", { children: [
|
|
5021
5021
|
/* @__PURE__ */ i("div", { className: "w-[150px] mb-4", children: /* @__PURE__ */ i(
|
|
5022
|
-
|
|
5022
|
+
_,
|
|
5023
5023
|
{
|
|
5024
5024
|
watch: v,
|
|
5025
5025
|
label: "Toggle Visibility",
|
|
@@ -5049,7 +5049,7 @@ const wo = O.object().shape({
|
|
|
5049
5049
|
No,
|
|
5050
5050
|
{
|
|
5051
5051
|
value: v("formula") || "",
|
|
5052
|
-
onChange: (
|
|
5052
|
+
onChange: (q) => g("formula", q, {
|
|
5053
5053
|
shouldValidate: !0,
|
|
5054
5054
|
shouldDirty: !0
|
|
5055
5055
|
}),
|
|
@@ -5060,7 +5060,7 @@ const wo = O.object().shape({
|
|
|
5060
5060
|
] }),
|
|
5061
5061
|
a.type.toLowerCase() === "polling" && /* @__PURE__ */ c("div", { className: "grid gap-y-4 mb-4 mt-2", children: [
|
|
5062
5062
|
/* @__PURE__ */ i(
|
|
5063
|
-
|
|
5063
|
+
_,
|
|
5064
5064
|
{
|
|
5065
5065
|
watch: v,
|
|
5066
5066
|
label: "Fetch results from external API",
|
|
@@ -5073,7 +5073,7 @@ const wo = O.object().shape({
|
|
|
5073
5073
|
}
|
|
5074
5074
|
),
|
|
5075
5075
|
C.fetchExternalResults && /* @__PURE__ */ i(
|
|
5076
|
-
|
|
5076
|
+
_,
|
|
5077
5077
|
{
|
|
5078
5078
|
watch: v,
|
|
5079
5079
|
label: "External API URL (returns options results)",
|
|
@@ -5089,7 +5089,7 @@ const wo = O.object().shape({
|
|
|
5089
5089
|
!ii.includes(a.type.toLowerCase()) && d === "validation" && /* @__PURE__ */ c("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
|
|
5090
5090
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-6", children: [
|
|
5091
5091
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
5092
|
-
|
|
5092
|
+
_,
|
|
5093
5093
|
{
|
|
5094
5094
|
watch: v,
|
|
5095
5095
|
label: "Required",
|
|
@@ -5103,7 +5103,7 @@ const wo = O.object().shape({
|
|
|
5103
5103
|
) }),
|
|
5104
5104
|
" ",
|
|
5105
5105
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
5106
|
-
|
|
5106
|
+
_,
|
|
5107
5107
|
{
|
|
5108
5108
|
watch: v,
|
|
5109
5109
|
label: "Error message text",
|
|
@@ -5114,10 +5114,10 @@ const wo = O.object().shape({
|
|
|
5114
5114
|
}
|
|
5115
5115
|
) })
|
|
5116
5116
|
] }),
|
|
5117
|
-
ao.includes(a.inputType) && /* @__PURE__ */ c(
|
|
5117
|
+
ao.includes(a.inputType) && /* @__PURE__ */ c(ge, { children: [
|
|
5118
5118
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-6", children: [
|
|
5119
5119
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
5120
|
-
|
|
5120
|
+
_,
|
|
5121
5121
|
{
|
|
5122
5122
|
watch: v,
|
|
5123
5123
|
label: "Min Length",
|
|
@@ -5130,7 +5130,7 @@ const wo = O.object().shape({
|
|
|
5130
5130
|
) }),
|
|
5131
5131
|
" ",
|
|
5132
5132
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
5133
|
-
|
|
5133
|
+
_,
|
|
5134
5134
|
{
|
|
5135
5135
|
watch: v,
|
|
5136
5136
|
label: "Error message text",
|
|
@@ -5143,7 +5143,7 @@ const wo = O.object().shape({
|
|
|
5143
5143
|
] }),
|
|
5144
5144
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-6", children: [
|
|
5145
5145
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
5146
|
-
|
|
5146
|
+
_,
|
|
5147
5147
|
{
|
|
5148
5148
|
watch: v,
|
|
5149
5149
|
label: "Max Length",
|
|
@@ -5156,7 +5156,7 @@ const wo = O.object().shape({
|
|
|
5156
5156
|
) }),
|
|
5157
5157
|
" ",
|
|
5158
5158
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
5159
|
-
|
|
5159
|
+
_,
|
|
5160
5160
|
{
|
|
5161
5161
|
watch: v,
|
|
5162
5162
|
label: "Error message text",
|
|
@@ -5168,10 +5168,10 @@ const wo = O.object().shape({
|
|
|
5168
5168
|
) })
|
|
5169
5169
|
] })
|
|
5170
5170
|
] }),
|
|
5171
|
-
so.includes(a.inputType) && /* @__PURE__ */ c(
|
|
5171
|
+
so.includes(a.inputType) && /* @__PURE__ */ c(ge, { children: [
|
|
5172
5172
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-6", children: [
|
|
5173
5173
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
5174
|
-
|
|
5174
|
+
_,
|
|
5175
5175
|
{
|
|
5176
5176
|
watch: v,
|
|
5177
5177
|
label: "Min Amount",
|
|
@@ -5184,7 +5184,7 @@ const wo = O.object().shape({
|
|
|
5184
5184
|
) }),
|
|
5185
5185
|
" ",
|
|
5186
5186
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
5187
|
-
|
|
5187
|
+
_,
|
|
5188
5188
|
{
|
|
5189
5189
|
watch: v,
|
|
5190
5190
|
label: "Error message text",
|
|
@@ -5197,7 +5197,7 @@ const wo = O.object().shape({
|
|
|
5197
5197
|
] }),
|
|
5198
5198
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-6", children: [
|
|
5199
5199
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
5200
|
-
|
|
5200
|
+
_,
|
|
5201
5201
|
{
|
|
5202
5202
|
watch: v,
|
|
5203
5203
|
label: "Max Amount",
|
|
@@ -5210,7 +5210,7 @@ const wo = O.object().shape({
|
|
|
5210
5210
|
) }),
|
|
5211
5211
|
" ",
|
|
5212
5212
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
5213
|
-
|
|
5213
|
+
_,
|
|
5214
5214
|
{
|
|
5215
5215
|
watch: v,
|
|
5216
5216
|
label: "Error message text",
|
|
@@ -5252,17 +5252,17 @@ const wo = O.object().shape({
|
|
|
5252
5252
|
] })
|
|
5253
5253
|
}
|
|
5254
5254
|
);
|
|
5255
|
-
return document.body ?
|
|
5255
|
+
return document.body ? Rn(te, document.body) : te;
|
|
5256
5256
|
}, Ki = li(
|
|
5257
5257
|
({ state: e, element: n, children: a }) => {
|
|
5258
5258
|
var b, h;
|
|
5259
|
-
const [s, o] = G(!1), { removeElement: l, duplicateElement: d, updateElement: u, copyElement: m } =
|
|
5259
|
+
const [s, o] = G(!1), { removeElement: l, duplicateElement: d, updateElement: u, copyElement: m } = me.useContext(we), r = ue(
|
|
5260
5260
|
() => {
|
|
5261
5261
|
var x;
|
|
5262
5262
|
return (x = n == null ? void 0 : n.acceptedFiles) == null ? void 0 : x.map((f) => f.label).join(", ");
|
|
5263
5263
|
},
|
|
5264
5264
|
[n]
|
|
5265
|
-
), t =
|
|
5265
|
+
), t = ae(() => {
|
|
5266
5266
|
l(n.id, n.sectionId);
|
|
5267
5267
|
}, [n.id, n.sectionId, l]);
|
|
5268
5268
|
return /* @__PURE__ */ c("div", { className: "w-full min-w-0", children: [
|
|
@@ -5288,7 +5288,7 @@ const wo = O.object().shape({
|
|
|
5288
5288
|
] })
|
|
5289
5289
|
] }),
|
|
5290
5290
|
e === "edit" && /* @__PURE__ */ c("span", { className: "flex items-center gap-x-3", children: [
|
|
5291
|
-
((b = n.type) == null ? void 0 : b.toLowerCase()) !== "spacer" && ((h = n.type) == null ? void 0 : h.toLowerCase()) !== "divider" && /* @__PURE__ */ c(
|
|
5291
|
+
((b = n.type) == null ? void 0 : b.toLowerCase()) !== "spacer" && ((h = n.type) == null ? void 0 : h.toLowerCase()) !== "divider" && /* @__PURE__ */ c(ge, { children: [
|
|
5292
5292
|
n.isDisabled && /* @__PURE__ */ i("span", { className: "px-1.5 py-0.5 text-[10px] font-medium bg-gray-100 text-gray-600 rounded border border-gray-200", children: "Disabled" }),
|
|
5293
5293
|
n.isReadOnly && /* @__PURE__ */ i("span", { className: "px-1.5 py-0.5 text-[10px] font-medium bg-amber-50 text-amber-700 rounded border border-amber-200", children: "Read Only" }),
|
|
5294
5294
|
/* @__PURE__ */ c("label", { className: "flex items-center gap-1 text-xs cursor-pointer text-gray-500 mr-2 hover:text-gray-700 select-none", children: [
|
|
@@ -5316,7 +5316,7 @@ const wo = O.object().shape({
|
|
|
5316
5316
|
typeof d == "function" && d(n == null ? void 0 : n.id, n.sectionId);
|
|
5317
5317
|
},
|
|
5318
5318
|
title: "Duplicate",
|
|
5319
|
-
children: /* @__PURE__ */ i(
|
|
5319
|
+
children: /* @__PURE__ */ i(J, { icon: "solar:copy-outline", iconClass: "text-base" })
|
|
5320
5320
|
}
|
|
5321
5321
|
),
|
|
5322
5322
|
/* @__PURE__ */ i(
|
|
@@ -5328,7 +5328,7 @@ const wo = O.object().shape({
|
|
|
5328
5328
|
typeof m == "function" && m(n == null ? void 0 : n.id, n.sectionId);
|
|
5329
5329
|
},
|
|
5330
5330
|
title: "Copy to Clipboard",
|
|
5331
|
-
children: /* @__PURE__ */ i(
|
|
5331
|
+
children: /* @__PURE__ */ i(J, { icon: "lucide:clipboard-copy", iconClass: "text-base" })
|
|
5332
5332
|
}
|
|
5333
5333
|
),
|
|
5334
5334
|
/* @__PURE__ */ i(
|
|
@@ -5338,7 +5338,7 @@ const wo = O.object().shape({
|
|
|
5338
5338
|
className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
|
|
5339
5339
|
onClick: () => o(!0),
|
|
5340
5340
|
title: "Edit",
|
|
5341
|
-
children: /* @__PURE__ */ i(
|
|
5341
|
+
children: /* @__PURE__ */ i(J, { icon: "circum:edit", iconClass: "text-base" })
|
|
5342
5342
|
}
|
|
5343
5343
|
),
|
|
5344
5344
|
/* @__PURE__ */ i(
|
|
@@ -5348,7 +5348,7 @@ const wo = O.object().shape({
|
|
|
5348
5348
|
className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
|
|
5349
5349
|
onClick: t,
|
|
5350
5350
|
title: "Remove",
|
|
5351
|
-
children: /* @__PURE__ */ i(
|
|
5351
|
+
children: /* @__PURE__ */ i(J, { icon: "iconamoon:trash", iconClass: "text-base" })
|
|
5352
5352
|
}
|
|
5353
5353
|
)
|
|
5354
5354
|
] })
|
|
@@ -5393,7 +5393,7 @@ const Eo = ({
|
|
|
5393
5393
|
placeholder: o = "Select time",
|
|
5394
5394
|
is24Hour: l = !1
|
|
5395
5395
|
}) => {
|
|
5396
|
-
const [d, u] = G(e || null), m =
|
|
5396
|
+
const [d, u] = G(e || null), m = ye("config"), r = (m == null ? void 0 : m.buttonColor) || "#7F56D9";
|
|
5397
5397
|
j(() => {
|
|
5398
5398
|
e !== d && u(e || null);
|
|
5399
5399
|
}, [e]);
|
|
@@ -5423,7 +5423,7 @@ const Eo = ({
|
|
|
5423
5423
|
scrollbar-width: none;
|
|
5424
5424
|
}
|
|
5425
5425
|
` }),
|
|
5426
|
-
/* @__PURE__ */ i(mi, { className: "relative w-full", children: ({ open: g }) => /* @__PURE__ */ c(
|
|
5426
|
+
/* @__PURE__ */ i(mi, { className: "relative w-full", children: ({ open: g }) => /* @__PURE__ */ c(ge, { children: [
|
|
5427
5427
|
/* @__PURE__ */ c(
|
|
5428
5428
|
mi.Button,
|
|
5429
5429
|
{
|
|
@@ -5435,7 +5435,7 @@ const Eo = ({
|
|
|
5435
5435
|
),
|
|
5436
5436
|
children: [
|
|
5437
5437
|
/* @__PURE__ */ i("span", { children: d || o }),
|
|
5438
|
-
/* @__PURE__ */ i(
|
|
5438
|
+
/* @__PURE__ */ i(J, { icon: "mdi:clock-outline", iconClass: "text-gray-400 text-lg inline" })
|
|
5439
5439
|
]
|
|
5440
5440
|
}
|
|
5441
5441
|
),
|
|
@@ -5572,7 +5572,7 @@ function Po({ element: e, validationData: n }) {
|
|
|
5572
5572
|
};
|
|
5573
5573
|
}
|
|
5574
5574
|
}, [u, e.id]);
|
|
5575
|
-
const m =
|
|
5575
|
+
const m = ae(
|
|
5576
5576
|
(b) => {
|
|
5577
5577
|
l == null || l(e.id, b), s(b);
|
|
5578
5578
|
},
|
|
@@ -5593,7 +5593,7 @@ function Po({ element: e, validationData: n }) {
|
|
|
5593
5593
|
maxFileSize: (e == null ? void 0 : e.maxFileSize) || 5
|
|
5594
5594
|
}
|
|
5595
5595
|
),
|
|
5596
|
-
d && /* @__PURE__ */ i(
|
|
5596
|
+
d && /* @__PURE__ */ i(ge, { children: a ? /* @__PURE__ */ i("div", { className: "relative grid gap-y-1 flex-1 w-full", children: typeof a == "object" && Array.isArray(a) && a.map(
|
|
5597
5597
|
(b, h) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
5598
5598
|
Tn,
|
|
5599
5599
|
{
|
|
@@ -5604,7 +5604,7 @@ function Po({ element: e, validationData: n }) {
|
|
|
5604
5604
|
) }) : /* @__PURE__ */ i("span", { className: "field-control !bg-gray-50 w-full !text-gray-400 !text-sm !italic ", children: "No File Uploaded" }) })
|
|
5605
5605
|
] });
|
|
5606
5606
|
}
|
|
5607
|
-
function
|
|
5607
|
+
function Do({
|
|
5608
5608
|
element: e,
|
|
5609
5609
|
validationData: n
|
|
5610
5610
|
}) {
|
|
@@ -5625,7 +5625,7 @@ function Ro({
|
|
|
5625
5625
|
}
|
|
5626
5626
|
);
|
|
5627
5627
|
}
|
|
5628
|
-
function
|
|
5628
|
+
function Ro({
|
|
5629
5629
|
element: e,
|
|
5630
5630
|
validationData: n
|
|
5631
5631
|
}) {
|
|
@@ -5633,7 +5633,7 @@ function Do({
|
|
|
5633
5633
|
const { register: a = () => ({}), watch: s } = n || {};
|
|
5634
5634
|
return /* @__PURE__ */ i("div", { className: $("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
|
|
5635
5635
|
(l) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
5636
|
-
|
|
5636
|
+
_,
|
|
5637
5637
|
{
|
|
5638
5638
|
placeholder: e.placeholder,
|
|
5639
5639
|
type: e.inputType,
|
|
@@ -5658,7 +5658,7 @@ function Oo({
|
|
|
5658
5658
|
const { register: a = () => ({}), watch: s } = n || {};
|
|
5659
5659
|
return /* @__PURE__ */ i("div", { className: $("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
|
|
5660
5660
|
(l) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
5661
|
-
|
|
5661
|
+
_,
|
|
5662
5662
|
{
|
|
5663
5663
|
placeholder: e.placeholder,
|
|
5664
5664
|
type: e.inputType,
|
|
@@ -5684,32 +5684,32 @@ function ei({
|
|
|
5684
5684
|
name: u,
|
|
5685
5685
|
customClass: m
|
|
5686
5686
|
}) {
|
|
5687
|
-
const [r, t] = G(null), [b, h] = G([]), [x, f] = G(!1), p =
|
|
5687
|
+
const [r, t] = G(null), [b, h] = G([]), [x, f] = G(!1), p = fe(!0);
|
|
5688
5688
|
j(() => {
|
|
5689
5689
|
const y = new AbortController(), A = a != null ? a : s;
|
|
5690
5690
|
let k = "";
|
|
5691
5691
|
r !== null ? k = r : A && (k = String(A));
|
|
5692
5692
|
const C = async () => {
|
|
5693
|
-
var
|
|
5693
|
+
var D, Z;
|
|
5694
5694
|
if (n) {
|
|
5695
5695
|
f(!0);
|
|
5696
5696
|
try {
|
|
5697
|
-
const Q =
|
|
5697
|
+
const Q = ye("token"), H = {
|
|
5698
5698
|
...Q ? { headers: { Authorization: `Bearer ${Q}` } } : {},
|
|
5699
5699
|
signal: y.signal,
|
|
5700
5700
|
params: k ? { search: k } : {}
|
|
5701
5701
|
};
|
|
5702
|
-
let U = (await Fe.get(n,
|
|
5703
|
-
if (U && !Array.isArray(U) && (U.data && Array.isArray(U.data) ? U = U.data : (
|
|
5702
|
+
let U = (await Fe.get(n, H)).data;
|
|
5703
|
+
if (U && !Array.isArray(U) && (U.data && Array.isArray(U.data) ? U = U.data : (D = U.data) != null && D.data && Array.isArray(U.data.data) ? U = U.data.data : U.results && Array.isArray(U.results) ? U = U.results : (Z = U.data) != null && Z.results && Array.isArray(U.data.results) ? U = U.data.results : U.items && Array.isArray(U.items) && (U = U.items)), Array.isArray(U)) {
|
|
5704
5704
|
const X = U.map((Y) => {
|
|
5705
|
-
var
|
|
5705
|
+
var ce, W, he, xe, te, Te, De, Re, Ie, q, T, K, L, R;
|
|
5706
5706
|
if (typeof Y == "string") return { label: Y, value: Y };
|
|
5707
|
-
const ke = (Ie = (Te = (
|
|
5708
|
-
(
|
|
5707
|
+
const ke = (Ie = (Te = (te = (xe = (he = (W = (ce = Y.label) != null ? ce : Y.name) != null ? W : Y.title) != null ? he : Y.productName) != null ? xe : Y.description) != null ? te : Y.text) != null ? Te : Y.displayName) != null ? Ie : String((Re = (De = Y.id) != null ? De : Y.value) != null ? Re : ""), pe = String(
|
|
5708
|
+
(R = (L = (K = (T = (q = Y.value) != null ? q : Y.id) != null ? T : Y.key) != null ? K : Y.code) != null ? L : Y.name) != null ? R : ""
|
|
5709
5709
|
);
|
|
5710
5710
|
return {
|
|
5711
5711
|
label: String(ke),
|
|
5712
|
-
value: String(
|
|
5712
|
+
value: String(pe)
|
|
5713
5713
|
};
|
|
5714
5714
|
});
|
|
5715
5715
|
h(X);
|
|
@@ -5729,7 +5729,7 @@ function ei({
|
|
|
5729
5729
|
clearTimeout(B), y.abort();
|
|
5730
5730
|
};
|
|
5731
5731
|
}, [n, r, a, s]);
|
|
5732
|
-
const S = n ? b : e, N =
|
|
5732
|
+
const S = n ? b : e, N = ue(() => {
|
|
5733
5733
|
const y = a != null ? a : s;
|
|
5734
5734
|
if (y == null || y === "") return null;
|
|
5735
5735
|
const A = S.find(
|
|
@@ -5758,7 +5758,7 @@ function ei({
|
|
|
5758
5758
|
}));
|
|
5759
5759
|
}
|
|
5760
5760
|
}, [a, s, o, S]);
|
|
5761
|
-
const w =
|
|
5761
|
+
const w = ue(() => {
|
|
5762
5762
|
let y = S;
|
|
5763
5763
|
if (g && !y.some(
|
|
5764
5764
|
(k) => String(k.value) === String(g.value) || String(k.label) === String(g.label)
|
|
@@ -5767,7 +5767,7 @@ function ei({
|
|
|
5767
5767
|
return y.filter(
|
|
5768
5768
|
(k) => k.label.toLowerCase().includes(A)
|
|
5769
5769
|
);
|
|
5770
|
-
}, [r, S, g]), M =
|
|
5770
|
+
}, [r, S, g]), M = ae(
|
|
5771
5771
|
(y) => {
|
|
5772
5772
|
v(y), l(u, y);
|
|
5773
5773
|
},
|
|
@@ -5826,7 +5826,7 @@ function ei({
|
|
|
5826
5826
|
)
|
|
5827
5827
|
]
|
|
5828
5828
|
}
|
|
5829
|
-
) : /* @__PURE__ */ i(
|
|
5829
|
+
) : /* @__PURE__ */ i(J, { icon: "octicon:chevron-down-12" }) })
|
|
5830
5830
|
] }),
|
|
5831
5831
|
/* @__PURE__ */ i(
|
|
5832
5832
|
Vn,
|
|
@@ -5872,7 +5872,7 @@ function Ko({
|
|
|
5872
5872
|
a(e.id);
|
|
5873
5873
|
}, [e.id, a]);
|
|
5874
5874
|
const r = d ? e.apiUrl : void 0;
|
|
5875
|
-
return /* @__PURE__ */ i(
|
|
5875
|
+
return /* @__PURE__ */ i(ge, { children: e.selectType === "list" && !d ? /* @__PURE__ */ i(
|
|
5876
5876
|
Ve,
|
|
5877
5877
|
{
|
|
5878
5878
|
options: (h = e == null ? void 0 : e.options) != null ? h : [],
|
|
@@ -5938,7 +5938,7 @@ function jo({
|
|
|
5938
5938
|
return j(() => {
|
|
5939
5939
|
m && typeof o == "function" && o(e.id, r);
|
|
5940
5940
|
}, [r, m, e.id, o]), /* @__PURE__ */ i(
|
|
5941
|
-
|
|
5941
|
+
_,
|
|
5942
5942
|
{
|
|
5943
5943
|
placeholder: e.placeholder,
|
|
5944
5944
|
type: e.inputType,
|
|
@@ -6061,43 +6061,43 @@ function Uo({
|
|
|
6061
6061
|
j(() => {
|
|
6062
6062
|
a(e.id);
|
|
6063
6063
|
}, [e.id, a]);
|
|
6064
|
-
const { url: N, method: g, responseType: v } = e || {}, w =
|
|
6064
|
+
const { url: N, method: g, responseType: v } = e || {}, w = fe(null), M = ae(
|
|
6065
6065
|
async (A) => {
|
|
6066
|
-
var C, E, B,
|
|
6066
|
+
var C, E, B, D, Z, Q, H, ie, U, X, Y, ke, pe, ce;
|
|
6067
6067
|
if (!N || typeof N != "string" || !N.trim() || !g) return;
|
|
6068
6068
|
w.current && w.current.abort();
|
|
6069
6069
|
const k = new AbortController();
|
|
6070
6070
|
w.current = k, m(!0), h(""), t(!1);
|
|
6071
6071
|
try {
|
|
6072
6072
|
let W;
|
|
6073
|
-
const
|
|
6073
|
+
const he = {
|
|
6074
6074
|
headers: {
|
|
6075
|
-
Authorization: `Bearer ${
|
|
6075
|
+
Authorization: `Bearer ${ye("token")}`
|
|
6076
6076
|
},
|
|
6077
6077
|
signal: k.signal
|
|
6078
6078
|
};
|
|
6079
6079
|
if (g.toLowerCase() === "get") {
|
|
6080
|
-
const
|
|
6081
|
-
W = await Fe.get(
|
|
6080
|
+
const xe = `${N}?value=${A}`;
|
|
6081
|
+
W = await Fe.get(xe, he);
|
|
6082
6082
|
} else if (g.toLowerCase() === "post")
|
|
6083
|
-
W = await Fe.post(N, { value: A },
|
|
6083
|
+
W = await Fe.post(N, { value: A }, he);
|
|
6084
6084
|
else
|
|
6085
6085
|
throw new Error("Unsupported HTTP method");
|
|
6086
6086
|
if (W.status === 200)
|
|
6087
6087
|
if (((E = (C = W == null ? void 0 : W.data) == null ? void 0 : C.data) == null ? void 0 : E.status) === !1 || ((B = W == null ? void 0 : W.data) == null ? void 0 : B.status) === !1)
|
|
6088
6088
|
console.error("Invalid input:", A), h("Unable to validate input"), t(!1);
|
|
6089
6089
|
else if (t(!0), v === "string") {
|
|
6090
|
-
let
|
|
6091
|
-
typeof
|
|
6090
|
+
let te = ((Z = (D = W == null ? void 0 : W.data) == null ? void 0 : D.data) == null ? void 0 : Z.description) || ((Q = W == null ? void 0 : W.data) == null ? void 0 : Q.description) || ((H = W == null ? void 0 : W.data) == null ? void 0 : H.data) || (W == null ? void 0 : W.data) || "Validation successful";
|
|
6091
|
+
typeof te == "object" && te !== null && (te = JSON.stringify(te)), h(te);
|
|
6092
6092
|
} else {
|
|
6093
|
-
const
|
|
6094
|
-
S(
|
|
6093
|
+
const te = ((U = (ie = W == null ? void 0 : W.data) == null ? void 0 : ie.data) == null ? void 0 : U.description) || ((X = W == null ? void 0 : W.data) == null ? void 0 : X.description) || ((Y = W == null ? void 0 : W.data) == null ? void 0 : Y.data) || (W == null ? void 0 : W.data) || {};
|
|
6094
|
+
S(te), typeof te == "object" && te !== null && typeof s == "function" && s(`${e == null ? void 0 : e.id}_metaData`, te);
|
|
6095
6095
|
}
|
|
6096
6096
|
} catch (W) {
|
|
6097
6097
|
if (!Fe.isCancel(W)) {
|
|
6098
6098
|
console.error("Error validating input:", W);
|
|
6099
|
-
let
|
|
6100
|
-
typeof
|
|
6099
|
+
let he = ((pe = (ke = W == null ? void 0 : W.response) == null ? void 0 : ke.data) == null ? void 0 : pe.message) || ((ce = W == null ? void 0 : W.response) == null ? void 0 : ce.data) || "Unable to validate input";
|
|
6100
|
+
typeof he == "object" && he !== null && (he = JSON.stringify(he)), h(he), t(!1);
|
|
6101
6101
|
}
|
|
6102
6102
|
} finally {
|
|
6103
6103
|
w.current === k && m(!1);
|
|
@@ -6164,7 +6164,7 @@ function Uo({
|
|
|
6164
6164
|
}
|
|
6165
6165
|
)
|
|
6166
6166
|
] }),
|
|
6167
|
-
r && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(
|
|
6167
|
+
r && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(J, { icon: "gg:check-o" }) })
|
|
6168
6168
|
] })
|
|
6169
6169
|
] }),
|
|
6170
6170
|
b && v === "string" && /* @__PURE__ */ i(
|
|
@@ -6207,7 +6207,7 @@ function Wo({
|
|
|
6207
6207
|
function u(r, t) {
|
|
6208
6208
|
return parseFloat(r) * parseFloat(t) || 0;
|
|
6209
6209
|
}
|
|
6210
|
-
const m =
|
|
6210
|
+
const m = ue(
|
|
6211
6211
|
() => o.reduce((r, t) => {
|
|
6212
6212
|
const b = u(t.key, t.value);
|
|
6213
6213
|
return r + b;
|
|
@@ -6308,7 +6308,7 @@ function $o({
|
|
|
6308
6308
|
validationData: a
|
|
6309
6309
|
}) {
|
|
6310
6310
|
const { watch: s } = a || {}, o = e.valueSource === "field" && e.sourceFieldId, l = o && typeof s == "function" ? s(e.sourceFieldId) : void 0;
|
|
6311
|
-
return /* @__PURE__ */ i(
|
|
6311
|
+
return /* @__PURE__ */ i(ge, { children: /* @__PURE__ */ i("div", { className: e == null ? void 0 : e.customClass, children: o ? l || n === "edit" && /* @__PURE__ */ i("span", { className: "text-gray-400", children: "Empty dynamic text" }) : (e == null ? void 0 : e.value) || n === "edit" && /* @__PURE__ */ i("span", { className: "text-gray-400", children: "Provide text" }) }) });
|
|
6312
6312
|
}
|
|
6313
6313
|
function Yo({
|
|
6314
6314
|
row: e,
|
|
@@ -6420,7 +6420,7 @@ function Yo({
|
|
|
6420
6420
|
onClick: () => l(e.id),
|
|
6421
6421
|
className: "text-red-500 hover:text-red-700",
|
|
6422
6422
|
"aria-label": "Delete row",
|
|
6423
|
-
children: /* @__PURE__ */ i(
|
|
6423
|
+
children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone", iconClass: "text-xl" })
|
|
6424
6424
|
}
|
|
6425
6425
|
) })
|
|
6426
6426
|
] });
|
|
@@ -6432,11 +6432,11 @@ function Qo({
|
|
|
6432
6432
|
isReadOnly: a = !1,
|
|
6433
6433
|
columns: s
|
|
6434
6434
|
}) {
|
|
6435
|
-
const [o, l] = G(e), d =
|
|
6435
|
+
const [o, l] = G(e), d = ye("config"), u = fe(o);
|
|
6436
6436
|
u.current = o, j(() => {
|
|
6437
6437
|
l((h) => JSON.stringify(h) !== JSON.stringify(e) ? e : h);
|
|
6438
6438
|
}, [e]);
|
|
6439
|
-
const m =
|
|
6439
|
+
const m = ae(
|
|
6440
6440
|
(h, x, f) => {
|
|
6441
6441
|
const p = u.current.map(
|
|
6442
6442
|
(S) => S.id === x ? { ...S, [f]: h } : S
|
|
@@ -6444,16 +6444,16 @@ function Qo({
|
|
|
6444
6444
|
l(p), n == null || n(p);
|
|
6445
6445
|
},
|
|
6446
6446
|
[n]
|
|
6447
|
-
), r =
|
|
6447
|
+
), r = ae(() => {
|
|
6448
6448
|
const h = Ce(), x = s.reduce((p, S) => (p[S.field] = S.field === "id" ? h : "", p), {}), f = [...u.current, { id: h, ...x }];
|
|
6449
6449
|
l(f), n == null || n(f);
|
|
6450
|
-
}, [s, n]), t =
|
|
6450
|
+
}, [s, n]), t = ae(
|
|
6451
6451
|
(h) => {
|
|
6452
6452
|
const x = u.current.filter((f) => f.id !== h);
|
|
6453
6453
|
l(x), n == null || n(x);
|
|
6454
6454
|
},
|
|
6455
6455
|
[n]
|
|
6456
|
-
), b =
|
|
6456
|
+
), b = ae(
|
|
6457
6457
|
() => ({
|
|
6458
6458
|
isValidating: !1,
|
|
6459
6459
|
result: void 0
|
|
@@ -6525,9 +6525,9 @@ function Xo({
|
|
|
6525
6525
|
j(() => {
|
|
6526
6526
|
a(e.id);
|
|
6527
6527
|
}, [e.id, a]);
|
|
6528
|
-
const m =
|
|
6528
|
+
const m = fe(""), r = fe(e == null ? void 0 : e.id), t = fe(e == null ? void 0 : e.dataColumns), b = fe(s);
|
|
6529
6529
|
r.current = e == null ? void 0 : e.id, t.current = e == null ? void 0 : e.dataColumns, b.current = s;
|
|
6530
|
-
const h =
|
|
6530
|
+
const h = ae((f) => {
|
|
6531
6531
|
var S;
|
|
6532
6532
|
const p = JSON.stringify(f);
|
|
6533
6533
|
p !== m.current && (m.current = p, (S = b.current) == null || S.call(b, r.current, {
|
|
@@ -6563,7 +6563,7 @@ const on = ({
|
|
|
6563
6563
|
loading: f,
|
|
6564
6564
|
disabled: p
|
|
6565
6565
|
}) => {
|
|
6566
|
-
const [S, N] = G(t ? [] : null), g = $("custom-select__control", e), v =
|
|
6566
|
+
const [S, N] = G(t ? [] : null), g = $("custom-select__control", e), v = ue(() => n, [n]);
|
|
6567
6567
|
j(() => {
|
|
6568
6568
|
const M = n == null ? void 0 : n.find((y) => {
|
|
6569
6569
|
var A;
|
|
@@ -6571,7 +6571,7 @@ const on = ({
|
|
|
6571
6571
|
});
|
|
6572
6572
|
N(M || null);
|
|
6573
6573
|
}, [m, n]);
|
|
6574
|
-
const w =
|
|
6574
|
+
const w = ue(() => m == null || m === "" || !n || n.length === 0 ? !1 : t && Array.isArray(m) ? Array.isArray(S) && S.length < m.length : !n.some((y) => {
|
|
6575
6575
|
var A;
|
|
6576
6576
|
return typeof y.value == "string" && typeof m == "string" ? y.value.toLowerCase() === m.toLowerCase() : typeof y.value == "object" && typeof m == "object" ? ((A = y.value) == null ? void 0 : A.id) === (m == null ? void 0 : m.id) : y.value === m;
|
|
6577
6577
|
}), [m, n, S, t]);
|
|
@@ -6581,19 +6581,19 @@ const on = ({
|
|
|
6581
6581
|
u && !b && /* @__PURE__ */ i("label", { className: "custom-select__label", children: u }),
|
|
6582
6582
|
b && u && /* @__PURE__ */ i("label", { className: $("custom-select__floating-label", x), children: u }),
|
|
6583
6583
|
/* @__PURE__ */ i(
|
|
6584
|
-
|
|
6584
|
+
be,
|
|
6585
6585
|
{
|
|
6586
6586
|
value: S,
|
|
6587
6587
|
onChange: N,
|
|
6588
6588
|
multiple: t,
|
|
6589
6589
|
disabled: p,
|
|
6590
6590
|
children: /* @__PURE__ */ c("div", { className: "custom-select__wrapper", children: [
|
|
6591
|
-
/* @__PURE__ */ c(
|
|
6591
|
+
/* @__PURE__ */ c(be.Button, { className: g, disabled: p, children: [
|
|
6592
6592
|
f ? /* @__PURE__ */ i("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ i("span", { className: "custom-select__value", children: (S == null ? void 0 : S.label) || /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a }) }),
|
|
6593
|
-
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(
|
|
6593
|
+
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) })
|
|
6594
6594
|
] }),
|
|
6595
|
-
/* @__PURE__ */ i(je, { as:
|
|
6596
|
-
|
|
6595
|
+
/* @__PURE__ */ i(je, { as: me.Fragment, leave: "custom-select__transition", children: /* @__PURE__ */ i(be.Options, { className: "custom-select__options", anchor: "bottom", children: v == null ? void 0 : v.map((M, y) => /* @__PURE__ */ i(
|
|
6596
|
+
be.Option,
|
|
6597
6597
|
{
|
|
6598
6598
|
value: M,
|
|
6599
6599
|
className: ({ active: A }) => $(
|
|
@@ -6650,7 +6650,7 @@ const on = ({
|
|
|
6650
6650
|
}
|
|
6651
6651
|
}
|
|
6652
6652
|
}, [l, u]);
|
|
6653
|
-
const f =
|
|
6653
|
+
const f = ue(
|
|
6654
6654
|
() => {
|
|
6655
6655
|
var S;
|
|
6656
6656
|
return (S = e.options1) == null ? void 0 : S.filter((N) => N.key === m);
|
|
@@ -6786,13 +6786,13 @@ function sn({
|
|
|
6786
6786
|
trigger: o,
|
|
6787
6787
|
isReadOnly: l,
|
|
6788
6788
|
watch: d
|
|
6789
|
-
} = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: m, state: r } =
|
|
6789
|
+
} = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: m, state: r } = ue(() => {
|
|
6790
6790
|
if (typeof u == "string" && u.includes(",")) {
|
|
6791
6791
|
const [f, p] = u.split(",").map((S) => S.trim());
|
|
6792
6792
|
return { country: p, state: f };
|
|
6793
6793
|
}
|
|
6794
6794
|
return { country: u, state: "" };
|
|
6795
|
-
}, [u]), t =
|
|
6795
|
+
}, [u]), t = fe(u), b = ue(() => {
|
|
6796
6796
|
var f, p;
|
|
6797
6797
|
return m ? ((p = (f = oi.find((S) => S.name === m)) == null ? void 0 : f.states) == null ? void 0 : p.map((S) => ({
|
|
6798
6798
|
label: S.name,
|
|
@@ -7098,31 +7098,31 @@ function as({
|
|
|
7098
7098
|
onChange: h,
|
|
7099
7099
|
onError: x
|
|
7100
7100
|
}) {
|
|
7101
|
-
const [f, p] = G(""), [S, N] = G(null), [g, v] = G(""), w =
|
|
7101
|
+
const [f, p] = G(""), [S, N] = G(null), [g, v] = G(""), w = ue(
|
|
7102
7102
|
() => {
|
|
7103
7103
|
var B;
|
|
7104
|
-
return (B = fi == null ? void 0 : fi.slice().sort((
|
|
7104
|
+
return (B = fi == null ? void 0 : fi.slice().sort((D, Z) => D.label.localeCompare(Z.label))) == null ? void 0 : B.map((D) => ({ ...D, phone: `+${D.phone}` }));
|
|
7105
7105
|
},
|
|
7106
7106
|
[]
|
|
7107
|
-
), M =
|
|
7107
|
+
), M = ue(() => f ? w.filter(
|
|
7108
7108
|
(B) => `${B.label} ${B.phone}`.toLowerCase().includes(f.toLowerCase())
|
|
7109
7109
|
) : w, [f, w]), y = (S == null ? void 0 : S.min) || 10, A = (S == null ? void 0 : S.max) || 10, k = () => g ? `${(S == null ? void 0 : S.phone) || "+234"}-${g}` : "", C = (B) => {
|
|
7110
7110
|
if (!B || typeof B != "string") return { code: "+234", number: "" };
|
|
7111
|
-
const
|
|
7112
|
-
return { code:
|
|
7111
|
+
const D = B.split(/[-\s]/);
|
|
7112
|
+
return { code: D[0], number: D.slice(1).join(" ") };
|
|
7113
7113
|
};
|
|
7114
7114
|
j(() => {
|
|
7115
7115
|
if (d) {
|
|
7116
7116
|
const B = k();
|
|
7117
7117
|
if (d !== B) {
|
|
7118
|
-
const
|
|
7118
|
+
const D = C(d);
|
|
7119
7119
|
N(
|
|
7120
|
-
w.find((Z) => Z.phone ===
|
|
7121
|
-
), v(
|
|
7120
|
+
w.find((Z) => Z.phone === D.code) || w[0]
|
|
7121
|
+
), v(D.number);
|
|
7122
7122
|
}
|
|
7123
7123
|
}
|
|
7124
7124
|
}, [d, w]);
|
|
7125
|
-
const E =
|
|
7125
|
+
const E = ue(() => {
|
|
7126
7126
|
if (u) return u;
|
|
7127
7127
|
const B = g.length;
|
|
7128
7128
|
return s && B === 0 ? "Phone number is required" : B > 0 && !/^\d+$/.test(g) ? "Phone number must contain only digits" : B > 0 && B < y ? `Minimum length is ${y}` : B > A ? `Maximum length is ${A}` : "";
|
|
@@ -7151,7 +7151,7 @@ function as({
|
|
|
7151
7151
|
}
|
|
7152
7152
|
),
|
|
7153
7153
|
/* @__PURE__ */ c("div", { className: "relative !flex items-center input-control text-[#667085] !py-0 field-control", children: [
|
|
7154
|
-
/* @__PURE__ */ i(
|
|
7154
|
+
/* @__PURE__ */ i(J, { icon: "lucide:phone-call" }),
|
|
7155
7155
|
/* @__PURE__ */ i(Le, { value: S, onChange: N, children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
7156
7156
|
/* @__PURE__ */ i(
|
|
7157
7157
|
Le.Input,
|
|
@@ -7162,8 +7162,8 @@ function as({
|
|
|
7162
7162
|
onChange: (B) => p(B.target.value)
|
|
7163
7163
|
}
|
|
7164
7164
|
),
|
|
7165
|
-
/* @__PURE__ */ i(Le.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(
|
|
7166
|
-
/* @__PURE__ */ i(Le.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: M == null ? void 0 : M.map((B,
|
|
7165
|
+
/* @__PURE__ */ i(Le.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(J, { icon: "lucide:chevron-down" }) }),
|
|
7166
|
+
/* @__PURE__ */ i(Le.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: M == null ? void 0 : M.map((B, D) => /* @__PURE__ */ c(
|
|
7167
7167
|
Le.Option,
|
|
7168
7168
|
{
|
|
7169
7169
|
value: B,
|
|
@@ -7174,7 +7174,7 @@ function as({
|
|
|
7174
7174
|
B.label
|
|
7175
7175
|
]
|
|
7176
7176
|
},
|
|
7177
|
-
`${B.code}+ ${
|
|
7177
|
+
`${B.code}+ ${D}`
|
|
7178
7178
|
)) })
|
|
7179
7179
|
] }) }),
|
|
7180
7180
|
/* @__PURE__ */ c("div", { className: "relative flex items-center flex-1 z-[1]", children: [
|
|
@@ -7187,8 +7187,8 @@ function as({
|
|
|
7187
7187
|
disabled: m,
|
|
7188
7188
|
readOnly: r,
|
|
7189
7189
|
onChange: (B) => {
|
|
7190
|
-
const
|
|
7191
|
-
v(
|
|
7190
|
+
const D = B.target.value.replace(/\D/g, "");
|
|
7191
|
+
v(D);
|
|
7192
7192
|
},
|
|
7193
7193
|
placeholder: n,
|
|
7194
7194
|
className: "w-full px-3 outline-none",
|
|
@@ -7196,7 +7196,7 @@ function as({
|
|
|
7196
7196
|
minLength: y
|
|
7197
7197
|
}
|
|
7198
7198
|
),
|
|
7199
|
-
/* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !E && g.length > 0 && !r && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(
|
|
7199
|
+
/* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !E && g.length > 0 && !r && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(J, { icon: "bi:check-lg" }) }) })
|
|
7200
7200
|
] })
|
|
7201
7201
|
] }),
|
|
7202
7202
|
b && /* @__PURE__ */ i("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: b })
|
|
@@ -7296,13 +7296,13 @@ function ls({
|
|
|
7296
7296
|
validationData: n
|
|
7297
7297
|
}) {
|
|
7298
7298
|
var m;
|
|
7299
|
-
const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l =
|
|
7299
|
+
const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l = ue(() => {
|
|
7300
7300
|
const t = (o.match(/\{\{([^{}]+)\}\}/g) || []).map((x) => x.replace(/[{}]/g, "")), h = (o.match(/@\[.*?\]\((.*?)\)/g) || []).map((x) => {
|
|
7301
7301
|
const f = /@\[.*?\]\((.*?)\)/.exec(x);
|
|
7302
7302
|
return f ? f[1] : "";
|
|
7303
7303
|
}).filter(Boolean);
|
|
7304
7304
|
return Array.from(/* @__PURE__ */ new Set([...t, ...h]));
|
|
7305
|
-
}, [o]), d = a ? a(l) : [], u =
|
|
7305
|
+
}, [o]), d = a ? a(l) : [], u = ue(() => {
|
|
7306
7306
|
if (!o) return "";
|
|
7307
7307
|
let r = o, t = !1;
|
|
7308
7308
|
if (l.forEach((b, h) => {
|
|
@@ -7414,7 +7414,7 @@ function ds({
|
|
|
7414
7414
|
S,
|
|
7415
7415
|
"%"
|
|
7416
7416
|
] }),
|
|
7417
|
-
N && /* @__PURE__ */ i(
|
|
7417
|
+
N && /* @__PURE__ */ i(J, { icon: "material-symbols:check-circle", iconClass: "text-blue-500 text-lg" })
|
|
7418
7418
|
] }),
|
|
7419
7419
|
/* @__PURE__ */ i(
|
|
7420
7420
|
"input",
|
|
@@ -7497,7 +7497,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7497
7497
|
onClick: () => t(x),
|
|
7498
7498
|
disabled: s || n === "edit" || x === 0,
|
|
7499
7499
|
className: "hover:text-[#6366f1] disabled:opacity-30 disabled:hover:text-gray-400",
|
|
7500
|
-
children: /* @__PURE__ */ i(
|
|
7500
|
+
children: /* @__PURE__ */ i(J, { icon: "mdi:chevron-up", iconClass: "w-5 h-5" })
|
|
7501
7501
|
}
|
|
7502
7502
|
),
|
|
7503
7503
|
/* @__PURE__ */ i(
|
|
@@ -7507,7 +7507,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7507
7507
|
onClick: () => b(x),
|
|
7508
7508
|
disabled: s || n === "edit" || x === m.length - 1,
|
|
7509
7509
|
className: "hover:text-[#6366f1] disabled:opacity-30 disabled:hover:text-gray-400",
|
|
7510
|
-
children: /* @__PURE__ */ i(
|
|
7510
|
+
children: /* @__PURE__ */ i(J, { icon: "mdi:chevron-down", iconClass: "w-5 h-5" })
|
|
7511
7511
|
}
|
|
7512
7512
|
)
|
|
7513
7513
|
] }),
|
|
@@ -7534,7 +7534,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7534
7534
|
u === t.value ? "border-[#6366f1] ring-2 ring-[#6366f1]/20" : "border-gray-100 hover:border-[#6366f1]"
|
|
7535
7535
|
),
|
|
7536
7536
|
children: [
|
|
7537
|
-
/* @__PURE__ */ i("div", { className: "aspect-video bg-gray-50 flex items-center justify-center text-gray-300 relative", children: t.imageUrl ? /* @__PURE__ */ i("img", { src: t.imageUrl, alt: t.label, className: "absolute inset-0 w-full h-full object-cover" }) : /* @__PURE__ */ i(
|
|
7537
|
+
/* @__PURE__ */ i("div", { className: "aspect-video bg-gray-50 flex items-center justify-center text-gray-300 relative", children: t.imageUrl ? /* @__PURE__ */ i("img", { src: t.imageUrl, alt: t.label, className: "absolute inset-0 w-full h-full object-cover" }) : /* @__PURE__ */ i(J, { icon: "mdi:image-outline", iconClass: "w-12 h-12 group-hover:text-[#6366f1] transition-colors" }) }),
|
|
7538
7538
|
/* @__PURE__ */ i("div", { className: $(
|
|
7539
7539
|
"p-3 text-center text-sm font-medium",
|
|
7540
7540
|
u === t.value ? "bg-[#6366f1] text-white" : "bg-white text-gray-700"
|
|
@@ -7554,9 +7554,9 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7554
7554
|
amountField: jo,
|
|
7555
7555
|
date: Bo,
|
|
7556
7556
|
time: Lo,
|
|
7557
|
-
password:
|
|
7557
|
+
password: Do,
|
|
7558
7558
|
checkbox: Oo,
|
|
7559
|
-
radio:
|
|
7559
|
+
radio: Ro,
|
|
7560
7560
|
email: gi,
|
|
7561
7561
|
file: Po,
|
|
7562
7562
|
dataGrid: Xo,
|
|
@@ -7618,7 +7618,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7618
7618
|
moveElement: r,
|
|
7619
7619
|
isDragging: t,
|
|
7620
7620
|
removeElement: b
|
|
7621
|
-
} = Pe(we), h =
|
|
7621
|
+
} = Pe(we), h = ue(
|
|
7622
7622
|
() => Array.from({ length: e.columns }),
|
|
7623
7623
|
[e.columns]
|
|
7624
7624
|
), [x, f] = G(null);
|
|
@@ -7628,23 +7628,23 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7628
7628
|
};
|
|
7629
7629
|
return document.addEventListener("dragend", w), () => document.removeEventListener("dragend", w);
|
|
7630
7630
|
}, [m]);
|
|
7631
|
-
const p =
|
|
7631
|
+
const p = ae(
|
|
7632
7632
|
(w, M) => {
|
|
7633
7633
|
w.preventDefault(), w.stopPropagation(), w.dataTransfer.dropEffect = "move", f(M);
|
|
7634
7634
|
},
|
|
7635
7635
|
[]
|
|
7636
|
-
), S =
|
|
7636
|
+
), S = ae(
|
|
7637
7637
|
(w, M) => {
|
|
7638
7638
|
w.preventDefault(), w.stopPropagation(), f(M);
|
|
7639
7639
|
},
|
|
7640
7640
|
[]
|
|
7641
|
-
), N =
|
|
7641
|
+
), N = ae(
|
|
7642
7642
|
(w, M) => {
|
|
7643
7643
|
const y = w.relatedTarget;
|
|
7644
7644
|
y && w.currentTarget.contains(y) || f((A) => A === M ? null : A);
|
|
7645
7645
|
},
|
|
7646
7646
|
[]
|
|
7647
|
-
), g =
|
|
7647
|
+
), g = ae(
|
|
7648
7648
|
(w, M) => {
|
|
7649
7649
|
var k;
|
|
7650
7650
|
w.preventDefault(), w.stopPropagation(), m(!1), f(null);
|
|
@@ -7663,13 +7663,13 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7663
7663
|
if (!C) return;
|
|
7664
7664
|
const E = JSON.parse(C);
|
|
7665
7665
|
if ((E == null ? void 0 : E.type) === "grid") return;
|
|
7666
|
-
const B = d.find((Q) => Q.id === n),
|
|
7666
|
+
const B = d.find((Q) => Q.id === n), D = (k = B == null ? void 0 : B.questionData) == null ? void 0 : k.find(
|
|
7667
7667
|
(Q) => {
|
|
7668
|
-
var
|
|
7669
|
-
return !Q.isDeleted && Q.gridId === e.id && ((
|
|
7668
|
+
var H;
|
|
7669
|
+
return !Q.isDeleted && Q.gridId === e.id && ((H = Q.gridPosition) == null ? void 0 : H.col) === y;
|
|
7670
7670
|
}
|
|
7671
7671
|
);
|
|
7672
|
-
|
|
7672
|
+
D && b(D.id, n);
|
|
7673
7673
|
const Z = {
|
|
7674
7674
|
...E,
|
|
7675
7675
|
id: Ce(),
|
|
@@ -7684,8 +7684,8 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7684
7684
|
},
|
|
7685
7685
|
[u, e.id, d, n, m, r]
|
|
7686
7686
|
), v = (w, M, y) => {
|
|
7687
|
-
var
|
|
7688
|
-
const A = w + 1, k = (
|
|
7687
|
+
var H, ie, U;
|
|
7688
|
+
const A = w + 1, k = (ie = (H = d.find((X) => X.id === n)) == null ? void 0 : H.questionData) == null ? void 0 : ie.find(
|
|
7689
7689
|
(X) => {
|
|
7690
7690
|
var Y;
|
|
7691
7691
|
return !X.isDeleted && X.gridId === e.id && ((Y = X.gridPosition) == null ? void 0 : Y.col) === A;
|
|
@@ -7693,7 +7693,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7693
7693
|
), C = (U = k == null ? void 0 : k.id) != null ? U : null, E = Array.isArray(a) && a.find((X) => {
|
|
7694
7694
|
var Y;
|
|
7695
7695
|
return ((Y = X == null ? void 0 : X.props) == null ? void 0 : Y.col) === A;
|
|
7696
|
-
}), B = t && x === w,
|
|
7696
|
+
}), B = t && x === w, D = !!E, Z = t && !!l, Q = D && C && y === "edit" ? {
|
|
7697
7697
|
draggable: !0,
|
|
7698
7698
|
onDragStart: (X) => {
|
|
7699
7699
|
X.stopPropagation(), X.dataTransfer.setData("elementId", C), X.dataTransfer.setData("properties", C), X.dataTransfer.effectAllowed = "move", m(!0);
|
|
@@ -7716,21 +7716,21 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7716
7716
|
"flex items-center justify-center",
|
|
7717
7717
|
"transition-all duration-200 ease-in-out",
|
|
7718
7718
|
y === "edit" ? "py-3 " : "",
|
|
7719
|
-
|
|
7719
|
+
D && y === "edit" && "cursor-grab active:cursor-grabbing border-none",
|
|
7720
7720
|
M,
|
|
7721
7721
|
!Z && !B && "bg-white border-gray-200 text-gray-300",
|
|
7722
|
-
Z && !B && !
|
|
7723
|
-
Z && !B &&
|
|
7724
|
-
B && !
|
|
7725
|
-
B &&
|
|
7722
|
+
Z && !B && !D && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
|
|
7723
|
+
Z && !B && D && "bg-white border-orange-200 border-dashed",
|
|
7724
|
+
B && !D && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
|
|
7725
|
+
B && D && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
|
|
7726
7726
|
),
|
|
7727
7727
|
children: [
|
|
7728
|
-
|
|
7729
|
-
B && !
|
|
7730
|
-
/* @__PURE__ */ i(
|
|
7728
|
+
D && y === "edit" && /* @__PURE__ */ i("div", { className: "absolute top-1 left-1/2 -translate-x-1/2 flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-gray-100 hover:bg-blue-100 text-gray-400 hover:text-blue-500 cursor-grab active:cursor-grabbing transition-colors z-10 opacity-60 hover:opacity-100 pointer-events-none select-none", children: /* @__PURE__ */ i(J, { icon: "ph:dots-six-bold" }) }),
|
|
7729
|
+
B && !D && /* @__PURE__ */ c("span", { className: "absolute inset-0 flex flex-col items-center justify-center gap-1 text-blue-400 text-xs font-medium pointer-events-none", children: [
|
|
7730
|
+
/* @__PURE__ */ i(J, { icon: "ph:plus-bold" }),
|
|
7731
7731
|
"Drop here"
|
|
7732
7732
|
] }),
|
|
7733
|
-
B &&
|
|
7733
|
+
B && D && /* @__PURE__ */ i("span", { className: "absolute top-1 right-1 text-xs text-orange-400 font-medium pointer-events-none px-1 py-0.5 bg-orange-50 rounded", children: "Replace" }),
|
|
7734
7734
|
/* @__PURE__ */ i(
|
|
7735
7735
|
"div",
|
|
7736
7736
|
{
|
|
@@ -7738,7 +7738,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7738
7738
|
"w-full select-none min-w-0",
|
|
7739
7739
|
B && "opacity-50 pointer-events-none"
|
|
7740
7740
|
),
|
|
7741
|
-
children: E || /* @__PURE__ */ i("span", { className: "flex items-center justify-center text-gray-300", children: y === "edit" && /* @__PURE__ */ i(
|
|
7741
|
+
children: E || /* @__PURE__ */ i("span", { className: "flex items-center justify-center text-gray-300", children: y === "edit" && /* @__PURE__ */ i(J, { icon: "ph:plus-bold" }) })
|
|
7742
7742
|
}
|
|
7743
7743
|
)
|
|
7744
7744
|
]
|
|
@@ -7757,7 +7757,7 @@ const us = ({ element: e, state: n, validationData: a }) => {
|
|
|
7757
7757
|
)
|
|
7758
7758
|
}
|
|
7759
7759
|
) });
|
|
7760
|
-
}, ri =
|
|
7760
|
+
}, ri = me.memo(ms), bs = "edit";
|
|
7761
7761
|
function yi({
|
|
7762
7762
|
index: e,
|
|
7763
7763
|
onDrop: n,
|
|
@@ -7788,7 +7788,7 @@ function yi({
|
|
|
7788
7788
|
o ? "bg-blue-50 border-2 border-blue-300 border-dashed" : s ? "border-2 border-blue-200 border-dashed" : "border-2 border-transparent"
|
|
7789
7789
|
),
|
|
7790
7790
|
children: o && /* @__PURE__ */ c("span", { className: "flex items-center gap-1 text-blue-500 text-xs font-medium select-none pointer-events-none", children: [
|
|
7791
|
-
/* @__PURE__ */ i(
|
|
7791
|
+
/* @__PURE__ */ i(J, { icon: "octicon:plus-16" }),
|
|
7792
7792
|
"Drop here"
|
|
7793
7793
|
] })
|
|
7794
7794
|
}
|
|
@@ -7801,24 +7801,24 @@ function vs({ elementData: e, sectionId: n }) {
|
|
|
7801
7801
|
setIsDragging: o,
|
|
7802
7802
|
addElementInPosition: l,
|
|
7803
7803
|
moveElement: d
|
|
7804
|
-
} = Pe(we), [u, m] = G(null), r =
|
|
7804
|
+
} = Pe(we), [u, m] = G(null), r = ue(
|
|
7805
7805
|
() => {
|
|
7806
7806
|
var g;
|
|
7807
7807
|
return ((g = a.find((v) => v.id === n)) == null ? void 0 : g.questionData) || [];
|
|
7808
7808
|
},
|
|
7809
7809
|
[a, n]
|
|
7810
|
-
), t =
|
|
7810
|
+
), t = ae(
|
|
7811
7811
|
(g, v) => {
|
|
7812
7812
|
g.dataTransfer.setData("elementId", v), g.dataTransfer.setData("properties", v), g.dataTransfer.effectAllowed = "move", m(v), o(!0);
|
|
7813
7813
|
},
|
|
7814
7814
|
[o]
|
|
7815
|
-
), b =
|
|
7815
|
+
), b = ae(() => {
|
|
7816
7816
|
m(null), o(!1);
|
|
7817
7817
|
}, [o]);
|
|
7818
7818
|
j(() => {
|
|
7819
7819
|
!s && u && m(null);
|
|
7820
7820
|
}, [s, u]);
|
|
7821
|
-
const h =
|
|
7821
|
+
const h = ae(
|
|
7822
7822
|
(g) => {
|
|
7823
7823
|
g.preventDefault(), g.stopPropagation();
|
|
7824
7824
|
const v = g.dataTransfer.getData("elementId"), w = g.currentTarget.id;
|
|
@@ -7832,7 +7832,7 @@ function vs({ elementData: e, sectionId: n }) {
|
|
|
7832
7832
|
M != null && M.gridId && y !== -1 ? d({ draggedId: v, sectionId: n, targetIndex: y }) : d({ draggedId: v, sectionId: n, targetId: w }), m(null), o(!1);
|
|
7833
7833
|
},
|
|
7834
7834
|
[n, d, o, b, r]
|
|
7835
|
-
), x =
|
|
7835
|
+
), x = ae(
|
|
7836
7836
|
(g, v) => {
|
|
7837
7837
|
g.preventDefault(), g.stopPropagation(), o(!1);
|
|
7838
7838
|
const w = g.dataTransfer.getData("elementId");
|
|
@@ -7850,7 +7850,7 @@ function vs({ elementData: e, sectionId: n }) {
|
|
|
7850
7850
|
}
|
|
7851
7851
|
},
|
|
7852
7852
|
[l, n, o, d]
|
|
7853
|
-
), f =
|
|
7853
|
+
), f = ae(
|
|
7854
7854
|
(g, v = !1) => /* @__PURE__ */ i(
|
|
7855
7855
|
"div",
|
|
7856
7856
|
{
|
|
@@ -7872,7 +7872,7 @@ function vs({ elementData: e, sectionId: n }) {
|
|
|
7872
7872
|
g.id
|
|
7873
7873
|
),
|
|
7874
7874
|
[u, h, n, t, b]
|
|
7875
|
-
), p =
|
|
7875
|
+
), p = ue(() => (e == null ? void 0 : e.reduce((g, v) => (v.gridId && !v.isDeleted && (g[v.gridId] = g[v.gridId] || [], g[v.gridId].push(v)), g), {})) || {}, [e]), S = ue(
|
|
7876
7876
|
() => (e == null ? void 0 : e.filter((g) => !g.isDeleted)) || [],
|
|
7877
7877
|
[e]
|
|
7878
7878
|
);
|
|
@@ -7967,8 +7967,8 @@ const ps = li(vs), hs = O.object({
|
|
|
7967
7967
|
description: O.string(),
|
|
7968
7968
|
disabled: O.boolean().default(!1),
|
|
7969
7969
|
isHidden: O.boolean().default(!1)
|
|
7970
|
-
}).required(), xi =
|
|
7971
|
-
const { updateSection: s } =
|
|
7970
|
+
}).required(), xi = ye("config"), gs = ({ isOpen: e, onClose: n, section: a }) => {
|
|
7971
|
+
const { updateSection: s } = me.useContext(we), {
|
|
7972
7972
|
register: o,
|
|
7973
7973
|
handleSubmit: l,
|
|
7974
7974
|
watch: d,
|
|
@@ -7978,7 +7978,7 @@ const ps = li(vs), hs = O.object({
|
|
|
7978
7978
|
resolver: Ii(hs),
|
|
7979
7979
|
defaultValues: a
|
|
7980
7980
|
});
|
|
7981
|
-
if (
|
|
7981
|
+
if (me.useEffect(() => {
|
|
7982
7982
|
e || t();
|
|
7983
7983
|
}, [e, t]), !e) return null;
|
|
7984
7984
|
const b = (x) => {
|
|
@@ -7992,7 +7992,7 @@ const ps = li(vs), hs = O.object({
|
|
|
7992
7992
|
{
|
|
7993
7993
|
onClick: n,
|
|
7994
7994
|
className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
|
|
7995
|
-
children: /* @__PURE__ */ i(
|
|
7995
|
+
children: /* @__PURE__ */ i(J, { icon: "tabler:x" })
|
|
7996
7996
|
}
|
|
7997
7997
|
)
|
|
7998
7998
|
] }),
|
|
@@ -8005,7 +8005,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8005
8005
|
children: [
|
|
8006
8006
|
/* @__PURE__ */ c("div", { className: "w-full px-6 flex flex-col gap-5 z-10", children: [
|
|
8007
8007
|
/* @__PURE__ */ i(
|
|
8008
|
-
|
|
8008
|
+
_,
|
|
8009
8009
|
{
|
|
8010
8010
|
label: "Title",
|
|
8011
8011
|
name: "title",
|
|
@@ -8015,7 +8015,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8015
8015
|
}
|
|
8016
8016
|
),
|
|
8017
8017
|
/* @__PURE__ */ i(
|
|
8018
|
-
|
|
8018
|
+
_,
|
|
8019
8019
|
{
|
|
8020
8020
|
label: "Description",
|
|
8021
8021
|
name: "description",
|
|
@@ -8026,7 +8026,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8026
8026
|
}
|
|
8027
8027
|
),
|
|
8028
8028
|
/* @__PURE__ */ i(
|
|
8029
|
-
|
|
8029
|
+
_,
|
|
8030
8030
|
{
|
|
8031
8031
|
label: "Disable Section",
|
|
8032
8032
|
name: "disabled",
|
|
@@ -8039,7 +8039,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8039
8039
|
}
|
|
8040
8040
|
),
|
|
8041
8041
|
/* @__PURE__ */ i(
|
|
8042
|
-
|
|
8042
|
+
_,
|
|
8043
8043
|
{
|
|
8044
8044
|
label: "Hide Section",
|
|
8045
8045
|
name: "isHidden",
|
|
@@ -8085,7 +8085,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8085
8085
|
{
|
|
8086
8086
|
onClick: n,
|
|
8087
8087
|
className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
|
|
8088
|
-
children: /* @__PURE__ */ i(
|
|
8088
|
+
children: /* @__PURE__ */ i(J, { icon: "tabler:x" })
|
|
8089
8089
|
}
|
|
8090
8090
|
)
|
|
8091
8091
|
] }),
|
|
@@ -8288,7 +8288,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8288
8288
|
onReorderSection: h
|
|
8289
8289
|
}) => {
|
|
8290
8290
|
var S, N;
|
|
8291
|
-
const x =
|
|
8291
|
+
const x = fe(null), f = fe((S = e == null ? void 0 : e.questionData) == null ? void 0 : S.length), p = fe(b);
|
|
8292
8292
|
return j(() => {
|
|
8293
8293
|
var g, v;
|
|
8294
8294
|
if (((g = e == null ? void 0 : e.questionData) == null ? void 0 : g.length) > f.current && !b && !p.current) {
|
|
@@ -8334,7 +8334,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8334
8334
|
className: "flex-1 h-full py-4 cursor-grab active:cursor-grabbing flex items-center gap-2",
|
|
8335
8335
|
title: "Drag to reorder section",
|
|
8336
8336
|
children: [
|
|
8337
|
-
/* @__PURE__ */ i(
|
|
8337
|
+
/* @__PURE__ */ i(J, { icon: "material-symbols:drag-indicator", iconClass: "text-gray-400 text-lg" }),
|
|
8338
8338
|
/* @__PURE__ */ i("h2", { className: "font-medium", children: e.title || "Section title" })
|
|
8339
8339
|
]
|
|
8340
8340
|
}
|
|
@@ -8346,7 +8346,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8346
8346
|
type: "button",
|
|
8347
8347
|
className: "p-1 text-xs border rounded-lg",
|
|
8348
8348
|
onClick: () => d(e),
|
|
8349
|
-
children: /* @__PURE__ */ i(
|
|
8349
|
+
children: /* @__PURE__ */ i(J, { icon: "fluent:edit-28-regular" })
|
|
8350
8350
|
}
|
|
8351
8351
|
),
|
|
8352
8352
|
m > 1 && /* @__PURE__ */ i(
|
|
@@ -8355,7 +8355,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8355
8355
|
type: "button",
|
|
8356
8356
|
className: "p-1 text-xs border rounded-lg",
|
|
8357
8357
|
onClick: () => u(e.id),
|
|
8358
|
-
children: /* @__PURE__ */ i(
|
|
8358
|
+
children: /* @__PURE__ */ i(J, { icon: "lets-icons:trash-duotone-line" })
|
|
8359
8359
|
}
|
|
8360
8360
|
),
|
|
8361
8361
|
/* @__PURE__ */ i(
|
|
@@ -8365,7 +8365,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8365
8365
|
className: "p-1 text-xs rounded-lg",
|
|
8366
8366
|
onClick: () => l(n),
|
|
8367
8367
|
children: /* @__PURE__ */ i(
|
|
8368
|
-
|
|
8368
|
+
J,
|
|
8369
8369
|
{
|
|
8370
8370
|
icon: o.includes(n) ? "fa6-solid:chevron-up" : "fa6-solid:chevron-down",
|
|
8371
8371
|
iconClass: "text-base"
|
|
@@ -8404,7 +8404,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8404
8404
|
);
|
|
8405
8405
|
}, Ss = ({ onAddTemplate: e, templates: n }) => {
|
|
8406
8406
|
var B;
|
|
8407
|
-
const a = [...ys, ...n || []], [s, o] = G(!1), [l, d] = G(!1), u =
|
|
8407
|
+
const a = [...ys, ...n || []], [s, o] = G(!1), [l, d] = G(!1), u = fe(null), m = fe(null), {
|
|
8408
8408
|
removeSection: r,
|
|
8409
8409
|
// addElement,
|
|
8410
8410
|
addSection: t,
|
|
@@ -8419,72 +8419,72 @@ const ps = li(vs), hs = O.object({
|
|
|
8419
8419
|
pasteElement: v
|
|
8420
8420
|
} = Pe(we);
|
|
8421
8421
|
j(() => {
|
|
8422
|
-
const
|
|
8423
|
-
var
|
|
8422
|
+
const D = (Z) => {
|
|
8423
|
+
var H;
|
|
8424
8424
|
const Q = Z.target;
|
|
8425
8425
|
if (!(Q.tagName === "INPUT" || Q.tagName === "TEXTAREA" || Q.isContentEditable) && f) {
|
|
8426
|
-
const
|
|
8427
|
-
v(f, void 0,
|
|
8426
|
+
const ie = ((H = Z.clipboardData) == null ? void 0 : H.getData("text")) || "";
|
|
8427
|
+
v(f, void 0, ie);
|
|
8428
8428
|
}
|
|
8429
8429
|
};
|
|
8430
|
-
return window.addEventListener("paste",
|
|
8431
|
-
window.removeEventListener("paste",
|
|
8430
|
+
return window.addEventListener("paste", D), () => {
|
|
8431
|
+
window.removeEventListener("paste", D);
|
|
8432
8432
|
};
|
|
8433
8433
|
}, [f, v]);
|
|
8434
|
-
const w =
|
|
8434
|
+
const w = fe((b == null ? void 0 : b.length) || 0);
|
|
8435
8435
|
j(() => {
|
|
8436
|
-
var
|
|
8437
|
-
x(((
|
|
8436
|
+
var D;
|
|
8437
|
+
x(((D = b[0]) == null ? void 0 : D.id) || null);
|
|
8438
8438
|
}, []), j(() => {
|
|
8439
8439
|
(b == null ? void 0 : b.length) > w.current && m.current && requestAnimationFrame(() => {
|
|
8440
|
-
var
|
|
8441
|
-
(
|
|
8440
|
+
var D;
|
|
8441
|
+
(D = m.current) == null || D.scrollTo({
|
|
8442
8442
|
top: m.current.scrollHeight,
|
|
8443
8443
|
behavior: "smooth"
|
|
8444
8444
|
});
|
|
8445
8445
|
}), w.current = (b == null ? void 0 : b.length) || 0;
|
|
8446
8446
|
}, [b == null ? void 0 : b.length]);
|
|
8447
|
-
const M =
|
|
8448
|
-
|
|
8449
|
-
}, []), y =
|
|
8447
|
+
const M = ae((D) => {
|
|
8448
|
+
D.preventDefault(), D.dataTransfer.dropEffect = "move";
|
|
8449
|
+
}, []), y = ae((D, Z) => {
|
|
8450
8450
|
N((Q) => {
|
|
8451
|
-
const
|
|
8452
|
-
if (
|
|
8453
|
-
const U = [...Q], [X] = U.splice(
|
|
8454
|
-
return U.splice(
|
|
8451
|
+
const H = Q.findIndex((Y) => Y.id === D), ie = Q.findIndex((Y) => Y.id === Z);
|
|
8452
|
+
if (H === -1 || ie === -1 || H === ie) return Q;
|
|
8453
|
+
const U = [...Q], [X] = U.splice(H, 1);
|
|
8454
|
+
return U.splice(ie, 0, X), U;
|
|
8455
8455
|
});
|
|
8456
8456
|
}, [N]);
|
|
8457
|
-
function A(
|
|
8458
|
-
p.includes(
|
|
8459
|
-
(Z) => Z.filter((Q) => Q !==
|
|
8460
|
-
) : S((Z) => [...Z,
|
|
8457
|
+
function A(D) {
|
|
8458
|
+
p.includes(D) ? S(
|
|
8459
|
+
(Z) => Z.filter((Q) => Q !== D)
|
|
8460
|
+
) : S((Z) => [...Z, D]);
|
|
8461
8461
|
}
|
|
8462
|
-
function k(
|
|
8463
|
-
u.current =
|
|
8462
|
+
function k(D) {
|
|
8463
|
+
u.current = D, o(!0);
|
|
8464
8464
|
}
|
|
8465
|
-
const C = (
|
|
8466
|
-
var Q,
|
|
8465
|
+
const C = (D) => {
|
|
8466
|
+
var Q, H, ie, U;
|
|
8467
8467
|
const Z = (X, Y = {}) => ({
|
|
8468
8468
|
...JSON.parse(JSON.stringify(X)),
|
|
8469
8469
|
...Y
|
|
8470
8470
|
});
|
|
8471
|
-
if (
|
|
8472
|
-
const Y =
|
|
8473
|
-
var
|
|
8474
|
-
const
|
|
8471
|
+
if (D.sections && Array.isArray(D.sections)) {
|
|
8472
|
+
const Y = D.sections.filter(Boolean).map((pe) => {
|
|
8473
|
+
var he;
|
|
8474
|
+
const ce = Ce(), W = (he = pe.questionData) == null ? void 0 : he.map((xe) => Z(xe, { id: Ce(), sectionId: ce }));
|
|
8475
8475
|
if (W) {
|
|
8476
|
-
const
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
}), W.forEach((
|
|
8480
|
-
|
|
8476
|
+
const xe = /* @__PURE__ */ new Map();
|
|
8477
|
+
pe.questionData.forEach((te, Te) => {
|
|
8478
|
+
xe.set(te.id, W[Te].id);
|
|
8479
|
+
}), W.forEach((te) => {
|
|
8480
|
+
te.gridId && xe.has(te.gridId) && (te.gridId = xe.get(te.gridId));
|
|
8481
8481
|
});
|
|
8482
8482
|
}
|
|
8483
|
-
return Z(
|
|
8483
|
+
return Z(pe, { id: ce, questionData: W || [] });
|
|
8484
8484
|
});
|
|
8485
|
-
b.length === 1 && b[0].title === "" && b[0].description === "" && (!((Q = b[0]) != null && Q.questionData) || ((
|
|
8485
|
+
b.length === 1 && b[0].title === "" && b[0].description === "" && (!((Q = b[0]) != null && Q.questionData) || ((ie = (H = b[0]) == null ? void 0 : H.questionData) == null ? void 0 : ie.length) === 0) ? (N(Y), Y.length > 0 && x((U = Y[0]) == null ? void 0 : U.id)) : N((pe) => [...pe, ...Y]);
|
|
8486
8486
|
}
|
|
8487
|
-
}, E =
|
|
8487
|
+
}, E = ye("config");
|
|
8488
8488
|
return /* @__PURE__ */ c(
|
|
8489
8489
|
"div",
|
|
8490
8490
|
{
|
|
@@ -8505,13 +8505,13 @@ const ps = li(vs), hs = O.object({
|
|
|
8505
8505
|
ref: m,
|
|
8506
8506
|
className: "relative flex flex-col flex-1 w-full gap-y-3 container overflow-y-auto",
|
|
8507
8507
|
children: [
|
|
8508
|
-
(B = b == null ? void 0 : b.filter((
|
|
8509
|
-
(
|
|
8508
|
+
(B = b == null ? void 0 : b.filter((D) => !(D != null && D.isDeleted))) == null ? void 0 : B.map(
|
|
8509
|
+
(D, Z) => {
|
|
8510
8510
|
var Q;
|
|
8511
8511
|
return /* @__PURE__ */ i(
|
|
8512
8512
|
xs,
|
|
8513
8513
|
{
|
|
8514
|
-
section:
|
|
8514
|
+
section: D,
|
|
8515
8515
|
index: Z,
|
|
8516
8516
|
selectedSection: f,
|
|
8517
8517
|
setSelectedSection: x,
|
|
@@ -8519,13 +8519,13 @@ const ps = li(vs), hs = O.object({
|
|
|
8519
8519
|
toggleSection: A,
|
|
8520
8520
|
handleSectionEdit: k,
|
|
8521
8521
|
removeSection: r,
|
|
8522
|
-
formDataLength: ((Q = b == null ? void 0 : b.filter((
|
|
8522
|
+
formDataLength: ((Q = b == null ? void 0 : b.filter((H) => !(H != null && H.isDeleted))) == null ? void 0 : Q.length) || 0,
|
|
8523
8523
|
onDragOver: M,
|
|
8524
8524
|
setIsDragging: h,
|
|
8525
8525
|
isDragging: g,
|
|
8526
8526
|
onReorderSection: y
|
|
8527
8527
|
},
|
|
8528
|
-
|
|
8528
|
+
D.id
|
|
8529
8529
|
);
|
|
8530
8530
|
}
|
|
8531
8531
|
),
|
|
@@ -8574,7 +8574,7 @@ const ps = li(vs), hs = O.object({
|
|
|
8574
8574
|
}, Ns = () => {
|
|
8575
8575
|
const { formData: e, uploadUrl: n } = Pe(
|
|
8576
8576
|
we
|
|
8577
|
-
), [a, s] = G("multi"), o =
|
|
8577
|
+
), [a, s] = G("multi"), o = ye("config");
|
|
8578
8578
|
return /* @__PURE__ */ c("div", { className: "flex flex-col h-full w-full", children: [
|
|
8579
8579
|
/* @__PURE__ */ i("div", { className: "flex justify-center p-3 border-b border-gray-100 bg-gray-50/50", children: /* @__PURE__ */ c("div", { className: "flex bg-gray-200 p-1 rounded-lg text-sm font-medium", children: [
|
|
8580
8580
|
/* @__PURE__ */ i(
|
|
@@ -8614,10 +8614,10 @@ const ps = li(vs), hs = O.object({
|
|
|
8614
8614
|
e
|
|
8615
8615
|
);
|
|
8616
8616
|
return j(() => {
|
|
8617
|
-
const a =
|
|
8617
|
+
const a = ye("config"), s = (a == null ? void 0 : a.loaderColor) || "#333";
|
|
8618
8618
|
document.documentElement.style.setProperty("--loader-color", s);
|
|
8619
8619
|
}, []), /* @__PURE__ */ i("div", { className: n, children: /* @__PURE__ */ i("span", { className: "loader" }) });
|
|
8620
|
-
}, As =
|
|
8620
|
+
}, As = me.lazy(() => import("./logic-flow-DoGabFPy.js"));
|
|
8621
8621
|
function Cs({
|
|
8622
8622
|
questionData: e,
|
|
8623
8623
|
uploadUrl: n,
|
|
@@ -8631,7 +8631,7 @@ function Cs({
|
|
|
8631
8631
|
}, [e, l]), j(() => {
|
|
8632
8632
|
u(n);
|
|
8633
8633
|
}, [n, u]);
|
|
8634
|
-
const t =
|
|
8634
|
+
const t = ae((b) => {
|
|
8635
8635
|
b.preventDefault();
|
|
8636
8636
|
try {
|
|
8637
8637
|
const h = JSON.parse(b.dataTransfer.getData("properties"));
|
|
@@ -8650,7 +8650,7 @@ function Cs({
|
|
|
8650
8650
|
onDragOver: (b) => b.preventDefault(),
|
|
8651
8651
|
onDrop: (b) => t(b),
|
|
8652
8652
|
className: " h-full overflow-y-auto no-scrollbar max-h-[calc(100vh-80px)] flex-1 form_builder",
|
|
8653
|
-
children: o === "canvas" ? /* @__PURE__ */ i(Ss, { onAddTemplate: a, templates: s }) : /* @__PURE__ */ i(
|
|
8653
|
+
children: o === "canvas" ? /* @__PURE__ */ i(Ss, { onAddTemplate: a, templates: s }) : /* @__PURE__ */ i(Dn, { fallback: /* @__PURE__ */ i(Gi, { loadingClass: "!w-full !h-full" }), children: /* @__PURE__ */ i(As, { formData: r }) })
|
|
8654
8654
|
}
|
|
8655
8655
|
),
|
|
8656
8656
|
o === "canvas" && /* @__PURE__ */ i(
|
|
@@ -8699,7 +8699,7 @@ const ks = [
|
|
|
8699
8699
|
const w = setInterval(v, 1e3);
|
|
8700
8700
|
return () => clearInterval(w);
|
|
8701
8701
|
}, []);
|
|
8702
|
-
const r =
|
|
8702
|
+
const r = ae(
|
|
8703
8703
|
(v, w) => {
|
|
8704
8704
|
if (!u) {
|
|
8705
8705
|
Ae.error("Please select a section to add an element.");
|
|
@@ -8721,7 +8721,7 @@ const ks = [
|
|
|
8721
8721
|
};
|
|
8722
8722
|
d(w, u);
|
|
8723
8723
|
}
|
|
8724
|
-
const b =
|
|
8724
|
+
const b = ye("config") || {}, h = b.elementColor, x = b.elementBgColor, f = b.elementBorderColor, p = Qa.filter(
|
|
8725
8725
|
(v) => v.label.toLowerCase().includes(n.toLowerCase())
|
|
8726
8726
|
), S = e === "poll" ? ws : ks, N = e === "poll" ? eo : Xa, g = S == null ? void 0 : S.map((v) => ({
|
|
8727
8727
|
title: v.title,
|
|
@@ -8759,7 +8759,7 @@ const ks = [
|
|
|
8759
8759
|
},
|
|
8760
8760
|
title: "Paste copied element",
|
|
8761
8761
|
children: [
|
|
8762
|
-
/* @__PURE__ */ i(
|
|
8762
|
+
/* @__PURE__ */ i(J, { icon: "lucide:clipboard-paste" }),
|
|
8763
8763
|
"Paste Element (Ctrl+V)"
|
|
8764
8764
|
]
|
|
8765
8765
|
}
|
|
@@ -8785,7 +8785,7 @@ const ks = [
|
|
|
8785
8785
|
active:opacity-50 element_class`,
|
|
8786
8786
|
draggable: !0,
|
|
8787
8787
|
children: /* @__PURE__ */ c("span", { className: "flex flex-col items-center justify-center w-full gap-2", children: [
|
|
8788
|
-
/* @__PURE__ */ i("span", { style: { color: h }, children: /* @__PURE__ */ i(
|
|
8788
|
+
/* @__PURE__ */ i("span", { style: { color: h }, children: /* @__PURE__ */ i(J, { icon: y.icon, iconClass: "w-6 h-6" }) }),
|
|
8789
8789
|
/* @__PURE__ */ i(
|
|
8790
8790
|
"span",
|
|
8791
8791
|
{
|
|
@@ -8823,7 +8823,7 @@ const ks = [
|
|
|
8823
8823
|
"opacity-40 cursor-not-allowed": n
|
|
8824
8824
|
},
|
|
8825
8825
|
s
|
|
8826
|
-
), f = () => a ? /* @__PURE__ */ c(
|
|
8826
|
+
), f = () => a ? /* @__PURE__ */ c(ge, { children: [
|
|
8827
8827
|
/* @__PURE__ */ c(
|
|
8828
8828
|
"svg",
|
|
8829
8829
|
{
|
|
@@ -8856,9 +8856,9 @@ const ks = [
|
|
|
8856
8856
|
),
|
|
8857
8857
|
"Submitting..."
|
|
8858
8858
|
] }) : /* @__PURE__ */ c("span", { className: "flex items-center", children: [
|
|
8859
|
-
o && l === "left" && /* @__PURE__ */ i("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ i(
|
|
8859
|
+
o && l === "left" && /* @__PURE__ */ i("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ i(J, { icon: o }) }),
|
|
8860
8860
|
e && /* @__PURE__ */ i("span", { children: e }),
|
|
8861
|
-
o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(
|
|
8861
|
+
o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(J, { icon: o }) })
|
|
8862
8862
|
] });
|
|
8863
8863
|
return r ? /* @__PURE__ */ i("div", { className: x, children: f() }) : m ? /* @__PURE__ */ i(Jn, { to: m, className: x, children: f() }) : /* @__PURE__ */ i(
|
|
8864
8864
|
"button",
|
|
@@ -8917,7 +8917,7 @@ const Es = ({
|
|
|
8917
8917
|
we
|
|
8918
8918
|
);
|
|
8919
8919
|
if (!e) return null;
|
|
8920
|
-
const o =
|
|
8920
|
+
const o = ye("config");
|
|
8921
8921
|
return /* @__PURE__ */ c("div", { className: "fixed inset-0 flex justify-center z-[999] cursor-default no-drag select-none w-screen h-screen pt-20 bg-[#F8F9FC]", children: [
|
|
8922
8922
|
/* @__PURE__ */ i(
|
|
8923
8923
|
"button",
|
|
@@ -8987,20 +8987,20 @@ function Ps({
|
|
|
8987
8987
|
redo: p,
|
|
8988
8988
|
canUndo: S,
|
|
8989
8989
|
canRedo: N
|
|
8990
|
-
} = Pe(we), [g, v] = G(!1), [w, M] = G(!1), [y, A] = G(e || ""), k =
|
|
8990
|
+
} = Pe(we), [g, v] = G(!1), [w, M] = G(!1), [y, A] = G(e || ""), k = ye("config");
|
|
8991
8991
|
function C() {
|
|
8992
8992
|
try {
|
|
8993
8993
|
localStorage.setItem("formData", JSON.stringify(b));
|
|
8994
|
-
} catch (
|
|
8995
|
-
console.warn("Could not save formData to localStorage",
|
|
8994
|
+
} catch (D) {
|
|
8995
|
+
console.warn("Could not save formData to localStorage", D);
|
|
8996
8996
|
}
|
|
8997
8997
|
a == null || a(b);
|
|
8998
8998
|
}
|
|
8999
8999
|
function E() {
|
|
9000
9000
|
try {
|
|
9001
9001
|
localStorage.setItem("formData", JSON.stringify(b));
|
|
9002
|
-
} catch (
|
|
9003
|
-
console.warn("Could not save formData to localStorage",
|
|
9002
|
+
} catch (D) {
|
|
9003
|
+
console.warn("Could not save formData to localStorage", D);
|
|
9004
9004
|
}
|
|
9005
9005
|
s == null || s(b);
|
|
9006
9006
|
}
|
|
@@ -9025,7 +9025,7 @@ function Ps({
|
|
|
9025
9025
|
{
|
|
9026
9026
|
type: "text",
|
|
9027
9027
|
value: y,
|
|
9028
|
-
onChange: (
|
|
9028
|
+
onChange: (D) => A(D.target.value),
|
|
9029
9029
|
onBlur: B,
|
|
9030
9030
|
autoFocus: !0,
|
|
9031
9031
|
className: "w-48 px-2 py-1 text-sm font-semibold outline-gray-100 input form_title"
|
|
@@ -9059,7 +9059,7 @@ function Ps({
|
|
|
9059
9059
|
onClick: () => r("canvas"),
|
|
9060
9060
|
children: [
|
|
9061
9061
|
/* @__PURE__ */ i(
|
|
9062
|
-
|
|
9062
|
+
J,
|
|
9063
9063
|
{
|
|
9064
9064
|
icon: "mdi:view-dashboard-outline",
|
|
9065
9065
|
iconClass: "text-base"
|
|
@@ -9078,7 +9078,7 @@ function Ps({
|
|
|
9078
9078
|
className: `px-3 flex items-center gap-1.5 border-l border-gray-300 transition-colors flow_view ${m === "flow" ? " bg-white font-medium" : "bg-gray-100 text-gray-500 hover:bg-gray-50"}`,
|
|
9079
9079
|
onClick: () => r("flow"),
|
|
9080
9080
|
children: [
|
|
9081
|
-
/* @__PURE__ */ i(
|
|
9081
|
+
/* @__PURE__ */ i(J, { icon: "mdi:sitemap-outline", iconClass: "text-base" }),
|
|
9082
9082
|
" Flow"
|
|
9083
9083
|
]
|
|
9084
9084
|
}
|
|
@@ -9122,7 +9122,7 @@ function Ps({
|
|
|
9122
9122
|
/* @__PURE__ */ i(
|
|
9123
9123
|
Ge,
|
|
9124
9124
|
{
|
|
9125
|
-
onClick: () => h((
|
|
9125
|
+
onClick: () => h((D) => !D),
|
|
9126
9126
|
text: x ? "Hide Preview" : "Preview",
|
|
9127
9127
|
btnClass: "px-2 bg-transparent font-medium text-sm form_preview",
|
|
9128
9128
|
icon: x ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
|
|
@@ -9159,7 +9159,7 @@ function Ps({
|
|
|
9159
9159
|
] })
|
|
9160
9160
|
] });
|
|
9161
9161
|
}
|
|
9162
|
-
function
|
|
9162
|
+
function Ds({
|
|
9163
9163
|
onSubmit: e,
|
|
9164
9164
|
onChange: n,
|
|
9165
9165
|
onLogAction: a,
|
|
@@ -9250,7 +9250,7 @@ const sl = ({
|
|
|
9250
9250
|
}) => (j(() => {
|
|
9251
9251
|
d && wn("config", d);
|
|
9252
9252
|
}, [d]), /* @__PURE__ */ i(
|
|
9253
|
-
|
|
9253
|
+
Ds,
|
|
9254
9254
|
{
|
|
9255
9255
|
onSubmit: e,
|
|
9256
9256
|
onChange: n,
|
|
@@ -9281,7 +9281,7 @@ const sl = ({
|
|
|
9281
9281
|
maxLength: (e) => `Maximum length is ${e}`,
|
|
9282
9282
|
minAmount: (e) => `Minimum amount is ${e}`,
|
|
9283
9283
|
maxAmount: (e) => `Maximum amount is ${e}`
|
|
9284
|
-
},
|
|
9284
|
+
}, Rs = (e) => ({
|
|
9285
9285
|
textField: O.string().nullable(),
|
|
9286
9286
|
longText: O.string().nullable(),
|
|
9287
9287
|
numberField: O.number().nullable().transform((a) => isNaN(a) ? null : a),
|
|
@@ -9364,7 +9364,7 @@ function Gs({
|
|
|
9364
9364
|
o[m] = O.mixed().notRequired().nullable();
|
|
9365
9365
|
return;
|
|
9366
9366
|
}
|
|
9367
|
-
let f =
|
|
9367
|
+
let f = Rs(r);
|
|
9368
9368
|
f = Is(
|
|
9369
9369
|
f,
|
|
9370
9370
|
t,
|
|
@@ -9430,7 +9430,7 @@ const dn = (e) => {
|
|
|
9430
9430
|
}
|
|
9431
9431
|
) })
|
|
9432
9432
|
] }, b)),
|
|
9433
|
-
e.type === "rating" && ((o = e.responsesData) == null ? void 0 : o.options) && /* @__PURE__ */ c(
|
|
9433
|
+
e.type === "rating" && ((o = e.responsesData) == null ? void 0 : o.options) && /* @__PURE__ */ c(ge, { children: [
|
|
9434
9434
|
((l = e.responsesData) == null ? void 0 : l.average) !== void 0 && /* @__PURE__ */ c("div", { className: "mb-4 p-3 bg-white rounded-lg border text-center w-32 mx-auto", children: [
|
|
9435
9435
|
/* @__PURE__ */ i("div", { className: "text-xs text-gray-500 uppercase", children: "Average Rating" }),
|
|
9436
9436
|
/* @__PURE__ */ i("div", { className: "text-2xl font-bold text-yellow-500", children: e.responsesData.average })
|
|
@@ -9486,7 +9486,7 @@ const dn = (e) => {
|
|
|
9486
9486
|
] }, f)) })
|
|
9487
9487
|
] }, b);
|
|
9488
9488
|
}) }),
|
|
9489
|
-
e.type === "ranking" && ((u = e.responsesData) == null ? void 0 : u.rankings) && /* @__PURE__ */ c(
|
|
9489
|
+
e.type === "ranking" && ((u = e.responsesData) == null ? void 0 : u.rankings) && /* @__PURE__ */ c(ge, { children: [
|
|
9490
9490
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-1 text-xs text-gray-500", children: [
|
|
9491
9491
|
/* @__PURE__ */ i("span", { className: "font-medium", children: "Rankings" }),
|
|
9492
9492
|
/* @__PURE__ */ c("span", { children: [
|
|
@@ -9522,7 +9522,7 @@ const dn = (e) => {
|
|
|
9522
9522
|
] }, b);
|
|
9523
9523
|
})
|
|
9524
9524
|
] }),
|
|
9525
|
-
e.type === "nps" && /* @__PURE__ */ c(
|
|
9525
|
+
e.type === "nps" && /* @__PURE__ */ c(ge, { children: [
|
|
9526
9526
|
((m = e.responsesData) == null ? void 0 : m.nps) && /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-4 md:grid-cols-4 mb-4", children: [
|
|
9527
9527
|
/* @__PURE__ */ c("div", { className: "p-3 bg-white rounded-lg border text-center", children: [
|
|
9528
9528
|
/* @__PURE__ */ i("div", { className: "text-xs text-gray-500 uppercase", children: "NPS Score" }),
|
|
@@ -9569,7 +9569,7 @@ const dn = (e) => {
|
|
|
9569
9569
|
onClick: () => a(!n),
|
|
9570
9570
|
className: "flex items-center gap-1.5 text-sm text-blue-600 hover:text-blue-700 font-medium transition-colors",
|
|
9571
9571
|
children: [
|
|
9572
|
-
/* @__PURE__ */ i(
|
|
9572
|
+
/* @__PURE__ */ i(J, { icon: "bx:bar-chart-alt-2", iconClass: "w-4 h-4" }),
|
|
9573
9573
|
n ? "Hide Results" : "Show Results"
|
|
9574
9574
|
]
|
|
9575
9575
|
}
|
|
@@ -9577,13 +9577,13 @@ const dn = (e) => {
|
|
|
9577
9577
|
] }) : null;
|
|
9578
9578
|
}, qe = ({ element: e, validationData: n }) => {
|
|
9579
9579
|
var d;
|
|
9580
|
-
const a = En[e.type], { answerData: s } = Pe(we), o =
|
|
9580
|
+
const a = En[e.type], { answerData: s } = Pe(we), o = ue(
|
|
9581
9581
|
() => {
|
|
9582
9582
|
var u;
|
|
9583
9583
|
return (u = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : u.map((m) => m.label).join(", ");
|
|
9584
9584
|
},
|
|
9585
9585
|
[e]
|
|
9586
|
-
), l =
|
|
9586
|
+
), l = ue(() => ji(e, s), [s, e]);
|
|
9587
9587
|
return a ? /* @__PURE__ */ c("div", { className: `${l ? "" : "hidden"} min-w-0 w-full`, children: [
|
|
9588
9588
|
/* @__PURE__ */ i("div", { className: "mb-1.5 min-w-0", children: e.inputLabel && /* @__PURE__ */ c("label", { className: "block text-sm font-medium input_label", children: [
|
|
9589
9589
|
e.inputLabel,
|
|
@@ -9730,7 +9730,7 @@ function Hs({ form_data: e, options: n, current: a }) {
|
|
|
9730
9730
|
);
|
|
9731
9731
|
}) });
|
|
9732
9732
|
}
|
|
9733
|
-
const Si =
|
|
9733
|
+
const Si = ye("config");
|
|
9734
9734
|
function Vs({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast: l, isReadOnly: d }) {
|
|
9735
9735
|
if (!e)
|
|
9736
9736
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-center min-h-[500px] text-gray-500", children: "No questions available." });
|
|
@@ -9821,7 +9821,7 @@ function Vs({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
9821
9821
|
),
|
|
9822
9822
|
!l && /* @__PURE__ */ i("span", { className: "text-xs text-gray-400 font-medium hidden sm:inline-block", children: "press Enter ↵" }),
|
|
9823
9823
|
!o && /* @__PURE__ */ c("button", { type: "button", onClick: s, className: "text-gray-400 hover:text-gray-600 font-medium text-sm ml-auto flex items-center gap-1 transition-colors", children: [
|
|
9824
|
-
/* @__PURE__ */ i(
|
|
9824
|
+
/* @__PURE__ */ i(J, { icon: "material-symbols:arrow-upward-rounded", iconClass: "text-lg" }),
|
|
9825
9825
|
"Back"
|
|
9826
9826
|
] })
|
|
9827
9827
|
] })
|
|
@@ -9852,33 +9852,33 @@ const Ws = ({
|
|
|
9852
9852
|
pollResults: t,
|
|
9853
9853
|
showResults: b
|
|
9854
9854
|
}) => {
|
|
9855
|
-
var
|
|
9856
|
-
const { setAnswerData: h, setUploadUrl: x, apiActivityCount: f } = Pe(we), [p, S] = G(0), [N, g] = G(0), v =
|
|
9855
|
+
var De, Re, Ie, q, T, K, L, R, P, V;
|
|
9856
|
+
const { setAnswerData: h, setUploadUrl: x, apiActivityCount: f } = Pe(we), [p, S] = G(0), [N, g] = G(0), v = ue(
|
|
9857
9857
|
() => e.filter((I) => !I.isHidden && !I.isDeleted).map((I) => {
|
|
9858
|
-
var
|
|
9859
|
-
const
|
|
9860
|
-
return
|
|
9858
|
+
var oe;
|
|
9859
|
+
const F = I.isDisabled || I.disabled, z = ((oe = I == null ? void 0 : I.questionData) == null ? void 0 : oe.filter((ne) => !ne.isDeleted)) || [];
|
|
9860
|
+
return F ? {
|
|
9861
9861
|
...I,
|
|
9862
|
-
questionData:
|
|
9863
|
-
...
|
|
9862
|
+
questionData: z.map((ne) => ({
|
|
9863
|
+
...ne,
|
|
9864
9864
|
isDisabled: !0
|
|
9865
9865
|
}))
|
|
9866
9866
|
} : {
|
|
9867
9867
|
...I,
|
|
9868
|
-
questionData:
|
|
9868
|
+
questionData: z
|
|
9869
9869
|
};
|
|
9870
9870
|
}),
|
|
9871
9871
|
[e]
|
|
9872
|
-
), w = (
|
|
9873
|
-
async (I,
|
|
9874
|
-
const
|
|
9872
|
+
), w = (De = v == null ? void 0 : v.length) != null ? De : 0, M = ye("config"), y = ae(
|
|
9873
|
+
async (I, F, z) => {
|
|
9874
|
+
const oe = Gs({
|
|
9875
9875
|
formData: v,
|
|
9876
9876
|
isReadOnly: l,
|
|
9877
9877
|
ignoreValidation: a,
|
|
9878
9878
|
answerData: I
|
|
9879
9879
|
// use current form data to evaluate visibility
|
|
9880
9880
|
});
|
|
9881
|
-
return Ii(
|
|
9881
|
+
return Ii(oe)(I, F, z);
|
|
9882
9882
|
},
|
|
9883
9883
|
[v, l, a]
|
|
9884
9884
|
), A = Ei({
|
|
@@ -9890,33 +9890,33 @@ const Ws = ({
|
|
|
9890
9890
|
setValue: C,
|
|
9891
9891
|
control: E,
|
|
9892
9892
|
handleSubmit: B,
|
|
9893
|
-
reset:
|
|
9893
|
+
reset: D,
|
|
9894
9894
|
getValues: Z,
|
|
9895
9895
|
watch: Q,
|
|
9896
|
-
formState: { errors:
|
|
9896
|
+
formState: { errors: H, isSubmitting: ie },
|
|
9897
9897
|
trigger: U,
|
|
9898
9898
|
setError: X,
|
|
9899
9899
|
clearErrors: Y
|
|
9900
|
-
} = A, ke = On({ control: E }),
|
|
9900
|
+
} = A, ke = On({ control: E }), pe = ue(
|
|
9901
9901
|
() => ke,
|
|
9902
9902
|
[JSON.stringify(ke)]
|
|
9903
|
-
),
|
|
9903
|
+
), ce = ue(() => {
|
|
9904
9904
|
if (d !== "conversational") return [];
|
|
9905
9905
|
const I = [];
|
|
9906
|
-
return v.forEach((
|
|
9907
|
-
var
|
|
9908
|
-
(
|
|
9909
|
-
var
|
|
9910
|
-
if (ji(
|
|
9911
|
-
if (
|
|
9912
|
-
const
|
|
9913
|
-
(
|
|
9906
|
+
return v.forEach((F) => {
|
|
9907
|
+
var z;
|
|
9908
|
+
(z = F == null ? void 0 : F.questionData) == null || z.forEach((oe) => {
|
|
9909
|
+
var ne;
|
|
9910
|
+
if (ji(oe, pe))
|
|
9911
|
+
if (oe.type === "grid") {
|
|
9912
|
+
const le = (ne = F == null ? void 0 : F.questionData) == null ? void 0 : ne.filter(
|
|
9913
|
+
(se) => se.gridId === oe.id
|
|
9914
9914
|
);
|
|
9915
|
-
I.push({ ...
|
|
9916
|
-
} else
|
|
9915
|
+
I.push({ ...oe, gridChildren: le });
|
|
9916
|
+
} else oe.gridId || I.push(oe);
|
|
9917
9917
|
});
|
|
9918
9918
|
}), I;
|
|
9919
|
-
}, [v,
|
|
9919
|
+
}, [v, pe, d]), W = ae(
|
|
9920
9920
|
(I) => {
|
|
9921
9921
|
o && o(I);
|
|
9922
9922
|
},
|
|
@@ -9925,97 +9925,95 @@ const Ws = ({
|
|
|
9925
9925
|
j(() => {
|
|
9926
9926
|
x(r);
|
|
9927
9927
|
}, [x, r]), j(() => {
|
|
9928
|
-
if (!(
|
|
9929
|
-
const I =
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
);
|
|
9945
|
-
W(I), h(be);
|
|
9928
|
+
if (!(e != null && e.length) || !o) return;
|
|
9929
|
+
const I = e.filter((F) => !(F != null && F.isDeleted)).flatMap((F) => {
|
|
9930
|
+
var oe, ne;
|
|
9931
|
+
const z = F == null ? void 0 : F.isHidden;
|
|
9932
|
+
return ((ne = (oe = F == null ? void 0 : F.questionData) == null ? void 0 : oe.filter((le) => !(le != null && le.isDeleted))) == null ? void 0 : ne.map((le) => ({
|
|
9933
|
+
id: le.id,
|
|
9934
|
+
value: z ? "" : pe[le.id] || "",
|
|
9935
|
+
sectionId: F.id,
|
|
9936
|
+
type: le.type,
|
|
9937
|
+
metaData: {
|
|
9938
|
+
prefix: le.prefix,
|
|
9939
|
+
dateFormat: le.dateFormat,
|
|
9940
|
+
...z || !pe[`${le.id}_metaData`] ? {} : { responseObject: pe[`${le.id}_metaData`] }
|
|
9941
|
+
}
|
|
9942
|
+
}))) || [];
|
|
9943
|
+
});
|
|
9944
|
+
W(I), h(pe);
|
|
9946
9945
|
}, [
|
|
9947
|
-
|
|
9948
|
-
|
|
9946
|
+
pe,
|
|
9947
|
+
e,
|
|
9949
9948
|
W,
|
|
9950
9949
|
o,
|
|
9951
9950
|
h
|
|
9952
9951
|
]), j(() => {
|
|
9953
|
-
n != null && n.length &&
|
|
9954
|
-
}, [n,
|
|
9955
|
-
const
|
|
9952
|
+
n != null && n.length && D(Us(n));
|
|
9953
|
+
}, [n, D]);
|
|
9954
|
+
const he = ae(
|
|
9956
9955
|
(I) => {
|
|
9957
|
-
const
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
);
|
|
9973
|
-
Object.keys(F).length > 0 || s == null || s(V);
|
|
9956
|
+
const F = e.filter((z) => !(z != null && z.isDeleted)).flatMap((z) => {
|
|
9957
|
+
var ne, le;
|
|
9958
|
+
const oe = z == null ? void 0 : z.isHidden;
|
|
9959
|
+
return ((le = (ne = z == null ? void 0 : z.questionData) == null ? void 0 : ne.filter((se) => !(se != null && se.isDeleted))) == null ? void 0 : le.map((se) => ({
|
|
9960
|
+
id: se.id,
|
|
9961
|
+
value: oe ? "" : I[se.id] || "",
|
|
9962
|
+
sectionId: z.id,
|
|
9963
|
+
type: se.type,
|
|
9964
|
+
metaData: {
|
|
9965
|
+
prefix: se.prefix,
|
|
9966
|
+
dateFormat: se.dateFormat,
|
|
9967
|
+
...oe || !I[`${se.id}_metaData`] ? {} : { responseObject: I[`${se.id}_metaData`] }
|
|
9968
|
+
}
|
|
9969
|
+
}))) || [];
|
|
9970
|
+
});
|
|
9971
|
+
Object.keys(H).length > 0 || s == null || s(F);
|
|
9974
9972
|
},
|
|
9975
|
-
[
|
|
9976
|
-
),
|
|
9977
|
-
var I,
|
|
9973
|
+
[H, e, s]
|
|
9974
|
+
), xe = ae(async () => {
|
|
9975
|
+
var I, F;
|
|
9978
9976
|
if (d === "conversational") {
|
|
9979
9977
|
if (!a) {
|
|
9980
|
-
const
|
|
9981
|
-
if (!
|
|
9982
|
-
const
|
|
9983
|
-
if (!await U(
|
|
9978
|
+
const z = ce[N];
|
|
9979
|
+
if (!z) return;
|
|
9980
|
+
const oe = z.gridChildren ? z.gridChildren.map((le) => le.id) : [z.id];
|
|
9981
|
+
if (!await U(oe)) return;
|
|
9984
9982
|
}
|
|
9985
|
-
N <
|
|
9983
|
+
N < ce.length - 1 ? g((z) => z + 1) : B(he)();
|
|
9986
9984
|
return;
|
|
9987
9985
|
}
|
|
9988
9986
|
if (!a) {
|
|
9989
|
-
const
|
|
9990
|
-
(
|
|
9987
|
+
const z = (F = (I = v == null ? void 0 : v[p]) == null ? void 0 : I.questionData) == null ? void 0 : F.map(
|
|
9988
|
+
(ne) => ne.id
|
|
9991
9989
|
);
|
|
9992
|
-
if (!await U(
|
|
9990
|
+
if (!await U(z)) return;
|
|
9993
9991
|
}
|
|
9994
|
-
S((
|
|
9992
|
+
S((z) => z + 1);
|
|
9995
9993
|
}, [
|
|
9996
9994
|
p,
|
|
9997
9995
|
N,
|
|
9998
|
-
|
|
9996
|
+
ce,
|
|
9999
9997
|
v,
|
|
10000
9998
|
a,
|
|
10001
9999
|
U,
|
|
10002
10000
|
d,
|
|
10003
10001
|
B,
|
|
10004
|
-
|
|
10005
|
-
]),
|
|
10002
|
+
he
|
|
10003
|
+
]), te = ae(() => {
|
|
10006
10004
|
if (d === "conversational") {
|
|
10007
10005
|
g((I) => Math.max(0, I - 1));
|
|
10008
10006
|
return;
|
|
10009
10007
|
}
|
|
10010
10008
|
S((I) => I - 1);
|
|
10011
|
-
}, [d]), Te =
|
|
10009
|
+
}, [d]), Te = ue(
|
|
10012
10010
|
() => ({
|
|
10013
10011
|
register: k,
|
|
10014
10012
|
setValue: C,
|
|
10015
10013
|
watch: Q,
|
|
10016
|
-
errors:
|
|
10014
|
+
errors: H,
|
|
10017
10015
|
trigger: U,
|
|
10018
|
-
isSubmitting:
|
|
10016
|
+
isSubmitting: ie,
|
|
10019
10017
|
isReadOnly: l,
|
|
10020
10018
|
getValues: Z,
|
|
10021
10019
|
setError: X,
|
|
@@ -10029,9 +10027,9 @@ const Ws = ({
|
|
|
10029
10027
|
k,
|
|
10030
10028
|
C,
|
|
10031
10029
|
Q,
|
|
10032
|
-
|
|
10030
|
+
H,
|
|
10033
10031
|
U,
|
|
10034
|
-
|
|
10032
|
+
ie,
|
|
10035
10033
|
l,
|
|
10036
10034
|
Z,
|
|
10037
10035
|
X,
|
|
@@ -10046,7 +10044,7 @@ const Ws = ({
|
|
|
10046
10044
|
/* @__PURE__ */ c(
|
|
10047
10045
|
"form",
|
|
10048
10046
|
{
|
|
10049
|
-
onSubmit: B(
|
|
10047
|
+
onSubmit: B(he),
|
|
10050
10048
|
className: "container h-full mx-auto",
|
|
10051
10049
|
children: [
|
|
10052
10050
|
/* @__PURE__ */ i("div", { className: "relative flex flex-col w-full min-w-0 py-4 gap-y-12", children: /* @__PURE__ */ c(
|
|
@@ -10054,8 +10052,8 @@ const Ws = ({
|
|
|
10054
10052
|
{
|
|
10055
10053
|
className: "multi_section__box min-w-0",
|
|
10056
10054
|
children: [
|
|
10057
|
-
d === "multi" && (((
|
|
10058
|
-
((
|
|
10055
|
+
d === "multi" && (((Re = v == null ? void 0 : v[p]) == null ? void 0 : Re.title) || ((Ie = v == null ? void 0 : v[p]) == null ? void 0 : Ie.description)) && /* @__PURE__ */ c("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
|
|
10056
|
+
((q = v[p]) == null ? void 0 : q.title) && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold mb-[6px]", children: (T = v[p]) == null ? void 0 : T.title }),
|
|
10059
10057
|
((K = v[p]) == null ? void 0 : K.description) && /* @__PURE__ */ i("p", { className: "text-sm", children: (L = v[p]) == null ? void 0 : L.description })
|
|
10060
10058
|
] }),
|
|
10061
10059
|
d === "multi" ? /* @__PURE__ */ i(
|
|
@@ -10068,12 +10066,12 @@ const Ws = ({
|
|
|
10068
10066
|
) : d === "conversational" ? /* @__PURE__ */ i(
|
|
10069
10067
|
Vs,
|
|
10070
10068
|
{
|
|
10071
|
-
element:
|
|
10069
|
+
element: ce[N],
|
|
10072
10070
|
options: Te,
|
|
10073
|
-
onNext:
|
|
10074
|
-
onPrev:
|
|
10071
|
+
onNext: xe,
|
|
10072
|
+
onPrev: te,
|
|
10075
10073
|
isFirst: N === 0,
|
|
10076
|
-
isLast: N ===
|
|
10074
|
+
isLast: N === ce.length - 1,
|
|
10077
10075
|
isReadOnly: l
|
|
10078
10076
|
}
|
|
10079
10077
|
) : /* @__PURE__ */ i(
|
|
@@ -10085,9 +10083,9 @@ const Ws = ({
|
|
|
10085
10083
|
)
|
|
10086
10084
|
]
|
|
10087
10085
|
},
|
|
10088
|
-
d === "conversational" ? `conv-${N}` : (
|
|
10086
|
+
d === "conversational" ? `conv-${N}` : (R = v == null ? void 0 : v[p]) == null ? void 0 : R.id
|
|
10089
10087
|
) }),
|
|
10090
|
-
!m && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ c(
|
|
10088
|
+
!m && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ c(ge, { children: [
|
|
10091
10089
|
/* @__PURE__ */ c("div", { className: "flex gap-x-4 justify-between navigation_container w-full", children: [
|
|
10092
10090
|
/* @__PURE__ */ c("div", { children: [
|
|
10093
10091
|
" ",
|
|
@@ -10095,11 +10093,11 @@ const Ws = ({
|
|
|
10095
10093
|
"button",
|
|
10096
10094
|
{
|
|
10097
10095
|
type: "button",
|
|
10098
|
-
onClick:
|
|
10096
|
+
onClick: te,
|
|
10099
10097
|
className: "text-gray-400 hover:text-gray-600 font-medium text-sm flex items-center gap-1 transition-colors back_btn",
|
|
10100
10098
|
children: [
|
|
10101
10099
|
/* @__PURE__ */ i(
|
|
10102
|
-
|
|
10100
|
+
J,
|
|
10103
10101
|
{
|
|
10104
10102
|
icon: "material-symbols:arrow-upward-rounded",
|
|
10105
10103
|
iconClass: "text-lg"
|
|
@@ -10115,7 +10113,7 @@ const Ws = ({
|
|
|
10115
10113
|
{
|
|
10116
10114
|
type: "button",
|
|
10117
10115
|
text: "Next",
|
|
10118
|
-
onClick:
|
|
10116
|
+
onClick: xe,
|
|
10119
10117
|
style: { background: (M == null ? void 0 : M.buttonColor) || "#333" },
|
|
10120
10118
|
btnClass: "text-gray-700 next_btn text-sm border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg continue_btn"
|
|
10121
10119
|
}
|
|
@@ -10123,40 +10121,40 @@ const Ws = ({
|
|
|
10123
10121
|
] }),
|
|
10124
10122
|
(p === w - 1 || l) && !a && ((P = typeof u == "function" ? u({
|
|
10125
10123
|
isUploading: f > 0,
|
|
10126
|
-
isSubmitting:
|
|
10127
|
-
hasErrors: Object.keys(
|
|
10124
|
+
isSubmitting: ie,
|
|
10125
|
+
hasErrors: Object.keys(H).length > 0
|
|
10128
10126
|
}) : u) != null ? P : /* @__PURE__ */ i(
|
|
10129
10127
|
Ge,
|
|
10130
10128
|
{
|
|
10131
|
-
isDisabled:
|
|
10132
|
-
isLoading:
|
|
10129
|
+
isDisabled: ie || Object.keys(H).length > 0 || f > 0,
|
|
10130
|
+
isLoading: ie,
|
|
10133
10131
|
type: "submit",
|
|
10134
10132
|
text: "Submit",
|
|
10135
10133
|
style: { background: (M == null ? void 0 : M.buttonColor) || "#333" },
|
|
10136
10134
|
btnClass: "text-gray-700 border-[#98A2B3] submit_btn !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
10137
10135
|
}
|
|
10138
10136
|
))
|
|
10139
|
-
] }) : !a && ((
|
|
10137
|
+
] }) : !a && ((V = typeof u == "function" ? u({
|
|
10140
10138
|
isUploading: f > 0,
|
|
10141
|
-
isSubmitting:
|
|
10142
|
-
hasErrors: Object.keys(
|
|
10143
|
-
}) : u) != null ?
|
|
10139
|
+
isSubmitting: ie,
|
|
10140
|
+
hasErrors: Object.keys(H).length > 0
|
|
10141
|
+
}) : u) != null ? V : /* @__PURE__ */ i(
|
|
10144
10142
|
Ge,
|
|
10145
10143
|
{
|
|
10146
|
-
isDisabled:
|
|
10147
|
-
isLoading:
|
|
10144
|
+
isDisabled: ie || Object.keys(H).length > 0 || f > 0,
|
|
10145
|
+
isLoading: ie,
|
|
10148
10146
|
type: "submit",
|
|
10149
10147
|
text: "Submit",
|
|
10150
10148
|
style: { background: (M == null ? void 0 : M.buttonColor) || "#333" },
|
|
10151
10149
|
btnClass: "text-gray-700 border-[#98A2B3] submit_btn !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
10152
10150
|
}
|
|
10153
10151
|
)) }),
|
|
10154
|
-
d === "conversational" &&
|
|
10152
|
+
d === "conversational" && ce.length > 0 && /* @__PURE__ */ i("div", { className: "fixed bottom-0 left-0 w-full h-1.5 bg-gray-200", children: /* @__PURE__ */ i(
|
|
10155
10153
|
"div",
|
|
10156
10154
|
{
|
|
10157
10155
|
className: "h-full bg-blue-600 transition-all duration-500 ease-out",
|
|
10158
10156
|
style: {
|
|
10159
|
-
width: `${(N + 1) /
|
|
10157
|
+
width: `${(N + 1) / ce.length * 100}%`,
|
|
10160
10158
|
background: (M == null ? void 0 : M.buttonColor) || "#2563EB"
|
|
10161
10159
|
}
|
|
10162
10160
|
}
|
|
@@ -10165,7 +10163,7 @@ const Ws = ({
|
|
|
10165
10163
|
}
|
|
10166
10164
|
)
|
|
10167
10165
|
] });
|
|
10168
|
-
}, zs =
|
|
10166
|
+
}, zs = me.memo(Ws);
|
|
10169
10167
|
function Ln({
|
|
10170
10168
|
answerData: e,
|
|
10171
10169
|
form_data: n,
|
|
@@ -10185,7 +10183,7 @@ function Ln({
|
|
|
10185
10183
|
j(() => {
|
|
10186
10184
|
d && wn("config", d);
|
|
10187
10185
|
}, [d]);
|
|
10188
|
-
const f =
|
|
10186
|
+
const f = ae(
|
|
10189
10187
|
(p) => {
|
|
10190
10188
|
t && t(p);
|
|
10191
10189
|
},
|
|
@@ -10213,7 +10211,7 @@ function Ln({
|
|
|
10213
10211
|
] }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("p", { className: "p-6 text-sm text-gray-400", children: "Error: No form data available." }) });
|
|
10214
10212
|
}
|
|
10215
10213
|
export {
|
|
10216
|
-
|
|
10214
|
+
J as A,
|
|
10217
10215
|
sl as H,
|
|
10218
10216
|
Ln as V
|
|
10219
10217
|
};
|