sevago-library 1.4.0 → 1.4.2

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.
package/dist/index.esm.js CHANGED
@@ -5,8 +5,8 @@ import { createTheme as createTheme$2, Stack, TableCell, tableCellClasses, Linea
5
5
  import dayjs from "dayjs";
6
6
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
7
7
  import * as React from "react";
8
- import React__default, { useState, useId as useId$1, useEffect, Fragment as Fragment$1, useRef, isValidElement, cloneElement, Children, createElement, useMemo, forwardRef, useCallback } from "react";
9
- import { unstable_createGetCssVar, createSpacing as createSpacing$1, useTheme as useTheme$3, GlobalStyles as GlobalStyles$1, unstable_memoTheme, keyframes, css, shouldForwardProp as shouldForwardProp$1, alpha as alpha$1, Stack as Stack$1, Box as Box$1 } from "@mui/system";
8
+ import React__default, { useState, useId as useId$1, Fragment as Fragment$1, useEffect, useRef, isValidElement, cloneElement, Children, createElement, useMemo, forwardRef, useCallback } from "react";
9
+ import { createSpacing as createSpacing$1, unstable_createGetCssVar, useTheme as useTheme$3, GlobalStyles as GlobalStyles$1, unstable_memoTheme, keyframes, css, shouldForwardProp as shouldForwardProp$1, alpha as alpha$1, Stack as Stack$1, Box as Box$1 } from "@mui/system";
10
10
  import styled$2 from "@emotion/styled";
11
11
  import { ThemeContext } from "@emotion/react";
12
12
  import { LayoutGroup, motion, AnimatePresence, MotionConfig } from "framer-motion";
@@ -28292,8 +28292,11 @@ function getContainerQuery(theme, shorthand) {
28292
28292
  const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
28293
28293
  if (!matches) {
28294
28294
  if (process.env.NODE_ENV !== "production") {
28295
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
28296
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.` : formatMuiErrorMessage(18, `(${shorthand})`));
28295
+ throw (
28296
+ /* minify-error */
28297
+ new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
28298
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
28299
+ );
28297
28300
  }
28298
28301
  return null;
28299
28302
  }
@@ -28865,7 +28868,7 @@ function serializeStyles(args, registered, mergedProps) {
28865
28868
  };
28866
28869
  }
28867
28870
  /**
28868
- * @mui/styled-engine v7.3.3
28871
+ * @mui/styled-engine v7.3.10
28869
28872
  *
28870
28873
  * @license MIT
28871
28874
  * This source code is licensed under the MIT license found in the
@@ -30417,7 +30420,7 @@ function createThemeNoVars(options = {}, ...args) {
30417
30420
  if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
30418
30421
  // `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
30419
30422
  options.generateThemeVars === void 0) {
30420
- throw new Error(process.env.NODE_ENV !== "production" ? "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." : formatMuiErrorMessage(20));
30423
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://v7.mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature." : formatMuiErrorMessage(20));
30421
30424
  }
30422
30425
  const palette = createPalette({
30423
30426
  ...paletteInput,
@@ -30765,10 +30768,10 @@ function createThemeWithVars(options = {}, ...args) {
30765
30768
  }
30766
30769
  assignNode(palette, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
30767
30770
  if (palette.mode === "light") {
30768
- setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, palette.error.light, 0.6));
30769
- setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, palette.info.light, 0.6));
30770
- setColor(palette.Alert, "successColor", colorMix(private_safeDarken, palette.success.light, 0.6));
30771
- setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, palette.warning.light, 0.6));
30771
+ setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
30772
+ setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
30773
+ setColor(palette.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
30774
+ setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
30772
30775
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
30773
30776
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
30774
30777
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
@@ -30777,10 +30780,10 @@ function createThemeWithVars(options = {}, ...args) {
30777
30780
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.main)));
30778
30781
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.main)));
30779
30782
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.main)));
30780
- setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, palette.error.light, 0.9));
30781
- setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, palette.info.light, 0.9));
30782
- setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, palette.success.light, 0.9));
30783
- setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, palette.warning.light, 0.9));
30783
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
30784
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
30785
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
30786
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
30784
30787
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
30785
30788
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
30786
30789
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -30795,20 +30798,20 @@ function createThemeWithVars(options = {}, ...args) {
30795
30798
  setColor(palette.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
30796
30799
  setColor(palette.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
30797
30800
  setColor(palette.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
30798
- setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, palette.primary.main, 0.62));
30799
- setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, palette.secondary.main, 0.62));
30800
- setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, palette.error.main, 0.62));
30801
- setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, palette.info.main, 0.62));
30802
- setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, palette.success.main, 0.62));
30803
- setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, palette.warning.main, 0.62));
30804
- setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, palette.text.primary, 0.11) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
30805
- setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, palette.primary.main, 0.62));
30806
- setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, palette.secondary.main, 0.62));
30807
- setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, palette.error.main, 0.62));
30808
- setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, palette.info.main, 0.62));
30809
- setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, palette.success.main, 0.62));
30810
- setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, palette.warning.main, 0.62));
30811
- const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
30801
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
30802
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
30803
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
30804
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
30805
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
30806
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.62));
30807
+ 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)`);
30808
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
30809
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
30810
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
30811
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
30812
+ setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
30813
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
30814
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
30812
30815
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
30813
30816
  setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
30814
30817
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
@@ -30816,20 +30819,20 @@ function createThemeWithVars(options = {}, ...args) {
30816
30819
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-400"));
30817
30820
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-common-white"));
30818
30821
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
30819
- setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, palette.primary.main, 0.62));
30820
- setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, palette.secondary.main, 0.62));
30821
- setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, palette.error.main, 0.62));
30822
- setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, palette.info.main, 0.62));
30823
- setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, palette.success.main, 0.62));
30824
- setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, palette.warning.main, 0.62));
30825
- setColor(palette.TableCell, "border", colorMix(private_safeLighten, colorMix(private_safeAlpha, palette.divider, 1), 0.88));
30826
- setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, palette.grey[700], 0.92));
30822
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
30823
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
30824
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
30825
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
30826
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
30827
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
30828
+ setColor(palette.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.88));
30829
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
30827
30830
  }
30828
30831
  if (palette.mode === "dark") {
30829
- setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, palette.error.light, 0.6));
30830
- setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, palette.info.light, 0.6));
30831
- setColor(palette.Alert, "successColor", colorMix(private_safeLighten, palette.success.light, 0.6));
30832
- setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, palette.warning.light, 0.6));
30832
+ setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
30833
+ setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
30834
+ setColor(palette.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
30835
+ setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
30833
30836
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
30834
30837
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
30835
30838
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
@@ -30838,10 +30841,10 @@ function createThemeWithVars(options = {}, ...args) {
30838
30841
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.dark)));
30839
30842
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.dark)));
30840
30843
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.dark)));
30841
- setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, palette.error.light, 0.9));
30842
- setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, palette.info.light, 0.9));
30843
- setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, palette.success.light, 0.9));
30844
- setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, palette.warning.light, 0.9));
30844
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
30845
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
30846
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
30847
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
30845
30848
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
30846
30849
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
30847
30850
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -30858,20 +30861,20 @@ function createThemeWithVars(options = {}, ...args) {
30858
30861
  setColor(palette.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
30859
30862
  setColor(palette.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
30860
30863
  setColor(palette.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
30861
- setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, palette.primary.main, 0.5));
30862
- setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, palette.secondary.main, 0.5));
30863
- setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, palette.error.main, 0.5));
30864
- setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, palette.info.main, 0.5));
30865
- setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, palette.success.main, 0.5));
30866
- setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, palette.warning.main, 0.5));
30867
- setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, palette.text.primary, 0.13) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
30868
- setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, palette.primary.main, 0.5));
30869
- setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, palette.secondary.main, 0.5));
30870
- setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, palette.error.main, 0.5));
30871
- setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, palette.info.main, 0.5));
30872
- setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, palette.success.main, 0.5));
30873
- setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, palette.warning.main, 0.5));
30874
- const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
30864
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
30865
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
30866
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
30867
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
30868
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
30869
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.5));
30870
+ 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)`);
30871
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
30872
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
30873
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
30874
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
30875
+ setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
30876
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.5));
30877
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
30875
30878
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
30876
30879
  setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
