import r from"../../../../@babel/runtime/helpers/esm/extends.js";import o from"../../../../@babel/runtime/helpers/esm/objectWithoutProperties.js";import e from"../colors/common.js";import t from"../colors/grey.js";import a from"../colors/indigo.js";import i from"../colors/pink.js";import n from"../colors/red.js";import s from"../colors/orange.js";import c from"../colors/blue.js";import d from"../colors/green.js";import{getContrastRatio as l,lighten as m,darken as p}from"./colorManipulator.js";import g from"../../../utils/esm/deepmerge.js";import h from"../../../utils/esm/formatMuiErrorMessage.js";var u={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:e.white,default:t[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},f={text:{primary:e.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:t[800],default:"#303030"},action:{active:e.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function b(r,o,e,t){var a=t.light||t,i=t.dark||1.5*t;r[o]||(r.hasOwnProperty(e)?r[o]=r[e]:"light"===o?r.light=m(r.main,a):"dark"===o&&(r.dark=p(r.main,i)))}function v(m){var p=m.primary,v=void 0===p?{light:a[300],main:a[500],dark:a[700]}:p,y=m.secondary,O=void 0===y?{light:i.A200,main:i.A400,dark:i.A700}:y,w=m.error,j=void 0===w?{light:n[300],main:n[500],dark:n[700]}:w,k=m.warning,T=void 0===k?{light:s[300],main:s[500],dark:s[700]}:k,E=m.info,x=void 0===E?{light:c[300],main:c[500],dark:c[700]}:E,N=m.success,M=void 0===N?{light:d[300],main:d[500],dark:d[700]}:N,A=m.type,C=void 0===A?"light":A,D=m.contrastThreshold,I=void 0===D?3:D,U=m.tonalOffset,V=void 0===U?.2:U,_=o(m,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function W(r){var o=l(r,f.text.primary)>=I?f.text.primary:u.text.primary;if("production"!==process.env.NODE_ENV){var e=l(r,o);e<3&&console.error(["Material-UI: The contrast ratio of ".concat(e,":1 for ").concat(o," on ").concat(r),"falls below the WCAG recommended absolute minimum contrast ratio of 3:1.","https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join("\n"))}return o}var B=function(o){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(o=r({},o)).main&&o[e]&&(o.main=o[e]),!o.main)throw new Error("production"!==process.env.NODE_ENV?"Material-UI: The color provided to augmentColor(color) is invalid.\nThe color object needs to have a `main` property or a `".concat(e,"` property."):h(4,e));if("string"!=typeof o.main)throw new Error("production"!==process.env.NODE_ENV?"Material-UI: The color provided to augmentColor(color) is invalid.\n`color.main` should be a string, but `".concat(JSON.stringify(o.main),'` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from "@material-ui/core/colors";\n\nconst theme1 = createMuiTheme({ palette: {\n  primary: green,\n} });\n\nconst theme2 = createMuiTheme({ palette: {\n  primary: { main: green[500] },\n} });'):h(5,JSON.stringify(o.main)));return b(o,"light",t,V),b(o,"dark",a,V),o.contrastText||(o.contrastText=W(o.main)),o},G={dark:f,light:u};return"production"!==process.env.NODE_ENV&&(G[C]||console.error("Material-UI: The palette type `".concat(C,"` is not supported."))),g(r({common:e,type:C,primary:B(v),secondary:B(O,"A400","A200","A700"),error:B(j),warning:B(T),info:B(x),success:B(M),grey:t,contrastThreshold:I,getContrastText:W,augmentColor:B,tonalOffset:V},G[C]),_)}export default v;export{f as dark,u as light};
//# sourceMappingURL=createPalette.js.map
