{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-section-v11",
  "title": "Hero Section v11",
  "description": "Two-panel travel hero with integrated ACME nav, dual CTAs, and a full-bleed destination image with Canvas UI Displacement on pointer move.",
  "registryDependencies": [
    "https://uiception.com/r/block-media.json",
    "button"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/hero-section-v11/page.tsx",
      "content": "import HeroSectionV11 from \"./components/hero-section-v11\"\n\nexport default function Page() {\n  return <HeroSectionV11 />\n}\n",
      "type": "registry:page",
      "target": "app/hero-section-v11/page.tsx"
    },
    {
      "path": "registry/new-york/blocks/hero-section-v11/components/hero-section-v11.tsx",
      "content": "import Image from \"next/image\"\nimport Link from \"next/link\"\n\nimport { Displacement } from \"@/components/canvasui/displacement\"\nimport { Button } from \"@/components/ui/button\"\nimport { createBlockImage } from \"@/lib/block-media\"\n\nconst blockImage = createBlockImage(\"hero-section-v11\")\nconst HERO_IMAGE = blockImage(\"image.jpg\")\n\nconst NAV_LINKS = [\n  { label: \"Discover\", href: \"#\" },\n  { label: \"Pricing\", href: \"#\" },\n  { label: \"Log In\", href: \"#\" },\n] as const\n\nexport default function HeroSectionV11() {\n  return (\n    <section className=\"bg-background text-foreground\">\n      <div className=\"grid min-h-svh lg:grid-cols-2\">\n        <div className=\"flex flex-col px-6 py-6 sm:px-10 sm:py-8 lg:px-12 lg:py-10\">\n          <nav className=\"flex items-center justify-between gap-4\">\n            <Link\n              href=\"#\"\n              className=\"text-base font-semibold tracking-tight text-foreground\"\n            >\n              ACME\n            </Link>\n            <div className=\"flex items-center gap-5 sm:gap-6\">\n              {NAV_LINKS.map((link) => (\n                <Link\n                  key={link.label}\n                  href={link.href}\n                  className=\"text-base text-muted-foreground transition-colors hover:text-foreground\"\n                >\n                  {link.label}\n                </Link>\n              ))}\n            </div>\n          </nav>\n\n          <div className=\"flex flex-1 flex-col justify-center py-12 lg:py-16\">\n            <div className=\"max-w-lg\">\n              <h1 className=\"text-4xl font-medium leading-[1.1] tracking-[-0.03em] sm:text-5xl lg:text-6xl\">\n                Your next escape, fully mapped.\n              </h1>\n              <p className=\"mt-5 max-w-md text-[0.9375rem] leading-relaxed text-muted-foreground sm:text-base\">\n                Pick a destination and a window. ACME builds the itinerary,\n                secures lodging, and tucks every confirmation into a single trip\n                hub.\n              </p>\n              <div className=\"mt-8 flex flex-col gap-3 sm:flex-row sm:flex-wrap\">\n                <Button variant=\"default\">Start Planning</Button>\n                <Button variant=\"outline\">See A Sample Trip</Button>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"relative min-h-[50svh] w-full lg:min-h-svh\">\n          <Displacement\n            className=\"absolute inset-0 size-full overflow-hidden\"\n            grid={40}\n            cellAspect={1}\n            radius={0.12}\n            strength={0.12}\n            threshold={400}\n            scramble={0}\n          >\n            {/* Relative shell so next/image fill resolves inside html-in-canvas capture. */}\n            <div className=\"relative size-full min-h-[50svh] lg:min-h-svh\">\n              <Image\n                src={HERO_IMAGE}\n                unoptimized\n                alt=\"Scenic destination fully mapped for your next escape\"\n                fill\n                className=\"object-cover object-center\"\n                sizes=\"(max-width: 1024px) 100vw, 50vw\"\n                preload={true}\n              />\n            </div>\n          </Displacement>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "app/hero-section-v11/components/hero-section-v11.tsx"
    },
    {
      "path": "components/canvasui/displacement.tsx",
      "content": "\"use client\";\n\nimport {\n  useEffect,\n  useRef,\n  useState,\n  useSyncExternalStore,\n  type ReactNode,\n} from \"react\";\n\nexport interface DisplacementOptions {\n  /** Cells across the width of the wrapped area (4 to 100). */\n  grid?: number;\n  /** Width to height ratio of each cell (0.25 to 4). 1 is a perfect square. */\n  cellAspect?: number;\n  /** Radius of the cursor influence as a fraction of the grid (0.02 to 1). */\n  radius?: number;\n  /** How hard cursor movement pushes cells around (0 to 1). */\n  strength?: number;\n  /** Minimum cursor speed in CSS pixels per second before cells react. 0 reacts to any movement. */\n  threshold?: number;\n  /** How slowly cells return to rest, per frame (0.5 to 0.99). */\n  relaxation?: number;\n  /** Multiplier on how far displaced cells shift the content (0 to 4). */\n  shift?: number;\n  /** Chromatic aberration inside each displaced cell (0 to 3). */\n  aberration?: number;\n  /** Film grain over displaced cells (0 to 1). */\n  grain?: number;\n  /** Grain speck size multiplier (0.5 to 4). */\n  grainSize?: number;\n  /** Grain animation speed (0 to 4). */\n  grainSpeed?: number;\n  /** Random cell scramble on load that relaxes into place (0 to 3). */\n  scramble?: number;\n}\n\nexport interface DisplacementElements {\n  /** Canvas with layoutsubtree that hosts the HTML content. */\n  source: HTMLCanvasElement;\n  /** The element inside the source canvas that gets captured. */\n  content: HTMLElement;\n  /** Canvas the WebGL effect renders to. */\n  output: HTMLCanvasElement;\n}\n\nexport interface DisplacementInstance {\n  /** Update effect options live. */\n  setOptions: (options: DisplacementOptions) => void;\n  /** Re-read canvas size. Call when the element is resized. */\n  resize: () => void;\n  /** Stop the loop and release all GPU resources. */\n  destroy: () => void;\n}\n\nconst DEFAULTS: Required<DisplacementOptions> = {\n  grid: 50,\n  cellAspect: 1,\n  radius: 0.1,\n  strength: 0.1,\n  threshold: 1000,\n  relaxation: 0.9,\n  shift: 1,\n  aberration: 1.5,\n  grain: 0.1,\n  grainSize: 1,\n  grainSpeed: 1,\n  scramble: 1,\n};\n\ntype PaintableCanvas = HTMLCanvasElement & {\n  onpaint?: (() => void) | null;\n  requestPaint?: () => void;\n  // Chrome 156+: children are only hit-testable once their geometry is registered.\n  updateElementGeometry?: (element: Element) => void;\n};\n\ntype ElementImageContext = CanvasRenderingContext2D & {\n  drawElementImage?: (element: Element, x: number, y: number) => void;\n};\n\nconst VERT = `#version 300 es\nprecision highp float;\nlayout(location = 0) in vec2 aPos;\nout vec2 vUv;\nvoid main () {\n  vUv = aPos * 0.5 + 0.5;\n  gl_Position = vec4(aPos, 0.0, 1.0);\n}`;\n\nconst FRAG = `#version 300 es\nprecision highp float;\nin vec2 vUv;\nout vec4 outColor;\nuniform sampler2D uContent;\nuniform sampler2D uField;\nuniform vec2 uResolution;\nuniform float uShift;\nuniform float uAberration;\nuniform float uGrain;\nuniform float uGrainPx;\nuniform float uGrainTick;\n\nfloat hash(vec2 p) {\n  vec3 q = fract(vec3(p.xyx) * 0.1031);\n  q += dot(q, q.yzx + 33.33);\n  return fract((q.x + q.y) * q.z);\n}\n\nvoid main () {\n  vec2 cuv = vec2(vUv.x, 1.0 - vUv.y);\n  vec2 offset = texture(uField, cuv).rg;\n  vec2 push = offset * 0.02 * uShift;\n  float ab = uAberration * 0.08;\n  vec2 lo = vec2(0.001);\n  vec2 hi = vec2(0.999);\n  vec4 cr = texture(uContent, clamp(cuv - push * (1.0 + ab), lo, hi));\n  vec4 cg = texture(uContent, clamp(cuv - push, lo, hi));\n  vec4 cb = texture(uContent, clamp(cuv - push * (1.0 - ab), lo, hi));\n  float alpha = (cr.a + cg.a + cb.a) / 3.0;\n  vec3 col = vec3(cr.r * cr.a, cg.g * cg.a, cb.b * cb.a);\n  col = min(col, vec3(alpha));\n  float pushPx = length(push * uResolution);\n  float gate = smoothstep(1.5, 18.0, pushPx);\n  vec2 cell = floor(gl_FragCoord.xy / max(uGrainPx, 1.0));\n  float gn = hash(cell + vec2(uGrainTick * 0.37, uGrainTick * 0.113));\n  col += (gn - 0.5) * 0.3 * uGrain * gate * alpha;\n  col = clamp(col, vec3(0.0), vec3(alpha));\n  outColor = vec4(col, alpha);\n}`;\n\nexport function supportsHtmlInCanvas(): boolean {\n  if (typeof document === \"undefined\") return false;\n  const probe = document.createElement(\"canvas\") as PaintableCanvas;\n  const ctx = probe.getContext(\"2d\") as ElementImageContext | null;\n  return Boolean(\n    ctx &&\n    typeof ctx.drawElementImage === \"function\" &&\n    typeof probe.requestPaint === \"function\",\n  );\n}\n\nexport function createDisplacement(\n  elements: DisplacementElements,\n  options: DisplacementOptions = {},\n): DisplacementInstance | null {\n  const config = { ...DEFAULTS, ...options };\n  const { source, content, output } = elements;\n\n  const gl = output.getContext(\"webgl2\", {\n    alpha: true,\n    depth: false,\n    stencil: false,\n    antialias: false,\n    premultipliedAlpha: true,\n  });\n  if (!gl || gl.isContextLost()) return null;\n\n  const sourceCtx = source.getContext(\"2d\") as ElementImageContext | null;\n  const paintable = source as PaintableCanvas;\n  const htmlInCanvas = Boolean(\n    sourceCtx &&\n    typeof sourceCtx.drawElementImage === \"function\" &&\n    typeof paintable.requestPaint === \"function\",\n  );\n\n  let contentDirty = false;\n  let wake = () => {};\n\n  if (htmlInCanvas) {\n    paintable.onpaint = () => {\n      try {\n        sourceCtx!.reset();\n        sourceCtx!.drawElementImage!(content, 0, 0);\n        // Register hit-test geometry so links/buttons under the canvas get clicks.\n        paintable.updateElementGeometry?.(content);\n        contentDirty = true;\n        wake();\n      } catch {}\n    };\n  }\n\n  function compile(type: number, text: string): WebGLShader {\n    const shader = gl!.createShader(type)!;\n    gl!.shaderSource(shader, text);\n    gl!.compileShader(shader);\n    if (!gl!.getShaderParameter(shader, gl!.COMPILE_STATUS)) {\n      console.error(\"Displacement shader error:\", gl!.getShaderInfoLog(shader));\n    }\n    return shader;\n  }\n\n  const vertexShader = compile(gl.VERTEX_SHADER, VERT);\n  const fragmentShader = compile(gl.FRAGMENT_SHADER, FRAG);\n  const program = gl.createProgram()!;\n  gl.attachShader(program, vertexShader);\n  gl.attachShader(program, fragmentShader);\n  gl.linkProgram(program);\n\n  const uniforms: Record<string, WebGLUniformLocation> = {};\n  const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n  for (let i = 0; i < count; i++) {\n    const info = gl.getActiveUniform(program, i)!;\n    uniforms[info.name] = gl.getUniformLocation(program, info.name)!;\n  }\n\n  const quad = gl.createBuffer();\n  gl.bindBuffer(gl.ARRAY_BUFFER, quad);\n  gl.bufferData(\n    gl.ARRAY_BUFFER,\n    new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]),\n    gl.STATIC_DRAW,\n  );\n  gl.enableVertexAttribArray(0);\n  gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n  const contentTexture = gl.createTexture()!;\n  gl.bindTexture(gl.TEXTURE_2D, contentTexture);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n  gl.texImage2D(\n    gl.TEXTURE_2D,\n    0,\n    gl.RGBA,\n    1,\n    1,\n    0,\n    gl.RGBA,\n    gl.UNSIGNED_BYTE,\n    new Uint8Array([0, 0, 0, 0]),\n  );\n\n  const fieldTexture = gl.createTexture()!;\n  gl.bindTexture(gl.TEXTURE_2D, fieldTexture);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n  const motionQuery = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n  let reducedMotion = motionQuery.matches;\n\n  let cols = 0;\n  let rows = 0;\n  let rowScale = 1;\n  let outW = 1;\n  let outH = 1;\n  let scrambled = false;\n  let field = new Float32Array(0);\n  let fieldDirty = false;\n\n  function syncGrid() {\n    const nextCols = Math.round(Math.min(Math.max(config.grid, 4), 100));\n    const aspect = Math.min(Math.max(config.cellAspect, 0.25), 4);\n    const nextRows = Math.max(\n      2,\n      Math.min(Math.round((nextCols * outH * aspect) / outW), 200),\n    );\n    if (nextCols === cols && nextRows === rows) {\n      rowScale = (outH * cols) / (outW * rows);\n      return;\n    }\n    cols = nextCols;\n    rows = nextRows;\n    rowScale = (outH * cols) / (outW * rows);\n    field = new Float32Array(cols * rows * 2);\n    if (!scrambled && !reducedMotion && config.scramble > 0) {\n      const amp = 40 * Math.min(config.scramble, 3);\n      for (let i = 0; i < field.length; i++) {\n        field[i] = (Math.random() * 2 - 1) * amp;\n      }\n    }\n    scrambled = true;\n    gl!.bindTexture(gl!.TEXTURE_2D, fieldTexture);\n    gl!.pixelStorei(gl!.UNPACK_ALIGNMENT, 1);\n    gl!.texImage2D(\n      gl!.TEXTURE_2D,\n      0,\n      gl!.RG32F,\n      cols,\n      rows,\n      0,\n      gl!.RG,\n      gl!.FLOAT,\n      field,\n    );\n    fieldDirty = false;\n  }\n\n  let dpr = 1;\n\n  function syncCanvasSize() {\n    dpr = Math.min(window.devicePixelRatio || 1, 2);\n    outW = Math.max(1, output.clientWidth);\n    outH = Math.max(1, output.clientHeight);\n    const width = Math.max(1, Math.round(outW * dpr));\n    const height = Math.max(1, Math.round(outH * dpr));\n    if (output.width !== width || output.height !== height) {\n      output.width = width;\n      output.height = height;\n    }\n    if (htmlInCanvas) {\n      const cssWidth = Math.max(1, Math.round(source.clientWidth));\n      const cssHeight = Math.max(1, Math.round(source.clientHeight));\n      if (\n        source.width !== cssWidth * dpr ||\n        source.height !== cssHeight * dpr\n      ) {\n        source.width = cssWidth * dpr;\n        source.height = cssHeight * dpr;\n      }\n      paintable.requestPaint!();\n    }\n    syncGrid();\n  }\n\n  syncCanvasSize();\n\n  function uploadContent() {\n    if (!htmlInCanvas || !contentDirty) return;\n    contentDirty = false;\n    gl!.bindTexture(gl!.TEXTURE_2D, contentTexture);\n    gl!.texImage2D(\n      gl!.TEXTURE_2D,\n      0,\n      gl!.RGBA,\n      gl!.RGBA,\n      gl!.UNSIGNED_BYTE,\n      source,\n    );\n    sourceCtx!.clearRect(0, 0, source.width, source.height);\n  }\n\n  function uploadField() {\n    if (!fieldDirty) return;\n    fieldDirty = false;\n    gl!.bindTexture(gl!.TEXTURE_2D, fieldTexture);\n    gl!.pixelStorei(gl!.UNPACK_ALIGNMENT, 1);\n    gl!.texSubImage2D(\n      gl!.TEXTURE_2D,\n      0,\n      0,\n      0,\n      cols,\n      rows,\n      gl!.RG,\n      gl!.FLOAT,\n      field,\n    );\n  }\n\n  const mouse = {\n    x: 0,\n    y: 0,\n    prevX: 0,\n    prevY: 0,\n    vX: 0,\n    vY: 0,\n    speed: 0,\n    gate: 0,\n    lastT: 0,\n  };\n  let tracking = false;\n\n  function stepSimulation(delta: number): boolean {\n    const relaxation = Math.min(Math.max(config.relaxation, 0.5), 0.995);\n    const decay = Math.pow(relaxation, delta * 60);\n    let maxAbs = 0;\n    for (let i = 0; i < field.length; i++) {\n      const value = field[i] * decay;\n      field[i] = value;\n      const abs = Math.abs(value);\n      if (abs > maxAbs) maxAbs = abs;\n    }\n    const injecting = tracking && (mouse.vX !== 0 || mouse.vY !== 0);\n    if (injecting) {\n      const gridX = mouse.x * cols;\n      const gridY = mouse.y * rows;\n      const maxDist = cols * Math.min(Math.max(config.radius, 0.02), 1);\n      const maxSq = maxDist * maxDist;\n      const gain = Math.min(Math.max(config.strength, 0), 1) * 100 * mouse.gate;\n      for (let j = 0; j < rows; j++) {\n        const dy = (gridY - j) * rowScale;\n        for (let i = 0; i < cols; i++) {\n          const dx = gridX - i;\n          const distSq = dx * dx + dy * dy;\n          if (distSq < maxSq) {\n            const power = Math.min(maxDist / Math.sqrt(distSq), 10);\n            const idx = 2 * (i + cols * j);\n            field[idx] += gain * mouse.vX * power;\n            field[idx + 1] += gain * mouse.vY * power;\n          }\n        }\n      }\n    }\n    const vDecay = Math.pow(0.9, delta * 60);\n    mouse.vX *= vDecay;\n    mouse.vY *= vDecay;\n    if (Math.abs(mouse.vX) < 0.0001) mouse.vX = 0;\n    if (Math.abs(mouse.vY) < 0.0001) mouse.vY = 0;\n    fieldDirty = true;\n    const alive =\n      injecting || mouse.vX !== 0 || mouse.vY !== 0 || maxAbs > 0.03;\n    if (!alive && maxAbs > 0) field.fill(0);\n    return alive;\n  }\n\n  let time = 0;\n\n  function render() {\n    uploadContent();\n    uploadField();\n    gl!.useProgram(program);\n    gl!.activeTexture(gl!.TEXTURE0);\n    gl!.bindTexture(gl!.TEXTURE_2D, contentTexture);\n    gl!.uniform1i(uniforms.uContent, 0);\n    gl!.activeTexture(gl!.TEXTURE1);\n    gl!.bindTexture(gl!.TEXTURE_2D, fieldTexture);\n    gl!.uniform1i(uniforms.uField, 1);\n    gl!.uniform2f(uniforms.uResolution, output.width, output.height);\n    gl!.uniform1f(uniforms.uShift, Math.min(Math.max(config.shift, 0), 4));\n    gl!.uniform1f(\n      uniforms.uAberration,\n      Math.min(Math.max(config.aberration, 0), 3),\n    );\n    gl!.uniform1f(uniforms.uGrain, Math.min(Math.max(config.grain, 0), 1));\n    gl!.uniform1f(\n      uniforms.uGrainPx,\n      Math.max(1, Math.min(Math.max(config.grainSize, 0.5), 4) * dpr * 1.5),\n    );\n    gl!.uniform1f(\n      uniforms.uGrainTick,\n      Math.floor(time * Math.min(Math.max(config.grainSpeed, 0), 4) * 18),\n    );\n    gl!.bindFramebuffer(gl!.FRAMEBUFFER, null);\n    gl!.viewport(0, 0, output.width, output.height);\n    gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4);\n  }\n\n  let raf = 0;\n  let lastTime = performance.now();\n  let destroyed = false;\n  let running = false;\n  let visible = true;\n\n  function frame(now: number) {\n    if (destroyed) return;\n    if (!visible) {\n      running = false;\n      return;\n    }\n    const delta = Math.min((now - lastTime) / 1000, 1 / 30);\n    lastTime = now;\n    time += delta;\n    let alive = false;\n    if (!reducedMotion) alive = stepSimulation(delta);\n    render();\n    if (!alive && !contentDirty) {\n      running = false;\n      return;\n    }\n    raf = requestAnimationFrame(frame);\n  }\n\n  function start() {\n    if (destroyed || running || !visible) return;\n    running = true;\n    lastTime = performance.now();\n    raf = requestAnimationFrame(frame);\n  }\n\n  wake = start;\n  start();\n\n  function onMotionChange() {\n    reducedMotion = motionQuery.matches;\n    if (reducedMotion) {\n      field.fill(0);\n      mouse.vX = 0;\n      mouse.vY = 0;\n      fieldDirty = true;\n    }\n    start();\n  }\n  motionQuery.addEventListener(\"change\", onMotionChange);\n\n  const pointerHost = output.parentElement ?? output;\n\n  function onPointerMove(event: PointerEvent) {\n    if (reducedMotion) return;\n    const box = output.getBoundingClientRect();\n    if (box.width < 1 || box.height < 1) return;\n    const x = (event.clientX - box.left) / box.width;\n    const y = (event.clientY - box.top) / box.height;\n    const now = performance.now();\n    if (!tracking) {\n      tracking = true;\n      mouse.prevX = x;\n      mouse.prevY = y;\n      mouse.speed = 0;\n      mouse.gate = 0;\n      mouse.lastT = now;\n    }\n    mouse.vX = x - mouse.prevX;\n    mouse.vY = y - mouse.prevY;\n    const dt = Math.max((now - mouse.lastT) / 1000, 0.001);\n    mouse.lastT = now;\n    const distPx = Math.hypot(mouse.vX * box.width, mouse.vY * box.height);\n    const instSpeed = distPx / dt;\n    mouse.speed += (instSpeed - mouse.speed) * Math.min(dt * 25, 1);\n    const threshold = Math.max(config.threshold, 0);\n    if (threshold <= 0) {\n      mouse.gate = 1;\n    } else {\n      const ramp = (mouse.speed - threshold) / threshold;\n      const step = Math.min(Math.max(ramp, 0), 1);\n      mouse.gate = step * step * (3 - 2 * step);\n    }\n    mouse.prevX = x;\n    mouse.prevY = y;\n    mouse.x = x;\n    mouse.y = y;\n    start();\n  }\n\n  function onPointerLeave() {\n    tracking = false;\n    mouse.vX = 0;\n    mouse.vY = 0;\n    mouse.speed = 0;\n    mouse.gate = 0;\n  }\n\n  pointerHost.addEventListener(\"pointermove\", onPointerMove);\n  pointerHost.addEventListener(\"pointerleave\", onPointerLeave);\n  pointerHost.addEventListener(\"pointercancel\", onPointerLeave);\n\n  const observer = new ResizeObserver(() => {\n    syncCanvasSize();\n    start();\n  });\n  observer.observe(output);\n  observer.observe(content);\n\n  const intersection = new IntersectionObserver((entries) => {\n    visible = entries[entries.length - 1]?.isIntersecting ?? true;\n    if (visible) start();\n  });\n  intersection.observe(output);\n\n  return {\n    setOptions(next) {\n      let changed = false;\n      for (const [key, value] of Object.entries(next)) {\n        const prev = config[key as keyof typeof config];\n        if (prev !== value) {\n          changed = true;\n          break;\n        }\n      }\n      Object.assign(config, next);\n      if (!changed) return;\n      syncGrid();\n      syncCanvasSize();\n      start();\n    },\n    resize() {\n      syncCanvasSize();\n      start();\n    },\n    destroy() {\n      destroyed = true;\n      cancelAnimationFrame(raf);\n      observer.disconnect();\n      intersection.disconnect();\n      motionQuery.removeEventListener(\"change\", onMotionChange);\n      pointerHost.removeEventListener(\"pointermove\", onPointerMove);\n      pointerHost.removeEventListener(\"pointerleave\", onPointerLeave);\n      pointerHost.removeEventListener(\"pointercancel\", onPointerLeave);\n      gl!.deleteTexture(contentTexture);\n      gl!.deleteTexture(fieldTexture);\n      gl!.deleteProgram(program);\n      gl!.deleteShader(vertexShader);\n      gl!.deleteShader(fragmentShader);\n      gl!.deleteBuffer(quad);\n      if (htmlInCanvas) paintable.onpaint = null;\n    },\n  };\n}\n\nexport interface DisplacementProps extends DisplacementOptions {\n  children: ReactNode;\n  className?: string;\n  style?: React.CSSProperties;\n}\n\nconst emptySubscribe = () => () => {};\n\nexport function Displacement({\n  children,\n  className,\n  style,\n  ...options\n}: DisplacementProps) {\n  const sourceRef = useRef<HTMLCanvasElement>(null);\n  const contentRef = useRef<HTMLDivElement>(null);\n  const outputRef = useRef<HTMLCanvasElement>(null);\n  const instanceRef = useRef<DisplacementInstance | null>(null);\n  const [initialOptions] = useState(options);\n  const [failed, setFailed] = useState(false);\n\n  const supported = useSyncExternalStore(\n    emptySubscribe,\n    supportsHtmlInCanvas,\n    () => false,\n  );\n  const native = supported && !failed;\n\n  useEffect(() => {\n    const source = sourceRef.current;\n    const content = contentRef.current;\n    const output = outputRef.current;\n    if (!source || !content || !output) return;\n    instanceRef.current = createDisplacement(\n      { source, content, output },\n      initialOptions,\n    );\n    // eslint-disable-next-line react-hooks/set-state-in-effect -- recover from GPU init failure\n    if (native && !instanceRef.current) setFailed(true);\n    return () => {\n      instanceRef.current?.destroy();\n      instanceRef.current = null;\n    };\n  }, [initialOptions, native]);\n\n  useEffect(() => {\n    instanceRef.current?.setOptions(options);\n  });\n\n  return (\n    <div className={className} style={{ position: \"relative\", ...style }}>\n      <canvas\n        ref={sourceRef}\n        // @ts-expect-error experimental html-in-canvas attribute\n        layoutsubtree=\"true\"\n        // Chrome 156+ html-in-canvas needs content=\"drawable\" for children to be\n        // hit-tested; without it links/buttons under the canvas never get clicks.\n        content=\"drawable\"\n        suppressHydrationWarning\n        style={\n          native\n            ? { position: \"absolute\", inset: 0, width: \"100%\", height: \"100%\" }\n            : { display: \"none\" }\n        }\n      >\n        {native ? (\n          <div\n            ref={contentRef}\n            // Chrome 157+ rejects drawElementImage() on descendants without `drawable`.\n            // @ts-expect-error experimental html-in-canvas attribute\n            drawable=\"\"\n            style={{\n              position: \"relative\",\n              width: \"100%\",\n              height: \"100%\",\n              overflow: \"auto\",\n            }}\n          >\n            {children}\n          </div>\n        ) : null}\n      </canvas>\n      {!native ? (\n        <div\n          ref={contentRef}\n          style={{\n            position: \"relative\",\n            width: \"100%\",\n            height: \"100%\",\n            overflow: \"auto\",\n          }}\n        >\n          {children}\n        </div>\n      ) : null}\n      <canvas\n        ref={outputRef}\n        aria-hidden\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          width: \"100%\",\n          height: \"100%\",\n          pointerEvents: \"none\",\n        }}\n      />\n    </div>\n  );\n}\n\n\nexport default Displacement;\n",
      "type": "registry:component",
      "target": "components/canvasui/displacement.tsx"
    },
    {
      "path": "public/images/blocks/hero-section-v11/image.jpg.gitkeep",
      "content": "Place your asset here. Same base name, any supported format: jpg, jpeg, png, webp, avif, gif, or svg. Remove the .gitkeep extension from the filename.",
      "type": "registry:file",
      "target": "public/images/blocks/hero-section-v11/image.jpg.gitkeep"
    }
  ],
  "type": "registry:block"
}