···11+import { dev } from "$app/environment";
22+import dolly from "../../../static/logos/dolly.svg?raw";
33+import type { RequestHandler } from "./$types";
44+55+// the logo is monochrome and tracks the color scheme, so we repaint the favicon
66+// per environment to tell a local or next tab apart from production at a glance
77+const devTint = "#d97706"; // --color-foreground-warning
88+const nextTint = "#4338ca"; // --color-foreground-info
99+1010+export const prerender = false;
1111+1212+export const GET: RequestHandler = ({ url }) => {
1313+ const tint = dev ? devTint : url.hostname === "next.tangled.org" ? nextTint : null;
1414+ const svg = tint ? dolly.replace(/color:\s*#[0-9a-f]{3,8};/gi, `color: ${tint};`) : dolly;
1515+1616+ return new Response(svg, {
1717+ headers: {
1818+ "content-type": "image/svg+xml",
1919+ "cache-control": dev ? "no-store" : "public, max-age=3600"
2020+ }
2121+ });
2222+};