import u from "./index-extends.js";
import * as h from "react";
import { clsx as k } from "./index-clsx.m.js";
import { Pen as w, Clock as y, Calendar as P } from "./index-icons.js";
import { useLocaleText as B } from "./index-useUtils.js";
import { getPickersToolbarUtilityClass as C, pickersToolbarClasses as v } from "./index-pickersToolbarClasses.js";
import { jsxs as d, jsx as t } from "react/jsx-runtime";
import L from "./index-useThemeProps.js";
import M from "./index-Typography.js";
import R from "./index-composeClasses.js";
import l from "./index-styled.js";
import j from "./index-Grid.js";
import N from "./index-IconButton2.js";
const S = (e) => {
  const {
    classes: o,
    isLandscape: r
  } = e;
  return R({
    root: ["root"],
    content: ["content"],
    penIconButton: ["penIconButton", r && "penIconButtonLandscape"]
  }, C, o);
}, V = l("div", {
  name: "MuiPickersToolbar",
  slot: "Root",
  overridesResolver: (e, o) => o.root
})(({
  theme: e,
  ownerState: o
}) => u({
  display: "flex",
  flexDirection: "column",
  alignItems: "flex-start",
  justifyContent: "space-between",
  padding: e.spacing(2, 3)
}, o.isLandscape && {
  height: "auto",
  maxWidth: 160,
  padding: 16,
  justifyContent: "flex-start",
  flexWrap: "wrap"
})), K = l(j, {
  name: "MuiPickersToolbar",
  slot: "Content",
  overridesResolver: (e, o) => o.content
})(({
  ownerState: e
}) => u({
  flex: 1
}, !e.isLandscape && {
  alignItems: "center"
})), D = l(N, {
  name: "MuiPickersToolbar",
  slot: "PenIconButton",
  overridesResolver: (e, o) => [{
    [`&.${v.penIconButtonLandscape}`]: o.penIconButtonLandscape
  }, o.penIconButton]
})({}), U = (e) => e === "clock" ? /* @__PURE__ */ t(y, {
  color: "inherit"
}) : /* @__PURE__ */ t(P, {
  color: "inherit"
}), Q = /* @__PURE__ */ h.forwardRef(function(o, r) {
  const s = L({
    props: o,
    name: "MuiPickersToolbar"
  }), {
    children: f,
    className: b,
    getMobileKeyboardInputViewButtonText: p,
    isLandscape: m,
    isMobileKeyboardViewOpen: i,
    landscapeDirection: T = "column",
    toggleMobileKeyboardView: x,
    toolbarTitle: g,
    viewType: a = "calendar"
  } = s, n = s, I = B(), c = S(n);
  return /* @__PURE__ */ d(V, {
    ref: r,
    className: k(c.root, b),
    ownerState: n,
    children: [/* @__PURE__ */ t(M, {
      color: "text.secondary",
      variant: "overline",
      children: g
    }), /* @__PURE__ */ d(K, {
      container: !0,
      justifyContent: "space-between",
      className: c.content,
      ownerState: n,
      direction: m ? T : "row",
      alignItems: m ? "flex-start" : "flex-end",
      children: [f, /* @__PURE__ */ t(D, {
        onClick: x,
        className: c.penIconButton,
        ownerState: n,
        color: "inherit",
        "aria-label": p ? p(i, a) : I.inputModeToggleButtonAriaLabel(i, a),
        children: i ? U(a) : /* @__PURE__ */ t(w, {
          color: "inherit"
        })
      })]
    })]
  });
});
export {
  Q as PickersToolbar
};
