import p from "./index-extends.js";
import h from "./index-objectWithoutPropertiesLoose.js";
import d from "./index-createBreakpoints.js";
import g from "./index-shape.js";
import x from "./index-createSpacing.js";
import b from "./index-styleFunctionSx.js";
import _ from "./index-defaultSxConfig.js";
import k from "./index-applyStyles.js";
import s from "./index-deepmerge.js";
const y = ["breakpoints", "palette", "spacing", "shape"];
function P(r = {}, ...i) {
  const {
    breakpoints: a = {},
    palette: m = {},
    spacing: c,
    shape: l = {}
  } = r, t = h(r, y), u = d(a), f = x(c);
  let e = s({
    breakpoints: u,
    direction: "ltr",
    components: {},
    // Inject component definitions.
    palette: p({
      mode: "light"
    }, m),
    spacing: f,
    shape: p({}, g, l)
  }, t);
  return e.applyStyles = k, e = i.reduce((n, o) => s(n, o), e), e.unstable_sxConfig = p({}, _, t == null ? void 0 : t.unstable_sxConfig), e.unstable_sx = function(o) {
    return b({
      sx: o,
      theme: this
    });
  }, e;
}
export {
  P as default
};
