import{v as a,x as l,l as n,s,k as i,z as u,D as c,B as r,U as f,f as h}from"./x-CuOWXDIc.js";import{C as k}from"./check-D7sgkfv8.js";import{M as x}from"./lucide-vue-next-DqYmV2Wg.js";const y={class:"form-group"},g={key:0,class:"checkbox__label"},B={key:0,class:"form-group__error"},v={key:1,class:"form-group__hint"},N={__name:"CheckboxField",props:{modelValue:{type:[Boolean,Number,String],default:!1},label:{type:String,default:""},hint:{type:String,default:""},error:{type:String,default:""},disabled:{type:Boolean,default:!1},value:{type:[Boolean,Number,String],default:!0},uncheckedValue:{type:[Boolean,Number,String],default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:d}){const t=e,m=d,o=h(()=>t.modelValue===t.value);function b(){t.disabled||m("update:modelValue",o.value?t.uncheckedValue:t.value)}return(_,p)=>(a(),l("div",y,[n("label",{class:s(["checkbox",e.disabled?"checkbox--disabled":""]),onClick:f(b,["prevent"])},[n("span",{class:s(["checkbox__box",o.value||e.indeterminate?"checkbox__box--checked":"",e.error?"checkbox__box--error":""])},[o.value&&!e.indeterminate?(a(),i(u(k),{key:0,class:"checkbox__icon"})):e.indeterminate?(a(),i(u(x),{key:1,class:"checkbox__icon"})):c("",!0)],2),e.label?(a(),l("span",g,r(e.label),1)):c("",!0)],2),e.error?(a(),l("p",B,r(e.error),1)):e.hint?(a(),l("p",v,r(e.hint),1)):c("",!0)]))}};export{N as _};
