import b from "./index-extends.js";
import A from "./index-objectWithoutPropertiesLoose.js";
import { c as p } from "./index-colorManipulator2.js";
import f from "./index-common.js";
import I from "./index-grey.js";
import n from "./index-purple.js";
import s from "./index-red.js";
import l from "./index-orange.js";
import c from "./index-blue.js";
import d from "./index-lightBlue.js";
import m from "./index-green.js";
import P from "./index-deepmerge.js";
import w from "./index-formatMuiErrorMessage.js";
const R = ["mode", "contrastThreshold", "tonalOffset"], T = {
  // The colors used to style the text.
  text: {
    // The most important text.
    primary: "rgba(0, 0, 0, 0.87)",
    // Secondary text.
    secondary: "rgba(0, 0, 0, 0.6)",
    // Disabled text have even lower visual prominence.
    disabled: "rgba(0, 0, 0, 0.38)"
  },
  // The color used to divide different elements.
  divider: "rgba(0, 0, 0, 0.12)",
  // The background colors used to style the surfaces.
  // Consistency between these values is important.
  background: {
    paper: f.white,
    default: f.white
  },
  // The colors used to style the action elements.
  action: {
    // The color of an active action like an icon button.
    active: "rgba(0, 0, 0, 0.54)",
    // The color of an hovered action.
    hover: "rgba(0, 0, 0, 0.04)",
    hoverOpacity: 0.04,
    // The color of a selected action.
    selected: "rgba(0, 0, 0, 0.08)",
    selectedOpacity: 0.08,
    // The color of a disabled action.
    disabled: "rgba(0, 0, 0, 0.26)",
    // The background color of a disabled action.
    disabledBackground: "rgba(0, 0, 0, 0.12)",
    disabledOpacity: 0.38,
    focus: "rgba(0, 0, 0, 0.12)",
    focusOpacity: 0.12,
    activatedOpacity: 0.12
  }
}, k = {
  text: {
    primary: f.white,
    secondary: "rgba(255, 255, 255, 0.7)",
    disabled: "rgba(255, 255, 255, 0.5)",
    icon: "rgba(255, 255, 255, 0.5)"
  },
  divider: "rgba(255, 255, 255, 0.12)",
  background: {
    paper: "#121212",
    default: "#121212"
  },
  action: {
    active: f.white,
    hover: "rgba(255, 255, 255, 0.08)",
    hoverOpacity: 0.08,
    selected: "rgba(255, 255, 255, 0.16)",
    selectedOpacity: 0.16,
    disabled: "rgba(255, 255, 255, 0.3)",
    disabledBackground: "rgba(255, 255, 255, 0.12)",
    disabledOpacity: 0.38,
    focus: "rgba(255, 255, 255, 0.12)",
    focusOpacity: 0.12,
    activatedOpacity: 0.24
  }
};
function x(r, e, g, a) {
  const h = a.light || a, y = a.dark || a * 1.5;
  r[e] || (r.hasOwnProperty(g) ? r[e] = r[g] : e === "light" ? r.light = p.lighten(r.main, h) : e === "dark" && (r.dark = p.darken(r.main, y)));
}
function S(r = "light") {
  return r === "dark" ? {
    main: c[200],
    light: c[50],
    dark: c[400]
  } : {
    main: c[700],
    light: c[400],
    dark: c[800]
  };
}
function U(r = "light") {
  return r === "dark" ? {
    main: n[200],
    light: n[50],
    dark: n[400]
  } : {
    main: n[500],
    light: n[300],
    dark: n[700]
  };
}
function V(r = "light") {
  return r === "dark" ? {
    main: s[500],
    light: s[300],
    dark: s[700]
  } : {
    main: s[700],
    light: s[400],
    dark: s[800]
  };
}
function W(r = "light") {
  return r === "dark" ? {
    main: d[400],
    light: d[300],
    dark: d[700]
  } : {
    main: d[700],
    light: d[500],
    dark: d[900]
  };
}
function j(r = "light") {
  return r === "dark" ? {
    main: m[400],
    light: m[300],
    dark: m[700]
  } : {
    main: m[800],
    light: m[500],
    dark: m[900]
  };
}
function B(r = "light") {
  return r === "dark" ? {
    main: l[400],
    light: l[300],
    dark: l[700]
  } : {
    main: "#ed6c02",
    // closest to orange[800] that pass 3:1.
    light: l[500],
    dark: l[900]
  };
}
function er(r) {
  const {
    mode: e = "light",
    contrastThreshold: g = 3,
    tonalOffset: a = 0.2
  } = r, h = A(r, R), y = r.primary || S(e), E = r.secondary || U(e), D = r.error || V(e), $ = r.info || W(e), N = r.success || j(e), C = r.warning || B(e);
  function O(t) {
    const o = p.getContrastRatio(t, k.text.primary) >= g ? k.text.primary : T.text.primary;
    return process.env.NODE_ENV !== "production" && p.getContrastRatio(t, o) < 3, o;
  }
  const i = ({
    color: t,
    name: o,
    mainShade: u = 500,
    lightShade: M = 300,
    darkShade: _ = 700
  }) => {
    if (t = b({}, t), !t.main && t[u] && (t.main = t[u]), !t.hasOwnProperty("main"))
      throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${o ? ` (${o})` : ""} provided to augmentColor(color) is invalid.
The color object needs to have a \`main\` property or a \`${u}\` property.` : w(11, o ? ` (${o})` : "", u));
    if (typeof t.main != "string")
      throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${o ? ` (${o})` : ""} provided to augmentColor(color) is invalid.
\`color.main\` should be a string, but \`${JSON.stringify(t.main)}\` was provided instead.

Did you intend to use one of the following approaches?

import { green } from "@mui/material/colors";

const theme1 = createTheme({ palette: {
  primary: green,
} });

const theme2 = createTheme({ palette: {
  primary: { main: green[500] },
} });` : w(12, o ? ` (${o})` : "", JSON.stringify(t.main)));
    return x(t, "light", M, a), x(t, "dark", _, a), t.contrastText || (t.contrastText = O(t.main)), t;
  }, v = {
    dark: k,
    light: T
  };
  return process.env.NODE_ENV !== "production" && v[e], P(b({
    // A collection of common colors.
    common: b({}, f),
    // prevent mutable object.
    // The palette mode, can be light or dark.
    mode: e,
    // The colors used to represent primary interface elements for a user.
    primary: i({
      color: y,
      name: "primary"
    }),
    // The colors used to represent secondary interface elements for a user.
    secondary: i({
      color: E,
      name: "secondary",
      mainShade: "A400",
      lightShade: "A200",
      darkShade: "A700"
    }),
    // The colors used to represent interface elements that the user should be made aware of.
    error: i({
      color: D,
      name: "error"
    }),
    // The colors used to represent potentially dangerous actions or important messages.
    warning: i({
      color: C,
      name: "warning"
    }),
    // The colors used to present information to the user that is neutral and not necessarily important.
    info: i({
      color: $,
      name: "info"
    }),
    // The colors used to indicate the successful completion of an action that user triggered.
    success: i({
      color: N,
      name: "success"
    }),
    // The grey colors.
    grey: I,
    // Used by `getContrastText()` to maximize the contrast between
    // the background and the text.
    contrastThreshold: g,
    // Takes a background color and returns the text color that maximizes the contrast.
    getContrastText: O,
    // Generate a rich color object.
    augmentColor: i,
    // Used by the functions below to shift a color's luminance by approximately
    // two indexes within its tonal palette.
    // E.g., shift from Red 500 to Red 300 or Red 700.
    tonalOffset: a
  }, v[e]), h);
}
export {
  k as dark,
  er as default,
  T as light
};
