/* global React */ const { useState, useEffect, useRef } = React; window.KitChrome = {}; // ============================================================================ // HCR Ticker — live-feeling micro chip in the status strip. // Fakes a smooth random-walk price; consistent seed per session. // ============================================================================ window.KitChrome.HCRTicker = function HCRTicker() { const [price, setPrice] = useState(0.1842); const [delta, setDelta] = useState(0.024); useEffect(() => { const id = setInterval(() => { setPrice(p => { const drift = (Math.random() - 0.48) * 0.0008; return Math.max(0.10, Math.min(0.40, p + drift)); }); setDelta(d => Math.max(-0.06, Math.min(0.08, d + (Math.random() - 0.5) * 0.004))); }, 2200); return () => clearInterval(id); }, []); const up = delta >= 0; return ( HCR/HCC ${price.toFixed(4)} {up ? "▲" : "▼"} {(Math.abs(delta) * 100).toFixed(2)}% ); }; // ============================================================================ // AppSwitcher — 9-dot launcher in the top-right of every nav bar. // Reveals all 11 ecosystem properties grouped by role. // ============================================================================ window.KitChrome.AppSwitcher = function AppSwitcher({ currentId, hideRoles = [] }) { const [open, setOpen] = useState(false); const ref = useRef(null); useEffect(() => { if (!open) return; const onClick = (e) => { if (ref.current && !ref.current.contains(e.target)) setOpen(false); }; const onEsc = (e) => { if (e.key === "Escape") setOpen(false); }; document.addEventListener("mousedown", onClick); document.addEventListener("keydown", onEsc); return () => { document.removeEventListener("mousedown", onClick); document.removeEventListener("keydown", onEsc); }; }, [open]); const groups = {}; window.CHBrand.ecosystem.forEach(p => { (groups[p.role] = groups[p.role] || []).push(p); }); const allRoles = []; const order = hideRoles.length ? allRoles.filter(r => !hideRoles.includes(r)) : allRoles; return (
{open && (
The Conceptual Health® ecosystem {window.CHBrand.position}
{order.flatMap(role => (groups[role] || []).map(p => ( {p.axis} {p.name} {p.sub} )))}
{window.CHBrand.equation} {window.CHBrand.compliance.patent}
)}
); }; // ============================================================================ // StatusStrip — top-of-page brand chrome // ============================================================================ window.KitChrome.StatusStrip = function StatusStrip({ right }) { const B = window.CHBrand; return (
“{B.tagline}” — {B.legal}
· {right || <> {B.compliance.hipaa} · {B.compliance.soc2} · {B.compliance.cap} }
); }; // ============================================================================ // Nav — primary navigation. Now hosts AppSwitcher on the right edge. // ============================================================================ window.KitChrome.Nav = function Nav({ brand, sub, links, tab, setTab, primary, secondary, currentId }) { return ( ); }; // ============================================================================ // MasterEquationArtifact — persistent footer signature. // Drop this above