import { f as mt, i as _, g as I, r as b, c as Tt, b as B, d as O, h as vt, a as C, L as D, j as x, M as jt, t as l } from "./_MapCache-CdMtAzzF.js";
import { useCallback as y, useLayoutEffect as ht, useState as At, useRef as _t, useEffect as W } from "react";
var xt = /\s/;
function It(t) {
  for (var r = t.length; r-- && xt.test(t.charAt(r)); )
    ;
  return r;
}
var Ot = /^\s+/;
function wt(t) {
  return t && t.slice(0, It(t) + 1).replace(Ot, "");
}
var N = NaN, Et = /^[-+]0x[0-9a-f]+$/i, St = /^0b[01]+$/i, $t = /^0o[0-7]+$/i, Pt = parseInt;
function G(t) {
  if (typeof t == "number")
    return t;
  if (mt(t))
    return N;
  if (_(t)) {
    var r = typeof t.valueOf == "function" ? t.valueOf() : t;
    t = _(r) ? r + "" : r;
  }
  if (typeof t != "string")
    return t === 0 ? t : +t;
  t = wt(t);
  var e = St.test(t);
  return e || $t.test(t) ? Pt(t.slice(2), e ? 2 : 8) : Et.test(t) ? N : +t;
}
var M = I(b, "WeakMap"), Mt = 9007199254740991, kt = /^(?:0|[1-9]\d*)$/;
function zt(t, r) {
  var e = typeof t;
  return r = r ?? Mt, !!r && (e == "number" || e != "symbol" && kt.test(t)) && t > -1 && t % 1 == 0 && t < r;
}
var Ft = 9007199254740991;
function et(t) {
  return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Ft;
}
function nt(t) {
  return t != null && et(t.length) && !Tt(t);
}
var Bt = Object.prototype;
function at(t) {
  var r = t && t.constructor, e = typeof r == "function" && r.prototype || Bt;
  return t === e;
}
function Ct(t, r) {
  for (var e = -1, n = Array(t); ++e < t; )
    n[e] = r(e);
  return n;
}
var Dt = "[object Arguments]";
function K(t) {
  return B(t) && O(t) == Dt;
}
var it = Object.prototype, Lt = it.hasOwnProperty, Rt = it.propertyIsEnumerable, ot = K(/* @__PURE__ */ function() {
  return arguments;
}()) ? K : function(t) {
  return B(t) && Lt.call(t, "callee") && !Rt.call(t, "callee");
};
function Ut() {
  return !1;
}
var st = typeof exports == "object" && exports && !exports.nodeType && exports, q = st && typeof module == "object" && module && !module.nodeType && module, Wt = q && q.exports === st, X = Wt ? b.Buffer : void 0, Nt = X ? X.isBuffer : void 0, ct = Nt || Ut, Gt = "[object Arguments]", Kt = "[object Array]", qt = "[object Boolean]", Xt = "[object Date]", Ht = "[object Error]", Yt = "[object Function]", Zt = "[object Map]", Jt = "[object Number]", Qt = "[object Object]", Vt = "[object RegExp]", tr = "[object Set]", rr = "[object String]", er = "[object WeakMap]", nr = "[object ArrayBuffer]", ar = "[object DataView]", ir = "[object Float32Array]", or = "[object Float64Array]", sr = "[object Int8Array]", cr = "[object Int16Array]", ur = "[object Int32Array]", fr = "[object Uint8Array]", pr = "[object Uint8ClampedArray]", dr = "[object Uint16Array]", gr = "[object Uint32Array]", i = {};
i[ir] = i[or] = i[sr] = i[cr] = i[ur] = i[fr] = i[pr] = i[dr] = i[gr] = !0;
i[Gt] = i[Kt] = i[nr] = i[qt] = i[ar] = i[Xt] = i[Ht] = i[Yt] = i[Zt] = i[Jt] = i[Qt] = i[Vt] = i[tr] = i[rr] = i[er] = !1;
function br(t) {
  return B(t) && et(t.length) && !!i[O(t)];
}
function yr(t) {
  return function(r) {
    return t(r);
  };
}
var ut = typeof exports == "object" && exports && !exports.nodeType && exports, v = ut && typeof module == "object" && module && !module.nodeType && module, lr = v && v.exports === ut, $ = lr && vt.process, H = function() {
  try {
    var t = v && v.require && v.require("util").types;
    return t || $ && $.binding && $.binding("util");
  } catch {
  }
}(), Y = H && H.isTypedArray, ft = Y ? yr(Y) : br, mr = Object.prototype, Tr = mr.hasOwnProperty;
function vr(t, r) {
  var e = C(t), n = !e && ot(t), a = !e && !n && ct(t), u = !e && !n && !a && ft(t), s = e || n || a || u, f = s ? Ct(t.length, String) : [], c = f.length;
  for (var o in t)
    (r || Tr.call(t, o)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
    (o == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    a && (o == "offset" || o == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    u && (o == "buffer" || o == "byteLength" || o == "byteOffset") || // Skip index properties.
    zt(o, c))) && f.push(o);
  return f;
}
function jr(t, r) {
  return function(e) {
    return t(r(e));
  };
}
var hr = jr(Object.keys, Object), Ar = Object.prototype, _r = Ar.hasOwnProperty;
function pt(t) {
  if (!at(t))
    return hr(t);
  var r = [];
  for (var e in Object(t))
    _r.call(t, e) && e != "constructor" && r.push(e);
  return r;
}
function xr(t) {
  return nt(t) ? vr(t) : pt(t);
}
function Ir(t, r) {
  for (var e = -1, n = r.length, a = t.length; ++e < n; )
    t[a + e] = r[e];
  return t;
}
function Or() {
  this.__data__ = new D(), this.size = 0;
}
function wr(t) {
  var r = this.__data__, e = r.delete(t);
  return this.size = r.size, e;
}
function Er(t) {
  return this.__data__.get(t);
}
function Sr(t) {
  return this.__data__.has(t);
}
var $r = 200;
function Pr(t, r) {
  var e = this.__data__;
  if (e instanceof D) {
    var n = e.__data__;
    if (!x || n.length < $r - 1)
      return n.push([t, r]), this.size = ++e.size, this;
    e = this.__data__ = new jt(n);
  }
  return e.set(t, r), this.size = e.size, this;
}
function j(t) {
  var r = this.__data__ = new D(t);
  this.size = r.size;
}
j.prototype.clear = Or;
j.prototype.delete = wr;
j.prototype.get = Er;
j.prototype.has = Sr;
j.prototype.set = Pr;
function Mr(t, r) {
  for (var e = -1, n = t == null ? 0 : t.length, a = 0, u = []; ++e < n; ) {
    var s = t[e];
    r(s, e, t) && (u[a++] = s);
  }
  return u;
}
function kr() {
  return [];
}
var zr = Object.prototype, Fr = zr.propertyIsEnumerable, Z = Object.getOwnPropertySymbols, Br = Z ? function(t) {
  return t == null ? [] : (t = Object(t), Mr(Z(t), function(r) {
    return Fr.call(t, r);
  }));
} : kr;
function Cr(t, r, e) {
  var n = r(t);
  return C(t) ? n : Ir(n, e(t));
}
function ee(t) {
  return Cr(t, xr, Br);
}
var k = I(b, "DataView"), z = I(b, "Promise"), F = I(b, "Set"), J = "[object Map]", Dr = "[object Object]", Q = "[object Promise]", V = "[object Set]", tt = "[object WeakMap]", rt = "[object DataView]", Lr = l(k), Rr = l(x), Ur = l(z), Wr = l(F), Nr = l(M), g = O;
(k && g(new k(new ArrayBuffer(1))) != rt || x && g(new x()) != J || z && g(z.resolve()) != Q || F && g(new F()) != V || M && g(new M()) != tt) && (g = function(t) {
  var r = O(t), e = r == Dr ? t.constructor : void 0, n = e ? l(e) : "";
  if (n)
    switch (n) {
      case Lr:
        return rt;
      case Rr:
        return J;
      case Ur:
        return Q;
      case Wr:
        return V;
      case Nr:
        return tt;
    }
  return r;
});
var ne = b.Uint8Array, P = function() {
  return b.Date.now();
}, Gr = "Expected a function", Kr = Math.max, qr = Math.min;
function dt(t, r, e) {
  var n, a, u, s, f, c, o = 0, h = !1, m = !1, w = !0;
  if (typeof t != "function")
    throw new TypeError(Gr);
  r = G(r) || 0, _(e) && (h = !!e.leading, m = "maxWait" in e, u = m ? Kr(G(e.maxWait) || 0, r) : u, w = "trailing" in e ? !!e.trailing : w);
  function E(p) {
    var d = n, T = a;
    return n = a = void 0, o = p, s = t.apply(T, d), s;
  }
  function gt(p) {
    return o = p, f = setTimeout(A, r), h ? E(p) : s;
  }
  function bt(p) {
    var d = p - c, T = p - o, U = r - d;
    return m ? qr(U, u - T) : U;
  }
  function L(p) {
    var d = p - c, T = p - o;
    return c === void 0 || d >= r || d < 0 || m && T >= u;
  }
  function A() {
    var p = P();
    if (L(p))
      return R(p);
    f = setTimeout(A, bt(p));
  }
  function R(p) {
    return f = void 0, w && n ? E(p) : (n = a = void 0, s);
  }
  function yt() {
    f !== void 0 && clearTimeout(f), o = 0, n = c = a = f = void 0;
  }
  function lt() {
    return f === void 0 ? s : R(P());
  }
  function S() {
    var p = P(), d = L(p);
    if (n = arguments, a = this, c = p, d) {
      if (f === void 0)
        return gt(c);
      if (m)
        return clearTimeout(f), f = setTimeout(A, r), E(c);
    }
    return f === void 0 && (f = setTimeout(A, r)), s;
  }
  return S.cancel = yt, S.flush = lt, S;
}
var Xr = "[object Map]", Hr = "[object Set]", Yr = Object.prototype, Zr = Yr.hasOwnProperty;
function ae(t) {
  if (t == null)
    return !0;
  if (nt(t) && (C(t) || typeof t == "string" || typeof t.splice == "function" || ct(t) || ft(t) || ot(t)))
    return !t.length;
  var r = g(t);
  if (r == Xr || r == Hr)
    return !t.size;
  if (at(t))
    return !pt(t).length;
  for (var e in t)
    if (Zr.call(t, e))
      return !1;
  return !0;
}
var Jr = "Expected a function";
function Qr(t, r, e) {
  var n = !0, a = !0;
  if (typeof t != "function")
    throw new TypeError(Jr);
  return _(e) && (n = "leading" in e ? !!e.leading : n, a = "trailing" in e ? !!e.trailing : a), dt(t, r, {
    leading: n,
    maxWait: r,
    trailing: a
  });
}
function ie(t, r, e = 100) {
  const n = y(
    Qr((a) => {
      document.hidden || r(a);
    }, e),
    [r, e]
  );
  ht(() => {
    let a = 0;
    const u = t.current;
    if (!u) return;
    const s = new ResizeObserver(() => {
      cancelAnimationFrame(a), a = requestAnimationFrame(() => n(u));
    });
    return s.observe(u), () => {
      cancelAnimationFrame(a), s.disconnect(), n.cancel();
    };
  }, [t, n]);
}
const Vr = ({ items: t, onReorder: r }) => {
  const e = y(
    (a) => {
      const { active: u, over: s } = a;
      if (!s || u.id === s.id) return;
      const f = parseInt(u.id.toString().split("-")[1]), c = parseInt(s.id.toString().split("-")[1]), o = [...t], [h] = o.splice(f, 1);
      o.splice(c, 0, h), r == null || r(o);
    },
    [t, r]
  ), n = y((a) => `sort-${a}`, []);
  return {
    handleDragEnd: e,
    getItemId: n
  };
}, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: Vr
}, Symbol.toStringTag, { value: "Module" })), se = ({ handleChangeSearchValue: t, searchValue: r }) => {
  const [e, n] = At(""), a = _t(dt((c) => t == null ? void 0 : t(c), 300));
  W(() => n(r ?? ""), [r]), W(() => {
    const c = a.current;
    return () => {
      c.cancel();
    };
  }, []);
  const u = y((c) => {
    const o = c.target.value;
    n(o), a.current(o);
  }, []), s = y((c) => {
    n(c), a.current(c);
  }, []);
  return {
    handleResetSearch: y(() => {
      n(""), t == null || t("");
    }, [t]),
    handleSearchChange: u,
    handleStringSearchChange: s,
    search: e
  };
};
export {
  oe as A,
  j as S,
  ne as U,
  ie as a,
  zt as b,
  at as c,
  dt as d,
  et as e,
  ot as f,
  ct as g,
  ft as h,
  nt as i,
  Mr as j,
  xr as k,
  yr as l,
  F as m,
  H as n,
  ae as o,
  se as p,
  vr as q,
  Ir as r,
  jr as s,
  G as t,
  Vr as u,
  Br as v,
  kr as w,
  Cr as x,
  g as y,
  ee as z
};
//# sourceMappingURL=use-debounce-search-V04Zachp.js.map
