Something went wrong. Try again.
Automations and webhooks for the AT Protocol airglow.run
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import { WORDMARK_BOOTSTRAP } from "./components/FooterWordmark/bootstrap.js";import { RAYS_BOOTSTRAP } from "./components/HeroRays/bootstrap.js";
// Every inline <script> the app ships is a fixed string listed here, so// lib/security-headers.ts can allow each one in `script-src` by its SHA-256// hash. A per-request nonce cannot do that job on a page the edge caches: every// visitor would be handed the same, publicly readable nonce. A new inline// script goes in INLINE_SCRIPTS, or the CSP blocks it.
/** Blocking script: set data-theme before paint. Stored 'light'/'dark' wins; * 'auto' leaves the attribute unset so the prefers-color-scheme media query * applies. With nothing stored we default to 'light' regardless of the OS * preference (light is the default theme). * * A pinned theme also pins the browser's own UI: `<meta name="color-scheme">` * (scrollbars, form controls, the canvas before the stylesheet loads) and both * `theme-color` metas (the mobile browser bar). The renderer emits all three * before this script, set for 'auto', so 'auto' leaves them as they are; each * theme-color meta names its scheme (`data-scheme`) and that scheme's colour * (`data-color`). */export const THEME_BOOTSTRAP = `(function(){var t=localStorage.getItem('theme'),d=document;if(t==='auto')return;if(t!=='dark')t='light';d.documentElement.dataset.theme=t;d.querySelector('meta[name="color-scheme"]').content=t;var c=d.querySelector('meta[name="theme-color"][data-scheme="'+t+'"]').dataset.color;d.querySelectorAll('meta[name="theme-color"]').forEach(function(m){m.content=c})})()`;
/** Speculation Rules (Chromium). `moderate` eagerness triggers on hover / * pointerdown, not page load — bots and bouncing users don't spend origin * quota. Non-supporting browsers ignore the script. * prerender: high-confidence CTAs. Next click is ~0ms perceived. * prefetch: broad list-style destinations. Fills the HTTP cache only, * so a mis-guess is cheap (no JS/render budget consumed). */export const SPECULATION_RULES = JSON.stringify({ prerender: [ { where: { href_matches: ["/auth/login", "/automations/new"] }, eagerness: "moderate", }, ], prefetch: [ { where: { href_matches: ["/lexicons/*", "/u/*"] }, eagerness: "moderate", }, ],});
/** The bodies `script-src` allows by hash. JSON-LD blocks are not listed: a * `type="application/ld+json"` script is a data block the browser never runs, * so CSP does not apply to it. */export const INLINE_SCRIPTS: readonly string[] = [ THEME_BOOTSTRAP, SPECULATION_RULES, RAYS_BOOTSTRAP, WORDMARK_BOOTSTRAP,];