30877
30880
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
@@ -30879,23 +30882,25 @@ function createThemeWithVars(options = {}, ...args) {
30879
30882
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-600"));
30880
30883
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
30881
30884
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
30882
- setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, palette.primary.main, 0.55));
30883
- setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, palette.secondary.main, 0.55));
30884
- setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, palette.error.main, 0.55));
30885
- setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, palette.info.main, 0.55));
30886
- setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, palette.success.main, 0.55));
30887
- setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, palette.warning.main, 0.55));
30888
- setColor(palette.TableCell, "border", colorMix(private_safeDarken, colorMix(private_safeAlpha, palette.divider, 1), 0.68));
30889
- setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, palette.grey[700], 0.92));
30890
- }
30891
- setColorChannel(palette.background, "default");
30892
- setColorChannel(palette.background, "paper");
30893
- setColorChannel(palette.common, "background");
30894
- setColorChannel(palette.common, "onBackground");
30895
- setColorChannel(palette, "divider");
30885
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.55));
30886
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.55));
30887
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.55));
30888
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.55));
30889
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.55));
30890
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.55));
30891
+ setColor(palette.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.68));
30892
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
30893
+ }
30894
+ if (!nativeColor) {
30895
+ setColorChannel(palette.background, "default");
30896
+ setColorChannel(palette.background, "paper");
30897
+ setColorChannel(palette.common, "background");
30898
+ setColorChannel(palette.common, "onBackground");
30899
+ setColorChannel(palette, "divider");
30900
+ }
30896
30901
  Object.keys(palette).forEach((color2) => {
30897
30902
  const colors = palette[color2];
30898
- if (color2 !== "tonalOffset" && colors && typeof colors === "object") {
30903
+ if (color2 !== "tonalOffset" && !nativeColor && colors && typeof colors === "object") {
30899
30904
  if (colors.main) {
30900
30905
  setColor(palette[color2], "mainChannel", private_safeColorChannel(toRgb(colors.main)));
30901
30906
  }
@@ -34157,15 +34162,8 @@ const transferDateSectionValue = (adapter, section, dateToTransferFrom, dateToTr
34157
34162
  return adapter.setDate(dateToTransferTo, adapter.getDate(dateToTransferFrom));
34158
34163
  }
34159
34164
  case "meridiem": {
34160
- const isAM = adapter.getHours(dateToTransferFrom) < 12;
34161
- const mergedDateHours = adapter.getHours(dateToTransferTo);
34162
- if (isAM && mergedDateHours >= 12) {
34163
- return adapter.addHours(dateToTransferTo, -12);
34164
- }
34165
- if (!isAM && mergedDateHours < 12) {
34166
- return adapter.addHours(dateToTransferTo, 12);
34167
- }
34168
- return dateToTransferTo;
34165
+ const meridiem = adapter.getHours(dateToTransferFrom) < 12 ? "am" : "pm";
34166
+ return convertToMeridiem(dateToTransferTo, meridiem, true, adapter);
34169
34167
  }
34170
34168
  case "hours": {
34171
34169
  return adapter.setHours(dateToTransferTo, adapter.getHours(dateToTransferFrom));
@@ -36896,6 +36894,26 @@ TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
36896
36894
  } : {};
36897
36895
  TransitionGroup.defaultProps = defaultProps;
36898
36896
  const reflow = (node) => node.scrollTop;
36897
+ function normalizedTransitionCallback(nodeRef, callback) {
36898
+ return (maybeIsAppearing) => {
36899
+ if (callback) {
36900
+ const node = nodeRef.current;
36901
+ if (maybeIsAppearing === void 0) {
36902
+ callback(node);
36903
+ } else {
36904
+ callback(node, maybeIsAppearing);
36905
+ }
36906
+ }
36907
+ };
36908
+ }
36909
+ function getTransitionChildStyle(state, inProp, baseStyles, hiddenStyles2, styleProp, childStyle) {
36910
+ const base = state === "exited" && !inProp ? hiddenStyles2 : baseStyles[state] || baseStyles.exited;
36911
+ return styleProp || childStyle ? {
36912
+ ...base,
36913
+ ...styleProp,
36914
+ ...childStyle
36915
+ } : base;
36916
+ }
36899
36917
  function getTransitionProps(props, options) {
36900
36918
  const {
36901
36919
  timeout: timeout2,
@@ -36919,9 +36937,21 @@ const styles$3 = {
36919
36937
  entered: {
36920
36938
  opacity: 1,
36921
36939
  transform: "none"
36940
+ },
36941
+ exiting: {
36942
+ opacity: 0,
36943
+ transform: getScale(0.75)
36944
+ },
36945
+ exited: {
36946
+ opacity: 0,
36947
+ transform: getScale(0.75)
36922
36948
  }
36923
36949
  };
36924
- const isWebKit154 = typeof navigator !== "undefined" && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
36950
+ const hiddenStyles$1 = {
36951
+ opacity: 0,
36952
+ transform: getScale(0.75),
36953
+ visibility: "hidden"
36954
+ };
36925
36955
  const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
36926
36956
  const {
36927
36957
  addEndListener,
@@ -36937,8 +36967,6 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
36937
36967
  onExiting,
36938
36968
  style: style2,
36939
36969
  timeout: timeout2 = "auto",
36940
- // eslint-disable-next-line react/prop-types
36941
- TransitionComponent = Transition,
36942
36970
  ...other
36943
36971
  } = props;
36944
36972
  const timer = useTimeout();
@@ -36946,18 +36974,8 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
36946
36974
  const theme = useTheme();
36947
36975
  const nodeRef = React.useRef(null);
36948
36976
  const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
36949
- const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
36950
- if (callback) {
36951
- const node = nodeRef.current;
36952
- if (maybeIsAppearing === void 0) {
36953
- callback(node);
36954
- } else {
36955
- callback(node, maybeIsAppearing);
36956
- }
36957
- }
36958
- };
36959
- const handleEntering = normalizedTransitionCallback(onEntering);
36960
- const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
36977
+ const handleEntering = normalizedTransitionCallback(nodeRef, onEntering);
36978
+ const handleEnter = normalizedTransitionCallback(nodeRef, (node, isAppearing) => {
36961
36979
  reflow(node);
36962
36980
  const {
36963
36981
  duration: transitionDuration,
@@ -36981,7 +36999,7 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
36981
36999
  duration: duration2,
36982
37000
  delay
36983
37001
  }), theme.transitions.create("transform", {
36984
- duration: isWebKit154 ? duration2 : duration2 * 0.666,
37002
+ duration: duration2 * 0.666,
36985
37003
  delay,
36986
37004
  easing: transitionTimingFunction
36987
37005
  })].join(",");
@@ -36989,9 +37007,9 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
36989
37007
  onEnter(node, isAppearing);
36990
37008
  }
36991
37009
  });
36992
- const handleEntered = normalizedTransitionCallback(onEntered);
36993
- const handleExiting = normalizedTransitionCallback(onExiting);
36994
- const handleExit = normalizedTransitionCallback((node) => {
37010
+ const handleEntered = normalizedTransitionCallback(nodeRef, onEntered);
37011
+ const handleExiting = normalizedTransitionCallback(nodeRef, onExiting);
37012
+ const handleExit = normalizedTransitionCallback(nodeRef, (node) => {
36995
37013
  const {
36996
37014
  duration: transitionDuration,
36997
37015
  delay,
@@ -37014,8 +37032,8 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
37014
37032
  duration: duration2,
37015
37033
  delay
37016
37034
  }), theme.transitions.create("transform", {
37017
- duration: isWebKit154 ? duration2 : duration2 * 0.666,
37018
- delay: isWebKit154 ? delay : delay || duration2 * 0.333,
37035
+ duration: duration2 * 0.666,
37036
+ delay: delay || duration2 * 0.333,
37019
37037
  easing: transitionTimingFunction
37020
37038
  })].join(",");
37021
37039
  node.style.opacity = 0;
@@ -37024,7 +37042,12 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
37024
37042
  onExit(node);
37025
37043
  }
37026
37044
  });
37027
- const handleExited = normalizedTransitionCallback(onExited);
37045
+ const handleExited = normalizedTransitionCallback(nodeRef, (node) => {
37046
+ node.style.transition = "";
37047
+ if (onExited) {
37048
+ onExited(node);
37049
+ }
37050
+ });
37028
37051
  const handleAddEndListener = (next) => {
37029
37052
  if (timeout2 === "auto") {
37030
37053
  timer.start(autoTimeout.current || 0, next);
@@ -37033,7 +37056,7 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
37033
37056
  addEndListener(nodeRef.current, next);
37034
37057
  }
37035
37058
  };
37036
- return /* @__PURE__ */ jsx(TransitionComponent, {
37059
+ return /* @__PURE__ */ jsx(Transition, {
37037
37060
  appear,
37038
37061
  in: inProp,
37039
37062
  nodeRef,
@@ -37050,15 +37073,9 @@ const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
37050
37073
  ownerState,
37051
37074
  ...restChildProps
37052
37075
  }) => {
37076
+ const childStyle = getTransitionChildStyle(state, inProp, styles$3, hiddenStyles$1, style2, children.props.style);
37053
37077
  return /* @__PURE__ */ React.cloneElement(children, {
37054
- style: {
37055
- opacity: 0,
37056
- transform: getScale(0.75),
37057
- visibility: state === "exited" && !inProp ? "hidden" : void 0,
37058
- ...styles$3[state],
37059
- ...style2,
37060
- ...children.props.style
37061
- },
37078
+ style: childStyle,
37062
37079
  ref: handleRef,
37063
37080
  ...restChildProps
37064
37081
  });
@@ -37148,8 +37165,18 @@ const styles$2 = {
37148
37165
  },
37149
37166
  entered: {
37150
37167
  opacity: 1
37168
+ },
37169
+ exiting: {
37170
+ opacity: 0
37171
+ },
37172
+ exited: {
37173
+ opacity: 0
37151
37174
  }
37152
37175
  };
37176
+ const hiddenStyles = {
37177
+ opacity: 0,
37178
+ visibility: "hidden"
37179
+ };
37153
37180
  const Fade = /* @__PURE__ */ React.forwardRef(function Fade2(props, ref) {
37154
37181
  const theme = useTheme();
37155
37182
  const defaultTimeout = {
@@ -37170,24 +37197,12 @@ const Fade = /* @__PURE__ */ React.forwardRef(function Fade2(props, ref) {
37170
37197
  onExiting,
37171
37198
  style: style2,
37172
37199
  timeout: timeout2 = defaultTimeout,
37173
- // eslint-disable-next-line react/prop-types
37174
- TransitionComponent = Transition,
37175
37200
  ...other
37176
37201
  } = props;
37177
37202
  const nodeRef = React.useRef(null);
37178
37203
  const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
37179
- const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
37180
- if (callback) {
37181
- const node = nodeRef.current;
37182
- if (maybeIsAppearing === void 0) {
37183
- callback(node);
37184
- } else {
37185
- callback(node, maybeIsAppearing);
37186
- }
37187
- }
37188
- };
37189
- const handleEntering = normalizedTransitionCallback(onEntering);
37190
- const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
37204
+ const handleEntering = normalizedTransitionCallback(nodeRef, onEntering);
37205
+ const handleEnter = normalizedTransitionCallback(nodeRef, (node, isAppearing) => {
37191
37206
  reflow(node);
37192
37207
  const transitionProps = getTransitionProps({
37193
37208
  style: style2,
@@ -37196,15 +37211,14 @@ const Fade = /* @__PURE__ */ React.forwardRef(function Fade2(props, ref) {
37196
37211
  }, {
37197
37212
  mode: "enter"
37198
37213
  });
37199
- node.style.webkitTransition = theme.transitions.create("opacity", transitionProps);
37200
37214
  node.style.transition = theme.transitions.create("opacity", transitionProps);
37201
37215
  if (onEnter) {
37202
37216
  onEnter(node, isAppearing);
37203
37217
  }
37204
37218
  });
37205
- const handleEntered = normalizedTransitionCallback(onEntered);
37206
- const handleExiting = normalizedTransitionCallback(onExiting);
37207
- const handleExit = normalizedTransitionCallback((node) => {
37219
+ const handleEntered = normalizedTransitionCallback(nodeRef, onEntered);
37220
+ const handleExiting = normalizedTransitionCallback(nodeRef, onExiting);
37221
+ const handleExit = normalizedTransitionCallback(nodeRef, (node) => {
37208
37222
  const transitionProps = getTransitionProps({
37209
37223
  style: style2,
37210
37224
  timeout: timeout2,
@@ -37212,19 +37226,23 @@ const Fade = /* @__PURE__ */ React.forwardRef(function Fade2(props, ref) {
37212
37226
  }, {
37213
37227
  mode: "exit"
37214
37228
  });
37215
- node.style.webkitTransition = theme.transitions.create("opacity", transitionProps);
37216
37229
  node.style.transition = theme.transitions.create("opacity", transitionProps);
37217
37230
  if (onExit) {
37218
37231
  onExit(node);
37219
37232
  }
37220
37233
  });
37221
- const handleExited = normalizedTransitionCallback(onExited);
37234
+ const handleExited = normalizedTransitionCallback(nodeRef, (node) => {
37235
+ node.style.transition = "";
37236
+ if (onExited) {
37237
+ onExited(node);
37238
+ }
37239
+ });
37222
37240
  const handleAddEndListener = (next) => {
37223
37241
  if (addEndListener) {
37224
37242
  addEndListener(nodeRef.current, next);
37225
37243
  }
37226
37244
  };
37227
- return /* @__PURE__ */ jsx(TransitionComponent, {
37245
+ return /* @__PURE__ */ jsx(Transition, {
37228
37246
  appear,
37229
37247
  in: inProp,
37230
37248
  nodeRef,
@@ -37241,14 +37259,9 @@ const Fade = /* @__PURE__ */ React.forwardRef(function Fade2(props, ref) {
37241
37259
  ownerState,
37242
37260
  ...restChildProps
37243
37261
  }) => {
37262
+ const childStyle = getTransitionChildStyle(state, inProp, styles$2, hiddenStyles, style2, children.props.style);
37244
37263
  return /* @__PURE__ */ React.cloneElement(children, {
37245
- style: {
37246
- opacity: 0,
37247
- visibility: state === "exited" && !inProp ? "hidden" : void 0,
37248
- ...styles$2[state],
37249
- ...style2,
37250
- ...children.props.style
37251
- },
37264
+ style: childStyle,
37252
37265
  ref: handleRef,
37253
37266
  ...restChildProps
37254
37267
  });
@@ -37738,7 +37751,7 @@ function getLayoutRect(element) {
37738
37751
  height: height2
37739
37752
  };
37740
37753
  }
37741
- function contains(parent, child) {
37754
+ function contains$1(parent, child) {
37742
37755
  var rootNode = child.getRootNode && child.getRootNode();
37743
37756
  if (parent.contains(child)) {
37744
37757
  return true;
@@ -37894,7 +37907,7 @@ function effect$1(_ref2) {
37894
37907
  return;
37895
37908
  }
37896
37909
  }
37897
- if (!contains(state.elements.popper, arrowElement)) {
37910
+ if (!contains$1(state.elements.popper, arrowElement)) {
37898
37911
  return;
37899
37912
  }
37900
37913
  state.elements.arrow = arrowElement;
@@ -38200,7 +38213,7 @@ function getClippingParents(element) {
38200
38213
  return [];
38201
38214
  }
38202
38215
  return clippingParents2.filter(function(clippingParent) {
38203
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
38216
+ return isElement(clippingParent) && contains$1(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
38204
38217
  });
38205
38218
  }
38206
38219
  function getClippingRect(element, boundary, rootBoundary, strategy) {
@@ -38896,6 +38909,11 @@ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyS
38896
38909
  var createPopper = /* @__PURE__ */ popperGenerator({
38897
38910
  defaultModifiers
38898
38911
  });
38912
+ function isLayoutSupported() {
38913
+ return !(/jsdom|HappyDOM/.test(window.navigator.userAgent) || // TODO(v9): Remove the test environment check
38914
+ // eslint-disable-next-line mui/consistent-production-guard
38915
+ process.env.NODE_ENV === "test");
38916
+ }
38899
38917
  function setRef(ref, value) {
38900
38918
  if (typeof ref === "function") {
38901
38919
  ref(value);
@@ -39059,7 +39077,7 @@ const PopperTooltip = /* @__PURE__ */ React.forwardRef(function PopperTooltip2(p
39059
39077
  if (process.env.NODE_ENV !== "production") {
39060
39078
  if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {
39061
39079
  const box = resolvedAnchorElement.getBoundingClientRect();
39062
- if (process.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
39080
+ if (isLayoutSupported() && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
39063
39081
  console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
39064
39082
  }
39065
39083
  }
@@ -39096,8 +39114,24 @@ const PopperTooltip = /* @__PURE__ */ React.forwardRef(function PopperTooltip2(p
39096
39114
  modifiers: popperModifiers
39097
39115
  });
39098
39116
  handlePopperRefRef.current(popper2);
39117
+ const popperElement = tooltipRef.current;
39099
39118
  return () => {
39100
- popper2.destroy();
39119
+ if (popperElement) {
39120
+ const {
39121
+ style: style2
39122
+ } = popperElement;
39123
+ const position = style2.position;
39124
+ const top2 = style2.top;
39125
+ const left2 = style2.left;
39126
+ const transform = style2.transform;
39127
+ popper2.destroy();
39128
+ style2.position = position;
39129
+ style2.top = top2;
39130
+ style2.left = left2;
39131
+ style2.transform = transform;
39132
+ } else {
39133
+ popper2.destroy();
39134
+ }
39101
39135
  handlePopperRefRef.current(null);
39102
39136
  };
39103
39137
  }, [resolvedAnchorElement, disablePortal, modifiers, open2, popperOptions, rtlPlacement]);
@@ -39213,8 +39247,10 @@ process.env.NODE_ENV !== "production" ? Popper$1.propTypes = {
39213
39247
  const resolvedAnchorEl = resolveAnchorEl$1(props.anchorEl);
39214
39248
  if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {
39215
39249
  const box = resolvedAnchorEl.getBoundingClientRect();
39216
- if (process.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
39217
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
39250
+ if (process.env.NODE_ENV !== "production") {
39251
+ if (isLayoutSupported() && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
39252
+ return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
39253
+ }
39218
39254
  }
39219
39255
  } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== "function" || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
39220
39256
  return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "It should be an HTML element instance or a virtualElement ", "(https://popper.js.org/docs/v2/virtual-elements/)."].join("\n"));
@@ -39502,6 +39538,41 @@ process.env.NODE_ENV !== "production" ? Popper2.propTypes = {
39502
39538
  */
39503
39539
  transition: PropTypes.bool
39504
39540
  } : void 0;
39541
+ function contains(parent, child) {
39542
+ var _a;
39543
+ if (!parent || !child) {
39544
+ return false;
39545
+ }
39546
+ if (parent.contains(child)) {
39547
+ return true;
39548
+ }
39549
+ const rootNode = (_a = child.getRootNode) == null ? void 0 : _a.call(child);
39550
+ if (rootNode && rootNode instanceof ShadowRoot) {
39551
+ let next = child;
39552
+ while (next) {
39553
+ if (parent === next) {
39554
+ return true;
39555
+ }
39556
+ next = next.parentNode ?? next.host ?? null;
39557
+ }
39558
+ }
39559
+ return false;
39560
+ }
39561
+ function activeElement(doc) {
39562
+ var _a;
39563
+ let element = doc.activeElement;
39564
+ while (((_a = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a.activeElement) != null) {
39565
+ element = element.shadowRoot.activeElement;
39566
+ }
39567
+ return element;
39568
+ }
39569
+ const FOCUSABLE_ATTRIBUTE = "data-mui-focusable";
39570
+ function getFocusTarget(rootElement) {
39571
+ if (!rootElement) {
39572
+ return null;
39573
+ }
39574
+ return rootElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? rootElement : rootElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`);
39575
+ }
39505
39576
  const candidatesSelector = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
39506
39577
  function getTabIndex(node) {
39507
39578
  const tabindexAttr = parseInt(node.getAttribute("tabindex") || "", 10);
@@ -39582,19 +39653,22 @@ function FocusTrap(props) {
39582
39653
  activated.current = !disableAutoFocus;
39583
39654
  }, [disableAutoFocus, open2]);
39584
39655
  React.useEffect(() => {
39656
+ ignoreNextEnforceFocus.current = false;
39585
39657
  if (!open2 || !rootRef.current) {
39586
39658
  return;
39587
39659
  }
39588
39660
  const doc = ownerDocument(rootRef.current);
39589
- if (!rootRef.current.contains(doc.activeElement)) {
39590
- if (!rootRef.current.hasAttribute("tabIndex")) {
39661
+ const activeElement$1 = activeElement(doc);
39662
+ const focusTarget = getFocusTarget(rootRef.current) ?? rootRef.current;
39663
+ if (!contains(rootRef.current, activeElement$1)) {
39664
+ if (!focusTarget.hasAttribute("tabIndex")) {
39591
39665
  if (process.env.NODE_ENV !== "production") {
39592
39666
  console.error(["MUI: The modal content node does not accept focus.", 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join("\n"));
39593
39667
  }
39594
- rootRef.current.setAttribute("tabIndex", "-1");
39668
+ focusTarget.setAttribute("tabIndex", "-1");
39595
39669
  }
39596
39670
  if (activated.current) {
39597
- rootRef.current.focus();
39671
+ focusTarget.focus();
39598
39672
  }
39599
39673
  }
39600
39674
  return () => {
@@ -39617,7 +39691,8 @@ function FocusTrap(props) {
39617
39691
  if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== "Tab") {
39618
39692
  return;
39619
39693
  }
39620
- if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
39694
+ const activeElement$1 = activeElement(doc);
39695
+ if (activeElement$1 === rootRef.current && nativeEvent.shiftKey) {
39621
39696
  ignoreNextEnforceFocus.current = true;
39622
39697
  if (sentinelEnd.current) {
39623
39698
  sentinelEnd.current.focus();
@@ -39630,17 +39705,18 @@ function FocusTrap(props) {
39630
39705
  if (rootElement === null) {
39631
39706
  return;
39632
39707
  }
39708
+ const activeEl = activeElement(doc);
39633
39709
  if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
39634
39710
  ignoreNextEnforceFocus.current = false;
39635
39711
  return;
39636
39712
  }
39637
- if (rootElement.contains(doc.activeElement)) {
39713
+ if (contains(rootElement, activeEl)) {
39638
39714
  return;
39639
39715
  }
39640
- if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {
39716
+ if (disableEnforceFocus && activeEl !== sentinelStart.current && activeEl !== sentinelEnd.current) {
39641
39717
  return;
39642
39718
  }
39643
- if (doc.activeElement !== reactFocusEventTarget.current) {
39719
+ if (activeEl !== reactFocusEventTarget.current) {
39644
39720
  reactFocusEventTarget.current = null;
39645
39721
  } else if (reactFocusEventTarget.current !== null) {
39646
39722
  return;
@@ -39649,7 +39725,7 @@ function FocusTrap(props) {
39649
39725
  return;
39650
39726
  }
39651
39727
  let tabbable = [];
39652
- if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
39728
+ if (activeEl === sentinelStart.current || activeEl === sentinelEnd.current) {
39653
39729
  tabbable = getTabbable(rootRef.current);
39654
39730
  }
39655
39731
  if (tabbable.length > 0) {
@@ -39670,7 +39746,8 @@ function FocusTrap(props) {
39670
39746
  doc.addEventListener("focusin", contain);
39671
39747
  doc.addEventListener("keydown", loopFocus, true);
39672
39748
  const interval = setInterval(() => {
39673
- if (doc.activeElement && doc.activeElement.tagName === "BODY") {
39749
+ const activeEl = activeElement(doc);
39750
+ if (activeEl && activeEl.tagName === "BODY") {
39674
39751
  contain();
39675
39752
  }
39676
39753
  }, 50);
@@ -41260,8 +41337,11 @@ function elementTypeAcceptingRef(props, propName, componentName, location2, prop
41260
41337
  if (typeof propValue === "function" && !isClassComponent(propValue)) {
41261
41338
  warningHint = "Did you accidentally provide a plain function component instead?";
41262
41339
  }
41340
+ if (propValue === React.Fragment) {
41341
+ warningHint = "Did you accidentally provide a React.Fragment instead?";
41342
+ }
41263
41343
  if (warningHint !== void 0) {
41264
- return new Error(`Invalid ${location2} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
41344
+ return new Error(`Invalid ${location2} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element type that can hold a ref. ${warningHint} For more information see https://v7.mui.com/r/caveat-with-refs-guide`);
41265
41345
  }
41266
41346
  return null;
41267
41347
  }
@@ -41870,7 +41950,13 @@ const ButtonBase = /* @__PURE__ */ React.forwardRef(function ButtonBase2(inProps
41870
41950
  });
41871
41951
  const isNonNativeButton = () => {
41872
41952
  const button = buttonRef.current;
41873
- return component && component !== "button" && !(button.tagName === "A" && button.href);
41953
+ if (!button) {
41954
+ return component && component !== "button";
41955
+ }
41956
+ if (button.tagName === "BUTTON") {
41957
+ return false;
41958
+ }
41959
+ return !(button.tagName === "A" && button.href);
41874
41960
  };
41875
41961
  const handleKeyDown = useEventCallback((event) => {
41876
41962
  if (focusRipple && !event.repeat && focusVisible && event.key === " ") {
@@ -41900,7 +41986,7 @@ const ButtonBase = /* @__PURE__ */ React.forwardRef(function ButtonBase2(inProps
41900
41986
  if (onKeyUp) {
41901
41987
  onKeyUp(event);
41902
41988
  }
41903
- if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === " " && !event.defaultPrevented) {
41989
+ if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === " " && !event.defaultPrevented && !disabled) {
41904
41990
  onClick(event);
41905
41991
  }
41906
41992
  });
@@ -41910,7 +41996,8 @@ const ButtonBase = /* @__PURE__ */ React.forwardRef(function ButtonBase2(inProps
41910
41996
  }
41911
41997
  const buttonProps = {};
41912
41998
  if (ComponentProp === "button") {
41913
- buttonProps.type = type === void 0 ? "button" : type;
41999
+ const hasFormAttributes = !!other.formAction;
42000
+ buttonProps.type = type === void 0 && !hasFormAttributes ? "button" : type;
41914
42001
  buttonProps.disabled = disabled;
41915
42002
  } else {
41916
42003
  if (!other.href && !other.to) {
@@ -42038,6 +42125,10 @@ process.env.NODE_ENV !== "production" ? ButtonBase.propTypes = {
42038
42125
  * if needed.
42039
42126
  */
42040
42127
  focusVisibleClassName: PropTypes.string,
42128
+ /**
42129
+ * @ignore
42130
+ */
42131
+ formAction: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
42041
42132
  /**
42042
42133
  * @ignore
42043
42134
  */
@@ -42517,6 +42608,17 @@ const ButtonRoot = styled(ButtonBase, {
42517
42608
  color: (theme.vars || theme).palette.action.disabled
42518
42609
  },
42519
42610
  variants: [{
42611
+ props: ({
42612
+ ownerState
42613
+ }) => ownerState.startIcon || ownerState.loading && ownerState.loadingPosition === "start",
42614
+ style: {
42615
+ "&::before": {
42616
+ content: '"\\200b"',
42617
+ width: 0,
42618
+ overflow: "hidden"
42619
+ }
42620
+ }
42621
+ }, {
42520
42622
  props: {
42521
42623
  variant: "contained"
42522
42624
  },
@@ -42965,6 +43067,10 @@ const Button = /* @__PURE__ */ React.forwardRef(function Button2(inProps, ref) {
42965
43067
  })
42966
43068
  })
42967
43069
  ) : null;
43070
+ const {
43071
+ root,
43072
+ ...forwardedClasses
43073
+ } = classes;
42968
43074
  return /* @__PURE__ */ jsxs(ButtonRoot, {
42969
43075
  ownerState,
42970
43076
  className: clsx(contextProps.className, classes.root, className, positionClassName),
@@ -42976,7 +43082,7 @@ const Button = /* @__PURE__ */ React.forwardRef(function Button2(inProps, ref) {
42976
43082
  type,
42977
43083
  id: loading ? loadingId : idProp,
42978
43084
  ...other,
42979
- classes,
43085
+ classes: forwardedClasses,
42980
43086
  children: [startIcon, loadingPosition !== "end" && loader, children, loadingPosition === "end" && loader, endIcon]
42981
43087
  });
42982
43088
  });
@@ -43407,6 +43513,56 @@ process.env.NODE_ENV !== "production" ? List$1.propTypes = {
43407
43513
  */
43408
43514
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
43409
43515
  } : void 0;
43516
+ function useSlot(name, parameters) {
43517
+ const {
43518
+ className,
43519
+ elementType: initialElementType,
43520
+ ownerState,
43521
+ externalForwardedProps,
43522
+ internalForwardedProps,
43523
+ shouldForwardComponentProp = false,
43524
+ ...useSlotPropsParams
43525
+ } = parameters;
43526
+ const {
43527
+ component: rootComponent,
43528
+ slots = {
43529
+ [name]: void 0
43530
+ },
43531
+ slotProps = {
43532
+ [name]: void 0
43533
+ },
43534
+ ...other
43535
+ } = externalForwardedProps;
43536
+ const elementType = slots[name] || initialElementType;
43537
+ const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
43538
+ const {
43539
+ props: {
43540
+ component: slotComponent,
43541
+ ...mergedProps
43542
+ },
43543
+ internalRef
43544
+ } = mergeSlotProps$2({
43545
+ className,
43546
+ ...useSlotPropsParams,
43547
+ externalForwardedProps: name === "root" ? other : void 0,
43548
+ externalSlotProps: resolvedComponentsProps
43549
+ });
43550
+ const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);
43551
+ const LeafComponent = name === "root" ? slotComponent || rootComponent : slotComponent;
43552
+ const props = appendOwnerState(elementType, {
43553
+ ...name === "root" && !rootComponent && !slots[name] && internalForwardedProps,
43554
+ ...name !== "root" && !slots[name] && internalForwardedProps,
43555
+ ...mergedProps,
43556
+ ...LeafComponent && !shouldForwardComponentProp && {
43557
+ as: LeafComponent
43558
+ },
43559
+ ...LeafComponent && shouldForwardComponentProp && {
43560
+ component: LeafComponent
43561
+ },
43562
+ ref
43563
+ }, ownerState);
43564
+ return [elementType, props];
43565
+ }
43410
43566
  function getListItemUtilityClass(slot) {
43411
43567
  return generateUtilityClass("MuiListItem", slot);
43412
43568
  }
@@ -43512,7 +43668,8 @@ const useUtilityClasses$X = (ownerState) => {
43512
43668
  } = ownerState;
43513
43669
  const slots = {
43514
43670
  root: ["root", dense && "dense", !disableGutters && "gutters", !disablePadding && "padding", divider && "divider", alignItems === "flex-start" && "alignItemsFlexStart", hasSecondaryAction && "secondaryAction"],
43515
- container: ["container"]
43671
+ container: ["container"],
43672
+ secondaryAction: ["secondaryAction"]
43516
43673
  };
43517
43674
  return composeClasses(slots, getListItemUtilityClass, classes);
43518
43675
  };
@@ -43668,6 +43825,16 @@ const ListItem = /* @__PURE__ */ React.forwardRef(function ListItem2(inProps, re
43668
43825
  };
43669
43826
  const classes = useUtilityClasses$X(ownerState);
43670
43827
  const handleRef = useForkRef(listItemRef, ref);
43828
+ const externalForwardedProps = {
43829
+ slots,
43830
+ slotProps
43831
+ };
43832
+ const [SecondaryActionSlot, secondaryActionSlotProps] = useSlot("secondaryAction", {
43833
+ elementType: ListItemSecondaryAction,
43834
+ externalForwardedProps,
43835
+ ownerState,
43836
+ className: classes.secondaryAction
43837
+ });
43671
43838
  const Root = slots.root || components.Root || ListItemRoot;
43672
43839
  const rootProps = slotProps.root || componentsProps.root || {};
43673
43840
  const componentProps = {
@@ -43720,7 +43887,8 @@ const ListItem = /* @__PURE__ */ React.forwardRef(function ListItem2(inProps, re
43720
43887
  }
43721
43888
  },
43722
43889
  ...componentProps,
43723
- children: [children, secondaryAction && /* @__PURE__ */ jsx(ListItemSecondaryAction, {
43890
+ children: [children, secondaryAction && /* @__PURE__ */ jsx(SecondaryActionSlot, {
43891
+ ...secondaryActionSlotProps,
43724
43892
  children: secondaryAction
43725
43893
  })]
43726
43894
  })
@@ -43831,7 +43999,8 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes = {
43831
43999
  * @default {}
43832
44000
  */
43833
44001
  slotProps: PropTypes.shape({
43834
- root: PropTypes.object
44002
+ root: PropTypes.object,
44003
+ secondaryAction: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
43835
44004
  }),
43836
44005
  /**
43837
44006
  * The components used for each slot inside.
@@ -43839,7 +44008,8 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes = {
43839
44008
  * @default {}
43840
44009
  */
43841
44010
  slots: PropTypes.shape({
43842
- root: PropTypes.elementType
44011
+ root: PropTypes.elementType,
44012
+ secondaryAction: PropTypes.elementType
43843
44013
  }),
43844
44014
  /**
43845
44015
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -43853,56 +44023,6 @@ function getChipUtilityClass(slot) {
43853
44023
  return generateUtilityClass("MuiChip", slot);
43854
44024
  }
43855
44025
  const chipClasses = generateUtilityClasses("MuiChip", ["root", "sizeSmall", "sizeMedium", "colorDefault", "colorError", "colorInfo", "colorPrimary", "colorSecondary", "colorSuccess", "colorWarning", "disabled", "clickable", "clickableColorPrimary", "clickableColorSecondary", "deletable", "deletableColorPrimary", "deletableColorSecondary", "outlined", "filled", "outlinedPrimary", "outlinedSecondary", "filledPrimary", "filledSecondary", "avatar", "avatarSmall", "avatarMedium", "avatarColorPrimary", "avatarColorSecondary", "icon", "iconSmall", "iconMedium", "iconColorPrimary", "iconColorSecondary", "label", "labelSmall", "labelMedium", "deleteIcon", "deleteIconSmall", "deleteIconMedium", "deleteIconColorPrimary", "deleteIconColorSecondary", "deleteIconOutlinedColorPrimary", "deleteIconOutlinedColorSecondary", "deleteIconFilledColorPrimary", "deleteIconFilledColorSecondary", "focusVisible"]);
43856
- function useSlot(name, parameters) {
43857
- const {
43858
- className,
43859
- elementType: initialElementType,
43860
- ownerState,
43861
- externalForwardedProps,
43862
- internalForwardedProps,
43863
- shouldForwardComponentProp = false,
43864
- ...useSlotPropsParams
43865
- } = parameters;
43866
- const {
43867
- component: rootComponent,
43868
- slots = {
43869
- [name]: void 0
43870
- },
43871
- slotProps = {
43872
- [name]: void 0
43873
- },
43874
- ...other
43875
- } = externalForwardedProps;
43876
- const elementType = slots[name] || initialElementType;
43877
- const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
43878
- const {
43879
- props: {
43880
- component: slotComponent,
43881
- ...mergedProps
43882
- },
43883
- internalRef
43884
- } = mergeSlotProps$2({
43885
- className,
43886
- ...useSlotPropsParams,
43887
- externalForwardedProps: name === "root" ? other : void 0,
43888
- externalSlotProps: resolvedComponentsProps
43889
- });
43890
- const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);
43891
- const LeafComponent = name === "root" ? slotComponent || rootComponent : slotComponent;
43892
- const props = appendOwnerState(elementType, {
43893
- ...name === "root" && !rootComponent && !slots[name] && internalForwardedProps,
43894
- ...name !== "root" && !slots[name] && internalForwardedProps,
43895
- ...mergedProps,
43896
- ...LeafComponent && !shouldForwardComponentProp && {
43897
- as: LeafComponent
43898
- },
43899
- ...LeafComponent && shouldForwardComponentProp && {
43900
- component: LeafComponent
43901
- },
43902
- ref
43903
- }, ownerState);
43904
- return [elementType, props];
43905
- }
43906
44026
  const useUtilityClasses$W = (ownerState) => {
43907
44027
  const {
43908
44028
  classes,
@@ -43958,7 +44078,7 @@ const ChipRoot = styled("div", {
43958
44078
  [`& .${chipClasses.deleteIcon}`]: styles2[`deleteIconColor${capitalize(color2)}`]
43959
44079
  }, {
43960
44080
  [`& .${chipClasses.deleteIcon}`]: styles2[`deleteIcon${capitalize(variant)}Color${capitalize(color2)}`]
43961
- }, styles2.root, styles2[`size${capitalize(size)}`], styles2[`color${capitalize(color2)}`], clickable && styles2.clickable, clickable && color2 !== "default" && styles2[`clickableColor${capitalize(color2)})`], onDelete && styles2.deletable, onDelete && color2 !== "default" && styles2[`deletableColor${capitalize(color2)}`], styles2[variant], styles2[`${variant}${capitalize(color2)}`]];
44081
+ }, styles2.root, styles2[`size${capitalize(size)}`], styles2[`color${capitalize(color2)}`], clickable && styles2.clickable, clickable && color2 !== "default" && styles2[`clickableColor${capitalize(color2)}`], onDelete && styles2.deletable, onDelete && color2 !== "default" && styles2[`deletableColor${capitalize(color2)}`], styles2[variant], styles2[`${variant}${capitalize(color2)}`]];
43962
44082
  }
43963
44083
  })(memoTheme(({
43964
44084
  theme
@@ -44262,9 +44382,7 @@ const Chip = /* @__PURE__ */ React.forwardRef(function Chip2(inProps, ref) {
44262
44382
  const handleRef = useForkRef(chipRef, ref);
44263
44383
  const handleDeleteIconClick = (event) => {
44264
44384
  event.stopPropagation();
44265
- if (onDelete) {
44266
- onDelete(event);
44267
- }
44385
+ onDelete(event);
44268
44386
  };
44269
44387
  const handleKeyDown = (event) => {
44270
44388
  if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
@@ -44922,8 +45040,8 @@ const useDesktopPicker = (_ref) => {
44922
45040
  });
44923
45041
  const renderPicker = () => /* @__PURE__ */ jsxs(PickerProvider, _extends({}, providerProps, {
44924
45042
  children: [/* @__PURE__ */ jsx(Field, _extends({}, fieldProps, {
44925
- slots,
44926
- slotProps,
45043
+ slots: _extends({}, slots, fieldProps.slots),
45044
+ slotProps: _extends({}, slotProps, fieldProps.slotProps),
44927
45045
  inputRef
44928
45046
  })), /* @__PURE__ */ jsx(PickerPopper, {
44929
45047
  slots,
@@ -45862,9 +45980,9 @@ function useFieldRootProps(parameters) {
45862
45980
  if (focused || disabled || !domGetters.isReady()) {
45863
45981
  return;
45864
45982
  }
45865
- const activeElement = getActiveElement(domGetters.getRoot());
45983
+ const activeElement2 = getActiveElement(domGetters.getRoot());
45866
45984
  setFocused(true);
45867
- const isFocusInsideASection = domGetters.getSectionIndexFromDOMElement(activeElement) != null;
45985
+ const isFocusInsideASection = domGetters.getSectionIndexFromDOMElement(activeElement2) != null;
45868
45986
  if (!isFocusInsideASection) {
45869
45987
  setSelectedSections(sectionOrder.startIndex);
45870
45988
  }
@@ -45874,8 +45992,8 @@ function useFieldRootProps(parameters) {
45874
45992
  if (!domGetters.isReady()) {
45875
45993
  return;
45876
45994
  }
45877
- const activeElement = getActiveElement(domGetters.getRoot());
45878
- const shouldBlur = !domGetters.getRoot().contains(activeElement);
45995
+ const activeElement2 = getActiveElement(domGetters.getRoot());
45996
+ const shouldBlur = !domGetters.getRoot().contains(activeElement2);
45879
45997
  if (shouldBlur) {
45880
45998
  setFocused(false);
45881
45999
  setSelectedSections(null);
@@ -45956,6 +46074,7 @@ function useFieldSectionContentProps(parameters) {
45956
46074
  sectionsValueBoundaries,
45957
46075
  state,
45958
46076
  value,
46077
+ localizedDigits,
45959
46078
  // Methods to update the states
45960
46079
  clearActiveSection,
45961
46080
  setCharacterQuery,
@@ -46065,10 +46184,10 @@ function useFieldSectionContentProps(parameters) {
46065
46184
  onFocus: createFocusHandler(sectionIndex),
46066
46185
  // Aria attributes
46067
46186
  "aria-readonly": readOnly,
46068
- "aria-valuenow": getSectionValueNow(section, adapter),
46187
+ "aria-valuenow": getSectionValueNow(section, adapter, localizedDigits),
46069
46188
  "aria-valuemin": sectionBoundaries.minimum,
46070
46189
  "aria-valuemax": sectionBoundaries.maximum,
46071
- "aria-valuetext": section.value ? getSectionValueText(section, adapter) : translations.empty,
46190
+ "aria-valuetext": section.value ? getSectionValueText(section, adapter, localizedDigits) : translations.empty,
46072
46191
  "aria-label": translations[section.type],
46073
46192
  "aria-disabled": disabled,
46074
46193
  // Other
@@ -46084,16 +46203,16 @@ function useFieldSectionContentProps(parameters) {
46084
46203
  children: section.value || section.placeholder,
46085
46204
  inputMode: section.contentType === "letter" ? "text" : "numeric"
46086
46205
  };
46087
- }, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
46206
+ }, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, localizedDigits, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
46088
46207
  }
46089
- function getSectionValueText(section, adapter) {
46208
+ function getSectionValueText(section, adapter, localizedDigits) {
46090
46209
  if (!section.value) {
46091
46210
  return void 0;
46092
46211
  }
46093
46212
  switch (section.type) {
46094
46213
  case "month": {
46095
46214
  if (section.contentType === "digit") {
46096
- const dateWithMonth = adapter.setMonth(adapter.date(), Number(section.value) - 1);
46215
+ const dateWithMonth = adapter.setMonth(adapter.date(), Number(removeLocalizedDigits(section.value, localizedDigits)) - 1);
46097
46216
  return adapter.isValid(dateWithMonth) ? adapter.format(dateWithMonth, "month") : "";
46098
46217
  }
46099
46218
  const parsedDate = adapter.parse(section.value, section.format);
@@ -46101,7 +46220,7 @@ function getSectionValueText(section, adapter) {
46101
46220
  }
46102
46221
  case "day":
46103
46222
  if (section.contentType === "digit") {
46104
- const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(section.value));
46223
+ const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(removeLocalizedDigits(section.value, localizedDigits)));
46105
46224
  return adapter.isValid(dateWithDay) ? adapter.format(dateWithDay, "dayOfMonthFull") : "";
46106
46225
  }
46107
46226
  return section.value;
@@ -46111,16 +46230,17 @@ function getSectionValueText(section, adapter) {
46111
46230
  return void 0;
46112
46231
  }
46113
46232
  }
46114
- function getSectionValueNow(section, adapter) {
46233
+ function getSectionValueNow(section, adapter, localizedDigits) {
46115
46234
  if (!section.value) {
46116
46235
  return void 0;
46117
46236
  }
46237
+ const nonLocalizedValue = removeLocalizedDigits(section.value, localizedDigits);
46118
46238
  switch (section.type) {
46119
46239
  case "weekDay": {
46120
46240
  if (section.contentType === "letter") {
46121
46241
  return void 0;
46122
46242
  }
46123
- return Number(section.value);
46243
+ return Number(nonLocalizedValue);
46124
46244
  }
46125
46245
  case "meridiem": {
46126
46246
  const parsedDate = adapter.parse(`01:00 ${section.value}`, `${adapter.formats.hours12h}:${adapter.formats.minutes} ${section.format}`);
@@ -46130,16 +46250,16 @@ function getSectionValueNow(section, adapter) {
46130
46250
  return void 0;
46131
46251
  }
46132
46252
  case "day":
46133
- return section.contentType === "digit-with-letter" ? parseInt(section.value, 10) : Number(section.value);
46253
+ return section.contentType === "digit-with-letter" ? parseInt(nonLocalizedValue, 10) : Number(nonLocalizedValue);
46134
46254
  case "month": {
46135
46255
  if (section.contentType === "digit") {
46136
- return Number(section.value);
46256
+ return Number(nonLocalizedValue);
46137
46257
  }
46138
46258
  const parsedDate = adapter.parse(section.value, section.format);
46139
46259
  return parsedDate ? adapter.getMonth(parsedDate) + 1 : void 0;
46140
46260
  }
46141
46261
  default:
46142
- return section.contentType !== "letter" ? Number(section.value) : void 0;
46262
+ return section.contentType !== "letter" ? Number(nonLocalizedValue) : void 0;
46143
46263
  }
46144
46264
  }
46145
46265
  const useFieldV7TextField = (parameters) => {
@@ -46365,16 +46485,16 @@ const useFieldV7TextField = (parameters) => {
46365
46485
  };
46366
46486
  function getActiveSectionIndex(sectionListRef) {
46367
46487
  var _a;
46368
- const activeElement = getActiveElement((_a = sectionListRef.current) == null ? void 0 : _a.getRoot());
46369
- if (!activeElement || !sectionListRef.current || !sectionListRef.current.getRoot().contains(activeElement)) {
46488
+ const activeElement2 = getActiveElement((_a = sectionListRef.current) == null ? void 0 : _a.getRoot());
46489
+ if (!activeElement2 || !sectionListRef.current || !sectionListRef.current.getRoot().contains(activeElement2)) {
46370
46490
  return null;
46371
46491
  }
46372
- return sectionListRef.current.getSectionIndexFromDOMElement(activeElement);
46492
+ return sectionListRef.current.getSectionIndexFromDOMElement(activeElement2);
46373
46493
  }
46374
46494
  function isFieldFocused$1(sectionListRef) {
46375
46495
  var _a;
46376
- const activeElement = getActiveElement((_a = sectionListRef.current) == null ? void 0 : _a.getRoot());
46377
- return !!sectionListRef.current && sectionListRef.current.getRoot().contains(activeElement);
46496
+ const activeElement2 = getActiveElement((_a = sectionListRef.current) == null ? void 0 : _a.getRoot());
46497
+ return !!sectionListRef.current && sectionListRef.current.getRoot().contains(activeElement2);
46378
46498
  }
46379
46499
  const cleanString = (dirtyString) => dirtyString.replace(/[\u2066\u2067\u2068\u2069]/g, "");
46380
46500
  const addPositionPropertiesToSections = (sections, localizedDigits, isRtl) => {
@@ -47081,6 +47201,8 @@ function getInputBaseUtilityClass(slot) {
47081
47201
  }
47082
47202
  const inputBaseClasses = generateUtilityClasses("MuiInputBase", ["root", "formControl", "focused", "disabled", "adornedStart", "adornedEnd", "error", "sizeSmall", "multiline", "colorSecondary", "fullWidth", "hiddenLabel", "readOnly", "input", "inputSizeSmall", "inputMultiline", "inputTypeSearch", "inputAdornedStart", "inputAdornedEnd", "inputHiddenLabel"]);
47083
47203
  var _InputGlobalStyles;
47204
+ const MUI_AUTO_FILL = "mui-auto-fill";
47205
+ const MUI_AUTO_FILL_CANCEL = "mui-auto-fill-cancel";
47084
47206
  const rootOverridesResolver = (props, styles2) => {
47085
47207
  const {
47086
47208
  ownerState
@@ -47245,11 +47367,11 @@ const InputBaseInput = styled("input", {
47245
47367
  ownerState
47246
47368
  }) => !ownerState.disableInjectingGlobalStyles,
47247
47369
  style: {
47248
- animationName: "mui-auto-fill-cancel",
47370
+ animationName: MUI_AUTO_FILL_CANCEL,
47249
47371
  animationDuration: "10ms",
47250
47372
  "&:-webkit-autofill": {
47251
47373
  animationDuration: "5000s",
47252
- animationName: "mui-auto-fill"
47374
+ animationName: MUI_AUTO_FILL
47253
47375
  }
47254
47376
  }
47255
47377
  }, {
@@ -47281,14 +47403,16 @@ const InputBaseInput = styled("input", {
47281
47403
  };
47282
47404
  }));
47283
47405
  const InputGlobalStyles = globalCss({
47284
- "@keyframes mui-auto-fill": {
47406
+ // Keep keyframes non-empty for Emotion production builds. Animation properties are ignored
47407
+ // inside keyframes, avoiding the visible display animation triggered by Chrome 117+.
47408
+ [`@keyframes ${MUI_AUTO_FILL}`]: {
47285
47409
  from: {
47286
- display: "block"
47410
+ animationName: MUI_AUTO_FILL
47287
47411
  }
47288
47412
  },
47289
- "@keyframes mui-auto-fill-cancel": {
47413
+ [`@keyframes ${MUI_AUTO_FILL_CANCEL}`]: {
47290
47414
  from: {
47291
- display: "block"
47415
+ animationName: MUI_AUTO_FILL_CANCEL
47292
47416
  }
47293
47417
  }
47294
47418
  });
@@ -47393,6 +47517,27 @@ const InputBase = /* @__PURE__ */ React.forwardRef(function InputBase2(inProps,
47393
47517
  });
47394
47518
  }
47395
47519
  }, [value, checkDirty, isControlled]);
47520
+ useEnhancedEffect(() => {
47521
+ if (!autoFocus) {
47522
+ return;
47523
+ }
47524
+ const input = inputRef.current;
47525
+ if (!input) {
47526
+ return;
47527
+ }
47528
+ const doc = ownerDocument(input);
47529
+ const activeElement$1 = activeElement(doc);
47530
+ const noElementFocused = activeElement$1 == null || activeElement$1 === doc.body || activeElement$1 === doc.documentElement;
47531
+ if (input === activeElement$1) {
47532
+ if (muiFormControl && muiFormControl.onFocus) {
47533
+ muiFormControl.onFocus();
47534
+ } else {
47535
+ setFocused(true);
47536
+ }
47537
+ } else if (noElementFocused) {
47538
+ input.focus();
47539
+ }
47540
+ }, [autoFocus]);
47396
47541
  const handleFocus = (event) => {
47397
47542
  if (onFocus) {
47398
47543
  onFocus(event);
@@ -47473,7 +47618,7 @@ const InputBase = /* @__PURE__ */ React.forwardRef(function InputBase2(inProps,
47473
47618
  InputComponent = TextareaAutosize;
47474
47619
  }
47475
47620
  const handleAutoFill = (event) => {
47476
- checkDirty(event.animationName === "mui-auto-fill-cancel" ? inputRef.current : {
47621
+ checkDirty(event.animationName === MUI_AUTO_FILL_CANCEL ? inputRef.current : {
47477
47622
  value: "x"
47478
47623
  });
47479
47624
  };
@@ -47874,7 +48019,7 @@ const InputRoot = styled(InputBaseRoot, {
47874
48019
  borderBottom: `1px solid ${bottomLineColor}`,
47875
48020
  left: 0,
47876
48021
  bottom: 0,
47877
- content: '"\\00a0"',
48022
+ content: '""',
47878
48023
  position: "absolute",
47879
48024
  right: 0,
47880
48025
  transition: theme.transitions.create("border-bottom-color", {
@@ -48243,7 +48388,7 @@ const FilledInputRoot = styled(InputBaseRoot, {
48243
48388
  borderBottom: `1px solid ${theme.vars ? theme.alpha(theme.vars.palette.common.onBackground, theme.vars.opacity.inputUnderline) : bottomLineColor}`,
48244
48389
  left: 0,
48245
48390
  bottom: 0,
48246
- content: '"\\00a0"',
48391
+ content: '""',
48247
48392
  position: "absolute",
48248
48393
  right: 0,
48249
48394
  transition: theme.transitions.create("border-bottom-color", {
@@ -50202,7 +50347,7 @@ const MenuList = /* @__PURE__ */ React.forwardRef(function MenuList2(props, ref)
50202
50347
  }
50203
50348
  return;
50204
50349
  }
50205
- const currentFocus = ownerDocument(list).activeElement;
50350
+ const currentFocus = activeElement(ownerDocument(list));
50206
50351
  if (key === "ArrowDown") {
50207
50352
  event.preventDefault();
50208
50353
  moveFocus$1(list, currentFocus, disableListWrap, disabledItemsFocusable, nextItem$1);
@@ -50355,7 +50500,7 @@ function ariaHidden(element, hide2) {
50355
50500
  }
50356
50501
  }
50357
50502
  function getPaddingRight(element) {
50358
- return parseInt(ownerWindow(element).getComputedStyle(element).paddingRight, 10) || 0;
50503
+ return parseFloat(ownerWindow(element).getComputedStyle(element).paddingRight) || 0;
50359
50504
  }
50360
50505
  function isAriaHiddenForbiddenOnElement(element) {
50361
50506
  const forbiddenTagNames = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"];
@@ -50621,7 +50766,6 @@ const Backdrop = /* @__PURE__ */ React.forwardRef(function Backdrop2(inProps, re
50621
50766
  children: /* @__PURE__ */ jsx(RootSlot, {
50622
50767
  "aria-hidden": true,
50623
50768
  ...rootProps,
50624
- classes,
50625
50769
  ref,
50626
50770
  children
50627
50771
  })
@@ -51367,7 +51511,7 @@ const Popover = /* @__PURE__ */ React.forwardRef(function Popover2(inProps, ref)
51367
51511
  const anchorRect = anchorElement.getBoundingClientRect();
51368
51512
  if (process.env.NODE_ENV !== "production") {
51369
51513
  const box = anchorElement.getBoundingClientRect();
51370
- if (process.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
51514
+ if (isLayoutSupported() && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
51371
51515
  console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
51372
51516
  }
51373
51517
  }
@@ -51600,8 +51744,10 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes = {
51600
51744
  const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
51601
51745
  if (resolvedAnchorEl && resolvedAnchorEl.nodeType === 1) {
51602
51746
  const box = resolvedAnchorEl.getBoundingClientRect();
51603
- if (process.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
51604
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
51747
+ if (process.env.NODE_ENV !== "production") {
51748
+ if (isLayoutSupported() && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
51749
+ return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
51750
+ }
51605
51751
  }
51606
51752
  } else {
51607
51753
  return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", `It should be an Element or PopoverVirtualElement instance but it's \`${resolvedAnchorEl}\` instead.`].join("\n"));
@@ -52332,6 +52478,36 @@ function getSelectUtilityClasses(slot) {
52332
52478
  return generateUtilityClass("MuiSelect", slot);
52333
52479
  }
52334
52480
  const selectClasses = generateUtilityClasses("MuiSelect", ["root", "select", "multiple", "filled", "outlined", "standard", "disabled", "focused", "icon", "iconOpen", "iconFilled", "iconOutlined", "iconStandard", "nativeInput", "error"]);
52481
+ function getOpenInteractionType(event) {
52482
+ if (!event) {
52483
+ return null;
52484
+ }
52485
+ if (event.type === "mousedown" || event.type === "pointerdown" || event.type === "touchstart") {
52486
+ return "pointer";
52487
+ }
52488
+ if (event.type === "keydown" || event.type === "click" && event.detail === 0) {
52489
+ return "keyboard";
52490
+ }
52491
+ return null;
52492
+ }
52493
+ function isEmpty(display) {
52494
+ return display == null || typeof display === "string" && !display.trim();
52495
+ }
52496
+ function areEqualValues(a, b) {
52497
+ if (typeof b === "object" && b !== null) {
52498
+ return a === b;
52499
+ }
52500
+ return String(a) === String(b);
52501
+ }
52502
+ const SelectFocusSourceContext = /* @__PURE__ */ React.createContext(null);
52503
+ if (process.env.NODE_ENV !== "production") {
52504
+ SelectFocusSourceContext.displayName = "SelectFocusSourceContext";
52505
+ }
52506
+ function useSelectFocusSource() {
52507
+ const context = React.useContext(SelectFocusSourceContext);
52508
+ return context;
52509
+ }
52510
+ const SelectFocusSourceProvider = SelectFocusSourceContext.Provider;
52335
52511
  var _span$1;
52336
52512
  const SelectSelect = styled(StyledSelectSelect, {
52337
52513
  name: "MuiSelect",
@@ -52391,15 +52567,6 @@ const SelectNativeInput = styled("input", {
52391
52567
  width: "100%",
52392
52568
  boxSizing: "border-box"
52393
52569
  });
52394
- function areEqualValues(a, b) {
52395
- if (typeof b === "object" && b !== null) {
52396
- return a === b;
52397
- }
52398
- return String(a) === String(b);
52399
- }
52400
- function isEmpty(display) {
52401
- return display == null || typeof display === "string" && !display.trim();
52402
- }
52403
52570
  const useUtilityClasses$G = (ownerState) => {
52404
52571
  const {
52405
52572
  classes,
@@ -52440,6 +52607,10 @@ const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props
52440
52607
  onChange,
52441
52608
  onClose,
52442
52609
  onFocus,
52610
+ // eslint-disable-next-line react/prop-types
52611
+ onKeyDown,
52612
+ // eslint-disable-next-line react/prop-types
52613
+ onMouseDown,
52443
52614
  onOpen,
52444
52615
  open: openProp,
52445
52616
  readOnly,
@@ -52470,6 +52641,7 @@ const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props
52470
52641
  current: isOpenControlled
52471
52642
  } = React.useRef(openProp != null);
52472
52643
  const [menuMinWidthState, setMenuMinWidthState] = React.useState();
52644
+ const [openInteractionType, setOpenInteractionType] = React.useState(null);
52473
52645
  const handleRef = useForkRef(ref, inputRefProp);
52474
52646
  const handleDisplayRef = React.useCallback((node) => {
52475
52647
  displayRef.current = node;
@@ -52485,6 +52657,22 @@ const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props
52485
52657
  node: inputRef.current,
52486
52658
  value
52487
52659
  }), [value]);
52660
+ const open2 = displayNode !== null && openState;
52661
+ React.useEffect(() => {
52662
+ if (!open2 || !anchorElement || autoWidth) {
52663
+ return void 0;
52664
+ }
52665
+ if (typeof ResizeObserver === "undefined") {
52666
+ return void 0;
52667
+ }
52668
+ const observer = new ResizeObserver(() => {
52669
+ setMenuMinWidthState(anchorElement.clientWidth);
52670
+ });
52671
+ observer.observe(anchorElement);
52672
+ return () => {
52673
+ observer.disconnect();
52674
+ };
52675
+ }, [open2, anchorElement, autoWidth]);
52488
52676
  React.useEffect(() => {
52489
52677
  if (defaultOpen && openState && displayNode && !isOpenControlled) {
52490
52678
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
@@ -52514,20 +52702,25 @@ const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props
52514
52702
  }
52515
52703
  return void 0;
52516
52704
  }, [labelId]);
52517
- const update = (open3, event) => {
52518
- if (open3) {
52705
+ const update = (openParam, event) => {
52706
+ if (openParam) {
52707
+ setOpenInteractionType(getOpenInteractionType(event));
52519
52708
  if (onOpen) {
52520
52709
  onOpen(event);
52521
52710
  }
52522
- } else if (onClose) {
52523
- onClose(event);
52711
+ } else {
52712
+ setOpenInteractionType(null);
52713
+ if (onClose) {
52714
+ onClose(event);
52715
+ }
52524
52716
  }
52525
52717
  if (!isOpenControlled) {
52526
52718
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
52527
- setOpenState(open3);
52719
+ setOpenState(openParam);
52528
52720
  }
52529
52721
  };
52530
52722
  const handleMouseDown = (event) => {
52723
+ onMouseDown == null ? void 0 : onMouseDown(event);
52531
52724
  if (event.button !== 0) {
52532
52725
  return;
52533
52726
  }
@@ -52601,9 +52794,9 @@ const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props
52601
52794
  event.preventDefault();
52602
52795
  update(true, event);
52603
52796
  }
52797
+ onKeyDown == null ? void 0 : onKeyDown(event);
52604
52798
  }
52605
52799
  };
52606
- const open2 = displayNode !== null && openState;
52607
52800
  const handleBlur = (event) => {
52608
52801
  if (!open2 && onBlur) {
52609
52802
  Object.defineProperty(event, "target", {
@@ -52779,39 +52972,42 @@ const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props
52779
52972
  as: IconComponent,
52780
52973
  className: classes.icon,
52781
52974
  ownerState
52782
- }), /* @__PURE__ */ jsx(Menu, {
52783
- id: `menu-${name || ""}`,
52784
- anchorEl: anchorElement,
52785
- open: open2,
52786
- onClose: handleClose,
52787
- anchorOrigin: {
52788
- vertical: "bottom",
52789
- horizontal: "center"
52790
- },
52791
- transformOrigin: {
52792
- vertical: "top",
52793
- horizontal: "center"
52794
- },
52795
- ...MenuProps,
52796
- slotProps: {
52797
- ...MenuProps.slotProps,
52798
- list: {
52799
- "aria-labelledby": labelId,
52800
- role: "listbox",
52801
- "aria-multiselectable": multiple ? "true" : void 0,
52802
- disableListWrap: true,
52803
- id: listboxId,
52804
- ...listProps
52975
+ }), /* @__PURE__ */ jsx(SelectFocusSourceProvider, {
52976
+ value: openInteractionType,
52977
+ children: /* @__PURE__ */ jsx(Menu, {
52978
+ id: `menu-${name || ""}`,
52979
+ anchorEl: anchorElement,
52980
+ open: open2,
52981
+ onClose: handleClose,
52982
+ anchorOrigin: {
52983
+ vertical: "bottom",
52984
+ horizontal: "center"
52805
52985
  },
52806
- paper: {
52807
- ...paperProps,
52808
- style: {
52809
- minWidth: menuMinWidth,
52810
- ...paperProps != null ? paperProps.style : null
52986
+ transformOrigin: {
52987
+ vertical: "top",
52988
+ horizontal: "center"
52989
+ },
52990
+ ...MenuProps,
52991
+ slotProps: {
52992
+ ...MenuProps.slotProps,
52993
+ list: {
52994
+ "aria-labelledby": labelId,
52995
+ role: "listbox",
52996
+ "aria-multiselectable": multiple ? "true" : void 0,
52997
+ disableListWrap: true,
52998
+ id: listboxId,
52999
+ ...listProps
53000
+ },
53001
+ paper: {
53002
+ ...paperProps,
53003
+ style: {
53004
+ minWidth: menuMinWidth,
53005
+ ...paperProps != null ? paperProps.style : null
53006
+ }
52811
53007
  }
52812
- }
52813
- },
52814
- children: items
53008
+ },
53009
+ children: items
53010
+ })
52815
53011
  })]
52816
53012
  });
52817
53013
  });
@@ -54454,6 +54650,10 @@ const PickersInputBaseRoot = styled("div", {
54454
54650
  boxSizing: "border-box",
54455
54651
  // Prevent padding issue with fullWidth.
54456
54652
  letterSpacing: `${round(0.15 / 16)}em`,
54653
+ [`&.${pickersInputBaseClasses.disabled}`]: {
54654
+ color: (theme.vars || theme).palette.action.disabled,
54655
+ cursor: "default"
54656
+ },
54457
54657
  variants: [{
54458
54658
  props: {
54459
54659
  isInputInFullWidth: true
@@ -54927,13 +55127,17 @@ const OutlineRoot = styled("fieldset", {
54927
55127
  borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor2
54928
55128
  };
54929
55129
  });
54930
- const OutlineLabel = styled("span")(({
55130
+ const OutlineLabel = styled("span", {
55131
+ slot: "internal",
55132
+ shouldForwardProp: void 0
55133
+ })(({
54931
55134
  theme
54932
55135
  }) => ({
54933
55136
  fontFamily: theme.typography.fontFamily,
54934
55137
  fontSize: "inherit"
54935
55138
  }));
54936
55139
  const OutlineLegend = styled("legend", {
55140
+ slot: "internal",
54937
55141
  shouldForwardProp: (prop) => shouldForwardProp(prop) && prop !== "notched"
54938
55142
  })(({
54939
55143
  theme
@@ -55049,17 +55253,14 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
55049
55253
  borderStyle: "solid",
55050
55254
  borderWidth: 2
55051
55255
  },
55256
+ [`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
55257
+ borderColor: (theme.vars || theme).palette.error.main
55258
+ },
55052
55259
  [`&.${pickersOutlinedInputClasses.disabled}`]: {
55053
55260
  [`& .${pickersOutlinedInputClasses.notchedOutline}`]: {
55054
55261
  borderColor: (theme.vars || theme).palette.action.disabled
55055
- },
55056
- "*": {
55057
- color: (theme.vars || theme).palette.action.disabled
55058
55262
  }
55059
55263
  },
55060
- [`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
55061
- borderColor: (theme.vars || theme).palette.error.main
55062
- },
55063
55264
  variants: Object.keys((theme.vars ?? theme).palette).filter((key) => {
55064
55265
  var _a;
55065
55266
  return ((_a = (theme.vars ?? theme).palette[key]) == null ? void 0 : _a.main) ?? false;
@@ -55116,14 +55317,17 @@ const PickersOutlinedInput = /* @__PURE__ */ React.forwardRef(function PickersOu
55116
55317
  root: PickersOutlinedInputRoot,
55117
55318
  input: PickersOutlinedInputSectionsContainer
55118
55319
  },
55119
- renderSuffix: (state) => /* @__PURE__ */ jsx(Outline, {
55120
- shrink: Boolean(notched || state.adornedStart || state.focused || state.filled),
55121
- notched: Boolean(notched || state.adornedStart || state.focused || state.filled),
55122
- className: classes.notchedOutline,
55123
- label: label != null && label !== "" && (muiFormControl == null ? void 0 : muiFormControl.required) ? /* @__PURE__ */ jsxs(React.Fragment, {
55124
- children: [label, " ", "*"]
55125
- }) : label
55126
- })
55320
+ renderSuffix: (state) => {
55321
+ const isNotched = typeof notched !== "undefined" ? notched : Boolean(state.adornedStart || state.focused || state.filled);
55322
+ return /* @__PURE__ */ jsx(Outline, {
55323
+ shrink: isNotched,
55324
+ notched: isNotched,
55325
+ className: classes.notchedOutline,
55326
+ label: label != null && label !== "" && (muiFormControl == null ? void 0 : muiFormControl.required) ? /* @__PURE__ */ jsxs(React.Fragment, {
55327
+ children: [label, " ", "*"]
55328
+ }) : label
55329
+ });
55330
+ }
55127
55331
  }, other, {
55128
55332
  label,
55129
55333
  classes,
@@ -56689,7 +56893,11 @@ const useCalendarState = (params) => {
56689
56893
  const [calendarState, dispatch] = React.useReducer(reducerFn, {
56690
56894
  isMonthSwitchingAnimating: false,
56691
56895
  focusedDay: referenceDate,
56692
- currentMonth: adapter.startOfMonth(referenceDate),
56896
+ // Keep the time from the reference date when computing the current month anchor.
56897
+ // Using startOfMonth would reset the time to 00:00 which breaks expectations
56898
+ // that month selections preserve the referenceDate time when no value is provided.
56899
+ // See tests: "should use `referenceDate` when no value defined".
56900
+ currentMonth: adapter.setDate(referenceDate, 1),
56693
56901
  slideDirection: "left"
56694
56902
  });
56695
56903
  const isDateDisabled = useIsDateDisabled({
@@ -56870,6 +57078,8 @@ const useUtilityClasses$u = (classes, ownerState) => {
56870
57078
  const styleArg = ({
56871
57079
  theme
56872
57080
  }) => _extends({}, theme.typography.caption, {
57081
+ display: "flex",
57082
+ lineHeight: 1,
56873
57083
  width: DAY_SIZE,
56874
57084
  height: DAY_SIZE,
56875
57085
  borderRadius: "50%",
@@ -56938,7 +57148,7 @@ const overridesResolver$1 = (props, styles2) => {
56938
57148
  const {
56939
57149
  ownerState
56940
57150
  } = props;
56941
- return [styles2.root, !ownerState.disableMargin && styles2.dayWithMargin, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles2.today, !ownerState.isDayOutsideMonth && ownerState.showDaysOutsideCurrentMonth && styles2.dayOutsideMonth, ownerState.isDayOutsideMonth && !ownerState.showDaysOutsideCurrentMonth && styles2.hiddenDaySpacingFiller];
57151
+ return [styles2.root, !ownerState.disableMargin && styles2.dayWithMargin, !ownerState.disableHighlightToday && ownerState.isDayCurrent && styles2.today, ownerState.isDayOutsideMonth && ownerState.showDaysOutsideCurrentMonth && styles2.dayOutsideMonth, ownerState.isDayOutsideMonth && !ownerState.showDaysOutsideCurrentMonth && styles2.hiddenDaySpacingFiller];
56942
57152
  };
56943
57153
  const PickersDayRoot = styled(ButtonBase, {
56944
57154
  name: "MuiPickersDay",
@@ -57632,6 +57842,11 @@ function DayCalendar(inProps) {
57632
57842
  focusDay(adapter.addMonths(day, -1));
57633
57843
  event.preventDefault();
57634
57844
  break;
57845
+ case "Enter":
57846
+ case " ":
57847
+ handleDaySelect(day);
57848
+ event.preventDefault();
57849
+ break;
57635
57850
  }
57636
57851
  });
57637
57852
  const handleFocus = useEventCallback((event, day) => focusDay(day));
@@ -57967,12 +58182,13 @@ const MonthCalendar = /* @__PURE__ */ React.forwardRef(function MonthCalendar2(i
57967
58182
  }
57968
58183
  return shouldDisableMonth(monthToValidate);
57969
58184
  }, [disableFuture, disablePast, maxDate, minDate, now, shouldDisableMonth, adapter]);
57970
- const handleMonthSelection = useEventCallback((event, month) => {
58185
+ const handleMonthSelection = useEventCallback((_event, month) => {
57971
58186
  if (readOnly) {
57972
58187
  return;
57973
58188
  }
57974
58189
  const currentValue = value && currentMonth && !adapter.isSameYear(value, currentMonth) ? adapter.setYear(value, adapter.getYear(currentMonth)) : value;
57975
- const newDate = adapter.setMonth(currentValue ?? referenceDate, month);
58190
+ const baseDateForMonth = currentValue ?? currentMonth ?? referenceDate;
58191
+ const newDate = adapter.setMonth(baseDateForMonth, month);
57976
58192
  handleValueChange(newDate);
57977
58193
  });
57978
58194
  const focusMonth = useEventCallback((month) => {
@@ -58007,6 +58223,11 @@ const MonthCalendar = /* @__PURE__ */ React.forwardRef(function MonthCalendar2(i
58007
58223
  focusMonth((monthsInYear + month + (isRtl ? -1 : 1)) % monthsInYear);
58008
58224
  event.preventDefault();
58009
58225
  break;
58226
+ case "Enter":
58227
+ case " ":
58228
+ handleMonthSelection(event, month);
58229
+ event.preventDefault();
58230
+ break;
58010
58231
  }
58011
58232
  });
58012
58233
  const handleMonthFocus = useEventCallback((event, month) => {
@@ -58419,7 +58640,7 @@ const YearCalendar = /* @__PURE__ */ React.forwardRef(function YearCalendar2(inP
58419
58640
  const yearToValidate = adapter.startOfYear(dateToValidate);
58420
58641
  return shouldDisableYear(yearToValidate);
58421
58642
  }, [disableFuture, disablePast, maxDate, minDate, now, shouldDisableYear, adapter]);
58422
- const handleYearSelection = useEventCallback((event, year) => {
58643
+ const handleYearSelection = useEventCallback((_event, year) => {
58423
58644
  if (readOnly) {
58424
58645
  return;
58425
58646
  }
@@ -58456,6 +58677,11 @@ const YearCalendar = /* @__PURE__ */ React.forwardRef(function YearCalendar2(inP
58456
58677
  focusYear(year + horizontalDirection);
58457
58678
  event.preventDefault();
58458
58679
  break;
58680
+ case "Enter":
58681
+ case " ":
58682
+ handleYearSelection(event, year);
58683
+ event.preventDefault();
58684
+ break;
58459
58685
  }
58460
58686
  });
58461
58687
  const handleYearFocus = useEventCallback((event, year) => {
@@ -59072,7 +59298,10 @@ process.env.NODE_ENV !== "production" ? PickersCalendarHeader.propTypes = {
59072
59298
  view: PropTypes.oneOf(["day", "month", "year"]).isRequired,
59073
59299
  views: PropTypes.arrayOf(PropTypes.oneOf(["day", "month", "year"]).isRequired).isRequired
59074
59300
  } : void 0;
59075
- const PickerViewRoot = styled("div")({
59301
+ const PickerViewRoot = styled("div", {
59302
+ slot: "internal",
59303
+ shouldForwardProp: void 0
59304
+ })({
59076
59305
  overflow: "hidden",
59077
59306
  width: DIALOG_WIDTH,
59078
59307
  maxHeight: VIEW_HEIGHT,
@@ -59872,7 +60101,7 @@ DesktopDatePicker.propTypes = {
59872
60101
  * @param {TValue} value The value that was just accepted.
59873
60102
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
59874
60103
  * - `validationError`: validation result of the current value
59875
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
60104
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
59876
60105
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
59877
60106
  */
59878
60107
  onAccept: PropTypes.func,
@@ -60170,15 +60399,14 @@ process.env.NODE_ENV !== "production" ? DialogContent.propTypes = {
60170
60399
  function getDialogUtilityClass(slot) {
60171
60400
  return generateUtilityClass("MuiDialog", slot);
60172
60401
  }
60173
- const dialogClasses = generateUtilityClasses("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]);
60402
+ const dialogClasses = generateUtilityClasses("MuiDialog", ["root", "backdrop", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]);
60174
60403
  const DialogContext = /* @__PURE__ */ React.createContext({});
60175
60404
  if (process.env.NODE_ENV !== "production") {
60176
60405
  DialogContext.displayName = "DialogContext";
60177
60406
  }
60178
60407
  const DialogBackdrop = styled(Backdrop, {
60179
60408
  name: "MuiDialog",
60180
- slot: "Backdrop",
60181
- overrides: (props, styles2) => styles2.backdrop
60409
+ slot: "Backdrop"
60182
60410
  })({
60183
60411
  // Improve scrollable dialog support.
60184
60412
  zIndex: -1
@@ -60193,6 +60421,7 @@ const useUtilityClasses$j = (ownerState) => {
60193
60421
  } = ownerState;
60194
60422
  const slots = {
60195
60423
  root: ["root"],
60424
+ backdrop: ["backdrop"],
60196
60425
  container: ["container", `scroll${capitalize(scroll)}`],
60197
60426
  paper: ["paper", `paperScroll${capitalize(scroll)}`, `paperWidth${capitalize(String(maxWidth2))}`, fullWidth && "paperFullWidth", fullScreen && "paperFullScreen"]
60198
60427
  };
@@ -60370,6 +60599,7 @@ const Dialog = /* @__PURE__ */ React.forwardRef(function Dialog2(inProps, ref) {
60370
60599
  open: open2,
60371
60600
  PaperComponent = Paper,
60372
60601
  PaperProps = {},
60602
+ role = "dialog",
60373
60603
  scroll = "paper",
60374
60604
  slots = {},
60375
60605
  slotProps = {},
@@ -60435,14 +60665,24 @@ const Dialog = /* @__PURE__ */ React.forwardRef(function Dialog2(inProps, ref) {
60435
60665
  elementType: DialogBackdrop,
60436
60666
  shouldForwardComponentProp: true,
60437
60667
  externalForwardedProps,
60438
- ownerState
60668
+ ownerState,
60669
+ className: classes.backdrop
60439
60670
  });
60440
60671
  const [PaperSlot, paperSlotProps] = useSlot("paper", {
60441
60672
  elementType: DialogPaper,
60442
60673
  shouldForwardComponentProp: true,
60443
60674
  externalForwardedProps,
60444
60675
  ownerState,
60445
- className: clsx(classes.paper, PaperProps.className)
60676
+ className: classes.paper,
60677
+ additionalProps: {
60678
+ elevation: 24,
60679
+ role,
60680
+ "aria-describedby": ariaDescribedby,
60681
+ "aria-labelledby": ariaLabelledby,
60682
+ "aria-modal": ariaModal,
60683
+ tabIndex: -1,
60684
+ [FOCUSABLE_ATTRIBUTE]: ""
60685
+ }
60446
60686
  });
60447
60687
  const [ContainerSlot, containerSlotProps] = useSlot("container", {
60448
60688
  elementType: DialogContainer,
@@ -60486,11 +60726,6 @@ const Dialog = /* @__PURE__ */ React.forwardRef(function Dialog2(inProps, ref) {
60486
60726
  ...containerSlotProps,
60487
60727
  children: /* @__PURE__ */ jsx(PaperSlot, {
60488
60728
  as: PaperComponent,
60489
- elevation: 24,
60490
- role: "dialog",
60491
- "aria-describedby": ariaDescribedby,
60492
- "aria-labelledby": ariaLabelledby,
60493
- "aria-modal": ariaModal,
60494
60729
  ...paperSlotProps,
60495
60730
  children: /* @__PURE__ */ jsx(DialogContext.Provider, {
60496
60731
  value: dialogContextValue,
@@ -60598,6 +60833,13 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes = {
60598
60833
  * @deprecated Use `slotProps.paper` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
60599
60834
  */
60600
60835
  PaperProps: PropTypes.object,
60836
+ /**
60837
+ * The ARIA role for the dialog element.
60838
+ * The main dialog role is `dialog`, but `alertdialog` can be used if the content of the dialog requires immediate attention.
60839
+ * See https://www.w3.org/TR/wai-aria-1.2/#dialog and https://www.w3.org/TR/wai-aria-1.2/#alertdialog for more details.
60840
+ * @default 'dialog'
60841
+ */
60842
+ role: PropTypes.oneOf(["alertdialog", "dialog"]),
60601
60843
  /**
60602
60844
  * Determine the container for scrolling the dialog.
60603
60845
  * @default 'paper'
@@ -60656,7 +60898,9 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes = {
60656
60898
  */
60657
60899
  TransitionProps: PropTypes.object
60658
60900
  } : void 0;
60659
- const PickersModalDialogRoot = styled(Dialog)({
60901
+ const PickersModalDialogRoot = styled(Dialog, {
60902
+ slot: "internal"
60903
+ })({
60660
60904
  [`& .${dialogClasses.container}`]: {
60661
60905
  outline: 0
60662
60906
  },
@@ -60665,7 +60909,9 @@ const PickersModalDialogRoot = styled(Dialog)({
60665
60909
  minWidth: DIALOG_WIDTH
60666
60910
  }
60667
60911
  });
60668
- const PickersModalDialogContent = styled(DialogContent)({
60912
+ const PickersModalDialogContent = styled(DialogContent, {
60913
+ slot: "internal"
60914
+ })({
60669
60915
  "&:first-of-type": {
60670
60916
  padding: 0
60671
60917
  }
@@ -60760,8 +61006,8 @@ const useMobilePicker = (_ref) => {
60760
61006
  });
60761
61007
  const renderPicker = () => /* @__PURE__ */ jsxs(PickerProvider, _extends({}, providerProps, {
60762
61008
  children: [/* @__PURE__ */ jsx(Field, _extends({}, fieldProps, {
60763
- slots,
60764
- slotProps,
61009
+ slots: _extends({}, slots, fieldProps.slots),
61010
+ slotProps: _extends({}, slotProps, fieldProps.slotProps),
60765
61011
  inputRef
60766
61012
  })), /* @__PURE__ */ jsx(PickersModalDialog, {
60767
61013
  slots,
@@ -60942,7 +61188,7 @@ MobileDatePicker.propTypes = {
60942
61188
  * @param {TValue} value The value that was just accepted.
60943
61189
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
60944
61190
  * - `validationError`: validation result of the current value
60945
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
61191
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
60946
61192
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
60947
61193
  */
60948
61194
  onAccept: PropTypes.func,
@@ -61290,7 +61536,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
61290
61536
  * @param {TValue} value The value that was just accepted.
61291
61537
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
61292
61538
  * - `validationError`: validation result of the current value
61293
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
61539
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
61294
61540
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
61295
61541
  */
61296
61542
  onAccept: PropTypes.func,
@@ -63281,7 +63527,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef(function Tabs2(inProps, ref) {
63281
63527
  slots,
63282
63528
  slotProps: {
63283
63529
  indicator: TabIndicatorProps,
63284
- scrollButton: TabScrollButtonProps,
63530
+ scrollButtons: TabScrollButtonProps,
63285
63531
  ...slotProps
63286
63532
  }
63287
63533
  };
@@ -63313,7 +63559,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef(function Tabs2(inProps, ref) {
63313
63559
  }
63314
63560
  tabMeta = tab ? tab.getBoundingClientRect() : null;
63315
63561
  if (process.env.NODE_ENV !== "production") {
63316
- if (process.env.NODE_ENV !== "test" && !warnedOnceTabPresent && tabMeta && tabMeta.width === 0 && tabMeta.height === 0 && // if the whole Tabs component is hidden, don't warn
63562
+ if (isLayoutSupported() && !warnedOnceTabPresent && tabMeta && tabMeta.width === 0 && tabMeta.height === 0 && // if the whole Tabs component is hidden, don't warn
63317
63563
  tabsMeta.clientWidth !== 0) {
63318
63564
  tabsMeta = null;
63319
63565
  console.error(["MUI: The `value` provided to the Tabs component is invalid.", `The Tab with this \`value\` ("${value}") is not part of the document layout.`, "Make sure the tab item is present in the document or that it's not `display: none`."].join("\n"));
@@ -63608,8 +63854,8 @@ const Tabs = /* @__PURE__ */ React.forwardRef(function Tabs2(inProps, ref) {
63608
63854
  return;
63609
63855
  }
63610
63856
  const list = tabListRef.current;
63611
- const currentFocus = ownerDocument(list).activeElement;
63612
- const role = currentFocus.getAttribute("role");
63857
+ const currentFocus = activeElement(ownerDocument(list));
63858
+ const role = currentFocus == null ? void 0 : currentFocus.getAttribute("role");
63613
63859
  if (role !== "tab") {
63614
63860
  return;
63615
63861
  }
@@ -65681,6 +65927,19 @@ function getMenuItemUtilityClass(slot) {
65681
65927
  return generateUtilityClass("MuiMenuItem", slot);
65682
65928
  }
65683
65929
  const menuItemClasses = generateUtilityClasses("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divider", "gutters", "selected"]);
65930
+ function focusWithVisible(element, focusSource) {
65931
+ if (focusSource == null) {
65932
+ element.focus();
65933
+ return;
65934
+ }
65935
+ try {
65936
+ element.focus({
65937
+ focusVisible: focusSource === "keyboard"
65938
+ });
65939
+ } catch (error) {
65940
+ element.focus();
65941
+ }
65942
+ }
65684
65943
  const overridesResolver = (props, styles2) => {
65685
65944
  const {
65686
65945
  ownerState
@@ -65826,6 +66085,7 @@ const MenuItem = /* @__PURE__ */ React.forwardRef(function MenuItem2(inProps, re
65826
66085
  className,
65827
66086
  ...other
65828
66087
  } = props;
66088
+ const focusSource = useSelectFocusSource();
65829
66089
  const context = React.useContext(ListContext);
65830
66090
  const childContext = React.useMemo(() => ({
65831
66091
  dense: dense || context.dense || false,
@@ -65835,7 +66095,7 @@ const MenuItem = /* @__PURE__ */ React.forwardRef(function MenuItem2(inProps, re
65835
66095
  useEnhancedEffect(() => {
65836
66096
  if (autoFocus) {
65837
66097
  if (menuItemRef.current) {
65838
- menuItemRef.current.focus();
66098
+ focusWithVisible(menuItemRef.current, focusSource);
65839
66099
  } else if (process.env.NODE_ENV !== "production") {
65840
66100
  console.error("MUI: Unable to set focus to a MenuItem whose component has not been rendered.");
65841
66101
  }
@@ -65849,6 +66109,10 @@ const MenuItem = /* @__PURE__ */ React.forwardRef(function MenuItem2(inProps, re
65849
66109
  };
65850
66110
  const classes = useUtilityClasses$6(props);
65851
66111
  const handleRef = useForkRef(menuItemRef, ref);
66112
+ const {
66113
+ root,
66114
+ ...forwardedClasses
66115
+ } = classes;
65852
66116
  let tabIndex;
65853
66117
  if (!props.disabled) {
65854
66118
  tabIndex = tabIndexProp !== void 0 ? tabIndexProp : -1;
@@ -65864,7 +66128,7 @@ const MenuItem = /* @__PURE__ */ React.forwardRef(function MenuItem2(inProps, re
65864
66128
  className: clsx(classes.root, className),
65865
66129
  ...other,
65866
66130
  ownerState,
65867
- classes
66131
+ classes: forwardedClasses
65868
66132
  })
65869
66133
  });
65870
66134
  });
@@ -66600,9 +66864,10 @@ const getHourSectionOptions = ({
66600
66864
  const isFocused = (hour) => {
66601
66865
  return isSelected(hour, adapter.getHours(valueOrReferenceDate));
66602
66866
  };
66867
+ const labelReferenceDate = adapter.setDate(adapter.setMonth(adapter.startOfDay(now), 0), 15);
66603
66868
  const endHour = ampm ? 11 : 23;
66604
66869
  for (let hour = 0; hour <= endHour; hour += timeStep) {
66605
- let label = adapter.format(adapter.setHours(now, hour), ampm ? "hours12h" : "hours24h");
66870
+ let label = adapter.format(adapter.setHours(labelReferenceDate, hour), ampm ? "hours12h" : "hours24h");
66606
66871
  const ariaLabel = resolveAriaLabel(parseInt(label, 10).toString());
66607
66872
  label = adapter.formatNumber(label);
66608
66873
  result.push({
@@ -67648,7 +67913,7 @@ DesktopDateTimePicker.propTypes = {
67648
67913
  * @param {TValue} value The value that was just accepted.
67649
67914
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
67650
67915
  * - `validationError`: validation result of the current value
67651
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
67916
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
67652
67917
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
67653
67918
  */
67654
67919
  onAccept: PropTypes.func,
@@ -68120,7 +68385,7 @@ MobileDateTimePicker.propTypes = {
68120
68385
  * @param {TValue} value The value that was just accepted.
68121
68386
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
68122
68387
  * - `validationError`: validation result of the current value
68123
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
68388
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
68124
68389
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
68125
68390
  */
68126
68391
  onAccept: PropTypes.func,
@@ -68538,7 +68803,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
68538
68803
  * @param {TValue} value The value that was just accepted.
68539
68804
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
68540
68805
  * - `validationError`: validation result of the current value
68541
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
68806
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
68542
68807
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
68543
68808
  */
68544
68809
  onAccept: PropTypes.func,
@@ -68880,6 +69145,12 @@ const TextFieldDateElement = ({
68880
69145
  )
68881
69146
  ] });
68882
69147
  };
69148
+ function useForcedRerendering() {
69149
+ const [, setState] = React.useState({});
69150
+ return React.useCallback(() => {
69151
+ setState({});
69152
+ }, []);
69153
+ }
68883
69154
  function usePreviousProps(value) {
68884
69155
  const ref = React.useRef({});
68885
69156
  React.useEffect(() => {
@@ -68932,10 +69203,8 @@ function createFilterOptions(config2 = {}) {
68932
69203
  }
68933
69204
  const defaultFilterOptions = createFilterOptions();
68934
69205
  const pageSize = 5;
68935
- const defaultIsActiveElementInListbox = (listboxRef) => {
68936
- var _a;
68937
- return listboxRef.current !== null && ((_a = listboxRef.current.parentElement) == null ? void 0 : _a.contains(document.activeElement));
68938
- };
69206
+ const defaultIsActiveElementInListbox = (listboxRef) => listboxRef.current !== null && contains(listboxRef.current.parentElement, document.activeElement);
69207
+ const defaultIsOptionEqualToValue = (option, value) => option === value;
68939
69208
  const MULTIPLE_DEFAULT_VALUE = [];
68940
69209
  function getInputValue(value, multiple, getOptionLabel, renderValue) {
68941
69210
  if (multiple || value == null || renderValue) {
@@ -68974,7 +69243,7 @@ function useAutocomplete(props) {
68974
69243
  id: idProp,
68975
69244
  includeInputInList = false,
68976
69245
  inputValue: inputValueProp,
68977
- isOptionEqualToValue = (option, value2) => option === value2,
69246
+ isOptionEqualToValue = defaultIsOptionEqualToValue,
68978
69247
  multiple = false,
68979
69248
  onChange,
68980
69249
  onClose,
@@ -69006,10 +69275,14 @@ function useAutocomplete(props) {
69006
69275
  const firstFocus = React.useRef(true);
69007
69276
  const inputRef = React.useRef(null);
69008
69277
  const listboxRef = React.useRef(null);
69278
+ const windowLostFocus = React.useRef(false);
69009
69279
  const [anchorEl, setAnchorEl] = React.useState(null);
69010
69280
  const [focusedItem, setFocusedItem] = React.useState(-1);
69011
69281
  const defaultHighlighted = autoHighlight ? 0 : -1;
69012
69282
  const highlightedIndexRef = React.useRef(defaultHighlighted);
69283
+ const highlightReasonRef = React.useRef(null);
69284
+ const touchScrolledRef = React.useRef(false);
69285
+ const isTouchRef = React.useRef(false);
69013
69286
  const initialInputValue = React.useRef(getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel)).current;
69014
69287
  const [value, setValueState] = useControlled({
69015
69288
  controlled: valueProp,
@@ -69024,8 +69297,8 @@ function useAutocomplete(props) {
69024
69297
  });
69025
69298
  const [focused, setFocused] = React.useState(false);
69026
69299
  const resetInputValue = React.useCallback((event, newValue, reason) => {
69027
- const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;
69028
- if (!isOptionSelected && !clearOnBlur) {
69300
+ const isOptionSelected2 = multiple ? value.length < newValue.length : newValue !== null;
69301
+ if (!isOptionSelected2 && !clearOnBlur) {
69029
69302
  return;
69030
69303
  }
69031
69304
  const newInputValue = getInputValue(newValue, multiple, getOptionLabel, renderValue);
@@ -69046,9 +69319,30 @@ function useAutocomplete(props) {
69046
69319
  const [inputPristine, setInputPristine] = React.useState(true);
69047
69320
  const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);
69048
69321
  const popupOpen = open2 && !readOnly;
69322
+ const selectedValues = React.useMemo(() => {
69323
+ if (multiple) {
69324
+ return value;
69325
+ }
69326
+ if (value != null) {
69327
+ return [value];
69328
+ }
69329
+ return [];
69330
+ }, [multiple, value]);
69331
+ const selectedValuesSet = React.useMemo(() => {
69332
+ if (isOptionEqualToValue !== defaultIsOptionEqualToValue || selectedValues.length === 0) {
69333
+ return null;
69334
+ }
69335
+ return new Set(selectedValues);
69336
+ }, [isOptionEqualToValue, selectedValues]);
69337
+ const isOptionSelected = React.useCallback((option) => {
69338
+ if (selectedValuesSet) {
69339
+ return selectedValuesSet.has(option);
69340
+ }
69341
+ return selectedValues.some((value2) => value2 != null && isOptionEqualToValue(option, value2));
69342
+ }, [isOptionEqualToValue, selectedValues, selectedValuesSet]);
69049
69343
  const filteredOptions = popupOpen ? filterOptions(
69050
69344
  options.filter((option) => {
69051
- if (filterSelectedOptions && (multiple ? value : [value]).some((value2) => value2 !== null && isOptionEqualToValue(option, value2))) {
69345
+ if (filterSelectedOptions && isOptionSelected(option)) {
69052
69346
  return false;
69053
69347
  }
69054
69348
  return true;
@@ -69111,20 +69405,16 @@ function useAutocomplete(props) {
69111
69405
  }
69112
69406
  }
69113
69407
  }
69114
- const setHighlightedIndex = useEventCallback(({
69115
- event,
69408
+ const syncHighlightedIndexToDOM = useEventCallback(({
69116
69409
  index,
69117
- reason
69410
+ reason,
69411
+ preserveScroll = false
69118
69412
  }) => {
69119
- highlightedIndexRef.current = index;
69120
69413
  if (index === -1) {
69121
69414
  inputRef.current.removeAttribute("aria-activedescendant");
69122
69415
  } else {
69123
69416
  inputRef.current.setAttribute("aria-activedescendant", `${id}-option-${index}`);
69124
69417
  }
69125
- if (onHighlightChange && ["mouse", "keyboard", "touch"].includes(reason)) {
69126
- onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
69127
- }
69128
69418
  if (!listboxRef.current) {
69129
69419
  return;
69130
69420
  }
@@ -69141,7 +69431,9 @@ function useAutocomplete(props) {
69141
69431
  return;
69142
69432
  }
69143
69433
  if (index === -1) {
69144
- listboxNode.scrollTop = 0;
69434
+ if (!preserveScroll) {
69435
+ listboxNode.scrollTop = 0;
69436
+ }
69145
69437
  return;
69146
69438
  }
69147
69439
  const option = listboxRef.current.querySelector(`[data-option-index="${index}"]`);
@@ -69163,15 +69455,46 @@ function useAutocomplete(props) {
69163
69455
  }
69164
69456
  }
69165
69457
  });
69458
+ const setHighlightedIndex = useEventCallback(({
69459
+ event,
69460
+ index,
69461
+ reason,
69462
+ preserveScroll = false
69463
+ }) => {
69464
+ highlightedIndexRef.current = index;
69465
+ highlightReasonRef.current = reason ?? null;
69466
+ if (onHighlightChange && ["mouse", "keyboard", "touch"].includes(reason)) {
69467
+ onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
69468
+ }
69469
+ syncHighlightedIndexToDOM({
69470
+ index,
69471
+ reason,
69472
+ preserveScroll
69473
+ });
69474
+ });
69475
+ const setHighlightedIndexFromSync = useEventCallback(({
69476
+ index
69477
+ }) => {
69478
+ highlightedIndexRef.current = index;
69479
+ syncHighlightedIndexToDOM({
69480
+ index,
69481
+ reason: highlightReasonRef.current
69482
+ });
69483
+ });
69166
69484
  const changeHighlightedIndex = useEventCallback(({
69167
69485
  event,
69168
69486
  diff,
69169
69487
  direction = "next",
69170
- reason
69488
+ reason,
69489
+ preserveScroll
69171
69490
  }) => {
69172
69491
  if (!popupOpen) {
69173
69492
  return;
69174
69493
  }
69494
+ if (reason === "keyboard") {
69495
+ touchScrolledRef.current = false;
69496
+ isTouchRef.current = false;
69497
+ }
69175
69498
  const getNextIndex = () => {
69176
69499
  const maxIndex = filteredOptions.length - 1;
69177
69500
  if (diff === "reset") {
@@ -69208,7 +69531,8 @@ function useAutocomplete(props) {
69208
69531
  setHighlightedIndex({
69209
69532
  index: nextIndex,
69210
69533
  reason,
69211
- event
69534
+ event,
69535
+ preserveScroll
69212
69536
  });
69213
69537
  if (autoComplete && diff !== "reset") {
69214
69538
  if (nextIndex === -1) {
@@ -69249,18 +69573,23 @@ function useAutocomplete(props) {
69249
69573
  return -1;
69250
69574
  };
69251
69575
  const syncHighlightedIndex = React.useCallback(() => {
69576
+ var _a, _b;
69252
69577
  if (!popupOpen) {
69253
69578
  return;
69254
69579
  }
69255
69580
  const previousHighlightedOptionIndex = getPreviousHighlightedOptionIndex();
69256
69581
  if (previousHighlightedOptionIndex !== -1) {
69257
- highlightedIndexRef.current = previousHighlightedOptionIndex;
69582
+ setHighlightedIndexFromSync({
69583
+ index: previousHighlightedOptionIndex
69584
+ });
69258
69585
  return;
69259
69586
  }
69260
69587
  const valueItem = multiple ? value[0] : value;
69261
69588
  if (filteredOptions.length === 0 || valueItem == null) {
69589
+ const isAppendOnly = filteredOptionsChanged && previousProps.inputValue === inputValue && ((_a = previousProps.filteredOptions) == null ? void 0 : _a.length) > 0 && filteredOptions.length > previousProps.filteredOptions.length && previousProps.filteredOptions.every((option, index) => getOptionLabel(option) === getOptionLabel(filteredOptions[index]));
69262
69590
  changeHighlightedIndex({
69263
- diff: "reset"
69591
+ diff: "reset",
69592
+ preserveScroll: isAppendOnly
69264
69593
  });
69265
69594
  return;
69266
69595
  }
@@ -69269,7 +69598,10 @@ function useAutocomplete(props) {
69269
69598
  }
69270
69599
  if (valueItem != null) {
69271
69600
  const currentOption = filteredOptions[highlightedIndexRef.current];
69272
- if (multiple && currentOption && value.findIndex((val) => isOptionEqualToValue(currentOption, val)) !== -1) {
69601
+ if (multiple && currentOption && value.findIndex((val) => isOptionEqualToValue(currentOption, val)) !== -1 && ((_b = previousProps.filteredOptions) == null ? void 0 : _b.length) > 0) {
69602
+ setHighlightedIndexFromSync({
69603
+ index: highlightedIndexRef.current
69604
+ });
69273
69605
  return;
69274
69606
  }
69275
69607
  const itemIndex = filteredOptions.findIndex((optionItem) => isOptionEqualToValue(optionItem, valueItem));
@@ -69299,9 +69631,9 @@ function useAutocomplete(props) {
69299
69631
  // Don't sync the highlighted index with the value when multiple
69300
69632
  // eslint-disable-next-line react-hooks/exhaustive-deps
69301
69633
  multiple ? false : value,
69302
- filterSelectedOptions,
69303
69634
  changeHighlightedIndex,
69304
69635
  setHighlightedIndex,
69636
+ setHighlightedIndexFromSync,
69305
69637
  popupOpen,
69306
69638
  inputValue,
69307
69639
  multiple
@@ -69325,16 +69657,29 @@ function useAutocomplete(props) {
69325
69657
  }, [componentName]);
69326
69658
  }
69327
69659
  React.useEffect(() => {
69328
- if (filteredOptionsChanged || popupOpen) {
69660
+ if (filteredOptionsChanged || popupOpen && !disableCloseOnSelect) {
69329
69661
  syncHighlightedIndex();
69330
69662
  }
69331
- }, [syncHighlightedIndex, filteredOptionsChanged, popupOpen]);
69663
+ }, [syncHighlightedIndex, filteredOptionsChanged, popupOpen, disableCloseOnSelect]);
69664
+ React.useEffect(() => {
69665
+ if (typeof window === "undefined") {
69666
+ return void 0;
69667
+ }
69668
+ const handleWindowBlur = () => {
69669
+ windowLostFocus.current = true;
69670
+ };
69671
+ window.addEventListener("blur", handleWindowBlur);
69672
+ return () => {
69673
+ window.removeEventListener("blur", handleWindowBlur);
69674
+ };
69675
+ }, []);
69332
69676
  const handleOpen = (event) => {
69333
69677
  if (open2) {
69334
69678
  return;
69335
69679
  }
69336
69680
  setOpenState(true);
69337
69681
  setInputPristine(true);
69682
+ isTouchRef.current = false;
69338
69683
  if (onOpen) {
69339
69684
  onOpen(event);
69340
69685
  }
@@ -69344,6 +69689,8 @@ function useAutocomplete(props) {
69344
69689
  return;
69345
69690
  }
69346
69691
  setOpenState(false);
69692
+ touchScrolledRef.current = false;
69693
+ highlightReasonRef.current = null;
69347
69694
  if (onClose) {
69348
69695
  onClose(event, reason);
69349
69696
  }
@@ -69361,7 +69708,6 @@ function useAutocomplete(props) {
69361
69708
  }
69362
69709
  setValueState(newValue);
69363
69710
  };
69364
- const isTouch = React.useRef(false);
69365
69711
  const selectNewValue = (event, option, reasonProp = "selectOption", origin = "options") => {
69366
69712
  let reason = reasonProp;
69367
69713
  let newValue = option;
@@ -69388,7 +69734,7 @@ function useAutocomplete(props) {
69388
69734
  if (!disableCloseOnSelect && (!event || !event.ctrlKey && !event.metaKey)) {
69389
69735
  handleClose(event, reason);
69390
69736
  }
69391
- if (blurOnSelect === true || blurOnSelect === "touch" && isTouch.current || blurOnSelect === "mouse" && !isTouch.current) {
69737
+ if (blurOnSelect === true || blurOnSelect === "touch" && isTouchRef.current || blurOnSelect === "mouse" && !isTouchRef.current) {
69392
69738
  inputRef.current.blur();
69393
69739
  }
69394
69740
  };
@@ -69418,9 +69764,13 @@ function useAutocomplete(props) {
69418
69764
  handleClose(event, "toggleInput");
69419
69765
  }
69420
69766
  let nextItem2 = focusedItem;
69421
- if (focusedItem === -1) {
69422
- if (inputValue === "" && direction === "previous") {
69423
- nextItem2 = value.length - 1;
69767
+ if (focusedItem === -1 && direction === "previous") {
69768
+ nextItem2 = value.length - 1;
69769
+ if (freeSolo && inputValue !== "") {
69770
+ setInputValueState("");
69771
+ if (onInputChange) {
69772
+ onInputChange(event, "", "reset");
69773
+ }
69424
69774
  }
69425
69775
  } else {
69426
69776
  nextItem2 += direction === "next" ? 1 : -1;
@@ -69518,22 +69868,39 @@ function useAutocomplete(props) {
69518
69868
  });
69519
69869
  handleOpen(event);
69520
69870
  break;
69521
- case "ArrowLeft":
69522
- if (!multiple && renderValue) {
69871
+ case "ArrowLeft": {
69872
+ const input = inputRef.current;
69873
+ const caretAtStart = input && input.selectionStart === 0 && input.selectionEnd === 0;
69874
+ if (!caretAtStart) {
69875
+ return;
69876
+ }
69877
+ if (!multiple && renderValue && value != null) {
69878
+ if (freeSolo && inputValue !== "") {
69879
+ setInputValueState("");
69880
+ if (onInputChange) {
69881
+ onInputChange(event, "", "reset");
69882
+ }
69883
+ }
69884
+ setFocusedItem(0);
69523
69885
  focusItem(0);
69524
69886
  } else {
69525
69887
  handleFocusItem(event, "previous");
69526
69888
  }
69527
69889
  break;
69890
+ }
69528
69891
  case "ArrowRight":
69529
69892
  if (!multiple && renderValue) {
69893
+ setFocusedItem(-1);
69530
69894
  focusItem(-1);
69531
69895
  } else {
69532
69896
  handleFocusItem(event, "next");
69533
69897
  }
69534
69898
  break;
69535
- case "Enter":
69536
- if (highlightedIndexRef.current !== -1 && popupOpen) {
69899
+ case "Enter": {
69900
+ const shouldSelectHighlighted = !freeSolo || inputPristine || highlightReasonRef.current !== null;
69901
+ if (highlightedIndexRef.current !== -1 && popupOpen && shouldSelectHighlighted && // After a touch-scroll the highlight is stale (the user scrolled
69902
+ // past it), so skip selection until the next deliberate interaction.
69903
+ !touchScrolledRef.current) {
69537
69904
  const option = filteredOptions[highlightedIndexRef.current];
69538
69905
  const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
69539
69906
  event.preventDefault();
@@ -69549,8 +69916,12 @@ function useAutocomplete(props) {
69549
69916
  event.preventDefault();
69550
69917
  }
69551
69918
  selectNewValue(event, inputValue, "createOption", "freeSolo");
69919
+ } else if (popupOpen && touchScrolledRef.current) {
69920
+ event.preventDefault();
69921
+ handleClose(event, "escape");
69552
69922
  }
69553
69923
  break;
69924
+ }
69554
69925
  case "Escape":
69555
69926
  if (popupOpen) {
69556
69927
  event.preventDefault();
@@ -69571,9 +69942,10 @@ function useAutocomplete(props) {
69571
69942
  option: value[index]
69572
69943
  });
69573
69944
  }
69574
- if (!multiple && renderValue && !readOnly) {
69575
- setValueState(null);
69576
- focusItem(-1);
69945
+ if (!multiple && renderValue && !readOnly && inputValue === "") {
69946
+ handleValue(event, null, "removeOption", {
69947
+ option: value
69948
+ });
69577
69949
  }
69578
69950
  break;
69579
69951
  case "Delete":
@@ -69585,9 +69957,10 @@ function useAutocomplete(props) {
69585
69957
  option: value[index]
69586
69958
  });
69587
69959
  }
69588
- if (!multiple && renderValue && !readOnly) {
69589
- setValueState(null);
69590
- focusItem(-1);
69960
+ if (!multiple && renderValue && !readOnly && inputValue === "") {
69961
+ handleValue(event, null, "removeOption", {
69962
+ option: value
69963
+ });
69591
69964
  }
69592
69965
  break;
69593
69966
  }
@@ -69595,6 +69968,14 @@ function useAutocomplete(props) {
69595
69968
  };
69596
69969
  const handleFocus = (event) => {
69597
69970
  setFocused(true);
69971
+ if (focusedItem !== -1) {
69972
+ setFocusedItem(-1);
69973
+ focusItem(-1);
69974
+ }
69975
+ if (windowLostFocus.current) {
69976
+ windowLostFocus.current = false;
69977
+ return;
69978
+ }
69598
69979
  if (openOnFocus && !ignoreFocus.current) {
69599
69980
  handleOpen(event);
69600
69981
  }
@@ -69607,7 +69988,7 @@ function useAutocomplete(props) {
69607
69988
  setFocused(false);
69608
69989
  firstFocus.current = true;
69609
69990
  ignoreFocus.current = false;
69610
- if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
69991
+ if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen && highlightReasonRef.current !== "mouse" && highlightReasonRef.current !== "touch") {
69611
69992
  selectNewValue(event, filteredOptions[highlightedIndexRef.current], "blur");
69612
69993
  } else if (autoSelect && freeSolo && inputValue !== "") {
69613
69994
  selectNewValue(event, inputValue, "blur", "freeSolo");
@@ -69618,20 +69999,24 @@ function useAutocomplete(props) {
69618
69999
  };
69619
70000
  const handleInputChange = (event) => {
69620
70001
  const newValue = event.target.value;
69621
- if (inputValue !== newValue) {
70002
+ const valueChanged = inputValue !== newValue;
70003
+ if (valueChanged) {
69622
70004
  setInputValueState(newValue);
69623
- setInputPristine(false);
70005
+ touchScrolledRef.current = false;
69624
70006
  if (onInputChange) {
69625
70007
  onInputChange(event, newValue, "input");
69626
70008
  }
69627
70009
  }
69628
70010
  if (newValue === "") {
69629
- if (!disableClearable && !multiple) {
70011
+ if (!disableClearable && !multiple && !renderValue) {
69630
70012
  handleValue(event, null, "clear");
69631
70013
  }
69632
70014
  } else {
69633
70015
  handleOpen(event);
69634
70016
  }
70017
+ if (valueChanged) {
70018
+ setInputPristine(false);
70019
+ }
69635
70020
  };
69636
70021
  const handleOptionMouseMove = (event) => {
69637
70022
  const index = Number(event.currentTarget.getAttribute("data-option-index"));
@@ -69641,20 +70026,26 @@ function useAutocomplete(props) {
69641
70026
  index,
69642
70027
  reason: "mouse"
69643
70028
  });
70029
+ } else {
70030
+ highlightReasonRef.current = "mouse";
70031
+ }
70032
+ if (!isTouchRef.current) {
70033
+ touchScrolledRef.current = false;
69644
70034
  }
69645
70035
  };
69646
70036
  const handleOptionTouchStart = (event) => {
70037
+ touchScrolledRef.current = false;
69647
70038
  setHighlightedIndex({
69648
70039
  event,
69649
70040
  index: Number(event.currentTarget.getAttribute("data-option-index")),
69650
70041
  reason: "touch"
69651
70042
  });
69652
- isTouch.current = true;
70043
+ isTouchRef.current = true;
69653
70044
  };
69654
70045
  const handleOptionClick = (event) => {
69655
70046
  const index = Number(event.currentTarget.getAttribute("data-option-index"));
69656
70047
  selectNewValue(event, filteredOptions[index], "selectOption");
69657
- isTouch.current = false;
70048
+ isTouchRef.current = false;
69658
70049
  };
69659
70050
  const handleItemDelete = (index) => (event) => {
69660
70051
  const newValue = value.slice();
@@ -69676,7 +70067,10 @@ function useAutocomplete(props) {
69676
70067
  }
69677
70068
  };
69678
70069
  const handleMouseDown = (event) => {
69679
- if (!event.currentTarget.contains(event.target)) {
70070
+ if (!contains(event.currentTarget, event.target)) {
70071
+ return;
70072
+ }
70073
+ if (anchorEl && !contains(anchorEl, event.target)) {
69680
70074
  return;
69681
70075
  }
69682
70076
  if (event.target.getAttribute("id") !== id) {
@@ -69684,7 +70078,10 @@ function useAutocomplete(props) {
69684
70078
  }
69685
70079
  };
69686
70080
  const handleClick = (event) => {
69687
- if (!event.currentTarget.contains(event.target)) {
70081
+ if (!contains(event.currentTarget, event.target)) {
70082
+ return;
70083
+ }
70084
+ if (anchorEl && !contains(anchorEl, event.target)) {
69688
70085
  return;
69689
70086
  }
69690
70087
  inputRef.current.focus();
@@ -69803,16 +70200,22 @@ function useAutocomplete(props) {
69803
70200
  role: "listbox",
69804
70201
  id: `${id}-listbox`,
69805
70202
  "aria-labelledby": `${id}-label`,
70203
+ "aria-multiselectable": multiple || void 0,
69806
70204
  ref: handleListboxRef,
69807
70205
  onMouseDown: (event) => {
69808
70206
  event.preventDefault();
70207
+ },
70208
+ onScroll: () => {
70209
+ if (isTouchRef.current) {
70210
+ touchScrolledRef.current = true;
70211
+ }
69809
70212
  }
69810
70213
  }),
69811
70214
  getOptionProps: ({
69812
70215
  index,
69813
70216
  option
69814
70217
  }) => {
69815
- const selected = (multiple ? value : [value]).some((value2) => value2 != null && isOptionEqualToValue(option, value2));
70218
+ const selected = isOptionSelected(option);
69816
70219
  const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
69817
70220
  return {
69818
70221
  key: (getOptionKey == null ? void 0 : getOptionKey(option)) ?? getOptionLabel(option),
@@ -70473,6 +70876,36 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70473
70876
  ...props,
70474
70877
  componentName: "Autocomplete"
70475
70878
  });
70879
+ const forceRenderOnResize = useForcedRerendering();
70880
+ React.useEffect(() => {
70881
+ if (!popupOpen || !anchorEl || typeof ResizeObserver === "undefined") {
70882
+ return void 0;
70883
+ }
70884
+ let lastWidth = anchorEl.clientWidth;
70885
+ const observer = new ResizeObserver(() => {
70886
+ const newWidth = anchorEl.clientWidth;
70887
+ if (lastWidth !== newWidth) {
70888
+ lastWidth = newWidth;
70889
+ forceRenderOnResize();
70890
+ }
70891
+ });
70892
+ observer.observe(anchorEl);
70893
+ return () => {
70894
+ observer.disconnect();
70895
+ };
70896
+ }, [popupOpen, anchorEl, forceRenderOnResize]);
70897
+ const previousGroupedOptionsRef = React.useRef([]);
70898
+ const prevPopupOpenRef = React.useRef(false);
70899
+ const renderedOptions = popupOpen ? groupedOptions : previousGroupedOptionsRef.current;
70900
+ useEnhancedEffect(() => {
70901
+ if (popupOpen && !prevPopupOpenRef.current) {
70902
+ previousGroupedOptionsRef.current = [];
70903
+ }
70904
+ prevPopupOpenRef.current = popupOpen;
70905
+ if (popupOpen && groupedOptions.length > 0) {
70906
+ previousGroupedOptionsRef.current = groupedOptions;
70907
+ }
70908
+ }, [popupOpen, groupedOptions]);
70476
70909
  const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
70477
70910
  const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
70478
70911
  const {
@@ -70511,6 +70944,17 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70511
70944
  ...slotProps
70512
70945
  }
70513
70946
  };
70947
+ const [RootSlot, rootProps] = useSlot("root", {
70948
+ ref,
70949
+ className: [classes.root, className],
70950
+ elementType: AutocompleteRoot,
70951
+ externalForwardedProps: {
70952
+ ...externalForwardedProps,
70953
+ ...other
70954
+ },
70955
+ getSlotProps: getRootProps,
70956
+ ownerState
70957
+ });
70514
70958
  const [ListboxSlot, listboxProps] = useSlot("listbox", {
70515
70959
  elementType: AutocompleteListbox,
70516
70960
  externalForwardedProps,
@@ -70533,13 +70977,43 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70533
70977
  additionalProps: {
70534
70978
  disablePortal,
70535
70979
  style: {
70536
- width: anchorEl ? anchorEl.clientWidth : null
70980
+ width: anchorEl ? anchorEl.clientWidth : null,
70981
+ // Prevent interaction with stale cached options during exit transitions.
70982
+ // The hook's filteredOptions is [] when popupOpen=false, so clicks on stale
70983
+ // rendered options would pass undefined to selectNewValue.
70984
+ pointerEvents: popupOpen ? void 0 : "none"
70537
70985
  },
70538
70986
  role: "presentation",
70539
70987
  anchorEl,
70540
70988
  open: popupOpen
70541
70989
  }
70542
70990
  });
70991
+ const hasPopupContent = renderedOptions.length > 0 || loading || !freeSolo || popperProps.keepMounted === true;
70992
+ const [ClearIndicatorSlot, clearIndicatorProps] = useSlot("clearIndicator", {
70993
+ elementType: AutocompleteClearIndicator,
70994
+ externalForwardedProps,
70995
+ ownerState,
70996
+ className: classes.clearIndicator,
70997
+ shouldForwardComponentProp: true,
70998
+ additionalProps: {
70999
+ ...getClearProps(),
71000
+ "aria-label": clearText,
71001
+ title: clearText
71002
+ }
71003
+ });
71004
+ const [PopupIndicatorSlot, popupIndicatorProps] = useSlot("popupIndicator", {
71005
+ elementType: AutocompletePopupIndicator,
71006
+ externalForwardedProps,
71007
+ ownerState,
71008
+ className: classes.popupIndicator,
71009
+ shouldForwardComponentProp: true,
71010
+ additionalProps: {
71011
+ ...getPopupIndicatorProps(),
71012
+ disabled,
71013
+ "aria-label": popupOpen ? closeText : openText,
71014
+ title: popupOpen ? closeText : openText
71015
+ }
71016
+ });
70543
71017
  let startAdornment;
70544
71018
  const getCustomizedItemProps = (params) => ({
70545
71019
  className: classes.tag,
@@ -70620,18 +71094,13 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70620
71094
  inputValue
70621
71095
  }, ownerState);
70622
71096
  };
70623
- const clearIndicatorSlotProps = externalForwardedProps.slotProps.clearIndicator;
70624
- const popupIndicatorSlotProps = externalForwardedProps.slotProps.popupIndicator;
70625
71097
  return /* @__PURE__ */ jsxs(React.Fragment, {
70626
- children: [/* @__PURE__ */ jsx(AutocompleteRoot, {
70627
- ref,
70628
- className: clsx(classes.root, className),
70629
- ownerState,
70630
- ...getRootProps(other),
71098
+ children: [/* @__PURE__ */ jsx(RootSlot, {
71099
+ ...rootProps,
70631
71100
  children: renderInput({
70632
71101
  id,
70633
71102
  disabled,
70634
- fullWidth: true,
71103
+ fullWidth: props.fullWidth ?? true,
70635
71104
  size: size === "small" ? "small" : void 0,
70636
71105
  InputLabelProps: getInputLabelProps(),
70637
71106
  InputProps: {
@@ -70647,22 +71116,11 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70647
71116
  endAdornment: /* @__PURE__ */ jsxs(AutocompleteEndAdornment, {
70648
71117
  className: classes.endAdornment,
70649
71118
  ownerState,
70650
- children: [hasClearIcon ? /* @__PURE__ */ jsx(AutocompleteClearIndicator, {
70651
- ...getClearProps(),
70652
- "aria-label": clearText,
70653
- title: clearText,
70654
- ownerState,
70655
- ...clearIndicatorSlotProps,
70656
- className: clsx(classes.clearIndicator, clearIndicatorSlotProps == null ? void 0 : clearIndicatorSlotProps.className),
71119
+ children: [hasClearIcon ? /* @__PURE__ */ jsx(ClearIndicatorSlot, {
71120
+ ...clearIndicatorProps,
70657
71121
  children: clearIcon
70658
- }) : null, hasPopupIcon ? /* @__PURE__ */ jsx(AutocompletePopupIndicator, {
70659
- ...getPopupIndicatorProps(),
70660
- disabled,
70661
- "aria-label": popupOpen ? closeText : openText,
70662
- title: popupOpen ? closeText : openText,
70663
- ownerState,
70664
- ...popupIndicatorSlotProps,
70665
- className: clsx(classes.popupIndicator, popupIndicatorSlotProps == null ? void 0 : popupIndicatorSlotProps.className),
71122
+ }) : null, hasPopupIcon ? /* @__PURE__ */ jsx(PopupIndicatorSlot, {
71123
+ ...popupIndicatorProps,
70666
71124
  children: popupIcon
70667
71125
  }) : null]
70668
71126
  })
@@ -70675,17 +71133,17 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70675
71133
  ...getInputProps()
70676
71134
  }
70677
71135
  })
70678
- }), anchorEl ? /* @__PURE__ */ jsx(AutocompletePopper, {
71136
+ }), anchorEl && hasPopupContent ? /* @__PURE__ */ jsx(AutocompletePopper, {
70679
71137
  as: PopperSlot,
70680
71138
  ...popperProps,
70681
71139
  children: /* @__PURE__ */ jsxs(AutocompletePaper, {
70682
71140
  as: PaperSlot,
70683
71141
  ...paperProps,
70684
- children: [loading && groupedOptions.length === 0 ? /* @__PURE__ */ jsx(AutocompleteLoading, {
71142
+ children: [loading && renderedOptions.length === 0 ? /* @__PURE__ */ jsx(AutocompleteLoading, {
70685
71143
  className: classes.loading,
70686
71144
  ownerState,
70687
71145
  children: loadingText
70688
- }) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /* @__PURE__ */ jsx(AutocompleteNoOptions, {
71146
+ }) : null, renderedOptions.length === 0 && !freeSolo && !loading ? /* @__PURE__ */ jsx(AutocompleteNoOptions, {
70689
71147
  className: classes.noOptions,
70690
71148
  ownerState,
70691
71149
  role: "presentation",
@@ -70693,10 +71151,9 @@ const Autocomplete = /* @__PURE__ */ React.forwardRef(function Autocomplete2(inP
70693
71151
  event.preventDefault();
70694
71152
  },
70695
71153
  children: noOptionsText
70696
- }) : null, groupedOptions.length > 0 ? /* @__PURE__ */ jsx(ListboxSlot, {
70697
- as: ListboxComponentProp,
71154
+ }) : null, renderedOptions.length > 0 ? /* @__PURE__ */ jsx(ListboxSlot, {
70698
71155
  ...listboxProps,
70699
- children: groupedOptions.map((option, index) => {
71156
+ children: renderedOptions.map((option, index) => {
70700
71157
  if (groupBy2) {
70701
71158
  return renderGroup({
70702
71159
  key: option.key,
@@ -70729,12 +71186,11 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes = {
70729
71186
  */
70730
71187
  autoHighlight: PropTypes.bool,
70731
71188
  /**
70732
- * If `true`, the selected option becomes the value of the input
70733
- * when the Autocomplete loses focus unless the user chooses
70734
- * a different option or changes the character string in the input.
71189
+ * If `true`, the value is updated when the input loses focus under one of these conditions:
70735
71190
  *
70736
- * When using the `freeSolo` mode, the typed value will be the input value
70737
- * if the Autocomplete loses focus without highlighting an option.
71191
+ * - An option highlighted via keyboard navigation or `autoHighlight` is selected.
71192
+ * Hover and touch highlights are ignored.
71193
+ * - Otherwise, in `freeSolo` mode, the typed text becomes the value.
70738
71194
  * @default false
70739
71195
  */
70740
71196
  autoSelect: PropTypes.bool,
@@ -71145,16 +71601,20 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes = {
71145
71601
  listbox: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
71146
71602
  paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
71147
71603
  popper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
71148
- popupIndicator: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
71604
+ popupIndicator: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
71605
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
71149
71606
  }),
71150
71607
  /**
71151
71608
  * The components used for each slot inside.
71152
71609
  * @default {}
71153
71610
  */
71154
71611
  slots: PropTypes.shape({
71612
+ clearIndicator: PropTypes.elementType,
71155
71613
  listbox: PropTypes.elementType,
71156
71614
  paper: PropTypes.elementType,
71157
- popper: PropTypes.elementType
71615
+ popper: PropTypes.elementType,
71616
+ popupIndicator: PropTypes.elementType,
71617
+ root: PropTypes.elementType
71158
71618
  }),
71159
71619
  /**
71160
71620
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -72928,7 +73388,7 @@ DesktopTimePicker.propTypes = {
72928
73388
  * @param {TValue} value The value that was just accepted.
72929
73389
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
72930
73390
  * - `validationError`: validation result of the current value
72931
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
73391
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
72932
73392
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
72933
73393
  */
72934
73394
  onAccept: PropTypes.func,
@@ -73247,7 +73707,7 @@ MobileTimePicker.propTypes = {
73247
73707
  * @param {TValue} value The value that was just accepted.
73248
73708
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
73249
73709
  * - `validationError`: validation result of the current value
73250
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
73710
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
73251
73711
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
73252
73712
  */
73253
73713
  onAccept: PropTypes.func,
@@ -73531,7 +73991,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
73531
73991
  * @param {TValue} value The value that was just accepted.
73532
73992
  * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
73533
73993
  * - `validationError`: validation result of the current value
73534
- * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
73994
+ * - `source`: source of the acceptance. One of 'field' | 'view' | 'unknown'
73535
73995
  * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
73536
73996
  */
73537
73997
  onAccept: PropTypes.func,
@@ -78008,18 +78468,7 @@ class AdapterDayjs {
78008
78468
  }
78009
78469
  });
78010
78470
  __publicField(this, "createSystemDate", (value) => {
78011
- let date;
78012
- if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
78013
- const timezone2 = dayjs.tz.guess();
78014
- if (timezone2 === "UTC") {
78015
- date = dayjs(value);
78016
- } else {
78017
- date = dayjs.tz(value, timezone2);
78018
- }
78019
- } else {
78020
- date = dayjs(value);
78021
- }
78022
- return this.setLocaleToValue(date);
78471
+ return this.setLocaleToValue(dayjs(value));
78023
78472
  });
78024
78473
  __publicField(this, "createUTCDate", (value) => {
78025
78474
  if (!this.hasUTCPlugin()) {