const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../_util/vue-types/index.js"),i=require("../form/FormItemContext.js"),a=require("./context.js"),o=require("./style/index.js"),s=require("./Radio.js");let c=require("vue");var l=()=>({prefixCls:String,value:r.default.any,size:e.stringType(),options:e.arrayType(),disabled:e.booleanType(),name:String,buttonStyle:e.stringType(`outline`),id:String,optionType:e.stringType(`default`),onChange:e.functionType(),"onUpdate:value":e.functionType()}),u=(0,c.defineComponent)({compatConfig:{MODE:3},name:`ARadioGroup`,inheritAttrs:!1,props:l(),setup(e,{slots:r,emit:l,attrs:u}){let d=i.useInjectFormItemContext(),{prefixCls:f,direction:p,size:m}=n.default(`radio`,e),[h,g]=o.default(f),_=(0,c.ref)(e.value),v=(0,c.ref)(!1);return(0,c.watch)(()=>e.value,e=>{_.value=e,v.value=!1}),a.useProvideRadioGroupContext({onChange:t=>{let n=_.value,{value:r}=t.target;`value`in e||(_.value=r),!v.value&&r!==n&&(v.value=!0,l(`update:value`,r),l(`change`,t),d.onFieldChange()),(0,c.nextTick)(()=>{v.value=!1})},value:_,disabled:(0,c.computed)(()=>e.disabled),name:(0,c.computed)(()=>e.name),optionType:(0,c.computed)(()=>e.optionType)}),()=>{let{options:n,buttonStyle:i,id:a=d.id.value}=e,o=`${f.value}-group`,l=t.default(o,`${o}-${i}`,{[`${o}-${m.value}`]:m.value,[`${o}-rtl`]:p.value===`rtl`},u.class,g.value),v=null;return v=n&&n.length>0?n.map(t=>{if(typeof t==`string`||typeof t==`number`)return(0,c.createVNode)(s.default,{key:t,prefixCls:f.value,disabled:e.disabled,value:t,checked:_.value===t},{default:()=>[t]});let{value:n,disabled:r,label:i}=t;return(0,c.createVNode)(s.default,{key:`radio-group-value-options-${n}`,prefixCls:f.value,disabled:r||e.disabled,value:n,checked:_.value===n},{default:()=>[i]})}):r.default?.(),h((0,c.createVNode)(`div`,{...u,class:l,id:a},[v]))}}});exports.default=u,exports.radioGroupProps=l;