import{r as k,_ as R}from"./Radio.iFsaiT2r.js";import{u as b,g as l}from"./selectMenu.C9lwG85K.js";import{u as z}from"./useFormGroup.Y2N1Wpzd.js";import{I as h,J as r,h as B,K as n,G,v as N,o,c as i,a as U,B as y,M as v,d as j,t as w,z as F,F as _,A as I,y as P,w as T,N as A,O}from"./entry.RGd0w9hd.js";import{_ as D}from"./_plugin-vue_export-helper.x3n3nnut.js";import"./uid.KLLbMoZc.js";import"./index.g8c07QCY.js";const E={wrapper:"relative flex items-start",legend:"text-sm font-medium text-gray-700 dark:text-gray-200 mb-1",default:{color:"primary"}},d=h(r.ui.strategy,r.ui.radioGroup,E),J=h(r.ui.strategy,r.ui.radio,k),K=B({components:{URadio:R},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"),J),{emitFormChange:p,color:u,name:t}=z(e,d);G("radio-group",{color:u,name:t});const f=a=>{s("update:modelValue",a),s("change",a),p()},C=a=>l(a,e.valueAttribute,l(a,e.optionAttribute)),S=a=>l(a,e.optionAttribute,l(a,e.valueAttribute)),V=a=>["string","number","boolean"].includes(typeof a)?{value:a,label:a}:{...a,value:C(a),label:S(a)},$=N(()=>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=R;return o(),i("div",{class:y(e.ui.wrapper)},[U("fieldset",A(O(e.attrs)),[e.legend||e.$slots.legend?(o(),i("legend",{key:0,class:y(e.ui.legend)},[v(e.$slots,"legend",{},()=>[j(w(e.legend),1)])],2)):F("",!0),(o(!0),i(_,null,I(e.normalizedOptions,t=>(o(),P(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:T(()=>[v(e.$slots,"label",A(O({option:t})))]),_:2},1032,["label","model-value","value","disabled","ui","onChange"]))),128))],16)],2)}const Z=D(K,[["render",L]]);export{Z as default};
