@arudovwen/form-builder-react 1.4.42 → 1.4.44

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,9 +1,9 @@
1
- import ri, { createContext as ro, useState as R, useMemo as ii, useEffect as O, forwardRef as ye, createElement as Sn, Fragment as qi, useContext as Ni, useRef as Ii, useCallback as Y, memo as an } from "react";
2
- import { v4 as xi } from "uuid";
1
+ import ri, { createContext as ro, useState as R, useMemo as ni, useEffect as O, forwardRef as ye, createElement as Sn, Fragment as Zi, useContext as ji, useRef as Di, useCallback as Y, memo as an } from "react";
2
+ import { v4 as yi } from "uuid";
3
3
  import mo from "react-datepicker";
4
- import { Listbox as oi, Transition as Ri, Combobox as Pi, ComboboxInput as bo, ComboboxButton as vo, ComboboxOptions as ho, ComboboxOption as po } from "@headlessui/react";
5
- import { toast as Si, Toaster as Ae } from "sonner";
6
- import Di from "axios";
4
+ import { Listbox as ai, Transition as Ri, Combobox as Pi, ComboboxInput as bo, ComboboxButton as vo, ComboboxOptions as ho, ComboboxOption as po } from "@headlessui/react";
5
+ import { toast as Ni, Toaster as Ae } from "sonner";
6
+ import Ii from "axios";
7
7
  import sn from "react-currency-input-field";
8
8
  import { appendErrors as go, useForm as En, useFieldArray as mn, useWatch as fo, FormProvider as xo } from "react-hook-form";
9
9
  import { validateFieldsNatively as yo, toNestErrors as Ao } from "@hookform/resolvers";
@@ -48,45 +48,45 @@ var Hi = {};
48
48
  var ne;
