const body=document.body,config=body.getAttribute("data-theme"),getThemeState=()=>{const t=localStorage.getItem("theme");if(t)return t;let e;switch(config){case"dark":e="dark";break;case"light":e="light";break;case"auto":default:e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";break}return e},initTheme=e=>{e==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light")):e==="light"&&(document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"))};initTheme(getThemeState()),setTimeout(()=>body.classList.remove("notransition"),75)