import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "./utils-CZt7LCbO.js";
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "./FieldError-DHrSdE_Q.js";
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "./Form-Bnyyv3Im.js";
import { a as $3985021b0ad6602f$export$37fb8590cf2c088c, b as $2d73ec29415bd339$export$712718f7aec83d5 } from "./Input-DfSBLhDx.js";
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-JS_ob-kh.js";
import React__default, { forwardRef, createContext, useRef, useState, useCallback } from "react";
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./useHover-C2SkI1Fn.js";
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-Bv0UJQl8.js";
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-BuJgePCv.js";
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "./Hidden-rE6uR-lr.js";
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
let $216918bed6669f72$var$filterHoverProps = (props) => {
  let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
  return otherProps;
};
const $216918bed6669f72$export$f5c9f3c2c4054eec = /* @__PURE__ */ forwardRef(function TextArea(props, ref) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $216918bed6669f72$export$2dc6166a7e65358c);
  let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
  let { isFocused, isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f({
    isTextInput: true,
    autoFocus: props.autoFocus
  });
  let isInvalid = !!props["aria-invalid"] && props["aria-invalid"] !== "false";
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    ...props,
    values: {
      isHovered,
      isFocused,
      isFocusVisible,
      isDisabled: props.disabled || false,
      isInvalid
    },
    defaultClassName: "react-aria-TextArea"
  });
  return /* @__PURE__ */ React__default.createElement("textarea", {
    ...$3ef42575df84b30b$export$9d1611c77c2fe928($216918bed6669f72$var$filterHoverProps(props), focusProps, hoverProps),
    ...renderProps,
    ref,
    "data-focused": isFocused || void 0,
    "data-disabled": props.disabled || void 0,
    "data-hovered": isHovered || void 0,
    "data-focus-visible": isFocusVisible || void 0,
    "data-invalid": isInvalid || void 0
  });
});
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
  let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
  var _props_validationBehavior, _ref;
  let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
  let inputRef = useRef(null);
  let [inputContextProps, mergedInputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415({}, inputRef, $3985021b0ad6602f$export$37fb8590cf2c088c);
  let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
  let [inputElementType, setInputElementType] = useState("input");
  let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5({
    ...$64fa3d84918910a7$export$ef03459518577ad4(props),
    inputElementType,
    label,
    validationBehavior
  }, mergedInputRef);
  let inputOrTextAreaRef = useCallback((el) => {
    mergedInputRef.current = el;
    if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
  }, [
    mergedInputRef
  ]);
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
    ...props,
    values: {
      isDisabled: props.isDisabled || false,
      isInvalid: validation.isInvalid,
      isReadOnly: props.isReadOnly || false,
      isRequired: props.isRequired || false
    },
    defaultClassName: "react-aria-TextField"
  });
  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
  delete DOMProps.id;
  return /* @__PURE__ */ React__default.createElement("div", {
    ...DOMProps,
    ...renderProps,
    ref,
    slot: props.slot || void 0,
    "data-disabled": props.isDisabled || void 0,
    "data-invalid": validation.isInvalid || void 0,
    "data-readonly": props.isReadOnly || void 0,
    "data-required": props.isRequired || void 0
  }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
    values: [
      [
        $01b77f81d0f07f68$export$75b6ee27786ba447,
        {
          ...labelProps,
          ref: labelRef
        }
      ],
      [
        $3985021b0ad6602f$export$37fb8590cf2c088c,
        {
          ...$3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, inputContextProps),
          ref: inputOrTextAreaRef
        }
      ],
      [
        $216918bed6669f72$export$2dc6166a7e65358c,
        {
          ...inputProps,
          ref: inputOrTextAreaRef
        }
      ],
      [
        $514c0188e459b4c0$export$9afb8bc826b033ea,
        {
          slots: {
            description: descriptionProps,
            errorMessage: errorMessageProps
          }
        }
      ],
      [
        $ee014567cb39d3f0$export$ff05c3ac10437e03,
        validation
      ]
    ]
  }, renderProps.children));
});
export {
  $bcdf0525bf22703d$export$2c73285ae9390cec as $,
  $216918bed6669f72$export$f5c9f3c2c4054eec as a,
  $bcdf0525bf22703d$export$2129e27b3ef0d483 as b
};
