import{r as u}from"./redux-1.0.63-Df-eBzJn.js";import{h as x,g as C,i as M,j,c as F,l as g}from"./Typography-1.0.63-mecuj_Wl.js";import{a as S}from"./Radio-1.0.63-CTxGi4al.js";import{j as d}from"./cm-1.0.63-CSIRHMXC.js";import{X as U}from"./index-1.0.63-oIDff4nA.js";import{a as N,c as P}from"./ButtonBase-1.0.63-CF10PFMS.js";import{u as D,f as V}from"./Select-1.0.63-BMejr8a7.js";function b(o){return x("MuiFormGroup",o)}C("MuiFormGroup",["root","row","error"]);const k=o=>{const{classes:r,row:e,error:t}=o;return g({root:["root",e&&"row",t&&"error"]},b,r)},q=j("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"}}]}),E=u.forwardRef(function(r,e){const t=M({props:r,name:"MuiFormGroup"}),{className:a,row:i=!1,...c}=t,m=D(),n=V({props:t,muiFormControl:m,states:["error"]}),l={...t,row:i,error:n.error},p=k(l);return d.jsx(q,{className:F(p.root,a),ownerState:l,ref:e,...c})});function I(o){return x("MuiRadioGroup",o)}C("MuiRadioGroup",["root","row","error"]);const H=o=>{const{classes:r,row:e,error:t}=o;return g({root:["root",e&&"row",t&&"error"]},I,r)},K=u.forwardRef(function(r,e){const{actions:t,children:a,className:i,defaultValue:c,name:m,onChange:n,value:l,...p}=r,f=u.useRef(null),v=H(r),[R,w]=U({controlled:l,default:c,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 y=N(e,f),G=P(m),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(S.Provider,{value:h,children:d.jsx(E,{role:"radiogroup",ref:y,className:F(v.root,i),...p,children:a})})});export{K as R};
