// Direction B — "Operator" // Grafana-leaning. KPI tiles, gauges, more status color. Cooler slate base. const B = (() => { const { useMemo, useState } = React; const { bytes, speed, pct, relTime, duration, airTime, weekday, STATUS_TONE, seedingHealth, sourceLink, LINKS } = window.HL; const tones = { ok: "var(--b-ok)", bad: "var(--b-bad)", warn: "var(--b-warn)", info: "var(--b-info)", muted: "var(--b-muted)", }; // Per-panel collapsed state, persisted to localStorage so it survives // reloads and sessions. Key is derived from the panel title. const COLLAPSE_KEY_PREFIX = "dashboard:collapsed:"; const slugify = (s) => String(s || "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""); const readCollapsed = (slug) => { if (!slug) return false; try { return window.localStorage.getItem(COLLAPSE_KEY_PREFIX + slug) === "1"; } catch { return false; } }; const writeCollapsed = (slug, val) => { if (!slug) return; try { if (val) window.localStorage.setItem(COLLAPSE_KEY_PREFIX + slug, "1"); else window.localStorage.removeItem(COLLAPSE_KEY_PREFIX + slug); } catch { /* private mode etc — fall back to session-only state */ } }; const Chip = ({ tone = "muted", children, solid }) => ( {children} ); // `href` → a single "OPEN ↗" link. `links` → one labelled // "OPEN