import{c as t,b as r,n as i,t as d,i as l,o as a}from"./app-CYVHboi-.js";const m={class:"flex items-center"},g=["disabled"],b={key:0,class:"font-medium"},f={key:1,class:"text-mute ms-1"},x={__name:"Toggle",props:{id:{type:String,default(){return(Math.random()+"").replace("0.","")}},modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:String,text:String,error:String},emits:["change","update:modelValue"],setup(e,{emit:u}){const n=u,s=e;function o(){n("update:modelValue",!s.modelValue),n("change",!s.modelValue)}return(c,h)=>(a(),t("div",m,[r("button",{type:"button",role:"switch",disabled:e.disabled,onClick:o,class:i([e.modelValue?"bg-primary-600":"bg-gray-200 dark:bg-gray-700","relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-primary-600 focus:ring-offset-2 focus:outline-hidden disabled:cursor-not-allowed!"])},[r("span",{class:i([e.modelValue?c.$page.props.settings?.rtl_support=="1"?"-translate-x-5 bg-white":"translate-x-5 bg-white":"translate-x-0 bg-white dark:bg-gray-500","pointer-events-none inline-block size-5 transform rounded-full shadow-sm ring-0 transition duration-200 ease-in-out"])},null,2)],10,g),e.label||e.text?(a(),t("label",{key:0,class:"ms-3 text-sm",onClick:o},[e.label?(a(),t("span",b,d(e.label),1)):l("",!0),e.text?(a(),t("span",f,d(e.text),1)):l("",!0)])):l("",!0)]))}};export{x as _};
