{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bg-flow-paths",
  "type": "registry:component",
  "title": "Flow Paths",
  "description": "A bundle of SVG curves that crosses the frame and twists through a pinch point, with bright glints racing along random strands. The whole bundle breathes slowly.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "overlay",
    "background",
    "svg",
    "paths",
    "lines",
    "flow",
    "hero"
  ],
  "docs": "https://hyperblur.dev/effects/bg-flow-paths",
  "files": [
    {
      "path": "registry/hyperblur/bg-flow-paths.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/bg-flow-paths.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface BgFlowPathsProps extends React.HTMLAttributes<HTMLDivElement> {\n  color?: string;\n  accent?: string;\n  background?: string;\n  count?: number;\n  pinch?: number;\n  speed?: number;\n  children?: React.ReactNode;\n}\n\nconst css = `\n.hb-vd2 { position: absolute; inset: 0; overflow: hidden; pointer-events: none; box-sizing: border-box; background: var(--hb-vd2-bg); }\n.hb-vd2 *, .hb-vd2 *::before, .hb-vd2 *::after { box-sizing: border-box; }\n.hb-vd2-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(120% 95% at 50% 50%, #000 55%, transparent 100%); mask-image: radial-gradient(120% 95% at 50% 50%, #000 55%, transparent 100%); }\n.hb-vd2-sway { transform-box: view-box; transform-origin: 50% 50%; animation: hb-vd2-sway calc(19s * var(--hb-vd2-k)) cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }\n.hb-vd2-glint { stroke-dasharray: 0.13 1.01; stroke-dashoffset: 0; animation: hb-vd2-run calc(var(--d) * var(--hb-vd2-k)) cubic-bezier(0.55, 0.08, 0.4, 0.95) infinite; animation-delay: var(--dl); }\n.hb-vd2-halo { stroke-dasharray: 0.13 1.01; animation: hb-vd2-run calc(var(--d) * var(--hb-vd2-k)) cubic-bezier(0.55, 0.08, 0.4, 0.95) infinite; animation-delay: var(--dl); }\n.hb-vd2-shade { position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 50%, color-mix(in srgb, var(--hb-vd2-a) 14%, transparent), transparent 70%); }\n.hb-vd2-in { position: relative; z-index: 1; width: 100%; height: 100%; pointer-events: auto; font-family: inherit; }\n@keyframes hb-vd2-run { from { stroke-dashoffset: 0.13; } to { stroke-dashoffset: -1.01; } }\n@keyframes hb-vd2-sway { from { transform: translateY(-1.6%) scaleY(0.97); } to { transform: translateY(1.6%) scaleY(1.04); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vd2-sway { animation: none; }\n  .hb-vd2-glint, .hb-vd2-halo { animation: none; stroke-dashoffset: var(--o); }\n}\n`;\n\nfunction hash(i: number) {\n  let x = Math.imul(i ^ 0x2c1b3c6d, 0x297a2d39);\n  x ^= x >>> 15;\n  x = Math.imul(x, 0x8f8fc5ad);\n  x ^= x >>> 14;\n  return (x >>> 0) / 4294967296;\n}\n\nexport function BgFlowPaths({\n  color = \"#7fb3ff\",\n  accent = \"#2f7bff\",\n  background = \"#05070c\",\n  count = 28,\n  pinch = 0.6,\n  speed = 1,\n  children,\n  className = \"\",\n  style,\n  ...rest\n}: BgFlowPathsProps) {\n  const rawId = React.useId();\n  const id = `hb-vd2-${rawId.replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  const n = Math.max(4, Math.min(80, Math.round(count)));\n  const p = Math.max(0, Math.min(1, pinch));\n  const paths = React.useMemo(() => {\n    return Array.from({ length: n }, (_, i) => {\n      const u = i / (n - 1);\n      const y0 = 30 + u * 540 + (hash(i * 5 + 1) - 0.5) * 36;\n      const y1 = 570 - u * 540 + (hash(i * 5 + 2) - 0.5) * 36;\n      const yc = 300 + (u - 0.5) * 540 * (1 - p) * 0.9 + (hash(i * 5 + 3) - 0.5) * 14;\n      const xc = 470 + (hash(i * 5 + 4) - 0.5) * 80;\n      const d = `M-40 ${y0.toFixed(1)} C${(210 + 40 * hash(i + 90)).toFixed(1)} ${y0.toFixed(1)} ${(xc - 150).toFixed(1)} ${yc.toFixed(1)} ${xc.toFixed(1)} ${yc.toFixed(1)} S${(800 - 40 * hash(i + 91)).toFixed(1)} ${y1.toFixed(1)} 1040 ${y1.toFixed(1)}`;\n      const depth = hash(i * 5 + 5);\n      return {\n        d,\n        width: (0.5 + depth * 1.1).toFixed(2),\n        opacity: (0.08 + depth * 0.22).toFixed(3),\n        glint: hash(i * 7 + 11) > 0.35,\n        dur: (6 + hash(i * 7 + 12) * 9).toFixed(2),\n        delay: (-hash(i * 7 + 13) * 15).toFixed(2),\n        off: (-hash(i * 7 + 14) * 1.1).toFixed(3),\n      };\n    });\n  }, [n, p]);\n\n  return (\n    <div\n      className={`hb-vd2 ${className}`}\n      style={{ \"--hb-vd2-bg\": background, \"--hb-vd2-a\": accent, \"--hb-vd2-k\": (1 / Math.max(0.05, speed)).toFixed(3), ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-bg-flow-paths\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vd2-shade\" aria-hidden=\"true\" />\n      <svg className=\"hb-vd2-svg\" viewBox=\"0 0 1000 600\" preserveAspectRatio=\"xMidYMid slice\" fill=\"none\" aria-hidden=\"true\">\n        <defs>\n          <linearGradient id={`${id}-base`} x1=\"0\" y1=\"0\" x2=\"1000\" y2=\"0\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stopColor={color} stopOpacity=\"0.4\" />\n            <stop offset=\"0.48\" stopColor={color} stopOpacity=\"1\" />\n            <stop offset=\"1\" stopColor={accent} stopOpacity=\"0.5\" />\n          </linearGradient>\n          <linearGradient id={`${id}-hot`} x1=\"0\" y1=\"0\" x2=\"1000\" y2=\"0\" gradientUnits=\"userSpaceOnUse\">\n            <stop offset=\"0\" stopColor={accent} />\n            <stop offset=\"0.5\" stopColor=\"#ffffff\" />\n            <stop offset=\"1\" stopColor={accent} />\n          </linearGradient>\n        </defs>\n        <g className=\"hb-vd2-sway\">\n          {paths.map((q, i) => (\n            <path key={i} d={q.d} stroke={`url(#${id}-base)`} strokeWidth={q.width} strokeOpacity={q.opacity} />\n          ))}\n          {paths.map((q, i) =>\n            q.glint ? (\n              <path\n                key={`h${i}`}\n                className=\"hb-vd2-halo\"\n                d={q.d}\n                pathLength={1}\n                stroke={accent}\n                strokeOpacity=\"0.22\"\n                strokeWidth={(Number(q.width) * 4).toFixed(2)}\n                strokeLinecap=\"round\"\n                style={{ \"--d\": `${q.dur}s`, \"--dl\": `${q.delay}s`, \"--o\": q.off } as React.CSSProperties}\n              />\n            ) : null,\n          )}\n          {paths.map((q, i) =>\n            q.glint ? (\n              <path\n                key={`g${i}`}\n                className=\"hb-vd2-glint\"\n                d={q.d}\n                pathLength={1}\n                stroke={`url(#${id}-hot)`}\n                strokeWidth={(Number(q.width) * 1.4).toFixed(2)}\n                strokeLinecap=\"round\"\n                style={{ \"--d\": `${q.dur}s`, \"--dl\": `${q.delay}s`, \"--o\": q.off } as React.CSSProperties}\n              />\n            ) : null,\n          )}\n        </g>\n      </svg>\n      {children ? <div className=\"hb-vd2-in\">{children}</div> : null}\n    </div>\n  );\n}\n"
    }
  ]
}