import{A as s,a as m,g as a,v as c}from"/build/_shared/chunk-IYEHZB2Y.js";import{d as n}from"/build/_shared/chunk-4AMCPB2Y.js";function u(){return c("root").requestInfo}var i=n(m(),1);var d=n(s(),1),r={theme:{cookieName:"KCDShop_CH-prefers-color-scheme",getValueCode:"window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'",fallback:"light",transform(e){return e==="dark"?"dark":"light"}},reducedMotion:{cookieName:"KCDShop_CH-reduced-motion",getValueCode:"window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'reduce' : 'no-preference'",fallback:"no-preference",transform(e){return e==="reduce"?"reduce":"no-preference"}},timeZone:{cookieName:"CH-time-zone",getValueCode:"Intl.DateTimeFormat().resolvedOptions().timeZone",fallback:"Etc/UTC",transform(e){return decodeURIComponent(e??"Etc%2FUTC")}}};function k(){return u().hints}function g(){let{revalidate:e}=a();return i.useEffect(()=>{let t=window.matchMedia("(prefers-color-scheme: dark)");function o(){document.cookie=`${r.theme.cookieName}=${t.matches?"dark":"light"}; Max-Age=31536000; Path=/`,e()}return t.addEventListener("change",o),()=>{t.removeEventListener("change",o)}},[e]),i.useEffect(()=>{let t=window.matchMedia("(prefers-reduced-motion: reduce)");function o(){document.cookie=`${r.reducedMotion.cookieName}=${t.matches?"reduce":"no-preference"}; Max-Age=31536000; Path=/`,e()}return t.addEventListener("change",o),()=>{t.removeEventListener("change",o)}}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:`
const cookies = document.cookie.split(';').map(c => c.trim()).reduce((acc, cur) => {
	const [key, value] = cur.split('=');
	acc[key] = value;
	return acc;
}, {});
let cookieChanged = false;
const hints = [
${Object.values(r).map(t=>{let o=JSON.stringify(t.cookieName);return`{ name: ${o}, actual: String(${t.getValueCode}), cookie: cookies[${o}] }`}).join(`,
`)}
];
for (const hint of hints) {
	if (decodeURIComponent(hint.cookie) !== hint.actual) {
		cookieChanged = true;
		document.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; Path=/';
	}
}
if (cookieChanged && navigator.cookieEnabled) {
	window.location.reload();
}
			`}})}export{u as a,k as b,g as c};
//# sourceMappingURL=/build/_shared/chunk-HTTIUZX4.js.map
