import{g as b,E as u,G as y,j as d,H as v,O as k,o as s,c as t,a as i,M as C,Z as B,L as V,I as S,d as $,t as g,y as n,l as p}from"./entry.eb978f24.js";import{u as q}from"./useFormEvents.4d081bc0.js";import{_ as A}from"./_plugin-vue_export-helper.c27b6911.js";const N=b({inheritAttrs:!1,props:{value:{type:[String,Number,Boolean,Object],default:null},modelValue:{type:[Boolean,Array],default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},help:{type:String,default:null},label:{type:String,default:null},required:{type:Boolean,default:!1},color:{type:String,default:()=>u.ui.checkbox.default.color,validator(e){return u.ui.colors.includes(e)}},ui:{type:Object,default:()=>u.ui.checkbox}},emits:["update:modelValue","change"],setup(e,{emit:l}){const c=y(),a=d(()=>v({},e.ui,c.ui.checkbox)),{emitFormBlur:m}=q(),f=d({get(){return e.modelValue},set(r){l("update:modelValue",r)}}),o=r=>{l("change",r),m()},h=d(()=>k(a.value.base,a.value.rounded,a.value.background,a.value.border,a.value.ring.replaceAll("{color}",e.color),a.value.color.replaceAll("{color}",e.color)));return{ui:a,toggle:f,inputClass:h,onChange:o}}}),j={class:"flex items-center h-5"},E=["id","name","required","value","disabled","checked","indeterminate"],O={key:0,class:"ms-3 text-sm"},w=["for"];function D(e,l,c,a,m,f){return s(),t("div",{class:n(e.ui.wrapper)},[i("div",j,[C(i("input",V({id:e.name,"onUpdate:modelValue":l[0]||(l[0]=o=>e.toggle=o),name:e.name,required:e.required,value:e.value,disabled:e.disabled,checked:e.checked,indeterminate:e.indeterminate,type:"checkbox",class:["form-checkbox",e.inputClass]},e.$attrs,{onChange:l[1]||(l[1]=(...o)=>e.onChange&&e.onChange(...o))}),null,16,E),[[B,e.toggle]])]),e.label||e.$slots.label?(s(),t("div",O,[i("label",{for:e.name,class:n(e.ui.label)},[S(e.$slots,"label",{},()=>[$(g(e.label),1)]),e.required?(s(),t("span",{key:0,class:n(e.ui.required)},"*",2)):p("",!0)],10,w),e.help?(s(),t("p",{key:0,class:n(e.ui.help)},g(e.help),3)):p("",!0)])):p("",!0)],2)}const G=A(N,[["render",D]]);export{G as default};
