{"version":3,"sources":["../src/index.ts","../src/react/LiquidGlass.tsx","../src/core/math.ts","../src/core/displacementMap.ts","../src/core/types.ts","../src/core/engine.ts"],"sourcesContent":["export { LiquidGlass } from \"./react/LiquidGlass\";\nexport type { LiquidGlassProps, LiquidGlassHandle } from \"./react/LiquidGlass\";\n\nexport { LiquidGlassEngine } from \"./core/engine\";\nexport type { LiquidGlassHost } from \"./core/engine\";\n\nexport { computeDisplacementMap, renderDisplacementMap } from \"./core/displacementMap\";\nexport { DEFAULT_OPTIONS } from \"./core/types\";\nexport type { LiquidGlassOptions, DisplacementMapParams } from \"./core/types\";\n","import {\n  forwardRef,\n  useEffect,\n  useImperativeHandle,\n  useLayoutEffect,\n  useRef,\n  type CSSProperties,\n  type HTMLAttributes,\n  type PointerEvent as ReactPointerEvent,\n  type ReactNode,\n} from \"react\";\nimport { LiquidGlassEngine } from \"../core/engine\";\nimport { DEFAULT_OPTIONS, type LiquidGlassOptions } from \"../core/types\";\n\nconst DEFAULT_SHADOW = \"0 0 0 1px rgba(255,255,255,0.25), 0 8px 24px rgba(0,0,0,0.35)\";\n\nexport interface LiquidGlassProps\n  extends Partial<LiquidGlassOptions>,\n    Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n  /** Content the lens refracts. Stays live: selectable, clickable, scrollable. */\n  children: ReactNode;\n  /** Lens center as a fraction of the container width, 0–1. Default 0.5. */\n  x?: number;\n  /** Lens center as a fraction of the container height, 0–1. Default 0.5. */\n  y?: number;\n  /** Let the user drag the lens around. */\n  draggable?: boolean;\n  /**\n   * Drop shadow / rim around the lens. `true` for the default, a string for\n   * a custom `box-shadow`, `false` for none. Default `true`.\n   */\n  shadow?: boolean | string;\n  /** Fires while the lens moves (dragging or `x`/`y` changes). */\n  onMove?: (x: number, y: number) => void;\n  /** Fires with a PNG data URL whenever the displacement map regenerates. */\n  onMapGenerated?: (url: string) => void;\n}\n\nexport interface LiquidGlassHandle {\n  /** Root container element. */\n  element: HTMLDivElement | null;\n  /** Imperative engine, for advanced control (animation loops etc.). */\n  engine: LiquidGlassEngine | null;\n  /** Move the lens without re-rendering React (cheap, per-frame safe). */\n  setPosition: (x: number, y: number) => void;\n}\n\nconst OPTION_KEYS = Object.keys(DEFAULT_OPTIONS) as (keyof LiquidGlassOptions)[];\n\nfunction pickOptions(props: Partial<LiquidGlassOptions>): Partial<LiquidGlassOptions> {\n  const out: Partial<LiquidGlassOptions> = {};\n  for (const key of OPTION_KEYS) {\n    if (props[key] !== undefined) (out as Record<string, unknown>)[key] = props[key];\n  }\n  return out;\n}\n\n/**\n * A liquid glass lens over live DOM content.\n *\n * ```tsx\n * <LiquidGlass draggable>\n *   <img src=\"/photo.jpg\" alt=\"\" />\n * </LiquidGlass>\n * ```\n */\nexport const LiquidGlass = forwardRef<LiquidGlassHandle, LiquidGlassProps>(\n  function LiquidGlass(props, ref) {\n    const {\n      children,\n      x = 0.5,\n      y = 0.5,\n      draggable = false,\n      shadow = true,\n      onMove,\n      onMapGenerated,\n      // engine options\n      width,\n      height,\n      radius,\n      strength,\n      chromaticAberration,\n      blur,\n      depth,\n      curvature,\n      splay,\n      glow,\n      glowSpread,\n      glowExponent,\n      edgeHighlight,\n      edgeWidth,\n      edgeExponent,\n      specular,\n      specularAngle,\n      quality,\n      // div props\n      style,\n      ...rest\n    } = props;\n\n    const options = pickOptions({\n      width,\n      height,\n      radius,\n      strength,\n      chromaticAberration,\n      blur,\n      depth,\n      curvature,\n      splay,\n      glow,\n      glowSpread,\n      glowExponent,\n      edgeHighlight,\n      edgeWidth,\n      edgeExponent,\n      specular,\n      specularAngle,\n      quality,\n    });\n\n    const containerRef = useRef<HTMLDivElement>(null);\n    const filteredRef = useRef<HTMLDivElement>(null);\n    const defsRef = useRef<HTMLDivElement>(null);\n    const shadowRef = useRef<HTMLDivElement>(null);\n    const engineRef = useRef<LiquidGlassEngine | null>(null);\n    const draggingRef = useRef(false);\n    const dragOffsetRef = useRef({ x: 0, y: 0 });\n\n    const onMoveRef = useRef(onMove);\n    onMoveRef.current = onMove;\n    const onMapRef = useRef(onMapGenerated);\n    onMapRef.current = onMapGenerated;\n\n    // The engine is created once; renders only push option/position diffs.\n    const initialRef = useRef({ options, x, y });\n    initialRef.current.options = options;\n\n    useLayoutEffect(() => {\n      const container = containerRef.current;\n      const filtered = filteredRef.current;\n      const defsHost = defsRef.current;\n      if (!container || !filtered || !defsHost) return;\n\n      const engine = new LiquidGlassEngine(\n        { container, filtered, defsHost, shadow: shadowRef.current },\n        initialRef.current.options,\n      );\n      engine.onMap = (url) => onMapRef.current?.(url);\n      engine.setPosition(initialRef.current.x, initialRef.current.y);\n      engineRef.current = engine;\n      return () => {\n        engine.destroy();\n        engineRef.current = null;\n      };\n    }, []);\n\n    // Push option changes (engine decides: cheap update vs map regeneration).\n    useEffect(() => {\n      engineRef.current?.setOptions(options);\n      // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [...OPTION_KEYS.map((key) => options[key])]);\n\n    // Controlled position. Only reacts to actual prop *changes*: the initial\n    // value is applied at engine creation, and re-applying it on mount would\n    // stomp positions set imperatively (setPosition) before this effect runs.\n    // Also ignored mid-drag so dragging stays smooth.\n    const prevPosRef = useRef<{ x: number; y: number } | null>(null);\n    useEffect(() => {\n      initialRef.current.x = x;\n      initialRef.current.y = y;\n      const prev = prevPosRef.current;\n      prevPosRef.current = { x, y };\n      if (prev === null || (prev.x === x && prev.y === y)) return;\n      if (!draggingRef.current) engineRef.current?.setPosition(x, y);\n    }, [x, y]);\n\n    useImperativeHandle(ref, () => ({\n      get element() {\n        return containerRef.current;\n      },\n      get engine() {\n        return engineRef.current;\n      },\n      setPosition: (px: number, py: number) => engineRef.current?.setPosition(px, py),\n    }));\n\n    const handlePointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n      if (!draggable || !engineRef.current) return;\n      const rect = e.currentTarget.getBoundingClientRect();\n      const pos = engineRef.current.getPosition();\n      draggingRef.current = true;\n      dragOffsetRef.current = {\n        x: (e.clientX - rect.left) / rect.width - pos.x,\n        y: (e.clientY - rect.top) / rect.height - pos.y,\n      };\n      e.currentTarget.setPointerCapture(e.pointerId);\n      e.preventDefault();\n    };\n\n    const handlePointerMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n      if (!draggingRef.current || !engineRef.current) return;\n      const rect = e.currentTarget.getBoundingClientRect();\n      const nx = (e.clientX - rect.left) / rect.width - dragOffsetRef.current.x;\n      const ny = (e.clientY - rect.top) / rect.height - dragOffsetRef.current.y;\n      engineRef.current.setPosition(nx, ny);\n      const pos = engineRef.current.getPosition();\n      onMoveRef.current?.(pos.x, pos.y);\n      e.preventDefault();\n    };\n\n    const handlePointerEnd = () => {\n      draggingRef.current = false;\n    };\n\n    const containerStyle: CSSProperties = {\n      position: \"relative\",\n      ...(draggable\n        ? { cursor: \"grab\", touchAction: \"none\", userSelect: \"none\", WebkitUserSelect: \"none\" }\n        : null),\n      ...style,\n    };\n\n    return (\n      <div\n        ref={containerRef}\n        data-liquid-glass=\"\"\n        style={containerStyle}\n        onPointerDown={draggable ? handlePointerDown : undefined}\n        onPointerMove={draggable ? handlePointerMove : undefined}\n        onPointerUp={draggable ? handlePointerEnd : undefined}\n        onPointerCancel={draggable ? handlePointerEnd : undefined}\n        {...rest}\n      >\n        <div ref={filteredRef} style={{ willChange: \"filter\" }}>\n          {children}\n        </div>\n        <div ref={defsRef} style={{ position: \"absolute\", inset: 0, pointerEvents: \"none\" }} aria-hidden />\n        {shadow !== false && (\n          <div\n            ref={shadowRef}\n            aria-hidden\n            style={{\n              position: \"absolute\",\n              top: 0,\n              left: 0,\n              pointerEvents: \"none\",\n              willChange: \"transform\",\n              boxShadow: shadow === true ? DEFAULT_SHADOW : shadow,\n            }}\n          />\n        )}\n      </div>\n    );\n  },\n);\n","/** Fast error-function approximation, used for the smooth edge falloff. */\nexport function erf(x: number): number {\n  return Math.tanh(1.7724538509 * x);\n}\n\nexport interface DomeConstants {\n  Rx: number;\n  Ry: number;\n  scaleX: number;\n  scaleY: number;\n}\n\n/**\n * Average gradient magnitude of a circular cap of radius `R` sampled across\n * `half`. Used to normalize the dome profile so its mean refraction strength\n * matches the linear profile, keeping `strength` perceptually stable while\n * `curvature` changes.\n */\nfunction averageDomeGradient(R: number, half: number): number {\n  let sum = 0;\n  for (let i = 0; i <= 200; i++) {\n    const s = (i / 200) * half;\n    const v = s / Math.sqrt(R * R - s * s);\n    sum += i === 0 || i === 200 ? 0.5 * v : v;\n  }\n  return sum / 200;\n}\n\n/** Sphere radii + normalization for a dome of `depth` px over the lens. */\nexport function computeDomeConstants(\n  depth: number,\n  halfWidth: number,\n  halfHeight: number,\n): DomeConstants {\n  const d = Math.max(0.01, Math.min(depth, Math.min(halfWidth, halfHeight) - 1));\n  const Rx = (halfWidth * halfWidth + d * d) / (2 * d);\n  const Ry = (halfHeight * halfHeight + d * d) / (2 * d);\n  const gx = averageDomeGradient(Rx, halfWidth);\n  const gy = averageDomeGradient(Ry, halfHeight);\n  return {\n    Rx,\n    Ry,\n    scaleX: gx > 0 ? 0.5 / gx : 1,\n    scaleY: gy > 0 ? 0.5 / gy : 1,\n  };\n}\n\n/** Surface gradient of the dome at offset `x` from the lens center. */\nexport function domeGradient(x: number, R: number, scale: number): number {\n  const s = Math.min(x, 0.999 * R);\n  return (s / Math.sqrt(R * R - s * s)) * scale;\n}\n","import { computeDomeConstants, domeGradient, erf } from \"./math\";\nimport type { DisplacementMapParams } from \"./types\";\n\n/**\n * Computes the displacement map as raw RGBA pixels.\n *\n * Red encodes horizontal displacement and green vertical (128 = neutral).\n * Blue carries the baked specular mask (glow + edge highlight). Outside the\n * rounded-rect lens every pixel is neutral, so the filter leaves those\n * pixels untouched.\n *\n * The map has four-fold symmetry: only the top-left quadrant is computed and\n * each pixel is written into all four quadrants, negating X displacement\n * across the vertical axis and Y across the horizontal one. The specular\n * projection |x·cosθ ± y·sinθ| yields two values per quadrant pair, which is\n * what the sum/diff split below handles.\n *\n * Pure function (no DOM), so it is unit-testable and worker-friendly.\n */\nexport function computeDisplacementMap(p: DisplacementMapParams): Uint8ClampedArray {\n  const size = p.size;\n  const half = size >> 1;\n  const data = new Uint8ClampedArray(size * size * 4);\n\n  const hw = p.halfWidth;\n  const hh = p.halfHeight;\n\n  const cornerR = Math.min(p.radius, Math.min(hw, hh));\n  const innerW = Math.max(0, hw - p.depth);\n  const innerH = Math.max(0, hh - p.depth);\n  const innerR = Math.max(0, Math.min(p.radius, Math.min(innerW, innerH)));\n  const falloffK = p.depth > 0 ? 1 / (p.depth * Math.SQRT2) : 1e6;\n\n  const hasSpecular = p.glow > 0 || p.edgeHighlight > 0;\n  const theta = (p.specularAngle * Math.PI) / 180;\n  const cosT = Math.cos(theta);\n  const sinT = Math.sin(theta);\n  const glowLo = (1 - p.glowSpread) * Math.SQRT2;\n  const glowRange = p.glowSpread * Math.SQRT2;\n  const glowInv = glowRange > 0.001 ? 1 / glowRange : 0;\n  const edgeInv = p.edgeWidth > 0 ? 1 / p.edgeWidth : 0;\n\n  const stepX = (2 * hw) / size;\n  const stepY = (2 * hh) / size;\n  const invW = 1 / hw;\n  const invH = 1 / hh;\n\n  const dome = p.domeDepth > 0 ? computeDomeConstants(p.domeDepth, hw, hh) : null;\n  let domeColumns: Float32Array | null = null;\n  if (dome) {\n    domeColumns = new Float32Array(half);\n    const rr = dome.Rx * dome.Rx;\n    const cap = 0.999 * dome.Rx;\n    for (let c = 0; c < half; c++) {\n      const ax = -((c + 0.5) * stepX - hw);\n      const s = ax < cap ? ax : cap;\n      domeColumns[c] = (s / Math.sqrt(rr - s * s)) * dome.scaleX;\n    }\n  }\n\n  const doSplay = p.splay < 1;\n  const splayMix = 1 - p.splay;\n  const splayHalf = 0.5 * Math.min(hw, hh);\n  const splayInv = splayHalf > 0 ? 1 / splayHalf : 0;\n\n  for (let row = 0; row < half; row++) {\n    const mirrorRow = size - 1 - row;\n    const ay = -((row + 0.5) * stepY - hh); // positive y offset (top half)\n    const sdfY = ay - hh + cornerR;\n    const fallY = ay - innerH + innerR;\n    const gradY = dome\n      ? domeGradient(ay, dome.Ry, dome.scaleY)\n      : ay * invH > 1\n        ? 1\n        : ay * invH;\n    const clampY = ay * invH > 1 ? 1 : ay * invH;\n    const splayY = doSplay ? Math.max(0, 1 - (hh - ay) * splayInv) : 0;\n\n    for (let col = 0; col < half; col++) {\n      const mirrorCol = size - 1 - col;\n      const ax = -((col + 0.5) * stepX - hw); // positive x offset (left half)\n      const sdfX = ax - hw + cornerR;\n\n      // Signed distance to the rounded-rect lens boundary.\n      const ox = sdfX > 0 ? sdfX : 0;\n      const oy = sdfY > 0 ? sdfY : 0;\n      const oo = ox * ox + oy * oy;\n      const sdf =\n        (oo > 0 ? Math.sqrt(oo) : 0) +\n        (sdfX > sdfY ? (sdfX > 0 ? 0 : sdfX) : sdfY > 0 ? 0 : sdfY) -\n        cornerR;\n\n      const iTL = (row * size + col) * 4;\n      const iTR = (row * size + mirrorCol) * 4;\n      const iBL = (mirrorRow * size + col) * 4;\n      const iBR = (mirrorRow * size + mirrorCol) * 4;\n\n      if (sdf >= 0) {\n        // Outside the lens: neutral color, transparent alpha. The alpha\n        // channel doubles as the lens-shape mask in the filter, so blur and\n        // refraction clip to the rounded shape instead of the bounding rect.\n        data[iTL] = data[iTL + 1] = data[iTL + 2] = 128;\n        data[iTR] = data[iTR + 1] = data[iTR + 2] = 128;\n        data[iBL] = data[iBL + 1] = data[iBL + 2] = 128;\n        data[iBR] = data[iBR + 1] = data[iBR + 2] = 128;\n        data[iTL + 3] = data[iTR + 3] = data[iBL + 3] = data[iBR + 3] = 0;\n        continue;\n      }\n\n      let dispX = dome && domeColumns ? domeColumns[col] : ax * invW > 1 ? 1 : ax * invW;\n      let dispY = gradY;\n\n      if (doSplay) {\n        const attX = splayY * splayMix; // damps X displacement near top/bottom\n        const attY = Math.max(0, 1 - (hw - ax) * splayInv) * splayMix; // damps Y near left/right\n        if (attX > 0.001 || attY > 0.001) {\n          const x0 = dispX;\n          const y0 = dispY;\n          dispX = x0 * (1 - attX);\n          dispY = y0 * (1 - attY);\n          const m0 = Math.sqrt(x0 * x0 + y0 * y0);\n          const m1 = Math.sqrt(dispX * dispX + dispY * dispY);\n          if (m1 > 0.001) {\n            const k = m0 / m1;\n            dispX *= k;\n            dispY *= k;\n          }\n        }\n      }\n\n      // Smooth falloff: flat center, ramping up across the edge band.\n      const ex = ax - innerW + innerR;\n      const rx = ex > 0 ? ex : 0;\n      const ry = fallY > 0 ? fallY : 0;\n      const innerSdf =\n        Math.sqrt(rx * rx + ry * ry) +\n        (ex > fallY ? (ex > 0 ? 0 : ex) : fallY > 0 ? 0 : fallY) -\n        innerR;\n      const fall = 0.5 * (1 + erf(innerSdf * falloffK));\n\n      const hx = 0.5 * dispX * fall;\n      const hy = 0.5 * dispY * fall;\n      const rPlus = ((0.5 + hx) * 255 + 0.5) | 0;\n      const rMinus = ((0.5 - hx) * 255 + 0.5) | 0;\n      const gPlus = ((0.5 + hy) * 255 + 0.5) | 0;\n      const gMinus = ((0.5 - hy) * 255 + 0.5) | 0;\n\n      let bSum = 128;\n      let bDiff = 128;\n      if (hasSpecular) {\n        const px = (ax * invW > 1 ? 1 : ax * invW) * cosT;\n        const py = clampY * sinT;\n        const projSum = Math.abs(px + py); // TL and BR quadrants\n        const projDiff = Math.abs(px - py); // TR and BL quadrants\n\n        let band = 0;\n        if (p.edgeHighlight > 0) {\n          band = 1 + sdf * edgeInv;\n          if (band < 0) band = 0;\n        }\n\n        let vSum = 0;\n        let vDiff = 0;\n        if (p.glow > 0) {\n          const tS = (projSum - glowLo) * glowInv;\n          vSum += p.glow * Math.pow(tS < 0 ? 0 : tS > 1 ? 1 : tS, p.glowExponent) * fall;\n          const tD = (projDiff - glowLo) * glowInv;\n          vDiff += p.glow * Math.pow(tD < 0 ? 0 : tD > 1 ? 1 : tD, p.glowExponent) * fall;\n        }\n        if (p.edgeHighlight > 0) {\n          vSum += p.edgeHighlight * band * Math.pow(projSum, p.edgeExponent);\n          vDiff += p.edgeHighlight * band * Math.pow(projDiff, p.edgeExponent);\n        }\n        if (vSum > 1) vSum = 1;\n        if (vDiff > 1) vDiff = 1;\n        bSum = (127 * vSum + 128 + 0.5) | 0;\n        bDiff = (127 * vDiff + 128 + 0.5) | 0;\n      }\n\n      data[iTL] = rPlus;\n      data[iTL + 1] = gPlus;\n      data[iTL + 2] = bSum;\n      data[iTL + 3] = 255;\n      data[iTR] = rMinus;\n      data[iTR + 1] = gPlus;\n      data[iTR + 2] = bDiff;\n      data[iTR + 3] = 255;\n      data[iBL] = rPlus;\n      data[iBL + 1] = gMinus;\n      data[iBL + 2] = bDiff;\n      data[iBL + 3] = 255;\n      data[iBR] = rMinus;\n      data[iBR + 1] = gMinus;\n      data[iBR + 2] = bSum;\n      data[iBR + 3] = 255;\n    }\n  }\n\n  return data;\n}\n\n/**\n * Renders the displacement map to a PNG data URL via a (reusable) canvas.\n */\nexport function renderDisplacementMap(\n  p: DisplacementMapParams,\n  canvas: HTMLCanvasElement = document.createElement(\"canvas\"),\n): string {\n  canvas.width = p.size;\n  canvas.height = p.size;\n  const ctx = canvas.getContext(\"2d\");\n  if (!ctx) return \"\";\n  const image = ctx.createImageData(p.size, p.size);\n  image.data.set(computeDisplacementMap(p));\n  ctx.putImageData(image, 0, 0);\n  return canvas.toDataURL();\n}\n","/** Options accepted by the engine and the `<LiquidGlass>` component. */\nexport interface LiquidGlassOptions {\n  /** Lens width in px. */\n  width: number;\n  /** Lens height in px. */\n  height: number;\n  /** Corner radius in px, or `\"auto\"` for a fully rounded pill/circle. */\n  radius: number | \"auto\";\n\n  /**\n   * Refraction strength as a fraction of the container size (0–0.25 is a\n   * sensible range). Cheap to change: does not regenerate the map.\n   */\n  strength: number;\n  /** Chromatic aberration along the lens edge, 0–1. */\n  chromaticAberration: number;\n  /** Gaussian blur of the refracted content in px. */\n  blur: number;\n\n  /** Width of the refracting edge band in px. Larger = thicker glass rim. */\n  depth: number;\n  /**\n   * Lens profile, 0–1. At 0 displacement ramps linearly from the center;\n   * at 1 the lens is a full spherical dome.\n   */\n  curvature: number;\n  /**\n   * How much displacement near an edge stays perpendicular to it, 0–1.\n   * 1 splays the refraction outwards at the corners, 0 keeps it radial.\n   */\n  splay: number;\n\n  /** Inner specular glow strength, 0–1. */\n  glow: number;\n  /** Fraction of the lens the glow spreads across, 0–1. */\n  glowSpread: number;\n  /** Falloff exponent of the glow. */\n  glowExponent: number;\n  /** Bright rim along the lens edge, 0–1. */\n  edgeHighlight: number;\n  /** Width of the edge highlight band in px. */\n  edgeWidth: number;\n  /** Falloff exponent of the edge highlight. */\n  edgeExponent: number;\n  /** Master intensity of the baked specular pass (glow + edge), 0–2. */\n  specular: number;\n  /** Direction of the specular light in degrees. */\n  specularAngle: number;\n\n  /** Resolution of the generated displacement map (power of two). */\n  quality: number;\n}\n\nexport const DEFAULT_OPTIONS: LiquidGlassOptions = {\n  width: 160,\n  height: 120,\n  radius: \"auto\",\n  strength: 0.1,\n  chromaticAberration: 0.2,\n  blur: 0,\n  depth: 10,\n  curvature: 0.65,\n  splay: 1,\n  glow: 0.1,\n  glowSpread: 1,\n  glowExponent: 1.5,\n  edgeHighlight: 0.25,\n  edgeWidth: 3,\n  edgeExponent: 1.5,\n  specular: 1,\n  specularAngle: 45,\n  quality: 512,\n};\n\n/** Parameters of the raw displacement-map computation, all in lens space. */\nexport interface DisplacementMapParams {\n  /** Output bitmap size (square, even). */\n  size: number;\n  halfWidth: number;\n  halfHeight: number;\n  radius: number;\n  depth: number;\n  /** Dome depth in px; 0 for a linear profile. */\n  domeDepth: number;\n  splay: number;\n  glow: number;\n  glowSpread: number;\n  glowExponent: number;\n  edgeHighlight: number;\n  edgeWidth: number;\n  edgeExponent: number;\n  specularAngle: number;\n}\n","import { renderDisplacementMap } from \"./displacementMap\";\nimport { DEFAULT_OPTIONS, type LiquidGlassOptions } from \"./types\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/** DOM elements the engine drives. */\nexport interface LiquidGlassHost {\n  /** Element the lens lives in; overlays are positioned relative to it. */\n  container: HTMLElement;\n  /**\n   * Wrapper around the refracted content; receives `style.filter`. The SVG\n   * filter's coordinate space belongs to this element, so all lens math is\n   * measured against it.\n   */\n  filtered: HTMLElement;\n  /** Empty element the engine renders the `<svg><defs>` filter into. */\n  defsHost: HTMLElement;\n  /** Optional element positioned over the lens (shadow / rim chrome). */\n  shadow?: HTMLElement | null;\n}\n\nlet instanceCounter = 0;\n\nconst UA = typeof navigator !== \"undefined\" ? navigator.userAgent : \"\";\n/**\n * iOS WebKit (every iOS browser) misplaces filter primitive subregions\n * expressed in objectBoundingBox units, so the engine runs the filter in\n * userSpaceOnUse units there instead.\n */\nconst IS_IOS =\n  typeof navigator !== \"undefined\" &&\n  (/iPad|iPhone|iPod/.test(UA) ||\n    (navigator.platform === \"MacIntel\" && navigator.maxTouchPoints > 1));\n/**\n * Safari caches SVG filter output by filter ID and keeps serving stale\n * results when attributes change. Only there does every update need a fresh\n * ID; forcing it on other engines would rebuild the filter chain per frame.\n */\nconst IS_SAFARI = IS_IOS || /^((?!chrome|chromium|android).)*safari/i.test(UA);\n\nfunction fe(name: string, attrs: Record<string, string | number>): SVGElement {\n  const el = document.createElementNS(SVG_NS, name);\n  for (const key of Object.keys(attrs)) el.setAttribute(key, String(attrs[key]));\n  return el;\n}\n\n/**\n * Imperative core of liquid-glass-web-react. Owns the SVG filter, the displacement map\n * and all per-frame attribute updates. Framework-agnostic by design; the\n * React component is a thin wrapper around this class.\n *\n * Two update paths, mirroring how the effect stays cheap to animate:\n * - `setPosition` / fast options only move the filter's lens subregion and\n *   never touch the map.\n * - Shape/surface options regenerate the map, throttled to one per frame.\n */\nexport class LiquidGlassEngine {\n  private host: LiquidGlassHost;\n  private options: LiquidGlassOptions;\n\n  private filterEl: SVGElement | null = null;\n  private feImageEl: SVGElement | null = null;\n  private lensRegionEls: SVGElement[] = [];\n  private dispEls: SVGElement[] = [];\n  private blurEl: SVGElement | null = null;\n  private specularEl: SVGElement | null = null;\n\n  private x = 0.5;\n  private y = 0.5;\n  private mapUrl = \"\";\n  private mapCanvas: HTMLCanvasElement | null = null;\n\n  private readonly id: string;\n  private version = 0;\n  private regenQueued = false;\n  private rafId: number | null = null;\n  private resizeObserver: ResizeObserver | null = null;\n  private destroyed = false;\n  private warnedFootprint = false;\n\n  /** Called whenever a new displacement map has been generated. */\n  onMap: ((url: string) => void) | null = null;\n\n  constructor(host: LiquidGlassHost, options?: Partial<LiquidGlassOptions>) {\n    this.host = host;\n    this.options = { ...DEFAULT_OPTIONS, ...options };\n    this.id = `liquid-glass-web-react-${++instanceCounter}`;\n\n    this.buildFilter();\n    this.regenerate();\n\n    this.resizeObserver = new ResizeObserver(() => this.update());\n    this.resizeObserver.observe(host.container);\n    if (host.filtered !== host.container) this.resizeObserver.observe(host.filtered);\n  }\n\n  /** Lens center as fractions (0–1) of the glass surface (filtered box). */\n  setPosition(x: number, y: number): void {\n    this.x = Math.min(1, Math.max(0, x));\n    this.y = Math.min(1, Math.max(0, y));\n    this.update();\n  }\n\n  getPosition(): { x: number; y: number } {\n    return { x: this.x, y: this.y };\n  }\n\n  /** Latest generated displacement map as a PNG data URL. */\n  getMapUrl(): string {\n    return this.mapUrl;\n  }\n\n  /** Merge new options; regenerates the map only when the shape changed. */\n  setOptions(partial: Partial<LiquidGlassOptions>): void {\n    const prev = this.options;\n    const next = { ...prev, ...partial };\n    this.options = next;\n\n    const needsRegen = (\n      [\n        \"width\",\n        \"height\",\n        \"radius\",\n        \"depth\",\n        \"curvature\",\n        \"splay\",\n        \"glow\",\n        \"glowSpread\",\n        \"glowExponent\",\n        \"edgeHighlight\",\n        \"edgeWidth\",\n        \"edgeExponent\",\n        \"specularAngle\",\n        \"quality\",\n      ] as const\n    ).some((key) => prev[key] !== next[key]);\n\n    if (needsRegen) this.scheduleRegenerate();\n    else this.update();\n  }\n\n  getOptions(): LiquidGlassOptions {\n    return { ...this.options };\n  }\n\n  /** Re-measure and re-apply everything (e.g. after layout changes). */\n  refresh(): void {\n    this.update();\n  }\n\n  destroy(): void {\n    this.destroyed = true;\n    if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n    this.resizeObserver?.disconnect();\n    this.resizeObserver = null;\n    this.host.filtered.style.filter = \"\";\n    this.host.defsHost.replaceChildren();\n    if (this.mapCanvas) {\n      this.mapCanvas.width = 0;\n      this.mapCanvas.height = 0;\n      this.mapCanvas = null;\n    }\n  }\n\n  // -- internals ----------------------------------------------------------\n\n  private get halfWidth(): number {\n    return this.options.width / 2;\n  }\n\n  private get halfHeight(): number {\n    return this.options.height / 2;\n  }\n\n  private get cornerRadius(): number {\n    const { radius } = this.options;\n    const max = Math.min(this.halfWidth, this.halfHeight);\n    return radius === \"auto\" ? max : Math.min(radius, max);\n  }\n\n  /**\n   * Builds the filter primitive chain:\n   *\n   *   neutral flood ─ feImage(map at lens) ─▶ map\n   *   source ─ feGaussianBlur(optional) ─▶ blurred\n   *   3 × feDisplacementMap at offset scales, one per RGB channel,\n   *     recombined additively ─▶ chromatic refraction\n   *   map blue channel ─▶ specular highlight, composited over\n   *   lens punched out of source, refraction composited back in\n   *\n   * Everything tagged `data-lens` is restricted to the lens subregion, so\n   * content outside the lens is the browser's original render and the\n   * filter's cost scales with the lens, not the container.\n   */\n  private buildFilter(): void {\n    const units = IS_IOS ? \"userSpaceOnUse\" : \"objectBoundingBox\";\n    const filter = fe(\"filter\", {\n      filterUnits: units,\n      primitiveUnits: units,\n      \"color-interpolation-filters\": \"sRGB\",\n      x: 0,\n      y: 0,\n      width: 1, // userSpaceOnUse sizes are set in px on every update\n      height: 1,\n    });\n\n    filter.appendChild(\n      fe(\"feFlood\", { \"flood-color\": \"rgb(128,128,128)\", \"flood-opacity\": 1, result: \"mapBg\" }),\n    );\n    this.feImageEl = fe(\"feImage\", {\n      \"data-lens\": \"\",\n      preserveAspectRatio: \"none\",\n      result: \"rawMap\",\n    });\n    filter.appendChild(this.feImageEl);\n    filter.appendChild(fe(\"feComposite\", { in: \"rawMap\", in2: \"mapBg\", operator: \"over\", result: \"map\" }));\n\n    this.blurEl = fe(\"feGaussianBlur\", { in: \"SourceGraphic\", stdDeviation: \"0 0\", result: \"blurred\" });\n    filter.appendChild(this.blurEl);\n\n    const channelMatrices = [\n      \"1 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0\",\n      \"0 0 0 0 0  0 1 0 0 0  0 0 0 0 0  0 0 0 1 0\",\n      \"0 0 0 0 0  0 0 0 0 0  0 0 1 0 0  0 0 0 1 0\",\n    ];\n    const results = [\"dispR\", \"dispG\", \"dispB\"];\n    for (let i = 0; i < 3; i++) {\n      filter.appendChild(\n        fe(\"feDisplacementMap\", {\n          \"data-lens\": \"\",\n          in: \"SourceGraphic\",\n          in2: \"map\",\n          scale: 0,\n          xChannelSelector: \"R\",\n          yChannelSelector: \"G\",\n        }),\n      );\n      filter.appendChild(fe(\"feColorMatrix\", { type: \"matrix\", values: channelMatrices[i], result: results[i] }));\n    }\n    filter.appendChild(\n      fe(\"feComposite\", { in: \"dispR\", in2: \"dispG\", operator: \"arithmetic\", k1: 0, k2: 1, k3: 1, k4: 0 }),\n    );\n    filter.appendChild(\n      fe(\"feComposite\", { in2: \"dispB\", operator: \"arithmetic\", k1: 0, k2: 1, k3: 1, k4: 0, result: \"lensResult\" }),\n    );\n\n    // The specular pass costs whatever area it reads. On Safari, reading the\n    // lens-sized rawMap instead of the full-region map produces an identical\n    // result (outside the lens both resolve to zero alpha) at a fraction of\n    // the cost. Chromium shows sub-pixel flicker along the lens edge with the\n    // restricted read, so it keeps the full-region input.\n    filter.appendChild(\n      fe(\"feColorMatrix\", {\n        in: IS_SAFARI ? \"rawMap\" : \"map\",\n        type: \"matrix\",\n        values: `0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 1 0 ${-128 / 255}`,\n        result: \"specMask\",\n      }),\n    );\n    this.specularEl = fe(\"feComposite\", {\n      in: \"specMask\",\n      in2: \"lensResult\",\n      operator: \"arithmetic\",\n      k1: 0,\n      k2: this.options.specular,\n      k3: 1,\n      k4: 0,\n      result: \"lensResult\",\n    });\n    filter.appendChild(this.specularEl);\n\n    // The map's alpha channel is the exact lens shape. Clip the refracted\n    // result to it and punch the same shape out of the source, so the lens\n    // (and any blur) follows the rounded geometry, not its bounding rect.\n    filter.appendChild(\n      fe(\"feColorMatrix\", {\n        in: \"rawMap\",\n        type: \"matrix\",\n        values: \"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0\",\n        result: \"lensShape\",\n      }),\n    );\n    filter.appendChild(\n      fe(\"feComposite\", { in: \"lensResult\", in2: \"lensShape\", operator: \"in\", result: \"lensResult\" }),\n    );\n    filter.appendChild(fe(\"feComposite\", { in: \"SourceGraphic\", in2: \"lensShape\", operator: \"out\", result: \"holedSG\" }));\n    filter.appendChild(fe(\"feComposite\", { in: \"lensResult\", in2: \"holedSG\", operator: \"over\" }));\n\n    const svg = document.createElementNS(SVG_NS, \"svg\");\n    svg.setAttribute(\"aria-hidden\", \"true\");\n    svg.setAttribute(\"width\", \"0\");\n    svg.setAttribute(\"height\", \"0\");\n    svg.style.position = \"absolute\";\n    const defs = document.createElementNS(SVG_NS, \"defs\");\n    defs.appendChild(filter);\n    svg.appendChild(defs);\n    this.host.defsHost.replaceChildren(svg);\n\n    this.filterEl = filter;\n    this.lensRegionEls = Array.from(filter.querySelectorAll(\"[data-lens]\"));\n    this.dispEls = Array.from(filter.querySelectorAll(\"feDisplacementMap\"));\n  }\n\n  private scheduleRegenerate(): void {\n    if (this.regenQueued) return;\n    this.regenQueued = true;\n    this.rafId = requestAnimationFrame(() => {\n      this.regenQueued = false;\n      this.rafId = null;\n      if (!this.destroyed) this.regenerate();\n    });\n  }\n\n  private regenerate(): void {\n    const o = this.options;\n    const hw = this.halfWidth;\n    const hh = this.halfHeight;\n    if (!this.mapCanvas) this.mapCanvas = document.createElement(\"canvas\");\n\n    this.mapUrl = renderDisplacementMap(\n      {\n        size: o.quality,\n        halfWidth: hw,\n        halfHeight: hh,\n        radius: this.cornerRadius,\n        depth: o.depth,\n        domeDepth: Math.max(0, Math.min(1, o.curvature)) * Math.min(hw, hh),\n        splay: o.splay,\n        glow: o.glow,\n        glowSpread: o.glowSpread,\n        glowExponent: o.glowExponent,\n        edgeHighlight: o.edgeHighlight,\n        edgeWidth: o.edgeWidth,\n        edgeExponent: o.edgeExponent,\n        specularAngle: o.specularAngle,\n      },\n      this.mapCanvas,\n    );\n    this.feImageEl?.setAttribute(\"href\", this.mapUrl);\n    this.onMap?.(this.mapUrl);\n    this.update();\n  }\n\n  /**\n   * Fast path: repositions the lens subregion, updates scales/blur, bumps\n   * the filter ID. Safari caches filter output by ID and keeps serving stale\n   * results otherwise, so every update assigns a fresh one.\n   */\n  private update(): void {\n    if (!this.filterEl || this.destroyed) return;\n    // The filter's user space is the filtered element's box. Measuring the\n    // container instead would desync the lens whenever the two differ (e.g.\n    // padding on the container).\n    const rect = this.host.filtered.getBoundingClientRect();\n    const W = rect.width;\n    const H = rect.height;\n    if (W <= 0 || H <= 0) return;\n\n    // Safari caps the source-graphic size an SVG filter can process; past it\n    // the effect tiles into mismatched blocks or drops entirely. The exact\n    // ceiling varies by version and device, so warn once at a conservative\n    // threshold rather than failing silently.\n    if (IS_SAFARI && !this.warnedFootprint && W * H > 2_500_000) {\n      this.warnedFootprint = true;\n      console.warn(\n        `[liquid-glass-web-react] Refracting a ${Math.round(W)}×${Math.round(H)}px element. ` +\n          \"Safari limits the source size an SVG filter can process and may degrade or drop \" +\n          \"the effect — consider scoping the glass to a smaller region on Safari/iOS.\",\n      );\n    }\n\n    const o = this.options;\n    const hw = this.halfWidth;\n    const hh = this.halfHeight;\n    const left = this.x * W - hw;\n    const top = this.y * H - hh;\n    const bias = 0.5; // shrink the subregion slightly to avoid edge artifacts\n\n    // userSpaceOnUse works in px; objectBoundingBox in fractions of the box.\n    const sx = IS_IOS ? 1 : 1 / W;\n    const sy = IS_IOS ? 1 : 1 / H;\n    if (IS_IOS) {\n      this.filterEl.setAttribute(\"width\", String(W));\n      this.filterEl.setAttribute(\"height\", String(H));\n    }\n\n    const fx = String((left + bias) * sx);\n    const fy = String((top + bias) * sy);\n    const fw = String(Math.max(0, 2 * hw - 2 * bias) * sx);\n    const fh = String(Math.max(0, 2 * hh - 2 * bias) * sy);\n    for (const el of this.lensRegionEls) {\n      el.setAttribute(\"x\", fx);\n      el.setAttribute(\"y\", fy);\n      el.setAttribute(\"width\", fw);\n      el.setAttribute(\"height\", fh);\n    }\n\n    // In objectBoundingBox units the browser resolves a displacement scale\n    // of `s` to s·√(W²+H²)/√2 px; in userSpaceOnUse, apply that ourselves so\n    // `strength` means the same thing on every platform.\n    const s = IS_IOS\n      ? (o.strength * Math.sqrt(W * W + H * H)) / Math.SQRT2\n      : o.strength;\n    const c = o.chromaticAberration;\n    const scales = [s * (1 + 0.2 * c), s * (1 + 0.1 * c), s];\n    const blurInput = o.blur > 0 ? \"blurred\" : \"SourceGraphic\";\n    for (let i = 0; i < this.dispEls.length; i++) {\n      this.dispEls[i].setAttribute(\"scale\", String(scales[i]));\n      this.dispEls[i].setAttribute(\"in\", blurInput);\n    }\n    this.blurEl?.setAttribute(\n      \"stdDeviation\",\n      IS_IOS ? `${o.blur} ${o.blur}` : `${o.blur / W} ${o.blur / H}`,\n    );\n    this.specularEl?.setAttribute(\"k2\", String(o.specular));\n\n    if (IS_SAFARI) {\n      // Fresh ID every update, or Safari serves the cached filter output.\n      this.filterEl.id = `${this.id}-v${++this.version}`;\n      this.host.filtered.style.filter = `url(#${this.filterEl.id})`;\n    } else if (!this.filterEl.id) {\n      // Everywhere else attribute updates apply in place; assign the filter\n      // once and never invalidate it, which keeps dragging cheap.\n      this.filterEl.id = this.id;\n      this.host.filtered.style.filter = `url(#${this.id})`;\n    }\n\n    const shadow = this.host.shadow;\n    if (shadow) {\n      // The overlay lives in the container, which may be offset from the\n      // filtered element; bridge the two coordinate spaces.\n      let ox = 0;\n      let oy = 0;\n      if (this.host.filtered !== this.host.container) {\n        const crect = this.host.container.getBoundingClientRect();\n        ox = rect.left - crect.left;\n        oy = rect.top - crect.top;\n      }\n      shadow.style.transform = `translate(${ox + left}px, ${oy + top}px)`;\n      shadow.style.width = `${2 * hw}px`;\n      shadow.style.height = `${2 * hh}px`;\n      shadow.style.borderRadius = `${this.cornerRadius}px`;\n    }\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAUO;;;ACTA,SAAS,IAAI,GAAmB;AACrC,SAAO,KAAK,KAAK,eAAe,CAAC;AACnC;AAeA,SAAS,oBAAoB,GAAW,MAAsB;AAC5D,MAAI,MAAM;AACV,WAAS,IAAI,GAAG,KAAK,KAAK,KAAK;AAC7B,UAAM,IAAK,IAAI,MAAO;AACtB,UAAM,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC;AACrC,WAAO,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI;AAAA,EAC1C;AACA,SAAO,MAAM;AACf;AAGO,SAAS,qBACd,OACA,WACA,YACe;AACf,QAAM,IAAI,KAAK,IAAI,MAAM,KAAK,IAAI,OAAO,KAAK,IAAI,WAAW,UAAU,IAAI,CAAC,CAAC;AAC7E,QAAM,MAAM,YAAY,YAAY,IAAI,MAAM,IAAI;AAClD,QAAM,MAAM,aAAa,aAAa,IAAI,MAAM,IAAI;AACpD,QAAM,KAAK,oBAAoB,IAAI,SAAS;AAC5C,QAAM,KAAK,oBAAoB,IAAI,UAAU;AAC7C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,QAAQ,KAAK,IAAI,MAAM,KAAK;AAAA,IAC5B,QAAQ,KAAK,IAAI,MAAM,KAAK;AAAA,EAC9B;AACF;AAGO,SAAS,aAAa,GAAW,GAAW,OAAuB;AACxE,QAAM,IAAI,KAAK,IAAI,GAAG,QAAQ,CAAC;AAC/B,SAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,IAAK;AAC1C;;;AChCO,SAAS,uB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