{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "how-flow-diagram",
  "type": "registry:component",
  "title": "How It Works: Flow Diagram",
  "description": "Four connected nodes for input, process, review and output, with packets traveling along the paths, a skip route and a loop back. Hovering or focusing a node shows its details below.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "how-it-works",
    "flow",
    "diagram",
    "pipeline",
    "workflow",
    "nodes",
    "animated"
  ],
  "docs": "https://hyperblur.dev/effects/how-flow-diagram",
  "files": [
    {
      "path": "registry/hyperblur/how-flow-diagram.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/how-flow-diagram.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HowFlowDiagramStat {\n  label: string;\n  value: string;\n}\n\nexport interface HowFlowDiagramNode {\n  stage: string;\n  title: string;\n  metric: string;\n  description: string;\n  stats?: HowFlowDiagramStat[];\n}\n\nexport interface HowFlowDiagramProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  live?: string;\n  nodes?: HowFlowDiagramNode[];\n  skipLabel?: string;\n  loopLabel?: string;\n  defaultActive?: number;\n  onNodeActive?: (index: number) => void;\n  accent?: string;\n}\n\nconst css = `\n@keyframes hb-kh4-flow { to { stroke-dashoffset: -24; } }\n@keyframes hb-kh4-blink {\n  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hb-kh4-accent) 60%, transparent); }\n  100% { box-shadow: 0 0 0 7px transparent; }\n}\n@keyframes hb-kh4-in {\n  from { opacity: 0; transform: translate3d(0, 6px, 0); }\n  to { opacity: 1; transform: none; }\n}\n.hb-kh4 {\n  --hb-kh4-accent: #22d3ee;\n  --hb-kh4-warn: #fbbf24;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  container: hb-kh4-root / inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-kh4 *, .hb-kh4 *::before, .hb-kh4 *::after { box-sizing: border-box; }\n.hb-kh4::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  background:\n    radial-gradient(50% 50% at 50% 55%, color-mix(in srgb, var(--hb-kh4-accent) 9%, transparent), transparent 70%),\n    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.015));\n}\n.hb-kh4-in {\n  position: relative;\n  max-width: 1120px;\n  margin: 0 auto;\n  padding: 72px 20px 80px;\n}\n.hb-kh4-head {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 20px 32px;\n}\n.hb-kh4-copy { max-width: 580px; }\n.hb-kh4-eyebrow {\n  font-family: var(--font-mono, ui-monospace), SFMono-Regular, Menlo, monospace;\n  color: var(--hb-kh4-accent);\n  font-size: 12px;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n}\n.hb-kh4-title {\n  margin: 12px 0 0;\n  font-size: clamp(30px, 4.3cqw, 42px);\n  font-weight: 600;\n  line-height: 1.08;\n  letter-spacing: -0.035em;\n  text-wrap: balance;\n}\n.hb-kh4-sub {\n  margin: 14px 0 0;\n  color: #8f8f8f;\n  font-size: 16px;\n  line-height: 1.6;\n  text-wrap: pretty;\n}\n.hb-kh4-live {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  height: 34px;\n  padding: 0 14px;\n  border: 1px solid rgba(255, 255, 255, 0.09);\n  border-radius: 999px;\n  background: rgba(255, 255, 255, 0.03);\n  color: #c9c9c9;\n  font-size: 13px;\n  font-variant-numeric: tabular-nums;\n}\n.hb-kh4-live::before {\n  content: \"\";\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n  background: var(--hb-kh4-accent);\n  animation: hb-kh4-blink 1.6s ease-out infinite;\n}\n.hb-kh4-frame {\n  margin-top: 40px;\n  padding: 18px 12px;\n  border: 1px solid rgba(255, 255, 255, 0.07);\n  border-radius: 22px;\n  background:\n    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 18px 18px,\n    linear-gradient(180deg, #0f0f0f, #0b0b0b);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);\n}\n.hb-kh4-dia {\n  position: relative;\n  width: 100%;\n  max-width: 400px;\n  margin: 0 auto;\n  aspect-ratio: 360 / 820;\n  container-type: inline-size;\n}\n.hb-kh4-svg {\n  position: absolute;\n  inset: 0;\n  width: 100%;\n  height: 100%;\n  overflow: visible;\n}\n.hb-kh4-svg-w { display: none; }\n.hb-kh4-path { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 1.5; transition: stroke 0.3s ease; }\n.hb-kh4-path[data-on=\"true\"] { stroke: color-mix(in srgb, var(--hb-kh4-accent) 45%, rgba(255, 255, 255, 0.15)); }\n.hb-kh4-flow { fill: none; stroke: var(--hb-kh4-accent); stroke-width: 1.5; stroke-dasharray: 2 10; stroke-linecap: round; opacity: 0.55; animation: hb-kh4-flow 1.1s linear infinite; }\n.hb-kh4-flow-warn { stroke: var(--hb-kh4-warn); opacity: 0.45; }\n.hb-kh4-pkt { fill: #ffffff; filter: drop-shadow(0 0 5px var(--hb-kh4-accent)); }\n.hb-kh4-pkt-warn { fill: var(--hb-kh4-warn); filter: drop-shadow(0 0 5px var(--hb-kh4-warn)); }\n.hb-kh4-tip { fill: rgba(255, 255, 255, 0.35); }\n.hb-kh4-node {\n  position: absolute;\n  left: var(--nx);\n  top: var(--ny);\n  width: var(--nw);\n  height: var(--nh);\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n  margin: 0;\n  padding: 3.6cqw 4.2cqw;\n  border: 1px solid rgba(255, 255, 255, 0.1);\n  border-radius: 4.4cqw;\n  background: linear-gradient(180deg, #171717, #111111);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 40px -24px rgba(0, 0, 0, 0.9);\n  color: inherit;\n  font: inherit;\n  text-align: left;\n  cursor: pointer;\n  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;\n}\n.hb-kh4-node:hover { border-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }\n.hb-kh4-node[data-active=\"true\"] {\n  border-color: var(--hb-kh4-accent);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 4px color-mix(in srgb, var(--hb-kh4-accent) 12%, transparent), 0 20px 50px -20px color-mix(in srgb, var(--hb-kh4-accent) 50%, transparent);\n}\n.hb-kh4-node:focus-visible { outline: 2px solid var(--hb-kh4-accent); outline-offset: 3px; }\n.hb-kh4-ntop { display: flex; align-items: center; justify-content: space-between; gap: 6px; }\n.hb-kh4-ico {\n  display: grid;\n  place-items: center;\n  width: 8.4cqw;\n  height: 8.4cqw;\n  border: 1px solid rgba(255, 255, 255, 0.1);\n  border-radius: 2.4cqw;\n  background: #0d0d0d;\n  color: #bdbdbd;\n  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;\n}\n.hb-kh4-node[data-active=\"true\"] .hb-kh4-ico {\n  border-color: color-mix(in srgb, var(--hb-kh4-accent) 50%, transparent);\n  background: color-mix(in srgb, var(--hb-kh4-accent) 14%, #0d0d0d);\n  color: var(--hb-kh4-accent);\n}\n.hb-kh4-ico svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n.hb-kh4-stage {\n  font-family: var(--font-mono, ui-monospace), SFMono-Regular, Menlo, monospace;\n  color: #8f8f8f;\n  font-size: max(10px, 3.1cqw);\n  letter-spacing: 0.06em;\n  text-transform: uppercase;\n}\n.hb-kh4-ntitle {\n  display: block;\n  font-size: max(13px, 4.6cqw);\n  font-weight: 600;\n  letter-spacing: -0.015em;\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n.hb-kh4-metric {\n  display: block;\n  margin-top: 0.6cqw;\n  color: #9a9a9a;\n  font-size: max(10.5px, 3.4cqw);\n  font-variant-numeric: tabular-nums;\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n.hb-kh4-node[data-active=\"true\"] .hb-kh4-metric { color: var(--hb-kh4-accent); }\n.hb-kh4-lbl {\n  position: absolute;\n  left: var(--lx);\n  top: var(--ly);\n  display: none;\n  align-items: center;\n  gap: 6px;\n  padding: 0.5cqw 1.2cqw;\n  border: 1px solid rgba(255, 255, 255, 0.1);\n  border-radius: 999px;\n  background: #0d0d0d;\n  color: #bdbdbd;\n  font-size: max(10px, 1.15cqw);\n  white-space: nowrap;\n  transform: translate(-50%, -50%);\n}\n.hb-kh4-lbl i { width: 6px; height: 6px; border-radius: 50%; background: var(--hb-kh4-accent); }\n.hb-kh4-lbl[data-warn=\"true\"] i { background: var(--hb-kh4-warn); }\n.hb-kh4-legend {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  gap: 8px 16px;\n  margin-top: 14px;\n  color: #8f8f8f;\n  font-size: 12.5px;\n}\n.hb-kh4-legend span { display: inline-flex; align-items: center; gap: 6px; }\n.hb-kh4-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--hb-kh4-accent); }\n.hb-kh4-legend span:last-child i { background: var(--hb-kh4-warn); }\n.hb-kh4-detail {\n  display: grid;\n  grid-template-columns: 1fr;\n  gap: 16px;\n  margin-top: 16px;\n  padding: 20px;\n  border: 1px solid rgba(255, 255, 255, 0.08);\n  border-radius: 18px;\n  background: linear-gradient(180deg, #121212, #0e0e0e);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);\n}\n.hb-kh4-dcopy { animation: hb-kh4-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }\n.hb-kh4-dstage {\n  font-family: var(--font-mono, ui-monospace), SFMono-Regular, Menlo, monospace;\n  color: var(--hb-kh4-accent);\n  font-size: 11.5px;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n}\n.hb-kh4-dtitle { margin: 6px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }\n.hb-kh4-ddesc { margin: 6px 0 0; color: #9a9a9a; font-size: 14px; line-height: 1.55; }\n.hb-kh4-stats {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  gap: 8px;\n  margin: 0;\n}\n.hb-kh4-stat {\n  min-width: 0;\n  padding: 12px;\n  border: 1px solid rgba(255, 255, 255, 0.06);\n  border-radius: 12px;\n  background: #0b0b0b;\n  animation: hb-kh4-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;\n  animation-delay: calc(var(--i) * 60ms + 60ms);\n}\n.hb-kh4-stat dt { color: #8f8f8f; font-size: 11.5px; }\n.hb-kh4-stat dd {\n  margin: 4px 0 0;\n  overflow: hidden;\n  font-size: 15px;\n  font-weight: 600;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  font-variant-numeric: tabular-nums;\n}\n@container hb-kh4-root (min-width: 720px) {\n  .hb-kh4-in { padding: 88px 40px 104px; }\n  .hb-kh4-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 24px; padding: 22px 24px; }\n}\n@container hb-kh4-root (min-width: 840px) {\n  .hb-kh4-frame { padding: 24px 28px; }\n  .hb-kh4-dia { max-width: none; aspect-ratio: 1000 / 320; }\n  .hb-kh4-svg-n { display: none; }\n  .hb-kh4-svg-w { display: block; }\n  .hb-kh4-node {\n    left: var(--wx);\n    top: var(--wy);\n    width: var(--ww);\n    height: var(--wh);\n    padding: 1.6cqw 1.7cqw;\n    border-radius: 1.8cqw;\n  }\n  .hb-kh4-ico { width: 3.2cqw; height: 3.2cqw; border-radius: 0.9cqw; }\n  .hb-kh4-stage { font-size: max(10px, 1.1cqw); }\n  .hb-kh4-ntitle { font-size: max(13px, 1.8cqw); }\n  .hb-kh4-metric { font-size: max(10.5px, 1.25cqw); margin-top: 0.3cqw; }\n  .hb-kh4-lbl { display: inline-flex; }\n  .hb-kh4-legend { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-kh4 *, .hb-kh4 *::before, .hb-kh4 *::after { animation: none !important; transition: none !important; }\n  .hb-kh4-pkt, .hb-kh4-pkt-warn { display: none; }\n}\n`;\n\nconst defaultNodes: HowFlowDiagramNode[] = [\n  {\n    stage: \"Input\",\n    title: \"Inbox\",\n    metric: \"1,284 today\",\n    description: \"Invoices arrive by email, upload or API. Duplicates are caught before they ever reach your books.\",\n    stats: [\n      { label: \"Sources\", value: \"Email, upload, API\" },\n      { label: \"Duplicates blocked\", value: \"37 this week\" },\n      { label: \"Average length\", value: \"2.4 pages\" },\n    ],\n  },\n  {\n    stage: \"Process\",\n    title: \"Extract\",\n    metric: \"98.7% matched\",\n    description: \"Line items are read, coded to the right GL account and matched against open purchase orders.\",\n    stats: [\n      { label: \"Fields read\", value: \"42 per invoice\" },\n      { label: \"PO match rate\", value: \"98.7%\" },\n      { label: \"Time per invoice\", value: \"8 seconds\" },\n    ],\n  },\n  {\n    stage: \"Review\",\n    title: \"Exceptions\",\n    metric: \"Median 6 min\",\n    description: \"Only exceptions reach a person: price mismatches, new vendors or anything above your threshold.\",\n    stats: [\n      { label: \"Needs a person\", value: \"18%\" },\n      { label: \"Median wait\", value: \"6 minutes\" },\n      { label: \"Threshold\", value: \"$5,000\" },\n    ],\n  },\n  {\n    stage: \"Output\",\n    title: \"Pay and sync\",\n    metric: \"0 manual entries\",\n    description: \"Approved bills post to your ledger and are paid on their due date, with the audit trail attached.\",\n    stats: [\n      { label: \"Posted today\", value: \"1,191\" },\n      { label: \"Paid on time\", value: \"99.4%\" },\n      { label: \"Audit trail\", value: \"Every step\" },\n    ],\n  },\n];\n\nconst W = { w: 1000, h: 320, nw: 180, nh: 130, xs: [110, 370, 630, 890], y: 160 };\nconst N = { w: 360, h: 820, nw: 240, nh: 112, x: 180, ys: [96, 300, 504, 708] };\n\nconst wide = {\n  main: [\"M200 160 L280 160\", \"M460 160 L540 160\", \"M720 160 L800 160\"],\n  skip: \"M370 95 C370 30 890 30 890 95\",\n  loop: \"M630 225 C630 300 370 300 370 225\",\n};\n\nconst narrow = {\n  main: [\"M180 152 L180 244\", \"M180 356 L180 448\", \"M180 560 L180 652\"],\n  skip: \"M300 300 C350 300 350 708 300 708\",\n  loop: \"M60 504 C10 504 10 300 60 300\",\n};\n\nconst touches: [number, number][] = [\n  [0, 1],\n  [1, 2],\n  [2, 3],\n];\n\nfunction pct(n: number, total: number) {\n  return `${((n / total) * 100).toFixed(3)}%`;\n}\n\nconst icons = [\n  <path key=\"0\" d=\"M3 7l9 6 9-6M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z\" />,\n  <path key=\"1\" d=\"M4 6h10M4 12h16M4 18h7M17 4l3 3-3 3M14 18l2 2 4-4\" />,\n  <path key=\"2\" d=\"M12 3l8 4v5c0 5-3.5 8-8 9-4.5-1-8-4-8-9V7l8-4zM8.5 12l2.5 2.5 4.5-5\" />,\n  <path key=\"3\" d=\"M4 12a8 8 0 0 1 14-5.3M20 12a8 8 0 0 1-14 5.3M18 3v4h-4M6 21v-4h4\" />,\n];\n\nfunction Packets({ path, count, dur, offset, warn }: { path: string; count: number; dur: number; offset: number; warn?: boolean }) {\n  return (\n    <>\n      {Array.from({ length: count }, (_, i) => (\n        <circle key={i} className={warn ? \"hb-kh4-pkt-warn\" : \"hb-kh4-pkt\"} r=\"3.5\" cx=\"0\" cy=\"0\">\n          <animateMotion\n            dur={`${dur.toFixed(2)}s`}\n            begin={`${(-(offset + (i * dur) / count)).toFixed(2)}s`}\n            repeatCount=\"indefinite\"\n            path={path}\n          />\n        </circle>\n      ))}\n    </>\n  );\n}\n\nfunction Layer({ paths, active, variant, uid }: { paths: typeof wide; active: number; variant: \"w\" | \"n\"; uid: string }) {\n  const markerId = `${uid}-${variant}`;\n  const vb = variant === \"w\" ? `0 0 ${W.w} ${W.h}` : `0 0 ${N.w} ${N.h}`;\n  const flowAll = [...paths.main, paths.skip].join(\" \");\n  return (\n    <svg className={`hb-kh4-svg hb-kh4-svg-${variant}`} viewBox={vb} preserveAspectRatio=\"none\" aria-hidden=\"true\">\n      <defs>\n        <marker id={markerId} viewBox=\"0 0 8 8\" refX=\"7\" refY=\"4\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\">\n          <path className=\"hb-kh4-tip\" d=\"M0 0L8 4L0 8z\" />\n        </marker>\n      </defs>\n      {paths.main.map((d, i) => (\n        <path\n          key={d}\n          className=\"hb-kh4-path\"\n          d={d}\n          markerEnd={`url(#${markerId})`}\n          data-on={touches[i].includes(active) ? \"true\" : \"false\"}\n        />\n      ))}\n      <path className=\"hb-kh4-path\" d={paths.skip} markerEnd={`url(#${markerId})`} data-on={active === 1 || active === 3 ? \"true\" : \"false\"} />\n      <path className=\"hb-kh4-path\" d={paths.loop} markerEnd={`url(#${markerId})`} data-on={active === 1 || active === 2 ? \"true\" : \"false\"} />\n      <path className=\"hb-kh4-flow\" d={flowAll} />\n      <path className=\"hb-kh4-flow hb-kh4-flow-warn\" d={paths.loop} />\n      {paths.main.map((d, i) => (\n        <Packets key={d} path={d} count={2} dur={1.6} offset={i * 0.35} />\n      ))}\n      <Packets path={paths.skip} count={3} dur={3.2} offset={0.5} />\n      <Packets path={paths.loop} count={1} dur={3.6} offset={1.2} warn />\n    </svg>\n  );\n}\n\nexport function HowFlowDiagram({\n  eyebrow = \"Under the hood\",\n  title = \"Every invoice takes the same four-stop route\",\n  subtitle = \"Ledgerline reads, matches and routes bills on its own. People only see the few that need a decision.\",\n  live = \"1,284 invoices processed today\",\n  nodes = defaultNodes,\n  skipLabel = \"Auto-approved 82%\",\n  loopLabel = \"Sent back 3%\",\n  defaultActive = 1,\n  onNodeActive,\n  accent = \"#22d3ee\",\n  className,\n  style,\n  ...rest\n}: HowFlowDiagramProps) {\n  const list = nodes.slice(0, 4);\n  const [active, setActive] = React.useState(Math.min(Math.max(defaultActive, 0), list.length - 1));\n  const btns = React.useRef<(HTMLButtonElement | null)[]>([]);\n  const uid = `kh4tip${React.useId().replace(/[^a-zA-Z0-9]/g, \"\")}`;\n\n  const activate = (i: number) => {\n    setActive(i);\n    onNodeActive?.(i);\n  };\n\n  const onKey = (e: React.KeyboardEvent<HTMLButtonElement>, i: number) => {\n    let next = -1;\n    if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") next = (i + 1) % list.length;\n    if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") next = (i - 1 + list.length) % list.length;\n    if (e.key === \"Home\") next = 0;\n    if (e.key === \"End\") next = list.length - 1;\n    if (next < 0) return;\n    e.preventDefault();\n    btns.current[next]?.focus();\n    activate(next);\n  };\n\n  const current = list[active] ?? list[0];\n\n  return (\n    <section\n      className={[\"hb-kh4\", className].filter(Boolean).join(\" \")}\n      style={{ [\"--hb-kh4-accent\" as string]: accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-how-flow-diagram\" precedence=\"default\">{css}</style>\n      <div className=\"hb-kh4-in\">\n        <header className=\"hb-kh4-head\">\n          <div className=\"hb-kh4-copy\">\n            {eyebrow ? <div className=\"hb-kh4-eyebrow\">{eyebrow}</div> : null}\n            <h2 className=\"hb-kh4-title\">{title}</h2>\n            {subtitle ? <p className=\"hb-kh4-sub\">{subtitle}</p> : null}\n          </div>\n          {live ? <span className=\"hb-kh4-live\">{live}</span> : null}\n        </header>\n        <div className=\"hb-kh4-frame\">\n          <div className=\"hb-kh4-dia\">\n            <Layer paths={narrow} active={active} variant=\"n\" uid={uid} />\n            <Layer paths={wide} active={active} variant=\"w\" uid={uid} />\n            {list.map((node, i) => {\n              const vars = {\n                \"--wx\": pct(W.xs[i] - W.nw / 2, W.w),\n                \"--wy\": pct(W.y - W.nh / 2, W.h),\n                \"--ww\": pct(W.nw, W.w),\n                \"--wh\": pct(W.nh, W.h),\n                \"--nx\": pct(N.x - N.nw / 2, N.w),\n                \"--ny\": pct(N.ys[i] - N.nh / 2, N.h),\n                \"--nw\": pct(N.nw, N.w),\n                \"--nh\": pct(N.nh, N.h),\n              } as React.CSSProperties;\n              return (\n                <button\n                  key={node.title + i}\n                  ref={(el) => {\n                    btns.current[i] = el;\n                  }}\n                  type=\"button\"\n                  className=\"hb-kh4-node\"\n                  style={vars}\n                  data-active={active === i ? \"true\" : \"false\"}\n                  aria-pressed={active === i}\n                  aria-label={`${node.stage}: ${node.title}, ${node.metric}`}\n                  tabIndex={active === i ? 0 : -1}\n                  onMouseEnter={() => activate(i)}\n                  onFocus={() => activate(i)}\n                  onClick={() => activate(i)}\n                  onKeyDown={(e) => onKey(e, i)}\n                >\n                  <span className=\"hb-kh4-ntop\">\n                    <span className=\"hb-kh4-ico\" aria-hidden=\"true\">\n                      <svg viewBox=\"0 0 24 24\">{icons[i % icons.length]}</svg>\n                    </span>\n                    <span className=\"hb-kh4-stage\">{node.stage}</span>\n                  </span>\n                  <span>\n                    <span className=\"hb-kh4-ntitle\">{node.title}</span>\n                    <span className=\"hb-kh4-metric\">{node.metric}</span>\n                  </span>\n                </button>\n              );\n            })}\n            {skipLabel ? (\n              <span className=\"hb-kh4-lbl\" style={{ [\"--lx\" as string]: pct(630, W.w), [\"--ly\" as string]: pct(46, W.h) } as React.CSSProperties}>\n                <i aria-hidden=\"true\" />\n                {skipLabel}\n              </span>\n            ) : null}\n            {loopLabel ? (\n              <span\n                className=\"hb-kh4-lbl\"\n                data-warn=\"true\"\n                style={{ [\"--lx\" as string]: pct(500, W.w), [\"--ly\" as string]: pct(281, W.h) } as React.CSSProperties}\n              >\n                <i aria-hidden=\"true\" />\n                {loopLabel}\n              </span>\n            ) : null}\n          </div>\n          <div className=\"hb-kh4-legend\">\n            {skipLabel ? (\n              <span>\n                <i aria-hidden=\"true\" />\n                {skipLabel}\n              </span>\n            ) : null}\n            {loopLabel ? (\n              <span>\n                <i aria-hidden=\"true\" />\n                {loopLabel}\n              </span>\n            ) : null}\n          </div>\n        </div>\n        {current ? (\n          <div className=\"hb-kh4-detail\" aria-live=\"polite\">\n            <div className=\"hb-kh4-dcopy\" key={`c${active}`}>\n              <div className=\"hb-kh4-dstage\">\n                {String(active + 1).padStart(2, \"0\")} · {current.stage}\n              </div>\n              <h3 className=\"hb-kh4-dtitle\">{current.title}</h3>\n              <p className=\"hb-kh4-ddesc\">{current.description}</p>\n            </div>\n            {current.stats && current.stats.length ? (\n              <dl className=\"hb-kh4-stats\" key={`s${active}`}>\n                {current.stats.slice(0, 3).map((s, i) => (\n                  <div key={s.label} className=\"hb-kh4-stat\" style={{ [\"--i\" as string]: i } as React.CSSProperties}>\n                    <dt>{s.label}</dt>\n                    <dd>{s.value}</dd>\n                  </div>\n                ))}\n              </dl>\n            ) : null}\n          </div>\n        ) : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}