@redi.run/redi-components 0.0.76 → 0.0.78

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,100 @@ 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
12833
- ${x ? "" : "static"}
12827
+ }, `skeleton-${t}`)) : n.length > 0 ? n.map((e, g) => {
12828
+ let y = typeof c == "function" ? c(e) : e[c], b = _.includes(y);
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, b = a(t), x = o.includes(t.id), S = v && s, C = 0;
12833
+ if (x) for (let e = 0; e < c; e++) o.includes(i[e].id) && (C += a(i[e]));
12834
+ let w = `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
12835
+ ${S ? "" : "static"}
12834
12836
  ${v ? "border-l border-gray-300" : ""}
12835
- ${b && !x ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12836
- ${x ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12837
- ${x ? "group-hover:bg-gray-100" : ""}
12838
- `, 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`,
12859
- 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
12837
+ ${x && !S ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12838
+ ${S ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12839
+ ${S ? "group-hover:bg-gray-100" : ""}
12840
+ `, T = {
12841
+ width: b,
12842
+ minWidth: b,
12843
+ maxWidth: b,
12844
+ overflowWrap: "break-word",
12845
+ ...S ? {
12846
+ position: "sticky",
12847
+ right: 0,
12848
+ zIndex: 15,
12849
+ backgroundColor: g % 2 == 0 ? "#ffffff" : "#f9fafb"
12850
+ } : x ? {
12851
+ position: "sticky",
12852
+ left: C,
12853
+ zIndex: 10,
12854
+ backgroundColor: "inherit"
12855
+ } : {}
12856
+ };
12857
+ if (u && l === y && t.editable) {
12858
+ let e = d[t.id] ?? _, n = m[t.id];
12859
+ return /* @__PURE__ */ jsx("td", {
12860
+ className: `${w} p-1`,
12861
+ style: T,
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: w,
12891
+ style: T,
12892
+ children: /* @__PURE__ */ jsx("div", {
12893
+ style: { width: "100%" },
12894
+ children: t.render({
12895
+ value: _,
12896
+ row: e,
12897
+ column: t,
12898
+ index: g,
12899
+ data: n
12900
+ })
12897
12901
  })
12902
+ }, t.id) : /* @__PURE__ */ jsx("td", {
12903
+ className: w,
12904
+ style: T,
12905
+ children: formatCellValue(_)
12906
+ }, t.id);
12907
+ })
12908
+ }), b && v && /* @__PURE__ */ jsx("tr", {
12909
+ className: "bg-gray-50 border-b border-solid border-b-gray-100",
12910
+ children: /* @__PURE__ */ jsx("td", {
12911
+ colSpan: i.length,
12912
+ className: "p-4 border-r border-solid border-gray-300 last:border-r-0",
12913
+ children: v({
12914
+ row: e,
12915
+ data: n
12898
12916
  })
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,
12917
+ })
12918
+ })] }, y);
12919
+ }) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
12920
+ colSpan: i.length,
12907
12921
  className: "py-12 text-center text-gray-500",
12908
12922
  children: /* @__PURE__ */ jsxs("div", {
12909
12923
  className: "flex flex-col items-center justify-center gap-2",
@@ -12920,7 +12934,7 @@ var buildThemePalette$1 = (e) => {
12920
12934
  })
12921
12935
  }), /* @__PURE__ */ jsx("span", {
12922
12936
  className: "text-sm font-medium",
12923
- children: h.noData
12937
+ children: g.noData
12924
12938
  })]
12925
12939
  })
12926
12940
  }) }) }));
@@ -13149,11 +13163,11 @@ var AdvancedTable_module_default = {
13149
13163
  }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
