import{s as p}from"./app-DZaelcLs.js";import{r as o,J as h,o as r,g as u,b as k,x as g,u as v,j as b,h as V,n as _}from"./app-SC54XQDl.js";const C=["for"],I={inheritAttrs:!1},$=Object.assign(I,{__name:"TCheckboxBinary",props:["inputId","checked","modelValue","onChange"],emits:["emits"],setup(c,{emit:i}){const e=c,d=i,l=o(),t=o("checkbox-"+Math.random().toString().replace(/\./,"").substring(0,6));typeof e.inputId=="string"&&(t.value=e.inputId);const m=()=>{d("change",!l.value.checked)},a=o(!1);return e.checked==="checked"?a.value=!0:a.value=e.modelValue,h(()=>e.modelValue,()=>{a.value=e.modelValue}),(s,n)=>(r(),u("div",{class:_({"flex gap-2 items-center":s.$slots.default})},[k(v(p),g({ref_key:"checkboxRef",ref:l,binary:""},s.$attrs,{inputId:t.value,onChange:m,modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=f=>a.value=f)}),null,16,["inputId","modelValue"]),s.$slots.default?(r(),u("label",{key:0,class:"cursor-pointer",for:t.value},[b(s.$slots,"default")],8,C)):V("",!0)],2))}});export{$ as _};
