@redi.run/redi-components 0.0.76 → 0.0.77

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.
@@ -1338,8 +1338,8 @@ var CRC32 = /* @__PURE__ */ (function() {
1338
1338
  return c ||= {};
1339
1339
  }
1340
1340
  function u(e, t) {
1341
- if (e[0] == 80 && e[1] == 75) return yg(e, t);
1342
- if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return Og(e, t);
1341
+ if (e[0] == 80 && e[1] == 75) return pg(e, t);
1342
+ if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return Sg(e, t);
1343
1343
  if (e.length < 512) throw Error("CFB file size " + e.length + " < 512");
1344
1344
  var n = 3, i = 512, a = 0, o = 0, s = 0, c = 0, l = 0, u = [], h = e.slice(0, 512);
1345
1345
  prep_blob(h, 0);
@@ -1351,7 +1351,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1351
1351
  case 4:
1352
1352
  i = 4096;
1353
1353
  break;
1354
- case 0: if (_[1] == 0) return yg(e, t);
1354
+ case 0: if (_[1] == 0) return pg(e, t);
1355
1355
  default: throw Error("Major Version: Expected 3 or 4 saw " + n);
1356
1356
  }
1357
1357
  i !== 512 && (h = e.slice(0, i), prep_blob(h, 28));
@@ -1565,9 +1565,9 @@ var CRC32 = /* @__PURE__ */ (function() {
1565
1565
  }
1566
1566
  function E(e, t) {
1567
1567
  var n = t || {};
1568
- if (n.fileType == "mad") return kg(e, n);
1568
+ if (n.fileType == "mad") return Cg(e, n);
1569
1569
  switch (T(e), n.fileType) {
1570
- case "zip": return xg(e, n);
1570
+ case "zip": return hg(e, n);
1571
1571
  }
1572
1572
  var i = (function(e) {
1573
1573
  for (var t = 0, n = 0, i = 0; i < e.FileIndex.length; ++i) {
@@ -1680,45 +1680,45 @@ var CRC32 = /* @__PURE__ */ (function() {
1680
1680
  "root"
1681
1681
  ]
1682
1682
  };
1683
- function V(e, t, n) {
1683
+ function Ph(e, t, n) {
1684
1684
  l();
1685
1685
  var i = E(e, n);
1686
1686
  c.writeFileSync(t, i);
1687
1687
  }
1688
- function H(e) {
1688
+ function V(e) {
1689
1689
  for (var t = Array(e.length), n = 0; n < e.length; ++n) t[n] = String.fromCharCode(e[n]);
1690
1690
  return t.join("");
1691
1691
  }
1692
- function U(e, t) {
1692
+ function Ih(e, t) {
1693
1693
  var n = E(e, t);
1694
1694
  switch (t && t.type || "buffer") {
1695
1695
  case "file": return l(), c.writeFileSync(t.filename, n), n;
1696
- case "binary": return typeof n == "string" ? n : H(n);
1697
- case "base64": return Base64_encode(typeof n == "string" ? n : H(n));
1696
+ case "binary": return typeof n == "string" ? n : V(n);
1697
+ case "base64": return Base64_encode(typeof n == "string" ? n : V(n));
1698
1698
  case "buffer": if (has_buf) return Buffer.isBuffer(n) ? n : Buffer_from(n);
1699
1699
  case "array": return typeof n == "string" ? s2a(n) : n;
1700
1700
  }
1701
1701
  return n;
1702
1702
  }
1703
- var W;
1704
- function Uh(e) {
1703
+ var H;
1704
+ function zh(e) {
1705
1705
  try {
1706
1706
  var t = e.InflateRaw, n = new t();
1707
- if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) W = e;
1707
+ if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) H = e;
1708
1708
  else throw Error("zlib does not expose bytesRead");
1709
1709
  } catch (e) {
1710
1710
  console.error("cannot use native zlib: " + (e.message || e));
1711
1711
  }
1712
1712
  }
1713
- function Wh(e, t) {
1714
- if (!W) return _g(e, t);
1715
- var n = W.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1713
+ function Bh(e, t) {
1714
+ if (!H) return fg(e, t);
1715
+ var n = H.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1716
1716
  return e.l += i.bytesRead, a;
1717
1717
  }
1718
- function Gh(e) {
1719
- return W ? W.deflateRawSync(e) : Q(e);
1718
+ function Vh(e) {
1719
+ return H ? H.deflateRawSync(e) : ig(e);
1720
1720
  }
1721
- var G = [
1721
+ var U = [
1722
1722
  16,
1723
1723
  17,
1724
1724
  18,
@@ -1738,7 +1738,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1738
1738
  14,
1739
1739
  1,
1740
1740
  15
1741
- ], K = [
1741
+ ], W = [
1742
1742
  3,
1743
1743
  4,
1744
1744
  5,
@@ -1768,7 +1768,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1768
1768
  195,
1769
1769
  227,
1770
1770
  258
1771
- ], Kh = [
1771
+ ], Hh = [
1772
1772
  1,
1773
1773
  2,
1774
1774
  3,
@@ -1800,56 +1800,56 @@ var CRC32 = /* @__PURE__ */ (function() {
1800
1800
  16385,
1801
1801
  24577
1802
1802
  ];
1803
- function q(e) {
1803
+ function G(e) {
1804
1804
  var t = (e << 1 | e << 11) & 139536 | (e << 5 | e << 15) & 558144;
1805
1805
  return (t >> 16 | t >> 8 | t) & 255;
1806
1806
  }
1807
- for (var J = typeof Uint8Array < "u", Y = J ? new Uint8Array(256) : [], qh = 0; qh < 256; ++qh) Y[qh] = q(qh);
1808
- function Jh(e, t) {
1809
- var n = Y[e & 255];
1810
- return t <= 8 ? n >>> 8 - t : (n = n << 8 | Y[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | Y[e >> 16 & 255], n >>> 24 - t));
1807
+ for (var K = typeof Uint8Array < "u", q = K ? new Uint8Array(256) : [], J = 0; J < 256; ++J) q[J] = G(J);
1808
+ function Uh(e, t) {
1809
+ var n = q[e & 255];
1810
+ return t <= 8 ? n >>> 8 - t : (n = n << 8 | q[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | q[e >> 16 & 255], n >>> 24 - t));
1811
1811
  }
1812
- function Yh(e, t) {
1812
+ function Wh(e, t) {
1813
1813
  var n = t & 7, i = t >>> 3;
1814
1814
  return (e[i] | (n <= 6 ? 0 : e[i + 1] << 8)) >>> n & 3;
1815
1815
  }
1816
- function Xh(e, t) {
1816
+ function Gh(e, t) {
1817
1817
  var n = t & 7, i = t >>> 3;
1818
1818
  return (e[i] | (n <= 5 ? 0 : e[i + 1] << 8)) >>> n & 7;
1819
1819
  }
1820
- function Zh(e, t) {
1820
+ function Kh(e, t) {
1821
1821
  var n = t & 7, i = t >>> 3;
1822
1822
  return (e[i] | (n <= 4 ? 0 : e[i + 1] << 8)) >>> n & 15;
1823
1823
  }
1824
- function Qh(e, t) {
1824
+ function qh(e, t) {
1825
1825
  var n = t & 7, i = t >>> 3;
1826
1826
  return (e[i] | (n <= 3 ? 0 : e[i + 1] << 8)) >>> n & 31;
1827
1827
  }
1828
- function $h(e, t) {
1828
+ function Jh(e, t) {
1829
1829
  var n = t & 7, i = t >>> 3;
1830
1830
  return (e[i] | (n <= 1 ? 0 : e[i + 1] << 8)) >>> n & 127;
1831
1831
  }
1832
- function eg(e, t, n) {
1832
+ function Yh(e, t, n) {
1833
1833
  var i = t & 7, a = t >>> 3, o = (1 << n) - 1, s = e[a] >>> i;
1834
1834
  return n < 8 - i || (s |= e[a + 1] << 8 - i, n < 16 - i) || (s |= e[a + 2] << 16 - i, n < 24 - i) || (s |= e[a + 3] << 24 - i), s & o;
1835
1835
  }
1836
- function tg(e, t, n) {
1836
+ function Xh(e, t, n) {
1837
1837
  var i = t & 7, a = t >>> 3;
1838
1838
  return i <= 5 ? e[a] |= (n & 7) << i : (e[a] |= n << i & 255, e[a + 1] = (n & 7) >> 8 - i), t + 3;
1839
1839
  }
1840
- function ng(e, t, n) {
1840
+ function Zh(e, t, n) {
1841
1841
  var i = t & 7, a = t >>> 3;
1842
1842
  return n = (n & 1) << i, e[a] |= n, t + 1;
1843
1843
  }
1844
- function rg(e, t, n) {
1844
+ function Qh(e, t, n) {
1845
1845
  var i = t & 7, a = t >>> 3;
1846
1846
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n, t + 8;
1847
1847
  }
1848
- function ig(e, t, n) {
1848
+ function $h(e, t, n) {
1849
1849
  var i = t & 7, a = t >>> 3;
1850
1850
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n & 255, e[a + 2] = n >>> 8, t + 16;
1851
1851
  }
1852
- function ag(e, t) {
1852
+ function eg(e, t) {
1853
1853
  var n = e.length, i = 2 * n > t ? 2 * n : t + 5, a = 0;
1854
1854
  if (n >= t) return e;
1855
1855
  if (has_buf) {
@@ -1857,7 +1857,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1857
1857
  if (e.copy) e.copy(o);
1858
1858
  else for (; a < e.length; ++a) o[a] = e[a];
1859
1859
  return o;
1860
- } else if (J) {
1860
+ } else if (K) {
1861
1861
  var s = new Uint8Array(i);
1862
1862
  if (s.set) s.set(e);
1863
1863
  else for (; a < n; ++a) s[a] = e[a];
@@ -1865,43 +1865,43 @@ var CRC32 = /* @__PURE__ */ (function() {
1865
1865
  }
1866
1866
  return e.length = i, e;
1867
1867
  }
1868
- function X(e) {
1868
+ function Y(e) {
1869
1869
  for (var t = Array(e), n = 0; n < e; ++n) t[n] = 0;
1870
1870
  return t;
1871
1871
  }
1872
- function og(e, t, n) {
1873
- var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = J ? new Uint16Array(32) : X(32);
1872
+ function X(e, t, n) {
1873
+ var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = K ? new Uint16Array(32) : Y(32);
1874
1874
  for (o = 0; o < 32; ++o) u[o] = 0;
1875
1875
  for (o = l; o < n; ++o) e[o] = 0;
1876
1876
  l = e.length;
1877
- var d = J ? new Uint16Array(l) : X(l);
1877
+ var d = K ? new Uint16Array(l) : Y(l);
1878
1878
  for (o = 0; o < l; ++o) u[a = e[o]]++, i < a && (i = a), d[o] = 0;
1879
1879
  for (u[0] = 0, o = 1; o <= i; ++o) u[o + 16] = c = c + u[o - 1] << 1;
1880
1880
  for (o = 0; o < l; ++o) c = e[o], c != 0 && (d[o] = u[c + 16]++);
1881
1881
  var f = 0;
1882
- for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Jh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
1882
+ for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Uh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
1883
1883
  return i;
1884
1884
  }
1885
- var sg = J ? new Uint16Array(512) : X(512), cg = J ? new Uint16Array(32) : X(32);
1886
- if (!J) {
1887
- for (var Z = 0; Z < 512; ++Z) sg[Z] = 0;
1888
- for (Z = 0; Z < 32; ++Z) cg[Z] = 0;
1885
+ var tg = K ? new Uint16Array(512) : Y(512), ng = K ? new Uint16Array(32) : Y(32);
1886
+ if (!K) {
1887
+ for (var Z = 0; Z < 512; ++Z) tg[Z] = 0;
1888
+ for (Z = 0; Z < 32; ++Z) ng[Z] = 0;
1889
1889
  }
1890
1890
  (function() {
1891
1891
  for (var e = [], t = 0; t < 32; t++) e.push(5);
1892
- og(e, cg, 32);
1892
+ X(e, ng, 32);
1893
1893
  var n = [];
1894
1894
  for (t = 0; t <= 143; t++) n.push(8);
1895
1895
  for (; t <= 255; t++) n.push(9);
1896
1896
  for (; t <= 279; t++) n.push(7);
1897
1897
  for (; t <= 287; t++) n.push(8);
1898
- og(n, sg, 288);
1898
+ X(n, tg, 288);
1899
1899
  })();
1900
- var lg = /* @__PURE__ */ (function() {
1901
- for (var e = J ? new Uint8Array(32768) : [], t = 0, n = 0; t < Kh.length - 1; ++t) for (; n < Kh[t + 1]; ++n) e[n] = t;
1900
+ var rg = /* @__PURE__ */ (function() {
1901
+ for (var e = K ? new Uint8Array(32768) : [], t = 0, n = 0; t < Hh.length - 1; ++t) for (; n < Hh[t + 1]; ++n) e[n] = t;
1902
1902
  for (; n < 32768; ++n) e[n] = 29;
1903
- var i = J ? new Uint8Array(259) : [];
1904
- for (t = 0, n = 0; t < K.length - 1; ++t) for (; n < K[t + 1]; ++n) i[n] = t;
1903
+ var i = K ? new Uint8Array(259) : [];
1904
+ for (t = 0, n = 0; t < W.length - 1; ++t) for (; n < W[t + 1]; ++n) i[n] = t;
1905
1905
  function a(e, t) {
1906
1906
  for (var n = 0; n < e.length;) {
1907
1907
  var i = Math.min(65535, e.length - n), a = n + i == e.length;
@@ -1910,30 +1910,30 @@ var CRC32 = /* @__PURE__ */ (function() {
1910
1910
  return t.l;
1911
1911
  }
1912
1912
  function o(t, n) {
1913
- for (var a = 0, o = 0, s = J ? new Uint16Array(32768) : []; o < t.length;) {
1913
+ for (var a = 0, o = 0, s = K ? new Uint16Array(32768) : []; o < t.length;) {
1914
1914
  var c = Math.min(65535, t.length - o);
1915
1915
  if (c < 10) {
1916
- for (a = tg(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
1916
+ for (a = Xh(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
1917
1917
  a = n.l * 8;
1918
1918
  continue;
1919
1919
  }
1920
- a = tg(n, a, +(o + c == t.length) + 2);
1920
+ a = Xh(n, a, +(o + c == t.length) + 2);
1921
1921
  for (var l = 0; c-- > 0;) {
1922
1922
  var u = t[o];
1923
1923
  l = (l << 5 ^ u) & 32767;
1924
1924
  var d = -1, f = 0;
1925
1925
  if ((d = s[l]) && (d |= o & -32768, d > o && (d -= 32768), d < o)) for (; t[d + f] == t[o + f] && f < 250;) ++f;
1926
1926
  if (f > 2) {
1927
- u = i[f], u <= 22 ? a = rg(n, a, Y[u + 1] >> 1) - 1 : (rg(n, a, 3), a += 5, rg(n, a, Y[u - 23] >> 5), a += 3);
1927
+ u = i[f], u <= 22 ? a = Qh(n, a, q[u + 1] >> 1) - 1 : (Qh(n, a, 3), a += 5, Qh(n, a, q[u - 23] >> 5), a += 3);
1928
1928
  var p = u < 8 ? 0 : u - 4 >> 2;
1929
- p > 0 && (ig(n, a, f - K[u]), a += p), u = e[o - d], a = rg(n, a, Y[u] >> 3), a -= 3;
1929
+ p > 0 && ($h(n, a, f - W[u]), a += p), u = e[o - d], a = Qh(n, a, q[u] >> 3), a -= 3;
1930
1930
  var m = u < 4 ? 0 : u - 2 >> 1;
1931
- m > 0 && (ig(n, a, o - d - Kh[u]), a += m);
1931
+ m > 0 && ($h(n, a, o - d - Hh[u]), a += m);
1932
1932
  for (var h = 0; h < f; ++h) s[l] = o & 32767, l = (l << 5 ^ t[o]) & 32767, ++o;
1933
1933
  c -= f - 1;
1934
- } else u <= 143 ? u += 48 : a = ng(n, a, 1), a = rg(n, a, Y[u]), s[l] = o & 32767, ++o;
1934
+ } else u <= 143 ? u += 48 : a = Zh(n, a, 1), a = Qh(n, a, q[u]), s[l] = o & 32767, ++o;
1935
1935
  }
1936
- a = rg(n, a, 0) - 1;
1936
+ a = Qh(n, a, 0) - 1;
1937
1937
  }
1938
1938
  return n.l = (a + 7) / 8 | 0, n.l;
1939
1939
  }
@@ -1941,19 +1941,19 @@ var CRC32 = /* @__PURE__ */ (function() {
1941
1941
  return e.length < 8 ? a(e, t) : o(e, t);
1942
1942
  };
1943
1943
  })();
1944
- function Q(e) {
1945
- var t = new_buf(50 + Math.floor(e.length * 1.1)), n = lg(e, t);
1944
+ function ig(e) {
1945
+ var t = new_buf(50 + Math.floor(e.length * 1.1)), n = rg(e, t);
1946
1946
  return t.slice(0, n);
1947
1947
  }
1948
- var ug = J ? new Uint16Array(32768) : X(32768), dg = J ? new Uint16Array(32768) : X(32768), fg = J ? new Uint16Array(128) : X(128), pg = 1, mg = 1;
1949
- function hg(e, t) {
1950
- var n = Qh(e, t) + 257;
1948
+ var ag = K ? new Uint16Array(32768) : Y(32768), og = K ? new Uint16Array(32768) : Y(32768), sg = K ? new Uint16Array(128) : Y(128), cg = 1, lg = 1;
1949
+ function ug(e, t) {
1950
+ var n = qh(e, t) + 257;
1951
1951
  t += 5;
1952
- var i = Qh(e, t) + 1;
1952
+ var i = qh(e, t) + 1;
1953
1953
  t += 5;
1954
- var a = Zh(e, t) + 4;
1954
+ var a = Kh(e, t) + 4;
1955
1955
  t += 4;
1956
- for (var o = 0, s = J ? new Uint8Array(19) : X(19), c = [
1956
+ for (var o = 0, s = K ? new Uint8Array(19) : Y(19), c = [
1957
1957
  0,
1958
1958
  0,
1959
1959
  0,
@@ -1973,25 +1973,25 @@ var CRC32 = /* @__PURE__ */ (function() {
1973
1973
  0,
1974
1974
  0,
1975
1975
  0
1976
- ], l = 1, u = J ? new Uint8Array(8) : X(8), d = J ? new Uint8Array(8) : X(8), f = s.length, p = 0; p < a; ++p) s[G[p]] = o = Xh(e, t), l < o && (l = o), u[o]++, t += 3;
1976
+ ], l = 1, u = K ? new Uint8Array(8) : Y(8), d = K ? new Uint8Array(8) : Y(8), f = s.length, p = 0; p < a; ++p) s[U[p]] = o = Gh(e, t), l < o && (l = o), u[o]++, t += 3;
1977
1977
  var m = 0;
1978
1978
  for (u[0] = 0, p = 1; p <= l; ++p) d[p] = m = m + u[p - 1] << 1;
1979
1979
  for (p = 0; p < f; ++p) (m = s[p]) != 0 && (c[p] = d[m]++);
1980
1980
  var h = 0;
1981
1981
  for (p = 0; p < f; ++p) if (h = s[p], h != 0) {
1982
- m = Y[c[p]] >> 8 - h;
1983
- for (var g = (1 << 7 - h) - 1; g >= 0; --g) fg[m | g << h] = h & 7 | p << 3;
1982
+ m = q[c[p]] >> 8 - h;
1983
+ for (var g = (1 << 7 - h) - 1; g >= 0; --g) sg[m | g << h] = h & 7 | p << 3;
1984
1984
  }
1985
1985
  var _ = [];
1986
- for (l = 1; _.length < n + i;) switch (m = fg[$h(e, t)], t += m & 7, m >>>= 3) {
1986
+ for (l = 1; _.length < n + i;) switch (m = sg[Jh(e, t)], t += m & 7, m >>>= 3) {
1987
1987
  case 16:
1988
- for (o = 3 + Yh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
1988
+ for (o = 3 + Wh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
1989
1989
  break;
1990
1990
  case 17:
1991
- for (o = 3 + Xh(e, t), t += 3; o-- > 0;) _.push(0);
1991
+ for (o = 3 + Gh(e, t), t += 3; o-- > 0;) _.push(0);
1992
1992
  break;
1993
1993
  case 18:
1994
- for (o = 11 + $h(e, t), t += 7; o-- > 0;) _.push(0);
1994
+ for (o = 11 + Jh(e, t), t += 7; o-- > 0;) _.push(0);
1995
1995
  break;
1996
1996
  default:
1997
1997
  _.push(m), l < m && (l = m);
@@ -2000,45 +2000,45 @@ var CRC32 = /* @__PURE__ */ (function() {
2000
2000
  var v = _.slice(0, n), y = _.slice(n);
2001
2001
  for (p = n; p < 286; ++p) v[p] = 0;
2002
2002
  for (p = i; p < 30; ++p) y[p] = 0;
2003
- return pg = og(v, ug, 286), mg = og(y, dg, 30), t;
2003
+ return cg = X(v, ag, 286), lg = X(y, og, 30), t;
2004
2004
  }
2005
- function gg(e, t) {
2005
+ function dg(e, t) {
2006
2006
  if (e[0] == 3 && !(e[1] & 3)) return [new_raw_buf(t), 2];
2007
2007
  for (var n = 0, i = 0, a = new_unsafe_buf(t || 1 << 18), o = 0, s = a.length >>> 0, c = 0, l = 0; !(i & 1);) {
2008
- if (i = Xh(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = hg(e, n), c = pg, l = mg);
2008
+ if (i = Gh(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = ug(e, n), c = cg, l = lg);
2009
2009
  else {
2010
2010
  n & 7 && (n += 8 - (n & 7));
2011
2011
  var u = e[n >>> 3] | e[(n >>> 3) + 1] << 8;
2012
- if (n += 32, u > 0) for (!t && s < o + u && (a = ag(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2012
+ if (n += 32, u > 0) for (!t && s < o + u && (a = eg(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2013
2013
  continue;
2014
2014
  }
2015
2015
  for (;;) {
2016
- !t && s < o + 32767 && (a = ag(a, o + 32767), s = a.length);
2017
- var d = eg(e, n, c), f = i >>> 1 == 1 ? sg[d] : ug[d];
2016
+ !t && s < o + 32767 && (a = eg(a, o + 32767), s = a.length);
2017
+ var d = Yh(e, n, c), f = i >>> 1 == 1 ? tg[d] : ag[d];
2018
2018
  if (n += f & 15, f >>>= 4, !(f >>> 8 & 255)) a[o++] = f;
2019
2019
  else if (f == 256) break;
2020
2020
  else {
2021
2021
  f -= 257;
2022
2022
  var p = f < 8 ? 0 : f - 4 >> 2;
2023
2023
  p > 5 && (p = 0);
2024
- var m = o + K[f];
2025
- p > 0 && (m += eg(e, n, p), n += p), d = eg(e, n, l), f = i >>> 1 == 1 ? cg[d] : dg[d], n += f & 15, f >>>= 4;
2026
- var h = f < 4 ? 0 : f - 2 >> 1, g = Kh[f];
2027
- for (h > 0 && (g += eg(e, n, h), n += h), !t && s < m && (a = ag(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2024
+ var m = o + W[f];
2025
+ p > 0 && (m += Yh(e, n, p), n += p), d = Yh(e, n, l), f = i >>> 1 == 1 ? ng[d] : og[d], n += f & 15, f >>>= 4;
2026
+ var h = f < 4 ? 0 : f - 2 >> 1, g = Hh[f];
2027
+ for (h > 0 && (g += Yh(e, n, h), n += h), !t && s < m && (a = eg(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2028
2028
  }
2029
2029
  }
2030
2030
  }
2031
2031
  return t ? [a, n + 7 >>> 3] : [a.slice(0, o), n + 7 >>> 3];
2032
2032
  }
2033
- function _g(e, t) {
2034
- var n = e.slice(e.l || 0), i = gg(n, t);
2033
+ function fg(e, t) {
2034
+ var n = e.slice(e.l || 0), i = dg(n, t);
2035
2035
  return e.l += i[1], i[0];
2036
2036
  }
2037
- function vg(e, t) {
2037
+ function Q(e, t) {
2038
2038
  if (e) typeof console < "u" && console.error(t);
2039
2039
  else throw Error(t);
2040
2040
  }
2041
- function yg(e, t) {
2041
+ function pg(e, t) {
2042
2042
  var n = e;
2043
2043
  prep_blob(n, 0);
2044
2044
  var i = {
@@ -2056,11 +2056,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2056
2056
  var p = n.read_shift(4), m = s(n.slice(n.l + u, n.l + u + d));
2057
2057
  n.l += u + d + f;
2058
2058
  var h = n.l;
2059
- n.l = p + 4, bg(n, c, l, i, m), n.l = h;
2059
+ n.l = p + 4, mg(n, c, l, i, m), n.l = h;
2060
2060
  }
2061
2061
  return i;
2062
2062
  }
2063
- function bg(e, t, n, i, a) {
2063
+ function mg(e, t, n, i, a) {
2064
2064
  e.l += 2;
2065
2065
  var c = e.read_shift(2), l = e.read_shift(2), u = o(e);
2066
2066
  if (c & 8257) throw Error("Unsupported ZIP encryption");
@@ -2073,25 +2073,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2073
2073
  var y = e.slice(e.l, e.l + f);
2074
2074
  switch (l) {
2075
2075
  case 8:
2076
- y = Wh(e, p);
2076
+ y = Bh(e, p);
2077
2077
  break;
2078
2078
  case 0: break;
2079
2079
  default: throw Error("Unsupported ZIP Compression method " + l);
2080
2080
  }
2081
2081
  var b = !1;
2082
- c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && vg(b, "Bad compressed size: " + t + " != " + f), p != n && vg(b, "Bad uncompressed size: " + n + " != " + p), jg(i, g, y, {
2082
+ c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && Q(b, "Bad compressed size: " + t + " != " + f), p != n && Q(b, "Bad uncompressed size: " + n + " != " + p), Tg(i, g, y, {
2083
2083
  unsafe: !0,
2084
2084
  mt: u
2085
2085
  });
2086
2086
  }
2087
- function xg(e, t) {
2087
+ function hg(e, t) {
2088
2088
  var n = t || {}, i = [], o = [], s = new_buf(1), c = n.compression ? 8 : 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = e.FullPaths[0], h = m, g = e.FileIndex[0], _ = [], v = 0;
2089
2089
  for (u = 1; u < e.FullPaths.length; ++u) if (h = e.FullPaths[u].slice(m.length), g = e.FileIndex[u], !(!g.size || !g.content || h == "Sh33tJ5")) {
2090
2090
  var y = f, b = new_buf(h.length);
2091
2091
  for (d = 0; d < h.length; ++d) b.write_shift(1, h.charCodeAt(d) & 127);
2092
2092
  b = b.slice(0, b.l), _[p] = CRC32.buf(g.content, 0);
2093
2093
  var x = g.content;
2094
- c == 8 && (x = Gh(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
2094
+ c == 8 && (x = Vh(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
2095
2095
  }
2096
2096
  return s = new_buf(22), s.write_shift(4, 101010256), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, p), s.write_shift(2, p), s.write_shift(4, v), s.write_shift(4, f), s.write_shift(2, 0), bconcat([
2097
2097
  bconcat(i),
@@ -2099,7 +2099,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2099
2099
  s
2100
2100
  ]);
2101
2101
  }
2102
- var Sg = {
2102
+ var gg = {
2103
2103
  htm: "text/html",
2104
2104
  xml: "text/xml",
2105
2105
  gif: "image/gif",
@@ -2109,16 +2109,16 @@ var CRC32 = /* @__PURE__ */ (function() {
2109
2109
  thmx: "application/vnd.ms-officetheme",
2110
2110
  sh33tj5: "application/octet-stream"
2111
2111
  };
2112
- function Cg(e, t) {
2112
+ function _g(e, t) {
2113
2113
  if (e.ctype) return e.ctype;
2114
2114
  var n = e.name || "", i = n.match(/\.([^\.]+)$/);
2115
- return i && Sg[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && Sg[i[1]]) ? Sg[i[1]] : "application/octet-stream";
2115
+ return i && gg[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && gg[i[1]]) ? gg[i[1]] : "application/octet-stream";
2116
2116
  }
2117
- function wg(e) {
2117
+ function vg(e) {
2118
2118
  for (var t = Base64_encode(e), n = [], i = 0; i < t.length; i += 76) n.push(t.slice(i, i + 76));
2119
2119
  return n.join("\r\n") + "\r\n";
2120
2120
  }
2121
- function Tg(e) {
2121
+ function yg(e) {
2122
2122
  var t = e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(e) {
2123
2123
  var t = e.charCodeAt(0).toString(16).toUpperCase();
2124
2124
  return "=" + (t.length == 1 ? "0" + t : t);
@@ -2137,7 +2137,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2137
2137
  }
2138
2138
  return n.join("\r\n");
2139
2139
  }
2140
- function Eg(e) {
2140
+ function bg(e) {
2141
2141
  for (var t = [], n = 0; n < e.length; ++n) {
2142
2142
  for (var i = e[n]; n <= e.length && i.charAt(i.length - 1) == "=";) i = i.slice(0, i.length - 1) + e[++n];
2143
2143
  t.push(i);
@@ -2147,7 +2147,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2147
2147
  });
2148
2148
  return s2a(t.join("\r\n"));
2149
2149
  }
2150
- function Dg(e, t, n) {
2150
+ function xg(e, t, n) {
2151
2151
  for (var i = "", a = "", o = "", s, c = 0; c < 10; ++c) {
2152
2152
  var l = t[c];
2153
2153
  if (!l || l.match(/^\s*$/)) break;
@@ -2169,16 +2169,16 @@ var CRC32 = /* @__PURE__ */ (function() {
2169
2169
  s = s2a(Base64_decode(t.slice(c).join("")));
2170
2170
  break;
2171
2171
  case "quoted-printable":
2172
- s = Eg(t.slice(c));
2172
+ s = bg(t.slice(c));
2173
2173
  break;
2174
2174
  default: throw Error("Unsupported Content-Transfer-Encoding " + a);
2175
2175
  }
2176
- var d = jg(e, i.slice(n.length), s, { unsafe: !0 });
2176
+ var d = Tg(e, i.slice(n.length), s, { unsafe: !0 });
2177
2177
  o && (d.ctype = o);
2178
2178
  }
2179
- function Og(e, t) {
2180
- if (H(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
2181
- var n = t && t.root || "", i = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : H(e)).split("\r\n"), a = 0, o = "";
2179
+ function Sg(e, t) {
2180
+ if (V(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
2181
+ var n = t && t.root || "", i = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : V(e)).split("\r\n"), a = 0, o = "";
2182
2182
  for (a = 0; a < i.length; ++a) if (o = i[a], /^Content-Location:/i.test(o) && (o = o.slice(o.indexOf("file")), n ||= o.slice(0, o.lastIndexOf("/") + 1), o.slice(0, n.length) != n)) for (; n.length > 0 && (n = n.slice(0, n.length - 1), n = n.slice(0, n.lastIndexOf("/") + 1), o.slice(0, n.length) != n););
2183
2183
  var s = (i[1] || "").match(/boundary="(.*?)"/);
2184
2184
  if (!s) throw Error("MAD cannot find boundary");
@@ -2190,11 +2190,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2190
2190
  var u, d = 0;
2191
2191
  for (a = 0; a < i.length; ++a) {
2192
2192
  var f = i[a];
2193
- f !== c && f !== c + "--" || (d++ && Dg(l, i.slice(u, a), n), u = a);
2193
+ f !== c && f !== c + "--" || (d++ && xg(l, i.slice(u, a), n), u = a);
2194
2194
  }
2195
2195
  return l;
2196
2196
  }
2197
- function kg(e, t) {
2197
+ function Cg(e, t) {
2198
2198
  var n = t || {}, i = n.boundary || "SheetJS";
2199
2199
  i = "------=" + i;
2200
2200
  for (var a = [
@@ -2209,17 +2209,17 @@ var CRC32 = /* @__PURE__ */ (function() {
2209
2209
  }).replace(/[\u0080-\uFFFF]/g, function(e) {
2210
2210
  return "_u" + e.charCodeAt(0).toString(16) + "_";
2211
2211
  });
2212
- for (var u = c.content, d = has_buf && Buffer.isBuffer(u) ? u.toString("binary") : H(u), f = 0, p = Math.min(1024, d.length), m = 0, h = 0; h <= p; ++h) (m = d.charCodeAt(h)) >= 32 && m < 128 && ++f;
2212
+ for (var u = c.content, d = has_buf && Buffer.isBuffer(u) ? u.toString("binary") : V(u), f = 0, p = Math.min(1024, d.length), m = 0, h = 0; h <= p; ++h) (m = d.charCodeAt(h)) >= 32 && m < 128 && ++f;
2213
2213
  var g = f >= p * 4 / 5;
2214
- a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + Cg(c, s)), a.push(""), a.push(g ? Tg(d) : wg(d));
2214
+ a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + _g(c, s)), a.push(""), a.push(g ? yg(d) : vg(d));
2215
2215
  }
2216
2216
  return a.push(i + "--\r\n"), a.join("\r\n");
2217
2217
  }
2218
- function Ag(e) {
2218
+ function wg(e) {
2219
2219
  var t = {};
2220
2220
  return C(t, e), t;
2221
2221
  }
2222
- function jg(e, t, n, a) {
2222
+ function Tg(e, t, n, a) {
2223
2223
  var o = a && a.unsafe;
2224
2224
  o || C(e);
2225
2225
  var s = !o && CFB.find(e, t);
@@ -2232,7 +2232,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2232
2232
  }
2233
2233
  return s.content = n, s.size = n ? n.length : 0, a && (a.CLSID && (s.clsid = a.CLSID), a.mt && (s.mt = a.mt), a.ct && (s.ct = a.ct)), s;
2234
2234
  }
2235
- function Mg(e, t) {
2235
+ function Eg(e, t) {
2236
2236
  C(e);
2237
2237
  var n = CFB.find(e, t);
2238
2238
  if (n) {
@@ -2240,7 +2240,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2240
2240
  }
2241
2241
  return !1;
2242
2242
  }
2243
- function Ng(e, t, n) {
2243
+ function Dg(e, t, n) {
2244
2244
  C(e);
2245
2245
  var a = CFB.find(e, t);
2246
2246
  if (a) {
@@ -2248,22 +2248,22 @@ var CRC32 = /* @__PURE__ */ (function() {
2248
2248
  }
2249
2249
  return !1;
2250
2250
  }
2251
- function Pg(e) {
2251
+ function Og(e) {
2252
2252
  T(e, !0);
2253
2253
  }
2254
- return e.find = D, e.read = S, e.parse = u, e.write = U, e.writeFile = V, e.utils = {
2255
- cfb_new: Ag,
2256
- cfb_add: jg,
2257
- cfb_del: Mg,
2258
- cfb_mov: Ng,
2259
- cfb_gc: Pg,
2254
+ return e.find = D, e.read = S, e.parse = u, e.write = Ih, e.writeFile = Ph, e.utils = {
2255
+ cfb_new: wg,
2256
+ cfb_add: Tg,
2257
+ cfb_del: Eg,
2258
+ cfb_mov: Dg,
2259
+ cfb_gc: Og,
2260
2260
  ReadShift,
2261
2261
  CheckField,
2262
2262
  prep_blob,
2263
2263
  bconcat,
2264
- use_zlib: Uh,
2265
- _deflateRaw: Q,
2266
- _inflateRaw: _g,
2264
+ use_zlib: zh,
2265
+ _deflateRaw: ig,
2266
+ _inflateRaw: fg,
2267
2267
  consts: B
2268
2268
  }, e;
2269
2269
  })(), _fs = void 0;
@@ -5395,7 +5395,7 @@ var DBF = /* @__PURE__ */ (function() {
5395
5395
  function e(e, t, n) {
5396
5396
  if (e) {
5397
5397
  prep_blob(e, e.l || 0);
5398
- for (var i = n.Enum || V; e.l < e.length;) {
5398
+ for (var i = n.Enum || Ph; e.l < e.length;) {
5399
5399
  var a = e.read_shift(2), o = i[a] || i[65535], s = e.read_shift(2), c = e.l + s, l = o.f && o.f(e, s, n);
5400
5400
  if (e.l = c, t(l, o, a)) return;
5401
5401
  }
@@ -5425,7 +5425,7 @@ var DBF = /* @__PURE__ */ (function() {
5425
5425
  }
5426
5426
  }, p = i.sheetRows || 0;
5427
5427
  if (t[2] == 0 && (t[3] == 8 || t[3] == 9) && t.length >= 16 && t[14] == 5 && t[15] === 108) throw Error("Unsupported Works 3 for Mac file");
5428
- if (t[2] == 2) i.Enum = V, e(t, function(e, t, n) {
5428
+ if (t[2] == 2) i.Enum = Ph, e(t, function(e, t, n) {
5429
5429
  switch (n) {
5430
5430
  case 0:
5431
5431
  i.vers = e, e >= 4096 && (i.qpro = !0);
@@ -5464,7 +5464,7 @@ var DBF = /* @__PURE__ */ (function() {
5464
5464
  default:
5465
5465
  }
5466
5466
  }, i);
5467
- else if (t[2] == 26 || t[2] == 14) i.Enum = H, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5467
+ else if (t[2] == 26 || t[2] == 14) i.Enum = V, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5468
5468
  switch (n) {
5469
5469
  case 204:
5470
5470
  o = e;
@@ -5839,7 +5839,7 @@ var DBF = /* @__PURE__ */ (function() {
5839
5839
  }
5840
5840
  return n[n.l++] = 0, n;
5841
5841
  }
5842
- var V = {
5842
+ var Ph = {
5843
5843
  0: {
5844
5844
  n: "BOF",
5845
5845
  f: parseuint16
@@ -5931,7 +5931,7 @@ var DBF = /* @__PURE__ */ (function() {
5931
5931
  f: I
5932
5932
  },
5933
5933
  65535: { n: "" }
5934
- }, H = {
5934
+ }, V = {
5935
5935
  0: { n: "BOF" },
5936
5936
  1: { n: "EOF" },
5937
5937
  2: { n: "PASSWORD" },
@@ -12797,15 +12797,15 @@ var buildThemePalette$1 = (e) => {
12797
12797
  l && a === "right" && !s && l
12798
12798
  ] })]
12799
12799
  });
12800
- }, TableBody_default = React.memo(({ loading: e, paginatedData: t, displayColumns: n, getColumnWidth: i, pinnedColumns: a, stickyActionsColumn: o, rowKey: s, editingRowId: c, enableInlineEditing: l, editValues: u, validationErrors: d, handleInputChange: m, labels: h }) => /* @__PURE__ */ jsx("tbody", { children: e ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
12800
+ }, TableBody_default = React.memo(({ loading: e, paginatedData: n, displayColumns: i, getColumnWidth: a, pinnedColumns: o, stickyActionsColumn: s, rowKey: c, editingRowId: l, enableInlineEditing: u, editValues: d, validationErrors: m, handleInputChange: h, labels: g, expandedRowIds: _, renderSubComponent: v }) => /* @__PURE__ */ jsx("tbody", { children: e ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
12801
12801
  className: "border-b border-solid border-gray-100",
12802
- children: n.map((e, t) => {
12803
- let s = i(e), c = a.includes(e.id), l = e.isAction && o, u = 0;
12804
- if (c) for (let e = 0; e < t; e++) a.includes(n[e].id) && (u += i(n[e]));
12802
+ children: i.map((e, t) => {
12803
+ let n = a(e), c = o.includes(e.id), l = e.isAction && s, u = 0;
12804
+ if (c) for (let e = 0; e < t; e++) o.includes(i[e].id) && (u += a(i[e]));
12805
12805
  let d = {
12806
- width: s,
12807
- minWidth: s,
12808
- maxWidth: s,
12806
+ width: n,
12807
+ minWidth: n,
12808
+ maxWidth: n,
12809
12809
  ...l ? {
12810
12810
  position: "sticky",
12811
12811
  right: 0,
@@ -12824,86 +12824,96 @@ var buildThemePalette$1 = (e) => {
12824
12824
  children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" })
12825
12825
  }, `skeleton-cell-${t}`);
12826
12826
  })
12827
- }, `skeleton-${t}`)) : t.length > 0 ? t.map((e, t) => /* @__PURE__ */ jsx("tr", {
12828
- className: "group even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
12829
- children: n.map((h, g) => {
12830
- let _ = typeof h.accessor == "function" ? h.accessor(e) : e[h.accessor], v = h.isAction, y = i(h), b = a.includes(h.id), x = v && o, S = 0;
12831
- if (b) for (let e = 0; e < g; e++) a.includes(n[e].id) && (S += i(n[e]));
12832
- let C = `py-2 px-3 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 table-cell last:border-r-0 first:font-medium
12827
+ }, `skeleton-${t}`)) : n.length > 0 ? n.map((e, n) => {
12828
+ let g = typeof c == "function" ? c(e) : e[c], y = _.includes(g);
12829
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("tr", {
12830
+ className: "group even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
12831
+ children: i.map((t, c) => {
12832
+ let _ = typeof t.accessor == "function" ? t.accessor(e) : e[t.accessor], v = t.isAction, y = a(t), b = o.includes(t.id), x = v && s, S = 0;
12833
+ if (b) for (let e = 0; e < c; e++) o.includes(i[e].id) && (S += a(i[e]));
12834
+ let C = `py-2 px-3 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 table-cell last:border-r-0 first:font-medium
12833
12835
  ${x ? "" : "static"}
12834
12836
  ${v ? "border-l border-gray-300" : ""}
12835
12837
  ${b && !x ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12836
12838
  ${x ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12837
12839
  ${x ? "group-hover:bg-gray-100" : ""}
12838
12840
  `, w = {
12839
- width: y,
12840
- minWidth: y,
12841
- maxWidth: y,
12842
- overflowWrap: "break-word",
12843
- ...x ? {
12844
- position: "sticky",
12845
- right: 0,
12846
- zIndex: 15,
12847
- backgroundColor: t % 2 == 0 ? "#ffffff" : "#f9fafb"
12848
- } : b ? {
12849
- position: "sticky",
12850
- left: S,
12851
- zIndex: 10,
12852
- backgroundColor: "inherit"
12853
- } : {}
12854
- }, T = c === (typeof s == "function" ? s(e) : e[s]);
12855
- if (l && T && h.editable) {
12856
- let e = u[h.id] ?? _, t = d[h.id];
12857
- return /* @__PURE__ */ jsx("td", {
12858
- className: `${C} p-1`,
12841
+ width: y,
12842
+ minWidth: y,
12843
+ maxWidth: y,
12844
+ overflowWrap: "break-word",
12845
+ ...x ? {
12846
+ position: "sticky",
12847
+ right: 0,
12848
+ zIndex: 15,
12849
+ backgroundColor: n % 2 == 0 ? "#ffffff" : "#f9fafb"
12850
+ } : b ? {
12851
+ position: "sticky",
12852
+ left: S,
12853
+ zIndex: 10,
12854
+ backgroundColor: "inherit"
12855
+ } : {}
12856
+ };
12857
+ if (u && l === g && t.editable) {
12858
+ let e = d[t.id] ?? _, n = m[t.id];
12859
+ return /* @__PURE__ */ jsx("td", {
12860
+ className: `${C} p-1`,
12861
+ style: w,
12862
+ children: /* @__PURE__ */ jsxs("div", {
12863
+ className: "flex flex-col",
12864
+ children: [t.inputType === "select" ? /* @__PURE__ */ jsxs("select", {
12865
+ className: `w-full border ${n ? "border-red-500" : "border-gray-300"} rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-redi-primary`,
12866
+ value: e,
12867
+ onChange: (e) => h(t.id, e.target.value),
12868
+ onClick: (e) => e.stopPropagation(),
12869
+ children: [/* @__PURE__ */ jsx("option", {
12870
+ value: "",
12871
+ children: "Select..."
12872
+ }), t.options?.map((e) => /* @__PURE__ */ jsx("option", {
12873
+ value: e.value,
12874
+ children: e.label
12875
+ }, e.value))]
12876
+ }) : /* @__PURE__ */ jsx("input", {
12877
+ type: t.inputType || "text",
12878
+ className: `w-full border ${n ? "border-red-500" : "border-gray-300"} rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-redi-primary`,
12879
+ value: e,
12880
+ onChange: (e) => h(t.id, e.target.value),
12881
+ onClick: (e) => e.stopPropagation()
12882
+ }), n && /* @__PURE__ */ jsx("span", {
12883
+ className: "text-xs text-red-500 mt-1",
12884
+ children: n
12885
+ })]
12886
+ })
12887
+ }, t.id);
12888
+ }
12889
+ return t.render ? /* @__PURE__ */ jsx("td", {
12890
+ className: C,
12859
12891
  style: w,
12860
- children: /* @__PURE__ */ jsxs("div", {
12861
- className: "flex flex-col",
12862
- children: [h.inputType === "select" ? /* @__PURE__ */ jsxs("select", {
12863
- className: `w-full border ${t ? "border-red-500" : "border-gray-300"} rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-redi-primary`,
12864
- value: e,
12865
- onChange: (e) => m(h.id, e.target.value),
12866
- onClick: (e) => e.stopPropagation(),
12867
- children: [/* @__PURE__ */ jsx("option", {
12868
- value: "",
12869
- children: "Select..."
12870
- }), h.options?.map((e) => /* @__PURE__ */ jsx("option", {
12871
- value: e.value,
12872
- children: e.label
12873
- }, e.value))]
12874
- }) : /* @__PURE__ */ jsx("input", {
12875
- type: h.inputType || "text",
12876
- className: `w-full border ${t ? "border-red-500" : "border-gray-300"} rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-redi-primary`,
12877
- value: e,
12878
- onChange: (e) => m(h.id, e.target.value),
12879
- onClick: (e) => e.stopPropagation()
12880
- }), t && /* @__PURE__ */ jsx("span", {
12881
- className: "text-xs text-red-500 mt-1",
12882
- children: t
12883
- })]
12884
- })
12885
- }, h.id);
12886
- }
12887
- return h.render ? /* @__PURE__ */ jsx("td", {
12888
- className: C,
12889
- style: w,
12890
- children: /* @__PURE__ */ jsx("div", {
12891
- style: { width: "100%" },
12892
- children: h.render({
12893
- value: _,
12894
- row: e,
12895
- column: h,
12896
- index: t
12892
+ children: /* @__PURE__ */ jsx("div", {
12893
+ style: { width: "100%" },
12894
+ children: t.render({
12895
+ value: _,
12896
+ row: e,
12897
+ column: t,
12898
+ index: n
12899
+ })
12897
12900
  })
12898
- })
12899
- }, h.id) : /* @__PURE__ */ jsx("td", {
12900
- className: C,
12901
- style: w,
12902
- children: formatCellValue(_)
12903
- }, h.id);
12904
- })
12905
- }, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
12906
- colSpan: n.length,
12901
+ }, t.id) : /* @__PURE__ */ jsx("td", {
12902
+ className: C,
12903
+ style: w,
12904
+ children: formatCellValue(_)
12905
+ }, t.id);
12906
+ })
12907
+ }), y && v && /* @__PURE__ */ jsx("tr", {
12908
+ className: "bg-gray-50 border-b border-solid border-b-gray-100",
12909
+ children: /* @__PURE__ */ jsx("td", {
12910
+ colSpan: i.length,
12911
+ className: "p-4 border-r border-solid border-gray-300 last:border-r-0",
12912
+ children: v(e)
12913
+ })
12914
+ })] }, g);
12915
+ }) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
12916
+ colSpan: i.length,
12907
12917
  className: "py-12 text-center text-gray-500",
12908
12918
  children: /* @__PURE__ */ jsxs("div", {
12909
12919
  className: "flex flex-col items-center justify-center gap-2",
@@ -12920,7 +12930,7 @@ var buildThemePalette$1 = (e) => {
12920
12930
  })
12921
12931
  }), /* @__PURE__ */ jsx("span", {
12922
12932
  className: "text-sm font-medium",
12923
- children: h.noData
12933
+ children: g.noData
12924
12934
  })]
12925
12935
  })
12926
12936
  }) }) }));
@@ -13149,11 +13159,11 @@ var AdvancedTable_module_default = {
13149
13159
  }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
13150
13160
  }, B = (e, t) => {
13151
13161
  k(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13152
- }, V = (e, t) => {
13162
+ }, Ph = (e, t) => {
13153
13163
  e.preventDefault(), e.dataTransfer.dropEffect = "move", j(t);
13154
- }, H = () => {
13164
+ }, V = () => {
13155
13165
  j(null);
13156
- }, Bh = (t, n) => {
13166
+ }, Fh = (t, n) => {
13157
13167
  if (t.preventDefault(), O === null) return;
13158
13168
  let i = e[O].id, a = e[n].id;
13159
13169
  if (i === a) {
@@ -13162,9 +13172,9 @@ var AdvancedTable_module_default = {
13162
13172
  }
13163
13173
  let o = t.currentTarget.getBoundingClientRect(), s = t.clientX - o.left > o.width / 2, l = [...D], u = l.indexOf(i), d = l.indexOf(a);
13164
13174
  u === -1 || d === -1 || (l.splice(u, 1), d = l.indexOf(a), s ? l.splice(d + 1, 0, i) : l.splice(d, 0, i), c(l), k(null), j(null));
13165
- }, U = () => {
13175
+ }, Ih = () => {
13166
13176
  k(null), j(null);
13167
- }, Vh = useCallback(async (e) => {
13177
+ }, Lh = useCallback(async (e) => {
13168
13178
  let t = C.find((t) => t.id === e);
13169
13179
  if (t?.fetchColumn && !P[e]) {
13170
13180
  L((t) => ({
@@ -13186,10 +13196,10 @@ var AdvancedTable_module_default = {
13186
13196
  }));
13187
13197
  }
13188
13198
  }
13189
- }, [C, P]), Hh = (e) => {
13199
+ }, [C, P]), Rh = (e) => {
13190
13200
  let t = M !== e;
13191
- N(t ? e : null), t && Vh(e);
13192
- }, W = useCallback((e) => {
13201
+ N(t ? e : null), t && Lh(e);
13202
+ }, H = useCallback((e) => {
13193
13203
  let t = C.find((t) => t.id === e);
13194
13204
  if (!t) return [];
13195
13205
  if (t.fetchColumn && P[e]) return P[e];
@@ -13275,10 +13285,10 @@ var AdvancedTable_module_default = {
13275
13285
  style: C,
13276
13286
  draggable: !a.isAction && o && (a.draggable ?? !1),
13277
13287
  onDragStart: (e) => !a.isAction && o && (a.draggable ?? !1) && B(e, s),
13278
- onDragOver: (e) => !a.isAction && o && V(e, s),
13279
- onDragLeave: H,
13280
- onDrop: (e) => !a.isAction && o && Bh(e, s),
13281
- onDragEnd: U,
13288
+ onDragOver: (e) => !a.isAction && o && Ph(e, s),
13289
+ onDragLeave: V,
13290
+ onDrop: (e) => !a.isAction && o && Fh(e, s),
13291
+ onDragEnd: Ih,
13282
13292
  "aria-sort": d?.column === a.id ? d.direction === "asc" ? "ascending" : "descending" : "none",
13283
13293
  children: /* @__PURE__ */ jsxs("div", {
13284
13294
  className: "flex items-center py-2 px-3 gap-2 min-h-10",
@@ -13323,14 +13333,14 @@ var AdvancedTable_module_default = {
13323
13333
  children: [/* @__PURE__ */ jsx(Button_default, {
13324
13334
  level: "icon",
13325
13335
  onClick: (e) => {
13326
- e.stopPropagation(), Hh(a.id);
13336
+ e.stopPropagation(), Rh(a.id);
13327
13337
  },
13328
13338
  "aria-label": `Filter by ${a.label}`,
13329
13339
  children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13330
13340
  }), M === a.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13331
13341
  columnId: a.id,
13332
13342
  label: a.label,
13333
- options: W(a.id),
13343
+ options: H(a.id),
13334
13344
  textValue: g[a.id]?.type === "text" ? String(g[a.id].value || "") : "",
13335
13345
  selectedValues: g[a.id]?.value ? Array.isArray(g[a.id].value) ? g[a.id].value : [String(g[a.id].value)] : [],
13336
13346
  onTextChange: (e) => _(a.id, e, "text"),
@@ -13932,23 +13942,23 @@ const useAdvancedTable = (e) => {
13932
13942
  values: {},
13933
13943
  errors: {},
13934
13944
  isSaving: !1
13935
- }), [B, V] = useState([]), [H, Bh] = useState(0), [U, Vh] = useState(0), [Hh, W] = useState(!1), [Uh, Wh] = useState(0);
13945
+ }), [B, Ph] = useState([]), [V, Fh] = useState(0), [Ih, Lh] = useState(0), [Rh, H] = useState(!1), [zh, Bh] = useState(0);
13936
13946
  useColumnSync(n, {
13937
13947
  setColumnOrder: D,
13938
13948
  setHiddenColumns: k,
13939
13949
  setPinnedColumns: j
13940
13950
  });
13941
- let Gh = useMemo(() => {
13951
+ let Vh = useMemo(() => {
13942
13952
  let e = /* @__PURE__ */ new Map();
13943
13953
  return Object.entries(w).forEach(([t, n]) => {
13944
13954
  n.value && (n.type === "text" || n.type === "select" || n.type === "multiselect" && Array.isArray(n.value) && n.value.length > 0) && e.set(t, n);
13945
13955
  }), e;
13946
- }, [w]), G = useMemo(() => {
13956
+ }, [w]), U = useMemo(() => {
13947
13957
  let e = [];
13948
- if (e = _ ? [...B] : [...t], Gh.size === 0) return e;
13958
+ if (e = _ ? [...B] : [...t], Vh.size === 0) return e;
13949
13959
  let i = /* @__PURE__ */ new Map();
13950
13960
  return n.forEach((e) => i.set(e.id, e)), e.filter((e) => {
13951
- for (let [t, n] of Gh) {
13961
+ for (let [t, n] of Vh) {
13952
13962
  let a = i.get(t);
13953
13963
  if (!a || _ && a.shouldBeRefetch) continue;
13954
13964
  let o = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], s = String(o || "").toLowerCase(), c = !0;
@@ -13958,22 +13968,22 @@ const useAdvancedTable = (e) => {
13958
13968
  });
13959
13969
  }, [
13960
13970
  t,
13961
- Gh,
13971
+ Vh,
13962
13972
  n,
13963
13973
  _,
13964
13974
  B
13965
- ]), K = _ ? H : G.length, Kh = _ ? U : t.length, q = useMemo(() => ({
13975
+ ]), W = _ ? V : U.length, Hh = _ ? Ih : t.length, G = useMemo(() => ({
13966
13976
  page: I.page,
13967
13977
  pageSize: I.pageSize,
13968
- total: K
13978
+ total: W
13969
13979
  }), [
13970
13980
  I.page,
13971
13981
  I.pageSize,
13972
- K
13973
- ]), J = useMemo(() => {
13974
- if (_ || !S) return G;
13982
+ W
13983
+ ]), K = useMemo(() => {
13984
+ if (_ || !S) return U;
13975
13985
  let e = n.find((e) => e.id === S.column);
13976
- return e ? [...G].sort((t, n) => {
13986
+ return e ? [...U].sort((t, n) => {
13977
13987
  let i = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], a = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
13978
13988
  if (i == null) return 1;
13979
13989
  if (a == null) return -1;
@@ -13986,99 +13996,99 @@ const useAdvancedTable = (e) => {
13986
13996
  o = e.localeCompare(t);
13987
13997
  }
13988
13998
  return S.direction === "desc" ? o * -1 : o;
13989
- }) : G;
13999
+ }) : U;
13990
14000
  }, [
13991
- G,
14001
+ U,
13992
14002
  S,
13993
14003
  n,
13994
14004
  _
13995
- ]), Y = useMemo(() => {
13996
- if (_ || !x) return J;
13997
- let e = (q.page - 1) * q.pageSize, t = e + q.pageSize;
13998
- return J.slice(e, t);
14005
+ ]), q = useMemo(() => {
14006
+ if (_ || !x) return K;
14007
+ let e = (G.page - 1) * G.pageSize, t = e + G.pageSize;
14008
+ return K.slice(e, t);
13999
14009
  }, [
14000
- J,
14001
- q.page,
14002
- q.pageSize,
14010
+ K,
14011
+ G.page,
14012
+ G.pageSize,
14003
14013
  _,
14004
14014
  x
14005
- ]), qh = useCallback(async () => {
14015
+ ]), J = useCallback(async () => {
14006
14016
  if (_) {
14007
- W(!0);
14017
+ H(!0);
14008
14018
  try {
14009
14019
  let e = {
14010
- page_number: q.page,
14011
- page_size: q.pageSize
14020
+ page_number: G.page,
14021
+ page_size: G.pageSize
14012
14022
  };
14013
14023
  S && (e.order_by = `${S.direction === "desc" ? "-" : ""}${S.column}`), Object.entries(w).forEach(([t, i]) => {
14014
14024
  i.value && n.find((e) => e.id === t)?.shouldBeRefetch && (e[t] = i.value);
14015
14025
  });
14016
14026
  let t = await _(e);
14017
- V(t.items), Bh(t.total_items), t.total_unfiltered_items === void 0 ? Object.entries(w).some(([e, t]) => n.find((t) => t.id === e)?.shouldBeRefetch && t.value && (Array.isArray(t.value) ? t.value.length > 0 : !0)) || Vh(t.total_items) : Vh(t.total_unfiltered_items);
14027
+ Ph(t.items), Fh(t.total_items), t.total_unfiltered_items === void 0 ? Object.entries(w).some(([e, t]) => n.find((t) => t.id === e)?.shouldBeRefetch && t.value && (Array.isArray(t.value) ? t.value.length > 0 : !0)) || Lh(t.total_items) : Lh(t.total_unfiltered_items);
14018
14028
  } catch (e) {
14019
14029
  console.error("Failed to fetch data:", e);
14020
14030
  } finally {
14021
- W(!1);
14031
+ H(!1);
14022
14032
  }
14023
14033
  }
14024
14034
  }, [
14025
14035
  _,
14026
- q.page,
14027
- q.pageSize,
14036
+ G.page,
14037
+ G.pageSize,
14028
14038
  S,
14029
14039
  w,
14030
14040
  n
14031
- ]), Jh = useRef(!0), Yh = useRef(w), Xh = useRef(S), Zh = useRef(q.page), Qh = useRef(q.pageSize), $h = useRef(Uh);
14041
+ ]), Uh = useRef(!0), Wh = useRef(w), Gh = useRef(S), Kh = useRef(G.page), qh = useRef(G.pageSize), Jh = useRef(zh);
14032
14042
  useEffect(() => {
14033
14043
  if (_) {
14034
- let e = !1, t = !deepEqual(w, Yh.current), i = !deepEqual(S, Xh.current), a = q.page !== Zh.current || q.pageSize !== Qh.current;
14035
- if (Jh.current) e = !0, Jh.current = !1;
14036
- else if (Uh !== $h.current) e = !0, $h.current = Uh;
14044
+ let e = !1, t = !deepEqual(w, Wh.current), i = !deepEqual(S, Gh.current), a = G.page !== Kh.current || G.pageSize !== qh.current;
14045
+ if (Uh.current) e = !0, Uh.current = !1;
14046
+ else if (zh !== Jh.current) e = !0, Jh.current = zh;
14037
14047
  else if (t) {
14038
- let t = Object.keys(Yh.current), i = Object.keys(w), a = Array.from(new Set([...t, ...i]));
14039
- for (let t of a) if (!deepEqual(Yh.current[t], w[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
14048
+ let t = Object.keys(Wh.current), i = Object.keys(w), a = Array.from(new Set([...t, ...i]));
14049
+ for (let t of a) if (!deepEqual(Wh.current[t], w[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
14040
14050
  e = !0;
14041
14051
  break;
14042
14052
  }
14043
14053
  } else (a || i) && (e = !0);
14044
- Zh.current = q.page, Qh.current = q.pageSize, Xh.current = S, Yh.current = w, e && qh();
14054
+ Kh.current = G.page, qh.current = G.pageSize, Gh.current = S, Wh.current = w, e && J();
14045
14055
  }
14046
14056
  }, [
14047
- qh,
14048
- Uh,
14057
+ J,
14058
+ zh,
14049
14059
  _,
14050
- q.page,
14051
- q.pageSize,
14060
+ G.page,
14061
+ G.pageSize,
14052
14062
  S,
14053
14063
  w,
14054
14064
  n
14055
14065
  ]), useEffect(() => {
14056
14066
  if (!_) {
14057
- let e = Math.ceil(K / q.pageSize) || 1;
14058
- q.page > e && L((t) => ({
14067
+ let e = Math.ceil(W / G.pageSize) || 1;
14068
+ G.page > e && L((t) => ({
14059
14069
  ...t,
14060
14070
  page: e
14061
14071
  }));
14062
14072
  }
14063
14073
  }, [
14064
- K,
14065
- q.pageSize,
14074
+ W,
14075
+ G.pageSize,
14066
14076
  _,
14067
- q.page
14077
+ G.page
14068
14078
  ]), useDebouncedCallback(() => {
14069
14079
  m?.({
14070
14080
  columns: n,
14071
14081
  sort: S,
14072
14082
  filters: w,
14073
- pagination: q,
14083
+ pagination: G,
14074
14084
  columnOrder: E,
14075
14085
  hiddenColumns: O,
14076
14086
  pinnedColumns: A
14077
- }), h?.(q), g?.(w);
14087
+ }), h?.(G), g?.(w);
14078
14088
  }, 100, [
14079
14089
  S,
14080
14090
  w,
14081
- q,
14091
+ G,
14082
14092
  E,
14083
14093
  O,
14084
14094
  A,
@@ -14103,7 +14113,7 @@ const useAdvancedTable = (e) => {
14103
14113
  n,
14104
14114
  _
14105
14115
  ]);
14106
- let eg = useCallback((e) => {
14116
+ let Yh = useCallback((e) => {
14107
14117
  C((t) => t?.column === e ? t.direction === "asc" ? {
14108
14118
  column: e,
14109
14119
  direction: "desc"
@@ -14111,7 +14121,7 @@ const useAdvancedTable = (e) => {
14111
14121
  column: e,
14112
14122
  direction: "asc"
14113
14123
  });
14114
- }, []), tg = useCallback((e, t, n = "text") => {
14124
+ }, []), Xh = useCallback((e, t, n = "text") => {
14115
14125
  T((i) => ({
14116
14126
  ...i,
14117
14127
  [e]: {
@@ -14123,31 +14133,31 @@ const useAdvancedTable = (e) => {
14123
14133
  ...e,
14124
14134
  page: 1
14125
14135
  }));
14126
- }, []), ng = useCallback((e) => {
14136
+ }, []), Zh = useCallback((e) => {
14127
14137
  T((t) => {
14128
14138
  let n = { ...t };
14129
14139
  return delete n[e], n;
14130
14140
  });
14131
- }, []), rg = useCallback(() => {
14141
+ }, []), Qh = useCallback(() => {
14132
14142
  T({});
14133
- }, []), ig = useCallback((e) => {
14143
+ }, []), $h = useCallback((e) => {
14134
14144
  L((t) => ({
14135
14145
  ...t,
14136
14146
  page: e
14137
14147
  }));
14138
- }, []), ag = useCallback((e) => {
14148
+ }, []), eg = useCallback((e) => {
14139
14149
  L((t) => ({
14140
14150
  ...t,
14141
14151
  pageSize: e,
14142
14152
  page: 1
14143
14153
  }));
14144
- }, []), X = useCallback((e) => {
14154
+ }, []), Y = useCallback((e) => {
14145
14155
  D(e);
14146
- }, []), og = useCallback((e) => {
14156
+ }, []), X = useCallback((e) => {
14147
14157
  k((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
14148
- }, []), sg = useCallback((e) => {
14158
+ }, []), tg = useCallback((e) => {
14149
14159
  j((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
14150
- }, []), cg = useCallback((e) => {
14160
+ }, []), ng = useCallback((e) => {
14151
14161
  N((t) => {
14152
14162
  let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
14153
14163
  return y?.(n), n;
@@ -14162,12 +14172,12 @@ const useAdvancedTable = (e) => {
14162
14172
  }
14163
14173
  return y?.(a), a;
14164
14174
  });
14165
- }, [v, y]), lg = useCallback((e, t) => {
14175
+ }, [v, y]), rg = useCallback((e, t) => {
14166
14176
  F((n) => ({
14167
14177
  ...n,
14168
14178
  [e]: Math.max(50, t)
14169
14179
  }));
14170
- }, []), Q = useCallback((e) => {
14180
+ }, []), ig = useCallback((e) => {
14171
14181
  let t = typeof v == "function" ? v(e) : e[v], i = {};
14172
14182
  n.forEach((t) => {
14173
14183
  if (t.editable) {
@@ -14180,14 +14190,14 @@ const useAdvancedTable = (e) => {
14180
14190
  errors: {},
14181
14191
  isSaving: !1
14182
14192
  });
14183
- }, [v, n]), ug = useCallback(() => {
14193
+ }, [v, n]), ag = useCallback(() => {
14184
14194
  z((e) => ({
14185
14195
  ...e,
14186
14196
  rowId: null,
14187
14197
  values: {},
14188
14198
  errors: {}
14189
14199
  }));
14190
- }, []), dg = useCallback(async (t) => {
14200
+ }, []), og = useCallback(async (t) => {
14191
14201
  let i = {}, a = !1, o = {};
14192
14202
  if (n.forEach((e) => {
14193
14203
  if (e.editable) {
@@ -14231,7 +14241,7 @@ const useAdvancedTable = (e) => {
14231
14241
  n,
14232
14242
  R.values,
14233
14243
  e.onRowSave
14234
- ]), fg = useCallback((e, t) => {
14244
+ ]), sg = useCallback((e, t) => {
14235
14245
  if (z((n) => ({
14236
14246
  ...n,
14237
14247
  values: {
@@ -14249,58 +14259,111 @@ const useAdvancedTable = (e) => {
14249
14259
  errors: t
14250
14260
  }));
14251
14261
  }
14252
- }, [R.errors]), pg = useMemo(() => {
14262
+ }, [R.errors]), cg = useMemo(() => {
14253
14263
  let e = new Map(n.map((e) => [e.id, e])), t = E.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
14254
14264
  return [...t, ...a].filter((e) => !O.includes(e.id));
14255
14265
  }, [
14256
14266
  E,
14257
14267
  n,
14258
14268
  O
14259
- ]), mg = useCallback(() => {
14260
- Wh((e) => e + 1);
14269
+ ]), lg = useCallback(() => {
14270
+ Bh((e) => e + 1);
14261
14271
  }, []);
14262
14272
  return {
14263
14273
  state: {
14264
14274
  data: t,
14265
- filteredData: G,
14266
- paginatedData: Y,
14275
+ filteredData: U,
14276
+ paginatedData: q,
14267
14277
  sortConfig: S,
14268
14278
  filters: w,
14269
- pagination: q,
14279
+ pagination: G,
14270
14280
  columnOrder: E,
14271
14281
  hiddenColumns: O,
14272
14282
  pinnedColumns: A,
14273
14283
  selectedRows: M,
14274
14284
  columnWidths: P,
14275
- loading: Hh,
14276
- totalUnfiltered: Kh
14285
+ loading: Rh,
14286
+ totalUnfiltered: Hh
14277
14287
  },
14278
- orderedColumns: pg,
14288
+ orderedColumns: cg,
14279
14289
  pageSizeOptions: f,
14280
- handleSort: eg,
14281
- handleFilter: tg,
14282
- clearFilter: ng,
14283
- clearAllFilters: rg,
14284
- handlePageChange: ig,
14285
- handlePageSizeChange: ag,
14286
- handleColumnReorder: X,
14287
- handleToggleColumn: og,
14288
- handleTogglePin: sg,
14289
- handleRowSelect: cg,
14290
+ handleSort: Yh,
14291
+ handleFilter: Xh,
14292
+ clearFilter: Zh,
14293
+ clearAllFilters: Qh,
14294
+ handlePageChange: $h,
14295
+ handlePageSizeChange: eg,
14296
+ handleColumnReorder: Y,
14297
+ handleToggleColumn: X,
14298
+ handleTogglePin: tg,
14299
+ handleRowSelect: ng,
14290
14300
  handleSelectAll: Z,
14291
- handleColumnResize: lg,
14301
+ handleColumnResize: rg,
14292
14302
  allColumns: n,
14293
- refresh: mg,
14303
+ refresh: lg,
14294
14304
  editingRowId: R.rowId,
14295
14305
  editValues: R.values,
14296
14306
  validationErrors: R.errors,
14297
14307
  isSaving: R.isSaving,
14298
- handleEditClick: Q,
14299
- handleCancelEdit: ug,
14300
- handleSaveEdit: dg,
14301
- handleInputChange: fg
14308
+ handleEditClick: ig,
14309
+ handleCancelEdit: ag,
14310
+ handleSaveEdit: og,
14311
+ handleInputChange: sg
14302
14312
  };
14303
- };
14313
+ }, ChevronDownIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14314
+ width: t,
14315
+ height: t,
14316
+ fill: e || "currentColor",
14317
+ viewBox: "0 0 20 20",
14318
+ children: /* @__PURE__ */ jsx("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
14319
+ }), ChevronRightIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14320
+ width: t,
14321
+ height: t,
14322
+ fill: e || "currentColor",
14323
+ viewBox: "0 0 20 20",
14324
+ children: /* @__PURE__ */ jsx("path", {
14325
+ fillRule: "evenodd",
14326
+ d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
14327
+ clipRule: "evenodd"
14328
+ })
14329
+ }), FileIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14330
+ width: t,
14331
+ height: t,
14332
+ fill: "none",
14333
+ stroke: e || "currentColor",
14334
+ viewBox: "0 0 24 24",
14335
+ children: /* @__PURE__ */ jsx("path", {
14336
+ strokeLinecap: "round",
14337
+ strokeLinejoin: "round",
14338
+ strokeWidth: 2,
14339
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
14340
+ })
14341
+ }), TrashIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14342
+ className: `w-${t / 4} h-${t / 4}`,
14343
+ fill: "none",
14344
+ stroke: e || "currentColor",
14345
+ viewBox: "0 0 24 24",
14346
+ width: t,
14347
+ height: t,
14348
+ children: /* @__PURE__ */ jsx("path", {
14349
+ strokeLinecap: "round",
14350
+ strokeLinejoin: "round",
14351
+ strokeWidth: 2,
14352
+ d: "M6 18L18 6M6 6l12 12"
14353
+ })
14354
+ }), UploadIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14355
+ width: t,
14356
+ height: t,
14357
+ fill: "none",
14358
+ stroke: e || "currentColor",
14359
+ viewBox: "0 0 24 24",
14360
+ children: /* @__PURE__ */ jsx("path", {
14361
+ strokeLinecap: "round",
14362
+ strokeLinejoin: "round",
14363
+ strokeWidth: 2,
14364
+ d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
14365
+ })
14366
+ });
14304
14367
  var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: i = {}, defaultPageSize: o = 10, pageSizeOptions: d = [
14305
14368
  10,
14306
14369
  25,
@@ -14310,7 +14373,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14310
14373
  300,
14311
14374
  400,
14312
14375
  500
14313
- ], enableSorting: _ = !0, enableFiltering: v = !0, enablePagination: y = !0, enableExport: b = !0, initialConfig: x, onConfigChange: S, className: C = "", labels: w = {
14376
+ ], enableSorting: _ = !0, enableFiltering: v = !0, enablePagination: y = !0, enableExport: b = !0, exportFileName: x, initialConfig: S, onConfigChange: C, className: w = "", labels: T = {
14314
14377
  configuration: "Configuración",
14315
14378
  columnVisibility: "Columnas visibles",
14316
14379
  pagination: {
@@ -14323,24 +14386,30 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14323
14386
  },
14324
14387
  clearAllFilters: "Limpiar todos los filtros",
14325
14388
  noData: "No hay datos disponibles"
14326
- }, enableColumnReordering: T = !0, enableColumnPinning: E = !1, enableColumnResizing: D = !1, enableRowSelection: O = !1, stickyActionsColumn: k = !1, rowKey: A = "id", onRowSelectionChange: j, renderActions: M, actionsColumnLabel: N, loading: P = !1, fetchData: F, onRefresh: I, onPaginationChange: L, onFiltersChange: R, syncFiltersWithUrl: z = !1, enableColumnConfig: B = !0, enableInlineEditing: V = !1, onRowSave: H, onRowEditCancel: Bh }) => {
14327
- let [U, Vh] = useState(t), [Hh, W] = useState(null), [Uh, Wh] = useState({}), [Gh, G] = useState({}), [K, Kh] = useState(!1), [q, J] = useState({}), Y = useCallback((e) => {
14328
- let t = typeof A == "function" ? A(e) : e[A];
14329
- W(t);
14389
+ }, enableColumnReordering: E = !0, enableColumnPinning: D = !1, enableColumnResizing: O = !1, enableRowSelection: k = !1, stickyActionsColumn: A = !1, rowKey: j = "id", onRowSelectionChange: M, renderActions: N, actionsColumnLabel: P, loading: F = !1, fetchData: I, onRefresh: L, onPaginationChange: R, onFiltersChange: z, syncFiltersWithUrl: B = !1, enableColumnConfig: Ph = !0, enableInlineEditing: V = !1, onRowSave: Fh, onRowEditCancel: Ih, enableRowExpansion: Lh = !1, renderSubComponent: Rh, getRowCanExpand: H, onRowExpand: zh, expandColumnLabel: Bh, getSubRowsForExport: Vh, subColumnsForExport: U }) => {
14390
+ let [W, Hh] = useState(t), [G, K] = useState([]), q = useCallback((e) => {
14391
+ let t = typeof j == "function" ? j(e) : e[j];
14392
+ K((e) => {
14393
+ let n = e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
14394
+ return zh?.(n), n;
14395
+ });
14396
+ }, [j, zh]), [J, Uh] = useState(null), [Wh, Gh] = useState({}), [Kh, qh] = useState({}), [Jh, Yh] = useState(!1), [Xh, Zh] = useState({}), Qh = useCallback((e) => {
14397
+ let t = typeof j == "function" ? j(e) : e[j];
14398
+ Uh(t);
14330
14399
  let n = {};
14331
- U.forEach((t) => {
14400
+ W.forEach((t) => {
14332
14401
  if (t.editable) {
14333
14402
  let i = typeof t.accessor == "function" ? t.accessor(e) : e[t.accessor];
14334
14403
  n[t.id] = i;
14335
14404
  }
14336
- }), Wh(n), G({});
14337
- }, [A, U]), qh = useCallback(() => {
14338
- W(null), Wh({}), G({}), Bh?.();
14339
- }, [Bh]), Jh = useCallback(async (e) => {
14405
+ }), Gh(n), qh({});
14406
+ }, [j, W]), $h = useCallback(() => {
14407
+ Uh(null), Gh({}), qh({}), Ih?.();
14408
+ }, [Ih]), eg = useCallback(async (e) => {
14340
14409
  let t = {}, n = !1, i = {};
14341
- if (U.forEach((e) => {
14410
+ if (W.forEach((e) => {
14342
14411
  if (e.editable) {
14343
- let a = Uh[e.id];
14412
+ let a = Wh[e.id];
14344
14413
  if (e.inputType === "number" && typeof a == "string" && a !== "") {
14345
14414
  let e = Number(a);
14346
14415
  isNaN(e) || (a = e);
@@ -14352,55 +14421,55 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14352
14421
  typeof e.accessor == "string" ? i[e.accessor] = a : i[e.id] = a;
14353
14422
  }
14354
14423
  }), n) {
14355
- G(t);
14424
+ qh(t);
14356
14425
  return;
14357
14426
  }
14358
- Kh(!0);
14427
+ Yh(!0);
14359
14428
  try {
14360
- await H?.(e, i), W(null), Wh({});
14429
+ await Fh?.(e, i), Uh(null), Gh({});
14361
14430
  } catch (e) {
14362
14431
  console.error("Failed to save row", e);
14363
14432
  } finally {
14364
- Kh(!1);
14433
+ Yh(!1);
14365
14434
  }
14366
14435
  }, [
14367
- H,
14368
- U,
14369
- Uh
14370
- ]), Yh = (e, t) => {
14371
- Wh((n) => ({
14436
+ Fh,
14437
+ W,
14438
+ Wh
14439
+ ]), Y = (e, t) => {
14440
+ Gh((n) => ({
14372
14441
  ...n,
14373
14442
  [e]: t
14374
- })), Gh[e] && G((t) => {
14443
+ })), Kh[e] && qh((t) => {
14375
14444
  let n = { ...t };
14376
14445
  return delete n[e], n;
14377
14446
  });
14378
- }, { state: Xh, orderedColumns: Zh, handleSort: Qh, handleFilter: $h, clearAllFilters: eg, handlePageChange: tg, handlePageSizeChange: ng, handleColumnReorder: rg, handleToggleColumn: ig, handleTogglePin: ag, handleRowSelect: X, handleSelectAll: og, handleColumnResize: sg, refresh: cg } = useAdvancedTable({
14447
+ }, { state: X, orderedColumns: tg, handleSort: ng, handleFilter: Z, clearAllFilters: rg, handlePageChange: ig, handlePageSizeChange: ag, handleColumnReorder: og, handleToggleColumn: sg, handleTogglePin: cg, handleRowSelect: lg, handleSelectAll: ug, handleColumnResize: dg, refresh: fg } = useAdvancedTable({
14379
14448
  data: e,
14380
- columns: U,
14449
+ columns: W,
14381
14450
  defaultSort: n,
14382
14451
  defaultFilters: i,
14383
14452
  defaultPageSize: o,
14384
14453
  pageSizeOptions: d,
14385
- initialConfig: x,
14386
- onConfigChange: S,
14387
- fetchData: F,
14388
- onPaginationChange: L,
14389
- onFiltersChange: R,
14390
- rowKey: A,
14391
- onRowSelectionChange: j,
14392
- syncFiltersWithUrl: z,
14454
+ initialConfig: S,
14455
+ onConfigChange: C,
14456
+ fetchData: I,
14457
+ onPaginationChange: R,
14458
+ onFiltersChange: z,
14459
+ rowKey: j,
14460
+ onRowSelectionChange: M,
14461
+ syncFiltersWithUrl: B,
14393
14462
  enablePagination: y
14394
- }), { paginatedData: Z, sortConfig: lg, filters: Q, pagination: ug, hiddenColumns: dg, pinnedColumns: fg, selectedRows: pg, columnWidths: mg, loading: hg, totalUnfiltered: gg } = Xh, _g = P || hg;
14395
- useEffect(() => Vh(t), [t]), useEffect(() => {
14396
- Z.length !== 0 && J((e) => {
14463
+ }), { paginatedData: Q, sortConfig: pg, filters: mg, pagination: hg, hiddenColumns: gg, pinnedColumns: _g, selectedRows: vg, columnWidths: yg, loading: bg, totalUnfiltered: xg } = X, Sg = F || bg;
14464
+ useEffect(() => Hh(t), [t]), useEffect(() => {
14465
+ Q.length !== 0 && Zh((e) => {
14397
14466
  let t = { ...e }, n = !1;
14398
- return Object.entries(Q).forEach(([e, i]) => {
14467
+ return Object.entries(mg).forEach(([e, i]) => {
14399
14468
  if (i.type !== "multiselect" || !Array.isArray(i.value)) return;
14400
- let a = U.find((t) => t.id === e);
14469
+ let a = W.find((t) => t.id === e);
14401
14470
  a?.filterLabelAccessor && i.value.forEach((i) => {
14402
14471
  if (t[e]?.[i]) return;
14403
- let o = Z.find((e) => {
14472
+ let o = Q.find((e) => {
14404
14473
  let t = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor];
14405
14474
  return String(t) === i;
14406
14475
  });
@@ -14412,39 +14481,39 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14412
14481
  }), n ? t : e;
14413
14482
  });
14414
14483
  }, [
14415
- Z,
14416
14484
  Q,
14417
- U
14485
+ mg,
14486
+ W
14418
14487
  ]);
14419
- let vg = useRef(null), yg = useRef(null), [bg, xg] = useState(0);
14488
+ let Cg = useRef(null), wg = useRef(null), [Tg, Eg] = useState(0);
14420
14489
  useEffect(() => {
14421
14490
  let e = () => {
14422
- vg.current && xg(vg.current.scrollWidth);
14491
+ Cg.current && Eg(Cg.current.scrollWidth);
14423
14492
  };
14424
14493
  e();
14425
14494
  let t = new ResizeObserver(e);
14426
- return vg.current && t.observe(vg.current), () => t.disconnect();
14427
- }, [Z, U]);
14428
- let Sg = (e) => {
14429
- vg.current && (vg.current.scrollLeft = e.currentTarget.scrollLeft);
14430
- }, Cg = (e) => {
14431
- yg.current && (yg.current.scrollLeft = e.currentTarget.scrollLeft);
14432
- }, wg = useMemo(() => {
14433
- let e = [...Zh], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
14434
- return O && n.unshift({
14495
+ return Cg.current && t.observe(Cg.current), () => t.disconnect();
14496
+ }, [Q, W]);
14497
+ let Dg = (e) => {
14498
+ Cg.current && (Cg.current.scrollLeft = e.currentTarget.scrollLeft);
14499
+ }, Og = (e) => {
14500
+ wg.current && (wg.current.scrollLeft = e.currentTarget.scrollLeft);
14501
+ }, kg = useMemo(() => {
14502
+ let e = [...tg], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
14503
+ return k && n.unshift({
14435
14504
  id: "selection-synthetic",
14436
14505
  label: "",
14437
- accessor: (e) => e[A],
14506
+ accessor: (e) => e[j],
14438
14507
  width: 50,
14439
14508
  minWidth: 50,
14440
14509
  render: ({ row: e }) => {
14441
- let t = e[A];
14510
+ let t = e[j];
14442
14511
  return /* @__PURE__ */ jsx("input", {
14443
14512
  type: "checkbox",
14444
14513
  className: "w-4 h-4 accent-redi-primary cursor-pointer",
14445
- checked: pg.includes(t),
14514
+ checked: vg.includes(t),
14446
14515
  onChange: (e) => {
14447
- e.stopPropagation(), X(t);
14516
+ e.stopPropagation(), lg(t);
14448
14517
  },
14449
14518
  onClick: (e) => e.stopPropagation()
14450
14519
  });
@@ -14453,29 +14522,49 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14453
14522
  filterable: !1,
14454
14523
  sortable: !1,
14455
14524
  draggable: !1
14456
- }), (M || V) && n.push({
14525
+ }), Lh && n.unshift({
14526
+ id: "expand-synthetic",
14527
+ label: Bh || "",
14528
+ width: 50,
14529
+ minWidth: 50,
14530
+ accessor: (e) => e[j],
14531
+ render: ({ row: e }) => {
14532
+ let t = typeof j == "function" ? j(e) : e[j], n = G.includes(t);
14533
+ return !H || H(e) ? /* @__PURE__ */ jsx("div", {
14534
+ className: "cursor-pointer p-1 hover:bg-gray-200 rounded-full w-fit flex items-center justify-center",
14535
+ onClick: (t) => {
14536
+ t.stopPropagation(), q(e);
14537
+ },
14538
+ children: jsx(n ? ChevronDownIcon : ChevronRightIcon, { size: 20 })
14539
+ }) : null;
14540
+ },
14541
+ isAction: !1,
14542
+ filterable: !1,
14543
+ sortable: !1,
14544
+ draggable: !1
14545
+ }), (N || V) && n.push({
14457
14546
  id: "actions-synthetic",
14458
- label: N || "",
14459
- accessor: (e) => e[A],
14547
+ label: P || "",
14548
+ accessor: (e) => e[j],
14460
14549
  render: ({ row: e, column: t, index: n }) => {
14461
- let i = typeof A == "function" ? A(e) : e[A];
14462
- return V ? Hh === i ? /* @__PURE__ */ jsxs("div", {
14550
+ let i = typeof j == "function" ? j(e) : e[j];
14551
+ return V ? J === i ? /* @__PURE__ */ jsxs("div", {
14463
14552
  className: "flex items-center gap-2",
14464
14553
  children: [/* @__PURE__ */ jsx(Button_default, {
14465
14554
  level: "icon",
14466
14555
  onClick: (t) => {
14467
- t.stopPropagation(), Jh(e);
14556
+ t.stopPropagation(), eg(e);
14468
14557
  },
14469
- disabled: K,
14558
+ disabled: Jh,
14470
14559
  className: "text-green-600 hover:bg-green-100 p-1 rounded-full",
14471
14560
  label: "Save",
14472
14561
  children: /* @__PURE__ */ jsx(CheckIcon, { size: 18 })
14473
14562
  }), /* @__PURE__ */ jsx(Button_default, {
14474
14563
  level: "icon",
14475
14564
  onClick: (e) => {
14476
- e.stopPropagation(), qh();
14565
+ e.stopPropagation(), $h();
14477
14566
  },
14478
- disabled: K,
14567
+ disabled: Jh,
14479
14568
  className: "text-red-600 hover:bg-red-100 p-1 rounded-full",
14480
14569
  label: "Cancel",
14481
14570
  children: /* @__PURE__ */ jsx(CloseIcon, { size: 18 })
@@ -14485,17 +14574,17 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14485
14574
  children: [/* @__PURE__ */ jsx(Button_default, {
14486
14575
  level: "icon",
14487
14576
  onClick: (t) => {
14488
- t.stopPropagation(), Y(e);
14577
+ t.stopPropagation(), Qh(e);
14489
14578
  },
14490
14579
  className: "text-blue-600 hover:bg-blue-100 p-1 rounded-full",
14491
14580
  label: "Edit",
14492
14581
  children: /* @__PURE__ */ jsx(EditIcon, { size: 18 })
14493
- }), M && M({
14582
+ }), N && N({
14494
14583
  row: e,
14495
14584
  index: n,
14496
14585
  column: t
14497
14586
  })]
14498
- }) : M ? M({
14587
+ }) : N ? N({
14499
14588
  row: e,
14500
14589
  index: n,
14501
14590
  column: t
@@ -14508,43 +14597,53 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14508
14597
  draggable: !1
14509
14598
  }), n;
14510
14599
  }, [
14511
- Zh,
14512
- O,
14513
- M,
14514
- V,
14515
- A,
14516
- pg,
14517
- X,
14600
+ tg,
14601
+ k,
14518
14602
  N,
14519
- Hh,
14520
- K,
14603
+ V,
14604
+ j,
14605
+ vg,
14606
+ lg,
14607
+ P,
14608
+ J,
14521
14609
  Jh,
14522
- qh,
14523
- Y
14524
- ]), Tg = (e = "xlsx", t) => {
14610
+ eg,
14611
+ $h,
14612
+ Qh,
14613
+ Lh,
14614
+ G,
14615
+ H,
14616
+ q,
14617
+ Bh
14618
+ ]), Ag = (e = "xlsx", t) => {
14525
14619
  if (!b) return;
14526
14620
  let n = [];
14527
14621
  if (t && t.length > 0) {
14528
- let e = new Map(Xh.columnOrder.map((e, t) => [e, t]));
14529
- n = U.filter((e) => t.includes(e.id)).sort((t, n) => {
14622
+ let e = new Map(X.columnOrder.map((e, t) => [e, t]));
14623
+ n = W.filter((e) => t.includes(e.id)).sort((t, n) => {
14530
14624
  let i = e.get(t.id) ?? 9999, a = e.get(n.id) ?? 9999;
14531
14625
  return i - a;
14532
14626
  });
14533
- } else n = wg.filter((e) => !e.isAction);
14534
- exportToExcel(Xh.filteredData, n, "table-data", e);
14535
- }, Eg = Object.values(Q).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0), Dg = useMemo(() => {
14627
+ } else n = kg.filter((e) => !e.isAction);
14628
+ U && (n = [...n, ...U]);
14629
+ let i = X.filteredData;
14630
+ Vh && (i = X.filteredData.flatMap((e) => {
14631
+ let t = Vh(e) || [];
14632
+ return [e, ...t];
14633
+ })), exportToExcel(i, n, x || "table-data", e);
14634
+ }, jg = Object.values(mg).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0), Mg = useMemo(() => {
14536
14635
  let e = [];
14537
- return Object.entries(Q).forEach(([t, n]) => {
14538
- let i = U.find((e) => e.id === t);
14636
+ return Object.entries(mg).forEach(([t, n]) => {
14637
+ let i = W.find((e) => e.id === t);
14539
14638
  i && (n.type === "text" && n.value ? e.push({
14540
14639
  columnId: t,
14541
14640
  columnLabel: i.label,
14542
14641
  value: String(n.value),
14543
14642
  displayValue: String(n.value)
14544
14643
  }) : n.type === "multiselect" && Array.isArray(n.value) && n.value.length > 0 && n.value.forEach((n) => {
14545
- let a = q[t]?.[n], o = a ?? n;
14644
+ let a = Xh[t]?.[n], o = a ?? n;
14546
14645
  if (!a && i.filterLabelAccessor) {
14547
- let e = Z.find((e) => {
14646
+ let e = Q.find((e) => {
14548
14647
  let t = typeof i.accessor == "function" ? i.accessor(e) : e[i.accessor];
14549
14648
  return String(t) === n;
14550
14649
  });
@@ -14559,109 +14658,111 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14559
14658
  }));
14560
14659
  }), e;
14561
14660
  }, [
14661
+ mg,
14662
+ W,
14562
14663
  Q,
14563
- U,
14564
- Z,
14565
- q
14566
- ]), Og = (e, t) => {
14567
- let n = Q[e];
14568
- if (n.type === "text") $h(e, "", "text");
14664
+ Xh
14665
+ ]), Ng = (e, t) => {
14666
+ let n = mg[e];
14667
+ if (n.type === "text") Z(e, "", "text");
14569
14668
  else if (n.type === "multiselect" && Array.isArray(n.value)) {
14570
14669
  let i = n.value.filter((e) => e !== t);
14571
- $h(e, i, "multiselect");
14670
+ Z(e, i, "multiselect");
14572
14671
  }
14573
- }, kg = Math.ceil(ug.total / ug.pageSize), Ag = (e) => mg[e.id] ? mg[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
14672
+ }, Pg = Math.ceil(hg.total / hg.pageSize), Fg = (e) => yg[e.id] ? yg[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
14574
14673
  return /* @__PURE__ */ jsxs("div", {
14575
- className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${C}`,
14674
+ className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${w}`,
14576
14675
  children: [
14577
14676
  /* @__PURE__ */ jsx(TableToolbar_default, {
14578
- fetchData: F,
14579
- onRefresh: I,
14677
+ fetchData: I,
14678
+ onRefresh: L,
14580
14679
  handleRefreshClick: () => {
14581
- cg(), I?.();
14680
+ fg(), L?.();
14582
14681
  },
14583
- isLoading: _g,
14584
- enableColumnConfig: B,
14585
- labels: w,
14586
- tableColumns: U,
14587
- hiddenColumns: dg,
14588
- pinnedColumns: fg,
14589
- handleToggleColumn: ig,
14590
- handleTogglePin: ag,
14591
- setTableColumns: Vh,
14592
- enableColumnPinning: E,
14682
+ isLoading: Sg,
14683
+ enableColumnConfig: Ph,
14684
+ labels: T,
14685
+ tableColumns: W,
14686
+ hiddenColumns: gg,
14687
+ pinnedColumns: _g,
14688
+ handleToggleColumn: sg,
14689
+ handleTogglePin: cg,
14690
+ setTableColumns: Hh,
14691
+ enableColumnPinning: D,
14593
14692
  enableFiltering: v,
14594
- hasActiveFilters: Eg,
14595
- clearAllFilters: eg,
14596
- activeFilterTags: Dg,
14597
- handleRemoveFilterTag: Og,
14693
+ hasActiveFilters: jg,
14694
+ clearAllFilters: rg,
14695
+ activeFilterTags: Mg,
14696
+ handleRemoveFilterTag: Ng,
14598
14697
  enableExport: b,
14599
- handleExport: Tg
14698
+ handleExport: Ag
14600
14699
  }),
14601
14700
  y && /* @__PURE__ */ jsx("div", {
14602
- ref: yg,
14701
+ ref: wg,
14603
14702
  className: `overflow-x-auto bg-gray-50 border-b border-gray-200 ${y ? "md:overflow-y-hidden" : ""}`,
14604
- onScroll: Sg,
14703
+ onScroll: Dg,
14605
14704
  style: { height: "12px" },
14606
14705
  children: /* @__PURE__ */ jsx("div", { style: {
14607
- width: bg,
14706
+ width: Tg,
14608
14707
  height: "1px"
14609
14708
  } })
14610
14709
  }),
14611
14710
  /* @__PURE__ */ jsx("div", {
14612
- ref: vg,
14613
- onScroll: Cg,
14711
+ ref: Cg,
14712
+ onScroll: Og,
14614
14713
  className: `overflow-x-auto bg-white relative ${y ? "max-h-150 md:max-h-none min-h-125 overflow-y-auto md:overflow-y-visible" : "min-h-0 max-h-150 overflow-y-auto"}`,
14615
14714
  children: /* @__PURE__ */ jsxs("table", {
14616
14715
  className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
14617
14716
  "aria-label": "Data Table",
14618
14717
  children: [/* @__PURE__ */ jsx(TableHeader_default, {
14619
- displayColumns: wg,
14620
- getColumnWidth: Ag,
14621
- pinnedColumns: fg,
14622
- stickyActionsColumn: k,
14623
- enableColumnReordering: T,
14624
- handleColumnReorder: rg,
14625
- sortConfig: lg,
14626
- handleSort: Qh,
14718
+ displayColumns: kg,
14719
+ getColumnWidth: Fg,
14720
+ pinnedColumns: _g,
14721
+ stickyActionsColumn: A,
14722
+ enableColumnReordering: E,
14723
+ handleColumnReorder: og,
14724
+ sortConfig: pg,
14725
+ handleSort: ng,
14627
14726
  enableSorting: _,
14628
- filters: Q,
14629
- handleFilter: $h,
14630
- fetchData: F,
14727
+ filters: mg,
14728
+ handleFilter: Z,
14729
+ fetchData: I,
14631
14730
  data: e,
14632
- paginatedData: Z,
14633
- enableColumnResizing: D,
14634
- handleColumnResize: sg,
14635
- tableColumns: U,
14636
- rowKey: A,
14637
- selectedRows: pg,
14638
- handleSelectAll: og,
14639
- stateColumnOrder: Xh.columnOrder
14731
+ paginatedData: Q,
14732
+ enableColumnResizing: O,
14733
+ handleColumnResize: dg,
14734
+ tableColumns: W,
14735
+ rowKey: j,
14736
+ selectedRows: vg,
14737
+ handleSelectAll: ug,
14738
+ stateColumnOrder: X.columnOrder
14640
14739
  }), /* @__PURE__ */ jsx(TableBody_default, {
14641
- loading: P,
14642
- paginatedData: Z,
14643
- displayColumns: wg,
14644
- getColumnWidth: Ag,
14645
- pinnedColumns: fg,
14646
- stickyActionsColumn: k,
14647
- rowKey: A,
14648
- editingRowId: Hh,
14740
+ loading: F,
14741
+ paginatedData: Q,
14742
+ displayColumns: kg,
14743
+ getColumnWidth: Fg,
14744
+ pinnedColumns: _g,
14745
+ stickyActionsColumn: A,
14746
+ rowKey: j,
14747
+ editingRowId: J,
14649
14748
  enableInlineEditing: V,
14650
- editValues: Uh,
14651
- validationErrors: Gh,
14652
- handleInputChange: Yh,
14653
- labels: w
14749
+ editValues: Wh,
14750
+ validationErrors: Kh,
14751
+ handleInputChange: Y,
14752
+ labels: T,
14753
+ expandedRowIds: G,
14754
+ renderSubComponent: Rh
14654
14755
  })]
14655
14756
  })
14656
14757
  }),
14657
14758
  y && /* @__PURE__ */ jsx(TablePagination, {
14658
- pagination: ug,
14659
- labels: w,
14660
- totalUnfiltered: gg,
14759
+ pagination: hg,
14760
+ labels: T,
14761
+ totalUnfiltered: xg,
14661
14762
  pageSizeOptions: d,
14662
- handlePageSizeChange: ng,
14663
- handlePageChange: tg,
14664
- totalPages: kg
14763
+ handlePageSizeChange: ag,
14764
+ handlePageChange: ig,
14765
+ totalPages: Pg
14665
14766
  })
14666
14767
  ]
14667
14768
  });
@@ -16563,46 +16664,7 @@ var tones = {
16563
16664
  onChange: (e) => t(e.target.value),
16564
16665
  disabled: a,
16565
16666
  className: "rounded-lg border border-redi-border bg-redi-secondary-bg text-redi-tertiary-text px-3 py-2 focus:outline-none focus:ring-2 focus:ring-redi-primary-bg-hover"
16566
- });
16567
- const FileIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16568
- width: t,
16569
- height: t,
16570
- fill: "none",
16571
- stroke: e || "currentColor",
16572
- viewBox: "0 0 24 24",
16573
- children: /* @__PURE__ */ jsx("path", {
16574
- strokeLinecap: "round",
16575
- strokeLinejoin: "round",
16576
- strokeWidth: 2,
16577
- d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
16578
- })
16579
- }), TrashIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16580
- className: `w-${t / 4} h-${t / 4}`,
16581
- fill: "none",
16582
- stroke: e || "currentColor",
16583
- viewBox: "0 0 24 24",
16584
- width: t,
16585
- height: t,
16586
- children: /* @__PURE__ */ jsx("path", {
16587
- strokeLinecap: "round",
16588
- strokeLinejoin: "round",
16589
- strokeWidth: 2,
16590
- d: "M6 18L18 6M6 6l12 12"
16591
- })
16592
- }), UploadIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16593
- width: t,
16594
- height: t,
16595
- fill: "none",
16596
- stroke: e || "currentColor",
16597
- viewBox: "0 0 24 24",
16598
- children: /* @__PURE__ */ jsx("path", {
16599
- strokeLinecap: "round",
16600
- strokeLinejoin: "round",
16601
- strokeWidth: 2,
16602
- d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
16603
- })
16604
- });
16605
- var FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i = !1, uploadUrl: a, onUploadComplete: o, onUploadError: s, maxSize: c, label: d, helperText: m, color: h, id: g, name: _ }) => {
16667
+ }), FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i = !1, uploadUrl: a, onUploadComplete: o, onUploadError: s, maxSize: c, label: d, helperText: m, color: h, id: g, name: _ }) => {
16606
16668
  let [v, y] = useState([]), [b, x] = useState({}), [S, C] = useState(!1), w = useRef(null), T = (t) => {
16607
16669
  if (t.target.files) {
16608
16670
  let i = Array.from(t.target.files), a = c ? i.filter((e) => e.size <= c) : i;
@@ -16752,15 +16814,7 @@ var FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i
16752
16814
  children: t.label
16753
16815
  })]
16754
16816
  }, t.value))
16755
- });
16756
- const ChevronDownIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16757
- width: t,
16758
- height: t,
16759
- fill: e || "currentColor",
16760
- viewBox: "0 0 20 20",
16761
- children: /* @__PURE__ */ jsx("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
16762
- });
16763
- var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, placeholder: a, label: o, error: s, helperText: c, color: l, fullWidth: d = !1, id: m, name: h }) => {
16817
+ }), Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, placeholder: a, label: o, error: s, helperText: c, color: l, fullWidth: d = !1, id: m, name: h }) => {
16764
16818
  let [g, _] = useState(!1), v = s ? "border-red-500" : "border-gray-300", y = s ? "text-red-500" : "text-gray-700", b = l ? generatePalette(l) : null, x = s ? "border-red-500" : b ? "border-[var(--custom-color)]" : "border-redi-primary-bg", S = b ? {
16765
16819
  "--custom-color": b.main,
16766
16820
  borderColor: g && !s ? b.main : void 0,