import{s as h}from"./chunk-DZLz74EQ.js";import{c as f,d as o,n as d}from"./jotai-DDOP7CKM.js";import{n as k}from"./jsx-runtime-DvsdsEjx.js";import{g,t as y}from"./utils-DnJCRgaX.js";var b=h(k(),1);const p=["light","dark","system"];var v=o(e=>{if(y()){if(document.body.classList.contains("dark-mode")||document.body.classList.contains("dark")||document.body.dataset.theme==="dark"||document.body.dataset.mode==="dark"||s()==="dark")return"dark";let t=window.getComputedStyle(document.body),r=t.getPropertyValue("color-scheme").trim();if(r)return r.includes("dark")?"dark":"light";let a=t.getPropertyValue("background-color").match(/\d+/g);if(a){let[m,u,l]=a.map(Number);return(m*299+u*587+l*114)/1e3<128?"dark":"light"}return"light"}return e(g).display.theme}),n=o(!1);function w(){if(typeof window>"u"||!window.matchMedia)return;let e=window.matchMedia("(prefers-color-scheme: dark)");d.set(n,e.matches),e.addEventListener("change",t=>{d.set(n,t.matches)})}w();function s(){switch(document.body.dataset.vscodeThemeKind){case"vscode-dark":return"dark";case"vscode-high-contrast":return"dark";case"vscode-light":return"light"}}var c=o(s());function L(){let e=new MutationObserver(()=>{let t=s();d.set(c,t)});return e.observe(document.body,{attributes:!0,attributeFilter:["data-vscode-theme-kind"]}),()=>e.disconnect()}L();const i=o(e=>{let t=e(v),r=e(c);if(r!==void 0)return r;let a=e(n);return t==="system"?a?"dark":"light":t});function M(){let e=(0,b.c)(3),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={store:d},e[0]=t):t=e[0];let r=f(i,t),a;return e[1]===r?a=e[2]:(a={theme:r},e[1]=r,e[2]=a),a}export{i as n,M as r,p as t};
