import { useState as m, useEffect as A } from "react";
function n(o) {
  const [V, s] = m(void 0);
  A(() => {
    (o == null ? void 0 : o.condition) === void 0 && s(void 0);
  }, [o == null ? void 0 : o.condition]);
  const c = (o == null ? void 0 : o.condition) === void 0 ? V : o == null ? void 0 : o.condition;
  return {
    memoizedFilterCondition: c,
    handleFilterInputChange: (a) => {
      var F;
      const e = { ...c || {}, ...a }, h = Object.keys(e).reduce(
        (C, g) => {
          const d = e[g];
          return d && Array.isArray(d.value) && d.value.length > 0 && (C[g] = d), C;
        },
        {}
      ), v = Object.keys(h).length === 0 ? void 0 : h;
      s(v), (F = o == null ? void 0 : o.onChange) == null || F.call(o, v);
    },
    handleClearAllFilters: () => {
      var a;
      s(void 0), (a = o == null ? void 0 : o.onChange) == null || a.call(o, void 0);
    }
  };
}
export {
  n as default
};
//# sourceMappingURL=useTableFilterInput.js.map
