import{r as k,_ as A}from"./Radio.PXNo1ntv.js";import{u as b,g as l}from"./selectMenu.72ERhOvP.js";import{u as j}from"./useFormGroup.ppIt-kam.js";import{C as O,D as r,f as z,E as n,y as B,i as G,o,c as i,a as U,x as y,H as v,d as w,t as F,k as N,F as _,v as D,j as E,w as I,I as C,J as R}from"./entry.2xM5grDS.js";import{_ as P}from"./_plugin-vue_export-helper.x3n3nnut.js";import"./uid.KLLbMoZc.js";import"./index.OjlVAl1H.js";const T={wrapper:"relative flex items-start",legend:"text-sm font-medium text-gray-700 dark:text-gray-200 mb-1",default:{color:"primary"}},d=O(r.ui.strategy,r.ui.radioGroup,T),H=O(r.ui.strategy,r.ui.radio,k),J=z({components:{URadio:A},inheritAttrs:!1,props:{modelValue:{type:[String,Number,Object],default:""},name:{type:String,default:null},legend:{type:String,default:null},options:{type:Array,default:()=>[]},optionAttribute:{type:String,default:"label"},valueAttribute:{type:String,default:"value"},disabled:{type:Boolean,default:!1},color:{type:String,default:()=>d.default.color,validator(e){return r.ui.colors.includes(e)}},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})},uiRadio:{type:Object,default:()=>({})}},emits:["update:modelValue","change"],setup(e,{emit:s}){const{ui:m,attrs:c}=b("radioGroup",n(e,"ui"),d,n(e,"class")),{ui:g}=b("radio",n(e,"uiRadio"),H),{emitFormChange:p,color:u,name:t}=j(e,d);B("radio-group",{color:u,name:t});const f=a=>{s("update:modelValue",a),s("change",a),p()},S=a=>l(a,e.valueAttribute,l(a,e.optionAttribute)),h=a=>l(a,e.optionAttribute,l(a,e.valueAttribute)),V=a=>["string","number","boolean"].includes(typeof a)?{value:a,label:a}:{...a,value:S(a),label:h(a)},$=G(()=>e.options.map(a=>V(a)));return{ui:m,uiRadio:g,attrs:c,normalizedOptions:$,onUpdate:f}}});function L(e,s,m,c,g,p){const u=A;return o(),i("div",{class:y(e.ui.wrapper)},[U("fieldset",C(R(e.attrs)),[e.legend||e.$slots.legend?(o(),i("legend",{key:0,class:y(e.ui.legend)},[v(e.$slots,"legend",{},()=>[w(F(e.legend),1)])],2)):N("",!0),(o(!0),i(_,null,D(e.normalizedOptions,t=>(o(),E(u,{key:t.value,label:t.label,"model-value":e.modelValue,value:t.value,disabled:t.disabled||e.disabled,ui:e.uiRadio,onChange:f=>e.onUpdate(t.value)},{label:I(()=>[v(e.$slots,"label",C(R({option:t})))]),_:2},1032,["label","model-value","value","disabled","ui","onChange"]))),128))],16)],2)}const Z=P(J,[["render",L]]);export{Z as default};
