(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{15272:(e,t,r)=>{var a={"./en.json":[99373,99373],"./zh.json":[4860,4860]};function n(e){if(!r.o(a,e))return Promise.resolve().then(()=>{var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=a[e],n=t[0];return r.e(t[1]).then(()=>r.t(n,19))}n.keys=()=>Object.keys(a),n.id=15272,e.exports=n},23602:(e,t,r)=>{"use strict";r.d(t,{D:()=>i,ThemeProvider:()=>u});var a=r(90508),n=r(1856);let o="synapse-theme",s=(0,n.createContext)(void 0);function l(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){"undefined"!=typeof document&&(document.documentElement.classList.toggle("dark","dark"===e),document.documentElement.style.colorScheme=e)}function u(e){let{children:t}=e,[r,u]=(0,n.useState)("light"),[i,d]=(0,n.useState)("light");(0,n.useEffect)(()=>{let e=window.localStorage.getItem(o),t="light"===e||"dark"===e||"system"===e?e:"light",r="system"===t?l():t;u(t),d(r),c(r),document.cookie="synapse-theme=".concat(t,";path=/;max-age=").concat(31536e3,";SameSite=Lax")},[]),(0,n.useEffect)(()=>{if("system"!==r)return;let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{let e=l();d(e),c(e)};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[r]);let m=e=>{u(e),window.localStorage.setItem(o,e),document.cookie="synapse-theme=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax");let t="system"===e?l():e;d(t),c(t)},h=(0,n.useMemo)(()=>({theme:r,resolvedTheme:i,setTheme:m}),[i,r]);return(0,a.jsx)(s.Provider,{value:h,children:t})}function i(){let e=(0,n.useContext)(s);if(!e)throw Error("useTheme must be used within ThemeProvider");return e}},23675:(e,t,r)=>{"use strict";var a=r(84675);r.o(a,"useParams")&&r.d(t,{useParams:function(){return a.useParams}}),r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},25359:(e,t,r)=>{"use strict";r.d(t,{AL:()=>s,IB:()=>a,L$:()=>o,q:()=>n});let a=["en","zh"],n="en",o={en:"English",zh:"中文"};function s(){if("undefined"==typeof navigator)return n;let e=navigator.language.split("-")[0];return a.includes(e)?e:n}},32277:(e,t,r)=>{"use strict";r.d(t,{LocaleProvider:()=>m,Y:()=>d});var a=r(90508),n=r(1856),o=r(23675),s=r(57472),l=r(25359),c=r(67712);let u="synapse-locale",i=(0,n.createContext)(null);function d(){let e=(0,n.useContext)(i);if(!e)throw Error("useLocale must be used within LocaleProvider");return e}function m(e){let{children:t}=e,d=(0,o.useRouter)(),[m,h]=(0,n.useState)(l.q),[f,v]=(0,n.useState)(null),[g,y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e,t=localStorage.getItem(u);t&&l.IB.includes(t)?e=t:(e=(0,l.AL)(),localStorage.setItem(u,e)),h(e),document.cookie="synapse-locale=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax"),y(!0)},[]),(0,n.useEffect)(()=>{g&&r(15272)("./".concat(m,".json")).then(e=>{v(e.default)}).catch(e=>{c.q.error("Failed to load messages for locale ".concat(m,":"),e),r(15272)("./".concat(l.q,".json")).then(e=>{v(e.default)})})},[m,g]);let S=(0,n.useCallback)(e=>{h(e),localStorage.setItem(u,e),document.cookie="synapse-locale=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax"),document.documentElement.lang=e,d.refresh()},[d]);return g&&f?(0,a.jsx)(i.Provider,{value:{locale:m,setLocale:S},children:(0,a.jsx)(s.default,{locale:m,messages:f,children:t})}):null}},44902:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,66160,23)),Promise.resolve().then(r.t.bind(r,49408,23)),Promise.resolve().then(r.t.bind(r,94651,23)),Promise.resolve().then(r.bind(r,32277)),Promise.resolve().then(r.bind(r,23602))},49408:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_c29908",variable:"__variable_c29908"}},57472:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var a=r(12079),n=r(90508);function o(e){let{locale:t,...r}=e;if(!t)throw Error(void 0);return(0,n.jsx)(a.Dk,{locale:t,...r})}},66160:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_246ccd",variable:"__variable_246ccd"}},67712:(e,t,r)=>{"use strict";r.d(t,{q:()=>l});var a,n=r(34897);let o={debug:0,info:1,warn:2,error:3},s=null!=(a=o[n.env.NEXT_PUBLIC_LOG_LEVEL||"warn"])?a:o.warn,l={debug(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.debug>=s&&console.debug("[Synapse]",...t)},info(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.info>=s&&console.info("[Synapse]",...t)},warn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.warn>=s&&console.warn("[Synapse]",...t)},error(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];o.error>=s&&console.error("[Synapse]",...t)}}},94651:()=>{}},e=>{e.O(0,[53169,32492,12079,74951,65496,77358],()=>e(e.s=44902)),_N_E=e.O()}]);