@arudovwen/form-builder-react 1.7.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-builder-react.css +1 -1
- package/dist/form-builder.es.js +1 -1
- package/dist/form-builder.umd.js +11 -11
- package/dist/{index-CvM58Lcf.js → index-h5u3VnI5.js} +844 -844
- package/dist/{logic-flow-BCnTaMDm.js → logic-flow-KtIPQ2fZ.js} +1 -1
- package/package.json +1 -1
- package/types/components/viewer/index.d.ts +5 -1
- package/types/pages/viewer/index.d.ts +5 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { v4 as
|
|
1
|
+
import { jsx as i, Fragment as ve, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import se, { createContext as xn, useState as D, useEffect as G, useRef as re, useMemo as ee, forwardRef as Zi, createElement as bi, Fragment as ze, useContext as ye, useCallback as Y, memo as Ze, Suspense as An } from "react";
|
|
3
|
+
import { v4 as pe } from "uuid";
|
|
4
4
|
import Sn from "react-datepicker";
|
|
5
|
-
import { Listbox as
|
|
5
|
+
import { Listbox as ae, Transition as we, Combobox as De, ComboboxInput as Nn, ComboboxButton as kn, ComboboxOptions as Cn, ComboboxOption as Mn } from "@headlessui/react";
|
|
6
6
|
import { toast as xe, Toaster as $i } from "sonner";
|
|
7
7
|
import Pe from "axios";
|
|
8
8
|
import $e from "react-currency-input-field";
|
|
@@ -13,10 +13,10 @@ import * as R from "yup";
|
|
|
13
13
|
import Rn from "papaparse";
|
|
14
14
|
import * as Li from "xlsx";
|
|
15
15
|
import { Link as Dn } from "react-router-dom";
|
|
16
|
-
const
|
|
16
|
+
const be = xn(void 0), Pi = {
|
|
17
17
|
title: "",
|
|
18
18
|
description: "",
|
|
19
|
-
id:
|
|
19
|
+
id: pe(),
|
|
20
20
|
questionData: [],
|
|
21
21
|
disabled: !1,
|
|
22
22
|
isHidden: !1
|
|
@@ -27,194 +27,194 @@ const ce = xn(void 0), Pi = {
|
|
|
27
27
|
}) => {
|
|
28
28
|
const [s, o] = D(!0), [l, d] = D({}), [u, t] = D({}), [m, c] = D([Pi]), [r, h] = D(() => {
|
|
29
29
|
try {
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
} catch (
|
|
30
|
+
const O = sessionStorage.getItem("editor_past");
|
|
31
|
+
return O ? JSON.parse(O) : [];
|
|
32
|
+
} catch (O) {
|
|
33
33
|
return [];
|
|
34
34
|
}
|
|
35
35
|
}), [v, y] = D(() => {
|
|
36
36
|
try {
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
} catch (
|
|
37
|
+
const O = sessionStorage.getItem("editor_future");
|
|
38
|
+
return O ? JSON.parse(O) : [];
|
|
39
|
+
} catch (O) {
|
|
40
40
|
return [];
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
|
|
43
|
+
G(() => {
|
|
44
44
|
n && n(m);
|
|
45
|
-
}, [m, n]),
|
|
45
|
+
}, [m, n]), G(() => {
|
|
46
46
|
sessionStorage.setItem("editor_past", JSON.stringify(r));
|
|
47
|
-
}, [r]),
|
|
47
|
+
}, [r]), G(() => {
|
|
48
48
|
sessionStorage.setItem("editor_future", JSON.stringify(v));
|
|
49
49
|
}, [v]);
|
|
50
|
-
const f =
|
|
50
|
+
const f = re(Date.now()), g = se.useCallback((O) => {
|
|
51
51
|
c((B) => {
|
|
52
|
-
const K = typeof
|
|
52
|
+
const K = typeof O == "function" ? O(B) : O;
|
|
53
53
|
if (JSON.stringify(B) !== JSON.stringify(K)) {
|
|
54
54
|
const P = Date.now();
|
|
55
55
|
h((E) => E.length > 0 && JSON.stringify(E[E.length - 1]) === JSON.stringify(B) ? E : P - f.current < 800 && E.length > 0 ? (f.current = P, E) : (f.current = P, [...E, B])), y([]);
|
|
56
56
|
}
|
|
57
57
|
return K;
|
|
58
58
|
});
|
|
59
|
-
}, []), p =
|
|
59
|
+
}, []), p = se.useCallback(() => {
|
|
60
60
|
if (r.length === 0) return;
|
|
61
|
-
const
|
|
62
|
-
h(B), y([m, ...v]), c(
|
|
63
|
-
}, [r, v, m, a]), N =
|
|
61
|
+
const O = r[r.length - 1], B = r.slice(0, r.length - 1);
|
|
62
|
+
h(B), y([m, ...v]), c(O), a == null || a("UNDO", null);
|
|
63
|
+
}, [r, v, m, a]), N = se.useCallback(() => {
|
|
64
64
|
if (v.length === 0) return;
|
|
65
|
-
const
|
|
66
|
-
y(B), h([...r, m]), c(
|
|
67
|
-
}, [r, v, m, a]), S = m,
|
|
65
|
+
const O = v[0], B = v.slice(1);
|
|
66
|
+
y(B), h([...r, m]), c(O), a == null || a("REDO", null);
|
|
67
|
+
}, [r, v, m, a]), S = m, C = r.length > 0, x = v.length > 0, [k, M] = D(!1), [w, A] = D(null), [T, I] = D([
|
|
68
68
|
0
|
|
69
|
-
]), [L,
|
|
70
|
-
}, []),
|
|
71
|
-
const
|
|
72
|
-
g((B) => [...B, { ...Pi, id:
|
|
73
|
-
}, [S, a, g]), _ =
|
|
74
|
-
(
|
|
69
|
+
]), [L, F] = D(""), [Z, ie] = D(0), X = se.useCallback(() => {
|
|
70
|
+
}, []), he = se.useCallback(() => {
|
|
71
|
+
const O = pe();
|
|
72
|
+
g((B) => [...B, { ...Pi, id: O }]), A(O), I([S.length]), a == null || a("ADD_SECTION", { sectionId: O });
|
|
73
|
+
}, [S, a, g]), _ = se.useCallback(
|
|
74
|
+
(O) => {
|
|
75
75
|
g(
|
|
76
|
-
(B) => B.filter((K) => K.id !==
|
|
77
|
-
), A(null), a == null || a("REMOVE_SECTION", { sectionId:
|
|
76
|
+
(B) => B.filter((K) => K.id !== O)
|
|
77
|
+
), A(null), a == null || a("REMOVE_SECTION", { sectionId: O });
|
|
78
78
|
},
|
|
79
79
|
[a, g]
|
|
80
|
-
), V =
|
|
81
|
-
(
|
|
80
|
+
), V = se.useCallback(
|
|
81
|
+
(O, B) => {
|
|
82
82
|
const K = S.find((E) => E.id === B), P = K == null ? void 0 : K.questionData.find(
|
|
83
|
-
(E) => E.id ===
|
|
83
|
+
(E) => E.id === O
|
|
84
84
|
);
|
|
85
85
|
P && (g(
|
|
86
86
|
(E) => E == null ? void 0 : E.map(
|
|
87
|
-
(
|
|
88
|
-
...
|
|
89
|
-
questionData:
|
|
90
|
-
} :
|
|
87
|
+
(q) => q.id === B ? {
|
|
88
|
+
...q,
|
|
89
|
+
questionData: q == null ? void 0 : q.questionData.filter(($) => P.type === "grid" ? $.gridId !== P.id && $.id !== P.id : $.id !== O)
|
|
90
|
+
} : q
|
|
91
91
|
)
|
|
92
|
-
), a == null || a("REMOVE_ELEMENT", { sectionId: B, elementId:
|
|
92
|
+
), a == null || a("REMOVE_ELEMENT", { sectionId: B, elementId: O }));
|
|
93
93
|
},
|
|
94
94
|
[S, g, a]
|
|
95
|
-
),
|
|
96
|
-
(
|
|
97
|
-
const K = S.find((
|
|
95
|
+
), ce = se.useCallback(
|
|
96
|
+
(O, B) => {
|
|
97
|
+
const K = S.find(($) => $.id === B);
|
|
98
98
|
if (!K) return;
|
|
99
99
|
const P = K == null ? void 0 : K.questionData.findIndex(
|
|
100
|
-
(
|
|
100
|
+
($) => $.id === O
|
|
101
101
|
);
|
|
102
102
|
if (P === -1) return;
|
|
103
|
-
const E = K == null ? void 0 : K.questionData[P],
|
|
104
|
-
...JSON.parse(JSON.stringify(
|
|
105
|
-
id:
|
|
106
|
-
...
|
|
103
|
+
const E = K == null ? void 0 : K.questionData[P], q = ($, j = {}) => ({
|
|
104
|
+
...JSON.parse(JSON.stringify($)),
|
|
105
|
+
id: pe(),
|
|
106
|
+
...j
|
|
107
107
|
});
|
|
108
108
|
g(
|
|
109
|
-
(
|
|
110
|
-
var
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
109
|
+
($) => $ == null ? void 0 : $.map((j) => {
|
|
110
|
+
var U;
|
|
111
|
+
if (j.id !== B) return j;
|
|
112
|
+
const H = [...j.questionData];
|
|
113
113
|
if (E.type === "grid") {
|
|
114
|
-
const
|
|
114
|
+
const Q = (U = H == null ? void 0 : H.map((fe, ii) => ({ e: fe, i: ii })).filter(
|
|
115
115
|
({ e: fe }) => fe.id === E.id || fe.gridId === E.id
|
|
116
|
-
)) == null ? void 0 :
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
(fe) =>
|
|
116
|
+
)) == null ? void 0 : U.map(({ i: fe }) => fe), oe = Q.length ? Math.max(...Q) + 1 : P + 1, le = pe(), me = q(E, {});
|
|
117
|
+
me.id = le;
|
|
118
|
+
const te = H.filter((fe) => fe.gridId === E.id), Ne = te == null ? void 0 : te.map(
|
|
119
|
+
(fe) => q(fe, { gridId: le })
|
|
120
120
|
), Le = [
|
|
121
|
-
...
|
|
122
|
-
|
|
121
|
+
...H.slice(0, oe),
|
|
122
|
+
me,
|
|
123
123
|
...Ne,
|
|
124
|
-
...
|
|
124
|
+
...H.slice(oe)
|
|
125
125
|
];
|
|
126
|
-
return { ...
|
|
126
|
+
return { ...j, questionData: Le };
|
|
127
127
|
} else if (E.gridId) {
|
|
128
|
-
const { gridId:
|
|
128
|
+
const { gridId: Q, gridPosition: oe, ...le } = E, me = q(le, {}), te = H.reduce(
|
|
129
129
|
(Le, fe, ii) => fe.id === E.gridId || fe.gridId === E.gridId ? ii : Le,
|
|
130
130
|
P
|
|
131
131
|
), Ne = [
|
|
132
|
-
...
|
|
133
|
-
|
|
134
|
-
...
|
|
132
|
+
...H.slice(0, te + 1),
|
|
133
|
+
me,
|
|
134
|
+
...H.slice(te + 1)
|
|
135
135
|
];
|
|
136
|
-
return { ...
|
|
136
|
+
return { ...j, questionData: Ne };
|
|
137
137
|
} else {
|
|
138
|
-
const
|
|
139
|
-
...
|
|
140
|
-
|
|
141
|
-
...
|
|
138
|
+
const Q = q(E, {}), oe = [
|
|
139
|
+
...H.slice(0, P + 1),
|
|
140
|
+
Q,
|
|
141
|
+
...H.slice(P + 1)
|
|
142
142
|
];
|
|
143
|
-
return { ...
|
|
143
|
+
return { ...j, questionData: oe };
|
|
144
144
|
}
|
|
145
145
|
})
|
|
146
|
-
), a == null || a("DUPLICATE_ELEMENT", { sectionId: B, elementId:
|
|
146
|
+
), a == null || a("DUPLICATE_ELEMENT", { sectionId: B, elementId: O });
|
|
147
147
|
},
|
|
148
148
|
[S, g, a]
|
|
149
|
-
), Ae =
|
|
150
|
-
(
|
|
149
|
+
), Ae = se.useCallback(
|
|
150
|
+
(O, B) => {
|
|
151
151
|
g(
|
|
152
152
|
(K) => K == null ? void 0 : K.map(
|
|
153
|
-
(P) => P.id === B ? { ...P, questionData:
|
|
153
|
+
(P) => P.id === B ? { ...P, questionData: O } : P
|
|
154
154
|
)
|
|
155
155
|
), a == null || a("UPDATE_ELEMENT_POSITION", { sectionId: B });
|
|
156
156
|
},
|
|
157
157
|
[g, a]
|
|
158
|
-
),
|
|
159
|
-
(
|
|
158
|
+
), ge = se.useCallback(
|
|
159
|
+
(O, B) => {
|
|
160
160
|
g(
|
|
161
161
|
(K) => K == null ? void 0 : K.map(
|
|
162
162
|
(P) => P.id === B ? {
|
|
163
163
|
...P,
|
|
164
|
-
questionData: [...P == null ? void 0 : P.questionData,
|
|
164
|
+
questionData: [...P == null ? void 0 : P.questionData, O]
|
|
165
165
|
} : P
|
|
166
166
|
)
|
|
167
|
-
), a == null || a("ADD_ELEMENT", { sectionId: B, element:
|
|
167
|
+
), a == null || a("ADD_ELEMENT", { sectionId: B, element: O });
|
|
168
168
|
},
|
|
169
169
|
[g, a]
|
|
170
|
-
),
|
|
171
|
-
(
|
|
170
|
+
), ue = se.useCallback(
|
|
171
|
+
(O, B, K) => {
|
|
172
172
|
g(
|
|
173
173
|
(P) => P == null ? void 0 : P.map(
|
|
174
174
|
(E) => E.id === B ? {
|
|
175
175
|
...E,
|
|
176
176
|
questionData: [
|
|
177
177
|
...E == null ? void 0 : E.questionData.slice(0, K),
|
|
178
|
-
|
|
178
|
+
O,
|
|
179
179
|
...E == null ? void 0 : E.questionData.slice(K)
|
|
180
180
|
]
|
|
181
181
|
} : E
|
|
182
182
|
)
|
|
183
|
-
), a == null || a("ADD_ELEMENT_IN_POSITION", { sectionId: B, element:
|
|
183
|
+
), a == null || a("ADD_ELEMENT_IN_POSITION", { sectionId: B, element: O, index: K });
|
|
184
184
|
},
|
|
185
185
|
[g, a]
|
|
186
|
-
), Se =
|
|
187
|
-
(
|
|
186
|
+
), Se = se.useCallback(
|
|
187
|
+
(O, B, K) => {
|
|
188
188
|
g(
|
|
189
189
|
(P) => P == null ? void 0 : P.map(
|
|
190
190
|
(E) => {
|
|
191
|
-
var
|
|
191
|
+
var q;
|
|
192
192
|
return E.id === K ? {
|
|
193
193
|
...E,
|
|
194
|
-
questionData: (
|
|
195
|
-
(
|
|
196
|
-
var
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
gridData: (
|
|
200
|
-
(
|
|
201
|
-
...
|
|
194
|
+
questionData: (q = E == null ? void 0 : E.questionData) == null ? void 0 : q.map(
|
|
195
|
+
($) => {
|
|
196
|
+
var j;
|
|
197
|
+
return $.type === "grid" && $.gridData ? {
|
|
198
|
+
...$,
|
|
199
|
+
gridData: (j = $.gridData) == null ? void 0 : j.map(
|
|
200
|
+
(H, U) => U === O ? {
|
|
201
|
+
...H,
|
|
202
202
|
...B
|
|
203
|
-
} :
|
|
203
|
+
} : H
|
|
204
204
|
).concat(
|
|
205
|
-
|
|
205
|
+
O >= $.gridData.length ? { ...B } : []
|
|
206
206
|
)
|
|
207
|
-
} :
|
|
207
|
+
} : $;
|
|
208
208
|
}
|
|
209
209
|
)
|
|
210
210
|
} : E;
|
|
211
211
|
}
|
|
212
212
|
)
|
|
213
|
-
), a == null || a("UPDATE_GRID_ELEMENT", { sectionId: K, gridIndex:
|
|
213
|
+
), a == null || a("UPDATE_GRID_ELEMENT", { sectionId: K, gridIndex: O, element: B });
|
|
214
214
|
},
|
|
215
215
|
[g, a]
|
|
216
|
-
),
|
|
217
|
-
(
|
|
216
|
+
), Ce = se.useCallback(
|
|
217
|
+
(O, B) => {
|
|
218
218
|
g(
|
|
219
219
|
(K) => K == null ? void 0 : K.map(
|
|
220
220
|
(P) => {
|
|
@@ -222,99 +222,99 @@ const ce = xn(void 0), Pi = {
|
|
|
222
222
|
return P.id === B ? {
|
|
223
223
|
...P,
|
|
224
224
|
questionData: (E = P == null ? void 0 : P.questionData) == null ? void 0 : E.map(
|
|
225
|
-
(
|
|
225
|
+
(q) => q.id === O.id ? { ...q, ...O } : q
|
|
226
226
|
)
|
|
227
227
|
} : P;
|
|
228
228
|
}
|
|
229
229
|
)
|
|
230
|
-
), a == null || a("UPDATE_ELEMENT", { sectionId: B, value:
|
|
230
|
+
), a == null || a("UPDATE_ELEMENT", { sectionId: B, value: O });
|
|
231
231
|
},
|
|
232
232
|
[g, a]
|
|
233
|
-
), Be =
|
|
234
|
-
(
|
|
233
|
+
), Be = se.useCallback(
|
|
234
|
+
(O) => {
|
|
235
235
|
const {
|
|
236
236
|
draggedId: B,
|
|
237
237
|
sectionId: K,
|
|
238
238
|
targetIndex: P,
|
|
239
239
|
targetId: E,
|
|
240
|
-
targetGridId:
|
|
241
|
-
targetCol:
|
|
242
|
-
} =
|
|
240
|
+
targetGridId: q,
|
|
241
|
+
targetCol: $
|
|
242
|
+
} = O;
|
|
243
243
|
g(
|
|
244
|
-
(
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
if (
|
|
251
|
-
const
|
|
252
|
-
(
|
|
244
|
+
(j) => j.map((H) => {
|
|
245
|
+
if (H.id !== K) return H;
|
|
246
|
+
const U = [...H == null ? void 0 : H.questionData], Q = U.findIndex((le) => le.id === B);
|
|
247
|
+
if (Q === -1) return H;
|
|
248
|
+
const oe = { ...U[Q] };
|
|
249
|
+
if (q !== void 0 && $ !== void 0) {
|
|
250
|
+
if (oe.type === "grid") return H;
|
|
251
|
+
const le = U.findIndex(
|
|
252
|
+
(te) => {
|
|
253
253
|
var Ne;
|
|
254
|
-
return
|
|
254
|
+
return te.id !== B && te.gridId === q && ((Ne = te.gridPosition) == null ? void 0 : Ne.col) === $;
|
|
255
255
|
}
|
|
256
256
|
);
|
|
257
|
-
let
|
|
258
|
-
(
|
|
259
|
-
...
|
|
260
|
-
gridId:
|
|
261
|
-
gridPosition: { col:
|
|
262
|
-
} :
|
|
257
|
+
let me = U.map(
|
|
258
|
+
(te) => te.id === B ? {
|
|
259
|
+
...te,
|
|
260
|
+
gridId: q,
|
|
261
|
+
gridPosition: { col: $ }
|
|
262
|
+
} : te
|
|
263
263
|
);
|
|
264
|
-
return
|
|
265
|
-
if (Ne !==
|
|
266
|
-
const Le = { ...
|
|
264
|
+
return le !== -1 && (me = me.map((te, Ne) => {
|
|
265
|
+
if (Ne !== le) return te;
|
|
266
|
+
const Le = { ...te };
|
|
267
267
|
return delete Le.gridId, delete Le.gridPosition, Le;
|
|
268
|
-
})), { ...
|
|
268
|
+
})), { ...H, questionData: me };
|
|
269
269
|
}
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
272
|
-
delete
|
|
273
|
-
const
|
|
274
|
-
return
|
|
270
|
+
if (oe.gridId && P !== void 0 && q === void 0) {
|
|
271
|
+
const le = { ...oe };
|
|
272
|
+
delete le.gridId, delete le.gridPosition;
|
|
273
|
+
const me = U.filter((Ne) => Ne.id !== B), te = Math.min(P, me.length);
|
|
274
|
+
return me.splice(te, 0, le), { ...H, questionData: me };
|
|
275
275
|
}
|
|
276
|
-
if (!
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
return
|
|
276
|
+
if (!oe.gridId && P !== void 0 && q === void 0 && !E) {
|
|
277
|
+
U.splice(Q, 1);
|
|
278
|
+
const le = Math.min(P, U.length);
|
|
279
|
+
return U.splice(le, 0, oe), { ...H, questionData: U };
|
|
280
280
|
}
|
|
281
281
|
if (E) {
|
|
282
|
-
const
|
|
283
|
-
return
|
|
282
|
+
const le = U.findIndex((me) => me.id === E);
|
|
283
|
+
return le === -1 ? H : (U.splice(Q, 1), U.splice(le, 0, oe), { ...H, questionData: U });
|
|
284
284
|
}
|
|
285
|
-
return
|
|
285
|
+
return H;
|
|
286
286
|
})
|
|
287
|
-
), a == null || a("MOVE_ELEMENT",
|
|
287
|
+
), a == null || a("MOVE_ELEMENT", O);
|
|
288
288
|
},
|
|
289
289
|
[g, a]
|
|
290
|
-
), Me =
|
|
291
|
-
(
|
|
290
|
+
), Me = se.useCallback(
|
|
291
|
+
(O, B) => {
|
|
292
292
|
g(
|
|
293
293
|
(K) => K == null ? void 0 : K.map(
|
|
294
294
|
(P) => P.id === B ? {
|
|
295
295
|
...P,
|
|
296
|
-
...
|
|
296
|
+
...O
|
|
297
297
|
} : P
|
|
298
298
|
)
|
|
299
|
-
), a == null || a("UPDATE_SECTION", { sectionId: B, value:
|
|
299
|
+
), a == null || a("UPDATE_SECTION", { sectionId: B, value: O });
|
|
300
300
|
},
|
|
301
301
|
[g, a]
|
|
302
|
-
), Ee =
|
|
302
|
+
), Ee = ee(
|
|
303
303
|
() => ({
|
|
304
304
|
formData: S,
|
|
305
305
|
setFormData: g,
|
|
306
|
-
handleDragStop:
|
|
306
|
+
handleDragStop: X,
|
|
307
307
|
removeElement: V,
|
|
308
308
|
elementData: u,
|
|
309
309
|
setElementData: t,
|
|
310
310
|
updateElementPosition: Ae,
|
|
311
|
-
addElement:
|
|
312
|
-
addElementInPosition:
|
|
313
|
-
updateElement:
|
|
314
|
-
addSection:
|
|
311
|
+
addElement: ge,
|
|
312
|
+
addElementInPosition: ue,
|
|
313
|
+
updateElement: Ce,
|
|
314
|
+
addSection: he,
|
|
315
315
|
removeSection: _,
|
|
316
316
|
updateSection: Me,
|
|
317
|
-
isDragging:
|
|
317
|
+
isDragging: k,
|
|
318
318
|
setIsDragging: M,
|
|
319
319
|
selectedSection: w,
|
|
320
320
|
setSelectedSection: A,
|
|
@@ -324,47 +324,47 @@ const ce = xn(void 0), Pi = {
|
|
|
324
324
|
answerData: l,
|
|
325
325
|
setAnswerData: d,
|
|
326
326
|
uploadUrl: L,
|
|
327
|
-
setUploadUrl:
|
|
327
|
+
setUploadUrl: F,
|
|
328
328
|
apiActivityCount: Z,
|
|
329
|
-
setApiActivityCount:
|
|
330
|
-
duplicateElement:
|
|
329
|
+
setApiActivityCount: ie,
|
|
330
|
+
duplicateElement: ce,
|
|
331
331
|
moveElement: Be,
|
|
332
332
|
showPreview: s,
|
|
333
333
|
setShowPreview: o,
|
|
334
334
|
undo: p,
|
|
335
335
|
redo: N,
|
|
336
|
-
canUndo:
|
|
336
|
+
canUndo: C,
|
|
337
337
|
canRedo: x
|
|
338
338
|
}),
|
|
339
339
|
[
|
|
340
340
|
S,
|
|
341
|
-
|
|
341
|
+
X,
|
|
342
342
|
V,
|
|
343
343
|
u,
|
|
344
344
|
Ae,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
ge,
|
|
346
|
+
ue,
|
|
347
|
+
Ce,
|
|
348
|
+
he,
|
|
349
349
|
_,
|
|
350
350
|
Me,
|
|
351
|
-
|
|
351
|
+
k,
|
|
352
352
|
w,
|
|
353
353
|
T,
|
|
354
354
|
Se,
|
|
355
355
|
l,
|
|
356
356
|
L,
|
|
357
357
|
Z,
|
|
358
|
-
|
|
358
|
+
ce,
|
|
359
359
|
Be,
|
|
360
360
|
s,
|
|
361
361
|
p,
|
|
362
362
|
N,
|
|
363
|
-
|
|
363
|
+
C,
|
|
364
364
|
x
|
|
365
365
|
]
|
|
366
366
|
);
|
|
367
|
-
return /* @__PURE__ */ i(
|
|
367
|
+
return /* @__PURE__ */ i(be.Provider, { value: Ee, children: e });
|
|
368
368
|
};
|
|
369
369
|
function Xi(e) {
|
|
370
370
|
var n, a, s = "";
|
|
@@ -375,12 +375,12 @@ function Xi(e) {
|
|
|
375
375
|
} else for (a in e) e[a] && (s && (s += " "), s += a);
|
|
376
376
|
return s;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function J() {
|
|
379
379
|
for (var e, n, a = 0, s = "", o = arguments.length; a < o; a++) (e = arguments[a]) && (n = Xi(e)) && (s && (s += " "), s += n);
|
|
380
380
|
return s;
|
|
381
381
|
}
|
|
382
382
|
function In({ type: e = "calendar", className: n }) {
|
|
383
|
-
return /* @__PURE__ */ i(
|
|
383
|
+
return /* @__PURE__ */ i(ve, { children: e === "calendar" ? /* @__PURE__ */ b(
|
|
384
384
|
"svg",
|
|
385
385
|
{
|
|
386
386
|
width: "20",
|
|
@@ -564,10 +564,10 @@ const vi = ({
|
|
|
564
564
|
showYearDropdown: t
|
|
565
565
|
}) => {
|
|
566
566
|
const m = e ? new Date(e) : null, [c, r] = D(m);
|
|
567
|
-
return
|
|
567
|
+
return G(() => {
|
|
568
568
|
const v = e ? new Date(e) : null;
|
|
569
569
|
(v && c && v.getTime() !== c.getTime() || !v && c || v && !c) && r(v);
|
|
570
|
-
}, [e]),
|
|
570
|
+
}, [e]), G(() => {
|
|
571
571
|
n && n(o, c);
|
|
572
572
|
}, [c, n, o]), /* @__PURE__ */ i("div", { className: "builder_date__picker", children: /* @__PURE__ */ i(
|
|
573
573
|
Sn,
|
|
@@ -602,7 +602,7 @@ function Kn({
|
|
|
602
602
|
watch: o
|
|
603
603
|
} = n || {};
|
|
604
604
|
let l;
|
|
605
|
-
return o && (l = o()[e.id]),
|
|
605
|
+
return o && (l = o()[e.id]), G(() => {
|
|
606
606
|
a(e.id);
|
|
607
607
|
}, [e.id]), /* @__PURE__ */ i(
|
|
608
608
|
vi,
|
|
@@ -629,7 +629,7 @@ function ai({
|
|
|
629
629
|
{
|
|
630
630
|
placeholder: (e == null ? void 0 : e.placeholder) || "",
|
|
631
631
|
type: (e == null ? void 0 : e.inputType) || "text",
|
|
632
|
-
className:
|
|
632
|
+
className: J("field-control", e == null ? void 0 : e.customClass),
|
|
633
633
|
...a(e == null ? void 0 : e.id),
|
|
634
634
|
disabled: n == null ? void 0 : n.isReadOnly,
|
|
635
635
|
inputMode: (e == null ? void 0 : e.inputMode) || void 0,
|
|
@@ -884,19 +884,19 @@ function $n(e, n) {
|
|
|
884
884
|
const g = [], p = f.hFlip, N = f.vFlip;
|
|
885
885
|
let S = f.rotate;
|
|
886
886
|
p ? N ? S += 2 : (g.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), g.push("scale(-1 1)"), o.top = o.left = 0) : N && (g.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), g.push("scale(1 -1)"), o.top = o.left = 0);
|
|
887
|
-
let
|
|
887
|
+
let C;
|
|
888
888
|
switch (S < 0 && (S -= Math.floor(S / 4) * 4), S = S % 4, S) {
|
|
889
889
|
case 1:
|
|
890
|
-
|
|
890
|
+
C = o.height / 2 + o.top, g.unshift("rotate(90 " + C.toString() + " " + C.toString() + ")");
|
|
891
891
|
break;
|
|
892
892
|
case 2:
|
|
893
893
|
g.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
894
894
|
break;
|
|
895
895
|
case 3:
|
|
896
|
-
|
|
896
|
+
C = o.width / 2 + o.left, g.unshift("rotate(-90 " + C.toString() + " " + C.toString() + ")");
|
|
897
897
|
break;
|
|
898
898
|
}
|
|
899
|
-
S % 2 === 1 && (o.left !== o.top && (
|
|
899
|
+
S % 2 === 1 && (o.left !== o.top && (C = o.left, o.left = o.top, o.top = C), o.width !== o.height && (C = o.width, o.width = o.height, o.height = C)), g.length && (l = Yn(l, '<g transform="' + g.join(" ") + '">', "</g>"));
|
|
900
900
|
});
|
|
901
901
|
const d = s.width, u = s.height, t = o.width, m = o.height;
|
|
902
902
|
let c, r;
|
|
@@ -952,15 +952,15 @@ function Ni(e) {
|
|
|
952
952
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
953
953
|
};
|
|
954
954
|
}
|
|
955
|
-
const
|
|
955
|
+
const ki = /* @__PURE__ */ Object.create(null), je = ["https://api.simplesvg.com", "https://api.unisvg.com"], qe = [];
|
|
956
956
|
for (; je.length > 0; ) je.length === 1 || Math.random() > 0.5 ? qe.push(je.shift()) : qe.push(je.pop());
|
|
957
|
-
|
|
957
|
+
ki[""] = Ni({ resources: ["https://api.iconify.design"].concat(qe) });
|
|
958
958
|
function aa(e, n) {
|
|
959
959
|
const a = Ni(n);
|
|
960
|
-
return a === null ? !1 : (
|
|
960
|
+
return a === null ? !1 : (ki[e] = a, !0);
|
|
961
961
|
}
|
|
962
|
-
function
|
|
963
|
-
return
|
|
962
|
+
function Ci(e) {
|
|
963
|
+
return ki[e];
|
|
964
964
|
}
|
|
965
965
|
const oa = () => {
|
|
966
966
|
let e;
|
|
@@ -971,7 +971,7 @@ const oa = () => {
|
|
|
971
971
|
};
|
|
972
972
|
let Oi = oa();
|
|
973
973
|
function sa(e, n) {
|
|
974
|
-
const a =
|
|
974
|
+
const a = Ci(e);
|
|
975
975
|
if (!a) return 0;
|
|
976
976
|
let s;
|
|
977
977
|
if (!a.maxURL) s = 0;
|
|
@@ -1007,7 +1007,7 @@ const da = (e, n, a) => {
|
|
|
1007
1007
|
};
|
|
1008
1008
|
function ua(e) {
|
|
1009
1009
|
if (typeof e == "string") {
|
|
1010
|
-
const n =
|
|
1010
|
+
const n = Ci(e);
|
|
1011
1011
|
if (n) return n.path;
|
|
1012
1012
|
}
|
|
1013
1013
|
return "/";
|
|
@@ -1154,12 +1154,12 @@ function ga(e, n, a, s) {
|
|
|
1154
1154
|
const o = e.resources.length, l = e.random ? Math.floor(Math.random() * o) : e.index;
|
|
1155
1155
|
let d;
|
|
1156
1156
|
if (e.random) {
|
|
1157
|
-
let
|
|
1158
|
-
for (d = [];
|
|
1159
|
-
const M = Math.floor(Math.random() *
|
|
1160
|
-
d.push(
|
|
1157
|
+
let k = e.resources.slice(0);
|
|
1158
|
+
for (d = []; k.length > 1; ) {
|
|
1159
|
+
const M = Math.floor(Math.random() * k.length);
|
|
1160
|
+
d.push(k[M]), k = k.slice(0, M).concat(k.slice(M + 1));
|
|
1161
1161
|
}
|
|
1162
|
-
d = d.concat(
|
|
1162
|
+
d = d.concat(k);
|
|
1163
1163
|
} else d = e.resources.slice(l).concat(e.resources.slice(0, l));
|
|
1164
1164
|
const u = Date.now();
|
|
1165
1165
|
let t = "pending", m = 0, c, r = null, h = [], v = [];
|
|
@@ -1168,12 +1168,12 @@ function ga(e, n, a, s) {
|
|
|
1168
1168
|
r && (clearTimeout(r), r = null);
|
|
1169
1169
|
}
|
|
1170
1170
|
function f() {
|
|
1171
|
-
t === "pending" && (t = "aborted"), y(), h.forEach((
|
|
1172
|
-
|
|
1171
|
+
t === "pending" && (t = "aborted"), y(), h.forEach((k) => {
|
|
1172
|
+
k.status === "pending" && (k.status = "aborted");
|
|
1173
1173
|
}), h = [];
|
|
1174
1174
|
}
|
|
1175
|
-
function g(
|
|
1176
|
-
M && (v = []), typeof
|
|
1175
|
+
function g(k, M) {
|
|
1176
|
+
M && (v = []), typeof k == "function" && v.push(k);
|
|
1177
1177
|
}
|
|
1178
1178
|
function p() {
|
|
1179
1179
|
return {
|
|
@@ -1187,18 +1187,18 @@ function ga(e, n, a, s) {
|
|
|
1187
1187
|
};
|
|
1188
1188
|
}
|
|
1189
1189
|
function N() {
|
|
1190
|
-
t = "failed", v.forEach((
|
|
1191
|
-
|
|
1190
|
+
t = "failed", v.forEach((k) => {
|
|
1191
|
+
k(void 0, c);
|
|
1192
1192
|
});
|
|
1193
1193
|
}
|
|
1194
1194
|
function S() {
|
|
1195
|
-
h.forEach((
|
|
1196
|
-
|
|
1195
|
+
h.forEach((k) => {
|
|
1196
|
+
k.status === "pending" && (k.status = "aborted");
|
|
1197
1197
|
}), h = [];
|
|
1198
1198
|
}
|
|
1199
|
-
function k
|
|
1199
|
+
function C(k, M, w) {
|
|
1200
1200
|
const A = M !== "success";
|
|
1201
|
-
switch (h = h.filter((T) => T !==
|
|
1201
|
+
switch (h = h.filter((T) => T !== k), t) {
|
|
1202
1202
|
case "pending":
|
|
1203
1203
|
break;
|
|
1204
1204
|
case "failed":
|
|
@@ -1216,7 +1216,7 @@ function ga(e, n, a, s) {
|
|
|
1216
1216
|
return;
|
|
1217
1217
|
}
|
|
1218
1218
|
if (y(), S(), !e.random) {
|
|
1219
|
-
const T = e.resources.indexOf(
|
|
1219
|
+
const T = e.resources.indexOf(k.resource);
|
|
1220
1220
|
T !== -1 && T !== e.index && (e.index = T);
|
|
1221
1221
|
}
|
|
1222
1222
|
t = "completed", v.forEach((T) => {
|
|
@@ -1226,8 +1226,8 @@ function ga(e, n, a, s) {
|
|
|
1226
1226
|
function x() {
|
|
1227
1227
|
if (t !== "pending") return;
|
|
1228
1228
|
y();
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1229
|
+
const k = d.shift();
|
|
1230
|
+
if (k === void 0) {
|
|
1231
1231
|
if (h.length) {
|
|
1232
1232
|
r = setTimeout(() => {
|
|
1233
1233
|
y(), t === "pending" && (S(), N());
|
|
@@ -1239,12 +1239,12 @@ function ga(e, n, a, s) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
const M = {
|
|
1241
1241
|
status: "pending",
|
|
1242
|
-
resource:
|
|
1242
|
+
resource: k,
|
|
1243
1243
|
callback: (w, A) => {
|
|
1244
|
-
|
|
1244
|
+
C(M, w, A);
|
|
1245
1245
|
}
|
|
1246
1246
|
};
|
|
1247
|
-
h.push(M), m++, r = setTimeout(x, e.rotate), a(
|
|
1247
|
+
h.push(M), m++, r = setTimeout(x, e.rotate), a(k, n, M.callback);
|
|
1248
1248
|
}
|
|
1249
1249
|
return setTimeout(x), p;
|
|
1250
1250
|
}
|
|
@@ -1281,7 +1281,7 @@ function Gi() {
|
|
|
1281
1281
|
const si = /* @__PURE__ */ Object.create(null);
|
|
1282
1282
|
function fa(e) {
|
|
1283
1283
|
if (!si[e]) {
|
|
1284
|
-
const n =
|
|
1284
|
+
const n = Ci(e);
|
|
1285
1285
|
if (!n) return;
|
|
1286
1286
|
const a = cn(n), s = {
|
|
1287
1287
|
config: n,
|
|
@@ -1415,7 +1415,7 @@ const Na = (e, n) => {
|
|
|
1415
1415
|
m.length && Sa(t, m);
|
|
1416
1416
|
}), n ? ba(n, s, l) : ji;
|
|
1417
1417
|
};
|
|
1418
|
-
function
|
|
1418
|
+
function ka(e, n) {
|
|
1419
1419
|
const a = { ...e };
|
|
1420
1420
|
for (const s in n) {
|
|
1421
1421
|
const o = n[s], l = typeof o;
|
|
@@ -1423,9 +1423,9 @@ function Ca(e, n) {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
return a;
|
|
1425
1425
|
}
|
|
1426
|
-
const
|
|
1426
|
+
const Ca = /[\s,]+/;
|
|
1427
1427
|
function Ma(e, n) {
|
|
1428
|
-
n.split(
|
|
1428
|
+
n.split(Ca).forEach((a) => {
|
|
1429
1429
|
switch (a.trim()) {
|
|
1430
1430
|
case "horizontal":
|
|
1431
1431
|
e.hFlip = !0;
|
|
@@ -1522,7 +1522,7 @@ function Ui(e) {
|
|
|
1522
1522
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1523
1523
|
}
|
|
1524
1524
|
const Oa = (e, n, a) => {
|
|
1525
|
-
const s = n.inline ? Ka : rn, o =
|
|
1525
|
+
const s = n.inline ? Ka : rn, o = ka(s, n), l = n.mode || "svg", d = {}, u = n.style || {}, t = {
|
|
1526
1526
|
...l === "svg" ? Da : {}
|
|
1527
1527
|
};
|
|
1528
1528
|
if (a) {
|
|
@@ -1697,7 +1697,7 @@ function bn(e) {
|
|
|
1697
1697
|
});
|
|
1698
1698
|
} else f && ((v = e.onLoad) === null || v === void 0 || v.call(e, y));
|
|
1699
1699
|
}
|
|
1700
|
-
|
|
1700
|
+
G(() => (a(!0), t), []), G(() => {
|
|
1701
1701
|
n && c();
|
|
1702
1702
|
}, [e.icon, n]);
|
|
1703
1703
|
const { name: r, data: h } = d;
|
|
@@ -1715,11 +1715,11 @@ Zi((e, n) => bn({
|
|
|
1715
1715
|
...e,
|
|
1716
1716
|
_ref: n
|
|
1717
1717
|
}));
|
|
1718
|
-
function
|
|
1718
|
+
function z({
|
|
1719
1719
|
icon: e,
|
|
1720
1720
|
iconClass: n
|
|
1721
1721
|
}) {
|
|
1722
|
-
return /* @__PURE__ */ i(
|
|
1722
|
+
return /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(vn, { icon: e, className: n }) });
|
|
1723
1723
|
}
|
|
1724
1724
|
function Mi({
|
|
1725
1725
|
element: e,
|
|
@@ -1736,13 +1736,13 @@ function Mi({
|
|
|
1736
1736
|
} = n || {}, [t, m] = D(() => {
|
|
1737
1737
|
const h = u == null ? void 0 : u(e.id);
|
|
1738
1738
|
return Array.isArray(h) ? h : [];
|
|
1739
|
-
}), c =
|
|
1739
|
+
}), c = ee(
|
|
1740
1740
|
() => t == null ? void 0 : t.map((h) => h.label).join(", "),
|
|
1741
1741
|
[t]
|
|
1742
1742
|
);
|
|
1743
|
-
return
|
|
1743
|
+
return G(() => {
|
|
1744
1744
|
s(e.id);
|
|
1745
|
-
}, [e.id, s]),
|
|
1745
|
+
}, [e.id, s]), G(() => {
|
|
1746
1746
|
if (!d) return;
|
|
1747
1747
|
const h = d((v) => {
|
|
1748
1748
|
const y = v[e.id];
|
|
@@ -1753,7 +1753,7 @@ function Mi({
|
|
|
1753
1753
|
return (v = h.unsubscribe) == null ? void 0 : v.call(h);
|
|
1754
1754
|
};
|
|
1755
1755
|
}, [d, e.id]), /* @__PURE__ */ i("div", { className: "custom-select", children: /* @__PURE__ */ i(
|
|
1756
|
-
|
|
1756
|
+
ae,
|
|
1757
1757
|
{
|
|
1758
1758
|
value: t || [],
|
|
1759
1759
|
onChange: (h) => {
|
|
@@ -1764,24 +1764,24 @@ function Mi({
|
|
|
1764
1764
|
by: "value",
|
|
1765
1765
|
children: /* @__PURE__ */ b("div", { className: "custom-select__wrapper", children: [
|
|
1766
1766
|
/* @__PURE__ */ b(
|
|
1767
|
-
|
|
1767
|
+
ae.Button,
|
|
1768
1768
|
{
|
|
1769
1769
|
className: "custom-select__control field-control",
|
|
1770
1770
|
disabled: l,
|
|
1771
1771
|
children: [
|
|
1772
1772
|
/* @__PURE__ */ i("span", { className: "custom-select__value", children: (t == null ? void 0 : t.length) > 0 ? c : /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a != null ? a : " Select options" }) }),
|
|
1773
|
-
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(
|
|
1773
|
+
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) })
|
|
1774
1774
|
]
|
|
1775
1775
|
}
|
|
1776
1776
|
),
|
|
1777
1777
|
/* @__PURE__ */ i(we, { as: ze, leave: "custom-select__transition", children: /* @__PURE__ */ i(
|
|
1778
|
-
|
|
1778
|
+
ae.Options,
|
|
1779
1779
|
{
|
|
1780
1780
|
anchor: "bottom start",
|
|
1781
1781
|
className: "custom-select__options",
|
|
1782
1782
|
children: (r = e == null ? void 0 : e.options) == null ? void 0 : r.map(
|
|
1783
1783
|
(h, v) => /* @__PURE__ */ i(
|
|
1784
|
-
|
|
1784
|
+
ae.Option,
|
|
1785
1785
|
{
|
|
1786
1786
|
value: h,
|
|
1787
1787
|
className: ({ active: y }) => `custom-select__option ${y ? "custom-select__option--active" : ""}`,
|
|
@@ -1830,9 +1830,9 @@ function pn({
|
|
|
1830
1830
|
removeFile: a
|
|
1831
1831
|
}) {
|
|
1832
1832
|
const [s, o] = D(!1), [l, d] = D("unknown"), [u, t] = D(null);
|
|
1833
|
-
|
|
1833
|
+
G(() => {
|
|
1834
1834
|
e && d(ja(e));
|
|
1835
|
-
}, [e]),
|
|
1835
|
+
}, [e]), G(() => {
|
|
1836
1836
|
if (l === "pdf" && (e != null && e.startsWith("data:")))
|
|
1837
1837
|
try {
|
|
1838
1838
|
const v = atob(e.split(",")[1]), y = new ArrayBuffer(v.length), f = new Uint8Array(y);
|
|
@@ -1867,8 +1867,8 @@ function pn({
|
|
|
1867
1867
|
className: "!flex items-center rounded cursor-pointer gap-x-3",
|
|
1868
1868
|
title: `Click to preview ${r}`,
|
|
1869
1869
|
children: [
|
|
1870
|
-
l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(
|
|
1871
|
-
l !== "image" && /* @__PURE__ */ i(
|
|
1870
|
+
l === "image" && /* @__PURE__ */ i("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ i(z, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
|
|
1871
|
+
l !== "image" && /* @__PURE__ */ i(z, { icon: Ha[l], iconClass: "text-4xl" }),
|
|
1872
1872
|
/* @__PURE__ */ i("span", { className: "text-sm font-semibold text-center text-gray-700 truncate max-w-[300px]", children: r })
|
|
1873
1873
|
]
|
|
1874
1874
|
}
|
|
@@ -1881,7 +1881,7 @@ function pn({
|
|
|
1881
1881
|
className: "p-2",
|
|
1882
1882
|
onClick: () => h(u || e, n),
|
|
1883
1883
|
title: `Download ${r}`,
|
|
1884
|
-
children: /* @__PURE__ */ i(
|
|
1884
|
+
children: /* @__PURE__ */ i(z, { icon: "streamline-flex:download-tray-solid" })
|
|
1885
1885
|
}
|
|
1886
1886
|
),
|
|
1887
1887
|
a && /* @__PURE__ */ i(
|
|
@@ -1890,7 +1890,7 @@ function pn({
|
|
|
1890
1890
|
type: "button",
|
|
1891
1891
|
className: "p-2 text-lg text-red-500",
|
|
1892
1892
|
onClick: a,
|
|
1893
|
-
children: /* @__PURE__ */ i(
|
|
1893
|
+
children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone" })
|
|
1894
1894
|
}
|
|
1895
1895
|
)
|
|
1896
1896
|
] }),
|
|
@@ -1937,7 +1937,7 @@ function pn({
|
|
|
1937
1937
|
)
|
|
1938
1938
|
] });
|
|
1939
1939
|
}
|
|
1940
|
-
const
|
|
1940
|
+
const de = (e) => {
|
|
1941
1941
|
const n = typeof window != "undefined" ? localStorage.getItem(e) : "";
|
|
1942
1942
|
try {
|
|
1943
1943
|
return JSON.parse(n);
|
|
@@ -1956,20 +1956,20 @@ function Va({
|
|
|
1956
1956
|
list: o = null,
|
|
1957
1957
|
accept: l = []
|
|
1958
1958
|
}) {
|
|
1959
|
-
const { uploadUrl: d, setApiActivityCount: u } = ye(
|
|
1960
|
-
|
|
1959
|
+
const { uploadUrl: d, setApiActivityCount: u } = ye(be), t = re(null), [m, c] = D(o), [r, h] = D(!1);
|
|
1960
|
+
G(() => {
|
|
1961
1961
|
c(o);
|
|
1962
1962
|
}, [o]);
|
|
1963
|
-
const v =
|
|
1963
|
+
const v = ee(
|
|
1964
1964
|
() => l == null ? void 0 : l.map((x) => x.value).join(", "),
|
|
1965
1965
|
[l]
|
|
1966
|
-
), y =
|
|
1966
|
+
), y = ee(
|
|
1967
1967
|
() => l == null ? void 0 : l.map((x) => x.label).join(", "),
|
|
1968
1968
|
[l]
|
|
1969
1969
|
), f = Y(
|
|
1970
1970
|
async (x) => {
|
|
1971
1971
|
var w, A;
|
|
1972
|
-
const
|
|
1972
|
+
const k = de("token"), M = ((w = de("orgData")) == null ? void 0 : w.id) || de("organizationId");
|
|
1973
1973
|
try {
|
|
1974
1974
|
const { data: T } = await Pe.post(
|
|
1975
1975
|
d,
|
|
@@ -1980,7 +1980,7 @@ function Va({
|
|
|
1980
1980
|
},
|
|
1981
1981
|
{
|
|
1982
1982
|
headers: {
|
|
1983
|
-
Authorization: `Bearer ${
|
|
1983
|
+
Authorization: `Bearer ${k}`
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
);
|
|
@@ -1991,7 +1991,7 @@ function Va({
|
|
|
1991
1991
|
},
|
|
1992
1992
|
[d]
|
|
1993
1993
|
), g = Y(
|
|
1994
|
-
(x) => new Promise((
|
|
1994
|
+
(x) => new Promise((k, M) => {
|
|
1995
1995
|
const w = new FileReader();
|
|
1996
1996
|
w.onloadend = async () => {
|
|
1997
1997
|
try {
|
|
@@ -2003,7 +2003,7 @@ function Va({
|
|
|
2003
2003
|
ext: `.${x.name.split(".").pop()}`,
|
|
2004
2004
|
fileName: x.name
|
|
2005
2005
|
}) : w.result;
|
|
2006
|
-
|
|
2006
|
+
k({
|
|
2007
2007
|
base64: T,
|
|
2008
2008
|
type: x.type,
|
|
2009
2009
|
name: x.name
|
|
@@ -2017,13 +2017,13 @@ function Va({
|
|
|
2017
2017
|
), p = Y(
|
|
2018
2018
|
(x) => {
|
|
2019
2019
|
var M;
|
|
2020
|
-
const
|
|
2020
|
+
const k = v ? (M = v.split(",")) == null ? void 0 : M.map((w) => w.trim()) : [];
|
|
2021
2021
|
for (const w of x) {
|
|
2022
2022
|
if (w.size > Fa)
|
|
2023
2023
|
return xe.error(
|
|
2024
2024
|
`File "${w.name}" exceeds 5MB limit (${(w.size / 1024 / 1024).toFixed(2)}MB)`
|
|
2025
2025
|
), !1;
|
|
2026
|
-
if (
|
|
2026
|
+
if (k.length && !k.some(
|
|
2027
2027
|
(A) => w.type === A || w.name.toLowerCase().endsWith(A.replace("*", ""))
|
|
2028
2028
|
))
|
|
2029
2029
|
return xe.error(
|
|
@@ -2035,16 +2035,16 @@ function Va({
|
|
|
2035
2035
|
[v, y]
|
|
2036
2036
|
), N = Y(
|
|
2037
2037
|
async (x) => {
|
|
2038
|
-
const
|
|
2039
|
-
if (!(!
|
|
2040
|
-
if (!p(
|
|
2038
|
+
const k = Array.from(x.target.files || []);
|
|
2039
|
+
if (!(!k.length || r)) {
|
|
2040
|
+
if (!p(k)) {
|
|
2041
2041
|
t.current && (t.current.value = "");
|
|
2042
2042
|
return;
|
|
2043
2043
|
}
|
|
2044
2044
|
try {
|
|
2045
2045
|
h(!0), u == null || u((A) => A + 1);
|
|
2046
|
-
const M = await Promise.all(
|
|
2047
|
-
c(w), e(w), xe.success(`Successfully uploaded ${
|
|
2046
|
+
const M = await Promise.all(k == null ? void 0 : k.map(g)), w = s && m ? [...m, ...M] : M;
|
|
2047
|
+
c(w), e(w), xe.success(`Successfully uploaded ${k.length} file(s)`);
|
|
2048
2048
|
} catch (M) {
|
|
2049
2049
|
console.error("Upload error:", M), xe.error("Failed to upload file(s). Please try again.");
|
|
2050
2050
|
} finally {
|
|
@@ -2055,13 +2055,13 @@ function Va({
|
|
|
2055
2055
|
[r, p, g, e, s, m, u]
|
|
2056
2056
|
), S = Y(
|
|
2057
2057
|
(x) => {
|
|
2058
|
-
r || (t.current && (t.current.value = ""), c((
|
|
2059
|
-
const M = x === void 0 ? null : (
|
|
2058
|
+
r || (t.current && (t.current.value = ""), c((k) => {
|
|
2059
|
+
const M = x === void 0 ? null : (k == null ? void 0 : k.filter((w, A) => A !== x)) || null;
|
|
2060
2060
|
return e(M), M;
|
|
2061
2061
|
}), a == null || a());
|
|
2062
2062
|
},
|
|
2063
2063
|
[a, e, r]
|
|
2064
|
-
),
|
|
2064
|
+
), C = m && m.length > 0;
|
|
2065
2065
|
return /* @__PURE__ */ b("div", { className: "flex flex-col items-start gap-2", children: [
|
|
2066
2066
|
!n && /* @__PURE__ */ b("div", { className: "!flex field-control !py-0 !px-0 relative", children: [
|
|
2067
2067
|
/* @__PURE__ */ i(
|
|
@@ -2080,7 +2080,7 @@ function Va({
|
|
|
2080
2080
|
hover:file:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed`
|
|
2081
2081
|
}
|
|
2082
2082
|
),
|
|
2083
|
-
|
|
2083
|
+
C && /* @__PURE__ */ i(
|
|
2084
2084
|
"button",
|
|
2085
2085
|
{
|
|
2086
2086
|
type: "button",
|
|
@@ -2088,23 +2088,23 @@ function Va({
|
|
|
2088
2088
|
onClick: () => S(),
|
|
2089
2089
|
disabled: r,
|
|
2090
2090
|
"aria-label": "Remove all files",
|
|
2091
|
-
children: /* @__PURE__ */ i(
|
|
2091
|
+
children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone" })
|
|
2092
2092
|
}
|
|
2093
2093
|
)
|
|
2094
2094
|
] }),
|
|
2095
|
-
|
|
2095
|
+
C && /* @__PURE__ */ b("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
|
|
2096
2096
|
r && /* @__PURE__ */ i("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ b("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
|
|
2097
2097
|
/* @__PURE__ */ i("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
|
|
2098
2098
|
"Uploading..."
|
|
2099
2099
|
] }) }),
|
|
2100
|
-
typeof m == "object" && (m == null ? void 0 : m.map((x,
|
|
2100
|
+
typeof m == "object" && (m == null ? void 0 : m.map((x, k) => /* @__PURE__ */ i(
|
|
2101
2101
|
pn,
|
|
2102
2102
|
{
|
|
2103
2103
|
fileUrl: x.base64,
|
|
2104
2104
|
fileName: x.name,
|
|
2105
|
-
removeFile: () => S(
|
|
2105
|
+
removeFile: () => S(k)
|
|
2106
2106
|
},
|
|
2107
|
-
`${x.name}-${
|
|
2107
|
+
`${x.name}-${k}`
|
|
2108
2108
|
)))
|
|
2109
2109
|
] })
|
|
2110
2110
|
] });
|
|
@@ -2117,9 +2117,9 @@ function Ua({ element: e, validationData: n }) {
|
|
|
2117
2117
|
isReadOnly: d,
|
|
2118
2118
|
watch: u
|
|
2119
2119
|
} = n || {};
|
|
2120
|
-
|
|
2120
|
+
G(() => {
|
|
2121
2121
|
o(e.id);
|
|
2122
|
-
}, [e.id, o]),
|
|
2122
|
+
}, [e.id, o]), G(() => {
|
|
2123
2123
|
if (u) {
|
|
2124
2124
|
const r = u((h) => {
|
|
2125
2125
|
s(h[e.id]);
|
|
@@ -2150,7 +2150,7 @@ function Ua({ element: e, validationData: n }) {
|
|
|
2150
2150
|
accept: e == null ? void 0 : e.acceptedFiles
|
|
2151
2151
|
}
|
|
2152
2152
|
),
|
|
2153
|
-
d && /* @__PURE__ */ i(
|
|
2153
|
+
d && /* @__PURE__ */ i(ve, { children: a ? /* @__PURE__ */ i("div", { className: "relative grid gap-y-1 flex-1 w-full", children: typeof a == "object" && Array.isArray(a) && a.map(
|
|
2154
2154
|
(r, h) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
2155
2155
|
pn,
|
|
2156
2156
|
{
|
|
@@ -2171,13 +2171,13 @@ function Wa({
|
|
|
2171
2171
|
{
|
|
2172
2172
|
placeholder: e.placeholder,
|
|
2173
2173
|
type: e.inputType,
|
|
2174
|
-
className:
|
|
2174
|
+
className: J("field-control", e == null ? void 0 : e.customClass),
|
|
2175
2175
|
...a(e.id),
|
|
2176
2176
|
disabled: n == null ? void 0 : n.isReadOnly
|
|
2177
2177
|
}
|
|
2178
2178
|
);
|
|
2179
2179
|
}
|
|
2180
|
-
const
|
|
2180
|
+
const W = ({
|
|
2181
2181
|
label: e,
|
|
2182
2182
|
name: n,
|
|
2183
2183
|
register: a,
|
|
@@ -2197,7 +2197,7 @@ const z = ({
|
|
|
2197
2197
|
description: g,
|
|
2198
2198
|
onChange: p
|
|
2199
2199
|
}) => {
|
|
2200
|
-
var S,
|
|
2200
|
+
var S, C, x, k;
|
|
2201
2201
|
const N = a ? { ...a(n) } : {};
|
|
2202
2202
|
if (l === "amount")
|
|
2203
2203
|
return /* @__PURE__ */ b("div", { className: "space-y-1.5 relative", children: [
|
|
@@ -2256,7 +2256,7 @@ const z = ({
|
|
|
2256
2256
|
peer-disabled:cursor-not-allowed
|
|
2257
2257
|
`,
|
|
2258
2258
|
children: w && /* @__PURE__ */ i(
|
|
2259
|
-
|
|
2259
|
+
z,
|
|
2260
2260
|
{
|
|
2261
2261
|
icon: "meteor-icons:check",
|
|
2262
2262
|
iconClass: "w-3.5 h-3.5 text-white"
|
|
@@ -2271,7 +2271,7 @@ const z = ({
|
|
|
2271
2271
|
]
|
|
2272
2272
|
}
|
|
2273
2273
|
),
|
|
2274
|
-
(s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "ml-8 text-sm text-red-600", children: (
|
|
2274
|
+
(s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "ml-8 text-sm text-red-600", children: (C = s[n]) == null ? void 0 : C.message })
|
|
2275
2275
|
] });
|
|
2276
2276
|
}
|
|
2277
2277
|
return l === "textarea" ? /* @__PURE__ */ b("div", { className: "space-y-1.5 relative", children: [
|
|
@@ -2320,7 +2320,7 @@ const z = ({
|
|
|
2320
2320
|
max: f
|
|
2321
2321
|
}
|
|
2322
2322
|
),
|
|
2323
|
-
(s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "mt-1 text-sm text-red-600", children: (
|
|
2323
|
+
(s == null ? void 0 : s[n]) && /* @__PURE__ */ i("p", { className: "mt-1 text-sm text-red-600", children: (k = s[n]) == null ? void 0 : k.message })
|
|
2324
2324
|
] });
|
|
2325
2325
|
};
|
|
2326
2326
|
function za({
|
|
@@ -2329,9 +2329,9 @@ function za({
|
|
|
2329
2329
|
}) {
|
|
2330
2330
|
var o;
|
|
2331
2331
|
const { register: a = () => ({}), watch: s } = n || {};
|
|
2332
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2332
|
+
return /* @__PURE__ */ i("div", { className: J("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
|
|
2333
2333
|
(l) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
2334
|
-
|
|
2334
|
+
W,
|
|
2335
2335
|
{
|
|
2336
2336
|
placeholder: e.placeholder,
|
|
2337
2337
|
type: e.inputType,
|
|
@@ -2357,9 +2357,9 @@ function qa({
|
|
|
2357
2357
|
}) {
|
|
2358
2358
|
var o;
|
|
2359
2359
|
const { register: a = () => ({}), watch: s } = n || {};
|
|
2360
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2360
|
+
return /* @__PURE__ */ i("div", { className: J("grid gap-y-[6px]", e.customClass), children: (o = e == null ? void 0 : e.options) == null ? void 0 : o.map(
|
|
2361
2361
|
(l) => /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
2362
|
-
|
|
2362
|
+
W,
|
|
2363
2363
|
{
|
|
2364
2364
|
placeholder: e.placeholder,
|
|
2365
2365
|
type: e.inputType,
|
|
@@ -2390,39 +2390,39 @@ const Ie = ({
|
|
|
2390
2390
|
loading: v,
|
|
2391
2391
|
disabled: y
|
|
2392
2392
|
}) => {
|
|
2393
|
-
const [f, g] = D(m ? [] : null), p =
|
|
2394
|
-
(
|
|
2393
|
+
const [f, g] = D(m ? [] : null), p = re(!1), N = ee(() => !u || !e || e.length === 0 ? m ? [] : null : m ? Array.isArray(u) ? e.filter((x) => u.some(
|
|
2394
|
+
(k) => {
|
|
2395
2395
|
var M;
|
|
2396
|
-
return typeof x.value == "object" ? ((M = x.value) == null ? void 0 : M.id) === (
|
|
2396
|
+
return typeof x.value == "object" ? ((M = x.value) == null ? void 0 : M.id) === (k == null ? void 0 : k.id) : x.value === k;
|
|
2397
2397
|
}
|
|
2398
2398
|
)) : [] : e.find((x) => {
|
|
2399
|
-
var
|
|
2400
|
-
return typeof x.value == "string" && typeof u == "string" ? x.value.toLowerCase() === u.toLowerCase() : typeof x.value == "object" && typeof u == "object" ? ((
|
|
2399
|
+
var k;
|
|
2400
|
+
return typeof x.value == "string" && typeof u == "string" ? x.value.toLowerCase() === u.toLowerCase() : typeof x.value == "object" && typeof u == "object" ? ((k = x.value) == null ? void 0 : k.id) === (u == null ? void 0 : u.id) : x.value === u;
|
|
2401
2401
|
}) || null, [u, e, m]);
|
|
2402
|
-
|
|
2402
|
+
G(() => {
|
|
2403
2403
|
if (p.current) {
|
|
2404
2404
|
p.current = !1;
|
|
2405
2405
|
return;
|
|
2406
2406
|
}
|
|
2407
2407
|
if (m && Array.isArray(N) && Array.isArray(f)) {
|
|
2408
|
-
const x = f == null ? void 0 : f.map((M) => M.value),
|
|
2409
|
-
JSON.stringify(x) !== JSON.stringify(
|
|
2408
|
+
const x = f == null ? void 0 : f.map((M) => M.value), k = N == null ? void 0 : N.map((M) => M.value);
|
|
2409
|
+
JSON.stringify(x) !== JSON.stringify(k) && g(N);
|
|
2410
2410
|
} else (N == null ? void 0 : N.value) !== (f == null ? void 0 : f.value) && g(N);
|
|
2411
2411
|
}, [N, m]);
|
|
2412
2412
|
const S = Y((x) => {
|
|
2413
|
-
var
|
|
2413
|
+
var k;
|
|
2414
2414
|
if (p.current = !0, g(x), o) {
|
|
2415
|
-
const M = m ? Array.isArray(x) ? x == null ? void 0 : x.map((w) => w.value) : [] : (
|
|
2415
|
+
const M = m ? Array.isArray(x) ? x == null ? void 0 : x.map((w) => w.value) : [] : (k = x == null ? void 0 : x.value) != null ? k : null;
|
|
2416
2416
|
o(l, M), t == null || t(l);
|
|
2417
2417
|
}
|
|
2418
2418
|
s && !p.current && s(l);
|
|
2419
|
-
}, [o, l, t, s, m]),
|
|
2419
|
+
}, [o, l, t, s, m]), C = ee(() => v ? "Fetching data..." : f ? m && Array.isArray(f) ? f.length > 0 ? f == null ? void 0 : f.map((x) => x.label).join(", ") : n : (f == null ? void 0 : f.label) || n : n, [f, v, n, m]);
|
|
2420
2420
|
return /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
2421
2421
|
!c && d && /* @__PURE__ */ i("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
|
|
2422
2422
|
c && d && /* @__PURE__ */ i(
|
|
2423
2423
|
"label",
|
|
2424
2424
|
{
|
|
2425
|
-
className:
|
|
2425
|
+
className: J(
|
|
2426
2426
|
"z-[40] absolute bg-white py-[2px] px-1 -top-[10px] left-3",
|
|
2427
2427
|
h
|
|
2428
2428
|
),
|
|
@@ -2430,24 +2430,24 @@ const Ie = ({
|
|
|
2430
2430
|
}
|
|
2431
2431
|
),
|
|
2432
2432
|
/* @__PURE__ */ i(
|
|
2433
|
-
|
|
2433
|
+
ae,
|
|
2434
2434
|
{
|
|
2435
2435
|
value: f,
|
|
2436
2436
|
onChange: S,
|
|
2437
2437
|
multiple: m,
|
|
2438
2438
|
disabled: y || v,
|
|
2439
2439
|
children: /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
2440
|
-
/* @__PURE__ */ b(
|
|
2440
|
+
/* @__PURE__ */ b(ae.Button, { className: "field-control", disabled: y || v, children: [
|
|
2441
2441
|
/* @__PURE__ */ i(
|
|
2442
2442
|
"span",
|
|
2443
2443
|
{
|
|
2444
|
-
className:
|
|
2444
|
+
className: J("block text-sm text-left truncate", {
|
|
2445
2445
|
"opacity-60": !f || v
|
|
2446
2446
|
}),
|
|
2447
|
-
children:
|
|
2447
|
+
children: C
|
|
2448
2448
|
}
|
|
2449
2449
|
),
|
|
2450
|
-
/* @__PURE__ */ i("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ i(
|
|
2450
|
+
/* @__PURE__ */ i("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) })
|
|
2451
2451
|
] }),
|
|
2452
2452
|
/* @__PURE__ */ i(
|
|
2453
2453
|
we,
|
|
@@ -2455,16 +2455,16 @@ const Ie = ({
|
|
|
2455
2455
|
leave: "transition ease-in duration-100",
|
|
2456
2456
|
leaveFrom: "opacity-100",
|
|
2457
2457
|
leaveTo: "opacity-0",
|
|
2458
|
-
children: /* @__PURE__ */ i(
|
|
2458
|
+
children: /* @__PURE__ */ i(ae.Options, { anchor: "bottom start", className: "select-button-options", 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((x, k) => {
|
|
2459
2459
|
var M;
|
|
2460
2460
|
return /* @__PURE__ */ i(
|
|
2461
|
-
|
|
2461
|
+
ae.Option,
|
|
2462
2462
|
{
|
|
2463
2463
|
value: x,
|
|
2464
|
-
className: ({ active: w }) =>
|
|
2465
|
-
children: ({ selected: w }) => /* @__PURE__ */ i("div", { className:
|
|
2464
|
+
className: ({ active: w }) => J("select-option", { active: w }),
|
|
2465
|
+
children: ({ selected: w }) => /* @__PURE__ */ i("div", { className: J("option-text", { selected: w }), children: x.label })
|
|
2466
2466
|
},
|
|
2467
|
-
((M = x.value) == null ? void 0 : M.id) || x.value ||
|
|
2467
|
+
((M = x.value) == null ? void 0 : M.id) || x.value || k
|
|
2468
2468
|
);
|
|
2469
2469
|
}) })
|
|
2470
2470
|
}
|
|
@@ -2487,15 +2487,15 @@ function Ue({
|
|
|
2487
2487
|
customClass: u
|
|
2488
2488
|
}) {
|
|
2489
2489
|
const [t, m] = D(""), [c, r] = D([]), [h, v] = D(!1);
|
|
2490
|
-
|
|
2490
|
+
G(() => {
|
|
2491
2491
|
(async () => {
|
|
2492
|
-
var x,
|
|
2492
|
+
var x, k;
|
|
2493
2493
|
if (n) {
|
|
2494
2494
|
v(!0);
|
|
2495
2495
|
try {
|
|
2496
|
-
const M =
|
|
2496
|
+
const M = de("token"), w = M ? { headers: { Authorization: `Bearer ${M}` } } : {};
|
|
2497
2497
|
let T = (await Pe.get(n, w)).data;
|
|
2498
|
-
if (T && !Array.isArray(T) && (T.data && Array.isArray(T.data) ? T = T.data : (x = T.data) != null && x.data && Array.isArray(T.data.data) ? T = T.data.data : T.results && Array.isArray(T.results) ? T = T.results : (
|
|
2498
|
+
if (T && !Array.isArray(T) && (T.data && Array.isArray(T.data) ? T = T.data : (x = T.data) != null && x.data && Array.isArray(T.data.data) ? T = T.data.data : T.results && Array.isArray(T.results) ? T = T.results : (k = T.data) != null && k.results && Array.isArray(T.data.results) ? T = T.data.results : T.items && Array.isArray(T.items) && (T = T.items)), Array.isArray(T)) {
|
|
2499
2499
|
const I = T.map((L) => typeof L == "string" ? { label: L, value: L } : {
|
|
2500
2500
|
label: L.label || L.name || String(L.id || L.value),
|
|
2501
2501
|
value: String(L.value || L.id || L.name)
|
|
@@ -2510,27 +2510,27 @@ function Ue({
|
|
|
2510
2510
|
}
|
|
2511
2511
|
})();
|
|
2512
2512
|
}, [n]);
|
|
2513
|
-
const y = n ? c : e, f =
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2513
|
+
const y = n ? c : e, f = ee(() => {
|
|
2514
|
+
const C = a != null ? a : s;
|
|
2515
|
+
return C == null || C === "" ? null : y.find((x) => String(x.value) === String(C) || String(x.label) === String(C)) || null;
|
|
2516
2516
|
}, [a, s, y]), [g, p] = D(f);
|
|
2517
|
-
|
|
2517
|
+
G(() => {
|
|
2518
2518
|
if (a !== void 0)
|
|
2519
2519
|
if (a === null || a === "")
|
|
2520
2520
|
p(null);
|
|
2521
2521
|
else {
|
|
2522
|
-
const
|
|
2523
|
-
p(
|
|
2522
|
+
const C = y.find((x) => String(x.value) === String(a) || String(x.label) === String(a)) || null;
|
|
2523
|
+
p(C);
|
|
2524
2524
|
}
|
|
2525
2525
|
}, [a, y]);
|
|
2526
|
-
const N =
|
|
2526
|
+
const N = ee(() => {
|
|
2527
2527
|
if (t === "") return y;
|
|
2528
|
-
const
|
|
2528
|
+
const C = t.toLowerCase();
|
|
2529
2529
|
return y.filter(
|
|
2530
|
-
(x) => x.label.toLowerCase().includes(
|
|
2530
|
+
(x) => x.label.toLowerCase().includes(C)
|
|
2531
2531
|
);
|
|
2532
|
-
}, [t, y]), S = Y((
|
|
2533
|
-
p(
|
|
2532
|
+
}, [t, y]), S = Y((C) => {
|
|
2533
|
+
p(C), o(d, C);
|
|
2534
2534
|
}, [d, o]);
|
|
2535
2535
|
return /* @__PURE__ */ i("div", { className: "relative w-full", children: /* @__PURE__ */ b(
|
|
2536
2536
|
De,
|
|
@@ -2544,24 +2544,24 @@ function Ue({
|
|
|
2544
2544
|
Nn,
|
|
2545
2545
|
{
|
|
2546
2546
|
className: `field-control ${u}`,
|
|
2547
|
-
displayValue: (
|
|
2548
|
-
onChange: (
|
|
2547
|
+
displayValue: (C) => (C == null ? void 0 : C.label) || "",
|
|
2548
|
+
onChange: (C) => m(C.target.value),
|
|
2549
2549
|
placeholder: h ? "Loading..." : l ? "" : "Select an option..."
|
|
2550
2550
|
}
|
|
2551
2551
|
),
|
|
2552
|
-
!l && /* @__PURE__ */ i(
|
|
2552
|
+
!l && /* @__PURE__ */ i(kn, { className: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 hover:text-gray-600", children: h ? /* @__PURE__ */ b("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2553
2553
|
/* @__PURE__ */ i("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2554
2554
|
/* @__PURE__ */ i("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
2555
|
-
] }) : /* @__PURE__ */ i(
|
|
2555
|
+
] }) : /* @__PURE__ */ i(z, { icon: "octicon:chevron-down-12" }) })
|
|
2556
2556
|
] }),
|
|
2557
|
-
/* @__PURE__ */ i(
|
|
2557
|
+
/* @__PURE__ */ i(Cn, { anchor: "bottom start", className: "select-options__combo", children: h ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "Loading..." }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found." }) : N == null ? void 0 : N.map((C) => /* @__PURE__ */ i(
|
|
2558
2558
|
Mn,
|
|
2559
2559
|
{
|
|
2560
|
-
value:
|
|
2561
|
-
className: ({ active: x, selected:
|
|
2562
|
-
children: ({ selected: x }) => /* @__PURE__ */ i("div", { className:
|
|
2560
|
+
value: C,
|
|
2561
|
+
className: ({ active: x, selected: k }) => J("select-option", { active: x, selected: k }),
|
|
2562
|
+
children: ({ selected: x }) => /* @__PURE__ */ i("div", { className: J("option-text", { selected: x }), children: C.label })
|
|
2563
2563
|
},
|
|
2564
|
-
|
|
2564
|
+
C.value
|
|
2565
2565
|
)) })
|
|
2566
2566
|
]
|
|
2567
2567
|
}
|
|
@@ -2579,9 +2579,9 @@ function _a({
|
|
|
2579
2579
|
watch: l
|
|
2580
2580
|
} = n || {};
|
|
2581
2581
|
let d;
|
|
2582
|
-
return l && (d = l()[e.id]),
|
|
2582
|
+
return l && (d = l()[e.id]), G(() => {
|
|
2583
2583
|
a(e.id);
|
|
2584
|
-
}, [e.id, a]), /* @__PURE__ */ i(
|
|
2584
|
+
}, [e.id, a]), /* @__PURE__ */ i(ve, { children: e.selectType === "list" ? /* @__PURE__ */ i(
|
|
2585
2585
|
Ie,
|
|
2586
2586
|
{
|
|
2587
2587
|
options: (u = e == null ? void 0 : e.options) != null ? u : [],
|
|
@@ -2590,7 +2590,7 @@ function _a({
|
|
|
2590
2590
|
setValue: o,
|
|
2591
2591
|
trigger: s,
|
|
2592
2592
|
value: d,
|
|
2593
|
-
className:
|
|
2593
|
+
className: J("field-control", e == null ? void 0 : e.customClass),
|
|
2594
2594
|
disabled: n == null ? void 0 : n.isReadOnly
|
|
2595
2595
|
}
|
|
2596
2596
|
) : /* @__PURE__ */ i(
|
|
@@ -2614,7 +2614,7 @@ function Ya({
|
|
|
2614
2614
|
{
|
|
2615
2615
|
placeholder: e.placeholder,
|
|
2616
2616
|
rows: 4,
|
|
2617
|
-
className:
|
|
2617
|
+
className: J("field-control resize-none", e == null ? void 0 : e.customClass),
|
|
2618
2618
|
...a(e.id),
|
|
2619
2619
|
disabled: n == null ? void 0 : n.isReadOnly
|
|
2620
2620
|
}
|
|
@@ -2656,16 +2656,16 @@ const Za = ({
|
|
|
2656
2656
|
activeTab: o,
|
|
2657
2657
|
btnClass: l = ""
|
|
2658
2658
|
}) => {
|
|
2659
|
-
const d =
|
|
2659
|
+
const d = J(
|
|
2660
2660
|
"flex gap-x-3 mb-8 w-full no-scrollbar overflow-x-auto border-b-2 border-[#EAECF0] darks:border-gray-500",
|
|
2661
2661
|
n
|
|
2662
2662
|
);
|
|
2663
2663
|
return /* @__PURE__ */ i("div", { className: d, children: e == null ? void 0 : e.map((u) => {
|
|
2664
|
-
const t = o === u.key, m = a[u.key] || 0, c =
|
|
2664
|
+
const t = o === u.key, m = a[u.key] || 0, c = J(
|
|
2665
2665
|
"capitalize text-sm whitespace-nowrap no-scrollbar font-semibold pb-[14px] border-b-2 border-[#EAECF0] px-6 flex items-center gap-x-1 flex-1 text-center",
|
|
2666
2666
|
`${e.length === 1 ? "justify-start" : "justify-center"}`,
|
|
2667
2667
|
l
|
|
2668
|
-
), r =
|
|
2668
|
+
), r = J({
|
|
2669
2669
|
"border-gray-500 border-primary border-primary-500 text-primary text-primary-500": t,
|
|
2670
2670
|
"border-transparent text-gray-400 ": !t
|
|
2671
2671
|
}), h = m > 0 && /* @__PURE__ */ i("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: m });
|
|
@@ -2673,7 +2673,7 @@ const Za = ({
|
|
|
2673
2673
|
"button",
|
|
2674
2674
|
{
|
|
2675
2675
|
onClick: () => s(u.key),
|
|
2676
|
-
className:
|
|
2676
|
+
className: J(c, r),
|
|
2677
2677
|
"aria-selected": t,
|
|
2678
2678
|
role: "tab",
|
|
2679
2679
|
type: "button",
|
|
@@ -2709,8 +2709,8 @@ const Za = ({
|
|
|
2709
2709
|
}, Re = (e, n = e) => ({
|
|
2710
2710
|
label: e,
|
|
2711
2711
|
value: n,
|
|
2712
|
-
id:
|
|
2713
|
-
}),
|
|
2712
|
+
id: pe()
|
|
2713
|
+
}), ne = (e) => ({
|
|
2714
2714
|
...Qa,
|
|
2715
2715
|
...e
|
|
2716
2716
|
}), Xa = _e == null ? void 0 : _e.map((e) => ({
|
|
@@ -2718,28 +2718,28 @@ const Za = ({
|
|
|
2718
2718
|
value: e.name,
|
|
2719
2719
|
id: e.code || e.name
|
|
2720
2720
|
})), eo = [
|
|
2721
|
-
|
|
2721
|
+
ne({
|
|
2722
2722
|
type: "basicText",
|
|
2723
2723
|
label: "Basic Text",
|
|
2724
2724
|
icon: "majesticons:text",
|
|
2725
2725
|
inputLabel: "",
|
|
2726
2726
|
inputType: "basicText"
|
|
2727
2727
|
}),
|
|
2728
|
-
|
|
2728
|
+
ne({
|
|
2729
2729
|
type: "textField",
|
|
2730
2730
|
label: "Text Input",
|
|
2731
2731
|
icon: "fluent:text-16-filled",
|
|
2732
2732
|
inputLabel: "Text Label",
|
|
2733
2733
|
inputType: "text"
|
|
2734
2734
|
}),
|
|
2735
|
-
|
|
2735
|
+
ne({
|
|
2736
2736
|
type: "longText",
|
|
2737
2737
|
label: "Long Text",
|
|
2738
2738
|
icon: "dashicons:text",
|
|
2739
2739
|
inputLabel: "Long Text Label",
|
|
2740
2740
|
inputType: "text"
|
|
2741
2741
|
}),
|
|
2742
|
-
|
|
2742
|
+
ne({
|
|
2743
2743
|
type: "selectField",
|
|
2744
2744
|
label: "List",
|
|
2745
2745
|
icon: "tabler:select",
|
|
@@ -2757,7 +2757,7 @@ const Za = ({
|
|
|
2757
2757
|
// options: [option("Parent", "")],
|
|
2758
2758
|
// options2: [option("Child", "")],
|
|
2759
2759
|
// }),
|
|
2760
|
-
|
|
2760
|
+
ne({
|
|
2761
2761
|
type: "multiSelect",
|
|
2762
2762
|
label: "Multi List",
|
|
2763
2763
|
icon: "fluent-mdl2:multi-select",
|
|
@@ -2765,7 +2765,7 @@ const Za = ({
|
|
|
2765
2765
|
inputType: "select",
|
|
2766
2766
|
options: [Re("Placeholder 1", "placeholder_1")]
|
|
2767
2767
|
}),
|
|
2768
|
-
|
|
2768
|
+
ne({
|
|
2769
2769
|
type: "validateInput",
|
|
2770
2770
|
label: "Validate",
|
|
2771
2771
|
icon: "iconoir:www",
|
|
@@ -2775,7 +2775,7 @@ const Za = ({
|
|
|
2775
2775
|
method: "GET",
|
|
2776
2776
|
responseType: "string"
|
|
2777
2777
|
}),
|
|
2778
|
-
|
|
2778
|
+
ne({
|
|
2779
2779
|
type: "numberField",
|
|
2780
2780
|
label: "Number",
|
|
2781
2781
|
icon: "octicon:number-16",
|
|
@@ -2783,7 +2783,7 @@ const Za = ({
|
|
|
2783
2783
|
inputType: "number",
|
|
2784
2784
|
inputMode: "decimal"
|
|
2785
2785
|
}),
|
|
2786
|
-
|
|
2786
|
+
ne({
|
|
2787
2787
|
type: "amountField",
|
|
2788
2788
|
label: "Amount",
|
|
2789
2789
|
icon: "carbon:currency",
|
|
@@ -2791,7 +2791,7 @@ const Za = ({
|
|
|
2791
2791
|
inputType: "amount",
|
|
2792
2792
|
prefix: null
|
|
2793
2793
|
}),
|
|
2794
|
-
|
|
2794
|
+
ne({
|
|
2795
2795
|
type: "date",
|
|
2796
2796
|
label: "Date",
|
|
2797
2797
|
icon: "bx:calendar",
|
|
@@ -2804,21 +2804,21 @@ const Za = ({
|
|
|
2804
2804
|
canHaveDateRange: !1,
|
|
2805
2805
|
allowYearPicker: !1
|
|
2806
2806
|
}),
|
|
2807
|
-
|
|
2807
|
+
ne({
|
|
2808
2808
|
type: "url",
|
|
2809
2809
|
label: "Link",
|
|
2810
2810
|
icon: "iconamoon:link",
|
|
2811
2811
|
inputLabel: "Url Link",
|
|
2812
2812
|
inputType: "url"
|
|
2813
2813
|
}),
|
|
2814
|
-
|
|
2814
|
+
ne({
|
|
2815
2815
|
type: "password",
|
|
2816
2816
|
label: "Password",
|
|
2817
2817
|
icon: "ic:round-password",
|
|
2818
2818
|
inputLabel: "Password Label",
|
|
2819
2819
|
inputType: "password"
|
|
2820
2820
|
}),
|
|
2821
|
-
|
|
2821
|
+
ne({
|
|
2822
2822
|
type: "checkbox",
|
|
2823
2823
|
label: "Checkbox",
|
|
2824
2824
|
icon: "mingcute:checkbox-line",
|
|
@@ -2826,7 +2826,7 @@ const Za = ({
|
|
|
2826
2826
|
inputType: "checkbox",
|
|
2827
2827
|
options: [Re("Checkbox Option", "")]
|
|
2828
2828
|
}),
|
|
2829
|
-
|
|
2829
|
+
ne({
|
|
2830
2830
|
type: "phoneField",
|
|
2831
2831
|
label: "Phone",
|
|
2832
2832
|
icon: "fluent-mdl2:add-phone",
|
|
@@ -2834,7 +2834,7 @@ const Za = ({
|
|
|
2834
2834
|
inputType: "tel",
|
|
2835
2835
|
pattern: "^\\+?[0-9]{7,15}$"
|
|
2836
2836
|
}),
|
|
2837
|
-
|
|
2837
|
+
ne({
|
|
2838
2838
|
type: "radio",
|
|
2839
2839
|
label: "Radio",
|
|
2840
2840
|
icon: "ri:checkbox-circle-line",
|
|
@@ -2842,14 +2842,14 @@ const Za = ({
|
|
|
2842
2842
|
inputType: "radio",
|
|
2843
2843
|
options: [Re("Radio Option", "")]
|
|
2844
2844
|
}),
|
|
2845
|
-
|
|
2845
|
+
ne({
|
|
2846
2846
|
type: "email",
|
|
2847
2847
|
label: "Email",
|
|
2848
2848
|
icon: "mdi:email-outline",
|
|
2849
2849
|
inputLabel: "Email Label",
|
|
2850
2850
|
inputType: "email"
|
|
2851
2851
|
}),
|
|
2852
|
-
|
|
2852
|
+
ne({
|
|
2853
2853
|
type: "file",
|
|
2854
2854
|
label: "File",
|
|
2855
2855
|
icon: "ion:attach-sharp",
|
|
@@ -2858,7 +2858,7 @@ const Za = ({
|
|
|
2858
2858
|
isMultiple: !1,
|
|
2859
2859
|
acceptedFiles: []
|
|
2860
2860
|
}),
|
|
2861
|
-
|
|
2861
|
+
ne({
|
|
2862
2862
|
type: "country",
|
|
2863
2863
|
label: "Country",
|
|
2864
2864
|
icon: "fluent:globe-16-regular",
|
|
@@ -2867,14 +2867,14 @@ const Za = ({
|
|
|
2867
2867
|
options: Xa,
|
|
2868
2868
|
showState: !1
|
|
2869
2869
|
}),
|
|
2870
|
-
|
|
2870
|
+
ne({
|
|
2871
2871
|
type: "rating",
|
|
2872
2872
|
label: "Ratings",
|
|
2873
2873
|
icon: "streamline-ultimate:rating-star-ribbon",
|
|
2874
2874
|
inputLabel: "Rating Label",
|
|
2875
2875
|
inputType: "rating"
|
|
2876
2876
|
}),
|
|
2877
|
-
|
|
2877
|
+
ne({
|
|
2878
2878
|
type: "dataGrid",
|
|
2879
2879
|
label: "Table",
|
|
2880
2880
|
icon: "carbon:data-table",
|
|
@@ -2883,7 +2883,7 @@ const Za = ({
|
|
|
2883
2883
|
value: [],
|
|
2884
2884
|
dataColumns: [
|
|
2885
2885
|
{
|
|
2886
|
-
id:
|
|
2886
|
+
id: pe(),
|
|
2887
2887
|
field: "",
|
|
2888
2888
|
headerName: "",
|
|
2889
2889
|
width: 150,
|
|
@@ -2901,14 +2901,14 @@ const Za = ({
|
|
|
2901
2901
|
// inputType: "tableInput",
|
|
2902
2902
|
// value: [],
|
|
2903
2903
|
// }),
|
|
2904
|
-
|
|
2904
|
+
ne({
|
|
2905
2905
|
type: "divider",
|
|
2906
2906
|
label: "Divider",
|
|
2907
2907
|
icon: "pixel:divider",
|
|
2908
2908
|
inputLabel: "",
|
|
2909
2909
|
inputType: "divider"
|
|
2910
2910
|
}),
|
|
2911
|
-
|
|
2911
|
+
ne({
|
|
2912
2912
|
type: "spacer",
|
|
2913
2913
|
label: "Spacer",
|
|
2914
2914
|
icon: "fluent-mdl2:spacer",
|
|
@@ -2922,7 +2922,7 @@ const Za = ({
|
|
|
2922
2922
|
// inputLabel: "",
|
|
2923
2923
|
// inputType: "section",
|
|
2924
2924
|
// }),
|
|
2925
|
-
|
|
2925
|
+
ne({
|
|
2926
2926
|
type: "grid",
|
|
2927
2927
|
label: "Grid",
|
|
2928
2928
|
icon: "cuida:grid-outline",
|
|
@@ -2930,7 +2930,7 @@ const Za = ({
|
|
|
2930
2930
|
inputType: "grid",
|
|
2931
2931
|
columns: 2
|
|
2932
2932
|
}),
|
|
2933
|
-
|
|
2933
|
+
ne({
|
|
2934
2934
|
type: "matrix",
|
|
2935
2935
|
label: "Likert Scale",
|
|
2936
2936
|
icon: "pepicons-pop:list",
|
|
@@ -2947,7 +2947,7 @@ const Za = ({
|
|
|
2947
2947
|
{ id: "c5", label: "Strongly Agree", value: "strongly_agree" }
|
|
2948
2948
|
]
|
|
2949
2949
|
}),
|
|
2950
|
-
|
|
2950
|
+
ne({
|
|
2951
2951
|
type: "calculatedField",
|
|
2952
2952
|
label: "Calculated Field",
|
|
2953
2953
|
icon: "material-symbols:functions",
|
|
@@ -2955,7 +2955,7 @@ const Za = ({
|
|
|
2955
2955
|
inputType: "calculatedField",
|
|
2956
2956
|
formula: ""
|
|
2957
2957
|
}),
|
|
2958
|
-
|
|
2958
|
+
ne({
|
|
2959
2959
|
type: "polling",
|
|
2960
2960
|
label: "Polling",
|
|
2961
2961
|
icon: "mdi:poll",
|
|
@@ -3093,7 +3093,7 @@ function mo({
|
|
|
3093
3093
|
const [s, o] = D(
|
|
3094
3094
|
(e == null ? void 0 : e.length) > 0 ? e : [{ value: "" }]
|
|
3095
3095
|
);
|
|
3096
|
-
|
|
3096
|
+
G(() => {
|
|
3097
3097
|
(e == null ? void 0 : e.length) > 0 && JSON.stringify(e) !== JSON.stringify(s) && o(e);
|
|
3098
3098
|
}, [e]);
|
|
3099
3099
|
function l(t, m) {
|
|
@@ -3116,7 +3116,7 @@ function mo({
|
|
|
3116
3116
|
const m = s.filter((c, r) => r !== t);
|
|
3117
3117
|
o(m), n && n(m);
|
|
3118
3118
|
}
|
|
3119
|
-
return
|
|
3119
|
+
return G(() => {
|
|
3120
3120
|
a && a(JSON.stringify({ values: s }));
|
|
3121
3121
|
}, [a, s]), /* @__PURE__ */ b("div", { className: "]", children: [
|
|
3122
3122
|
/* @__PURE__ */ b("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
|
|
@@ -3218,7 +3218,7 @@ const bo = () => /* @__PURE__ */ i("blockquote", { className: "bg-gray-100 p-4 r
|
|
|
3218
3218
|
label: s,
|
|
3219
3219
|
type: o
|
|
3220
3220
|
}) => {
|
|
3221
|
-
const [l, d] = D(""), u =
|
|
3221
|
+
const [l, d] = D(""), u = de("config");
|
|
3222
3222
|
return /* @__PURE__ */ b("div", { children: [
|
|
3223
3223
|
/* @__PURE__ */ b("div", { className: "relative", children: [
|
|
3224
3224
|
/* @__PURE__ */ i(
|
|
@@ -3339,7 +3339,7 @@ function xo({
|
|
|
3339
3339
|
watch: s,
|
|
3340
3340
|
id: o
|
|
3341
3341
|
}) {
|
|
3342
|
-
const { formData: l } = ye(
|
|
3342
|
+
const { formData: l } = ye(be), d = s("visibilityDependentFields") || [], u = ee(() => {
|
|
3343
3343
|
var m;
|
|
3344
3344
|
return (m = fo(l).filter((c) => c.id !== o)) == null ? void 0 : m.map((c) => {
|
|
3345
3345
|
const r = d.find(
|
|
@@ -3388,12 +3388,12 @@ function xo({
|
|
|
3388
3388
|
}
|
|
3389
3389
|
),
|
|
3390
3390
|
/* @__PURE__ */ i("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ i(
|
|
3391
|
-
|
|
3391
|
+
ae,
|
|
3392
3392
|
{
|
|
3393
3393
|
value: m.fieldType,
|
|
3394
3394
|
onChange: (v) => t(c, "fieldType", v),
|
|
3395
3395
|
children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
|
|
3396
|
-
/* @__PURE__ */ i(
|
|
3396
|
+
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: m.fieldType }),
|
|
3397
3397
|
/* @__PURE__ */ i(
|
|
3398
3398
|
we,
|
|
3399
3399
|
{
|
|
@@ -3402,12 +3402,12 @@ function xo({
|
|
|
3402
3402
|
leaveFrom: "opacity-100",
|
|
3403
3403
|
leaveTo: "opacity-0",
|
|
3404
3404
|
children: /* @__PURE__ */ i(
|
|
3405
|
-
|
|
3405
|
+
ae.Options,
|
|
3406
3406
|
{
|
|
3407
3407
|
className: "listbox-options ",
|
|
3408
3408
|
anchor: "bottom",
|
|
3409
3409
|
children: di == null ? void 0 : di.map((v) => /* @__PURE__ */ i(
|
|
3410
|
-
|
|
3410
|
+
ae.Option,
|
|
3411
3411
|
{
|
|
3412
3412
|
value: v,
|
|
3413
3413
|
className: "listbox-option",
|
|
@@ -3423,12 +3423,12 @@ function xo({
|
|
|
3423
3423
|
}
|
|
3424
3424
|
) }),
|
|
3425
3425
|
/* @__PURE__ */ i("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ i(
|
|
3426
|
-
|
|
3426
|
+
ae,
|
|
3427
3427
|
{
|
|
3428
3428
|
value: m.operator,
|
|
3429
3429
|
onChange: (v) => t(c, "operator", v),
|
|
3430
3430
|
children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
|
|
3431
|
-
/* @__PURE__ */ i(
|
|
3431
|
+
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: m.operator.replace("_", " ") }),
|
|
3432
3432
|
/* @__PURE__ */ i(
|
|
3433
3433
|
we,
|
|
3434
3434
|
{
|
|
@@ -3437,12 +3437,12 @@ function xo({
|
|
|
3437
3437
|
leaveFrom: "opacity-100",
|
|
3438
3438
|
leaveTo: "opacity-0",
|
|
3439
3439
|
children: /* @__PURE__ */ i(
|
|
3440
|
-
|
|
3440
|
+
ae.Options,
|
|
3441
3441
|
{
|
|
3442
3442
|
className: "listbox-options ",
|
|
3443
3443
|
anchor: "bottom",
|
|
3444
3444
|
children: (r = m.fieldType === "number" ? [...zi, ...yo] : zi) == null ? void 0 : r.map((v) => /* @__PURE__ */ i(
|
|
3445
|
-
|
|
3445
|
+
ae.Option,
|
|
3446
3446
|
{
|
|
3447
3447
|
value: v,
|
|
3448
3448
|
className: "listbox-option",
|
|
@@ -3467,12 +3467,12 @@ function xo({
|
|
|
3467
3467
|
className: "field-value"
|
|
3468
3468
|
}
|
|
3469
3469
|
) : /* @__PURE__ */ i("div", { className: "field-listbox", children: /* @__PURE__ */ i(
|
|
3470
|
-
|
|
3470
|
+
ae,
|
|
3471
3471
|
{
|
|
3472
3472
|
value: (h = m.fieldValue) != null ? h : "",
|
|
3473
3473
|
onChange: (v) => t(c, "fieldValue", v),
|
|
3474
3474
|
children: /* @__PURE__ */ b("div", { className: "listbox-wrapper", children: [
|
|
3475
|
-
/* @__PURE__ */ i(
|
|
3475
|
+
/* @__PURE__ */ i(ae.Button, { className: "listbox-button", children: m.fieldValue === !0 ? "True" : m.fieldValue === !1 ? "False" : "Select value" }),
|
|
3476
3476
|
/* @__PURE__ */ i(
|
|
3477
3477
|
we,
|
|
3478
3478
|
{
|
|
@@ -3481,13 +3481,13 @@ function xo({
|
|
|
3481
3481
|
leaveFrom: "opacity-100",
|
|
3482
3482
|
leaveTo: "opacity-0",
|
|
3483
3483
|
children: /* @__PURE__ */ b(
|
|
3484
|
-
|
|
3484
|
+
ae.Options,
|
|
3485
3485
|
{
|
|
3486
3486
|
className: "listbox-options ",
|
|
3487
3487
|
anchor: "bottom",
|
|
3488
3488
|
children: [
|
|
3489
3489
|
/* @__PURE__ */ i(
|
|
3490
|
-
|
|
3490
|
+
ae.Option,
|
|
3491
3491
|
{
|
|
3492
3492
|
value: !0,
|
|
3493
3493
|
className: "listbox-option",
|
|
@@ -3495,7 +3495,7 @@ function xo({
|
|
|
3495
3495
|
}
|
|
3496
3496
|
),
|
|
3497
3497
|
/* @__PURE__ */ i(
|
|
3498
|
-
|
|
3498
|
+
ae.Option,
|
|
3499
3499
|
{
|
|
3500
3500
|
value: !1,
|
|
3501
3501
|
className: "listbox-option",
|
|
@@ -3535,8 +3535,8 @@ function So({
|
|
|
3535
3535
|
fields: a,
|
|
3536
3536
|
placeholder: s
|
|
3537
3537
|
}) {
|
|
3538
|
-
const [o, l] = D(() => Ji(e)), [d, u] = D(null), [t, m] = D(!1), [c, r] = D(""), [h, v] = D(null), y =
|
|
3539
|
-
|
|
3538
|
+
const [o, l] = D(() => Ji(e)), [d, u] = D(null), [t, m] = D(!1), [c, r] = D(""), [h, v] = D(null), y = re(null), f = re(null), g = re(/* @__PURE__ */ new Map());
|
|
3539
|
+
G(() => {
|
|
3540
3540
|
const A = Ji(e);
|
|
3541
3541
|
l(A);
|
|
3542
3542
|
}, []);
|
|
@@ -3551,17 +3551,17 @@ function So({
|
|
|
3551
3551
|
}, S = (A) => {
|
|
3552
3552
|
const T = o.filter((I, L) => L !== A);
|
|
3553
3553
|
l(T), p(T);
|
|
3554
|
-
},
|
|
3554
|
+
}, C = (A) => {
|
|
3555
3555
|
v(A), r(""), m(!0);
|
|
3556
3556
|
}, x = (A, T) => {
|
|
3557
|
-
const I = T !== void 0 ? T : h != null ? h : o.length, L = [...o],
|
|
3558
|
-
...
|
|
3557
|
+
const I = T !== void 0 ? T : h != null ? h : o.length, L = [...o], F = L.slice(0, I), Z = L.slice(I), ie = [
|
|
3558
|
+
...F,
|
|
3559
3559
|
{ type: "field", id: A.id, display: A.display },
|
|
3560
3560
|
...Z
|
|
3561
|
-
],
|
|
3562
|
-
l(
|
|
3561
|
+
], X = k(ie);
|
|
3562
|
+
l(X), p(X), m(!1), v(null);
|
|
3563
3563
|
};
|
|
3564
|
-
function
|
|
3564
|
+
function k(A) {
|
|
3565
3565
|
const T = [];
|
|
3566
3566
|
if (A.length === 0) return [{ type: "operator", value: "" }];
|
|
3567
3567
|
A[0].type === "field" && T.push({ type: "operator", value: "" });
|
|
@@ -3638,7 +3638,7 @@ function So({
|
|
|
3638
3638
|
{
|
|
3639
3639
|
type: "button",
|
|
3640
3640
|
onMouseDown: (A) => {
|
|
3641
|
-
A.preventDefault(),
|
|
3641
|
+
A.preventDefault(), C(o.length);
|
|
3642
3642
|
},
|
|
3643
3643
|
className: "inline-flex items-center gap-1 text-xs text-blue-600 hover:text-blue-800 hover:bg-blue-50 px-1.5 py-0.5 rounded transition-colors",
|
|
3644
3644
|
title: "Insert a field",
|
|
@@ -3652,7 +3652,7 @@ function So({
|
|
|
3652
3652
|
/* @__PURE__ */ i("span", { className: "font-sans font-semibold text-blue-500 uppercase tracking-wide mr-1", children: "Preview:" }),
|
|
3653
3653
|
o.map((A) => A.type === "field" ? `[${A.display}]` : A.value).join("")
|
|
3654
3654
|
] }),
|
|
3655
|
-
t && /* @__PURE__ */ b(
|
|
3655
|
+
t && /* @__PURE__ */ b(ve, { children: [
|
|
3656
3656
|
/* @__PURE__ */ i(
|
|
3657
3657
|
"div",
|
|
3658
3658
|
{
|
|
@@ -3794,18 +3794,18 @@ const No = R.object().shape({
|
|
|
3794
3794
|
formula: R.string().nullable(),
|
|
3795
3795
|
fetchExternalResults: R.boolean(),
|
|
3796
3796
|
externalApiUrl: R.string().nullable()
|
|
3797
|
-
}),
|
|
3797
|
+
}), ko = [
|
|
3798
3798
|
{ title: "Configurations", key: "basic" },
|
|
3799
3799
|
{ title: "Validations", key: "validation" }
|
|
3800
|
-
],
|
|
3800
|
+
], Co = ({
|
|
3801
3801
|
isOpen: e,
|
|
3802
3802
|
onClose: n,
|
|
3803
3803
|
element: a
|
|
3804
3804
|
}) => {
|
|
3805
|
-
var
|
|
3806
|
-
const s =
|
|
3805
|
+
var O;
|
|
3806
|
+
const s = ko.filter(
|
|
3807
3807
|
(B) => !We.includes(a.inputType) || B.key !== "validation"
|
|
3808
|
-
), { updateElement: o, formData: l } =
|
|
3808
|
+
), { updateElement: o, formData: l } = se.useContext(be), [d, u] = D("basic"), [t, m] = D(!1), [c, r] = D("manual"), h = ((O = l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || [])) == null ? void 0 : O.length) || 0, v = se.useMemo(() => (l == null ? void 0 : l.flatMap((B) => (B == null ? void 0 : B.questionData) || []).filter(
|
|
3809
3809
|
(B) => {
|
|
3810
3810
|
var K;
|
|
3811
3811
|
return B.id !== (a == null ? void 0 : a.id) && !["spacer", "divider", "section", "grid"].includes(
|
|
@@ -3815,14 +3815,14 @@ const No = R.object().shape({
|
|
|
3815
3815
|
).map((B) => ({
|
|
3816
3816
|
id: B.id,
|
|
3817
3817
|
display: B.inputLabel || B.label || "Unnamed"
|
|
3818
|
-
}))) || [], [h, a == null ? void 0 : a.id]), y =
|
|
3818
|
+
}))) || [], [h, a == null ? void 0 : a.id]), y = de("config"), {
|
|
3819
3819
|
register: f,
|
|
3820
3820
|
handleSubmit: g,
|
|
3821
3821
|
control: p,
|
|
3822
3822
|
setValue: N,
|
|
3823
3823
|
watch: S,
|
|
3824
|
-
trigger:
|
|
3825
|
-
formState: { errors: x, isSubmitting:
|
|
3824
|
+
trigger: C,
|
|
3825
|
+
formState: { errors: x, isSubmitting: k, isValid: M },
|
|
3826
3826
|
reset: w
|
|
3827
3827
|
} = Ai({
|
|
3828
3828
|
resolver: wi(No),
|
|
@@ -3834,30 +3834,30 @@ const No = R.object().shape({
|
|
|
3834
3834
|
control: p,
|
|
3835
3835
|
name: "options"
|
|
3836
3836
|
}), {
|
|
3837
|
-
fields:
|
|
3837
|
+
fields: F,
|
|
3838
3838
|
append: Z,
|
|
3839
|
-
remove:
|
|
3839
|
+
remove: ie
|
|
3840
3840
|
} = ni({
|
|
3841
3841
|
control: p,
|
|
3842
3842
|
name: "options1"
|
|
3843
3843
|
}), {
|
|
3844
|
-
fields:
|
|
3845
|
-
append:
|
|
3844
|
+
fields: X,
|
|
3845
|
+
append: he,
|
|
3846
3846
|
remove: _
|
|
3847
3847
|
} = ni({
|
|
3848
3848
|
control: p,
|
|
3849
3849
|
name: "dataColumns"
|
|
3850
3850
|
});
|
|
3851
|
-
|
|
3851
|
+
G(() => {
|
|
3852
3852
|
e || w();
|
|
3853
3853
|
}, [e, w]);
|
|
3854
3854
|
const V = (B) => {
|
|
3855
3855
|
o(B, a.sectionId), n();
|
|
3856
3856
|
}, Ae = {
|
|
3857
3857
|
headers: {
|
|
3858
|
-
Authorization: `Bearer ${
|
|
3858
|
+
Authorization: `Bearer ${de("token")}`
|
|
3859
3859
|
}
|
|
3860
|
-
},
|
|
3860
|
+
}, ge = Y(async () => {
|
|
3861
3861
|
var B, K, P;
|
|
3862
3862
|
if (!A.apiUrl || !/^https?:\/\//.test(A.apiUrl)) {
|
|
3863
3863
|
xe.info("Please provide a valid API URL");
|
|
@@ -3865,31 +3865,31 @@ const No = R.object().shape({
|
|
|
3865
3865
|
}
|
|
3866
3866
|
try {
|
|
3867
3867
|
m(!0);
|
|
3868
|
-
const { status: E, data:
|
|
3869
|
-
if (E !== 200 || !
|
|
3868
|
+
const { status: E, data: q } = await Pe.get(A.apiUrl, Ae);
|
|
3869
|
+
if (E !== 200 || !q) {
|
|
3870
3870
|
xe.error("Unexpected response from server.");
|
|
3871
3871
|
return;
|
|
3872
3872
|
}
|
|
3873
|
-
const
|
|
3874
|
-
if (!Array.isArray(
|
|
3873
|
+
const $ = q.data || q.record || q.result;
|
|
3874
|
+
if (!Array.isArray($)) {
|
|
3875
3875
|
xe.error("Expected an array in response (data, record, or result).");
|
|
3876
3876
|
return;
|
|
3877
3877
|
}
|
|
3878
|
-
((B = a.type) == null ? void 0 : B.toLowerCase()) === "datagrid" ? N("dataColumns", xi(
|
|
3878
|
+
((B = a.type) == null ? void 0 : B.toLowerCase()) === "datagrid" ? N("dataColumns", xi($)) : N("options", yi($));
|
|
3879
3879
|
} catch (E) {
|
|
3880
|
-
const
|
|
3881
|
-
xe.error(
|
|
3880
|
+
const q = ((P = (K = E == null ? void 0 : E.response) == null ? void 0 : K.data) == null ? void 0 : P.message) || (E == null ? void 0 : E.message) || "Unable to load options";
|
|
3881
|
+
xe.error(q);
|
|
3882
3882
|
} finally {
|
|
3883
3883
|
m(!1);
|
|
3884
3884
|
}
|
|
3885
|
-
}, [a.type, N, A.apiUrl]),
|
|
3885
|
+
}, [a.type, N, A.apiUrl]), ue = ["manual", "api", "sheet"];
|
|
3886
3886
|
function Se() {
|
|
3887
|
-
c === "api" &&
|
|
3887
|
+
c === "api" && ge();
|
|
3888
3888
|
}
|
|
3889
|
-
const
|
|
3889
|
+
const Ce = () => {
|
|
3890
3890
|
var B, K;
|
|
3891
3891
|
return /* @__PURE__ */ b("div", { className: "flex flex-col justify-start gap-y-1", children: [
|
|
3892
|
-
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children:
|
|
3892
|
+
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: ue == null ? void 0 : ue.map((P) => /* @__PURE__ */ b("label", { className: "items-center text-base capitalize gap-x-3", children: [
|
|
3893
3893
|
/* @__PURE__ */ i(
|
|
3894
3894
|
"input",
|
|
3895
3895
|
{
|
|
@@ -3909,7 +3909,7 @@ const No = R.object().shape({
|
|
|
3909
3909
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
3910
3910
|
/* @__PURE__ */ b("div", { className: "relative flex items-center w-full mb-2", children: [
|
|
3911
3911
|
/* @__PURE__ */ i(
|
|
3912
|
-
|
|
3912
|
+
W,
|
|
3913
3913
|
{
|
|
3914
3914
|
watch: S,
|
|
3915
3915
|
label: "Load Options from Api",
|
|
@@ -3952,7 +3952,7 @@ const No = R.object().shape({
|
|
|
3952
3952
|
className: "flex items-center mb-1 gap-x-4 last:mb-0",
|
|
3953
3953
|
children: [
|
|
3954
3954
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
3955
|
-
|
|
3955
|
+
W,
|
|
3956
3956
|
{
|
|
3957
3957
|
watch: S,
|
|
3958
3958
|
label: E === 0 ? "Label" : "",
|
|
@@ -3961,9 +3961,9 @@ const No = R.object().shape({
|
|
|
3961
3961
|
errors: x,
|
|
3962
3962
|
element: a,
|
|
3963
3963
|
placeholder: "Label",
|
|
3964
|
-
onChange: (
|
|
3965
|
-
const
|
|
3966
|
-
N(`options.${E}.value`,
|
|
3964
|
+
onChange: (q) => {
|
|
3965
|
+
const j = q.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
3966
|
+
N(`options.${E}.value`, j, {
|
|
3967
3967
|
shouldValidate: !0,
|
|
3968
3968
|
shouldDirty: !0
|
|
3969
3969
|
});
|
|
@@ -3971,7 +3971,7 @@ const No = R.object().shape({
|
|
|
3971
3971
|
}
|
|
3972
3972
|
) }),
|
|
3973
3973
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
3974
|
-
|
|
3974
|
+
W,
|
|
3975
3975
|
{
|
|
3976
3976
|
watch: S,
|
|
3977
3977
|
label: E === 0 ? "Value" : "",
|
|
@@ -3989,7 +3989,7 @@ const No = R.object().shape({
|
|
|
3989
3989
|
type: "button",
|
|
3990
3990
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
3991
3991
|
onClick: () => L(E),
|
|
3992
|
-
children: /* @__PURE__ */ i(
|
|
3992
|
+
children: /* @__PURE__ */ i(z, { icon: "iconamoon:sign-times-fill" })
|
|
3993
3993
|
}
|
|
3994
3994
|
)
|
|
3995
3995
|
]
|
|
@@ -4004,27 +4004,27 @@ const No = R.object().shape({
|
|
|
4004
4004
|
{
|
|
4005
4005
|
type: "button",
|
|
4006
4006
|
className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
|
|
4007
|
-
onClick: () => I({ label: "", value: "", id:
|
|
4007
|
+
onClick: () => I({ label: "", value: "", id: pe() }),
|
|
4008
4008
|
children: [
|
|
4009
|
-
/* @__PURE__ */ i(
|
|
4009
|
+
/* @__PURE__ */ i(z, { icon: "qlementine-icons:plus-16" }),
|
|
4010
4010
|
" Add Option"
|
|
4011
4011
|
]
|
|
4012
4012
|
}
|
|
4013
4013
|
)
|
|
4014
4014
|
] })
|
|
4015
4015
|
] }),
|
|
4016
|
-
["cascadeselect", "matrix"].includes(a.type.toLowerCase()) && /* @__PURE__ */ b(
|
|
4016
|
+
["cascadeselect", "matrix"].includes(a.type.toLowerCase()) && /* @__PURE__ */ b(ve, { children: [
|
|
4017
4017
|
/* @__PURE__ */ i("hr", { className: "my-5" }),
|
|
4018
4018
|
/* @__PURE__ */ b("div", { children: [
|
|
4019
4019
|
" ",
|
|
4020
4020
|
/* @__PURE__ */ i("h3", { className: "mb-4 text-sm text-gray-500 font-semibold", children: ((K = a == null ? void 0 : a.type) == null ? void 0 : K.toLowerCase()) === "matrix" ? "Columns Options" : "Child Options" }),
|
|
4021
|
-
|
|
4021
|
+
F == null ? void 0 : F.map((P, E) => /* @__PURE__ */ b(
|
|
4022
4022
|
"div",
|
|
4023
4023
|
{
|
|
4024
4024
|
className: "flex items-center mb-1 gap-x-4 last:mb-0",
|
|
4025
4025
|
children: [
|
|
4026
4026
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4027
|
-
|
|
4027
|
+
W,
|
|
4028
4028
|
{
|
|
4029
4029
|
watch: S,
|
|
4030
4030
|
label: E === 0 ? "Label" : "",
|
|
@@ -4033,9 +4033,9 @@ const No = R.object().shape({
|
|
|
4033
4033
|
errors: x,
|
|
4034
4034
|
element: a,
|
|
4035
4035
|
placeholder: "Label",
|
|
4036
|
-
onChange: (
|
|
4037
|
-
const
|
|
4038
|
-
N(`options1.${E}.value`,
|
|
4036
|
+
onChange: (q) => {
|
|
4037
|
+
const j = q.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
4038
|
+
N(`options1.${E}.value`, j, {
|
|
4039
4039
|
shouldValidate: !0,
|
|
4040
4040
|
shouldDirty: !0
|
|
4041
4041
|
});
|
|
@@ -4043,7 +4043,7 @@ const No = R.object().shape({
|
|
|
4043
4043
|
}
|
|
4044
4044
|
) }),
|
|
4045
4045
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4046
|
-
|
|
4046
|
+
W,
|
|
4047
4047
|
{
|
|
4048
4048
|
watch: S,
|
|
4049
4049
|
label: E === 0 ? "Value" : "",
|
|
@@ -4055,7 +4055,7 @@ const No = R.object().shape({
|
|
|
4055
4055
|
}
|
|
4056
4056
|
) }),
|
|
4057
4057
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4058
|
-
|
|
4058
|
+
W,
|
|
4059
4059
|
{
|
|
4060
4060
|
watch: S,
|
|
4061
4061
|
label: E === 0 ? "Key" : "",
|
|
@@ -4069,11 +4069,11 @@ const No = R.object().shape({
|
|
|
4069
4069
|
/* @__PURE__ */ i(
|
|
4070
4070
|
"button",
|
|
4071
4071
|
{
|
|
4072
|
-
disabled:
|
|
4072
|
+
disabled: F.length === 1,
|
|
4073
4073
|
type: "button",
|
|
4074
4074
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
4075
|
-
onClick: () =>
|
|
4076
|
-
children: /* @__PURE__ */ i(
|
|
4075
|
+
onClick: () => ie(E),
|
|
4076
|
+
children: /* @__PURE__ */ i(z, { icon: "iconamoon:sign-times-fill" })
|
|
4077
4077
|
}
|
|
4078
4078
|
)
|
|
4079
4079
|
]
|
|
@@ -4087,9 +4087,9 @@ const No = R.object().shape({
|
|
|
4087
4087
|
{
|
|
4088
4088
|
type: "button",
|
|
4089
4089
|
className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
|
|
4090
|
-
onClick: () => Z({ label: "", value: "", key: "", id:
|
|
4090
|
+
onClick: () => Z({ label: "", value: "", key: "", id: pe() }),
|
|
4091
4091
|
children: [
|
|
4092
|
-
/* @__PURE__ */ i(
|
|
4092
|
+
/* @__PURE__ */ i(z, { icon: "qlementine-icons:plus-16" }),
|
|
4093
4093
|
" Add Option"
|
|
4094
4094
|
]
|
|
4095
4095
|
}
|
|
@@ -4099,7 +4099,7 @@ const No = R.object().shape({
|
|
|
4099
4099
|
] })
|
|
4100
4100
|
] });
|
|
4101
4101
|
}, Be = () => /* @__PURE__ */ b("div", { className: "flex flex-col justify-start gap-y-1", children: [
|
|
4102
|
-
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children:
|
|
4102
|
+
/* @__PURE__ */ i("div", { className: "flex items-center mb-4 gap-x-5", children: ue == null ? void 0 : ue.map((B) => /* @__PURE__ */ b("label", { className: "items-center text-base capitalize gap-x-3", children: [
|
|
4103
4103
|
/* @__PURE__ */ i(
|
|
4104
4104
|
"input",
|
|
4105
4105
|
{
|
|
@@ -4120,7 +4120,7 @@ const No = R.object().shape({
|
|
|
4120
4120
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
4121
4121
|
/* @__PURE__ */ b("div", { className: "relative flex items-center w-full mb-2", children: [
|
|
4122
4122
|
/* @__PURE__ */ i(
|
|
4123
|
-
|
|
4123
|
+
W,
|
|
4124
4124
|
{
|
|
4125
4125
|
watch: S,
|
|
4126
4126
|
label: "Load Columns from Api",
|
|
@@ -4155,7 +4155,7 @@ const No = R.object().shape({
|
|
|
4155
4155
|
name: "dataColumns"
|
|
4156
4156
|
}
|
|
4157
4157
|
) }),
|
|
4158
|
-
/* @__PURE__ */ i("div", { className: "grid gap-y-3", children:
|
|
4158
|
+
/* @__PURE__ */ i("div", { className: "grid gap-y-3", children: X == null ? void 0 : X.map((B, K) => {
|
|
4159
4159
|
var P, E;
|
|
4160
4160
|
return /* @__PURE__ */ b(
|
|
4161
4161
|
"div",
|
|
@@ -4188,20 +4188,20 @@ const No = R.object().shape({
|
|
|
4188
4188
|
register: f,
|
|
4189
4189
|
name: `dataColumns.${K}.type`,
|
|
4190
4190
|
setValue: N,
|
|
4191
|
-
trigger:
|
|
4191
|
+
trigger: C,
|
|
4192
4192
|
value: A.dataColumns[K].type
|
|
4193
4193
|
}
|
|
4194
4194
|
) }),
|
|
4195
4195
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4196
|
-
|
|
4196
|
+
W,
|
|
4197
4197
|
{
|
|
4198
4198
|
watch: S,
|
|
4199
4199
|
label: K === 0 ? "Display header" : "",
|
|
4200
4200
|
name: `dataColumns.${K}.headerName`,
|
|
4201
4201
|
register: f,
|
|
4202
|
-
onChange: (
|
|
4203
|
-
const
|
|
4204
|
-
N(`dataColumns.${K}.field`,
|
|
4202
|
+
onChange: (q) => {
|
|
4203
|
+
const j = q.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
4204
|
+
N(`dataColumns.${K}.field`, j, {
|
|
4205
4205
|
shouldValidate: !0,
|
|
4206
4206
|
shouldDirty: !0
|
|
4207
4207
|
});
|
|
@@ -4212,7 +4212,7 @@ const No = R.object().shape({
|
|
|
4212
4212
|
}
|
|
4213
4213
|
) }),
|
|
4214
4214
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4215
|
-
|
|
4215
|
+
W,
|
|
4216
4216
|
{
|
|
4217
4217
|
watch: S,
|
|
4218
4218
|
label: K === 0 ? "Field key" : "",
|
|
@@ -4227,16 +4227,16 @@ const No = R.object().shape({
|
|
|
4227
4227
|
/* @__PURE__ */ i(
|
|
4228
4228
|
"button",
|
|
4229
4229
|
{
|
|
4230
|
-
disabled:
|
|
4230
|
+
disabled: X.length === 1,
|
|
4231
4231
|
type: "button",
|
|
4232
4232
|
className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
4233
4233
|
onClick: () => _(K),
|
|
4234
|
-
children: /* @__PURE__ */ i(
|
|
4234
|
+
children: /* @__PURE__ */ i(z, { icon: "iconamoon:sign-times-fill" })
|
|
4235
4235
|
}
|
|
4236
4236
|
)
|
|
4237
4237
|
] }),
|
|
4238
4238
|
((E = (P = A.dataColumns) == null ? void 0 : P[K]) == null ? void 0 : E.type) === "select" && /* @__PURE__ */ i("div", { className: "flex items-center gap-x-4", children: /* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4239
|
-
|
|
4239
|
+
W,
|
|
4240
4240
|
{
|
|
4241
4241
|
watch: S,
|
|
4242
4242
|
label: "Options API URL",
|
|
@@ -4259,30 +4259,30 @@ const No = R.object().shape({
|
|
|
4259
4259
|
{
|
|
4260
4260
|
type: "button",
|
|
4261
4261
|
className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
|
|
4262
|
-
onClick: () =>
|
|
4262
|
+
onClick: () => he({
|
|
4263
4263
|
headerName: "",
|
|
4264
4264
|
field: "",
|
|
4265
4265
|
editable: !0,
|
|
4266
|
-
id:
|
|
4266
|
+
id: pe(),
|
|
4267
4267
|
type: "text",
|
|
4268
4268
|
validate: !1
|
|
4269
4269
|
}),
|
|
4270
4270
|
children: [
|
|
4271
|
-
/* @__PURE__ */ i(
|
|
4271
|
+
/* @__PURE__ */ i(z, { icon: "qlementine-icons:plus-16" }),
|
|
4272
4272
|
" Add column"
|
|
4273
4273
|
]
|
|
4274
4274
|
}
|
|
4275
4275
|
)
|
|
4276
4276
|
] })
|
|
4277
4277
|
] }), Me = Y(async () => {
|
|
4278
|
-
const B =
|
|
4278
|
+
const B = de("token"), { status: K, data: P } = await Pe.get(A.url, {
|
|
4279
4279
|
headers: {
|
|
4280
4280
|
Authorization: `Bearer ${B}`
|
|
4281
4281
|
}
|
|
4282
4282
|
});
|
|
4283
4283
|
K === 200 && N("options", (P == null ? void 0 : P.data) || P);
|
|
4284
4284
|
}, [N, A.url]);
|
|
4285
|
-
|
|
4285
|
+
G(() => {
|
|
4286
4286
|
a.type === "document" && A.url && Me();
|
|
4287
4287
|
}, [A.url, a.type, Me]);
|
|
4288
4288
|
const Ee = /* @__PURE__ */ i(
|
|
@@ -4300,7 +4300,7 @@ const No = R.object().shape({
|
|
|
4300
4300
|
{
|
|
4301
4301
|
className: "bg-white h-10 w-10 flex justify-center items-center absolute top-1 -left-12 rounded-lg hover:bg-gray-50",
|
|
4302
4302
|
onClick: n,
|
|
4303
|
-
children: /* @__PURE__ */ i(
|
|
4303
|
+
children: /* @__PURE__ */ i(z, { icon: "tabler:x", iconClass: "text-xl" })
|
|
4304
4304
|
}
|
|
4305
4305
|
),
|
|
4306
4306
|
/* @__PURE__ */ i("div", { className: "w-full pt-4", children: /* @__PURE__ */ i(
|
|
@@ -4323,8 +4323,8 @@ const No = R.object().shape({
|
|
|
4323
4323
|
" ",
|
|
4324
4324
|
/* @__PURE__ */ b("div", { className: " max-h-[70vh] overflow-y-auto flex-1", children: [
|
|
4325
4325
|
d === "basic" && /* @__PURE__ */ b("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
|
|
4326
|
-
li.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4327
|
-
|
|
4326
|
+
li.includes(a.inputType) && /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(
|
|
4327
|
+
W,
|
|
4328
4328
|
{
|
|
4329
4329
|
watch: S,
|
|
4330
4330
|
label: "Value",
|
|
@@ -4334,9 +4334,9 @@ const No = R.object().shape({
|
|
|
4334
4334
|
element: a
|
|
4335
4335
|
}
|
|
4336
4336
|
) }),
|
|
4337
|
-
!li.includes(a.inputType) && !We.includes(a.inputType) && /* @__PURE__ */ b(
|
|
4337
|
+
!li.includes(a.inputType) && !We.includes(a.inputType) && /* @__PURE__ */ b(ve, { children: [
|
|
4338
4338
|
/* @__PURE__ */ i(
|
|
4339
|
-
|
|
4339
|
+
W,
|
|
4340
4340
|
{
|
|
4341
4341
|
watch: S,
|
|
4342
4342
|
label: "Label",
|
|
@@ -4348,7 +4348,7 @@ const No = R.object().shape({
|
|
|
4348
4348
|
),
|
|
4349
4349
|
" ",
|
|
4350
4350
|
a.type.toLowerCase() === "cascadeselect" && /* @__PURE__ */ i(
|
|
4351
|
-
|
|
4351
|
+
W,
|
|
4352
4352
|
{
|
|
4353
4353
|
watch: S,
|
|
4354
4354
|
label: "Child Label",
|
|
@@ -4360,7 +4360,7 @@ const No = R.object().shape({
|
|
|
4360
4360
|
)
|
|
4361
4361
|
] }),
|
|
4362
4362
|
so.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4363
|
-
|
|
4363
|
+
W,
|
|
4364
4364
|
{
|
|
4365
4365
|
watch: S,
|
|
4366
4366
|
label: "Placeholder",
|
|
@@ -4371,7 +4371,7 @@ const No = R.object().shape({
|
|
|
4371
4371
|
}
|
|
4372
4372
|
),
|
|
4373
4373
|
ao.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4374
|
-
|
|
4374
|
+
W,
|
|
4375
4375
|
{
|
|
4376
4376
|
watch: S,
|
|
4377
4377
|
label: "Prefix",
|
|
@@ -4384,7 +4384,7 @@ const No = R.object().shape({
|
|
|
4384
4384
|
to.includes(a.inputType) && /* @__PURE__ */ b("div", { className: "grid gap-y-4", children: [
|
|
4385
4385
|
/* @__PURE__ */ i(bo, {}),
|
|
4386
4386
|
/* @__PURE__ */ i(
|
|
4387
|
-
|
|
4387
|
+
W,
|
|
4388
4388
|
{
|
|
4389
4389
|
watch: S,
|
|
4390
4390
|
label: "Api Url",
|
|
@@ -4411,7 +4411,7 @@ const No = R.object().shape({
|
|
|
4411
4411
|
register: f,
|
|
4412
4412
|
name: "method",
|
|
4413
4413
|
setValue: N,
|
|
4414
|
-
trigger:
|
|
4414
|
+
trigger: C,
|
|
4415
4415
|
value: S("method")
|
|
4416
4416
|
}
|
|
4417
4417
|
),
|
|
@@ -4432,7 +4432,7 @@ const No = R.object().shape({
|
|
|
4432
4432
|
register: f,
|
|
4433
4433
|
name: "responseType",
|
|
4434
4434
|
setValue: N,
|
|
4435
|
-
trigger:
|
|
4435
|
+
trigger: C,
|
|
4436
4436
|
value: S("responseType")
|
|
4437
4437
|
}
|
|
4438
4438
|
)
|
|
@@ -4447,7 +4447,7 @@ const No = R.object().shape({
|
|
|
4447
4447
|
}
|
|
4448
4448
|
),
|
|
4449
4449
|
!li.includes(a.inputType) && !We.includes(a.inputType) && /* @__PURE__ */ i(
|
|
4450
|
-
|
|
4450
|
+
W,
|
|
4451
4451
|
{
|
|
4452
4452
|
watch: S,
|
|
4453
4453
|
label: "Short Description",
|
|
@@ -4457,7 +4457,7 @@ const No = R.object().shape({
|
|
|
4457
4457
|
element: a
|
|
4458
4458
|
}
|
|
4459
4459
|
),
|
|
4460
|
-
a.type.toLowerCase() === "date" && /* @__PURE__ */ b(
|
|
4460
|
+
a.type.toLowerCase() === "date" && /* @__PURE__ */ b(ve, { children: [
|
|
4461
4461
|
/* @__PURE__ */ i(
|
|
4462
4462
|
Ie,
|
|
4463
4463
|
{
|
|
@@ -4466,12 +4466,12 @@ const No = R.object().shape({
|
|
|
4466
4466
|
register: f,
|
|
4467
4467
|
name: "dateFormat",
|
|
4468
4468
|
setValue: N,
|
|
4469
|
-
trigger:
|
|
4469
|
+
trigger: C,
|
|
4470
4470
|
value: S("dateFormat")
|
|
4471
4471
|
}
|
|
4472
4472
|
),
|
|
4473
4473
|
/* @__PURE__ */ i(
|
|
4474
|
-
|
|
4474
|
+
W,
|
|
4475
4475
|
{
|
|
4476
4476
|
watch: S,
|
|
4477
4477
|
label: "Allow Range",
|
|
@@ -4505,7 +4505,7 @@ const No = R.object().shape({
|
|
|
4505
4505
|
)
|
|
4506
4506
|
] }),
|
|
4507
4507
|
/* @__PURE__ */ i(
|
|
4508
|
-
|
|
4508
|
+
W,
|
|
4509
4509
|
{
|
|
4510
4510
|
watch: S,
|
|
4511
4511
|
label: "Allow Year Picker",
|
|
@@ -4519,7 +4519,7 @@ const No = R.object().shape({
|
|
|
4519
4519
|
)
|
|
4520
4520
|
] }),
|
|
4521
4521
|
a.type.toLowerCase() === "country" && /* @__PURE__ */ i(
|
|
4522
|
-
|
|
4522
|
+
W,
|
|
4523
4523
|
{
|
|
4524
4524
|
watch: S,
|
|
4525
4525
|
label: "Allow States",
|
|
@@ -4548,12 +4548,12 @@ const No = R.object().shape({
|
|
|
4548
4548
|
register: f,
|
|
4549
4549
|
name: "selectType",
|
|
4550
4550
|
setValue: N,
|
|
4551
|
-
trigger:
|
|
4551
|
+
trigger: C,
|
|
4552
4552
|
value: S("selectType")
|
|
4553
4553
|
}
|
|
4554
4554
|
),
|
|
4555
4555
|
a.type.toLowerCase() === "grid" && /* @__PURE__ */ i(
|
|
4556
|
-
|
|
4556
|
+
W,
|
|
4557
4557
|
{
|
|
4558
4558
|
watch: S,
|
|
4559
4559
|
label: "Number of columns (max: 4)",
|
|
@@ -4568,7 +4568,7 @@ const No = R.object().shape({
|
|
|
4568
4568
|
a.type.toLowerCase() === "document" && /* @__PURE__ */ b("div", { className: "grid gap-y-6", children: [
|
|
4569
4569
|
/* @__PURE__ */ b("div", { className: "grid gap-y-1", children: [
|
|
4570
4570
|
/* @__PURE__ */ i(
|
|
4571
|
-
|
|
4571
|
+
W,
|
|
4572
4572
|
{
|
|
4573
4573
|
watch: S,
|
|
4574
4574
|
label: "Document Options Url",
|
|
@@ -4583,7 +4583,7 @@ const No = R.object().shape({
|
|
|
4583
4583
|
] }),
|
|
4584
4584
|
/* @__PURE__ */ b("div", { className: "grid gap-y-1", children: [
|
|
4585
4585
|
/* @__PURE__ */ i(
|
|
4586
|
-
|
|
4586
|
+
W,
|
|
4587
4587
|
{
|
|
4588
4588
|
watch: S,
|
|
4589
4589
|
label: "Document Validation Url",
|
|
@@ -4596,7 +4596,7 @@ const No = R.object().shape({
|
|
|
4596
4596
|
/* @__PURE__ */ i(go, {})
|
|
4597
4597
|
] }),
|
|
4598
4598
|
/* @__PURE__ */ i("div", { className: "grid gap-y-1", children: /* @__PURE__ */ i(
|
|
4599
|
-
|
|
4599
|
+
W,
|
|
4600
4600
|
{
|
|
4601
4601
|
watch: S,
|
|
4602
4602
|
label: "Signature Page Url",
|
|
@@ -4608,9 +4608,9 @@ const No = R.object().shape({
|
|
|
4608
4608
|
) })
|
|
4609
4609
|
] }),
|
|
4610
4610
|
a.type.toLowerCase() === "datagrid" && Be(),
|
|
4611
|
-
a.type.toLowerCase() === "file" && /* @__PURE__ */ b(
|
|
4611
|
+
a.type.toLowerCase() === "file" && /* @__PURE__ */ b(ve, { children: [
|
|
4612
4612
|
/* @__PURE__ */ i(
|
|
4613
|
-
|
|
4613
|
+
W,
|
|
4614
4614
|
{
|
|
4615
4615
|
watch: S,
|
|
4616
4616
|
label: "Allow Multiple Uploads",
|
|
@@ -4630,15 +4630,15 @@ const No = R.object().shape({
|
|
|
4630
4630
|
id: "acceptedFiles",
|
|
4631
4631
|
value: A == null ? void 0 : A.acceptedFiles
|
|
4632
4632
|
},
|
|
4633
|
-
validationData: { register: f, setValue: N, trigger:
|
|
4633
|
+
validationData: { register: f, setValue: N, trigger: C, watch: S },
|
|
4634
4634
|
placeholder: "Choose file types"
|
|
4635
4635
|
}
|
|
4636
4636
|
)
|
|
4637
4637
|
] }),
|
|
4638
|
-
uo.includes(a.inputType) &&
|
|
4638
|
+
uo.includes(a.inputType) && Ce(),
|
|
4639
4639
|
/* @__PURE__ */ b("div", { children: [
|
|
4640
4640
|
/* @__PURE__ */ i("div", { className: "w-[150px] mb-4", children: /* @__PURE__ */ i(
|
|
4641
|
-
|
|
4641
|
+
W,
|
|
4642
4642
|
{
|
|
4643
4643
|
watch: S,
|
|
4644
4644
|
label: "Toggle Visibility",
|
|
@@ -4656,7 +4656,7 @@ const No = R.object().shape({
|
|
|
4656
4656
|
{
|
|
4657
4657
|
register: f,
|
|
4658
4658
|
setValue: N,
|
|
4659
|
-
trigger:
|
|
4659
|
+
trigger: C,
|
|
4660
4660
|
watch: S,
|
|
4661
4661
|
id: a == null ? void 0 : a.id
|
|
4662
4662
|
}
|
|
@@ -4679,7 +4679,7 @@ const No = R.object().shape({
|
|
|
4679
4679
|
] }),
|
|
4680
4680
|
a.type.toLowerCase() === "polling" && /* @__PURE__ */ b("div", { className: "grid gap-y-4 mb-4 mt-2", children: [
|
|
4681
4681
|
/* @__PURE__ */ i(
|
|
4682
|
-
|
|
4682
|
+
W,
|
|
4683
4683
|
{
|
|
4684
4684
|
watch: S,
|
|
4685
4685
|
label: "Fetch results from external API",
|
|
@@ -4692,7 +4692,7 @@ const No = R.object().shape({
|
|
|
4692
4692
|
}
|
|
4693
4693
|
),
|
|
4694
4694
|
A.fetchExternalResults && /* @__PURE__ */ i(
|
|
4695
|
-
|
|
4695
|
+
W,
|
|
4696
4696
|
{
|
|
4697
4697
|
watch: S,
|
|
4698
4698
|
label: "External API URL (returns options results)",
|
|
@@ -4708,7 +4708,7 @@ const No = R.object().shape({
|
|
|
4708
4708
|
!We.includes(a.type.toLowerCase()) && d === "validation" && /* @__PURE__ */ b("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
|
|
4709
4709
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
|
|
4710
4710
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
4711
|
-
|
|
4711
|
+
W,
|
|
4712
4712
|
{
|
|
4713
4713
|
watch: S,
|
|
4714
4714
|
label: "Required",
|
|
@@ -4722,7 +4722,7 @@ const No = R.object().shape({
|
|
|
4722
4722
|
) }),
|
|
4723
4723
|
" ",
|
|
4724
4724
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4725
|
-
|
|
4725
|
+
W,
|
|
4726
4726
|
{
|
|
4727
4727
|
watch: S,
|
|
4728
4728
|
label: "Error message text",
|
|
@@ -4733,10 +4733,10 @@ const No = R.object().shape({
|
|
|
4733
4733
|
}
|
|
4734
4734
|
) })
|
|
4735
4735
|
] }),
|
|
4736
|
-
oo.includes(a.inputType) && /* @__PURE__ */ b(
|
|
4736
|
+
oo.includes(a.inputType) && /* @__PURE__ */ b(ve, { children: [
|
|
4737
4737
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
|
|
4738
4738
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
4739
|
-
|
|
4739
|
+
W,
|
|
4740
4740
|
{
|
|
4741
4741
|
watch: S,
|
|
4742
4742
|
label: "Min Length",
|
|
@@ -4749,7 +4749,7 @@ const No = R.object().shape({
|
|
|
4749
4749
|
) }),
|
|
4750
4750
|
" ",
|
|
4751
4751
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4752
|
-
|
|
4752
|
+
W,
|
|
4753
4753
|
{
|
|
4754
4754
|
watch: S,
|
|
4755
4755
|
label: "Error message text",
|
|
@@ -4762,7 +4762,7 @@ const No = R.object().shape({
|
|
|
4762
4762
|
] }),
|
|
4763
4763
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
|
|
4764
4764
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
4765
|
-
|
|
4765
|
+
W,
|
|
4766
4766
|
{
|
|
4767
4767
|
watch: S,
|
|
4768
4768
|
label: "Max Length",
|
|
@@ -4775,7 +4775,7 @@ const No = R.object().shape({
|
|
|
4775
4775
|
) }),
|
|
4776
4776
|
" ",
|
|
4777
4777
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4778
|
-
|
|
4778
|
+
W,
|
|
4779
4779
|
{
|
|
4780
4780
|
watch: S,
|
|
4781
4781
|
label: "Error message text",
|
|
@@ -4787,10 +4787,10 @@ const No = R.object().shape({
|
|
|
4787
4787
|
) })
|
|
4788
4788
|
] })
|
|
4789
4789
|
] }),
|
|
4790
|
-
lo.includes(a.inputType) && /* @__PURE__ */ b(
|
|
4790
|
+
lo.includes(a.inputType) && /* @__PURE__ */ b(ve, { children: [
|
|
4791
4791
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
|
|
4792
4792
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
4793
|
-
|
|
4793
|
+
W,
|
|
4794
4794
|
{
|
|
4795
4795
|
watch: S,
|
|
4796
4796
|
label: "Min Amount",
|
|
@@ -4803,7 +4803,7 @@ const No = R.object().shape({
|
|
|
4803
4803
|
) }),
|
|
4804
4804
|
" ",
|
|
4805
4805
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4806
|
-
|
|
4806
|
+
W,
|
|
4807
4807
|
{
|
|
4808
4808
|
watch: S,
|
|
4809
4809
|
label: "Error message text",
|
|
@@ -4816,7 +4816,7 @@ const No = R.object().shape({
|
|
|
4816
4816
|
] }),
|
|
4817
4817
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-x-6", children: [
|
|
4818
4818
|
/* @__PURE__ */ i("div", { className: "w-[150px]", children: /* @__PURE__ */ i(
|
|
4819
|
-
|
|
4819
|
+
W,
|
|
4820
4820
|
{
|
|
4821
4821
|
watch: S,
|
|
4822
4822
|
label: "Max Amount",
|
|
@@ -4829,7 +4829,7 @@ const No = R.object().shape({
|
|
|
4829
4829
|
) }),
|
|
4830
4830
|
" ",
|
|
4831
4831
|
/* @__PURE__ */ i("div", { className: "flex-1", children: /* @__PURE__ */ i(
|
|
4832
|
-
|
|
4832
|
+
W,
|
|
4833
4833
|
{
|
|
4834
4834
|
watch: S,
|
|
4835
4835
|
label: "Error message text",
|
|
@@ -4858,10 +4858,10 @@ const No = R.object().shape({
|
|
|
4858
4858
|
"button",
|
|
4859
4859
|
{
|
|
4860
4860
|
type: "submit",
|
|
4861
|
-
disabled: !M ||
|
|
4861
|
+
disabled: !M || k,
|
|
4862
4862
|
style: { background: (y == null ? void 0 : y.buttonColor) || "#333" },
|
|
4863
|
-
className: `flex-1 px-4 py-2.5 ${!M ||
|
|
4864
|
-
children:
|
|
4863
|
+
className: `flex-1 px-4 py-2.5 ${!M || k ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!M || k ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50 editor_option__save`,
|
|
4864
|
+
children: k ? "Saving..." : "Save"
|
|
4865
4865
|
}
|
|
4866
4866
|
)
|
|
4867
4867
|
] })
|
|
@@ -4875,7 +4875,7 @@ const No = R.object().shape({
|
|
|
4875
4875
|
}, Ti = Ze(
|
|
4876
4876
|
({ state: e, element: n, children: a }) => {
|
|
4877
4877
|
var c, r;
|
|
4878
|
-
const [s, o] = D(!1), { removeElement: l, duplicateElement: d, updateElement: u } =
|
|
4878
|
+
const [s, o] = D(!1), { removeElement: l, duplicateElement: d, updateElement: u } = se.useContext(be), t = ee(
|
|
4879
4879
|
() => {
|
|
4880
4880
|
var h;
|
|
4881
4881
|
return (h = n == null ? void 0 : n.acceptedFiles) == null ? void 0 : h.map((v) => v.label).join(", ");
|
|
@@ -4886,7 +4886,7 @@ const No = R.object().shape({
|
|
|
4886
4886
|
}, [n.id, n.sectionId, l]);
|
|
4887
4887
|
return /* @__PURE__ */ b("div", { className: "w-full min-w-0", children: [
|
|
4888
4888
|
s && /* @__PURE__ */ i(
|
|
4889
|
-
|
|
4889
|
+
Co,
|
|
4890
4890
|
{
|
|
4891
4891
|
isOpen: s,
|
|
4892
4892
|
onClose: () => o(!1),
|
|
@@ -4929,7 +4929,7 @@ const No = R.object().shape({
|
|
|
4929
4929
|
className: "text-sm outline-none hover:opacity-80 py-1 text-gray-600",
|
|
4930
4930
|
onClick: () => d(n == null ? void 0 : n.id, n.sectionId),
|
|
4931
4931
|
title: "Duplicate",
|
|
4932
|
-
children: /* @__PURE__ */ i(
|
|
4932
|
+
children: /* @__PURE__ */ i(z, { icon: "tabler:copy", iconClass: "text-base" })
|
|
4933
4933
|
}
|
|
4934
4934
|
),
|
|
4935
4935
|
/* @__PURE__ */ i(
|
|
@@ -4939,7 +4939,7 @@ const No = R.object().shape({
|
|
|
4939
4939
|
className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
|
|
4940
4940
|
onClick: () => o(!0),
|
|
4941
4941
|
title: "Edit",
|
|
4942
|
-
children: /* @__PURE__ */ i(
|
|
4942
|
+
children: /* @__PURE__ */ i(z, { icon: "circum:edit", iconClass: "text-base" })
|
|
4943
4943
|
}
|
|
4944
4944
|
),
|
|
4945
4945
|
/* @__PURE__ */ i(
|
|
@@ -4949,7 +4949,7 @@ const No = R.object().shape({
|
|
|
4949
4949
|
className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
|
|
4950
4950
|
onClick: m,
|
|
4951
4951
|
title: "Remove",
|
|
4952
|
-
children: /* @__PURE__ */ i(
|
|
4952
|
+
children: /* @__PURE__ */ i(z, { icon: "iconamoon:trash", iconClass: "text-base" })
|
|
4953
4953
|
}
|
|
4954
4954
|
)
|
|
4955
4955
|
] })
|
|
@@ -4972,7 +4972,7 @@ function Mo({
|
|
|
4972
4972
|
} = n || {};
|
|
4973
4973
|
let u;
|
|
4974
4974
|
return l && (u = l()[e.id]), /* @__PURE__ */ i(
|
|
4975
|
-
|
|
4975
|
+
W,
|
|
4976
4976
|
{
|
|
4977
4977
|
placeholder: e.placeholder,
|
|
4978
4978
|
type: e.inputType,
|
|
@@ -5084,41 +5084,41 @@ function Bo({
|
|
|
5084
5084
|
element: e,
|
|
5085
5085
|
validationData: n
|
|
5086
5086
|
}) {
|
|
5087
|
-
var
|
|
5087
|
+
var k;
|
|
5088
5088
|
const { register: a = () => ({}), setValue: s, watch: o } = n || {}, [l, d] = D(), [u, t] = D(!1), [m, c] = D(!1), [r, h] = D(""), v = o && o(e == null ? void 0 : e.id);
|
|
5089
|
-
|
|
5089
|
+
G(() => {
|
|
5090
5090
|
d(v);
|
|
5091
5091
|
}, [v]);
|
|
5092
5092
|
const [y, f] = D("");
|
|
5093
|
-
|
|
5093
|
+
G(() => {
|
|
5094
5094
|
a(e.id);
|
|
5095
5095
|
}, [e.id, a]);
|
|
5096
|
-
const { url: g, method: p, responseType: N } = e || {},
|
|
5096
|
+
const { url: g, method: p, responseType: N } = e || {}, C = {
|
|
5097
5097
|
headers: {
|
|
5098
|
-
Authorization: `Bearer ${
|
|
5098
|
+
Authorization: `Bearer ${de("token")}`
|
|
5099
5099
|
}
|
|
5100
5100
|
}, x = Y(
|
|
5101
5101
|
async (M) => {
|
|
5102
|
-
var w, A, T, I, L,
|
|
5102
|
+
var w, A, T, I, L, F, Z, ie, X, he, _;
|
|
5103
5103
|
if (!(!g || !p)) {
|
|
5104
5104
|
t(!0);
|
|
5105
5105
|
try {
|
|
5106
5106
|
let V;
|
|
5107
5107
|
if (p.toLowerCase() === "get") {
|
|
5108
|
-
const
|
|
5109
|
-
V = await Pe.get(
|
|
5108
|
+
const ce = `${g}?value=${M}`;
|
|
5109
|
+
V = await Pe.get(ce, C);
|
|
5110
5110
|
} else if (p.toLowerCase() === "post")
|
|
5111
|
-
V = await Pe.post(g, { value: M },
|
|
5111
|
+
V = await Pe.post(g, { value: M }, C);
|
|
5112
5112
|
else
|
|
5113
5113
|
throw new Error("Unsupported HTTP method");
|
|
5114
5114
|
V.status === 200 && ((((A = (w = V == null ? void 0 : V.data) == null ? void 0 : w.data) == null ? void 0 : A.status) || ((T = V == null ? void 0 : V.data) == null ? void 0 : T.status)) === !0 ? (c(!0), N === "string" ? h(
|
|
5115
|
-
((L = (I = V == null ? void 0 : V.data) == null ? void 0 : I.data) == null ? void 0 : L.description) || ((
|
|
5115
|
+
((L = (I = V == null ? void 0 : V.data) == null ? void 0 : I.data) == null ? void 0 : L.description) || ((F = V == null ? void 0 : V.data) == null ? void 0 : F.description) || "Validation successful"
|
|
5116
5116
|
) : f(
|
|
5117
|
-
((
|
|
5117
|
+
((ie = (Z = V == null ? void 0 : V.data) == null ? void 0 : Z.data) == null ? void 0 : ie.description) || ((X = V == null ? void 0 : V.data) == null ? void 0 : X.description) || {}
|
|
5118
5118
|
)) : (console.error("Invalid input:", M), h("Unable to validate input"), c(!1)));
|
|
5119
5119
|
} catch (V) {
|
|
5120
5120
|
console.error("Error validating input:", V), h(
|
|
5121
|
-
((_ = (
|
|
5121
|
+
((_ = (he = V == null ? void 0 : V.response) == null ? void 0 : he.data) == null ? void 0 : _.message) || "Unable to validate input"
|
|
5122
5122
|
), c(!1);
|
|
5123
5123
|
} finally {
|
|
5124
5124
|
t(!1);
|
|
@@ -5127,7 +5127,7 @@ function Bo({
|
|
|
5127
5127
|
},
|
|
5128
5128
|
[p, N, g]
|
|
5129
5129
|
);
|
|
5130
|
-
return
|
|
5130
|
+
return G(() => {
|
|
5131
5131
|
if (l) {
|
|
5132
5132
|
const M = setTimeout(() => {
|
|
5133
5133
|
x(l);
|
|
@@ -5141,7 +5141,7 @@ function Bo({
|
|
|
5141
5141
|
{
|
|
5142
5142
|
placeholder: (e == null ? void 0 : e.placeholder) || "",
|
|
5143
5143
|
type: (e == null ? void 0 : e.inputType) || "text",
|
|
5144
|
-
className:
|
|
5144
|
+
className: J("field-control", e == null ? void 0 : e.customClass),
|
|
5145
5145
|
...a(e == null ? void 0 : e.id),
|
|
5146
5146
|
onChange: (M) => {
|
|
5147
5147
|
d(M.target.value), s(e == null ? void 0 : e.id, M.target.value);
|
|
@@ -5183,7 +5183,7 @@ function Bo({
|
|
|
5183
5183
|
}
|
|
5184
5184
|
)
|
|
5185
5185
|
] }),
|
|
5186
|
-
m && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(
|
|
5186
|
+
m && !u && /* @__PURE__ */ i("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ i(z, { icon: "gg:check-o" }) })
|
|
5187
5187
|
] })
|
|
5188
5188
|
] }),
|
|
5189
5189
|
r && N === "string" && /* @__PURE__ */ i(
|
|
@@ -5193,7 +5193,7 @@ function Bo({
|
|
|
5193
5193
|
children: r
|
|
5194
5194
|
}
|
|
5195
5195
|
),
|
|
5196
|
-
N === "object" && /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (
|
|
5196
|
+
N === "object" && /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (k = Object.entries(y)) == null ? void 0 : k.map(([M, w]) => /* @__PURE__ */ b("div", { className: "flex items-center gap-x-2", children: [
|
|
5197
5197
|
/* @__PURE__ */ b("span", { className: "font-semibold", children: [
|
|
5198
5198
|
M,
|
|
5199
5199
|
":"
|
|
@@ -5221,16 +5221,16 @@ function Eo({
|
|
|
5221
5221
|
function u(m, c) {
|
|
5222
5222
|
return parseFloat(m) * parseFloat(c) || 0;
|
|
5223
5223
|
}
|
|
5224
|
-
const t =
|
|
5224
|
+
const t = ee(
|
|
5225
5225
|
() => o.reduce((m, c) => {
|
|
5226
5226
|
const r = u(c.key, c.value);
|
|
5227
5227
|
return m + r;
|
|
5228
5228
|
}, 0),
|
|
5229
5229
|
[o]
|
|
5230
5230
|
);
|
|
5231
|
-
return
|
|
5231
|
+
return G(() => {
|
|
5232
5232
|
e && e(o);
|
|
5233
|
-
}, [o]),
|
|
5233
|
+
}, [o]), G(() => {
|
|
5234
5234
|
if (s != null && s.length) {
|
|
5235
5235
|
const m = s == null ? void 0 : s.map((c, r) => ({
|
|
5236
5236
|
key: c.value,
|
|
@@ -5281,7 +5281,7 @@ function Lo({
|
|
|
5281
5281
|
validationData: n
|
|
5282
5282
|
}) {
|
|
5283
5283
|
const { register: a = () => ({}), setValue: s, getValues: o } = n || {}, l = o && o(e == null ? void 0 : e.id) || [];
|
|
5284
|
-
return
|
|
5284
|
+
return G(() => {
|
|
5285
5285
|
a(e.id);
|
|
5286
5286
|
}, [e.id, a]), /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
5287
5287
|
Eo,
|
|
@@ -5296,10 +5296,10 @@ function Lo({
|
|
|
5296
5296
|
) });
|
|
5297
5297
|
}
|
|
5298
5298
|
function Po({ element: e }) {
|
|
5299
|
-
return /* @__PURE__ */ i("div", { className:
|
|
5299
|
+
return /* @__PURE__ */ i("div", { className: J("py-6", e == null ? void 0 : e.customClass) });
|
|
5300
5300
|
}
|
|
5301
5301
|
function Ro({ element: e }) {
|
|
5302
|
-
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("hr", { className:
|
|
5302
|
+
return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("hr", { className: J("border-gray-200 my-4", e == null ? void 0 : e.customClass) }) });
|
|
5303
5303
|
}
|
|
5304
5304
|
function Do({
|
|
5305
5305
|
element: e,
|
|
@@ -5320,7 +5320,7 @@ function Io({
|
|
|
5320
5320
|
element: e,
|
|
5321
5321
|
state: n
|
|
5322
5322
|
}) {
|
|
5323
|
-
return /* @__PURE__ */ i(
|
|
5323
|
+
return /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i("div", { className: e == null ? void 0 : e.customClass, children: (e == null ? void 0 : e.value) || n === "edit" && /* @__PURE__ */ i("span", { className: "text-gray-400", children: "Provide text" }) }) });
|
|
5324
5324
|
}
|
|
5325
5325
|
function Ko({
|
|
5326
5326
|
row: e,
|
|
@@ -5432,7 +5432,7 @@ function Ko({
|
|
|
5432
5432
|
onClick: () => l(e.id),
|
|
5433
5433
|
className: "text-red-500 hover:text-red-700",
|
|
5434
5434
|
"aria-label": "Delete row",
|
|
5435
|
-
children: /* @__PURE__ */ i(
|
|
5435
|
+
children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone", iconClass: "text-xl" })
|
|
5436
5436
|
}
|
|
5437
5437
|
) })
|
|
5438
5438
|
] });
|
|
@@ -5444,8 +5444,8 @@ function Go({
|
|
|
5444
5444
|
isReadOnly: a = !1,
|
|
5445
5445
|
columns: s
|
|
5446
5446
|
}) {
|
|
5447
|
-
const [o, l] = D(e), d =
|
|
5448
|
-
u.current = o,
|
|
5447
|
+
const [o, l] = D(e), d = de("config"), u = re(o);
|
|
5448
|
+
u.current = o, G(() => {
|
|
5449
5449
|
l((h) => JSON.stringify(h) !== JSON.stringify(e) ? e : h);
|
|
5450
5450
|
}, [e]);
|
|
5451
5451
|
const t = Y(
|
|
@@ -5457,7 +5457,7 @@ function Go({
|
|
|
5457
5457
|
},
|
|
5458
5458
|
[n]
|
|
5459
5459
|
), m = Y(() => {
|
|
5460
|
-
const h =
|
|
5460
|
+
const h = pe(), v = s.reduce((f, g) => (f[g.field] = g.field === "id" ? h : "", f), {}), y = [...u.current, { id: h, ...v }];
|
|
5461
5461
|
l(y), n == null || n(y);
|
|
5462
5462
|
}, [s, n]), c = Y(
|
|
5463
5463
|
(h) => {
|
|
@@ -5534,10 +5534,10 @@ function jo({
|
|
|
5534
5534
|
watch: o,
|
|
5535
5535
|
isReadOnly: l
|
|
5536
5536
|
} = n || {}, d = o && o(e == null ? void 0 : e.id) || {}, u = Array.isArray(d) ? d : (v = d == null ? void 0 : d.rows) != null ? v : [];
|
|
5537
|
-
|
|
5537
|
+
G(() => {
|
|
5538
5538
|
a(e.id);
|
|
5539
5539
|
}, [e.id, a]);
|
|
5540
|
-
const t =
|
|
5540
|
+
const t = re(""), m = re(e == null ? void 0 : e.id), c = re(e == null ? void 0 : e.dataColumns), r = re(s);
|
|
5541
5541
|
m.current = e == null ? void 0 : e.id, c.current = e == null ? void 0 : e.dataColumns, r.current = s;
|
|
5542
5542
|
const h = Y((y) => {
|
|
5543
5543
|
var g;
|
|
@@ -5575,51 +5575,51 @@ const qi = ({
|
|
|
5575
5575
|
loading: y,
|
|
5576
5576
|
disabled: f
|
|
5577
5577
|
}) => {
|
|
5578
|
-
const [g, p] = D(c ? [] : null), N =
|
|
5579
|
-
return
|
|
5580
|
-
const
|
|
5581
|
-
var
|
|
5582
|
-
return typeof x.value == "string" && typeof t == "string" ? x.value.toLowerCase() === t.toLowerCase() : typeof x.value == "object" && typeof t == "object" ? ((
|
|
5578
|
+
const [g, p] = D(c ? [] : null), N = J("custom-select__control", e), S = ee(() => n, [n]);
|
|
5579
|
+
return G(() => {
|
|
5580
|
+
const C = n == null ? void 0 : n.find((x) => {
|
|
5581
|
+
var k;
|
|
5582
|
+
return typeof x.value == "string" && typeof t == "string" ? x.value.toLowerCase() === t.toLowerCase() : typeof x.value == "object" && typeof t == "object" ? ((k = x.value) == null ? void 0 : k.id) === (t == null ? void 0 : t.id) : x.value === t;
|
|
5583
5583
|
});
|
|
5584
|
-
p(
|
|
5585
|
-
}, [t, n]),
|
|
5584
|
+
p(C || null);
|
|
5585
|
+
}, [t, n]), G(() => {
|
|
5586
5586
|
g && l && o && (l(d, g == null ? void 0 : g.value), o(d), m == null || m(d));
|
|
5587
5587
|
}, [d, g]), /* @__PURE__ */ b("div", { className: "custom-select", children: [
|
|
5588
5588
|
u && !r && /* @__PURE__ */ i("label", { className: "custom-select__label", children: u }),
|
|
5589
|
-
r && u && /* @__PURE__ */ i("label", { className:
|
|
5589
|
+
r && u && /* @__PURE__ */ i("label", { className: J("custom-select__floating-label", v), children: u }),
|
|
5590
5590
|
/* @__PURE__ */ i(
|
|
5591
|
-
|
|
5591
|
+
ae,
|
|
5592
5592
|
{
|
|
5593
5593
|
value: g,
|
|
5594
5594
|
onChange: p,
|
|
5595
5595
|
multiple: c,
|
|
5596
5596
|
disabled: f,
|
|
5597
5597
|
children: /* @__PURE__ */ b("div", { className: "custom-select__wrapper", children: [
|
|
5598
|
-
/* @__PURE__ */ b(
|
|
5598
|
+
/* @__PURE__ */ b(ae.Button, { className: N, disabled: f, children: [
|
|
5599
5599
|
y ? /* @__PURE__ */ i("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ i("span", { className: "custom-select__value", children: (g == null ? void 0 : g.label) || /* @__PURE__ */ i("span", { className: "custom-select__placeholder", children: a }) }),
|
|
5600
|
-
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(
|
|
5600
|
+
/* @__PURE__ */ i("span", { className: "custom-select__icon", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) })
|
|
5601
5601
|
] }),
|
|
5602
5602
|
/* @__PURE__ */ i(
|
|
5603
5603
|
we,
|
|
5604
5604
|
{
|
|
5605
|
-
as:
|
|
5605
|
+
as: se.Fragment,
|
|
5606
5606
|
leave: "custom-select__transition",
|
|
5607
|
-
children: /* @__PURE__ */ i(
|
|
5608
|
-
|
|
5607
|
+
children: /* @__PURE__ */ i(ae.Options, { className: "custom-select__options", anchor: "bottom", children: S == null ? void 0 : S.map((C, x) => /* @__PURE__ */ i(
|
|
5608
|
+
ae.Option,
|
|
5609
5609
|
{
|
|
5610
|
-
value:
|
|
5611
|
-
className: ({ active:
|
|
5610
|
+
value: C,
|
|
5611
|
+
className: ({ active: k }) => J(
|
|
5612
5612
|
"custom-select__option",
|
|
5613
|
-
|
|
5613
|
+
k && "custom-select__option--active"
|
|
5614
5614
|
),
|
|
5615
|
-
children: ({ selected:
|
|
5615
|
+
children: ({ selected: k }) => /* @__PURE__ */ i(
|
|
5616
5616
|
"span",
|
|
5617
5617
|
{
|
|
5618
|
-
className:
|
|
5618
|
+
className: J(
|
|
5619
5619
|
"custom-select__option-label",
|
|
5620
|
-
|
|
5620
|
+
k && "custom-select__option--selected"
|
|
5621
5621
|
),
|
|
5622
|
-
children:
|
|
5622
|
+
children: C.label
|
|
5623
5623
|
}
|
|
5624
5624
|
)
|
|
5625
5625
|
},
|
|
@@ -5650,7 +5650,7 @@ const qi = ({
|
|
|
5650
5650
|
}, v = (g, p) => {
|
|
5651
5651
|
g === "first" ? (m(p), r(""), h(p, "")) : (r(p), h(t, p));
|
|
5652
5652
|
};
|
|
5653
|
-
|
|
5653
|
+
G(() => {
|
|
5654
5654
|
if (l) {
|
|
5655
5655
|
const g = l(u);
|
|
5656
5656
|
if (g != null && g.includes("_")) {
|
|
@@ -5659,7 +5659,7 @@ const qi = ({
|
|
|
5659
5659
|
}
|
|
5660
5660
|
}
|
|
5661
5661
|
}, [l, u]);
|
|
5662
|
-
const y =
|
|
5662
|
+
const y = ee(
|
|
5663
5663
|
() => {
|
|
5664
5664
|
var g;
|
|
5665
5665
|
return (g = e.options1) == null ? void 0 : g.filter((p) => p.key === t);
|
|
@@ -5710,7 +5710,7 @@ const qi = ({
|
|
|
5710
5710
|
watch: r,
|
|
5711
5711
|
isReadOnly: h
|
|
5712
5712
|
} = u || {}, v = (p = r == null ? void 0 : r(d.id)) != null ? p : 0, [y, f] = D(null);
|
|
5713
|
-
|
|
5713
|
+
G(() => {
|
|
5714
5714
|
v == null && (c == null || c(d.id, e));
|
|
5715
5715
|
}, []);
|
|
5716
5716
|
const g = (N) => {
|
|
@@ -5722,12 +5722,12 @@ const qi = ({
|
|
|
5722
5722
|
return /* @__PURE__ */ b("div", { className: `flex gap-1 ${l}`, children: [
|
|
5723
5723
|
/* @__PURE__ */ i("input", { type: "hidden", ...t(d.id) }),
|
|
5724
5724
|
Array.from({ length: n }, (N, S) => {
|
|
5725
|
-
const
|
|
5725
|
+
const C = y !== null ? S <= y : S < v;
|
|
5726
5726
|
return /* @__PURE__ */ i(
|
|
5727
5727
|
vn,
|
|
5728
5728
|
{
|
|
5729
|
-
icon:
|
|
5730
|
-
className: `cursor-pointer transition-colors ${
|
|
5729
|
+
icon: C ? "mdi:star" : "mdi:star-outline",
|
|
5730
|
+
className: `cursor-pointer transition-colors ${C ? "text-yellow-400" : "text-gray-300"}`,
|
|
5731
5731
|
width: o,
|
|
5732
5732
|
height: o,
|
|
5733
5733
|
onMouseEnter: () => !(a || h) && f(S),
|
|
@@ -5744,7 +5744,7 @@ function Vo({
|
|
|
5744
5744
|
validationData: n
|
|
5745
5745
|
}) {
|
|
5746
5746
|
const { register: a = () => ({}) } = n || {}, s = (e == null ? void 0 : e.options) || [], o = (e == null ? void 0 : e.options1) || [];
|
|
5747
|
-
return /* @__PURE__ */ i("div", { className:
|
|
5747
|
+
return /* @__PURE__ */ i("div", { className: J("w-full overflow-x-auto", e.customClass), children: /* @__PURE__ */ b("table", { className: "w-full text-left border-collapse min-w-[600px] mb-2", children: [
|
|
5748
5748
|
/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ b("tr", { children: [
|
|
5749
5749
|
/* @__PURE__ */ i("th", { className: "p-3 border-b bg-gray-50/50" }),
|
|
5750
5750
|
o.map((l) => /* @__PURE__ */ i(
|
|
@@ -5788,14 +5788,14 @@ function _i({
|
|
|
5788
5788
|
trigger: o,
|
|
5789
5789
|
isReadOnly: l,
|
|
5790
5790
|
watch: d
|
|
5791
|
-
} = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: t, state: m } =
|
|
5791
|
+
} = n || {}, u = (d == null ? void 0 : d(e.id)) || "", { country: t, state: m } = ee(() => {
|
|
5792
5792
|
var y;
|
|
5793
5793
|
if (typeof u == "string" && u.includes(",")) {
|
|
5794
5794
|
const [f, g] = (y = u.split(",")) == null ? void 0 : y.map((p) => p.trim());
|
|
5795
5795
|
return { country: g, state: f };
|
|
5796
5796
|
}
|
|
5797
5797
|
return { country: u, state: "" };
|
|
5798
|
-
}, [u]), c =
|
|
5798
|
+
}, [u]), c = re(u), r = ee(() => {
|
|
5799
5799
|
var y, f;
|
|
5800
5800
|
return t ? ((f = (y = _e.find((g) => g.name === t)) == null ? void 0 : y.states) == null ? void 0 : f.map((g) => ({
|
|
5801
5801
|
label: g.name,
|
|
@@ -5808,7 +5808,7 @@ function _i({
|
|
|
5808
5808
|
const g = (f == null ? void 0 : f.value) || "", p = g ? `${g}, ${t}` : t;
|
|
5809
5809
|
s && p !== c.current && (s(e.id, p), o == null || o(e.id), c.current = p);
|
|
5810
5810
|
};
|
|
5811
|
-
return
|
|
5811
|
+
return G(() => {
|
|
5812
5812
|
c.current = u;
|
|
5813
5813
|
}, [u]), /* @__PURE__ */ b("div", { className: "grid gap-y-6", children: [
|
|
5814
5814
|
/* @__PURE__ */ i("input", { type: "hidden", ...a(e.id) }),
|
|
@@ -5843,14 +5843,14 @@ function Uo({
|
|
|
5843
5843
|
element: e,
|
|
5844
5844
|
validationData: n
|
|
5845
5845
|
}) {
|
|
5846
|
-
const { register: a = () => ({}), isReadOnly: s } = n || {}, { validationUrl: o, documentObj: l, signatureLink: d } = e, u =
|
|
5846
|
+
const { register: a = () => ({}), isReadOnly: s } = n || {}, { validationUrl: o, documentObj: l, signatureLink: d } = e, u = ee(() => de("config"), []), [t, m] = D(!1), [c, r] = D(!1), h = Y(async () => {
|
|
5847
5847
|
var v, y;
|
|
5848
5848
|
if (!(!o || !l))
|
|
5849
5849
|
try {
|
|
5850
5850
|
r(!0);
|
|
5851
5851
|
const g = {
|
|
5852
5852
|
headers: {
|
|
5853
|
-
Authorization: `Bearer ${
|
|
5853
|
+
Authorization: `Bearer ${de("token")}`
|
|
5854
5854
|
}
|
|
5855
5855
|
}, { data: p } = await Pe.get(
|
|
5856
5856
|
`${o}/${l}`,
|
|
@@ -5863,7 +5863,7 @@ function Uo({
|
|
|
5863
5863
|
r(!1);
|
|
5864
5864
|
}
|
|
5865
5865
|
}, [o, l]);
|
|
5866
|
-
return
|
|
5866
|
+
return G(() => {
|
|
5867
5867
|
let v = null;
|
|
5868
5868
|
return !t && l && o && (async () => {
|
|
5869
5869
|
await h() || (v = setInterval(async () => {
|
|
@@ -5878,7 +5878,7 @@ function Uo({
|
|
|
5878
5878
|
{
|
|
5879
5879
|
placeholder: e.placeholder,
|
|
5880
5880
|
type: e.inputType,
|
|
5881
|
-
className:
|
|
5881
|
+
className: J("field-control", e.customClass),
|
|
5882
5882
|
...a(e.id),
|
|
5883
5883
|
disabled: s
|
|
5884
5884
|
}
|
|
@@ -5890,13 +5890,13 @@ function Uo({
|
|
|
5890
5890
|
onClick: h,
|
|
5891
5891
|
disabled: c || t,
|
|
5892
5892
|
style: { background: (u == null ? void 0 : u.buttonColor) || "#333" },
|
|
5893
|
-
className:
|
|
5893
|
+
className: J(
|
|
5894
5894
|
"flex items-center gap-x-1 rounded-lg border border-gray-200 bg-gray-200 px-3 py-[10px] text-sm text-white",
|
|
5895
5895
|
{ "!opacity-60": c }
|
|
5896
5896
|
),
|
|
5897
5897
|
children: [
|
|
5898
5898
|
/* @__PURE__ */ i(
|
|
5899
|
-
|
|
5899
|
+
z,
|
|
5900
5900
|
{
|
|
5901
5901
|
icon: c ? "solar:refresh-outline" : t ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
|
|
5902
5902
|
iconClass: c ? "animate-spin" : ""
|
|
@@ -6171,33 +6171,33 @@ function Wo({
|
|
|
6171
6171
|
onChange: v,
|
|
6172
6172
|
onError: y
|
|
6173
6173
|
}) {
|
|
6174
|
-
const [f, g] = D(""), [p, N] = D(null), [S,
|
|
6174
|
+
const [f, g] = D(""), [p, N] = D(null), [S, C] = D(""), x = ee(
|
|
6175
6175
|
() => {
|
|
6176
6176
|
var L;
|
|
6177
|
-
return (L = ui == null ? void 0 : ui.slice().sort((
|
|
6177
|
+
return (L = ui == null ? void 0 : ui.slice().sort((F, Z) => F.label.localeCompare(Z.label))) == null ? void 0 : L.map((F) => ({ ...F, phone: `+${F.phone}` }));
|
|
6178
6178
|
},
|
|
6179
6179
|
[]
|
|
6180
|
-
),
|
|
6180
|
+
), k = ee(() => f ? x.filter(
|
|
6181
6181
|
(L) => `${L.label} ${L.phone}`.toLowerCase().includes(f.toLowerCase())
|
|
6182
6182
|
) : x, [f, x]), M = (p == null ? void 0 : p.min) || 10, w = (p == null ? void 0 : p.max) || 10, A = () => S ? `${(p == null ? void 0 : p.phone) || "+234"}-${S}` : "", T = (L) => {
|
|
6183
6183
|
if (!L) return { code: "+234", number: "" };
|
|
6184
|
-
const
|
|
6185
|
-
return { code:
|
|
6184
|
+
const F = L.split(/[-\s]/);
|
|
6185
|
+
return { code: F[0], number: F.slice(1).join(" ") };
|
|
6186
6186
|
};
|
|
6187
|
-
|
|
6187
|
+
G(() => {
|
|
6188
6188
|
if (d) {
|
|
6189
6189
|
const L = T(d);
|
|
6190
6190
|
N(
|
|
6191
|
-
x.find((
|
|
6192
|
-
),
|
|
6191
|
+
x.find((F) => F.phone === L.code) || x[0]
|
|
6192
|
+
), C(L.number);
|
|
6193
6193
|
}
|
|
6194
6194
|
}, [d, x]);
|
|
6195
|
-
const I =
|
|
6195
|
+
const I = ee(() => {
|
|
6196
6196
|
if (u) return u;
|
|
6197
6197
|
const L = S.length;
|
|
6198
6198
|
return s && L === 0 ? "Phone number is required" : L > 0 && !/^\d+$/.test(S) ? "Phone number must contain only digits" : L > 0 && L < M ? `Minimum length is ${M}` : L > w ? `Maximum length is ${w}` : "";
|
|
6199
6199
|
}, [u, S, M, w, s]);
|
|
6200
|
-
return
|
|
6200
|
+
return G(() => {
|
|
6201
6201
|
v == null || v(A()), y == null || y(I || null);
|
|
6202
6202
|
}, [S, p, I]), /* @__PURE__ */ b(
|
|
6203
6203
|
"div",
|
|
@@ -6218,7 +6218,7 @@ function Wo({
|
|
|
6218
6218
|
}
|
|
6219
6219
|
),
|
|
6220
6220
|
/* @__PURE__ */ b("div", { className: "relative !flex items-center input-control text-[#667085] !py-0 field-control", children: [
|
|
6221
|
-
/* @__PURE__ */ i(
|
|
6221
|
+
/* @__PURE__ */ i(z, { icon: "lucide:phone-call" }),
|
|
6222
6222
|
/* @__PURE__ */ i(De, { value: p, onChange: N, children: /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
6223
6223
|
/* @__PURE__ */ i(
|
|
6224
6224
|
De.Input,
|
|
@@ -6229,8 +6229,8 @@ function Wo({
|
|
|
6229
6229
|
onChange: (L) => g(L.target.value)
|
|
6230
6230
|
}
|
|
6231
6231
|
),
|
|
6232
|
-
/* @__PURE__ */ i(De.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(
|
|
6233
|
-
/* @__PURE__ */ i(De.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children:
|
|
6232
|
+
/* @__PURE__ */ i(De.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ i(z, { icon: "lucide:chevron-down" }) }),
|
|
6233
|
+
/* @__PURE__ */ i(De.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: k == null ? void 0 : k.map((L, F) => /* @__PURE__ */ b(
|
|
6234
6234
|
De.Option,
|
|
6235
6235
|
{
|
|
6236
6236
|
value: L,
|
|
@@ -6241,7 +6241,7 @@ function Wo({
|
|
|
6241
6241
|
L.label
|
|
6242
6242
|
]
|
|
6243
6243
|
},
|
|
6244
|
-
`${L.code}+ ${
|
|
6244
|
+
`${L.code}+ ${F}`
|
|
6245
6245
|
)) })
|
|
6246
6246
|
] }) }),
|
|
6247
6247
|
/* @__PURE__ */ b("div", { className: "relative flex items-center flex-1 z-[1]", children: [
|
|
@@ -6254,8 +6254,8 @@ function Wo({
|
|
|
6254
6254
|
disabled: t,
|
|
6255
6255
|
readOnly: m,
|
|
6256
6256
|
onChange: (L) => {
|
|
6257
|
-
const
|
|
6258
|
-
|
|
6257
|
+
const F = L.target.value.replace(/\D/g, "");
|
|
6258
|
+
C(F);
|
|
6259
6259
|
},
|
|
6260
6260
|
placeholder: n,
|
|
6261
6261
|
className: "w-full px-3 outline-none",
|
|
@@ -6263,7 +6263,7 @@ function Wo({
|
|
|
6263
6263
|
minLength: M
|
|
6264
6264
|
}
|
|
6265
6265
|
),
|
|
6266
|
-
/* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !I && S.length > 0 && !m && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(
|
|
6266
|
+
/* @__PURE__ */ i("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !I && S.length > 0 && !m && /* @__PURE__ */ i("span", { className: "text-green-500", children: /* @__PURE__ */ i(z, { icon: "bi:check-lg" }) }) })
|
|
6267
6267
|
] })
|
|
6268
6268
|
] }),
|
|
6269
6269
|
r && /* @__PURE__ */ i("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: r })
|
|
@@ -6284,7 +6284,7 @@ function zo({
|
|
|
6284
6284
|
clearErrors: u
|
|
6285
6285
|
} = n || {};
|
|
6286
6286
|
let t;
|
|
6287
|
-
return
|
|
6287
|
+
return G(() => {
|
|
6288
6288
|
a(e.id);
|
|
6289
6289
|
}, [e.id, a]), o && (t = o()[e.id]), /* @__PURE__ */ i(
|
|
6290
6290
|
Wo,
|
|
@@ -6321,7 +6321,7 @@ function Jo({
|
|
|
6321
6321
|
{
|
|
6322
6322
|
placeholder: (e == null ? void 0 : e.placeholder) || "Enter Url link",
|
|
6323
6323
|
type: "text",
|
|
6324
|
-
className:
|
|
6324
|
+
className: J(
|
|
6325
6325
|
"field-control",
|
|
6326
6326
|
t && "!pl-16",
|
|
6327
6327
|
e == null ? void 0 : e.customClass
|
|
@@ -6358,13 +6358,13 @@ function qo({
|
|
|
6358
6358
|
validationData: n
|
|
6359
6359
|
}) {
|
|
6360
6360
|
var t;
|
|
6361
|
-
const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l =
|
|
6361
|
+
const { watch: a, setValue: s } = n || {}, o = (e == null ? void 0 : e.formula) || "", l = ee(() => {
|
|
6362
6362
|
const c = (o.match(/\{\{([^{}]+)\}\}/g) || []).map((v) => v.replace(/[{}]/g, "")), h = (o.match(/@\[.*?\]\((.*?)\)/g) || []).map((v) => {
|
|
6363
6363
|
const y = /@\[.*?\]\((.*?)\)/.exec(v);
|
|
6364
6364
|
return y ? y[1] : "";
|
|
6365
6365
|
}).filter(Boolean);
|
|
6366
6366
|
return Array.from(/* @__PURE__ */ new Set([...c, ...h]));
|
|
6367
|
-
}, [o]), d = a ? a(l) : [], u =
|
|
6367
|
+
}, [o]), d = a ? a(l) : [], u = ee(() => {
|
|
6368
6368
|
if (!o) return "";
|
|
6369
6369
|
let m = o, c = !1;
|
|
6370
6370
|
if (l.forEach((r, h) => {
|
|
@@ -6380,14 +6380,14 @@ function qo({
|
|
|
6380
6380
|
return "Error";
|
|
6381
6381
|
}
|
|
6382
6382
|
}, [o, l, d]);
|
|
6383
|
-
return
|
|
6383
|
+
return G(() => {
|
|
6384
6384
|
s && u !== "Error" && u !== "" && s(e.id, u, { shouldValidate: !0, shouldDirty: !0 });
|
|
6385
6385
|
}, [u, e.id, s]), /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(
|
|
6386
6386
|
"input",
|
|
6387
6387
|
{
|
|
6388
6388
|
placeholder: (e == null ? void 0 : e.placeholder) || "Calculated result",
|
|
6389
6389
|
type: "text",
|
|
6390
|
-
className:
|
|
6390
|
+
className: J("field-control bg-gray-100 cursor-not-allowed", e == null ? void 0 : e.customClass),
|
|
6391
6391
|
value: u,
|
|
6392
6392
|
readOnly: !0,
|
|
6393
6393
|
disabled: !0,
|
|
@@ -6402,7 +6402,7 @@ function _o({
|
|
|
6402
6402
|
}) {
|
|
6403
6403
|
var v;
|
|
6404
6404
|
const { register: s, watch: o, setValue: l } = n || {}, [d, u] = D({}), [t, m] = D(0), c = o ? o(e.id) : null, r = !!(c || a && a !== "edit");
|
|
6405
|
-
|
|
6405
|
+
G(() => {
|
|
6406
6406
|
if (!e.fetchExternalResults || !e.externalApiUrl) return;
|
|
6407
6407
|
const y = async () => {
|
|
6408
6408
|
try {
|
|
@@ -6410,11 +6410,11 @@ function _o({
|
|
|
6410
6410
|
if (!g.ok) return;
|
|
6411
6411
|
const p = await g.json();
|
|
6412
6412
|
let N = {};
|
|
6413
|
-
Array.isArray(p) ? p.forEach((
|
|
6414
|
-
const x =
|
|
6415
|
-
x && (N[x] = Number(
|
|
6413
|
+
Array.isArray(p) ? p.forEach((C) => {
|
|
6414
|
+
const x = C.value || C.id || C.option, k = C.count || C.votes || C.value || 0;
|
|
6415
|
+
x && (N[x] = Number(k));
|
|
6416
6416
|
}) : typeof p == "object" && (N = p), u(N);
|
|
6417
|
-
const S = Object.values(N).reduce((
|
|
6417
|
+
const S = Object.values(N).reduce((C, x) => C + Number(x), 0);
|
|
6418
6418
|
m(S);
|
|
6419
6419
|
} catch (g) {
|
|
6420
6420
|
console.error("Failed to fetch polling results", g);
|
|
@@ -6423,7 +6423,7 @@ function _o({
|
|
|
6423
6423
|
y();
|
|
6424
6424
|
const f = setInterval(y, 1e4);
|
|
6425
6425
|
return () => clearInterval(f);
|
|
6426
|
-
}, [e.fetchExternalResults, e.externalApiUrl]),
|
|
6426
|
+
}, [e.fetchExternalResults, e.externalApiUrl]), G(() => {
|
|
6427
6427
|
e.fetchExternalResults || (c ? (u({ [c]: 1 }), m(1)) : (u({}), m(0)));
|
|
6428
6428
|
}, [c, e.fetchExternalResults]);
|
|
6429
6429
|
const h = (y) => {
|
|
@@ -6436,7 +6436,7 @@ function _o({
|
|
|
6436
6436
|
"div",
|
|
6437
6437
|
{
|
|
6438
6438
|
onClick: () => h(y.value),
|
|
6439
|
-
className:
|
|
6439
|
+
className: J(
|
|
6440
6440
|
"relative flex items-center justify-between p-3 border rounded-lg overflow-hidden transition-all duration-200",
|
|
6441
6441
|
n != null && n.isReadOnly ? "cursor-default" : "cursor-pointer hover:border-blue-400 hover:bg-blue-50/50",
|
|
6442
6442
|
p ? "border-blue-500 ring-1 ring-blue-500" : "border-gray-200"
|
|
@@ -6453,7 +6453,7 @@ function _o({
|
|
|
6453
6453
|
/* @__PURE__ */ i(
|
|
6454
6454
|
"div",
|
|
6455
6455
|
{
|
|
6456
|
-
className:
|
|
6456
|
+
className: J(
|
|
6457
6457
|
"flex-shrink-0 w-5 h-5 rounded-full border flex items-center justify-center transition-colors",
|
|
6458
6458
|
p ? "border-blue-500 bg-blue-500" : "border-gray-300 bg-white"
|
|
6459
6459
|
),
|
|
@@ -6463,7 +6463,7 @@ function _o({
|
|
|
6463
6463
|
/* @__PURE__ */ i(
|
|
6464
6464
|
"span",
|
|
6465
6465
|
{
|
|
6466
|
-
className:
|
|
6466
|
+
className: J(
|
|
6467
6467
|
"font-medium text-sm",
|
|
6468
6468
|
p ? "text-blue-900" : "text-gray-700"
|
|
6469
6469
|
),
|
|
@@ -6476,7 +6476,7 @@ function _o({
|
|
|
6476
6476
|
g,
|
|
6477
6477
|
"%"
|
|
6478
6478
|
] }),
|
|
6479
|
-
p && /* @__PURE__ */ i(
|
|
6479
|
+
p && /* @__PURE__ */ i(z, { icon: "material-symbols:check-circle", iconClass: "text-blue-500 text-lg" })
|
|
6480
6480
|
] }),
|
|
6481
6481
|
/* @__PURE__ */ i(
|
|
6482
6482
|
"input",
|
|
@@ -6558,7 +6558,7 @@ const fn = {
|
|
|
6558
6558
|
}, Xe = ({ col: e, children: n, customClass: a }) => /* @__PURE__ */ i(
|
|
6559
6559
|
"div",
|
|
6560
6560
|
{
|
|
6561
|
-
className:
|
|
6561
|
+
className: J("w-full bg-white min-w-0", a),
|
|
6562
6562
|
style: { gridColumn: e },
|
|
6563
6563
|
children: n
|
|
6564
6564
|
}
|
|
@@ -6577,82 +6577,82 @@ const fn = {
|
|
|
6577
6577
|
moveElement: m,
|
|
6578
6578
|
isDragging: c,
|
|
6579
6579
|
removeElement: r
|
|
6580
|
-
} = ye(
|
|
6580
|
+
} = ye(be), h = ee(
|
|
6581
6581
|
() => Array.from({ length: e.columns }),
|
|
6582
6582
|
[e.columns]
|
|
6583
6583
|
), [v, y] = D(null);
|
|
6584
|
-
|
|
6585
|
-
const
|
|
6584
|
+
G(() => {
|
|
6585
|
+
const C = () => {
|
|
6586
6586
|
y(null), t(!1);
|
|
6587
6587
|
};
|
|
6588
|
-
return document.addEventListener("dragend",
|
|
6588
|
+
return document.addEventListener("dragend", C), () => document.removeEventListener("dragend", C);
|
|
6589
6589
|
}, [t]);
|
|
6590
6590
|
const f = Y(
|
|
6591
|
-
(
|
|
6592
|
-
|
|
6591
|
+
(C, x) => {
|
|
6592
|
+
C.preventDefault(), C.stopPropagation(), C.dataTransfer.dropEffect = "move", y(x);
|
|
6593
6593
|
},
|
|
6594
6594
|
[]
|
|
6595
6595
|
), g = Y(
|
|
6596
|
-
(
|
|
6597
|
-
|
|
6596
|
+
(C, x) => {
|
|
6597
|
+
C.preventDefault(), C.stopPropagation(), y(x);
|
|
6598
6598
|
},
|
|
6599
6599
|
[]
|
|
6600
6600
|
), p = Y(
|
|
6601
|
-
(
|
|
6602
|
-
const
|
|
6603
|
-
|
|
6601
|
+
(C, x) => {
|
|
6602
|
+
const k = C.relatedTarget;
|
|
6603
|
+
k && C.currentTarget.contains(k) || y((M) => M === x ? null : M);
|
|
6604
6604
|
},
|
|
6605
6605
|
[]
|
|
6606
6606
|
), N = Y(
|
|
6607
|
-
(
|
|
6607
|
+
(C, x) => {
|
|
6608
6608
|
var w;
|
|
6609
|
-
|
|
6610
|
-
const
|
|
6609
|
+
C.preventDefault(), C.stopPropagation(), t(!1), y(null);
|
|
6610
|
+
const k = x + 1, M = C.dataTransfer.getData("elementId");
|
|
6611
6611
|
if (M) {
|
|
6612
6612
|
m({
|
|
6613
6613
|
draggedId: M,
|
|
6614
6614
|
sectionId: n,
|
|
6615
6615
|
targetGridId: e.id,
|
|
6616
|
-
targetCol:
|
|
6616
|
+
targetCol: k
|
|
6617
6617
|
});
|
|
6618
6618
|
return;
|
|
6619
6619
|
}
|
|
6620
6620
|
try {
|
|
6621
|
-
const A =
|
|
6621
|
+
const A = C.dataTransfer.getData("properties");
|
|
6622
6622
|
if (!A) return;
|
|
6623
6623
|
const T = JSON.parse(A);
|
|
6624
6624
|
if ((T == null ? void 0 : T.type) === "grid") return;
|
|
6625
6625
|
const I = d.find((Z) => Z.id === n), L = (w = I == null ? void 0 : I.questionData) == null ? void 0 : w.find(
|
|
6626
6626
|
(Z) => {
|
|
6627
|
-
var
|
|
6628
|
-
return Z.gridId === e.id && ((
|
|
6627
|
+
var ie;
|
|
6628
|
+
return Z.gridId === e.id && ((ie = Z.gridPosition) == null ? void 0 : ie.col) === k;
|
|
6629
6629
|
}
|
|
6630
6630
|
);
|
|
6631
6631
|
L && r(L.id, n);
|
|
6632
|
-
const
|
|
6632
|
+
const F = {
|
|
6633
6633
|
...T,
|
|
6634
|
-
id:
|
|
6634
|
+
id: pe(),
|
|
6635
6635
|
sectionId: n,
|
|
6636
6636
|
gridId: e.id,
|
|
6637
|
-
gridPosition: { col:
|
|
6637
|
+
gridPosition: { col: k }
|
|
6638
6638
|
};
|
|
6639
|
-
u(
|
|
6639
|
+
u(F, n);
|
|
6640
6640
|
} catch (A) {
|
|
6641
6641
|
console.error("Drop failed in grid:", A), t(!1);
|
|
6642
6642
|
}
|
|
6643
6643
|
},
|
|
6644
6644
|
[u, e.id, d, n, t, m]
|
|
6645
|
-
), S = (
|
|
6646
|
-
var
|
|
6647
|
-
const M =
|
|
6645
|
+
), S = (C, x, k) => {
|
|
6646
|
+
var ie, X, he;
|
|
6647
|
+
const M = C + 1, w = (X = (ie = d.find((_) => _.id === n)) == null ? void 0 : ie.questionData) == null ? void 0 : X.find(
|
|
6648
6648
|
(_) => {
|
|
6649
6649
|
var V;
|
|
6650
6650
|
return _.gridId === e.id && ((V = _.gridPosition) == null ? void 0 : V.col) === M;
|
|
6651
6651
|
}
|
|
6652
|
-
), A = (
|
|
6652
|
+
), A = (he = w == null ? void 0 : w.id) != null ? he : null, T = Array.isArray(a) && a.find((_) => {
|
|
6653
6653
|
var V;
|
|
6654
6654
|
return ((V = _ == null ? void 0 : _.props) == null ? void 0 : V.col) === M;
|
|
6655
|
-
}), I = c && v ===
|
|
6655
|
+
}), I = c && v === C, L = !!T, F = c && !!l, Z = L && A && k === "edit" ? {
|
|
6656
6656
|
draggable: !0,
|
|
6657
6657
|
onDragStart: (_) => {
|
|
6658
6658
|
_.stopPropagation(), _.dataTransfer.setData("elementId", A), _.dataTransfer.setData("properties", A), _.dataTransfer.effectAllowed = "move", t(!0);
|
|
@@ -6664,45 +6664,45 @@ const fn = {
|
|
|
6664
6664
|
return /* @__PURE__ */ i("div", { className: "min-w-0", children: /* @__PURE__ */ b(
|
|
6665
6665
|
"div",
|
|
6666
6666
|
{
|
|
6667
|
-
id: `grid-cell-${e.id}-${
|
|
6667
|
+
id: `grid-cell-${e.id}-${C}`,
|
|
6668
6668
|
...Z,
|
|
6669
|
-
onDrop: (_) => N(_,
|
|
6670
|
-
onDragEnter: (_) => g(_,
|
|
6671
|
-
onDragOver: (_) => f(_,
|
|
6672
|
-
onDragLeave: (_) => p(_,
|
|
6673
|
-
className:
|
|
6669
|
+
onDrop: (_) => N(_, C),
|
|
6670
|
+
onDragEnter: (_) => g(_, C),
|
|
6671
|
+
onDragOver: (_) => f(_, C),
|
|
6672
|
+
onDragLeave: (_) => p(_, C),
|
|
6673
|
+
className: J(
|
|
6674
6674
|
"relative border rounded-lg min-h-[110px] min-w-0",
|
|
6675
6675
|
"flex items-center justify-center",
|
|
6676
6676
|
"transition-all duration-200 ease-in-out",
|
|
6677
|
-
|
|
6678
|
-
L &&
|
|
6677
|
+
k === "edit" ? "py-3 " : "",
|
|
6678
|
+
L && k === "edit" && "cursor-grab active:cursor-grabbing border-none",
|
|
6679
6679
|
x,
|
|
6680
|
-
!
|
|
6681
|
-
|
|
6682
|
-
|
|
6680
|
+
!F && !I && "bg-white border-gray-200 text-gray-300",
|
|
6681
|
+
F && !I && !L && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
|
|
6682
|
+
F && !I && L && "bg-white border-orange-200 border-dashed",
|
|
6683
6683
|
I && !L && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
|
|
6684
6684
|
I && L && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
|
|
6685
6685
|
),
|
|
6686
6686
|
children: [
|
|
6687
|
-
L &&
|
|
6687
|
+
L && k === "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(z, { icon: "ph:dots-six-bold" }) }),
|
|
6688
6688
|
I && !L && /* @__PURE__ */ b("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: [
|
|
6689
|
-
/* @__PURE__ */ i(
|
|
6689
|
+
/* @__PURE__ */ i(z, { icon: "ph:plus-bold" }),
|
|
6690
6690
|
"Drop here"
|
|
6691
6691
|
] }),
|
|
6692
6692
|
I && L && /* @__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" }),
|
|
6693
6693
|
/* @__PURE__ */ i(
|
|
6694
6694
|
"div",
|
|
6695
6695
|
{
|
|
6696
|
-
className:
|
|
6696
|
+
className: J(
|
|
6697
6697
|
"w-full select-none min-w-0",
|
|
6698
6698
|
I && "opacity-50 pointer-events-none"
|
|
6699
6699
|
),
|
|
6700
|
-
children: T || /* @__PURE__ */ i("span", { className: "flex items-center justify-center text-gray-300", children:
|
|
6700
|
+
children: T || /* @__PURE__ */ i("span", { className: "flex items-center justify-center text-gray-300", children: k === "edit" && /* @__PURE__ */ i(z, { icon: "ph:plus-bold" }) })
|
|
6701
6701
|
}
|
|
6702
6702
|
)
|
|
6703
6703
|
]
|
|
6704
6704
|
}
|
|
6705
|
-
) },
|
|
6705
|
+
) }, C);
|
|
6706
6706
|
};
|
|
6707
6707
|
return /* @__PURE__ */ i("div", { className: "relative w-full", children: /* @__PURE__ */ i(
|
|
6708
6708
|
"div",
|
|
@@ -6712,11 +6712,11 @@ const fn = {
|
|
|
6712
6712
|
gridTemplateColumns: `repeat(${e.columns}, minmax(0, 1fr))`
|
|
6713
6713
|
},
|
|
6714
6714
|
children: h == null ? void 0 : h.map(
|
|
6715
|
-
(
|
|
6715
|
+
(C, x) => S(x, s, o)
|
|
6716
6716
|
)
|
|
6717
6717
|
}
|
|
6718
6718
|
) });
|
|
6719
|
-
}, ei =
|
|
6719
|
+
}, ei = se.memo(Zo), $o = "edit";
|
|
6720
6720
|
function ti({
|
|
6721
6721
|
index: e,
|
|
6722
6722
|
onDrop: n,
|
|
@@ -6741,13 +6741,13 @@ function ti({
|
|
|
6741
6741
|
l(!1), a();
|
|
6742
6742
|
},
|
|
6743
6743
|
style: { height: `${o ? 52 : s ? 28 : 4}px` },
|
|
6744
|
-
className:
|
|
6744
|
+
className: J(
|
|
6745
6745
|
"w-full rounded-md flex items-center justify-center",
|
|
6746
6746
|
"transition-all duration-150 ease-in-out overflow-hidden",
|
|
6747
6747
|
o ? "bg-blue-50 border-2 border-blue-300 border-dashed" : s ? "border-2 border-blue-200 border-dashed" : "border-2 border-transparent"
|
|
6748
6748
|
),
|
|
6749
6749
|
children: o && /* @__PURE__ */ b("span", { className: "flex items-center gap-1 text-blue-500 text-xs font-medium select-none pointer-events-none", children: [
|
|
6750
|
-
/* @__PURE__ */ i(
|
|
6750
|
+
/* @__PURE__ */ i(z, { icon: "octicon:plus-16" }),
|
|
6751
6751
|
"Drop here"
|
|
6752
6752
|
] })
|
|
6753
6753
|
}
|
|
@@ -6760,7 +6760,7 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6760
6760
|
setIsDragging: o,
|
|
6761
6761
|
addElementInPosition: l,
|
|
6762
6762
|
moveElement: d
|
|
6763
|
-
} = ye(
|
|
6763
|
+
} = ye(be), [u, t] = D(null), m = ee(
|
|
6764
6764
|
() => {
|
|
6765
6765
|
var p;
|
|
6766
6766
|
return ((p = a.find((N) => N.id === n)) == null ? void 0 : p.questionData) || [];
|
|
@@ -6774,7 +6774,7 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6774
6774
|
), r = Y(() => {
|
|
6775
6775
|
t(null), o(!1);
|
|
6776
6776
|
}, [o]);
|
|
6777
|
-
|
|
6777
|
+
G(() => {
|
|
6778
6778
|
!s && u && t(null);
|
|
6779
6779
|
}, [s, u]);
|
|
6780
6780
|
const h = Y(
|
|
@@ -6785,10 +6785,10 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6785
6785
|
r();
|
|
6786
6786
|
return;
|
|
6787
6787
|
}
|
|
6788
|
-
const
|
|
6789
|
-
(
|
|
6788
|
+
const C = m.find((k) => k.id === N), x = m.findIndex(
|
|
6789
|
+
(k) => k.id === S
|
|
6790
6790
|
);
|
|
6791
|
-
|
|
6791
|
+
C != null && C.gridId && x !== -1 ? d({ draggedId: N, sectionId: n, targetIndex: x }) : d({ draggedId: N, sectionId: n, targetId: S }), t(null), o(!1);
|
|
6792
6792
|
},
|
|
6793
6793
|
[n, d, o, r, m]
|
|
6794
6794
|
), v = Y(
|
|
@@ -6800,12 +6800,12 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6800
6800
|
return;
|
|
6801
6801
|
}
|
|
6802
6802
|
try {
|
|
6803
|
-
const
|
|
6804
|
-
if ((
|
|
6805
|
-
const x = { ...
|
|
6803
|
+
const C = JSON.parse(p.dataTransfer.getData("properties"));
|
|
6804
|
+
if ((C == null ? void 0 : C.type) === "section") return;
|
|
6805
|
+
const x = { ...C, id: pe(), sectionId: n };
|
|
6806
6806
|
l(x, n, N), t(null);
|
|
6807
|
-
} catch (
|
|
6808
|
-
console.error("Drop error:",
|
|
6807
|
+
} catch (C) {
|
|
6808
|
+
console.error("Drop error:", C);
|
|
6809
6809
|
}
|
|
6810
6810
|
},
|
|
6811
6811
|
[l, n, o, d]
|
|
@@ -6821,7 +6821,7 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6821
6821
|
},
|
|
6822
6822
|
onDrop: N ? void 0 : h,
|
|
6823
6823
|
onDragEnd: r,
|
|
6824
|
-
className:
|
|
6824
|
+
className: J(
|
|
6825
6825
|
"cursor-grab active:cursor-grabbing border p-4 w-full rounded-lg",
|
|
6826
6826
|
"transition-all duration-200 ease-in-out",
|
|
6827
6827
|
u === p.id ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-300 shadow-inner" : u ? "bg-white border-dashed border-blue-200 shadow-sm" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
|
|
@@ -6831,7 +6831,7 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6831
6831
|
p.id
|
|
6832
6832
|
),
|
|
6833
6833
|
[u, h, n, c, r]
|
|
6834
|
-
), f =
|
|
6834
|
+
), f = ee(() => (e == null ? void 0 : e.reduce((p, N) => (N.gridId && (p[N.gridId] = p[N.gridId] || [], p[N.gridId].push(N)), p), {})) || {}, [e]);
|
|
6835
6835
|
if (!(e != null && e.length))
|
|
6836
6836
|
return /* @__PURE__ */ i(
|
|
6837
6837
|
"div",
|
|
@@ -6857,23 +6857,23 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6857
6857
|
g.map((p) => {
|
|
6858
6858
|
const N = m.findIndex((S) => S.id === p.id);
|
|
6859
6859
|
if (p.type === "grid") {
|
|
6860
|
-
const S = f[p.id] || [],
|
|
6860
|
+
const S = f[p.id] || [], C = u === p.id, x = !!u && !C;
|
|
6861
6861
|
return /* @__PURE__ */ b("div", { className: "flex flex-col gap-0", children: [
|
|
6862
6862
|
/* @__PURE__ */ i(
|
|
6863
6863
|
"div",
|
|
6864
6864
|
{
|
|
6865
6865
|
id: p.id,
|
|
6866
6866
|
draggable: !0,
|
|
6867
|
-
onDragStart: (
|
|
6868
|
-
onDragOver: (
|
|
6869
|
-
|
|
6867
|
+
onDragStart: (k) => c(k, p.id),
|
|
6868
|
+
onDragOver: (k) => {
|
|
6869
|
+
k.preventDefault(), k.stopPropagation();
|
|
6870
6870
|
},
|
|
6871
6871
|
onDrop: h,
|
|
6872
6872
|
onDragEnd: r,
|
|
6873
|
-
className:
|
|
6873
|
+
className: J(
|
|
6874
6874
|
"w-full p-4 border rounded-lg cursor-grab active:cursor-grabbing",
|
|
6875
6875
|
"transition-all duration-200 ease-in-out",
|
|
6876
|
-
|
|
6876
|
+
C ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : x ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
|
|
6877
6877
|
),
|
|
6878
6878
|
children: /* @__PURE__ */ i(Ti, { element: p, state: "edit", children: /* @__PURE__ */ i(
|
|
6879
6879
|
ei,
|
|
@@ -6883,9 +6883,9 @@ function Qo({ elementData: e, sectionId: n }) {
|
|
|
6883
6883
|
state: $o,
|
|
6884
6884
|
draggedElementId: u,
|
|
6885
6885
|
children: S == null ? void 0 : S.map(
|
|
6886
|
-
(
|
|
6886
|
+
(k) => {
|
|
6887
6887
|
var M;
|
|
6888
|
-
return /* @__PURE__ */ i(Xe, { col: (M =
|
|
6888
|
+
return /* @__PURE__ */ i(Xe, { col: (M = k.gridPosition) == null ? void 0 : M.col, children: y(k, !0) }, k.id);
|
|
6889
6889
|
}
|
|
6890
6890
|
)
|
|
6891
6891
|
}
|
|
@@ -6923,8 +6923,8 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6923
6923
|
description: R.string(),
|
|
6924
6924
|
disabled: R.boolean().default(!1),
|
|
6925
6925
|
isHidden: R.boolean().default(!1)
|
|
6926
|
-
}).required(), ci =
|
|
6927
|
-
const { updateSection: s } =
|
|
6926
|
+
}).required(), ci = de("config"), is = ({ isOpen: e, onClose: n, section: a }) => {
|
|
6927
|
+
const { updateSection: s } = se.useContext(be), {
|
|
6928
6928
|
register: o,
|
|
6929
6929
|
handleSubmit: l,
|
|
6930
6930
|
watch: d,
|
|
@@ -6934,7 +6934,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6934
6934
|
resolver: wi(es),
|
|
6935
6935
|
defaultValues: a
|
|
6936
6936
|
});
|
|
6937
|
-
if (
|
|
6937
|
+
if (se.useEffect(() => {
|
|
6938
6938
|
e || c();
|
|
6939
6939
|
}, [e, c]), !e) return null;
|
|
6940
6940
|
const r = (v) => {
|
|
@@ -6948,14 +6948,14 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6948
6948
|
{
|
|
6949
6949
|
onClick: n,
|
|
6950
6950
|
className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
|
|
6951
|
-
children: /* @__PURE__ */ i(
|
|
6951
|
+
children: /* @__PURE__ */ i(z, { icon: "tabler:x" })
|
|
6952
6952
|
}
|
|
6953
6953
|
)
|
|
6954
6954
|
] }),
|
|
6955
6955
|
/* @__PURE__ */ b("form", { onSubmit: l(r), className: "w-full", children: [
|
|
6956
6956
|
/* @__PURE__ */ b("div", { className: "w-full px-6 flex flex-col gap-5 z-10", children: [
|
|
6957
6957
|
/* @__PURE__ */ i(
|
|
6958
|
-
|
|
6958
|
+
W,
|
|
6959
6959
|
{
|
|
6960
6960
|
label: "Title",
|
|
6961
6961
|
name: "title",
|
|
@@ -6965,7 +6965,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6965
6965
|
}
|
|
6966
6966
|
),
|
|
6967
6967
|
/* @__PURE__ */ i(
|
|
6968
|
-
|
|
6968
|
+
W,
|
|
6969
6969
|
{
|
|
6970
6970
|
label: "Description",
|
|
6971
6971
|
name: "description",
|
|
@@ -6976,7 +6976,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6976
6976
|
}
|
|
6977
6977
|
),
|
|
6978
6978
|
/* @__PURE__ */ i(
|
|
6979
|
-
|
|
6979
|
+
W,
|
|
6980
6980
|
{
|
|
6981
6981
|
label: "Disable Section",
|
|
6982
6982
|
name: "disabled",
|
|
@@ -6989,7 +6989,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
6989
6989
|
}
|
|
6990
6990
|
),
|
|
6991
6991
|
/* @__PURE__ */ i(
|
|
6992
|
-
|
|
6992
|
+
W,
|
|
6993
6993
|
{
|
|
6994
6994
|
label: "Hide Section",
|
|
6995
6995
|
name: "isHidden",
|
|
@@ -7033,7 +7033,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7033
7033
|
{
|
|
7034
7034
|
onClick: n,
|
|
7035
7035
|
className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
|
|
7036
|
-
children: /* @__PURE__ */ i(
|
|
7036
|
+
children: /* @__PURE__ */ i(z, { icon: "tabler:x" })
|
|
7037
7037
|
}
|
|
7038
7038
|
)
|
|
7039
7039
|
] }),
|
|
@@ -7235,8 +7235,8 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7235
7235
|
onReorderSection: r
|
|
7236
7236
|
}) => {
|
|
7237
7237
|
var y, f;
|
|
7238
|
-
const h =
|
|
7239
|
-
return
|
|
7238
|
+
const h = re(null), v = re((y = e == null ? void 0 : e.questionData) == null ? void 0 : y.length);
|
|
7239
|
+
return G(() => {
|
|
7240
7240
|
var g, p;
|
|
7241
7241
|
((g = e == null ? void 0 : e.questionData) == null ? void 0 : g.length) > v.current && h.current && requestAnimationFrame(() => {
|
|
7242
7242
|
var N;
|
|
@@ -7276,7 +7276,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7276
7276
|
className: "flex-1 h-full py-4 cursor-grab active:cursor-grabbing flex items-center gap-2",
|
|
7277
7277
|
title: "Drag to reorder section",
|
|
7278
7278
|
children: [
|
|
7279
|
-
/* @__PURE__ */ i(
|
|
7279
|
+
/* @__PURE__ */ i(z, { icon: "material-symbols:drag-indicator", iconClass: "text-gray-400 text-lg" }),
|
|
7280
7280
|
/* @__PURE__ */ i("h2", { className: "font-medium", children: e.title || "Section title" })
|
|
7281
7281
|
]
|
|
7282
7282
|
}
|
|
@@ -7288,7 +7288,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7288
7288
|
type: "button",
|
|
7289
7289
|
className: "p-1 text-xs border rounded-lg",
|
|
7290
7290
|
onClick: () => d(e),
|
|
7291
|
-
children: /* @__PURE__ */ i(
|
|
7291
|
+
children: /* @__PURE__ */ i(z, { icon: "fluent:edit-28-regular" })
|
|
7292
7292
|
}
|
|
7293
7293
|
),
|
|
7294
7294
|
t > 1 && /* @__PURE__ */ i(
|
|
@@ -7297,7 +7297,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7297
7297
|
type: "button",
|
|
7298
7298
|
className: "p-1 text-xs border rounded-lg",
|
|
7299
7299
|
onClick: () => u(e.id),
|
|
7300
|
-
children: /* @__PURE__ */ i(
|
|
7300
|
+
children: /* @__PURE__ */ i(z, { icon: "lets-icons:trash-duotone-line" })
|
|
7301
7301
|
}
|
|
7302
7302
|
),
|
|
7303
7303
|
/* @__PURE__ */ i(
|
|
@@ -7307,7 +7307,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7307
7307
|
className: "p-1 text-xs rounded-lg",
|
|
7308
7308
|
onClick: () => l(n),
|
|
7309
7309
|
children: /* @__PURE__ */ i(
|
|
7310
|
-
|
|
7310
|
+
z,
|
|
7311
7311
|
{
|
|
7312
7312
|
icon: o.includes(n) ? "fa6-solid:chevron-up" : "fa6-solid:chevron-down",
|
|
7313
7313
|
iconClass: "text-base"
|
|
@@ -7345,7 +7345,7 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7345
7345
|
e == null ? void 0 : e.id
|
|
7346
7346
|
);
|
|
7347
7347
|
}, ss = ({ onAddTemplate: e, templates: n }) => {
|
|
7348
|
-
const a = [...as, ...n || []], [s, o] = D(!1), [l, d] = D(!1), u =
|
|
7348
|
+
const a = [...as, ...n || []], [s, o] = D(!1), [l, d] = D(!1), u = re(null), t = re(null), {
|
|
7349
7349
|
removeSection: m,
|
|
7350
7350
|
// addElement,
|
|
7351
7351
|
addSection: c,
|
|
@@ -7356,11 +7356,11 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7356
7356
|
activeSections: f,
|
|
7357
7357
|
setActiveSections: g,
|
|
7358
7358
|
setFormData: p
|
|
7359
|
-
} = ye(
|
|
7360
|
-
|
|
7359
|
+
} = ye(be), N = re((r == null ? void 0 : r.length) || 0);
|
|
7360
|
+
G(() => {
|
|
7361
7361
|
var A;
|
|
7362
7362
|
v(((A = r[0]) == null ? void 0 : A.id) || null);
|
|
7363
|
-
}, []),
|
|
7363
|
+
}, []), G(() => {
|
|
7364
7364
|
(r == null ? void 0 : r.length) > N.current && t.current && requestAnimationFrame(() => {
|
|
7365
7365
|
var A;
|
|
7366
7366
|
(A = t.current) == null || A.scrollTo({
|
|
@@ -7371,12 +7371,12 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7371
7371
|
}, [r == null ? void 0 : r.length]);
|
|
7372
7372
|
const S = Y((A) => {
|
|
7373
7373
|
A.preventDefault(), A.dataTransfer.dropEffect = "move", t.current && (t.current.scrollTop = t.current.scrollHeight);
|
|
7374
|
-
}, []),
|
|
7374
|
+
}, []), C = Y((A, T) => {
|
|
7375
7375
|
p((I) => {
|
|
7376
|
-
const L = I.findIndex((
|
|
7377
|
-
if (L === -1 ||
|
|
7378
|
-
const Z = [...I], [
|
|
7379
|
-
return Z.splice(
|
|
7376
|
+
const L = I.findIndex((X) => X.id === A), F = I.findIndex((X) => X.id === T);
|
|
7377
|
+
if (L === -1 || F === -1 || L === F) return I;
|
|
7378
|
+
const Z = [...I], [ie] = Z.splice(L, 1);
|
|
7379
|
+
return Z.splice(F, 0, ie), Z;
|
|
7380
7380
|
});
|
|
7381
7381
|
}, [p]);
|
|
7382
7382
|
function x(A) {
|
|
@@ -7384,32 +7384,32 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7384
7384
|
(T) => T.filter((I) => I !== A)
|
|
7385
7385
|
) : g((T) => [...T, A]);
|
|
7386
7386
|
}
|
|
7387
|
-
function
|
|
7387
|
+
function k(A) {
|
|
7388
7388
|
u.current = A, o(!0);
|
|
7389
7389
|
}
|
|
7390
7390
|
const M = (A) => {
|
|
7391
|
-
var I, L,
|
|
7392
|
-
const T = (
|
|
7393
|
-
...JSON.parse(JSON.stringify(
|
|
7394
|
-
|
|
7391
|
+
var I, L, F, Z;
|
|
7392
|
+
const T = (ie, X = {}) => ({
|
|
7393
|
+
...JSON.parse(JSON.stringify(ie)),
|
|
7394
|
+
...X
|
|
7395
7395
|
});
|
|
7396
7396
|
if (A.sections && Array.isArray(A.sections)) {
|
|
7397
|
-
const
|
|
7397
|
+
const X = A.sections.filter(Boolean).map((_) => {
|
|
7398
7398
|
var Ae;
|
|
7399
|
-
const V =
|
|
7400
|
-
if (
|
|
7401
|
-
const
|
|
7402
|
-
_.questionData.forEach((
|
|
7403
|
-
|
|
7404
|
-
}),
|
|
7405
|
-
|
|
7399
|
+
const V = pe(), ce = (Ae = _.questionData) == null ? void 0 : Ae.map((ge) => T(ge, { id: pe(), sectionId: V }));
|
|
7400
|
+
if (ce) {
|
|
7401
|
+
const ge = /* @__PURE__ */ new Map();
|
|
7402
|
+
_.questionData.forEach((ue, Se) => {
|
|
7403
|
+
ge.set(ue.id, ce[Se].id);
|
|
7404
|
+
}), ce.forEach((ue) => {
|
|
7405
|
+
ue.gridId && ge.has(ue.gridId) && (ue.gridId = ge.get(ue.gridId));
|
|
7406
7406
|
});
|
|
7407
7407
|
}
|
|
7408
|
-
return T(_, { id: V, questionData:
|
|
7408
|
+
return T(_, { id: V, questionData: ce || [] });
|
|
7409
7409
|
});
|
|
7410
|
-
r.length === 1 && r[0].title === "" && r[0].description === "" && (!((I = r[0]) != null && I.questionData) || ((
|
|
7410
|
+
r.length === 1 && r[0].title === "" && r[0].description === "" && (!((I = r[0]) != null && I.questionData) || ((F = (L = r[0]) == null ? void 0 : L.questionData) == null ? void 0 : F.length) === 0) ? (p(X), X.length > 0 && v((Z = X[0]) == null ? void 0 : Z.id)) : p((_) => [..._, ...X]);
|
|
7411
7411
|
}
|
|
7412
|
-
}, w =
|
|
7412
|
+
}, w = de("config");
|
|
7413
7413
|
return /* @__PURE__ */ b(
|
|
7414
7414
|
"div",
|
|
7415
7415
|
{
|
|
@@ -7440,12 +7440,12 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7440
7440
|
setSelectedSection: v,
|
|
7441
7441
|
activeSections: f,
|
|
7442
7442
|
toggleSection: x,
|
|
7443
|
-
handleSectionEdit:
|
|
7443
|
+
handleSectionEdit: k,
|
|
7444
7444
|
removeSection: m,
|
|
7445
7445
|
formDataLength: r.length,
|
|
7446
7446
|
onDragOver: S,
|
|
7447
7447
|
setIsDragging: h,
|
|
7448
|
-
onReorderSection:
|
|
7448
|
+
onReorderSection: C
|
|
7449
7449
|
},
|
|
7450
7450
|
A.id
|
|
7451
7451
|
)
|
|
@@ -7494,8 +7494,8 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7494
7494
|
);
|
|
7495
7495
|
}, ls = () => {
|
|
7496
7496
|
const { formData: e, uploadUrl: n } = ye(
|
|
7497
|
-
|
|
7498
|
-
), [a, s] = D("multi"), o =
|
|
7497
|
+
be
|
|
7498
|
+
), [a, s] = D("multi"), o = de("config");
|
|
7499
7499
|
return /* @__PURE__ */ b("div", { className: "flex flex-col h-full w-full", children: [
|
|
7500
7500
|
/* @__PURE__ */ i("div", { className: "flex justify-center p-3 border-b border-gray-100 bg-gray-50/50", children: /* @__PURE__ */ b("div", { className: "flex bg-gray-200 p-1 rounded-lg text-sm font-medium", children: [
|
|
7501
7501
|
/* @__PURE__ */ i(
|
|
@@ -7530,15 +7530,15 @@ const Xo = Ze(Qo), es = R.object({
|
|
|
7530
7530
|
) })
|
|
7531
7531
|
] });
|
|
7532
7532
|
}, Bi = ({ loadingClass: e }) => {
|
|
7533
|
-
const n =
|
|
7533
|
+
const n = J(
|
|
7534
7534
|
"h-full w-full min-h-[300px] flex justify-center items-center",
|
|
7535
7535
|
e
|
|
7536
7536
|
);
|
|
7537
|
-
return
|
|
7538
|
-
const a =
|
|
7537
|
+
return G(() => {
|
|
7538
|
+
const a = de("config"), s = (a == null ? void 0 : a.loaderColor) || "#333";
|
|
7539
7539
|
document.documentElement.style.setProperty("--loader-color", s);
|
|
7540
7540
|
}, []), /* @__PURE__ */ i("div", { className: n, children: /* @__PURE__ */ i("span", { className: "loader" }) });
|
|
7541
|
-
}, ds =
|
|
7541
|
+
}, ds = se.lazy(() => import("./logic-flow-KtIPQ2fZ.js"));
|
|
7542
7542
|
function us({
|
|
7543
7543
|
questionData: e,
|
|
7544
7544
|
uploadUrl: n,
|
|
@@ -7546,10 +7546,10 @@ function us({
|
|
|
7546
7546
|
templates: s,
|
|
7547
7547
|
viewMode: o = "canvas"
|
|
7548
7548
|
}) {
|
|
7549
|
-
const { setFormData: l, addSection: d, setUploadUrl: u, showPreview: t, formData: m } = ye(
|
|
7550
|
-
|
|
7549
|
+
const { setFormData: l, addSection: d, setUploadUrl: u, showPreview: t, formData: m } = ye(be);
|
|
7550
|
+
G(() => {
|
|
7551
7551
|
e && e.length > 0 && l(e);
|
|
7552
|
-
}, [e, l]),
|
|
7552
|
+
}, [e, l]), G(() => {
|
|
7553
7553
|
u(n);
|
|
7554
7554
|
}, [n, u]);
|
|
7555
7555
|
const c = Y((r) => {
|
|
@@ -7599,7 +7599,7 @@ const ri = [
|
|
|
7599
7599
|
{ key: "layoutAndDisplay", title: "Layout & Display" },
|
|
7600
7600
|
{ key: "advancedData", title: "Advanced / Data" }
|
|
7601
7601
|
], ts = () => {
|
|
7602
|
-
const [e, n] = D(""), { setIsDragging: a, addElement: s, selectedSection: o } = ye(
|
|
7602
|
+
const [e, n] = D(""), { setIsDragging: a, addElement: s, selectedSection: o } = ye(be), l = Y(
|
|
7603
7603
|
(v, y) => {
|
|
7604
7604
|
if (!o) {
|
|
7605
7605
|
xe.error("Please select a section to add an element.");
|
|
@@ -7616,12 +7616,12 @@ const ri = [
|
|
|
7616
7616
|
}
|
|
7617
7617
|
const y = {
|
|
7618
7618
|
...v,
|
|
7619
|
-
id:
|
|
7619
|
+
id: pe(),
|
|
7620
7620
|
sectionId: o
|
|
7621
7621
|
};
|
|
7622
7622
|
s(y, o);
|
|
7623
7623
|
}
|
|
7624
|
-
const u =
|
|
7624
|
+
const u = de("config") || {}, t = u.elementColor, m = u.elementBgColor, c = u.elementBorderColor, r = eo.filter(
|
|
7625
7625
|
(v) => v.label.toLowerCase().includes(e.toLowerCase())
|
|
7626
7626
|
), h = ri == null ? void 0 : ri.map((v) => ({
|
|
7627
7627
|
title: v.title,
|
|
@@ -7664,7 +7664,7 @@ const ri = [
|
|
|
7664
7664
|
active:opacity-50 element_class`,
|
|
7665
7665
|
draggable: !0,
|
|
7666
7666
|
children: /* @__PURE__ */ b("span", { className: "flex flex-col items-center justify-center w-full gap-2", children: [
|
|
7667
|
-
/* @__PURE__ */ i("span", { style: { color: t }, children: /* @__PURE__ */ i(
|
|
7667
|
+
/* @__PURE__ */ i("span", { style: { color: t }, children: /* @__PURE__ */ i(z, { icon: g.icon, iconClass: "w-6 h-6" }) }),
|
|
7668
7668
|
/* @__PURE__ */ i(
|
|
7669
7669
|
"span",
|
|
7670
7670
|
{
|
|
@@ -7680,7 +7680,7 @@ const ri = [
|
|
|
7680
7680
|
] }, y);
|
|
7681
7681
|
}) }) })
|
|
7682
7682
|
] });
|
|
7683
|
-
}, cs = Ze(ts),
|
|
7683
|
+
}, cs = Ze(ts), ke = ({
|
|
7684
7684
|
text: e = "",
|
|
7685
7685
|
isDisabled: n = !1,
|
|
7686
7686
|
isLoading: a = !1,
|
|
@@ -7695,14 +7695,14 @@ const ri = [
|
|
|
7695
7695
|
style: r,
|
|
7696
7696
|
onClick: h
|
|
7697
7697
|
}) => {
|
|
7698
|
-
const v =
|
|
7698
|
+
const v = J(
|
|
7699
7699
|
"btn inline-flex justify-center",
|
|
7700
7700
|
{
|
|
7701
7701
|
"pointer-events-none": a,
|
|
7702
7702
|
"opacity-40 cursor-not-allowed": n
|
|
7703
7703
|
},
|
|
7704
7704
|
s
|
|
7705
|
-
), y = () => a ? /* @__PURE__ */ b(
|
|
7705
|
+
), y = () => a ? /* @__PURE__ */ b(ve, { children: [
|
|
7706
7706
|
/* @__PURE__ */ b(
|
|
7707
7707
|
"svg",
|
|
7708
7708
|
{
|
|
@@ -7735,9 +7735,9 @@ const ri = [
|
|
|
7735
7735
|
),
|
|
7736
7736
|
"Submitting..."
|
|
7737
7737
|
] }) : /* @__PURE__ */ b("span", { className: "flex items-center", children: [
|
|
7738
|
-
o && l === "left" && /* @__PURE__ */ i("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ i(
|
|
7738
|
+
o && l === "left" && /* @__PURE__ */ i("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ i(z, { icon: o }) }),
|
|
7739
7739
|
e && /* @__PURE__ */ i("span", { children: e }),
|
|
7740
|
-
o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(
|
|
7740
|
+
o && l === "right" && /* @__PURE__ */ i("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ i(z, { icon: o }) })
|
|
7741
7741
|
] });
|
|
7742
7742
|
return m ? /* @__PURE__ */ i("div", { className: v, children: y() }) : t ? /* @__PURE__ */ i(Dn, { to: t, className: v, children: y() }) : /* @__PURE__ */ i(
|
|
7743
7743
|
"button",
|
|
@@ -7793,10 +7793,10 @@ const ms = ({
|
|
|
7793
7793
|
onClose: n
|
|
7794
7794
|
}) => {
|
|
7795
7795
|
const { formData: a, uploadUrl: s } = ye(
|
|
7796
|
-
|
|
7796
|
+
be
|
|
7797
7797
|
);
|
|
7798
7798
|
if (!e) return null;
|
|
7799
|
-
const o =
|
|
7799
|
+
const o = de("config");
|
|
7800
7800
|
return /* @__PURE__ */ b("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: [
|
|
7801
7801
|
/* @__PURE__ */ i(
|
|
7802
7802
|
"button",
|
|
@@ -7866,7 +7866,7 @@ function vs({
|
|
|
7866
7866
|
redo: f,
|
|
7867
7867
|
canUndo: g,
|
|
7868
7868
|
canRedo: p
|
|
7869
|
-
} = ye(
|
|
7869
|
+
} = ye(be), [N, S] = D(!1), [C, x] = D(!1), [k, M] = D(e || ""), w = de("config");
|
|
7870
7870
|
function A() {
|
|
7871
7871
|
localStorage.setItem("formData", JSON.stringify(r)), a == null || a(r);
|
|
7872
7872
|
}
|
|
@@ -7874,7 +7874,7 @@ function vs({
|
|
|
7874
7874
|
localStorage.setItem("formData", JSON.stringify(r)), s == null || s(r);
|
|
7875
7875
|
}
|
|
7876
7876
|
function I() {
|
|
7877
|
-
x(!1), u &&
|
|
7877
|
+
x(!1), u && k !== e && u(k.trim());
|
|
7878
7878
|
}
|
|
7879
7879
|
return /* @__PURE__ */ b("div", { className: "px-[30px] py-3 flex justify-between items-center bg-[#F9F9FB] top_bar border-b h-full", children: [
|
|
7880
7880
|
/* @__PURE__ */ b("span", { className: "flex items-center gap-x-2", children: [
|
|
@@ -7889,11 +7889,11 @@ function vs({
|
|
|
7889
7889
|
}
|
|
7890
7890
|
),
|
|
7891
7891
|
" ",
|
|
7892
|
-
|
|
7892
|
+
C ? /* @__PURE__ */ i(
|
|
7893
7893
|
"input",
|
|
7894
7894
|
{
|
|
7895
7895
|
type: "text",
|
|
7896
|
-
value:
|
|
7896
|
+
value: k,
|
|
7897
7897
|
onChange: (L) => M(L.target.value),
|
|
7898
7898
|
onBlur: I,
|
|
7899
7899
|
autoFocus: !0,
|
|
@@ -7905,7 +7905,7 @@ function vs({
|
|
|
7905
7905
|
title: "Click to edit",
|
|
7906
7906
|
className: "text-base font-semibold cursor-pointer form_title",
|
|
7907
7907
|
onClick: () => x(!0),
|
|
7908
|
-
children:
|
|
7908
|
+
children: k || "Untitled"
|
|
7909
7909
|
}
|
|
7910
7910
|
)
|
|
7911
7911
|
] }),
|
|
@@ -7928,7 +7928,7 @@ function vs({
|
|
|
7928
7928
|
onClick: () => m("canvas"),
|
|
7929
7929
|
children: [
|
|
7930
7930
|
/* @__PURE__ */ i(
|
|
7931
|
-
|
|
7931
|
+
z,
|
|
7932
7932
|
{
|
|
7933
7933
|
icon: "mdi:view-dashboard-outline",
|
|
7934
7934
|
iconClass: "text-base"
|
|
@@ -7947,14 +7947,14 @@ function vs({
|
|
|
7947
7947
|
className: `px-3 flex items-center gap-1.5 border-l border-gray-300 transition-colors flow_view ${t === "flow" ? " bg-white font-medium" : "bg-gray-100 text-gray-500 hover:bg-gray-50"}`,
|
|
7948
7948
|
onClick: () => m("flow"),
|
|
7949
7949
|
children: [
|
|
7950
|
-
/* @__PURE__ */ i(
|
|
7950
|
+
/* @__PURE__ */ i(z, { icon: "mdi:sitemap-outline", iconClass: "text-base" }),
|
|
7951
7951
|
" Flow"
|
|
7952
7952
|
]
|
|
7953
7953
|
}
|
|
7954
7954
|
)
|
|
7955
7955
|
] }),
|
|
7956
7956
|
/* @__PURE__ */ i(
|
|
7957
|
-
|
|
7957
|
+
ke,
|
|
7958
7958
|
{
|
|
7959
7959
|
onClick: y,
|
|
7960
7960
|
text: "",
|
|
@@ -7966,7 +7966,7 @@ function vs({
|
|
|
7966
7966
|
}
|
|
7967
7967
|
),
|
|
7968
7968
|
/* @__PURE__ */ i(
|
|
7969
|
-
|
|
7969
|
+
ke,
|
|
7970
7970
|
{
|
|
7971
7971
|
onClick: f,
|
|
7972
7972
|
text: "",
|
|
@@ -7978,7 +7978,7 @@ function vs({
|
|
|
7978
7978
|
}
|
|
7979
7979
|
),
|
|
7980
7980
|
c && /* @__PURE__ */ i(
|
|
7981
|
-
|
|
7981
|
+
ke,
|
|
7982
7982
|
{
|
|
7983
7983
|
onClick: c,
|
|
7984
7984
|
text: "Versions",
|
|
@@ -7989,7 +7989,7 @@ function vs({
|
|
|
7989
7989
|
}
|
|
7990
7990
|
),
|
|
7991
7991
|
/* @__PURE__ */ i(
|
|
7992
|
-
|
|
7992
|
+
ke,
|
|
7993
7993
|
{
|
|
7994
7994
|
onClick: () => h((L) => !L),
|
|
7995
7995
|
text: v ? "Hide Preview" : "Preview",
|
|
@@ -8002,7 +8002,7 @@ function vs({
|
|
|
8002
8002
|
}
|
|
8003
8003
|
),
|
|
8004
8004
|
/* @__PURE__ */ i(
|
|
8005
|
-
|
|
8005
|
+
ke,
|
|
8006
8006
|
{
|
|
8007
8007
|
onClick: A,
|
|
8008
8008
|
text: "Save",
|
|
@@ -8015,7 +8015,7 @@ function vs({
|
|
|
8015
8015
|
}
|
|
8016
8016
|
),
|
|
8017
8017
|
/* @__PURE__ */ i(
|
|
8018
|
-
|
|
8018
|
+
ke,
|
|
8019
8019
|
{
|
|
8020
8020
|
onClick: T,
|
|
8021
8021
|
text: "Publish",
|
|
@@ -8103,7 +8103,7 @@ const Hs = ({
|
|
|
8103
8103
|
onAddTemplate: f,
|
|
8104
8104
|
templates: g,
|
|
8105
8105
|
onShowVersion: p
|
|
8106
|
-
}) => (
|
|
8106
|
+
}) => (G(() => {
|
|
8107
8107
|
l && hn("config", l);
|
|
8108
8108
|
}, [l]), /* @__PURE__ */ i(
|
|
8109
8109
|
ps,
|
|
@@ -8222,13 +8222,13 @@ function xs({ formData: e, isReadOnly: n, answerData: a }) {
|
|
|
8222
8222
|
}), R.object().shape(s);
|
|
8223
8223
|
}
|
|
8224
8224
|
const Oe = ({ element: e, validationData: n }) => {
|
|
8225
|
-
const a = fn[e.type], { answerData: s } = ye(
|
|
8225
|
+
const a = fn[e.type], { answerData: s } = ye(be), o = ee(
|
|
8226
8226
|
() => {
|
|
8227
8227
|
var d;
|
|
8228
8228
|
return (d = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : d.map((u) => u.label).join(", ");
|
|
8229
8229
|
},
|
|
8230
8230
|
[e]
|
|
8231
|
-
), l =
|
|
8231
|
+
), l = ee(() => Ei(e, s), [s, e]);
|
|
8232
8232
|
return a ? /* @__PURE__ */ b("div", { className: `${l ? "" : "invisible h-0"} min-w-0 w-full`, children: [
|
|
8233
8233
|
/* @__PURE__ */ b("div", { className: "mb-1.5 min-w-0", children: [
|
|
8234
8234
|
e.inputLabel && /* @__PURE__ */ b("label", { className: "block text-sm font-medium input_label", children: [
|
|
@@ -8284,7 +8284,7 @@ function As({ form_data: e, options: n }) {
|
|
|
8284
8284
|
return /* @__PURE__ */ b(
|
|
8285
8285
|
"div",
|
|
8286
8286
|
{
|
|
8287
|
-
className:
|
|
8287
|
+
className: J(
|
|
8288
8288
|
"group relative grid gap-y-[6px] min-w-0",
|
|
8289
8289
|
o.elementClass
|
|
8290
8290
|
),
|
|
@@ -8359,7 +8359,7 @@ function Ss({ form_data: e, options: n, current: a }) {
|
|
|
8359
8359
|
return l.gridId ? null : /* @__PURE__ */ b(
|
|
8360
8360
|
"div",
|
|
8361
8361
|
{
|
|
8362
|
-
className:
|
|
8362
|
+
className: J(
|
|
8363
8363
|
"group relative grid gap-y-[6px] min-w-0",
|
|
8364
8364
|
l.elementClass
|
|
8365
8365
|
),
|
|
@@ -8378,7 +8378,7 @@ function Ss({ form_data: e, options: n, current: a }) {
|
|
|
8378
8378
|
);
|
|
8379
8379
|
}) });
|
|
8380
8380
|
}
|
|
8381
|
-
const mi =
|
|
8381
|
+
const mi = de("config");
|
|
8382
8382
|
function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast: l, isReadOnly: d }) {
|
|
8383
8383
|
if (!e)
|
|
8384
8384
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-center min-h-[500px] text-gray-500", children: "No questions available." });
|
|
@@ -8419,7 +8419,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
8419
8419
|
return /* @__PURE__ */ b(
|
|
8420
8420
|
"div",
|
|
8421
8421
|
{
|
|
8422
|
-
className:
|
|
8422
|
+
className: J("group relative grid gap-y-[6px] min-w-0 w-full", c.elementClass),
|
|
8423
8423
|
children: [
|
|
8424
8424
|
/* @__PURE__ */ i(
|
|
8425
8425
|
Oe,
|
|
@@ -8457,7 +8457,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
8457
8457
|
/* @__PURE__ */ i("div", { className: "text-left w-full mb-8", children: e.type === "grid" ? t(e) : m(e) }),
|
|
8458
8458
|
!d && /* @__PURE__ */ b("div", { className: "flex items-center gap-4 mt-8", children: [
|
|
8459
8459
|
/* @__PURE__ */ i(
|
|
8460
|
-
|
|
8460
|
+
ke,
|
|
8461
8461
|
{
|
|
8462
8462
|
type: "button",
|
|
8463
8463
|
text: l ? n != null && n.isSubmitting ? "Submitting..." : "Submit" : "OK",
|
|
@@ -8469,7 +8469,7 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
8469
8469
|
),
|
|
8470
8470
|
!l && /* @__PURE__ */ i("span", { className: "text-xs text-gray-400 font-medium hidden sm:inline-block", children: "press Enter ↵" }),
|
|
8471
8471
|
!o && /* @__PURE__ */ b("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: [
|
|
8472
|
-
/* @__PURE__ */ i(
|
|
8472
|
+
/* @__PURE__ */ i(z, { icon: "material-symbols:arrow-upward-rounded", iconClass: "text-lg" }),
|
|
8473
8473
|
"Back"
|
|
8474
8474
|
] })
|
|
8475
8475
|
] })
|
|
@@ -8480,10 +8480,10 @@ function Ns({ element: e, options: n, onNext: a, onPrev: s, isFirst: o, isLast:
|
|
|
8480
8480
|
}
|
|
8481
8481
|
);
|
|
8482
8482
|
}
|
|
8483
|
-
function
|
|
8483
|
+
function ks(e) {
|
|
8484
8484
|
return e.reduce((n, a) => (n[a.id] = a.value, n), {});
|
|
8485
8485
|
}
|
|
8486
|
-
const
|
|
8486
|
+
const Cs = ({
|
|
8487
8487
|
form_data: e,
|
|
8488
8488
|
answerData: n = [],
|
|
8489
8489
|
ignoreValidation: a = !1,
|
|
@@ -8495,180 +8495,180 @@ const ks = ({
|
|
|
8495
8495
|
hideFooter: t = !1,
|
|
8496
8496
|
uploadUrl: m
|
|
8497
8497
|
}) => {
|
|
8498
|
-
var Be, Me, Ee,
|
|
8499
|
-
const { setAnswerData: c, setUploadUrl: r, apiActivityCount: h } = ye(
|
|
8500
|
-
() => e.filter((
|
|
8498
|
+
var Be, Me, Ee, O, B, K, P, E, q, $;
|
|
8499
|
+
const { setAnswerData: c, setUploadUrl: r, apiActivityCount: h } = ye(be), [v, y] = D(0), [f, g] = D(0), p = ee(
|
|
8500
|
+
() => e.filter((j) => !j.isHidden).map((j) => {
|
|
8501
8501
|
var U;
|
|
8502
|
-
return
|
|
8503
|
-
...
|
|
8504
|
-
questionData: (U =
|
|
8505
|
-
...
|
|
8502
|
+
return j.isDisabled || j.disabled ? {
|
|
8503
|
+
...j,
|
|
8504
|
+
questionData: (U = j == null ? void 0 : j.questionData) == null ? void 0 : U.map((Q) => ({
|
|
8505
|
+
...Q,
|
|
8506
8506
|
isDisabled: !0
|
|
8507
8507
|
}))
|
|
8508
|
-
} :
|
|
8508
|
+
} : j;
|
|
8509
8509
|
}),
|
|
8510
8510
|
[e]
|
|
8511
|
-
), N = (Be = p == null ? void 0 : p.length) != null ? Be : 0, S =
|
|
8512
|
-
async (
|
|
8513
|
-
const
|
|
8511
|
+
), N = (Be = p == null ? void 0 : p.length) != null ? Be : 0, S = de("config"), C = Y(
|
|
8512
|
+
async (j, H, U) => {
|
|
8513
|
+
const Q = xs({
|
|
8514
8514
|
formData: p,
|
|
8515
8515
|
isReadOnly: l,
|
|
8516
|
-
answerData:
|
|
8516
|
+
answerData: j
|
|
8517
8517
|
// use current form data to evaluate visibility
|
|
8518
8518
|
});
|
|
8519
|
-
return wi(
|
|
8519
|
+
return wi(Q)(j, H, U);
|
|
8520
8520
|
},
|
|
8521
8521
|
[p, l]
|
|
8522
8522
|
), x = Ai({
|
|
8523
|
-
resolver:
|
|
8523
|
+
resolver: C,
|
|
8524
8524
|
mode: "onSubmit",
|
|
8525
8525
|
defaultValues: {}
|
|
8526
8526
|
}), {
|
|
8527
|
-
register:
|
|
8527
|
+
register: k,
|
|
8528
8528
|
setValue: M,
|
|
8529
8529
|
control: w,
|
|
8530
8530
|
handleSubmit: A,
|
|
8531
8531
|
reset: T,
|
|
8532
8532
|
getValues: I,
|
|
8533
8533
|
watch: L,
|
|
8534
|
-
formState: { errors:
|
|
8535
|
-
trigger:
|
|
8536
|
-
setError:
|
|
8537
|
-
clearErrors:
|
|
8538
|
-
} = x, _ = Bn({ control: w }), V =
|
|
8534
|
+
formState: { errors: F, isSubmitting: Z },
|
|
8535
|
+
trigger: ie,
|
|
8536
|
+
setError: X,
|
|
8537
|
+
clearErrors: he
|
|
8538
|
+
} = x, _ = Bn({ control: w }), V = ee(
|
|
8539
8539
|
() => _,
|
|
8540
8540
|
[JSON.stringify(_)]
|
|
8541
|
-
),
|
|
8541
|
+
), ce = ee(() => {
|
|
8542
8542
|
if (d !== "conversational") return [];
|
|
8543
|
-
const
|
|
8543
|
+
const j = [];
|
|
8544
8544
|
return p.forEach((H) => {
|
|
8545
8545
|
var U;
|
|
8546
|
-
(U = H == null ? void 0 : H.questionData) == null || U.forEach((
|
|
8547
|
-
var
|
|
8548
|
-
if (Ei(
|
|
8549
|
-
if (
|
|
8550
|
-
const
|
|
8551
|
-
(
|
|
8546
|
+
(U = H == null ? void 0 : H.questionData) == null || U.forEach((Q) => {
|
|
8547
|
+
var oe;
|
|
8548
|
+
if (Ei(Q, V))
|
|
8549
|
+
if (Q.type === "grid") {
|
|
8550
|
+
const le = (oe = H == null ? void 0 : H.questionData) == null ? void 0 : oe.filter(
|
|
8551
|
+
(me) => me.gridId === Q.id
|
|
8552
8552
|
);
|
|
8553
|
-
|
|
8554
|
-
} else
|
|
8553
|
+
j.push({ ...Q, gridChildren: le });
|
|
8554
|
+
} else Q.gridId || j.push(Q);
|
|
8555
8555
|
});
|
|
8556
|
-
}),
|
|
8556
|
+
}), j;
|
|
8557
8557
|
}, [p, V, d]), Ae = Y(
|
|
8558
|
-
(
|
|
8559
|
-
o && o(
|
|
8558
|
+
(j) => {
|
|
8559
|
+
o && o(j);
|
|
8560
8560
|
},
|
|
8561
8561
|
[o]
|
|
8562
8562
|
);
|
|
8563
|
-
|
|
8563
|
+
G(() => {
|
|
8564
8564
|
r(m);
|
|
8565
|
-
}, [r, m]),
|
|
8565
|
+
}, [r, m]), G(() => {
|
|
8566
8566
|
if (!(p != null && p.length) || !o) return;
|
|
8567
|
-
const
|
|
8567
|
+
const j = p.flatMap(
|
|
8568
8568
|
(H) => {
|
|
8569
8569
|
var U;
|
|
8570
|
-
return (U = H == null ? void 0 : H.questionData) == null ? void 0 : U.map((
|
|
8571
|
-
id:
|
|
8572
|
-
value: V[
|
|
8570
|
+
return (U = H == null ? void 0 : H.questionData) == null ? void 0 : U.map((Q) => ({
|
|
8571
|
+
id: Q.id,
|
|
8572
|
+
value: V[Q.id] || "",
|
|
8573
8573
|
sectionId: H.id,
|
|
8574
|
-
type:
|
|
8574
|
+
type: Q.type,
|
|
8575
8575
|
metaData: {
|
|
8576
|
-
prefix:
|
|
8577
|
-
dateFormat:
|
|
8576
|
+
prefix: Q.prefix,
|
|
8577
|
+
dateFormat: Q.dateFormat
|
|
8578
8578
|
}
|
|
8579
8579
|
}));
|
|
8580
8580
|
}
|
|
8581
8581
|
);
|
|
8582
|
-
Ae(
|
|
8582
|
+
Ae(j), c(V);
|
|
8583
8583
|
}, [
|
|
8584
8584
|
V,
|
|
8585
8585
|
p,
|
|
8586
8586
|
Ae,
|
|
8587
8587
|
o,
|
|
8588
8588
|
c
|
|
8589
|
-
]),
|
|
8590
|
-
n != null && n.length && T(
|
|
8589
|
+
]), G(() => {
|
|
8590
|
+
n != null && n.length && T(ks(n));
|
|
8591
8591
|
}, [n, T]);
|
|
8592
|
-
const
|
|
8593
|
-
(
|
|
8592
|
+
const ge = Y(
|
|
8593
|
+
(j) => {
|
|
8594
8594
|
const H = p.flatMap(
|
|
8595
8595
|
(U) => {
|
|
8596
|
-
var
|
|
8597
|
-
return (
|
|
8598
|
-
id:
|
|
8599
|
-
value:
|
|
8596
|
+
var Q;
|
|
8597
|
+
return (Q = U == null ? void 0 : U.questionData) == null ? void 0 : Q.map((oe) => ({
|
|
8598
|
+
id: oe.id,
|
|
8599
|
+
value: j[oe.id] || "",
|
|
8600
8600
|
sectionId: U.id,
|
|
8601
|
-
type:
|
|
8601
|
+
type: oe.type,
|
|
8602
8602
|
metaData: {
|
|
8603
|
-
prefix:
|
|
8604
|
-
dateFormat:
|
|
8603
|
+
prefix: oe.prefix,
|
|
8604
|
+
dateFormat: oe.dateFormat
|
|
8605
8605
|
}
|
|
8606
8606
|
}));
|
|
8607
8607
|
}
|
|
8608
8608
|
);
|
|
8609
|
-
Object.keys(
|
|
8609
|
+
Object.keys(F).length > 0 || s == null || s(H);
|
|
8610
8610
|
},
|
|
8611
|
-
[
|
|
8612
|
-
),
|
|
8613
|
-
var
|
|
8611
|
+
[F, p, s]
|
|
8612
|
+
), ue = Y(async () => {
|
|
8613
|
+
var j, H;
|
|
8614
8614
|
if (d === "conversational") {
|
|
8615
8615
|
if (!a) {
|
|
8616
|
-
const U =
|
|
8616
|
+
const U = ce[f];
|
|
8617
8617
|
if (!U) return;
|
|
8618
|
-
const
|
|
8619
|
-
if (!await
|
|
8618
|
+
const Q = U.gridChildren ? U.gridChildren.map((le) => le.id) : [U.id];
|
|
8619
|
+
if (!await ie(Q)) return;
|
|
8620
8620
|
}
|
|
8621
|
-
f <
|
|
8621
|
+
f < ce.length - 1 ? g((U) => U + 1) : A(ge)();
|
|
8622
8622
|
return;
|
|
8623
8623
|
}
|
|
8624
8624
|
if (!a) {
|
|
8625
|
-
const U = (H = (
|
|
8626
|
-
(
|
|
8625
|
+
const U = (H = (j = p == null ? void 0 : p[v]) == null ? void 0 : j.questionData) == null ? void 0 : H.map(
|
|
8626
|
+
(oe) => oe.id
|
|
8627
8627
|
);
|
|
8628
|
-
if (!await
|
|
8628
|
+
if (!await ie(U)) return;
|
|
8629
8629
|
}
|
|
8630
8630
|
y((U) => U + 1);
|
|
8631
8631
|
}, [
|
|
8632
8632
|
v,
|
|
8633
8633
|
f,
|
|
8634
|
-
|
|
8634
|
+
ce,
|
|
8635
8635
|
p,
|
|
8636
8636
|
a,
|
|
8637
|
-
|
|
8637
|
+
ie,
|
|
8638
8638
|
d,
|
|
8639
8639
|
A,
|
|
8640
|
-
|
|
8640
|
+
ge
|
|
8641
8641
|
]), Se = Y(() => {
|
|
8642
8642
|
if (d === "conversational") {
|
|
8643
|
-
g((
|
|
8643
|
+
g((j) => Math.max(0, j - 1));
|
|
8644
8644
|
return;
|
|
8645
8645
|
}
|
|
8646
|
-
y((
|
|
8647
|
-
}, [d]),
|
|
8646
|
+
y((j) => j - 1);
|
|
8647
|
+
}, [d]), Ce = ee(
|
|
8648
8648
|
() => ({
|
|
8649
|
-
register:
|
|
8649
|
+
register: k,
|
|
8650
8650
|
setValue: M,
|
|
8651
8651
|
watch: L,
|
|
8652
|
-
errors:
|
|
8653
|
-
trigger:
|
|
8652
|
+
errors: F,
|
|
8653
|
+
trigger: ie,
|
|
8654
8654
|
isSubmitting: Z,
|
|
8655
8655
|
isReadOnly: l,
|
|
8656
8656
|
getValues: I,
|
|
8657
|
-
setError:
|
|
8658
|
-
clearErrors:
|
|
8657
|
+
setError: X,
|
|
8658
|
+
clearErrors: he,
|
|
8659
8659
|
apiActivityCount: h
|
|
8660
8660
|
}),
|
|
8661
8661
|
[
|
|
8662
|
-
|
|
8662
|
+
k,
|
|
8663
8663
|
M,
|
|
8664
8664
|
L,
|
|
8665
|
-
|
|
8666
|
-
|
|
8665
|
+
F,
|
|
8666
|
+
ie,
|
|
8667
8667
|
Z,
|
|
8668
8668
|
l,
|
|
8669
8669
|
I,
|
|
8670
|
-
|
|
8671
|
-
|
|
8670
|
+
X,
|
|
8671
|
+
he,
|
|
8672
8672
|
h
|
|
8673
8673
|
]
|
|
8674
8674
|
);
|
|
@@ -8677,7 +8677,7 @@ const ks = ({
|
|
|
8677
8677
|
/* @__PURE__ */ b(
|
|
8678
8678
|
"form",
|
|
8679
8679
|
{
|
|
8680
|
-
onSubmit: A(
|
|
8680
|
+
onSubmit: A(ge),
|
|
8681
8681
|
className: "container h-full mx-auto",
|
|
8682
8682
|
children: [
|
|
8683
8683
|
/* @__PURE__ */ i("div", { className: "relative flex flex-col w-full min-w-0 py-4 gap-y-12", children: /* @__PURE__ */ b(
|
|
@@ -8686,39 +8686,39 @@ const ks = ({
|
|
|
8686
8686
|
className: "multi_section__box min-w-0",
|
|
8687
8687
|
children: [
|
|
8688
8688
|
d === "multi" && (((Me = p == null ? void 0 : p[v]) == null ? void 0 : Me.title) || ((Ee = p == null ? void 0 : p[v]) == null ? void 0 : Ee.description)) && /* @__PURE__ */ b("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
|
|
8689
|
-
((
|
|
8689
|
+
((O = p[v]) == null ? void 0 : O.title) && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold mb-[6px]", children: (B = p[v]) == null ? void 0 : B.title }),
|
|
8690
8690
|
((K = p[v]) == null ? void 0 : K.description) && /* @__PURE__ */ i("p", { className: "text-sm", children: (P = p[v]) == null ? void 0 : P.description })
|
|
8691
8691
|
] }),
|
|
8692
8692
|
d === "multi" ? /* @__PURE__ */ i(
|
|
8693
8693
|
Ss,
|
|
8694
8694
|
{
|
|
8695
8695
|
form_data: p,
|
|
8696
|
-
options:
|
|
8696
|
+
options: Ce,
|
|
8697
8697
|
current: v
|
|
8698
8698
|
}
|
|
8699
8699
|
) : d === "conversational" ? /* @__PURE__ */ i(
|
|
8700
8700
|
Ns,
|
|
8701
8701
|
{
|
|
8702
|
-
element:
|
|
8703
|
-
options:
|
|
8704
|
-
onNext:
|
|
8702
|
+
element: ce[f],
|
|
8703
|
+
options: Ce,
|
|
8704
|
+
onNext: ue,
|
|
8705
8705
|
onPrev: Se,
|
|
8706
8706
|
isFirst: f === 0,
|
|
8707
|
-
isLast: f ===
|
|
8707
|
+
isLast: f === ce.length - 1,
|
|
8708
8708
|
isReadOnly: l
|
|
8709
8709
|
}
|
|
8710
8710
|
) : /* @__PURE__ */ i(
|
|
8711
8711
|
As,
|
|
8712
8712
|
{
|
|
8713
8713
|
form_data: p,
|
|
8714
|
-
options:
|
|
8714
|
+
options: Ce
|
|
8715
8715
|
}
|
|
8716
8716
|
)
|
|
8717
8717
|
]
|
|
8718
8718
|
},
|
|
8719
8719
|
d === "conversational" ? `conv-${f}` : (E = p == null ? void 0 : p[v]) == null ? void 0 : E.id
|
|
8720
8720
|
) }),
|
|
8721
|
-
!t && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ b(
|
|
8721
|
+
!t && d !== "conversational" && /* @__PURE__ */ i("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ b(ve, { children: [
|
|
8722
8722
|
/* @__PURE__ */ b("div", { className: "flex gap-x-4 justify-between navigation_container w-full", children: [
|
|
8723
8723
|
/* @__PURE__ */ b("div", { children: [
|
|
8724
8724
|
" ",
|
|
@@ -8730,7 +8730,7 @@ const ks = ({
|
|
|
8730
8730
|
className: "text-gray-400 hover:text-gray-600 font-medium text-sm flex items-center gap-1 transition-colors back_btn",
|
|
8731
8731
|
children: [
|
|
8732
8732
|
/* @__PURE__ */ i(
|
|
8733
|
-
|
|
8733
|
+
z,
|
|
8734
8734
|
{
|
|
8735
8735
|
icon: "material-symbols:arrow-upward-rounded",
|
|
8736
8736
|
iconClass: "text-lg"
|
|
@@ -8742,20 +8742,20 @@ const ks = ({
|
|
|
8742
8742
|
)
|
|
8743
8743
|
] }),
|
|
8744
8744
|
v < N - 1 && /* @__PURE__ */ i(
|
|
8745
|
-
|
|
8745
|
+
ke,
|
|
8746
8746
|
{
|
|
8747
8747
|
type: "button",
|
|
8748
8748
|
text: "Next",
|
|
8749
|
-
onClick:
|
|
8749
|
+
onClick: ue,
|
|
8750
8750
|
style: { background: (S == null ? void 0 : S.buttonColor) || "#333" },
|
|
8751
8751
|
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"
|
|
8752
8752
|
}
|
|
8753
8753
|
)
|
|
8754
8754
|
] }),
|
|
8755
|
-
(v === N - 1 || l) && !a && (u != null ?
|
|
8756
|
-
|
|
8755
|
+
(v === N - 1 || l) && !a && ((q = typeof u == "function" ? u({ isUploading: h > 0, isSubmitting: Z, hasErrors: Object.keys(F).length > 0 }) : u) != null ? q : /* @__PURE__ */ i(
|
|
8756
|
+
ke,
|
|
8757
8757
|
{
|
|
8758
|
-
isDisabled: Z || Object.keys(
|
|
8758
|
+
isDisabled: Z || Object.keys(F).length > 0 || h > 0,
|
|
8759
8759
|
isLoading: Z,
|
|
8760
8760
|
type: "submit",
|
|
8761
8761
|
text: "Submit",
|
|
@@ -8763,10 +8763,10 @@ const ks = ({
|
|
|
8763
8763
|
btnClass: "text-gray-700 border-[#98A2B3] submit_btn !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
8764
8764
|
}
|
|
8765
8765
|
))
|
|
8766
|
-
] }) : !a && (u != null ?
|
|
8767
|
-
|
|
8766
|
+
] }) : !a && (($ = typeof u == "function" ? u({ isUploading: h > 0, isSubmitting: Z, hasErrors: Object.keys(F).length > 0 }) : u) != null ? $ : /* @__PURE__ */ i(
|
|
8767
|
+
ke,
|
|
8768
8768
|
{
|
|
8769
|
-
isDisabled: Z || Object.keys(
|
|
8769
|
+
isDisabled: Z || Object.keys(F).length > 0 || h > 0,
|
|
8770
8770
|
isLoading: Z,
|
|
8771
8771
|
type: "submit",
|
|
8772
8772
|
text: "Submit",
|
|
@@ -8774,12 +8774,12 @@ const ks = ({
|
|
|
8774
8774
|
btnClass: "text-gray-700 border-[#98A2B3] submit_btn !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
8775
8775
|
}
|
|
8776
8776
|
)) }),
|
|
8777
|
-
d === "conversational" &&
|
|
8777
|
+
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(
|
|
8778
8778
|
"div",
|
|
8779
8779
|
{
|
|
8780
8780
|
className: "h-full bg-blue-600 transition-all duration-500 ease-out",
|
|
8781
8781
|
style: {
|
|
8782
|
-
width: `${(f + 1) /
|
|
8782
|
+
width: `${(f + 1) / ce.length * 100}%`,
|
|
8783
8783
|
background: (S == null ? void 0 : S.buttonColor) || "#2563EB"
|
|
8784
8784
|
}
|
|
8785
8785
|
}
|
|
@@ -8788,7 +8788,7 @@ const ks = ({
|
|
|
8788
8788
|
}
|
|
8789
8789
|
)
|
|
8790
8790
|
] });
|
|
8791
|
-
}, Ms =
|
|
8791
|
+
}, Ms = se.memo(Cs);
|
|
8792
8792
|
function yn({
|
|
8793
8793
|
answerData: e,
|
|
8794
8794
|
form_data: n,
|
|
@@ -8803,7 +8803,7 @@ function yn({
|
|
|
8803
8803
|
onGetValues: c,
|
|
8804
8804
|
uploadUrl: r
|
|
8805
8805
|
}) {
|
|
8806
|
-
|
|
8806
|
+
G(() => {
|
|
8807
8807
|
d && hn("config", d);
|
|
8808
8808
|
}, [d]);
|
|
8809
8809
|
const h = Y(
|
|
@@ -8832,7 +8832,7 @@ function yn({
|
|
|
8832
8832
|
] }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("p", { className: "p-6 text-sm text-gray-400", children: "Error: No form data available." }) });
|
|
8833
8833
|
}
|
|
8834
8834
|
export {
|
|
8835
|
-
|
|
8835
|
+
z as A,
|
|
8836
8836
|
Hs as H,
|
|
8837
8837
|
yn as V
|
|
8838
8838
|
};
|