13150
13164
  }, B = (e, t) => {
13151
13165
  k(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13152
- }, V = (e, t) => {
13166
+ }, Ph = (e, t) => {
13153
13167
  e.preventDefault(), e.dataTransfer.dropEffect = "move", j(t);
13154
- }, H = () => {
13168
+ }, V = () => {
13155
13169
  j(null);
13156
- }, Bh = (t, n) => {
13170
+ }, Fh = (t, n) => {
13157
13171
  if (t.preventDefault(), O === null) return;
13158
13172
  let i = e[O].id, a = e[n].id;
13159
13173
  if (i === a) {
@@ -13162,9 +13176,9 @@ var AdvancedTable_module_default = {
13162
13176
  }
13163
13177
  let o = t.currentTarget.getBoundingClientRect(), s = t.clientX - o.left > o.width / 2, l = [...D], u = l.indexOf(i), d = l.indexOf(a);
13164
13178
  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 = () => {
13179
+ }, Ih = () => {
13166
13180
  k(null), j(null);
13167
- }, Vh = useCallback(async (e) => {
13181
+ }, Lh = useCallback(async (e) => {
13168
13182
  let t = C.find((t) => t.id === e);
13169
13183
  if (t?.fetchColumn && !P[e]) {
13170
13184
  L((t) => ({
@@ -13186,10 +13200,10 @@ var AdvancedTable_module_default = {
13186
13200
  }));
13187
13201
  }
13188
13202
  }
13189
- }, [C, P]), Hh = (e) => {
13203
+ }, [C, P]), Rh = (e) => {
13190
13204
  let t = M !== e;
13191
- N(t ? e : null), t && Vh(e);
13192
- }, W = useCallback((e) => {
13205
+ N(t ? e : null), t && Lh(e);
13206
+ }, H = useCallback((e) => {
13193
13207
  let t = C.find((t) => t.id === e);
13194
13208
  if (!t) return [];
13195
13209
  if (t.fetchColumn && P[e]) return P[e];
@@ -13275,10 +13289,10 @@ var AdvancedTable_module_default = {
13275
13289
  style: C,
13276
13290
  draggable: !a.isAction && o && (a.draggable ?? !1),
13277
13291
  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,
13292
+ onDragOver: (e) => !a.isAction && o && Ph(e, s),
13293
+ onDragLeave: V,
13294
+ onDrop: (e) => !a.isAction && o && Fh(e, s),
13295
+ onDragEnd: Ih,
13282
13296
  "aria-sort": d?.column === a.id ? d.direction === "asc" ? "ascending" : "descending" : "none",
13283
13297
  children: /* @__PURE__ */ jsxs("div", {
13284
13298
  className: "flex items-center py-2 px-3 gap-2 min-h-10",
@@ -13323,14 +13337,14 @@ var AdvancedTable_module_default = {
13323
13337
  children: [/* @__PURE__ */ jsx(Button_default, {
13324
13338
  level: "icon",
13325
13339
  onClick: (e) => {
13326
- e.stopPropagation(), Hh(a.id);
13340
+ e.stopPropagation(), Rh(a.id);
13327
13341
  },
13328
13342
  "aria-label": `Filter by ${a.label}`,
13329
13343
  children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13330
13344
  }), M === a.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13331
13345
  columnId: a.id,
13332
13346
  label: a.label,
13333
- options: W(a.id),
13347
+ options: H(a.id),
13334
13348
  textValue: g[a.id]?.type === "text" ? String(g[a.id].value || "") : "",
13335
13349
  selectedValues: g[a.id]?.value ? Array.isArray(g[a.id].value) ? g[a.id].value : [String(g[a.id].value)] : [],
13336
13350
  onTextChange: (e) => _(a.id, e, "text"),
@@ -13932,23 +13946,23 @@ const useAdvancedTable = (e) => {
13932
13946
  values: {},
13933
13947
  errors: {},
13934
13948
  isSaving: !1
13935
- }), [B, V] = useState([]), [H, Bh] = useState(0), [U, Vh] = useState(0), [Hh, W] = useState(!1), [Uh, Wh] = useState(0);
13949
+ }), [B, Ph] = useState([]), [V, Fh] = useState(0), [Ih, Lh] = useState(0), [Rh, H] = useState(!1), [zh, Bh] = useState(0);
13936
13950
  useColumnSync(n, {
13937
13951
  setColumnOrder: D,
13938
13952
  setHiddenColumns: k,
13939
13953
  setPinnedColumns: j
13940
13954
  });
13941
- let Gh = useMemo(() => {
13955
+ let Vh = useMemo(() => {
13942
13956
  let e = /* @__PURE__ */ new Map();
13943
13957
  return Object.entries(w).forEach(([t, n]) => {
13944
13958
  n.value && (n.type === "text" || n.type === "select" || n.type === "multiselect" && Array.isArray(n.value) && n.value.length > 0) && e.set(t, n);
13945
13959
  }), e;
13946
- }, [w]), G = useMemo(() => {
13960
+ }, [w]), U = useMemo(() => {
13947
13961
  let e = [];
13948
- if (e = _ ? [...B] : [...t], Gh.size === 0) return e;
13962
+ if (e = _ ? [...B] : [...t], Vh.size === 0) return e;
13949
13963
  let i = /* @__PURE__ */ new Map();
13950
13964
  return n.forEach((e) => i.set(e.id, e)), e.filter((e) => {
13951
- for (let [t, n] of Gh) {
13965
+ for (let [t, n] of Vh) {
13952
13966
  let a = i.get(t);
13953
13967
  if (!a || _ && a.shouldBeRefetch) continue;
13954
13968
  let o = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], s = String(o || "").toLowerCase(), c = !0;
@@ -13958,22 +13972,22 @@ const useAdvancedTable = (e) => {
13958
13972
  });
13959
13973
  }, [
13960
13974
  t,
13961
- Gh,
13975
+ Vh,
13962
13976
  n,
13963
13977
  _,
13964
13978
  B
13965
- ]), K = _ ? H : G.length, Kh = _ ? U : t.length, q = useMemo(() => ({
13979
+ ]), W = _ ? V : U.length, Hh = _ ? Ih : t.length, G = useMemo(() => ({
13966
13980
  page: I.page,
13967
13981
  pageSize: I.pageSize,
13968
- total: K
13982
+ total: W
13969
13983
  }), [
13970
13984
  I.page,
13971
13985
  I.pageSize,
13972
- K
13973
- ]), J = useMemo(() => {
13974
- if (_ || !S) return G;
13986
+ W
13987
+ ]), K = useMemo(() => {
13988
+ if (_ || !S) return U;
13975
13989
  let e = n.find((e) => e.id === S.column);
13976
- return e ? [...G].sort((t, n) => {
13990
+ return e ? [...U].sort((t, n) => {
13977
13991
  let i = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], a = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
13978
13992
  if (i == null) return 1;
13979
13993
  if (a == null) return -1;
@@ -13986,99 +14000,99 @@ const useAdvancedTable = (e) => {
13986
14000
  o = e.localeCompare(t);
13987
14001
  }
13988
14002
  return S.direction === "desc" ? o * -1 : o;
13989
- }) : G;
14003
+ }) : U;
13990
14004
  }, [
13991
- G,
14005
+ U,
13992
14006
  S,
13993
14007
  n,
13994
14008
  _
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);
14009
+ ]), q = useMemo(() => {
14010
+ if (_ || !x) return K;
14011
+ let e = (G.page - 1) * G.pageSize, t = e + G.pageSize;
14012
+ return K.slice(e, t);
13999
14013
  }, [
14000
- J,
14001
- q.page,
14002
- q.pageSize,
14014
+ K,
14015
+ G.page,
14016
+ G.pageSize,
14003
14017
  _,
14004
14018
  x
14005
- ]), qh = useCallback(async () => {
14019
+ ]), J = useCallback(async () => {
14006
14020
  if (_) {
14007
- W(!0);
14021
+ H(!0);
14008
14022
  try {
14009
14023
  let e = {
14010
- page_number: q.page,
14011
- page_size: q.pageSize
14024
+ page_number: G.page,
14025
+ page_size: G.pageSize
14012
14026
  };
14013
14027
  S && (e.order_by = `${S.direction === "desc" ? "-" : ""}${S.column}`), Object.entries(w).forEach(([t, i]) => {
14014
14028
  i.value && n.find((e) => e.id === t)?.shouldBeRefetch && (e[t] = i.value);
14015
14029
  });
14016
14030
  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);
14031
+ 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
14032
  } catch (e) {
14019
14033
  console.error("Failed to fetch data:", e);
14020
14034
  } finally {
14021
- W(!1);
14035
+ H(!1);
14022
14036
  }
14023
14037
  }
14024
14038
  }, [
14025
14039
  _,
14026
- q.page,
14027
- q.pageSize,
14040
+ G.page,
14041
+ G.pageSize,
14028
14042
  S,
14029
14043
  w,
14030
14044
  n
14031
- ]), Jh = useRef(!0), Yh = useRef(w), Xh = useRef(S), Zh = useRef(q.page), Qh = useRef(q.pageSize), $h = useRef(Uh);
14045
+ ]), Uh = useRef(!0), Wh = useRef(w), Gh = useRef(S), Kh = useRef(G.page), qh = useRef(G.pageSize), Jh = useRef(zh);
14032
14046
  useEffect(() => {
14033
14047
  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;
14048
+ let e = !1, t = !deepEqual(w, Wh.current), i = !deepEqual(S, Gh.current), a = G.page !== Kh.current || G.pageSize !== qh.current;
14049
+ if (Uh.current) e = !0, Uh.current = !1;
14050
+ else if (zh !== Jh.current) e = !0, Jh.current = zh;
14037
14051
  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) {
14052
+ let t = Object.keys(Wh.current), i = Object.keys(w), a = Array.from(new Set([...t, ...i]));
14053
+ for (let t of a) if (!deepEqual(Wh.current[t], w[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
14040
14054
  e = !0;
14041
14055
  break;
14042
14056
  }
14043
14057
  } else (a || i) && (e = !0);
14044
- Zh.current = q.page, Qh.current = q.pageSize, Xh.current = S, Yh.current = w, e && qh();
14058
+ Kh.current = G.page, qh.current = G.pageSize, Gh.current = S, Wh.current = w, e && J();
14045
14059
  }
14046
14060
  }, [
14047
- qh,
14048
- Uh,
14061
+ J,
14062
+ zh,
14049
14063
  _,
14050
- q.page,
14051
- q.pageSize,
14064
+ G.page,
14065
+ G.pageSize,
14052
14066
  S,
14053
14067
  w,
14054
14068
  n
14055
14069
  ]), useEffect(() => {
14056
14070
  if (!_) {
14057
- let e = Math.ceil(K / q.pageSize) || 1;
14058
- q.page > e && L((t) => ({
14071
+ let e = Math.ceil(W / G.pageSize) || 1;
14072
+ G.page > e && L((t) => ({
14059
14073
  ...t,
14060
14074
  page: e
14061
14075
  }));
14062
14076
  }
14063
14077
  }, [
14064
- K,
14065
- q.pageSize,
14078
+ W,
14079
+ G.pageSize,
14066
14080
  _,
14067
- q.page
14081
+ G.page
14068
14082
  ]), useDebouncedCallback(() => {
14069
14083
  m?.({
14070
14084
  columns: n,
14071
14085
  sort: S,
14072
14086
  filters: w,
14073
- pagination: q,
14087
+ pagination: G,
14074
14088
  columnOrder: E,
14075
14089
  hiddenColumns: O,
14076
14090
  pinnedColumns: A
14077
- }), h?.(q), g?.(w);
14091
+ }), h?.(G), g?.(w);
14078
14092
  }, 100, [
14079
14093
  S,
14080
14094
  w,
14081
- q,
14095
+ G,
14082
14096
  E,
14083
14097
  O,
14084
14098
  A,
@@ -14103,7 +14117,7 @@ const useAdvancedTable = (e) => {
14103
14117
  n,
14104
14118
  _
14105
14119
  ]);
14106
- let eg = useCallback((e) => {
14120
+ let Yh = useCallback((e) => {
14107
14121
  C((t) => t?.column === e ? t.direction === "asc" ? {
14108
14122
  column: e,
14109
14123
  direction: "desc"
@@ -14111,7 +14125,7 @@ const useAdvancedTable = (e) => {
14111
14125
  column: e,
14112
14126
  direction: "asc"
14113
14127
  });
14114
- }, []), tg = useCallback((e, t, n = "text") => {
14128
+ }, []), Xh = useCallback((e, t, n = "text") => {
14115
14129
  T((i) => ({
14116
14130
  ...i,
14117
14131
  [e]: {
@@ -14123,31 +14137,31 @@ const useAdvancedTable = (e) => {
14123
14137
  ...e,
14124
14138
  page: 1
14125
14139
  }));
14126
- }, []), ng = useCallback((e) => {
14140
+ }, []), Zh = useCallback((e) => {
14127
14141
  T((t) => {
14128
14142
  let n = { ...t };
14129
14143
  return delete n[e], n;
14130
14144
  });
14131
- }, []), rg = useCallback(() => {
14145
+ }, []), Qh = useCallback(() => {
14132
14146
  T({});
14133
- }, []), ig = useCallback((e) => {
14147
+ }, []), $h = useCallback((e) => {
14134
14148
  L((t) => ({
14135
14149
  ...t,
14136
14150
  page: e
14137
14151
  }));
14138
- }, []), ag = useCallback((e) => {
14152
+ }, []), eg = useCallback((e) => {
14139
14153
  L((t) => ({
14140
14154
  ...t,
14141
14155
  pageSize: e,
14142
14156
  page: 1
14143
14157
  }));
14144
- }, []), X = useCallback((e) => {
14158
+ }, []), Y = useCallback((e) => {
14145
14159
  D(e);
14146
- }, []), og = useCallback((e) => {
14160
+ }, []), X = useCallback((e) => {
14147
14161
  k((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
14148
- }, []), sg = useCallback((e) => {
14162
+ }, []), tg = useCallback((e) => {
14149
14163
  j((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
14150
- }, []), cg = useCallback((e) => {
14164
+ }, []), ng = useCallback((e) => {
14151
14165
  N((t) => {
14152
14166
  let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
14153
14167
  return y?.(n), n;
@@ -14162,12 +14176,12 @@ const useAdvancedTable = (e) => {
14162
14176
  }
14163
14177
  return y?.(a), a;
14164
14178
  });
14165
- }, [v, y]), lg = useCallback((e, t) => {
14179
+ }, [v, y]), rg = useCallback((e, t) => {
14166
14180
  F((n) => ({
14167
14181
  ...n,
14168
14182
  [e]: Math.max(50, t)
14169
14183
  }));
14170
- }, []), Q = useCallback((e) => {
14184
+ }, []), ig = useCallback((e) => {
14171
14185
  let t = typeof v == "function" ? v(e) : e[v], i = {};
14172
14186
  n.forEach((t) => {
14173
14187
  if (t.editable) {
@@ -14180,14 +14194,14 @@ const useAdvancedTable = (e) => {
14180
14194
  errors: {},
14181
14195
  isSaving: !1
14182
14196
  });
14183
- }, [v, n]), ug = useCallback(() => {
14197
+ }, [v, n]), ag = useCallback(() => {
14184
14198
  z((e) => ({
14185
14199
  ...e,
14186
14200
  rowId: null,
14187
14201
  values: {},
14188
14202
  errors: {}
14189
14203
  }));
14190
- }, []), dg = useCallback(async (t) => {
14204
+ }, []), og = useCallback(async (t) => {
14191
14205
  let i = {}, a = !1, o = {};
14192
14206
  if (n.forEach((e) => {
14193
14207
  if (e.editable) {
@@ -14231,7 +14245,7 @@ const useAdvancedTable = (e) => {
14231
14245
  n,
14232
14246
  R.values,
14233
14247
  e.onRowSave
14234
- ]), fg = useCallback((e, t) => {
14248
+ ]), sg = useCallback((e, t) => {
14235
14249
  if (z((n) => ({
14236
14250
  ...n,
14237
14251
  values: {
@@ -14249,58 +14263,111 @@ const useAdvancedTable = (e) => {
14249
14263
  errors: t
14250
14264
  }));
14251
14265
  }
14252
- }, [R.errors]), pg = useMemo(() => {
14266
+ }, [R.errors]), cg = useMemo(() => {
14253
14267
  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
14268
  return [...t, ...a].filter((e) => !O.includes(e.id));
14255
14269
  }, [
14256
14270
  E,
14257
14271
  n,
14258
14272
  O
14259
- ]), mg = useCallback(() => {
14260
- Wh((e) => e + 1);
14273
+ ]), lg = useCallback(() => {
14274
+ Bh((e) => e + 1);
14261
14275
  }, []);
14262
14276
  return {
14263
14277
  state: {
14264
14278
  data: t,
14265
- filteredData: G,
14266
- paginatedData: Y,
14279
+ filteredData: U,
14280
+ paginatedData: q,
14267
14281
  sortConfig: S,
14268
14282
  filters: w,
14269
- pagination: q,
14283
+ pagination: G,
14270
14284
  columnOrder: E,
14271
14285
  hiddenColumns: O,
14272
14286
  pinnedColumns: A,
14273
14287
  selectedRows: M,
14274
14288
  columnWidths: P,
14275
- loading: Hh,
14276
- totalUnfiltered: Kh
14289
+ loading: Rh,
14290
+ totalUnfiltered: Hh
14277
14291
  },
14278
- orderedColumns: pg,
14292
+ orderedColumns: cg,
14279
14293
  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,
14294
+ handleSort: Yh,
14295
+ handleFilter: Xh,
14296
+ clearFilter: Zh,
14297
+ clearAllFilters: Qh,
14298
+ handlePageChange: $h,
14299
+ handlePageSizeChange: eg,
14300
+ handleColumnReorder: Y,
14301
+ handleToggleColumn: X,
14302
+ handleTogglePin: tg,
14303
+ handleRowSelect: ng,
14290
14304
  handleSelectAll: Z,
14291
- handleColumnResize: lg,
14305
+ handleColumnResize: rg,
14292
14306
  allColumns: n,
14293
- refresh: mg,
14307
+ refresh: lg,
14294
14308
  editingRowId: R.rowId,
14295
14309
  editValues: R.values,
14296
14310
  validationErrors: R.errors,
14297
14311
  isSaving: R.isSaving,
14298
- handleEditClick: Q,
14299
- handleCancelEdit: ug,
14300
- handleSaveEdit: dg,
14301
- handleInputChange: fg
14312
+ handleEditClick: ig,
14313
+ handleCancelEdit: ag,
14314
+ handleSaveEdit: og,
14315
+ handleInputChange: sg
14302
14316
  };
14303
- };
14317
+ }, ChevronDownIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14318
+ width: t,
14319
+ height: t,
14320
+ fill: e || "currentColor",
14321
+ viewBox: "0 0 20 20",
14322
+ 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" })
14323
+ }), ChevronRightIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14324
+ width: t,
14325
+ height: t,
14326
+ fill: e || "currentColor",
14327
+ viewBox: "0 0 20 20",
14328
+ children: /* @__PURE__ */ jsx("path", {
14329
+ fillRule: "evenodd",
14330
+ 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",
14331
+ clipRule: "evenodd"
14332
+ })
14333
+ }), FileIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14334
+ width: t,
14335
+ height: t,
14336
+ fill: "none",
14337
+ stroke: e || "currentColor",
14338
+ viewBox: "0 0 24 24",
14339
+ children: /* @__PURE__ */ jsx("path", {
14340
+ strokeLinecap: "round",
14341
+ strokeLinejoin: "round",
14342
+ strokeWidth: 2,
14343
+ 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"
14344
+ })
14345
+ }), TrashIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14346
+ className: `w-${t / 4} h-${t / 4}`,
14347
+ fill: "none",
14348
+ stroke: e || "currentColor",
14349
+ viewBox: "0 0 24 24",
14350
+ width: t,
14351
+ height: t,
14352
+ children: /* @__PURE__ */ jsx("path", {
14353
+ strokeLinecap: "round",
14354
+ strokeLinejoin: "round",
14355
+ strokeWidth: 2,
14356
+ d: "M6 18L18 6M6 6l12 12"
14357
+ })
14358
+ }), UploadIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
14359
+ width: t,
14360
+ height: t,
14361
+ fill: "none",
14362
+ stroke: e || "currentColor",
14363
+ viewBox: "0 0 24 24",
14364
+ children: /* @__PURE__ */ jsx("path", {
14365
+ strokeLinecap: "round",
14366
+ strokeLinejoin: "round",
14367
+ strokeWidth: 2,
14368
+ 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"
14369
+ })
14370
+ });
14304
14371
  var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: i = {}, defaultPageSize: o = 10, pageSizeOptions: d = [
14305
14372
  10,
14306
14373
  25,
@@ -14310,7 +14377,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14310
14377
  300,
14311
14378
  400,
14312
14379
  500
14313
- ], enableSorting: _ = !0, enableFiltering: v = !0, enablePagination: y = !0, enableExport: b = !0, initialConfig: x, onConfigChange: S, className: C = "", labels: w = {
14380
+ ], enableSorting: _ = !0, enableFiltering: v = !0, enablePagination: y = !0, enableExport: b = !0, exportFileName: x, initialConfig: S, onConfigChange: C, className: w = "", labels: T = {
14314
14381
  configuration: "Configuración",
14315
14382
  columnVisibility: "Columnas visibles",
14316
14383
  pagination: {
@@ -14323,24 +14390,30 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14323
14390
  },
14324
14391
  clearAllFilters: "Limpiar todos los filtros",
14325
14392
  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);
14393
+ }, 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 }) => {
14394
+ let [W, Hh] = useState(t), [G, K] = useState([]), q = useCallback((e) => {
14395
+ let t = typeof j == "function" ? j(e) : e[j];
14396
+ K((e) => {
14397
+ let n = e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
14398
+ return zh?.(n), n;
14399
+ });
14400
+ }, [j, zh]), [J, Uh] = useState(null), [Wh, Gh] = useState({}), [Kh, qh] = useState({}), [Jh, Yh] = useState(!1), [Xh, Zh] = useState({}), Qh = useCallback((e) => {
14401
+ let t = typeof j == "function" ? j(e) : e[j];
14402
+ Uh(t);
14330
14403
  let n = {};
14331
- U.forEach((t) => {
14404
+ W.forEach((t) => {
14332
14405
  if (t.editable) {
14333
14406
  let i = typeof t.accessor == "function" ? t.accessor(e) : e[t.accessor];
14334
14407
  n[t.id] = i;
14335
14408
  }
14336
- }), Wh(n), G({});
14337
- }, [A, U]), qh = useCallback(() => {
14338
- W(null), Wh({}), G({}), Bh?.();
14339
- }, [Bh]), Jh = useCallback(async (e) => {
14409
+ }), Gh(n), qh({});
14410
+ }, [j, W]), $h = useCallback(() => {
14411
+ Uh(null), Gh({}), qh({}), Ih?.();
14412
+ }, [Ih]), eg = useCallback(async (e) => {
14340
14413
  let t = {}, n = !1, i = {};
14341
- if (U.forEach((e) => {
14414
+ if (W.forEach((e) => {
14342
14415
  if (e.editable) {
14343
- let a = Uh[e.id];
14416
+ let a = Wh[e.id];
14344
14417
  if (e.inputType === "number" && typeof a == "string" && a !== "") {
14345
14418
  let e = Number(a);
14346
14419
  isNaN(e) || (a = e);
@@ -14352,55 +14425,55 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14352
14425
  typeof e.accessor == "string" ? i[e.accessor] = a : i[e.id] = a;
14353
14426
  }
14354
14427
  }), n) {
14355
- G(t);
14428
+ qh(t);
14356
14429
  return;
14357
14430
  }
14358
- Kh(!0);
14431
+ Yh(!0);
14359
14432
  try {
14360
- await H?.(e, i), W(null), Wh({});
14433
+ await Fh?.(e, i), Uh(null), Gh({});
14361
14434
  } catch (e) {
14362
14435
  console.error("Failed to save row", e);
14363
14436
  } finally {
14364
- Kh(!1);
14437
+ Yh(!1);
14365
14438
  }
14366
14439
  }, [
14367
- H,
14368
- U,
14369
- Uh
14370
- ]), Yh = (e, t) => {
14371
- Wh((n) => ({
14440
+ Fh,
14441
+ W,
14442
+ Wh
14443
+ ]), Y = (e, t) => {
14444
+ Gh((n) => ({
14372
14445
  ...n,
14373
14446
  [e]: t
14374
- })), Gh[e] && G((t) => {
14447
+ })), Kh[e] && qh((t) => {
14375
14448
  let n = { ...t };
14376
14449
  return delete n[e], n;
14377
14450
  });
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({
14451
+ }, { 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
14452
  data: e,
14380
- columns: U,
14453
+ columns: W,
14381
14454
  defaultSort: n,
14382
14455
  defaultFilters: i,
14383
14456
  defaultPageSize: o,
14384
14457
  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,
14458
+ initialConfig: S,
14459
+ onConfigChange: C,
14460
+ fetchData: I,
14461
+ onPaginationChange: R,
14462
+ onFiltersChange: z,
14463
+ rowKey: j,
14464
+ onRowSelectionChange: M,
14465
+ syncFiltersWithUrl: B,
14393
14466
  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) => {
14467
+ }), { paginatedData: Q, sortConfig: pg, filters: mg, pagination: hg, hiddenColumns: gg, pinnedColumns: _g, selectedRows: vg, columnWidths: yg, loading: bg, totalUnfiltered: xg } = X, Sg = F || bg;
14468
+ useEffect(() => Hh(t), [t]), useEffect(() => {
14469
+ Q.length !== 0 && Zh((e) => {
14397
14470
  let t = { ...e }, n = !1;
14398
- return Object.entries(Q).forEach(([e, i]) => {
14471
+ return Object.entries(mg).forEach(([e, i]) => {
14399
14472
  if (i.type !== "multiselect" || !Array.isArray(i.value)) return;
14400
- let a = U.find((t) => t.id === e);
14473
+ let a = W.find((t) => t.id === e);
14401
14474
  a?.filterLabelAccessor && i.value.forEach((i) => {
14402
14475
  if (t[e]?.[i]) return;
14403
- let o = Z.find((e) => {
14476
+ let o = Q.find((e) => {
14404
14477
  let t = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor];
14405
14478
  return String(t) === i;
14406
14479
  });
@@ -14412,39 +14485,39 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14412
14485
  }), n ? t : e;
14413
14486
  });
14414
14487
  }, [
14415
- Z,
14416
14488
  Q,
14417
- U
14489
+ mg,
14490
+ W
14418
14491
  ]);
14419
- let vg = useRef(null), yg = useRef(null), [bg, xg] = useState(0);
14492
+ let Cg = useRef(null), wg = useRef(null), [Tg, Eg] = useState(0);
14420
14493
  useEffect(() => {
14421
14494
  let e = () => {
14422
- vg.current && xg(vg.current.scrollWidth);
14495
+ Cg.current && Eg(Cg.current.scrollWidth);
14423
14496
  };
14424
14497
  e();
14425
14498
  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({
14499
+ return Cg.current && t.observe(Cg.current), () => t.disconnect();
14500
+ }, [Q, W]);
14501
+ let Dg = (e) => {
14502
+ Cg.current && (Cg.current.scrollLeft = e.currentTarget.scrollLeft);
14503
+ }, Og = (e) => {
14504
+ wg.current && (wg.current.scrollLeft = e.currentTarget.scrollLeft);
14505
+ }, kg = useMemo(() => {
14506
+ let e = [...tg], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
14507
+ return k && n.unshift({
14435
14508
  id: "selection-synthetic",
14436
14509
  label: "",
14437
- accessor: (e) => e[A],
14510
+ accessor: (e) => e[j],
14438
14511
  width: 50,
14439
14512
  minWidth: 50,
14440
14513
  render: ({ row: e }) => {
14441
- let t = e[A];
14514
+ let t = e[j];
14442
14515
  return /* @__PURE__ */ jsx("input", {
14443
14516
  type: "checkbox",
14444
14517
  className: "w-4 h-4 accent-redi-primary cursor-pointer",
14445
- checked: pg.includes(t),
14518
+ checked: vg.includes(t),
14446
14519
  onChange: (e) => {
14447
- e.stopPropagation(), X(t);
14520
+ e.stopPropagation(), lg(t);
14448
14521
  },
14449
14522
  onClick: (e) => e.stopPropagation()
14450
14523
  });
@@ -14453,29 +14526,52 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14453
14526
  filterable: !1,
14454
14527
  sortable: !1,
14455
14528
  draggable: !1
14456
- }), (M || V) && n.push({
14529
+ }), Lh && n.unshift({
14530
+ id: "expand-synthetic",
14531
+ label: Bh || "",
14532
+ width: 50,
14533
+ minWidth: 50,
14534
+ accessor: (e) => e[j],
14535
+ render: ({ row: e, data: t }) => {
14536
+ let n = typeof j == "function" ? j(e) : e[j], i = G.includes(n);
14537
+ return !H || H({
14538
+ row: e,
14539
+ data: t
14540
+ }) ? /* @__PURE__ */ jsx("div", {
14541
+ className: "cursor-pointer p-1 hover:bg-gray-200 rounded-full w-fit flex items-center justify-center",
14542
+ onClick: (t) => {
14543
+ t.stopPropagation(), q(e);
14544
+ },
14545
+ children: jsx(i ? ChevronDownIcon : ChevronRightIcon, { size: 20 })
14546
+ }) : null;
14547
+ },
14548
+ isAction: !1,
14549
+ filterable: !1,
14550
+ sortable: !1,
14551
+ draggable: !1
14552
+ }), (N || V) && n.push({
14457
14553
  id: "actions-synthetic",
14458
- label: N || "",
14459
- accessor: (e) => e[A],
14460
- 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", {
14554
+ label: P || "",
14555
+ accessor: (e) => e[j],
14556
+ render: ({ row: e, column: t, index: n, data: i }) => {
14557
+ let a = typeof j == "function" ? j(e) : e[j];
14558
+ return V ? J === a ? /* @__PURE__ */ jsxs("div", {
14463
14559
  className: "flex items-center gap-2",
14464
14560
  children: [/* @__PURE__ */ jsx(Button_default, {
14465
14561
  level: "icon",
14466
14562
  onClick: (t) => {
14467
- t.stopPropagation(), Jh(e);
14563
+ t.stopPropagation(), eg(e);
14468
14564
  },
14469
- disabled: K,
14565
+ disabled: Jh,
14470
14566
  className: "text-green-600 hover:bg-green-100 p-1 rounded-full",
14471
14567
  label: "Save",
14472
14568
  children: /* @__PURE__ */ jsx(CheckIcon, { size: 18 })
14473
14569
  }), /* @__PURE__ */ jsx(Button_default, {
14474
14570
  level: "icon",
14475
14571
  onClick: (e) => {
14476
- e.stopPropagation(), qh();
14572
+ e.stopPropagation(), $h();
14477
14573
  },
14478
- disabled: K,
14574
+ disabled: Jh,
14479
14575
  className: "text-red-600 hover:bg-red-100 p-1 rounded-full",
14480
14576
  label: "Cancel",
14481
14577
  children: /* @__PURE__ */ jsx(CloseIcon, { size: 18 })
@@ -14485,20 +14581,22 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14485
14581
  children: [/* @__PURE__ */ jsx(Button_default, {
14486
14582
  level: "icon",
14487
14583
  onClick: (t) => {
14488
- t.stopPropagation(), Y(e);
14584
+ t.stopPropagation(), Qh(e);
14489
14585
  },
14490
14586
  className: "text-blue-600 hover:bg-blue-100 p-1 rounded-full",
14491
14587
  label: "Edit",
14492
14588
  children: /* @__PURE__ */ jsx(EditIcon, { size: 18 })
14493
- }), M && M({
14589
+ }), N && N({
14494
14590
  row: e,
14495
14591
  index: n,
14496
- column: t
14592
+ column: t,
14593
+ data: i
14497
14594
  })]
14498
- }) : M ? M({
14595
+ }) : N ? N({
14499
14596
  row: e,
14500
14597
  index: n,
14501
- column: t
14598
+ column: t,
14599
+ data: i
14502
14600
  }) : null;
14503
14601
  },
14504
14602
  width: 100,
@@ -14508,43 +14606,56 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14508
14606
  draggable: !1
14509
14607
  }), n;
14510
14608
  }, [
14511
- Zh,
14512
- O,
14513
- M,
14514
- V,
14515
- A,
14516
- pg,
14517
- X,
14609
+ tg,
14610
+ k,
14518
14611
  N,
14519
- Hh,
14520
- K,
14612
+ V,
14613
+ j,
14614
+ vg,
14615
+ lg,
14616
+ P,
14617
+ J,
14521
14618
  Jh,
14522
- qh,
14523
- Y
14524
- ]), Tg = (e = "xlsx", t) => {
14619
+ eg,
14620
+ $h,
14621
+ Qh,
14622
+ Lh,
14623
+ G,
14624
+ H,
14625
+ q,
14626
+ Bh
14627
+ ]), Ag = (e = "xlsx", t) => {
14525
14628
  if (!b) return;
14526
14629
  let n = [];
14527
14630
  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) => {
14631
+ let e = new Map(X.columnOrder.map((e, t) => [e, t]));
14632
+ n = W.filter((e) => t.includes(e.id)).sort((t, n) => {
14530
14633
  let i = e.get(t.id) ?? 9999, a = e.get(n.id) ?? 9999;
14531
14634
  return i - a;
14532
14635
  });
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(() => {
14636
+ } else n = kg.filter((e) => !e.isAction);
14637
+ U && (n = [...n, ...U]);
14638
+ let i = X.filteredData;
14639
+ Vh && (i = X.filteredData.flatMap((e) => {
14640
+ let t = Vh({
14641
+ row: e,
14642
+ data: X.filteredData
14643
+ }) || [];
14644
+ return [e, ...t];
14645
+ })), exportToExcel(i, n, x || "table-data", e);
14646
+ }, 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
14647
  let e = [];
14537
- return Object.entries(Q).forEach(([t, n]) => {
14538
- let i = U.find((e) => e.id === t);
14648
+ return Object.entries(mg).forEach(([t, n]) => {
14649
+ let i = W.find((e) => e.id === t);
14539
14650
  i && (n.type === "text" && n.value ? e.push({
14540
14651
  columnId: t,
14541
14652
  columnLabel: i.label,
14542
14653
  value: String(n.value),
14543
14654
  displayValue: String(n.value)
14544
14655
  }) : n.type === "multiselect" && Array.isArray(n.value) && n.value.length > 0 && n.value.forEach((n) => {
14545
- let a = q[t]?.[n], o = a ?? n;
14656
+ let a = Xh[t]?.[n], o = a ?? n;
14546
14657
  if (!a && i.filterLabelAccessor) {
14547
- let e = Z.find((e) => {
14658
+ let e = Q.find((e) => {
14548
14659
  let t = typeof i.accessor == "function" ? i.accessor(e) : e[i.accessor];
14549
14660
  return String(t) === n;
14550
14661
  });
@@ -14559,109 +14670,111 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14559
14670
  }));
14560
14671
  }), e;
14561
14672
  }, [
14673
+ mg,
14674
+ W,
14562
14675
  Q,
14563
- U,
14564
- Z,
14565
- q
14566
- ]), Og = (e, t) => {
14567
- let n = Q[e];
14568
- if (n.type === "text") $h(e, "", "text");
14676
+ Xh
14677
+ ]), Ng = (e, t) => {
14678
+ let n = mg[e];
14679
+ if (n.type === "text") Z(e, "", "text");
14569
14680
  else if (n.type === "multiselect" && Array.isArray(n.value)) {
14570
14681
  let i = n.value.filter((e) => e !== t);
14571
- $h(e, i, "multiselect");
14682
+ Z(e, i, "multiselect");
14572
14683
  }
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);
14684
+ }, 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
14685
  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}`,
14686
+ className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${w}`,
14576
14687
  children: [
14577
14688
  /* @__PURE__ */ jsx(TableToolbar_default, {
14578
- fetchData: F,
14579
- onRefresh: I,
14689
+ fetchData: I,
14690
+ onRefresh: L,
14580
14691
  handleRefreshClick: () => {
14581
- cg(), I?.();
14692
+ fg(), L?.();
14582
14693
  },
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,
14694
+ isLoading: Sg,
14695
+ enableColumnConfig: Ph,
14696
+ labels: T,
14697
+ tableColumns: W,
14698
+ hiddenColumns: gg,
14699
+ pinnedColumns: _g,
14700
+ handleToggleColumn: sg,
14701
+ handleTogglePin: cg,
14702
+ setTableColumns: Hh,
14703
+ enableColumnPinning: D,
14593
14704
  enableFiltering: v,
14594
- hasActiveFilters: Eg,
14595
- clearAllFilters: eg,
14596
- activeFilterTags: Dg,
14597
- handleRemoveFilterTag: Og,
14705
+ hasActiveFilters: jg,
14706
+ clearAllFilters: rg,
14707
+ activeFilterTags: Mg,
14708
+ handleRemoveFilterTag: Ng,
14598
14709
  enableExport: b,
14599
- handleExport: Tg
14710
+ handleExport: Ag
14600
14711
  }),
14601
14712
  y && /* @__PURE__ */ jsx("div", {
14602
- ref: yg,
14713
+ ref: wg,
14603
14714
  className: `overflow-x-auto bg-gray-50 border-b border-gray-200 ${y ? "md:overflow-y-hidden" : ""}`,
14604
- onScroll: Sg,
14715
+ onScroll: Dg,
14605
14716
  style: { height: "12px" },
14606
14717
  children: /* @__PURE__ */ jsx("div", { style: {
14607
- width: bg,
14718
+ width: Tg,
14608
14719
  height: "1px"
14609
14720
  } })
14610
14721
  }),
14611
14722
  /* @__PURE__ */ jsx("div", {
14612
- ref: vg,
14613
- onScroll: Cg,
14723
+ ref: Cg,
14724
+ onScroll: Og,
14614
14725
  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
14726
  children: /* @__PURE__ */ jsxs("table", {
14616
14727
  className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
14617
14728
  "aria-label": "Data Table",
14618
14729
  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,
14730
+ displayColumns: kg,
14731
+ getColumnWidth: Fg,
14732
+ pinnedColumns: _g,
14733
+ stickyActionsColumn: A,
14734
+ enableColumnReordering: E,
14735
+ handleColumnReorder: og,
14736
+ sortConfig: pg,
14737
+ handleSort: ng,
14627
14738
  enableSorting: _,
14628
- filters: Q,
14629
- handleFilter: $h,
14630
- fetchData: F,
14739
+ filters: mg,
14740
+ handleFilter: Z,
14741
+ fetchData: I,
14631
14742
  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
14743
+ paginatedData: Q,
14744
+ enableColumnResizing: O,
14745
+ handleColumnResize: dg,
14746
+ tableColumns: W,
14747
+ rowKey: j,
14748
+ selectedRows: vg,
14749
+ handleSelectAll: ug,
14750
+ stateColumnOrder: X.columnOrder
14640
14751
  }), /* @__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,
14752
+ loading: F,
14753
+ paginatedData: Q,
14754
+ displayColumns: kg,
14755
+ getColumnWidth: Fg,
14756
+ pinnedColumns: _g,
14757
+ stickyActionsColumn: A,
14758
+ rowKey: j,
14759
+ editingRowId: J,
14649
14760
  enableInlineEditing: V,
14650
- editValues: Uh,
14651
- validationErrors: Gh,
14652
- handleInputChange: Yh,
14653
- labels: w
14761
+ editValues: Wh,
14762
+ validationErrors: Kh,
14763
+ handleInputChange: Y,
14764
+ labels: T,
14765
+ expandedRowIds: G,
14766
+ renderSubComponent: Rh
14654
14767
  })]
14655
14768
  })
14656
14769
  }),
14657
14770
  y && /* @__PURE__ */ jsx(TablePagination, {
14658
- pagination: ug,
14659
- labels: w,
14660
- totalUnfiltered: gg,
14771
+ pagination: hg,
14772
+ labels: T,
14773
+ totalUnfiltered: xg,
14661
14774
  pageSizeOptions: d,
14662
- handlePageSizeChange: ng,
14663
- handlePageChange: tg,
14664
- totalPages: kg
14775
+ handlePageSizeChange: ag,
14776
+ handlePageChange: ig,
14777
+ totalPages: Pg
14665
14778
  })
14666
14779
  ]
14667
14780
  });
@@ -16563,46 +16676,7 @@ var tones = {
16563
16676
  onChange: (e) => t(e.target.value),
16564
16677
  disabled: a,
16565
16678
  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: _ }) => {
16679
+ }), 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
16680
  let [v, y] = useState([]), [b, x] = useState({}), [S, C] = useState(!1), w = useRef(null), T = (t) => {
16607
16681
  if (t.target.files) {
16608
16682
  let i = Array.from(t.target.files), a = c ? i.filter((e) => e.size <= c) : i;
@@ -16752,15 +16826,7 @@ var FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i
16752
16826
  children: t.label
16753
16827
  })]
16754
16828
  }, 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 }) => {
16829
+ }), 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
16830
  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
16831
  "--custom-color": b.main,
16766
16832
  borderColor: g && !s ? b.main : void 0,