import j from "./index-objectWithoutPropertiesLoose.js";
import a from "./index-extends.js";
import * as B from "react";
import o from "./index-_virtual16.js";
import y from "./index-styled.js";
import s, { getInputUtilityClass as U } from "./index-inputClasses.js";
import _, { InputBaseRoot as w, rootOverridesResolver as S, InputBaseComponent as W, inputOverridesResolver as E } from "./index-InputBase2.js";
import { jsx as F } from "react/jsx-runtime";
import { useDefaultProps as M } from "./index-DefaultPropsProvider.js";
import N from "./index-deepmerge.js";
import X from "./index-composeClasses.js";
import A from "./index-rootShouldForwardProp.js";
import D from "./index-refType.js";
const L = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"], V = (t) => {
  const {
    classes: e,
    disableUnderline: r
  } = t, i = X({
    root: ["root", !r && "underline"],
    input: ["input"]
  }, U, e);
  return a({}, e, i);
}, k = y(w, {
  shouldForwardProp: (t) => A(t) || t === "classes",
  name: "MuiInput",
  slot: "Root",
  overridesResolver: (t, e) => {
    const {
      ownerState: r
    } = t;
    return [...S(t, e), !r.disableUnderline && e.underline];
  }
})(({
  theme: t,
  ownerState: e
}) => {
  let n = t.palette.mode === "light" ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)";
  return t.vars && (n = `rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`), a({
    position: "relative"
  }, e.formControl && {
    "label + &": {
      marginTop: 16
    }
  }, !e.disableUnderline && {
    "&::after": {
      borderBottom: `2px solid ${(t.vars || t).palette[e.color].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.
    },
    [`&.${s.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)"
    },
    [`&.${s.error}`]: {
      "&::before, &::after": {
        borderBottomColor: (t.vars || t).palette.error.main
      }
    },
    "&::before": {
      borderBottom: `1px solid ${n}`,
      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(.${s.disabled}, .${s.error}):before`]: {
      borderBottom: `2px solid ${(t.vars || t).palette.text.primary}`,
      // Reset on touch devices, it doesn't add specificity
      "@media (hover: none)": {
        borderBottom: `1px solid ${n}`
      }
    },
    [`&.${s.disabled}:before`]: {
      borderBottomStyle: "dotted"
    }
  });
}), q = y(W, {
  name: "MuiInput",
  slot: "Input",
  overridesResolver: E
})({}), g = /* @__PURE__ */ B.forwardRef(function(e, r) {
  var n, i, u, d;
  const p = M({
    props: e,
    name: "MuiInput"
  }), {
    disableUnderline: v,
    components: m = {},
    componentsProps: c,
    fullWidth: C = !1,
    inputComponent: I = "input",
    multiline: P = !1,
    slotProps: l,
    slots: f = {},
    type: R = "text"
  } = p, T = j(p, L), O = V(p), b = {
    root: {
      ownerState: {
        disableUnderline: v
      }
    }
  }, $ = l ?? c ? N(l ?? c, b) : b, x = (n = (i = f.root) != null ? i : m.Root) != null ? n : k, h = (u = (d = f.input) != null ? d : m.Input) != null ? u : q;
  return /* @__PURE__ */ F(_, a({
    slots: {
      root: x,
      input: h
    },
    slotProps: $,
    fullWidth: C,
    inputComponent: I,
    multiline: P,
    ref: r,
    type: R
  }, T, {
    classes: O
  }));
});
process.env.NODE_ENV !== "production" && (g.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,
  /**
   * 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: D,
  /**
   * 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
});
g.muiName = "Input";
export {
  g as default
};
