import { useModuleSkeleton as y } from "@m4l/core";
import { getDynamicSortDictionary as D, DICCTIONARY as i } from "../../dictionary.js";
import { useDynamicSortStore as o } from "../../store/useDynamicSortStore.js";
function w() {
  const a = o((t) => t.automatic), c = y(), n = o((t) => t.ownerState?.isValid), r = o((t) => t.ownerState?.isDirty), e = o((t) => t.appliedSorts), l = o((t) => t.ownerState?.inEdition), { hidePopoverSort: S, clearSorts: d, fireOnChangeSorts: s } = o(
    (t) => t.actions
  );
  function p() {
    S(!1), d(), s();
  }
  const f = e.findIndex((t) => !t.fixed) > -1, m = e.length > 0, u = D(
    n ? r ? i.sort_tooltip_dirty : i.sort_tooltip_refresh : i.sort_tooltip_invalid
  );
  return {
    automatic: a,
    isSkeleton: c,
    canShowRemoveAction: f,
    hasAppliedSorts: m,
    onClickClearSorts: p,
    onClickSort: s,
    sortButtonDictionaryTooltip: u,
    ownerState: { isValid: n, isDirty: r, inEdition: l }
  };
}
export {
  w as default
};
