{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "image-pixelate-transition",
  "type": "registry:component",
  "title": "Image Pixelate Transition",
  "description": "A canvas transition that pixelates the current photo into coarse blocks, swaps to the next at the peak and resolves it back to sharp.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "transitions",
    "image",
    "pixelate",
    "canvas",
    "retro",
    "transition",
    "slideshow"
  ],
  "docs": "https://hyperblur.dev/effects/image-pixelate-transition",
  "files": [
    {
      "path": "registry/hyperblur/image-pixelate-transition.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/image-pixelate-transition.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nconst SCENE_COUNT = 4;\n\ntype SceneLayer = \"all\" | \"back\" | \"mid\" | \"front\";\n\nfunction mod(n: number, m: number) {\n  return ((n % m) + m) % m;\n}\n\nfunction hash(n: number) {\n  let x = Math.imul(n + 1, 2654435761) >>> 0;\n  x = Math.imul(x ^ (x >>> 15), 2246822519) >>> 0;\n  x = Math.imul(x ^ (x >>> 13), 3266489917) >>> 0;\n  return (x ^ (x >>> 16)) >>> 0;\n}\n\nconst sceneCache = new Map<string, string>();\n\nfunction sceneSvg(k: number, layer: SceneLayer) {\n  const on = (name: string) => layer === \"all\" || layer === name;\n  let s = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 200\" width=\"320\" height=\"200\">';\n  if (k === 0) {\n    if (on(\"back\")) {\n      s +=\n        '<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#ffb36b\"/><stop offset=\"0.5\" stop-color=\"#ff6f91\"/><stop offset=\"1\" stop-color=\"#4b3b8f\"/></linearGradient></defs><rect width=\"320\" height=\"200\" fill=\"url(#g)\"/><circle cx=\"220\" cy=\"96\" r=\"46\" fill=\"#ffe3a8\" opacity=\"0.22\"/><circle cx=\"220\" cy=\"96\" r=\"26\" fill=\"#ffe9bd\"/>';\n    }\n    if (on(\"mid\")) {\n      s +=\n        '<polygon points=\"0,140 50,92 90,122 140,70 200,128 250,96 320,138 320,200 0,200\" fill=\"#6a4a98\"/><polygon points=\"0,158 70,118 130,148 190,110 260,150 320,128 320,200 0,200\" fill=\"#3d2c70\"/>';\n    }\n    if (on(\"front\")) {\n      s += '<path d=\"M0 178 Q80 150 160 172 T320 166 L320 200 L0 200Z\" fill=\"#1b1640\"/>';\n      for (let i = 0; i < 9; i += 1) {\n        const x = 12 + i * 36 + (hash(i + 3) % 14);\n        const h = 26 + (hash(i + 9) % 18);\n        s += `<polygon points=\"${x},${200 - h - 6} ${x - 8},${206 - 6} ${x + 8},${206 - 6}\" fill=\"#120e30\"/><rect x=\"${x - 1}\" y=\"${200 - 8}\" width=\"2\" height=\"8\" fill=\"#120e30\"/>`;\n      }\n    }\n  } else if (k === 1) {\n    if (on(\"back\")) {\n      s +=\n        '<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#14183f\"/><stop offset=\"0.55\" stop-color=\"#6a3d8f\"/><stop offset=\"1\" stop-color=\"#ff8a7a\"/></linearGradient></defs><rect width=\"320\" height=\"200\" fill=\"url(#g)\"/><circle cx=\"252\" cy=\"46\" r=\"16\" fill=\"#fff1d6\"/><circle cx=\"259\" cy=\"41\" r=\"14\" fill=\"#3a2f78\" opacity=\"0.4\"/>';\n      for (let i = 0; i < 22; i += 1) {\n        const h = hash(i + 11);\n        s += `<circle cx=\"${h % 320}\" cy=\"${hash(i + 71) % 80}\" r=\"${(0.5 + (h % 5) / 6).toFixed(2)}\" fill=\"#fff\" opacity=\"0.${5 + (h % 4)}\"/>`;\n      }\n    }\n    if (on(\"mid\")) {\n      const fx = [0, 28, 64, 98, 132, 170, 208, 246, 284];\n      const fw = [32, 40, 38, 40, 42, 42, 42, 42, 40];\n      const fh = [96, 120, 88, 130, 104, 126, 92, 118, 100];\n      fx.forEach((x, i) => {\n        s += `<rect x=\"${x}\" y=\"${200 - fh[i]}\" width=\"${fw[i]}\" height=\"${fh[i]}\" fill=\"#3b3182\" opacity=\"0.92\"/>`;\n      });\n    }\n    if (on(\"front\")) {\n      const nx = [-6, 40, 86, 136, 190, 236, 282];\n      const nw = [50, 50, 54, 60, 52, 52, 50];\n      const nh = [74, 100, 64, 92, 110, 70, 90];\n      nx.forEach((x, b) => {\n        s += `<rect x=\"${x}\" y=\"${200 - nh[b]}\" width=\"${nw[b]}\" height=\"${nh[b]}\" fill=\"#16132f\"/>`;\n        const cols = Math.floor((nw[b] - 10) / 11);\n        const rows = Math.floor((nh[b] - 10) / 13);\n        for (let r = 0; r < rows; r += 1) {\n          for (let c = 0; c < cols; c += 1) {\n            const h = hash(b * 100 + r * 10 + c);\n            if (h % 3 !== 0) {\n              s += `<rect x=\"${x + 6 + c * 11}\" y=\"${200 - nh[b] + 8 + r * 13}\" width=\"5\" height=\"7\" fill=\"${h % 4 === 0 ? \"#ff9f80\" : \"#ffd37a\"}\"/>`;\n            }\n          }\n        }\n      });\n    }\n  } else if (k === 2) {\n    if (on(\"back\")) {\n      s +=\n        '<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop offset=\"0\" stop-color=\"#0b1f5c\"/><stop offset=\"0.55\" stop-color=\"#1c7ed6\"/><stop offset=\"1\" stop-color=\"#5ee0c8\"/></linearGradient></defs><rect width=\"320\" height=\"200\" fill=\"url(#g)\"/><circle cx=\"72\" cy=\"52\" r=\"20\" fill=\"#fff\" opacity=\"0.25\"/>';\n    }\n    if (on(\"mid\")) {\n      s +=\n        '<path d=\"M0 110 C60 80 120 140 180 108 S280 90 320 112 V200 H0Z\" fill=\"#fff\" opacity=\"0.16\"/><path d=\"M0 130 C70 100 130 160 200 128 S290 112 320 134 V200 H0Z\" fill=\"#7ee8d3\" opacity=\"0.32\"/>';\n    }\n    if (on(\"front\")) {\n      s +=\n        '<path d=\"M0 156 C80 130 140 184 210 154 S290 142 320 160 V200 H0Z\" fill=\"#0a2f6a\" opacity=\"0.88\"/><path d=\"M0 178 C90 160 160 196 240 176 S300 170 320 182 V200 H0Z\" fill=\"#061a42\"/>';\n    }\n  } else {\n    if (on(\"back\")) {\n      s +=\n        '<defs><radialGradient id=\"g\" cx=\"0.5\" cy=\"0.38\" r=\"0.8\"><stop offset=\"0\" stop-color=\"#ffd9b0\"/><stop offset=\"0.55\" stop-color=\"#ea6f8f\"/><stop offset=\"1\" stop-color=\"#43235f\"/></radialGradient></defs><rect width=\"320\" height=\"200\" fill=\"url(#g)\"/>';\n    }\n    if (on(\"mid\")) {\n      s +=\n        '<circle cx=\"160\" cy=\"100\" r=\"72\" fill=\"none\" stroke=\"#fff\" stroke-width=\"1.5\" opacity=\"0.24\"/><path d=\"M70 120 C60 70 120 40 170 52 C230 64 262 110 236 150 C210 190 100 180 70 120Z\" fill=\"#fff\" opacity=\"0.13\"/>';\n    }\n    if (on(\"front\")) {\n      s +=\n        '<path d=\"M70 200 C74 160 112 148 160 148 C208 148 246 160 250 200Z\" fill=\"#2a1a48\"/><rect x=\"146\" y=\"124\" width=\"28\" height=\"32\" fill=\"#d9987a\"/><ellipse cx=\"160\" cy=\"98\" rx=\"30\" ry=\"35\" fill=\"#f0b698\"/><path d=\"M128 96 C124 62 150 50 172 56 C196 62 198 84 192 98 C186 78 170 72 150 74 C140 76 132 84 128 96Z\" fill=\"#2b1230\"/><circle cx=\"160\" cy=\"160\" r=\"4\" fill=\"#ffd37a\"/>';\n    }\n  }\n  return `${s}</svg>`;\n}\n\nfunction sceneUri(index: number, layer: SceneLayer = \"all\") {\n  const k = mod(index, SCENE_COUNT);\n  const key = `${k}:${layer}`;\n  let uri = sceneCache.get(key);\n  if (!uri) {\n    uri = `data:image/svg+xml,${encodeURIComponent(sceneSvg(k, layer))}`;\n    sceneCache.set(key, uri);\n  }\n  return uri;\n}\n\nfunction cssUrl(list: string[] | null, index: number, layer: SceneLayer = \"all\") {\n  if (list) return `url(${JSON.stringify(list[mod(index, list.length)])})`;\n  return `url(\"${sceneUri(index, layer)}\")`;\n}\n\nfunction Slide({ image, label, hidden }: { image: string; label: string; hidden?: boolean }) {\n  return (\n    <div\n      role=\"img\"\n      aria-label={label}\n      aria-hidden={hidden || undefined}\n      style={{\n        position: \"absolute\",\n        inset: 0,\n        backgroundImage: image,\n        backgroundSize: \"cover\",\n        backgroundPosition: \"center\",\n      }}\n    />\n  );\n}\n\nfunction cx(base: string, extra?: string) {\n  return extra ? `${base} ${extra}` : base;\n}\n\nfunction rootBox(\n  width: number | string | undefined,\n  height: number | string | undefined,\n  aspect: string,\n  style: React.CSSProperties | undefined,\n): React.CSSProperties {\n  return {\n    width: width ?? \"100%\",\n    ...(height !== undefined ? { height } : { aspectRatio: aspect }),\n    ...style,\n  };\n}\n\nfunction arrowNav(e: React.KeyboardEvent, prev: () => void, next: () => void) {\n  if (e.defaultPrevented) return;\n  if (e.key === \"ArrowLeft\") {\n    e.preventDefault();\n    prev();\n  } else if (e.key === \"ArrowRight\") {\n    e.preventDefault();\n    next();\n  }\n}\n\nconst motionQuery = \"(prefers-reduced-motion: reduce)\";\n\nfunction subscribeMotion(callback: () => void) {\n  const query = window.matchMedia(motionQuery);\n  query.addEventListener(\"change\", callback);\n  return () => query.removeEventListener(\"change\", callback);\n}\n\nfunction useReducedMotion() {\n  return React.useSyncExternalStore(\n    subscribeMotion,\n    () => window.matchMedia(motionQuery).matches,\n    () => false,\n  );\n}\n\nfunction useInView(ref: React.RefObject<HTMLElement | null>) {\n  const [visible, setVisible] = React.useState(true);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el || typeof IntersectionObserver === \"undefined\") return;\n    const observer = new IntersectionObserver((entries) => {\n      const last = entries[entries.length - 1];\n      if (last) setVisible(last.isIntersecting);\n    });\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, [ref]);\n  return visible;\n}\n\nfunction usePause() {\n  const [paused, setPaused] = React.useState(false);\n  const handlers = {\n    onPointerEnter: () => setPaused(true),\n    onPointerLeave: () => setPaused(false),\n    onFocus: (e: React.FocusEvent<HTMLElement>) => {\n      if (e.target.matches(\":focus-visible\")) setPaused(true);\n    },\n    onBlur: (e: React.FocusEvent<HTMLElement>) => {\n      if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setPaused(false);\n    },\n  };\n  return [paused, handlers] as const;\n}\n\nfunction useAutoAdvance(\n  enabled: boolean,\n  interval: number,\n  step: () => void,\n  ref: React.RefObject<HTMLElement | null>,\n  paused: boolean,\n  resetKey: number,\n) {\n  const reduced = useReducedMotion();\n  const visible = useInView(ref);\n  const stepRef = React.useRef(step);\n  React.useEffect(() => {\n    stepRef.current = step;\n  });\n  React.useEffect(() => {\n    if (!enabled || reduced || !visible || paused) return;\n    const id = window.setInterval(() => stepRef.current(), interval);\n    return () => window.clearInterval(id);\n  }, [enabled, reduced, visible, paused, interval, resetKey]);\n}\n\nfunction useSlideIndex(\n  count: number,\n  value: number | undefined,\n  initial: number,\n  onChange?: (index: number) => void,\n) {\n  const [inner, setInner] = React.useState(initial);\n  const controlled = value !== undefined;\n  const current = mod(controlled ? value : inner, count);\n  const set = (next: number) => {\n    const n = mod(next, count);\n    if (n === current) return;\n    if (!controlled) setInner(n);\n    onChange?.(n);\n  };\n  return [current, set] as const;\n}\n\nfunction Controls({\n  count,\n  index,\n  onGo,\n  label,\n  arrows = true,\n}: {\n  count: number;\n  index: number;\n  onGo: (index: number) => void;\n  label: string;\n  arrows?: boolean;\n}) {\n  if (count < 2) return null;\n  return (\n    <>\n      {arrows ? (\n        <>\n          <button\n            type=\"button\"\n            className=\"hb-qe4-nav hb-qe4-prev\"\n            aria-label={`Previous ${label}`}\n            onClick={() => onGo(index - 1)}\n          >\n            <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n              <path d=\"M15 5l-7 7 7 7\" />\n            </svg>\n          </button>\n          <button\n            type=\"button\"\n            className=\"hb-qe4-nav hb-qe4-next\"\n            aria-label={`Next ${label}`}\n            onClick={() => onGo(index + 1)}\n          >\n            <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n              <path d=\"M9 5l7 7-7 7\" />\n            </svg>\n          </button>\n        </>\n      ) : null}\n      <div className=\"hb-qe4-dots\">\n        {Array.from({ length: count }, (_, i) => (\n          <button\n            key={i}\n            type=\"button\"\n            className=\"hb-qe4-dot\"\n            aria-label={`Show ${label} ${i + 1} of ${count}`}\n            aria-current={i === index ? \"true\" : undefined}\n            onClick={() => onGo(i)}\n          />\n        ))}\n      </div>\n    </>\n  );\n}\n\nexport interface ImagePixelateTransitionProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n  images?: string[];\n  alt?: string;\n  width?: number | string;\n  height?: number | string;\n  aspect?: string;\n  index?: number;\n  defaultIndex?: number;\n  onChange?: (index: number) => void;\n  autoPlay?: boolean;\n  interval?: number;\n  duration?: number;\n  maxBlock?: number;\n  accent?: string;\n}\n\nconst css = `\n.hb-qe4 {\n  --hb-qe4-a: #2f7bff;\n  position: relative;\n  display: block;\n  box-sizing: border-box;\n  overflow: hidden;\n  border-radius: 14px;\n  background: #0a0a0a;\n  isolation: isolate;\n  font-family: inherit;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-tap-highlight-color: transparent;\n}\n.hb-qe4 *, .hb-qe4 *::before, .hb-qe4 *::after { box-sizing: border-box; }\n.hb-qe4:focus-visible { outline: 2px solid var(--hb-qe4-a); outline-offset: 2px; }\n.hb-qe4-layer { position: absolute; inset: 0; }\n.hb-qe4-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n  border: 0;\n}\n.hb-qe4-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }\n.hb-qe4-nav {\n  position: absolute;\n  top: 50%;\n  z-index: 4;\n  display: grid;\n  place-items: center;\n  width: 30px;\n  height: 30px;\n  margin: -15px 0 0;\n  padding: 0;\n  color: #fff;\n  background: rgba(10, 10, 10, 0.45);\n  border: 1px solid rgba(255, 255, 255, 0.18);\n  border-radius: 50%;\n  cursor: pointer;\n  -webkit-backdrop-filter: blur(8px);\n  backdrop-filter: blur(8px);\n  transition: background 0.2s ease, transform 0.2s ease;\n}\n.hb-qe4-nav:hover { background: rgba(10, 10, 10, 0.7); transform: scale(1.06); }\n.hb-qe4-nav:active { transform: scale(0.95); }\n.hb-qe4-nav:focus-visible { outline: 2px solid var(--hb-qe4-a); outline-offset: 2px; }\n.hb-qe4-prev { left: 10px; }\n.hb-qe4-next { right: 10px; }\n.hb-qe4-dots {\n  position: absolute;\n  left: 50%;\n  bottom: 10px;\n  z-index: 4;\n  display: flex;\n  gap: 6px;\n  padding: 5px 8px;\n  background: rgba(10, 10, 10, 0.35);\n  border-radius: 999px;\n  transform: translateX(-50%);\n  -webkit-backdrop-filter: blur(8px);\n  backdrop-filter: blur(8px);\n}\n.hb-qe4-dot {\n  position: relative;\n  width: 6px;\n  height: 6px;\n  margin: 0;\n  padding: 0;\n  background: rgba(255, 255, 255, 0.5);\n  border: 0;\n  border-radius: 999px;\n  cursor: pointer;\n  transition: width 0.3s cubic-bezier(0.3, 0.8, 0.2, 1), background 0.2s ease;\n}\n.hb-qe4-dot::before { content: \"\"; position: absolute; inset: -6px -3px; }\n.hb-qe4-dot[aria-current=\"true\"] { width: 16px; background: #fff; }\n.hb-qe4-dot:focus-visible { outline: 2px solid var(--hb-qe4-a); outline-offset: 2px; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qe4-nav, .hb-qe4-dot { transition: none; }\n}\n`;\n\nexport function ImagePixelateTransition({\n  images,\n  alt = \"Photo\",\n  width,\n  height,\n  aspect = \"16 / 10\",\n  index: indexProp,\n  defaultIndex = 0,\n  onChange,\n  autoPlay = true,\n  interval = 3400,\n  duration = 900,\n  maxBlock = 36,\n  accent = \"#2f7bff\",\n  className,\n  style,\n  onKeyDown,\n  ...rest\n}: ImagePixelateTransitionProps) {\n  const list = images && images.length > 0 ? images : null;\n  const count = list ? list.length : SCENE_COUNT;\n  const [index, setIndex] = useSlideIndex(count, indexProp, defaultIndex, onChange);\n  const [paused, pause] = usePause();\n  const ref = React.useRef<HTMLDivElement>(null);\n  const canvasRef = React.useRef<HTMLCanvasElement>(null);\n  const smallRef = React.useRef<HTMLCanvasElement | null>(null);\n  const loadedRef = React.useRef<(HTMLImageElement | null)[]>([]);\n  const shownRef = React.useRef(index);\n  const dprRef = React.useRef(1);\n  const [ready, setReady] = React.useState(0);\n  const reduced = useReducedMotion();\n  useAutoAdvance(autoPlay && count > 1, interval, () => setIndex(index + 1), ref, paused, index);\n  const label = (i: number) => `${alt} ${i + 1} of ${count}`;\n  const sourceKey = Array.from({ length: count }, (_, i) => (list ? list[i] : sceneUri(i))).join(\"\\n\");\n\n  React.useEffect(() => {\n    let alive = true;\n    loadedRef.current = [];\n    sourceKey.split(\"\\n\").forEach((src, i) => {\n      const img = new Image();\n      img.onload = () => {\n        if (!alive) return;\n        loadedRef.current[i] = img;\n        setReady((n) => n + 1);\n      };\n      img.src = src;\n    });\n    return () => {\n      alive = false;\n    };\n  }, [sourceKey]);\n\n  const paint = React.useCallback((i: number, block: number) => {\n    const canvas = canvasRef.current;\n    const ctx = canvas ? canvas.getContext(\"2d\") : null;\n    if (!canvas || !ctx) return;\n    const w = canvas.width;\n    const h = canvas.height;\n    ctx.clearRect(0, 0, w, h);\n    const img = loadedRef.current[i];\n    if (!img || w === 0 || h === 0) return;\n    const draw = (target: CanvasRenderingContext2D, tw: number, th: number) => {\n      const s = Math.max(tw / img.width, th / img.height);\n      const dw = img.width * s;\n      const dh = img.height * s;\n      target.drawImage(img, (tw - dw) / 2, (th - dh) / 2, dw, dh);\n    };\n    if (block <= 1) {\n      ctx.imageSmoothingEnabled = true;\n      draw(ctx, w, h);\n      return;\n    }\n    const small = smallRef.current ?? document.createElement(\"canvas\");\n    smallRef.current = small;\n    const bw = Math.max(1, Math.ceil(w / block));\n    const bh = Math.max(1, Math.ceil(h / block));\n    small.width = bw;\n    small.height = bh;\n    const sctx = small.getContext(\"2d\");\n    if (!sctx) return;\n    sctx.imageSmoothingEnabled = true;\n    draw(sctx, bw, bh);\n    ctx.imageSmoothingEnabled = false;\n    ctx.drawImage(small, 0, 0, bw, bh, 0, 0, bw * block, bh * block);\n  }, []);\n\n  React.useEffect(() => {\n    const box = ref.current;\n    const canvas = canvasRef.current;\n    if (!box || !canvas) return;\n    const fit = () => {\n      const dpr = Math.min(window.devicePixelRatio || 1, 2);\n      dprRef.current = dpr;\n      const rect = box.getBoundingClientRect();\n      canvas.width = Math.max(1, Math.round(rect.width * dpr));\n      canvas.height = Math.max(1, Math.round(rect.height * dpr));\n      paint(shownRef.current, 1);\n    };\n    fit();\n    const observer = new ResizeObserver(fit);\n    observer.observe(box);\n    return () => observer.disconnect();\n  }, [paint, ready]);\n\n  React.useEffect(() => {\n    const from = shownRef.current;\n    shownRef.current = index;\n    if (from === index || reduced) {\n      paint(index, 1);\n      return;\n    }\n    const steps = Math.log2(Math.max(2, maxBlock));\n    let raf = 0;\n    let t0 = -1;\n    const tick = (now: number) => {\n      if (t0 < 0) t0 = now;\n      const p = Math.min(1, (now - t0) / duration);\n      const half = p < 0.5 ? p * 2 : (1 - p) * 2;\n      const step = Math.round(2 ** (half * steps));\n      const block = p >= 1 || step <= 1 ? 1 : step * dprRef.current;\n      paint(p < 0.5 ? from : index, block);\n      if (p < 1) raf = requestAnimationFrame(tick);\n    };\n    raf = requestAnimationFrame(tick);\n    return () => cancelAnimationFrame(raf);\n  }, [index, reduced, duration, maxBlock, paint]);\n\n  return (\n    <div\n      tabIndex={0}\n      role=\"group\"\n      aria-roledescription=\"carousel\"\n      aria-label={`${alt} gallery`}\n      {...rest}\n      {...pause}\n      ref={ref}\n      className={cx(\"hb-qe4\", className)}\n      style={{ ...rootBox(width, height, aspect, style), \"--hb-qe4-a\": accent } as React.CSSProperties}\n      onKeyDown={(e) => {\n        onKeyDown?.(e);\n        arrowNav(e, () => setIndex(index - 1), () => setIndex(index + 1));\n      }}\n    >\n      <style href=\"hb-image-pixelate-transition\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-qe4-layer\">\n        <Slide image={cssUrl(list, index)} label={label(index)} />\n      </div>\n      <canvas ref={canvasRef} className=\"hb-qe4-canvas\" aria-hidden=\"true\" />\n      <Controls count={count} index={index} onGo={setIndex} label=\"photo\" />\n      <span className=\"hb-qe4-sr\" aria-live=\"polite\">\n        {label(index)}\n      </span>\n    </div>\n  );\n}\n"
    }
  ]
}