import{r as o,e as i}from"./index-NdkWRN8K.js";import{M as F}from"./Field-DH3L8v09.js";import{g as L,u as S}from"./inputUtils-Dbi8XkA6.js";import{M as D}from"./Radio-BdNnpooK.js";import{j as M}from"./jsx-runtime-CnH95YSl.js";import{R as B}from"./RadioGroup-CtUWSbQc.js";const H=({ariaDescribedBy:y,children:n,defaultValue:m,errorMessage:x,errorMessageList:C,hint:V,HintLinkComponent:g,id:j,isDisabled:s,isReadOnly:a=!1,label:z,name:l,onChange:r,testId:p,translate:d,value:u})=>{const E=o.useRef(L({controlledValue:u,uncontrolledValue:m})),c=S({defaultValue:m,value:u,controlState:E.current}),b=o.useCallback((e,t)=>{r==null||r(e,t)},[r]),f=o.useMemo(()=>i.Children.map(n,e=>i.isValidElement(e)&&e.type===D?i.cloneElement(e,{...e.props,isDisabled:s||e.props.isDisabled,isReadOnly:a||e.props.isReadOnly}):e),[n,s,a]),G=o.useCallback(({ariaDescribedBy:e,errorMessageElementId:t,id:R,labelElementId:k})=>M.jsx(B,{...c,"aria-describedby":e,"aria-errormessage":t,"aria-labelledby":k,"data-se":p,id:R,name:l??R,onChange:b,translate:d,children:f}),[c,l,b,f,p,d]);return M.jsx(F,{ariaDescribedBy:y,errorMessage:x,errorMessageList:C,fieldType:"group",hasVisibleLabel:!1,hint:V,HintLinkComponent:g,id:j,isDisabled:s,isReadOnly:a,label:z,renderFieldComponent:G})},N=o.memo(H);N.displayName="RadioGroup";export{N as M};
