@vitessce/description 4.0.10 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +828 -542
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -72,6 +72,7 @@ const CoordinationType = {
72
72
  SPATIAL_ROTATION_ORBIT: "spatialRotationOrbit",
73
73
  SPATIAL_ORBIT_AXIS: "spatialOrbitAxis",
74
74
  SPATIAL_AXIS_FIXED: "spatialAxisFixed",
75
+ SPATIAL_CAMERA_SNAPSHOT: "spatialCameraSnapshot",
75
76
  HEATMAP_ZOOM_X: "heatmapZoomX",
76
77
  HEATMAP_ZOOM_Y: "heatmapZoomY",
77
78
  HEATMAP_TARGET_X: "heatmapTargetX",
@@ -119,6 +120,7 @@ const CoordinationType = {
119
120
  SPATIAL_TARGET_C: "spatialTargetC",
120
121
  SPATIAL_LAYER_VISIBLE: "spatialLayerVisible",
121
122
  SPATIAL_LAYER_OPACITY: "spatialLayerOpacity",
123
+ SPATIAL_LAYER_OPACITY_UNSELECTED: "spatialLayerOpacityUnselected",
122
124
  SPATIAL_LAYER_COLORMAP: "spatialLayerColormap",
123
125
  SPATIAL_LAYER_LABEL: "spatialLayerLabel",
124
126
  SPATIAL_LAYER_TRANSPARENT_COLOR: "spatialLayerTransparentColor",
@@ -213,6 +215,7 @@ const COMPONENT_COORDINATION_TYPES = {
213
215
  CoordinationType.SPATIAL_ROTATION_ORBIT,
214
216
  CoordinationType.SPATIAL_ORBIT_AXIS,
215
217
  CoordinationType.SPATIAL_ZOOM,
218
+ CoordinationType.SPATIAL_CAMERA_SNAPSHOT,
216
219
  CoordinationType.OBS_FILTER,
217
220
  CoordinationType.OBS_HIGHLIGHT,
218
221
  CoordinationType.OBS_SET_SELECTION,
@@ -238,6 +241,7 @@ const COMPONENT_COORDINATION_TYPES = {
238
241
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
239
242
  CoordinationType.SPATIAL_LAYER_COLOR,
240
243
  CoordinationType.SPATIAL_LAYER_OPACITY,
244
+ CoordinationType.SPATIAL_LAYER_OPACITY_UNSELECTED,
241
245
  CoordinationType.SPATIAL_LAYER_VISIBLE,
242
246
  CoordinationType.SPATIAL_LAYER_LABEL,
243
247
  CoordinationType.SPATIAL_CHANNEL_COLOR,
@@ -442,6 +446,7 @@ const COMPONENT_COORDINATION_TYPES = {
442
446
  CoordinationType.SPATIAL_ROTATION_ORBIT,
443
447
  CoordinationType.SPATIAL_ORBIT_AXIS,
444
448
  CoordinationType.SPATIAL_AXIS_FIXED,
449
+ CoordinationType.SPATIAL_CAMERA_SNAPSHOT,
445
450
  CoordinationType.OBS_FILTER,
446
451
  CoordinationType.OBS_HIGHLIGHT,
447
452
  CoordinationType.OBS_SET_SELECTION,
@@ -463,6 +468,7 @@ const COMPONENT_COORDINATION_TYPES = {
463
468
  CoordinationType.SPATIAL_TARGET_C,
464
469
  CoordinationType.SPATIAL_LAYER_VISIBLE,
465
470
  CoordinationType.SPATIAL_LAYER_OPACITY,
471
+ CoordinationType.SPATIAL_LAYER_OPACITY_UNSELECTED,
466
472
  CoordinationType.SPATIAL_LAYER_COLORMAP,
467
473
  CoordinationType.SPATIAL_LAYER_TRANSPARENT_COLOR,
468
474
  CoordinationType.SPATIAL_LAYER_MODEL_MATRIX,
@@ -658,6 +664,7 @@ const COMPONENT_COORDINATION_TYPES = {
658
664
  CoordinationType.SPATIAL_LAYER_VISIBLE,
659
665
  CoordinationType.SPATIAL_LAYER_LABEL,
660
666
  CoordinationType.SPATIAL_LAYER_OPACITY,
667
+ CoordinationType.SPATIAL_LAYER_OPACITY_UNSELECTED,
661
668
  CoordinationType.SPATIAL_LAYER_COLORMAP,
662
669
  CoordinationType.SPATIAL_LAYER_TRANSPARENT_COLOR,
663
670
  CoordinationType.SPATIAL_LAYER_MODEL_MATRIX,
@@ -1371,7 +1378,7 @@ function rulesheet(callback) {
1371
1378
  }
1372
1379
  };
1373
1380
  }
1374
- function memoize$1(fn) {
1381
+ function memoize(fn) {
1375
1382
  var cache = /* @__PURE__ */ Object.create(null);
1376
1383
  return function(arg2) {
1377
1384
  if (cache[arg2] === void 0) cache[arg2] = fn(arg2);
@@ -1659,10 +1666,10 @@ var createCache = function createCache2(options) {
1659
1666
  }
1660
1667
  var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1661
1668
  var inserted = {};
1662
- var container;
1669
+ var container2;
1663
1670
  var nodesToHydrate = [];
1664
1671
  {
1665
- container = options.container || document.head;
1672
+ container2 = options.container || document.head;
1666
1673
  Array.prototype.forEach.call(
1667
1674
  // this means we will ignore elements which don't have a space in them which
1668
1675
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
@@ -1699,7 +1706,7 @@ var createCache = function createCache2(options) {
1699
1706
  key,
1700
1707
  sheet: new StyleSheet({
1701
1708
  key,
1702
- container,
1709
+ container: container2,
1703
1710
  nonce: options.nonce,
1704
1711
  speedy: options.speedy,
1705
1712
  prepend: options.prepend,
@@ -2023,7 +2030,7 @@ var isCustomProperty = function isCustomProperty2(property) {
2023
2030
  var isProcessableValue = function isProcessableValue2(value) {
2024
2031
  return value != null && typeof value !== "boolean";
2025
2032
  };
2026
- var processStyleName = /* @__PURE__ */ memoize$1(function(styleName) {
2033
+ var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
2027
2034
  return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
2028
2035
  });
2029
2036
  var processStyleValue = function processStyleValue2(key, value) {
@@ -2920,7 +2927,7 @@ const { tss: tss$1 } = createTss({
2920
2927
  tss$1.create({});
2921
2928
  const THEME_ID = "$$material";
2922
2929
  var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
2923
- var isPropValid = /* @__PURE__ */ memoize$1(
2930
+ var isPropValid = /* @__PURE__ */ memoize(
2924
2931
  function(prop) {
2925
2932
  return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
2926
2933
  }
@@ -3870,8 +3877,7 @@ function requireReactIs_development() {
3870
3877
  }
3871
3878
  }
3872
3879
  }
3873
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
3874
- var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
3880
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
3875
3881
  reactIs_development.ContextConsumer = REACT_CONSUMER_TYPE;
3876
3882
  reactIs_development.ContextProvider = REACT_CONTEXT_TYPE;
3877
3883
  reactIs_development.Element = REACT_ELEMENT_TYPE;
@@ -3921,7 +3927,7 @@ function requireReactIs_development() {
3921
3927
  return typeOf2(object) === REACT_SUSPENSE_LIST_TYPE;
3922
3928
  };
3923
3929
  reactIs_development.isValidElementType = function(type) {
3924
- return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
3930
+ return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_VIEW_TRANSITION_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
3925
3931
  };
3926
3932
  reactIs_development.typeOf = typeOf2;
3927
3933
  })();
@@ -3991,19 +3997,12 @@ const sortBreakpointsValues = (values2) => {
3991
3997
  };
3992
3998
  function createBreakpoints(breakpoints) {
3993
3999
  const {
3994
- // The breakpoint **start** at this value.
3995
- // For instance with the first breakpoint xs: [xs, sm).
3996
4000
  values: values2 = {
3997
4001
  xs: 0,
3998
- // phone
3999
4002
  sm: 600,
4000
- // tablet
4001
4003
  md: 900,
4002
- // small laptop
4003
4004
  lg: 1200,
4004
- // desktop
4005
4005
  xl: 1536
4006
- // large screen
4007
4006
  },
4008
4007
  unit = "px",
4009
4008
  step = 5,
@@ -4039,6 +4038,10 @@ function createBreakpoints(breakpoints) {
4039
4038
  }
4040
4039
  return between(key, keys2[keys2.indexOf(key) + 1]).replace("@media", "@media not all and");
4041
4040
  }
4041
+ const mediaKeys = [];
4042
+ for (let i = 0; i < keys2.length; i += 1) {
4043
+ mediaKeys.push(up(keys2[i]));
4044
+ }
4042
4045
  return {
4043
4046
  keys: keys2,
4044
4047
  values: sortedValues,
@@ -4048,28 +4051,40 @@ function createBreakpoints(breakpoints) {
4048
4051
  only,
4049
4052
  not,
4050
4053
  unit,
4054
+ internal_mediaKeys: mediaKeys,
4051
4055
  ...other
4052
4056
  };
4053
4057
  }
4058
+ const MIN_WIDTH_PATTERN = /min-width:\s*([0-9.]+)/;
4054
4059
  function sortContainerQueries(theme, css) {
4055
- if (!theme.containerQueries) {
4060
+ if (!theme.containerQueries || !hasContainerQuery(css)) {
4056
4061
  return css;
4057
4062
  }
4058
- const sorted = Object.keys(css).filter((key) => key.startsWith("@container")).sort((a, b) => {
4059
- const regex = /min-width:\s*([0-9.]+)/;
4060
- return +(a.match(regex)?.[1] || 0) - +(b.match(regex)?.[1] || 0);
4061
- });
4062
- if (!sorted.length) {
4063
- return css;
4063
+ const keys2 = [];
4064
+ for (const key in css) {
4065
+ if (key.startsWith("@container")) {
4066
+ keys2.push(key);
4067
+ }
4064
4068
  }
4065
- return sorted.reduce((acc, key) => {
4066
- const value = css[key];
4067
- delete acc[key];
4068
- acc[key] = value;
4069
- return acc;
4070
- }, {
4071
- ...css
4069
+ keys2.sort((a, b) => {
4070
+ return +(a.match(MIN_WIDTH_PATTERN)?.[1] || 0) - +(b.match(MIN_WIDTH_PATTERN)?.[1] || 0);
4072
4071
  });
4072
+ const result = css;
4073
+ for (let i = 0; i < keys2.length; i += 1) {
4074
+ const key = keys2[i];
4075
+ const value = result[key];
4076
+ delete result[key];
4077
+ result[key] = value;
4078
+ }
4079
+ return result;
4080
+ }
4081
+ function hasContainerQuery(css) {
4082
+ for (const key in css) {
4083
+ if (key.startsWith("@container")) {
4084
+ return true;
4085
+ }
4086
+ }
4087
+ return false;
4073
4088
  }
4074
4089
  function isCqShorthand(breakpointKeys, value) {
4075
4090
  return value === "@" || value.startsWith("@") && (breakpointKeys.some((key) => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
@@ -4078,8 +4093,11 @@ function getContainerQuery(theme, shorthand) {
4078
4093
  const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
4079
4094
  if (!matches) {
4080
4095
  {
4081
- throw new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
4082
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);
4096
+ throw (
4097
+ /* minify-error */
4098
+ new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
4099
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
4100
+ );
4083
4101
  }
4084
4102
  }
4085
4103
  const [, containerQuery, containerName] = matches;
@@ -4116,15 +4134,82 @@ const shape = {
4116
4134
  borderRadius: 4
4117
4135
  };
4118
4136
  const responsivePropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]);
4119
- function merge$1(acc, item) {
4120
- if (!item) {
4121
- return acc;
4137
+ function isObjectEmpty$1(object) {
4138
+ if (object == null) {
4139
+ return true;
4122
4140
  }
4123
- return deepmerge(acc, item, {
4124
- clone: false
4125
- // No need to clone deep, it's way faster.
4126
- });
4141
+ for (const _ in object) {
4142
+ return false;
4143
+ }
4144
+ return true;
4127
4145
  }
4146
+ function fastDeepAssign(target, source) {
4147
+ const sourceIsArray = Array.isArray(source);
4148
+ const targetIsArray = Array.isArray(target);
4149
+ if (isPrimitive(source)) {
4150
+ return source;
4151
+ } else if (isPrimitiveOrBuiltIn(target)) {
4152
+ return clone(source);
4153
+ } else if (sourceIsArray && targetIsArray) {
4154
+ return mergeArray(target, source);
4155
+ } else if (sourceIsArray !== targetIsArray) {
4156
+ return clone(source);
4157
+ } else {
4158
+ return mergeObject(target, source);
4159
+ }
4160
+ }
4161
+ function cloneArray(value) {
4162
+ let i = 0;
4163
+ const il = value.length;
4164
+ const result = new Array(il);
4165
+ for (i = 0; i < il; i += 1) {
4166
+ result[i] = clone(value[i]);
4167
+ }
4168
+ return result;
4169
+ }
4170
+ function cloneObject(target) {
4171
+ const result = {};
4172
+ for (const key in target) {
4173
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
4174
+ continue;
4175
+ }
4176
+ result[key] = clone(target[key]);
4177
+ }
4178
+ return result;
4179
+ }
4180
+ function mergeArray(target, source) {
4181
+ const tl = target.length;
4182
+ for (let i = 0; i < source.length; i += 1) {
4183
+ target[tl + i] = clone(source[i]);
4184
+ }
4185
+ return target;
4186
+ }
4187
+ function isMergeableObject(value) {
4188
+ return typeof value === "object" && value !== null && !(value instanceof RegExp) && !(value instanceof Date);
4189
+ }
4190
+ function isPrimitive(value) {
4191
+ return typeof value !== "object" || value === null;
4192
+ }
4193
+ function isPrimitiveOrBuiltIn(value) {
4194
+ return typeof value !== "object" || value === null || value instanceof RegExp || value instanceof Date;
4195
+ }
4196
+ function clone(entry) {
4197
+ return isMergeableObject(entry) ? Array.isArray(entry) ? cloneArray(entry) : cloneObject(entry) : entry;
4198
+ }
4199
+ function mergeObject(target, source) {
4200
+ for (const key in source) {
4201
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
4202
+ continue;
4203
+ }
4204
+ if (key in target) {
4205
+ target[key] = fastDeepAssign(target[key], source[key]);
4206
+ } else {
4207
+ target[key] = clone(source[key]);
4208
+ }
4209
+ }
4210
+ return target;
4211
+ }
4212
+ const EMPTY_THEME$2 = {};
4128
4213
  const values = {
4129
4214
  xs: 0,
4130
4215
  // phone
@@ -4137,12 +4222,9 @@ const values = {
4137
4222
  xl: 1536
4138
4223
  // large screen
4139
4224
  };
4140
- const defaultBreakpoints = {
4141
- // Sorted ASC by size. That's important.
4142
- // It can't be configured as it's used statically for propTypes.
4143
- keys: ["xs", "sm", "md", "lg", "xl"],
4144
- up: (key) => `@media (min-width:${values[key]}px)`
4145
- };
4225
+ const DEFAULT_BREAKPOINTS = createBreakpoints({
4226
+ values
4227
+ });
4146
4228
  const defaultContainerQueries = {
4147
4229
  containerQueries: (containerName) => ({
4148
4230
  up: (key) => {
@@ -4155,52 +4237,89 @@ const defaultContainerQueries = {
4155
4237
  })
4156
4238
  };
4157
4239
  function handleBreakpoints(props, propValue, styleFromPropValue) {
4158
- const theme = props.theme || {};
4240
+ const result = {};
4241
+ return iterateBreakpoints(result, props.theme, propValue, (mediaKey, value, initialKey) => {
4242
+ const finalValue = styleFromPropValue(value, initialKey);
4243
+ if (mediaKey) {
4244
+ result[mediaKey] = finalValue;
4245
+ } else {
4246
+ fastDeepAssign(result, finalValue);
4247
+ }
4248
+ });
4249
+ }
4250
+ function iterateBreakpoints(target, theme, propValue, callback) {
4251
+ theme ??= EMPTY_THEME$2;
4159
4252
  if (Array.isArray(propValue)) {
4160
- const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
4161
- return propValue.reduce((acc, item, index2) => {
4162
- acc[themeBreakpoints.up(themeBreakpoints.keys[index2])] = styleFromPropValue(propValue[index2]);
4163
- return acc;
4164
- }, {});
4253
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
4254
+ for (let i = 0; i < propValue.length; i += 1) {
4255
+ buildBreakpoint(target, breakpoints.up(breakpoints.keys[i]), propValue[i], void 0, callback);
4256
+ }
4257
+ return target;
4165
4258
  }
4166
4259
  if (typeof propValue === "object") {
4167
- const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
4168
- return Object.keys(propValue).reduce((acc, breakpoint) => {
4169
- if (isCqShorthand(themeBreakpoints.keys, breakpoint)) {
4170
- const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, breakpoint);
4260
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
4261
+ const breakpointValues = breakpoints.values ?? values;
4262
+ for (const key in propValue) {
4263
+ if (isCqShorthand(breakpoints.keys, key)) {
4264
+ const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, key);
4171
4265
  if (containerKey) {
4172
- acc[containerKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
4266
+ buildBreakpoint(target, containerKey, propValue[key], key, callback);
4173
4267
  }
4174
- } else if (Object.keys(themeBreakpoints.values || values).includes(breakpoint)) {
4175
- const mediaKey = themeBreakpoints.up(breakpoint);
4176
- acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
4268
+ } else if (key in breakpointValues) {
4269
+ const mediaKey = breakpoints.up(key);
4270
+ buildBreakpoint(target, mediaKey, propValue[key], key, callback);
4177
4271
  } else {
4178
- const cssKey = breakpoint;
4179
- acc[cssKey] = propValue[cssKey];
4272
+ const cssKey = key;
4273
+ target[cssKey] = propValue[cssKey];
4180
4274
  }
4181
- return acc;
4182
- }, {});
4275
+ }
4276
+ return target;
4183
4277
  }
4184
- const output = styleFromPropValue(propValue);
4185
- return output;
4278
+ callback(void 0, propValue);
4279
+ return target;
4186
4280
  }
4187
- function createEmptyBreakpointObject(breakpointsInput = {}) {
4188
- const breakpointsInOrder = breakpointsInput.keys?.reduce((acc, key) => {
4189
- const breakpointStyleKey = breakpointsInput.up(key);
4190
- acc[breakpointStyleKey] = {};
4191
- return acc;
4192
- }, {});
4193
- return breakpointsInOrder || {};
4281
+ function buildBreakpoint(target, mediaKey, value, initialKey, callback) {
4282
+ target[mediaKey] ??= {};
4283
+ callback(mediaKey, value, initialKey);
4194
4284
  }
4195
- function removeUnusedBreakpoints(breakpointKeys, style2) {
4196
- return breakpointKeys.reduce((acc, key) => {
4197
- const breakpointOutput = acc[key];
4198
- const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
4199
- if (isBreakpointUnused) {
4200
- delete acc[key];
4285
+ function createEmptyBreakpointObject(breakpoints = DEFAULT_BREAKPOINTS) {
4286
+ const {
4287
+ internal_mediaKeys: mediaKeys
4288
+ } = breakpoints;
4289
+ const result = {};
4290
+ for (let i = 0; i < mediaKeys.length; i += 1) {
4291
+ result[mediaKeys[i]] = {};
4292
+ }
4293
+ return result;
4294
+ }
4295
+ function removeUnusedBreakpoints(breakpoints, style2) {
4296
+ const breakpointKeys = breakpoints.internal_mediaKeys;
4297
+ for (let i = 0; i < breakpointKeys.length; i += 1) {
4298
+ const key = breakpointKeys[i];
4299
+ if (isObjectEmpty$1(style2[key])) {
4300
+ delete style2[key];
4201
4301
  }
4202
- return acc;
4203
- }, style2);
4302
+ }
4303
+ return style2;
4304
+ }
4305
+ function hasBreakpoint(breakpoints, value) {
4306
+ if (Array.isArray(value)) {
4307
+ return true;
4308
+ }
4309
+ if (typeof value === "object" && value !== null) {
4310
+ for (let i = 0; i < breakpoints.keys.length; i += 1) {
4311
+ if (breakpoints.keys[i] in value) {
4312
+ return true;
4313
+ }
4314
+ }
4315
+ const valueKeys = Object.keys(value);
4316
+ for (let i = 0; i < valueKeys.length; i += 1) {
4317
+ if (isCqShorthand(breakpoints.keys, valueKeys[i])) {
4318
+ return true;
4319
+ }
4320
+ }
4321
+ }
4322
+ return false;
4204
4323
  }
4205
4324
  function capitalize(string2) {
4206
4325
  if (typeof string2 !== "string") {
@@ -4208,37 +4327,54 @@ function capitalize(string2) {
4208
4327
  }
4209
4328
  return string2.charAt(0).toUpperCase() + string2.slice(1);
4210
4329
  }
4211
- function getPath(obj, path, checkVars = true) {
4212
- if (!path || typeof path !== "string") {
4213
- return null;
4214
- }
4215
- if (obj && obj.vars && checkVars) {
4216
- const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
4217
- if (val != null) {
4218
- return val;
4219
- }
4220
- }
4221
- return path.split(".").reduce((acc, item) => {
4222
- if (acc && acc[item] != null) {
4223
- return acc[item];
4224
- }
4225
- return null;
4226
- }, obj);
4227
- }
4228
- function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
4330
+ function getStyleValue2(themeMapping, transform, userValue, alternateProp) {
4229
4331
  let value;
4230
4332
  if (typeof themeMapping === "function") {
4231
- value = themeMapping(propValueFinal);
4333
+ value = themeMapping(userValue);
4232
4334
  } else if (Array.isArray(themeMapping)) {
4233
- value = themeMapping[propValueFinal] || userValue;
4335
+ value = themeMapping[userValue] || userValue;
4336
+ } else if (typeof userValue === "string") {
4337
+ value = getPath(themeMapping, userValue, true, alternateProp) || userValue;
4234
4338
  } else {
4235
- value = getPath(themeMapping, propValueFinal) || userValue;
4339
+ value = userValue;
4236
4340
  }
4237
4341
  if (transform) {
4238
4342
  value = transform(value, userValue, themeMapping);
4239
4343
  }
4240
4344
  return value;
4241
4345
  }
4346
+ function getPath(obj, pathInput, checkVars = true, alternateProp = void 0) {
4347
+ if (!obj || !pathInput) {
4348
+ return null;
4349
+ }
4350
+ const path = pathInput.split(".");
4351
+ if (obj.vars && checkVars) {
4352
+ const val = getPathImpl(obj.vars, path, alternateProp);
4353
+ if (val != null) {
4354
+ return val;
4355
+ }
4356
+ }
4357
+ return getPathImpl(obj, path, alternateProp);
4358
+ }
4359
+ function getPathImpl(object, path, alternateProp = void 0) {
4360
+ let lastResult = void 0;
4361
+ let result = object;
4362
+ let index2 = 0;
4363
+ while (index2 < path.length) {
4364
+ if (result === null || result === void 0) {
4365
+ return result;
4366
+ }
4367
+ lastResult = result;
4368
+ result = result[path[index2]];
4369
+ index2 += 1;
4370
+ }
4371
+ if (alternateProp && result === void 0) {
4372
+ const lastKey = path[path.length - 1];
4373
+ const alternateKey = `${alternateProp}${lastKey === "default" ? "" : capitalize(lastKey)}`;
4374
+ return lastResult?.[alternateKey];
4375
+ }
4376
+ return result;
4377
+ }
4242
4378
  function style$1(options) {
4243
4379
  const {
4244
4380
  prop,
@@ -4253,15 +4389,9 @@ function style$1(options) {
4253
4389
  const propValue = props[prop];
4254
4390
  const theme = props.theme;
4255
4391
  const themeMapping = getPath(theme, themeKey) || {};
4256
- const styleFromPropValue = (propValueFinal) => {
4257
- let value = getStyleValue(themeMapping, transform, propValueFinal);
4258
- if (propValueFinal === value && typeof propValueFinal === "string") {
4259
- value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
4260
- }
4261
- if (cssProperty === false) {
4262
- return value;
4263
- }
4264
- return {
4392
+ const styleFromPropValue = (valueFinal) => {
4393
+ const value = getStyleValue2(themeMapping, transform, valueFinal, prop);
4394
+ return cssProperty === false ? value : {
4265
4395
  [cssProperty]: value
4266
4396
  };
4267
4397
  };
@@ -4273,15 +4403,9 @@ function style$1(options) {
4273
4403
  fn.filterProps = [prop];
4274
4404
  return fn;
4275
4405
  }
4276
- function memoize(fn) {
4277
- const cache = {};
4278
- return (arg2) => {
4279
- if (cache[arg2] === void 0) {
4280
- cache[arg2] = fn(arg2);
4281
- }
4282
- return cache[arg2];
4283
- };
4284
- }
4406
+ const EMPTY_THEME$1 = {
4407
+ internal_cache: {}
4408
+ };
4285
4409
  const properties = {
4286
4410
  m: "margin",
4287
4411
  p: "padding"
@@ -4300,22 +4424,24 @@ const aliases = {
4300
4424
  paddingX: "px",
4301
4425
  paddingY: "py"
4302
4426
  };
4303
- const getCssProperties = memoize((prop) => {
4304
- if (prop.length > 2) {
4305
- if (aliases[prop]) {
4306
- prop = aliases[prop];
4307
- } else {
4308
- return [prop];
4309
- }
4427
+ const CSS_PROPERTIES = {};
4428
+ for (const key in properties) {
4429
+ CSS_PROPERTIES[key] = [properties[key]];
4430
+ }
4431
+ for (const keyProperty in properties) {
4432
+ for (const keyDirection in directions) {
4433
+ const property = properties[keyProperty];
4434
+ const direction = directions[keyDirection];
4435
+ const value = Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
4436
+ CSS_PROPERTIES[keyProperty + keyDirection] = value;
4310
4437
  }
4311
- const [a, b] = prop.split("");
4312
- const property = properties[a];
4313
- const direction = directions[b] || "";
4314
- return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
4315
- });
4316
- const marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
4317
- const paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
4318
- const spacingKeys = [...marginKeys, ...paddingKeys];
4438
+ }
4439
+ for (const key in aliases) {
4440
+ CSS_PROPERTIES[key] = CSS_PROPERTIES[aliases[key]];
4441
+ }
4442
+ const marginKeys = /* @__PURE__ */ new Set(["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"]);
4443
+ const paddingKeys = /* @__PURE__ */ new Set(["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"]);
4444
+ const spacingKeys = /* @__PURE__ */ new Set([...marginKeys, ...paddingKeys]);
4319
4445
  function createUnaryUnit(theme, themeKey, defaultValue, propName) {
4320
4446
  const themeSpacing = getPath(theme, themeKey, true) ?? defaultValue;
4321
4447
  if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
@@ -4383,42 +4509,45 @@ function getValue(transformer, propValue) {
4383
4509
  }
4384
4510
  return transformer(propValue);
4385
4511
  }
4386
- function getStyleFromPropValue(cssProperties, transformer) {
4387
- return (propValue) => cssProperties.reduce((acc, cssProperty) => {
4388
- acc[cssProperty] = getValue(transformer, propValue);
4389
- return acc;
4390
- }, {});
4391
- }
4392
- function resolveCssProperty(props, keys2, prop, transformer) {
4393
- if (!keys2.includes(prop)) {
4394
- return null;
4395
- }
4396
- const cssProperties = getCssProperties(prop);
4397
- const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
4398
- const propValue = props[prop];
4399
- return handleBreakpoints(props, propValue, styleFromPropValue);
4400
- }
4512
+ const container = [""];
4401
4513
  function style(props, keys2) {
4402
- const transformer = createUnarySpacing(props.theme);
4403
- return Object.keys(props).map((prop) => resolveCssProperty(props, keys2, prop, transformer)).reduce(merge$1, {});
4514
+ const theme = props.theme ?? EMPTY_THEME$1;
4515
+ const transformer = theme?.internal_cache?.unarySpacing ?? createUnarySpacing(theme);
4516
+ const result = {};
4517
+ for (const prop in props) {
4518
+ if (!keys2.has(prop)) {
4519
+ continue;
4520
+ }
4521
+ const cssProperties = CSS_PROPERTIES[prop] ?? (container[0] = prop, container);
4522
+ const propValue = props[prop];
4523
+ iterateBreakpoints(result, props.theme, propValue, (mediaKey, value) => {
4524
+ const target = mediaKey ? result[mediaKey] : result;
4525
+ for (let i = 0; i < cssProperties.length; i += 1) {
4526
+ target[cssProperties[i]] = getValue(transformer, value);
4527
+ }
4528
+ });
4529
+ }
4530
+ return result;
4404
4531
  }
4405
- function margin(props) {
4532
+ function marginFn(props) {
4406
4533
  return style(props, marginKeys);
4407
4534
  }
4408
- margin.propTypes = marginKeys.reduce((obj, key) => {
4535
+ marginFn.propTypes = Array.from(marginKeys).reduce((obj, key) => {
4409
4536
  obj[key] = responsivePropType;
4410
4537
  return obj;
4411
4538
  }, {});
4412
- margin.filterProps = marginKeys;
4413
- function padding(props) {
4539
+ marginFn.filterProps = marginKeys;
4540
+ const margin = marginFn;
4541
+ function paddingFn(props) {
4414
4542
  return style(props, paddingKeys);
4415
4543
  }
4416
- padding.propTypes = paddingKeys.reduce((obj, key) => {
4544
+ paddingFn.propTypes = Array.from(paddingKeys).reduce((obj, key) => {
4417
4545
  obj[key] = responsivePropType;
4418
4546
  return obj;
4419
4547
  }, {});
4420
- padding.filterProps = paddingKeys;
4421
- spacingKeys.reduce((obj, key) => {
4548
+ paddingFn.filterProps = paddingKeys;
4549
+ const padding = paddingFn;
4550
+ Array.from(spacingKeys).reduce((obj, key) => {
4422
4551
  obj[key] = responsivePropType;
4423
4552
  return obj;
4424
4553
  }, {});
@@ -4451,12 +4580,13 @@ function compose(...styles) {
4451
4580
  return acc;
4452
4581
  }, {});
4453
4582
  const fn = (props) => {
4454
- return Object.keys(props).reduce((acc, prop) => {
4583
+ const result = {};
4584
+ for (const prop in props) {
4455
4585
  if (handlers2[prop]) {
4456
- return merge$1(acc, handlers2[prop](props));
4586
+ fastDeepAssign(result, handlers2[prop](props));
4457
4587
  }
4458
- return acc;
4459
- }, {});
4588
+ }
4589
+ return result;
4460
4590
  };
4461
4591
  fn.propTypes = styles.reduce((acc, style2) => Object.assign(acc, style2.propTypes), {});
4462
4592
  fn.filterProps = styles.reduce((acc, style2) => acc.concat(style2.filterProps), []);
@@ -4595,6 +4725,7 @@ const backgroundColor = style$1({
4595
4725
  transform: paletteTransform
4596
4726
  });
4597
4727
  compose(color$1, bgcolor, backgroundColor);
4728
+ const breakpointsValues = values;
4598
4729
  function sizingTransform(value) {
4599
4730
  return value <= 1 && value !== 0 ? `${value * 100}%` : value;
4600
4731
  }
@@ -4605,7 +4736,7 @@ const width = style$1({
4605
4736
  const maxWidth = (props) => {
4606
4737
  if (props.maxWidth !== void 0 && props.maxWidth !== null) {
4607
4738
  const styleFromPropValue = (propValue) => {
4608
- const breakpoint = props.theme?.breakpoints?.values?.[propValue] || values[propValue];
4739
+ const breakpoint = props.theme?.breakpoints?.values?.[propValue] || breakpointsValues[propValue];
4609
4740
  if (!breakpoint) {
4610
4741
  return {
4611
4742
  maxWidth: sizingTransform(propValue)
@@ -4943,68 +5074,24 @@ const defaultSxConfig = {
4943
5074
  themeKey: "typography"
4944
5075
  }
4945
5076
  };
4946
- function objectsHaveSameKeys(...objects) {
4947
- const allKeys = objects.reduce((keys2, object) => keys2.concat(Object.keys(object)), []);
4948
- const union = new Set(allKeys);
4949
- return objects.every((object) => union.size === Object.keys(object).length);
4950
- }
4951
- function callIfFn(maybeFn, arg2) {
4952
- return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
4953
- }
5077
+ const EMPTY_THEME = {};
4954
5078
  function unstable_createStyleFunctionSx() {
4955
- function getThemeValue(prop, val, theme, config) {
4956
- const props = {
4957
- [prop]: val,
4958
- theme
4959
- };
4960
- const options = config[prop];
4961
- if (!options) {
4962
- return {
4963
- [prop]: val
4964
- };
4965
- }
4966
- const {
4967
- cssProperty = prop,
4968
- themeKey,
4969
- transform,
4970
- style: style2
4971
- } = options;
4972
- if (val == null) {
5079
+ function styleFunctionSx2(props) {
5080
+ if (!props.sx) {
4973
5081
  return null;
4974
5082
  }
4975
- if (themeKey === "typography" && val === "inherit") {
4976
- return {
4977
- [prop]: val
4978
- };
4979
- }
4980
- const themeMapping = getPath(theme, themeKey) || {};
4981
- if (style2) {
4982
- return style2(props);
4983
- }
4984
- const styleFromPropValue = (propValueFinal) => {
4985
- let value = getStyleValue(themeMapping, transform, propValueFinal);
4986
- if (propValueFinal === value && typeof propValueFinal === "string") {
4987
- value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
4988
- }
4989
- if (cssProperty === false) {
4990
- return value;
4991
- }
4992
- return {
4993
- [cssProperty]: value
4994
- };
4995
- };
4996
- return handleBreakpoints(props, val, styleFromPropValue);
4997
- }
4998
- function styleFunctionSx2(props) {
4999
5083
  const {
5000
5084
  sx,
5001
- theme = {}
5002
- } = props || {};
5003
- if (!sx) {
5004
- return null;
5005
- }
5085
+ theme = EMPTY_THEME,
5086
+ nested
5087
+ } = props;
5006
5088
  const config = theme.unstable_sxConfig ?? defaultSxConfig;
5007
- function traverse(sxInput) {
5089
+ const wrapper2 = {
5090
+ sx: null,
5091
+ theme,
5092
+ nested: true
5093
+ };
5094
+ function process(sxInput) {
5008
5095
  let sxObject = sxInput;
5009
5096
  if (typeof sxInput === "function") {
5010
5097
  sxObject = sxInput(theme);
@@ -5014,43 +5101,94 @@ function unstable_createStyleFunctionSx() {
5014
5101
  if (!sxObject) {
5015
5102
  return null;
5016
5103
  }
5017
- const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
5018
- const breakpointsKeys = Object.keys(emptyBreakpoints);
5019
- let css = emptyBreakpoints;
5020
- Object.keys(sxObject).forEach((styleKey) => {
5104
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
5105
+ const css = createEmptyBreakpointObject(breakpoints);
5106
+ for (const styleKey in sxObject) {
5021
5107
  const value = callIfFn(sxObject[styleKey], theme);
5022
- if (value !== null && value !== void 0) {
5023
- if (typeof value === "object") {
5024
- if (config[styleKey]) {
5025
- css = merge$1(css, getThemeValue(styleKey, value, theme, config));
5026
- } else {
5027
- const breakpointsValues = handleBreakpoints({
5028
- theme
5029
- }, value, (x) => ({
5030
- [styleKey]: x
5031
- }));
5032
- if (objectsHaveSameKeys(breakpointsValues, value)) {
5033
- css[styleKey] = styleFunctionSx2({
5034
- sx: value,
5035
- theme
5036
- });
5037
- } else {
5038
- css = merge$1(css, breakpointsValues);
5039
- }
5040
- }
5041
- } else {
5042
- css = merge$1(css, getThemeValue(styleKey, value, theme, config));
5043
- }
5108
+ if (value === null || value === void 0) {
5109
+ continue;
5044
5110
  }
5045
- });
5046
- return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));
5111
+ if (typeof value !== "object") {
5112
+ setThemeValue(css, styleKey, value, theme, config);
5113
+ continue;
5114
+ }
5115
+ if (config[styleKey]) {
5116
+ setThemeValue(css, styleKey, value, theme, config);
5117
+ continue;
5118
+ }
5119
+ if (hasBreakpoint(breakpoints, value)) {
5120
+ iterateBreakpoints(css, props.theme, value, (mediaKey, finalValue) => {
5121
+ css[mediaKey][styleKey] = finalValue;
5122
+ });
5123
+ } else {
5124
+ wrapper2.sx = value;
5125
+ css[styleKey] = styleFunctionSx2(wrapper2);
5126
+ }
5127
+ }
5128
+ if (!nested && theme.modularCssLayers) {
5129
+ return {
5130
+ "@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css))
5131
+ };
5132
+ }
5133
+ return sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css));
5047
5134
  }
5048
- return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
5135
+ return Array.isArray(sx) ? sx.map(process) : process(sx);
5049
5136
  }
5137
+ styleFunctionSx2.filterProps = ["sx"];
5050
5138
  return styleFunctionSx2;
5051
5139
  }
5052
5140
  const styleFunctionSx = unstable_createStyleFunctionSx();
5053
- styleFunctionSx.filterProps = ["sx"];
5141
+ function setThemeValue(css, prop, value, theme, config) {
5142
+ const options = config[prop];
5143
+ if (!options) {
5144
+ css[prop] = value;
5145
+ return;
5146
+ }
5147
+ if (value == null) {
5148
+ return;
5149
+ }
5150
+ const {
5151
+ themeKey
5152
+ } = options;
5153
+ if (themeKey === "typography" && value === "inherit") {
5154
+ css[prop] = value;
5155
+ return;
5156
+ }
5157
+ const {
5158
+ style: style2
5159
+ } = options;
5160
+ if (style2) {
5161
+ fastDeepAssign(css, style2({
5162
+ [prop]: value,
5163
+ theme
5164
+ }));
5165
+ return;
5166
+ }
5167
+ const {
5168
+ cssProperty = prop,
5169
+ transform
5170
+ } = options;
5171
+ const themeMapping = getPath(theme, themeKey);
5172
+ iterateBreakpoints(css, theme, value, (mediaKey, valueFinal) => {
5173
+ const finalValue = getStyleValue2(themeMapping, transform, valueFinal, prop);
5174
+ if (cssProperty === false) {
5175
+ if (mediaKey) {
5176
+ fastDeepAssign(css[mediaKey], finalValue);
5177
+ } else {
5178
+ fastDeepAssign(css, finalValue);
5179
+ }
5180
+ } else {
5181
+ if (mediaKey) {
5182
+ css[mediaKey][cssProperty] = finalValue;
5183
+ } else {
5184
+ css[cssProperty] = finalValue;
5185
+ }
5186
+ }
5187
+ });
5188
+ }
5189
+ function callIfFn(maybeFn, arg2) {
5190
+ return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
5191
+ }
5054
5192
  function applyStyles(key, styles) {
5055
5193
  const theme = this;
5056
5194
  if (theme.vars) {
@@ -5111,67 +5249,19 @@ function createTheme$1(options = {}, ...args) {
5111
5249
  theme: this
5112
5250
  });
5113
5251
  };
5252
+ muiTheme.internal_cache = {};
5114
5253
  return muiTheme;
5115
5254
  }
5116
- function isObjectEmpty$1(obj) {
5255
+ function isObjectEmpty(obj) {
5117
5256
  return Object.keys(obj).length === 0;
5118
5257
  }
5119
- function useTheme$2(defaultTheme2 = null) {
5258
+ function useThemeWithoutDefault(defaultTheme2 = null) {
5120
5259
  const contextTheme = React.useContext(ThemeContext);
5121
- return !contextTheme || isObjectEmpty$1(contextTheme) ? defaultTheme2 : contextTheme;
5260
+ return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
5122
5261
  }
5123
5262
  const systemDefaultTheme$1 = createTheme$1();
5124
5263
  function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
5125
- return useTheme$2(defaultTheme2);
5126
- }
5127
- const splitProps = (props) => {
5128
- const result = {
5129
- systemProps: {},
5130
- otherProps: {}
5131
- };
5132
- const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
5133
- Object.keys(props).forEach((prop) => {
5134
- if (config[prop]) {
5135
- result.systemProps[prop] = props[prop];
5136
- } else {
5137
- result.otherProps[prop] = props[prop];
5138
- }
5139
- });
5140
- return result;
5141
- };
5142
- function extendSxProp$1(props) {
5143
- const {
5144
- sx: inSx,
5145
- ...other
5146
- } = props;
5147
- const {
5148
- systemProps,
5149
- otherProps
5150
- } = splitProps(other);
5151
- let finalSx;
5152
- if (Array.isArray(inSx)) {
5153
- finalSx = [systemProps, ...inSx];
5154
- } else if (typeof inSx === "function") {
5155
- finalSx = (...args) => {
5156
- const result = inSx(...args);
5157
- if (!isPlainObject$1(result)) {
5158
- return systemProps;
5159
- }
5160
- return {
5161
- ...systemProps,
5162
- ...result
5163
- };
5164
- };
5165
- } else {
5166
- finalSx = {
5167
- ...systemProps,
5168
- ...inSx
5169
- };
5170
- }
5171
- return {
5172
- ...otherProps,
5173
- sx: finalSx
5174
- };
5264
+ return useThemeWithoutDefault(defaultTheme2);
5175
5265
  }
5176
5266
  const defaultGenerator = (componentName) => componentName;
5177
5267
  const createClassNameGenerator = () => {
@@ -5282,6 +5372,12 @@ const systemDefaultTheme = createTheme$1();
5282
5372
  function shouldForwardProp(prop) {
5283
5373
  return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
5284
5374
  }
5375
+ function shallowLayer(serialized, layerName) {
5376
+ if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
5377
+ serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
5378
+ }
5379
+ return serialized;
5380
+ }
5285
5381
  function defaultOverridesResolver(slot) {
5286
5382
  if (!slot) {
5287
5383
  return null;
@@ -5289,32 +5385,32 @@ function defaultOverridesResolver(slot) {
5289
5385
  return (_props, styles) => styles[slot];
5290
5386
  }
5291
5387
  function attachTheme(props, themeId, defaultTheme2) {
5292
- props.theme = isObjectEmpty(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
5388
+ props.theme = isObjectEmpty$1(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
5293
5389
  }
5294
- function processStyle(props, style2) {
5390
+ function processStyle(props, style2, layerName) {
5295
5391
  const resolvedStyle = typeof style2 === "function" ? style2(props) : style2;
5296
5392
  if (Array.isArray(resolvedStyle)) {
5297
- return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
5393
+ return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
5298
5394
  }
5299
5395
  if (Array.isArray(resolvedStyle?.variants)) {
5300
5396
  let rootStyle;
5301
5397
  if (resolvedStyle.isProcessed) {
5302
- rootStyle = resolvedStyle.style;
5398
+ rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
5303
5399
  } else {
5304
5400
  const {
5305
5401
  variants,
5306
5402
  ...otherStyles
5307
5403
  } = resolvedStyle;
5308
- rootStyle = otherStyles;
5404
+ rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
5309
5405
  }
5310
- return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
5406
+ return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
5311
5407
  }
5312
5408
  if (resolvedStyle?.isProcessed) {
5313
- return resolvedStyle.style;
5409
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
5314
5410
  }
5315
- return resolvedStyle;
5411
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
5316
5412
  }
5317
- function processStyleVariants(props, variants, results = []) {
5413
+ function processStyleVariants(props, variants, results = [], layerName = void 0) {
5318
5414
  let mergedState;
5319
5415
  variantLoop: for (let i = 0; i < variants.length; i += 1) {
5320
5416
  const variant = variants[i];
@@ -5340,9 +5436,9 @@ function processStyleVariants(props, variants, results = []) {
5340
5436
  ...props.ownerState,
5341
5437
  ownerState: props.ownerState
5342
5438
  };
5343
- results.push(variant.style(mergedState));
5439
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
5344
5440
  } else {
5345
- results.push(variant.style);
5441
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
5346
5442
  }
5347
5443
  }
5348
5444
  return results;
@@ -5369,6 +5465,7 @@ function createStyled2(input = {}) {
5369
5465
  overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),
5370
5466
  ...options
5371
5467
  } = inputOptions;
5468
+ const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
5372
5469
  const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
5373
5470
  // TODO v6: remove `Root` in the next major release
5374
5471
  // For more details: https://github.com/mui/material-ui/pull/37908
@@ -5389,18 +5486,21 @@ function createStyled2(input = {}) {
5389
5486
  ...options
5390
5487
  });
5391
5488
  const transformStyle = (style2) => {
5392
- if (typeof style2 === "function" && style2.__emotion_real !== style2) {
5489
+ if (style2.__emotion_real === style2) {
5490
+ return style2;
5491
+ }
5492
+ if (typeof style2 === "function") {
5393
5493
  return function styleFunctionProcessor(props) {
5394
- return processStyle(props, style2);
5494
+ return processStyle(props, style2, props.theme.modularCssLayers ? layerName : void 0);
5395
5495
  };
5396
5496
  }
5397
5497
  if (isPlainObject$1(style2)) {
5398
5498
  const serialized = preprocessStyles(style2);
5399
- if (!serialized.variants) {
5400
- return serialized.style;
5401
- }
5402
5499
  return function styleObjectProcessor(props) {
5403
- return processStyle(props, serialized);
5500
+ if (!serialized.variants) {
5501
+ return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
5502
+ }
5503
+ return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
5404
5504
  };
5405
5505
  }
5406
5506
  return style2;
@@ -5419,7 +5519,7 @@ function createStyled2(input = {}) {
5419
5519
  }
5420
5520
  const resolvedStyleOverrides = {};
5421
5521
  for (const slotKey in styleOverrides) {
5422
- resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);
5522
+ resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
5423
5523
  }
5424
5524
  return overridesResolver(props, resolvedStyleOverrides);
5425
5525
  });
@@ -5431,7 +5531,7 @@ function createStyled2(input = {}) {
5431
5531
  if (!themeVariants) {
5432
5532
  return null;
5433
5533
  }
5434
- return processStyleVariants(props, themeVariants);
5534
+ return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
5435
5535
  });
5436
5536
  }
5437
5537
  if (!skipSx) {
@@ -5480,12 +5580,6 @@ function generateStyledLabel(componentName, componentSlot) {
5480
5580
  }
5481
5581
  return label;
5482
5582
  }
5483
- function isObjectEmpty(object) {
5484
- for (const _ in object) {
5485
- return false;
5486
- }
5487
- return true;
5488
- }
5489
5583
  function isStringTag(tag) {
5490
5584
  return typeof tag === "string" && // 96 is one less than the char code
5491
5585
  // for "a" so this is checking that
@@ -5498,7 +5592,7 @@ function lowercaseFirstLetter(string2) {
5498
5592
  }
5499
5593
  return string2.charAt(0).toLowerCase() + string2.slice(1);
5500
5594
  }
5501
- function resolveProps(defaultProps, props) {
5595
+ function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {
5502
5596
  const output = {
5503
5597
  ...props
5504
5598
  };
@@ -5524,10 +5618,23 @@ function resolveProps(defaultProps, props) {
5524
5618
  for (const slotKey in defaultSlotProps) {
5525
5619
  if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {
5526
5620
  const slotPropName = slotKey;
5527
- output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
5621
+ const defaultSlotPropValue = defaultSlotProps[slotPropName];
5622
+ const slotPropValue = slotProps[slotPropName];
5623
+ if (typeof defaultSlotPropValue === "function" || typeof slotPropValue === "function") {
5624
+ output[propName][slotPropName] = (...args) => resolveProps((typeof defaultSlotPropValue === "function" ? defaultSlotPropValue(...args) : defaultSlotPropValue) ?? {}, (typeof slotPropValue === "function" ? slotPropValue(...args) : slotPropValue) ?? {}, mergeClassNameAndStyle);
5625
+ } else {
5626
+ output[propName][slotPropName] = resolveProps(defaultSlotPropValue ?? {}, slotPropValue ?? {}, mergeClassNameAndStyle);
5627
+ }
5528
5628
  }
5529
5629
  }
5530
5630
  }
5631
+ } else if (propName === "className" && mergeClassNameAndStyle && props.className !== void 0) {
5632
+ output.className = clsx(defaultProps?.className, props?.className);
5633
+ } else if (propName === "style" && mergeClassNameAndStyle && props.style) {
5634
+ output.style = {
5635
+ ...defaultProps?.style,
5636
+ ...props?.style
5637
+ };
5531
5638
  } else if (output[propName] === void 0) {
5532
5639
  output[propName] = defaultProps[propName];
5533
5640
  }
@@ -5687,6 +5794,9 @@ function private_safeAlpha(color2, value, warning) {
5687
5794
  try {
5688
5795
  return alpha(color2, value);
5689
5796
  } catch (error) {
5797
+ if (warning && true) {
5798
+ console.warn(warning);
5799
+ }
5690
5800
  return color2;
5691
5801
  }
5692
5802
  }
@@ -5706,6 +5816,9 @@ function private_safeDarken(color2, coefficient, warning) {
5706
5816
  try {
5707
5817
  return darken(color2, coefficient);
5708
5818
  } catch (error) {
5819
+ if (warning && true) {
5820
+ console.warn(warning);
5821
+ }
5709
5822
  return color2;
5710
5823
  }
5711
5824
  }
@@ -5729,6 +5842,9 @@ function private_safeLighten(color2, coefficient, warning) {
5729
5842
  try {
5730
5843
  return lighten(color2, coefficient);
5731
5844
  } catch (error) {
5845
+ if (warning && true) {
5846
+ console.warn(warning);
5847
+ }
5732
5848
  return color2;
5733
5849
  }
5734
5850
  }
@@ -5781,10 +5897,10 @@ function getThemeProps(params) {
5781
5897
  }
5782
5898
  const config = theme.components[name2];
5783
5899
  if (config.defaultProps) {
5784
- return resolveProps(config.defaultProps, props);
5900
+ return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
5785
5901
  }
5786
5902
  if (!config.styleOverrides && !config.variants) {
5787
- return resolveProps(config, props);
5903
+ return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
5788
5904
  }
5789
5905
  return props;
5790
5906
  }
@@ -5834,9 +5950,14 @@ function createGetCssVar$1(prefix2 = "") {
5834
5950
  };
5835
5951
  return getCssVar;
5836
5952
  }
5953
+ const prototypePollutingKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
5837
5954
  const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
5838
5955
  let temp = obj;
5839
- keys2.forEach((k, index2) => {
5956
+ for (let index2 = 0; index2 < keys2.length; index2 += 1) {
5957
+ const k = keys2[index2];
5958
+ if (prototypePollutingKeys.has(k)) {
5959
+ break;
5960
+ }
5840
5961
  if (index2 === keys2.length - 1) {
5841
5962
  if (Array.isArray(temp)) {
5842
5963
  temp[Number(k)] = value;
@@ -5849,7 +5970,7 @@ const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
5849
5970
  }
5850
5971
  temp = temp[k];
5851
5972
  }
5852
- });
5973
+ }
5853
5974
  };
5854
5975
  const walkObjectDeep = (obj, callback, shouldSkipPaths) => {
5855
5976
  function recurse(object, parentKeys = [], arrayKeys = []) {
@@ -5916,7 +6037,8 @@ function prepareCssVars(theme, parserConfig = {}) {
5916
6037
  const {
5917
6038
  getSelector = defaultGetSelector2,
5918
6039
  disableCssColorScheme,
5919
- colorSchemeSelector: selector
6040
+ colorSchemeSelector: selector,
6041
+ enableContrastVars
5920
6042
  } = parserConfig;
5921
6043
  const {
5922
6044
  colorSchemes = {},
@@ -6050,6 +6172,17 @@ function prepareCssVars(theme, parserConfig = {}) {
6050
6172
  ...finalCss
6051
6173
  }), finalCss);
6052
6174
  });
6175
+ if (enableContrastVars) {
6176
+ stylesheets.push({
6177
+ ":root": {
6178
+ // use double underscore to indicate that these are private variables
6179
+ "--__l-threshold": "0.7",
6180
+ "--__l": "clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)",
6181
+ "--__a": "clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"
6182
+ // 0.87 is the default alpha value for black text.
6183
+ }
6184
+ });
6185
+ }
6053
6186
  return stylesheets;
6054
6187
  };
6055
6188
  return {
@@ -6250,6 +6383,19 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
6250
6383
  }
6251
6384
  }
6252
6385
  }
6386
+ function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
6387
+ const tonalOffsetLight = tonalOffset.light || tonalOffset;
6388
+ const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
6389
+ if (!intent[direction]) {
6390
+ if (intent.hasOwnProperty(shade)) {
6391
+ intent[direction] = intent[shade];
6392
+ } else if (direction === "light") {
6393
+ intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
6394
+ } else if (direction === "dark") {
6395
+ intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
6396
+ }
6397
+ }
6398
+ }
6253
6399
  function getDefaultPrimary(mode = "light") {
6254
6400
  if (mode === "dark") {
6255
6401
  return {
@@ -6335,11 +6481,15 @@ function getDefaultWarning(mode = "light") {
6335
6481
  dark: orange[900]
6336
6482
  };
6337
6483
  }
6484
+ function contrastColor(background) {
6485
+ return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;
6486
+ }
6338
6487
  function createPalette(palette) {
6339
6488
  const {
6340
6489
  mode = "light",
6341
6490
  contrastThreshold = 3,
6342
6491
  tonalOffset = 0.2,
6492
+ colorSpace,
6343
6493
  ...other
6344
6494
  } = palette;
6345
6495
  const primary = palette.primary || getDefaultPrimary(mode);
@@ -6349,6 +6499,9 @@ function createPalette(palette) {
6349
6499
  const success = palette.success || getDefaultSuccess(mode);
6350
6500
  const warning = palette.warning || getDefaultWarning(mode);
6351
6501
  function getContrastText(background) {
6502
+ if (colorSpace) {
6503
+ return contrastColor(background);
6504
+ }
6352
6505
  const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
6353
6506
  {
6354
6507
  const contrast = getContrastRatio(background, contrastText);
@@ -6391,8 +6544,13 @@ const theme2 = createTheme({ palette: {
6391
6544
  primary: { main: green[500] },
6392
6545
  } });`);
6393
6546
  }
6394
- addLightOrDark(color2, "light", lightShade, tonalOffset);
6395
- addLightOrDark(color2, "dark", darkShade, tonalOffset);
6547
+ if (colorSpace) {
6548
+ mixLightOrDark(colorSpace, color2, "light", lightShade, tonalOffset);
6549
+ mixLightOrDark(colorSpace, color2, "dark", darkShade, tonalOffset);
6550
+ } else {
6551
+ addLightOrDark(color2, "light", lightShade, tonalOffset);
6552
+ addLightOrDark(color2, "dark", darkShade, tonalOffset);
6553
+ }
6396
6554
  if (!color2.contrastText) {
6397
6555
  color2.contrastText = getContrastText(color2.main);
6398
6556
  }
@@ -6468,6 +6626,44 @@ const theme2 = createTheme({ palette: {
6468
6626
  }, other);
6469
6627
  return paletteOutput;
6470
6628
  }
6629
+ const focusVisibleOffsetVar = "--_focusVisible-offset";
6630
+ const focusVisibleBehaviorVar = "--_focusVisible-behavior";
6631
+ const focusVisibleShadowVar = "--_focusVisible-shadow";
6632
+ const offsetValue = `var(${focusVisibleOffsetVar}, 1)`;
6633
+ const behaviorValue = `var(${focusVisibleBehaviorVar}, )`;
6634
+ function mergeFocusVisibleInput(optionsFocusVisible, args) {
6635
+ return args.reduce((acc, arg2) => arg2 && "focusVisible" in arg2 ? deepmerge(acc, {
6636
+ focusVisible: arg2.focusVisible
6637
+ }) : acc, {
6638
+ focusVisible: optionsFocusVisible
6639
+ }).focusVisible;
6640
+ }
6641
+ function isResolvedFocusVisible(input) {
6642
+ return input != null && typeof input === "object" && typeof input.outlineOffset === "string" && input.outlineOffset.includes(focusVisibleOffsetVar);
6643
+ }
6644
+ function resolveFocusVisible(input, outlineColor2) {
6645
+ return wireFocusVisibleVars({
6646
+ outlineStyle: "solid",
6647
+ outlineColor: outlineColor2,
6648
+ outlineWidth: 2,
6649
+ outlineOffset: 2,
6650
+ // invisible shadow for parent component with solid background (AppBar, Snackbar, Alert) can control the ring color.
6651
+ boxShadow: `var(${focusVisibleShadowVar}, 0 0)`,
6652
+ ...input === true ? null : input
6653
+ });
6654
+ }
6655
+ function wireFocusVisibleVars(resolved) {
6656
+ const offset2 = resolved.outlineOffset ?? 0;
6657
+ if (typeof offset2 !== "string" || !offset2.includes(focusVisibleOffsetVar)) {
6658
+ const offsetPx = typeof offset2 === "number" ? `${offset2}px` : offset2;
6659
+ resolved.outlineOffset = `calc(${offsetValue} * ${offsetPx})`;
6660
+ }
6661
+ const standaloneBoxShadows = /* @__PURE__ */ new Set(["none", "initial", "inherit", "unset", "revert", "revert-layer"]);
6662
+ if (typeof resolved.boxShadow === "string" && !standaloneBoxShadows.has(resolved.boxShadow.trim().toLowerCase()) && !/\binset\b/.test(resolved.boxShadow) && !resolved.boxShadow.includes(focusVisibleBehaviorVar)) {
6663
+ resolved.boxShadow = `${behaviorValue} ${resolved.boxShadow}`;
6664
+ }
6665
+ return resolved;
6666
+ }
6471
6667
  function prepareTypographyVars(typography) {
6472
6668
  const vars = {};
6473
6669
  const entries = Object.entries(typography);
@@ -6589,6 +6785,8 @@ function createShadow(...px) {
6589
6785
  return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
6590
6786
  }
6591
6787
  const shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
6788
+ const DEFAULT_TRANSITION_PROPS = ["all"];
6789
+ const EMPTY_OPTIONS = {};
6592
6790
  const easing = {
6593
6791
  // This is the most common easing curve.
6594
6792
  easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
@@ -6624,15 +6822,19 @@ function getAutoHeightDuration(height2) {
6624
6822
  return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3e3);
6625
6823
  }
6626
6824
  function createTransitions(inputTransitions) {
6825
+ const transitions = {
6826
+ ...inputTransitions
6827
+ };
6828
+ delete transitions.reducedMotion;
6627
6829
  const mergedEasing = {
6628
6830
  ...easing,
6629
- ...inputTransitions.easing
6831
+ ...transitions.easing
6630
6832
  };
6631
6833
  const mergedDuration = {
6632
6834
  ...duration,
6633
- ...inputTransitions.duration
6835
+ ...transitions.duration
6634
6836
  };
6635
- const create2 = (props = ["all"], options = {}) => {
6837
+ const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {
6636
6838
  const {
6637
6839
  duration: durationOption = mergedDuration.standard,
6638
6840
  easing: easingOption = mergedEasing.easeInOut,
@@ -6663,14 +6865,22 @@ function createTransitions(inputTransitions) {
6663
6865
  }
6664
6866
  return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
6665
6867
  };
6868
+ const create2 = transitions.create ?? createTransitionValue;
6666
6869
  return {
6667
6870
  getAutoHeightDuration,
6668
6871
  create: create2,
6669
- ...inputTransitions,
6872
+ ...transitions,
6670
6873
  easing: mergedEasing,
6671
6874
  duration: mergedDuration
6672
6875
  };
6673
6876
  }
6877
+ const EMPTY_MOTION = {};
6878
+ function createMotion(inputMotion = EMPTY_MOTION) {
6879
+ return {
6880
+ reducedMotion: "never",
6881
+ ...inputMotion
6882
+ };
6883
+ }
6674
6884
  const zIndex = {
6675
6885
  mobileStepper: 1e3,
6676
6886
  fab: 1050,
@@ -6692,7 +6902,7 @@ function stringifyTheme(baseTheme = {}) {
6692
6902
  const array = Object.entries(object);
6693
6903
  for (let index2 = 0; index2 < array.length; index2++) {
6694
6904
  const [key, value] = array[index2];
6695
- if (!isSerializable(value) || key.startsWith("unstable_")) {
6905
+ if (!isSerializable(value) || key.startsWith("unstable_") || key.startsWith("internal_")) {
6696
6906
  delete object[key];
6697
6907
  } else if (isPlainObject$1(value)) {
6698
6908
  object[key] = {
@@ -6708,19 +6918,70 @@ function stringifyTheme(baseTheme = {}) {
6708
6918
  const theme = ${JSON.stringify(serializableTheme, null, 2)};
6709
6919
 
6710
6920
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
6921
+ theme.motion = { reducedMotion: 'never', ...theme.motion };
6711
6922
  theme.transitions = createTransitions(theme.transitions || {});
6712
6923
 
6713
6924
  export default theme;`;
6714
6925
  }
6926
+ function coefficientToPercentage(coefficient) {
6927
+ if (typeof coefficient === "number") {
6928
+ return `${(coefficient * 100).toFixed(0)}%`;
6929
+ }
6930
+ return `calc((${coefficient}) * 100%)`;
6931
+ }
6932
+ const parseAddition = (str) => {
6933
+ if (!Number.isNaN(+str)) {
6934
+ return +str;
6935
+ }
6936
+ const numbers = str.match(/\d*\.?\d+/g);
6937
+ if (!numbers) {
6938
+ return 0;
6939
+ }
6940
+ let sum = 0;
6941
+ for (let i = 0; i < numbers.length; i += 1) {
6942
+ sum += +numbers[i];
6943
+ }
6944
+ return sum;
6945
+ };
6946
+ function attachColorManipulators(theme) {
6947
+ Object.assign(theme, {
6948
+ alpha(color2, coefficient) {
6949
+ const obj = this || theme;
6950
+ if (obj.colorSpace) {
6951
+ return `oklch(from ${color2} l c h / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
6952
+ }
6953
+ if (obj.vars) {
6954
+ return `rgba(${color2.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, "var(--$1Channel)")} / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
6955
+ }
6956
+ return alpha(color2, parseAddition(coefficient));
6957
+ },
6958
+ lighten(color2, coefficient) {
6959
+ const obj = this || theme;
6960
+ if (obj.colorSpace) {
6961
+ return `color-mix(in ${obj.colorSpace}, ${color2}, #fff ${coefficientToPercentage(coefficient)})`;
6962
+ }
6963
+ return lighten(color2, coefficient);
6964
+ },
6965
+ darken(color2, coefficient) {
6966
+ const obj = this || theme;
6967
+ if (obj.colorSpace) {
6968
+ return `color-mix(in ${obj.colorSpace}, ${color2}, #000 ${coefficientToPercentage(coefficient)})`;
6969
+ }
6970
+ return darken(color2, coefficient);
6971
+ }
6972
+ });
6973
+ }
6715
6974
  function createThemeNoVars(options = {}, ...args) {
6716
6975
  const {
6717
6976
  breakpoints: breakpointsInput,
6718
6977
  mixins: mixinsInput = {},
6719
6978
  spacing: spacingInput,
6720
6979
  palette: paletteInput = {},
6980
+ motion: motionInput = {},
6721
6981
  transitions: transitionsInput = {},
6722
6982
  typography: typographyInput = {},
6723
6983
  shape: shapeInput,
6984
+ colorSpace,
6724
6985
  ...other
6725
6986
  } = options;
6726
6987
  if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
@@ -6728,7 +6989,10 @@ function createThemeNoVars(options = {}, ...args) {
6728
6989
  options.generateThemeVars === void 0) {
6729
6990
  throw new Error("MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.");
6730
6991
  }
6731
- const palette = createPalette(paletteInput);
6992
+ const palette = createPalette({
6993
+ ...paletteInput,
6994
+ colorSpace
6995
+ });
6732
6996
  const systemTheme = createTheme$1(options);
6733
6997
  let muiTheme = deepmerge(systemTheme, {
6734
6998
  mixins: createMixins(systemTheme.breakpoints, mixinsInput),
@@ -6736,6 +7000,7 @@ function createThemeNoVars(options = {}, ...args) {
6736
7000
  // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
6737
7001
  shadows: shadows.slice(),
6738
7002
  typography: createTypography(palette, typographyInput),
7003
+ motion: createMotion(motionInput),
6739
7004
  transitions: createTransitions(transitionsInput),
6740
7005
  zIndex: {
6741
7006
  ...zIndex
@@ -6743,6 +7008,10 @@ function createThemeNoVars(options = {}, ...args) {
6743
7008
  });
6744
7009
  muiTheme = deepmerge(muiTheme, other);
6745
7010
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
7011
+ delete muiTheme.transitions.reducedMotion;
7012
+ if (muiTheme.focusVisible != null && muiTheme.focusVisible !== false) {
7013
+ muiTheme.focusVisible = resolveFocusVisible(muiTheme.focusVisible, muiTheme.palette.primary.main);
7014
+ }
6746
7015
  {
6747
7016
  const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
6748
7017
  const traverse = (node2, component) => {
@@ -6780,6 +7049,7 @@ function createThemeNoVars(options = {}, ...args) {
6780
7049
  });
6781
7050
  };
6782
7051
  muiTheme.toRuntimeSource = stringifyTheme;
7052
+ attachColorManipulators(muiTheme);
6783
7053
  return muiTheme;
6784
7054
  }
6785
7055
  function getOverlayAlpha(elevation) {
@@ -6817,9 +7087,13 @@ function createColorScheme(options) {
6817
7087
  // need to cast to avoid module augmentation test
6818
7088
  opacity,
6819
7089
  overlays,
6820
- ...rest
7090
+ colorSpace,
7091
+ ...other
6821
7092
  } = options;
6822
- const palette = createPalette(paletteInput);
7093
+ const palette = createPalette({
7094
+ ...paletteInput,
7095
+ colorSpace
7096
+ });
6823
7097
  return {
6824
7098
  palette,
6825
7099
  opacity: {
@@ -6827,11 +7101,14 @@ function createColorScheme(options) {
6827
7101
  ...opacity
6828
7102
  },
6829
7103
  overlays: overlays || getOverlays(palette.mode),
6830
- ...rest
7104
+ ...other
6831
7105
  };
6832
7106
  }
6833
7107
  function shouldSkipGeneratingVar(keys2) {
6834
- return !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
7108
+ return keys2[0] === "motion" || // Keep `focusVisible` inline: its values reference the per-component private vars
7109
+ // (`--_focusVisible-offset`/`-behavior`). Hoisted to a `:root` var they resolve where those
7110
+ // vars are unset, silently breaking the inner-ring inset.
7111
+ keys2[0] === "focusVisible" || !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
6835
7112
  keys2[0] === "palette" && !!keys2[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
6836
7113
  }
6837
7114
  const excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index2) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index2}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
@@ -6934,7 +7211,7 @@ const silent = (fn) => {
6934
7211
  return void 0;
6935
7212
  };
6936
7213
  const createGetCssVar = (cssVarPrefix = "mui") => createGetCssVar$1(cssVarPrefix);
6937
- function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
7214
+ function attachColorScheme$1(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {
6938
7215
  if (!scheme) {
6939
7216
  return void 0;
6940
7217
  }
@@ -6946,7 +7223,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
6946
7223
  palette: {
6947
7224
  mode,
6948
7225
  ...scheme?.palette
6949
- }
7226
+ },
7227
+ colorSpace
6950
7228
  });
6951
7229
  return void 0;
6952
7230
  }
@@ -6958,7 +7236,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
6958
7236
  palette: {
6959
7237
  mode,
6960
7238
  ...scheme?.palette
6961
- }
7239
+ },
7240
+ colorSpace
6962
7241
  });
6963
7242
  colorSchemes[colorScheme] = {
6964
7243
  ...scheme,
@@ -6979,6 +7258,7 @@ function createThemeWithVars(options = {}, ...args) {
6979
7258
  defaultColorScheme: defaultColorSchemeInput,
6980
7259
  disableCssColorScheme = false,
6981
7260
  cssVarPrefix = "mui",
7261
+ nativeColor = false,
6982
7262
  shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 = shouldSkipGeneratingVar,
6983
7263
  colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? "media" : void 0,
6984
7264
  rootSelector = ":root",
@@ -7003,12 +7283,16 @@ function createThemeWithVars(options = {}, ...args) {
7003
7283
  if (!defaultScheme) {
7004
7284
  throw new Error(`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`);
7005
7285
  }
7006
- const muiTheme = attachColorScheme$1(colorSchemes, defaultScheme, input, defaultColorScheme);
7286
+ let colorSpace;
7287
+ if (nativeColor) {
7288
+ colorSpace = "oklch";
7289
+ }
7290
+ const muiTheme = attachColorScheme$1(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);
7007
7291
  if (builtInLight && !colorSchemes.light) {
7008
- attachColorScheme$1(colorSchemes, builtInLight, void 0, "light");
7292
+ attachColorScheme$1(colorSpace, colorSchemes, builtInLight, void 0, "light");
7009
7293
  }
7010
7294
  if (builtInDark && !colorSchemes.dark) {
7011
- attachColorScheme$1(colorSchemes, builtInDark, void 0, "dark");
7295
+ attachColorScheme$1(colorSpace, colorSchemes, builtInDark, void 0, "dark");
7012
7296
  }
7013
7297
  let theme = {
7014
7298
  defaultColorScheme,
@@ -7040,12 +7324,28 @@ function createThemeWithVars(options = {}, ...args) {
7040
7324
  setColor(palette.common, "background", "#000");
7041
7325
  setColor(palette.common, "onBackground", "#fff");
7042
7326
  }
7327
+ function colorMix(method, color2, coefficient) {
7328
+ if (colorSpace) {
7329
+ let mixer;
7330
+ if (method === private_safeAlpha) {
7331
+ mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
7332
+ }
7333
+ if (method === private_safeDarken) {
7334
+ mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
7335
+ }
7336
+ if (method === private_safeLighten) {
7337
+ mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
7338
+ }
7339
+ return `color-mix(in ${colorSpace}, ${color2}, ${mixer})`;
7340
+ }
7341
+ return method(color2, coefficient);
7342
+ }
7043
7343
  assignNode(palette, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
7044
7344
  if (palette.mode === "light") {
7045
- setColor(palette.Alert, "errorColor", private_safeDarken(palette.error.light, 0.6));
7046
- setColor(palette.Alert, "infoColor", private_safeDarken(palette.info.light, 0.6));
7047
- setColor(palette.Alert, "successColor", private_safeDarken(palette.success.light, 0.6));
7048
- setColor(palette.Alert, "warningColor", private_safeDarken(palette.warning.light, 0.6));
7345
+ setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
7346
+ setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
7347
+ setColor(palette.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
7348
+ setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
7049
7349
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
7050
7350
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
7051
7351
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
@@ -7054,10 +7354,10 @@ function createThemeWithVars(options = {}, ...args) {
7054
7354
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.main)));
7055
7355
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.main)));
7056
7356
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.main)));
7057
- setColor(palette.Alert, "errorStandardBg", private_safeLighten(palette.error.light, 0.9));
7058
- setColor(palette.Alert, "infoStandardBg", private_safeLighten(palette.info.light, 0.9));
7059
- setColor(palette.Alert, "successStandardBg", private_safeLighten(palette.success.light, 0.9));
7060
- setColor(palette.Alert, "warningStandardBg", private_safeLighten(palette.warning.light, 0.9));
7357
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
7358
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
7359
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
7360
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
7061
7361
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
7062
7362
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
7063
7363
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -7072,41 +7372,41 @@ function createThemeWithVars(options = {}, ...args) {
7072
7372
  setColor(palette.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
7073
7373
  setColor(palette.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
7074
7374
  setColor(palette.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
7075
- setColor(palette.LinearProgress, "primaryBg", private_safeLighten(palette.primary.main, 0.62));
7076
- setColor(palette.LinearProgress, "secondaryBg", private_safeLighten(palette.secondary.main, 0.62));
7077
- setColor(palette.LinearProgress, "errorBg", private_safeLighten(palette.error.main, 0.62));
7078
- setColor(palette.LinearProgress, "infoBg", private_safeLighten(palette.info.main, 0.62));
7079
- setColor(palette.LinearProgress, "successBg", private_safeLighten(palette.success.main, 0.62));
7080
- setColor(palette.LinearProgress, "warningBg", private_safeLighten(palette.warning.main, 0.62));
7081
- setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
7082
- setColor(palette.Slider, "primaryTrack", private_safeLighten(palette.primary.main, 0.62));
7083
- setColor(palette.Slider, "secondaryTrack", private_safeLighten(palette.secondary.main, 0.62));
7084
- setColor(palette.Slider, "errorTrack", private_safeLighten(palette.error.main, 0.62));
7085
- setColor(palette.Slider, "infoTrack", private_safeLighten(palette.info.main, 0.62));
7086
- setColor(palette.Slider, "successTrack", private_safeLighten(palette.success.main, 0.62));
7087
- setColor(palette.Slider, "warningTrack", private_safeLighten(palette.warning.main, 0.62));
7088
- const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.8);
7375
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
7376
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
7377
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
7378
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
7379
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
7380
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.62));
7381
+ setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette.text.primary, 0.11) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
7382
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
7383
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
7384
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
7385
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
7386
+ setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
7387
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
7388
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
7089
7389
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
7090
- setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
7390
+ setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
7091
7391
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
7092
7392
  setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-400"));
7093
7393
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-400"));
7094
7394
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-common-white"));
7095
7395
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
7096
- setColor(palette.Switch, "primaryDisabledColor", private_safeLighten(palette.primary.main, 0.62));
7097
- setColor(palette.Switch, "secondaryDisabledColor", private_safeLighten(palette.secondary.main, 0.62));
7098
- setColor(palette.Switch, "errorDisabledColor", private_safeLighten(palette.error.main, 0.62));
7099
- setColor(palette.Switch, "infoDisabledColor", private_safeLighten(palette.info.main, 0.62));
7100
- setColor(palette.Switch, "successDisabledColor", private_safeLighten(palette.success.main, 0.62));
7101
- setColor(palette.Switch, "warningDisabledColor", private_safeLighten(palette.warning.main, 0.62));
7102
- setColor(palette.TableCell, "border", private_safeLighten(private_safeAlpha(palette.divider, 1), 0.88));
7103
- setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
7396
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
7397
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
7398
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
7399
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
7400
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
7401
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
7402
+ setColor(palette.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.88));
7403
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
7104
7404
  }
7105
7405
  if (palette.mode === "dark") {
7106
- setColor(palette.Alert, "errorColor", private_safeLighten(palette.error.light, 0.6));
7107
- setColor(palette.Alert, "infoColor", private_safeLighten(palette.info.light, 0.6));
7108
- setColor(palette.Alert, "successColor", private_safeLighten(palette.success.light, 0.6));
7109
- setColor(palette.Alert, "warningColor", private_safeLighten(palette.warning.light, 0.6));
7406
+ setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
7407
+ setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
7408
+ setColor(palette.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
7409
+ setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
7110
7410
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
7111
7411
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
7112
7412
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
@@ -7115,10 +7415,10 @@ function createThemeWithVars(options = {}, ...args) {
7115
7415
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.dark)));
7116
7416
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.dark)));
7117
7417
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.dark)));
7118
- setColor(palette.Alert, "errorStandardBg", private_safeDarken(palette.error.light, 0.9));
7119
- setColor(palette.Alert, "infoStandardBg", private_safeDarken(palette.info.light, 0.9));
7120
- setColor(palette.Alert, "successStandardBg", private_safeDarken(palette.success.light, 0.9));
7121
- setColor(palette.Alert, "warningStandardBg", private_safeDarken(palette.warning.light, 0.9));
7418
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
7419
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
7420
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
7421
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
7122
7422
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
7123
7423
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
7124
7424
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -7135,44 +7435,46 @@ function createThemeWithVars(options = {}, ...args) {
7135
7435
  setColor(palette.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
7136
7436
  setColor(palette.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
7137
7437
  setColor(palette.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
7138
- setColor(palette.LinearProgress, "primaryBg", private_safeDarken(palette.primary.main, 0.5));
7139
- setColor(palette.LinearProgress, "secondaryBg", private_safeDarken(palette.secondary.main, 0.5));
7140
- setColor(palette.LinearProgress, "errorBg", private_safeDarken(palette.error.main, 0.5));
7141
- setColor(palette.LinearProgress, "infoBg", private_safeDarken(palette.info.main, 0.5));
7142
- setColor(palette.LinearProgress, "successBg", private_safeDarken(palette.success.main, 0.5));
7143
- setColor(palette.LinearProgress, "warningBg", private_safeDarken(palette.warning.main, 0.5));
7144
- setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
7145
- setColor(palette.Slider, "primaryTrack", private_safeDarken(palette.primary.main, 0.5));
7146
- setColor(palette.Slider, "secondaryTrack", private_safeDarken(palette.secondary.main, 0.5));
7147
- setColor(palette.Slider, "errorTrack", private_safeDarken(palette.error.main, 0.5));
7148
- setColor(palette.Slider, "infoTrack", private_safeDarken(palette.info.main, 0.5));
7149
- setColor(palette.Slider, "successTrack", private_safeDarken(palette.success.main, 0.5));
7150
- setColor(palette.Slider, "warningTrack", private_safeDarken(palette.warning.main, 0.5));
7151
- const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.98);
7438
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
7439
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
7440
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
7441
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
7442
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
7443
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.5));
7444
+ setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette.text.primary, 0.13) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
7445
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
7446
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
7447
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
7448
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
7449
+ setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
7450
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.5));
7451
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
7152
7452
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
7153
- setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
7453
+ setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
7154
7454
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
7155
7455
  setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-600"));
7156
7456
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-600"));
7157
7457
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
7158
7458
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
7159
- setColor(palette.Switch, "primaryDisabledColor", private_safeDarken(palette.primary.main, 0.55));
7160
- setColor(palette.Switch, "secondaryDisabledColor", private_safeDarken(palette.secondary.main, 0.55));
7161
- setColor(palette.Switch, "errorDisabledColor", private_safeDarken(palette.error.main, 0.55));
7162
- setColor(palette.Switch, "infoDisabledColor", private_safeDarken(palette.info.main, 0.55));
7163
- setColor(palette.Switch, "successDisabledColor", private_safeDarken(palette.success.main, 0.55));
7164
- setColor(palette.Switch, "warningDisabledColor", private_safeDarken(palette.warning.main, 0.55));
7165
- setColor(palette.TableCell, "border", private_safeDarken(private_safeAlpha(palette.divider, 1), 0.68));
7166
- setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
7167
- }
7168
- setColorChannel(palette.background, "default");
7169
- setColorChannel(palette.background, "paper");
7170
- setColorChannel(palette.common, "background");
7171
- setColorChannel(palette.common, "onBackground");
7172
- setColorChannel(palette, "divider");
7459
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.55));
7460
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.55));
7461
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.55));
7462
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.55));
7463
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.55));
7464
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.55));
7465
+ setColor(palette.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.68));
7466
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
7467
+ }
7468
+ if (!nativeColor) {
7469
+ setColorChannel(palette.background, "default");
7470
+ setColorChannel(palette.background, "paper");
7471
+ setColorChannel(palette.common, "background");
7472
+ setColorChannel(palette.common, "onBackground");
7473
+ setColorChannel(palette, "divider");
7474
+ }
7173
7475
  Object.keys(palette).forEach((color2) => {
7174
7476
  const colors = palette[color2];
7175
- if (color2 !== "tonalOffset" && colors && typeof colors === "object") {
7477
+ if (color2 !== "tonalOffset" && !nativeColor && colors && typeof colors === "object") {
7176
7478
  if (colors.main) {
7177
7479
  setColor(palette[color2], "mainChannel", private_safeColorChannel(toRgb(colors.main)));
7178
7480
  }
@@ -7201,11 +7503,16 @@ function createThemeWithVars(options = {}, ...args) {
7201
7503
  });
7202
7504
  });
7203
7505
  theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
7506
+ const focusVisibleInput = mergeFocusVisibleInput(options.focusVisible, args);
7507
+ if (focusVisibleInput != null && focusVisibleInput !== false) {
7508
+ theme.focusVisible = resolveFocusVisible(focusVisibleInput, getCssVar("palette-primary-main"));
7509
+ }
7204
7510
  const parserConfig = {
7205
7511
  prefix: cssVarPrefix,
7206
7512
  disableCssColorScheme,
7207
7513
  shouldSkipGeneratingVar: shouldSkipGeneratingVar$1,
7208
- getSelector: defaultGetSelector(theme)
7514
+ getSelector: defaultGetSelector(theme),
7515
+ enableContrastVars: nativeColor
7209
7516
  };
7210
7517
  const {
7211
7518
  vars,
@@ -7234,6 +7541,7 @@ function createThemeWithVars(options = {}, ...args) {
7234
7541
  theme: this
7235
7542
  });
7236
7543
  };
7544
+ theme.internal_cache = {};
7237
7545
  theme.toRuntimeSource = stringifyTheme;
7238
7546
  return theme;
7239
7547
  }
@@ -7260,7 +7568,7 @@ function createTheme(options = {}, ...args) {
7260
7568
  light: true
7261
7569
  } : void 0,
7262
7570
  defaultColorScheme: initialDefaultColorScheme = palette?.mode,
7263
- ...rest
7571
+ ...other
7264
7572
  } = options;
7265
7573
  const defaultColorSchemeInput = initialDefaultColorScheme || "light";
7266
7574
  const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
@@ -7309,18 +7617,74 @@ function createTheme(options = {}, ...args) {
7309
7617
  };
7310
7618
  attachColorScheme(theme, "light", colorSchemesInput.light);
7311
7619
  }
7620
+ if (theme.focusVisible != null && theme.focusVisible !== false) {
7621
+ let focusVisibleInput = theme.focusVisible;
7622
+ const rawFocusVisible = mergeFocusVisibleInput(options.focusVisible, args);
7623
+ const authoredColor = rawFocusVisible && typeof rawFocusVisible === "object" ? rawFocusVisible.outlineColor : void 0;
7624
+ if (!authoredColor || isResolvedFocusVisible(rawFocusVisible) && authoredColor === theme.palette.primary.main) {
7625
+ const {
7626
+ outlineColor: outlineColor2,
7627
+ ...rest
7628
+ } = focusVisibleInput;
7629
+ focusVisibleInput = rest;
7630
+ }
7631
+ Object.keys(theme.colorSchemes).forEach((scheme) => {
7632
+ const schemePalette = theme.colorSchemes?.[scheme]?.palette;
7633
+ if (schemePalette?.primary) {
7634
+ theme.colorSchemes[scheme].focusVisible = resolveFocusVisible(focusVisibleInput, schemePalette.primary.main);
7635
+ }
7636
+ });
7637
+ }
7312
7638
  return theme;
7313
7639
  }
7314
7640
  if (!palette && !("light" in colorSchemesInput) && defaultColorSchemeInput === "light") {
7315
7641
  colorSchemesInput.light = true;
7316
7642
  }
7317
7643
  return createThemeWithVars({
7318
- ...rest,
7644
+ ...other,
7319
7645
  colorSchemes: colorSchemesInput,
7320
7646
  defaultColorScheme: defaultColorSchemeInput,
7321
7647
  ...typeof cssVariables !== "boolean" && cssVariables
7322
7648
  }, ...args);
7323
7649
  }
7650
+ function useForkRef$1(...refs) {
7651
+ const cleanupRef = React.useRef(void 0);
7652
+ const refEffect = React.useCallback((instance) => {
7653
+ const cleanups = refs.map((ref) => {
7654
+ if (ref == null) {
7655
+ return null;
7656
+ }
7657
+ if (typeof ref === "function") {
7658
+ const refCallback = ref;
7659
+ const refCleanup = refCallback(instance);
7660
+ return typeof refCleanup === "function" ? refCleanup : () => {
7661
+ refCallback(null);
7662
+ };
7663
+ }
7664
+ ref.current = instance;
7665
+ return () => {
7666
+ ref.current = null;
7667
+ };
7668
+ });
7669
+ return () => {
7670
+ cleanups.forEach((refCleanup) => refCleanup?.());
7671
+ };
7672
+ }, refs);
7673
+ return React.useMemo(() => {
7674
+ if (refs.every((ref) => ref == null)) {
7675
+ return null;
7676
+ }
7677
+ return (value) => {
7678
+ if (cleanupRef.current) {
7679
+ cleanupRef.current();
7680
+ cleanupRef.current = void 0;
7681
+ }
7682
+ if (value != null) {
7683
+ cleanupRef.current = refEffect(value);
7684
+ }
7685
+ };
7686
+ }, refs);
7687
+ }
7324
7688
  const defaultTheme = createTheme();
7325
7689
  function useTheme() {
7326
7690
  const theme = useTheme$1(defaultTheme);
@@ -7338,20 +7702,6 @@ const styled = createStyled2({
7338
7702
  defaultTheme,
7339
7703
  rootShouldForwardProp
7340
7704
  });
7341
- const { makeStyles } = createMakeAndWithStyles({
7342
- useTheme
7343
- });
7344
- const { tss } = createTss({
7345
- "useContext": function useContext2() {
7346
- const theme = useTheme();
7347
- return { theme };
7348
- },
7349
- "usePlugin": useMuiThemeStyleOverridesPlugin
7350
- });
7351
- const useStyles$1 = tss.create({});
7352
- function internal_createExtendSxProp() {
7353
- return extendSxProp$1;
7354
- }
7355
7705
  const memoTheme = unstable_memoTheme;
7356
7706
  ({
7357
7707
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -7370,6 +7720,17 @@ const memoTheme = unstable_memoTheme;
7370
7720
  function useDefaultProps(params) {
7371
7721
  return useDefaultProps$1(params);
7372
7722
  }
7723
+ const { makeStyles } = createMakeAndWithStyles({
7724
+ useTheme
7725
+ });
7726
+ const { tss } = createTss({
7727
+ "useContext": function useContext2() {
7728
+ const theme = useTheme();
7729
+ return { theme };
7730
+ },
7731
+ "usePlugin": useMuiThemeStyleOverridesPlugin
7732
+ });
7733
+ const useStyles$1 = tss.create({});
7373
7734
  function setRef$1(ref, value) {
7374
7735
  if (typeof ref === "function") {
7375
7736
  ref(value);
@@ -7377,56 +7738,6 @@ function setRef$1(ref, value) {
7377
7738
  ref.current = value;
7378
7739
  }
7379
7740
  }
7380
- function useForkRef$1(...refs) {
7381
- const cleanupRef = React.useRef(void 0);
7382
- const refEffect = React.useCallback((instance) => {
7383
- const cleanups = refs.map((ref) => {
7384
- if (ref == null) {
7385
- return null;
7386
- }
7387
- if (typeof ref === "function") {
7388
- const refCallback = ref;
7389
- const refCleanup = refCallback(instance);
7390
- return typeof refCleanup === "function" ? refCleanup : () => {
7391
- refCallback(null);
7392
- };
7393
- }
7394
- ref.current = instance;
7395
- return () => {
7396
- ref.current = null;
7397
- };
7398
- });
7399
- return () => {
7400
- cleanups.forEach((refCleanup) => refCleanup?.());
7401
- };
7402
- }, refs);
7403
- return React.useMemo(() => {
7404
- if (refs.every((ref) => ref == null)) {
7405
- return null;
7406
- }
7407
- return (value) => {
7408
- if (cleanupRef.current) {
7409
- cleanupRef.current();
7410
- cleanupRef.current = void 0;
7411
- }
7412
- if (value != null) {
7413
- cleanupRef.current = refEffect(value);
7414
- }
7415
- };
7416
- }, refs);
7417
- }
7418
- function _setPrototypeOf(t, e) {
7419
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
7420
- return t2.__proto__ = e2, t2;
7421
- }, _setPrototypeOf(t, e);
7422
- }
7423
- function _inheritsLoose(t, o) {
7424
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
7425
- }
7426
- function _assertThisInitialized(e) {
7427
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7428
- return e;
7429
- }
7430
7741
  function hasCorrectMainProperty(obj) {
7431
7742
  return typeof obj.main === "string";
7432
7743
  }
@@ -7461,22 +7772,22 @@ function getReactElementRef(element2) {
7461
7772
  }
7462
7773
  return element2?.ref || null;
7463
7774
  }
7464
- function getContainer(container) {
7465
- return typeof container === "function" ? container() : container;
7775
+ function getContainer(container2) {
7776
+ return typeof container2 === "function" ? container2() : container2;
7466
7777
  }
7467
7778
  const Portal = /* @__PURE__ */ React.forwardRef(function Portal2(props, forwardedRef) {
7468
7779
  const {
7469
7780
  children,
7470
- container,
7781
+ container: container2,
7471
7782
  disablePortal = false
7472
7783
  } = props;
7473
7784
  const [mountNode, setMountNode] = React.useState(null);
7474
7785
  const handleRef = useForkRef$1(/* @__PURE__ */ React.isValidElement(children) ? getReactElementRef(children) : null, forwardedRef);
7475
7786
  useEnhancedEffect$1(() => {
7476
7787
  if (!disablePortal) {
7477
- setMountNode(getContainer(container) || document.body);
7788
+ setMountNode(getContainer(container2) || document.body);
7478
7789
  }
7479
- }, [container, disablePortal]);
7790
+ }, [container2, disablePortal]);
7480
7791
  useEnhancedEffect$1(() => {
7481
7792
  if (mountNode && !disablePortal) {
7482
7793
  setRef$1(forwardedRef, mountNode);
@@ -7529,30 +7840,17 @@ Portal.propTypes = {
7529
7840
  function getTypographyUtilityClass(slot) {
7530
7841
  return generateUtilityClass("MuiTypography", slot);
7531
7842
  }
7532
- generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
7533
- const v6Colors = {
7534
- primary: true,
7535
- secondary: true,
7536
- error: true,
7537
- info: true,
7538
- success: true,
7539
- warning: true,
7540
- textPrimary: true,
7541
- textSecondary: true,
7542
- textDisabled: true
7543
- };
7544
- const extendSxProp = internal_createExtendSxProp();
7843
+ generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"]);
7545
7844
  const useUtilityClasses = (ownerState) => {
7546
7845
  const {
7547
7846
  align,
7548
7847
  gutterBottom,
7549
7848
  noWrap,
7550
- paragraph: paragraph2,
7551
7849
  variant,
7552
7850
  classes
7553
7851
  } = ownerState;
7554
7852
  const slots = {
7555
- root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph2 && "paragraph"]
7853
+ root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"]
7556
7854
  };
7557
7855
  return composeClasses(slots, getTypographyUtilityClass, classes);
7558
7856
  };
@@ -7563,7 +7861,7 @@ const TypographyRoot = styled("span", {
7563
7861
  const {
7564
7862
  ownerState
7565
7863
  } = props;
7566
- return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
7864
+ return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom];
7567
7865
  }
7568
7866
  })(memoTheme(({
7569
7867
  theme
@@ -7621,13 +7919,6 @@ const TypographyRoot = styled("span", {
7621
7919
  style: {
7622
7920
  marginBottom: "0.35em"
7623
7921
  }
7624
- }, {
7625
- props: ({
7626
- ownerState
7627
- }) => ownerState.paragraph,
7628
- style: {
7629
- marginBottom: 16
7630
- }
7631
7922
  }]
7632
7923
  })));
7633
7924
  const defaultVariantMapping = {
@@ -7644,27 +7935,17 @@ const defaultVariantMapping = {
7644
7935
  inherit: "p"
7645
7936
  };
7646
7937
  const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
7647
- const {
7648
- color: color2,
7649
- ...themeProps
7650
- } = useDefaultProps({
7938
+ const props = useDefaultProps({
7651
7939
  props: inProps,
7652
7940
  name: "MuiTypography"
7653
7941
  });
7654
- const isSxColor = !v6Colors[color2];
7655
- const props = extendSxProp({
7656
- ...themeProps,
7657
- ...isSxColor && {
7658
- color: color2
7659
- }
7660
- });
7661
7942
  const {
7943
+ color: color2,
7662
7944
  align = "inherit",
7663
7945
  className,
7664
7946
  component,
7665
7947
  gutterBottom = false,
7666
7948
  noWrap = false,
7667
- paragraph: paragraph2 = false,
7668
7949
  variant = "body1",
7669
7950
  variantMapping = defaultVariantMapping,
7670
7951
  ...other
@@ -7677,11 +7958,10 @@ const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps
7677
7958
  component,
7678
7959
  gutterBottom,
7679
7960
  noWrap,
7680
- paragraph: paragraph2,
7681
7961
  variant,
7682
7962
  variantMapping
7683
7963
  };
7684
- const Component = component || (paragraph2 ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
7964
+ const Component = component || variantMapping[variant] || defaultVariantMapping[variant] || "span";
7685
7965
  const classes = useUtilityClasses(ownerState);
7686
7966
  return /* @__PURE__ */ jsx(TypographyRoot, {
7687
7967
  as: Component,
@@ -7743,12 +8023,6 @@ Typography.propTypes = {
7743
8023
  * @default false
7744
8024
  */
7745
8025
  noWrap: PropTypes.bool,
7746
- /**
7747
- * If `true`, the element will be a paragraph element.
7748
- * @default false
7749
- * @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
7750
- */
7751
- paragraph: PropTypes.bool,
7752
8026
  /**
7753
8027
  * @ignore
7754
8028
  */
@@ -9378,7 +9652,7 @@ function getAnchorEl(anchorEl) {
9378
9652
  const useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
9379
9653
  const defaultPopperOptions = {};
9380
9654
  React.forwardRef((props, ref) => {
9381
- const { anchorEl, children, container, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
9655
+ const { anchorEl, children, container: container2, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
9382
9656
  const tooltipRef = React.useRef(null);
9383
9657
  const ownRef = useForkRef(tooltipRef, ref);
9384
9658
  const popperRef = React.useRef(null);
@@ -9475,7 +9749,7 @@ React.forwardRef((props, ref) => {
9475
9749
  onExited: handleExited
9476
9750
  };
9477
9751
  }
9478
- return jsx(Portal, { disablePortal, container, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
9752
+ return jsx(Portal, { disablePortal, container: container2, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
9479
9753
  // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
9480
9754
  position: "fixed",
9481
9755
  // Fix Popper.js display issue
@@ -9485,6 +9759,18 @@ React.forwardRef((props, ref) => {
9485
9759
  ...style2
9486
9760
  }, children: typeof children === "function" ? children(childProps) : children }) });
9487
9761
  });
9762
+ function _assertThisInitialized(e) {
9763
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9764
+ return e;
9765
+ }
9766
+ function _setPrototypeOf(t, e) {
9767
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
9768
+ return t2.__proto__ = e2, t2;
9769
+ }, _setPrototypeOf(t, e);
9770
+ }
9771
+ function _inheritsLoose(t, o) {
9772
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
9773
+ }
9488
9774
  var safeIsNaN = Number.isNaN || function ponyfill(value) {
9489
9775
  return typeof value === "number" && value !== value;
9490
9776
  };
@@ -18044,7 +18330,7 @@ function requireExtend() {
18044
18330
  return obj[name2];
18045
18331
  };
18046
18332
  extend$1 = function extend2() {
18047
- var options, name2, src, copy2, copyIsArray, clone;
18333
+ var options, name2, src, copy2, copyIsArray, clone2;
18048
18334
  var target = arguments[0];
18049
18335
  var i = 1;
18050
18336
  var length2 = arguments.length;
@@ -18067,11 +18353,11 @@ function requireExtend() {
18067
18353
  if (deep && copy2 && (isPlainObject2(copy2) || (copyIsArray = isArray(copy2)))) {
18068
18354
  if (copyIsArray) {
18069
18355
  copyIsArray = false;
18070
- clone = src && isArray(src) ? src : [];
18356
+ clone2 = src && isArray(src) ? src : [];
18071
18357
  } else {
18072
- clone = src && isPlainObject2(src) ? src : {};
18358
+ clone2 = src && isPlainObject2(src) ? src : {};
18073
18359
  }
18074
- setProperty(target, { name: name2, newValue: extend2(deep, clone, copy2) });
18360
+ setProperty(target, { name: name2, newValue: extend2(deep, clone2, copy2) });
18075
18361
  } else if (typeof copy2 !== "undefined") {
18076
18362
  setProperty(target, { name: name2, newValue: copy2 });
18077
18363
  }