import { useMemo as c } from "react";
import { useChipsOverflow as f } from "../../hooks/useChipsOverflow.js";
import { useDynamicFilterStore as r } from "../../store/useDynamicFilterStore.js";
function R() {
  const s = r((i) => i.appliedFilters), p = r((i) => i.ownerState?.isSkeleton), o = c(() => {
    const i = [...s.filter((e) => e.fixed)].sort(
      (e, t) => e.isSet !== t.isSet ? Number(e.isSet) - Number(t.isSet) : t.id - e.id
    ), F = [...s.filter((e) => !e.fixed)].sort(
      (e, t) => e.isSet !== t.isSet ? Number(e.isSet) - Number(t.isSet) : t.id - e.id
    );
    return [...i, ...F];
  }, [s]), { visibleFilters: n, overflowFilters: d, parentRef: l, containerRef: S, setChipRef: m, setMoreChipRef: u, setActionsRef: a } = f(o);
  return {
    appliedFiltersSorted: o,
    visibleFilters: n,
    overflowFilters: d,
    isSkeleton: p,
    parentRef: l,
    containerRef: S,
    setChipRef: m,
    setMoreChipRef: u,
    setActionsRef: a
  };
}
export {
  R as default
};
