import{m as x,n as C,f as M,r as u,t as S,j as d,v as F,w as v,c_ as U}from"./index-458d5762.js";import{a as j}from"./Radio-202b3970.js";import{a as N,f as P,u as D}from"./Grow-1b19ccc0.js";import{u as V}from"./Select-1c8a1710.js";function $(o){return x("MuiFormGroup",o)}C("MuiFormGroup",["root","row","error"]);const b=o=>{const{classes:r,row:e,error:t}=o;return v({root:["root",e&&"row",t&&"error"]},$,r)},k=M("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(o,r)=>{const{ownerState:e}=o;return[r.root,e.row&&r.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),q=u.forwardRef(function(r,e){const t=S({props:r,name:"MuiFormGroup"}),{className:a,row:c=!1,...i}=t,p=N(),n=P({props:t,muiFormControl:p,states:["error"]}),l={...t,row:c,error:n.error},m=b(l);return d.jsx(k,{className:F(m.root,a),ownerState:l,ref:e,...i})}),E=q;function I(o){return x("MuiRadioGroup",o)}C("MuiRadioGroup",["root","row","error"]);const H=o=>{const{classes:r,row:e,error:t}=o;return v({root:["root",e&&"row",t&&"error"]},I,r)},W=u.forwardRef(function(r,e){const{actions:t,children:a,className:c,defaultValue:i,name:p,onChange:n,value:l,...m}=r,f=u.useRef(null),y=H(r),[R,w]=D({controlled:l,default:i,name:"RadioGroup"});u.useImperativeHandle(t,()=>({focus:()=>{let s=f.current.querySelector("input:not(:disabled):checked");s||(s=f.current.querySelector("input:not(:disabled)")),s&&s.focus()}}),[]);const g=U(e,f),G=V(p),h=u.useMemo(()=>({name:G,onChange(s){w(s.target.value),n&&n(s,s.target.value)},value:R}),[G,n,w,R]);return d.jsx(j.Provider,{value:h,children:d.jsx(E,{role:"radiogroup",ref:g,className:F(y.root,c),...m,children:a})})}),J=W;export{J as R};
