@arudovwen/form-builder-react 1.5.5 → 1.5.6

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.
@@ -27,11 +27,11 @@ function wo() {
27
27
  if (ee) return Gi;
28
28
  ee = 1;
29
29
  var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
30
- function d(t, u, c) {
31
- var r, v = {}, m = null, h = null;
32
- c !== void 0 && (m = "" + c), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (h = u.ref);
33
- for (r in u) s.call(u, r) && !l.hasOwnProperty(r) && (v[r] = u[r]);
34
- if (t && t.defaultProps) for (r in u = t.defaultProps, u) v[r] === void 0 && (v[r] = u[r]);
30
+ function d(t, u, r) {
31
+ var c, v = {}, m = null, h = null;
32
+ r !== void 0 && (m = "" + r), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (h = u.ref);
33
+ for (c in u) s.call(u, c) && !l.hasOwnProperty(c) && (v[c] = u[c]);
34
+ if (t && t.defaultProps) for (c in u = t.defaultProps, u) v[c] === void 0 && (v[c] = u[c]);
35
35
  return { $$typeof: e, type: t, key: m, ref: h, props: v, _owner: a.current };
36
36
  }
37
37
  return Gi.Fragment = o, Gi.jsx = d, Gi.jsxs = d, Gi;
@@ -49,7 +49,7 @@ var Hi = {};
49
49
  var oe;
50
50
  function Bo() {
51
51
  return oe || (oe = 1, process.env.NODE_ENV !== "production" && function() {
52
- var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), t = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), r = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
52
+ var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), t = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
53
53
  function g(b) {
54
54
  if (b === null || typeof b != "object")
55
55
  return null;
@@ -77,7 +77,7 @@ function Bo() {
77
77
  var S = !1, j = !1, A = !1, N = !1, E = !1, ei;
78
78
  ei = Symbol.for("react.module.reference");
79
79
  function Y(b) {
80
- return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || E || b === a || b === c || b === r || N || b === h || S || j || A || typeof b == "object" && b !== null && (b.$$typeof === m || b.$$typeof === v || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
80
+ return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || E || b === a || b === r || b === c || N || b === h || S || j || A || typeof b == "object" && b !== null && (b.$$typeof === m || b.$$typeof === v || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
81
81
  // types supported by any Flight configuration anywhere since
82
82
  // we don't know which Flight build this will end up being used
83
83
  // with.
@@ -109,9 +109,9 @@ function Bo() {
109
109
  return "Profiler";
110
110
  case a:
111
111
  return "StrictMode";
112
- case c:
113
- return "Suspense";
114
112
  case r:
113
+ return "Suspense";
114
+ case c:
115
115
  return "SuspenseList";
116
116
  }
117
117
  if (typeof b == "object")
@@ -305,9 +305,9 @@ function Bo() {
305
305
  if (typeof b == "string")
306
306
  return V(b);
307
307
  switch (b) {
308
- case c:
309
- return V("Suspense");
310
308
  case r:
309
+ return V("Suspense");
310
+ case c:
311
311
  return V("SuspenseList");
312
312
  }
313
313
  if (typeof b == "object")
@@ -649,7 +649,7 @@ const fi = ho(void 0), se = {
649
649
  disabled: !1,
650
650
  isHidden: !1
651
651
  }, je = ({ children: i }) => {
652
- const [e, o] = R(!0), [s, a] = R({}), [l, d] = R({}), [t, u] = R([se]), [c, r] = R(!1), [v, m] = R(null), [h, f] = R([
652
+ const [e, o] = R(!0), [s, a] = R({}), [l, d] = R({}), [t, u] = R([se]), [r, c] = R(!1), [v, m] = R(null), [h, f] = R([
653
653
  0
654
654
  ]), [y, g] = R(""), p = bi.useCallback(() => {
655
655
  }, []), x = bi.useCallback(() => {
@@ -887,8 +887,8 @@ const fi = ho(void 0), se = {
887
887
  addSection: x,
888
888
  removeSection: C,
889
889
  updateSection: L,
890
- isDragging: c,
891
- setIsDragging: r,
890
+ isDragging: r,
891
+ setIsDragging: c,
892
892
  selectedSection: v,
893
893
  setSelectedSection: m,
894
894
  activeSections: h,
@@ -915,7 +915,7 @@ const fi = ho(void 0), se = {
915
915
  x,
916
916
  C,
917
917
  L,
918
- c,
918
+ r,
919
919
  v,
920
920
  h,
921
921
  ei,
@@ -1125,13 +1125,13 @@ const Nn = ({
1125
1125
  maxDate: t,
1126
1126
  showYearDropdown: u
1127
1127
  }) => {
1128
- const c = i ? new Date(i) : null, [r, v] = R(c);
1128
+ const r = i ? new Date(i) : null, [c, v] = R(r);
1129
1129
  O(() => {
1130
1130
  const h = i ? new Date(i) : null;
1131
- (h && r && h.getTime() !== r.getTime() || !h && r || h && !r) && v(h);
1131
+ (h && c && h.getTime() !== c.getTime() || !h && c || h && !c) && v(h);
1132
1132
  }, [i]), O(() => {
1133
- e && e(a, r);
1134
- }, [r, e, a]);
1133
+ e && e(a, c);
1134
+ }, [c, e, a]);
1135
1135
  const m = (h) => {
1136
1136
  v(h);
1137
1137
  };
@@ -1143,7 +1143,7 @@ const Nn = ({
1143
1143
  showPopperArrow: !1,
1144
1144
  dateFormat: s,
1145
1145
  disabled: o,
1146
- selected: r,
1146
+ selected: c,
1147
1147
  onChange: m,
1148
1148
  className: "field-control",
1149
1149
  portalId: "root-portal",
@@ -1324,12 +1324,12 @@ const Be = /^[a-z0-9]+(-[a-z0-9]+)*$/, ln = (i, e, o, s = "") => {
1324
1324
  }
1325
1325
  if (a.length > 3 || !a.length) return null;
1326
1326
  if (a.length > 1) {
1327
- const t = a.pop(), u = a.pop(), c = {
1327
+ const t = a.pop(), u = a.pop(), r = {
1328
1328
  provider: a.length > 0 ? a[0] : s,
1329
1329
  prefix: u,
1330
1330
  name: t
1331
1331
  };
1332
- return e && !$i(c) ? null : c;
1332
+ return e && !$i(r) ? null : r;
1333
1333
  }
1334
1334
  const l = a[0], d = l.split("-");
1335
1335
  if (d.length > 1) {
@@ -1462,18 +1462,18 @@ function Yo(i, e) {
1462
1462
  }
1463
1463
  C % 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)), g.length && (l = _o(l, '<g transform="' + g.join(" ") + '">', "</g>"));
1464
1464
  });
1465
- const d = s.width, t = s.height, u = a.width, c = a.height;
1466
- let r, v;
1467
- d === null ? (v = t === null ? "1em" : t === "auto" ? c : t, r = te(v, u / c)) : (r = d === "auto" ? u : d, v = t === null ? te(r, c / u) : t === "auto" ? c : t);
1465
+ const d = s.width, t = s.height, u = a.width, r = a.height;
1466
+ let c, v;
1467
+ d === null ? (v = t === null ? "1em" : t === "auto" ? r : t, c = te(v, u / r)) : (c = d === "auto" ? u : d, v = t === null ? te(c, r / u) : t === "auto" ? r : t);
1468
1468
  const m = {}, h = (y, g) => {
1469
1469
  Jo(g) || (m[y] = g.toString());
1470
1470
  };
1471
- h("width", r), h("height", v);
1471
+ h("width", c), h("height", v);
1472
1472
  const f = [
1473
1473
  a.left,
1474
1474
  a.top,
1475
1475
  u,
1476
- c
1476
+ r
1477
1477
  ];
1478
1478
  return m.viewBox = f.join(" "), {
1479
1479
  attributes: m,
@@ -1560,8 +1560,8 @@ const aa = (i, e, o) => {
1560
1560
  prefix: e,
1561
1561
  icons: []
1562
1562
  }, t = 0;
1563
- return o.forEach((u, c) => {
1564
- t += u.length + 1, t >= a && c > 0 && (s.push(d), d = {
1563
+ return o.forEach((u, r) => {
1564
+ t += u.length + 1, t >= a && r > 0 && (s.push(d), d = {
1565
1565
  type: l,
1566
1566
  provider: i,
1567
1567
  prefix: e,
@@ -1641,16 +1641,16 @@ function ua(i) {
1641
1641
  const d = l.icons, t = d.pending.length;
1642
1642
  d.pending = d.pending.filter((u) => {
1643
1643
  if (u.prefix !== a) return !0;
1644
- const c = u.name;
1645
- if (i.icons[c]) d.loaded.push({
1644
+ const r = u.name;
1645
+ if (i.icons[r]) d.loaded.push({
1646
1646
  provider: s,
1647
1647
  prefix: a,
1648
- name: c
1648
+ name: r
1649
1649
  });
1650
- else if (i.missing.has(c)) d.missing.push({
1650
+ else if (i.missing.has(r)) d.missing.push({
1651
1651
  provider: s,
1652
1652
  prefix: a,
1653
- name: c
1653
+ name: r
1654
1654
  });
1655
1655
  else
1656
1656
  return o = !0, !0;
@@ -1688,15 +1688,15 @@ function ra(i) {
1688
1688
  return i.forEach((a) => {
1689
1689
  if (s.name === a.name && s.prefix === a.prefix && s.provider === a.provider) return;
1690
1690
  s = a;
1691
- const l = a.provider, d = a.prefix, t = a.name, u = o[l] || (o[l] = /* @__PURE__ */ Object.create(null)), c = u[d] || (u[d] = Oi(l, d));
1692
- let r;
1693
- t in c.icons ? r = e.loaded : d === "" || c.missing.has(t) ? r = e.missing : r = e.pending;
1691
+ const l = a.provider, d = a.prefix, t = a.name, u = o[l] || (o[l] = /* @__PURE__ */ Object.create(null)), r = u[d] || (u[d] = Oi(l, d));
1692
+ let c;
1693
+ t in r.icons ? c = e.loaded : d === "" || r.missing.has(t) ? c = e.missing : c = e.pending;
1694
1694
  const v = {
1695
1695
  provider: l,
1696
1696
  prefix: d,
1697
1697
  name: t
1698
1698
  };
1699
- r.push(v);
1699
+ c.push(v);
1700
1700
  }), e;
1701
1701
  }
1702
1702
  function ma(i, e = !0, o = !1) {
@@ -1726,7 +1726,7 @@ function va(i, e, o, s) {
1726
1726
  d = d.concat(A);
1727
1727
  } else d = i.resources.slice(l).concat(i.resources.slice(0, l));
1728
1728
  const t = Date.now();
1729
- let u = "pending", c = 0, r, v = null, m = [], h = [];
1729
+ let u = "pending", r = 0, c, v = null, m = [], h = [];
1730
1730
  typeof s == "function" && h.push(s);
1731
1731
  function f() {
1732
1732
  v && (clearTimeout(v), v = null);
@@ -1744,7 +1744,7 @@ function va(i, e, o, s) {
1744
1744
  startTime: t,
1745
1745
  payload: e,
1746
1746
  status: u,
1747
- queriesSent: c,
1747
+ queriesSent: r,
1748
1748
  queriesPending: m.length,
1749
1749
  subscribe: g,
1750
1750
  abort: y
@@ -1752,7 +1752,7 @@ function va(i, e, o, s) {
1752
1752
  }
1753
1753
  function x() {
1754
1754
  u = "failed", h.forEach((A) => {
1755
- A(void 0, r);
1755
+ A(void 0, c);
1756
1756
  });
1757
1757
  }
1758
1758
  function C() {
@@ -1772,11 +1772,11 @@ function va(i, e, o, s) {
1772
1772
  return;
1773
1773
  }
1774
1774
  if (N === "abort") {
1775
- r = E, x();
1775
+ c = E, x();
1776
1776
  return;
1777
1777
  }
1778
1778
  if (ei) {
1779
- r = E, m.length || (d.length ? j() : x());
1779
+ c = E, m.length || (d.length ? j() : x());
1780
1780
  return;
1781
1781
  }
1782
1782
  if (f(), C(), !i.random) {
@@ -1808,7 +1808,7 @@ function va(i, e, o, s) {
1808
1808
  S(N, E, ei);
1809
1809
  }
1810
1810
  };
1811
- m.push(N), c++, v = setTimeout(j, i.rotate), o(A, e, N.callback);
1811
+ m.push(N), r++, v = setTimeout(j, i.rotate), o(A, e, N.callback);
1812
1812
  }
1813
1813
  return setTimeout(j), p;
1814
1814
  }
@@ -1821,11 +1821,11 @@ function De(i) {
1821
1821
  function s() {
1822
1822
  o = o.filter((t) => t().status === "pending");
1823
1823
  }
1824
- function a(t, u, c) {
1825
- const r = va(e, t, u, (v, m) => {
1826
- s(), c && c(v, m);
1824
+ function a(t, u, r) {
1825
+ const c = va(e, t, u, (v, m) => {
1826
+ s(), r && r(v, m);
1827
1827
  });
1828
- return o.push(r), r;
1828
+ return o.push(c), c;
1829
1829
  }
1830
1830
  function l(t) {
1831
1831
  return o.find((u) => t(u)) || null;
@@ -1921,20 +1921,20 @@ function xa(i, e) {
1921
1921
  if (delete i.iconsToLoad, !a || !a.length) return;
1922
1922
  const l = i.loadIcon;
1923
1923
  if (i.loadIcons && (a.length > 1 || !l)) {
1924
- be(i.loadIcons(a, s, o), (r) => {
1925
- Fi(i, a, r);
1924
+ be(i.loadIcons(a, s, o), (c) => {
1925
+ Fi(i, a, c);
1926
1926
  });
1927
1927
  return;
1928
1928
  }
1929
1929
  if (l) {
1930
- a.forEach((r) => {
1931
- const v = l(r, s, o);
1930
+ a.forEach((c) => {
1931
+ const v = l(c, s, o);
1932
1932
  be(v, (m) => {
1933
1933
  const h = m ? {
1934
1934
  prefix: s,
1935
- icons: { [r]: m }
1935
+ icons: { [c]: m }
1936
1936
  } : null;
1937
- Fi(i, [r], h);
1937
+ Fi(i, [c], h);
1938
1938
  });
1939
1939
  });
1940
1940
  return;
@@ -1946,9 +1946,9 @@ function xa(i, e) {
1946
1946
  Fi(i, d, null);
1947
1947
  return;
1948
1948
  }
1949
- u.prepare(o, s, d).forEach((r) => {
1950
- pa(o, r, (v) => {
1951
- Fi(i, r.icons, v);
1949
+ u.prepare(o, s, d).forEach((c) => {
1950
+ pa(o, c, (v) => {
1951
+ Fi(i, c.icons, v);
1952
1952
  });
1953
1953
  });
1954
1954
  }));
@@ -1966,17 +1966,17 @@ const ya = (i, e) => {
1966
1966
  const a = /* @__PURE__ */ Object.create(null), l = [];
1967
1967
  let d, t;
1968
1968
  return s.pending.forEach((u) => {
1969
- const { provider: c, prefix: r } = u;
1970
- if (r === t && c === d) return;
1971
- d = c, t = r, l.push(Oi(c, r));
1972
- const v = a[c] || (a[c] = /* @__PURE__ */ Object.create(null));
1973
- v[r] || (v[r] = []);
1969
+ const { provider: r, prefix: c } = u;
1970
+ if (c === t && r === d) return;
1971
+ d = r, t = c, l.push(Oi(r, c));
1972
+ const v = a[r] || (a[r] = /* @__PURE__ */ Object.create(null));
1973
+ v[c] || (v[c] = []);
1974
1974
  }), s.pending.forEach((u) => {
1975
- const { provider: c, prefix: r, name: v } = u, m = Oi(c, r), h = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
1976
- h.has(v) || (h.add(v), a[c][r].push(v));
1975
+ const { provider: r, prefix: c, name: v } = u, m = Oi(r, c), h = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
1976
+ h.has(v) || (h.add(v), a[r][c].push(v));
1977
1977
  }), l.forEach((u) => {
1978
- const c = a[u.provider][u.prefix];
1979
- c.length && xa(u, c);
1978
+ const r = a[u.provider][u.prefix];
1979
+ r.length && xa(u, r);
1980
1980
  }), e ? ca(e, s, l) : me;
1981
1981
  };
1982
1982
  function Aa(i, e) {
@@ -2150,27 +2150,27 @@ const Ra = (i, e, o) => {
2150
2150
  s[g] === void 0 && (u[g] = p);
2151
2151
  }
2152
2152
  }
2153
- const c = Yo(i, a), r = c.attributes;
2153
+ const r = Yo(i, a), c = r.attributes;
2154
2154
  if (a.inline && (d.verticalAlign = "-0.125em"), l === "svg") {
2155
2155
  u.style = {
2156
2156
  ...d,
2157
2157
  ...t
2158
- }, Object.assign(u, r);
2158
+ }, Object.assign(u, c);
2159
2159
  let g = 0, p = e.id;
2160
2160
  return typeof p == "string" && (p = p.replace(/-/g, "_")), u.dangerouslySetInnerHTML = {
2161
- __html: Ba(Qo(c.body, p ? () => p + "ID" + g++ : "iconifyReact"))
2161
+ __html: Ba(Qo(r.body, p ? () => p + "ID" + g++ : "iconifyReact"))
2162
2162
  }, Sn("svg", u);
2163
2163
  }
2164
2164
  const { body: v, width: m, height: h } = i, f = l === "mask" || (l === "bg" ? !1 : v.indexOf("currentColor") !== -1), y = ka(v, {
2165
- ...r,
2165
+ ...c,
2166
2166
  width: m + "",
2167
2167
  height: h + ""
2168
2168
  });
2169
2169
  return u.style = {
2170
2170
  ...d,
2171
2171
  "--svg": Ta(y),
2172
- width: pe(r.width),
2173
- height: pe(r.height),
2172
+ width: pe(c.width),
2173
+ height: pe(c.height),
2174
2174
  ...La,
2175
2175
  ...f ? Mn : Oe,
2176
2176
  ...t
@@ -2235,34 +2235,34 @@ function Ke(i) {
2235
2235
  const h = s.callback;
2236
2236
  h && (h(), a({}));
2237
2237
  }
2238
- function c(h) {
2238
+ function r(h) {
2239
2239
  if (JSON.stringify(d) !== JSON.stringify(h))
2240
2240
  return u(), t(h), !0;
2241
2241
  }
2242
- function r() {
2242
+ function c() {
2243
2243
  var h;
2244
2244
  const f = i.icon;
2245
2245
  if (typeof f == "object") {
2246
- c({
2246
+ r({
2247
2247
  name: "",
2248
2248
  data: f
2249
2249
  });
2250
2250
  return;
2251
2251
  }
2252
2252
  const y = ue(f);
2253
- if (c({
2253
+ if (r({
2254
2254
  name: f,
2255
2255
  data: y
2256
2256
  }))
2257
2257
  if (y === void 0) {
2258
- const g = ya([f], r);
2258
+ const g = ya([f], c);
2259
2259
  a({
2260
2260
  callback: g
2261
2261
  });
2262
2262
  } else y && ((h = i.onLoad) === null || h === void 0 || h.call(i, f));
2263
2263
  }
2264
2264
  O(() => (o(!0), u), []), O(() => {
2265
- e && r();
2265
+ e && c();
2266
2266
  }, [i.icon, e]);
2267
2267
  const { name: v, data: m } = d;
2268
2268
  return m ? Ra({
@@ -2297,10 +2297,10 @@ function In({
2297
2297
  isReadOnly: l,
2298
2298
  watch: d,
2299
2299
  getValues: t
2300
- } = e || {}, [u, c] = R(() => {
2300
+ } = e || {}, [u, r] = R(() => {
2301
2301
  const m = t == null ? void 0 : t(i.id);
2302
2302
  return Array.isArray(m) ? m : [];
2303
- }), r = si(
2303
+ }), c = si(
2304
2304
  () => u == null ? void 0 : u.map((m) => m.label).join(", "),
2305
2305
  [u]
2306
2306
  );
@@ -2310,7 +2310,7 @@ function In({
2310
2310
  if (!d) return;
2311
2311
  const m = d((h) => {
2312
2312
  const f = h[i.id];
2313
- f !== void 0 && c(Array.isArray(f) ? f : []);
2313
+ f !== void 0 && r(Array.isArray(f) ? f : []);
2314
2314
  });
2315
2315
  return () => {
2316
2316
  var h;
@@ -2321,7 +2321,7 @@ function In({
2321
2321
  {
2322
2322
  value: u || [],
2323
2323
  onChange: (m) => {
2324
- c(m), a == null || a(i.id, m);
2324
+ r(m), a == null || a(i.id, m);
2325
2325
  },
2326
2326
  multiple: !0,
2327
2327
  disabled: l,
@@ -2333,7 +2333,7 @@ function In({
2333
2333
  className: "custom-select__control field-control",
2334
2334
  disabled: l,
2335
2335
  children: [
2336
- /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (u == null ? void 0 : u.length) > 0 ? r : /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o != null ? o : " Select options" }) }),
2336
+ /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (u == null ? void 0 : u.length) > 0 ? c : /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o != null ? o : " Select options" }) }),
2337
2337
  /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(q, { icon: "lucide:chevron-down" }) })
2338
2338
  ]
2339
2339
  }
@@ -2410,9 +2410,9 @@ function He({
2410
2410
  else
2411
2411
  u(null);
2412
2412
  }, [i, l]);
2413
- const c = () => {
2413
+ const r = () => {
2414
2414
  l === "image" || l === "pdf" ? a(!0) : window.open(t || i, "_blank");
2415
- }, r = () => a(!1), v = e || (i == null ? void 0 : i.split("/").pop()) || "Unknown file";
2415
+ }, c = () => a(!1), v = e || (i == null ? void 0 : i.split("/").pop()) || "Unknown file";
2416
2416
  function m(h, f = "download") {
2417
2417
  if (!h) return;
2418
2418
  if (h.startsWith("data:")) {
@@ -2427,7 +2427,7 @@ function He({
2427
2427
  /* @__PURE__ */ n.jsxs(
2428
2428
  "div",
2429
2429
  {
2430
- onClick: c,
2430
+ onClick: r,
2431
2431
  className: "!flex items-center rounded cursor-pointer gap-x-3",
2432
2432
  title: `Click to preview ${v}`,
2433
2433
  children: [
@@ -2462,7 +2462,7 @@ function He({
2462
2462
  "div",
2463
2463
  {
2464
2464
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",
2465
- onClick: r,
2465
+ onClick: c,
2466
2466
  children: /* @__PURE__ */ n.jsxs(
2467
2467
  "div",
2468
2468
  {
@@ -2472,7 +2472,7 @@ function He({
2472
2472
  /* @__PURE__ */ n.jsx(
2473
2473
  "button",
2474
2474
  {
2475
- onClick: r,
2475
+ onClick: c,
2476
2476
  className: "absolute text-2xl font-bold text-gray-700 top-2 right-2",
2477
2477
  "aria-label": "Close preview",
2478
2478
  children: "×"
@@ -2520,9 +2520,9 @@ function Ga({
2520
2520
  list: a = null,
2521
2521
  accept: l = []
2522
2522
  }) {
2523
- const { uploadUrl: d } = ji(fi), t = Mi(null), [u, c] = R(a), [r, v] = R(!1);
2523
+ const { uploadUrl: d } = ji(fi), t = Mi(null), [u, r] = R(a), [c, v] = R(!1);
2524
2524
  O(() => {
2525
- c(a);
2525
+ r(a);
2526
2526
  }, [a]);
2527
2527
  const m = si(
2528
2528
  () => l == null ? void 0 : l.map((S) => S.value).join(", "),
@@ -2592,7 +2592,7 @@ function Ga({
2592
2592
  ), p = X(
2593
2593
  async (S) => {
2594
2594
  const j = Array.from(S.target.files || []);
2595
- if (!(!j.length || r)) {
2595
+ if (!(!j.length || c)) {
2596
2596
  if (!g(j)) {
2597
2597
  t.current && (t.current.value = "");
2598
2598
  return;
@@ -2600,7 +2600,7 @@ function Ga({
2600
2600
  try {
2601
2601
  v(!0);
2602
2602
  const A = await Promise.all(j == null ? void 0 : j.map(y)), N = s && u ? [...u, ...A] : A;
2603
- c(N), i(N), ki.success(`Successfully uploaded ${j.length} file(s)`);
2603
+ r(N), i(N), ki.success(`Successfully uploaded ${j.length} file(s)`);
2604
2604
  } catch (A) {
2605
2605
  console.error("Upload error:", A), ki.error("Failed to upload file(s). Please try again.");
2606
2606
  } finally {
@@ -2608,15 +2608,15 @@ function Ga({
2608
2608
  }
2609
2609
  }
2610
2610
  },
2611
- [r, g, y, i, s, u]
2611
+ [c, g, y, i, s, u]
2612
2612
  ), x = X(
2613
2613
  (S) => {
2614
- r || (t.current && (t.current.value = ""), c((j) => {
2614
+ c || (t.current && (t.current.value = ""), r((j) => {
2615
2615
  const A = S === void 0 ? null : (j == null ? void 0 : j.filter((N, E) => E !== S)) || null;
2616
2616
  return i(A), A;
2617
2617
  }), o == null || o());
2618
2618
  },
2619
- [o, i, r]
2619
+ [o, i, c]
2620
2620
  ), C = u && u.length > 0;
2621
2621
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-start gap-2", children: [
2622
2622
  !e && /* @__PURE__ */ n.jsxs("div", { className: "!flex field-control !py-0 !px-0 relative", children: [
@@ -2626,7 +2626,7 @@ function Ga({
2626
2626
  ref: t,
2627
2627
  type: "file",
2628
2628
  onChange: p,
2629
- disabled: e || r,
2629
+ disabled: e || c,
2630
2630
  multiple: s,
2631
2631
  accept: m || "",
2632
2632
  className: `w-full text-sm text-gray-500 file:mr-4 flex-1 file:px-4 !py-1 !pl-1\r
@@ -2642,14 +2642,14 @@ function Ga({
2642
2642
  type: "button",
2643
2643
  className: "p-2 text-lg text-red-500 hover:text-red-600 transition-colors disabled:opacity-50",
2644
2644
  onClick: () => x(),
2645
- disabled: r,
2645
+ disabled: c,
2646
2646
  "aria-label": "Remove all files",
2647
2647
  children: /* @__PURE__ */ n.jsx(q, { icon: "lets-icons:trash-duotone" })
2648
2648
  }
2649
2649
  )
2650
2650
  ] }),
2651
2651
  C && /* @__PURE__ */ n.jsxs("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
2652
- r && /* @__PURE__ */ n.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
2652
+ c && /* @__PURE__ */ n.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
2653
2653
  /* @__PURE__ */ n.jsx("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
2654
2654
  "Uploading..."
2655
2655
  ] }) }),
@@ -2666,8 +2666,8 @@ function Ga({
2666
2666
  ] });
2667
2667
  }
2668
2668
  function Ha({ element: i, validationData: e }) {
2669
- var r;
2670
- const [o, s] = R((r = i == null ? void 0 : i.value) != null ? r : null), {
2669
+ var c;
2670
+ const [o, s] = R((c = i == null ? void 0 : i.value) != null ? c : null), {
2671
2671
  register: a = () => ({}),
2672
2672
  setValue: l,
2673
2673
  isReadOnly: d,
@@ -2691,7 +2691,7 @@ function Ha({ element: i, validationData: e }) {
2691
2691
  l == null || l(i.id, v), s(v);
2692
2692
  },
2693
2693
  [i.id, l]
2694
- ), c = () => {
2694
+ ), r = () => {
2695
2695
  l == null || l(i.id, null), s(null);
2696
2696
  };
2697
2697
  return /* @__PURE__ */ n.jsxs("div", { children: [
@@ -2701,7 +2701,7 @@ function Ha({ element: i, validationData: e }) {
2701
2701
  onFileLoaded: u,
2702
2702
  disabled: d,
2703
2703
  multiple: i == null ? void 0 : i.isMultiple,
2704
- handleDeleteFile: c,
2704
+ handleDeleteFile: r,
2705
2705
  list: o,
2706
2706
  accept: i == null ? void 0 : i.acceptedFiles
2707
2707
  }
@@ -2735,8 +2735,8 @@ const z = ({
2735
2735
  placeholder: d = "",
2736
2736
  isFloating: t,
2737
2737
  setValue: u,
2738
- value: c,
2739
- trigger: r,
2738
+ value: r,
2739
+ trigger: c,
2740
2740
  prefix: v,
2741
2741
  disabled: m,
2742
2742
  watch: h,
@@ -2760,12 +2760,12 @@ const z = ({
2760
2760
  sn,
2761
2761
  {
2762
2762
  onValueChange: (N) => {
2763
- u(e, N != null ? N : null), o && o(e), r && r(e);
2763
+ u(e, N != null ? N : null), o && o(e), c && c(e);
2764
2764
  },
2765
2765
  placeholder: d,
2766
2766
  className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"}`,
2767
2767
  decimalsLimit: 2,
2768
- value: c,
2768
+ value: r,
2769
2769
  prefix: v,
2770
2770
  disabled: m
2771
2771
  }
@@ -2775,7 +2775,7 @@ const z = ({
2775
2775
  if (["checkbox", "radio"].includes(l)) {
2776
2776
  const N = (h == null ? void 0 : h(e)) || null;
2777
2777
  let E = !1;
2778
- return N && (N != null && N.length && l === "checkbox" ? E = N == null ? void 0 : N.includes(c) : E = N == c), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
2778
+ return N && (N != null && N.length && l === "checkbox" ? E = N == null ? void 0 : N.includes(r) : E = N == r), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
2779
2779
  /* @__PURE__ */ n.jsxs(
2780
2780
  "label",
2781
2781
  {
@@ -2786,7 +2786,7 @@ const z = ({
2786
2786
  {
2787
2787
  ...x,
2788
2788
  type: l,
2789
- value: c || "",
2789
+ value: r || "",
2790
2790
  disabled: m,
2791
2791
  className: "peer sr-only"
2792
2792
  }
@@ -2931,14 +2931,14 @@ const Di = ({
2931
2931
  label: d,
2932
2932
  value: t,
2933
2933
  trigger: u,
2934
- isMultiple: c,
2935
- isFloatingLabel: r,
2934
+ isMultiple: r,
2935
+ isFloatingLabel: c,
2936
2936
  subText: v,
2937
2937
  labelClass: m = "text-[10px]",
2938
2938
  loading: h,
2939
2939
  disabled: f
2940
2940
  }) => {
2941
- const [y, g] = R(c ? [] : null), p = Mi(!1), x = si(() => !t || !i || i.length === 0 ? c ? [] : null : c ? Array.isArray(t) ? i.filter((j) => t.some(
2941
+ const [y, g] = R(r ? [] : null), p = Mi(!1), x = si(() => !t || !i || i.length === 0 ? r ? [] : null : r ? Array.isArray(t) ? i.filter((j) => t.some(
2942
2942
  (A) => {
2943
2943
  var N;
2944
2944
  return typeof j.value == "object" ? ((N = j.value) == null ? void 0 : N.id) === (A == null ? void 0 : A.id) : j.value === A;
@@ -2946,28 +2946,28 @@ const Di = ({
2946
2946
  )) : [] : i.find((j) => {
2947
2947
  var A;
2948
2948
  return typeof j.value == "string" && typeof t == "string" ? j.value.toLowerCase() === t.toLowerCase() : typeof j.value == "object" && typeof t == "object" ? ((A = j.value) == null ? void 0 : A.id) === (t == null ? void 0 : t.id) : j.value === t;
2949
- }) || null, [t, i, c]);
2949
+ }) || null, [t, i, r]);
2950
2950
  O(() => {
2951
2951
  if (p.current) {
2952
2952
  p.current = !1;
2953
2953
  return;
2954
2954
  }
2955
- if (c && Array.isArray(x) && Array.isArray(y)) {
2955
+ if (r && Array.isArray(x) && Array.isArray(y)) {
2956
2956
  const j = y == null ? void 0 : y.map((N) => N.value), A = x == null ? void 0 : x.map((N) => N.value);
2957
2957
  JSON.stringify(j) !== JSON.stringify(A) && g(x);
2958
2958
  } else (x == null ? void 0 : x.value) !== (y == null ? void 0 : y.value) && g(x);
2959
- }, [x, c]);
2959
+ }, [x, r]);
2960
2960
  const C = X((j) => {
2961
2961
  var A;
2962
2962
  if (p.current = !0, g(j), a) {
2963
- const N = c ? Array.isArray(j) ? j == null ? void 0 : j.map((E) => E.value) : [] : (A = j == null ? void 0 : j.value) != null ? A : null;
2963
+ const N = r ? Array.isArray(j) ? j == null ? void 0 : j.map((E) => E.value) : [] : (A = j == null ? void 0 : j.value) != null ? A : null;
2964
2964
  a(l, N), u == null || u(l);
2965
2965
  }
2966
2966
  s && !p.current && s(l);
2967
- }, [a, l, u, s, c]), S = si(() => h ? "Fetching data..." : y ? c && Array.isArray(y) ? y.length > 0 ? y == null ? void 0 : y.map((j) => j.label).join(", ") : e : (y == null ? void 0 : y.label) || e : e, [y, h, e, c]);
2967
+ }, [a, l, u, s, r]), S = si(() => h ? "Fetching data..." : y ? r && Array.isArray(y) ? y.length > 0 ? y == null ? void 0 : y.map((j) => j.label).join(", ") : e : (y == null ? void 0 : y.label) || e : e, [y, h, e, r]);
2968
2968
  return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2969
- !r && d && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2970
- r && d && /* @__PURE__ */ n.jsx(
2969
+ !c && d && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2970
+ c && d && /* @__PURE__ */ n.jsx(
2971
2971
  "label",
2972
2972
  {
2973
2973
  className: Z(
@@ -2982,7 +2982,7 @@ const Di = ({
2982
2982
  {
2983
2983
  value: y,
2984
2984
  onChange: C,
2985
- multiple: c,
2985
+ multiple: r,
2986
2986
  disabled: f || h,
2987
2987
  children: /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2988
2988
  /* @__PURE__ */ n.jsxs(ui.Button, { className: "field-control", disabled: f || h, children: [
@@ -3035,11 +3035,11 @@ function Tn({
3035
3035
  const [d, t] = R(""), u = si(() => {
3036
3036
  const h = e != null ? e : o;
3037
3037
  return i.find((f) => f.value === h || f.label === h) || null;
3038
- }, [e, o, i]), [c, r] = R(u);
3038
+ }, [e, o, i]), [r, c] = R(u);
3039
3039
  O(() => {
3040
3040
  if (e !== void 0) {
3041
3041
  const h = i.find((f) => f.value === e || f.label === e) || null;
3042
- r(h);
3042
+ c(h);
3043
3043
  }
3044
3044
  }, [e, i]);
3045
3045
  const v = si(() => {
@@ -3049,12 +3049,12 @@ function Tn({
3049
3049
  (f) => f.label.toLowerCase().includes(h)
3050
3050
  );
3051
3051
  }, [d, i]), m = X((h) => {
3052
- r(h), s(l, h);
3052
+ c(h), s(l, h);
3053
3053
  }, [l, s]);
3054
3054
  return /* @__PURE__ */ n.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ n.jsxs(
3055
3055
  Ri,
3056
3056
  {
3057
- value: c,
3057
+ value: r,
3058
3058
  onChange: m,
3059
3059
  disabled: a,
3060
3060
  children: [
@@ -3141,21 +3141,21 @@ function On(i, e, o) {
3141
3141
  try {
3142
3142
  return Promise.resolve(function(d, t) {
3143
3143
  try {
3144
- var u = (e.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(i[o.mode === "sync" ? "validateSync" : "validate"](s, Object.assign({ abortEarly: !1 }, e, { context: a }))).then(function(c) {
3145
- return l.shouldUseNativeValidation && ko({}, l), { values: o.raw ? s : c, errors: {} };
3144
+ var u = (e.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(i[o.mode === "sync" ? "validateSync" : "validate"](s, Object.assign({ abortEarly: !1 }, e, { context: a }))).then(function(r) {
3145
+ return l.shouldUseNativeValidation && ko({}, l), { values: o.raw ? s : r, errors: {} };
3146
3146
  }));
3147
- } catch (c) {
3148
- return t(c);
3147
+ } catch (r) {
3148
+ return t(r);
3149
3149
  }
3150
3150
  return u && u.then ? u.then(void 0, t) : u;
3151
3151
  }(0, function(d) {
3152
3152
  if (!d.inner) throw d;
3153
- return { values: {}, errors: Co((t = d, u = !l.shouldUseNativeValidation && l.criteriaMode === "all", (t.inner || []).reduce(function(c, r) {
3154
- if (c[r.path] || (c[r.path] = { message: r.message, type: r.type }), u) {
3155
- var v = c[r.path].types, m = v && v[r.type];
3156
- c[r.path] = So(r.path, u, c, r.type, m ? [].concat(m, r.message) : r.message);
3153
+ return { values: {}, errors: Co((t = d, u = !l.shouldUseNativeValidation && l.criteriaMode === "all", (t.inner || []).reduce(function(r, c) {
3154
+ if (r[c.path] || (r[c.path] = { message: c.message, type: c.type }), u) {
3155
+ var v = r[c.path].types, m = v && v[c.type];
3156
+ r[c.path] = So(c.path, u, r, c.type, m ? [].concat(m, c.message) : c.message);
3157
3157
  }
3158
- return c;
3158
+ return r;
3159
3159
  }, {})), l) };
3160
3160
  var t, u;
3161
3161
  }));
@@ -3177,19 +3177,19 @@ const Ja = ({
3177
3177
  e
3178
3178
  );
3179
3179
  return /* @__PURE__ */ n.jsx("div", { className: d, children: i == null ? void 0 : i.map((t) => {
3180
- const u = a === t.key, c = o[t.key] || 0, r = Z(
3180
+ const u = a === t.key, r = o[t.key] || 0, c = Z(
3181
3181
  "capitalize text-sm whitespace-nowrap no-scrollbar font-semibold pb-[14px] border-b-2 border-[#EAECF0] px-6 flex items-center gap-x-1 flex-1 text-center",
3182
3182
  `${i.length === 1 ? "justify-start" : "justify-center"}`,
3183
3183
  l
3184
3184
  ), v = Z({
3185
3185
  "border-gray-500 border-primary border-primary-500 text-primary text-primary-500": u,
3186
3186
  "border-transparent text-gray-400 ": !u
3187
- }), m = c > 0 && /* @__PURE__ */ n.jsx("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: c });
3187
+ }), m = r > 0 && /* @__PURE__ */ n.jsx("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: r });
3188
3188
  return /* @__PURE__ */ n.jsxs(
3189
3189
  "button",
3190
3190
  {
3191
3191
  onClick: () => s(t.key),
3192
- className: Z(r, v),
3192
+ className: Z(c, v),
3193
3193
  "aria-selected": u,
3194
3194
  role: "tab",
3195
3195
  type: "button",
@@ -3591,12 +3591,12 @@ function us({
3591
3591
  O(() => {
3592
3592
  (i == null ? void 0 : i.length) > 0 && JSON.stringify(i) !== JSON.stringify(s) && a(i);
3593
3593
  }, [i]);
3594
- function l(u, c) {
3595
- const r = [...s];
3596
- r[c] = {
3597
- ...r[c],
3594
+ function l(u, r) {
3595
+ const c = [...s];
3596
+ c[r] = {
3597
+ ...c[r],
3598
3598
  value: u
3599
- }, a(r), e && e(r);
3599
+ }, a(c), e && e(c);
3600
3600
  }
3601
3601
  function d() {
3602
3602
  const u = [
@@ -3608,15 +3608,15 @@ function us({
3608
3608
  a(u), e && e(u);
3609
3609
  }
3610
3610
  function t(u) {
3611
- const c = s.filter((r, v) => v !== u);
3612
- a(c), e && e(c);
3611
+ const r = s.filter((c, v) => v !== u);
3612
+ a(r), e && e(r);
3613
3613
  }
3614
3614
  return O(() => {
3615
3615
  o && o(JSON.stringify({ values: s }));
3616
3616
  }, [o, s]), /* @__PURE__ */ n.jsxs("div", { className: "]", children: [
3617
3617
  /* @__PURE__ */ n.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
3618
3618
  /* @__PURE__ */ n.jsx("div", { className: "grid text-sm font-bold border-b border-gray-100 bg-gray-50", children: /* @__PURE__ */ n.jsx("div", { className: "px-2 py-2", children: /* @__PURE__ */ n.jsx("span", { className: "", children: "Add Denominations" }) }) }),
3619
- s == null ? void 0 : s.map((u, c) => /* @__PURE__ */ n.jsx(
3619
+ s == null ? void 0 : s.map((u, r) => /* @__PURE__ */ n.jsx(
3620
3620
  "div",
3621
3621
  {
3622
3622
  className: "grid text-sm border-b border-gray-100",
@@ -3628,14 +3628,14 @@ function us({
3628
3628
  className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
3629
3629
  decimalsLimit: 6,
3630
3630
  defaultValue: u.value,
3631
- onValueChange: (r) => l(r, c),
3631
+ onValueChange: (c) => l(c, r),
3632
3632
  allowNegativeValue: !1
3633
3633
  }
3634
3634
  ) }),
3635
3635
  /* @__PURE__ */ n.jsx(
3636
3636
  "button",
3637
3637
  {
3638
- onClick: () => t(c),
3638
+ onClick: () => t(r),
3639
3639
  className: "text-red-500 hover:text-red-700 px-2",
3640
3640
  type: "button",
3641
3641
  "aria-label": "Remove row",
@@ -3644,7 +3644,7 @@ function us({
3644
3644
  )
3645
3645
  ] })
3646
3646
  },
3647
- c + "index"
3647
+ r + "index"
3648
3648
  ))
3649
3649
  ] }),
3650
3650
  /* @__PURE__ */ n.jsx("div", { className: "mt-1 flex justify-end", children: /* @__PURE__ */ n.jsx(
@@ -3713,12 +3713,12 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3713
3713
  label: s,
3714
3714
  type: a
3715
3715
  }) => {
3716
- const [l, d] = R(""), t = gi("config"), u = (c) => {
3717
- const r = c.target.files[0];
3718
- if (!r) return;
3719
- d(r.name);
3716
+ const [l, d] = R(""), t = gi("config"), u = (r) => {
3717
+ const c = r.target.files[0];
3718
+ if (!c) return;
3719
+ d(c.name);
3720
3720
  const v = new FileReader();
3721
- r.name.endsWith(".csv") ? (v.onload = (m) => {
3721
+ c.name.endsWith(".csv") ? (v.onload = (m) => {
3722
3722
  const h = m.target.result, f = Mo.parse(h, { header: !0 });
3723
3723
  i(
3724
3724
  e,
@@ -3726,13 +3726,13 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3726
3726
  f.data
3727
3727
  )
3728
3728
  );
3729
- }, v.readAsText(r)) : r.name.endsWith(".xlsx") || r.name.endsWith(".xls") ? (v.onload = (m) => {
3729
+ }, v.readAsText(c)) : c.name.endsWith(".xlsx") || c.name.endsWith(".xls") ? (v.onload = (m) => {
3730
3730
  const h = new Uint8Array(m.target.result), f = ne.read(h, { type: "array" }), y = f.SheetNames[0], g = f.Sheets[y], p = ne.utils.sheet_to_json(g);
3731
3731
  i(
3732
3732
  e,
3733
3733
  (a === "dataGrid" ? Bn : wn)(p)
3734
3734
  );
3735
- }, v.readAsArrayBuffer(r)) : ki.error("Unsupported file type. Please upload a CSV or Excel file.");
3735
+ }, v.readAsArrayBuffer(c)) : ki.error("Unsupported file type. Please upload a CSV or Excel file.");
3736
3736
  };
3737
3737
  return /* @__PURE__ */ n.jsxs("div", { children: [
3738
3738
  /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
@@ -3835,24 +3835,24 @@ function ps({
3835
3835
  id: a
3836
3836
  }) {
3837
3837
  const { formData: l } = ji(fi), d = s("visibilityDependentFields") || [], t = si(() => {
3838
- var c;
3839
- return (c = vs(l).filter((r) => r.id !== a)) == null ? void 0 : c.map((r) => {
3838
+ var r;
3839
+ return (r = vs(l).filter((c) => c.id !== a)) == null ? void 0 : r.map((c) => {
3840
3840
  const v = d.find(
3841
- (m) => m.id === r.id
3841
+ (m) => m.id === c.id
3842
3842
  );
3843
3843
  return {
3844
- id: r.id,
3845
- value: r.id,
3846
- label: r.inputLabel,
3847
- sectionId: r.sectionId,
3844
+ id: c.id,
3845
+ value: c.id,
3846
+ label: c.inputLabel,
3847
+ sectionId: c.sectionId,
3848
3848
  fieldType: (v == null ? void 0 : v.fieldType) || "text",
3849
3849
  operator: (v == null ? void 0 : v.operator) || "equals",
3850
3850
  fieldValue: (v == null ? void 0 : v.fieldValue) !== void 0 ? v.fieldValue : ""
3851
3851
  };
3852
3852
  });
3853
- }, [l, d, a]), u = (c, r, v) => {
3853
+ }, [l, d, a]), u = (r, c, v) => {
3854
3854
  const m = d == null ? void 0 : d.map(
3855
- (h, f) => f === c ? { ...h, [r]: v } : h
3855
+ (h, f) => f === r ? { ...h, [c]: v } : h
3856
3856
  );
3857
3857
  e("visibilityDependentFields", m);
3858
3858
  };
@@ -3869,14 +3869,14 @@ function ps({
3869
3869
  validationData: { register: i, setValue: e, trigger: o, watch: s }
3870
3870
  }
3871
3871
  ),
3872
- d.length > 0 && /* @__PURE__ */ n.jsx("div", { className: "py-1 bg-gray-100 rounded dependent-fields", children: d == null ? void 0 : d.map((c, r) => {
3872
+ d.length > 0 && /* @__PURE__ */ n.jsx("div", { className: "py-1 bg-gray-100 rounded dependent-fields", children: d == null ? void 0 : d.map((r, c) => {
3873
3873
  var v, m;
3874
3874
  return /* @__PURE__ */ n.jsxs("div", { className: "dependent-field", children: [
3875
3875
  /* @__PURE__ */ n.jsx(
3876
3876
  "input",
3877
3877
  {
3878
3878
  type: "text",
3879
- value: c.label,
3879
+ value: r.label,
3880
3880
  readOnly: !0,
3881
3881
  disabled: !0,
3882
3882
  className: "field-label"
@@ -3885,10 +3885,10 @@ function ps({
3885
3885
  /* @__PURE__ */ n.jsx("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ n.jsx(
3886
3886
  ui,
3887
3887
  {
3888
- value: c.fieldType,
3889
- onChange: (h) => u(r, "fieldType", h),
3888
+ value: r.fieldType,
3889
+ onChange: (h) => u(c, "fieldType", h),
3890
3890
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3891
- /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: c.fieldType }),
3891
+ /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: r.fieldType }),
3892
3892
  /* @__PURE__ */ n.jsx(
3893
3893
  Ei,
3894
3894
  {
@@ -3920,10 +3920,10 @@ function ps({
3920
3920
  /* @__PURE__ */ n.jsx("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ n.jsx(
3921
3921
  ui,
3922
3922
  {
3923
- value: c.operator,
3924
- onChange: (h) => u(r, "operator", h),
3923
+ value: r.operator,
3924
+ onChange: (h) => u(c, "operator", h),
3925
3925
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3926
- /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: c.operator.replace("_", " ") }),
3926
+ /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: r.operator.replace("_", " ") }),
3927
3927
  /* @__PURE__ */ n.jsx(
3928
3928
  Ei,
3929
3929
  {
@@ -3936,7 +3936,7 @@ function ps({
3936
3936
  {
3937
3937
  className: "listbox-options ",
3938
3938
  anchor: "bottom",
3939
- children: (v = c.fieldType === "number" ? [...fe, ...hs] : fe) == null ? void 0 : v.map((h) => /* @__PURE__ */ n.jsx(
3939
+ children: (v = r.fieldType === "number" ? [...fe, ...hs] : fe) == null ? void 0 : v.map((h) => /* @__PURE__ */ n.jsx(
3940
3940
  ui.Option,
3941
3941
  {
3942
3942
  value: h,
@@ -3952,22 +3952,22 @@ function ps({
3952
3952
  ] })
3953
3953
  }
3954
3954
  ) }),
3955
- c.fieldType !== "boolean" ? /* @__PURE__ */ n.jsx(
3955
+ r.fieldType !== "boolean" ? /* @__PURE__ */ n.jsx(
3956
3956
  "input",
3957
3957
  {
3958
- type: c.fieldType,
3959
- value: c.fieldValue || "",
3960
- onChange: (h) => u(r, "fieldValue", h.target.value),
3958
+ type: r.fieldType,
3959
+ value: r.fieldValue || "",
3960
+ onChange: (h) => u(c, "fieldValue", h.target.value),
3961
3961
  placeholder: "Value",
3962
3962
  className: "field-value"
3963
3963
  }
3964
3964
  ) : /* @__PURE__ */ n.jsx("div", { className: "field-listbox", children: /* @__PURE__ */ n.jsx(
3965
3965
  ui,
3966
3966
  {
3967
- value: (m = c.fieldValue) != null ? m : "",
3968
- onChange: (h) => u(r, "fieldValue", h),
3967
+ value: (m = r.fieldValue) != null ? m : "",
3968
+ onChange: (h) => u(c, "fieldValue", h),
3969
3969
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3970
- /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: c.fieldValue === !0 ? "True" : c.fieldValue === !1 ? "False" : "Select value" }),
3970
+ /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
3971
3971
  /* @__PURE__ */ n.jsx(
3972
3972
  Ei,
3973
3973
  {
@@ -4005,7 +4005,7 @@ function ps({
4005
4005
  ] })
4006
4006
  }
4007
4007
  ) })
4008
- ] }, c.id);
4008
+ ] }, r.id);
4009
4009
  }) })
4010
4010
  ] });
4011
4011
  }
@@ -4086,10 +4086,9 @@ const gs = w.object().shape({
4086
4086
  onClose: e,
4087
4087
  element: o
4088
4088
  }) => {
4089
- console.log(o);
4090
4089
  const s = fs.filter(
4091
4090
  (D) => !qi.includes(o.inputType) || D.key !== "validation"
4092
- ), { updateElement: a } = bi.useContext(fi), [l, d] = R("basic"), [t, u] = R(!1), [c, r] = R("manual"), v = gi("config"), {
4091
+ ), { updateElement: a } = bi.useContext(fi), [l, d] = R("basic"), [t, u] = R(!1), [r, c] = R("manual"), v = gi("config"), {
4093
4092
  register: m,
4094
4093
  handleSubmit: h,
4095
4094
  control: f,
@@ -4158,7 +4157,7 @@ const gs = w.object().shape({
4158
4157
  }
4159
4158
  }, [o.type, y, A.apiUrl]), J = ["manual", "api", "sheet"];
4160
4159
  function ri() {
4161
- c === "api" && B();
4160
+ r === "api" && B();
4162
4161
  }
4163
4162
  const ii = () => {
4164
4163
  var D, _;
@@ -4169,7 +4168,7 @@ const gs = w.object().shape({
4169
4168
  {
4170
4169
  type: "radio",
4171
4170
  name: "optionType",
4172
- onChange: (F) => r(F.target.value),
4171
+ onChange: (F) => c(F.target.value),
4173
4172
  value: V
4174
4173
  }
4175
4174
  ),
@@ -4179,7 +4178,7 @@ const gs = w.object().shape({
4179
4178
  " options"
4180
4179
  ] })
4181
4180
  ] }, V)) }),
4182
- c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4181
+ r === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4183
4182
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4184
4183
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
4185
4184
  /* @__PURE__ */ n.jsx(
@@ -4209,7 +4208,7 @@ const gs = w.object().shape({
4209
4208
  ] }),
4210
4209
  /* @__PURE__ */ n.jsx(cs, {})
4211
4210
  ] }),
4212
- c === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4211
+ r === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4213
4212
  ge,
4214
4213
  {
4215
4214
  type: o.type,
@@ -4379,9 +4378,9 @@ const gs = w.object().shape({
4379
4378
  {
4380
4379
  type: "radio",
4381
4380
  name: "optionType",
4382
- onChange: (_) => r(_.target.value),
4381
+ onChange: (_) => c(_.target.value),
4383
4382
  value: D,
4384
- checked: D === c
4383
+ checked: D === r
4385
4384
  }
4386
4385
  ),
4387
4386
  " ",
@@ -4390,7 +4389,7 @@ const gs = w.object().shape({
4390
4389
  " options"
4391
4390
  ] })
4392
4391
  ] }, D)) }),
4393
- c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4392
+ r === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4394
4393
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4395
4394
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
4396
4395
  /* @__PURE__ */ n.jsx(
@@ -4420,7 +4419,7 @@ const gs = w.object().shape({
4420
4419
  ] }),
4421
4420
  /* @__PURE__ */ n.jsx(rs, {})
4422
4421
  ] }),
4423
- c === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4422
+ r === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4424
4423
  ge,
4425
4424
  {
4426
4425
  type: o.type,
@@ -5067,8 +5066,8 @@ const gs = w.object().shape({
5067
5066
  ({ state: i, element: e, children: o }) => {
5068
5067
  const [s, a] = R(!1), { removeElement: l, duplicateElement: d } = bi.useContext(fi), t = si(
5069
5068
  () => {
5070
- var c;
5071
- return (c = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : c.map((r) => r.label).join(", ");
5069
+ var r;
5070
+ return (r = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : r.map((c) => c.label).join(", ");
5072
5071
  },
5073
5072
  [e]
5074
5073
  ), u = X(() => {
@@ -5260,7 +5259,7 @@ function Ns({
5260
5259
  validationData: e
5261
5260
  }) {
5262
5261
  var A;
5263
- const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = R(), [t, u] = R(!1), [c, r] = R(!1), [v, m] = R(""), h = a && a(i == null ? void 0 : i.id);
5262
+ const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = R(), [t, u] = R(!1), [r, c] = R(!1), [v, m] = R(""), h = a && a(i == null ? void 0 : i.id);
5264
5263
  O(() => {
5265
5264
  d(h);
5266
5265
  }, [h]);
@@ -5286,15 +5285,15 @@ function Ns({
5286
5285
  B = await Ii.post(g, { value: N }, S);
5287
5286
  else
5288
5287
  throw new Error("Unsupported HTTP method");
5289
- B.status === 200 && ((((ei = (E = B == null ? void 0 : B.data) == null ? void 0 : E.data) == null ? void 0 : ei.status) || ((Y = B == null ? void 0 : B.data) == null ? void 0 : Y.status)) === !0 ? (r(!0), x === "string" ? m(
5288
+ B.status === 200 && ((((ei = (E = B == null ? void 0 : B.data) == null ? void 0 : E.data) == null ? void 0 : ei.status) || ((Y = B == null ? void 0 : B.data) == null ? void 0 : Y.status)) === !0 ? (c(!0), x === "string" ? m(
5290
5289
  ((L = (Q = B == null ? void 0 : B.data) == null ? void 0 : Q.data) == null ? void 0 : L.description) || ((U = B == null ? void 0 : B.data) == null ? void 0 : U.description) || "Validation successful"
5291
5290
  ) : y(
5292
5291
  ((K = (I = B == null ? void 0 : B.data) == null ? void 0 : I.data) == null ? void 0 : K.description) || ((G = B == null ? void 0 : B.data) == null ? void 0 : G.description) || {}
5293
- )) : (console.error("Invalid input:", N), m("Unable to validate input"), r(!1)));
5292
+ )) : (console.error("Invalid input:", N), m("Unable to validate input"), c(!1)));
5294
5293
  } catch (B) {
5295
5294
  console.error("Error validating input:", B), m(
5296
5295
  ((M = (P = B == null ? void 0 : B.response) == null ? void 0 : P.data) == null ? void 0 : M.message) || "Unable to validate input"
5297
- ), r(!1);
5296
+ ), c(!1);
5298
5297
  } finally {
5299
5298
  u(!1);
5300
5299
  }
@@ -5358,13 +5357,13 @@ function Ns({
5358
5357
  }
5359
5358
  )
5360
5359
  ] }),
5361
- c && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(q, { icon: "gg:check-o" }) })
5360
+ r && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(q, { icon: "gg:check-o" }) })
5362
5361
  ] })
5363
5362
  ] }),
5364
5363
  v && x === "string" && /* @__PURE__ */ n.jsx(
5365
5364
  "span",
5366
5365
  {
5367
- className: `${c ? "text-green-600" : "text-red-600"} text-sm`,
5366
+ className: `${r ? "text-green-600" : "text-red-600"} text-sm`,
5368
5367
  children: v
5369
5368
  }
5370
5369
  ),
@@ -5384,22 +5383,22 @@ function js({
5384
5383
  denominators: s
5385
5384
  }) {
5386
5385
  const [a, l] = R([...o]);
5387
- function d(c, r) {
5386
+ function d(r, c) {
5388
5387
  l((v) => {
5389
5388
  const m = [...v];
5390
- return m[r] = {
5391
- ...m[r],
5392
- value: c
5389
+ return m[c] = {
5390
+ ...m[c],
5391
+ value: r
5393
5392
  }, m;
5394
5393
  });
5395
5394
  }
5396
- function t(c, r) {
5397
- return parseFloat(c) * parseFloat(r) || 0;
5395
+ function t(r, c) {
5396
+ return parseFloat(r) * parseFloat(c) || 0;
5398
5397
  }
5399
5398
  const u = si(
5400
- () => a.reduce((c, r) => {
5401
- const v = t(r.key, r.value);
5402
- return c + v;
5399
+ () => a.reduce((r, c) => {
5400
+ const v = t(c.key, c.value);
5401
+ return r + v;
5403
5402
  }, 0),
5404
5403
  [a]
5405
5404
  );
@@ -5407,11 +5406,11 @@ function js({
5407
5406
  i && i(a);
5408
5407
  }, [a]), O(() => {
5409
5408
  if (s != null && s.length) {
5410
- const c = s == null ? void 0 : s.map((r, v) => ({
5411
- key: r.value,
5409
+ const r = s == null ? void 0 : s.map((c, v) => ({
5410
+ key: c.value,
5412
5411
  value: Array.isArray(o) && o[v] ? o[v].value : ""
5413
5412
  }));
5414
- l(c);
5413
+ l(r);
5415
5414
  }
5416
5415
  }, [o, s]), /* @__PURE__ */ n.jsx("div", { className: "mt-2", children: /* @__PURE__ */ n.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden text-gray-700", children: [
5417
5416
  /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-3 text-sm font-bold border-b border-gray-100 bg-gray-50", children: [
@@ -5419,30 +5418,30 @@ function js({
5419
5418
  /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-2", children: /* @__PURE__ */ n.jsx("span", { children: "Quantity" }) }),
5420
5419
  /* @__PURE__ */ n.jsx("div", { className: "px-4 py-2", children: /* @__PURE__ */ n.jsx("span", { children: "Sub total" }) })
5421
5420
  ] }),
5422
- a == null ? void 0 : a.map((c, r) => {
5421
+ a == null ? void 0 : a.map((r, c) => {
5423
5422
  var v, m;
5424
5423
  return /* @__PURE__ */ n.jsxs(
5425
5424
  "div",
5426
5425
  {
5427
5426
  className: "grid grid-cols-3 text-sm border-b border-gray-100",
5428
5427
  children: [
5429
- /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-2 flex items-center", children: /* @__PURE__ */ n.jsx("span", { className: "", children: (v = parseFloat(c.key)) == null ? void 0 : v.toLocaleString() }) }),
5428
+ /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-2 flex items-center", children: /* @__PURE__ */ n.jsx("span", { className: "", children: (v = parseFloat(r.key)) == null ? void 0 : v.toLocaleString() }) }),
5430
5429
  /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-1", children: /* @__PURE__ */ n.jsx("span", { children: /* @__PURE__ */ n.jsx(
5431
5430
  sn,
5432
5431
  {
5433
5432
  id: "input-example",
5434
5433
  className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
5435
5434
  decimalsLimit: 6,
5436
- value: c.value,
5437
- onValueChange: (h) => d(h, r),
5435
+ value: r.value,
5436
+ onValueChange: (h) => d(h, c),
5438
5437
  disabled: e,
5439
5438
  allowNegativeValue: !1
5440
5439
  }
5441
5440
  ) }) }),
5442
- /* @__PURE__ */ n.jsx("div", { className: "px-4 py-2 flex justify-between items-center", children: /* @__PURE__ */ n.jsx("span", { children: (m = t(c.key, c.value)) == null ? void 0 : m.toLocaleString() }) })
5441
+ /* @__PURE__ */ n.jsx("div", { className: "px-4 py-2 flex justify-between items-center", children: /* @__PURE__ */ n.jsx("span", { children: (m = t(r.key, r.value)) == null ? void 0 : m.toLocaleString() }) })
5443
5442
  ]
5444
5443
  },
5445
- r + "index"
5444
+ c + "index"
5446
5445
  );
5447
5446
  }),
5448
5447
  /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-3 text-sm font-bold bg-gray-50", children: [
@@ -5508,9 +5507,9 @@ function Bs({
5508
5507
  return /* @__PURE__ */ n.jsxs("tr", { children: [
5509
5508
  e.map((d) => {
5510
5509
  var h;
5511
- const t = i[d.field], u = d.editable && !o, { isValidating: c, result: r } = a(i.id, d.field);
5510
+ const t = i[d.field], u = d.editable && !o, { isValidating: r, result: c } = a(i.id, d.field);
5512
5511
  let v = "border-gray-300";
5513
- d.validate && ((r == null ? void 0 : r.isValid) === !1 ? v = "border-red-500 bg-red-50" : (r == null ? void 0 : r.isValid) === !0 && (v = "border-green-500 bg-green-50"));
5512
+ d.validate && ((c == null ? void 0 : c.isValid) === !1 ? v = "border-red-500 bg-red-50" : (c == null ? void 0 : c.isValid) === !0 && (v = "border-green-500 bg-green-50"));
5514
5513
  const m = `w-full py-1 rounded outline-none ${v}`;
5515
5514
  return /* @__PURE__ */ n.jsx(
5516
5515
  "td",
@@ -5558,18 +5557,18 @@ function Bs({
5558
5557
  className: m
5559
5558
  }
5560
5559
  ),
5561
- c && /* @__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" }) })
5562
- ] }) : d.validate && r ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
5560
+ r && /* @__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" }) })
5561
+ ] }) : d.validate && c ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
5563
5562
  /* @__PURE__ */ n.jsxs("span", { children: [
5564
5563
  String(t != null ? t : ""),
5565
5564
  " ",
5566
- r.data && `[${r.data}]`
5565
+ c.data && `[${c.data}]`
5567
5566
  ] }),
5568
- r.isValid ? /* @__PURE__ */ n.jsx("span", { className: "text-xs text-green-600", children: "✓" }) : /* @__PURE__ */ n.jsx(
5567
+ c.isValid ? /* @__PURE__ */ n.jsx("span", { className: "text-xs text-green-600", children: "✓" }) : /* @__PURE__ */ n.jsx(
5569
5568
  "span",
5570
5569
  {
5571
5570
  className: "text-xs text-red-600 cursor-help",
5572
- title: (h = r.error) != null ? h : "",
5571
+ title: (h = c.error) != null ? h : "",
5573
5572
  children: "✗"
5574
5573
  }
5575
5574
  )
@@ -5615,9 +5614,9 @@ function Ls({
5615
5614
  ), u = X(() => {
5616
5615
  const v = Si(), m = s.reduce((h, f) => (h[f.field] = f.field === "id" ? v : "", h), {});
5617
5616
  l((h) => [...h, { id: v, ...m }]);
5618
- }, [s]), c = X((v) => {
5617
+ }, [s]), r = X((v) => {
5619
5618
  l((m) => m.filter((h) => h.id !== v));
5620
- }, []), r = X(
5619
+ }, []), c = X(
5621
5620
  (v, m) => ({
5622
5621
  isValidating: !1,
5623
5622
  result: void 0
@@ -5650,8 +5649,8 @@ function Ls({
5650
5649
  columns: s,
5651
5650
  isReadOnly: o,
5652
5651
  handleCellChange: t,
5653
- getValidationStatus: r,
5654
- deleteRow: c
5652
+ getValidationStatus: c,
5653
+ deleteRow: r
5655
5654
  },
5656
5655
  v.id
5657
5656
  )) : /* @__PURE__ */ n.jsx("tr", { children: /* @__PURE__ */ n.jsx(
@@ -5679,17 +5678,17 @@ function Ps({
5679
5678
  element: i,
5680
5679
  validationData: e
5681
5680
  }) {
5682
- var r;
5681
+ var c;
5683
5682
  const {
5684
5683
  register: o = () => ({}),
5685
5684
  setValue: s,
5686
5685
  watch: a,
5687
5686
  isReadOnly: l
5688
- } = e || {}, d = a && a(i == null ? void 0 : i.id) || {}, t = Array.isArray(d) ? d : (r = d == null ? void 0 : d.rows) != null ? r : [];
5687
+ } = e || {}, d = a && a(i == null ? void 0 : i.id) || {}, t = Array.isArray(d) ? d : (c = d == null ? void 0 : d.rows) != null ? c : [];
5689
5688
  O(() => {
5690
5689
  o(i.id);
5691
5690
  }, [i.id, o]);
5692
- const u = Mi(""), c = X(
5691
+ const u = Mi(""), r = X(
5693
5692
  (v) => {
5694
5693
  const m = JSON.stringify(v);
5695
5694
  m !== u.current && (u.current = m, s == null || s(i.id, {
@@ -5703,7 +5702,7 @@ function Ps({
5703
5702
  Ls,
5704
5703
  {
5705
5704
  value: t,
5706
- onChange: c,
5705
+ onChange: r,
5707
5706
  columns: i == null ? void 0 : i.dataColumns,
5708
5707
  isReadOnly: l
5709
5708
  }
@@ -5719,15 +5718,15 @@ const xe = ({
5719
5718
  name: d,
5720
5719
  label: t,
5721
5720
  value: u,
5722
- trigger: c,
5723
- isMultiple: r = !1,
5721
+ trigger: r,
5722
+ isMultiple: c = !1,
5724
5723
  isFloatingLabel: v = !1,
5725
5724
  subText: m,
5726
5725
  labelClass: h = "",
5727
5726
  loading: f,
5728
5727
  disabled: y
5729
5728
  }) => {
5730
- const [g, p] = R(r ? [] : null), x = Z("custom-select__control", i), C = si(() => e, [e]);
5729
+ const [g, p] = R(c ? [] : null), x = Z("custom-select__control", i), C = si(() => e, [e]);
5731
5730
  return O(() => {
5732
5731
  const S = e == null ? void 0 : e.find((j) => {
5733
5732
  var A;
@@ -5735,7 +5734,7 @@ const xe = ({
5735
5734
  });
5736
5735
  p(S || null);
5737
5736
  }, [u, e]), O(() => {
5738
- g && l && a && (l(d, g == null ? void 0 : g.value), a(d), c == null || c(d));
5737
+ g && l && a && (l(d, g == null ? void 0 : g.value), a(d), r == null || r(d));
5739
5738
  }, [d, g]), /* @__PURE__ */ n.jsxs("div", { className: "custom-select", children: [
5740
5739
  t && !v && /* @__PURE__ */ n.jsx("label", { className: "custom-select__label", children: t }),
5741
5740
  v && t && /* @__PURE__ */ n.jsx("label", { className: Z("custom-select__floating-label", h), children: t }),
@@ -5744,7 +5743,7 @@ const xe = ({
5744
5743
  {
5745
5744
  value: g,
5746
5745
  onChange: p,
5747
- multiple: r,
5746
+ multiple: c,
5748
5747
  disabled: y,
5749
5748
  children: /* @__PURE__ */ n.jsxs("div", { className: "custom-select__wrapper", children: [
5750
5749
  /* @__PURE__ */ n.jsxs(ui.Button, { className: x, disabled: y, children: [
@@ -5796,18 +5795,18 @@ const xe = ({
5796
5795
  setValue: a,
5797
5796
  watch: l,
5798
5797
  isReadOnly: d
5799
- } = e || {}, t = (y = i == null ? void 0 : i.id) != null ? y : "cascadeValue", [u, c] = R(""), [r, v] = R(""), m = (g, p) => {
5798
+ } = e || {}, t = (y = i == null ? void 0 : i.id) != null ? y : "cascadeValue", [u, r] = R(""), [c, v] = R(""), m = (g, p) => {
5800
5799
  const x = g && p ? `${g}_${p}` : "";
5801
5800
  a == null || a(t, x), s == null || s(t);
5802
5801
  }, h = (g, p) => {
5803
- g === "first" ? (c(p), v(""), m(p, "")) : (v(p), m(u, p));
5802
+ g === "first" ? (r(p), v(""), m(p, "")) : (v(p), m(u, p));
5804
5803
  };
5805
5804
  O(() => {
5806
5805
  if (l) {
5807
5806
  const g = l(t);
5808
5807
  if (g != null && g.includes("_")) {
5809
5808
  const [p, x] = g.split("_");
5810
- c(p), v(x);
5809
+ r(p), v(x);
5811
5810
  }
5812
5811
  }
5813
5812
  }, [l, t]);
@@ -5839,7 +5838,7 @@ const xe = ({
5839
5838
  options: f,
5840
5839
  name: `${t}`,
5841
5840
  register: o,
5842
- value: r
5841
+ value: c
5843
5842
  }
5844
5843
  )
5845
5844
  ] })
@@ -5857,18 +5856,18 @@ const xe = ({
5857
5856
  var p;
5858
5857
  const {
5859
5858
  register: u = () => ({}),
5860
- trigger: c,
5861
- setValue: r,
5859
+ trigger: r,
5860
+ setValue: c,
5862
5861
  watch: v,
5863
5862
  isReadOnly: m
5864
5863
  } = t || {}, h = (p = v == null ? void 0 : v(d.id)) != null ? p : 0, [f, y] = R(null);
5865
5864
  O(() => {
5866
- h == null && (r == null || r(d.id, i));
5865
+ h == null && (c == null || c(d.id, i));
5867
5866
  }, []);
5868
5867
  const g = (x) => {
5869
5868
  if (!o && !m) {
5870
5869
  const C = x + 1;
5871
- r == null || r(d.id, C), c == null || c(d.id), s == null || s(C);
5870
+ c == null || c(d.id, C), r == null || r(d.id), s == null || s(C);
5872
5871
  }
5873
5872
  };
5874
5873
  return /* @__PURE__ */ n.jsxs("div", { className: `flex gap-1 ${l}`, children: [
@@ -5940,14 +5939,14 @@ function ye({
5940
5939
  trigger: a,
5941
5940
  isReadOnly: l,
5942
5941
  watch: d
5943
- } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: c } = si(() => {
5942
+ } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: r } = si(() => {
5944
5943
  var f;
5945
5944
  if (typeof t == "string" && t.includes(",")) {
5946
5945
  const [y, g] = (f = t.split(",")) == null ? void 0 : f.map((p) => p.trim());
5947
5946
  return { country: g, state: y };
5948
5947
  }
5949
5948
  return { country: t, state: "" };
5950
- }, [t]), r = Mi(t), v = si(() => {
5949
+ }, [t]), c = Mi(t), v = si(() => {
5951
5950
  var f, y;
5952
5951
  return u ? ((y = (f = Xi.find((g) => g.name === u)) == null ? void 0 : f.states) == null ? void 0 : y.map((g) => ({
5953
5952
  label: g.name,
@@ -5955,13 +5954,13 @@ function ye({
5955
5954
  }))) || [] : [];
5956
5955
  }, [u]), m = (f, y) => {
5957
5956
  const p = (y == null ? void 0 : y.value) || "";
5958
- s && p !== r.current && (s(i.id, p), a == null || a(i.id), r.current = p);
5957
+ s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
5959
5958
  }, h = (f, y) => {
5960
5959
  const g = (y == null ? void 0 : y.value) || "", p = g ? `${g}, ${u}` : u;
5961
- s && p !== r.current && (s(i.id, p), a == null || a(i.id), r.current = p);
5960
+ s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
5962
5961
  };
5963
5962
  return O(() => {
5964
- r.current = t;
5963
+ c.current = t;
5965
5964
  }, [t]), /* @__PURE__ */ n.jsxs("div", { className: "grid gap-y-6", children: [
5966
5965
  /* @__PURE__ */ n.jsx("input", { type: "hidden", ...o(i.id) }),
5967
5966
  /* @__PURE__ */ n.jsx(
@@ -5984,9 +5983,9 @@ function ye({
5984
5983
  onGetValue: h,
5985
5984
  name: `${i.id}-state`,
5986
5985
  readOnly: l,
5987
- defaultValue: c
5986
+ defaultValue: r
5988
5987
  },
5989
- `state-${c}`
5988
+ `state-${r}`
5990
5989
  )
5991
5990
  ] })
5992
5991
  ] });
@@ -5995,7 +5994,7 @@ function Os({
5995
5994
  element: i,
5996
5995
  validationData: e
5997
5996
  }) {
5998
- const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = si(() => gi("config"), []), [u, c] = R(!1), [r, v] = R(!1), m = X(async () => {
5997
+ const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = si(() => gi("config"), []), [u, r] = R(!1), [c, v] = R(!1), m = X(async () => {
5999
5998
  var h, f;
6000
5999
  if (!(!a || !l))
6001
6000
  try {
@@ -6008,7 +6007,7 @@ function Os({
6008
6007
  `${a}/${l}`,
6009
6008
  g
6010
6009
  ), x = !!((f = (h = p == null ? void 0 : p.data) == null ? void 0 : h.isSigned) != null ? f : p != null && p.isSigned);
6011
- return c(x), x;
6010
+ return r(x), x;
6012
6011
  } catch (y) {
6013
6012
  console.error("Failed to check sign status", y);
6014
6013
  } finally {
@@ -6040,21 +6039,21 @@ function Os({
6040
6039
  {
6041
6040
  type: "button",
6042
6041
  onClick: m,
6043
- disabled: r || u,
6042
+ disabled: c || u,
6044
6043
  style: { background: (t == null ? void 0 : t.buttonColor) || "#333" },
6045
6044
  className: Z(
6046
6045
  "flex items-center gap-x-1 rounded-lg border border-gray-200 bg-gray-200 px-3 py-[10px] text-sm text-white",
6047
- { "!opacity-60": r }
6046
+ { "!opacity-60": c }
6048
6047
  ),
6049
6048
  children: [
6050
6049
  /* @__PURE__ */ n.jsx(
6051
6050
  q,
6052
6051
  {
6053
- icon: r ? "solar:refresh-outline" : u ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
6054
- iconClass: r ? "animate-spin" : ""
6052
+ icon: c ? "solar:refresh-outline" : u ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
6053
+ iconClass: c ? "animate-spin" : ""
6055
6054
  }
6056
6055
  ),
6057
- r ? "Checking..." : u ? "Signed" : "Sign"
6056
+ c ? "Checking..." : u ? "Signed" : "Sign"
6058
6057
  ]
6059
6058
  }
6060
6059
  ) })
@@ -6316,8 +6315,8 @@ function Ks({
6316
6315
  value: d,
6317
6316
  error: t,
6318
6317
  disabled: u,
6319
- readOnly: c,
6320
- horizontal: r,
6318
+ readOnly: r,
6319
+ horizontal: c,
6321
6320
  description: v,
6322
6321
  validate: m,
6323
6322
  onChange: h,
@@ -6354,13 +6353,13 @@ function Ks({
6354
6353
  }, [C, p, Q]), /* @__PURE__ */ n.jsxs(
6355
6354
  "div",
6356
6355
  {
6357
- className: `relative formGroup ${Q && !c ? "has-error" : ""} ${r ? "flex" : ""} ${!Q && C.length > 0 && !c ? "is-valid" : ""}`,
6356
+ className: `relative formGroup ${Q && !r ? "has-error" : ""} ${c ? "flex" : ""} ${!Q && C.length > 0 && !r ? "is-valid" : ""}`,
6358
6357
  children: [
6359
6358
  i && /* @__PURE__ */ n.jsxs(
6360
6359
  "label",
6361
6360
  {
6362
6361
  htmlFor: l,
6363
- className: `${o} ${r ? "flex-0 mr-6 md:w-[100px] w-[60px] break-words" : ""} flex items-center gap-x-1 input-label text-sm text-[#1B2B41B8]`,
6362
+ className: `${o} ${c ? "flex-0 mr-6 md:w-[100px] w-[60px] break-words" : ""} flex items-center gap-x-1 input-label text-sm text-[#1B2B41B8]`,
6364
6363
  children: [
6365
6364
  i,
6366
6365
  " ",
@@ -6404,7 +6403,7 @@ function Ks({
6404
6403
  inputMode: "numeric",
6405
6404
  value: C,
6406
6405
  disabled: u,
6407
- readOnly: c,
6406
+ readOnly: r,
6408
6407
  onChange: (L) => {
6409
6408
  const U = L.target.value.replace(/\D/g, "");
6410
6409
  S(U);
@@ -6415,7 +6414,7 @@ function Ks({
6415
6414
  minLength: N
6416
6415
  }
6417
6416
  ),
6418
- /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Q && C.length > 0 && !c && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(q, { icon: "bi:check-lg" }) }) })
6417
+ /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Q && C.length > 0 && !r && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(q, { icon: "bi:check-lg" }) }) })
6419
6418
  ] })
6420
6419
  ] }),
6421
6420
  v && /* @__PURE__ */ n.jsx("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: v })
@@ -6447,11 +6446,11 @@ function Gs({
6447
6446
  value: u,
6448
6447
  readOnly: l,
6449
6448
  disabled: l,
6450
- onError: (c) => {
6451
- c ? d == null || d(i.id, { type: "manual", message: c }) : t == null || t(i.id);
6449
+ onError: (r) => {
6450
+ r ? d == null || d(i.id, { type: "manual", message: r }) : t == null || t(i.id);
6452
6451
  },
6453
- onChange: (c) => {
6454
- c && (s == null || s(i.id, c));
6452
+ onChange: (r) => {
6453
+ r && (s == null || s(i.id, r));
6455
6454
  }
6456
6455
  }
6457
6456
  );
@@ -6460,10 +6459,10 @@ function Hs({
6460
6459
  element: i,
6461
6460
  validationData: e
6462
6461
  }) {
6463
- var c;
6462
+ var r;
6464
6463
  const { register: o = () => ({}), watch: s } = e || {};
6465
6464
  let a = "";
6466
- s && (a = (c = s()[i.id]) != null ? c : "");
6465
+ s && (a = (r = s()[i.id]) != null ? r : "");
6467
6466
  const l = a.trim(), d = /^https?:\/\//i.test(l), t = l ? d ? l : `https://${l}` : "", u = !d;
6468
6467
  return /* @__PURE__ */ n.jsxs("div", { children: [
6469
6468
  !(e != null && e.isReadOnly) && /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
@@ -6567,8 +6566,8 @@ const We = {
6567
6566
  formData: d,
6568
6567
  addElement: t,
6569
6568
  setIsDragging: u,
6570
- moveElement: c,
6571
- isDragging: r,
6569
+ moveElement: r,
6570
+ isDragging: c,
6572
6571
  removeElement: v
6573
6572
  } = ji(fi), m = si(
6574
6573
  () => Array.from({ length: i.columns }),
@@ -6602,7 +6601,7 @@ const We = {
6602
6601
  S.preventDefault(), S.stopPropagation(), u(!1), f(null);
6603
6602
  const A = j + 1, N = S.dataTransfer.getData("elementId");
6604
6603
  if (N) {
6605
- c({
6604
+ r({
6606
6605
  draggedId: N,
6607
6606
  sectionId: e,
6608
6607
  targetGridId: i.id,
@@ -6634,7 +6633,7 @@ const We = {
6634
6633
  console.error("Drop failed in grid:", ei), u(!1);
6635
6634
  }
6636
6635
  },
6637
- [t, i.id, d, e, u, c]
6636
+ [t, i.id, d, e, u, r]
6638
6637
  ), C = (S, j, A) => {
6639
6638
  var K, G, P;
6640
6639
  const N = S + 1, E = (G = (K = d.find((M) => M.id === e)) == null ? void 0 : K.questionData) == null ? void 0 : G.find(
@@ -6645,7 +6644,7 @@ const We = {
6645
6644
  ), ei = (P = E == null ? void 0 : E.id) != null ? P : null, Y = Array.isArray(o) && o.find((M) => {
6646
6645
  var B;
6647
6646
  return ((B = M == null ? void 0 : M.props) == null ? void 0 : B.col) === N;
6648
- }), Q = r && h === S, L = !!Y, U = r && !!l, I = L && ei && A === "edit" ? {
6647
+ }), Q = c && h === S, L = !!Y, U = c && !!l, I = L && ei && A === "edit" ? {
6649
6648
  draggable: !0,
6650
6649
  onDragStart: (M) => {
6651
6650
  M.stopPropagation(), M.dataTransfer.setData("elementId", ei), M.dataTransfer.setData("properties", ei), M.dataTransfer.effectAllowed = "move", u(!0);
@@ -6753,13 +6752,13 @@ function Us({ elementData: i, sectionId: e }) {
6753
6752
  setIsDragging: a,
6754
6753
  addElementInPosition: l,
6755
6754
  moveElement: d
6756
- } = ji(fi), [t, u] = R(null), c = si(
6755
+ } = ji(fi), [t, u] = R(null), r = si(
6757
6756
  () => {
6758
6757
  var p;
6759
6758
  return ((p = o.find((x) => x.id === e)) == null ? void 0 : p.questionData) || [];
6760
6759
  },
6761
6760
  [o, e]
6762
- ), r = X(
6761
+ ), c = X(
6763
6762
  (p, x) => {
6764
6763
  p.dataTransfer.setData("elementId", x), p.dataTransfer.setData("properties", x), p.dataTransfer.effectAllowed = "move", u(x), a(!0);
6765
6764
  },
@@ -6778,12 +6777,12 @@ function Us({ elementData: i, sectionId: e }) {
6778
6777
  v();
6779
6778
  return;
6780
6779
  }
6781
- const S = c.find((A) => A.id === x), j = c.findIndex(
6780
+ const S = r.find((A) => A.id === x), j = r.findIndex(
6782
6781
  (A) => A.id === C
6783
6782
  );
6784
6783
  S != null && S.gridId && j !== -1 ? d({ draggedId: x, sectionId: e, targetIndex: j }) : d({ draggedId: x, sectionId: e, targetId: C }), u(null), a(!1);
6785
6784
  },
6786
- [e, d, a, v, c]
6785
+ [e, d, a, v, r]
6787
6786
  ), h = X(
6788
6787
  (p, x) => {
6789
6788
  p.preventDefault(), p.stopPropagation(), a(!1);
@@ -6808,7 +6807,7 @@ function Us({ elementData: i, sectionId: e }) {
6808
6807
  {
6809
6808
  id: p.id,
6810
6809
  draggable: !0,
6811
- onDragStart: (C) => r(C, p.id),
6810
+ onDragStart: (C) => c(C, p.id),
6812
6811
  onDragOver: x ? void 0 : (C) => {
6813
6812
  C.preventDefault(), C.stopPropagation();
6814
6813
  },
@@ -6823,7 +6822,7 @@ function Us({ elementData: i, sectionId: e }) {
6823
6822
  },
6824
6823
  p.id
6825
6824
  ),
6826
- [t, m, e, r, v]
6825
+ [t, m, e, c, v]
6827
6826
  ), y = si(() => (i == null ? void 0 : i.reduce((p, x) => (x.gridId && (p[x.gridId] = p[x.gridId] || [], p[x.gridId].push(x)), p), {})) || {}, [i]);
6828
6827
  if (!(i != null && i.length))
6829
6828
  return /* @__PURE__ */ n.jsx(
@@ -6848,7 +6847,7 @@ function Us({ elementData: i, sectionId: e }) {
6848
6847
  }
6849
6848
  ),
6850
6849
  g.map((p) => {
6851
- const x = c.findIndex((C) => C.id === p.id);
6850
+ const x = r.findIndex((C) => C.id === p.id);
6852
6851
  if (p.type === "grid") {
6853
6852
  const C = y[p.id] || [], S = t === p.id, j = !!t && !S;
6854
6853
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-0", children: [
@@ -6857,7 +6856,7 @@ function Us({ elementData: i, sectionId: e }) {
6857
6856
  {
6858
6857
  id: p.id,
6859
6858
  draggable: !0,
6860
- onDragStart: (A) => r(A, p.id),
6859
+ onDragStart: (A) => c(A, p.id),
6861
6860
  onDragOver: (A) => {
6862
6861
  A.preventDefault(), A.stopPropagation();
6863
6862
  },
@@ -6921,15 +6920,15 @@ const zs = an(Us), _s = w.object({
6921
6920
  register: a,
6922
6921
  handleSubmit: l,
6923
6922
  watch: d,
6924
- formState: { errors: t, isSubmitting: u, isValid: c },
6925
- reset: r
6923
+ formState: { errors: t, isSubmitting: u, isValid: r },
6924
+ reset: c
6926
6925
  } = En({
6927
6926
  resolver: On(_s),
6928
6927
  defaultValues: o
6929
6928
  });
6930
6929
  if (bi.useEffect(() => {
6931
- i || r();
6932
- }, [i, r]), !i) return null;
6930
+ i || c();
6931
+ }, [i, c]), !i) return null;
6933
6932
  const v = (h) => {
6934
6933
  s(h, o.id), e();
6935
6934
  }, m = d();
@@ -7009,9 +7008,9 @@ const zs = an(Us), _s = w.object({
7009
7008
  "button",
7010
7009
  {
7011
7010
  type: "submit",
7012
- disabled: !c || u,
7011
+ disabled: !r || u,
7013
7012
  style: { background: (yn == null ? void 0 : yn.buttonColor) || "#333" },
7014
- className: `flex-1 px-4 py-2.5 ${!c || u ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!c || u ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,
7013
+ className: `flex-1 px-4 py-2.5 ${!r || u ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!r || u ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,
7015
7014
  children: u ? "Saving..." : "Save"
7016
7015
  }
7017
7016
  )
@@ -7028,8 +7027,8 @@ const zs = an(Us), _s = w.object({
7028
7027
  handleSectionEdit: d,
7029
7028
  removeSection: t,
7030
7029
  formDataLength: u,
7031
- onDragOver: c,
7032
- setIsDragging: r
7030
+ onDragOver: r,
7031
+ setIsDragging: c
7033
7032
  }) => {
7034
7033
  var h, f;
7035
7034
  const v = Mi(null), m = Mi((h = i.questionData) == null ? void 0 : h.length);
@@ -7104,8 +7103,8 @@ const zs = an(Us), _s = w.object({
7104
7103
  {
7105
7104
  className: "h-full mt-4 transition-all duration-200",
7106
7105
  id: i.id,
7107
- onDragOver: c,
7108
- onDragEnd: () => r(!1),
7106
+ onDragOver: r,
7107
+ onDragEnd: () => c(!1),
7109
7108
  onClick: () => s(i.id),
7110
7109
  children: [
7111
7110
  /* @__PURE__ */ n.jsx("hr", { className: "group-last:hidden" }),
@@ -7133,8 +7132,8 @@ const zs = an(Us), _s = w.object({
7133
7132
  formData: d,
7134
7133
  setIsDragging: t,
7135
7134
  setSelectedSection: u,
7136
- selectedSection: c,
7137
- activeSections: r,
7135
+ selectedSection: r,
7136
+ activeSections: c,
7138
7137
  setActiveSections: v
7139
7138
  } = ji(fi), m = Mi((d == null ? void 0 : d.length) || 0);
7140
7139
  O(() => {
@@ -7153,7 +7152,7 @@ const zs = an(Us), _s = w.object({
7153
7152
  p.preventDefault(), p.dataTransfer.dropEffect = "move", s.current && (s.current.scrollTop = s.current.scrollHeight);
7154
7153
  }, []);
7155
7154
  function f(p) {
7156
- r.includes(p) ? v(
7155
+ c.includes(p) ? v(
7157
7156
  (x) => x.filter((C) => C !== p)
7158
7157
  ) : v((x) => [...x, p]);
7159
7158
  }
@@ -7187,9 +7186,9 @@ const zs = an(Us), _s = w.object({
7187
7186
  {
7188
7187
  section: p,
7189
7188
  index: x,
7190
- selectedSection: c,
7189
+ selectedSection: r,
7191
7190
  setSelectedSection: u,
7192
- activeSections: r,
7191
+ activeSections: c,
7193
7192
  toggleSection: f,
7194
7193
  handleSectionEdit: y,
7195
7194
  removeSection: a,
@@ -7314,7 +7313,7 @@ const An = [
7314
7313
  };
7315
7314
  s(f, a);
7316
7315
  }
7317
- const t = gi("config") || {}, u = t.elementColor, c = t.elementBgColor, r = t.elementBorderColor, v = $a.filter(
7316
+ const t = gi("config") || {}, u = t.elementColor, r = t.elementBgColor, c = t.elementBorderColor, v = $a.filter(
7318
7317
  (h) => h.label.toLowerCase().includes(i.toLowerCase())
7319
7318
  ), m = An == null ? void 0 : An.map((h) => ({
7320
7319
  title: h.title,
@@ -7348,8 +7347,8 @@ const An = [
7348
7347
  onDragEnd: () => o(!1),
7349
7348
  onClick: () => d(g),
7350
7349
  style: {
7351
- borderColor: r,
7352
- backgroundColor: c
7350
+ borderColor: c,
7351
+ backgroundColor: r
7353
7352
  },
7354
7353
  className: `cursor-move text-[#475467] flex justify-between items-center \r
7355
7354
  border-[1.5px] border-[#98A2B3] rounded-lg py-2 px-2 shadow-custom\r
@@ -7383,8 +7382,8 @@ const An = [
7383
7382
  iconClass: d = "text-[20px]",
7384
7383
  loadingClass: t = "",
7385
7384
  link: u = "",
7386
- div: c = !1,
7387
- type: r = "button",
7385
+ div: r = !1,
7386
+ type: c = "button",
7388
7387
  style: v,
7389
7388
  onClick: m
7390
7389
  }) => {
@@ -7432,11 +7431,11 @@ const An = [
7432
7431
  i && /* @__PURE__ */ n.jsx("span", { children: i }),
7433
7432
  a && l === "right" && /* @__PURE__ */ n.jsx("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(q, { icon: a }) })
7434
7433
  ] });
7435
- return c ? /* @__PURE__ */ n.jsx("div", { className: h, children: f() }) : u ? /* @__PURE__ */ n.jsx(To, { to: u, className: h, children: f() }) : /* @__PURE__ */ n.jsx(
7434
+ return r ? /* @__PURE__ */ n.jsx("div", { className: h, children: f() }) : u ? /* @__PURE__ */ n.jsx(To, { to: u, className: h, children: f() }) : /* @__PURE__ */ n.jsx(
7436
7435
  "button",
7437
7436
  {
7438
7437
  disabled: e,
7439
- type: r,
7438
+ type: c,
7440
7439
  className: h,
7441
7440
  "data-testid": "btn",
7442
7441
  onClick: m,
@@ -7548,7 +7547,7 @@ function ol({
7548
7547
  publishLoading: d,
7549
7548
  onTitleChange: t
7550
7549
  }) {
7551
- const { formData: u, setShowPreview: c, showPreview: r } = ji(fi), [v, m] = R(!1), [h, f] = R(!1), [y, g] = R(i || ""), p = gi("config");
7550
+ const { formData: u, setShowPreview: r, showPreview: c } = ji(fi), [v, m] = R(!1), [h, f] = R(!1), [y, g] = R(i || ""), p = gi("config");
7552
7551
  function x() {
7553
7552
  localStorage.setItem("formData", JSON.stringify(u)), o == null || o(u);
7554
7553
  }
@@ -7603,10 +7602,10 @@ function ol({
7603
7602
  /* @__PURE__ */ n.jsx(
7604
7603
  Bi,
7605
7604
  {
7606
- onClick: () => c((j) => !j),
7607
- text: r ? "Hide Preview" : "Preview",
7605
+ onClick: () => r((j) => !j),
7606
+ text: c ? "Hide Preview" : "Preview",
7608
7607
  btnClass: "px-2 bg-transparent font-medium text-sm form_preview",
7609
- icon: r ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
7608
+ icon: c ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
7610
7609
  iconClass: "text-base",
7611
7610
  style: { color: (p == null ? void 0 : p.buttonColor) || "#333" },
7612
7611
  isDisabled: a,
@@ -7660,8 +7659,8 @@ function al({
7660
7659
  previewLoading: d,
7661
7660
  saveLoading: t,
7662
7661
  publishLoading: u,
7663
- onTitleChange: c,
7664
- uploadUrl: r
7662
+ onTitleChange: r,
7663
+ uploadUrl: c
7665
7664
  }) {
7666
7665
  return /* @__PURE__ */ n.jsxs(je, { children: [
7667
7666
  /* @__PURE__ */ n.jsx(Ne, { position: "top-right", richColors: !0, closeButton: !0 }),
@@ -7678,10 +7677,10 @@ function al({
7678
7677
  previewLoading: d,
7679
7678
  saveLoading: t,
7680
7679
  publishLoading: u,
7681
- onTitleChange: c
7680
+ onTitleChange: r
7682
7681
  }
7683
7682
  ) }),
7684
- /* @__PURE__ */ n.jsx("div", { className: "p-6 h-[calc(100vh-70px)]", children: a ? /* @__PURE__ */ n.jsx(Ue, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ n.jsx($s, { questionData: e, uploadUrl: r }) })
7683
+ /* @__PURE__ */ n.jsx("div", { className: "p-6 h-[calc(100vh-70px)]", children: a ? /* @__PURE__ */ n.jsx(Ue, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ n.jsx($s, { questionData: e, uploadUrl: c }) })
7685
7684
  ] })
7686
7685
  ] }) })
7687
7686
  ] });
@@ -7698,8 +7697,8 @@ const Ml = ({
7698
7697
  goBackUrl: d,
7699
7698
  onPublish: t,
7700
7699
  previewLoading: u,
7701
- saveLoading: c,
7702
- publishLoading: r,
7700
+ saveLoading: r,
7701
+ publishLoading: c,
7703
7702
  onTitleChange: v,
7704
7703
  uploadUrl: m
7705
7704
  }) => (O(() => {
@@ -7715,8 +7714,8 @@ const Ml = ({
7715
7714
  goBackUrl: d,
7716
7715
  loading: l,
7717
7716
  previewLoading: u,
7718
- saveLoading: c,
7719
- publishLoading: r,
7717
+ saveLoading: r,
7718
+ publishLoading: c,
7720
7719
  onTitleChange: v,
7721
7720
  uploadUrl: m
7722
7721
  }
@@ -7728,19 +7727,19 @@ const Ml = ({
7728
7727
  maxLength: (i) => `Maximum length is ${i}`,
7729
7728
  minAmount: (i) => `Minimum amount is ${i}`,
7730
7729
  maxAmount: (i) => `Maximum amount is ${i}`
7731
- }, sl = (i) => ({
7730
+ }, sl = (i, e = !1) => ({
7732
7731
  textField: w.string().nullable(),
7733
7732
  longText: w.string().nullable(),
7734
- numberField: w.number().nullable().transform((o) => isNaN(o) ? null : o),
7735
- amountField: w.number().nullable().transform((o) => isNaN(o) ? null : o),
7733
+ numberField: w.number().nullable().transform((s) => isNaN(s) ? null : s),
7734
+ amountField: w.number().nullable().transform((s) => isNaN(s) ? null : s),
7736
7735
  selectField: w.string().nullable(),
7737
7736
  checkbox: w.mixed().nullable(),
7738
7737
  radio: w.mixed().nullable(),
7739
7738
  matrix: w.mixed().nullable(),
7740
- email: w.string().nullable().test("email-format", Ti.email, (o) => !o || o.trim() === "" ? !0 : /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/.test(o)),
7741
- date: w.date().typeError("Invalid date").nullable(),
7742
- url: w.string().nullable().test("url-format", Ti.url, (o) => !o || o.trim() === "" ? !0 : /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(
7743
- o
7739
+ email: w.string().nullable().test("email-format", Ti.email, (s) => !s || s.trim() === "" ? !0 : /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/.test(s)),
7740
+ date: w.date().nullable().transform((s, a) => e && a === "" ? null : s).typeError("Invalid date"),
7741
+ url: w.string().nullable().test("url-format", Ti.url, (s) => !s || s.trim() === "" ? !0 : /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(
7742
+ s
7744
7743
  ))
7745
7744
  })[i] || w.mixed().nullable(), ll = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o || Ti.required) : i.required(o || Ti.required) : i, dl = (i, {
7746
7745
  minLength: e,
@@ -7771,25 +7770,25 @@ const Ml = ({
7771
7770
  a || Ti.maxAmount(o)
7772
7771
  )), l;
7773
7772
  };
7774
- function tl(i) {
7775
- const e = {};
7776
- return i.forEach(({ questionData: o }) => {
7777
- o == null || o.forEach((s) => {
7778
- const { id: a, type: l, isRequired: d, requiredMessage: t, isDisabled: u } = s;
7779
- let c = sl(l);
7773
+ function tl({ formData: i, isReadOnly: e }) {
7774
+ const o = {};
7775
+ return i.forEach(({ questionData: s }) => {
7776
+ s == null || s.forEach((a) => {
7777
+ const { id: l, type: d, isRequired: t, requiredMessage: u, isDisabled: r } = a;
7778
+ let c = sl(d, e);
7780
7779
  c = ll(
7781
7780
  c,
7782
- u ? !1 : d,
7783
- t
7784
- ), l === "textField" || l === "longText" || l === "email" || l === "url" ? c = dl(
7781
+ r || e ? !1 : t,
7782
+ u
7783
+ ), d === "textField" || d === "longText" || d === "email" || d === "url" ? c = dl(
7785
7784
  c,
7786
- s
7787
- ) : (l === "numberField" || l === "amountField") && (c = ul(
7785
+ a
7786
+ ) : (d === "numberField" || d === "amountField") && (c = ul(
7788
7787
  c,
7789
- s
7790
- )), e[a] = c;
7788
+ a
7789
+ )), o[l] = c;
7791
7790
  });
7792
- }), w.object().shape(e);
7791
+ }), w.object().shape(o);
7793
7792
  }
7794
7793
  const en = ({ element: i, validationData: e }) => {
7795
7794
  const o = We[i.type], { answerData: s } = ji(fi), a = si(
@@ -7804,20 +7803,20 @@ const en = ({ element: i, validationData: e }) => {
7804
7803
  ), d = si(() => l.length ? l.every(
7805
7804
  (t) => {
7806
7805
  if (!i.isHidden) return !0;
7807
- const u = s == null ? void 0 : s[t.id], c = t.fieldValue, r = u;
7806
+ const u = s == null ? void 0 : s[t.id], r = t.fieldValue, c = u;
7808
7807
  switch (t.operator) {
7809
7808
  case "equals":
7810
- return String(c).toLowerCase() === String(r).toLowerCase();
7809
+ return String(r).toLowerCase() === String(c).toLowerCase();
7811
7810
  case "not_equals":
7812
- return String(c).toLowerCase() !== String(r).toLowerCase();
7811
+ return String(r).toLowerCase() !== String(c).toLowerCase();
7813
7812
  case "greater":
7814
- return Number(r) > Number(c);
7813
+ return Number(c) > Number(r);
7815
7814
  case "less":
7816
- return Number(r) < Number(c);
7815
+ return Number(c) < Number(r);
7817
7816
  case "contains":
7818
- return String(r).toLowerCase().includes(String(c).toLowerCase());
7817
+ return String(c).toLowerCase().includes(String(r).toLowerCase());
7819
7818
  case "not_contains":
7820
- return !String(r).toLowerCase().includes(String(c).toLowerCase());
7819
+ return !String(c).toLowerCase().includes(String(r).toLowerCase());
7821
7820
  default:
7822
7821
  return !0;
7823
7822
  }
@@ -7859,7 +7858,7 @@ function cl({ form_data: i, options: e }) {
7859
7858
  element: a,
7860
7859
  customClass: "p-0 min-h-[60px] border-none",
7861
7860
  children: l == null ? void 0 : l.map((d) => {
7862
- var t, u, c;
7861
+ var t, u, r;
7863
7862
  return /* @__PURE__ */ n.jsxs(
7864
7863
  Gn,
7865
7864
  {
@@ -7873,7 +7872,7 @@ function cl({ form_data: i, options: e }) {
7873
7872
  validationData: on(d, e)
7874
7873
  }
7875
7874
  ),
7876
- ((c = (u = e == null ? void 0 : e.errors) == null ? void 0 : u[d.id]) == null ? void 0 : c.message) && /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: e.errors[d.id].message })
7875
+ ((r = (u = e == null ? void 0 : e.errors) == null ? void 0 : u[d.id]) == null ? void 0 : r.message) && /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: e.errors[d.id].message })
7877
7876
  ]
7878
7877
  },
7879
7878
  d.id
@@ -7931,11 +7930,11 @@ function rl({ form_data: i, options: e, current: o }) {
7931
7930
  element: a,
7932
7931
  customClass: "p-0 min-h-[60px] border-none",
7933
7932
  children: t == null ? void 0 : t.map((u) => {
7934
- var c, r, v;
7933
+ var r, c, v;
7935
7934
  return /* @__PURE__ */ n.jsxs(
7936
7935
  Gn,
7937
7936
  {
7938
- col: (c = u.gridPosition) == null ? void 0 : c.col,
7937
+ col: (r = u.gridPosition) == null ? void 0 : r.col,
7939
7938
  customClass: "p-0",
7940
7939
  children: [
7941
7940
  /* @__PURE__ */ n.jsx(
@@ -7945,7 +7944,7 @@ function rl({ form_data: i, options: e, current: o }) {
7945
7944
  validationData: on(u, e)
7946
7945
  }
7947
7946
  ),
7948
- /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: (v = (r = e == null ? void 0 : e.errors) == null ? void 0 : r[u.id]) == null ? void 0 : v.message })
7947
+ /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: (v = (c = e == null ? void 0 : e.errors) == null ? void 0 : c[u.id]) == null ? void 0 : v.message })
7949
7948
  ]
7950
7949
  },
7951
7950
  u.id
@@ -7989,10 +7988,10 @@ const bl = ({
7989
7988
  renderType: d = "multi",
7990
7989
  children: t,
7991
7990
  hideFooter: u = !1,
7992
- uploadUrl: c
7991
+ uploadUrl: r
7993
7992
  }) => {
7994
7993
  var ii, di, pi, vi, D, _, V, F;
7995
- const { setAnswerData: r, setUploadUrl: v } = ji(fi), [m, h] = R(0), f = si(
7994
+ const { setAnswerData: c, setUploadUrl: v } = ji(fi), [m, h] = R(0), f = si(
7996
7995
  () => i.filter((W) => !W.isHidden).map((W) => {
7997
7996
  var ti;
7998
7997
  return W.isDisabled || W.disabled ? {
@@ -8005,8 +8004,8 @@ const bl = ({
8005
8004
  }),
8006
8005
  [i]
8007
8006
  ), y = (ii = f == null ? void 0 : f.length) != null ? ii : 0, g = gi("config"), p = si(
8008
- () => tl(f),
8009
- [f]
8007
+ () => tl({ formData: f, isReadOnly: l }),
8008
+ [f, l]
8010
8009
  ), x = En({
8011
8010
  resolver: On(p),
8012
8011
  mode: "onSubmit",
@@ -8033,8 +8032,8 @@ const bl = ({
8033
8032
  [a]
8034
8033
  );
8035
8034
  O(() => {
8036
- v(c);
8037
- }, [v, c]), O(() => {
8035
+ v(r);
8036
+ }, [v, r]), O(() => {
8038
8037
  if (!(f != null && f.length) || !a) return;
8039
8038
  const W = f.flatMap(
8040
8039
  (oi) => {
@@ -8051,13 +8050,13 @@ const bl = ({
8051
8050
  }));
8052
8051
  }
8053
8052
  );
8054
- P(W), r(G);
8053
+ P(W), c(G);
8055
8054
  }, [
8056
8055
  G,
8057
8056
  f,
8058
8057
  P,
8059
8058
  a,
8060
- r
8059
+ c
8061
8060
  ]), O(() => {
8062
8061
  e != null && e.length && N(ml(e));
8063
8062
  }, [e, N]);
@@ -8215,8 +8214,8 @@ function ze({
8215
8214
  config: d = { buttonColor: "#333" },
8216
8215
  renderType: t,
8217
8216
  children: u,
8218
- hideFooter: c,
8219
- onGetValues: r,
8217
+ hideFooter: r,
8218
+ onGetValues: c,
8220
8219
  uploadUrl: v
8221
8220
  }) {
8222
8221
  O(() => {
@@ -8224,9 +8223,9 @@ function ze({
8224
8223
  }, [d]);
8225
8224
  const m = X(
8226
8225
  (h) => {
8227
- r && r(h);
8226
+ c && c(h);
8228
8227
  },
8229
- [r]
8228
+ [c]
8230
8229
  );
8231
8230
  return l ? /* @__PURE__ */ n.jsx(Ue, {}) : e ? /* @__PURE__ */ n.jsxs("div", { className: "w-full h-full min-w-0", children: [
8232
8231
  /* @__PURE__ */ n.jsx("div", { id: "root-portal" }),
@@ -8239,7 +8238,7 @@ function ze({
8239
8238
  onSubmitData: s,
8240
8239
  isReadOnly: a,
8241
8240
  renderType: t,
8242
- hideFooter: c,
8241
+ hideFooter: r,
8243
8242
  onGetValues: m,
8244
8243
  uploadUrl: v,
8245
8244
  children: u