{"version":3,"file":"next-themes-D8rgB_FP.js","sources":["../../node_modules/.pnpm/next-themes@0.3.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next-themes/dist/index.mjs"],"sourcesContent":["\"use client\";import*as t from\"react\";var P=[\"light\",\"dark\"],E=\"(prefers-color-scheme: dark)\",Q=typeof window==\"undefined\",L=t.createContext(void 0),D={setTheme:e=>{},themes:[]},j=()=>{var e;return(e=t.useContext(L))!=null?e:D},z=e=>t.useContext(L)?e.children:t.createElement(O,{...e}),N=[\"light\",\"dark\"],O=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:n=!0,enableColorScheme:g=!0,storageKey:m=\"theme\",themes:c=N,defaultTheme:o=n?\"system\":\"light\",attribute:y=\"data-theme\",value:h,children:k,nonce:w})=>{let[i,d]=t.useState(()=>M(m,o)),[S,l]=t.useState(()=>M(m)),u=h?Object.values(h):c,R=t.useCallback(s=>{let r=s;if(!r)return;s===\"system\"&&n&&(r=T());let v=h?h[r]:r,C=a?_():null,x=document.documentElement;if(y===\"class\"?(x.classList.remove(...u),v&&x.classList.add(v)):v?x.setAttribute(y,v):x.removeAttribute(y),g){let I=P.includes(o)?o:null,A=P.includes(r)?r:I;x.style.colorScheme=A}C==null||C()},[]),f=t.useCallback(s=>{let r=typeof s==\"function\"?s(s):s;d(r);try{localStorage.setItem(m,r)}catch(v){}},[e]),p=t.useCallback(s=>{let r=T(s);l(r),i===\"system\"&&n&&!e&&R(\"system\")},[i,e]);t.useEffect(()=>{let s=window.matchMedia(E);return s.addListener(p),p(s),()=>s.removeListener(p)},[p]),t.useEffect(()=>{let s=r=>{if(r.key!==m)return;let v=r.newValue||o;f(v)};return window.addEventListener(\"storage\",s),()=>window.removeEventListener(\"storage\",s)},[f]),t.useEffect(()=>{R(e!=null?e:i)},[e,i]);let $=t.useMemo(()=>({theme:i,setTheme:f,forcedTheme:e,resolvedTheme:i===\"system\"?S:i,themes:n?[...c,\"system\"]:c,systemTheme:n?S:void 0}),[i,f,e,S,n,c]);return t.createElement(L.Provider,{value:$},t.createElement(U,{forcedTheme:e,disableTransitionOnChange:a,enableSystem:n,enableColorScheme:g,storageKey:m,themes:c,defaultTheme:o,attribute:y,value:h,children:k,attrs:u,nonce:w}),k)},U=t.memo(({forcedTheme:e,storageKey:a,attribute:n,enableSystem:g,enableColorScheme:m,defaultTheme:c,value:o,attrs:y,nonce:h})=>{let k=c===\"system\",w=n===\"class\"?`var d=document.documentElement,c=d.classList;${`c.remove(${y.map(u=>`'${u}'`).join(\",\")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,i=m?(P.includes(c)?c:null)?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${c}'`:\"if(e==='light'||e==='dark')d.style.colorScheme=e\":\"\",d=(l,u=!1,R=!0)=>{let f=o?o[l]:l,p=u?l+\"|| ''\":`'${f}'`,$=\"\";return m&&R&&!u&&P.includes(l)&&($+=`d.style.colorScheme = '${l}';`),n===\"class\"?u||f?$+=`c.add(${p})`:$+=\"null\":f&&($+=`d[s](n,${p})`),$},S=e?`!function(){${w}${d(e)}}()`:g?`!function(){try{${w}var e=localStorage.getItem('${a}');if('system'===e||(!e&&${k})){var t='${E}',m=window.matchMedia(t);if(m.media!==t||m.matches){${d(\"dark\")}}else{${d(\"light\")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:\"\"}${d(o?\"x[e]\":\"e\",!0)}}${k?\"\":\"else{\"+d(c,!1,!1)+\"}\"}${i}}catch(e){}}()`:`!function(){try{${w}var e=localStorage.getItem('${a}');if(e){${o?`var x=${JSON.stringify(o)};`:\"\"}${d(o?\"x[e]\":\"e\",!0)}}else{${d(c,!1,!1)};}${i}}catch(t){}}();`;return t.createElement(\"script\",{nonce:h,dangerouslySetInnerHTML:{__html:S}})}),M=(e,a)=>{if(Q)return;let n;try{n=localStorage.getItem(e)||void 0}catch(g){}return n||a},_=()=>{let e=document.createElement(\"style\");return e.appendChild(document.createTextNode(\"*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},T=e=>(e||(e=window.matchMedia(E)),e.matches?\"dark\":\"light\");export{z as ThemeProvider,j as useTheme};\n"],"names":["P","E","L","t.createContext","D","e","j","t.useContext","t.memo","a","n","g","m","c","o","h","k","w","u","i","d","l","R","f","p","$","S","t.createElement"],"mappings":"wCAAwC,IAACA,EAAE,CAAC,QAAQ,MAAM,EAAEC,EAAE,+BAA4DC,EAAEC,EAAe,cAAC,MAAM,EAAEC,EAAE,CAAC,SAASC,GAAG,CAAA,EAAG,OAAO,CAAE,CAAA,EAAEC,EAAE,IAAI,CAAC,IAAID,EAAE,OAAOA,EAAEE,EAAAA,WAAaL,CAAC,IAAI,KAAKG,EAAED,CAAC,EAAiiDI,EAAAA,KAAO,CAAC,CAAC,YAAYH,EAAE,WAAWI,EAAE,UAAUC,EAAE,aAAaC,EAAE,kBAAkBC,EAAE,aAAaC,EAAE,MAAMC,EAAE,MAAM,EAAE,MAAMC,CAAC,IAAI,CAAC,IAAIC,EAAEH,IAAI,SAASI,EAAEP,IAAI,QAAQ,gDAAgD,YAAY,EAAE,IAAIQ,GAAG,IAAIA,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,IAAI,qCAAqCR,CAAC,sBAAsBS,EAAEP,EAAGZ,EAAE,SAASa,CAAC,GAAEA,EAAQ,0DAA0DA,CAAC,IAAI,mDAAmD,GAAGO,EAAE,CAACC,EAAEH,EAAE,GAAGI,EAAE,KAAK,CAAC,IAAIC,EAAET,EAAEA,EAAEO,CAAC,EAAEA,EAAEG,EAAEN,EAAEG,EAAE,QAAQ,IAAIE,CAAC,IAAIE,EAAE,GAAG,OAAOb,GAAGU,GAAG,CAACJ,GAAGlB,EAAE,SAASqB,CAAC,IAAII,GAAG,0BAA0BJ,CAAC,MAAMX,IAAI,QAAQQ,GAAGK,EAAEE,GAAG,SA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