@arudovwen/form-builder-react 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import mi, { createContext as ho, useState as D, useMemo as ai, useEffect as K, forwardRef as Se, createElement as Sn, Fragment as Zi, useContext as ji, useRef as Ci, useCallback as Q, memo as an } from "react";
2
- import { v4 as Ai } from "uuid";
1
+ import bi, { createContext as ho, useState as R, useMemo as si, useEffect as O, forwardRef as Se, createElement as Sn, Fragment as Zi, useContext as ji, useRef as Mi, useCallback as X, memo as an } from "react";
2
+ import { v4 as Si } from "uuid";
3
3
  import po from "react-datepicker";
4
4
  import { Listbox as ui, Transition as Ei, Combobox as Ri, ComboboxInput as go, ComboboxButton as fo, ComboboxOptions as xo, ComboboxOption as yo } from "@headlessui/react";
5
5
  import { toast as ki, Toaster as Ne } from "sonner";
@@ -26,7 +26,7 @@ var ee;
26
26
  function wo() {
27
27
  if (ee) return Gi;
28
28
  ee = 1;
29
- var i = mi, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
29
+ var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
30
30
  function d(t, u, c) {
31
31
  var r, v = {}, m = null, h = null;
32
32
  c !== void 0 && (m = "" + c), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (h = u.ref);
@@ -49,7 +49,7 @@ var Hi = {};
49
49
  var oe;
50
50
  function Bo() {
51
51
  return oe || (oe = 1, process.env.NODE_ENV !== "production" && function() {
52
- var i = mi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), t = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), r = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
52
+ var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), t = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), r = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
53
53
  function g(b) {
54
54
  if (b === null || typeof b != "object")
55
55
  return null;
@@ -59,41 +59,41 @@ function Bo() {
59
59
  var p = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
60
60
  function x(b) {
61
61
  {
62
- for (var k = arguments.length, T = new Array(k > 1 ? k - 1 : 0), V = 1; V < k; V++)
63
- T[V - 1] = arguments[V];
62
+ for (var k = arguments.length, T = new Array(k > 1 ? k - 1 : 0), H = 1; H < k; H++)
63
+ T[H - 1] = arguments[H];
64
64
  C("error", b, T);
65
65
  }
66
66
  }
67
67
  function C(b, k, T) {
68
68
  {
69
- var V = p.ReactDebugCurrentFrame, ei = V.getStackAddendum();
70
- ei !== "" && (k += "%s", T = T.concat([ei]));
71
- var li = T.map(function(ii) {
72
- return String(ii);
69
+ var H = p.ReactDebugCurrentFrame, ai = H.getStackAddendum();
70
+ ai !== "" && (k += "%s", T = T.concat([ai]));
71
+ var li = T.map(function(ni) {
72
+ return String(ni);
73
73
  });
74
74
  li.unshift("Warning: " + k), Function.prototype.apply.call(console[b], console, li);
75
75
  }
76
76
  }
77
- var S = !1, j = !1, A = !1, N = !1, E = !1, ni;
78
- ni = Symbol.for("react.module.reference");
79
- function J(b) {
77
+ var S = !1, j = !1, A = !1, N = !1, E = !1, ei;
78
+ ei = Symbol.for("react.module.reference");
79
+ function Y(b) {
80
80
  return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || E || b === a || b === c || b === r || N || b === h || S || j || A || typeof b == "object" && b !== null && (b.$$typeof === m || b.$$typeof === v || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
81
81
  // types supported by any Flight configuration anywhere since
82
82
  // we don't know which Flight build this will end up being used
83
83
  // with.
84
- b.$$typeof === ni || b.getModuleId !== void 0));
84
+ b.$$typeof === ei || b.getModuleId !== void 0));
85
85
  }
86
- function $(b, k, T) {
87
- var V = b.displayName;
88
- if (V)
89
- return V;
90
- var ei = k.displayName || k.name || "";
91
- return ei !== "" ? T + "(" + ei + ")" : T;
86
+ function Q(b, k, T) {
87
+ var H = b.displayName;
88
+ if (H)
89
+ return H;
90
+ var ai = k.displayName || k.name || "";
91
+ return ai !== "" ? T + "(" + ai + ")" : T;
92
92
  }
93
93
  function L(b) {
94
94
  return b.displayName || "Context";
95
95
  }
96
- function W(b) {
96
+ function U(b) {
97
97
  if (b == null)
98
98
  return null;
99
99
  if (typeof b.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof b == "function")
@@ -123,29 +123,29 @@ function Bo() {
123
123
  var T = b;
124
124
  return L(T._context) + ".Provider";
125
125
  case u:
126
- return $(b, b.render, "ForwardRef");
126
+ return Q(b, b.render, "ForwardRef");
127
127
  case v:
128
- var V = b.displayName || null;
129
- return V !== null ? V : W(b.type) || "Memo";
128
+ var H = b.displayName || null;
129
+ return H !== null ? H : U(b.type) || "Memo";
130
130
  case m: {
131
- var ei = b, li = ei._payload, ii = ei._init;
131
+ var ai = b, li = ai._payload, ni = ai._init;
132
132
  try {
133
- return W(ii(li));
134
- } catch (q) {
133
+ return U(ni(li));
134
+ } catch ($) {
135
135
  return null;
136
136
  }
137
137
  }
138
138
  }
139
139
  return null;
140
140
  }
141
- var O = Object.assign, G = 0, H, R, M, B, _, ti, X;
141
+ var I = Object.assign, K = 0, G, P, M, B, J, ri, ii;
142
142
  function di() {
143
143
  }
144
144
  di.__reactDisabledLog = !0;
145
145
  function pi() {
146
146
  {
147
- if (G === 0) {
148
- H = console.log, R = console.info, M = console.warn, B = console.error, _ = console.group, ti = console.groupCollapsed, X = console.groupEnd;
147
+ if (K === 0) {
148
+ G = console.log, P = console.info, M = console.warn, B = console.error, J = console.group, ri = console.groupCollapsed, ii = console.groupEnd;
149
149
  var b = {
150
150
  configurable: !0,
151
151
  enumerable: !0,
@@ -162,138 +162,138 @@ function Bo() {
162
162
  groupEnd: b
163
163
  });
164
164
  }
165
- G++;
165
+ K++;
166
166
  }
167
167
  }
168
- function bi() {
168
+ function vi() {
169
169
  {
170
- if (G--, G === 0) {
170
+ if (K--, K === 0) {
171
171
  var b = {
172
172
  configurable: !0,
173
173
  enumerable: !0,
174
174
  writable: !0
175
175
  };
176
176
  Object.defineProperties(console, {
177
- log: O({}, b, {
178
- value: H
177
+ log: I({}, b, {
178
+ value: G
179
179
  }),
180
- info: O({}, b, {
181
- value: R
180
+ info: I({}, b, {
181
+ value: P
182
182
  }),
183
- warn: O({}, b, {
183
+ warn: I({}, b, {
184
184
  value: M
185
185
  }),
186
- error: O({}, b, {
186
+ error: I({}, b, {
187
187
  value: B
188
188
  }),
189
- group: O({}, b, {
190
- value: _
189
+ group: I({}, b, {
190
+ value: J
191
191
  }),
192
- groupCollapsed: O({}, b, {
193
- value: ti
192
+ groupCollapsed: I({}, b, {
193
+ value: ri
194
194
  }),
195
- groupEnd: O({}, b, {
196
- value: X
195
+ groupEnd: I({}, b, {
196
+ value: ii
197
197
  })
198
198
  });
199
199
  }
200
- G < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
200
+ K < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
201
201
  }
202
202
  }
203
- var P = p.ReactCurrentDispatcher, I;
204
- function U(b, k, T) {
203
+ var D = p.ReactCurrentDispatcher, _;
204
+ function V(b, k, T) {
205
205
  {
206
- if (I === void 0)
206
+ if (_ === void 0)
207
207
  try {
208
208
  throw Error();
209
- } catch (ei) {
210
- var V = ei.stack.trim().match(/\n( *(at )?)/);
211
- I = V && V[1] || "";
209
+ } catch (ai) {
210
+ var H = ai.stack.trim().match(/\n( *(at )?)/);
211
+ _ = H && H[1] || "";
212
212
  }
213
213
  return `
214
- ` + I + b;
214
+ ` + _ + b;
215
215
  }
216
216
  }
217
- var oi = !1, F;
217
+ var F = !1, W;
218
218
  {
219
- var si = typeof WeakMap == "function" ? WeakMap : Map;
220
- F = new si();
219
+ var oi = typeof WeakMap == "function" ? WeakMap : Map;
220
+ W = new oi();
221
221
  }
222
- function hi(b, k) {
223
- if (!b || oi)
222
+ function ti(b, k) {
223
+ if (!b || F)
224
224
  return "";
225
225
  {
226
- var T = F.get(b);
226
+ var T = W.get(b);
227
227
  if (T !== void 0)
228
228
  return T;
229
229
  }
230
- var V;
231
- oi = !0;
232
- var ei = Error.prepareStackTrace;
230
+ var H;
231
+ F = !0;
232
+ var ai = Error.prepareStackTrace;
233
233
  Error.prepareStackTrace = void 0;
234
234
  var li;
235
- li = P.current, P.current = null, pi();
235
+ li = D.current, D.current = null, pi();
236
236
  try {
237
237
  if (k) {
238
- var ii = function() {
238
+ var ni = function() {
239
239
  throw Error();
240
240
  };
241
- if (Object.defineProperty(ii.prototype, "props", {
241
+ if (Object.defineProperty(ni.prototype, "props", {
242
242
  set: function() {
243
243
  throw Error();
244
244
  }
245
245
  }), typeof Reflect == "object" && Reflect.construct) {
246
246
  try {
247
- Reflect.construct(ii, []);
247
+ Reflect.construct(ni, []);
248
248
  } catch (yi) {
249
- V = yi;
249
+ H = yi;
250
250
  }
251
- Reflect.construct(b, [], ii);
251
+ Reflect.construct(b, [], ni);
252
252
  } else {
253
253
  try {
254
- ii.call();
254
+ ni.call();
255
255
  } catch (yi) {
256
- V = yi;
256
+ H = yi;
257
257
  }
258
- b.call(ii.prototype);
258
+ b.call(ni.prototype);
259
259
  }
260
260
  } else {
261
261
  try {
262
262
  throw Error();
263
263
  } catch (yi) {
264
- V = yi;
264
+ H = yi;
265
265
  }
266
266
  b();
267
267
  }
268
268
  } catch (yi) {
269
- if (yi && V && typeof yi.stack == "string") {
270
- for (var q = yi.stack.split(`
271
- `), xi = V.stack.split(`
272
- `), ri = q.length - 1, vi = xi.length - 1; ri >= 1 && vi >= 0 && q[ri] !== xi[vi]; )
273
- vi--;
274
- for (; ri >= 1 && vi >= 0; ri--, vi--)
275
- if (q[ri] !== xi[vi]) {
276
- if (ri !== 1 || vi !== 1)
269
+ if (yi && H && typeof yi.stack == "string") {
270
+ for (var $ = yi.stack.split(`
271
+ `), xi = H.stack.split(`
272
+ `), mi = $.length - 1, hi = xi.length - 1; mi >= 1 && hi >= 0 && $[mi] !== xi[hi]; )
273
+ hi--;
274
+ for (; mi >= 1 && hi >= 0; mi--, hi--)
275
+ if ($[mi] !== xi[hi]) {
276
+ if (mi !== 1 || hi !== 1)
277
277
  do
278
- if (ri--, vi--, vi < 0 || q[ri] !== xi[vi]) {
278
+ if (mi--, hi--, hi < 0 || $[mi] !== xi[hi]) {
279
279
  var Ni = `
280
- ` + q[ri].replace(" at new ", " at ");
281
- return b.displayName && Ni.includes("<anonymous>") && (Ni = Ni.replace("<anonymous>", b.displayName)), typeof b == "function" && F.set(b, Ni), Ni;
280
+ ` + $[mi].replace(" at new ", " at ");
281
+ return b.displayName && Ni.includes("<anonymous>") && (Ni = Ni.replace("<anonymous>", b.displayName)), typeof b == "function" && W.set(b, Ni), Ni;
282
282
  }
283
- while (ri >= 1 && vi >= 0);
283
+ while (mi >= 1 && hi >= 0);
284
284
  break;
285
285
  }
286
286
  }
287
287
  } finally {
288
- oi = !1, P.current = li, bi(), Error.prepareStackTrace = ei;
288
+ F = !1, D.current = li, vi(), Error.prepareStackTrace = ai;
289
289
  }
290
- var Pi = b ? b.displayName || b.name : "", wi = Pi ? U(Pi) : "";
291
- return typeof b == "function" && F.set(b, wi), wi;
290
+ var Pi = b ? b.displayName || b.name : "", wi = Pi ? V(Pi) : "";
291
+ return typeof b == "function" && W.set(b, wi), wi;
292
292
  }
293
- function Si(b, k, T) {
294
- return hi(b, !1);
293
+ function Ai(b, k, T) {
294
+ return ti(b, !1);
295
295
  }
296
- function Mi(b) {
296
+ function Ci(b) {
297
297
  var k = b.prototype;
298
298
  return !!(k && k.isReactComponent);
299
299
  }
@@ -301,26 +301,26 @@ function Bo() {
301
301
  if (b == null)
302
302
  return "";
303
303
  if (typeof b == "function")
304
- return hi(b, Mi(b));
304
+ return ti(b, Ci(b));
305
305
  if (typeof b == "string")
306
- return U(b);
306
+ return V(b);
307
307
  switch (b) {
308
308
  case c:
309
- return U("Suspense");
309
+ return V("Suspense");
310
310
  case r:
311
- return U("SuspenseList");
311
+ return V("SuspenseList");
312
312
  }
313
313
  if (typeof b == "object")
314
314
  switch (b.$$typeof) {
315
315
  case u:
316
- return Si(b.render);
316
+ return Ai(b.render);
317
317
  case v:
318
318
  return zi(b.type, k, T);
319
319
  case m: {
320
- var V = b, ei = V._payload, li = V._init;
320
+ var H = b, ai = H._payload, li = H._init;
321
321
  try {
322
- return zi(li(ei), k, T);
323
- } catch (ii) {
322
+ return zi(li(ai), k, T);
323
+ } catch (ni) {
324
324
  }
325
325
  }
326
326
  }
@@ -334,22 +334,22 @@ function Bo() {
334
334
  } else
335
335
  Fn.setExtraStackFrame(null);
336
336
  }
337
- function _e(b, k, T, V, ei) {
337
+ function _e(b, k, T, H, ai) {
338
338
  {
339
339
  var li = Function.call.bind(Ki);
340
- for (var ii in b)
341
- if (li(b, ii)) {
342
- var q = void 0;
340
+ for (var ni in b)
341
+ if (li(b, ni)) {
342
+ var $ = void 0;
343
343
  try {
344
- if (typeof b[ii] != "function") {
345
- var xi = Error((V || "React class") + ": " + T + " type `" + ii + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof b[ii] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ if (typeof b[ni] != "function") {
345
+ var xi = Error((H || "React class") + ": " + T + " type `" + ni + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof b[ni] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
346
346
  throw xi.name = "Invariant Violation", xi;
347
347
  }
348
- q = b[ii](k, ii, V, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
349
- } catch (ri) {
350
- q = ri;
348
+ $ = b[ni](k, ni, H, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
349
+ } catch (mi) {
350
+ $ = mi;
351
351
  }
352
- q && !(q instanceof Error) && (_i(ei), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", V || "React class", T, ii, typeof q), _i(null)), q instanceof Error && !(q.message in Vn) && (Vn[q.message] = !0, _i(ei), x("Failed %s type: %s", T, q.message), _i(null));
352
+ $ && !($ instanceof Error) && (_i(ai), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", H || "React class", T, ni, typeof $), _i(null)), $ instanceof Error && !($.message in Vn) && (Vn[$.message] = !0, _i(ai), x("Failed %s type: %s", T, $.message), _i(null));
353
353
  }
354
354
  }
355
355
  }
@@ -424,51 +424,51 @@ function Bo() {
424
424
  });
425
425
  }
426
426
  }
427
- var eo = function(b, k, T, V, ei, li, ii) {
428
- var q = {
427
+ var eo = function(b, k, T, H, ai, li, ni) {
428
+ var $ = {
429
429
  // This tag allows us to uniquely identify this as a React Element
430
430
  $$typeof: e,
431
431
  // Built-in properties that belong on the element
432
432
  type: b,
433
433
  key: k,
434
434
  ref: T,
435
- props: ii,
435
+ props: ni,
436
436
  // Record the component responsible for creating this element.
437
437
  _owner: li
438
438
  };
439
- return q._store = {}, Object.defineProperty(q._store, "validated", {
439
+ return $._store = {}, Object.defineProperty($._store, "validated", {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !0,
443
443
  value: !1
444
- }), Object.defineProperty(q, "_self", {
444
+ }), Object.defineProperty($, "_self", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !1,
448
- value: V
449
- }), Object.defineProperty(q, "_source", {
448
+ value: H
449
+ }), Object.defineProperty($, "_source", {
450
450
  configurable: !1,
451
451
  enumerable: !1,
452
452
  writable: !1,
453
- value: ei
454
- }), Object.freeze && (Object.freeze(q.props), Object.freeze(q)), q;
453
+ value: ai
454
+ }), Object.freeze && (Object.freeze($.props), Object.freeze($)), $;
455
455
  };
456
- function oo(b, k, T, V, ei) {
456
+ function oo(b, k, T, H, ai) {
457
457
  {
458
- var li, ii = {}, q = null, xi = null;
459
- T !== void 0 && (Un(T), q = "" + T), Qe(k) && (Un(k.key), q = "" + k.key), $e(k) && (xi = k.ref, Xe(k, ei));
458
+ var li, ni = {}, $ = null, xi = null;
459
+ T !== void 0 && (Un(T), $ = "" + T), Qe(k) && (Un(k.key), $ = "" + k.key), $e(k) && (xi = k.ref, Xe(k, ai));
460
460
  for (li in k)
461
- Ki.call(k, li) && !Ze.hasOwnProperty(li) && (ii[li] = k[li]);
461
+ Ki.call(k, li) && !Ze.hasOwnProperty(li) && (ni[li] = k[li]);
462
462
  if (b && b.defaultProps) {
463
- var ri = b.defaultProps;
464
- for (li in ri)
465
- ii[li] === void 0 && (ii[li] = ri[li]);
463
+ var mi = b.defaultProps;
464
+ for (li in mi)
465
+ ni[li] === void 0 && (ni[li] = mi[li]);
466
466
  }
467
- if (q || xi) {
468
- var vi = typeof b == "function" ? b.displayName || b.name || "Unknown" : b;
469
- q && io(ii, vi), xi && no(ii, vi);
467
+ if ($ || xi) {
468
+ var hi = typeof b == "function" ? b.displayName || b.name || "Unknown" : b;
469
+ $ && io(ni, hi), xi && no(ni, hi);
470
470
  }
471
- return eo(b, q, xi, ei, V, zn.current, ii);
471
+ return eo(b, $, xi, ai, H, zn.current, ni);
472
472
  }
473
473
  }
474
474
  var un = p.ReactCurrentOwner, Yn = p.ReactDebugCurrentFrame;
@@ -487,7 +487,7 @@ function Bo() {
487
487
  function qn() {
488
488
  {
489
489
  if (un.current) {
490
- var b = W(un.current.type);
490
+ var b = U(un.current.type);
491
491
  if (b)
492
492
  return `
493
493
 
@@ -521,8 +521,8 @@ Check the top-level render call using <` + T + ">.");
521
521
  if (Zn[T])
522
522
  return;
523
523
  Zn[T] = !0;
524
- var V = "";
525
- b && b._owner && b._owner !== un.current && (V = " It was passed a child from " + W(b._owner.type) + "."), Li(b), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, V), Li(null);
524
+ var H = "";
525
+ b && b._owner && b._owner !== un.current && (H = " It was passed a child from " + U(b._owner.type) + "."), Li(b), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, H), Li(null);
526
526
  }
527
527
  }
528
528
  function Qn(b, k) {
@@ -531,16 +531,16 @@ Check the top-level render call using <` + T + ">.");
531
531
  return;
532
532
  if (dn(b))
533
533
  for (var T = 0; T < b.length; T++) {
534
- var V = b[T];
535
- cn(V) && $n(V, k);
534
+ var H = b[T];
535
+ cn(H) && $n(H, k);
536
536
  }
537
537
  else if (cn(b))
538
538
  b._store && (b._store.validated = !0);
539
539
  else if (b) {
540
- var ei = g(b);
541
- if (typeof ei == "function" && ei !== b.entries)
542
- for (var li = ei.call(b), ii; !(ii = li.next()).done; )
543
- cn(ii.value) && $n(ii.value, k);
540
+ var ai = g(b);
541
+ if (typeof ai == "function" && ai !== b.entries)
542
+ for (var li = ai.call(b), ni; !(ni = li.next()).done; )
543
+ cn(ni.value) && $n(ni.value, k);
544
544
  }
545
545
  }
546
546
  }
@@ -559,12 +559,12 @@ Check the top-level render call using <` + T + ">.");
559
559
  else
560
560
  return;
561
561
  if (T) {
562
- var V = W(k);
563
- _e(T, b.props, "prop", V, b);
562
+ var H = U(k);
563
+ _e(T, b.props, "prop", H, b);
564
564
  } else if (k.PropTypes !== void 0 && !tn) {
565
565
  tn = !0;
566
- var ei = W(k);
567
- x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ei || "Unknown");
566
+ var ai = U(k);
567
+ x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ai || "Unknown");
568
568
  }
569
569
  typeof k.getDefaultProps == "function" && !k.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
570
570
  }
@@ -572,9 +572,9 @@ Check the top-level render call using <` + T + ">.");
572
572
  function uo(b) {
573
573
  {
574
574
  for (var k = Object.keys(b.props), T = 0; T < k.length; T++) {
575
- var V = k[T];
576
- if (V !== "children" && V !== "key") {
577
- Li(b), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", V), Li(null);
575
+ var H = k[T];
576
+ if (H !== "children" && H !== "key") {
577
+ Li(b), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", H), Li(null);
578
578
  break;
579
579
  }
580
580
  }
@@ -582,24 +582,24 @@ Check the top-level render call using <` + T + ">.");
582
582
  }
583
583
  }
584
584
  var Xn = {};
585
- function ie(b, k, T, V, ei, li) {
585
+ function ie(b, k, T, H, ai, li) {
586
586
  {
587
- var ii = J(b);
588
- if (!ii) {
589
- var q = "";
590
- (b === void 0 || typeof b == "object" && b !== null && Object.keys(b).length === 0) && (q += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
587
+ var ni = Y(b);
588
+ if (!ni) {
589
+ var $ = "";
590
+ (b === void 0 || typeof b == "object" && b !== null && Object.keys(b).length === 0) && ($ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
591
591
  var xi = ao();
592
- xi ? q += xi : q += qn();
593
- var ri;
594
- b === null ? ri = "null" : dn(b) ? ri = "array" : b !== void 0 && b.$$typeof === e ? (ri = "<" + (W(b.type) || "Unknown") + " />", q = " Did you accidentally export a JSX literal instead of a component?") : ri = typeof b, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ri, q);
592
+ xi ? $ += xi : $ += qn();
593
+ var mi;
594
+ b === null ? mi = "null" : dn(b) ? mi = "array" : b !== void 0 && b.$$typeof === e ? (mi = "<" + (U(b.type) || "Unknown") + " />", $ = " Did you accidentally export a JSX literal instead of a component?") : mi = typeof b, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", mi, $);
595
595
  }
596
- var vi = oo(b, k, T, ei, li);
597
- if (vi == null)
598
- return vi;
599
- if (ii) {
596
+ var hi = oo(b, k, T, ai, li);
597
+ if (hi == null)
598
+ return hi;
599
+ if (ni) {
600
600
  var Ni = k.children;
601
601
  if (Ni !== void 0)
602
- if (V)
602
+ if (H)
603
603
  if (dn(Ni)) {
604
604
  for (var Pi = 0; Pi < Ni.length; Pi++)
605
605
  Qn(Ni[Pi], b);
@@ -610,7 +610,7 @@ Check the top-level render call using <` + T + ">.");
610
610
  Qn(Ni, b);
611
611
  }
612
612
  if (Ki.call(k, "key")) {
613
- var wi = W(b), yi = Object.keys(k).filter(function(vo) {
613
+ var wi = U(b), yi = Object.keys(k).filter(function(vo) {
614
614
  return vo !== "key";
615
615
  }), rn = yi.length > 0 ? "{key: someKey, " + yi.join(": ..., ") + ": ...}" : "{key: someKey}";
616
616
  if (!Xn[wi + rn]) {
@@ -623,7 +623,7 @@ React keys must be passed directly to JSX without using spread:
623
623
  <%s key={someKey} {...props} />`, rn, wi, bo, wi), Xn[wi + rn] = !0;
624
624
  }
625
625
  }
626
- return b === s ? uo(vi) : lo(vi), vi;
626
+ return b === s ? uo(hi) : lo(hi), hi;
627
627
  }
628
628
  }
629
629
  function to(b, k, T) {
@@ -644,146 +644,146 @@ var n = Eo();
644
644
  const fi = ho(void 0), se = {
645
645
  title: "",
646
646
  description: "",
647
- id: Ai(),
647
+ id: Si(),
648
648
  questionData: [],
649
649
  disabled: !1,
650
650
  isHidden: !1
651
651
  }, je = ({ children: i }) => {
652
- const [e, o] = D(!0), [s, a] = D({}), [l, d] = D({}), [t, u] = D([se]), [c, r] = D(!1), [v, m] = D(null), [h, f] = D([
652
+ const [e, o] = R(!0), [s, a] = R({}), [l, d] = R({}), [t, u] = R([se]), [c, r] = R(!1), [v, m] = R(null), [h, f] = R([
653
653
  0
654
- ]), [y, g] = D(""), p = mi.useCallback(() => {
655
- }, []), x = mi.useCallback(() => {
656
- const O = Ai();
657
- u((G) => [...G, { ...se, id: O }]), m(O), f([t.length]);
658
- }, [t]), C = mi.useCallback((O) => {
654
+ ]), [y, g] = R(""), p = bi.useCallback(() => {
655
+ }, []), x = bi.useCallback(() => {
656
+ const I = Si();
657
+ u((K) => [...K, { ...se, id: I }]), m(I), f([t.length]);
658
+ }, [t]), C = bi.useCallback((I) => {
659
659
  u(
660
- (G) => G.filter((H) => H.id !== O)
660
+ (K) => K.filter((G) => G.id !== I)
661
661
  ), m(null);
662
- }, []), S = mi.useCallback(
663
- (O, G) => {
664
- const H = t.find((M) => M.id === G), R = H == null ? void 0 : H.questionData.find(
665
- (M) => M.id === O
662
+ }, []), S = bi.useCallback(
663
+ (I, K) => {
664
+ const G = t.find((M) => M.id === K), P = G == null ? void 0 : G.questionData.find(
665
+ (M) => M.id === I
666
666
  );
667
- R && u(
667
+ P && u(
668
668
  (M) => M == null ? void 0 : M.map(
669
- (B) => B.id === G ? {
669
+ (B) => B.id === K ? {
670
670
  ...B,
671
- questionData: B.questionData.filter((_) => R.type === "grid" ? _.gridId !== R.id && _.id !== R.id : _.id !== O)
671
+ questionData: B.questionData.filter((J) => P.type === "grid" ? J.gridId !== P.id && J.id !== P.id : J.id !== I)
672
672
  } : B
673
673
  )
674
674
  );
675
675
  },
676
676
  [t, u]
677
- ), j = mi.useCallback(
678
- (O, G) => {
679
- const H = t.find((_) => _.id === G);
680
- if (!H) return;
681
- const R = H.questionData.findIndex(
682
- (_) => _.id === O
677
+ ), j = bi.useCallback(
678
+ (I, K) => {
679
+ const G = t.find((J) => J.id === K);
680
+ if (!G) return;
681
+ const P = G.questionData.findIndex(
682
+ (J) => J.id === I
683
683
  );
684
- if (R === -1) return;
685
- const M = H.questionData[R], B = (_, ti = {}) => ({
686
- ...JSON.parse(JSON.stringify(_)),
687
- id: Ai(),
688
- ...ti
684
+ if (P === -1) return;
685
+ const M = G.questionData[P], B = (J, ri = {}) => ({
686
+ ...JSON.parse(JSON.stringify(J)),
687
+ id: Si(),
688
+ ...ri
689
689
  });
690
690
  u(
691
- (_) => _ == null ? void 0 : _.map((ti) => {
691
+ (J) => J == null ? void 0 : J.map((ri) => {
692
692
  var di;
693
- if (ti.id !== G) return ti;
694
- const X = [...ti.questionData];
693
+ if (ri.id !== K) return ri;
694
+ const ii = [...ri.questionData];
695
695
  if (M.type === "grid") {
696
- const pi = (di = X == null ? void 0 : X.map((si, hi) => ({ e: si, i: hi })).filter(
697
- ({ e: si }) => si.id === M.id || si.gridId === M.id
698
- )) == null ? void 0 : di.map(({ i: si }) => si), bi = pi.length ? Math.max(...pi) + 1 : R + 1, P = Ai(), I = B(M, {});
699
- I.id = P;
700
- const U = X.filter((si) => si.gridId === M.id), oi = U == null ? void 0 : U.map(
701
- (si) => B(si, { gridId: P })
702
- ), F = [
703
- ...X.slice(0, bi),
704
- I,
705
- ...oi,
706
- ...X.slice(bi)
696
+ const pi = (di = ii == null ? void 0 : ii.map((oi, ti) => ({ e: oi, i: ti })).filter(
697
+ ({ e: oi }) => oi.id === M.id || oi.gridId === M.id
698
+ )) == null ? void 0 : di.map(({ i: oi }) => oi), vi = pi.length ? Math.max(...pi) + 1 : P + 1, D = Si(), _ = B(M, {});
699
+ _.id = D;
700
+ const V = ii.filter((oi) => oi.gridId === M.id), F = V == null ? void 0 : V.map(
701
+ (oi) => B(oi, { gridId: D })
702
+ ), W = [
703
+ ...ii.slice(0, vi),
704
+ _,
705
+ ...F,
706
+ ...ii.slice(vi)
707
707
  ];
708
- return { ...ti, questionData: F };
708
+ return { ...ri, questionData: W };
709
709
  } else if (M.gridId) {
710
- const { gridId: pi, gridPosition: bi, ...P } = M, I = B(P, {}), U = X.reduce(
711
- (F, si, hi) => si.id === M.gridId || si.gridId === M.gridId ? hi : F,
712
- R
713
- ), oi = [
714
- ...X.slice(0, U + 1),
715
- I,
716
- ...X.slice(U + 1)
710
+ const { gridId: pi, gridPosition: vi, ...D } = M, _ = B(D, {}), V = ii.reduce(
711
+ (W, oi, ti) => oi.id === M.gridId || oi.gridId === M.gridId ? ti : W,
712
+ P
713
+ ), F = [
714
+ ...ii.slice(0, V + 1),
715
+ _,
716
+ ...ii.slice(V + 1)
717
717
  ];
718
- return { ...ti, questionData: oi };
718
+ return { ...ri, questionData: F };
719
719
  } else {
720
- const pi = B(M, {}), bi = [
721
- ...X.slice(0, R + 1),
720
+ const pi = B(M, {}), vi = [
721
+ ...ii.slice(0, P + 1),
722
722
  pi,
723
- ...X.slice(R + 1)
723
+ ...ii.slice(P + 1)
724
724
  ];
725
- return { ...ti, questionData: bi };
725
+ return { ...ri, questionData: vi };
726
726
  }
727
727
  })
728
728
  );
729
729
  },
730
730
  [t, u]
731
- ), A = mi.useCallback(
732
- (O, G) => {
731
+ ), A = bi.useCallback(
732
+ (I, K) => {
733
733
  u(
734
- (H) => H == null ? void 0 : H.map(
735
- (R) => R.id === G ? { ...R, questionData: O } : R
734
+ (G) => G == null ? void 0 : G.map(
735
+ (P) => P.id === K ? { ...P, questionData: I } : P
736
736
  )
737
737
  );
738
738
  },
739
739
  []
740
- ), N = mi.useCallback((O, G) => {
740
+ ), N = bi.useCallback((I, K) => {
741
741
  u(
742
- (H) => H == null ? void 0 : H.map(
743
- (R) => R.id === G ? {
744
- ...R,
745
- questionData: [...R.questionData, O]
746
- } : R
742
+ (G) => G == null ? void 0 : G.map(
743
+ (P) => P.id === K ? {
744
+ ...P,
745
+ questionData: [...P.questionData, I]
746
+ } : P
747
747
  )
748
748
  );
749
- }, []), E = mi.useCallback(
750
- (O, G, H) => {
749
+ }, []), E = bi.useCallback(
750
+ (I, K, G) => {
751
751
  u(
752
- (R) => R == null ? void 0 : R.map(
753
- (M) => M.id === G ? {
752
+ (P) => P == null ? void 0 : P.map(
753
+ (M) => M.id === K ? {
754
754
  ...M,
755
755
  questionData: [
756
- ...M.questionData.slice(0, H),
757
- O,
758
- ...M.questionData.slice(H)
756
+ ...M.questionData.slice(0, G),
757
+ I,
758
+ ...M.questionData.slice(G)
759
759
  ]
760
760
  } : M
761
761
  )
762
762
  );
763
763
  },
764
764
  []
765
- ), ni = mi.useCallback(
766
- (O, G, H) => {
765
+ ), ei = bi.useCallback(
766
+ (I, K, G) => {
767
767
  u(
768
- (R) => R == null ? void 0 : R.map(
768
+ (P) => P == null ? void 0 : P.map(
769
769
  (M) => {
770
770
  var B;
771
- return M.id === H ? {
771
+ return M.id === G ? {
772
772
  ...M,
773
773
  questionData: (B = M.questionData) == null ? void 0 : B.map(
774
- (_) => {
775
- var ti;
776
- return _.type === "grid" && _.gridData ? {
777
- ..._,
778
- gridData: (ti = _.gridData) == null ? void 0 : ti.map(
779
- (X, di) => di === O ? {
780
- ...X,
781
- ...G
782
- } : X
774
+ (J) => {
775
+ var ri;
776
+ return J.type === "grid" && J.gridData ? {
777
+ ...J,
778
+ gridData: (ri = J.gridData) == null ? void 0 : ri.map(
779
+ (ii, di) => di === I ? {
780
+ ...ii,
781
+ ...K
782
+ } : ii
783
783
  ).concat(
784
- O >= _.gridData.length ? { ...G } : []
784
+ I >= J.gridData.length ? { ...K } : []
785
785
  )
786
- } : _;
786
+ } : J;
787
787
  }
788
788
  )
789
789
  } : M;
@@ -792,87 +792,87 @@ const fi = ho(void 0), se = {
792
792
  );
793
793
  },
794
794
  []
795
- ), J = mi.useCallback((O, G) => {
795
+ ), Y = bi.useCallback((I, K) => {
796
796
  u(
797
- (H) => H == null ? void 0 : H.map(
798
- (R) => {
797
+ (G) => G == null ? void 0 : G.map(
798
+ (P) => {
799
799
  var M;
800
- return R.id === G ? {
801
- ...R,
802
- questionData: (M = R.questionData) == null ? void 0 : M.map(
803
- (B) => B.id === O.id ? { ...B, ...O } : B
800
+ return P.id === K ? {
801
+ ...P,
802
+ questionData: (M = P.questionData) == null ? void 0 : M.map(
803
+ (B) => B.id === I.id ? { ...B, ...I } : B
804
804
  )
805
- } : R;
805
+ } : P;
806
806
  }
807
807
  )
808
808
  );
809
- }, []), $ = mi.useCallback(
810
- (O) => {
809
+ }, []), Q = bi.useCallback(
810
+ (I) => {
811
811
  const {
812
- draggedId: G,
813
- sectionId: H,
814
- targetIndex: R,
812
+ draggedId: K,
813
+ sectionId: G,
814
+ targetIndex: P,
815
815
  targetId: M,
816
816
  targetGridId: B,
817
- targetCol: _
818
- } = O;
817
+ targetCol: J
818
+ } = I;
819
819
  u(
820
- (ti) => ti.map((X) => {
821
- if (X.id !== H) return X;
822
- const di = [...X.questionData], pi = di.findIndex((P) => P.id === G);
823
- if (pi === -1) return X;
824
- const bi = { ...di[pi] };
825
- if (B !== void 0 && _ !== void 0) {
826
- if (bi.type === "grid") return X;
827
- const P = di.findIndex(
828
- (U) => {
829
- var oi;
830
- return U.id !== G && U.gridId === B && ((oi = U.gridPosition) == null ? void 0 : oi.col) === _;
820
+ (ri) => ri.map((ii) => {
821
+ if (ii.id !== G) return ii;
822
+ const di = [...ii.questionData], pi = di.findIndex((D) => D.id === K);
823
+ if (pi === -1) return ii;
824
+ const vi = { ...di[pi] };
825
+ if (B !== void 0 && J !== void 0) {
826
+ if (vi.type === "grid") return ii;
827
+ const D = di.findIndex(
828
+ (V) => {
829
+ var F;
830
+ return V.id !== K && V.gridId === B && ((F = V.gridPosition) == null ? void 0 : F.col) === J;
831
831
  }
832
832
  );
833
- let I = di.map(
834
- (U) => U.id === G ? {
835
- ...U,
833
+ let _ = di.map(
834
+ (V) => V.id === K ? {
835
+ ...V,
836
836
  gridId: B,
837
- gridPosition: { col: _ }
838
- } : U
837
+ gridPosition: { col: J }
838
+ } : V
839
839
  );
840
- return P !== -1 && (I = I.map((U, oi) => {
841
- if (oi !== P) return U;
842
- const F = { ...U };
843
- return delete F.gridId, delete F.gridPosition, F;
844
- })), { ...X, questionData: I };
840
+ return D !== -1 && (_ = _.map((V, F) => {
841
+ if (F !== D) return V;
842
+ const W = { ...V };
843
+ return delete W.gridId, delete W.gridPosition, W;
844
+ })), { ...ii, questionData: _ };
845
845
  }
846
- if (bi.gridId && R !== void 0 && B === void 0) {
847
- const P = { ...bi };
848
- delete P.gridId, delete P.gridPosition;
849
- const I = di.filter((oi) => oi.id !== G), U = Math.min(R, I.length);
850
- return I.splice(U, 0, P), { ...X, questionData: I };
846
+ if (vi.gridId && P !== void 0 && B === void 0) {
847
+ const D = { ...vi };
848
+ delete D.gridId, delete D.gridPosition;
849
+ const _ = di.filter((F) => F.id !== K), V = Math.min(P, _.length);
850
+ return _.splice(V, 0, D), { ...ii, questionData: _ };
851
851
  }
852
- if (!bi.gridId && R !== void 0 && B === void 0 && !M) {
852
+ if (!vi.gridId && P !== void 0 && B === void 0 && !M) {
853
853
  di.splice(pi, 1);
854
- const P = Math.min(R, di.length);
855
- return di.splice(P, 0, bi), { ...X, questionData: di };
854
+ const D = Math.min(P, di.length);
855
+ return di.splice(D, 0, vi), { ...ii, questionData: di };
856
856
  }
857
857
  if (M) {
858
- const P = di.findIndex((I) => I.id === M);
859
- return P === -1 ? X : (di.splice(pi, 1), di.splice(P, 0, bi), { ...X, questionData: di });
858
+ const D = di.findIndex((_) => _.id === M);
859
+ return D === -1 ? ii : (di.splice(pi, 1), di.splice(D, 0, vi), { ...ii, questionData: di });
860
860
  }
861
- return X;
861
+ return ii;
862
862
  })
863
863
  );
864
864
  },
865
865
  []
866
- ), L = mi.useCallback((O, G) => {
866
+ ), L = bi.useCallback((I, K) => {
867
867
  u(
868
- (H) => H == null ? void 0 : H.map(
869
- (R) => R.id === G ? {
870
- ...R,
871
- ...O
872
- } : R
868
+ (G) => G == null ? void 0 : G.map(
869
+ (P) => P.id === K ? {
870
+ ...P,
871
+ ...I
872
+ } : P
873
873
  )
874
874
  );
875
- }, []), W = ai(
875
+ }, []), U = si(
876
876
  () => ({
877
877
  formData: t,
878
878
  setFormData: u,
@@ -883,7 +883,7 @@ const fi = ho(void 0), se = {
883
883
  updateElementPosition: A,
884
884
  addElement: N,
885
885
  addElementInPosition: E,
886
- updateElement: J,
886
+ updateElement: Y,
887
887
  addSection: x,
888
888
  removeSection: C,
889
889
  updateSection: L,
@@ -893,13 +893,13 @@ const fi = ho(void 0), se = {
893
893
  setSelectedSection: m,
894
894
  activeSections: h,
895
895
  setActiveSections: f,
896
- updateGridElement: ni,
896
+ updateGridElement: ei,
897
897
  answerData: s,
898
898
  setAnswerData: a,
899
899
  uploadUrl: y,
900
900
  setUploadUrl: g,
901
901
  duplicateElement: j,
902
- moveElement: $,
902
+ moveElement: Q,
903
903
  showPreview: e,
904
904
  setShowPreview: o
905
905
  }),
@@ -911,22 +911,22 @@ const fi = ho(void 0), se = {
911
911
  A,
912
912
  N,
913
913
  E,
914
- J,
914
+ Y,
915
915
  x,
916
916
  C,
917
917
  L,
918
918
  c,
919
919
  v,
920
920
  h,
921
- ni,
921
+ ei,
922
922
  s,
923
923
  y,
924
924
  j,
925
- $,
925
+ Q,
926
926
  e
927
927
  ]
928
928
  );
929
- return /* @__PURE__ */ n.jsx(fi.Provider, { value: W, children: i });
929
+ return /* @__PURE__ */ n.jsx(fi.Provider, { value: U, children: i });
930
930
  };
931
931
  function ke(i) {
932
932
  var e, o, s = "";
@@ -1125,11 +1125,11 @@ const Nn = ({
1125
1125
  maxDate: t,
1126
1126
  showYearDropdown: u
1127
1127
  }) => {
1128
- const c = i ? new Date(i) : null, [r, v] = D(c);
1129
- K(() => {
1128
+ const c = i ? new Date(i) : null, [r, v] = R(c);
1129
+ O(() => {
1130
1130
  const h = i ? new Date(i) : null;
1131
1131
  (h && r && h.getTime() !== r.getTime() || !h && r || h && !r) && v(h);
1132
- }, [i]), K(() => {
1132
+ }, [i]), O(() => {
1133
1133
  e && e(a, r);
1134
1134
  }, [r, e, a]);
1135
1135
  const m = (h) => {
@@ -1166,7 +1166,7 @@ function Po({
1166
1166
  watch: a
1167
1167
  } = e || {};
1168
1168
  let l;
1169
- return a && (l = a()[i.id]), K(() => {
1169
+ return a && (l = a()[i.id]), O(() => {
1170
1170
  o(i.id);
1171
1171
  }, [i.id]), /* @__PURE__ */ n.jsx(
1172
1172
  Nn,
@@ -1761,12 +1761,12 @@ function va(i, e, o, s) {
1761
1761
  }), m = [];
1762
1762
  }
1763
1763
  function S(A, N, E) {
1764
- const ni = N !== "success";
1765
- switch (m = m.filter((J) => J !== A), u) {
1764
+ const ei = N !== "success";
1765
+ switch (m = m.filter((Y) => Y !== A), u) {
1766
1766
  case "pending":
1767
1767
  break;
1768
1768
  case "failed":
1769
- if (ni || !i.dataAfterTimeout) return;
1769
+ if (ei || !i.dataAfterTimeout) return;
1770
1770
  break;
1771
1771
  default:
1772
1772
  return;
@@ -1775,16 +1775,16 @@ function va(i, e, o, s) {
1775
1775
  r = E, x();
1776
1776
  return;
1777
1777
  }
1778
- if (ni) {
1778
+ if (ei) {
1779
1779
  r = E, m.length || (d.length ? j() : x());
1780
1780
  return;
1781
1781
  }
1782
1782
  if (f(), C(), !i.random) {
1783
- const J = i.resources.indexOf(A.resource);
1784
- J !== -1 && J !== i.index && (i.index = J);
1783
+ const Y = i.resources.indexOf(A.resource);
1784
+ Y !== -1 && Y !== i.index && (i.index = Y);
1785
1785
  }
1786
- u = "completed", h.forEach((J) => {
1787
- J(E);
1786
+ u = "completed", h.forEach((Y) => {
1787
+ Y(E);
1788
1788
  });
1789
1789
  }
1790
1790
  function j() {
@@ -1804,8 +1804,8 @@ function va(i, e, o, s) {
1804
1804
  const N = {
1805
1805
  status: "pending",
1806
1806
  resource: A,
1807
- callback: (E, ni) => {
1808
- S(N, E, ni);
1807
+ callback: (E, ei) => {
1808
+ S(N, E, ei);
1809
1809
  }
1810
1810
  };
1811
1811
  m.push(N), c++, v = setTimeout(j, i.rotate), o(A, e, N.callback);
@@ -2210,7 +2210,7 @@ if (typeof document != "undefined" && typeof window != "undefined") {
2210
2210
  }
2211
2211
  }
2212
2212
  function Ke(i) {
2213
- const [e, o] = D(!!i.ssr), [s, a] = D({});
2213
+ const [e, o] = R(!!i.ssr), [s, a] = R({});
2214
2214
  function l(h) {
2215
2215
  if (h) {
2216
2216
  const f = i.icon;
@@ -2230,7 +2230,7 @@ function Ke(i) {
2230
2230
  name: ""
2231
2231
  };
2232
2232
  }
2233
- const [d, t] = D(l(!!i.ssr));
2233
+ const [d, t] = R(l(!!i.ssr));
2234
2234
  function u() {
2235
2235
  const h = s.callback;
2236
2236
  h && (h(), a({}));
@@ -2261,7 +2261,7 @@ function Ke(i) {
2261
2261
  });
2262
2262
  } else y && ((h = i.onLoad) === null || h === void 0 || h.call(i, f));
2263
2263
  }
2264
- K(() => (o(!0), u), []), K(() => {
2264
+ O(() => (o(!0), u), []), O(() => {
2265
2265
  e && r();
2266
2266
  }, [i.icon, e]);
2267
2267
  const { name: v, data: m } = d;
@@ -2279,7 +2279,7 @@ Se((i, e) => Ke({
2279
2279
  ...i,
2280
2280
  _ref: e
2281
2281
  }));
2282
- function Y({
2282
+ function q({
2283
2283
  icon: i,
2284
2284
  iconClass: e
2285
2285
  }) {
@@ -2297,16 +2297,16 @@ function In({
2297
2297
  isReadOnly: l,
2298
2298
  watch: d,
2299
2299
  getValues: t
2300
- } = e || {}, [u, c] = D(() => {
2300
+ } = e || {}, [u, c] = R(() => {
2301
2301
  const m = t == null ? void 0 : t(i.id);
2302
2302
  return Array.isArray(m) ? m : [];
2303
- }), r = ai(
2303
+ }), r = si(
2304
2304
  () => u == null ? void 0 : u.map((m) => m.label).join(", "),
2305
2305
  [u]
2306
2306
  );
2307
- return K(() => {
2307
+ return O(() => {
2308
2308
  s(i.id);
2309
- }, [i.id, s]), K(() => {
2309
+ }, [i.id, s]), O(() => {
2310
2310
  if (!d) return;
2311
2311
  const m = d((h) => {
2312
2312
  const f = h[i.id];
@@ -2334,7 +2334,7 @@ function In({
2334
2334
  disabled: l,
2335
2335
  children: [
2336
2336
  /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (u == null ? void 0 : u.length) > 0 ? r : /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o != null ? o : " Select options" }) }),
2337
- /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(Y, { icon: "lucide:chevron-down" }) })
2337
+ /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(q, { icon: "lucide:chevron-down" }) })
2338
2338
  ]
2339
2339
  }
2340
2340
  ),
@@ -2393,10 +2393,10 @@ function He({
2393
2393
  fileName: e,
2394
2394
  removeFile: o
2395
2395
  }) {
2396
- const [s, a] = D(!1), [l, d] = D("unknown"), [t, u] = D(null);
2397
- K(() => {
2396
+ const [s, a] = R(!1), [l, d] = R("unknown"), [t, u] = R(null);
2397
+ O(() => {
2398
2398
  i && d(Ia(i));
2399
- }, [i]), K(() => {
2399
+ }, [i]), O(() => {
2400
2400
  if (l === "pdf" && (i != null && i.startsWith("data:")))
2401
2401
  try {
2402
2402
  const h = atob(i.split(",")[1]), f = new ArrayBuffer(h.length), y = new Uint8Array(f);
@@ -2431,8 +2431,8 @@ function He({
2431
2431
  className: "!flex items-center rounded cursor-pointer gap-x-3",
2432
2432
  title: `Click to preview ${v}`,
2433
2433
  children: [
2434
- l === "image" && /* @__PURE__ */ n.jsx("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ n.jsx(Y, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
2435
- l !== "image" && /* @__PURE__ */ n.jsx(Y, { icon: Oa[l], iconClass: "text-4xl" }),
2434
+ l === "image" && /* @__PURE__ */ n.jsx("div", { className: "flex items-center justify-center ", children: /* @__PURE__ */ n.jsx(q, { iconClass: "text-4xl", icon: "fluent-color:image-48" }) }),
2435
+ l !== "image" && /* @__PURE__ */ n.jsx(q, { icon: Oa[l], iconClass: "text-4xl" }),
2436
2436
  /* @__PURE__ */ n.jsx("span", { className: "text-sm font-semibold text-center text-gray-700 truncate max-w-[300px]", children: v })
2437
2437
  ]
2438
2438
  }
@@ -2445,7 +2445,7 @@ function He({
2445
2445
  className: "p-2",
2446
2446
  onClick: () => m(t || i, e),
2447
2447
  title: `Download ${v}`,
2448
- children: /* @__PURE__ */ n.jsx(Y, { icon: "streamline-flex:download-tray-solid" })
2448
+ children: /* @__PURE__ */ n.jsx(q, { icon: "streamline-flex:download-tray-solid" })
2449
2449
  }
2450
2450
  ),
2451
2451
  o && /* @__PURE__ */ n.jsx(
@@ -2454,7 +2454,7 @@ function He({
2454
2454
  type: "button",
2455
2455
  className: "p-2 text-lg text-red-500",
2456
2456
  onClick: o,
2457
- children: /* @__PURE__ */ n.jsx(Y, { icon: "lets-icons:trash-duotone" })
2457
+ children: /* @__PURE__ */ n.jsx(q, { icon: "lets-icons:trash-duotone" })
2458
2458
  }
2459
2459
  )
2460
2460
  ] }),
@@ -2520,17 +2520,17 @@ function Ga({
2520
2520
  list: a = null,
2521
2521
  accept: l = []
2522
2522
  }) {
2523
- const { uploadUrl: d } = ji(fi), t = Ci(null), [u, c] = D(a), [r, v] = D(!1);
2524
- K(() => {
2523
+ const { uploadUrl: d } = ji(fi), t = Mi(null), [u, c] = R(a), [r, v] = R(!1);
2524
+ O(() => {
2525
2525
  c(a);
2526
2526
  }, [a]);
2527
- const m = ai(
2527
+ const m = si(
2528
2528
  () => l == null ? void 0 : l.map((S) => S.value).join(", "),
2529
2529
  [l]
2530
- ), h = ai(
2530
+ ), h = si(
2531
2531
  () => l == null ? void 0 : l.map((S) => S.label).join(", "),
2532
2532
  [l]
2533
- ), f = Q(
2533
+ ), f = X(
2534
2534
  async (S) => {
2535
2535
  var A;
2536
2536
  const j = gi("token");
@@ -2546,7 +2546,7 @@ function Ga({
2546
2546
  }
2547
2547
  },
2548
2548
  [d]
2549
- ), y = Q(
2549
+ ), y = X(
2550
2550
  (S) => new Promise((j, A) => {
2551
2551
  const N = new FileReader();
2552
2552
  N.onloadend = async () => {
@@ -2554,13 +2554,13 @@ function Ga({
2554
2554
  const E = N.result.replace(
2555
2555
  /^data:.*;base64,/,
2556
2556
  ""
2557
- ), ni = d ? await f({
2557
+ ), ei = d ? await f({
2558
2558
  base64: E,
2559
2559
  ext: `.${S.name.split(".").pop()}`,
2560
2560
  fileName: S.name
2561
2561
  }) : N.result;
2562
2562
  j({
2563
- base64: ni,
2563
+ base64: ei,
2564
2564
  type: S.type,
2565
2565
  name: S.name
2566
2566
  });
@@ -2570,7 +2570,7 @@ function Ga({
2570
2570
  }, N.onerror = () => A(new Error("File read failed")), N.readAsDataURL(S);
2571
2571
  }),
2572
2572
  [d, f]
2573
- ), g = Q(
2573
+ ), g = X(
2574
2574
  (S) => {
2575
2575
  var A;
2576
2576
  const j = m ? (A = m.split(",")) == null ? void 0 : A.map((N) => N.trim()) : [];
@@ -2589,7 +2589,7 @@ function Ga({
2589
2589
  return !0;
2590
2590
  },
2591
2591
  [m, h]
2592
- ), p = Q(
2592
+ ), p = X(
2593
2593
  async (S) => {
2594
2594
  const j = Array.from(S.target.files || []);
2595
2595
  if (!(!j.length || r)) {
@@ -2609,7 +2609,7 @@ function Ga({
2609
2609
  }
2610
2610
  },
2611
2611
  [r, g, y, i, s, u]
2612
- ), x = Q(
2612
+ ), x = X(
2613
2613
  (S) => {
2614
2614
  r || (t.current && (t.current.value = ""), c((j) => {
2615
2615
  const A = S === void 0 ? null : (j == null ? void 0 : j.filter((N, E) => E !== S)) || null;
@@ -2644,7 +2644,7 @@ function Ga({
2644
2644
  onClick: () => x(),
2645
2645
  disabled: r,
2646
2646
  "aria-label": "Remove all files",
2647
- children: /* @__PURE__ */ n.jsx(Y, { icon: "lets-icons:trash-duotone" })
2647
+ children: /* @__PURE__ */ n.jsx(q, { icon: "lets-icons:trash-duotone" })
2648
2648
  }
2649
2649
  )
2650
2650
  ] }),
@@ -2667,15 +2667,15 @@ function Ga({
2667
2667
  }
2668
2668
  function Ha({ element: i, validationData: e }) {
2669
2669
  var r;
2670
- const [o, s] = D((r = i == null ? void 0 : i.value) != null ? r : null), {
2670
+ const [o, s] = R((r = i == null ? void 0 : i.value) != null ? r : null), {
2671
2671
  register: a = () => ({}),
2672
2672
  setValue: l,
2673
2673
  isReadOnly: d,
2674
2674
  watch: t
2675
2675
  } = e || {};
2676
- K(() => {
2676
+ O(() => {
2677
2677
  a(i.id);
2678
- }, [i.id, a]), K(() => {
2678
+ }, [i.id, a]), O(() => {
2679
2679
  if (t) {
2680
2680
  const v = t((m) => {
2681
2681
  s(m[i.id]);
@@ -2686,7 +2686,7 @@ function Ha({ element: i, validationData: e }) {
2686
2686
  };
2687
2687
  }
2688
2688
  }, [t, i.id]);
2689
- const u = Q(
2689
+ const u = X(
2690
2690
  (v) => {
2691
2691
  l == null || l(i.id, v), s(v);
2692
2692
  },
@@ -2804,7 +2804,7 @@ const z = ({
2804
2804
  peer-disabled:cursor-not-allowed
2805
2805
  `,
2806
2806
  children: E && /* @__PURE__ */ n.jsx(
2807
- Y,
2807
+ q,
2808
2808
  {
2809
2809
  icon: "meteor-icons:check",
2810
2810
  iconClass: "w-3.5 h-3.5 text-white"
@@ -2938,7 +2938,7 @@ const Di = ({
2938
2938
  loading: h,
2939
2939
  disabled: f
2940
2940
  }) => {
2941
- const [y, g] = D(c ? [] : null), p = Ci(!1), x = ai(() => !t || !i || i.length === 0 ? c ? [] : null : c ? Array.isArray(t) ? i.filter((j) => t.some(
2941
+ const [y, g] = R(c ? [] : null), p = Mi(!1), x = si(() => !t || !i || i.length === 0 ? c ? [] : null : c ? Array.isArray(t) ? i.filter((j) => t.some(
2942
2942
  (A) => {
2943
2943
  var N;
2944
2944
  return typeof j.value == "object" ? ((N = j.value) == null ? void 0 : N.id) === (A == null ? void 0 : A.id) : j.value === A;
@@ -2947,7 +2947,7 @@ const Di = ({
2947
2947
  var A;
2948
2948
  return typeof j.value == "string" && typeof t == "string" ? j.value.toLowerCase() === t.toLowerCase() : typeof j.value == "object" && typeof t == "object" ? ((A = j.value) == null ? void 0 : A.id) === (t == null ? void 0 : t.id) : j.value === t;
2949
2949
  }) || null, [t, i, c]);
2950
- K(() => {
2950
+ O(() => {
2951
2951
  if (p.current) {
2952
2952
  p.current = !1;
2953
2953
  return;
@@ -2957,14 +2957,14 @@ const Di = ({
2957
2957
  JSON.stringify(j) !== JSON.stringify(A) && g(x);
2958
2958
  } else (x == null ? void 0 : x.value) !== (y == null ? void 0 : y.value) && g(x);
2959
2959
  }, [x, c]);
2960
- const C = Q((j) => {
2960
+ const C = X((j) => {
2961
2961
  var A;
2962
2962
  if (p.current = !0, g(j), a) {
2963
2963
  const N = c ? Array.isArray(j) ? j == null ? void 0 : j.map((E) => E.value) : [] : (A = j == null ? void 0 : j.value) != null ? A : null;
2964
2964
  a(l, N), u == null || u(l);
2965
2965
  }
2966
2966
  s && !p.current && s(l);
2967
- }, [a, l, u, s, c]), S = ai(() => h ? "Fetching data..." : y ? c && Array.isArray(y) ? y.length > 0 ? y == null ? void 0 : y.map((j) => j.label).join(", ") : e : (y == null ? void 0 : y.label) || e : e, [y, h, e, c]);
2967
+ }, [a, l, u, s, c]), S = si(() => h ? "Fetching data..." : y ? c && Array.isArray(y) ? y.length > 0 ? y == null ? void 0 : y.map((j) => j.label).join(", ") : e : (y == null ? void 0 : y.label) || e : e, [y, h, e, c]);
2968
2968
  return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2969
2969
  !r && d && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2970
2970
  r && d && /* @__PURE__ */ n.jsx(
@@ -2995,7 +2995,7 @@ const Di = ({
2995
2995
  children: S
2996
2996
  }
2997
2997
  ),
2998
- /* @__PURE__ */ n.jsx("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ n.jsx(Y, { icon: "lucide:chevron-down" }) })
2998
+ /* @__PURE__ */ n.jsx("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ n.jsx(q, { icon: "lucide:chevron-down" }) })
2999
2999
  ] }),
3000
3000
  /* @__PURE__ */ n.jsx(
3001
3001
  Ei,
@@ -3032,23 +3032,23 @@ function Tn({
3032
3032
  readOnly: a,
3033
3033
  name: l
3034
3034
  }) {
3035
- const [d, t] = D(""), u = ai(() => {
3035
+ const [d, t] = R(""), u = si(() => {
3036
3036
  const h = e != null ? e : o;
3037
3037
  return i.find((f) => f.value === h || f.label === h) || null;
3038
- }, [e, o, i]), [c, r] = D(u);
3039
- K(() => {
3038
+ }, [e, o, i]), [c, r] = R(u);
3039
+ O(() => {
3040
3040
  if (e !== void 0) {
3041
3041
  const h = i.find((f) => f.value === e || f.label === e) || null;
3042
3042
  r(h);
3043
3043
  }
3044
3044
  }, [e, i]);
3045
- const v = ai(() => {
3045
+ const v = si(() => {
3046
3046
  if (d === "") return i;
3047
3047
  const h = d.toLowerCase();
3048
3048
  return i.filter(
3049
3049
  (f) => f.label.toLowerCase().includes(h)
3050
3050
  );
3051
- }, [d, i]), m = Q((h) => {
3051
+ }, [d, i]), m = X((h) => {
3052
3052
  r(h), s(l, h);
3053
3053
  }, [l, s]);
3054
3054
  return /* @__PURE__ */ n.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ n.jsxs(
@@ -3068,7 +3068,7 @@ function Tn({
3068
3068
  placeholder: "Select an option..."
3069
3069
  }
3070
3070
  ),
3071
- /* @__PURE__ */ n.jsx(fo, { className: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ n.jsx(Y, { icon: "octicon:chevron-down-12" }) })
3071
+ /* @__PURE__ */ n.jsx(fo, { className: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ n.jsx(q, { icon: "octicon:chevron-down-12" }) })
3072
3072
  ] }),
3073
3073
  /* @__PURE__ */ n.jsx(xo, { anchor: "bottom start", className: "select-options__combo", children: v.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No results found." }) : v == null ? void 0 : v.map((h) => /* @__PURE__ */ n.jsx(
3074
3074
  yo,
@@ -3095,7 +3095,7 @@ function za({
3095
3095
  watch: l
3096
3096
  } = e || {};
3097
3097
  let d;
3098
- return l && (d = l()[i.id]), K(() => {
3098
+ return l && (d = l()[i.id]), O(() => {
3099
3099
  o(i.id);
3100
3100
  }, [i.id, o]), /* @__PURE__ */ n.jsx(n.Fragment, { children: i.selectType === "list" ? /* @__PURE__ */ n.jsx(
3101
3101
  Di,
@@ -3225,7 +3225,7 @@ const Ja = ({
3225
3225
  }, Yi = (i, e = i) => ({
3226
3226
  label: i,
3227
3227
  value: e,
3228
- id: Ai()
3228
+ id: Si()
3229
3229
  }), ci = (i) => ({
3230
3230
  ...qa,
3231
3231
  ...i
@@ -3399,7 +3399,7 @@ const Ja = ({
3399
3399
  value: [],
3400
3400
  dataColumns: [
3401
3401
  {
3402
- id: Ai(),
3402
+ id: Si(),
3403
3403
  field: "",
3404
3404
  headerName: "",
3405
3405
  width: 150,
@@ -3445,6 +3445,23 @@ const Ja = ({
3445
3445
  inputLabel: "",
3446
3446
  inputType: "grid",
3447
3447
  columns: 2
3448
+ }),
3449
+ ci({
3450
+ type: "matrix",
3451
+ label: "Likert Scale",
3452
+ icon: "pepicons-pop:list",
3453
+ inputLabel: "Matrix Label",
3454
+ inputType: "matrix",
3455
+ options: [
3456
+ { id: "r1", label: "Example Row", value: "row_1" }
3457
+ ],
3458
+ options1: [
3459
+ { id: "c1", label: "Strongly Disagree", value: "strongly_disagree" },
3460
+ { id: "c2", label: "Disagree", value: "disagree" },
3461
+ { id: "c3", label: "Neutral", value: "neutral" },
3462
+ { id: "c4", label: "Agree", value: "agree" },
3463
+ { id: "c5", label: "Strongly Agree", value: "strongly_agree" }
3464
+ ]
3448
3465
  })
3449
3466
  ], Qa = Object.freeze({
3450
3467
  textFields: [
@@ -3467,8 +3484,9 @@ const Ja = ({
3467
3484
  "radio",
3468
3485
  "checkbox",
3469
3486
  "country",
3470
- "rating"
3471
- /* RATING */
3487
+ "rating",
3488
+ "matrix"
3489
+ /* MATRIX */
3472
3490
  ],
3473
3491
  dateAndTime: [
3474
3492
  "date"
@@ -3517,7 +3535,8 @@ const Ja = ({
3517
3535
  "radio",
3518
3536
  "select",
3519
3537
  "checkbox",
3520
- "multiselect"
3538
+ "multiselect",
3539
+ "matrix"
3521
3540
  ], ss = ["validateInput"], ls = ["tableInput"], pn = ["basicText"], ds = [
3522
3541
  {
3523
3542
  value: [
@@ -3566,10 +3585,10 @@ function us({
3566
3585
  onChange: e,
3567
3586
  onGetValue: o
3568
3587
  }) {
3569
- const [s, a] = D(
3588
+ const [s, a] = R(
3570
3589
  (i == null ? void 0 : i.length) > 0 ? i : [{ value: "" }]
3571
3590
  );
3572
- K(() => {
3591
+ O(() => {
3573
3592
  (i == null ? void 0 : i.length) > 0 && JSON.stringify(i) !== JSON.stringify(s) && a(i);
3574
3593
  }, [i]);
3575
3594
  function l(u, c) {
@@ -3592,7 +3611,7 @@ function us({
3592
3611
  const c = s.filter((r, v) => v !== u);
3593
3612
  a(c), e && e(c);
3594
3613
  }
3595
- return K(() => {
3614
+ return O(() => {
3596
3615
  o && o(JSON.stringify({ values: s }));
3597
3616
  }, [o, s]), /* @__PURE__ */ n.jsxs("div", { className: "]", children: [
3598
3617
  /* @__PURE__ */ n.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
@@ -3694,7 +3713,7 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3694
3713
  label: s,
3695
3714
  type: a
3696
3715
  }) => {
3697
- const [l, d] = D(""), t = gi("config"), u = (c) => {
3716
+ const [l, d] = R(""), t = gi("config"), u = (c) => {
3698
3717
  const r = c.target.files[0];
3699
3718
  if (!r) return;
3700
3719
  d(r.name);
@@ -3813,7 +3832,7 @@ function ps({
3813
3832
  watch: s,
3814
3833
  id: a
3815
3834
  }) {
3816
- const { formData: l } = ji(fi), d = s("visibilityDependentFields") || [], t = ai(() => {
3835
+ const { formData: l } = ji(fi), d = s("visibilityDependentFields") || [], t = si(() => {
3817
3836
  var c;
3818
3837
  return (c = vs(l).filter((r) => r.id !== a)) == null ? void 0 : c.map((r) => {
3819
3838
  const v = d.find(
@@ -4067,8 +4086,8 @@ const gs = w.object().shape({
4067
4086
  }) => {
4068
4087
  console.log(o);
4069
4088
  const s = fs.filter(
4070
- (P) => !qi.includes(o.inputType) || P.key !== "validation"
4071
- ), { updateElement: a } = mi.useContext(fi), [l, d] = D("basic"), [t, u] = D(!1), [c, r] = D("manual"), v = gi("config"), {
4089
+ (D) => !qi.includes(o.inputType) || D.key !== "validation"
4090
+ ), { updateElement: a } = bi.useContext(fi), [l, d] = R("basic"), [t, u] = R(!1), [c, r] = R("manual"), v = gi("config"), {
4072
4091
  register: m,
4073
4092
  handleSubmit: h,
4074
4093
  control: f,
@@ -4083,193 +4102,123 @@ const gs = w.object().shape({
4083
4102
  ...o,
4084
4103
  options: o.options || []
4085
4104
  }
4086
- }), A = g(), { fields: N, append: E, remove: ni } = mn({
4105
+ }), A = g(), { fields: N, append: E, remove: ei } = mn({
4087
4106
  control: f,
4088
4107
  name: "options"
4089
4108
  }), {
4090
- fields: J,
4091
- append: $,
4109
+ fields: Y,
4110
+ append: Q,
4092
4111
  remove: L
4093
4112
  } = mn({
4094
4113
  control: f,
4095
4114
  name: "options1"
4096
4115
  }), {
4097
- fields: W,
4098
- append: O,
4099
- remove: G
4116
+ fields: U,
4117
+ append: I,
4118
+ remove: K
4100
4119
  } = mn({
4101
4120
  control: f,
4102
4121
  name: "dataColumns"
4103
4122
  });
4104
- K(() => {
4123
+ O(() => {
4105
4124
  i || j();
4106
4125
  }, [i, j]);
4107
- const H = (P) => {
4108
- a(P, o.sectionId), e();
4126
+ const G = (D) => {
4127
+ a(D, o.sectionId), e();
4109
4128
  }, M = {
4110
4129
  headers: {
4111
4130
  Authorization: `Bearer ${gi("token")}`
4112
4131
  }
4113
- }, B = Q(async () => {
4114
- var P, I, U;
4132
+ }, B = X(async () => {
4133
+ var D, _, V;
4115
4134
  if (!A.apiUrl || !/^https?:\/\//.test(A.apiUrl)) {
4116
4135
  ki.info("Please provide a valid API URL");
4117
4136
  return;
4118
4137
  }
4119
4138
  try {
4120
4139
  u(!0);
4121
- const { status: oi, data: F } = await Ii.get(A.apiUrl, M);
4122
- if (oi !== 200 || !F) {
4140
+ const { status: F, data: W } = await Ii.get(A.apiUrl, M);
4141
+ if (F !== 200 || !W) {
4123
4142
  ki.error("Unexpected response from server.");
4124
4143
  return;
4125
4144
  }
4126
- const si = F.data || F.record || F.result;
4127
- if (!Array.isArray(si)) {
4145
+ const oi = W.data || W.record || W.result;
4146
+ if (!Array.isArray(oi)) {
4128
4147
  ki.error("Expected an array in response (data, record, or result).");
4129
4148
  return;
4130
4149
  }
4131
- ((P = o.type) == null ? void 0 : P.toLowerCase()) === "datagrid" ? y("dataColumns", Bn(si)) : y("options", wn(si));
4132
- } catch (oi) {
4133
- const F = ((U = (I = oi == null ? void 0 : oi.response) == null ? void 0 : I.data) == null ? void 0 : U.message) || (oi == null ? void 0 : oi.message) || "Unable to load options";
4134
- ki.error(F);
4150
+ ((D = o.type) == null ? void 0 : D.toLowerCase()) === "datagrid" ? y("dataColumns", Bn(oi)) : y("options", wn(oi));
4151
+ } catch (F) {
4152
+ const W = ((V = (_ = F == null ? void 0 : F.response) == null ? void 0 : _.data) == null ? void 0 : V.message) || (F == null ? void 0 : F.message) || "Unable to load options";
4153
+ ki.error(W);
4135
4154
  } finally {
4136
4155
  u(!1);
4137
4156
  }
4138
- }, [o.type, y, A.apiUrl]), _ = ["manual", "api", "sheet"];
4139
- function ti() {
4157
+ }, [o.type, y, A.apiUrl]), J = ["manual", "api", "sheet"];
4158
+ function ri() {
4140
4159
  c === "api" && B();
4141
4160
  }
4142
- const X = () => /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col justify-start gap-y-1", children: [
4143
- /* @__PURE__ */ n.jsx("div", { className: "flex items-center mb-4 gap-x-5", children: _ == null ? void 0 : _.map((P) => /* @__PURE__ */ n.jsxs("label", { className: "items-center text-base capitalize gap-x-3", children: [
4144
- /* @__PURE__ */ n.jsx(
4145
- "input",
4146
- {
4147
- type: "radio",
4148
- name: "optionType",
4149
- onChange: (I) => r(I.target.value),
4150
- value: P
4151
- }
4152
- ),
4153
- " ",
4154
- /* @__PURE__ */ n.jsxs("span", { children: [
4155
- P,
4156
- " options"
4157
- ] })
4158
- ] }, P)) }),
4159
- c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4160
- /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4161
- /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
4162
- /* @__PURE__ */ n.jsx(
4163
- z,
4164
- {
4165
- watch: g,
4166
- label: "Load Options from Api",
4167
- name: "apiUrl",
4168
- errors: x,
4169
- register: m,
4170
- className: "!w-full",
4171
- placeholder: "https://example.com/options",
4172
- isFloating: !0
4173
- }
4174
- ),
4175
- t && /* @__PURE__ */ n.jsx("div", { className: "absolute w-4 h-4 mt-1 border-2 border-blue-500 rounded-full border-t-transparent animate-spin right-3 top-1/2" })
4176
- ] }),
4161
+ const ii = () => {
4162
+ var D, _;
4163
+ return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col justify-start gap-y-1", children: [
4164
+ /* @__PURE__ */ n.jsx("div", { className: "flex items-center mb-4 gap-x-5", children: J == null ? void 0 : J.map((V) => /* @__PURE__ */ n.jsxs("label", { className: "items-center text-base capitalize gap-x-3", children: [
4177
4165
  /* @__PURE__ */ n.jsx(
4178
- "button",
4166
+ "input",
4179
4167
  {
4180
- onClick: ti,
4181
- className: "px-3 py-1 text-xs text-white bg-gray-600 rounded",
4182
- type: "button",
4183
- children: "Load"
4168
+ type: "radio",
4169
+ name: "optionType",
4170
+ onChange: (F) => r(F.target.value),
4171
+ value: V
4184
4172
  }
4185
- )
4186
- ] }),
4187
- /* @__PURE__ */ n.jsx(cs, {})
4188
- ] }),
4189
- c === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4190
- ge,
4191
- {
4192
- type: o.type,
4193
- label: "Load options form sheet (csv, xlsx)",
4194
- setValue: y,
4195
- name: "options"
4196
- }
4197
- ) }),
4198
- /* @__PURE__ */ n.jsxs("div", { children: [
4199
- /* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500", children: "Parent Options " }),
4200
- N == null ? void 0 : N.map((P, I) => /* @__PURE__ */ n.jsxs(
4201
- "div",
4202
- {
4203
- className: "flex items-center mb-1 gap-x-4 last:mb-0",
4204
- children: [
4205
- /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4173
+ ),
4174
+ " ",
4175
+ /* @__PURE__ */ n.jsxs("span", { children: [
4176
+ V,
4177
+ " options"
4178
+ ] })
4179
+ ] }, V)) }),
4180
+ c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4181
+ /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4182
+ /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
4183
+ /* @__PURE__ */ n.jsx(
4206
4184
  z,
4207
4185
  {
4208
4186
  watch: g,
4209
- label: I === 0 ? "Label" : "",
4210
- name: `options.${I}.label`,
4211
- register: m,
4187
+ label: "Load Options from Api",
4188
+ name: "apiUrl",
4212
4189
  errors: x,
4213
- element: o,
4214
- placeholder: "Label",
4215
- onChange: (U) => {
4216
- const F = U.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4217
- y(`options.${I}.value`, F, {
4218
- shouldValidate: !0,
4219
- shouldDirty: !0
4220
- });
4221
- }
4222
- }
4223
- ) }),
4224
- /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4225
- z,
4226
- {
4227
- watch: g,
4228
- label: I === 0 ? "Value" : "",
4229
- name: `options.${I}.value`,
4230
4190
  register: m,
4231
- errors: x,
4232
- element: o,
4233
- placeholder: "Value"
4191
+ className: "!w-full",
4192
+ placeholder: "https://example.com/options",
4193
+ isFloating: !0
4234
4194
  }
4235
- ) }),
4236
- /* @__PURE__ */ n.jsx(
4237
- "button",
4238
- {
4239
- disabled: N.length === 1,
4240
- type: "button",
4241
- className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4242
- onClick: () => ni(I),
4243
- children: /* @__PURE__ */ n.jsx(Y, { icon: "iconamoon:sign-times-fill" })
4244
- }
4245
- )
4246
- ]
4247
- },
4248
- P.id
4249
- )),
4250
- " ",
4251
- /* @__PURE__ */ n.jsxs("div", { children: [
4252
- " ",
4253
- /* @__PURE__ */ n.jsxs(
4254
- "button",
4255
- {
4256
- type: "button",
4257
- className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4258
- onClick: () => E({ label: "", value: "", id: Ai() }),
4259
- children: [
4260
- /* @__PURE__ */ n.jsx(Y, { icon: "qlementine-icons:plus-16" }),
4261
- " Add Option"
4262
- ]
4263
- }
4264
- )
4265
- ] })
4266
- ] }),
4267
- o.type.toLowerCase() === "cascadeselect" && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
4268
- /* @__PURE__ */ n.jsx("hr", { className: "my-5" }),
4195
+ ),
4196
+ t && /* @__PURE__ */ n.jsx("div", { className: "absolute w-4 h-4 mt-1 border-2 border-blue-500 rounded-full border-t-transparent animate-spin right-3 top-1/2" })
4197
+ ] }),
4198
+ /* @__PURE__ */ n.jsx(
4199
+ "button",
4200
+ {
4201
+ onClick: ri,
4202
+ className: "px-3 py-1 text-xs text-white bg-gray-600 rounded",
4203
+ type: "button",
4204
+ children: "Load"
4205
+ }
4206
+ )
4207
+ ] }),
4208
+ /* @__PURE__ */ n.jsx(cs, {})
4209
+ ] }),
4210
+ c === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4211
+ ge,
4212
+ {
4213
+ type: o.type,
4214
+ label: "Load options form sheet (csv, xlsx)",
4215
+ setValue: y,
4216
+ name: "options"
4217
+ }
4218
+ ) }),
4269
4219
  /* @__PURE__ */ n.jsxs("div", { children: [
4270
- " ",
4271
- /* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500", children: "Child Options " }),
4272
- J == null ? void 0 : J.map((P, I) => /* @__PURE__ */ n.jsxs(
4220
+ /* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500 font-semibold", children: ((D = o == null ? void 0 : o.type) == null ? void 0 : D.toLowerCase()) === "matrix" ? "Rows Options" : "Parent Options" }),
4221
+ N == null ? void 0 : N.map((V, F) => /* @__PURE__ */ n.jsxs(
4273
4222
  "div",
4274
4223
  {
4275
4224
  className: "flex items-center mb-1 gap-x-4 last:mb-0",
@@ -4278,16 +4227,15 @@ const gs = w.object().shape({
4278
4227
  z,
4279
4228
  {
4280
4229
  watch: g,
4281
- label: "Label",
4282
- name: `options1.${I}.label`,
4230
+ label: F === 0 ? "Label" : "",
4231
+ name: `options.${F}.label`,
4283
4232
  register: m,
4284
4233
  errors: x,
4285
4234
  element: o,
4286
4235
  placeholder: "Label",
4287
- isFloating: !0,
4288
- onChange: (U) => {
4289
- const F = U.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4290
- y(`options1.${I}.value`, F, {
4236
+ onChange: (W) => {
4237
+ const ti = W.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4238
+ y(`options.${F}.value`, ti, {
4291
4239
  shouldValidate: !0,
4292
4240
  shouldDirty: !0
4293
4241
  });
@@ -4298,42 +4246,29 @@ const gs = w.object().shape({
4298
4246
  z,
4299
4247
  {
4300
4248
  watch: g,
4301
- label: "Value",
4302
- name: `options1.${I}.value`,
4303
- register: m,
4304
- errors: x,
4305
- element: o,
4306
- placeholder: "Value",
4307
- isFloating: !0
4308
- }
4309
- ) }),
4310
- /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4311
- z,
4312
- {
4313
- watch: g,
4314
- label: "Key",
4315
- name: `options1.${I}.key`,
4249
+ label: F === 0 ? "Value" : "",
4250
+ name: `options.${F}.value`,
4316
4251
  register: m,
4317
4252
  errors: x,
4318
4253
  element: o,
4319
- placeholder: "Key",
4320
- isFloating: !0
4254
+ placeholder: "Value"
4321
4255
  }
4322
4256
  ) }),
4323
4257
  /* @__PURE__ */ n.jsx(
4324
4258
  "button",
4325
4259
  {
4326
- disabled: J.length === 1,
4260
+ disabled: N.length === 1,
4327
4261
  type: "button",
4328
4262
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4329
- onClick: () => L(I),
4330
- children: /* @__PURE__ */ n.jsx(Y, { icon: "iconamoon:sign-times-fill" })
4263
+ onClick: () => ei(F),
4264
+ children: /* @__PURE__ */ n.jsx(q, { icon: "iconamoon:sign-times-fill" })
4331
4265
  }
4332
4266
  )
4333
4267
  ]
4334
4268
  },
4335
- P.id
4269
+ V.id
4336
4270
  )),
4271
+ " ",
4337
4272
  /* @__PURE__ */ n.jsxs("div", { children: [
4338
4273
  " ",
4339
4274
  /* @__PURE__ */ n.jsxs(
@@ -4341,34 +4276,118 @@ const gs = w.object().shape({
4341
4276
  {
4342
4277
  type: "button",
4343
4278
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4344
- onClick: () => $({ label: "", value: "", key: "", id: Ai() }),
4279
+ onClick: () => E({ label: "", value: "", id: Si() }),
4345
4280
  children: [
4346
- /* @__PURE__ */ n.jsx(Y, { icon: "qlementine-icons:plus-16" }),
4281
+ /* @__PURE__ */ n.jsx(q, { icon: "qlementine-icons:plus-16" }),
4347
4282
  " Add Option"
4348
4283
  ]
4349
4284
  }
4350
4285
  )
4351
4286
  ] })
4287
+ ] }),
4288
+ ["cascadeselect", "matrix"].includes(o.type.toLowerCase()) && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
4289
+ /* @__PURE__ */ n.jsx("hr", { className: "my-5" }),
4290
+ /* @__PURE__ */ n.jsxs("div", { children: [
4291
+ " ",
4292
+ /* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500 font-semibold", children: ((_ = o == null ? void 0 : o.type) == null ? void 0 : _.toLowerCase()) === "matrix" ? "Columns Options" : "Child Options" }),
4293
+ Y == null ? void 0 : Y.map((V, F) => /* @__PURE__ */ n.jsxs(
4294
+ "div",
4295
+ {
4296
+ className: "flex items-center mb-1 gap-x-4 last:mb-0",
4297
+ children: [
4298
+ /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4299
+ z,
4300
+ {
4301
+ watch: g,
4302
+ label: F === 0 ? "Label" : "",
4303
+ name: `options1.${F}.label`,
4304
+ register: m,
4305
+ errors: x,
4306
+ element: o,
4307
+ placeholder: "Label",
4308
+ onChange: (W) => {
4309
+ const ti = W.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4310
+ y(`options1.${F}.value`, ti, {
4311
+ shouldValidate: !0,
4312
+ shouldDirty: !0
4313
+ });
4314
+ }
4315
+ }
4316
+ ) }),
4317
+ /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4318
+ z,
4319
+ {
4320
+ watch: g,
4321
+ label: F === 0 ? "Value" : "",
4322
+ name: `options1.${F}.value`,
4323
+ register: m,
4324
+ errors: x,
4325
+ element: o,
4326
+ placeholder: "Value"
4327
+ }
4328
+ ) }),
4329
+ /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4330
+ z,
4331
+ {
4332
+ watch: g,
4333
+ label: F === 0 ? "Key" : "",
4334
+ name: `options1.${F}.key`,
4335
+ register: m,
4336
+ errors: x,
4337
+ element: o,
4338
+ placeholder: "Key"
4339
+ }
4340
+ ) }),
4341
+ /* @__PURE__ */ n.jsx(
4342
+ "button",
4343
+ {
4344
+ disabled: Y.length === 1,
4345
+ type: "button",
4346
+ className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4347
+ onClick: () => L(F),
4348
+ children: /* @__PURE__ */ n.jsx(q, { icon: "iconamoon:sign-times-fill" })
4349
+ }
4350
+ )
4351
+ ]
4352
+ },
4353
+ V.id
4354
+ )),
4355
+ /* @__PURE__ */ n.jsxs("div", { children: [
4356
+ " ",
4357
+ /* @__PURE__ */ n.jsxs(
4358
+ "button",
4359
+ {
4360
+ type: "button",
4361
+ className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4362
+ onClick: () => Q({ label: "", value: "", key: "", id: Si() }),
4363
+ children: [
4364
+ /* @__PURE__ */ n.jsx(q, { icon: "qlementine-icons:plus-16" }),
4365
+ " Add Option"
4366
+ ]
4367
+ }
4368
+ )
4369
+ ] })
4370
+ ] })
4352
4371
  ] })
4353
- ] })
4354
- ] }), di = () => /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col justify-start gap-y-1", children: [
4355
- /* @__PURE__ */ n.jsx("div", { className: "flex items-center mb-4 gap-x-5", children: _ == null ? void 0 : _.map((P) => /* @__PURE__ */ n.jsxs("label", { className: "items-center text-base capitalize gap-x-3", children: [
4372
+ ] });
4373
+ }, di = () => /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col justify-start gap-y-1", children: [
4374
+ /* @__PURE__ */ n.jsx("div", { className: "flex items-center mb-4 gap-x-5", children: J == null ? void 0 : J.map((D) => /* @__PURE__ */ n.jsxs("label", { className: "items-center text-base capitalize gap-x-3", children: [
4356
4375
  /* @__PURE__ */ n.jsx(
4357
4376
  "input",
4358
4377
  {
4359
4378
  type: "radio",
4360
4379
  name: "optionType",
4361
- onChange: (I) => r(I.target.value),
4362
- value: P,
4363
- checked: P === c
4380
+ onChange: (_) => r(_.target.value),
4381
+ value: D,
4382
+ checked: D === c
4364
4383
  }
4365
4384
  ),
4366
4385
  " ",
4367
4386
  /* @__PURE__ */ n.jsxs("span", { children: [
4368
- P,
4387
+ D,
4369
4388
  " options"
4370
4389
  ] })
4371
- ] }, P)) }),
4390
+ ] }, D)) }),
4372
4391
  c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4373
4392
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4374
4393
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
@@ -4390,7 +4409,7 @@ const gs = w.object().shape({
4390
4409
  /* @__PURE__ */ n.jsx(
4391
4410
  "button",
4392
4411
  {
4393
- onClick: ti,
4412
+ onClick: ri,
4394
4413
  className: "px-3 py-1 text-xs text-white bg-gray-600 rounded",
4395
4414
  type: "button",
4396
4415
  children: "Load"
@@ -4408,11 +4427,11 @@ const gs = w.object().shape({
4408
4427
  name: "dataColumns"
4409
4428
  }
4410
4429
  ) }),
4411
- /* @__PURE__ */ n.jsx("div", { className: "grid gap-y-3", children: W == null ? void 0 : W.map((P, I) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-4 ", children: [
4430
+ /* @__PURE__ */ n.jsx("div", { className: "grid gap-y-3", children: U == null ? void 0 : U.map((D, _) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-4 ", children: [
4412
4431
  /* @__PURE__ */ n.jsx("div", { className: "min-w-[140px]", children: /* @__PURE__ */ n.jsx(
4413
4432
  Di,
4414
4433
  {
4415
- label: I === 0 ? "Type" : "",
4434
+ label: _ === 0 ? "Type" : "",
4416
4435
  options: [
4417
4436
  {
4418
4437
  label: "Text",
@@ -4428,22 +4447,22 @@ const gs = w.object().shape({
4428
4447
  }
4429
4448
  ],
4430
4449
  register: m,
4431
- name: `dataColumns.${I}.type`,
4450
+ name: `dataColumns.${_}.type`,
4432
4451
  setValue: y,
4433
4452
  trigger: p,
4434
- value: A.dataColumns[I].type
4453
+ value: A.dataColumns[_].type
4435
4454
  }
4436
4455
  ) }),
4437
4456
  /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4438
4457
  z,
4439
4458
  {
4440
4459
  watch: g,
4441
- label: I === 0 ? "Display header" : "",
4442
- name: `dataColumns.${I}.headerName`,
4460
+ label: _ === 0 ? "Display header" : "",
4461
+ name: `dataColumns.${_}.headerName`,
4443
4462
  register: m,
4444
- onChange: (U) => {
4445
- const F = U.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4446
- y(`dataColumns.${I}.field`, F, {
4463
+ onChange: (V) => {
4464
+ const W = V.target.value.toLowerCase().trim().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
4465
+ y(`dataColumns.${_}.field`, W, {
4447
4466
  shouldValidate: !0,
4448
4467
  shouldDirty: !0
4449
4468
  });
@@ -4456,14 +4475,14 @@ const gs = w.object().shape({
4456
4475
  /* @__PURE__ */ n.jsx(
4457
4476
  "button",
4458
4477
  {
4459
- disabled: W.length === 1,
4478
+ disabled: U.length === 1,
4460
4479
  type: "button",
4461
4480
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4462
- onClick: () => G(I),
4463
- children: /* @__PURE__ */ n.jsx(Y, { icon: "iconamoon:sign-times-fill" })
4481
+ onClick: () => K(_),
4482
+ children: /* @__PURE__ */ n.jsx(q, { icon: "iconamoon:sign-times-fill" })
4464
4483
  }
4465
4484
  )
4466
- ] }, P.id)) }),
4485
+ ] }, D.id)) }),
4467
4486
  /* @__PURE__ */ n.jsxs("div", { children: [
4468
4487
  " ",
4469
4488
  /* @__PURE__ */ n.jsxs(
@@ -4471,40 +4490,40 @@ const gs = w.object().shape({
4471
4490
  {
4472
4491
  type: "button",
4473
4492
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4474
- onClick: () => O({
4493
+ onClick: () => I({
4475
4494
  headerName: "",
4476
4495
  field: "",
4477
4496
  editable: !0,
4478
- id: Ai(),
4497
+ id: Si(),
4479
4498
  type: "text",
4480
4499
  validate: !1
4481
4500
  }),
4482
4501
  children: [
4483
- /* @__PURE__ */ n.jsx(Y, { icon: "qlementine-icons:plus-16" }),
4502
+ /* @__PURE__ */ n.jsx(q, { icon: "qlementine-icons:plus-16" }),
4484
4503
  " Add column"
4485
4504
  ]
4486
4505
  }
4487
4506
  )
4488
4507
  ] })
4489
- ] }), pi = Q(async () => {
4490
- const P = gi("token"), { status: I, data: U } = await Ii.get(A.url, {
4508
+ ] }), pi = X(async () => {
4509
+ const D = gi("token"), { status: _, data: V } = await Ii.get(A.url, {
4491
4510
  headers: {
4492
- Authorization: `Bearer ${P}`
4511
+ Authorization: `Bearer ${D}`
4493
4512
  }
4494
4513
  });
4495
- I === 200 && y("options", (U == null ? void 0 : U.data) || U);
4514
+ _ === 200 && y("options", (V == null ? void 0 : V.data) || V);
4496
4515
  }, [y, A.url]);
4497
- K(() => {
4516
+ O(() => {
4498
4517
  o.type === "document" && A.url && pi();
4499
4518
  }, [A.url, o.type, pi]);
4500
- const bi = /* @__PURE__ */ n.jsx(
4519
+ const vi = /* @__PURE__ */ n.jsx(
4501
4520
  "div",
4502
4521
  {
4503
4522
  className: "fixed inset-0 bg-gray-800/40 backdrop-blur-sm flex items-center justify-end z-[999] cursor-default",
4504
- onMouseDown: (P) => P.stopPropagation(),
4505
- onPointerDown: (P) => P.stopPropagation(),
4506
- onDragStart: (P) => {
4507
- P.preventDefault(), P.stopPropagation();
4523
+ onMouseDown: (D) => D.stopPropagation(),
4524
+ onPointerDown: (D) => D.stopPropagation(),
4525
+ onDragStart: (D) => {
4526
+ D.preventDefault(), D.stopPropagation();
4508
4527
  },
4509
4528
  children: /* @__PURE__ */ n.jsxs("div", { className: "w-full lg:w-2/3 xl:w-2/5 bg-white h-screen shadow-xl relative flex flex-col items-center", children: [
4510
4529
  /* @__PURE__ */ n.jsx(
@@ -4512,7 +4531,7 @@ const gs = w.object().shape({
4512
4531
  {
4513
4532
  className: "bg-white h-10 w-10 flex justify-center items-center absolute top-1 -left-12 rounded-lg hover:bg-gray-50",
4514
4533
  onClick: e,
4515
- children: /* @__PURE__ */ n.jsx(Y, { icon: "tabler:x", iconClass: "text-xl" })
4534
+ children: /* @__PURE__ */ n.jsx(q, { icon: "tabler:x", iconClass: "text-xl" })
4516
4535
  }
4517
4536
  ),
4518
4537
  /* @__PURE__ */ n.jsx("div", { className: "w-full pt-4", children: /* @__PURE__ */ n.jsx(
@@ -4528,7 +4547,7 @@ const gs = w.object().shape({
4528
4547
  /* @__PURE__ */ n.jsxs(
4529
4548
  "form",
4530
4549
  {
4531
- onSubmit: h(H),
4550
+ onSubmit: h(G),
4532
4551
  className: "w-full flex-1 flex flex-col",
4533
4552
  children: [
4534
4553
  /* @__PURE__ */ n.jsxs("div", { className: "flex-1", children: [
@@ -4652,8 +4671,8 @@ const gs = w.object().shape({
4652
4671
  ls.includes(o.inputType) && /* @__PURE__ */ n.jsx(
4653
4672
  us,
4654
4673
  {
4655
- onChange: (P) => {
4656
- y("denominators", P);
4674
+ onChange: (D) => {
4675
+ y("denominators", D);
4657
4676
  },
4658
4677
  value: g("denominators")
4659
4678
  }
@@ -4847,7 +4866,7 @@ const gs = w.object().shape({
4847
4866
  }
4848
4867
  )
4849
4868
  ] }),
4850
- as.includes(o.inputType) && X(),
4869
+ as.includes(o.inputType) && ii(),
4851
4870
  /* @__PURE__ */ n.jsxs("div", { children: [
4852
4871
  /* @__PURE__ */ n.jsx("div", { className: "w-[150px] mb-4", children: /* @__PURE__ */ n.jsx(
4853
4872
  z,
@@ -5041,16 +5060,16 @@ const gs = w.object().shape({
5041
5060
  ] })
5042
5061
  }
5043
5062
  );
5044
- return document.body ? Ao(bi, document.body) : bi;
5063
+ return document.body ? Ao(vi, document.body) : vi;
5045
5064
  }, Kn = an(
5046
5065
  ({ state: i, element: e, children: o }) => {
5047
- const [s, a] = D(!1), { removeElement: l, duplicateElement: d } = mi.useContext(fi), t = ai(
5066
+ const [s, a] = R(!1), { removeElement: l, duplicateElement: d } = bi.useContext(fi), t = si(
5048
5067
  () => {
5049
5068
  var c;
5050
5069
  return (c = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : c.map((r) => r.label).join(", ");
5051
5070
  },
5052
5071
  [e]
5053
- ), u = Q(() => {
5072
+ ), u = X(() => {
5054
5073
  l(e.id, e.sectionId);
5055
5074
  }, [e.id, e.sectionId, l]);
5056
5075
  return /* @__PURE__ */ n.jsxs("div", { className: "w-full min-w-0", children: [
@@ -5083,7 +5102,7 @@ const gs = w.object().shape({
5083
5102
  className: "text-sm outline-none hover:opacity-80 py-1 text-gray-600",
5084
5103
  onClick: () => d(e == null ? void 0 : e.id, e.sectionId),
5085
5104
  title: "Duplicate",
5086
- children: /* @__PURE__ */ n.jsx(Y, { icon: "tabler:copy", iconClass: "text-base" })
5105
+ children: /* @__PURE__ */ n.jsx(q, { icon: "tabler:copy", iconClass: "text-base" })
5087
5106
  }
5088
5107
  ),
5089
5108
  /* @__PURE__ */ n.jsx(
@@ -5093,7 +5112,7 @@ const gs = w.object().shape({
5093
5112
  className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
5094
5113
  onClick: () => a(!0),
5095
5114
  title: "Edit",
5096
- children: /* @__PURE__ */ n.jsx(Y, { icon: "circum:edit", iconClass: "text-base" })
5115
+ children: /* @__PURE__ */ n.jsx(q, { icon: "circum:edit", iconClass: "text-base" })
5097
5116
  }
5098
5117
  ),
5099
5118
  /* @__PURE__ */ n.jsx(
@@ -5103,7 +5122,7 @@ const gs = w.object().shape({
5103
5122
  className: "text-sm outline-none hover:opacity-80 text-gray-600 py-1",
5104
5123
  onClick: u,
5105
5124
  title: "Remove",
5106
- children: /* @__PURE__ */ n.jsx(Y, { icon: "iconamoon:trash", iconClass: "text-base" })
5125
+ children: /* @__PURE__ */ n.jsx(q, { icon: "iconamoon:trash", iconClass: "text-base" })
5107
5126
  }
5108
5127
  )
5109
5128
  ] })
@@ -5148,7 +5167,7 @@ function As(i) {
5148
5167
  return e.test(i) || o.test(i);
5149
5168
  }
5150
5169
  const Ss = ({ imageUrl: i }) => {
5151
- const [e, o] = D(!1), s = () => {
5170
+ const [e, o] = R(!1), s = () => {
5152
5171
  o(!0);
5153
5172
  }, a = () => {
5154
5173
  o(!1);
@@ -5239,40 +5258,40 @@ function Ns({
5239
5258
  validationData: e
5240
5259
  }) {
5241
5260
  var A;
5242
- const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = D(), [t, u] = D(!1), [c, r] = D(!1), [v, m] = D(""), h = a && a(i == null ? void 0 : i.id);
5243
- K(() => {
5261
+ const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = R(), [t, u] = R(!1), [c, r] = R(!1), [v, m] = R(""), h = a && a(i == null ? void 0 : i.id);
5262
+ O(() => {
5244
5263
  d(h);
5245
5264
  }, [h]);
5246
- const [f, y] = D("");
5247
- K(() => {
5265
+ const [f, y] = R("");
5266
+ O(() => {
5248
5267
  o(i.id);
5249
5268
  }, [i.id, o]);
5250
5269
  const { url: g, method: p, responseType: x } = i || {}, S = {
5251
5270
  headers: {
5252
5271
  Authorization: `Bearer ${gi("token")}`
5253
5272
  }
5254
- }, j = Q(
5273
+ }, j = X(
5255
5274
  async (N) => {
5256
- var E, ni, J, $, L, W, O, G, H, R, M;
5275
+ var E, ei, Y, Q, L, U, I, K, G, P, M;
5257
5276
  if (!(!g || !p)) {
5258
5277
  u(!0);
5259
5278
  try {
5260
5279
  let B;
5261
5280
  if (p.toLowerCase() === "get") {
5262
- const _ = `${g}?value=${N}`;
5263
- B = await Ii.get(_, S);
5281
+ const J = `${g}?value=${N}`;
5282
+ B = await Ii.get(J, S);
5264
5283
  } else if (p.toLowerCase() === "post")
5265
5284
  B = await Ii.post(g, { value: N }, S);
5266
5285
  else
5267
5286
  throw new Error("Unsupported HTTP method");
5268
- B.status === 200 && ((((ni = (E = B == null ? void 0 : B.data) == null ? void 0 : E.data) == null ? void 0 : ni.status) || ((J = B == null ? void 0 : B.data) == null ? void 0 : J.status)) === !0 ? (r(!0), x === "string" ? m(
5269
- ((L = ($ = B == null ? void 0 : B.data) == null ? void 0 : $.data) == null ? void 0 : L.description) || ((W = B == null ? void 0 : B.data) == null ? void 0 : W.description) || "Validation successful"
5287
+ B.status === 200 && ((((ei = (E = B == null ? void 0 : B.data) == null ? void 0 : E.data) == null ? void 0 : ei.status) || ((Y = B == null ? void 0 : B.data) == null ? void 0 : Y.status)) === !0 ? (r(!0), x === "string" ? m(
5288
+ ((L = (Q = B == null ? void 0 : B.data) == null ? void 0 : Q.data) == null ? void 0 : L.description) || ((U = B == null ? void 0 : B.data) == null ? void 0 : U.description) || "Validation successful"
5270
5289
  ) : y(
5271
- ((G = (O = B == null ? void 0 : B.data) == null ? void 0 : O.data) == null ? void 0 : G.description) || ((H = B == null ? void 0 : B.data) == null ? void 0 : H.description) || {}
5290
+ ((K = (I = B == null ? void 0 : B.data) == null ? void 0 : I.data) == null ? void 0 : K.description) || ((G = B == null ? void 0 : B.data) == null ? void 0 : G.description) || {}
5272
5291
  )) : (console.error("Invalid input:", N), m("Unable to validate input"), r(!1)));
5273
5292
  } catch (B) {
5274
5293
  console.error("Error validating input:", B), m(
5275
- ((M = (R = B == null ? void 0 : B.response) == null ? void 0 : R.data) == null ? void 0 : M.message) || "Unable to validate input"
5294
+ ((M = (P = B == null ? void 0 : B.response) == null ? void 0 : P.data) == null ? void 0 : M.message) || "Unable to validate input"
5276
5295
  ), r(!1);
5277
5296
  } finally {
5278
5297
  u(!1);
@@ -5281,7 +5300,7 @@ function Ns({
5281
5300
  },
5282
5301
  [p, x, g]
5283
5302
  );
5284
- return K(() => {
5303
+ return O(() => {
5285
5304
  if (l) {
5286
5305
  const N = setTimeout(() => {
5287
5306
  j(l);
@@ -5337,7 +5356,7 @@ function Ns({
5337
5356
  }
5338
5357
  )
5339
5358
  ] }),
5340
- c && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(Y, { icon: "gg:check-o" }) })
5359
+ c && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(q, { icon: "gg:check-o" }) })
5341
5360
  ] })
5342
5361
  ] }),
5343
5362
  v && x === "string" && /* @__PURE__ */ n.jsx(
@@ -5362,7 +5381,7 @@ function js({
5362
5381
  defaultValue: o,
5363
5382
  denominators: s
5364
5383
  }) {
5365
- const [a, l] = D([...o]);
5384
+ const [a, l] = R([...o]);
5366
5385
  function d(c, r) {
5367
5386
  l((v) => {
5368
5387
  const m = [...v];
@@ -5375,16 +5394,16 @@ function js({
5375
5394
  function t(c, r) {
5376
5395
  return parseFloat(c) * parseFloat(r) || 0;
5377
5396
  }
5378
- const u = ai(
5397
+ const u = si(
5379
5398
  () => a.reduce((c, r) => {
5380
5399
  const v = t(r.key, r.value);
5381
5400
  return c + v;
5382
5401
  }, 0),
5383
5402
  [a]
5384
5403
  );
5385
- return K(() => {
5404
+ return O(() => {
5386
5405
  i && i(a);
5387
- }, [a]), K(() => {
5406
+ }, [a]), O(() => {
5388
5407
  if (s != null && s.length) {
5389
5408
  const c = s == null ? void 0 : s.map((r, v) => ({
5390
5409
  key: r.value,
@@ -5435,7 +5454,7 @@ function ks({
5435
5454
  validationData: e
5436
5455
  }) {
5437
5456
  const { register: o = () => ({}), setValue: s, getValues: a } = e || {}, l = a && a(i == null ? void 0 : i.id) || [];
5438
- return K(() => {
5457
+ return O(() => {
5439
5458
  o(i.id);
5440
5459
  }, [i.id, o]), /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(
5441
5460
  js,
@@ -5564,7 +5583,7 @@ function Bs({
5564
5583
  onClick: () => l(i.id),
5565
5584
  className: "text-red-500 hover:text-red-700",
5566
5585
  "aria-label": "Delete row",
5567
- children: /* @__PURE__ */ n.jsx(Y, { icon: "lets-icons:trash-duotone", iconClass: "text-xl" })
5586
+ children: /* @__PURE__ */ n.jsx(q, { icon: "lets-icons:trash-duotone", iconClass: "text-xl" })
5568
5587
  }
5569
5588
  ) })
5570
5589
  ] });
@@ -5576,13 +5595,13 @@ function Ls({
5576
5595
  isReadOnly: o = !1,
5577
5596
  columns: s
5578
5597
  }) {
5579
- const [a, l] = D(i), d = gi("config");
5580
- K(() => {
5598
+ const [a, l] = R(i), d = gi("config");
5599
+ O(() => {
5581
5600
  l((v) => JSON.stringify(v) !== JSON.stringify(i) ? i : v);
5582
- }, [i]), K(() => {
5601
+ }, [i]), O(() => {
5583
5602
  e == null || e(a);
5584
5603
  }, [a, e]);
5585
- const t = Q(
5604
+ const t = X(
5586
5605
  (v, m, h) => {
5587
5606
  l(
5588
5607
  (f) => f.map(
@@ -5591,12 +5610,12 @@ function Ls({
5591
5610
  );
5592
5611
  },
5593
5612
  []
5594
- ), u = Q(() => {
5595
- const v = Ai(), m = s.reduce((h, f) => (h[f.field] = f.field === "id" ? v : "", h), {});
5613
+ ), u = X(() => {
5614
+ const v = Si(), m = s.reduce((h, f) => (h[f.field] = f.field === "id" ? v : "", h), {});
5596
5615
  l((h) => [...h, { id: v, ...m }]);
5597
- }, [s]), c = Q((v) => {
5616
+ }, [s]), c = X((v) => {
5598
5617
  l((m) => m.filter((h) => h.id !== v));
5599
- }, []), r = Q(
5618
+ }, []), r = X(
5600
5619
  (v, m) => ({
5601
5620
  isValidating: !1,
5602
5621
  result: void 0
@@ -5665,10 +5684,10 @@ function Ps({
5665
5684
  watch: a,
5666
5685
  isReadOnly: l
5667
5686
  } = e || {}, d = a && a(i == null ? void 0 : i.id) || {}, t = Array.isArray(d) ? d : (r = d == null ? void 0 : d.rows) != null ? r : [];
5668
- K(() => {
5687
+ O(() => {
5669
5688
  o(i.id);
5670
5689
  }, [i.id, o]);
5671
- const u = Ci(""), c = Q(
5690
+ const u = Mi(""), c = X(
5672
5691
  (v) => {
5673
5692
  const m = JSON.stringify(v);
5674
5693
  m !== u.current && (u.current = m, s == null || s(i.id, {
@@ -5706,14 +5725,14 @@ const xe = ({
5706
5725
  loading: f,
5707
5726
  disabled: y
5708
5727
  }) => {
5709
- const [g, p] = D(r ? [] : null), x = Z("custom-select__control", i), C = ai(() => e, [e]);
5710
- return K(() => {
5728
+ const [g, p] = R(r ? [] : null), x = Z("custom-select__control", i), C = si(() => e, [e]);
5729
+ return O(() => {
5711
5730
  const S = e == null ? void 0 : e.find((j) => {
5712
5731
  var A;
5713
5732
  return typeof j.value == "string" && typeof u == "string" ? j.value.toLowerCase() === u.toLowerCase() : typeof j.value == "object" && typeof u == "object" ? ((A = j.value) == null ? void 0 : A.id) === (u == null ? void 0 : u.id) : j.value === u;
5714
5733
  });
5715
5734
  p(S || null);
5716
- }, [u, e]), K(() => {
5735
+ }, [u, e]), O(() => {
5717
5736
  g && l && a && (l(d, g == null ? void 0 : g.value), a(d), c == null || c(d));
5718
5737
  }, [d, g]), /* @__PURE__ */ n.jsxs("div", { className: "custom-select", children: [
5719
5738
  t && !v && /* @__PURE__ */ n.jsx("label", { className: "custom-select__label", children: t }),
@@ -5728,12 +5747,12 @@ const xe = ({
5728
5747
  children: /* @__PURE__ */ n.jsxs("div", { className: "custom-select__wrapper", children: [
5729
5748
  /* @__PURE__ */ n.jsxs(ui.Button, { className: x, disabled: y, children: [
5730
5749
  f ? /* @__PURE__ */ n.jsx("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (g == null ? void 0 : g.label) || /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o }) }),
5731
- /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(Y, { icon: "lucide:chevron-down" }) })
5750
+ /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(q, { icon: "lucide:chevron-down" }) })
5732
5751
  ] }),
5733
5752
  /* @__PURE__ */ n.jsx(
5734
5753
  Ei,
5735
5754
  {
5736
- as: mi.Fragment,
5755
+ as: bi.Fragment,
5737
5756
  leave: "custom-select__transition",
5738
5757
  children: /* @__PURE__ */ n.jsx(ui.Options, { className: "custom-select__options", anchor: "bottom", children: C == null ? void 0 : C.map((S, j) => /* @__PURE__ */ n.jsx(
5739
5758
  ui.Option,
@@ -5775,13 +5794,13 @@ const xe = ({
5775
5794
  setValue: a,
5776
5795
  watch: l,
5777
5796
  isReadOnly: d
5778
- } = e || {}, t = (y = i == null ? void 0 : i.id) != null ? y : "cascadeValue", [u, c] = D(""), [r, v] = D(""), m = (g, p) => {
5797
+ } = e || {}, t = (y = i == null ? void 0 : i.id) != null ? y : "cascadeValue", [u, c] = R(""), [r, v] = R(""), m = (g, p) => {
5779
5798
  const x = g && p ? `${g}_${p}` : "";
5780
5799
  a == null || a(t, x), s == null || s(t);
5781
5800
  }, h = (g, p) => {
5782
5801
  g === "first" ? (c(p), v(""), m(p, "")) : (v(p), m(u, p));
5783
5802
  };
5784
- K(() => {
5803
+ O(() => {
5785
5804
  if (l) {
5786
5805
  const g = l(t);
5787
5806
  if (g != null && g.includes("_")) {
@@ -5790,7 +5809,7 @@ const xe = ({
5790
5809
  }
5791
5810
  }
5792
5811
  }, [l, t]);
5793
- const f = ai(
5812
+ const f = si(
5794
5813
  () => {
5795
5814
  var g;
5796
5815
  return (g = i.options1) == null ? void 0 : g.filter((p) => p.key === u);
@@ -5840,8 +5859,8 @@ const xe = ({
5840
5859
  setValue: r,
5841
5860
  watch: v,
5842
5861
  isReadOnly: m
5843
- } = t || {}, h = (p = v == null ? void 0 : v(d.id)) != null ? p : 0, [f, y] = D(null);
5844
- K(() => {
5862
+ } = t || {}, h = (p = v == null ? void 0 : v(d.id)) != null ? p : 0, [f, y] = R(null);
5863
+ O(() => {
5845
5864
  h == null && (r == null || r(d.id, i));
5846
5865
  }, []);
5847
5866
  const g = (x) => {
@@ -5870,6 +5889,45 @@ const xe = ({
5870
5889
  })
5871
5890
  ] });
5872
5891
  };
5892
+ function Is({
5893
+ element: i,
5894
+ validationData: e
5895
+ }) {
5896
+ const { register: o = () => ({}) } = e || {}, s = (i == null ? void 0 : i.options) || [], a = (i == null ? void 0 : i.options1) || [];
5897
+ return /* @__PURE__ */ n.jsx("div", { className: Z("w-full overflow-x-auto", i.customClass), children: /* @__PURE__ */ n.jsxs("table", { className: "w-full text-left border-collapse min-w-[600px] mb-2", children: [
5898
+ /* @__PURE__ */ n.jsx("thead", { children: /* @__PURE__ */ n.jsxs("tr", { children: [
5899
+ /* @__PURE__ */ n.jsx("th", { className: "p-3 border-b bg-gray-50/50" }),
5900
+ a.map((l) => /* @__PURE__ */ n.jsx(
5901
+ "th",
5902
+ {
5903
+ className: "p-3 font-medium text-center border-b text-xs text-gray-700 w-[12%]",
5904
+ children: l.label
5905
+ },
5906
+ l.id || l.value
5907
+ ))
5908
+ ] }) }),
5909
+ /* @__PURE__ */ n.jsx("tbody", { children: s.map((l) => /* @__PURE__ */ n.jsxs(
5910
+ "tr",
5911
+ {
5912
+ className: "border-b last:border-0 hover:bg-gray-50/30",
5913
+ children: [
5914
+ /* @__PURE__ */ n.jsx("td", { className: "p-3 text-gray-700 min-w-[150px] text-sm", children: l.label }),
5915
+ a.map((d) => /* @__PURE__ */ n.jsx("td", { className: "p-3 text-center align-middle", children: /* @__PURE__ */ n.jsx(
5916
+ "input",
5917
+ {
5918
+ type: "radio",
5919
+ value: d.value,
5920
+ disabled: i.isDisabled || (e == null ? void 0 : e.isReadOnly),
5921
+ className: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 cursor-pointer disabled:opacity-50",
5922
+ ...o(`${i.id}.${l.value}`)
5923
+ }
5924
+ ) }, d.id || d.value))
5925
+ ]
5926
+ },
5927
+ l.id || l.value
5928
+ )) })
5929
+ ] }) });
5930
+ }
5873
5931
  function ye({
5874
5932
  element: i,
5875
5933
  validationData: e
@@ -5880,14 +5938,14 @@ function ye({
5880
5938
  trigger: a,
5881
5939
  isReadOnly: l,
5882
5940
  watch: d
5883
- } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: c } = ai(() => {
5941
+ } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: c } = si(() => {
5884
5942
  var f;
5885
5943
  if (typeof t == "string" && t.includes(",")) {
5886
5944
  const [y, g] = (f = t.split(",")) == null ? void 0 : f.map((p) => p.trim());
5887
5945
  return { country: g, state: y };
5888
5946
  }
5889
5947
  return { country: t, state: "" };
5890
- }, [t]), r = Ci(t), v = ai(() => {
5948
+ }, [t]), r = Mi(t), v = si(() => {
5891
5949
  var f, y;
5892
5950
  return u ? ((y = (f = Xi.find((g) => g.name === u)) == null ? void 0 : f.states) == null ? void 0 : y.map((g) => ({
5893
5951
  label: g.name,
@@ -5900,7 +5958,7 @@ function ye({
5900
5958
  const g = (y == null ? void 0 : y.value) || "", p = g ? `${g}, ${u}` : u;
5901
5959
  s && p !== r.current && (s(i.id, p), a == null || a(i.id), r.current = p);
5902
5960
  };
5903
- return K(() => {
5961
+ return O(() => {
5904
5962
  r.current = t;
5905
5963
  }, [t]), /* @__PURE__ */ n.jsxs("div", { className: "grid gap-y-6", children: [
5906
5964
  /* @__PURE__ */ n.jsx("input", { type: "hidden", ...o(i.id) }),
@@ -5931,11 +5989,11 @@ function ye({
5931
5989
  ] })
5932
5990
  ] });
5933
5991
  }
5934
- function Is({
5992
+ function Os({
5935
5993
  element: i,
5936
5994
  validationData: e
5937
5995
  }) {
5938
- const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = ai(() => gi("config"), []), [u, c] = D(!1), [r, v] = D(!1), m = Q(async () => {
5996
+ const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = si(() => gi("config"), []), [u, c] = R(!1), [r, v] = R(!1), m = X(async () => {
5939
5997
  var h, f;
5940
5998
  if (!(!a || !l))
5941
5999
  try {
@@ -5955,7 +6013,7 @@ function Is({
5955
6013
  v(!1);
5956
6014
  }
5957
6015
  }, [a, l]);
5958
- return K(() => {
6016
+ return O(() => {
5959
6017
  let h = null;
5960
6018
  return !u && l && a && (async () => {
5961
6019
  await m() || (h = setInterval(async () => {
@@ -5988,7 +6046,7 @@ function Is({
5988
6046
  ),
5989
6047
  children: [
5990
6048
  /* @__PURE__ */ n.jsx(
5991
- Y,
6049
+ q,
5992
6050
  {
5993
6051
  icon: r ? "solar:refresh-outline" : u ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
5994
6052
  iconClass: r ? "animate-spin" : ""
@@ -6246,7 +6304,7 @@ const fn = [
6246
6304
  { code: "MH", label: "Marshall Islands", phone: "692", min: 7, max: 7 },
6247
6305
  { code: "PW", label: "Palau", phone: "680", min: 7, max: 7 }
6248
6306
  ];
6249
- function Os({
6307
+ function Ks({
6250
6308
  label: i,
6251
6309
  placeholder: e,
6252
6310
  classLabel: o,
@@ -6263,38 +6321,38 @@ function Os({
6263
6321
  onChange: h,
6264
6322
  onError: f
6265
6323
  }) {
6266
- const [y, g] = D(""), [p, x] = D(null), [C, S] = D(""), j = ai(
6324
+ const [y, g] = R(""), [p, x] = R(null), [C, S] = R(""), j = si(
6267
6325
  () => {
6268
6326
  var L;
6269
- return (L = fn == null ? void 0 : fn.slice().sort((W, O) => W.label.localeCompare(O.label))) == null ? void 0 : L.map((W) => ({ ...W, phone: `+${W.phone}` }));
6327
+ return (L = fn == null ? void 0 : fn.slice().sort((U, I) => U.label.localeCompare(I.label))) == null ? void 0 : L.map((U) => ({ ...U, phone: `+${U.phone}` }));
6270
6328
  },
6271
6329
  []
6272
- ), A = ai(() => y ? j.filter(
6330
+ ), A = si(() => y ? j.filter(
6273
6331
  (L) => `${L.label} ${L.phone}`.toLowerCase().includes(y.toLowerCase())
6274
- ) : j, [y, j]), N = (p == null ? void 0 : p.min) || 10, E = (p == null ? void 0 : p.max) || 10, ni = () => C ? `${(p == null ? void 0 : p.phone) || "+234"}-${C}` : "", J = (L) => {
6332
+ ) : j, [y, j]), N = (p == null ? void 0 : p.min) || 10, E = (p == null ? void 0 : p.max) || 10, ei = () => C ? `${(p == null ? void 0 : p.phone) || "+234"}-${C}` : "", Y = (L) => {
6275
6333
  if (!L) return { code: "+234", number: "" };
6276
- const W = L.split(/[-\s]/);
6277
- return { code: W[0], number: W.slice(1).join(" ") };
6334
+ const U = L.split(/[-\s]/);
6335
+ return { code: U[0], number: U.slice(1).join(" ") };
6278
6336
  };
6279
- K(() => {
6337
+ O(() => {
6280
6338
  if (d) {
6281
- const L = J(d);
6339
+ const L = Y(d);
6282
6340
  x(
6283
- j.find((W) => W.phone === L.code) || j[0]
6341
+ j.find((U) => U.phone === L.code) || j[0]
6284
6342
  ), S(L.number);
6285
6343
  }
6286
6344
  }, [d, j]);
6287
- const $ = ai(() => {
6345
+ const Q = si(() => {
6288
6346
  if (t) return t;
6289
6347
  const L = C.length;
6290
6348
  return s && L === 0 ? "Phone number is required" : L > 0 && !/^\d+$/.test(C) ? "Phone number must contain only digits" : L > 0 && L < N ? `Minimum length is ${N}` : L > E ? `Maximum length is ${E}` : "";
6291
6349
  }, [t, C, N, E, s]);
6292
- return K(() => {
6293
- h == null || h(ni()), f == null || f($ || null);
6294
- }, [C, p, $]), /* @__PURE__ */ n.jsxs(
6350
+ return O(() => {
6351
+ h == null || h(ei()), f == null || f(Q || null);
6352
+ }, [C, p, Q]), /* @__PURE__ */ n.jsxs(
6295
6353
  "div",
6296
6354
  {
6297
- className: `relative formGroup ${$ && !c ? "has-error" : ""} ${r ? "flex" : ""} ${!$ && C.length > 0 && !c ? "is-valid" : ""}`,
6355
+ className: `relative formGroup ${Q && !c ? "has-error" : ""} ${r ? "flex" : ""} ${!Q && C.length > 0 && !c ? "is-valid" : ""}`,
6298
6356
  children: [
6299
6357
  i && /* @__PURE__ */ n.jsxs(
6300
6358
  "label",
@@ -6310,7 +6368,7 @@ function Os({
6310
6368
  }
6311
6369
  ),
6312
6370
  /* @__PURE__ */ n.jsxs("div", { className: "relative !flex items-center input-control text-[#667085] !py-0 field-control", children: [
6313
- /* @__PURE__ */ n.jsx(Y, { icon: "lucide:phone-call" }),
6371
+ /* @__PURE__ */ n.jsx(q, { icon: "lucide:phone-call" }),
6314
6372
  /* @__PURE__ */ n.jsx(Ri, { value: p, onChange: x, children: /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
6315
6373
  /* @__PURE__ */ n.jsx(
6316
6374
  Ri.Input,
@@ -6321,8 +6379,8 @@ function Os({
6321
6379
  onChange: (L) => g(L.target.value)
6322
6380
  }
6323
6381
  ),
6324
- /* @__PURE__ */ n.jsx(Ri.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ n.jsx(Y, { icon: "lucide:chevron-down" }) }),
6325
- /* @__PURE__ */ n.jsx(Ri.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: A == null ? void 0 : A.map((L, W) => /* @__PURE__ */ n.jsxs(
6382
+ /* @__PURE__ */ n.jsx(Ri.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ n.jsx(q, { icon: "lucide:chevron-down" }) }),
6383
+ /* @__PURE__ */ n.jsx(Ri.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: A == null ? void 0 : A.map((L, U) => /* @__PURE__ */ n.jsxs(
6326
6384
  Ri.Option,
6327
6385
  {
6328
6386
  value: L,
@@ -6333,7 +6391,7 @@ function Os({
6333
6391
  L.label
6334
6392
  ]
6335
6393
  },
6336
- `${L.code}+ ${W}`
6394
+ `${L.code}+ ${U}`
6337
6395
  )) })
6338
6396
  ] }) }),
6339
6397
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center flex-1 z-[1]", children: [
@@ -6346,8 +6404,8 @@ function Os({
6346
6404
  disabled: u,
6347
6405
  readOnly: c,
6348
6406
  onChange: (L) => {
6349
- const W = L.target.value.replace(/\D/g, "");
6350
- S(W);
6407
+ const U = L.target.value.replace(/\D/g, "");
6408
+ S(U);
6351
6409
  },
6352
6410
  placeholder: e,
6353
6411
  className: "w-full px-3 outline-none",
@@ -6355,7 +6413,7 @@ function Os({
6355
6413
  minLength: N
6356
6414
  }
6357
6415
  ),
6358
- /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !$ && C.length > 0 && !c && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(Y, { icon: "bi:check-lg" }) }) })
6416
+ /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Q && C.length > 0 && !c && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(q, { icon: "bi:check-lg" }) }) })
6359
6417
  ] })
6360
6418
  ] }),
6361
6419
  v && /* @__PURE__ */ n.jsx("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: v })
@@ -6363,7 +6421,7 @@ function Os({
6363
6421
  }
6364
6422
  );
6365
6423
  }
6366
- function Ks({
6424
+ function Gs({
6367
6425
  element: i,
6368
6426
  validationData: e
6369
6427
  }) {
@@ -6376,10 +6434,10 @@ function Ks({
6376
6434
  clearErrors: t
6377
6435
  } = e || {};
6378
6436
  let u;
6379
- return K(() => {
6437
+ return O(() => {
6380
6438
  o(i.id);
6381
6439
  }, [i.id, o]), a && (u = a()[i.id]), /* @__PURE__ */ n.jsx(
6382
- Os,
6440
+ Ks,
6383
6441
  {
6384
6442
  placeholder: i.placeholder,
6385
6443
  label: "",
@@ -6396,7 +6454,7 @@ function Ks({
6396
6454
  }
6397
6455
  );
6398
6456
  }
6399
- function Gs({
6457
+ function Hs({
6400
6458
  element: i,
6401
6459
  validationData: e
6402
6460
  }) {
@@ -6467,14 +6525,15 @@ const We = {
6467
6525
  divider: Ms,
6468
6526
  header: Ts,
6469
6527
  basicText: ws,
6470
- phoneField: Ks,
6528
+ phoneField: Gs,
6471
6529
  cascadeSelect: Rs,
6472
6530
  rating: Ds,
6531
+ matrix: Is,
6473
6532
  country: ye,
6474
6533
  bank: ye,
6475
- document: Is,
6476
- url: Gs
6477
- }, Ae = "edit", Hs = (i, e) => {
6534
+ document: Os,
6535
+ url: Hs
6536
+ }, Ae = "edit", Vs = (i, e) => {
6478
6537
  const o = We[i.type];
6479
6538
  return o ? /* @__PURE__ */ n.jsx(Kn, { element: i, state: Ae, children: /* @__PURE__ */ n.jsxs("div", { className: "relative w-full", children: [
6480
6539
  i.type.toLowerCase() !== "grid" && /* @__PURE__ */ n.jsx("div", { className: "absolute top-0 left-0 z-20 w-full h-full" }),
@@ -6494,7 +6553,7 @@ const We = {
6494
6553
  style: { gridColumn: i },
6495
6554
  children: e
6496
6555
  }
6497
- ), Vs = ({
6556
+ ), Fs = ({
6498
6557
  element: i,
6499
6558
  sectionId: e,
6500
6559
  children: o,
@@ -6509,33 +6568,33 @@ const We = {
6509
6568
  moveElement: c,
6510
6569
  isDragging: r,
6511
6570
  removeElement: v
6512
- } = ji(fi), m = ai(
6571
+ } = ji(fi), m = si(
6513
6572
  () => Array.from({ length: i.columns }),
6514
6573
  [i.columns]
6515
- ), [h, f] = D(null);
6516
- K(() => {
6574
+ ), [h, f] = R(null);
6575
+ O(() => {
6517
6576
  const S = () => {
6518
6577
  f(null), u(!1);
6519
6578
  };
6520
6579
  return document.addEventListener("dragend", S), () => document.removeEventListener("dragend", S);
6521
6580
  }, [u]);
6522
- const y = Q(
6581
+ const y = X(
6523
6582
  (S, j) => {
6524
6583
  S.preventDefault(), S.stopPropagation(), S.dataTransfer.dropEffect = "move", f(j);
6525
6584
  },
6526
6585
  []
6527
- ), g = Q(
6586
+ ), g = X(
6528
6587
  (S, j) => {
6529
6588
  S.preventDefault(), S.stopPropagation(), f(j);
6530
6589
  },
6531
6590
  []
6532
- ), p = Q(
6591
+ ), p = X(
6533
6592
  (S, j) => {
6534
6593
  const A = S.relatedTarget;
6535
6594
  A && S.currentTarget.contains(A) || f((N) => N === j ? null : N);
6536
6595
  },
6537
6596
  []
6538
- ), x = Q(
6597
+ ), x = X(
6539
6598
  (S, j) => {
6540
6599
  var E;
6541
6600
  S.preventDefault(), S.stopPropagation(), u(!1), f(null);
@@ -6550,44 +6609,44 @@ const We = {
6550
6609
  return;
6551
6610
  }
6552
6611
  try {
6553
- const ni = S.dataTransfer.getData("properties");
6554
- if (!ni) return;
6555
- const J = JSON.parse(ni);
6556
- if ((J == null ? void 0 : J.type) === "grid") return;
6557
- const $ = d.find((O) => O.id === e), L = (E = $ == null ? void 0 : $.questionData) == null ? void 0 : E.find(
6558
- (O) => {
6559
- var G;
6560
- return O.gridId === i.id && ((G = O.gridPosition) == null ? void 0 : G.col) === A;
6612
+ const ei = S.dataTransfer.getData("properties");
6613
+ if (!ei) return;
6614
+ const Y = JSON.parse(ei);
6615
+ if ((Y == null ? void 0 : Y.type) === "grid") return;
6616
+ const Q = d.find((I) => I.id === e), L = (E = Q == null ? void 0 : Q.questionData) == null ? void 0 : E.find(
6617
+ (I) => {
6618
+ var K;
6619
+ return I.gridId === i.id && ((K = I.gridPosition) == null ? void 0 : K.col) === A;
6561
6620
  }
6562
6621
  );
6563
6622
  L && v(L.id, e);
6564
- const W = {
6565
- ...J,
6566
- id: Ai(),
6623
+ const U = {
6624
+ ...Y,
6625
+ id: Si(),
6567
6626
  sectionId: e,
6568
6627
  gridId: i.id,
6569
6628
  gridPosition: { col: A }
6570
6629
  };
6571
- t(W, e);
6572
- } catch (ni) {
6573
- console.error("Drop failed in grid:", ni), u(!1);
6630
+ t(U, e);
6631
+ } catch (ei) {
6632
+ console.error("Drop failed in grid:", ei), u(!1);
6574
6633
  }
6575
6634
  },
6576
6635
  [t, i.id, d, e, u, c]
6577
6636
  ), C = (S, j, A) => {
6578
- var G, H, R;
6579
- const N = S + 1, E = (H = (G = d.find((M) => M.id === e)) == null ? void 0 : G.questionData) == null ? void 0 : H.find(
6637
+ var K, G, P;
6638
+ const N = S + 1, E = (G = (K = d.find((M) => M.id === e)) == null ? void 0 : K.questionData) == null ? void 0 : G.find(
6580
6639
  (M) => {
6581
6640
  var B;
6582
6641
  return M.gridId === i.id && ((B = M.gridPosition) == null ? void 0 : B.col) === N;
6583
6642
  }
6584
- ), ni = (R = E == null ? void 0 : E.id) != null ? R : null, J = Array.isArray(o) && o.find((M) => {
6643
+ ), ei = (P = E == null ? void 0 : E.id) != null ? P : null, Y = Array.isArray(o) && o.find((M) => {
6585
6644
  var B;
6586
6645
  return ((B = M == null ? void 0 : M.props) == null ? void 0 : B.col) === N;
6587
- }), $ = r && h === S, L = !!J, W = r && !!l, O = L && ni && A === "edit" ? {
6646
+ }), Q = r && h === S, L = !!Y, U = r && !!l, I = L && ei && A === "edit" ? {
6588
6647
  draggable: !0,
6589
6648
  onDragStart: (M) => {
6590
- M.stopPropagation(), M.dataTransfer.setData("elementId", ni), M.dataTransfer.setData("properties", ni), M.dataTransfer.effectAllowed = "move", u(!0);
6649
+ M.stopPropagation(), M.dataTransfer.setData("elementId", ei), M.dataTransfer.setData("properties", ei), M.dataTransfer.effectAllowed = "move", u(!0);
6591
6650
  },
6592
6651
  onDragEnd: () => {
6593
6652
  f(null), u(!1);
@@ -6597,7 +6656,7 @@ const We = {
6597
6656
  "div",
6598
6657
  {
6599
6658
  id: `grid-cell-${i.id}-${S}`,
6600
- ...O,
6659
+ ...I,
6601
6660
  onDrop: (M) => x(M, S),
6602
6661
  onDragEnter: (M) => g(M, S),
6603
6662
  onDragOver: (M) => y(M, S),
@@ -6609,27 +6668,27 @@ const We = {
6609
6668
  A === "edit" ? "py-3 " : "",
6610
6669
  L && A === "edit" && "cursor-grab active:cursor-grabbing border-none",
6611
6670
  j,
6612
- !W && !$ && "bg-white border-gray-200 text-gray-300",
6613
- W && !$ && !L && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
6614
- W && !$ && L && "bg-white border-orange-200 border-dashed",
6615
- $ && !L && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
6616
- $ && L && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
6671
+ !U && !Q && "bg-white border-gray-200 text-gray-300",
6672
+ U && !Q && !L && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
6673
+ U && !Q && L && "bg-white border-orange-200 border-dashed",
6674
+ Q && !L && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
6675
+ Q && L && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
6617
6676
  ),
6618
6677
  children: [
6619
- L && A === "edit" && /* @__PURE__ */ n.jsx("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__ */ n.jsx(Y, { icon: "ph:dots-six-bold" }) }),
6620
- $ && !L && /* @__PURE__ */ n.jsxs("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: [
6621
- /* @__PURE__ */ n.jsx(Y, { icon: "ph:plus-bold" }),
6678
+ L && A === "edit" && /* @__PURE__ */ n.jsx("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__ */ n.jsx(q, { icon: "ph:dots-six-bold" }) }),
6679
+ Q && !L && /* @__PURE__ */ n.jsxs("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: [
6680
+ /* @__PURE__ */ n.jsx(q, { icon: "ph:plus-bold" }),
6622
6681
  "Drop here"
6623
6682
  ] }),
6624
- $ && L && /* @__PURE__ */ n.jsx("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" }),
6683
+ Q && L && /* @__PURE__ */ n.jsx("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" }),
6625
6684
  /* @__PURE__ */ n.jsx(
6626
6685
  "div",
6627
6686
  {
6628
6687
  className: Z(
6629
6688
  "w-full select-none min-w-0",
6630
- $ && "opacity-50 pointer-events-none"
6689
+ Q && "opacity-50 pointer-events-none"
6631
6690
  ),
6632
- children: J || /* @__PURE__ */ n.jsx("span", { className: "flex items-center justify-center text-gray-300", children: A === "edit" && /* @__PURE__ */ n.jsx(Y, { icon: "ph:plus-bold" }) })
6691
+ children: Y || /* @__PURE__ */ n.jsx("span", { className: "flex items-center justify-center text-gray-300", children: A === "edit" && /* @__PURE__ */ n.jsx(q, { icon: "ph:plus-bold" }) })
6633
6692
  }
6634
6693
  )
6635
6694
  ]
@@ -6648,14 +6707,14 @@ const We = {
6648
6707
  )
6649
6708
  }
6650
6709
  ) });
6651
- }, Hn = mi.memo(Vs), Fs = "edit";
6710
+ }, Hn = bi.memo(Fs), Ws = "edit";
6652
6711
  function xn({
6653
6712
  index: i,
6654
6713
  onDrop: e,
6655
6714
  onDragEnd: o,
6656
6715
  isDragging: s
6657
6716
  }) {
6658
- const [a, l] = D(!1), d = a ? 52 : s ? 28 : 4;
6717
+ const [a, l] = R(!1), d = a ? 52 : s ? 28 : 4;
6659
6718
  return /* @__PURE__ */ n.jsx(
6660
6719
  "div",
6661
6720
  {
@@ -6679,37 +6738,37 @@ function xn({
6679
6738
  a ? "bg-blue-50 border-2 border-blue-300 border-dashed" : s ? "border-2 border-blue-200 border-dashed" : "border-2 border-transparent"
6680
6739
  ),
6681
6740
  children: a && /* @__PURE__ */ n.jsxs("span", { className: "flex items-center gap-1 text-blue-500 text-xs font-medium select-none pointer-events-none", children: [
6682
- /* @__PURE__ */ n.jsx(Y, { icon: "octicon:plus-16" }),
6741
+ /* @__PURE__ */ n.jsx(q, { icon: "octicon:plus-16" }),
6683
6742
  "Drop here"
6684
6743
  ] })
6685
6744
  }
6686
6745
  );
6687
6746
  }
6688
- function Ws({ elementData: i, sectionId: e }) {
6747
+ function Us({ elementData: i, sectionId: e }) {
6689
6748
  const {
6690
6749
  formData: o,
6691
6750
  isDragging: s,
6692
6751
  setIsDragging: a,
6693
6752
  addElementInPosition: l,
6694
6753
  moveElement: d
6695
- } = ji(fi), [t, u] = D(null), c = ai(
6754
+ } = ji(fi), [t, u] = R(null), c = si(
6696
6755
  () => {
6697
6756
  var p;
6698
6757
  return ((p = o.find((x) => x.id === e)) == null ? void 0 : p.questionData) || [];
6699
6758
  },
6700
6759
  [o, e]
6701
- ), r = Q(
6760
+ ), r = X(
6702
6761
  (p, x) => {
6703
6762
  p.dataTransfer.setData("elementId", x), p.dataTransfer.setData("properties", x), p.dataTransfer.effectAllowed = "move", u(x), a(!0);
6704
6763
  },
6705
6764
  [a]
6706
- ), v = Q(() => {
6765
+ ), v = X(() => {
6707
6766
  u(null), a(!1);
6708
6767
  }, [a]);
6709
- K(() => {
6768
+ O(() => {
6710
6769
  !s && t && u(null);
6711
6770
  }, [s, t]);
6712
- const m = Q(
6771
+ const m = X(
6713
6772
  (p) => {
6714
6773
  p.preventDefault(), p.stopPropagation();
6715
6774
  const x = p.dataTransfer.getData("elementId"), C = p.currentTarget.id;
@@ -6723,7 +6782,7 @@ function Ws({ elementData: i, sectionId: e }) {
6723
6782
  S != null && S.gridId && j !== -1 ? d({ draggedId: x, sectionId: e, targetIndex: j }) : d({ draggedId: x, sectionId: e, targetId: C }), u(null), a(!1);
6724
6783
  },
6725
6784
  [e, d, a, v, c]
6726
- ), h = Q(
6785
+ ), h = X(
6727
6786
  (p, x) => {
6728
6787
  p.preventDefault(), p.stopPropagation(), a(!1);
6729
6788
  const C = p.dataTransfer.getData("elementId");
@@ -6734,14 +6793,14 @@ function Ws({ elementData: i, sectionId: e }) {
6734
6793
  try {
6735
6794
  const S = JSON.parse(p.dataTransfer.getData("properties"));
6736
6795
  if ((S == null ? void 0 : S.type) === "section") return;
6737
- const j = { ...S, id: Ai(), sectionId: e };
6796
+ const j = { ...S, id: Si(), sectionId: e };
6738
6797
  l(j, e, x), u(null);
6739
6798
  } catch (S) {
6740
6799
  console.error("Drop error:", S);
6741
6800
  }
6742
6801
  },
6743
6802
  [l, e, a, d]
6744
- ), f = Q(
6803
+ ), f = X(
6745
6804
  (p, x = !1) => /* @__PURE__ */ n.jsx(
6746
6805
  "div",
6747
6806
  {
@@ -6758,12 +6817,12 @@ function Ws({ elementData: i, sectionId: e }) {
6758
6817
  "transition-all duration-200 ease-in-out",
6759
6818
  t === p.id ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-300 shadow-inner" : t ? "bg-white border-dashed border-blue-200 shadow-sm" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
6760
6819
  ),
6761
- children: Hs(p, e)
6820
+ children: Vs(p, e)
6762
6821
  },
6763
6822
  p.id
6764
6823
  ),
6765
6824
  [t, m, e, r, v]
6766
- ), y = ai(() => (i == null ? void 0 : i.reduce((p, x) => (x.gridId && (p[x.gridId] = p[x.gridId] || [], p[x.gridId].push(x)), p), {})) || {}, [i]);
6825
+ ), y = si(() => (i == null ? void 0 : i.reduce((p, x) => (x.gridId && (p[x.gridId] = p[x.gridId] || [], p[x.gridId].push(x)), p), {})) || {}, [i]);
6767
6826
  if (!(i != null && i.length))
6768
6827
  return /* @__PURE__ */ n.jsx(
6769
6828
  "div",
@@ -6812,7 +6871,7 @@ function Ws({ elementData: i, sectionId: e }) {
6812
6871
  {
6813
6872
  element: p,
6814
6873
  sectionId: e,
6815
- state: Fs,
6874
+ state: Ws,
6816
6875
  draggedElementId: t,
6817
6876
  children: C == null ? void 0 : C.map(
6818
6877
  (A) => {
@@ -6850,23 +6909,23 @@ function Ws({ elementData: i, sectionId: e }) {
6850
6909
  })
6851
6910
  ] });
6852
6911
  }
6853
- const Us = an(Ws), zs = w.object({
6912
+ const zs = an(Us), _s = w.object({
6854
6913
  title: w.string(),
6855
6914
  description: w.string(),
6856
6915
  disabled: w.boolean().default(!1),
6857
6916
  isHidden: w.boolean().default(!1)
6858
- }).required(), yn = gi("config"), _s = ({ isOpen: i, onClose: e, section: o }) => {
6859
- const { updateSection: s } = mi.useContext(fi), {
6917
+ }).required(), yn = gi("config"), Js = ({ isOpen: i, onClose: e, section: o }) => {
6918
+ const { updateSection: s } = bi.useContext(fi), {
6860
6919
  register: a,
6861
6920
  handleSubmit: l,
6862
6921
  watch: d,
6863
6922
  formState: { errors: t, isSubmitting: u, isValid: c },
6864
6923
  reset: r
6865
6924
  } = En({
6866
- resolver: On(zs),
6925
+ resolver: On(_s),
6867
6926
  defaultValues: o
6868
6927
  });
6869
- if (mi.useEffect(() => {
6928
+ if (bi.useEffect(() => {
6870
6929
  i || r();
6871
6930
  }, [i, r]), !i) return null;
6872
6931
  const v = (h) => {
@@ -6880,7 +6939,7 @@ const Us = an(Ws), zs = w.object({
6880
6939
  {
6881
6940
  onClick: e,
6882
6941
  className: "absolute right-4 top-4 p-2 text-[#98A2B3] hover:bg-gray-50 rounded-lg",
6883
- children: /* @__PURE__ */ n.jsx(Y, { icon: "tabler:x" })
6942
+ children: /* @__PURE__ */ n.jsx(q, { icon: "tabler:x" })
6884
6943
  }
6885
6944
  )
6886
6945
  ] }),
@@ -6957,7 +7016,7 @@ const Us = an(Ws), zs = w.object({
6957
7016
  ] })
6958
7017
  ] })
6959
7018
  ] }) });
6960
- }, Js = ({
7019
+ }, Ys = ({
6961
7020
  section: i,
6962
7021
  index: e,
6963
7022
  selectedSection: o,
@@ -6971,8 +7030,8 @@ const Us = an(Ws), zs = w.object({
6971
7030
  setIsDragging: r
6972
7031
  }) => {
6973
7032
  var h, f;
6974
- const v = Ci(null), m = Ci((h = i.questionData) == null ? void 0 : h.length);
6975
- return K(() => {
7033
+ const v = Mi(null), m = Mi((h = i.questionData) == null ? void 0 : h.length);
7034
+ return O(() => {
6976
7035
  var y;
6977
7036
  i.questionData.length > m.current && v.current && requestAnimationFrame(() => {
6978
7037
  var g;
@@ -7008,7 +7067,7 @@ const Us = an(Ws), zs = w.object({
7008
7067
  type: "button",
7009
7068
  className: "p-1 text-xs border rounded-lg",
7010
7069
  onClick: () => d(i),
7011
- children: /* @__PURE__ */ n.jsx(Y, { icon: "fluent:edit-28-regular" })
7070
+ children: /* @__PURE__ */ n.jsx(q, { icon: "fluent:edit-28-regular" })
7012
7071
  }
7013
7072
  ),
7014
7073
  u > 1 && /* @__PURE__ */ n.jsx(
@@ -7017,7 +7076,7 @@ const Us = an(Ws), zs = w.object({
7017
7076
  type: "button",
7018
7077
  className: "p-1 text-xs border rounded-lg",
7019
7078
  onClick: () => t(i.id),
7020
- children: /* @__PURE__ */ n.jsx(Y, { icon: "lets-icons:trash-duotone-line" })
7079
+ children: /* @__PURE__ */ n.jsx(q, { icon: "lets-icons:trash-duotone-line" })
7021
7080
  }
7022
7081
  ),
7023
7082
  /* @__PURE__ */ n.jsx(
@@ -7027,7 +7086,7 @@ const Us = an(Ws), zs = w.object({
7027
7086
  className: "p-1 text-xs rounded-lg",
7028
7087
  onClick: () => l(e),
7029
7088
  children: /* @__PURE__ */ n.jsx(
7030
- Y,
7089
+ q,
7031
7090
  {
7032
7091
  icon: a.includes(e) ? "fa6-solid:chevron-up" : "fa6-solid:chevron-down",
7033
7092
  iconClass: "text-base"
@@ -7049,7 +7108,7 @@ const Us = an(Ws), zs = w.object({
7049
7108
  children: [
7050
7109
  /* @__PURE__ */ n.jsx("hr", { className: "group-last:hidden" }),
7051
7110
  /* @__PURE__ */ n.jsx("div", { className: "h-full mt-4 gap-y-6 ", children: /* @__PURE__ */ n.jsx(
7052
- Us,
7111
+ zs,
7053
7112
  {
7054
7113
  elementData: i.questionData,
7055
7114
  sectionId: i.id
@@ -7064,8 +7123,8 @@ const Us = an(Ws), zs = w.object({
7064
7123
  },
7065
7124
  i.id
7066
7125
  );
7067
- }, Ys = () => {
7068
- const [i, e] = D(!1), o = Ci(null), s = Ci(null), {
7126
+ }, qs = () => {
7127
+ const [i, e] = R(!1), o = Mi(null), s = Mi(null), {
7069
7128
  removeSection: a,
7070
7129
  // addElement,
7071
7130
  addSection: l,
@@ -7075,11 +7134,11 @@ const Us = an(Ws), zs = w.object({
7075
7134
  selectedSection: c,
7076
7135
  activeSections: r,
7077
7136
  setActiveSections: v
7078
- } = ji(fi), m = Ci((d == null ? void 0 : d.length) || 0);
7079
- K(() => {
7137
+ } = ji(fi), m = Mi((d == null ? void 0 : d.length) || 0);
7138
+ O(() => {
7080
7139
  var p;
7081
7140
  u(((p = d[0]) == null ? void 0 : p.id) || null);
7082
- }, []), K(() => {
7141
+ }, []), O(() => {
7083
7142
  (d == null ? void 0 : d.length) > m.current && s.current && requestAnimationFrame(() => {
7084
7143
  var p;
7085
7144
  (p = s.current) == null || p.scrollTo({
@@ -7088,7 +7147,7 @@ const Us = an(Ws), zs = w.object({
7088
7147
  });
7089
7148
  }), m.current = (d == null ? void 0 : d.length) || 0;
7090
7149
  }, [d == null ? void 0 : d.length]);
7091
- const h = Q((p) => {
7150
+ const h = X((p) => {
7092
7151
  p.preventDefault(), p.dataTransfer.dropEffect = "move", s.current && (s.current.scrollTop = s.current.scrollHeight);
7093
7152
  }, []);
7094
7153
  function f(p) {
@@ -7107,7 +7166,7 @@ const Us = an(Ws), zs = w.object({
7107
7166
  className: "relative flex flex-col h-full pb-5 mx-auto gap-x-4 ",
7108
7167
  children: [
7109
7168
  i && /* @__PURE__ */ n.jsx(
7110
- _s,
7169
+ Js,
7111
7170
  {
7112
7171
  isOpen: i,
7113
7172
  onClose: () => e(!1),
@@ -7122,7 +7181,7 @@ const Us = an(Ws), zs = w.object({
7122
7181
  children: [
7123
7182
  d == null ? void 0 : d.map(
7124
7183
  (p, x) => /* @__PURE__ */ n.jsx(
7125
- Js,
7184
+ Ys,
7126
7185
  {
7127
7186
  section: p,
7128
7187
  index: x,
@@ -7158,7 +7217,7 @@ const Us = an(Ws), zs = w.object({
7158
7217
  ]
7159
7218
  }
7160
7219
  );
7161
- }, qs = () => {
7220
+ }, Zs = () => {
7162
7221
  const { formData: i, uploadUrl: e } = ji(
7163
7222
  fi
7164
7223
  ), o = gi("config");
@@ -7174,17 +7233,17 @@ const Us = an(Ws), zs = w.object({
7174
7233
  }
7175
7234
  );
7176
7235
  };
7177
- function Zs({
7236
+ function $s({
7178
7237
  questionData: i,
7179
7238
  uploadUrl: e
7180
7239
  }) {
7181
7240
  const { setFormData: o, addSection: s, setUploadUrl: a, showPreview: l } = ji(fi);
7182
- K(() => {
7241
+ O(() => {
7183
7242
  i && i.length > 0 && o(i);
7184
- }, [i, o]), K(() => {
7243
+ }, [i, o]), O(() => {
7185
7244
  a(e);
7186
7245
  }, [e, a]);
7187
- const d = Q((t) => {
7246
+ const d = X((t) => {
7188
7247
  t.preventDefault();
7189
7248
  try {
7190
7249
  const u = JSON.parse(t.dataTransfer.getData("properties"));
@@ -7203,7 +7262,7 @@ function Zs({
7203
7262
  onDragOver: (t) => t.preventDefault(),
7204
7263
  onDrop: (t) => d(t),
7205
7264
  className: " h-full overflow-y-auto no-scrollbar max-h-[calc(100vh-80px)] flex-1 form_builder",
7206
- children: /* @__PURE__ */ n.jsx(Ys, {})
7265
+ children: /* @__PURE__ */ n.jsx(qs, {})
7207
7266
  }
7208
7267
  ),
7209
7268
  /* @__PURE__ */ n.jsx(
@@ -7218,7 +7277,7 @@ function Zs({
7218
7277
  leaveFrom: "opacity-100 w-2/5 translate-x-0",
7219
7278
  leaveTo: "opacity-0 w-0 translate-x-10 px-0 overflow-hidden border-transparent shadow-none",
7220
7279
  className: "shrink-0 overflow-y-auto no-scrollbar max-h-[calc(100vh-70px)] form_preview w-2/5 min-w-0",
7221
- children: /* @__PURE__ */ n.jsx("div", { className: "px-2 shadow_box min-w-0 bg-white border border-gray-100 rounded-lg container", children: /* @__PURE__ */ n.jsx(qs, {}) })
7280
+ children: /* @__PURE__ */ n.jsx("div", { className: "px-2 shadow_box min-w-0 bg-white border border-gray-100 rounded-lg container", children: /* @__PURE__ */ n.jsx(Zs, {}) })
7222
7281
  }
7223
7282
  )
7224
7283
  ] });
@@ -7230,8 +7289,8 @@ const An = [
7230
7289
  { key: "fileAndMedia", title: "File & Media" },
7231
7290
  { key: "layoutAndDisplay", title: "Layout & Display" },
7232
7291
  { key: "advancedData", title: "Advanced / Data" }
7233
- ], $s = () => {
7234
- const [i, e] = D(""), { setIsDragging: o, addElement: s, selectedSection: a } = ji(fi), l = Q(
7292
+ ], Qs = () => {
7293
+ const [i, e] = R(""), { setIsDragging: o, addElement: s, selectedSection: a } = ji(fi), l = X(
7235
7294
  (h, f) => {
7236
7295
  if (!a) {
7237
7296
  ki.error("Please select a section to add an element.");
@@ -7248,7 +7307,7 @@ const An = [
7248
7307
  }
7249
7308
  const f = {
7250
7309
  ...h,
7251
- id: Ai(),
7310
+ id: Si(),
7252
7311
  sectionId: a
7253
7312
  };
7254
7313
  s(f, a);
@@ -7296,7 +7355,7 @@ const An = [
7296
7355
  active:opacity-50 element_class`,
7297
7356
  draggable: !0,
7298
7357
  children: /* @__PURE__ */ n.jsxs("span", { className: "flex flex-col items-center justify-center w-full gap-2", children: [
7299
- /* @__PURE__ */ n.jsx("span", { style: { color: u }, children: /* @__PURE__ */ n.jsx(Y, { icon: g.icon, iconClass: "w-6 h-6" }) }),
7358
+ /* @__PURE__ */ n.jsx("span", { style: { color: u }, children: /* @__PURE__ */ n.jsx(q, { icon: g.icon, iconClass: "w-6 h-6" }) }),
7300
7359
  /* @__PURE__ */ n.jsx(
7301
7360
  "span",
7302
7361
  {
@@ -7312,7 +7371,7 @@ const An = [
7312
7371
  ] }, f);
7313
7372
  }) }) })
7314
7373
  ] });
7315
- }, Qs = an($s), Bi = ({
7374
+ }, Xs = an(Qs), Bi = ({
7316
7375
  text: i = "",
7317
7376
  isDisabled: e = !1,
7318
7377
  isLoading: o = !1,
@@ -7367,9 +7426,9 @@ const An = [
7367
7426
  ),
7368
7427
  "Submitting..."
7369
7428
  ] }) : /* @__PURE__ */ n.jsxs("span", { className: "flex items-center", children: [
7370
- a && l === "left" && /* @__PURE__ */ n.jsx("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(Y, { icon: a }) }),
7429
+ a && l === "left" && /* @__PURE__ */ n.jsx("span", { className: `mr-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(q, { icon: a }) }),
7371
7430
  i && /* @__PURE__ */ n.jsx("span", { children: i }),
7372
- a && l === "right" && /* @__PURE__ */ n.jsx("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(Y, { icon: a }) })
7431
+ a && l === "right" && /* @__PURE__ */ n.jsx("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(q, { icon: a }) })
7373
7432
  ] });
7374
7433
  return c ? /* @__PURE__ */ n.jsx("div", { className: h, children: f() }) : u ? /* @__PURE__ */ n.jsx(To, { to: u, className: h, children: f() }) : /* @__PURE__ */ n.jsx(
7375
7434
  "button",
@@ -7384,7 +7443,7 @@ const An = [
7384
7443
  }
7385
7444
  );
7386
7445
  };
7387
- function Xs() {
7446
+ function il() {
7388
7447
  return /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsxs(
7389
7448
  "svg",
7390
7449
  {
@@ -7420,7 +7479,7 @@ function Xs() {
7420
7479
  }
7421
7480
  ) });
7422
7481
  }
7423
- const il = ({
7482
+ const nl = ({
7424
7483
  isOpen: i,
7425
7484
  onClose: e
7426
7485
  }) => {
@@ -7437,7 +7496,7 @@ const il = ({
7437
7496
  onClick: e,
7438
7497
  className: "absolute text-sm top-3 right-4",
7439
7498
  "aria-label": "close",
7440
- children: /* @__PURE__ */ n.jsx(Xs, {})
7499
+ children: /* @__PURE__ */ n.jsx(il, {})
7441
7500
  }
7442
7501
  ),
7443
7502
  " ",
@@ -7452,7 +7511,7 @@ const il = ({
7452
7511
  ) })
7453
7512
  ] });
7454
7513
  };
7455
- function nl() {
7514
+ function el() {
7456
7515
  return /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsxs(
7457
7516
  "svg",
7458
7517
  {
@@ -7477,7 +7536,7 @@ function nl() {
7477
7536
  }
7478
7537
  ) });
7479
7538
  }
7480
- function el({
7539
+ function ol({
7481
7540
  title: i,
7482
7541
  goBackUrl: e,
7483
7542
  onSubmit: o,
@@ -7487,7 +7546,7 @@ function el({
7487
7546
  publishLoading: d,
7488
7547
  onTitleChange: t
7489
7548
  }) {
7490
- const { formData: u, setShowPreview: c, showPreview: r } = ji(fi), [v, m] = D(!1), [h, f] = D(!1), [y, g] = D(i || ""), p = gi("config");
7549
+ const { formData: u, setShowPreview: c, showPreview: r } = ji(fi), [v, m] = R(!1), [h, f] = R(!1), [y, g] = R(i || ""), p = gi("config");
7491
7550
  function x() {
7492
7551
  localStorage.setItem("formData", JSON.stringify(u)), o == null || o(u);
7493
7552
  }
@@ -7506,7 +7565,7 @@ function el({
7506
7565
  onClick: () => e(),
7507
7566
  style: { color: (p == null ? void 0 : p.buttonColor) || "#333" },
7508
7567
  className: "flex items-center gap-x-3",
7509
- children: /* @__PURE__ */ n.jsx(nl, {})
7568
+ children: /* @__PURE__ */ n.jsx(el, {})
7510
7569
  }
7511
7570
  ),
7512
7571
  " ",
@@ -7531,7 +7590,7 @@ function el({
7531
7590
  )
7532
7591
  ] }),
7533
7592
  v && /* @__PURE__ */ n.jsx(
7534
- il,
7593
+ nl,
7535
7594
  {
7536
7595
  isOpen: v,
7537
7596
  onClose: () => m(!1),
@@ -7584,12 +7643,12 @@ const Ue = ({ loadingClass: i }) => {
7584
7643
  "h-full w-full min-h-[300px] flex justify-center items-center",
7585
7644
  i
7586
7645
  );
7587
- return K(() => {
7646
+ return O(() => {
7588
7647
  const o = gi("config"), s = (o == null ? void 0 : o.loaderColor) || "#333";
7589
7648
  document.documentElement.style.setProperty("--loader-color", s);
7590
7649
  }, []), /* @__PURE__ */ n.jsx("div", { className: e, children: /* @__PURE__ */ n.jsx("span", { className: "loader" }) });
7591
7650
  };
7592
- function ol({
7651
+ function al({
7593
7652
  onSubmit: i,
7594
7653
  questionData: e,
7595
7654
  title: o,
@@ -7605,10 +7664,10 @@ function ol({
7605
7664
  return /* @__PURE__ */ n.jsxs(je, { children: [
7606
7665
  /* @__PURE__ */ n.jsx(Ne, { position: "top-right", richColors: !0, closeButton: !0 }),
7607
7666
  /* @__PURE__ */ n.jsx("div", { className: "w-full h-full bg-[#F8F9FC] flex flex-col", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-1 ", children: [
7608
- /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("div", { className: "w-[250px] h-screen border-r border-[#E4E7EC] bg-white ", children: /* @__PURE__ */ n.jsx(Qs, {}) }) }),
7667
+ /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("div", { className: "w-[250px] h-screen border-r border-[#E4E7EC] bg-white ", children: /* @__PURE__ */ n.jsx(Xs, {}) }) }),
7609
7668
  /* @__PURE__ */ n.jsxs("div", { className: "flex-1 h-full max-h-full z-[1] w-[calc(100%-250px)]", children: [
7610
7669
  /* @__PURE__ */ n.jsx("div", { className: " h-[70px]", children: /* @__PURE__ */ n.jsx(
7611
- el,
7670
+ ol,
7612
7671
  {
7613
7672
  title: o,
7614
7673
  goBackUrl: s,
@@ -7620,12 +7679,12 @@ function ol({
7620
7679
  onTitleChange: c
7621
7680
  }
7622
7681
  ) }),
7623
- /* @__PURE__ */ n.jsx("div", { className: "p-6 h-[calc(100vh-70px)]", children: a ? /* @__PURE__ */ n.jsx(Ue, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ n.jsx(Zs, { questionData: e, uploadUrl: r }) })
7682
+ /* @__PURE__ */ n.jsx("div", { className: "p-6 h-[calc(100vh-70px)]", children: a ? /* @__PURE__ */ n.jsx(Ue, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ n.jsx($s, { questionData: e, uploadUrl: r }) })
7624
7683
  ] })
7625
7684
  ] }) })
7626
7685
  ] });
7627
7686
  }
7628
- const Cl = ({
7687
+ const Ml = ({
7629
7688
  onSubmit: i,
7630
7689
  questionData: e,
7631
7690
  isReadOnly: o,
@@ -7641,10 +7700,10 @@ const Cl = ({
7641
7700
  publishLoading: r,
7642
7701
  onTitleChange: v,
7643
7702
  uploadUrl: m
7644
- }) => (K(() => {
7703
+ }) => (O(() => {
7645
7704
  s && Ve("config", s);
7646
7705
  }, [s]), /* @__PURE__ */ n.jsx(
7647
- ol,
7706
+ al,
7648
7707
  {
7649
7708
  onSubmit: i,
7650
7709
  onPublish: t,
@@ -7667,7 +7726,7 @@ const Cl = ({
7667
7726
  maxLength: (i) => `Maximum length is ${i}`,
7668
7727
  minAmount: (i) => `Minimum amount is ${i}`,
7669
7728
  maxAmount: (i) => `Maximum amount is ${i}`
7670
- }, al = (i) => ({
7729
+ }, sl = (i) => ({
7671
7730
  textField: w.string().nullable(),
7672
7731
  longText: w.string().nullable(),
7673
7732
  numberField: w.number().nullable().transform((o) => isNaN(o) ? null : o),
@@ -7675,12 +7734,13 @@ const Cl = ({
7675
7734
  selectField: w.string().nullable(),
7676
7735
  checkbox: w.mixed().nullable(),
7677
7736
  radio: w.mixed().nullable(),
7737
+ matrix: w.mixed().nullable(),
7678
7738
  email: w.string().nullable().test("email-format", Ti.email, (o) => !o || o.trim() === "" ? !0 : /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/.test(o)),
7679
7739
  date: w.date().typeError("Invalid date").nullable(),
7680
7740
  url: w.string().nullable().test("url-format", Ti.url, (o) => !o || o.trim() === "" ? !0 : /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(
7681
7741
  o
7682
7742
  ))
7683
- })[i] || w.mixed().nullable(), sl = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o || Ti.required) : i.required(o || Ti.required) : i, ll = (i, {
7743
+ })[i] || w.mixed().nullable(), ll = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o || Ti.required) : i.required(o || Ti.required) : i, dl = (i, {
7684
7744
  minLength: e,
7685
7745
  maxLength: o,
7686
7746
  minLengthMessage: s,
@@ -7694,7 +7754,7 @@ const Cl = ({
7694
7754
  o,
7695
7755
  a || Ti.maxLength(o)
7696
7756
  )), l;
7697
- }, dl = (i, {
7757
+ }, ul = (i, {
7698
7758
  minAmount: e,
7699
7759
  maxAmount: o,
7700
7760
  minAmountMessage: s,
@@ -7709,20 +7769,20 @@ const Cl = ({
7709
7769
  a || Ti.maxAmount(o)
7710
7770
  )), l;
7711
7771
  };
7712
- function ul(i) {
7772
+ function tl(i) {
7713
7773
  const e = {};
7714
7774
  return i.forEach(({ questionData: o }) => {
7715
7775
  o == null || o.forEach((s) => {
7716
7776
  const { id: a, type: l, isRequired: d, requiredMessage: t, isDisabled: u } = s;
7717
- let c = al(l);
7718
- c = sl(
7777
+ let c = sl(l);
7778
+ c = ll(
7719
7779
  c,
7720
7780
  u ? !1 : d,
7721
7781
  t
7722
- ), l === "textField" || l === "longText" || l === "email" || l === "url" ? c = ll(
7782
+ ), l === "textField" || l === "longText" || l === "email" || l === "url" ? c = dl(
7723
7783
  c,
7724
7784
  s
7725
- ) : (l === "numberField" || l === "amountField") && (c = dl(
7785
+ ) : (l === "numberField" || l === "amountField") && (c = ul(
7726
7786
  c,
7727
7787
  s
7728
7788
  )), e[a] = c;
@@ -7730,16 +7790,16 @@ function ul(i) {
7730
7790
  }), w.object().shape(e);
7731
7791
  }
7732
7792
  const en = ({ element: i, validationData: e }) => {
7733
- const o = We[i.type], { answerData: s } = ji(fi), a = ai(
7793
+ const o = We[i.type], { answerData: s } = ji(fi), a = si(
7734
7794
  () => {
7735
7795
  var t;
7736
7796
  return (t = i == null ? void 0 : i.acceptedFiles) == null ? void 0 : t.map((u) => u.label).join(", ");
7737
7797
  },
7738
7798
  [i]
7739
- ), l = ai(
7799
+ ), l = si(
7740
7800
  () => (i == null ? void 0 : i.visibilityDependentFields) || [],
7741
7801
  [i]
7742
- ), d = ai(() => l.length ? l.every(
7802
+ ), d = si(() => l.length ? l.every(
7743
7803
  (t) => {
7744
7804
  if (!i.isHidden) return !0;
7745
7805
  const u = s == null ? void 0 : s[t.id], c = t.fieldValue, r = u;
@@ -7790,7 +7850,7 @@ const en = ({ element: i, validationData: e }) => {
7790
7850
  )
7791
7851
  ] }) : null;
7792
7852
  }, on = (i, e) => i != null && i.allowEdit ? { ...e, isReadOnly: !1 } : e;
7793
- function tl({ form_data: i, options: e }) {
7853
+ function cl({ form_data: i, options: e }) {
7794
7854
  const o = (a, l) => /* @__PURE__ */ n.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ n.jsx(
7795
7855
  Hn,
7796
7856
  {
@@ -7855,7 +7915,7 @@ function tl({ form_data: i, options: e }) {
7855
7915
  ] }, a.id);
7856
7916
  }) });
7857
7917
  }
7858
- function cl({ form_data: i, options: e, current: o }) {
7918
+ function rl({ form_data: i, options: e, current: o }) {
7859
7919
  var s;
7860
7920
  return /* @__PURE__ */ n.jsx("div", { className: "grid gap-y-3 multi_section__content min-w-0", children: (s = i[o].questionData) == null ? void 0 : s.map((a) => {
7861
7921
  var l, d;
@@ -7914,10 +7974,10 @@ function cl({ form_data: i, options: e, current: o }) {
7914
7974
  );
7915
7975
  }) });
7916
7976
  }
7917
- function rl(i) {
7977
+ function ml(i) {
7918
7978
  return i.reduce((e, o) => (e[o.id] = o.value, e), {});
7919
7979
  }
7920
- const ml = ({
7980
+ const bl = ({
7921
7981
  form_data: i,
7922
7982
  answerData: e = [],
7923
7983
  ignoreValidation: o = !1,
@@ -7929,21 +7989,21 @@ const ml = ({
7929
7989
  hideFooter: u = !1,
7930
7990
  uploadUrl: c
7931
7991
  }) => {
7932
- var X, di, pi, bi, P, I, U, oi;
7933
- const { setAnswerData: r, setUploadUrl: v } = ji(fi), [m, h] = D(0), f = ai(
7934
- () => i.filter((F) => !F.isHidden).map((F) => {
7935
- var hi;
7936
- return F.isDisabled || F.disabled ? {
7937
- ...F,
7938
- questionData: (hi = F.questionData) == null ? void 0 : hi.map((Si) => ({
7939
- ...Si,
7992
+ var ii, di, pi, vi, D, _, V, F;
7993
+ const { setAnswerData: r, setUploadUrl: v } = ji(fi), [m, h] = R(0), f = si(
7994
+ () => i.filter((W) => !W.isHidden).map((W) => {
7995
+ var ti;
7996
+ return W.isDisabled || W.disabled ? {
7997
+ ...W,
7998
+ questionData: (ti = W.questionData) == null ? void 0 : ti.map((Ai) => ({
7999
+ ...Ai,
7940
8000
  isDisabled: !0
7941
8001
  }))
7942
- } : F;
8002
+ } : W;
7943
8003
  }),
7944
8004
  [i]
7945
- ), y = (X = f == null ? void 0 : f.length) != null ? X : 0, g = gi("config"), p = ai(
7946
- () => ul(f),
8005
+ ), y = (ii = f == null ? void 0 : f.length) != null ? ii : 0, g = gi("config"), p = si(
8006
+ () => tl(f),
7947
8007
  [f]
7948
8008
  ), x = En({
7949
8009
  resolver: On(p),
@@ -7956,102 +8016,104 @@ const ml = ({
7956
8016
  handleSubmit: A,
7957
8017
  reset: N,
7958
8018
  getValues: E,
7959
- watch: ni,
7960
- formState: { errors: J, isSubmitting: $ },
8019
+ watch: ei,
8020
+ formState: { errors: Y, isSubmitting: Q },
7961
8021
  trigger: L,
7962
- setError: W,
7963
- clearErrors: O
7964
- } = x, G = No({ control: j }), H = ai(
7965
- () => G,
7966
- [JSON.stringify(G)]
7967
- ), R = Q(
7968
- (F) => {
7969
- a && a(F);
8022
+ setError: U,
8023
+ clearErrors: I
8024
+ } = x, K = No({ control: j }), G = si(
8025
+ () => K,
8026
+ [JSON.stringify(K)]
8027
+ ), P = X(
8028
+ (W) => {
8029
+ a && a(W);
7970
8030
  },
7971
8031
  [a]
7972
8032
  );
7973
- K(() => {
8033
+ O(() => {
7974
8034
  v(c);
7975
- }, [v, c]), K(() => {
8035
+ }, [v, c]), O(() => {
7976
8036
  if (!(f != null && f.length) || !a) return;
7977
- const F = f.flatMap(
7978
- (si) => {
7979
- var hi;
7980
- return (hi = si.questionData) == null ? void 0 : hi.map((Si) => ({
7981
- id: Si.id,
7982
- value: H[Si.id] || "",
7983
- sectionId: si.id,
7984
- type: Si.type,
8037
+ const W = f.flatMap(
8038
+ (oi) => {
8039
+ var ti;
8040
+ return (ti = oi.questionData) == null ? void 0 : ti.map((Ai) => ({
8041
+ id: Ai.id,
8042
+ value: G[Ai.id] || "",
8043
+ sectionId: oi.id,
8044
+ type: Ai.type,
7985
8045
  metaData: {
7986
- prefix: Si.prefix
8046
+ prefix: Ai.prefix,
8047
+ dateFormat: Ai.dateFormat
7987
8048
  }
7988
8049
  }));
7989
8050
  }
7990
8051
  );
7991
- R(F), r(H);
8052
+ P(W), r(G);
7992
8053
  }, [
7993
- H,
8054
+ G,
7994
8055
  f,
7995
- R,
8056
+ P,
7996
8057
  a,
7997
8058
  r
7998
- ]), K(() => {
7999
- e != null && e.length && N(rl(e));
8059
+ ]), O(() => {
8060
+ e != null && e.length && N(ml(e));
8000
8061
  }, [e, N]);
8001
- const M = Q(
8002
- (F) => {
8003
- const si = f.flatMap(
8004
- (hi) => {
8005
- var Si;
8006
- return (Si = hi.questionData) == null ? void 0 : Si.map((Mi) => ({
8007
- id: Mi.id,
8008
- value: F[Mi.id] || "",
8009
- sectionId: hi.id,
8010
- type: Mi.type,
8062
+ const M = X(
8063
+ (W) => {
8064
+ const oi = f.flatMap(
8065
+ (ti) => {
8066
+ var Ai;
8067
+ return (Ai = ti.questionData) == null ? void 0 : Ai.map((Ci) => ({
8068
+ id: Ci.id,
8069
+ value: W[Ci.id] || "",
8070
+ sectionId: ti.id,
8071
+ type: Ci.type,
8011
8072
  metaData: {
8012
- prefix: Mi.prefix
8073
+ prefix: Ci.prefix,
8074
+ dateFormat: Ci.dateFormat
8013
8075
  }
8014
8076
  }));
8015
8077
  }
8016
8078
  );
8017
- Object.keys(J).length > 0 || s == null || s(si);
8079
+ Object.keys(Y).length > 0 || s == null || s(oi);
8018
8080
  },
8019
- [J, f, s]
8020
- ), B = Q(async () => {
8021
- var F, si;
8081
+ [Y, f, s]
8082
+ ), B = X(async () => {
8083
+ var W, oi;
8022
8084
  if (!o) {
8023
- const hi = (si = (F = f == null ? void 0 : f[m]) == null ? void 0 : F.questionData) == null ? void 0 : si.map(
8024
- (Mi) => Mi.id
8085
+ const ti = (oi = (W = f == null ? void 0 : f[m]) == null ? void 0 : W.questionData) == null ? void 0 : oi.map(
8086
+ (Ci) => Ci.id
8025
8087
  );
8026
- if (!await L(hi)) return;
8088
+ if (!await L(ti)) return;
8027
8089
  }
8028
- h((hi) => hi + 1);
8029
- }, [m, f, o, L]), _ = Q(() => {
8030
- h((F) => F - 1);
8031
- }, []), ti = ai(
8090
+ h((ti) => ti + 1);
8091
+ }, [m, f, o, L]), J = X(() => {
8092
+ h((W) => W - 1);
8093
+ }, []), ri = si(
8032
8094
  () => ({
8033
8095
  register: C,
8034
8096
  setValue: S,
8035
- watch: ni,
8036
- errors: J,
8097
+ watch: ei,
8098
+ errors: Y,
8037
8099
  trigger: L,
8038
- isSubmitting: $,
8100
+ isSubmitting: Q,
8039
8101
  isReadOnly: l,
8040
8102
  getValues: E,
8041
- setError: W,
8042
- clearErrors: O
8103
+ setError: U,
8104
+ clearErrors: I
8043
8105
  }),
8044
8106
  [
8045
8107
  C,
8046
8108
  S,
8047
- ni,
8048
- J,
8109
+ ei,
8110
+ Y,
8049
8111
  L,
8050
- $,
8112
+ Q,
8051
8113
  l,
8052
8114
  E,
8053
- W,
8054
- O
8115
+ U,
8116
+ I
8055
8117
  ]
8056
8118
  );
8057
8119
  return /* @__PURE__ */ n.jsxs(jo, { ...x, children: [
@@ -8068,26 +8130,26 @@ const ml = ({
8068
8130
  className: "multi_section__box min-w-0",
8069
8131
  children: [
8070
8132
  d === "multi" && (((di = f == null ? void 0 : f[m]) == null ? void 0 : di.title) || ((pi = f == null ? void 0 : f[m]) == null ? void 0 : pi.description)) && /* @__PURE__ */ n.jsxs("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
8071
- ((bi = f[m]) == null ? void 0 : bi.title) && /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold mb-[6px]", children: (P = f[m]) == null ? void 0 : P.title }),
8072
- ((I = f[m]) == null ? void 0 : I.description) && /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: (U = f[m]) == null ? void 0 : U.description })
8133
+ ((vi = f[m]) == null ? void 0 : vi.title) && /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold mb-[6px]", children: (D = f[m]) == null ? void 0 : D.title }),
8134
+ ((_ = f[m]) == null ? void 0 : _.description) && /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: (V = f[m]) == null ? void 0 : V.description })
8073
8135
  ] }),
8074
8136
  d === "multi" ? /* @__PURE__ */ n.jsx(
8075
- cl,
8137
+ rl,
8076
8138
  {
8077
8139
  form_data: f,
8078
- options: ti,
8140
+ options: ri,
8079
8141
  current: m
8080
8142
  }
8081
8143
  ) : /* @__PURE__ */ n.jsx(
8082
- tl,
8144
+ cl,
8083
8145
  {
8084
8146
  form_data: f,
8085
- options: ti
8147
+ options: ri
8086
8148
  }
8087
8149
  )
8088
8150
  ]
8089
8151
  },
8090
- (oi = f == null ? void 0 : f[m]) == null ? void 0 : oi.id
8152
+ (F = f == null ? void 0 : f[m]) == null ? void 0 : F.id
8091
8153
  ) }),
8092
8154
  !u && /* @__PURE__ */ n.jsx("footer", { className: "flex items-center justify-end gap-4 footer flex-wrap", children: d === "multi" ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
8093
8155
  /* @__PURE__ */ n.jsxs("div", { className: "flex gap-x-4 justify-between navigation_container w-full", children: [
@@ -8098,7 +8160,7 @@ const ml = ({
8098
8160
  {
8099
8161
  type: "button",
8100
8162
  text: "Back",
8101
- onClick: _,
8163
+ onClick: J,
8102
8164
  btnClass: "text-gray-700 back_btn text-sm border-[#98A2B3] !font-medium !py-[10px] px-10 bg-gray-200 rounded-lg"
8103
8165
  }
8104
8166
  )
@@ -8117,8 +8179,8 @@ const ml = ({
8117
8179
  (m === y - 1 || l) && !o && (t != null ? t : /* @__PURE__ */ n.jsx(
8118
8180
  Bi,
8119
8181
  {
8120
- isDisabled: $ || Object.keys(J).length > 0,
8121
- isLoading: $,
8182
+ isDisabled: Q || Object.keys(Y).length > 0,
8183
+ isLoading: Q,
8122
8184
  type: "submit",
8123
8185
  text: "Submit",
8124
8186
  style: { background: (g == null ? void 0 : g.buttonColor) || "#333" },
@@ -8128,8 +8190,8 @@ const ml = ({
8128
8190
  ] }) : !o && (t != null ? t : /* @__PURE__ */ n.jsx(
8129
8191
  Bi,
8130
8192
  {
8131
- isDisabled: $ || Object.keys(J).length > 0,
8132
- isLoading: $,
8193
+ isDisabled: Q || Object.keys(Y).length > 0,
8194
+ isLoading: Q,
8133
8195
  type: "submit",
8134
8196
  text: "Submit",
8135
8197
  style: { background: (g == null ? void 0 : g.buttonColor) || "#333" },
@@ -8140,7 +8202,7 @@ const ml = ({
8140
8202
  }
8141
8203
  )
8142
8204
  ] });
8143
- }, bl = mi.memo(ml);
8205
+ }, vl = bi.memo(bl);
8144
8206
  function ze({
8145
8207
  answerData: i,
8146
8208
  form_data: e,
@@ -8155,10 +8217,10 @@ function ze({
8155
8217
  onGetValues: r,
8156
8218
  uploadUrl: v
8157
8219
  }) {
8158
- K(() => {
8220
+ O(() => {
8159
8221
  d && Ve("config", d);
8160
8222
  }, [d]);
8161
- const m = Q(
8223
+ const m = X(
8162
8224
  (h) => {
8163
8225
  r && r(h);
8164
8226
  },
@@ -8167,7 +8229,7 @@ function ze({
8167
8229
  return l ? /* @__PURE__ */ n.jsx(Ue, {}) : e ? /* @__PURE__ */ n.jsxs("div", { className: "w-full h-full min-w-0", children: [
8168
8230
  /* @__PURE__ */ n.jsx("div", { id: "root-portal" }),
8169
8231
  /* @__PURE__ */ n.jsx(je, { children: /* @__PURE__ */ n.jsx(
8170
- bl,
8232
+ vl,
8171
8233
  {
8172
8234
  form_data: e,
8173
8235
  answerData: i,
@@ -8184,6 +8246,6 @@ function ze({
8184
8246
  ] }) : /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("p", { className: "p-6 text-sm text-gray-400", children: "Error: No form data available." }) });
8185
8247
  }
8186
8248
  export {
8187
- Cl as FormBuilder,
8249
+ Ml as FormBuilder,
8188
8250
  ze as FormViewer
8189
8251
  };