49
49
  function ko() {
50
50
  return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
51
- var i = ri, 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"), r = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), y = Symbol.iterator, f = "@@iterator";
51
+ var i = ri, 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"), r = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), A = Symbol.iterator, f = "@@iterator";
52
52
  function m(b) {
53
53
  if (b === null || typeof b != "object")
54
54
  return null;
55
- var k = y && b[y] || b[f];
56
- return typeof k == "function" ? k : null;
55
+ var C = A && b[A] || b[f];
56
+ return typeof C == "function" ? C : null;
57
57
  }
58
58
  var p = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
59
59
  function x(b) {
60
60
  {
61
- for (var k = arguments.length, T = new Array(k > 1 ? k - 1 : 0), V = 1; V < k; V++)
61
+ for (var C = arguments.length, T = new Array(C > 1 ? C - 1 : 0), V = 1; V < C; V++)
62
62
  T[V - 1] = arguments[V];
63
63
  j("error", b, T);
64
64
  }
65
65
  }
66
- function j(b, k, T) {
66
+ function j(b, C, T) {
67
67
  {
68
68
  var V = p.ReactDebugCurrentFrame, X = V.getStackAddendum();
69
- X !== "" && (k += "%s", T = T.concat([X]));
70
- var ei = T.map(function($) {
69
+ X !== "" && (C += "%s", T = T.concat([X]));
70
+ var oi = T.map(function($) {
71
71
  return String($);
72
72
  });
73
- ei.unshift("Warning: " + k), Function.prototype.apply.call(console[b], console, ei);
73
+ oi.unshift("Warning: " + C), Function.prototype.apply.call(console[b], console, oi);
74
74
  }
75
75
  }
76
- var N = !1, S = !1, A = !1, C = !1, K = !1, Q;
76
+ var S = !1, N = !1, y = !1, k = !1, K = !1, Q;
77
77
  Q = Symbol.for("react.module.reference");
78
78
  function W(b) {
79
- return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || K || b === a || b === r || b === c || C || b === g || N || S || A || typeof b == "object" && b !== null && (b.$$typeof === v || b.$$typeof === h || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
79
+ return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || K || b === a || b === r || b === c || k || b === g || S || N || y || typeof b == "object" && b !== null && (b.$$typeof === v || b.$$typeof === h || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
80
80
  // types supported by any Flight configuration anywhere since
81
81
  // we don't know which Flight build this will end up being used
82
82
  // with.
83
83
  b.$$typeof === Q || b.getModuleId !== void 0));
84
84
  }
85
- function Z(b, k, T) {
85
+ function q(b, C, T) {
86
86
  var V = b.displayName;
87
87
  if (V)
88
88
  return V;
89
- var X = k.displayName || k.name || "";
89
+ var X = C.displayName || C.name || "";
90
90
  return X !== "" ? T + "(" + X + ")" : T;
91
91
  }
92
92
  function M(b) {
@@ -116,20 +116,20 @@ function ko() {
116
116
  if (typeof b == "object")
117
117
  switch (b.$$typeof) {
118
118
  case t:
119
- var k = b;
120
- return M(k) + ".Consumer";
119
+ var C = b;
120
+ return M(C) + ".Consumer";
121
121
  case d:
122
122
  var T = b;
123
123
  return M(T._context) + ".Provider";
124
124
  case u:
125
- return Z(b, b.render, "ForwardRef");
125
+ return q(b, b.render, "ForwardRef");
126
126
  case h:
127
127
  var V = b.displayName || null;
128
128
  return V !== null ? V : E(b.type) || "Memo";
129
129
  case v: {
130
- var X = b, ei = X._payload, $ = X._init;
130
+ var X = b, oi = X._payload, $ = X._init;
131
131
  try {
132
- return E($(ei));
132
+ return E($(oi));
133
133
  } catch (_) {
134
134
  return null;
135
135
  }
@@ -137,14 +137,14 @@ function ko() {
137
137
  }
138
138
  return null;
139
139
  }
140
- var P = Object.assign, L = 0, G, q, w, I, U, ni, vi;
140
+ var P = Object.assign, L = 0, G, Z, w, D, U, ei, vi;
141
141
  function bi() {
142
142
  }
143
143
  bi.__reactDisabledLog = !0;
144
- function ai() {
144
+ function si() {
145
145
  {
146
146
  if (L === 0) {
147
- G = console.log, q = console.info, w = console.warn, I = console.error, U = console.group, ni = console.groupCollapsed, vi = console.groupEnd;
147
+ G = console.log, Z = console.info, w = console.warn, D = console.error, U = console.group, ei = console.groupCollapsed, vi = console.groupEnd;
148
148
  var b = {
149
149
  configurable: !0,
150
150
  enumerable: !0,
@@ -177,19 +177,19 @@ function ko() {
177
177
  value: G
178
178
  }),
179
179
  info: P({}, b, {
180
- value: q
180
+ value: Z
181
181
  }),
182
182
  warn: P({}, b, {
183
183
  value: w
184
184
  }),
185
185
  error: P({}, b, {
186
- value: I
186
+ value: D
187
187
  }),
188
188
  group: P({}, b, {
189
189
  value: U
190
190
  }),
191
191
  groupCollapsed: P({}, b, {
192
- value: ni
192
+ value: ei
193
193
  }),
194
194
  groupEnd: P({}, b, {
195
195
  value: vi
@@ -199,41 +199,41 @@ function ko() {
199
199
  L < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
200
200
  }
201
201
  }
202
- var D = p.ReactCurrentDispatcher, li;
203
- function ui(b, k, T) {
202
+ var I = p.ReactCurrentDispatcher, di;
203
+ function ui(b, C, T) {
204
204
  {
205
- if (li === void 0)
205
+ if (di === void 0)
206
206
  try {
207
207
  throw Error();
208
208
  } catch (X) {
209
209
  var V = X.stack.trim().match(/\n( *(at )?)/);
210
- li = V && V[1] || "";
210
+ di = V && V[1] || "";
211
211
  }
212
212
  return `
213
- ` + li + b;
213
+ ` + di + b;
214
214
  }
215
215
  }
216
- var si = !1, di;
216
+ var li = !1, ii;
217
217
  {
218
218
  var ki = typeof WeakMap == "function" ? WeakMap : Map;
219
- di = new ki();
219
+ ii = new ki();
220
220
  }
221
- function yi(b, k) {
222
- if (!b || si)
221
+ function hi(b, C) {
222
+ if (!b || li)
223
223
  return "";
224
224
  {
225
- var T = di.get(b);
225
+ var T = ii.get(b);
226
226
  if (T !== void 0)
227
227
  return T;
228
228
  }
229
229
  var V;
230
- si = !0;
230
+ li = !0;
231
231
  var X = Error.prepareStackTrace;
232
232
  Error.prepareStackTrace = void 0;
233
- var ei;
234
- ei = D.current, D.current = null, ai();
233
+ var oi;
234
+ oi = I.current, I.current = null, si();
235
235
  try {
236
- if (k) {
236
+ if (C) {
237
237
  var $ = function() {
238
238
  throw Error();
239
239
  };
@@ -244,63 +244,63 @@ function ko() {
244
244
  }), typeof Reflect == "object" && Reflect.construct) {
245
245
  try {
246
246
  Reflect.construct($, []);
247
- } catch (gi) {
248
- V = gi;
247
+ } catch (fi) {
248
+ V = fi;
249
249
  }
250
250
  Reflect.construct(b, [], $);
251
251
  } else {
252
252
  try {
253
253
  $.call();
254
- } catch (gi) {
255
- V = gi;
254
+ } catch (fi) {
255
+ V = fi;
256
256
  }
257
257
  b.call($.prototype);
258
258
  }
259
259
  } else {
260
260
  try {
261
261
  throw Error();
262
- } catch (gi) {
263
- V = gi;
262
+ } catch (fi) {
263
+ V = fi;
264
264
  }
265
265
  b();
266
266
  }
267
- } catch (gi) {
268
- if (gi && V && typeof gi.stack == "string") {
269
- for (var _ = gi.stack.split(`
270
- `), hi = V.stack.split(`
271
- `), ci = _.length - 1, mi = hi.length - 1; ci >= 1 && mi >= 0 && _[ci] !== hi[mi]; )
267
+ } catch (fi) {
268
+ if (fi && V && typeof fi.stack == "string") {
269
+ for (var _ = fi.stack.split(`
270
+ `), pi = V.stack.split(`
271
+ `), ci = _.length - 1, mi = pi.length - 1; ci >= 1 && mi >= 0 && _[ci] !== pi[mi]; )
272
272
  mi--;
273
273
  for (; ci >= 1 && mi >= 0; ci--, mi--)
274
- if (_[ci] !== hi[mi]) {
274
+ if (_[ci] !== pi[mi]) {
275
275
  if (ci !== 1 || mi !== 1)
276
276
  do
277
- if (ci--, mi--, mi < 0 || _[ci] !== hi[mi]) {
278
- var Ai = `
277
+ if (ci--, mi--, mi < 0 || _[ci] !== pi[mi]) {
278
+ var Si = `
279
279
  ` + _[ci].replace(" at new ", " at ");
280
- return b.displayName && Ai.includes("<anonymous>") && (Ai = Ai.replace("<anonymous>", b.displayName)), typeof b == "function" && di.set(b, Ai), Ai;
280
+ return b.displayName && Si.includes("<anonymous>") && (Si = Si.replace("<anonymous>", b.displayName)), typeof b == "function" && ii.set(b, Si), Si;
281
281
  }
282
282
  while (ci >= 1 && mi >= 0);
283
283
  break;
284
284
  }
285
285
  }
286
286
  } finally {
287
- si = !1, D.current = ei, H(), Error.prepareStackTrace = X;
287
+ li = !1, I.current = oi, H(), Error.prepareStackTrace = X;
288
288
  }
289
289
  var Li = b ? b.displayName || b.name : "", Ti = Li ? ui(Li) : "";
290
- return typeof b == "function" && di.set(b, Ti), Ti;
290
+ return typeof b == "function" && ii.set(b, Ti), Ti;
291
291
  }
292
- function ji(b, k, T) {
293
- return yi(b, !1);
292
+ function Ai(b, C, T) {
293
+ return hi(b, !1);
294
294
  }
295
295
  function Ci(b) {
296
- var k = b.prototype;
297
- return !!(k && k.isReactComponent);
296
+ var C = b.prototype;
297
+ return !!(C && C.isReactComponent);
298
298
  }
299
- function zi(b, k, T) {
299
+ function zi(b, C, T) {
300
300
  if (b == null)
301
301
  return "";
302
302
  if (typeof b == "function")
303
- return yi(b, Ci(b));
303
+ return hi(b, Ci(b));
304
304
  if (typeof b == "string")
305
305
  return ui(b);
306
306
  switch (b) {
@@ -312,13 +312,13 @@ function ko() {
312
312
  if (typeof b == "object")
313
313
  switch (b.$$typeof) {
314
314
  case u:
315
- return ji(b.render);
315
+ return Ai(b.render);
316
316
  case h:
317
- return zi(b.type, k, T);
317
+ return zi(b.type, C, T);
318
318
  case v: {
319
- var V = b, X = V._payload, ei = V._init;
319
+ var V = b, X = V._payload, oi = V._init;
320
320
  try {
321
- return zi(ei(X), k, T);
321
+ return zi(oi(X), C, T);
322
322
  } catch ($) {
323
323
  }
324
324
  }
@@ -328,23 +328,23 @@ function ko() {
328
328
  var Ki = Object.prototype.hasOwnProperty, Gn = {}, Hn = p.ReactDebugCurrentFrame;
329
329
  function _i(b) {
330
330
  if (b) {
331
- var k = b._owner, T = zi(b.type, b._source, k ? k.type : null);
331
+ var C = b._owner, T = zi(b.type, b._source, C ? C.type : null);
332
332
  Hn.setExtraStackFrame(T);
333
333
  } else
334
334
  Hn.setExtraStackFrame(null);
335
335
  }
336
- function Fe(b, k, T, V, X) {
336
+ function Fe(b, C, T, V, X) {
337
337
  {
338
- var ei = Function.call.bind(Ki);
338
+ var oi = Function.call.bind(Ki);
339
339
  for (var $ in b)
340
- if (ei(b, $)) {
340
+ if (oi(b, $)) {
341
341
  var _ = void 0;
342
342
  try {
343
343
  if (typeof b[$] != "function") {
344
- var hi = Error((V || "React class") + ": " + T + " type `" + $ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof b[$] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
345
- throw hi.name = "Invariant Violation", hi;
344
+ var pi = Error((V || "React class") + ": " + T + " type `" + $ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof b[$] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
345
+ throw pi.name = "Invariant Violation", pi;
346
346
  }
347
- _ = b[$](k, $, V, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
+ _ = b[$](C, $, V, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
348
348
  } catch (ci) {
349
349
  _ = ci;
350
350
  }
@@ -358,14 +358,14 @@ function ko() {
358
358
  }
359
359
  function Ue(b) {
360
360
  {
361
- var k = typeof Symbol == "function" && Symbol.toStringTag, T = k && b[Symbol.toStringTag] || b.constructor.name || "Object";
361
+ var C = typeof Symbol == "function" && Symbol.toStringTag, T = C && b[Symbol.toStringTag] || b.constructor.name || "Object";
362
362
  return T;
363
363
  }
364
364
  }
365
365
  function ze(b) {
366
366
  try {
367
367
  return Vn(b), !1;
368
- } catch (k) {
368
+ } catch (C) {
369
369
  return !0;
370
370
  }
371
371
  }
@@ -384,27 +384,27 @@ function ko() {
384
384
  }, Un, zn;
385
385
  function Je(b) {
386
386
  if (Ki.call(b, "ref")) {
387
- var k = Object.getOwnPropertyDescriptor(b, "ref").get;
388
- if (k && k.isReactWarning)
387
+ var C = Object.getOwnPropertyDescriptor(b, "ref").get;
388
+ if (C && C.isReactWarning)
389
389
  return !1;
390
390
  }
391
391
  return b.ref !== void 0;
392
392
  }
393
393
  function Ye(b) {
394
394
  if (Ki.call(b, "key")) {
395
- var k = Object.getOwnPropertyDescriptor(b, "key").get;
396
- if (k && k.isReactWarning)
395
+ var C = Object.getOwnPropertyDescriptor(b, "key").get;
396
+ if (C && C.isReactWarning)
397
397
  return !1;
398
398
  }
399
399
  return b.key !== void 0;
400
400
  }
401
- function Ze(b, k) {
401
+ function qe(b, C) {
402
402
  typeof b.ref == "string" && Wn.current;
403
403
  }
404
- function qe(b, k) {
404
+ function Ze(b, C) {
405
405
  {
406
406
  var T = function() {
407
- Un || (Un = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", k));
407
+ Un || (Un = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", C));
408
408
  };
409
409
  T.isReactWarning = !0, Object.defineProperty(b, "key", {
410
410
  get: T,
@@ -412,10 +412,10 @@ function ko() {
412
412
  });
413
413
  }
414
414
  }
415
- function $e(b, k) {
415
+ function $e(b, C) {
416
416
  {
417
417
  var T = function() {
418
- zn || (zn = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", k));
418
+ zn || (zn = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", C));
419
419
  };
420
420
  T.isReactWarning = !0, Object.defineProperty(b, "ref", {
421
421
  get: T,
@@ -423,17 +423,17 @@ function ko() {
423
423
  });
424
424
  }
425
425
  }
426
- var Qe = function(b, k, T, V, X, ei, $) {
426
+ var Qe = function(b, C, T, V, X, oi, $) {
427
427
  var _ = {
428
428
  // This tag allows us to uniquely identify this as a React Element
429
429
  $$typeof: e,
430
430
  // Built-in properties that belong on the element
431
431
  type: b,
432
- key: k,
432
+ key: C,
433
433
  ref: T,
434
434
  props: $,
435
435
  // Record the component responsible for creating this element.
436
- _owner: ei
436
+ _owner: oi
437
437
  };
438
438
  return _._store = {}, Object.defineProperty(_._store, "validated", {
439
439
  configurable: !1,
@@ -452,28 +452,28 @@ function ko() {
452
452
  value: X
453
453
  }), Object.freeze && (Object.freeze(_.props), Object.freeze(_)), _;
454
454
  };
455
- function Xe(b, k, T, V, X) {
455
+ function Xe(b, C, T, V, X) {
456
456
  {
457
- var ei, $ = {}, _ = null, hi = null;
458
- T !== void 0 && (Fn(T), _ = "" + T), Ye(k) && (Fn(k.key), _ = "" + k.key), Je(k) && (hi = k.ref, Ze(k, X));
459
- for (ei in k)
460
- Ki.call(k, ei) && !_e.hasOwnProperty(ei) && ($[ei] = k[ei]);
457
+ var oi, $ = {}, _ = null, pi = null;
458
+ T !== void 0 && (Fn(T), _ = "" + T), Ye(C) && (Fn(C.key), _ = "" + C.key), Je(C) && (pi = C.ref, qe(C, X));
459
+ for (oi in C)
460
+ Ki.call(C, oi) && !_e.hasOwnProperty(oi) && ($[oi] = C[oi]);
461
461
  if (b && b.defaultProps) {
462
462
  var ci = b.defaultProps;
463
- for (ei in ci)
464
- $[ei] === void 0 && ($[ei] = ci[ei]);
463
+ for (oi in ci)
464
+ $[oi] === void 0 && ($[oi] = ci[oi]);
465
465
  }
466
- if (_ || hi) {
466
+ if (_ || pi) {
467
467
  var mi = typeof b == "function" ? b.displayName || b.name || "Unknown" : b;
468
- _ && qe($, mi), hi && $e($, mi);
468
+ _ && Ze($, mi), pi && $e($, mi);
469
469
  }
470
- return Qe(b, _, hi, X, V, Wn.current, $);
470
+ return Qe(b, _, pi, X, V, Wn.current, $);
471
471
  }
472
472
  }
473
473
  var un = p.ReactCurrentOwner, _n = p.ReactDebugCurrentFrame;
474
474
  function Bi(b) {
475
475
  if (b) {
476
- var k = b._owner, T = zi(b.type, b._source, k ? k.type : null);
476
+ var C = b._owner, T = zi(b.type, b._source, C ? C.type : null);
477
477
  _n.setExtraStackFrame(T);
478
478
  } else
479
479
  _n.setExtraStackFrame(null);
@@ -501,22 +501,22 @@ Check the render method of \`` + b + "`.";
501
501
  var Yn = {};
502
502
  function no(b) {
503
503
  {
504
- var k = Jn();
505
- if (!k) {
504
+ var C = Jn();
505
+ if (!C) {
506
506
  var T = typeof b == "string" ? b : b.displayName || b.name;
507
- T && (k = `
507
+ T && (C = `
508
508
 
509
509
  Check the top-level render call using <` + T + ">.");
510
510
  }
511
- return k;
511
+ return C;
512
512
  }
513
513
  }
514
- function Zn(b, k) {
514
+ function qn(b, C) {
515
515
  {
516
516
  if (!b._store || b._store.validated || b.key != null)
517
517
  return;
518
518
  b._store.validated = !0;
519
- var T = no(k);
519
+ var T = no(C);
520
520
  if (Yn[T])
521
521
  return;
522
522
  Yn[T] = !0;
@@ -524,54 +524,54 @@ Check the top-level render call using <` + T + ">.");
524
524
  b && b._owner && b._owner !== un.current && (V = " It was passed a child from " + E(b._owner.type) + "."), Bi(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), Bi(null);
525
525
  }
526
526
  }
527
- function qn(b, k) {
527
+ function Zn(b, C) {
528
528
  {
529
529
  if (typeof b != "object")
530
530
  return;
531
531
  if (dn(b))
532
532
  for (var T = 0; T < b.length; T++) {
533
533
  var V = b[T];
534
- cn(V) && Zn(V, k);
534
+ cn(V) && qn(V, C);
535
535
  }
536
536
  else if (cn(b))
537
537
  b._store && (b._store.validated = !0);
538
538
  else if (b) {
539
539
  var X = m(b);
540
540
  if (typeof X == "function" && X !== b.entries)
541
- for (var ei = X.call(b), $; !($ = ei.next()).done; )
542
- cn($.value) && Zn($.value, k);
541
+ for (var oi = X.call(b), $; !($ = oi.next()).done; )
542
+ cn($.value) && qn($.value, C);
543
543
  }
544
544
  }
545
545
  }
546
546
  function eo(b) {
547
547
  {
548
- var k = b.type;
549
- if (k == null || typeof k == "string")
548
+ var C = b.type;
549
+ if (C == null || typeof C == "string")
550
550
  return;
551
551
  var T;
552
- if (typeof k == "function")
553
- T = k.propTypes;
554
- else if (typeof k == "object" && (k.$$typeof === u || // Note: Memo only checks outer props here.
552
+ if (typeof C == "function")
553
+ T = C.propTypes;
554
+ else if (typeof C == "object" && (C.$$typeof === u || // Note: Memo only checks outer props here.
555
555
  // Inner props are checked in the reconciler.
556
- k.$$typeof === h))
557
- T = k.propTypes;
556
+ C.$$typeof === h))
557
+ T = C.propTypes;
558
558
  else
559
559
  return;
560
560
  if (T) {
561
- var V = E(k);
561
+ var V = E(C);
562
562
  Fe(T, b.props, "prop", V, b);
563
- } else if (k.PropTypes !== void 0 && !tn) {
563
+ } else if (C.PropTypes !== void 0 && !tn) {
564
564
  tn = !0;
565
- var X = E(k);
565
+ var X = E(C);
566
566
  x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", X || "Unknown");
567
567
  }
568
- typeof k.getDefaultProps == "function" && !k.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
568
+ typeof C.getDefaultProps == "function" && !C.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
569
569
  }
570
570
  }
571
571
  function oo(b) {
572
572
  {
573
- for (var k = Object.keys(b.props), T = 0; T < k.length; T++) {
574
- var V = k[T];
573
+ for (var C = Object.keys(b.props), T = 0; T < C.length; T++) {
574
+ var V = C[T];
575
575
  if (V !== "children" && V !== "key") {
576
576
  Bi(b), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", V), Bi(null);
577
577
  break;
@@ -581,39 +581,39 @@ Check the top-level render call using <` + T + ">.");
581
581
  }
582
582
  }
583
583
  var $n = {};
584
- function Qn(b, k, T, V, X, ei) {
584
+ function Qn(b, C, T, V, X, oi) {
585
585
  {
586
586
  var $ = W(b);
587
587
  if (!$) {
588
588
  var _ = "";
589
589
  (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.");
590
- var hi = io();
591
- hi ? _ += hi : _ += Jn();
590
+ var pi = io();
591
+ pi ? _ += pi : _ += Jn();
592
592
  var ci;
593
593
  b === null ? ci = "null" : dn(b) ? ci = "array" : b !== void 0 && b.$$typeof === e ? (ci = "<" + (E(b.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : ci = 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", ci, _);
594
594
  }
595
- var mi = Xe(b, k, T, X, ei);
595
+ var mi = Xe(b, C, T, X, oi);
596
596
  if (mi == null)
597
597
  return mi;
598
598
  if ($) {
599
- var Ai = k.children;
600
- if (Ai !== void 0)
599
+ var Si = C.children;
600
+ if (Si !== void 0)
601
601
  if (V)
602
- if (dn(Ai)) {
603
- for (var Li = 0; Li < Ai.length; Li++)
604
- qn(Ai[Li], b);
605
- Object.freeze && Object.freeze(Ai);
602
+ if (dn(Si)) {
603
+ for (var Li = 0; Li < Si.length; Li++)
604
+ Zn(Si[Li], b);
605
+ Object.freeze && Object.freeze(Si);
606
606
  } else
607
607
  x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
608
608
  else
609
- qn(Ai, b);
609
+ Zn(Si, b);
610
610
  }
611
- if (Ki.call(k, "key")) {
612
- var Ti = E(b), gi = Object.keys(k).filter(function(co) {
611
+ if (Ki.call(C, "key")) {
612
+ var Ti = E(b), fi = Object.keys(C).filter(function(co) {
613
613
  return co !== "key";
614
- }), rn = gi.length > 0 ? "{key: someKey, " + gi.join(": ..., ") + ": ...}" : "{key: someKey}";
614
+ }), rn = fi.length > 0 ? "{key: someKey, " + fi.join(": ..., ") + ": ...}" : "{key: someKey}";
615
615
  if (!$n[Ti + rn]) {
616
- var to = gi.length > 0 ? "{" + gi.join(": ..., ") + ": ...}" : "{}";
616
+ var to = fi.length > 0 ? "{" + fi.join(": ..., ") + ": ...}" : "{}";
617
617
  x(`A props object containing a "key" prop is being spread into JSX:
618
618
  let props = %s;
619
619
  <%s {...props} />
@@ -625,11 +625,11 @@ React keys must be passed directly to JSX without using spread:
625
625
  return b === s ? oo(mi) : eo(mi), mi;
626
626
  }
627
627
  }
628
- function ao(b, k, T) {
629
- return Qn(b, k, T, !0);
628
+ function ao(b, C, T) {
629
+ return Qn(b, C, T, !0);
630
630
  }
631
- function so(b, k, T) {
632
- return Qn(b, k, T, !1);
631
+ function so(b, C, T) {
632
+ return Qn(b, C, T, !1);
633
633
  }
634
634
  var lo = so, uo = ao;
635
635
  Hi.Fragment = s, Hi.jsx = lo, Hi.jsxs = uo;
@@ -640,18 +640,19 @@ function Co() {
640
640
  return ee || (ee = 1, process.env.NODE_ENV === "production" ? Ji.exports = jo() : Ji.exports = ko()), Ji.exports;
641
641
  }
642
642
  var n = Co();
643
- const pi = ro(void 0), oe = {
643
+ const gi = ro(void 0), oe = {
644
644
  title: "",
645
645
  description: "",
646
- id: xi(),
646
+ id: yi(),
647
647
  questionData: [],
648
- disabled: !1
648
+ disabled: !1,
649
+ isHidden: !1
649
650
  }, Se = ({ children: i }) => {
650
651
  const [e, o] = R({}), [s, a] = R({}), [l, d] = R([oe]), [t, u] = R(!1), [r, c] = R(null), [h, v] = R([
651
652
  0
652
- ]), [g, y] = R(""), f = ri.useCallback(() => {
653
+ ]), [g, A] = R(""), f = ri.useCallback(() => {
653
654
  }, []), m = ri.useCallback(() => {
654
- const M = xi();
655
+ const M = yi();
655
656
  d((E) => [...E, { ...oe, id: M }]), c(M), v([l.length]);
656
657
  }, [l]), p = ri.useCallback((M) => {
657
658
  d(
@@ -664,10 +665,10 @@ const pi = ro(void 0), oe = {
664
665
  );
665
666
  L && d(
666
667
  (G) => G == null ? void 0 : G.map(
667
- (q) => q.id === E ? {
668
- ...q,
669
- questionData: q.questionData.filter((w) => L.type === "grid" ? w.gridId !== L.id && w.id !== L.id : w.id !== M)
670
- } : q
668
+ (Z) => Z.id === E ? {
669
+ ...Z,
670
+ questionData: Z.questionData.filter((w) => L.type === "grid" ? w.gridId !== L.id && w.id !== L.id : w.id !== M)
671
+ } : Z
671
672
  )
672
673
  );
673
674
  },
@@ -680,32 +681,32 @@ const pi = ro(void 0), oe = {
680
681
  (w) => w.id === M
681
682
  );
682
683
  if (L === -1) return;
683
- const G = P.questionData[L], q = (w, I = {}) => ({
684
+ const G = P.questionData[L], Z = (w, D = {}) => ({
684
685
  ...JSON.parse(JSON.stringify(w)),
685
- id: xi(),
686
- ...I
686
+ id: yi(),
687
+ ...D
687
688
  });
688
689
  d(
689
- (w) => w == null ? void 0 : w.map((I) => {
690
- var ni;
691
- if (I.id !== E) return I;
692
- const U = [...I.questionData];
690
+ (w) => w == null ? void 0 : w.map((D) => {
691
+ var ei;
692
+ if (D.id !== E) return D;
693
+ const U = [...D.questionData];
693
694
  if (G.type === "grid") {
694
- const vi = (ni = U == null ? void 0 : U.map((si, di) => ({ e: si, i: di })).filter(
695
- ({ e: si }) => si.id === G.id || si.gridId === G.id
696
- )) == null ? void 0 : ni.map(({ i: si }) => si), bi = vi.length ? Math.max(...vi) + 1 : L + 1, ai = xi(), H = q(G, {});
697
- H.id = ai;
698
- const D = U.filter((si) => si.gridId === G.id), li = D == null ? void 0 : D.map(
699
- (si) => q(si, { gridId: ai })
695
+ const vi = (ei = U == null ? void 0 : U.map((li, ii) => ({ e: li, i: ii })).filter(
696
+ ({ e: li }) => li.id === G.id || li.gridId === G.id
697
+ )) == null ? void 0 : ei.map(({ i: li }) => li), bi = vi.length ? Math.max(...vi) + 1 : L + 1, si = yi(), H = Z(G, {});
698
+ H.id = si;
699
+ const I = U.filter((li) => li.gridId === G.id), di = I == null ? void 0 : I.map(
700
+ (li) => Z(li, { gridId: si })
700
701
  ), ui = [
701
702
  ...U.slice(0, bi),
702
703
  H,
703
- ...li,
704
+ ...di,
704
705
  ...U.slice(bi)
705
706
  ];
706
- return { ...I, questionData: ui };
707
+ return { ...D, questionData: ui };
707
708
  } else {
708
- const vi = q(
709
+ const vi = Z(
709
710
  G,
710
711
  G.gridId ? { gridId: G.gridId } : {}
711
712
  ), bi = [
@@ -713,13 +714,13 @@ const pi = ro(void 0), oe = {
713
714
  vi,
714
715
  ...U.slice(L + 1)
715
716
  ];
716
- return { ...I, questionData: bi };
717
+ return { ...D, questionData: bi };
717
718
  }
718
719
  })
719
720
  );
720
721
  },
721
722
  [l, d]
722
- ), N = ri.useCallback(
723
+ ), S = ri.useCallback(
723
724
  (M, E) => {
724
725
  d(
725
726
  (P) => P == null ? void 0 : P.map(
@@ -728,7 +729,7 @@ const pi = ro(void 0), oe = {
728
729
  );
729
730
  },
730
731
  []
731
- ), S = ri.useCallback((M, E) => {
732
+ ), N = ri.useCallback((M, E) => {
732
733
  d(
733
734
  (P) => P == null ? void 0 : P.map(
734
735
  (L) => L.id === E ? {
@@ -737,7 +738,7 @@ const pi = ro(void 0), oe = {
737
738
  } : L
738
739
  )
739
740
  );
740
- }, []), A = ri.useCallback(
741
+ }, []), y = ri.useCallback(
741
742
  (M, E, P) => {
742
743
  d(
743
744
  (L) => L == null ? void 0 : L.map(
@@ -753,21 +754,21 @@ const pi = ro(void 0), oe = {
753
754
  );
754
755
  },
755
756
  []
756
- ), C = ri.useCallback(
757
+ ), k = ri.useCallback(
757
758
  (M, E, P) => {
758
759
  d(
759
760
  (L) => L == null ? void 0 : L.map(
760
761
  (G) => {
761
- var q;
762
+ var Z;
762
763
  return G.id === P ? {
763
764
  ...G,
764
- questionData: (q = G.questionData) == null ? void 0 : q.map(
765
+ questionData: (Z = G.questionData) == null ? void 0 : Z.map(
765
766
  (w) => {
766
- var I;
767
+ var D;
767
768
  return w.type === "grid" && w.gridData ? {
768
769
  ...w,
769
- gridData: (I = w.gridData) == null ? void 0 : I.map(
770
- (U, ni) => ni === M ? {
770
+ gridData: (D = w.gridData) == null ? void 0 : D.map(
771
+ (U, ei) => ei === M ? {
771
772
  ...U,
772
773
  ...E
773
774
  } : U
@@ -791,7 +792,7 @@ const pi = ro(void 0), oe = {
791
792
  return L.id === E ? {
792
793
  ...L,
793
794
  questionData: (G = L.questionData) == null ? void 0 : G.map(
794
- (q) => q.id === M.id ? { ...q, ...M } : q
795
+ (Z) => Z.id === M.id ? { ...Z, ...M } : Z
795
796
  )
796
797
  } : L;
797
798
  }
@@ -804,50 +805,50 @@ const pi = ro(void 0), oe = {
804
805
  sectionId: P,
805
806
  targetIndex: L,
806
807
  targetId: G,
807
- targetGridId: q,
808
+ targetGridId: Z,
808
809
  targetCol: w
809
810
  } = M;
810
811
  d(
811
- (I) => I.map((U) => {
812
+ (D) => D.map((U) => {
812
813
  if (U.id !== P) return U;
813
- const ni = [...U.questionData], vi = ni.findIndex((ai) => ai.id === E);
814
+ const ei = [...U.questionData], vi = ei.findIndex((si) => si.id === E);
814
815
  if (vi === -1) return U;
815
- const bi = { ...ni[vi] };
816
- if (q !== void 0 && w !== void 0) {
816
+ const bi = { ...ei[vi] };
817
+ if (Z !== void 0 && w !== void 0) {
817
818
  if (bi.type === "grid") return U;
818
- const ai = ni.findIndex(
819
- (D) => {
820
- var li;
821
- return D.id !== E && D.gridId === q && ((li = D.gridPosition) == null ? void 0 : li.col) === w;
819
+ const si = ei.findIndex(
820
+ (I) => {
821
+ var di;
822
+ return I.id !== E && I.gridId === Z && ((di = I.gridPosition) == null ? void 0 : di.col) === w;
822
823
  }
823
824
  );
824
- let H = ni.map(
825
- (D) => D.id === E ? {
826
- ...D,
827
- gridId: q,
825
+ let H = ei.map(
826
+ (I) => I.id === E ? {
827
+ ...I,
828
+ gridId: Z,
828
829
  gridPosition: { col: w }
829
- } : D
830
+ } : I
830
831
  );
831
- return ai !== -1 && (H = H.map((D, li) => {
832
- if (li !== ai) return D;
833
- const ui = { ...D };
832
+ return si !== -1 && (H = H.map((I, di) => {
833
+ if (di !== si) return I;
834
+ const ui = { ...I };
834
835
  return delete ui.gridId, delete ui.gridPosition, ui;
835
836
  })), { ...U, questionData: H };
836
837
  }
837
- if (bi.gridId && L !== void 0 && q === void 0) {
838
- const ai = { ...bi };
839
- delete ai.gridId, delete ai.gridPosition;
840
- const H = ni.filter((li) => li.id !== E), D = Math.min(L, H.length);
841
- return H.splice(D, 0, ai), { ...U, questionData: H };
838
+ if (bi.gridId && L !== void 0 && Z === void 0) {
839
+ const si = { ...bi };
840
+ delete si.gridId, delete si.gridPosition;
841
+ const H = ei.filter((di) => di.id !== E), I = Math.min(L, H.length);
842
+ return H.splice(I, 0, si), { ...U, questionData: H };
842
843
  }
843
- if (!bi.gridId && L !== void 0 && q === void 0 && !G) {
844
- ni.splice(vi, 1);
845
- const ai = Math.min(L, ni.length);
846
- return ni.splice(ai, 0, bi), { ...U, questionData: ni };
844
+ if (!bi.gridId && L !== void 0 && Z === void 0 && !G) {
845
+ ei.splice(vi, 1);
846
+ const si = Math.min(L, ei.length);
847
+ return ei.splice(si, 0, bi), { ...U, questionData: ei };
847
848
  }
848
849
  if (G) {
849
- const ai = ni.findIndex((H) => H.id === G);
850
- return ai === -1 ? U : (ni.splice(vi, 1), ni.splice(ai, 0, bi), { ...U, questionData: ni });
850
+ const si = ei.findIndex((H) => H.id === G);
851
+ return si === -1 ? U : (ei.splice(vi, 1), ei.splice(si, 0, bi), { ...U, questionData: ei });
851
852
  }
852
853
  return U;
853
854
  })
@@ -863,7 +864,7 @@ const pi = ro(void 0), oe = {
863
864
  } : L
864
865
  )
865
866
  );
866
- }, []), Z = ii(
867
+ }, []), q = ni(
867
868
  () => ({
868
869
  formData: l,
869
870
  setFormData: d,
@@ -871,9 +872,9 @@ const pi = ro(void 0), oe = {
871
872
  removeElement: x,
872
873
  elementData: s,
873
874
  setElementData: a,
874
- updateElementPosition: N,
875
- addElement: S,
876
- addElementInPosition: A,
875
+ updateElementPosition: S,
876
+ addElement: N,
877
+ addElementInPosition: y,
877
878
  updateElement: K,
878
879
  addSection: m,
879
880
  removeSection: p,
@@ -884,11 +885,11 @@ const pi = ro(void 0), oe = {
884
885
  setSelectedSection: c,
885
886
  activeSections: h,
886
887
  setActiveSections: v,
887
- updateGridElement: C,
888
+ updateGridElement: k,
888
889
  answerData: e,
889
890
  setAnswerData: o,
890
891
  uploadUrl: g,
891
- setUploadUrl: y,
892
+ setUploadUrl: A,
892
893
  duplicateElement: j,
893
894
  moveElement: Q
894
895
  }),
@@ -897,9 +898,9 @@ const pi = ro(void 0), oe = {
897
898
  f,
898
899
  x,
899
900
  s,
900
- N,
901
901
  S,
902
- A,
902
+ N,
903
+ y,
903
904
  K,
904
905
  m,
905
906
  p,
@@ -907,14 +908,14 @@ const pi = ro(void 0), oe = {
907
908
  t,
908
909
  r,
909
910
  h,
910
- C,
911
+ k,
911
912
  e,
912
913
  g,
913
914
  j,
914
915
  Q
915
916
  ]
916
917
  );
917
- return /* @__PURE__ */ n.jsx(pi.Provider, { value: Z, children: i });
918
+ return /* @__PURE__ */ n.jsx(gi.Provider, { value: q, children: i });
918
919
  };
919
920
  function Ne(i) {
920
921
  var e, o, s = "";
@@ -1349,18 +1350,18 @@ function le(i) {
1349
1350
  return o.icons[s] || (o.missing.has(s) ? null : void 0);
1350
1351
  }
1351
1352
  }
1352
- function Io(i, e) {
1353
+ function Do(i, e) {
1353
1354
  const o = ln(i, !0, Ui);
1354
1355
  if (!o) return !1;
1355
1356
  const s = Oi(o.provider, o.prefix);
1356
1357
  return e ? Ro(s, o.name, e) : (s.missing.add(o.name), !0);
1357
1358
  }
1358
- function Do(i, e) {
1359
+ function Io(i, e) {
1359
1360
  if (typeof i != "object") return !1;
1360
1361
  if (typeof e != "string" && (e = i.provider || ""), Ui && !e && !i.prefix) {
1361
1362
  let a = !1;
1362
1363
  return Ce(i) && (i.prefix = "", ke(i, (l, d) => {
1363
- Io(l, d) && (a = !0);
1364
+ Do(l, d) && (a = !0);
1364
1365
  })), a;
1365
1366
  }
1366
1367
  const o = i.prefix;
@@ -1436,19 +1437,19 @@ function Wo(i, e) {
1436
1437
  const m = [], p = f.hFlip, x = f.vFlip;
1437
1438
  let j = f.rotate;
1438
1439
  p ? x ? j += 2 : (m.push("translate(" + (a.width + a.left).toString() + " " + (0 - a.top).toString() + ")"), m.push("scale(-1 1)"), a.top = a.left = 0) : x && (m.push("translate(" + (0 - a.left).toString() + " " + (a.height + a.top).toString() + ")"), m.push("scale(1 -1)"), a.top = a.left = 0);
1439
- let N;
1440
+ let S;
1440
1441
  switch (j < 0 && (j -= Math.floor(j / 4) * 4), j = j % 4, j) {
1441
1442
  case 1:
1442
- N = a.height / 2 + a.top, m.unshift("rotate(90 " + N.toString() + " " + N.toString() + ")");
1443
+ S = a.height / 2 + a.top, m.unshift("rotate(90 " + S.toString() + " " + S.toString() + ")");
1443
1444
  break;
1444
1445
  case 2:
1445
1446
  m.unshift("rotate(180 " + (a.width / 2 + a.left).toString() + " " + (a.height / 2 + a.top).toString() + ")");
1446
1447
  break;
1447
1448
  case 3:
1448
- N = a.width / 2 + a.left, m.unshift("rotate(-90 " + N.toString() + " " + N.toString() + ")");
1449
+ S = a.width / 2 + a.left, m.unshift("rotate(-90 " + S.toString() + " " + S.toString() + ")");
1449
1450
  break;
1450
1451
  }
1451
- j % 2 === 1 && (a.left !== a.top && (N = a.left, a.left = a.top, a.top = N), a.width !== a.height && (N = a.width, a.width = a.height, a.height = N)), m.length && (l = Vo(l, '<g transform="' + m.join(" ") + '">', "</g>"));
1452
+ j % 2 === 1 && (a.left !== a.top && (S = a.left, a.left = a.top, a.top = S), a.width !== a.height && (S = a.width, a.width = a.height, a.height = S)), m.length && (l = Vo(l, '<g transform="' + m.join(" ") + '">', "</g>"));
1452
1453
  });
1453
1454
  const d = s.width, t = s.height, u = a.width, r = a.height;
1454
1455
  let c, h;
@@ -1457,15 +1458,15 @@ function Wo(i, e) {
1457
1458
  Fo(m) || (v[f] = m.toString());
1458
1459
  };
1459
1460
  g("width", c), g("height", h);
1460
- const y = [
1461
+ const A = [
1461
1462
  a.left,
1462
1463
  a.top,
1463
1464
  u,
1464
1465
  r
1465
1466
  ];
1466
- return v.viewBox = y.join(" "), {
1467
+ return v.viewBox = A.join(" "), {
1467
1468
  attributes: v,
1468
- viewBox: y,
1469
+ viewBox: A,
1469
1470
  body: l
1470
1471
  };
1471
1472
  }
@@ -1507,21 +1508,21 @@ function Ln(i) {
1507
1508
  const Pn = /* @__PURE__ */ Object.create(null), Vi = ["https://api.simplesvg.com", "https://api.unisvg.com"], Qi = [];
1508
1509
  for (; Vi.length > 0; ) Vi.length === 1 || Math.random() > 0.5 ? Qi.push(Vi.shift()) : Qi.push(Vi.pop());
1509
1510
  Pn[""] = Ln({ resources: ["https://api.iconify.design"].concat(Qi) });
1510
- function Zo(i, e) {
1511
+ function qo(i, e) {
1511
1512
  const o = Ln(e);
1512
1513
  return o === null ? !1 : (Pn[i] = o, !0);
1513
1514
  }
1514
1515
  function wn(i) {
1515
1516
  return Pn[i];
1516
1517
  }
1517
- const qo = () => {
1518
+ const Zo = () => {
1518
1519
  let i;
1519
1520
  try {
1520
1521
  if (i = fetch, typeof i == "function") return i;
1521
1522
  } catch (e) {
1522
1523
  }
1523
1524
  };
1524
- let ue = qo();
1525
+ let ue = Zo();
1525
1526
  function $o(i, e) {
1526
1527
  const o = wn(i);
1527
1528
  if (!o) return 0;
@@ -1706,26 +1707,26 @@ function ta(i, e, o, s) {
1706
1707
  const a = i.resources.length, l = i.random ? Math.floor(Math.random() * a) : i.index;
1707
1708
  let d;
1708
1709
  if (i.random) {
1709
- let A = i.resources.slice(0);
1710
- for (d = []; A.length > 1; ) {
1711
- const C = Math.floor(Math.random() * A.length);
1712
- d.push(A[C]), A = A.slice(0, C).concat(A.slice(C + 1));
1710
+ let y = i.resources.slice(0);
1711
+ for (d = []; y.length > 1; ) {
1712
+ const k = Math.floor(Math.random() * y.length);
1713
+ d.push(y[k]), y = y.slice(0, k).concat(y.slice(k + 1));
1713
1714
  }
1714
- d = d.concat(A);
1715
+ d = d.concat(y);
1715
1716
  } else d = i.resources.slice(l).concat(i.resources.slice(0, l));
1716
1717
  const t = Date.now();
1717
1718
  let u = "pending", r = 0, c, h = null, v = [], g = [];
1718
1719
  typeof s == "function" && g.push(s);
1719
- function y() {
1720
+ function A() {
1720
1721
  h && (clearTimeout(h), h = null);
1721
1722
  }
1722
1723
  function f() {
1723
- u === "pending" && (u = "aborted"), y(), v.forEach((A) => {
1724
- A.status === "pending" && (A.status = "aborted");
1724
+ u === "pending" && (u = "aborted"), A(), v.forEach((y) => {
1725
+ y.status === "pending" && (y.status = "aborted");
1725
1726
  }), v = [];
1726
1727
  }
1727
- function m(A, C) {
1728
- C && (g = []), typeof A == "function" && g.push(A);
1728
+ function m(y, k) {
1729
+ k && (g = []), typeof y == "function" && g.push(y);
1729
1730
  }
1730
1731
  function p() {
1731
1732
  return {
@@ -1739,18 +1740,18 @@ function ta(i, e, o, s) {
1739
1740
  };
1740
1741
  }
1741
1742
  function x() {
1742
- u = "failed", g.forEach((A) => {
1743
- A(void 0, c);
1743
+ u = "failed", g.forEach((y) => {
1744
+ y(void 0, c);
1744
1745
  });
1745
1746
  }
1746
1747
  function j() {
1747
- v.forEach((A) => {
1748
- A.status === "pending" && (A.status = "aborted");
1748
+ v.forEach((y) => {
1749
+ y.status === "pending" && (y.status = "aborted");
1749
1750
  }), v = [];
1750
1751
  }
1751
- function N(A, C, K) {
1752
- const Q = C !== "success";
1753
- switch (v = v.filter((W) => W !== A), u) {
1752
+ function S(y, k, K) {
1753
+ const Q = k !== "success";
1754
+ switch (v = v.filter((W) => W !== y), u) {
1754
1755
  case "pending":
1755
1756
  break;
1756
1757
  case "failed":
@@ -1759,46 +1760,46 @@ function ta(i, e, o, s) {
1759
1760
  default:
1760
1761
  return;
1761
1762
  }
1762
- if (C === "abort") {
1763
+ if (k === "abort") {
1763
1764
  c = K, x();
1764
1765
  return;
1765
1766
  }
1766
1767
  if (Q) {
1767
- c = K, v.length || (d.length ? S() : x());
1768
+ c = K, v.length || (d.length ? N() : x());
1768
1769
  return;
1769
1770
  }
1770
- if (y(), j(), !i.random) {
1771
- const W = i.resources.indexOf(A.resource);
1771
+ if (A(), j(), !i.random) {
1772
+ const W = i.resources.indexOf(y.resource);
1772
1773
  W !== -1 && W !== i.index && (i.index = W);
1773
1774
  }
1774
1775
  u = "completed", g.forEach((W) => {
1775
1776
  W(K);
1776
1777
  });
1777
1778
  }
1778
- function S() {
1779
+ function N() {
1779
1780
  if (u !== "pending") return;
1780
- y();
1781
- const A = d.shift();
1782
- if (A === void 0) {
1781
+ A();
1782
+ const y = d.shift();
1783
+ if (y === void 0) {
1783
1784
  if (v.length) {
1784
1785
  h = setTimeout(() => {
1785
- y(), u === "pending" && (j(), x());
1786
+ A(), u === "pending" && (j(), x());
1786
1787
  }, i.timeout);
1787
1788
  return;
1788
1789
  }
1789
1790
  x();
1790
1791
  return;
1791
1792
  }
1792
- const C = {
1793
+ const k = {
1793
1794
  status: "pending",
1794
- resource: A,
1795
+ resource: y,
1795
1796
  callback: (K, Q) => {
1796
- N(C, K, Q);
1797
+ S(k, K, Q);
1797
1798
  }
1798
1799
  };
1799
- v.push(C), r++, h = setTimeout(S, i.rotate), o(A, e, C.callback);
1800
+ v.push(k), r++, h = setTimeout(N, i.rotate), o(y, e, k.callback);
1800
1801
  }
1801
- return setTimeout(S), p;
1802
+ return setTimeout(N), p;
1802
1803
  }
1803
1804
  function we(i) {
1804
1805
  const e = {
@@ -2050,7 +2051,7 @@ const Re = {
2050
2051
  display: "inline-block"
2051
2052
  }, Mn = {
2052
2053
  backgroundColor: "currentColor"
2053
- }, Ie = {
2054
+ }, De = {
2054
2055
  backgroundColor: "transparent"
2055
2056
  }, me = {
2056
2057
  Image: "var(--svg)",
@@ -2059,7 +2060,7 @@ const Re = {
2059
2060
  }, be = {
2060
2061
  WebkitMask: Mn,
2061
2062
  mask: Mn,
2062
- background: Ie
2063
+ background: De
2063
2064
  };
2064
2065
  for (const i in be) {
2065
2066
  const e = be[i];
@@ -2149,7 +2150,7 @@ const Ea = (i, e, o) => {
2149
2150
  __html: ka(Jo(r.body, p ? () => p + "ID" + m++ : "iconifyReact"))
2150
2151
  }, Sn("svg", u);
2151
2152
  }
2152
- const { body: h, width: v, height: g } = i, y = l === "mask" || (l === "bg" ? !1 : h.indexOf("currentColor") !== -1), f = ya(h, {
2153
+ const { body: h, width: v, height: g } = i, A = l === "mask" || (l === "bg" ? !1 : h.indexOf("currentColor") !== -1), f = ya(h, {
2153
2154
  ...c,
2154
2155
  width: v + "",
2155
2156
  height: g + ""
@@ -2160,7 +2161,7 @@ const Ea = (i, e, o) => {
2160
2161
  width: ve(c.width),
2161
2162
  height: ve(c.height),
2162
2163
  ...Ma,
2163
- ...y ? Mn : Ie,
2164
+ ...A ? Mn : De,
2164
2165
  ...t
2165
2166
  }, Sn("span", u);
2166
2167
  };
@@ -2175,7 +2176,7 @@ if (typeof document != "undefined" && typeof window != "undefined") {
2175
2176
  // Check if item is an object and not null/array
2176
2177
  (typeof s != "object" || s === null || s instanceof Array || // Check for 'icons' and 'prefix'
2177
2178
  typeof s.icons != "object" || typeof s.prefix != "string" || // Add icon set
2178
- !Do(s)) && console.error(o);
2179
+ !Io(s)) && console.error(o);
2179
2180
  } catch (a) {
2180
2181
  console.error(o);
2181
2182
  }
@@ -2190,27 +2191,27 @@ if (typeof document != "undefined" && typeof window != "undefined") {
2190
2191
  const a = e[o];
2191
2192
  if (typeof a != "object" || !a || a.resources === void 0)
2192
2193
  continue;
2193
- Zo(o, a) || console.error(s);
2194
+ qo(o, a) || console.error(s);
2194
2195
  } catch (a) {
2195
2196
  console.error(s);
2196
2197
  }
2197
2198
  }
2198
2199
  }
2199
2200
  }
2200
- function De(i) {
2201
+ function Ie(i) {
2201
2202
  const [e, o] = R(!!i.ssr), [s, a] = R({});
2202
2203
  function l(g) {
2203
2204
  if (g) {
2204
- const y = i.icon;
2205
- if (typeof y == "object")
2205
+ const A = i.icon;
2206
+ if (typeof A == "object")
2206
2207
  return {
2207
2208
  name: "",
2208
- data: y
2209
+ data: A
2209
2210
  };
2210
- const f = le(y);
2211
+ const f = le(A);
2211
2212
  if (f)
2212
2213
  return {
2213
- name: y,
2214
+ name: A,
2214
2215
  data: f
2215
2216
  };
2216
2217
  }
@@ -2229,25 +2230,25 @@ function De(i) {
2229
2230
  }
2230
2231
  function c() {
2231
2232
  var g;
2232
- const y = i.icon;
2233
- if (typeof y == "object") {
2233
+ const A = i.icon;
2234
+ if (typeof A == "object") {
2234
2235
  r({
2235
2236
  name: "",
2236
- data: y
2237
+ data: A
2237
2238
  });
2238
2239
  return;
2239
2240
  }
2240
- const f = le(y);
2241
+ const f = le(A);
2241
2242
  if (r({
2242
- name: y,
2243
+ name: A,
2243
2244
  data: f
2244
2245
  }))
2245
2246
  if (f === void 0) {
2246
- const m = ha([y], c);
2247
+ const m = ha([A], c);
2247
2248
  a({
2248
2249
  callback: m
2249
2250
  });
2250
- } else f && ((g = i.onLoad) === null || g === void 0 || g.call(i, y));
2251
+ } else f && ((g = i.onLoad) === null || g === void 0 || g.call(i, A));
2251
2252
  }
2252
2253
  O(() => (o(!0), u), []), O(() => {
2253
2254
  e && c();
@@ -2258,11 +2259,11 @@ function De(i) {
2258
2259
  ...v
2259
2260
  }, i, h) : i.children ? i.children : i.fallback ? i.fallback : Sn("span", {});
2260
2261
  }
2261
- const Oe = ye((i, e) => De({
2262
+ const Oe = ye((i, e) => Ie({
2262
2263
  ...i,
2263
2264
  _ref: e
2264
2265
  }));
2265
- ye((i, e) => De({
2266
+ ye((i, e) => Ie({
2266
2267
  inline: !0,
2267
2268
  ...i,
2268
2269
  _ref: e
@@ -2284,7 +2285,7 @@ function Rn({
2284
2285
  setValue: d,
2285
2286
  isReadOnly: t,
2286
2287
  watch: u
2287
- } = e || {}, r = ii(
2288
+ } = e || {}, r = ni(
2288
2289
  () => s == null ? void 0 : s.map((h) => h.label).join(", "),
2289
2290
  [s]
2290
2291
  );
@@ -2301,7 +2302,7 @@ function Rn({
2301
2302
  };
2302
2303
  }
2303
2304
  }, [u, i.id]), /* @__PURE__ */ n.jsx("div", { className: "custom-select", children: /* @__PURE__ */ n.jsx(
2304
- oi,
2305
+ ai,
2305
2306
  {
2306
2307
  value: s || [],
2307
2308
  onChange: (h) => {
@@ -2312,7 +2313,7 @@ function Rn({
2312
2313
  by: "value",
2313
2314
  children: /* @__PURE__ */ n.jsxs("div", { className: "custom-select__wrapper", children: [
2314
2315
  /* @__PURE__ */ n.jsxs(
2315
- oi.Button,
2316
+ ai.Button,
2316
2317
  {
2317
2318
  className: "custom-select__control field-control",
2318
2319
  disabled: t,
@@ -2322,14 +2323,14 @@ function Rn({
2322
2323
  ]
2323
2324
  }
2324
2325
  ),
2325
- /* @__PURE__ */ n.jsx(Ri, { as: qi, leave: "custom-select__transition", children: /* @__PURE__ */ n.jsx(
2326
- oi.Options,
2326
+ /* @__PURE__ */ n.jsx(Ri, { as: Zi, leave: "custom-select__transition", children: /* @__PURE__ */ n.jsx(
2327
+ ai.Options,
2327
2328
  {
2328
2329
  anchor: "bottom start",
2329
2330
  className: "custom-select__options",
2330
2331
  children: (c = i == null ? void 0 : i.options) == null ? void 0 : c.map(
2331
2332
  (h, v) => /* @__PURE__ */ n.jsx(
2332
- oi.Option,
2333
+ ai.Option,
2333
2334
  {
2334
2335
  value: h,
2335
2336
  className: ({ active: g }) => `custom-select__option ${g ? "custom-select__option--active" : ""}`,
@@ -2383,10 +2384,10 @@ function Ke({
2383
2384
  }, [i]), O(() => {
2384
2385
  if (l === "pdf" && (i != null && i.startsWith("data:")))
2385
2386
  try {
2386
- const g = atob(i.split(",")[1]), y = new ArrayBuffer(g.length), f = new Uint8Array(y);
2387
+ const g = atob(i.split(",")[1]), A = new ArrayBuffer(g.length), f = new Uint8Array(A);
2387
2388
  for (let x = 0; x < g.length; x++)
2388
2389
  f[x] = g.charCodeAt(x);
2389
- const m = new Blob([y], { type: "application/pdf" }), p = URL.createObjectURL(m);
2390
+ const m = new Blob([A], { type: "application/pdf" }), p = URL.createObjectURL(m);
2390
2391
  return u(p), () => URL.revokeObjectURL(p);
2391
2392
  } catch (g) {
2392
2393
  console.error("Error creating blob URL:", g);
@@ -2397,15 +2398,15 @@ function Ke({
2397
2398
  const r = () => {
2398
2399
  l === "image" || l === "pdf" ? a(!0) : window.open(t || i, "_blank");
2399
2400
  }, c = () => a(!1), h = e || (i == null ? void 0 : i.split("/").pop()) || "Unknown file";
2400
- function v(g, y = "download") {
2401
+ function v(g, A = "download") {
2401
2402
  if (!g) return;
2402
2403
  if (g.startsWith("data:")) {
2403
2404
  const m = document.createElement("a");
2404
- m.href = g, m.download = y, document.body.appendChild(m), m.click(), document.body.removeChild(m);
2405
+ m.href = g, m.download = A, document.body.appendChild(m), m.click(), document.body.removeChild(m);
2405
2406
  return;
2406
2407
  }
2407
2408
  const f = document.createElement("a");
2408
- f.href = g, f.setAttribute("download", y), document.body.appendChild(f), f.click(), document.body.removeChild(f);
2409
+ f.href = g, f.setAttribute("download", A), document.body.appendChild(f), f.click(), document.body.removeChild(f);
2409
2410
  }
2410
2411
  return /* @__PURE__ */ n.jsxs("div", { className: "mt-2 field-control !py-1 !bg-gray-50 !flex justify-between gap-x-8 items-center", children: [
2411
2412
  /* @__PURE__ */ n.jsxs(
@@ -2485,7 +2486,7 @@ function Ke({
2485
2486
  )
2486
2487
  ] });
2487
2488
  }
2488
- const fi = (i) => {
2489
+ const xi = (i) => {
2489
2490
  const e = typeof window != "undefined" ? localStorage.getItem(i) : "";
2490
2491
  try {
2491
2492
  return JSON.parse(e);
@@ -2504,89 +2505,89 @@ function Ra({
2504
2505
  list: a = null,
2505
2506
  accept: l = []
2506
2507
  }) {
2507
- const { uploadUrl: d } = Ni(pi), t = Ii(null), [u, r] = R(a), [c, h] = R(!1);
2508
+ const { uploadUrl: d } = ji(gi), t = Di(null), [u, r] = R(a), [c, h] = R(!1);
2508
2509
  O(() => {
2509
2510
  r(a);
2510
2511
  }, [a]);
2511
- const v = ii(
2512
- () => l == null ? void 0 : l.map((N) => N.value).join(", "),
2512
+ const v = ni(
2513
+ () => l == null ? void 0 : l.map((S) => S.value).join(", "),
2513
2514
  [l]
2514
- ), g = ii(
2515
- () => l == null ? void 0 : l.map((N) => N.label).join(", "),
2515
+ ), g = ni(
2516
+ () => l == null ? void 0 : l.map((S) => S.label).join(", "),
2516
2517
  [l]
2517
- ), y = Y(
2518
- async (N) => {
2519
- var A;
2520
- const S = fi("token");
2518
+ ), A = Y(
2519
+ async (S) => {
2520
+ var y;
2521
+ const N = xi("token");
2521
2522
  try {
2522
- const { data: C } = await Di.post(d, N, {
2523
+ const { data: k } = await Ii.post(d, S, {
2523
2524
  headers: {
2524
- Authorization: `Bearer ${S}`
2525
+ Authorization: `Bearer ${N}`
2525
2526
  }
2526
2527
  });
2527
- return (A = C == null ? void 0 : C.data) == null ? void 0 : A.url;
2528
- } catch (C) {
2529
- throw console.error("File upload error:", C), new Error("Failed to upload file to server");
2528
+ return (y = k == null ? void 0 : k.data) == null ? void 0 : y.url;
2529
+ } catch (k) {
2530
+ throw console.error("File upload error:", k), new Error("Failed to upload file to server");
2530
2531
  }
2531
2532
  },
2532
2533
  [d]
2533
2534
  ), f = Y(
2534
- (N) => new Promise((S, A) => {
2535
- const C = new FileReader();
2536
- C.onloadend = async () => {
2535
+ (S) => new Promise((N, y) => {
2536
+ const k = new FileReader();
2537
+ k.onloadend = async () => {
2537
2538
  try {
2538
- const K = C.result.replace(
2539
+ const K = k.result.replace(
2539
2540
  /^data:.*;base64,/,
2540
2541
  ""
2541
- ), Q = d ? await y({
2542
+ ), Q = d ? await A({
2542
2543
  base64: K,
2543
- ext: `.${N.name.split(".").pop()}`,
2544
- fileName: N.name
2545
- }) : C.result;
2546
- S({
2544
+ ext: `.${S.name.split(".").pop()}`,
2545
+ fileName: S.name
2546
+ }) : k.result;
2547
+ N({
2547
2548
  base64: Q,
2548
- type: N.type,
2549
- name: N.name
2549
+ type: S.type,
2550
+ name: S.name
2550
2551
  });
2551
2552
  } catch (K) {
2552
- A(K);
2553
+ y(K);
2553
2554
  }
2554
- }, C.onerror = () => A(new Error("File read failed")), C.readAsDataURL(N);
2555
+ }, k.onerror = () => y(new Error("File read failed")), k.readAsDataURL(S);
2555
2556
  }),
2556
- [d, y]
2557
+ [d, A]
2557
2558
  ), m = Y(
2558
- (N) => {
2559
- var A;
2560
- const S = v ? (A = v.split(",")) == null ? void 0 : A.map((C) => C.trim()) : [];
2561
- for (const C of N) {
2562
- if (C.size > wa)
2563
- return Si.error(
2564
- `File "${C.name}" exceeds 5MB limit (${(C.size / 1024 / 1024).toFixed(2)}MB)`
2559
+ (S) => {
2560
+ var y;
2561
+ const N = v ? (y = v.split(",")) == null ? void 0 : y.map((k) => k.trim()) : [];
2562
+ for (const k of S) {
2563
+ if (k.size > wa)
2564
+ return Ni.error(
2565
+ `File "${k.name}" exceeds 5MB limit (${(k.size / 1024 / 1024).toFixed(2)}MB)`
2565
2566
  ), !1;
2566
- if (S.length && !S.some(
2567
- (K) => C.type === K || C.name.toLowerCase().endsWith(K.replace("*", ""))
2567
+ if (N.length && !N.some(
2568
+ (K) => k.type === K || k.name.toLowerCase().endsWith(K.replace("*", ""))
2568
2569
  ))
2569
- return Si.error(
2570
- `File "${C.name}" is not an allowed type. Allowed: ${g || "any"}`
2570
+ return Ni.error(
2571
+ `File "${k.name}" is not an allowed type. Allowed: ${g || "any"}`
2571
2572
  ), !1;
2572
2573
  }
2573
2574
  return !0;
2574
2575
  },
2575
2576
  [v, g]
2576
2577
  ), p = Y(
2577
- async (N) => {
2578
- const S = Array.from(N.target.files || []);
2579
- if (!(!S.length || c)) {
2580
- if (!m(S)) {
2578
+ async (S) => {
2579
+ const N = Array.from(S.target.files || []);
2580
+ if (!(!N.length || c)) {
2581
+ if (!m(N)) {
2581
2582
  t.current && (t.current.value = "");
2582
2583
  return;
2583
2584
  }
2584
2585
  try {
2585
2586
  h(!0);
2586
- const A = await Promise.all(S == null ? void 0 : S.map(f)), C = s && u ? [...u, ...A] : A;
2587
- r(C), i(C), Si.success(`Successfully uploaded ${S.length} file(s)`);
2588
- } catch (A) {
2589
- console.error("Upload error:", A), Si.error("Failed to upload file(s). Please try again.");
2587
+ const y = await Promise.all(N == null ? void 0 : N.map(f)), k = s && u ? [...u, ...y] : y;
2588
+ r(k), i(k), Ni.success(`Successfully uploaded ${N.length} file(s)`);
2589
+ } catch (y) {
2590
+ console.error("Upload error:", y), Ni.error("Failed to upload file(s). Please try again.");
2590
2591
  } finally {
2591
2592
  h(!1), t.current && (t.current.value = "");
2592
2593
  }
@@ -2594,10 +2595,10 @@ function Ra({
2594
2595
  },
2595
2596
  [c, m, f, i, s, u]
2596
2597
  ), x = Y(
2597
- (N) => {
2598
- c || (t.current && (t.current.value = ""), r((S) => {
2599
- const A = N === void 0 ? null : (S == null ? void 0 : S.filter((C, K) => K !== N)) || null;
2600
- return i(A), A;
2598
+ (S) => {
2599
+ c || (t.current && (t.current.value = ""), r((N) => {
2600
+ const y = S === void 0 ? null : (N == null ? void 0 : N.filter((k, K) => K !== S)) || null;
2601
+ return i(y), y;
2601
2602
  }), o == null || o());
2602
2603
  },
2603
2604
  [o, i, c]
@@ -2637,19 +2638,19 @@ function Ra({
2637
2638
  /* @__PURE__ */ n.jsx("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
2638
2639
  "Uploading..."
2639
2640
  ] }) }),
2640
- typeof u == "object" && (u == null ? void 0 : u.map((N, S) => /* @__PURE__ */ n.jsx(
2641
+ typeof u == "object" && (u == null ? void 0 : u.map((S, N) => /* @__PURE__ */ n.jsx(
2641
2642
  Ke,
2642
2643
  {
2643
- fileUrl: N.base64,
2644
- fileName: N.name,
2645
- removeFile: () => x(S)
2644
+ fileUrl: S.base64,
2645
+ fileName: S.name,
2646
+ removeFile: () => x(N)
2646
2647
  },
2647
- `${N.name}-${S}`
2648
+ `${S.name}-${N}`
2648
2649
  )))
2649
2650
  ] })
2650
2651
  ] });
2651
2652
  }
2652
- function Ia({ element: i, validationData: e }) {
2653
+ function Da({ element: i, validationData: e }) {
2653
2654
  var c;
2654
2655
  const [o, s] = R((c = i == null ? void 0 : i.value) != null ? c : null), {
2655
2656
  register: a = () => ({}),
@@ -2693,7 +2694,7 @@ function Ia({ element: i, validationData: e }) {
2693
2694
  o && d && /* @__PURE__ */ n.jsx("div", { className: "relative grid gap-y-1 flex-1 w-full", children: typeof o == "object" && (o == null ? void 0 : o.map((h, v) => /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx(Ke, { fileUrl: h.base64, fileName: h.name }) }, v))) })
2694
2695
  ] });
2695
2696
  }
2696
- function Da({
2697
+ function Ia({
2697
2698
  element: i,
2698
2699
  validationData: e
2699
2700
  }) {
@@ -2724,11 +2725,12 @@ const F = ({
2724
2725
  prefix: h,
2725
2726
  disabled: v,
2726
2727
  watch: g,
2727
- min: y,
2728
- max: f
2728
+ min: A,
2729
+ max: f,
2730
+ description: m
2729
2731
  }) => {
2730
- var p, x, j, N;
2731
- const m = o ? { ...o(e) } : {};
2732
+ var x, j, S, N;
2733
+ const p = o ? { ...o(e) } : {};
2732
2734
  if (l === "amount")
2733
2735
  return /* @__PURE__ */ n.jsxs("div", { className: "space-y-1.5 relative", children: [
2734
2736
  /* @__PURE__ */ n.jsx(
@@ -2741,8 +2743,8 @@ const F = ({
2741
2743
  /* @__PURE__ */ n.jsx(
2742
2744
  sn,
2743
2745
  {
2744
- onValueChange: (S) => {
2745
- u(e, S != null ? S : null), o && o(e), c && c(e);
2746
+ onValueChange: (y) => {
2747
+ u(e, y != null ? y : null), o && o(e), c && c(e);
2746
2748
  },
2747
2749
  placeholder: d,
2748
2750
  className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"}`,
@@ -2752,27 +2754,31 @@ const F = ({
2752
2754
  disabled: v
2753
2755
  }
2754
2756
  ),
2755
- (s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (p = s[e]) == null ? void 0 : p.message })
2757
+ (s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (x = s[e]) == null ? void 0 : x.message })
2756
2758
  ] });
2757
2759
  if (["checkbox", "radio"].includes(l)) {
2758
- const S = (g == null ? void 0 : g(e)) || null;
2759
- let A = !1;
2760
- return S && (S != null && S.length && l === "checkbox" ? A = S == null ? void 0 : S.includes(r) : A = S == r), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
2761
- /* @__PURE__ */ n.jsxs("label", { className: "flex items-center gap-3 cursor-pointer select-none", children: [
2762
- /* @__PURE__ */ n.jsx(
2763
- "input",
2764
- {
2765
- ...m,
2766
- type: l,
2767
- value: r || "",
2768
- disabled: v,
2769
- className: "peer sr-only"
2770
- }
2771
- ),
2772
- /* @__PURE__ */ n.jsx(
2773
- "div",
2774
- {
2775
- className: `
2760
+ const y = (g == null ? void 0 : g(e)) || null;
2761
+ let k = !1;
2762
+ return y && (y != null && y.length && l === "checkbox" ? k = y == null ? void 0 : y.includes(r) : k = y == r), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
2763
+ /* @__PURE__ */ n.jsxs(
2764
+ "label",
2765
+ {
2766
+ className: `flex gap-3 cursor-pointer select-none ${m ? "items-start" : "items-center"}`,
2767
+ children: [
2768
+ /* @__PURE__ */ n.jsx(
2769
+ "input",
2770
+ {
2771
+ ...p,
2772
+ type: l,
2773
+ value: r || "",
2774
+ disabled: v,
2775
+ className: "peer sr-only"
2776
+ }
2777
+ ),
2778
+ /* @__PURE__ */ n.jsx(
2779
+ "div",
2780
+ {
2781
+ className: `
2776
2782
  w-[18px] h-[18px] flex items-center justify-center
2777
2783
  border rounded-md transition-all duration-200
2778
2784
  ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"}
@@ -2781,18 +2787,23 @@ const F = ({
2781
2787
  peer-disabled:opacity-60
2782
2788
  peer-disabled:cursor-not-allowed
2783
2789
  `,
2784
- children: A && /* @__PURE__ */ n.jsx(
2785
- z,
2786
- {
2787
- icon: "meteor-icons:check",
2788
- iconClass: "w-3.5 h-3.5 text-white"
2790
+ children: k && /* @__PURE__ */ n.jsx(
2791
+ z,
2792
+ {
2793
+ icon: "meteor-icons:check",
2794
+ iconClass: "w-3.5 h-3.5 text-white"
2795
+ }
2796
+ )
2789
2797
  }
2790
- )
2791
- }
2792
- ),
2793
- /* @__PURE__ */ n.jsx("span", { className: "text-sm font-medium text-[#344054] font-onest", children: i })
2794
- ] }),
2795
- (s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "ml-8 text-sm text-red-600", children: (x = s[e]) == null ? void 0 : x.message })
2798
+ ),
2799
+ /* @__PURE__ */ n.jsxs("div", { children: [
2800
+ /* @__PURE__ */ n.jsx("span", { className: "text-sm leading-none block font-medium text-[#344054] font-onest", children: i }),
2801
+ m && /* @__PURE__ */ n.jsx("span", { className: "text-xs font-medium leading-none text-[#5c6c86] font-onest", children: m })
2802
+ ] })
2803
+ ]
2804
+ }
2805
+ ),
2806
+ (s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "ml-8 text-sm text-red-600", children: (j = s[e]) == null ? void 0 : j.message })
2796
2807
  ] });
2797
2808
  }
2798
2809
  return l === "textarea" ? /* @__PURE__ */ n.jsxs("div", { className: "space-y-1.5 relative", children: [
@@ -2806,13 +2817,13 @@ const F = ({
2806
2817
  /* @__PURE__ */ n.jsx(
2807
2818
  "textarea",
2808
2819
  {
2809
- ...m,
2820
+ ...p,
2810
2821
  className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"} ${a}`,
2811
2822
  placeholder: d,
2812
2823
  disabled: v
2813
2824
  }
2814
2825
  ),
2815
- (s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (j = s[e]) == null ? void 0 : j.message })
2826
+ (s == null ? void 0 : s[e]) && /* @__PURE__ */ n.jsx("p", { className: "mt-1 text-sm text-red-600", children: (S = s[e]) == null ? void 0 : S.message })
2816
2827
  ] }) : /* @__PURE__ */ n.jsxs("div", { className: "space-y-1.5 relative w-full", children: [
2817
2828
  /* @__PURE__ */ n.jsx(
2818
2829
  "label",
@@ -2824,12 +2835,12 @@ const F = ({
2824
2835
  /* @__PURE__ */ n.jsx(
2825
2836
  "input",
2826
2837
  {
2827
- ...m,
2838
+ ...p,
2828
2839
  type: l,
2829
2840
  className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"} ${a}`,
2830
2841
  placeholder: t ? "" : d,
2831
2842
  disabled: v,
2832
- min: y,
2843
+ min: A,
2833
2844
  max: f
2834
2845
  }
2835
2846
  ),
@@ -2901,16 +2912,16 @@ const wi = ({
2901
2912
  subText: h,
2902
2913
  labelClass: v = "text-[10px]",
2903
2914
  loading: g,
2904
- disabled: y
2915
+ disabled: A
2905
2916
  }) => {
2906
- const [f, m] = R(r ? [] : null), p = Ii(!1), x = ii(() => !t || !i || i.length === 0 ? r ? [] : null : r ? Array.isArray(t) ? i.filter((S) => t.some(
2907
- (A) => {
2908
- var C;
2909
- return typeof S.value == "object" ? ((C = S.value) == null ? void 0 : C.id) === (A == null ? void 0 : A.id) : S.value === A;
2917
+ const [f, m] = R(r ? [] : null), p = Di(!1), x = ni(() => !t || !i || i.length === 0 ? r ? [] : null : r ? Array.isArray(t) ? i.filter((N) => t.some(
2918
+ (y) => {
2919
+ var k;
2920
+ return typeof N.value == "object" ? ((k = N.value) == null ? void 0 : k.id) === (y == null ? void 0 : y.id) : N.value === y;
2910
2921
  }
2911
- )) : [] : i.find((S) => {
2912
- var A;
2913
- return typeof S.value == "string" && typeof t == "string" ? S.value.toLowerCase() === t.toLowerCase() : typeof S.value == "object" && typeof t == "object" ? ((A = S.value) == null ? void 0 : A.id) === (t == null ? void 0 : t.id) : S.value === t;
2922
+ )) : [] : i.find((N) => {
2923
+ var y;
2924
+ return typeof N.value == "string" && typeof t == "string" ? N.value.toLowerCase() === t.toLowerCase() : typeof N.value == "object" && typeof t == "object" ? ((y = N.value) == null ? void 0 : y.id) === (t == null ? void 0 : t.id) : N.value === t;
2914
2925
  }) || null, [t, i, r]);
2915
2926
  O(() => {
2916
2927
  if (p.current) {
@@ -2918,18 +2929,18 @@ const wi = ({
2918
2929
  return;
2919
2930
  }
2920
2931
  if (r && Array.isArray(x) && Array.isArray(f)) {
2921
- const S = f == null ? void 0 : f.map((C) => C.value), A = x == null ? void 0 : x.map((C) => C.value);
2922
- JSON.stringify(S) !== JSON.stringify(A) && m(x);
2932
+ const N = f == null ? void 0 : f.map((k) => k.value), y = x == null ? void 0 : x.map((k) => k.value);
2933
+ JSON.stringify(N) !== JSON.stringify(y) && m(x);
2923
2934
  } else (x == null ? void 0 : x.value) !== (f == null ? void 0 : f.value) && m(x);
2924
2935
  }, [x, r]);
2925
- const j = Y((S) => {
2926
- var A;
2927
- if (p.current = !0, m(S), a) {
2928
- const C = r ? Array.isArray(S) ? S == null ? void 0 : S.map((K) => K.value) : [] : (A = S == null ? void 0 : S.value) != null ? A : null;
2929
- a(l, C), u == null || u(l);
2936
+ const j = Y((N) => {
2937
+ var y;
2938
+ if (p.current = !0, m(N), a) {
2939
+ const k = r ? Array.isArray(N) ? N == null ? void 0 : N.map((K) => K.value) : [] : (y = N == null ? void 0 : N.value) != null ? y : null;
2940
+ a(l, k), u == null || u(l);
2930
2941
  }
2931
2942
  s && !p.current && s(l);
2932
- }, [a, l, u, s, r]), N = ii(() => g ? "Fetching data..." : f ? r && Array.isArray(f) ? f.length > 0 ? f == null ? void 0 : f.map((S) => S.label).join(", ") : e : (f == null ? void 0 : f.label) || e : e, [f, g, e, r]);
2943
+ }, [a, l, u, s, r]), S = ni(() => g ? "Fetching data..." : f ? r && Array.isArray(f) ? f.length > 0 ? f == null ? void 0 : f.map((N) => N.label).join(", ") : e : (f == null ? void 0 : f.label) || e : e, [f, g, e, r]);
2933
2944
  return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2934
2945
  !c && d && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2935
2946
  c && d && /* @__PURE__ */ n.jsx(
@@ -2943,21 +2954,21 @@ const wi = ({
2943
2954
  }
2944
2955
  ),
2945
2956
  /* @__PURE__ */ n.jsx(
2946
- oi,
2957
+ ai,
2947
2958
  {
2948
2959
  value: f,
2949
2960
  onChange: j,
2950
2961
  multiple: r,
2951
- disabled: y || g,
2962
+ disabled: A || g,
2952
2963
  children: /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2953
- /* @__PURE__ */ n.jsxs(oi.Button, { className: "field-control", disabled: y || g, children: [
2964
+ /* @__PURE__ */ n.jsxs(ai.Button, { className: "field-control", disabled: A || g, children: [
2954
2965
  /* @__PURE__ */ n.jsx(
2955
2966
  "span",
2956
2967
  {
2957
2968
  className: J("block text-sm text-left truncate", {
2958
2969
  "opacity-60": !f || g
2959
2970
  }),
2960
- children: N
2971
+ children: S
2961
2972
  }
2962
2973
  ),
2963
2974
  /* @__PURE__ */ n.jsx("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ n.jsx(z, { icon: "lucide:chevron-down" }) })
@@ -2968,16 +2979,16 @@ const wi = ({
2968
2979
  leave: "transition ease-in duration-100",
2969
2980
  leaveFrom: "opacity-100",
2970
2981
  leaveTo: "opacity-0",
2971
- children: /* @__PURE__ */ n.jsx(oi.Options, { anchor: "bottom start", className: "select-button-options", children: i.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No options available" }) : i == null ? void 0 : i.map((S, A) => {
2972
- var C;
2982
+ children: /* @__PURE__ */ n.jsx(ai.Options, { anchor: "bottom start", className: "select-button-options", children: i.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No options available" }) : i == null ? void 0 : i.map((N, y) => {
2983
+ var k;
2973
2984
  return /* @__PURE__ */ n.jsx(
2974
- oi.Option,
2985
+ ai.Option,
2975
2986
  {
2976
- value: S,
2987
+ value: N,
2977
2988
  className: ({ active: K }) => J("select-option", { active: K }),
2978
- children: ({ selected: K }) => /* @__PURE__ */ n.jsx("div", { className: J("option-text", { selected: K }), children: S.label })
2989
+ children: ({ selected: K }) => /* @__PURE__ */ n.jsx("div", { className: J("option-text", { selected: K }), children: N.label })
2979
2990
  },
2980
- ((C = S.value) == null ? void 0 : C.id) || S.value || A
2991
+ ((k = N.value) == null ? void 0 : k.id) || N.value || y
2981
2992
  );
2982
2993
  }) })
2983
2994
  }
@@ -2997,21 +3008,21 @@ function Tn({
2997
3008
  readOnly: a,
2998
3009
  name: l
2999
3010
  }) {
3000
- const [d, t] = R(""), u = ii(() => {
3011
+ const [d, t] = R(""), u = ni(() => {
3001
3012
  const g = e != null ? e : o;
3002
- return i.find((y) => y.value === g || y.label === g) || null;
3013
+ return i.find((A) => A.value === g || A.label === g) || null;
3003
3014
  }, [e, o, i]), [r, c] = R(u);
3004
3015
  O(() => {
3005
3016
  if (e !== void 0) {
3006
- const g = i.find((y) => y.value === e || y.label === e) || null;
3017
+ const g = i.find((A) => A.value === e || A.label === e) || null;
3007
3018
  c(g);
3008
3019
  }
3009
3020
  }, [e, i]);
3010
- const h = ii(() => {
3021
+ const h = ni(() => {
3011
3022
  if (d === "") return i;
3012
3023
  const g = d.toLowerCase();
3013
3024
  return i.filter(
3014
- (y) => y.label.toLowerCase().includes(g)
3025
+ (A) => A.label.toLowerCase().includes(g)
3015
3026
  );
3016
3027
  }, [d, i]), v = Y((g) => {
3017
3028
  c(g), s(l, g);
@@ -3039,8 +3050,8 @@ function Tn({
3039
3050
  po,
3040
3051
  {
3041
3052
  value: g,
3042
- className: ({ active: y, selected: f }) => J("select-option", { active: y, selected: f }),
3043
- children: ({ selected: y }) => /* @__PURE__ */ n.jsx("div", { className: J("option-text", { selected: y }), children: g.label })
3053
+ className: ({ active: A, selected: f }) => J("select-option", { active: A, selected: f }),
3054
+ children: ({ selected: A }) => /* @__PURE__ */ n.jsx("div", { className: J("option-text", { selected: A }), children: g.label })
3044
3055
  },
3045
3056
  g.value
3046
3057
  )) })
@@ -3101,7 +3112,7 @@ function Va({
3101
3112
  }
3102
3113
  );
3103
3114
  }
3104
- function In(i, e, o) {
3115
+ function Dn(i, e, o) {
3105
3116
  return e === void 0 && (e = {}), o === void 0 && (o = {}), function(s, a, l) {
3106
3117
  try {
3107
3118
  return Promise.resolve(function(d, t) {
@@ -3190,7 +3201,7 @@ const Fa = ({
3190
3201
  }, Yi = (i, e = i) => ({
3191
3202
  label: i,
3192
3203
  value: e,
3193
- id: xi()
3204
+ id: yi()
3194
3205
  }), ti = (i) => ({
3195
3206
  ...Ua,
3196
3207
  ...i
@@ -3364,7 +3375,7 @@ const Fa = ({
3364
3375
  value: [],
3365
3376
  dataColumns: [
3366
3377
  {
3367
- id: xi(),
3378
+ id: yi(),
3368
3379
  field: "",
3369
3380
  headerName: "",
3370
3381
  width: 150,
@@ -3466,13 +3477,13 @@ const Fa = ({
3466
3477
  { label: "Weekday, Month Day, Year", value: "EEEE, MMMM d, yyyy" },
3467
3478
  { label: "Short Weekday, Month Day, Year", value: "EEE, MMM d, yyyy" },
3468
3479
  { label: "Day-Month-Year", value: "dd-MM-yyyy" }
3469
- ], Za = ["amount"], qa = ["text", "number"], $a = [
3480
+ ], qa = ["amount"], Za = ["text", "number"], $a = [
3470
3481
  "text",
3471
3482
  "number",
3472
3483
  "amount",
3473
3484
  "date",
3474
3485
  "password"
3475
- ], Qa = ["amount"], Zi = [
3486
+ ], Qa = ["amount"], qi = [
3476
3487
  "grid",
3477
3488
  "section",
3478
3489
  "divider",
@@ -3655,9 +3666,9 @@ const as = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3655
3666
  const h = c.target.result, v = So.parse(h, { header: !0 });
3656
3667
  i(e, v.data);
3657
3668
  }, r.readAsText(u)) : u.name.endsWith(".xlsx") || u.name.endsWith(".xls") ? (r.onload = (c) => {
3658
- const h = new Uint8Array(c.target.result), v = Xn.read(h, { type: "array" }), g = v.SheetNames[0], y = v.Sheets[g], f = Xn.utils.sheet_to_json(y);
3669
+ const h = new Uint8Array(c.target.result), v = Xn.read(h, { type: "array" }), g = v.SheetNames[0], A = v.Sheets[g], f = Xn.utils.sheet_to_json(A);
3659
3670
  i(e, f);
3660
- }, r.readAsArrayBuffer(u)) : Si.error("Unsupported file type. Please upload a CSV or Excel file.");
3671
+ }, r.readAsArrayBuffer(u)) : Ni.error("Unsupported file type. Please upload a CSV or Excel file.");
3661
3672
  };
3662
3673
  return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
3663
3674
  /* @__PURE__ */ n.jsx(
@@ -3745,7 +3756,7 @@ function rs({
3745
3756
  watch: s,
3746
3757
  id: a
3747
3758
  }) {
3748
- const { formData: l } = Ni(pi), d = s("visibilityDependentFields") || [], t = ii(() => {
3759
+ const { formData: l } = ji(gi), d = s("visibilityDependentFields") || [], t = ni(() => {
3749
3760
  var r;
3750
3761
  return (r = ts(l).filter((c) => c.id !== a)) == null ? void 0 : r.map((c) => {
3751
3762
  const h = d.find(
@@ -3763,7 +3774,7 @@ function rs({
3763
3774
  });
3764
3775
  }, [l, d, a]), u = (r, c, h) => {
3765
3776
  const v = d == null ? void 0 : d.map(
3766
- (g, y) => y === r ? { ...g, [c]: h } : g
3777
+ (g, A) => A === r ? { ...g, [c]: h } : g
3767
3778
  );
3768
3779
  e("visibilityDependentFields", v);
3769
3780
  };
@@ -3794,26 +3805,26 @@ function rs({
3794
3805
  }
3795
3806
  ),
3796
3807
  /* @__PURE__ */ n.jsx("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ n.jsx(
3797
- oi,
3808
+ ai,
3798
3809
  {
3799
3810
  value: r.fieldType,
3800
3811
  onChange: (g) => u(c, "fieldType", g),
3801
3812
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3802
- /* @__PURE__ */ n.jsx(oi.Button, { className: "listbox-button", children: r.fieldType }),
3813
+ /* @__PURE__ */ n.jsx(ai.Button, { className: "listbox-button", children: r.fieldType }),
3803
3814
  /* @__PURE__ */ n.jsx(
3804
3815
  Ri,
3805
3816
  {
3806
- as: qi,
3817
+ as: Zi,
3807
3818
  leave: "transition ease-in duration-100",
3808
3819
  leaveFrom: "opacity-100",
3809
3820
  leaveTo: "opacity-0",
3810
3821
  children: /* @__PURE__ */ n.jsx(
3811
- oi.Options,
3822
+ ai.Options,
3812
3823
  {
3813
3824
  className: "listbox-options ",
3814
3825
  anchor: "bottom",
3815
3826
  children: gn == null ? void 0 : gn.map((g) => /* @__PURE__ */ n.jsx(
3816
- oi.Option,
3827
+ ai.Option,
3817
3828
  {
3818
3829
  value: g,
3819
3830
  className: "listbox-option",
@@ -3829,26 +3840,26 @@ function rs({
3829
3840
  }
3830
3841
  ) }),
3831
3842
  /* @__PURE__ */ n.jsx("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ n.jsx(
3832
- oi,
3843
+ ai,
3833
3844
  {
3834
3845
  value: r.operator,
3835
3846
  onChange: (g) => u(c, "operator", g),
3836
3847
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3837
- /* @__PURE__ */ n.jsx(oi.Button, { className: "listbox-button", children: r.operator.replace("_", " ") }),
3848
+ /* @__PURE__ */ n.jsx(ai.Button, { className: "listbox-button", children: r.operator.replace("_", " ") }),
3838
3849
  /* @__PURE__ */ n.jsx(
3839
3850
  Ri,
3840
3851
  {
3841
- as: qi,
3852
+ as: Zi,
3842
3853
  leave: "transition ease-in duration-100",
3843
3854
  leaveFrom: "opacity-100",
3844
3855
  leaveTo: "opacity-0",
3845
3856
  children: /* @__PURE__ */ n.jsx(
3846
- oi.Options,
3857
+ ai.Options,
3847
3858
  {
3848
3859
  className: "listbox-options ",
3849
3860
  anchor: "bottom",
3850
3861
  children: (h = r.fieldType === "number" ? [...pe, ...cs] : pe) == null ? void 0 : h.map((g) => /* @__PURE__ */ n.jsx(
3851
- oi.Option,
3862
+ ai.Option,
3852
3863
  {
3853
3864
  value: g,
3854
3865
  className: "listbox-option",
@@ -3873,27 +3884,27 @@ function rs({
3873
3884
  className: "field-value"
3874
3885
  }
3875
3886
  ) : /* @__PURE__ */ n.jsx("div", { className: "field-listbox", children: /* @__PURE__ */ n.jsx(
3876
- oi,
3887
+ ai,
3877
3888
  {
3878
3889
  value: (v = r.fieldValue) != null ? v : "",
3879
3890
  onChange: (g) => u(c, "fieldValue", g),
3880
3891
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3881
- /* @__PURE__ */ n.jsx(oi.Button, { className: "listbox-button", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
3892
+ /* @__PURE__ */ n.jsx(ai.Button, { className: "listbox-button", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
3882
3893
  /* @__PURE__ */ n.jsx(
3883
3894
  Ri,
3884
3895
  {
3885
- as: qi,
3896
+ as: Zi,
3886
3897
  leave: "transition ease-in duration-100",
3887
3898
  leaveFrom: "opacity-100",
3888
3899
  leaveTo: "opacity-0",
3889
3900
  children: /* @__PURE__ */ n.jsxs(
3890
- oi.Options,
3901
+ ai.Options,
3891
3902
  {
3892
3903
  className: "listbox-options ",
3893
3904
  anchor: "bottom",
3894
3905
  children: [
3895
3906
  /* @__PURE__ */ n.jsx(
3896
- oi.Option,
3907
+ ai.Option,
3897
3908
  {
3898
3909
  value: !0,
3899
3910
  className: "listbox-option",
@@ -3901,7 +3912,7 @@ function rs({
3901
3912
  }
3902
3913
  ),
3903
3914
  /* @__PURE__ */ n.jsx(
3904
- oi.Option,
3915
+ ai.Option,
3905
3916
  {
3906
3917
  value: !1,
3907
3918
  className: "listbox-option",
@@ -3998,77 +4009,77 @@ const ms = B.object().shape({
3998
4009
  element: o
3999
4010
  }) => {
4000
4011
  const s = bs.filter(
4001
- (H) => !Zi.includes(o.inputType) || H.key !== "validation"
4002
- ), { updateElement: a } = ri.useContext(pi), [l, d] = R("basic"), [t, u] = R(!1), [r, c] = R("manual"), h = fi("config"), {
4012
+ (H) => !qi.includes(o.inputType) || H.key !== "validation"
4013
+ ), { updateElement: a } = ri.useContext(gi), [l, d] = R("basic"), [t, u] = R(!1), [r, c] = R("manual"), h = xi("config"), {
4003
4014
  register: v,
4004
4015
  handleSubmit: g,
4005
- control: y,
4016
+ control: A,
4006
4017
  setValue: f,
4007
4018
  watch: m,
4008
4019
  trigger: p,
4009
- formState: { errors: x, isSubmitting: j, isValid: N },
4010
- reset: S
4020
+ formState: { errors: x, isSubmitting: j, isValid: S },
4021
+ reset: N
4011
4022
  } = En({
4012
- resolver: In(ms),
4023
+ resolver: Dn(ms),
4013
4024
  defaultValues: {
4014
4025
  ...o,
4015
4026
  options: o.options || []
4016
4027
  }
4017
- }), A = m(), { fields: C, append: K, remove: Q } = mn({
4018
- control: y,
4028
+ }), y = m(), { fields: k, append: K, remove: Q } = mn({
4029
+ control: A,
4019
4030
  name: "options"
4020
4031
  }), {
4021
4032
  fields: W,
4022
- append: Z,
4033
+ append: q,
4023
4034
  remove: M
4024
4035
  } = mn({
4025
- control: y,
4036
+ control: A,
4026
4037
  name: "options1"
4027
4038
  }), {
4028
4039
  fields: E,
4029
4040
  append: P,
4030
4041
  remove: L
4031
4042
  } = mn({
4032
- control: y,
4043
+ control: A,
4033
4044
  name: "dataColumns"
4034
4045
  });
4035
4046
  O(() => {
4036
- i || S();
4037
- }, [i, S]);
4047
+ i || N();
4048
+ }, [i, N]);
4038
4049
  const G = (H) => {
4039
4050
  a(H, o.sectionId), e();
4040
4051
  }, w = {
4041
4052
  headers: {
4042
- Authorization: `Bearer ${fi("token")}`
4053
+ Authorization: `Bearer ${xi("token")}`
4043
4054
  }
4044
- }, I = Y(async () => {
4045
- var H, D, li;
4046
- if (!A.apiUrl || !/^https?:\/\//.test(A.apiUrl)) {
4047
- Si.info("Please provide a valid API URL");
4055
+ }, D = Y(async () => {
4056
+ var H, I, di;
4057
+ if (!y.apiUrl || !/^https?:\/\//.test(y.apiUrl)) {
4058
+ Ni.info("Please provide a valid API URL");
4048
4059
  return;
4049
4060
  }
4050
4061
  try {
4051
4062
  u(!0);
4052
- const { status: ui, data: si } = await Di.get(A.apiUrl, w);
4053
- if (ui !== 200 || !si) {
4054
- Si.error("Unexpected response from server.");
4063
+ const { status: ui, data: li } = await Ii.get(y.apiUrl, w);
4064
+ if (ui !== 200 || !li) {
4065
+ Ni.error("Unexpected response from server.");
4055
4066
  return;
4056
4067
  }
4057
- const di = si.data || si.record || si.result;
4058
- if (!Array.isArray(di)) {
4059
- Si.error("Expected an array in response (data, record, or result).");
4068
+ const ii = li.data || li.record || li.result;
4069
+ if (!Array.isArray(ii)) {
4070
+ Ni.error("Expected an array in response (data, record, or result).");
4060
4071
  return;
4061
4072
  }
4062
- ((H = o.type) == null ? void 0 : H.toLowerCase()) === "datagrid" ? f("dataColumns", di) : f("options", di);
4073
+ ((H = o.type) == null ? void 0 : H.toLowerCase()) === "datagrid" ? f("dataColumns", ii) : f("options", ii);
4063
4074
  } catch (ui) {
4064
- const si = ((li = (D = ui == null ? void 0 : ui.response) == null ? void 0 : D.data) == null ? void 0 : li.message) || (ui == null ? void 0 : ui.message) || "Unable to load options";
4065
- Si.error(si);
4075
+ const li = ((di = (I = ui == null ? void 0 : ui.response) == null ? void 0 : I.data) == null ? void 0 : di.message) || (ui == null ? void 0 : ui.message) || "Unable to load options";
4076
+ Ni.error(li);
4066
4077
  } finally {
4067
4078
  u(!1);
4068
4079
  }
4069
- }, [o.type, f, A.apiUrl]), U = ["manual", "api", "sheet"];
4070
- function ni() {
4071
- r === "api" && I();
4080
+ }, [o.type, f, y.apiUrl]), U = ["manual", "api", "sheet"];
4081
+ function ei() {
4082
+ r === "api" && D();
4072
4083
  }
4073
4084
  const vi = () => /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col justify-start gap-y-1", children: [
4074
4085
  /* @__PURE__ */ n.jsx("div", { className: "flex items-center mb-4 gap-x-5", children: U == null ? void 0 : U.map((H) => /* @__PURE__ */ n.jsxs("label", { className: "items-center text-base capitalize gap-x-3", children: [
@@ -4077,7 +4088,7 @@ const ms = B.object().shape({
4077
4088
  {
4078
4089
  type: "radio",
4079
4090
  name: "optionType",
4080
- onChange: (D) => c(D.target.value),
4091
+ onChange: (I) => c(I.target.value),
4081
4092
  value: H
4082
4093
  }
4083
4094
  ),
@@ -4108,7 +4119,7 @@ const ms = B.object().shape({
4108
4119
  /* @__PURE__ */ n.jsx(
4109
4120
  "button",
4110
4121
  {
4111
- onClick: ni,
4122
+ onClick: ei,
4112
4123
  className: "px-3 py-1 text-xs text-white bg-gray-600 rounded",
4113
4124
  type: "button",
4114
4125
  children: "Load"
@@ -4128,7 +4139,7 @@ const ms = B.object().shape({
4128
4139
  ) }),
4129
4140
  /* @__PURE__ */ n.jsxs("div", { children: [
4130
4141
  /* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500", children: "Parent Options " }),
4131
- C == null ? void 0 : C.map((H, D) => /* @__PURE__ */ n.jsxs(
4142
+ k == null ? void 0 : k.map((H, I) => /* @__PURE__ */ n.jsxs(
4132
4143
  "div",
4133
4144
  {
4134
4145
  className: "flex items-center mb-1 gap-x-4 last:mb-0",
@@ -4137,8 +4148,8 @@ const ms = B.object().shape({
4137
4148
  F,
4138
4149
  {
4139
4150
  watch: m,
4140
- label: D === 0 ? "Label" : "",
4141
- name: `options.${D}.label`,
4151
+ label: I === 0 ? "Label" : "",
4152
+ name: `options.${I}.label`,
4142
4153
  register: v,
4143
4154
  errors: x,
4144
4155
  element: o,
@@ -4149,8 +4160,8 @@ const ms = B.object().shape({
4149
4160
  F,
4150
4161
  {
4151
4162
  watch: m,
4152
- label: D === 0 ? "Value" : "",
4153
- name: `options.${D}.value`,
4163
+ label: I === 0 ? "Value" : "",
4164
+ name: `options.${I}.value`,
4154
4165
  register: v,
4155
4166
  errors: x,
4156
4167
  element: o,
@@ -4160,10 +4171,10 @@ const ms = B.object().shape({
4160
4171
  /* @__PURE__ */ n.jsx(
4161
4172
  "button",
4162
4173
  {
4163
- disabled: C.length === 1,
4174
+ disabled: k.length === 1,
4164
4175
  type: "button",
4165
4176
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4166
- onClick: () => Q(D),
4177
+ onClick: () => Q(I),
4167
4178
  children: /* @__PURE__ */ n.jsx(z, { icon: "iconamoon:sign-times-fill" })
4168
4179
  }
4169
4180
  )
@@ -4179,7 +4190,7 @@ const ms = B.object().shape({
4179
4190
  {
4180
4191
  type: "button",
4181
4192
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4182
- onClick: () => K({ label: "", value: "", id: xi() }),
4193
+ onClick: () => K({ label: "", value: "", id: yi() }),
4183
4194
  children: [
4184
4195
  /* @__PURE__ */ n.jsx(z, { icon: "qlementine-icons:plus-16" }),
4185
4196
  " Add Option"
@@ -4193,7 +4204,7 @@ const ms = B.object().shape({
4193
4204
  /* @__PURE__ */ n.jsxs("div", { children: [
4194
4205
  " ",
4195
4206
  /* @__PURE__ */ n.jsx("h3", { className: "mb-4 text-sm text-gray-500", children: "Child Options " }),
4196
- W == null ? void 0 : W.map((H, D) => /* @__PURE__ */ n.jsxs(
4207
+ W == null ? void 0 : W.map((H, I) => /* @__PURE__ */ n.jsxs(
4197
4208
  "div",
4198
4209
  {
4199
4210
  className: "flex items-center mb-1 gap-x-4 last:mb-0",
@@ -4203,7 +4214,7 @@ const ms = B.object().shape({
4203
4214
  {
4204
4215
  watch: m,
4205
4216
  label: "Label",
4206
- name: `options1.${D}.label`,
4217
+ name: `options1.${I}.label`,
4207
4218
  register: v,
4208
4219
  errors: x,
4209
4220
  element: o,
@@ -4216,7 +4227,7 @@ const ms = B.object().shape({
4216
4227
  {
4217
4228
  watch: m,
4218
4229
  label: "Value",
4219
- name: `options1.${D}.value`,
4230
+ name: `options1.${I}.value`,
4220
4231
  register: v,
4221
4232
  errors: x,
4222
4233
  element: o,
@@ -4229,7 +4240,7 @@ const ms = B.object().shape({
4229
4240
  {
4230
4241
  watch: m,
4231
4242
  label: "Key",
4232
- name: `options1.${D}.key`,
4243
+ name: `options1.${I}.key`,
4233
4244
  register: v,
4234
4245
  errors: x,
4235
4246
  element: o,
@@ -4243,7 +4254,7 @@ const ms = B.object().shape({
4243
4254
  disabled: W.length === 1,
4244
4255
  type: "button",
4245
4256
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4246
- onClick: () => M(D),
4257
+ onClick: () => M(I),
4247
4258
  children: /* @__PURE__ */ n.jsx(z, { icon: "iconamoon:sign-times-fill" })
4248
4259
  }
4249
4260
  )
@@ -4258,7 +4269,7 @@ const ms = B.object().shape({
4258
4269
  {
4259
4270
  type: "button",
4260
4271
  className: "flex items-center mt-2 text-sm font-medium text-gray-700 gap-x-1",
4261
- onClick: () => Z({ label: "", value: "", key: "", id: xi() }),
4272
+ onClick: () => q({ label: "", value: "", key: "", id: yi() }),
4262
4273
  children: [
4263
4274
  /* @__PURE__ */ n.jsx(z, { icon: "qlementine-icons:plus-16" }),
4264
4275
  " Add Option"
@@ -4275,7 +4286,7 @@ const ms = B.object().shape({
4275
4286
  {
4276
4287
  type: "radio",
4277
4288
  name: "optionType",
4278
- onChange: (D) => c(D.target.value),
4289
+ onChange: (I) => c(I.target.value),
4279
4290
  value: H,
4280
4291
  checked: H === r
4281
4292
  }
@@ -4308,7 +4319,7 @@ const ms = B.object().shape({
4308
4319
  /* @__PURE__ */ n.jsx(
4309
4320
  "button",
4310
4321
  {
4311
- onClick: ni,
4322
+ onClick: ei,
4312
4323
  className: "px-3 py-1 text-xs text-white bg-gray-600 rounded",
4313
4324
  type: "button",
4314
4325
  children: "Load"
@@ -4326,11 +4337,11 @@ const ms = B.object().shape({
4326
4337
  name: "dataColumns"
4327
4338
  }
4328
4339
  ) }),
4329
- E == null ? void 0 : E.map((H, D) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-4 ", children: [
4340
+ E == null ? void 0 : E.map((H, I) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-4 ", children: [
4330
4341
  /* @__PURE__ */ n.jsx("div", { className: "min-w-[140px]", children: /* @__PURE__ */ n.jsx(
4331
4342
  wi,
4332
4343
  {
4333
- label: D === 0 ? "Type" : "",
4344
+ label: I === 0 ? "Type" : "",
4334
4345
  options: [
4335
4346
  {
4336
4347
  label: "Text",
@@ -4346,18 +4357,18 @@ const ms = B.object().shape({
4346
4357
  }
4347
4358
  ],
4348
4359
  register: v,
4349
- name: `dataColumns.${D}.type`,
4360
+ name: `dataColumns.${I}.type`,
4350
4361
  setValue: f,
4351
4362
  trigger: p,
4352
- value: A.dataColumns[D].type
4363
+ value: y.dataColumns[I].type
4353
4364
  }
4354
4365
  ) }),
4355
4366
  /* @__PURE__ */ n.jsx("div", { className: "flex-1", children: /* @__PURE__ */ n.jsx(
4356
4367
  F,
4357
4368
  {
4358
4369
  watch: m,
4359
- label: D === 0 ? "Field key" : "",
4360
- name: `dataColumns.${D}.field`,
4370
+ label: I === 0 ? "Field key" : "",
4371
+ name: `dataColumns.${I}.field`,
4361
4372
  register: v,
4362
4373
  errors: x,
4363
4374
  element: o,
@@ -4368,8 +4379,8 @@ const ms = B.object().shape({
4368
4379
  F,
4369
4380
  {
4370
4381
  watch: m,
4371
- label: D === 0 ? "Display header" : "",
4372
- name: `dataColumns.${D}.headerName`,
4382
+ label: I === 0 ? "Display header" : "",
4383
+ name: `dataColumns.${I}.headerName`,
4373
4384
  register: v,
4374
4385
  errors: x,
4375
4386
  element: o,
@@ -4382,7 +4393,7 @@ const ms = B.object().shape({
4382
4393
  disabled: E.length === 1,
4383
4394
  type: "button",
4384
4395
  className: "outline-none hover:opacity-80 disabled:opacity-40 disabled:cursor-not-allowed",
4385
- onClick: () => L(D),
4396
+ onClick: () => L(I),
4386
4397
  children: /* @__PURE__ */ n.jsx(z, { icon: "iconamoon:sign-times-fill" })
4387
4398
  }
4388
4399
  )
@@ -4398,7 +4409,7 @@ const ms = B.object().shape({
4398
4409
  headerName: "",
4399
4410
  field: "",
4400
4411
  editable: !0,
4401
- id: xi(),
4412
+ id: yi(),
4402
4413
  type: "text",
4403
4414
  validate: !1
4404
4415
  }),
@@ -4409,17 +4420,17 @@ const ms = B.object().shape({
4409
4420
  }
4410
4421
  )
4411
4422
  ] })
4412
- ] }), ai = Y(async () => {
4413
- const H = fi("token"), { status: D, data: li } = await Di.get(A.url, {
4423
+ ] }), si = Y(async () => {
4424
+ const H = xi("token"), { status: I, data: di } = await Ii.get(y.url, {
4414
4425
  headers: {
4415
4426
  Authorization: `Bearer ${H}`
4416
4427
  }
4417
4428
  });
4418
- D === 200 && f("options", (li == null ? void 0 : li.data) || li);
4419
- }, [f, A.url]);
4429
+ I === 200 && f("options", (di == null ? void 0 : di.data) || di);
4430
+ }, [f, y.url]);
4420
4431
  return O(() => {
4421
- o.type === "document" && A.url && ai();
4422
- }, [A.url, o.type, ai]), /* @__PURE__ */ n.jsx(
4432
+ o.type === "document" && y.url && si();
4433
+ }, [y.url, o.type, si]), /* @__PURE__ */ n.jsx(
4423
4434
  "div",
4424
4435
  {
4425
4436
  className: "fixed inset-0 bg-gray-800/40 backdrop-blur-sm flex items-center justify-end z-[999] cursor-default select-none ",
@@ -4471,7 +4482,7 @@ const ms = B.object().shape({
4471
4482
  element: o
4472
4483
  }
4473
4484
  ) }),
4474
- !pn.includes(o.inputType) && !Zi.includes(o.inputType) && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
4485
+ !pn.includes(o.inputType) && !qi.includes(o.inputType) && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
4475
4486
  /* @__PURE__ */ n.jsx(
4476
4487
  F,
4477
4488
  {
@@ -4507,7 +4518,7 @@ const ms = B.object().shape({
4507
4518
  element: o
4508
4519
  }
4509
4520
  ),
4510
- Za.includes(o.inputType) && /* @__PURE__ */ n.jsx(
4521
+ qa.includes(o.inputType) && /* @__PURE__ */ n.jsx(
4511
4522
  F,
4512
4523
  {
4513
4524
  watch: m,
@@ -4583,7 +4594,7 @@ const ms = B.object().shape({
4583
4594
  value: m("denominators")
4584
4595
  }
4585
4596
  ),
4586
- !pn.includes(o.inputType) && !Zi.includes(o.inputType) && /* @__PURE__ */ n.jsx(
4597
+ !pn.includes(o.inputType) && !qi.includes(o.inputType) && /* @__PURE__ */ n.jsx(
4587
4598
  F,
4588
4599
  {
4589
4600
  watch: m,
@@ -4616,15 +4627,16 @@ const ms = B.object().shape({
4616
4627
  register: v,
4617
4628
  errors: x,
4618
4629
  element: o,
4619
- type: "checkbox"
4630
+ type: "checkbox",
4631
+ value: y.canHaveDateRange
4620
4632
  }
4621
4633
  ),
4622
- (A == null ? void 0 : A.canHaveDateRange) && /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4634
+ (y == null ? void 0 : y.canHaveDateRange) && /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4623
4635
  /* @__PURE__ */ n.jsx(
4624
4636
  Nn,
4625
4637
  {
4626
4638
  name: "minDate",
4627
- value: A == null ? void 0 : A.minDate,
4639
+ value: y == null ? void 0 : y.minDate,
4628
4640
  onGetValue: f,
4629
4641
  placeholder: "Select min date"
4630
4642
  }
@@ -4633,10 +4645,10 @@ const ms = B.object().shape({
4633
4645
  Nn,
4634
4646
  {
4635
4647
  name: "maxDate",
4636
- value: A == null ? void 0 : A.minDate,
4648
+ value: y == null ? void 0 : y.minDate,
4637
4649
  onGetValue: f,
4638
4650
  placeholder: "Select max date",
4639
- minDate: A == null ? void 0 : A.minDate
4651
+ minDate: y == null ? void 0 : y.minDate
4640
4652
  }
4641
4653
  )
4642
4654
  ] }),
@@ -4649,7 +4661,8 @@ const ms = B.object().shape({
4649
4661
  register: v,
4650
4662
  errors: x,
4651
4663
  element: o,
4652
- type: "checkbox"
4664
+ type: "checkbox",
4665
+ value: y.allowYearPicker
4653
4666
  }
4654
4667
  )
4655
4668
  ] }),
@@ -4662,7 +4675,8 @@ const ms = B.object().shape({
4662
4675
  register: v,
4663
4676
  errors: x,
4664
4677
  element: o,
4665
- type: "checkbox"
4678
+ type: "checkbox",
4679
+ value: y.showState
4666
4680
  }
4667
4681
  ),
4668
4682
  o.type.toLowerCase() === "selectfield" && /* @__PURE__ */ n.jsx(
@@ -4752,7 +4766,8 @@ const ms = B.object().shape({
4752
4766
  register: v,
4753
4767
  errors: x,
4754
4768
  element: o,
4755
- type: "checkbox"
4769
+ type: "checkbox",
4770
+ value: y.isMultiple
4756
4771
  }
4757
4772
  ),
4758
4773
  /* @__PURE__ */ n.jsx(
@@ -4761,7 +4776,7 @@ const ms = B.object().shape({
4761
4776
  element: {
4762
4777
  options: es,
4763
4778
  id: "acceptedFiles",
4764
- value: A == null ? void 0 : A.acceptedFiles
4779
+ value: y == null ? void 0 : y.acceptedFiles
4765
4780
  },
4766
4781
  validationData: { register: v, setValue: f, trigger: p, watch: m },
4767
4782
  placeholder: "Choose file types"
@@ -4779,11 +4794,12 @@ const ms = B.object().shape({
4779
4794
  register: v,
4780
4795
  errors: x,
4781
4796
  element: o,
4782
- type: "checkbox"
4797
+ type: "checkbox",
4798
+ value: y.isHidden
4783
4799
  }
4784
4800
  ) }),
4785
4801
  " ",
4786
- A.isHidden && /* @__PURE__ */ n.jsx(
4802
+ y.isHidden && /* @__PURE__ */ n.jsx(
4787
4803
  rs,
4788
4804
  {
4789
4805
  register: v,
@@ -4795,7 +4811,7 @@ const ms = B.object().shape({
4795
4811
  )
4796
4812
  ] })
4797
4813
  ] }),
4798
- !Zi.includes(o.type.toLowerCase()) && l === "validation" && /* @__PURE__ */ n.jsxs("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
4814
+ !qi.includes(o.type.toLowerCase()) && l === "validation" && /* @__PURE__ */ n.jsxs("div", { className: "z-10 flex flex-col w-full gap-5 px-6", children: [
4799
4815
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-6", children: [
4800
4816
  /* @__PURE__ */ n.jsx("div", { className: "w-[150px]", children: /* @__PURE__ */ n.jsx(
4801
4817
  F,
@@ -4806,7 +4822,8 @@ const ms = B.object().shape({
4806
4822
  register: v,
4807
4823
  errors: x,
4808
4824
  element: o,
4809
- type: "checkbox"
4825
+ type: "checkbox",
4826
+ value: y.isRequired
4810
4827
  }
4811
4828
  ) }),
4812
4829
  " ",
@@ -4822,7 +4839,7 @@ const ms = B.object().shape({
4822
4839
  }
4823
4840
  ) })
4824
4841
  ] }),
4825
- qa.includes(o.inputType) && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
4842
+ Za.includes(o.inputType) && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
4826
4843
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-6", children: [
4827
4844
  /* @__PURE__ */ n.jsx("div", { className: "w-[150px]", children: /* @__PURE__ */ n.jsx(
4828
4845
  F,
@@ -4947,9 +4964,9 @@ const ms = B.object().shape({
4947
4964
  "button",
4948
4965
  {
4949
4966
  type: "submit",
4950
- disabled: !N || j,
4967
+ disabled: !S || j,
4951
4968
  style: { background: (h == null ? void 0 : h.buttonColor) || "#333" },
4952
- className: `flex-1 px-4 py-2.5 ${!N || j ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!N || j ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50 editor_option__save`,
4969
+ className: `flex-1 px-4 py-2.5 ${!S || j ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!S || j ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50 editor_option__save`,
4953
4970
  children: j ? "Saving..." : "Save"
4954
4971
  }
4955
4972
  )
@@ -4962,9 +4979,9 @@ const ms = B.object().shape({
4962
4979
  )
4963
4980
  }
4964
4981
  );
4965
- }, Dn = an(
4982
+ }, In = an(
4966
4983
  ({ state: i, element: e, children: o }) => {
4967
- const [s, a] = R(!1), { removeElement: l, duplicateElement: d } = ri.useContext(pi), t = ii(
4984
+ const [s, a] = R(!1), { removeElement: l, duplicateElement: d } = ri.useContext(gi), t = ni(
4968
4985
  () => {
4969
4986
  var r;
4970
4987
  return (r = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : r.map((c) => c.label).join(", ");
@@ -5032,7 +5049,7 @@ const ms = B.object().shape({
5032
5049
  ] });
5033
5050
  }
5034
5051
  );
5035
- Dn.displayName = "ElementContainer";
5052
+ In.displayName = "ElementContainer";
5036
5053
  function hs({
5037
5054
  element: i,
5038
5055
  validationData: e
@@ -5158,41 +5175,41 @@ function fs({
5158
5175
  element: i,
5159
5176
  validationData: e
5160
5177
  }) {
5161
- var A;
5178
+ var y;
5162
5179
  const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = R(), [t, u] = R(!1), [r, c] = R(!1), [h, v] = R(""), g = a && a(i == null ? void 0 : i.id);
5163
5180
  O(() => {
5164
5181
  d(g);
5165
5182
  }, [g]);
5166
- const [y, f] = R("");
5183
+ const [A, f] = R("");
5167
5184
  O(() => {
5168
5185
  o(i.id);
5169
5186
  }, [i.id, o]);
5170
- const { url: m, method: p, responseType: x } = i || {}, N = {
5187
+ const { url: m, method: p, responseType: x } = i || {}, S = {
5171
5188
  headers: {
5172
- Authorization: `Bearer ${fi("token")}`
5189
+ Authorization: `Bearer ${xi("token")}`
5173
5190
  }
5174
- }, S = Y(
5175
- async (C) => {
5176
- var K, Q, W, Z, M, E, P, L, G, q, w;
5191
+ }, N = Y(
5192
+ async (k) => {
5193
+ var K, Q, W, q, M, E, P, L, G, Z, w;
5177
5194
  if (!(!m || !p)) {
5178
5195
  u(!0);
5179
5196
  try {
5180
- let I;
5197
+ let D;
5181
5198
  if (p.toLowerCase() === "get") {
5182
- const U = `${m}?value=${C}`;
5183
- I = await Di.get(U, N);
5199
+ const U = `${m}?value=${k}`;
5200
+ D = await Ii.get(U, S);
5184
5201
  } else if (p.toLowerCase() === "post")
5185
- I = await Di.post(m, { value: C }, N);
5202
+ D = await Ii.post(m, { value: k }, S);
5186
5203
  else
5187
5204
  throw new Error("Unsupported HTTP method");
5188
- I.status === 200 && ((((Q = (K = I == null ? void 0 : I.data) == null ? void 0 : K.data) == null ? void 0 : Q.status) || ((W = I == null ? void 0 : I.data) == null ? void 0 : W.status)) === !0 ? (c(!0), x === "string" ? v(
5189
- ((M = (Z = I == null ? void 0 : I.data) == null ? void 0 : Z.data) == null ? void 0 : M.description) || ((E = I == null ? void 0 : I.data) == null ? void 0 : E.description) || "Validation successful"
5205
+ D.status === 200 && ((((Q = (K = D == null ? void 0 : D.data) == null ? void 0 : K.data) == null ? void 0 : Q.status) || ((W = D == null ? void 0 : D.data) == null ? void 0 : W.status)) === !0 ? (c(!0), x === "string" ? v(
5206
+ ((M = (q = D == null ? void 0 : D.data) == null ? void 0 : q.data) == null ? void 0 : M.description) || ((E = D == null ? void 0 : D.data) == null ? void 0 : E.description) || "Validation successful"
5190
5207
  ) : f(
5191
- ((L = (P = I == null ? void 0 : I.data) == null ? void 0 : P.data) == null ? void 0 : L.description) || ((G = I == null ? void 0 : I.data) == null ? void 0 : G.description) || {}
5192
- )) : (console.error("Invalid input:", C), v("Unable to validate input"), c(!1)));
5193
- } catch (I) {
5194
- console.error("Error validating input:", I), v(
5195
- ((w = (q = I == null ? void 0 : I.response) == null ? void 0 : q.data) == null ? void 0 : w.message) || "Unable to validate input"
5208
+ ((L = (P = D == null ? void 0 : D.data) == null ? void 0 : P.data) == null ? void 0 : L.description) || ((G = D == null ? void 0 : D.data) == null ? void 0 : G.description) || {}
5209
+ )) : (console.error("Invalid input:", k), v("Unable to validate input"), c(!1)));
5210
+ } catch (D) {
5211
+ console.error("Error validating input:", D), v(
5212
+ ((w = (Z = D == null ? void 0 : D.response) == null ? void 0 : Z.data) == null ? void 0 : w.message) || "Unable to validate input"
5196
5213
  ), c(!1);
5197
5214
  } finally {
5198
5215
  u(!1);
@@ -5203,12 +5220,12 @@ function fs({
5203
5220
  );
5204
5221
  return O(() => {
5205
5222
  if (l) {
5206
- const C = setTimeout(() => {
5207
- S(l);
5223
+ const k = setTimeout(() => {
5224
+ N(l);
5208
5225
  }, 700);
5209
- return () => clearTimeout(C);
5226
+ return () => clearTimeout(k);
5210
5227
  }
5211
- }, [S, l]), /* @__PURE__ */ n.jsxs("div", { children: [
5228
+ }, [N, l]), /* @__PURE__ */ n.jsxs("div", { children: [
5212
5229
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center", children: [
5213
5230
  /* @__PURE__ */ n.jsx(
5214
5231
  "input",
@@ -5217,8 +5234,8 @@ function fs({
5217
5234
  type: (i == null ? void 0 : i.inputType) || "text",
5218
5235
  className: J("field-control", i == null ? void 0 : i.customClass),
5219
5236
  ...o(i == null ? void 0 : i.id),
5220
- onChange: (C) => {
5221
- d(C.target.value), s(i == null ? void 0 : i.id, C.target.value);
5237
+ onChange: (k) => {
5238
+ d(k.target.value), s(i == null ? void 0 : i.id, k.target.value);
5222
5239
  },
5223
5240
  disabled: e == null ? void 0 : e.isReadOnly
5224
5241
  }
@@ -5267,13 +5284,13 @@ function fs({
5267
5284
  children: h
5268
5285
  }
5269
5286
  ),
5270
- x === "object" && /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (A = Object.entries(y)) == null ? void 0 : A.map(([C, K]) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
5287
+ x === "object" && /* @__PURE__ */ n.jsx("div", { className: "grid grid-cols-2 gap-6 mt-2 text-sm text-gray-600", children: (y = Object.entries(A)) == null ? void 0 : y.map(([k, K]) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
5271
5288
  /* @__PURE__ */ n.jsxs("span", { className: "font-semibold", children: [
5272
- C,
5289
+ k,
5273
5290
  ":"
5274
5291
  ] }),
5275
5292
  ps(K) ? /* @__PURE__ */ n.jsx(gs, { imageUrl: K }) : /* @__PURE__ */ n.jsx("span", { children: String(K) })
5276
- ] }, C)) })
5293
+ ] }, k)) })
5277
5294
  ] });
5278
5295
  }
5279
5296
  function xs({
@@ -5295,7 +5312,7 @@ function xs({
5295
5312
  function t(r, c) {
5296
5313
  return parseFloat(r) * parseFloat(c) || 0;
5297
5314
  }
5298
- const u = ii(
5315
+ const u = ni(
5299
5316
  () => a.reduce((r, c) => {
5300
5317
  const h = t(c.key, c.value);
5301
5318
  return r + h;
@@ -5411,7 +5428,7 @@ function ks({
5411
5428
  return /* @__PURE__ */ n.jsxs("tr", { children: [
5412
5429
  e.map((c) => {
5413
5430
  var x;
5414
- const h = i[c.field], v = c.editable && !o, g = r(c.field), { isValidating: y, result: f } = t(i.id, c.field);
5431
+ const h = i[c.field], v = c.editable && !o, g = r(c.field), { isValidating: A, result: f } = t(i.id, c.field);
5415
5432
  let m = "border-gray-300";
5416
5433
  c.validate && ((f == null ? void 0 : f.isValid) === !1 ? m = "border-red-500 bg-red-50" : (f == null ? void 0 : f.isValid) === !0 && (m = "border-green-500 bg-green-50"));
5417
5434
  const p = `w-full px-2 py-1 border rounded outline-none ${m}`;
@@ -5439,26 +5456,26 @@ function ks({
5439
5456
  autoFocus: !0
5440
5457
  }
5441
5458
  ) : c.type === "checkbox" ? /* @__PURE__ */ n.jsx("div", { className: "flex items-center gap-x-4", children: ["yes", "no"].map((j) => {
5442
- const N = j === "yes", S = `radio-${i.id}-${String(
5459
+ const S = j === "yes", N = `radio-${i.id}-${String(
5443
5460
  c.field
5444
5461
  )}-${j}`;
5445
5462
  return /* @__PURE__ */ n.jsxs(
5446
5463
  "label",
5447
5464
  {
5448
- htmlFor: S,
5465
+ htmlFor: N,
5449
5466
  className: "flex items-center gap-1 cursor-pointer",
5450
5467
  children: [
5451
5468
  /* @__PURE__ */ n.jsx(
5452
5469
  "input",
5453
5470
  {
5454
- id: S,
5471
+ id: N,
5455
5472
  type: "radio",
5456
5473
  name: `boolean-${i.id}-${String(c.field)}`,
5457
- checked: h === N,
5458
- onChange: () => l(N, i.id, c.field)
5474
+ checked: h === S,
5475
+ onChange: () => l(S, i.id, c.field)
5459
5476
  }
5460
5477
  ),
5461
- /* @__PURE__ */ n.jsx("span", { className: "text-sm", children: N ? "Yes" : "No" })
5478
+ /* @__PURE__ */ n.jsx("span", { className: "text-sm", children: S ? "Yes" : "No" })
5462
5479
  ]
5463
5480
  },
5464
5481
  j
@@ -5476,7 +5493,7 @@ function ks({
5476
5493
  autoFocus: !0
5477
5494
  }
5478
5495
  ),
5479
- y && /* @__PURE__ */ n.jsx("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ n.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) })
5496
+ A && /* @__PURE__ */ n.jsx("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ n.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) })
5480
5497
  ] }) : c.validate && f ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
5481
5498
  /* @__PURE__ */ n.jsxs("span", { children: [
5482
5499
  String(h != null ? h : ""),
@@ -5515,7 +5532,7 @@ function Ms({
5515
5532
  isReadOnly: o = !1,
5516
5533
  columns: s
5517
5534
  }) {
5518
- const [a, l] = R(i), [d, t] = R(null), u = Ii(null), [r, c] = R(0);
5535
+ const [a, l] = R(i), [d, t] = R(null), u = Di(null), [r, c] = R(0);
5519
5536
  O(() => {
5520
5537
  const f = document.getElementById("form");
5521
5538
  if (!f) return;
@@ -5549,11 +5566,11 @@ function Ms({
5549
5566
  },
5550
5567
  []
5551
5568
  ), v = Y(() => {
5552
- const f = xi(), m = s.reduce((p, x) => (p[x.field] = x.field === "id" ? f : "", p), {});
5569
+ const f = yi(), m = s.reduce((p, x) => (p[x.field] = x.field === "id" ? f : "", p), {});
5553
5570
  l((p) => [...p, { id: f, ...m }]);
5554
5571
  }, [s]), g = Y((f) => {
5555
5572
  l((m) => m.filter((p) => p.id !== f));
5556
- }, []), y = Y(
5573
+ }, []), A = Y(
5557
5574
  () => ({
5558
5575
  isValidating: !1,
5559
5576
  result: void 0
@@ -5604,7 +5621,7 @@ function Ms({
5604
5621
  handleCellChange: h,
5605
5622
  debouncedValidate: () => {
5606
5623
  },
5607
- getValidationStatus: y,
5624
+ getValidationStatus: A,
5608
5625
  deleteRow: g
5609
5626
  },
5610
5627
  f.id
@@ -5665,31 +5682,31 @@ const ge = ({
5665
5682
  isFloatingLabel: h = !1,
5666
5683
  subText: v,
5667
5684
  labelClass: g = "",
5668
- loading: y,
5685
+ loading: A,
5669
5686
  disabled: f
5670
5687
  }) => {
5671
- const [m, p] = R(c ? [] : null), x = J("custom-select__control", i), j = ii(() => e, [e]);
5688
+ const [m, p] = R(c ? [] : null), x = J("custom-select__control", i), j = ni(() => e, [e]);
5672
5689
  return O(() => {
5673
- const N = e == null ? void 0 : e.find((S) => {
5674
- var A;
5675
- return typeof S.value == "string" && typeof u == "string" ? S.value.toLowerCase() === u.toLowerCase() : typeof S.value == "object" && typeof u == "object" ? ((A = S.value) == null ? void 0 : A.id) === (u == null ? void 0 : u.id) : S.value === u;
5690
+ const S = e == null ? void 0 : e.find((N) => {
5691
+ var y;
5692
+ return typeof N.value == "string" && typeof u == "string" ? N.value.toLowerCase() === u.toLowerCase() : typeof N.value == "object" && typeof u == "object" ? ((y = N.value) == null ? void 0 : y.id) === (u == null ? void 0 : u.id) : N.value === u;
5676
5693
  });
5677
- p(N || null);
5694
+ p(S || null);
5678
5695
  }, [u, e]), O(() => {
5679
5696
  m && l && a && (l(d, m == null ? void 0 : m.value), a(d), r == null || r(d));
5680
5697
  }, [d, m]), /* @__PURE__ */ n.jsxs("div", { className: "custom-select", children: [
5681
5698
  t && !h && /* @__PURE__ */ n.jsx("label", { className: "custom-select__label", children: t }),
5682
5699
  h && t && /* @__PURE__ */ n.jsx("label", { className: J("custom-select__floating-label", g), children: t }),
5683
5700
  /* @__PURE__ */ n.jsx(
5684
- oi,
5701
+ ai,
5685
5702
  {
5686
5703
  value: m,
5687
5704
  onChange: p,
5688
5705
  multiple: c,
5689
5706
  disabled: f,
5690
5707
  children: /* @__PURE__ */ n.jsxs("div", { className: "custom-select__wrapper", children: [
5691
- /* @__PURE__ */ n.jsxs(oi.Button, { className: x, disabled: f, children: [
5692
- y ? /* @__PURE__ */ n.jsx("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (m == null ? void 0 : m.label) || /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o }) }),
5708
+ /* @__PURE__ */ n.jsxs(ai.Button, { className: x, disabled: f, children: [
5709
+ A ? /* @__PURE__ */ n.jsx("span", { className: "custom-select__loading", children: "Fetching data..." }) : /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (m == null ? void 0 : m.label) || /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o }) }),
5693
5710
  /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(z, { icon: "lucide:chevron-down" }) })
5694
5711
  ] }),
5695
5712
  /* @__PURE__ */ n.jsx(
@@ -5697,26 +5714,26 @@ const ge = ({
5697
5714
  {
5698
5715
  as: ri.Fragment,
5699
5716
  leave: "custom-select__transition",
5700
- children: /* @__PURE__ */ n.jsx(oi.Options, { className: "custom-select__options", anchor: "bottom", children: j == null ? void 0 : j.map((N, S) => /* @__PURE__ */ n.jsx(
5701
- oi.Option,
5717
+ children: /* @__PURE__ */ n.jsx(ai.Options, { className: "custom-select__options", anchor: "bottom", children: j == null ? void 0 : j.map((S, N) => /* @__PURE__ */ n.jsx(
5718
+ ai.Option,
5702
5719
  {
5703
- value: N,
5704
- className: ({ active: A }) => J(
5720
+ value: S,
5721
+ className: ({ active: y }) => J(
5705
5722
  "custom-select__option",
5706
- A && "custom-select__option--active"
5723
+ y && "custom-select__option--active"
5707
5724
  ),
5708
- children: ({ selected: A }) => /* @__PURE__ */ n.jsx(
5725
+ children: ({ selected: y }) => /* @__PURE__ */ n.jsx(
5709
5726
  "span",
5710
5727
  {
5711
5728
  className: J(
5712
5729
  "custom-select__option-label",
5713
- A && "custom-select__option--selected"
5730
+ y && "custom-select__option--selected"
5714
5731
  ),
5715
- children: N.label
5732
+ children: S.label
5716
5733
  }
5717
5734
  )
5718
5735
  },
5719
- S
5736
+ N
5720
5737
  )) })
5721
5738
  }
5722
5739
  )
@@ -5752,7 +5769,7 @@ const ge = ({
5752
5769
  }
5753
5770
  }
5754
5771
  }, [l, t]);
5755
- const y = ii(
5772
+ const A = ni(
5756
5773
  () => {
5757
5774
  var m;
5758
5775
  return (m = i.options1) == null ? void 0 : m.filter((p) => p.key === u);
@@ -5777,7 +5794,7 @@ const ge = ({
5777
5794
  ge,
5778
5795
  {
5779
5796
  setValue: (m, p) => g("second", p),
5780
- options: y,
5797
+ options: A,
5781
5798
  name: `${t}`,
5782
5799
  register: o,
5783
5800
  value: c
@@ -5802,7 +5819,7 @@ const ge = ({
5802
5819
  setValue: c,
5803
5820
  watch: h,
5804
5821
  isReadOnly: v
5805
- } = t || {}, g = (p = h == null ? void 0 : h(d.id)) != null ? p : 0, [y, f] = R(null);
5822
+ } = t || {}, g = (p = h == null ? void 0 : h(d.id)) != null ? p : 0, [A, f] = R(null);
5806
5823
  O(() => {
5807
5824
  g == null && (c == null || c(d.id, i));
5808
5825
  }, []);
@@ -5815,12 +5832,12 @@ const ge = ({
5815
5832
  return /* @__PURE__ */ n.jsxs("div", { className: `flex gap-1 ${l}`, children: [
5816
5833
  /* @__PURE__ */ n.jsx("input", { type: "hidden", ...u(d.id) }),
5817
5834
  Array.from({ length: e }, (x, j) => {
5818
- const N = y !== null ? j <= y : j < g;
5835
+ const S = A !== null ? j <= A : j < g;
5819
5836
  return /* @__PURE__ */ n.jsx(
5820
5837
  Oe,
5821
5838
  {
5822
- icon: N ? "mdi:star" : "mdi:star-outline",
5823
- className: `cursor-pointer transition-colors ${N ? "text-yellow-400" : "text-gray-300"}`,
5839
+ icon: S ? "mdi:star" : "mdi:star-outline",
5840
+ className: `cursor-pointer transition-colors ${S ? "text-yellow-400" : "text-gray-300"}`,
5824
5841
  width: a,
5825
5842
  height: a,
5826
5843
  onMouseEnter: () => !(o || v) && f(j),
@@ -5842,23 +5859,23 @@ function fe({
5842
5859
  trigger: a,
5843
5860
  isReadOnly: l,
5844
5861
  watch: d
5845
- } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: r } = ii(() => {
5846
- var y;
5862
+ } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: r } = ni(() => {
5863
+ var A;
5847
5864
  if (typeof t == "string" && t.includes(",")) {
5848
- const [f, m] = (y = t.split(",")) == null ? void 0 : y.map((p) => p.trim());
5865
+ const [f, m] = (A = t.split(",")) == null ? void 0 : A.map((p) => p.trim());
5849
5866
  return { country: m, state: f };
5850
5867
  }
5851
5868
  return { country: t, state: "" };
5852
- }, [t]), c = Ii(t), h = ii(() => {
5853
- var y, f;
5854
- return u ? ((f = (y = Xi.find((m) => m.name === u)) == null ? void 0 : y.states) == null ? void 0 : f.map((m) => ({
5869
+ }, [t]), c = Di(t), h = ni(() => {
5870
+ var A, f;
5871
+ return u ? ((f = (A = Xi.find((m) => m.name === u)) == null ? void 0 : A.states) == null ? void 0 : f.map((m) => ({
5855
5872
  label: m.name,
5856
5873
  value: m.name
5857
5874
  }))) || [] : [];
5858
- }, [u]), v = (y, f) => {
5875
+ }, [u]), v = (A, f) => {
5859
5876
  const p = (f == null ? void 0 : f.value) || "";
5860
5877
  s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
5861
- }, g = (y, f) => {
5878
+ }, g = (A, f) => {
5862
5879
  const m = (f == null ? void 0 : f.value) || "", p = m ? `${m}, ${u}` : u;
5863
5880
  s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
5864
5881
  };
@@ -5897,19 +5914,19 @@ function Ls({
5897
5914
  element: i,
5898
5915
  validationData: e
5899
5916
  }) {
5900
- const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = ii(() => fi("config"), []), [u, r] = R(!1), [c, h] = R(!1), v = Y(async () => {
5901
- var g, y;
5917
+ const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = ni(() => xi("config"), []), [u, r] = R(!1), [c, h] = R(!1), v = Y(async () => {
5918
+ var g, A;
5902
5919
  if (!(!a || !l))
5903
5920
  try {
5904
5921
  h(!0);
5905
5922
  const m = {
5906
5923
  headers: {
5907
- Authorization: `Bearer ${fi("token")}`
5924
+ Authorization: `Bearer ${xi("token")}`
5908
5925
  }
5909
- }, { data: p } = await Di.get(
5926
+ }, { data: p } = await Ii.get(
5910
5927
  `${a}/${l}`,
5911
5928
  m
5912
- ), x = !!((y = (g = p == null ? void 0 : p.data) == null ? void 0 : g.isSigned) != null ? y : p != null && p.isSigned);
5929
+ ), x = !!((A = (g = p == null ? void 0 : p.data) == null ? void 0 : g.isSigned) != null ? A : p != null && p.isSigned);
5913
5930
  return r(x), x;
5914
5931
  } catch (f) {
5915
5932
  console.error("Failed to check sign status", f);
@@ -6223,17 +6240,17 @@ function Ps({
6223
6240
  description: h,
6224
6241
  validate: v,
6225
6242
  onChange: g,
6226
- onError: y
6243
+ onError: A
6227
6244
  }) {
6228
- const [f, m] = R(""), [p, x] = R(null), [j, N] = R(""), S = ii(
6245
+ const [f, m] = R(""), [p, x] = R(null), [j, S] = R(""), N = ni(
6229
6246
  () => {
6230
6247
  var M;
6231
6248
  return (M = fn == null ? void 0 : fn.slice().sort((E, P) => E.label.localeCompare(P.label))) == null ? void 0 : M.map((E) => ({ ...E, phone: `+${E.phone}` }));
6232
6249
  },
6233
6250
  []
6234
- ), A = ii(() => f ? S.filter(
6251
+ ), y = ni(() => f ? N.filter(
6235
6252
  (M) => `${M.label} ${M.phone}`.toLowerCase().includes(f.toLowerCase())
6236
- ) : S, [f, S]), C = (p == null ? void 0 : p.min) || 10, K = (p == null ? void 0 : p.max) || 10, Q = () => j ? `${(p == null ? void 0 : p.phone) || "+234"}-${j}` : "", W = (M) => {
6253
+ ) : N, [f, N]), k = (p == null ? void 0 : p.min) || 10, K = (p == null ? void 0 : p.max) || 10, Q = () => j ? `${(p == null ? void 0 : p.phone) || "+234"}-${j}` : "", W = (M) => {
6237
6254
  if (!M) return { code: "+234", number: "" };
6238
6255
  const E = M.split(/[-\s]/);
6239
6256
  return { code: E[0], number: E.slice(1).join(" ") };
@@ -6242,21 +6259,21 @@ function Ps({
6242
6259
  if (d) {
6243
6260
  const M = W(d);
6244
6261
  x(
6245
- S.find((E) => E.phone === M.code) || S[0]
6246
- ), N(M.number);
6262
+ N.find((E) => E.phone === M.code) || N[0]
6263
+ ), S(M.number);
6247
6264
  }
6248
- }, [d, S]);
6249
- const Z = ii(() => {
6265
+ }, [d, N]);
6266
+ const q = ni(() => {
6250
6267
  if (t) return t;
6251
6268
  const M = j.length;
6252
- return s && M === 0 ? "Phone number is required" : M > 0 && !/^\d+$/.test(j) ? "Phone number must contain only digits" : M > 0 && M < C ? `Minimum length is ${C}` : M > K ? `Maximum length is ${K}` : "";
6253
- }, [t, j, C, K, s]);
6269
+ return s && M === 0 ? "Phone number is required" : M > 0 && !/^\d+$/.test(j) ? "Phone number must contain only digits" : M > 0 && M < k ? `Minimum length is ${k}` : M > K ? `Maximum length is ${K}` : "";
6270
+ }, [t, j, k, K, s]);
6254
6271
  return O(() => {
6255
- g == null || g(Q()), y == null || y(Z || null);
6256
- }, [j, p, Z]), /* @__PURE__ */ n.jsxs(
6272
+ g == null || g(Q()), A == null || A(q || null);
6273
+ }, [j, p, q]), /* @__PURE__ */ n.jsxs(
6257
6274
  "div",
6258
6275
  {
6259
- className: `relative formGroup ${Z && !r ? "has-error" : ""} ${c ? "flex" : ""} ${!Z && j.length > 0 && !r ? "is-valid" : ""}`,
6276
+ className: `relative formGroup ${q && !r ? "has-error" : ""} ${c ? "flex" : ""} ${!q && j.length > 0 && !r ? "is-valid" : ""}`,
6260
6277
  children: [
6261
6278
  i && /* @__PURE__ */ n.jsxs(
6262
6279
  "label",
@@ -6284,7 +6301,7 @@ function Ps({
6284
6301
  }
6285
6302
  ),
6286
6303
  /* @__PURE__ */ n.jsx(Pi.Button, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ n.jsx(z, { icon: "lucide:chevron-down" }) }),
6287
- /* @__PURE__ */ n.jsx(Pi.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((M, E) => /* @__PURE__ */ n.jsxs(
6304
+ /* @__PURE__ */ n.jsx(Pi.Options, { className: "absolute z-10 w-[250px] left-0 bg-white border rounded-md shadow-lg max-h-[400px] overflow-y-auto", children: y == null ? void 0 : y.map((M, E) => /* @__PURE__ */ n.jsxs(
6288
6305
  Pi.Option,
6289
6306
  {
6290
6307
  value: M,
@@ -6309,15 +6326,15 @@ function Ps({
6309
6326
  readOnly: r,
6310
6327
  onChange: (M) => {
6311
6328
  const E = M.target.value.replace(/\D/g, "");
6312
- N(E);
6329
+ S(E);
6313
6330
  },
6314
6331
  placeholder: e,
6315
6332
  className: "w-full px-3 outline-none",
6316
6333
  maxLength: K,
6317
- minLength: C
6334
+ minLength: k
6318
6335
  }
6319
6336
  ),
6320
- /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Z && j.length > 0 && !r && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(z, { icon: "bi:check-lg" }) }) })
6337
+ /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !q && j.length > 0 && !r && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(z, { icon: "bi:check-lg" }) }) })
6321
6338
  ] })
6322
6339
  ] }),
6323
6340
  h && /* @__PURE__ */ n.jsx("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: h })
@@ -6416,11 +6433,11 @@ const He = {
6416
6433
  numberField: bn,
6417
6434
  amountField: hs,
6418
6435
  date: To,
6419
- password: Da,
6436
+ password: Ia,
6420
6437
  checkbox: Ga,
6421
6438
  radio: Oa,
6422
6439
  email: bn,
6423
- file: Ia,
6440
+ file: Da,
6424
6441
  dataGrid: Ts,
6425
6442
  section: Ka,
6426
6443
  validateInput: fs,
@@ -6436,9 +6453,9 @@ const He = {
6436
6453
  bank: fe,
6437
6454
  document: Ls,
6438
6455
  url: Rs
6439
- }, xe = "edit", Is = (i, e) => {
6456
+ }, xe = "edit", Ds = (i, e) => {
6440
6457
  const o = He[i.type];
6441
- return o ? /* @__PURE__ */ n.jsx(Dn, { element: i, state: xe, children: /* @__PURE__ */ n.jsxs("div", { className: "relative w-full", children: [
6458
+ return o ? /* @__PURE__ */ n.jsx(In, { element: i, state: xe, children: /* @__PURE__ */ n.jsxs("div", { className: "relative w-full", children: [
6442
6459
  i.type.toLowerCase() !== "grid" && /* @__PURE__ */ n.jsx("div", { className: "absolute top-0 left-0 z-20 w-full h-full" }),
6443
6460
  /* @__PURE__ */ n.jsx(
6444
6461
  o,
@@ -6456,7 +6473,7 @@ const He = {
6456
6473
  style: { gridColumn: i },
6457
6474
  children: e
6458
6475
  }
6459
- ), Ds = ({
6476
+ ), Is = ({
6460
6477
  element: i,
6461
6478
  sectionId: e,
6462
6479
  children: o,
@@ -6471,64 +6488,64 @@ const He = {
6471
6488
  moveElement: r,
6472
6489
  isDragging: c,
6473
6490
  removeElement: h
6474
- } = Ni(pi), v = ii(
6491
+ } = ji(gi), v = ni(
6475
6492
  () => Array.from({ length: i.columns }),
6476
6493
  [i.columns]
6477
- ), [g, y] = R(null);
6494
+ ), [g, A] = R(null);
6478
6495
  O(() => {
6479
- const N = () => {
6480
- y(null), u(!1);
6496
+ const S = () => {
6497
+ A(null), u(!1);
6481
6498
  };
6482
- return document.addEventListener("dragend", N), () => document.removeEventListener("dragend", N);
6499
+ return document.addEventListener("dragend", S), () => document.removeEventListener("dragend", S);
6483
6500
  }, [u]);
6484
6501
  const f = Y(
6485
- (N, S) => {
6486
- N.preventDefault(), N.stopPropagation(), N.dataTransfer.dropEffect = "move", y(S);
6502
+ (S, N) => {
6503
+ S.preventDefault(), S.stopPropagation(), S.dataTransfer.dropEffect = "move", A(N);
6487
6504
  },
6488
6505
  []
6489
6506
  ), m = Y(
6490
- (N, S) => {
6491
- N.preventDefault(), N.stopPropagation(), y(S);
6507
+ (S, N) => {
6508
+ S.preventDefault(), S.stopPropagation(), A(N);
6492
6509
  },
6493
6510
  []
6494
6511
  ), p = Y(
6495
- (N, S) => {
6496
- const A = N.relatedTarget;
6497
- A && N.currentTarget.contains(A) || y((C) => C === S ? null : C);
6512
+ (S, N) => {
6513
+ const y = S.relatedTarget;
6514
+ y && S.currentTarget.contains(y) || A((k) => k === N ? null : k);
6498
6515
  },
6499
6516
  []
6500
6517
  ), x = Y(
6501
- (N, S) => {
6518
+ (S, N) => {
6502
6519
  var K;
6503
- N.preventDefault(), N.stopPropagation(), u(!1), y(null);
6504
- const A = S + 1, C = N.dataTransfer.getData("elementId");
6505
- if (C) {
6520
+ S.preventDefault(), S.stopPropagation(), u(!1), A(null);
6521
+ const y = N + 1, k = S.dataTransfer.getData("elementId");
6522
+ if (k) {
6506
6523
  r({
6507
- draggedId: C,
6524
+ draggedId: k,
6508
6525
  sectionId: e,
6509
6526
  targetGridId: i.id,
6510
- targetCol: A
6527
+ targetCol: y
6511
6528
  });
6512
6529
  return;
6513
6530
  }
6514
6531
  try {
6515
- const Q = N.dataTransfer.getData("properties");
6532
+ const Q = S.dataTransfer.getData("properties");
6516
6533
  if (!Q) return;
6517
6534
  const W = JSON.parse(Q);
6518
6535
  if ((W == null ? void 0 : W.type) === "grid") return;
6519
- const Z = d.find((P) => P.id === e), M = (K = Z == null ? void 0 : Z.questionData) == null ? void 0 : K.find(
6536
+ const q = d.find((P) => P.id === e), M = (K = q == null ? void 0 : q.questionData) == null ? void 0 : K.find(
6520
6537
  (P) => {
6521
6538
  var L;
6522
- return P.gridId === i.id && ((L = P.gridPosition) == null ? void 0 : L.col) === A;
6539
+ return P.gridId === i.id && ((L = P.gridPosition) == null ? void 0 : L.col) === y;
6523
6540
  }
6524
6541
  );
6525
6542
  M && h(M.id, e);
6526
6543
  const E = {
6527
6544
  ...W,
6528
- id: xi(),
6545
+ id: yi(),
6529
6546
  sectionId: e,
6530
6547
  gridId: i.id,
6531
- gridPosition: { col: A }
6548
+ gridPosition: { col: y }
6532
6549
  };
6533
6550
  t(E, e);
6534
6551
  } catch (Q) {
@@ -6536,67 +6553,67 @@ const He = {
6536
6553
  }
6537
6554
  },
6538
6555
  [t, i.id, d, e, u, r]
6539
- ), j = (N, S, A) => {
6540
- var L, G, q;
6541
- const C = N + 1, K = (G = (L = d.find((w) => w.id === e)) == null ? void 0 : L.questionData) == null ? void 0 : G.find(
6556
+ ), j = (S, N, y) => {
6557
+ var L, G, Z;
6558
+ const k = S + 1, K = (G = (L = d.find((w) => w.id === e)) == null ? void 0 : L.questionData) == null ? void 0 : G.find(
6542
6559
  (w) => {
6543
- var I;
6544
- return w.gridId === i.id && ((I = w.gridPosition) == null ? void 0 : I.col) === C;
6560
+ var D;
6561
+ return w.gridId === i.id && ((D = w.gridPosition) == null ? void 0 : D.col) === k;
6545
6562
  }
6546
- ), Q = (q = K == null ? void 0 : K.id) != null ? q : null, W = Array.isArray(o) && o.find((w) => {
6547
- var I;
6548
- return ((I = w == null ? void 0 : w.props) == null ? void 0 : I.col) === C;
6549
- }), Z = c && g === N, M = !!W, E = c && !!l, P = M && Q && A === "edit" ? {
6563
+ ), Q = (Z = K == null ? void 0 : K.id) != null ? Z : null, W = Array.isArray(o) && o.find((w) => {
6564
+ var D;
6565
+ return ((D = w == null ? void 0 : w.props) == null ? void 0 : D.col) === k;
6566
+ }), q = c && g === S, M = !!W, E = c && !!l, P = M && Q && y === "edit" ? {
6550
6567
  draggable: !0,
6551
6568
  onDragStart: (w) => {
6552
6569
  w.stopPropagation(), w.dataTransfer.setData("elementId", Q), w.dataTransfer.setData("properties", Q), w.dataTransfer.effectAllowed = "move", u(!0);
6553
6570
  },
6554
6571
  onDragEnd: () => {
6555
- y(null), u(!1);
6572
+ A(null), u(!1);
6556
6573
  }
6557
6574
  } : {};
6558
6575
  return /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsxs(
6559
6576
  "div",
6560
6577
  {
6561
- id: `grid-cell-${i.id}-${N}`,
6578
+ id: `grid-cell-${i.id}-${S}`,
6562
6579
  ...P,
6563
- onDrop: (w) => x(w, N),
6564
- onDragEnter: (w) => m(w, N),
6565
- onDragOver: (w) => f(w, N),
6566
- onDragLeave: (w) => p(w, N),
6580
+ onDrop: (w) => x(w, S),
6581
+ onDragEnter: (w) => m(w, S),
6582
+ onDragOver: (w) => f(w, S),
6583
+ onDragLeave: (w) => p(w, S),
6567
6584
  className: J(
6568
6585
  "relative border rounded-lg min-h-[110px]",
6569
6586
  "flex items-center justify-center",
6570
6587
  "transition-all duration-200 ease-in-out",
6571
- A === "edit" ? "py-3 " : "",
6572
- M && A === "edit" && "cursor-grab active:cursor-grabbing border-none",
6573
- S,
6574
- !E && !Z && "bg-white border-gray-200 text-gray-300",
6575
- E && !Z && !M && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
6576
- E && !Z && M && "bg-white border-orange-200 border-dashed",
6577
- Z && !M && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
6578
- Z && M && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
6588
+ y === "edit" ? "py-3 " : "",
6589
+ M && y === "edit" && "cursor-grab active:cursor-grabbing border-none",
6590
+ N,
6591
+ !E && !q && "bg-white border-gray-200 text-gray-300",
6592
+ E && !q && !M && "bg-blue-50 border-blue-200 border-dashed text-blue-300",
6593
+ E && !q && M && "bg-white border-orange-200 border-dashed",
6594
+ q && !M && "bg-blue-100 border-blue-400 border-dashed shadow-inner scale-[1.01] text-blue-500",
6595
+ q && M && "bg-orange-50 border-orange-400 border-dashed shadow-inner scale-[1.01] text-orange-500"
6579
6596
  ),
6580
6597
  children: [
6581
- M && 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(z, { icon: "ph:dots-six-bold" }) }),
6582
- Z && !M && /* @__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: [
6598
+ M && y === "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(z, { icon: "ph:dots-six-bold" }) }),
6599
+ q && !M && /* @__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: [
6583
6600
  /* @__PURE__ */ n.jsx(z, { icon: "ph:plus-bold" }),
6584
6601
  "Drop here"
6585
6602
  ] }),
6586
- Z && M && /* @__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" }),
6603
+ q && M && /* @__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" }),
6587
6604
  /* @__PURE__ */ n.jsx(
6588
6605
  "div",
6589
6606
  {
6590
6607
  className: J(
6591
6608
  "w-full select-none",
6592
- Z && "opacity-50 pointer-events-none"
6609
+ q && "opacity-50 pointer-events-none"
6593
6610
  ),
6594
- children: W || /* @__PURE__ */ n.jsx("span", { className: "flex items-center justify-center text-gray-300", children: A === "edit" && /* @__PURE__ */ n.jsx(z, { icon: "ph:plus-bold" }) })
6611
+ children: W || /* @__PURE__ */ n.jsx("span", { className: "flex items-center justify-center text-gray-300", children: y === "edit" && /* @__PURE__ */ n.jsx(z, { icon: "ph:plus-bold" }) })
6595
6612
  }
6596
6613
  )
6597
6614
  ]
6598
6615
  }
6599
- ) }, N);
6616
+ ) }, S);
6600
6617
  };
6601
6618
  return /* @__PURE__ */ n.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ n.jsx(
6602
6619
  "div",
@@ -6606,11 +6623,11 @@ const He = {
6606
6623
  gridTemplateColumns: `repeat(${i.columns}, 1fr)`
6607
6624
  },
6608
6625
  children: v == null ? void 0 : v.map(
6609
- (N, S) => j(S, s, a)
6626
+ (S, N) => j(N, s, a)
6610
6627
  )
6611
6628
  }
6612
6629
  ) });
6613
- }, Kn = ri.memo(Ds), Os = "edit";
6630
+ }, Kn = ri.memo(Is), Os = "edit";
6614
6631
  function xn({
6615
6632
  index: i,
6616
6633
  onDrop: e,
@@ -6654,7 +6671,7 @@ function Ks({ elementData: i, sectionId: e }) {
6654
6671
  setIsDragging: a,
6655
6672
  addElementInPosition: l,
6656
6673
  moveElement: d
6657
- } = Ni(pi), [t, u] = R(null), r = ii(
6674
+ } = ji(gi), [t, u] = R(null), r = ni(
6658
6675
  () => {
6659
6676
  var p;
6660
6677
  return ((p = o.find((x) => x.id === e)) == null ? void 0 : p.questionData) || [];
@@ -6679,10 +6696,10 @@ function Ks({ elementData: i, sectionId: e }) {
6679
6696
  h();
6680
6697
  return;
6681
6698
  }
6682
- const N = r.find((A) => A.id === x), S = r.findIndex(
6683
- (A) => A.id === j
6699
+ const S = r.find((y) => y.id === x), N = r.findIndex(
6700
+ (y) => y.id === j
6684
6701
  );
6685
- N != null && N.gridId && S !== -1 ? d({ draggedId: x, sectionId: e, targetIndex: S }) : d({ draggedId: x, sectionId: e, targetId: j }), u(null), a(!1);
6702
+ S != null && S.gridId && N !== -1 ? d({ draggedId: x, sectionId: e, targetIndex: N }) : d({ draggedId: x, sectionId: e, targetId: j }), u(null), a(!1);
6686
6703
  },
6687
6704
  [e, d, a, h, r]
6688
6705
  ), g = Y(
@@ -6694,16 +6711,16 @@ function Ks({ elementData: i, sectionId: e }) {
6694
6711
  return;
6695
6712
  }
6696
6713
  try {
6697
- const N = JSON.parse(p.dataTransfer.getData("properties"));
6698
- if ((N == null ? void 0 : N.type) === "section") return;
6699
- const S = { ...N, id: xi(), sectionId: e };
6700
- l(S, e, x), u(null);
6701
- } catch (N) {
6702
- console.error("Drop error:", N);
6714
+ const S = JSON.parse(p.dataTransfer.getData("properties"));
6715
+ if ((S == null ? void 0 : S.type) === "section") return;
6716
+ const N = { ...S, id: yi(), sectionId: e };
6717
+ l(N, e, x), u(null);
6718
+ } catch (S) {
6719
+ console.error("Drop error:", S);
6703
6720
  }
6704
6721
  },
6705
6722
  [l, e, a, d]
6706
- ), y = Y(
6723
+ ), A = Y(
6707
6724
  (p, x = !1) => /* @__PURE__ */ n.jsx(
6708
6725
  "div",
6709
6726
  {
@@ -6720,12 +6737,12 @@ function Ks({ elementData: i, sectionId: e }) {
6720
6737
  "transition-all duration-200 ease-in-out",
6721
6738
  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"
6722
6739
  ),
6723
- children: Is(p, e)
6740
+ children: Ds(p, e)
6724
6741
  },
6725
6742
  p.id
6726
6743
  ),
6727
6744
  [t, v, e, c, h]
6728
- ), f = ii(() => (i == null ? void 0 : i.reduce((p, x) => (x.gridId && (p[x.gridId] = p[x.gridId] || [], p[x.gridId].push(x)), p), {})) || {}, [i]);
6745
+ ), f = ni(() => (i == null ? void 0 : i.reduce((p, x) => (x.gridId && (p[x.gridId] = p[x.gridId] || [], p[x.gridId].push(x)), p), {})) || {}, [i]);
6729
6746
  if (!(i != null && i.length))
6730
6747
  return /* @__PURE__ */ n.jsx(
6731
6748
  "div",
@@ -6751,25 +6768,25 @@ function Ks({ elementData: i, sectionId: e }) {
6751
6768
  m.map((p) => {
6752
6769
  const x = r.findIndex((j) => j.id === p.id);
6753
6770
  if (p.type === "grid") {
6754
- const j = f[p.id] || [], N = t === p.id, S = !!t && !N;
6771
+ const j = f[p.id] || [], S = t === p.id, N = !!t && !S;
6755
6772
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-0", children: [
6756
6773
  /* @__PURE__ */ n.jsx(
6757
6774
  "div",
6758
6775
  {
6759
6776
  id: p.id,
6760
6777
  draggable: !0,
6761
- onDragStart: (A) => c(A, p.id),
6762
- onDragOver: (A) => {
6763
- A.preventDefault(), A.stopPropagation();
6778
+ onDragStart: (y) => c(y, p.id),
6779
+ onDragOver: (y) => {
6780
+ y.preventDefault(), y.stopPropagation();
6764
6781
  },
6765
6782
  onDrop: v,
6766
6783
  onDragEnd: h,
6767
6784
  className: J(
6768
6785
  "w-full p-4 border rounded-lg cursor-grab active:cursor-grabbing",
6769
6786
  "transition-all duration-200 ease-in-out",
6770
- N ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : S ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
6787
+ S ? "opacity-40 scale-[0.98] bg-gray-100 border-dashed border-blue-400 shadow-inner" : N ? "bg-white border-dashed border-blue-200" : "bg-white border-gray-200 shadow-sm hover:border-blue-300 hover:shadow-md"
6771
6788
  ),
6772
- children: /* @__PURE__ */ n.jsx(Dn, { element: p, state: "edit", children: /* @__PURE__ */ n.jsx(
6789
+ children: /* @__PURE__ */ n.jsx(In, { element: p, state: "edit", children: /* @__PURE__ */ n.jsx(
6773
6790
  Kn,
6774
6791
  {
6775
6792
  element: p,
@@ -6777,9 +6794,9 @@ function Ks({ elementData: i, sectionId: e }) {
6777
6794
  state: Os,
6778
6795
  draggedElementId: t,
6779
6796
  children: j == null ? void 0 : j.map(
6780
- (A) => {
6781
- var C;
6782
- return /* @__PURE__ */ n.jsx(On, { col: (C = A.gridPosition) == null ? void 0 : C.col, children: y(A, !0) }, A.id);
6797
+ (y) => {
6798
+ var k;
6799
+ return /* @__PURE__ */ n.jsx(On, { col: (k = y.gridPosition) == null ? void 0 : k.col, children: A(y, !0) }, y.id);
6783
6800
  }
6784
6801
  )
6785
6802
  }
@@ -6798,7 +6815,7 @@ function Ks({ elementData: i, sectionId: e }) {
6798
6815
  ] }, p.id);
6799
6816
  }
6800
6817
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-0", children: [
6801
- y(p),
6818
+ A(p),
6802
6819
  /* @__PURE__ */ n.jsx(
6803
6820
  xn,
6804
6821
  {
@@ -6814,24 +6831,26 @@ function Ks({ elementData: i, sectionId: e }) {
6814
6831
  }
6815
6832
  const Gs = an(Ks), Hs = B.object({
6816
6833
  title: B.string(),
6817
- description: B.string()
6818
- }).required(), yn = fi("config"), Vs = ({ isOpen: i, onClose: e, section: o }) => {
6819
- const { updateSection: s } = ri.useContext(pi), {
6834
+ description: B.string(),
6835
+ disabled: B.boolean().default(!1),
6836
+ isHidden: B.boolean().default(!1)
6837
+ }).required(), yn = xi("config"), Vs = ({ isOpen: i, onClose: e, section: o }) => {
6838
+ const { updateSection: s } = ri.useContext(gi), {
6820
6839
  register: a,
6821
6840
  handleSubmit: l,
6822
6841
  watch: d,
6823
6842
  formState: { errors: t, isSubmitting: u, isValid: r },
6824
6843
  reset: c
6825
6844
  } = En({
6826
- resolver: In(Hs),
6845
+ resolver: Dn(Hs),
6827
6846
  defaultValues: o
6828
6847
  });
6829
6848
  if (ri.useEffect(() => {
6830
6849
  i || c();
6831
6850
  }, [i, c]), !i) return null;
6832
- const h = (v) => {
6833
- s(v, o.id), e();
6834
- };
6851
+ const h = (g) => {
6852
+ s(g, o.id), e();
6853
+ }, v = d();
6835
6854
  return /* @__PURE__ */ n.jsx("div", { className: "fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none", children: /* @__PURE__ */ n.jsxs("div", { className: "min-w-[600px] bg-white rounded-xl shadow-xl relative flex flex-col items-center", children: [
6836
6855
  /* @__PURE__ */ n.jsxs("div", { className: "w-full px-6 pt-6 pb-5 flex flex-col items-start gap-4 z-10 mb-6", children: [
6837
6856
  /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold text-[#475467] font-onest", children: "Update Section Information" }),
@@ -6863,7 +6882,34 @@ const Gs = an(Ks), Hs = B.object({
6863
6882
  name: "description",
6864
6883
  register: a,
6865
6884
  errors: t,
6866
- watch: d
6885
+ watch: d,
6886
+ type: "textarea"
6887
+ }
6888
+ ),
6889
+ /* @__PURE__ */ n.jsx(
6890
+ F,
6891
+ {
6892
+ label: "Disable Section",
6893
+ name: "disabled",
6894
+ register: a,
6895
+ errors: t,
6896
+ watch: d,
6897
+ type: "checkbox",
6898
+ value: v.disabled,
6899
+ description: "Disables all fields in this section"
6900
+ }
6901
+ ),
6902
+ /* @__PURE__ */ n.jsx(
6903
+ F,
6904
+ {
6905
+ label: "Hide Section",
6906
+ name: "isHidden",
6907
+ register: a,
6908
+ errors: t,
6909
+ watch: d,
6910
+ type: "checkbox",
6911
+ value: v.isHidden,
6912
+ description: "Hides this section from the form"
6867
6913
  }
6868
6914
  )
6869
6915
  ] }),
@@ -6891,7 +6937,7 @@ const Gs = an(Ks), Hs = B.object({
6891
6937
  ] })
6892
6938
  ] }) });
6893
6939
  }, Fs = () => {
6894
- const [i, e] = R(!1), o = Ii(null), s = Ii(null), {
6940
+ const [i, e] = R(!1), o = Di(null), s = Di(null), {
6895
6941
  removeSection: a,
6896
6942
  // addElement,
6897
6943
  addSection: l,
@@ -6901,7 +6947,7 @@ const Gs = an(Ks), Hs = B.object({
6901
6947
  selectedSection: r,
6902
6948
  activeSections: c,
6903
6949
  setActiveSections: h
6904
- } = Ni(pi);
6950
+ } = ji(gi);
6905
6951
  O(() => {
6906
6952
  var m;
6907
6953
  u(((m = d[0]) == null ? void 0 : m.id) || null);
@@ -6914,10 +6960,10 @@ const Gs = an(Ks), Hs = B.object({
6914
6960
  (p) => p.filter((x) => x !== m)
6915
6961
  ) : h((p) => [...p, m]);
6916
6962
  }
6917
- function y(m) {
6963
+ function A(m) {
6918
6964
  o.current = m, e(!0);
6919
6965
  }
6920
- const f = fi("config");
6966
+ const f = xi("config");
6921
6967
  return /* @__PURE__ */ n.jsxs(
6922
6968
  "div",
6923
6969
  {
@@ -6959,7 +7005,7 @@ const Gs = an(Ks), Hs = B.object({
6959
7005
  {
6960
7006
  type: "button",
6961
7007
  className: "p-1 text-xs border rounded-lg",
6962
- onClick: () => y(m),
7008
+ onClick: () => A(m),
6963
7009
  children: /* @__PURE__ */ n.jsx(z, { icon: "fluent:edit-28-regular" })
6964
7010
  }
6965
7011
  ),
@@ -7039,7 +7085,7 @@ function Ws({
7039
7085
  questionData: i,
7040
7086
  uploadUrl: e
7041
7087
  }) {
7042
- const { setFormData: o, addSection: s, setUploadUrl: a } = Ni(pi);
7088
+ const { setFormData: o, addSection: s, setUploadUrl: a } = ji(gi);
7043
7089
  O(() => {
7044
7090
  i && i.length > 0 && o(i);
7045
7091
  }, [i, o]), O(() => {
@@ -7075,36 +7121,36 @@ const An = [
7075
7121
  { key: "layoutAndDisplay", title: "Layout & Display" },
7076
7122
  { key: "advancedData", title: "Advanced / Data" }
7077
7123
  ], Us = () => {
7078
- const [i, e] = R(""), { setIsDragging: o, addElement: s, selectedSection: a } = Ni(pi), l = Y(
7079
- (g, y) => {
7124
+ const [i, e] = R(""), { setIsDragging: o, addElement: s, selectedSection: a } = ji(gi), l = Y(
7125
+ (g, A) => {
7080
7126
  if (!a) {
7081
- Si.error("Please select a section to add an element.");
7127
+ Ni.error("Please select a section to add an element.");
7082
7128
  return;
7083
7129
  }
7084
- g.dataTransfer.setData("properties", JSON.stringify(y)), g.dataTransfer.effectAllowed = "move", o(!0);
7130
+ g.dataTransfer.setData("properties", JSON.stringify(A)), g.dataTransfer.effectAllowed = "move", o(!0);
7085
7131
  },
7086
7132
  [o, a]
7087
7133
  );
7088
7134
  function d(g) {
7089
7135
  if (!a) {
7090
- Si.error("Please select a section to add an element.");
7136
+ Ni.error("Please select a section to add an element.");
7091
7137
  return;
7092
7138
  }
7093
- const y = {
7139
+ const A = {
7094
7140
  ...g,
7095
- id: xi(),
7141
+ id: yi(),
7096
7142
  sectionId: a
7097
7143
  };
7098
- s(y, a);
7144
+ s(A, a);
7099
7145
  }
7100
- const t = fi("config") || {}, u = t.elementColor, r = t.elementBgColor, c = t.elementBorderColor, h = _a.filter(
7146
+ const t = xi("config") || {}, u = t.elementColor, r = t.elementBgColor, c = t.elementBorderColor, h = _a.filter(
7101
7147
  (g) => g.label.toLowerCase().includes(i.toLowerCase())
7102
7148
  ), v = An == null ? void 0 : An.map((g) => ({
7103
7149
  title: g.title,
7104
7150
  elements: h.filter(
7105
- (y) => {
7151
+ (A) => {
7106
7152
  var f;
7107
- return (f = Ja[g.key]) == null ? void 0 : f.includes(y.type);
7153
+ return (f = Ja[g.key]) == null ? void 0 : f.includes(A.type);
7108
7154
  }
7109
7155
  )
7110
7156
  })).filter((g) => g.elements.length > 0);
@@ -7121,7 +7167,7 @@ const An = [
7121
7167
  }
7122
7168
  ) }),
7123
7169
  /* @__PURE__ */ n.jsx("hr", {}),
7124
- /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("ul", { className: "grid gap-y-5 mt-3 px-5 max-h-[80vh] overflow-y-auto no-scrollbar", children: v == null ? void 0 : v.map((g, y) => {
7170
+ /* @__PURE__ */ n.jsx("div", { children: /* @__PURE__ */ n.jsx("ul", { className: "grid gap-y-5 mt-3 px-5 max-h-[80vh] overflow-y-auto no-scrollbar", children: v == null ? void 0 : v.map((g, A) => {
7125
7171
  var f;
7126
7172
  return /* @__PURE__ */ n.jsxs("li", { children: [
7127
7173
  /* @__PURE__ */ n.jsx("h4", { className: "mb-2 text-[11px] font-bold text-gray-500 uppercase", children: g.title }),
@@ -7154,7 +7200,7 @@ const An = [
7154
7200
  },
7155
7201
  m.type
7156
7202
  )) })
7157
- ] }, y);
7203
+ ] }, A);
7158
7204
  }) }) })
7159
7205
  ] });
7160
7206
  }, zs = an(Us), Ei = ({
@@ -7179,7 +7225,7 @@ const An = [
7179
7225
  "opacity-40 cursor-not-allowed": e
7180
7226
  },
7181
7227
  s
7182
- ), y = () => o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
7228
+ ), A = () => o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
7183
7229
  /* @__PURE__ */ n.jsxs(
7184
7230
  "svg",
7185
7231
  {
@@ -7216,7 +7262,7 @@ const An = [
7216
7262
  i && /* @__PURE__ */ n.jsx("span", { children: i }),
7217
7263
  a && l === "right" && /* @__PURE__ */ n.jsx("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(z, { icon: a }) })
7218
7264
  ] });
7219
- return r ? /* @__PURE__ */ n.jsx("div", { className: g, children: y() }) : u ? /* @__PURE__ */ n.jsx(No, { to: u, className: g, children: y() }) : /* @__PURE__ */ n.jsx(
7265
+ return r ? /* @__PURE__ */ n.jsx("div", { className: g, children: A() }) : u ? /* @__PURE__ */ n.jsx(No, { to: u, className: g, children: A() }) : /* @__PURE__ */ n.jsx(
7220
7266
  "button",
7221
7267
  {
7222
7268
  disabled: e,
@@ -7225,7 +7271,7 @@ const An = [
7225
7271
  "data-testid": "btn",
7226
7272
  onClick: v,
7227
7273
  style: h,
7228
- children: y()
7274
+ children: A()
7229
7275
  }
7230
7276
  );
7231
7277
  };
@@ -7269,11 +7315,11 @@ const Js = ({
7269
7315
  isOpen: i,
7270
7316
  onClose: e
7271
7317
  }) => {
7272
- const { formData: o, uploadUrl: s } = Ni(
7273
- pi
7318
+ const { formData: o, uploadUrl: s } = ji(
7319
+ gi
7274
7320
  );
7275
7321
  if (!i) return null;
7276
- const a = fi("config");
7322
+ const a = xi("config");
7277
7323
  return /* @__PURE__ */ n.jsxs("div", { className: "fixed inset-0 flex justify-center z-[999] cursor-default no-drag select-none w-screen h-screen pt-20 bg-[#F8F9FC]", children: [
7278
7324
  /* @__PURE__ */ n.jsx(
7279
7325
  "button",
@@ -7322,7 +7368,7 @@ function Ys() {
7322
7368
  }
7323
7369
  ) });
7324
7370
  }
7325
- function Zs({
7371
+ function qs({
7326
7372
  title: i,
7327
7373
  goBackUrl: e,
7328
7374
  onSubmit: o,
@@ -7332,7 +7378,7 @@ function Zs({
7332
7378
  publishLoading: d,
7333
7379
  onTitleChange: t
7334
7380
  }) {
7335
- const { formData: u } = Ni(pi), [r, c] = R(!1), [h, v] = R(!1), [g, y] = R(i || ""), f = fi("config");
7381
+ const { formData: u } = ji(gi), [r, c] = R(!1), [h, v] = R(!1), [g, A] = R(i || ""), f = xi("config");
7336
7382
  function m() {
7337
7383
  localStorage.setItem("formData", JSON.stringify(u)), o == null || o(u);
7338
7384
  }
@@ -7360,7 +7406,7 @@ function Zs({
7360
7406
  {
7361
7407
  type: "text",
7362
7408
  value: g,
7363
- onChange: (j) => y(j.target.value),
7409
+ onChange: (j) => A(j.target.value),
7364
7410
  onBlur: x,
7365
7411
  autoFocus: !0,
7366
7412
  className: "w-48 px-2 py-1 text-sm font-semibold outline-gray-100 input form_title"
@@ -7430,11 +7476,11 @@ const Ve = ({ loadingClass: i }) => {
7430
7476
  i
7431
7477
  );
7432
7478
  return O(() => {
7433
- const o = fi("config"), s = (o == null ? void 0 : o.loaderColor) || "#333";
7479
+ const o = xi("config"), s = (o == null ? void 0 : o.loaderColor) || "#333";
7434
7480
  document.documentElement.style.setProperty("--loader-color", s);
7435
7481
  }, []), /* @__PURE__ */ n.jsx("div", { className: e, children: /* @__PURE__ */ n.jsx("span", { className: "loader" }) });
7436
7482
  };
7437
- function qs({
7483
+ function Zs({
7438
7484
  onSubmit: i,
7439
7485
  questionData: e,
7440
7486
  title: o,
@@ -7451,7 +7497,7 @@ function qs({
7451
7497
  /* @__PURE__ */ n.jsx(Ae, { position: "top-right", richColors: !0, closeButton: !0 }),
7452
7498
  /* @__PURE__ */ n.jsxs("div", { className: "w-full h-full bg-[#F8F9FC] flex flex-col", children: [
7453
7499
  /* @__PURE__ */ n.jsx("div", { className: "border-b bg-white border-[#E4E7EC]", children: /* @__PURE__ */ n.jsx(
7454
- Zs,
7500
+ qs,
7455
7501
  {
7456
7502
  title: o,
7457
7503
  goBackUrl: s,
@@ -7489,7 +7535,7 @@ const xl = ({
7489
7535
  }) => (O(() => {
7490
7536
  s && Ge("config", s);
7491
7537
  }, [s]), /* @__PURE__ */ n.jsx(
7492
- qs,
7538
+ Zs,
7493
7539
  {
7494
7540
  onSubmit: i,
7495
7541
  onPublish: t,
@@ -7558,52 +7604,54 @@ function nl(i) {
7558
7604
  const e = {};
7559
7605
  return i.forEach(({ questionData: o }) => {
7560
7606
  o == null || o.forEach((s) => {
7561
- const { id: a, type: l, isRequired: d, requiredMessage: t } = s;
7562
- let u = $s(l);
7563
- u = Qs(
7564
- u,
7565
- d,
7607
+ const { id: a, type: l, isRequired: d, requiredMessage: t, isDisabled: u } = s;
7608
+ let r = $s(l);
7609
+ r = Qs(
7610
+ r,
7611
+ u ? !1 : d,
7566
7612
  t
7567
- ), l === "textField" || l === "longText" || l === "email" || l === "url" ? u = Xs(
7568
- u,
7613
+ ), l === "textField" || l === "longText" || l === "email" || l === "url" ? r = Xs(
7614
+ r,
7569
7615
  s
7570
- ) : (l === "numberField" || l === "amountField") && (u = il(
7571
- u,
7616
+ ) : (l === "numberField" || l === "amountField") && (r = il(
7617
+ r,
7572
7618
  s
7573
- )), e[a] = u;
7619
+ )), e[a] = r;
7574
7620
  });
7575
7621
  }), B.object().shape(e);
7576
7622
  }
7577
7623
  const en = (i, e) => {
7578
- const o = He[i.type], { answerData: s } = Ni(pi), a = ii(
7624
+ const o = He[i.type], { answerData: s } = ji(gi), a = ni(
7579
7625
  () => {
7580
7626
  var t;
7581
7627
  return (t = i == null ? void 0 : i.acceptedFiles) == null ? void 0 : t.map((u) => u.label).join(", ");
7582
7628
  },
7583
7629
  [i]
7584
- ), l = ii(
7630
+ ), l = ni(
7585
7631
  () => (i == null ? void 0 : i.visibilityDependentFields) || [],
7586
7632
  [i]
7587
- ), d = ii(() => l.length ? l.every((t) => {
7588
- if (!i.isHidden) return !0;
7589
- const u = s == null ? void 0 : s[t.id], r = t.fieldValue, c = u;
7590
- switch (t.operator) {
7591
- case "equals":
7592
- return String(r).toLowerCase() === String(c).toLowerCase();
7593
- case "not_equals":
7594
- return String(r).toLowerCase() !== String(c).toLowerCase();
7595
- case "greater":
7596
- return Number(c) > Number(r);
7597
- case "less":
7598
- return Number(c) < Number(r);
7599
- case "contains":
7600
- return String(c).toLowerCase().includes(String(r).toLowerCase());
7601
- case "not_contains":
7602
- return !String(c).toLowerCase().includes(String(r).toLowerCase());
7603
- default:
7604
- return !0;
7633
+ ), d = ni(() => l.length ? l.every(
7634
+ (t) => {
7635
+ if (!i.isHidden) return !0;
7636
+ const u = s == null ? void 0 : s[t.id], r = t.fieldValue, c = u;
7637
+ switch (t.operator) {
7638
+ case "equals":
7639
+ return String(r).toLowerCase() === String(c).toLowerCase();
7640
+ case "not_equals":
7641
+ return String(r).toLowerCase() !== String(c).toLowerCase();
7642
+ case "greater":
7643
+ return Number(c) > Number(r);
7644
+ case "less":
7645
+ return Number(c) < Number(r);
7646
+ case "contains":
7647
+ return String(c).toLowerCase().includes(String(r).toLowerCase());
7648
+ case "not_contains":
7649
+ return !String(c).toLowerCase().includes(String(r).toLowerCase());
7650
+ default:
7651
+ return !0;
7652
+ }
7605
7653
  }
7606
- }) : !0, [l, s, i]);
7654
+ ) : !0, [l, s, i]);
7607
7655
  return o ? /* @__PURE__ */ n.jsxs("div", { className: d ? "" : "invisible h-0", children: [
7608
7656
  /* @__PURE__ */ n.jsxs("div", { className: "mb-1.5", children: [
7609
7657
  i.inputLabel && /* @__PURE__ */ n.jsxs("label", { className: "block text-sm font-medium input_label", children: [
@@ -7625,7 +7673,10 @@ const en = (i, e) => {
7625
7673
  {
7626
7674
  element: i,
7627
7675
  state: "edit",
7628
- validationData: e
7676
+ validationData: {
7677
+ ...e,
7678
+ isReadOnly: e.isReadOnly || i.isDisabled
7679
+ }
7629
7680
  }
7630
7681
  )
7631
7682
  ] }) : null;
@@ -7747,75 +7798,84 @@ const sl = ({
7747
7798
  hideFooter: u = !1,
7748
7799
  uploadUrl: r
7749
7800
  }) => {
7750
- var vi, bi, ai, H, D, li, ui, si;
7751
- const { setAnswerData: c, setUploadUrl: h } = Ni(pi), [v, g] = R(0), y = ii(
7752
- () => i.filter((di) => !di.disabled),
7801
+ var vi, bi, si, H, I, di, ui, li;
7802
+ const { setAnswerData: c, setUploadUrl: h } = ji(gi), [v, g] = R(0), A = ni(
7803
+ () => i.filter((ii) => !ii.isHidden).map((ii) => {
7804
+ var hi;
7805
+ return ii.isDisabled || ii.disabled ? {
7806
+ ...ii,
7807
+ questionData: (hi = ii.questionData) == null ? void 0 : hi.map((Ai) => ({
7808
+ ...Ai,
7809
+ isDisabled: !0
7810
+ }))
7811
+ } : ii;
7812
+ }),
7753
7813
  [i]
7754
- ), f = (vi = y == null ? void 0 : y.length) != null ? vi : 0, m = fi("config"), p = ii(
7755
- () => nl(y),
7756
- [y]
7814
+ ), f = (vi = A == null ? void 0 : A.length) != null ? vi : 0, m = xi("config"), p = ni(
7815
+ () => nl(A),
7816
+ [A]
7757
7817
  ), x = En({
7758
- resolver: In(p),
7818
+ resolver: Dn(p),
7759
7819
  mode: "onSubmit",
7760
7820
  defaultValues: {}
7761
7821
  }), {
7762
7822
  register: j,
7763
- setValue: N,
7764
- control: S,
7765
- handleSubmit: A,
7766
- reset: C,
7823
+ setValue: S,
7824
+ control: N,
7825
+ handleSubmit: y,
7826
+ reset: k,
7767
7827
  getValues: K,
7768
7828
  watch: Q,
7769
- formState: { errors: W, isSubmitting: Z },
7829
+ formState: { errors: W, isSubmitting: q },
7770
7830
  trigger: M,
7771
7831
  setError: E,
7772
7832
  clearErrors: P
7773
- } = x, L = fo({ control: S }), G = ii(
7833
+ } = x, L = fo({ control: N }), G = ni(
7774
7834
  () => L,
7775
7835
  [JSON.stringify(L)]
7776
- ), q = Y(
7777
- (di) => {
7778
- a && a(di);
7836
+ ), Z = Y(
7837
+ (ii) => {
7838
+ a && a(ii);
7779
7839
  },
7780
7840
  [a]
7781
7841
  );
7782
7842
  O(() => {
7783
7843
  h(r);
7784
7844
  }, [h, r]), O(() => {
7785
- if (!(y != null && y.length) || !a) return;
7786
- const di = y.flatMap(
7845
+ if (!(A != null && A.length) || !a) return;
7846
+ const ii = A.flatMap(
7787
7847
  (ki) => {
7788
- var yi;
7789
- return (yi = ki.questionData) == null ? void 0 : yi.map((ji) => ({
7790
- id: ji.id,
7791
- value: G[ji.id],
7848
+ var hi;
7849
+ return (hi = ki.questionData) == null ? void 0 : hi.map((Ai) => ({
7850
+ id: Ai.id,
7851
+ value: G[Ai.id] || "",
7792
7852
  sectionId: ki.id,
7793
- type: ji.type,
7853
+ type: Ai.type,
7794
7854
  metaData: {
7795
- prefix: ji.prefix
7855
+ prefix: Ai.prefix
7796
7856
  }
7797
7857
  }));
7798
7858
  }
7799
7859
  );
7800
- q(di), c(G);
7860
+ Z(ii), c(G);
7801
7861
  }, [
7802
7862
  G,
7803
- y,
7804
- q,
7863
+ A,
7864
+ Z,
7805
7865
  a,
7806
7866
  c
7807
7867
  ]), O(() => {
7808
- e != null && e.length && C(al(e));
7809
- }, [e, C]);
7868
+ e != null && e.length && k(al(e));
7869
+ }, [e, k]);
7810
7870
  const w = Y(
7811
- (di) => {
7812
- const ki = y.flatMap(
7813
- (yi) => {
7814
- var ji;
7815
- return (ji = yi.questionData) == null ? void 0 : ji.map((Ci) => ({
7871
+ (ii) => {
7872
+ const ki = A.flatMap(
7873
+ (hi) => {
7874
+ var Ai;
7875
+ return (Ai = hi.questionData) == null ? void 0 : Ai.map((Ci) => ({
7816
7876
  id: Ci.id,
7817
- value: di[Ci.id],
7818
- sectionId: yi.id,
7877
+ value: ii[Ci.id] || "",
7878
+ sectionId: hi.id,
7819
7879
  type: Ci.type,
7820
7880
  metaData: {
7821
7881
  prefix: Ci.prefix
@@ -7825,26 +7885,26 @@ const sl = ({
7825
7885
  );
7826
7886
  Object.keys(W).length > 0 || s == null || s(ki);
7827
7887
  },
7828
- [W, y, s]
7829
- ), I = Y(async () => {
7830
- var di, ki;
7888
+ [W, A, s]
7889
+ ), D = Y(async () => {
7890
+ var ii, ki;
7831
7891
  if (!o) {
7832
- const yi = (ki = (di = y == null ? void 0 : y[v]) == null ? void 0 : di.questionData) == null ? void 0 : ki.map(
7892
+ const hi = (ki = (ii = A == null ? void 0 : A[v]) == null ? void 0 : ii.questionData) == null ? void 0 : ki.map(
7833
7893
  (Ci) => Ci.id
7834
7894
  );
7835
- if (!await M(yi)) return;
7895
+ if (!await M(hi)) return;
7836
7896
  }
7837
- g((yi) => yi + 1);
7838
- }, [v, y, o, M]), U = Y(() => {
7839
- g((di) => di - 1);
7840
- }, []), ni = ii(
7897
+ g((hi) => hi + 1);
7898
+ }, [v, A, o, M]), U = Y(() => {
7899
+ g((ii) => ii - 1);
7900
+ }, []), ei = ni(
7841
7901
  () => ({
7842
7902
  register: j,
7843
- setValue: N,
7903
+ setValue: S,
7844
7904
  watch: Q,
7845
7905
  errors: W,
7846
7906
  trigger: M,
7847
- isSubmitting: Z,
7907
+ isSubmitting: q,
7848
7908
  isReadOnly: l,
7849
7909
  getValues: K,
7850
7910
  setError: E,
@@ -7852,11 +7912,11 @@ const sl = ({
7852
7912
  }),
7853
7913
  [
7854
7914
  j,
7855
- N,
7915
+ S,
7856
7916
  Q,
7857
7917
  W,
7858
7918
  M,
7859
- Z,
7919
+ q,
7860
7920
  l,
7861
7921
  K,
7862
7922
  E,
@@ -7868,7 +7928,7 @@ const sl = ({
7868
7928
  /* @__PURE__ */ n.jsxs(
7869
7929
  "form",
7870
7930
  {
7871
- onSubmit: A(w),
7931
+ onSubmit: y(w),
7872
7932
  className: "container h-full mx-auto",
7873
7933
  children: [
7874
7934
  /* @__PURE__ */ n.jsx("div", { className: "relative flex flex-col w-full py-4 gap-y-12", children: /* @__PURE__ */ n.jsxs(
@@ -7876,27 +7936,27 @@ const sl = ({
7876
7936
  {
7877
7937
  className: "multi_section__box",
7878
7938
  children: [
7879
- d === "multi" && (((bi = y == null ? void 0 : y[v]) == null ? void 0 : bi.title) || ((ai = y == null ? void 0 : y[v]) == null ? void 0 : ai.description)) && /* @__PURE__ */ n.jsxs("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
7880
- ((H = y[v]) == null ? void 0 : H.title) && /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold mb-[6px]", children: (D = y[v]) == null ? void 0 : D.title }),
7881
- ((li = y[v]) == null ? void 0 : li.description) && /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: (ui = y[v]) == null ? void 0 : ui.description })
7939
+ d === "multi" && (((bi = A == null ? void 0 : A[v]) == null ? void 0 : bi.title) || ((si = A == null ? void 0 : A[v]) == null ? void 0 : si.description)) && /* @__PURE__ */ n.jsxs("div", { className: "py-4 mb-4 border-b border-gray-100 multi_section__title", children: [
7940
+ ((H = A[v]) == null ? void 0 : H.title) && /* @__PURE__ */ n.jsx("h2", { className: "text-lg font-semibold mb-[6px]", children: (I = A[v]) == null ? void 0 : I.title }),
7941
+ ((di = A[v]) == null ? void 0 : di.description) && /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: (ui = A[v]) == null ? void 0 : ui.description })
7882
7942
  ] }),
7883
7943
  d === "multi" ? /* @__PURE__ */ n.jsx(
7884
7944
  ol,
7885
7945
  {
7886
- form_data: y,
7887
- options: ni,
7946
+ form_data: A,
7947
+ options: ei,
7888
7948
  current: v
7889
7949
  }
7890
7950
  ) : /* @__PURE__ */ n.jsx(
7891
7951
  el,
7892
7952
  {
7893
- form_data: y,
7894
- options: ni
7953
+ form_data: A,
7954
+ options: ei
7895
7955
  }
7896
7956
  )
7897
7957
  ]
7898
7958
  },
7899
- (si = y == null ? void 0 : y[v]) == null ? void 0 : si.id
7959
+ (li = A == null ? void 0 : A[v]) == null ? void 0 : li.id
7900
7960
  ) }),
7901
7961
  !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: [
7902
7962
  /* @__PURE__ */ n.jsxs("div", { className: "flex gap-x-4 justify-end navigation_container", children: [
@@ -7914,7 +7974,7 @@ const sl = ({
7914
7974
  {
7915
7975
  type: "button",
7916
7976
  text: "Next",
7917
- onClick: I,
7977
+ onClick: D,
7918
7978
  style: { background: (m == null ? void 0 : m.buttonColor) || "#333" },
7919
7979
  btnClass: "text-gray-700 next_btn text-sm border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg continue_btn"
7920
7980
  }
@@ -7923,8 +7983,8 @@ const sl = ({
7923
7983
  (v === f - 1 || l) && !o && (t != null ? t : /* @__PURE__ */ n.jsx(
7924
7984
  Ei,
7925
7985
  {
7926
- isDisabled: Z || Object.keys(W).length > 0,
7927
- isLoading: Z,
7986
+ isDisabled: q || Object.keys(W).length > 0,
7987
+ isLoading: q,
7928
7988
  type: "submit",
7929
7989
  text: "Submit",
7930
7990
  style: { background: (m == null ? void 0 : m.buttonColor) || "#333" },
@@ -7934,8 +7994,8 @@ const sl = ({
7934
7994
  ] }) : !o && (t != null ? t : /* @__PURE__ */ n.jsx(
7935
7995
  Ei,
7936
7996
  {
7937
- isDisabled: Z || Object.keys(W).length > 0,
7938
- isLoading: Z,
7997
+ isDisabled: q || Object.keys(W).length > 0,
7998
+ isLoading: q,
7939
7999
  type: "submit",
7940
8000
  text: "Submit",
7941
8001
  style: { background: (m == null ? void 0 : m.buttonColor) || "#333" },