import{a9 as $,N as s,i as n,f as d,ai as B,ae as V,A as q,D as t,W as g,h as u,l as A,b as p,e as m,z as N,j as b,a0 as h,a1 as v,a4 as j,a3 as D}from"./D7LY3N47.js";import{u as O}from"./DqW9UKXb.js";import{u as z}from"./DWMhLzME.js";import{_ as F}from"./DlAUqK2U.js";const M={wrapper:"relative flex items-start",container:"flex items-center h-5",base:"h-4 w-4 dark:checked:bg-current dark:checked:border-transparent dark:indeterminate:bg-current dark:indeterminate:border-transparent disabled:opacity-50 disabled:cursor-not-allowed focus:ring-0 focus:ring-transparent focus:ring-offset-transparent",form:"form-checkbox",rounded:"rounded",color:"text-{color}-500 dark:text-{color}-400",background:"bg-white dark:bg-gray-900",border:"border border-gray-300 dark:border-gray-700",ring:"focus-visible:ring-2 focus-visible:ring-{color}-500 dark:focus-visible:ring-{color}-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",inner:"ms-3 flex flex-col",label:"text-sm font-medium text-gray-700 dark:text-gray-200",required:"text-sm text-red-500 dark:text-red-400",help:"text-sm text-gray-500 dark:text-gray-400",default:{color:"primary"}},T=$,y=N(p.ui.strategy,p.ui.checkbox,M),U=A({inheritAttrs:!1,props:{id:{type:String,default:()=>null},value:{type:[String,Number,Boolean,Object],default:null},modelValue:{type:[Boolean,Array],default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:void 0},help:{type:String,default:null},label:{type:String,default:null},required:{type:Boolean,default:!1},color:{type:String,default:()=>y.default.color,validator(e){return p.ui.colors.includes(e)}},inputClass:{type:String,default:""},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},emits:["update:modelValue","change"],setup(e,{emit:r}){const{ui:a,attrs:c}=O("checkbox",v(e,"ui"),y,v(e,"class")),{emitFormChange:f,color:l,name:o,inputId:k}=z(e),C=k.value??T(),I=m({get(){return e.modelValue},set(i){r("update:modelValue",i)}}),S=i=>{r("change",i.target.checked),f()},w=m(()=>j(D(a.value.base,a.value.form,a.value.rounded,a.value.background,a.value.border,l.value&&a.value.ring.replaceAll("{color}",l.value),l.value&&a.value.color.replaceAll("{color}",l.value)),e.inputClass));return{ui:a,attrs:c,toggle:I,inputId:C,name:o,inputClass:w,onChange:S}}}),E=["data-n-ids"],G=["id","name","required","value","disabled","indeterminate"],J=["for"];function P(e,r,a,c,f,l){return s(),n("div",{class:t(e.ui.wrapper),"data-n-ids":e.attrs["data-n-ids"]},[d("div",{class:t(e.ui.container)},[B(d("input",q({id:e.inputId,"onUpdate:modelValue":r[0]||(r[0]=o=>e.toggle=o),name:e.name,required:e.required,value:e.value,disabled:e.disabled,indeterminate:e.indeterminate,type:"checkbox",class:e.inputClass},e.attrs,{onChange:r[1]||(r[1]=(...o)=>e.onChange&&e.onChange(...o))}),null,16,G),[[V,e.toggle]])],2),e.label||e.$slots.label?(s(),n("div",{key:0,class:t(e.ui.inner)},[d("label",{for:e.inputId,class:t(e.ui.label)},[g(e.$slots,"label",{label:e.label},()=>[b(h(e.label),1)]),e.required?(s(),n("span",{key:0,class:t(e.ui.required)},"*",2)):u("",!0)],10,J),e.help||e.$slots.help?(s(),n("p",{key:0,class:t(e.ui.help)},[g(e.$slots,"help",{help:e.help},()=>[b(h(e.help),1)])],2)):u("",!0)],2)):u("",!0)],10,E)}const L=F(U,[["render",P]]),Q=globalThis.setInterval;export{L as _,Q as s};
