import b from "./index-objectWithoutPropertiesLoose.js";
import s from "./index-extends.js";
import * as g from "react";
import r from "./index-_virtual16.js";
import { clsx as y } from "./index-clsx.js";
import { c as v } from "./index-colorManipulator2.js";
import P from "./index-styled.js";
import c from "./index-getOverlayAlpha.js";
import h from "./index-useTheme.js";
import { getPaperUtilityClass as x } from "./index-paperClasses.js";
import { jsx as $ } from "react/jsx-runtime";
import { useDefaultProps as T } from "./index-DefaultPropsProvider.js";
import N from "./index-composeClasses.js";
import O from "./index-chainPropTypes.js";
import E from "./index-integerPropType.js";
const R = ["className", "component", "elevation", "square", "variant"], j = (o) => {
  const {
    square: e,
    elevation: a,
    variant: t,
    classes: i
  } = o, n = {
    root: ["root", t, !e && "rounded", t === "elevation" && `elevation${a}`]
  };
  return N(n, x, i);
}, k = P("div", {
  name: "MuiPaper",
  slot: "Root",
  overridesResolver: (o, e) => {
    const {
      ownerState: a
    } = o;
    return [e.root, e[a.variant], !a.square && e.rounded, a.variant === "elevation" && e[`elevation${a.elevation}`]];
  }
})(({
  theme: o,
  ownerState: e
}) => {
  var a;
  return s({
    backgroundColor: (o.vars || o).palette.background.paper,
    color: (o.vars || o).palette.text.primary,
    transition: o.transitions.create("box-shadow")
  }, !e.square && {
    borderRadius: o.shape.borderRadius
  }, e.variant === "outlined" && {
    border: `1px solid ${(o.vars || o).palette.divider}`
  }, e.variant === "elevation" && s({
    boxShadow: (o.vars || o).shadows[e.elevation]
  }, !o.vars && o.palette.mode === "dark" && {
    backgroundImage: `linear-gradient(${v.alpha("#fff", c(e.elevation))}, ${v.alpha("#fff", c(e.elevation))})`
  }, o.vars && {
    backgroundImage: (a = o.vars.overlays) == null ? void 0 : a[e.elevation]
  }));
}), q = /* @__PURE__ */ g.forwardRef(function(e, a) {
  const t = T({
    props: e,
    name: "MuiPaper"
  }), {
    className: i,
    component: n = "div",
    elevation: l = 1,
    square: d = !1,
    variant: f = "elevation"
  } = t, u = b(t, R), p = s({}, t, {
    component: n,
    elevation: l,
    square: d,
    variant: f
  }), m = j(p);
  return process.env.NODE_ENV !== "production" && h().shadows[l], /* @__PURE__ */ $(k, s({
    as: n,
    ownerState: p,
    className: y(m.root, i),
    ref: a
  }, u));
});
process.env.NODE_ENV !== "production" && (q.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * The content of the component.
   */
  children: r.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: r.object,
  /**
   * @ignore
   */
  className: r.string,
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: r.elementType,
  /**
   * Shadow depth, corresponds to `dp` in the spec.
   * It accepts values between 0 and 24 inclusive.
   * @default 1
   */
  elevation: O(E, (o) => {
    const {
      elevation: e,
      variant: a
    } = o;
    return e > 0 && a === "outlined" ? new Error(`MUI: Combining \`elevation={${e}}\` with \`variant="${a}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`) : null;
  }),
  /**
   * If `true`, rounded corners are disabled.
   * @default false
   */
  square: r.bool,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
  /**
   * The variant to use.
   * @default 'elevation'
   */
  variant: r.oneOfType([r.oneOf(["elevation", "outlined"]), r.string])
});
export {
  q as default
};
