(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12283,e=>{"use strict";var t=e.i(90795),r=e.i(59369);let n=(0,r.createContext)(void 0);function a({children:e}){let[a,o]=(0,r.useState)(null),[s,l]=(0,r.useState)(null),[i,c]=(0,r.useState)(!1),u=(0,r.useMemo)(()=>"default",[]);(0,r.useEffect)(()=>{async function e(){try{let e=await fetch("/api/state");if(!e.ok)throw Error("Failed to fetch state");let t=await e.json();o(t),c(!0),l(null)}catch(e){e instanceof TypeError&&"Failed to fetch"===e.message?l("specific dev is not running. Restart it to reconnect."):l(e instanceof Error?e.message:"Unknown error"),c(!1)}}e();let t=setInterval(e,2e3);return()=>clearInterval(t)},[]);let m=a?.resources.some(e=>"postgres"===e.type)??!1,d=(0,r.useMemo)(()=>{var e;return u?(e=a?.drizzleGatewayPort)?`http://localhost:${e}`:"":null},[u,a?.drizzleGatewayPort]),h=a?.hasTemporal??!1,f=(0,r.useMemo)(()=>{var e;return u?(e=a?.temporalUiPort)?`http://localhost:${e}`:"":null},[u,a?.temporalUiPort]),v=a?.hasMail??!1,y=a?.mailApiUrl??null,p=a?.projectId??null,g=(0,r.useMemo)(()=>({state:a,error:s,connected:i,instanceKey:u,hasDatabases:m,drizzleGatewayUrl:d,hasTemporal:h,temporalUiUrl:f,hasMail:v,mailApiUrl:y,projectId:p}),[a,s,i,u,m,d,h,f,v,y,p]);return(0,t.jsx)(n.Provider,{value:g,children:e})}function o(){let e=(0,r.useContext)(n);if(void 0===e)throw Error("useDevState must be used within a DevStateProvider");return e}e.s(["DevStateProvider",()=>a,"useDevState",()=>o],12283)},70932,e=>{"use strict";var t=e.i(59369),r=(e,t,r,n,a,o,s,l)=>{let i=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&o?a.map(e=>o[e]||e):a;r?(i.classList.remove(...n),i.classList.add(o&&o[t]?o[t]:t)):i.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=s&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},n=["light","dark"],a="(prefers-color-scheme: dark)",o="u"<typeof window,s=t.createContext(void 0),l={setTheme:e=>{},themes:[]},i=()=>{var e;return null!=(e=t.useContext(s))?e:l},c=e=>t.useContext(s)?t.createElement(t.Fragment,null,e.children):t.createElement(m,{...e}),u=["light","dark"],m=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:l=!0,storageKey:i="theme",themes:c=u,defaultTheme:m=o?"system":"light",attribute:y="data-theme",value:p,children:g,nonce:w,scriptProps:b})=>{let[S,T]=t.useState(()=>h(i,m)),[E,C]=t.useState(()=>"system"===S?v():S),P=p?Object.values(p):c,k=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=v());let a=p?p[t]:t,s=r?f(w):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...P),a&&i.classList.add(a)):e.startsWith("data-")&&(a?i.setAttribute(e,a):i.removeAttribute(e))};if(Array.isArray(y)?y.forEach(c):c(y),l){let e=n.includes(m)?m:null,r=n.includes(t)?t:e;i.style.colorScheme=r}null==s||s()},[w]),A=t.useCallback(e=>{let t="function"==typeof e?e(S):e;T(t);try{localStorage.setItem(i,t)}catch(e){}},[S]),M=t.useCallback(t=>{C(v(t)),"system"===S&&o&&!e&&k("system")},[S,e]);t.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),t.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?T(e.newValue):A(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[A]),t.useEffect(()=>{k(null!=e?e:S)},[e,S]);let L=t.useMemo(()=>({theme:S,setTheme:A,forcedTheme:e,resolvedTheme:"system"===S?E:S,themes:o?[...c,"system"]:c,systemTheme:o?E:void 0}),[S,A,e,E,o,c]);return t.createElement(s.Provider,{value:L},t.createElement(d,{forcedTheme:e,storageKey:i,attribute:y,enableSystem:o,enableColorScheme:l,defaultTheme:m,value:p,themes:c,nonce:w,scriptProps:b}),g)},d=t.memo(({forcedTheme:e,storageKey:n,attribute:a,enableSystem:o,enableColorScheme:s,defaultTheme:l,value:i,themes:c,nonce:u,scriptProps:m})=>{let d=JSON.stringify([a,n,l,e,c,i,o,s]).slice(1,-1);return t.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"u"<typeof window?u:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${d})`}})}),h=(e,t)=>{let r;if(!o){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},v=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light");e.s(["ThemeProvider",()=>c,"useTheme",()=>i])},49311,e=>{"use strict";var t=e.i(90795),r=e.i(70932);function n({children:e,...n}){return(0,t.jsx)(r.ThemeProvider,{...n,children:e})}e.s(["ThemeProvider",()=>n])}]);