import{i as e,o as t,r as n}from"./button-DJ30HgDO.js";e();var r=t(n(),1);const i=({checked:e,onChange:t,label:n,className:i=``,labelClassName:a=``,disabled:o=!1})=>(0,r.jsxs)(`label`,{className:`flex items-center gap-2 ${o?`opacity-50 cursor-not-allowed`:`cursor-pointer`} ${i}`,children:[(0,r.jsxs)(`div`,{className:`relative`,children:[(0,r.jsx)(`input`,{type:`checkbox`,className:`sr-only peer`,checked:e,onChange:e=>!o&&t(e.target.checked),disabled:o,role:`switch`}),(0,r.jsxs)(`div`,{className:`w-[55px] h-[26px] rounded-full relative transition-colors duration-200 ease-in-out border border-transparent ${e?`bg-btn-primary dark:bg-btn-primary-dark`:`bg-gray-200 dark:bg-gray-700`} peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-btn-primary`,children:[(0,r.jsx)(`span`,{className:`absolute left-1.5 top-1/2 -translate-y-1/2 text-[10px] font-bold text-btn-primary-text dark:text-btn-primary-text-dark transition-opacity duration-200 pointer-events-none ${e?`opacity-100`:`opacity-0`}`,children:`ON`}),(0,r.jsx)(`span`,{className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-[10px] font-bold text-gray-500 dark:text-gray-300 transition-opacity duration-200 pointer-events-none ${e?`opacity-0`:`opacity-100`}`,children:`OFF`}),(0,r.jsx)(`div`,{className:`absolute top-[2px] left-[2px] w-5 h-5 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out z-10 ${e?`translate-x-[29px]`:`translate-x-0`}`})]})]}),n&&(0,r.jsx)(`span`,{className:`text-sm font-medium select-none ${a?``:`text-btn-primary-text dark:text-btn-primary-text-dark`} ${a}`,children:n})]});export{i as t};