import { jsxs as d, jsx as t } from "@emotion/react/jsx-runtime";
import { useModuleDictionary as A } from "@m4l/core";
import { ActionsCleanOutlined as C, ArrowRefreshCcwOutlined as S, ActionsSearchOutlined as h } from "@m4l/icons";
import { forwardRef as w } from "react";
import y from "../DynamicFilterBase/useDynamicFilterBase.js";
import b from "./useFilterActions.js";
import { DICCTIONARY as F } from "../../dictionary.js";
import { ActionsStyled as D, ActionsClearButtonStyled as R, ActionsSubmitButtonStyled as k } from "../../slots/dynamicFilterSlots.js";
const B = w((O, a) => {
  const {
    automatic: c,
    canShowRemoveAction: o,
    hasAppliedFilters: m,
    onClickClearFilters: f,
    onClickFilter: u,
    filterButtonDictionaryTooltip: p,
    ownerState: e
  } = b(), { size: i, ownerState: { isDirty: r }, visibleRefresh: l } = y(), { getLabel: n } = A(), s = l && (m || r);
  return !o && !s ? null : /* @__PURE__ */ d(D, { ref: a, ownerState: { ...e, isDirty: o, visibleRefresh: l }, children: [
    o && /* @__PURE__ */ t(
      R,
      {
        role: "button",
        "aria-label": "clear-filters",
        icon: /* @__PURE__ */ t(C, {}),
        size: i,
        onClick: f,
        tooltip: n(F.tooltip_clear_filters)
      }
    ),
    s ? /* @__PURE__ */ t(
      k,
      {
        icon: c ? /* @__PURE__ */ t(S, {}) : /* @__PURE__ */ t(h, {}),
        size: i,
        role: "button",
        "aria-label": "refresh",
        tooltip: n(p),
        onClick: u,
        ownerState: { ...e, isDirty: r }
      }
    ) : null
  ] });
});
B.displayName = "FilterActions";
export {
  B as default
};
