import{i as e,o as t,r as n,t as r}from"./button-DJ30HgDO.js";import{g as i,x as a}from"./free-solid-svg-icons-CttZC1b4.js";var o=t(e(),1);const s=`_mlflow_dark_mode_toggle_enabled`,c=`databricks-dark-mode-pref`,l=e=>{e?(document.documentElement.classList.add(`dark`),localStorage.setItem(s,`true`),localStorage.setItem(c,`dark`)):(document.documentElement.classList.remove(`dark`),localStorage.setItem(s,`false`),localStorage.setItem(c,`light`))},u=()=>{let e=localStorage.getItem(s),t;return t=e===`true`?!0:e===`false`?!1:window.matchMedia(`(prefers-color-scheme: dark)`).matches,t},d=()=>{l(u())},f=()=>{let[e,t]=(0,o.useState)(u);return(0,o.useEffect)(()=>{l(e)},[e]),{isDark:e,toggleTheme:(0,o.useCallback)(()=>{t(e=>!e)},[])}};var p=t(n(),1),m=()=>{let{isDark:e,toggleTheme:t}=f();return(0,p.jsx)(r,{variant:`ghost`,onClick:t,title:e?`Switch to Light Mode`:`Switch to Dark Mode`,"aria-label":e?`Switch to Light Mode`:`Switch to Dark Mode`,icon:e?i:a,iconClassName:`text-sm`})};export{d as n,m as t};