import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{$ as n,at as r,et as i,it as a,nt as o,ot as s,tt as c,x as l}from"./Tooltip.bbzhtE2V.js";import{n as u}from"./useLabel.DZK1zX4s.js";import{t as d}from"./Autocomplete.kV4wwzw9.js";import{t as f}from"./Hidden.tKmNEkoU.js";import{n as p}from"./useField.P41RsUO3.js";import{n as m}from"./useFormValidation.DAea014h.js";import{i as h,t as g}from"./Input.CELPEXLh.js";import{t as _}from"./useTextField.ByIiFDgd.js";import{pt as v}from"./index.ByR4Z2EF.js";var y=e(t(),1),b=(0,y.createContext)({}),x=(0,y.createContext)(null),S=f(function(e,t){[e,t]=i(e,t,x);let{validationBehavior:f}=s(m)||{},S=e.validationBehavior??f??`native`,C=(0,y.useRef)(null);[e,C]=i(e,C,d);let[w,T]=o(!e[`aria-label`]&&!e[`aria-labelledby`]),[E,D]=(0,y.useState)(`input`),{labelProps:O,inputProps:k,descriptionProps:A,errorMessageProps:j,...M}=_({...r(e),inputElementType:E,label:T,validationBehavior:S},C),N=(0,y.useCallback)(e=>{C.current=e,e&&D(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[C]),P=c({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:M.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),F=l(e,{global:!0});return delete F.id,y.createElement(a.div,{...F,...P,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":M.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},y.createElement(n,{values:[[u,{...O,ref:w}],[g,{...k,ref:N}],[b,{...k,ref:N}],[h,{role:`presentation`,isInvalid:M.isInvalid,isDisabled:e.isDisabled||!1}],[v,{slots:{description:A,errorMessage:j}}],[p,M]]},P.children))});export{S as t};