import { jsx as u } from "react/jsx-runtime";
import { useState as l, useEffect as m } from "react";
import { useDebouncedValue as i } from "../hooks/useDebounce.js";
import { c as f } from "../index-20bzTFSx.js";
import { cn as p } from "../utils/functions.js";
const h = ({ placeholder: t, callBack: r, className: s }) => {
  const [e, a] = l(""), { _value: o, loading: n } = i({ value: e, wait: 1e3, options: { leading: !1 } });
  return m(() => {
    r(o);
  }, [o]), /* @__PURE__ */ u(
    f,
    {
      className: p("_w-full", s),
      placeholder: t,
      value: e,
      isSearching: n,
      onChange: (c) => a(c.target.value),
      onCancel: () => a("")
    }
  );
}, w = {
  InputSearch: h
};
export {
  w as default
};
