@vitessce/spatial-accelerated 4.0.10 → 4.1.1

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 +829 -550
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -733,7 +733,7 @@ function rulesheet(callback) {
733
733
  }
734
734
  };
735
735
  }
736
- function memoize$1(fn) {
736
+ function memoize(fn) {
737
737
  var cache = /* @__PURE__ */ Object.create(null);
738
738
  return function(arg2) {
739
739
  if (cache[arg2] === void 0) cache[arg2] = fn(arg2);
@@ -1021,10 +1021,10 @@ var createCache = function createCache2(options) {
1021
1021
  }
1022
1022
  var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1023
1023
  var inserted = {};
1024
- var container;
1024
+ var container2;
1025
1025
  var nodesToHydrate = [];
1026
1026
  {
1027
- container = options.container || document.head;
1027
+ container2 = options.container || document.head;
1028
1028
  Array.prototype.forEach.call(
1029
1029
  // this means we will ignore elements which don't have a space in them which
1030
1030
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
@@ -1061,7 +1061,7 @@ var createCache = function createCache2(options) {
1061
1061
  key,
1062
1062
  sheet: new StyleSheet({
1063
1063
  key,
1064
- container,
1064
+ container: container2,
1065
1065
  nonce: options.nonce,
1066
1066
  speedy: options.speedy,
1067
1067
  prepend: options.prepend,
@@ -1382,7 +1382,7 @@ var isCustomProperty = function isCustomProperty2(property) {
1382
1382
  var isProcessableValue = function isProcessableValue2(value) {
1383
1383
  return value != null && typeof value !== "boolean";
1384
1384
  };
1385
- var processStyleName = /* @__PURE__ */ memoize$1(function(styleName) {
1385
+ var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
1386
1386
  return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
1387
1387
  });
1388
1388
  var processStyleValue = function processStyleValue2(key, value) {
@@ -1646,7 +1646,7 @@ function matchCSSObject(arg2) {
1646
1646
  return arg2 instanceof Object && !("styles" in arg2) && !("length" in arg2) && !("__emotion_styles" in arg2);
1647
1647
  }
1648
1648
  const { createCssAndCx } = /* @__PURE__ */ (() => {
1649
- function merge2(registered, css, className) {
1649
+ function merge(registered, css, className) {
1650
1650
  const registeredStyles = [];
1651
1651
  const rawClassName = getRegisteredStyles(registered, registeredStyles, className);
1652
1652
  if (registeredStyles.length < 2) {
@@ -1672,7 +1672,7 @@ const { createCssAndCx } = /* @__PURE__ */ (() => {
1672
1672
  const cx = (...args) => {
1673
1673
  const className = classnames(args);
1674
1674
  const feat27FixedClassnames = increaseSpecificityToTakePrecedenceOverMediaQueries.fixClassName(cache, className, css);
1675
- return merge2(cache.registered, css, feat27FixedClassnames);
1675
+ return merge(cache.registered, css, feat27FixedClassnames);
1676
1676
  };
1677
1677
  return { css, cx };
1678
1678
  }
@@ -2279,7 +2279,7 @@ const { tss: tss$1 } = createTss({
2279
2279
  tss$1.create({});
2280
2280
  const THEME_ID = "$$material";
2281
2281
  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)-.*))$/;
2282
- var isPropValid = /* @__PURE__ */ memoize$1(
2282
+ var isPropValid = /* @__PURE__ */ memoize(
2283
2283
  function(prop) {
2284
2284
  return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
2285
2285
  }
@@ -3229,8 +3229,7 @@ function requireReactIs_development() {
3229
3229
  }
3230
3230
  }
3231
3231
  }
3232
- 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");
3233
- 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");
3232
+ 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");
3234
3233
  reactIs_development.ContextConsumer = REACT_CONSUMER_TYPE;
3235
3234
  reactIs_development.ContextProvider = REACT_CONTEXT_TYPE;
3236
3235
  reactIs_development.Element = REACT_ELEMENT_TYPE;
@@ -3280,7 +3279,7 @@ function requireReactIs_development() {
3280
3279
  return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
3281
3280
  };
3282
3281
  reactIs_development.isValidElementType = function(type) {
3283
- 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;
3282
+ 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;
3284
3283
  };
3285
3284
  reactIs_development.typeOf = typeOf;
3286
3285
  })();
@@ -3350,19 +3349,12 @@ const sortBreakpointsValues = (values2) => {
3350
3349
  };
3351
3350
  function createBreakpoints(breakpoints) {
3352
3351
  const {
3353
- // The breakpoint **start** at this value.
3354
- // For instance with the first breakpoint xs: [xs, sm).
3355
3352
  values: values2 = {
3356
3353
  xs: 0,
3357
- // phone
3358
3354
  sm: 600,
3359
- // tablet
3360
3355
  md: 900,
3361
- // small laptop
3362
3356
  lg: 1200,
3363
- // desktop
3364
3357
  xl: 1536
3365
- // large screen
3366
3358
  },
3367
3359
  unit = "px",
3368
3360
  step = 5,
@@ -3398,6 +3390,10 @@ function createBreakpoints(breakpoints) {
3398
3390
  }
3399
3391
  return between(key, keys2[keys2.indexOf(key) + 1]).replace("@media", "@media not all and");
3400
3392
  }
3393
+ const mediaKeys = [];
3394
+ for (let i = 0; i < keys2.length; i += 1) {
3395
+ mediaKeys.push(up(keys2[i]));
3396
+ }
3401
3397
  return {
3402
3398
  keys: keys2,
3403
3399
  values: sortedValues,
@@ -3407,28 +3403,40 @@ function createBreakpoints(breakpoints) {
3407
3403
  only,
3408
3404
  not,
3409
3405
  unit,
3406
+ internal_mediaKeys: mediaKeys,
3410
3407
  ...other
3411
3408
  };
3412
3409
  }
3410
+ const MIN_WIDTH_PATTERN = /min-width:\s*([0-9.]+)/;
3413
3411
  function sortContainerQueries(theme, css) {
3414
- if (!theme.containerQueries) {
3412
+ if (!theme.containerQueries || !hasContainerQuery(css)) {
3415
3413
  return css;
3416
3414
  }
3417
- const sorted = Object.keys(css).filter((key) => key.startsWith("@container")).sort((a, b) => {
3418
- const regex = /min-width:\s*([0-9.]+)/;
3419
- return +(a.match(regex)?.[1] || 0) - +(b.match(regex)?.[1] || 0);
3420
- });
3421
- if (!sorted.length) {
3422
- return css;
3415
+ const keys2 = [];
3416
+ for (const key in css) {
3417
+ if (key.startsWith("@container")) {
3418
+ keys2.push(key);
3419
+ }
3423
3420
  }
3424
- return sorted.reduce((acc, key) => {
3425
- const value = css[key];
3426
- delete acc[key];
3427
- acc[key] = value;
3428
- return acc;
3429
- }, {
3430
- ...css
3421
+ keys2.sort((a, b) => {
3422
+ return +(a.match(MIN_WIDTH_PATTERN)?.[1] || 0) - +(b.match(MIN_WIDTH_PATTERN)?.[1] || 0);
3431
3423
  });
3424
+ const result = css;
3425
+ for (let i = 0; i < keys2.length; i += 1) {
3426
+ const key = keys2[i];
3427
+ const value = result[key];
3428
+ delete result[key];
3429
+ result[key] = value;
3430
+ }
3431
+ return result;
3432
+ }
3433
+ function hasContainerQuery(css) {
3434
+ for (const key in css) {
3435
+ if (key.startsWith("@container")) {
3436
+ return true;
3437
+ }
3438
+ }
3439
+ return false;
3432
3440
  }
3433
3441
  function isCqShorthand(breakpointKeys, value) {
3434
3442
  return value === "@" || value.startsWith("@") && (breakpointKeys.some((key) => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
@@ -3437,8 +3445,11 @@ function getContainerQuery(theme, shorthand) {
3437
3445
  const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
3438
3446
  if (!matches) {
3439
3447
  {
3440
- throw new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
3441
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);
3448
+ throw (
3449
+ /* minify-error */
3450
+ new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
3451
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
3452
+ );
3442
3453
  }
3443
3454
  }
3444
3455
  const [, containerQuery, containerName] = matches;
@@ -3475,15 +3486,82 @@ const shape = {
3475
3486
  borderRadius: 4
3476
3487
  };
3477
3488
  const responsivePropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]);
3478
- function merge(acc, item) {
3479
- if (!item) {
3480
- return acc;
3489
+ function isObjectEmpty$1(object) {
3490
+ if (object == null) {
3491
+ return true;
3481
3492
  }
3482
- return deepmerge(acc, item, {
3483
- clone: false
3484
- // No need to clone deep, it's way faster.
3485
- });
3493
+ for (const _ in object) {
3494
+ return false;
3495
+ }
3496
+ return true;
3486
3497
  }
3498
+ function fastDeepAssign(target, source) {
3499
+ const sourceIsArray = Array.isArray(source);
3500
+ const targetIsArray = Array.isArray(target);
3501
+ if (isPrimitive(source)) {
3502
+ return source;
3503
+ } else if (isPrimitiveOrBuiltIn(target)) {
3504
+ return clone(source);
3505
+ } else if (sourceIsArray && targetIsArray) {
3506
+ return mergeArray(target, source);
3507
+ } else if (sourceIsArray !== targetIsArray) {
3508
+ return clone(source);
3509
+ } else {
3510
+ return mergeObject(target, source);
3511
+ }
3512
+ }
3513
+ function cloneArray(value) {
3514
+ let i = 0;
3515
+ const il = value.length;
3516
+ const result = new Array(il);
3517
+ for (i = 0; i < il; i += 1) {
3518
+ result[i] = clone(value[i]);
3519
+ }
3520
+ return result;
3521
+ }
3522
+ function cloneObject(target) {
3523
+ const result = {};
3524
+ for (const key in target) {
3525
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
3526
+ continue;
3527
+ }
3528
+ result[key] = clone(target[key]);
3529
+ }
3530
+ return result;
3531
+ }
3532
+ function mergeArray(target, source) {
3533
+ const tl = target.length;
3534
+ for (let i = 0; i < source.length; i += 1) {
3535
+ target[tl + i] = clone(source[i]);
3536
+ }
3537
+ return target;
3538
+ }
3539
+ function isMergeableObject(value) {
3540
+ return typeof value === "object" && value !== null && !(value instanceof RegExp) && !(value instanceof Date);
3541
+ }
3542
+ function isPrimitive(value) {
3543
+ return typeof value !== "object" || value === null;
3544
+ }
3545
+ function isPrimitiveOrBuiltIn(value) {
3546
+ return typeof value !== "object" || value === null || value instanceof RegExp || value instanceof Date;
3547
+ }
3548
+ function clone(entry) {
3549
+ return isMergeableObject(entry) ? Array.isArray(entry) ? cloneArray(entry) : cloneObject(entry) : entry;
3550
+ }
3551
+ function mergeObject(target, source) {
3552
+ for (const key in source) {
3553
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
3554
+ continue;
3555
+ }
3556
+ if (key in target) {
3557
+ target[key] = fastDeepAssign(target[key], source[key]);
3558
+ } else {
3559
+ target[key] = clone(source[key]);
3560
+ }
3561
+ }
3562
+ return target;
3563
+ }
3564
+ const EMPTY_THEME$2 = {};
3487
3565
  const values = {
3488
3566
  xs: 0,
3489
3567
  // phone
@@ -3496,12 +3574,9 @@ const values = {
3496
3574
  xl: 1536
3497
3575
  // large screen
3498
3576
  };
3499
- const defaultBreakpoints = {
3500
- // Sorted ASC by size. That's important.
3501
- // It can't be configured as it's used statically for propTypes.
3502
- keys: ["xs", "sm", "md", "lg", "xl"],
3503
- up: (key) => `@media (min-width:${values[key]}px)`
3504
- };
3577
+ const DEFAULT_BREAKPOINTS = createBreakpoints({
3578
+ values
3579
+ });
3505
3580
  const defaultContainerQueries = {
3506
3581
  containerQueries: (containerName) => ({
3507
3582
  up: (key) => {
@@ -3514,52 +3589,89 @@ const defaultContainerQueries = {
3514
3589
  })
3515
3590
  };
3516
3591
  function handleBreakpoints(props, propValue, styleFromPropValue) {
3517
- const theme = props.theme || {};
3592
+ const result = {};
3593
+ return iterateBreakpoints(result, props.theme, propValue, (mediaKey, value, initialKey) => {
3594
+ const finalValue = styleFromPropValue(value, initialKey);
3595
+ if (mediaKey) {
3596
+ result[mediaKey] = finalValue;
3597
+ } else {
3598
+ fastDeepAssign(result, finalValue);
3599
+ }
3600
+ });
3601
+ }
3602
+ function iterateBreakpoints(target, theme, propValue, callback) {
3603
+ theme ??= EMPTY_THEME$2;
3518
3604
  if (Array.isArray(propValue)) {
3519
- const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
3520
- return propValue.reduce((acc, item, index) => {
3521
- acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
3522
- return acc;
3523
- }, {});
3605
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
3606
+ for (let i = 0; i < propValue.length; i += 1) {
3607
+ buildBreakpoint(target, breakpoints.up(breakpoints.keys[i]), propValue[i], void 0, callback);
3608
+ }
3609
+ return target;
3524
3610
  }
3525
3611
  if (typeof propValue === "object") {
3526
- const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
3527
- return Object.keys(propValue).reduce((acc, breakpoint) => {
3528
- if (isCqShorthand(themeBreakpoints.keys, breakpoint)) {
3529
- const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, breakpoint);
3612
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
3613
+ const breakpointValues = breakpoints.values ?? values;
3614
+ for (const key in propValue) {
3615
+ if (isCqShorthand(breakpoints.keys, key)) {
3616
+ const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, key);
3530
3617
  if (containerKey) {
3531
- acc[containerKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
3618
+ buildBreakpoint(target, containerKey, propValue[key], key, callback);
3532
3619
  }
3533
- } else if (Object.keys(themeBreakpoints.values || values).includes(breakpoint)) {
3534
- const mediaKey = themeBreakpoints.up(breakpoint);
3535
- acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
3620
+ } else if (key in breakpointValues) {
3621
+ const mediaKey = breakpoints.up(key);
3622
+ buildBreakpoint(target, mediaKey, propValue[key], key, callback);
3536
3623
  } else {
3537
- const cssKey = breakpoint;
3538
- acc[cssKey] = propValue[cssKey];
3624
+ const cssKey = key;
3625
+ target[cssKey] = propValue[cssKey];
3539
3626
  }
3540
- return acc;
3541
- }, {});
3627
+ }
3628
+ return target;
3542
3629
  }
3543
- const output = styleFromPropValue(propValue);
3544
- return output;
3630
+ callback(void 0, propValue);
3631
+ return target;
3545
3632
  }
3546
- function createEmptyBreakpointObject(breakpointsInput = {}) {
3547
- const breakpointsInOrder = breakpointsInput.keys?.reduce((acc, key) => {
3548
- const breakpointStyleKey = breakpointsInput.up(key);
3549
- acc[breakpointStyleKey] = {};
3550
- return acc;
3551
- }, {});
3552
- return breakpointsInOrder || {};
3633
+ function buildBreakpoint(target, mediaKey, value, initialKey, callback) {
3634
+ target[mediaKey] ??= {};
3635
+ callback(mediaKey, value, initialKey);
3636
+ }
3637
+ function createEmptyBreakpointObject(breakpoints = DEFAULT_BREAKPOINTS) {
3638
+ const {
3639
+ internal_mediaKeys: mediaKeys
3640
+ } = breakpoints;
3641
+ const result = {};
3642
+ for (let i = 0; i < mediaKeys.length; i += 1) {
3643
+ result[mediaKeys[i]] = {};
3644
+ }
3645
+ return result;
3553
3646
  }
3554
- function removeUnusedBreakpoints(breakpointKeys, style2) {
3555
- return breakpointKeys.reduce((acc, key) => {
3556
- const breakpointOutput = acc[key];
3557
- const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
3558
- if (isBreakpointUnused) {
3559
- delete acc[key];
3647
+ function removeUnusedBreakpoints(breakpoints, style2) {
3648
+ const breakpointKeys = breakpoints.internal_mediaKeys;
3649
+ for (let i = 0; i < breakpointKeys.length; i += 1) {
3650
+ const key = breakpointKeys[i];
3651
+ if (isObjectEmpty$1(style2[key])) {
3652
+ delete style2[key];
3560
3653
  }
3561
- return acc;
3562
- }, style2);
3654
+ }
3655
+ return style2;
3656
+ }
3657
+ function hasBreakpoint(breakpoints, value) {
3658
+ if (Array.isArray(value)) {
3659
+ return true;
3660
+ }
3661
+ if (typeof value === "object" && value !== null) {
3662
+ for (let i = 0; i < breakpoints.keys.length; i += 1) {
3663
+ if (breakpoints.keys[i] in value) {
3664
+ return true;
3665
+ }
3666
+ }
3667
+ const valueKeys = Object.keys(value);
3668
+ for (let i = 0; i < valueKeys.length; i += 1) {
3669
+ if (isCqShorthand(breakpoints.keys, valueKeys[i])) {
3670
+ return true;
3671
+ }
3672
+ }
3673
+ }
3674
+ return false;
3563
3675
  }
3564
3676
  function capitalize(string) {
3565
3677
  if (typeof string !== "string") {
@@ -3567,37 +3679,54 @@ function capitalize(string) {
3567
3679
  }
3568
3680
  return string.charAt(0).toUpperCase() + string.slice(1);
3569
3681
  }
3570
- function getPath(obj, path, checkVars = true) {
3571
- if (!path || typeof path !== "string") {
3572
- return null;
3573
- }
3574
- if (obj && obj.vars && checkVars) {
3575
- const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
3576
- if (val != null) {
3577
- return val;
3578
- }
3579
- }
3580
- return path.split(".").reduce((acc, item) => {
3581
- if (acc && acc[item] != null) {
3582
- return acc[item];
3583
- }
3584
- return null;
3585
- }, obj);
3586
- }
3587
- function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
3682
+ function getStyleValue2(themeMapping, transform, userValue, alternateProp) {
3588
3683
  let value;
3589
3684
  if (typeof themeMapping === "function") {
3590
- value = themeMapping(propValueFinal);
3685
+ value = themeMapping(userValue);
3591
3686
  } else if (Array.isArray(themeMapping)) {
3592
- value = themeMapping[propValueFinal] || userValue;
3687
+ value = themeMapping[userValue] || userValue;
3688
+ } else if (typeof userValue === "string") {
3689
+ value = getPath(themeMapping, userValue, true, alternateProp) || userValue;
3593
3690
  } else {
3594
- value = getPath(themeMapping, propValueFinal) || userValue;
3691
+ value = userValue;
3595
3692
  }
3596
3693
  if (transform) {
3597
3694
  value = transform(value, userValue, themeMapping);
3598
3695
  }
3599
3696
  return value;
3600
3697
  }
3698
+ function getPath(obj, pathInput, checkVars = true, alternateProp = void 0) {
3699
+ if (!obj || !pathInput) {
3700
+ return null;
3701
+ }
3702
+ const path = pathInput.split(".");
3703
+ if (obj.vars && checkVars) {
3704
+ const val = getPathImpl(obj.vars, path, alternateProp);
3705
+ if (val != null) {
3706
+ return val;
3707
+ }
3708
+ }
3709
+ return getPathImpl(obj, path, alternateProp);
3710
+ }
3711
+ function getPathImpl(object, path, alternateProp = void 0) {
3712
+ let lastResult = void 0;
3713
+ let result = object;
3714
+ let index = 0;
3715
+ while (index < path.length) {
3716
+ if (result === null || result === void 0) {
3717
+ return result;
3718
+ }
3719
+ lastResult = result;
3720
+ result = result[path[index]];
3721
+ index += 1;
3722
+ }
3723
+ if (alternateProp && result === void 0) {
3724
+ const lastKey = path[path.length - 1];
3725
+ const alternateKey = `${alternateProp}${lastKey === "default" ? "" : capitalize(lastKey)}`;
3726
+ return lastResult?.[alternateKey];
3727
+ }
3728
+ return result;
3729
+ }
3601
3730
  function style$1(options) {
3602
3731
  const {
3603
3732
  prop,
@@ -3612,15 +3741,9 @@ function style$1(options) {
3612
3741
  const propValue = props[prop];
3613
3742
  const theme = props.theme;
3614
3743
  const themeMapping = getPath(theme, themeKey) || {};
3615
- const styleFromPropValue = (propValueFinal) => {
3616
- let value = getStyleValue(themeMapping, transform, propValueFinal);
3617
- if (propValueFinal === value && typeof propValueFinal === "string") {
3618
- value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
3619
- }
3620
- if (cssProperty === false) {
3621
- return value;
3622
- }
3623
- return {
3744
+ const styleFromPropValue = (valueFinal) => {
3745
+ const value = getStyleValue2(themeMapping, transform, valueFinal, prop);
3746
+ return cssProperty === false ? value : {
3624
3747
  [cssProperty]: value
3625
3748
  };
3626
3749
  };
@@ -3632,15 +3755,9 @@ function style$1(options) {
3632
3755
  fn.filterProps = [prop];
3633
3756
  return fn;
3634
3757
  }
3635
- function memoize(fn) {
3636
- const cache = {};
3637
- return (arg2) => {
3638
- if (cache[arg2] === void 0) {
3639
- cache[arg2] = fn(arg2);
3640
- }
3641
- return cache[arg2];
3642
- };
3643
- }
3758
+ const EMPTY_THEME$1 = {
3759
+ internal_cache: {}
3760
+ };
3644
3761
  const properties = {
3645
3762
  m: "margin",
3646
3763
  p: "padding"
@@ -3659,22 +3776,24 @@ const aliases = {
3659
3776
  paddingX: "px",
3660
3777
  paddingY: "py"
3661
3778
  };
3662
- const getCssProperties = memoize((prop) => {
3663
- if (prop.length > 2) {
3664
- if (aliases[prop]) {
3665
- prop = aliases[prop];
3666
- } else {
3667
- return [prop];
3668
- }
3779
+ const CSS_PROPERTIES = {};
3780
+ for (const key in properties) {
3781
+ CSS_PROPERTIES[key] = [properties[key]];
3782
+ }
3783
+ for (const keyProperty in properties) {
3784
+ for (const keyDirection in directions) {
3785
+ const property = properties[keyProperty];
3786
+ const direction = directions[keyDirection];
3787
+ const value = Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
3788
+ CSS_PROPERTIES[keyProperty + keyDirection] = value;
3669
3789
  }
3670
- const [a, b] = prop.split("");
3671
- const property = properties[a];
3672
- const direction = directions[b] || "";
3673
- return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
3674
- });
3675
- const marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
3676
- const paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
3677
- const spacingKeys = [...marginKeys, ...paddingKeys];
3790
+ }
3791
+ for (const key in aliases) {
3792
+ CSS_PROPERTIES[key] = CSS_PROPERTIES[aliases[key]];
3793
+ }
3794
+ 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"]);
3795
+ 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"]);
3796
+ const spacingKeys = /* @__PURE__ */ new Set([...marginKeys, ...paddingKeys]);
3678
3797
  function createUnaryUnit(theme, themeKey, defaultValue, propName) {
3679
3798
  const themeSpacing = getPath(theme, themeKey, true) ?? defaultValue;
3680
3799
  if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
@@ -3742,42 +3861,45 @@ function getValue$1(transformer, propValue) {
3742
3861
  }
3743
3862
  return transformer(propValue);
3744
3863
  }
3745
- function getStyleFromPropValue(cssProperties, transformer) {
3746
- return (propValue) => cssProperties.reduce((acc, cssProperty) => {
3747
- acc[cssProperty] = getValue$1(transformer, propValue);
3748
- return acc;
3749
- }, {});
3750
- }
3751
- function resolveCssProperty(props, keys2, prop, transformer) {
3752
- if (!keys2.includes(prop)) {
3753
- return null;
3754
- }
3755
- const cssProperties = getCssProperties(prop);
3756
- const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
3757
- const propValue = props[prop];
3758
- return handleBreakpoints(props, propValue, styleFromPropValue);
3759
- }
3864
+ const container = [""];
3760
3865
  function style(props, keys2) {
3761
- const transformer = createUnarySpacing(props.theme);
3762
- return Object.keys(props).map((prop) => resolveCssProperty(props, keys2, prop, transformer)).reduce(merge, {});
3866
+ const theme = props.theme ?? EMPTY_THEME$1;
3867
+ const transformer = theme?.internal_cache?.unarySpacing ?? createUnarySpacing(theme);
3868
+ const result = {};
3869
+ for (const prop in props) {
3870
+ if (!keys2.has(prop)) {
3871
+ continue;
3872
+ }
3873
+ const cssProperties = CSS_PROPERTIES[prop] ?? (container[0] = prop, container);
3874
+ const propValue = props[prop];
3875
+ iterateBreakpoints(result, props.theme, propValue, (mediaKey, value) => {
3876
+ const target = mediaKey ? result[mediaKey] : result;
3877
+ for (let i = 0; i < cssProperties.length; i += 1) {
3878
+ target[cssProperties[i]] = getValue$1(transformer, value);
3879
+ }
3880
+ });
3881
+ }
3882
+ return result;
3763
3883
  }
3764
- function margin(props) {
3884
+ function marginFn(props) {
3765
3885
  return style(props, marginKeys);
3766
3886
  }
3767
- margin.propTypes = marginKeys.reduce((obj, key) => {
3887
+ marginFn.propTypes = Array.from(marginKeys).reduce((obj, key) => {
3768
3888
  obj[key] = responsivePropType;
3769
3889
  return obj;
3770
3890
  }, {});
3771
- margin.filterProps = marginKeys;
3772
- function padding(props) {
3891
+ marginFn.filterProps = marginKeys;
3892
+ const margin = marginFn;
3893
+ function paddingFn(props) {
3773
3894
  return style(props, paddingKeys);
3774
3895
  }
3775
- padding.propTypes = paddingKeys.reduce((obj, key) => {
3896
+ paddingFn.propTypes = Array.from(paddingKeys).reduce((obj, key) => {
3776
3897
  obj[key] = responsivePropType;
3777
3898
  return obj;
3778
3899
  }, {});
3779
- padding.filterProps = paddingKeys;
3780
- spacingKeys.reduce((obj, key) => {
3900
+ paddingFn.filterProps = paddingKeys;
3901
+ const padding = paddingFn;
3902
+ Array.from(spacingKeys).reduce((obj, key) => {
3781
3903
  obj[key] = responsivePropType;
3782
3904
  return obj;
3783
3905
  }, {});
@@ -3810,12 +3932,13 @@ function compose(...styles) {
3810
3932
  return acc;
3811
3933
  }, {});
3812
3934
  const fn = (props) => {
3813
- return Object.keys(props).reduce((acc, prop) => {
3935
+ const result = {};
3936
+ for (const prop in props) {
3814
3937
  if (handlers[prop]) {
3815
- return merge(acc, handlers[prop](props));
3938
+ fastDeepAssign(result, handlers[prop](props));
3816
3939
  }
3817
- return acc;
3818
- }, {});
3940
+ }
3941
+ return result;
3819
3942
  };
3820
3943
  fn.propTypes = styles.reduce((acc, style2) => Object.assign(acc, style2.propTypes), {});
3821
3944
  fn.filterProps = styles.reduce((acc, style2) => acc.concat(style2.filterProps), []);
@@ -3954,6 +4077,7 @@ const backgroundColor = style$1({
3954
4077
  transform: paletteTransform
3955
4078
  });
3956
4079
  compose(color, bgcolor, backgroundColor);
4080
+ const breakpointsValues = values;
3957
4081
  function sizingTransform(value) {
3958
4082
  return value <= 1 && value !== 0 ? `${value * 100}%` : value;
3959
4083
  }
@@ -3964,7 +4088,7 @@ const width = style$1({
3964
4088
  const maxWidth = (props) => {
3965
4089
  if (props.maxWidth !== void 0 && props.maxWidth !== null) {
3966
4090
  const styleFromPropValue = (propValue) => {
3967
- const breakpoint = props.theme?.breakpoints?.values?.[propValue] || values[propValue];
4091
+ const breakpoint = props.theme?.breakpoints?.values?.[propValue] || breakpointsValues[propValue];
3968
4092
  if (!breakpoint) {
3969
4093
  return {
3970
4094
  maxWidth: sizingTransform(propValue)
@@ -4302,68 +4426,24 @@ const defaultSxConfig = {
4302
4426
  themeKey: "typography"
4303
4427
  }
4304
4428
  };
4305
- function objectsHaveSameKeys(...objects) {
4306
- const allKeys = objects.reduce((keys2, object) => keys2.concat(Object.keys(object)), []);
4307
- const union = new Set(allKeys);
4308
- return objects.every((object) => union.size === Object.keys(object).length);
4309
- }
4310
- function callIfFn(maybeFn, arg2) {
4311
- return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
4312
- }
4429
+ const EMPTY_THEME = {};
4313
4430
  function unstable_createStyleFunctionSx() {
4314
- function getThemeValue(prop, val, theme, config) {
4315
- const props = {
4316
- [prop]: val,
4317
- theme
4318
- };
4319
- const options = config[prop];
4320
- if (!options) {
4321
- return {
4322
- [prop]: val
4323
- };
4324
- }
4325
- const {
4326
- cssProperty = prop,
4327
- themeKey,
4328
- transform,
4329
- style: style2
4330
- } = options;
4331
- if (val == null) {
4431
+ function styleFunctionSx2(props) {
4432
+ if (!props.sx) {
4332
4433
  return null;
4333
4434
  }
4334
- if (themeKey === "typography" && val === "inherit") {
4335
- return {
4336
- [prop]: val
4337
- };
4338
- }
4339
- const themeMapping = getPath(theme, themeKey) || {};
4340
- if (style2) {
4341
- return style2(props);
4342
- }
4343
- const styleFromPropValue = (propValueFinal) => {
4344
- let value = getStyleValue(themeMapping, transform, propValueFinal);
4345
- if (propValueFinal === value && typeof propValueFinal === "string") {
4346
- value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
4347
- }
4348
- if (cssProperty === false) {
4349
- return value;
4350
- }
4351
- return {
4352
- [cssProperty]: value
4353
- };
4354
- };
4355
- return handleBreakpoints(props, val, styleFromPropValue);
4356
- }
4357
- function styleFunctionSx2(props) {
4358
4435
  const {
4359
4436
  sx,
4360
- theme = {}
4361
- } = props || {};
4362
- if (!sx) {
4363
- return null;
4364
- }
4437
+ theme = EMPTY_THEME,
4438
+ nested
4439
+ } = props;
4365
4440
  const config = theme.unstable_sxConfig ?? defaultSxConfig;
4366
- function traverse(sxInput) {
4441
+ const wrapper2 = {
4442
+ sx: null,
4443
+ theme,
4444
+ nested: true
4445
+ };
4446
+ function process(sxInput) {
4367
4447
  let sxObject = sxInput;
4368
4448
  if (typeof sxInput === "function") {
4369
4449
  sxObject = sxInput(theme);
@@ -4373,43 +4453,94 @@ function unstable_createStyleFunctionSx() {
4373
4453
  if (!sxObject) {
4374
4454
  return null;
4375
4455
  }
4376
- const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
4377
- const breakpointsKeys = Object.keys(emptyBreakpoints);
4378
- let css = emptyBreakpoints;
4379
- Object.keys(sxObject).forEach((styleKey) => {
4456
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
4457
+ const css = createEmptyBreakpointObject(breakpoints);
4458
+ for (const styleKey in sxObject) {
4380
4459
  const value = callIfFn(sxObject[styleKey], theme);
4381
- if (value !== null && value !== void 0) {
4382
- if (typeof value === "object") {
4383
- if (config[styleKey]) {
4384
- css = merge(css, getThemeValue(styleKey, value, theme, config));
4385
- } else {
4386
- const breakpointsValues = handleBreakpoints({
4387
- theme
4388
- }, value, (x) => ({
4389
- [styleKey]: x
4390
- }));
4391
- if (objectsHaveSameKeys(breakpointsValues, value)) {
4392
- css[styleKey] = styleFunctionSx2({
4393
- sx: value,
4394
- theme
4395
- });
4396
- } else {
4397
- css = merge(css, breakpointsValues);
4398
- }
4399
- }
4400
- } else {
4401
- css = merge(css, getThemeValue(styleKey, value, theme, config));
4402
- }
4460
+ if (value === null || value === void 0) {
4461
+ continue;
4403
4462
  }
4404
- });
4405
- return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));
4463
+ if (typeof value !== "object") {
4464
+ setThemeValue(css, styleKey, value, theme, config);
4465
+ continue;
4466
+ }
4467
+ if (config[styleKey]) {
4468
+ setThemeValue(css, styleKey, value, theme, config);
4469
+ continue;
4470
+ }
4471
+ if (hasBreakpoint(breakpoints, value)) {
4472
+ iterateBreakpoints(css, props.theme, value, (mediaKey, finalValue) => {
4473
+ css[mediaKey][styleKey] = finalValue;
4474
+ });
4475
+ } else {
4476
+ wrapper2.sx = value;
4477
+ css[styleKey] = styleFunctionSx2(wrapper2);
4478
+ }
4479
+ }
4480
+ if (!nested && theme.modularCssLayers) {
4481
+ return {
4482
+ "@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css))
4483
+ };
4484
+ }
4485
+ return sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css));
4406
4486
  }
4407
- return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
4487
+ return Array.isArray(sx) ? sx.map(process) : process(sx);
4408
4488
  }
4489
+ styleFunctionSx2.filterProps = ["sx"];
4409
4490
  return styleFunctionSx2;
4410
4491
  }
4411
4492
  const styleFunctionSx = unstable_createStyleFunctionSx();
4412
- styleFunctionSx.filterProps = ["sx"];
4493
+ function setThemeValue(css, prop, value, theme, config) {
4494
+ const options = config[prop];
4495
+ if (!options) {
4496
+ css[prop] = value;
4497
+ return;
4498
+ }
4499
+ if (value == null) {
4500
+ return;
4501
+ }
4502
+ const {
4503
+ themeKey
4504
+ } = options;
4505
+ if (themeKey === "typography" && value === "inherit") {
4506
+ css[prop] = value;
4507
+ return;
4508
+ }
4509
+ const {
4510
+ style: style2
4511
+ } = options;
4512
+ if (style2) {
4513
+ fastDeepAssign(css, style2({
4514
+ [prop]: value,
4515
+ theme
4516
+ }));
4517
+ return;
4518
+ }
4519
+ const {
4520
+ cssProperty = prop,
4521
+ transform
4522
+ } = options;
4523
+ const themeMapping = getPath(theme, themeKey);
4524
+ iterateBreakpoints(css, theme, value, (mediaKey, valueFinal) => {
4525
+ const finalValue = getStyleValue2(themeMapping, transform, valueFinal, prop);
4526
+ if (cssProperty === false) {
4527
+ if (mediaKey) {
4528
+ fastDeepAssign(css[mediaKey], finalValue);
4529
+ } else {
4530
+ fastDeepAssign(css, finalValue);
4531
+ }
4532
+ } else {
4533
+ if (mediaKey) {
4534
+ css[mediaKey][cssProperty] = finalValue;
4535
+ } else {
4536
+ css[cssProperty] = finalValue;
4537
+ }
4538
+ }
4539
+ });
4540
+ }
4541
+ function callIfFn(maybeFn, arg2) {
4542
+ return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
4543
+ }
4413
4544
  function applyStyles(key, styles) {
4414
4545
  const theme = this;
4415
4546
  if (theme.vars) {
@@ -4470,67 +4601,19 @@ function createTheme$1(options = {}, ...args) {
4470
4601
  theme: this
4471
4602
  });
4472
4603
  };
4604
+ muiTheme.internal_cache = {};
4473
4605
  return muiTheme;
4474
4606
  }
4475
- function isObjectEmpty$1(obj) {
4607
+ function isObjectEmpty(obj) {
4476
4608
  return Object.keys(obj).length === 0;
4477
4609
  }
4478
- function useTheme$2(defaultTheme2 = null) {
4610
+ function useThemeWithoutDefault(defaultTheme2 = null) {
4479
4611
  const contextTheme = React.useContext(ThemeContext);
4480
- return !contextTheme || isObjectEmpty$1(contextTheme) ? defaultTheme2 : contextTheme;
4612
+ return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
4481
4613
  }
4482
4614
  const systemDefaultTheme$1 = createTheme$1();
4483
4615
  function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
4484
- return useTheme$2(defaultTheme2);
4485
- }
4486
- const splitProps = (props) => {
4487
- const result = {
4488
- systemProps: {},
4489
- otherProps: {}
4490
- };
4491
- const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
4492
- Object.keys(props).forEach((prop) => {
4493
- if (config[prop]) {
4494
- result.systemProps[prop] = props[prop];
4495
- } else {
4496
- result.otherProps[prop] = props[prop];
4497
- }
4498
- });
4499
- return result;
4500
- };
4501
- function extendSxProp$1(props) {
4502
- const {
4503
- sx: inSx,
4504
- ...other
4505
- } = props;
4506
- const {
4507
- systemProps,
4508
- otherProps
4509
- } = splitProps(other);
4510
- let finalSx;
4511
- if (Array.isArray(inSx)) {
4512
- finalSx = [systemProps, ...inSx];
4513
- } else if (typeof inSx === "function") {
4514
- finalSx = (...args) => {
4515
- const result = inSx(...args);
4516
- if (!isPlainObject(result)) {
4517
- return systemProps;
4518
- }
4519
- return {
4520
- ...systemProps,
4521
- ...result
4522
- };
4523
- };
4524
- } else {
4525
- finalSx = {
4526
- ...systemProps,
4527
- ...inSx
4528
- };
4529
- }
4530
- return {
4531
- ...otherProps,
4532
- sx: finalSx
4533
- };
4616
+ return useThemeWithoutDefault(defaultTheme2);
4534
4617
  }
4535
4618
  const defaultGenerator = (componentName) => componentName;
4536
4619
  const createClassNameGenerator = () => {
@@ -4641,6 +4724,12 @@ const systemDefaultTheme = createTheme$1();
4641
4724
  function shouldForwardProp(prop) {
4642
4725
  return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
4643
4726
  }
4727
+ function shallowLayer(serialized, layerName) {
4728
+ if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
4729
+ serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
4730
+ }
4731
+ return serialized;
4732
+ }
4644
4733
  function defaultOverridesResolver(slot) {
4645
4734
  if (!slot) {
4646
4735
  return null;
@@ -4648,32 +4737,32 @@ function defaultOverridesResolver(slot) {
4648
4737
  return (_props, styles) => styles[slot];
4649
4738
  }
4650
4739
  function attachTheme(props, themeId, defaultTheme2) {
4651
- props.theme = isObjectEmpty(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
4740
+ props.theme = isObjectEmpty$1(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
4652
4741
  }
4653
- function processStyle(props, style2) {
4742
+ function processStyle(props, style2, layerName) {
4654
4743
  const resolvedStyle = typeof style2 === "function" ? style2(props) : style2;
4655
4744
  if (Array.isArray(resolvedStyle)) {
4656
- return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
4745
+ return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
4657
4746
  }
4658
4747
  if (Array.isArray(resolvedStyle?.variants)) {
4659
4748
  let rootStyle;
4660
4749
  if (resolvedStyle.isProcessed) {
4661
- rootStyle = resolvedStyle.style;
4750
+ rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
4662
4751
  } else {
4663
4752
  const {
4664
4753
  variants,
4665
4754
  ...otherStyles
4666
4755
  } = resolvedStyle;
4667
- rootStyle = otherStyles;
4756
+ rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
4668
4757
  }
4669
- return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
4758
+ return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
4670
4759
  }
4671
4760
  if (resolvedStyle?.isProcessed) {
4672
- return resolvedStyle.style;
4761
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
4673
4762
  }
4674
- return resolvedStyle;
4763
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
4675
4764
  }
4676
- function processStyleVariants(props, variants, results = []) {
4765
+ function processStyleVariants(props, variants, results = [], layerName = void 0) {
4677
4766
  let mergedState;
4678
4767
  variantLoop: for (let i = 0; i < variants.length; i += 1) {
4679
4768
  const variant = variants[i];
@@ -4699,9 +4788,9 @@ function processStyleVariants(props, variants, results = []) {
4699
4788
  ...props.ownerState,
4700
4789
  ownerState: props.ownerState
4701
4790
  };
4702
- results.push(variant.style(mergedState));
4791
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
4703
4792
  } else {
4704
- results.push(variant.style);
4793
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
4705
4794
  }
4706
4795
  }
4707
4796
  return results;
@@ -4728,6 +4817,7 @@ function createStyled2(input = {}) {
4728
4817
  overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),
4729
4818
  ...options
4730
4819
  } = inputOptions;
4820
+ const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
4731
4821
  const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
4732
4822
  // TODO v6: remove `Root` in the next major release
4733
4823
  // For more details: https://github.com/mui/material-ui/pull/37908
@@ -4748,18 +4838,21 @@ function createStyled2(input = {}) {
4748
4838
  ...options
4749
4839
  });
4750
4840
  const transformStyle = (style2) => {
4751
- if (typeof style2 === "function" && style2.__emotion_real !== style2) {
4841
+ if (style2.__emotion_real === style2) {
4842
+ return style2;
4843
+ }
4844
+ if (typeof style2 === "function") {
4752
4845
  return function styleFunctionProcessor(props) {
4753
- return processStyle(props, style2);
4846
+ return processStyle(props, style2, props.theme.modularCssLayers ? layerName : void 0);
4754
4847
  };
4755
4848
  }
4756
4849
  if (isPlainObject(style2)) {
4757
4850
  const serialized = preprocessStyles(style2);
4758
- if (!serialized.variants) {
4759
- return serialized.style;
4760
- }
4761
4851
  return function styleObjectProcessor(props) {
4762
- return processStyle(props, serialized);
4852
+ if (!serialized.variants) {
4853
+ return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
4854
+ }
4855
+ return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
4763
4856
  };
4764
4857
  }
4765
4858
  return style2;
@@ -4778,7 +4871,7 @@ function createStyled2(input = {}) {
4778
4871
  }
4779
4872
  const resolvedStyleOverrides = {};
4780
4873
  for (const slotKey in styleOverrides) {
4781
- resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);
4874
+ resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
4782
4875
  }
4783
4876
  return overridesResolver(props, resolvedStyleOverrides);
4784
4877
  });
@@ -4790,7 +4883,7 @@ function createStyled2(input = {}) {
4790
4883
  if (!themeVariants) {
4791
4884
  return null;
4792
4885
  }
4793
- return processStyleVariants(props, themeVariants);
4886
+ return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
4794
4887
  });
4795
4888
  }
4796
4889
  if (!skipSx) {
@@ -4839,12 +4932,6 @@ function generateStyledLabel(componentName, componentSlot) {
4839
4932
  }
4840
4933
  return label;
4841
4934
  }
4842
- function isObjectEmpty(object) {
4843
- for (const _ in object) {
4844
- return false;
4845
- }
4846
- return true;
4847
- }
4848
4935
  function isStringTag(tag) {
4849
4936
  return typeof tag === "string" && // 96 is one less than the char code
4850
4937
  // for "a" so this is checking that
@@ -4857,7 +4944,7 @@ function lowercaseFirstLetter(string) {
4857
4944
  }
4858
4945
  return string.charAt(0).toLowerCase() + string.slice(1);
4859
4946
  }
4860
- function resolveProps(defaultProps, props) {
4947
+ function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {
4861
4948
  const output = {
4862
4949
  ...props
4863
4950
  };
@@ -4883,10 +4970,23 @@ function resolveProps(defaultProps, props) {
4883
4970
  for (const slotKey in defaultSlotProps) {
4884
4971
  if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {
4885
4972
  const slotPropName = slotKey;
4886
- output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
4973
+ const defaultSlotPropValue = defaultSlotProps[slotPropName];
4974
+ const slotPropValue = slotProps[slotPropName];
4975
+ if (typeof defaultSlotPropValue === "function" || typeof slotPropValue === "function") {
4976
+ output[propName][slotPropName] = (...args) => resolveProps((typeof defaultSlotPropValue === "function" ? defaultSlotPropValue(...args) : defaultSlotPropValue) ?? {}, (typeof slotPropValue === "function" ? slotPropValue(...args) : slotPropValue) ?? {}, mergeClassNameAndStyle);
4977
+ } else {
4978
+ output[propName][slotPropName] = resolveProps(defaultSlotPropValue ?? {}, slotPropValue ?? {}, mergeClassNameAndStyle);
4979
+ }
4887
4980
  }
4888
4981
  }
4889
4982
  }
4983
+ } else if (propName === "className" && mergeClassNameAndStyle && props.className !== void 0) {
4984
+ output.className = clsx(defaultProps?.className, props?.className);
4985
+ } else if (propName === "style" && mergeClassNameAndStyle && props.style) {
4986
+ output.style = {
4987
+ ...defaultProps?.style,
4988
+ ...props?.style
4989
+ };
4890
4990
  } else if (output[propName] === void 0) {
4891
4991
  output[propName] = defaultProps[propName];
4892
4992
  }
@@ -5046,6 +5146,9 @@ function private_safeAlpha(color2, value, warning) {
5046
5146
  try {
5047
5147
  return alpha(color2, value);
5048
5148
  } catch (error) {
5149
+ if (warning && true) {
5150
+ console.warn(warning);
5151
+ }
5049
5152
  return color2;
5050
5153
  }
5051
5154
  }
@@ -5065,6 +5168,9 @@ function private_safeDarken(color2, coefficient, warning) {
5065
5168
  try {
5066
5169
  return darken(color2, coefficient);
5067
5170
  } catch (error) {
5171
+ if (warning && true) {
5172
+ console.warn(warning);
5173
+ }
5068
5174
  return color2;
5069
5175
  }
5070
5176
  }
@@ -5088,6 +5194,9 @@ function private_safeLighten(color2, coefficient, warning) {
5088
5194
  try {
5089
5195
  return lighten(color2, coefficient);
5090
5196
  } catch (error) {
5197
+ if (warning && true) {
5198
+ console.warn(warning);
5199
+ }
5091
5200
  return color2;
5092
5201
  }
5093
5202
  }
@@ -5140,10 +5249,10 @@ function getThemeProps(params) {
5140
5249
  }
5141
5250
  const config = theme.components[name];
5142
5251
  if (config.defaultProps) {
5143
- return resolveProps(config.defaultProps, props);
5252
+ return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
5144
5253
  }
5145
5254
  if (!config.styleOverrides && !config.variants) {
5146
- return resolveProps(config, props);
5255
+ return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
5147
5256
  }
5148
5257
  return props;
5149
5258
  }
@@ -5193,9 +5302,14 @@ function createGetCssVar$1(prefix2 = "") {
5193
5302
  };
5194
5303
  return getCssVar;
5195
5304
  }
5305
+ const prototypePollutingKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
5196
5306
  const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
5197
5307
  let temp = obj;
5198
- keys2.forEach((k, index) => {
5308
+ for (let index = 0; index < keys2.length; index += 1) {
5309
+ const k = keys2[index];
5310
+ if (prototypePollutingKeys.has(k)) {
5311
+ break;
5312
+ }
5199
5313
  if (index === keys2.length - 1) {
5200
5314
  if (Array.isArray(temp)) {
5201
5315
  temp[Number(k)] = value;
@@ -5208,7 +5322,7 @@ const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
5208
5322
  }
5209
5323
  temp = temp[k];
5210
5324
  }
5211
- });
5325
+ }
5212
5326
  };
5213
5327
  const walkObjectDeep = (obj, callback, shouldSkipPaths) => {
5214
5328
  function recurse(object, parentKeys = [], arrayKeys = []) {
@@ -5275,7 +5389,8 @@ function prepareCssVars(theme, parserConfig = {}) {
5275
5389
  const {
5276
5390
  getSelector = defaultGetSelector2,
5277
5391
  disableCssColorScheme,
5278
- colorSchemeSelector: selector
5392
+ colorSchemeSelector: selector,
5393
+ enableContrastVars
5279
5394
  } = parserConfig;
5280
5395
  const {
5281
5396
  colorSchemes = {},
@@ -5409,6 +5524,17 @@ function prepareCssVars(theme, parserConfig = {}) {
5409
5524
  ...finalCss
5410
5525
  }), finalCss);
5411
5526
  });
5527
+ if (enableContrastVars) {
5528
+ stylesheets.push({
5529
+ ":root": {
5530
+ // use double underscore to indicate that these are private variables
5531
+ "--__l-threshold": "0.7",
5532
+ "--__l": "clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)",
5533
+ "--__a": "clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"
5534
+ // 0.87 is the default alpha value for black text.
5535
+ }
5536
+ });
5537
+ }
5412
5538
  return stylesheets;
5413
5539
  };
5414
5540
  return {
@@ -5609,6 +5735,19 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
5609
5735
  }
5610
5736
  }
5611
5737
  }
5738
+ function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
5739
+ const tonalOffsetLight = tonalOffset.light || tonalOffset;
5740
+ const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
5741
+ if (!intent[direction]) {
5742
+ if (intent.hasOwnProperty(shade)) {
5743
+ intent[direction] = intent[shade];
5744
+ } else if (direction === "light") {
5745
+ intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
5746
+ } else if (direction === "dark") {
5747
+ intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
5748
+ }
5749
+ }
5750
+ }
5612
5751
  function getDefaultPrimary(mode = "light") {
5613
5752
  if (mode === "dark") {
5614
5753
  return {
@@ -5694,11 +5833,15 @@ function getDefaultWarning(mode = "light") {
5694
5833
  dark: orange[900]
5695
5834
  };
5696
5835
  }
5836
+ function contrastColor(background) {
5837
+ return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;
5838
+ }
5697
5839
  function createPalette(palette) {
5698
5840
  const {
5699
5841
  mode = "light",
5700
5842
  contrastThreshold = 3,
5701
5843
  tonalOffset = 0.2,
5844
+ colorSpace,
5702
5845
  ...other
5703
5846
  } = palette;
5704
5847
  const primary = palette.primary || getDefaultPrimary(mode);
@@ -5708,6 +5851,9 @@ function createPalette(palette) {
5708
5851
  const success = palette.success || getDefaultSuccess(mode);
5709
5852
  const warning = palette.warning || getDefaultWarning(mode);
5710
5853
  function getContrastText(background) {
5854
+ if (colorSpace) {
5855
+ return contrastColor(background);
5856
+ }
5711
5857
  const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
5712
5858
  {
5713
5859
  const contrast = getContrastRatio(background, contrastText);
@@ -5750,8 +5896,13 @@ const theme2 = createTheme({ palette: {
5750
5896
  primary: { main: green[500] },
5751
5897
  } });`);
5752
5898
  }
5753
- addLightOrDark(color2, "light", lightShade, tonalOffset);
5754
- addLightOrDark(color2, "dark", darkShade, tonalOffset);
5899
+ if (colorSpace) {
5900
+ mixLightOrDark(colorSpace, color2, "light", lightShade, tonalOffset);
5901
+ mixLightOrDark(colorSpace, color2, "dark", darkShade, tonalOffset);
5902
+ } else {
5903
+ addLightOrDark(color2, "light", lightShade, tonalOffset);
5904
+ addLightOrDark(color2, "dark", darkShade, tonalOffset);
5905
+ }
5755
5906
  if (!color2.contrastText) {
5756
5907
  color2.contrastText = getContrastText(color2.main);
5757
5908
  }
@@ -5827,6 +5978,44 @@ const theme2 = createTheme({ palette: {
5827
5978
  }, other);
5828
5979
  return paletteOutput;
5829
5980
  }
5981
+ const focusVisibleOffsetVar = "--_focusVisible-offset";
5982
+ const focusVisibleBehaviorVar = "--_focusVisible-behavior";
5983
+ const focusVisibleShadowVar = "--_focusVisible-shadow";
5984
+ const offsetValue = `var(${focusVisibleOffsetVar}, 1)`;
5985
+ const behaviorValue = `var(${focusVisibleBehaviorVar}, )`;
5986
+ function mergeFocusVisibleInput(optionsFocusVisible, args) {
5987
+ return args.reduce((acc, arg2) => arg2 && "focusVisible" in arg2 ? deepmerge(acc, {
5988
+ focusVisible: arg2.focusVisible
5989
+ }) : acc, {
5990
+ focusVisible: optionsFocusVisible
5991
+ }).focusVisible;
5992
+ }
5993
+ function isResolvedFocusVisible(input) {
5994
+ return input != null && typeof input === "object" && typeof input.outlineOffset === "string" && input.outlineOffset.includes(focusVisibleOffsetVar);
5995
+ }
5996
+ function resolveFocusVisible(input, outlineColor2) {
5997
+ return wireFocusVisibleVars({
5998
+ outlineStyle: "solid",
5999
+ outlineColor: outlineColor2,
6000
+ outlineWidth: 2,
6001
+ outlineOffset: 2,
6002
+ // invisible shadow for parent component with solid background (AppBar, Snackbar, Alert) can control the ring color.
6003
+ boxShadow: `var(${focusVisibleShadowVar}, 0 0)`,
6004
+ ...input === true ? null : input
6005
+ });
6006
+ }
6007
+ function wireFocusVisibleVars(resolved) {
6008
+ const offset2 = resolved.outlineOffset ?? 0;
6009
+ if (typeof offset2 !== "string" || !offset2.includes(focusVisibleOffsetVar)) {
6010
+ const offsetPx = typeof offset2 === "number" ? `${offset2}px` : offset2;
6011
+ resolved.outlineOffset = `calc(${offsetValue} * ${offsetPx})`;
6012
+ }
6013
+ const standaloneBoxShadows = /* @__PURE__ */ new Set(["none", "initial", "inherit", "unset", "revert", "revert-layer"]);
6014
+ if (typeof resolved.boxShadow === "string" && !standaloneBoxShadows.has(resolved.boxShadow.trim().toLowerCase()) && !/\binset\b/.test(resolved.boxShadow) && !resolved.boxShadow.includes(focusVisibleBehaviorVar)) {
6015
+ resolved.boxShadow = `${behaviorValue} ${resolved.boxShadow}`;
6016
+ }
6017
+ return resolved;
6018
+ }
5830
6019
  function prepareTypographyVars(typography) {
5831
6020
  const vars = {};
5832
6021
  const entries = Object.entries(typography);
@@ -5948,6 +6137,8 @@ function createShadow(...px) {
5948
6137
  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(",");
5949
6138
  }
5950
6139
  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)];
6140
+ const DEFAULT_TRANSITION_PROPS = ["all"];
6141
+ const EMPTY_OPTIONS = {};
5951
6142
  const easing = {
5952
6143
  // This is the most common easing curve.
5953
6144
  easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
@@ -5983,15 +6174,19 @@ function getAutoHeightDuration(height2) {
5983
6174
  return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3e3);
5984
6175
  }
5985
6176
  function createTransitions(inputTransitions) {
6177
+ const transitions = {
6178
+ ...inputTransitions
6179
+ };
6180
+ delete transitions.reducedMotion;
5986
6181
  const mergedEasing = {
5987
6182
  ...easing,
5988
- ...inputTransitions.easing
6183
+ ...transitions.easing
5989
6184
  };
5990
6185
  const mergedDuration = {
5991
6186
  ...duration,
5992
- ...inputTransitions.duration
6187
+ ...transitions.duration
5993
6188
  };
5994
- const create = (props = ["all"], options = {}) => {
6189
+ const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {
5995
6190
  const {
5996
6191
  duration: durationOption = mergedDuration.standard,
5997
6192
  easing: easingOption = mergedEasing.easeInOut,
@@ -6022,14 +6217,22 @@ function createTransitions(inputTransitions) {
6022
6217
  }
6023
6218
  return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
6024
6219
  };
6220
+ const create = transitions.create ?? createTransitionValue;
6025
6221
  return {
6026
6222
  getAutoHeightDuration,
6027
6223
  create,
6028
- ...inputTransitions,
6224
+ ...transitions,
6029
6225
  easing: mergedEasing,
6030
6226
  duration: mergedDuration
6031
6227
  };
6032
6228
  }
6229
+ const EMPTY_MOTION = {};
6230
+ function createMotion(inputMotion = EMPTY_MOTION) {
6231
+ return {
6232
+ reducedMotion: "never",
6233
+ ...inputMotion
6234
+ };
6235
+ }
6033
6236
  const zIndex = {
6034
6237
  mobileStepper: 1e3,
6035
6238
  fab: 1050,
@@ -6051,7 +6254,7 @@ function stringifyTheme(baseTheme = {}) {
6051
6254
  const array = Object.entries(object);
6052
6255
  for (let index = 0; index < array.length; index++) {
6053
6256
  const [key, value] = array[index];
6054
- if (!isSerializable(value) || key.startsWith("unstable_")) {
6257
+ if (!isSerializable(value) || key.startsWith("unstable_") || key.startsWith("internal_")) {
6055
6258
  delete object[key];
6056
6259
  } else if (isPlainObject(value)) {
6057
6260
  object[key] = {
@@ -6067,19 +6270,70 @@ function stringifyTheme(baseTheme = {}) {
6067
6270
  const theme = ${JSON.stringify(serializableTheme, null, 2)};
6068
6271
 
6069
6272
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
6273
+ theme.motion = { reducedMotion: 'never', ...theme.motion };
6070
6274
  theme.transitions = createTransitions(theme.transitions || {});
6071
6275
 
6072
6276
  export default theme;`;
6073
6277
  }
6278
+ function coefficientToPercentage(coefficient) {
6279
+ if (typeof coefficient === "number") {
6280
+ return `${(coefficient * 100).toFixed(0)}%`;
6281
+ }
6282
+ return `calc((${coefficient}) * 100%)`;
6283
+ }
6284
+ const parseAddition = (str) => {
6285
+ if (!Number.isNaN(+str)) {
6286
+ return +str;
6287
+ }
6288
+ const numbers = str.match(/\d*\.?\d+/g);
6289
+ if (!numbers) {
6290
+ return 0;
6291
+ }
6292
+ let sum = 0;
6293
+ for (let i = 0; i < numbers.length; i += 1) {
6294
+ sum += +numbers[i];
6295
+ }
6296
+ return sum;
6297
+ };
6298
+ function attachColorManipulators(theme) {
6299
+ Object.assign(theme, {
6300
+ alpha(color2, coefficient) {
6301
+ const obj = this || theme;
6302
+ if (obj.colorSpace) {
6303
+ return `oklch(from ${color2} l c h / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
6304
+ }
6305
+ if (obj.vars) {
6306
+ return `rgba(${color2.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, "var(--$1Channel)")} / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
6307
+ }
6308
+ return alpha(color2, parseAddition(coefficient));
6309
+ },
6310
+ lighten(color2, coefficient) {
6311
+ const obj = this || theme;
6312
+ if (obj.colorSpace) {
6313
+ return `color-mix(in ${obj.colorSpace}, ${color2}, #fff ${coefficientToPercentage(coefficient)})`;
6314
+ }
6315
+ return lighten(color2, coefficient);
6316
+ },
6317
+ darken(color2, coefficient) {
6318
+ const obj = this || theme;
6319
+ if (obj.colorSpace) {
6320
+ return `color-mix(in ${obj.colorSpace}, ${color2}, #000 ${coefficientToPercentage(coefficient)})`;
6321
+ }
6322
+ return darken(color2, coefficient);
6323
+ }
6324
+ });
6325
+ }
6074
6326
  function createThemeNoVars(options = {}, ...args) {
6075
6327
  const {
6076
6328
  breakpoints: breakpointsInput,
6077
6329
  mixins: mixinsInput = {},
6078
6330
  spacing: spacingInput,
6079
6331
  palette: paletteInput = {},
6332
+ motion: motionInput = {},
6080
6333
  transitions: transitionsInput = {},
6081
6334
  typography: typographyInput = {},
6082
6335
  shape: shapeInput,
6336
+ colorSpace,
6083
6337
  ...other
6084
6338
  } = options;
6085
6339
  if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
@@ -6087,7 +6341,10 @@ function createThemeNoVars(options = {}, ...args) {
6087
6341
  options.generateThemeVars === void 0) {
6088
6342
  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.");
6089
6343
  }
6090
- const palette = createPalette(paletteInput);
6344
+ const palette = createPalette({
6345
+ ...paletteInput,
6346
+ colorSpace
6347
+ });
6091
6348
  const systemTheme = createTheme$1(options);
6092
6349
  let muiTheme = deepmerge(systemTheme, {
6093
6350
  mixins: createMixins(systemTheme.breakpoints, mixinsInput),
@@ -6095,6 +6352,7 @@ function createThemeNoVars(options = {}, ...args) {
6095
6352
  // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
6096
6353
  shadows: shadows.slice(),
6097
6354
  typography: createTypography(palette, typographyInput),
6355
+ motion: createMotion(motionInput),
6098
6356
  transitions: createTransitions(transitionsInput),
6099
6357
  zIndex: {
6100
6358
  ...zIndex
@@ -6102,6 +6360,10 @@ function createThemeNoVars(options = {}, ...args) {
6102
6360
  });
6103
6361
  muiTheme = deepmerge(muiTheme, other);
6104
6362
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
6363
+ delete muiTheme.transitions.reducedMotion;
6364
+ if (muiTheme.focusVisible != null && muiTheme.focusVisible !== false) {
6365
+ muiTheme.focusVisible = resolveFocusVisible(muiTheme.focusVisible, muiTheme.palette.primary.main);
6366
+ }
6105
6367
  {
6106
6368
  const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
6107
6369
  const traverse = (node2, component) => {
@@ -6139,6 +6401,7 @@ function createThemeNoVars(options = {}, ...args) {
6139
6401
  });
6140
6402
  };
6141
6403
  muiTheme.toRuntimeSource = stringifyTheme;
6404
+ attachColorManipulators(muiTheme);
6142
6405
  return muiTheme;
6143
6406
  }
6144
6407
  function getOverlayAlpha(elevation) {
@@ -6176,9 +6439,13 @@ function createColorScheme(options) {
6176
6439
  // need to cast to avoid module augmentation test
6177
6440
  opacity,
6178
6441
  overlays,
6179
- ...rest
6442
+ colorSpace,
6443
+ ...other
6180
6444
  } = options;
6181
- const palette = createPalette(paletteInput);
6445
+ const palette = createPalette({
6446
+ ...paletteInput,
6447
+ colorSpace
6448
+ });
6182
6449
  return {
6183
6450
  palette,
6184
6451
  opacity: {
@@ -6186,11 +6453,14 @@ function createColorScheme(options) {
6186
6453
  ...opacity
6187
6454
  },
6188
6455
  overlays: overlays || getOverlays(palette.mode),
6189
- ...rest
6456
+ ...other
6190
6457
  };
6191
6458
  }
6192
6459
  function shouldSkipGeneratingVar(keys2) {
6193
- return !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
6460
+ return keys2[0] === "motion" || // Keep `focusVisible` inline: its values reference the per-component private vars
6461
+ // (`--_focusVisible-offset`/`-behavior`). Hoisted to a `:root` var they resolve where those
6462
+ // vars are unset, silently breaking the inner-ring inset.
6463
+ keys2[0] === "focusVisible" || !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
6194
6464
  keys2[0] === "palette" && !!keys2[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
6195
6465
  }
6196
6466
  const excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
@@ -6293,7 +6563,7 @@ const silent = (fn) => {
6293
6563
  return void 0;
6294
6564
  };
6295
6565
  const createGetCssVar = (cssVarPrefix = "mui") => createGetCssVar$1(cssVarPrefix);
6296
- function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
6566
+ function attachColorScheme$1(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {
6297
6567
  if (!scheme) {
6298
6568
  return void 0;
6299
6569
  }
@@ -6305,7 +6575,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
6305
6575
  palette: {
6306
6576
  mode,
6307
6577
  ...scheme?.palette
6308
- }
6578
+ },
6579
+ colorSpace
6309
6580
  });
6310
6581
  return void 0;
6311
6582
  }
@@ -6317,7 +6588,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
6317
6588
  palette: {
6318
6589
  mode,
6319
6590
  ...scheme?.palette
6320
- }
6591
+ },
6592
+ colorSpace
6321
6593
  });
6322
6594
  colorSchemes[colorScheme] = {
6323
6595
  ...scheme,
@@ -6338,6 +6610,7 @@ function createThemeWithVars(options = {}, ...args) {
6338
6610
  defaultColorScheme: defaultColorSchemeInput,
6339
6611
  disableCssColorScheme = false,
6340
6612
  cssVarPrefix = "mui",
6613
+ nativeColor = false,
6341
6614
  shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 = shouldSkipGeneratingVar,
6342
6615
  colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? "media" : void 0,
6343
6616
  rootSelector = ":root",
@@ -6362,12 +6635,16 @@ function createThemeWithVars(options = {}, ...args) {
6362
6635
  if (!defaultScheme) {
6363
6636
  throw new Error(`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`);
6364
6637
  }
6365
- const muiTheme = attachColorScheme$1(colorSchemes, defaultScheme, input, defaultColorScheme);
6638
+ let colorSpace;
6639
+ if (nativeColor) {
6640
+ colorSpace = "oklch";
6641
+ }
6642
+ const muiTheme = attachColorScheme$1(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);
6366
6643
  if (builtInLight && !colorSchemes.light) {
6367
- attachColorScheme$1(colorSchemes, builtInLight, void 0, "light");
6644
+ attachColorScheme$1(colorSpace, colorSchemes, builtInLight, void 0, "light");
6368
6645
  }
6369
6646
  if (builtInDark && !colorSchemes.dark) {
6370
- attachColorScheme$1(colorSchemes, builtInDark, void 0, "dark");
6647
+ attachColorScheme$1(colorSpace, colorSchemes, builtInDark, void 0, "dark");
6371
6648
  }
6372
6649
  let theme = {
6373
6650
  defaultColorScheme,
@@ -6399,12 +6676,28 @@ function createThemeWithVars(options = {}, ...args) {
6399
6676
  setColor(palette.common, "background", "#000");
6400
6677
  setColor(palette.common, "onBackground", "#fff");
6401
6678
  }
6679
+ function colorMix(method, color2, coefficient) {
6680
+ if (colorSpace) {
6681
+ let mixer;
6682
+ if (method === private_safeAlpha) {
6683
+ mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
6684
+ }
6685
+ if (method === private_safeDarken) {
6686
+ mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
6687
+ }
6688
+ if (method === private_safeLighten) {
6689
+ mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
6690
+ }
6691
+ return `color-mix(in ${colorSpace}, ${color2}, ${mixer})`;
6692
+ }
6693
+ return method(color2, coefficient);
6694
+ }
6402
6695
  assignNode(palette, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
6403
6696
  if (palette.mode === "light") {
6404
- setColor(palette.Alert, "errorColor", private_safeDarken(palette.error.light, 0.6));
6405
- setColor(palette.Alert, "infoColor", private_safeDarken(palette.info.light, 0.6));
6406
- setColor(palette.Alert, "successColor", private_safeDarken(palette.success.light, 0.6));
6407
- setColor(palette.Alert, "warningColor", private_safeDarken(palette.warning.light, 0.6));
6697
+ setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
6698
+ setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
6699
+ setColor(palette.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
6700
+ setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
6408
6701
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
6409
6702
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
6410
6703
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
@@ -6413,10 +6706,10 @@ function createThemeWithVars(options = {}, ...args) {
6413
6706
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.main)));
6414
6707
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.main)));
6415
6708
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.main)));
6416
- setColor(palette.Alert, "errorStandardBg", private_safeLighten(palette.error.light, 0.9));
6417
- setColor(palette.Alert, "infoStandardBg", private_safeLighten(palette.info.light, 0.9));
6418
- setColor(palette.Alert, "successStandardBg", private_safeLighten(palette.success.light, 0.9));
6419
- setColor(palette.Alert, "warningStandardBg", private_safeLighten(palette.warning.light, 0.9));
6709
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
6710
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
6711
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
6712
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
6420
6713
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
6421
6714
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
6422
6715
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -6431,41 +6724,41 @@ function createThemeWithVars(options = {}, ...args) {
6431
6724
  setColor(palette.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
6432
6725
  setColor(palette.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
6433
6726
  setColor(palette.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
6434
- setColor(palette.LinearProgress, "primaryBg", private_safeLighten(palette.primary.main, 0.62));
6435
- setColor(palette.LinearProgress, "secondaryBg", private_safeLighten(palette.secondary.main, 0.62));
6436
- setColor(palette.LinearProgress, "errorBg", private_safeLighten(palette.error.main, 0.62));
6437
- setColor(palette.LinearProgress, "infoBg", private_safeLighten(palette.info.main, 0.62));
6438
- setColor(palette.LinearProgress, "successBg", private_safeLighten(palette.success.main, 0.62));
6439
- setColor(palette.LinearProgress, "warningBg", private_safeLighten(palette.warning.main, 0.62));
6440
- setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
6441
- setColor(palette.Slider, "primaryTrack", private_safeLighten(palette.primary.main, 0.62));
6442
- setColor(palette.Slider, "secondaryTrack", private_safeLighten(palette.secondary.main, 0.62));
6443
- setColor(palette.Slider, "errorTrack", private_safeLighten(palette.error.main, 0.62));
6444
- setColor(palette.Slider, "infoTrack", private_safeLighten(palette.info.main, 0.62));
6445
- setColor(palette.Slider, "successTrack", private_safeLighten(palette.success.main, 0.62));
6446
- setColor(palette.Slider, "warningTrack", private_safeLighten(palette.warning.main, 0.62));
6447
- const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.8);
6727
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
6728
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
6729
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
6730
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
6731
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
6732
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.62));
6733
+ 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)`);
6734
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
6735
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
6736
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
6737
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
6738
+ setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
6739
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
6740
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
6448
6741
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
6449
- setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
6742
+ setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
6450
6743
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
6451
6744
  setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-400"));
6452
6745
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-400"));
6453
6746
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-common-white"));
6454
6747
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
6455
- setColor(palette.Switch, "primaryDisabledColor", private_safeLighten(palette.primary.main, 0.62));
6456
- setColor(palette.Switch, "secondaryDisabledColor", private_safeLighten(palette.secondary.main, 0.62));
6457
- setColor(palette.Switch, "errorDisabledColor", private_safeLighten(palette.error.main, 0.62));
6458
- setColor(palette.Switch, "infoDisabledColor", private_safeLighten(palette.info.main, 0.62));
6459
- setColor(palette.Switch, "successDisabledColor", private_safeLighten(palette.success.main, 0.62));
6460
- setColor(palette.Switch, "warningDisabledColor", private_safeLighten(palette.warning.main, 0.62));
6461
- setColor(palette.TableCell, "border", private_safeLighten(private_safeAlpha(palette.divider, 1), 0.88));
6462
- setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
6748
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
6749
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
6750
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
6751
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
6752
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
6753
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
6754
+ setColor(palette.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.88));
6755
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
6463
6756
  }
6464
6757
  if (palette.mode === "dark") {
6465
- setColor(palette.Alert, "errorColor", private_safeLighten(palette.error.light, 0.6));
6466
- setColor(palette.Alert, "infoColor", private_safeLighten(palette.info.light, 0.6));
6467
- setColor(palette.Alert, "successColor", private_safeLighten(palette.success.light, 0.6));
6468
- setColor(palette.Alert, "warningColor", private_safeLighten(palette.warning.light, 0.6));
6758
+ setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
6759
+ setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
6760
+ setColor(palette.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
6761
+ setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
6469
6762
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
6470
6763
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
6471
6764
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
@@ -6474,10 +6767,10 @@ function createThemeWithVars(options = {}, ...args) {
6474
6767
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.dark)));
6475
6768
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.dark)));
6476
6769
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.dark)));
6477
- setColor(palette.Alert, "errorStandardBg", private_safeDarken(palette.error.light, 0.9));
6478
- setColor(palette.Alert, "infoStandardBg", private_safeDarken(palette.info.light, 0.9));
6479
- setColor(palette.Alert, "successStandardBg", private_safeDarken(palette.success.light, 0.9));
6480
- setColor(palette.Alert, "warningStandardBg", private_safeDarken(palette.warning.light, 0.9));
6770
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
6771
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
6772
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
6773
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
6481
6774
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
6482
6775
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
6483
6776
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -6494,44 +6787,46 @@ function createThemeWithVars(options = {}, ...args) {
6494
6787
  setColor(palette.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
6495
6788
  setColor(palette.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
6496
6789
  setColor(palette.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
6497
- setColor(palette.LinearProgress, "primaryBg", private_safeDarken(palette.primary.main, 0.5));
6498
- setColor(palette.LinearProgress, "secondaryBg", private_safeDarken(palette.secondary.main, 0.5));
6499
- setColor(palette.LinearProgress, "errorBg", private_safeDarken(palette.error.main, 0.5));
6500
- setColor(palette.LinearProgress, "infoBg", private_safeDarken(palette.info.main, 0.5));
6501
- setColor(palette.LinearProgress, "successBg", private_safeDarken(palette.success.main, 0.5));
6502
- setColor(palette.LinearProgress, "warningBg", private_safeDarken(palette.warning.main, 0.5));
6503
- setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
6504
- setColor(palette.Slider, "primaryTrack", private_safeDarken(palette.primary.main, 0.5));
6505
- setColor(palette.Slider, "secondaryTrack", private_safeDarken(palette.secondary.main, 0.5));
6506
- setColor(palette.Slider, "errorTrack", private_safeDarken(palette.error.main, 0.5));
6507
- setColor(palette.Slider, "infoTrack", private_safeDarken(palette.info.main, 0.5));
6508
- setColor(palette.Slider, "successTrack", private_safeDarken(palette.success.main, 0.5));
6509
- setColor(palette.Slider, "warningTrack", private_safeDarken(palette.warning.main, 0.5));
6510
- const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.98);
6790
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
6791
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
6792
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
6793
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
6794
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
6795
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.5));
6796
+ 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)`);
6797
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
6798
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
6799
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
6800
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
6801
+ setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
6802
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.5));
6803
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
6511
6804
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
6512
- setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
6805
+ setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
6513
6806
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
6514
6807
  setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-600"));
6515
6808
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-600"));
6516
6809
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
6517
6810
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
6518
- setColor(palette.Switch, "primaryDisabledColor", private_safeDarken(palette.primary.main, 0.55));
6519
- setColor(palette.Switch, "secondaryDisabledColor", private_safeDarken(palette.secondary.main, 0.55));
6520
- setColor(palette.Switch, "errorDisabledColor", private_safeDarken(palette.error.main, 0.55));
6521
- setColor(palette.Switch, "infoDisabledColor", private_safeDarken(palette.info.main, 0.55));
6522
- setColor(palette.Switch, "successDisabledColor", private_safeDarken(palette.success.main, 0.55));
6523
- setColor(palette.Switch, "warningDisabledColor", private_safeDarken(palette.warning.main, 0.55));
6524
- setColor(palette.TableCell, "border", private_safeDarken(private_safeAlpha(palette.divider, 1), 0.68));
6525
- setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
6526
- }
6527
- setColorChannel(palette.background, "default");
6528
- setColorChannel(palette.background, "paper");
6529
- setColorChannel(palette.common, "background");
6530
- setColorChannel(palette.common, "onBackground");
6531
- setColorChannel(palette, "divider");
6811
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.55));
6812
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.55));
6813
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.55));
6814
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.55));
6815
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.55));
6816
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.55));
6817
+ setColor(palette.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.68));
6818
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
6819
+ }
6820
+ if (!nativeColor) {
6821
+ setColorChannel(palette.background, "default");
6822
+ setColorChannel(palette.background, "paper");
6823
+ setColorChannel(palette.common, "background");
6824
+ setColorChannel(palette.common, "onBackground");
6825
+ setColorChannel(palette, "divider");
6826
+ }
6532
6827
  Object.keys(palette).forEach((color2) => {
6533
6828
  const colors = palette[color2];
6534
- if (color2 !== "tonalOffset" && colors && typeof colors === "object") {
6829
+ if (color2 !== "tonalOffset" && !nativeColor && colors && typeof colors === "object") {
6535
6830
  if (colors.main) {
6536
6831
  setColor(palette[color2], "mainChannel", private_safeColorChannel(toRgb(colors.main)));
6537
6832
  }
@@ -6560,11 +6855,16 @@ function createThemeWithVars(options = {}, ...args) {
6560
6855
  });
6561
6856
  });
6562
6857
  theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
6858
+ const focusVisibleInput = mergeFocusVisibleInput(options.focusVisible, args);
6859
+ if (focusVisibleInput != null && focusVisibleInput !== false) {
6860
+ theme.focusVisible = resolveFocusVisible(focusVisibleInput, getCssVar("palette-primary-main"));
6861
+ }
6563
6862
  const parserConfig = {
6564
6863
  prefix: cssVarPrefix,
6565
6864
  disableCssColorScheme,
6566
6865
  shouldSkipGeneratingVar: shouldSkipGeneratingVar$1,
6567
- getSelector: defaultGetSelector(theme)
6866
+ getSelector: defaultGetSelector(theme),
6867
+ enableContrastVars: nativeColor
6568
6868
  };
6569
6869
  const {
6570
6870
  vars,
@@ -6593,6 +6893,7 @@ function createThemeWithVars(options = {}, ...args) {
6593
6893
  theme: this
6594
6894
  });
6595
6895
  };
6896
+ theme.internal_cache = {};
6596
6897
  theme.toRuntimeSource = stringifyTheme;
6597
6898
  return theme;
6598
6899
  }
@@ -6619,7 +6920,7 @@ function createTheme(options = {}, ...args) {
6619
6920
  light: true
6620
6921
  } : void 0,
6621
6922
  defaultColorScheme: initialDefaultColorScheme = palette?.mode,
6622
- ...rest
6923
+ ...other
6623
6924
  } = options;
6624
6925
  const defaultColorSchemeInput = initialDefaultColorScheme || "light";
6625
6926
  const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
@@ -6668,18 +6969,84 @@ function createTheme(options = {}, ...args) {
6668
6969
  };
6669
6970
  attachColorScheme(theme, "light", colorSchemesInput.light);
6670
6971
  }
6972
+ if (theme.focusVisible != null && theme.focusVisible !== false) {
6973
+ let focusVisibleInput = theme.focusVisible;
6974
+ const rawFocusVisible = mergeFocusVisibleInput(options.focusVisible, args);
6975
+ const authoredColor = rawFocusVisible && typeof rawFocusVisible === "object" ? rawFocusVisible.outlineColor : void 0;
6976
+ if (!authoredColor || isResolvedFocusVisible(rawFocusVisible) && authoredColor === theme.palette.primary.main) {
6977
+ const {
6978
+ outlineColor: outlineColor2,
6979
+ ...rest
6980
+ } = focusVisibleInput;
6981
+ focusVisibleInput = rest;
6982
+ }
6983
+ Object.keys(theme.colorSchemes).forEach((scheme) => {
6984
+ const schemePalette = theme.colorSchemes?.[scheme]?.palette;
6985
+ if (schemePalette?.primary) {
6986
+ theme.colorSchemes[scheme].focusVisible = resolveFocusVisible(focusVisibleInput, schemePalette.primary.main);
6987
+ }
6988
+ });
6989
+ }
6671
6990
  return theme;
6672
6991
  }
6673
6992
  if (!palette && !("light" in colorSchemesInput) && defaultColorSchemeInput === "light") {
6674
6993
  colorSchemesInput.light = true;
6675
6994
  }
6676
6995
  return createThemeWithVars({
6677
- ...rest,
6996
+ ...other,
6678
6997
  colorSchemes: colorSchemesInput,
6679
6998
  defaultColorScheme: defaultColorSchemeInput,
6680
6999
  ...typeof cssVariables !== "boolean" && cssVariables
6681
7000
  }, ...args);
6682
7001
  }
7002
+ function useForkRef$1(...refs) {
7003
+ const cleanupRef = React.useRef(void 0);
7004
+ const refEffect = React.useCallback((instance) => {
7005
+ const cleanups = refs.map((ref) => {
7006
+ if (ref == null) {
7007
+ return null;
7008
+ }
7009
+ if (typeof ref === "function") {
7010
+ const refCallback = ref;
7011
+ const refCleanup = refCallback(instance);
7012
+ return typeof refCleanup === "function" ? refCleanup : () => {
7013
+ refCallback(null);
7014
+ };
7015
+ }
7016
+ ref.current = instance;
7017
+ return () => {
7018
+ ref.current = null;
7019
+ };
7020
+ });
7021
+ return () => {
7022
+ cleanups.forEach((refCleanup) => refCleanup?.());
7023
+ };
7024
+ }, refs);
7025
+ return React.useMemo(() => {
7026
+ if (refs.every((ref) => ref == null)) {
7027
+ return null;
7028
+ }
7029
+ return (value) => {
7030
+ if (cleanupRef.current) {
7031
+ cleanupRef.current();
7032
+ cleanupRef.current = void 0;
7033
+ }
7034
+ if (value != null) {
7035
+ cleanupRef.current = refEffect(value);
7036
+ }
7037
+ };
7038
+ }, refs);
7039
+ }
7040
+ function useEventCallback(fn) {
7041
+ const ref = React.useRef(fn);
7042
+ useEnhancedEffect$1(() => {
7043
+ ref.current = fn;
7044
+ });
7045
+ return React.useRef((...args) => (
7046
+ // @ts-expect-error hide `this`
7047
+ (0, ref.current)(...args)
7048
+ )).current;
7049
+ }
6683
7050
  const defaultTheme = createTheme();
6684
7051
  function useTheme() {
6685
7052
  const theme = useTheme$1(defaultTheme);
@@ -6697,20 +7064,6 @@ const styled = createStyled2({
6697
7064
  defaultTheme,
6698
7065
  rootShouldForwardProp
6699
7066
  });
6700
- const { makeStyles } = createMakeAndWithStyles({
6701
- useTheme
6702
- });
6703
- const { tss } = createTss({
6704
- "useContext": function useContext2() {
6705
- const theme = useTheme();
6706
- return { theme };
6707
- },
6708
- "usePlugin": useMuiThemeStyleOverridesPlugin
6709
- });
6710
- const useStyles = tss.create({});
6711
- function internal_createExtendSxProp() {
6712
- return extendSxProp$1;
6713
- }
6714
7067
  const memoTheme = unstable_memoTheme;
6715
7068
  ({
6716
7069
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -6729,6 +7082,17 @@ const memoTheme = unstable_memoTheme;
6729
7082
  function useDefaultProps(params) {
6730
7083
  return useDefaultProps$1(params);
6731
7084
  }
7085
+ const { makeStyles } = createMakeAndWithStyles({
7086
+ useTheme
7087
+ });
7088
+ const { tss } = createTss({
7089
+ "useContext": function useContext2() {
7090
+ const theme = useTheme();
7091
+ return { theme };
7092
+ },
7093
+ "usePlugin": useMuiThemeStyleOverridesPlugin
7094
+ });
7095
+ const useStyles = tss.create({});
6732
7096
  function setRef$1(ref, value) {
6733
7097
  if (typeof ref === "function") {
6734
7098
  ref(value);
@@ -6736,66 +7100,6 @@ function setRef$1(ref, value) {
6736
7100
  ref.current = value;
6737
7101
  }
6738
7102
  }
6739
- function useEventCallback(fn) {
6740
- const ref = React.useRef(fn);
6741
- useEnhancedEffect$1(() => {
6742
- ref.current = fn;
6743
- });
6744
- return React.useRef((...args) => (
6745
- // @ts-expect-error hide `this`
6746
- (0, ref.current)(...args)
6747
- )).current;
6748
- }
6749
- function useForkRef$1(...refs) {
6750
- const cleanupRef = React.useRef(void 0);
6751
- const refEffect = React.useCallback((instance) => {
6752
- const cleanups = refs.map((ref) => {
6753
- if (ref == null) {
6754
- return null;
6755
- }
6756
- if (typeof ref === "function") {
6757
- const refCallback = ref;
6758
- const refCleanup = refCallback(instance);
6759
- return typeof refCleanup === "function" ? refCleanup : () => {
6760
- refCallback(null);
6761
- };
6762
- }
6763
- ref.current = instance;
6764
- return () => {
6765
- ref.current = null;
6766
- };
6767
- });
6768
- return () => {
6769
- cleanups.forEach((refCleanup) => refCleanup?.());
6770
- };
6771
- }, refs);
6772
- return React.useMemo(() => {
6773
- if (refs.every((ref) => ref == null)) {
6774
- return null;
6775
- }
6776
- return (value) => {
6777
- if (cleanupRef.current) {
6778
- cleanupRef.current();
6779
- cleanupRef.current = void 0;
6780
- }
6781
- if (value != null) {
6782
- cleanupRef.current = refEffect(value);
6783
- }
6784
- };
6785
- }, refs);
6786
- }
6787
- function _setPrototypeOf(t, e) {
6788
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
6789
- return t2.__proto__ = e2, t2;
6790
- }, _setPrototypeOf(t, e);
6791
- }
6792
- function _inheritsLoose(t, o) {
6793
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
6794
- }
6795
- function _assertThisInitialized(e) {
6796
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
6797
- return e;
6798
- }
6799
7103
  function hasCorrectMainProperty(obj) {
6800
7104
  return typeof obj.main === "string";
6801
7105
  }
@@ -6830,22 +7134,22 @@ function getReactElementRef(element) {
6830
7134
  }
6831
7135
  return element?.ref || null;
6832
7136
  }
6833
- function getContainer(container) {
6834
- return typeof container === "function" ? container() : container;
7137
+ function getContainer(container2) {
7138
+ return typeof container2 === "function" ? container2() : container2;
6835
7139
  }
6836
7140
  const Portal = /* @__PURE__ */ React.forwardRef(function Portal2(props, forwardedRef) {
6837
7141
  const {
6838
7142
  children,
6839
- container,
7143
+ container: container2,
6840
7144
  disablePortal = false
6841
7145
  } = props;
6842
7146
  const [mountNode, setMountNode] = React.useState(null);
6843
7147
  const handleRef = useForkRef$1(/* @__PURE__ */ React.isValidElement(children) ? getReactElementRef(children) : null, forwardedRef);
6844
7148
  useEnhancedEffect$1(() => {
6845
7149
  if (!disablePortal) {
6846
- setMountNode(getContainer(container) || document.body);
7150
+ setMountNode(getContainer(container2) || document.body);
6847
7151
  }
6848
- }, [container, disablePortal]);
7152
+ }, [container2, disablePortal]);
6849
7153
  useEnhancedEffect$1(() => {
6850
7154
  if (mountNode && !disablePortal) {
6851
7155
  setRef$1(forwardedRef, mountNode);
@@ -6898,30 +7202,17 @@ Portal.propTypes = {
6898
7202
  function getTypographyUtilityClass(slot) {
6899
7203
  return generateUtilityClass("MuiTypography", slot);
6900
7204
  }
6901
- generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
6902
- const v6Colors = {
6903
- primary: true,
6904
- secondary: true,
6905
- error: true,
6906
- info: true,
6907
- success: true,
6908
- warning: true,
6909
- textPrimary: true,
6910
- textSecondary: true,
6911
- textDisabled: true
6912
- };
6913
- const extendSxProp = internal_createExtendSxProp();
7205
+ generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"]);
6914
7206
  const useUtilityClasses = (ownerState) => {
6915
7207
  const {
6916
7208
  align,
6917
7209
  gutterBottom,
6918
7210
  noWrap,
6919
- paragraph,
6920
7211
  variant,
6921
7212
  classes
6922
7213
  } = ownerState;
6923
7214
  const slots = {
6924
- root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph && "paragraph"]
7215
+ root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"]
6925
7216
  };
6926
7217
  return composeClasses(slots, getTypographyUtilityClass, classes);
6927
7218
  };
@@ -6932,7 +7223,7 @@ const TypographyRoot = styled("span", {
6932
7223
  const {
6933
7224
  ownerState
6934
7225
  } = props;
6935
- 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];
7226
+ return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom];
6936
7227
  }
6937
7228
  })(memoTheme(({
6938
7229
  theme
@@ -6990,13 +7281,6 @@ const TypographyRoot = styled("span", {
6990
7281
  style: {
6991
7282
  marginBottom: "0.35em"
6992
7283
  }
6993
- }, {
6994
- props: ({
6995
- ownerState
6996
- }) => ownerState.paragraph,
6997
- style: {
6998
- marginBottom: 16
6999
- }
7000
7284
  }]
7001
7285
  })));
7002
7286
  const defaultVariantMapping = {
@@ -7013,27 +7297,17 @@ const defaultVariantMapping = {
7013
7297
  inherit: "p"
7014
7298
  };
7015
7299
  const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
7016
- const {
7017
- color: color2,
7018
- ...themeProps
7019
- } = useDefaultProps({
7300
+ const props = useDefaultProps({
7020
7301
  props: inProps,
7021
7302
  name: "MuiTypography"
7022
7303
  });
7023
- const isSxColor = !v6Colors[color2];
7024
- const props = extendSxProp({
7025
- ...themeProps,
7026
- ...isSxColor && {
7027
- color: color2
7028
- }
7029
- });
7030
7304
  const {
7305
+ color: color2,
7031
7306
  align = "inherit",
7032
7307
  className,
7033
7308
  component,
7034
7309
  gutterBottom = false,
7035
7310
  noWrap = false,
7036
- paragraph = false,
7037
7311
  variant = "body1",
7038
7312
  variantMapping = defaultVariantMapping,
7039
7313
  ...other
@@ -7046,11 +7320,10 @@ const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps
7046
7320
  component,
7047
7321
  gutterBottom,
7048
7322
  noWrap,
7049
- paragraph,
7050
7323
  variant,
7051
7324
  variantMapping
7052
7325
  };
7053
- const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
7326
+ const Component = component || variantMapping[variant] || defaultVariantMapping[variant] || "span";
7054
7327
  const classes = useUtilityClasses(ownerState);
7055
7328
  return /* @__PURE__ */ jsx(TypographyRoot, {
7056
7329
  as: Component,
@@ -7112,12 +7385,6 @@ Typography.propTypes = {
7112
7385
  * @default false
7113
7386
  */
7114
7387
  noWrap: PropTypes.bool,
7115
- /**
7116
- * If `true`, the element will be a paragraph element.
7117
- * @default false
7118
- * @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.
7119
- */
7120
- paragraph: PropTypes.bool,
7121
7388
  /**
7122
7389
  * @ignore
7123
7390
  */
@@ -8747,7 +9014,7 @@ function getAnchorEl(anchorEl) {
8747
9014
  const useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
8748
9015
  const defaultPopperOptions = {};
8749
9016
  React.forwardRef((props, ref) => {
8750
- const { anchorEl, children, container, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
9017
+ 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;
8751
9018
  const tooltipRef = React.useRef(null);
8752
9019
  const ownRef = useForkRef(tooltipRef, ref);
8753
9020
  const popperRef = React.useRef(null);
@@ -8844,7 +9111,7 @@ React.forwardRef((props, ref) => {
8844
9111
  onExited: handleExited
8845
9112
  };
8846
9113
  }
8847
- return jsx(Portal, { disablePortal, container, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
9114
+ return jsx(Portal, { disablePortal, container: container2, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
8848
9115
  // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
8849
9116
  position: "fixed",
8850
9117
  // Fix Popper.js display issue
@@ -8854,6 +9121,18 @@ React.forwardRef((props, ref) => {
8854
9121
  ...style2
8855
9122
  }, children: typeof children === "function" ? children(childProps) : children }) });
8856
9123
  });
9124
+ function _assertThisInitialized(e) {
9125
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9126
+ return e;
9127
+ }
9128
+ function _setPrototypeOf(t, e) {
9129
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
9130
+ return t2.__proto__ = e2, t2;
9131
+ }, _setPrototypeOf(t, e);
9132
+ }
9133
+ function _inheritsLoose(t, o) {
9134
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
9135
+ }
8857
9136
  var safeIsNaN = Number.isNaN || function ponyfill(value) {
8858
9137
  return typeof value === "number" && value !== value;
8859
9138
  };