import h from "./index-objectWithoutPropertiesLoose.js";
import d from "./index-extends.js";
import * as L from "react";
import o from "./index-_virtual16.js";
import C from "./index-styled.js";
import i, { getFilledInputUtilityClass as O } from "./index-filledInputClasses.js";
import $, { InputBaseRoot as j, rootOverridesResolver as W, InputBaseComponent as _, inputOverridesResolver as U } from "./index-InputBase2.js";
import { jsx as A } from "react/jsx-runtime";
import { useDefaultProps as z } from "./index-DefaultPropsProvider.js";
import E from "./index-deepmerge.js";
import M from "./index-composeClasses.js";
import N from "./index-rootShouldForwardProp.js";
import X from "./index-refType.js";
const D = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"], V = (t) => {
  const {
    classes: n,
    disableUnderline: r
  } = t, s = M({
    root: ["root", !r && "underline"],
    input: ["input"]
  }, O, n);
  return d({}, n, s);
}, q = C(j, {
  shouldForwardProp: (t) => N(t) || t === "classes",
  name: "MuiFilledInput",
  slot: "Root",
  overridesResolver: (t, n) => {
    const {
      ownerState: r
    } = t;
    return [...W(t, n), !r.disableUnderline && n.underline];
  }
})(({
  theme: t,
  ownerState: n
}) => {
  var r;
  const e = t.palette.mode === "light", s = e ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)", l = e ? "rgba(0, 0, 0, 0.06)" : "rgba(255, 255, 255, 0.09)", p = e ? "rgba(0, 0, 0, 0.09)" : "rgba(255, 255, 255, 0.13)", a = e ? "rgba(0, 0, 0, 0.12)" : "rgba(255, 255, 255, 0.12)";
  return d({
    position: "relative",
    backgroundColor: t.vars ? t.vars.palette.FilledInput.bg : l,
    borderTopLeftRadius: (t.vars || t).shape.borderRadius,
    borderTopRightRadius: (t.vars || t).shape.borderRadius,
    transition: t.transitions.create("background-color", {
      duration: t.transitions.duration.shorter,
      easing: t.transitions.easing.easeOut
    }),
    "&:hover": {
      backgroundColor: t.vars ? t.vars.palette.FilledInput.hoverBg : p,
      // Reset on touch devices, it doesn't add specificity
      "@media (hover: none)": {
        backgroundColor: t.vars ? t.vars.palette.FilledInput.bg : l
      }
    },
    [`&.${i.focused}`]: {
      backgroundColor: t.vars ? t.vars.palette.FilledInput.bg : l
    },
    [`&.${i.disabled}`]: {
      backgroundColor: t.vars ? t.vars.palette.FilledInput.disabledBg : a
    }
  }, !n.disableUnderline && {
    "&::after": {
      borderBottom: `2px solid ${(r = (t.vars || t).palette[n.color || "primary"]) == null ? void 0 : r.main}`,
      left: 0,
      bottom: 0,
      // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
      content: '""',
      position: "absolute",
      right: 0,
      transform: "scaleX(0)",
      transition: t.transitions.create("transform", {
        duration: t.transitions.duration.shorter,
        easing: t.transitions.easing.easeOut
      }),
      pointerEvents: "none"
      // Transparent to the hover style.
    },
    [`&.${i.focused}:after`]: {
      // translateX(0) is a workaround for Safari transform scale bug
      // See https://github.com/mui/material-ui/issues/31766
      transform: "scaleX(1) translateX(0)"
    },
    [`&.${i.error}`]: {
      "&::before, &::after": {
        borderBottomColor: (t.vars || t).palette.error.main
      }
    },
    "&::before": {
      borderBottom: `1px solid ${t.vars ? `rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})` : s}`,
      left: 0,
      bottom: 0,
      // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
      content: '"\\00a0"',
      position: "absolute",
      right: 0,
      transition: t.transitions.create("border-bottom-color", {
        duration: t.transitions.duration.shorter
      }),
      pointerEvents: "none"
      // Transparent to the hover style.
    },
    [`&:hover:not(.${i.disabled}, .${i.error}):before`]: {
      borderBottom: `1px solid ${(t.vars || t).palette.text.primary}`
    },
    [`&.${i.disabled}:before`]: {
      borderBottomStyle: "dotted"
    }
  }, n.startAdornment && {
    paddingLeft: 12
  }, n.endAdornment && {
    paddingRight: 12
  }, n.multiline && d({
    padding: "25px 12px 8px"
  }, n.size === "small" && {
    paddingTop: 21,
    paddingBottom: 4
  }, n.hiddenLabel && {
    paddingTop: 16,
    paddingBottom: 17
  }, n.hiddenLabel && n.size === "small" && {
    paddingTop: 8,
    paddingBottom: 9
  }));
}), G = C(_, {
  name: "MuiFilledInput",
  slot: "Input",
  overridesResolver: U
})(({
  theme: t,
  ownerState: n
}) => d({
  paddingTop: 25,
  paddingRight: 12,
  paddingBottom: 8,
  paddingLeft: 12
}, !t.vars && {
  "&:-webkit-autofill": {
    WebkitBoxShadow: t.palette.mode === "light" ? null : "0 0 0 100px #266798 inset",
    WebkitTextFillColor: t.palette.mode === "light" ? null : "#fff",
    caretColor: t.palette.mode === "light" ? null : "#fff",
    borderTopLeftRadius: "inherit",
    borderTopRightRadius: "inherit"
  }
}, t.vars && {
  "&:-webkit-autofill": {
    borderTopLeftRadius: "inherit",
    borderTopRightRadius: "inherit"
  },
  [t.getColorSchemeSelector("dark")]: {
    "&:-webkit-autofill": {
      WebkitBoxShadow: "0 0 0 100px #266798 inset",
      WebkitTextFillColor: "#fff",
      caretColor: "#fff"
    }
  }
}, n.size === "small" && {
  paddingTop: 21,
  paddingBottom: 4
}, n.hiddenLabel && {
  paddingTop: 16,
  paddingBottom: 17
}, n.startAdornment && {
  paddingLeft: 0
}, n.endAdornment && {
  paddingRight: 0
}, n.hiddenLabel && n.size === "small" && {
  paddingTop: 8,
  paddingBottom: 9
}, n.multiline && {
  paddingTop: 0,
  paddingBottom: 0,
  paddingLeft: 0,
  paddingRight: 0
})), I = /* @__PURE__ */ L.forwardRef(function(n, r) {
  var e, s, l, p;
  const a = z({
    props: n,
    name: "MuiFilledInput"
  }), {
    components: b = {},
    componentsProps: c,
    fullWidth: g = !1,
    // declare here to prevent spreading to DOM
    inputComponent: f = "input",
    multiline: m = !1,
    slotProps: u,
    slots: v = {},
    type: y = "text"
  } = a, B = h(a, D), R = d({}, a, {
    fullWidth: g,
    inputComponent: f,
    multiline: m,
    type: y
  }), x = V(a), T = {
    root: {
      ownerState: R
    },
    input: {
      ownerState: R
    }
  }, k = u ?? c ? E(T, u ?? c) : T, F = (e = (s = v.root) != null ? s : b.Root) != null ? e : q, P = (l = (p = v.input) != null ? p : b.Input) != null ? l : G;
  return /* @__PURE__ */ A($, d({
    slots: {
      root: F,
      input: P
    },
    componentsProps: k,
    fullWidth: g,
    inputComponent: f,
    multiline: m,
    ref: r,
    type: y
  }, B, {
    classes: x
  }));
});
process.env.NODE_ENV !== "production" && (I.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * This prop helps users to fill forms faster, especially on mobile devices.
   * The name can be confusing, as it's more like an autofill.
   * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
   */
  autoComplete: o.string,
  /**
   * If `true`, the `input` element is focused during the first mount.
   */
  autoFocus: o.bool,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  /**
   * The color of the component.
   * It supports both default and custom theme colors, which can be added as shown in the
   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
   * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
   */
  color: o.oneOfType([o.oneOf(["primary", "secondary"]), o.string]),
  /**
   * The components used for each slot inside.
   *
   * This prop is an alias for the `slots` prop.
   * It's recommended to use the `slots` prop instead.
   *
   * @default {}
   */
  components: o.shape({
    Input: o.elementType,
    Root: o.elementType
  }),
  /**
   * The extra props for the slot components.
   * You can override the existing props or add new ones.
   *
   * This prop is an alias for the `slotProps` prop.
   * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
   *
   * @default {}
   */
  componentsProps: o.shape({
    input: o.object,
    root: o.object
  }),
  /**
   * The default value. Use when the component is not controlled.
   */
  defaultValue: o.any,
  /**
   * If `true`, the component is disabled.
   * The prop defaults to the value (`false`) inherited from the parent FormControl component.
   */
  disabled: o.bool,
  /**
   * If `true`, the input will not have an underline.
   */
  disableUnderline: o.bool,
  /**
   * End `InputAdornment` for this component.
   */
  endAdornment: o.node,
  /**
   * If `true`, the `input` will indicate an error.
   * The prop defaults to the value (`false`) inherited from the parent FormControl component.
   */
  error: o.bool,
  /**
   * If `true`, the `input` will take up the full width of its container.
   * @default false
   */
  fullWidth: o.bool,
  /**
   * If `true`, the label is hidden.
   * This is used to increase density for a `FilledInput`.
   * Be sure to add `aria-label` to the `input` element.
   * @default false
   */
  hiddenLabel: o.bool,
  /**
   * The id of the `input` element.
   */
  id: o.string,
  /**
   * The component used for the `input` element.
   * Either a string to use a HTML element or a component.
   * @default 'input'
   */
  inputComponent: o.elementType,
  /**
   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
   * @default {}
   */
  inputProps: o.object,
  /**
   * Pass a ref to the `input` element.
   */
  inputRef: X,
  /**
   * If `dense`, will adjust vertical spacing. This is normally obtained via context from
   * FormControl.
   * The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
   */
  margin: o.oneOf(["dense", "none"]),
  /**
   * Maximum number of rows to display when multiline option is set to true.
   */
  maxRows: o.oneOfType([o.number, o.string]),
  /**
   * Minimum number of rows to display when multiline option is set to true.
   */
  minRows: o.oneOfType([o.number, o.string]),
  /**
   * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
   * @default false
   */
  multiline: o.bool,
  /**
   * Name attribute of the `input` element.
   */
  name: o.string,
  /**
   * Callback fired when the value is changed.
   *
   * @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
   * You can pull out the new value by accessing `event.target.value` (string).
   */
  onChange: o.func,
  /**
   * The short hint displayed in the `input` before the user enters a value.
   */
  placeholder: o.string,
  /**
   * It prevents the user from changing the value of the field
   * (not from interacting with the field).
   */
  readOnly: o.bool,
  /**
   * If `true`, the `input` element is required.
   * The prop defaults to the value (`false`) inherited from the parent FormControl component.
   */
  required: o.bool,
  /**
   * Number of rows to display when multiline option is set to true.
   */
  rows: o.oneOfType([o.number, o.string]),
  /**
   * The extra props for the slot components.
   * You can override the existing props or add new ones.
   *
   * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
   *
   * @default {}
   */
  slotProps: o.shape({
    input: o.object,
    root: o.object
  }),
  /**
   * The components used for each slot inside.
   *
   * This prop is an alias for the `components` prop, which will be deprecated in the future.
   *
   * @default {}
   */
  slots: o.shape({
    input: o.elementType,
    root: o.elementType
  }),
  /**
   * Start `InputAdornment` for this component.
   */
  startAdornment: o.node,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
  /**
   * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
   * @default 'text'
   */
  type: o.string,
  /**
   * The value of the `input` element, required for a controlled component.
   */
  value: o.any
});
I.muiName = "Input";
export {
  I as default
};
