import { j as e } from "../../../../_virtual/jsx-runtime.js";
import { Wrapper as r, RangeButtonsWrapper as o, MonthYear as a, ButtonsWrapper as c } from "./styles.js";
import l from "../../../../icons/ChevronLeft.js";
import s from "../../../../icons/ChevronRight.js";
import { IconButton as n } from "../../../IconButton/index.js";
import { getMonthName as i } from "../../dateUtils.js";
import { getNextYear as x } from "../calendar/utils.js";
const h = "previousMonthIconButton";
function $(t) {
  return t.selection === "range" && t.months === 2 ? /* @__PURE__ */ e.jsxs(r, { children: [
    /* @__PURE__ */ e.jsxs(o, { children: [
      /* @__PURE__ */ e.jsx(
        n,
        {
          className: h,
          icon: /* @__PURE__ */ e.jsx(l, {}),
          variant: "ghost-tertiary",
          size: "x-small",
          onClick: t.handlePrevMonth,
          "aria-label": "previous month",
          "data-testid": `${t["data-testid"]}-previousMonth`
        }
      ),
      /* @__PURE__ */ e.jsx(a, { isLeft: !0, "aria-live": "polite", children: `${i(t.currentMonth, t.locale)} ${t.currentYear}` })
    ] }),
    /* @__PURE__ */ e.jsxs(o, { children: [
      /* @__PURE__ */ e.jsx(a, { children: `${i(t.nextMonth, t.locale)} ${x(
        t.currentMonth,
        t.currentYear
      )}` }),
      /* @__PURE__ */ e.jsx(
        n,
        {
          icon: /* @__PURE__ */ e.jsx(s, {}),
          variant: "ghost-tertiary",
          size: "x-small",
          onClick: t.handleNextMonth,
          "aria-label": "next month",
          "data-testid": `${t["data-testid"]}-nextMonth`
        }
      )
    ] })
  ] }) : /* @__PURE__ */ e.jsxs(r, { children: [
    /* @__PURE__ */ e.jsx(a, { "aria-live": "polite", children: `${i(
      t.currentMonth,
      t.locale
    )} ${t.currentYear}` }),
    /* @__PURE__ */ e.jsxs(c, { children: [
      /* @__PURE__ */ e.jsx(
        n,
        {
          className: h,
          icon: /* @__PURE__ */ e.jsx(l, {}),
          variant: "ghost-tertiary",
          size: "x-small",
          onClick: t.handlePrevMonth,
          "aria-label": "previous month",
          "data-testid": `${t["data-testid"]}-previousMonth`
        }
      ),
      /* @__PURE__ */ e.jsx(
        n,
        {
          icon: /* @__PURE__ */ e.jsx(s, {}),
          variant: "ghost-tertiary",
          size: "x-small",
          onClick: t.handleNextMonth,
          "aria-label": "next month",
          "data-testid": `${t["data-testid"]}-nextMonth`
        }
      )
    ] })
  ] });
}
export {
  $ as Header,
  h as previousMonthButton
};
