import h from "./index-extends.js";
import * as r from "react";
import e from "./index-_virtual16.js";
import { jsx as D } from "react/jsx-runtime";
import T from "./index-useThemeProps.js";
import { DEFAULT_LOCALE as y } from "./index-enUS.js";
const m = /* @__PURE__ */ r.createContext(null);
process.env.NODE_ENV !== "production" && (m.displayName = "MuiPickersAdapterContext");
let c = !1;
function x(p) {
  const u = T({
    props: p,
    name: "MuiLocalizationProvider"
  }), {
    children: g,
    dateAdapter: i,
    dateFormats: s,
    dateLibInstance: l,
    locale: n,
    adapterLocale: o,
    localeText: a
  } = u;
  process.env.NODE_ENV !== "production" && !c && n !== void 0 && (c = !0);
  const t = r.useMemo(() => new i({
    locale: o ?? n,
    formats: s,
    instance: l
  }), [i, n, o, s, l]), d = r.useMemo(() => ({
    minDate: t.date("1900-01-01T00:00:00.000"),
    maxDate: t.date("2099-12-31T00:00:00.000")
  }), [t]), f = r.useMemo(() => ({
    utils: t,
    defaultDates: d,
    localeText: h({}, y, a ?? {})
  }), [d, t, a]);
  return /* @__PURE__ */ D(m.Provider, {
    value: f,
    children: g
  });
}
process.env.NODE_ENV !== "production" && (x.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "yarn proptypes"  |
  // ----------------------------------------------------------------------
  /**
   * Locale for the date library you are using
   */
  adapterLocale: e.oneOfType([e.object, e.string]),
  children: e.node,
  /**
   * DateIO adapter class function
   */
  dateAdapter: e.func.isRequired,
  /**
   * Formats that are used for any child pickers
   */
  dateFormats: e.shape({
    dayOfMonth: e.string,
    fullDate: e.string,
    fullDateTime: e.string,
    fullDateTime12h: e.string,
    fullDateTime24h: e.string,
    fullDateWithWeekday: e.string,
    fullTime: e.string,
    fullTime12h: e.string,
    fullTime24h: e.string,
    hours12h: e.string,
    hours24h: e.string,
    keyboardDate: e.string,
    keyboardDateTime: e.string,
    keyboardDateTime12h: e.string,
    keyboardDateTime24h: e.string,
    minutes: e.string,
    month: e.string,
    monthAndDate: e.string,
    monthAndYear: e.string,
    monthShort: e.string,
    normalDate: e.string,
    normalDateWithWeekday: e.string,
    seconds: e.string,
    shortDate: e.string,
    weekday: e.string,
    weekdayShort: e.string,
    year: e.string
  }),
  /**
   * Date library instance you are using, if it has some global overrides
   * ```jsx
   * dateLibInstance={momentTimeZone}
   * ```
   */
  dateLibInstance: e.any,
  /**
   * Locale for the date library you are using
   * @deprecated Use `adapterLocale` instead
   */
  locale: e.oneOfType([e.object, e.string]),
  /**
   * Locale for components texts
   */
  localeText: e.object
});
export {
  x as LocalizationProvider,
  m as MuiPickersAdapterContext
};
