{
  "type": "remotion-element",
  "version": 1,
  "element": {
    "assets": [],
    "dependencies": [
      {
        "name": "@remotion/google-fonts",
        "version": null
      },
      {
        "name": "culori",
        "version": "4.0.2"
      },
      {
        "name": "@types/culori",
        "version": "4.0.1"
      }
    ],
    "dimensions": {
      "width": 1280,
      "height": 720
    },
    "displayName": "Click Type",
    "initialProps": {
      "placeholder": "Describe what you want to build...",
      "prompt": "Build me a marketing site",
      "hint": "New suggestion",
      "accentColor": "#3577e0",
      "mode": "light",
      "speed": 1
    },
    "slug": "click-type",
    "sourceCode": "/// <reference lib=\"dom\" />\n/// <reference lib=\"dom.iterable\" />\n/// <reference lib=\"es2023\" />\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Inter\";\nimport {\n  AbsoluteFill,\n  Easing,\n  getRemotionEnvironment,\n  Interactive,\n  type InteractivitySchema,\n  interpolate,\n  Sequence,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport {\n  type ComponentProps,\n  createContext,\n  type CSSProperties,\n  forwardRef,\n  type ReactNode,\n  useContext,\n  useId,\n} from \"react\";\nimport {\n  clampChroma,\n  converter,\n  formatRgb,\n  interpolate as culoriInterpolate,\n  type Oklch,\n  parse,\n  type Rgb,\n} from \"culori\";\n\nconst toRgb = converter(\"rgb\");\nconst toOklch = converter(\"oklch\");\n\nconst BLACK: Rgb = { mode: \"rgb\", r: 0, g: 0, b: 0, alpha: 1 };\n\n/**\n * Whether to warn. Read through `globalThis`, never a bare `process`: a Vite\n * project defines no `process`, so the bare name threw a ReferenceError on the\n * very input it meant to warn about — and a stock Remotion project has no Node\n * types, so the bare name was also a type error in every install.\n */\nfunction isDev(): boolean {\n  const env = (globalThis as { process?: { env?: { NODE_ENV?: string } } })\n    .process?.env;\n  return env?.NODE_ENV !== \"production\";\n}\n\nfunction parseColor(c: string): Rgb {\n  const s = c.trim();\n\n  if (s.startsWith(\"var(\")) {\n    if (isDev()) {\n      console.warn(\n        `parseColor cannot resolve CSS variable \"${s}\" under Remotion's per-frame render. ` +\n          \"Animated colors must be concrete oklch/hex/rgb values supplied via the theme. \" +\n          \"Falling back to the JS default.\",\n      );\n    }\n    return { ...BLACK };\n  }\n\n  const rgb = toRgb(parse(s));\n  if (!rgb) {\n    if (isDev()) {\n      console.warn(`parseColor could not parse \"${s}\"; using black.`);\n    }\n    return { ...BLACK };\n  }\n\n  return { mode: \"rgb\", r: rgb.r, g: rgb.g, b: rgb.b, alpha: rgb.alpha ?? 1 };\n}\n\nfunction resolveColorString(s: string): string {\n  const trimmed = s.trim();\n  if (trimmed.startsWith(\"var(\")) {\n    if (isDev()) {\n      console.warn(\n        `mixOklch cannot resolve CSS variable \"${trimmed}\" under Remotion's per-frame render. ` +\n          \"Animated colors must be concrete oklch/hex/rgb values supplied via the theme. \" +\n          \"Falling back to the JS default.\",\n      );\n    }\n    return \"#000\";\n  }\n  if (!parse(trimmed)) {\n    if (isDev()) {\n      console.warn(`mixOklch could not parse \"${trimmed}\"; using black.`);\n    }\n    return \"#000\";\n  }\n  return trimmed;\n}\n\n// A near-gray still carries a hue (#faf9f6 is h≈91), and oklch interpolation\n// sweeps it toward the other colour's hue: off-white → blue passed through\n// green (#82d6af at 0.42). Grays have no real hue, so drop it and let culori\n// borrow the other end's.\nfunction hueless(color: string): Oklch {\n  const o = toOklch(resolveColorString(color)) as Oklch;\n  return o.c < 0.02 ? { ...o, h: undefined } : o;\n}\n\nfunction mixOklch(a: string, b: string, t: number): string {\n  const mixed = clampChroma(\n    culoriInterpolate([hueless(a), hueless(b)], \"oklch\")(t),\n    \"oklch\",\n    \"rgb\",\n  );\n  return toCss(toRgb(mixed));\n}\n\nfunction toCss(color: Rgb): string {\n  return formatRgb(color);\n}\n\n/**\n * A token at partial opacity — for scrims, veils and inner washes.\n *\n * A scrim written as a literal `rgba(0,0,0,0.4)` is lit for a light surface and\n * does nothing on a dark one; `withAlpha(t.foreground, 0.4)` follows the theme\n * and a user's override. Resolves through `parseColor`, so it inherits the same\n * `var()` guard — an unresolvable token degrades to black rather than an\n * invalid colour string mid-render.\n */\nfunction withAlpha(color: string, alpha: number): string {\n  const { r, g, b } = parseColor(color);\n  return formatRgb({ mode: \"rgb\", r, g, b, alpha });\n}\n\ninterface KitTheme {\n  background: string;\n  foreground: string;\n  card: string;\n  cardForeground: string;\n  popover: string;\n  popoverForeground: string;\n  primary: string;\n  primaryForeground: string;\n  secondary: string;\n  secondaryForeground: string;\n  muted: string;\n  mutedForeground: string;\n  accent: string;\n  accentForeground: string;\n  destructive: string;\n  destructiveForeground: string;\n  border: string;\n  input: string;\n  ring: string;\n  radius: number;\n  /**\n   * The face every text component paints with, as a label from `fonts.ts` or a\n   * CSS family the caller has loaded themselves.\n   *\n   * Optional and defaulted to nothing on purpose: unset, each component keeps\n   * the face it was designed around, so adding this token changed no existing\n   * render. Set it on `KitUIProvider` and one value re-skins a whole\n   * timeline — which is the only reason it lives on the theme rather than\n   * staying a per-component prop.\n   */\n  fontFamily?: string;\n}\n\n/**\n * The shadcn token set, as concrete values.\n *\n * ## These are a mirror of `app/globals.css`, and that is the whole point\n *\n * A component we ship lands next to somebody's `Button` and `Input`, and those\n * paint from the CSS custom properties in `globals.css`. A scene that paints\n * from a *different* set of greys is a scene that clashes with the app it was\n * installed into — which is exactly what happened here: this file was written\n * first, `globals.css` was later re-skinned warm, and for a while the site and\n * the videos it sells were two different products.\n *\n * So every value below is the **literal string** from the corresponding\n * `--token` in `app/globals.css` (`:root` for light, `.dark` for dark). Hex, not\n * oklch, purely so that drift is a string comparison — if the two files ever\n * disagree again, `pnpm run check:tokens` says so and prints the pairs.\n *\n * ## Why not just read `var(--token)`?\n *\n * Because a Remotion bundle has none of the app's CSS, so `var()` resolves to\n * nothing under the headless renderer and cannot be interpolated by `mixOklch`\n * at all (see the guard in `color.ts`). Concrete values are not a shortcut here,\n * they are the only thing that survives a render. Users on a different palette\n * override via `KitUIProvider` or a component's `theme` prop.\n *\n * ## `radius` is the one value that flows the other way\n *\n * `globals.css` sets `--radius: 0.28rem` *so that* its `--radius-3xl` step lands\n * on this 10 — see the note beside it there. It is not drift; do not \"fix\" it.\n */\nconst defaultLightTheme: KitTheme = {\n  background: \"#faf9f6\", // page — warm off-white\n  foreground: \"#141414\", // text\n  card: \"#ffffff\", // surface on the page\n  cardForeground: \"#141414\",\n  popover: \"#ffffff\",\n  popoverForeground: \"#141414\",\n  primary: \"#1d6bff\", // accent blue\n  primaryForeground: \"#ffffff\",\n  secondary: \"#f2f0eb\", // subtle fill\n  secondaryForeground: \"#141414\",\n  muted: \"#f2f0eb\",\n  mutedForeground: \"#6e6a63\", // secondary text, leading icons\n  accent: \"#f2f0eb\", // hover wash\n  accentForeground: \"#141414\",\n  destructive: \"#d92d20\",\n  // `globals.css` defines no --destructive-foreground; white is the only thing\n  // that reads on #d92d20, and shadcn's own default agrees.\n  destructiveForeground: \"#ffffff\",\n  border: \"#d9d9d9\", // hairline\n  input: \"#d9d9d9\",\n  ring: \"#1d6bff\",\n  radius: 10,\n};\n\nconst defaultDarkTheme: KitTheme = {\n  background: \"#0a0a0b\", // page — near-black\n  foreground: \"#fafafa\", // text\n  card: \"#141417\", // surface, a shade above the page\n  cardForeground: \"#fafafa\",\n  popover: \"#141417\",\n  popoverForeground: \"#fafafa\",\n  primary: \"#1d6bff\", // the same accent blue in both modes\n  primaryForeground: \"#ffffff\",\n  secondary: \"#1d1d21\", // subtle fill\n  secondaryForeground: \"#fafafa\",\n  muted: \"#1b1b1f\",\n  mutedForeground: \"#a1a1aa\", // secondary text, leading icons\n  accent: \"#1d1d21\", // hover wash\n  accentForeground: \"#fafafa\",\n  destructive: \"#f97066\",\n  destructiveForeground: \"#fafafa\",\n  border: \"#26272b\", // hairline — separation is borders, not shadows\n  input: \"#26272b\",\n  ring: \"#1d6bff\",\n  radius: 10,\n};\n\ninterface KitThemeContextValue {\n  theme?: Partial<KitTheme>;\n  mode?: \"light\" | \"dark\";\n}\n\nconst KitThemeContext = createContext<KitThemeContextValue>({});\n\nfunction useKitTheme(\n  override?: Partial<KitTheme>,\n  modeOverride?: \"light\" | \"dark\",\n): KitTheme {\n  const ctx = useContext(KitThemeContext);\n  const mode = modeOverride ?? ctx.mode ?? \"light\";\n  const base = mode === \"dark\" ? defaultDarkTheme : defaultLightTheme;\n  return { ...base, ...ctx.theme, ...override };\n}\n\ninterface CaretProps {\n  color?: string;\n  width?: number;\n  height?: number;\n  radius?: number;\n  opacity?: number;\n  blink?: boolean;\n  blinkPerSecond?: number;\n  speed?: number;\n  marginLeft?: number;\n  className?: string;\n  style?: CSSProperties;\n}\n\nfunction caretBlinkOpacity(\n  frame: number,\n  opts: { fps: number; blinkPerSecond: number; speed: number },\n): number {\n  const cycles = opts.blinkPerSecond <= 0 ? 1 : opts.blinkPerSecond;\n  const halfPeriod = opts.fps / cycles / 2;\n  if (halfPeriod <= 0) return 1;\n  return Math.floor((frame * opts.speed) / halfPeriod) % 2 === 0 ? 1 : 0;\n}\n\nfunction Caret({\n  color = \"currentColor\",\n  width = 2,\n  height = 18,\n  radius = 1,\n  opacity,\n  blink = false,\n  blinkPerSecond = 1,\n  speed = 1,\n  marginLeft = 0,\n  className,\n  style,\n}: CaretProps) {\n  const frame = useCurrentFrame();\n  const { fps } = useVideoConfig();\n\n  const resolvedOpacity =\n    opacity !== undefined\n      ? opacity\n      : blink\n        ? caretBlinkOpacity(frame, { fps, blinkPerSecond, speed })\n        : 1;\n\n  return (\n    <span\n      className={className}\n      style={{\n        display: \"inline-block\",\n        flexShrink: 0,\n        width,\n        height,\n        borderRadius: radius,\n        background: color,\n        opacity: resolvedOpacity,\n        marginLeft,\n        ...style,\n      }}\n    />\n  );\n}\n\ntype CursorVariant = \"arrow\" | \"dot\";\n\ninterface CursorWaypoint {\n  /**\n   * Frame the cursor starts travelling TOWARDS this point, on this component's\n   * own clock (i.e. against `useCurrentFrame() * speed`). Absolute, not\n   * relative to the previous waypoint. Waypoints are sorted by `at`; ties break\n   * on array order and the last one wins.\n   *\n   * The FIRST waypoint has nothing to travel from, so it places the cursor\n   * rather than moving it — give it an off-frame `x` to have the cursor walk in.\n   */\n  at: number;\n  /**\n   * Destination, normalized: 0 -> 1 left to right across the composition,\n   * origin top-left. FRAME coordinates — a camera move inside a child\n   * `<ScreenRecording>` does not move the cursor. Values outside 0-1 are legal\n   * and mean off-frame, so a cursor entering from the left starts at `x: -0.1`.\n   */\n  x: number;\n  /** Destination, normalized: 0 -> 1 top to bottom. */\n  y: number;\n  /**\n   * Frames the travel takes. Default 14. The cursor then RESTS here until the\n   * next waypoint's `at` — there is no hold field, the hold is the gap. On the\n   * first waypoint there is no travel, so this is the fade-up window instead.\n   */\n  duration?: number;\n  /**\n   * Pulse a click ring on ARRIVAL, i.e. at `at + duration`. To click twice\n   * without moving, add a second waypoint at the same `x`/`y`.\n   */\n  click?: boolean;\n}\n\ninterface CursorTrackProps {\n  /**\n   * What the cursor moves over — anything. Rendered full-bleed underneath it.\n   * Put the `<ScreenRecording>` (or the UI sim) in here, not this inside that:\n   * the cursor has to be the top layer to read as a cursor.\n   */\n  children?: ReactNode;\n  /**\n   * The path, in any order. Defaults to `DEMO_PATH` so the component is worth\n   * looking at with no props; pass `[]` and it renders nothing at all, i.e. it\n   * becomes a no-op wrapper.\n   */\n  path?: CursorWaypoint[];\n  /** `arrow` (default) is a pointer; `dot` is a touch/tap puck. */\n  variant?: CursorVariant;\n  /**\n   * Cursor height in px. Omit it and the component computes 3.9% of the\n   * composition height, so it stays the size a real cursor looks at any crop.\n   */\n  size?: number;\n  /**\n   * Cursor fill. Defaults to the theme's `foreground` — so pass `mode=\"dark\"`\n   * when the recording underneath is dark, and the cursor and its outline swap\n   * together.\n   */\n  color?: string;\n  /**\n   * The outline that keeps the cursor readable over arbitrary footage. Defaults\n   * to the theme's `background`, the opposite end of `color`.\n   */\n  outlineColor?: string;\n  /** The click ring. Defaults to the theme's `primary`. */\n  ringColor?: string;\n  /** Frames a click ring lives for. Default 14. */\n  clickFrames?: number;\n  /**\n   * Show the cursor parked at the first waypoint before its `at`. Default\n   * false — it fades in as the first move starts, which is what stops a cursor\n   * sitting inertly on frame 0.\n   */\n  showBefore?: boolean;\n  /** Design-system token overrides. */\n  theme?: Partial<KitTheme>;\n  mode?: \"light\" | \"dark\";\n  /** Time multiplier. Every `at` is measured against `useCurrentFrame() * speed`. */\n  speed?: number;\n  className?: string;\n}\n\n// --- Constants -------------------------------------------------------------\n\n/**\n * Cursor travel, and deliberately NOT the camera curve. A pointer accelerates\n * and decelerates; a camera decelerate on a cursor reads robotic. Same curve\n * the notch morph and the showcase crane already use.\n */\nconst CURSOR_EASE = Easing.inOut(Easing.cubic);\n\n/** Click ring growth. Opacity fades linearly under it. */\nconst RING_EASE = Easing.out(Easing.cubic);\n\nconst TRAVEL_FRAMES = 14;\nconst CLICK_FRAMES = 14;\n\n/** Cursor height as a fraction of the composition height, when `size` is omitted. */\nconst CURSOR_HEIGHT_RATIO = 0.039;\n\n/** Ring radius at birth and at death, as multiples of the cursor height. */\nconst RING_START = 0.18;\nconst RING_END = 1.1;\n\n/**\n * The site's own pointer (app/globals.css): a rounded arrow, ink with a rim and\n * a soft shadow, in a 24-unit box with its hotspot — the tip — at (5.5, 5.5).\n * An SVG and not an emoji or a font glyph: a glyph is whatever face the\n * renderer happens to resolve, and it would carry the hinting problems the\n * motion-quality skill is about into the one element that moves every frame.\n */\nconst ARROW_VIEW = 24;\nconst ARROW_TIP = 5.5;\n/** The arrow's ink spans 14 of the 24 units; `size` is that span. */\nconst ARROW_INK = 14;\nconst ARROW_PATH = \"M5.5 5.5 19 11l-5.6 1.45a2 2 0 0 0-1.45 1.45L10.5 19.5z\";\n\n/** The `dot` puck's diameter, as a multiple of the cursor height. */\nconst DOT_RATIO = 0.62;\n\n/**\n * A short demo path: in from off-frame bottom-left, click, cross the frame,\n * click, then move off to the top-right. Carries the customizer preview and the\n * MCP skeleton, because `ControlType` has no array control to expose `path`\n * through — the same way `terminal-simulator` handles `lines`.\n */\nconst DEMO_PATH: CursorWaypoint[] = [\n  { at: 0, x: -0.06, y: 0.86, duration: 6 },\n  { at: 8, x: 0.34, y: 0.44, duration: 22, click: true },\n  { at: 52, x: 0.68, y: 0.62, duration: 20, click: true },\n  { at: 96, x: 0.82, y: 0.28, duration: 18 },\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\ninterface CursorPose {\n  /** Position, normalized to the frame, origin top-left. */\n  x: number;\n  y: number;\n  /** Click-ring progress, 0 -> 1, or 0 when no ring is up. */\n  click: number;\n  /** 0 before the cursor has appeared, 1 once it has. */\n  opacity: number;\n}\n\nconst CLAMPCursorTrack = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\n/**\n * Waypoints in the order they actually play. Same-`at` ties: the later array\n * entry wins and the earlier tied entries never display, so they can never act\n * as a leg's origin — the rule `useStateTransition` already uses for `Step`.\n */\nfunction ordered(path: CursorWaypoint[]): CursorWaypoint[] {\n  return path\n    .map((w, index) => ({ w, index }))\n    .sort((a, b) => a.w.at - b.w.at || a.index - b.index)\n    .filter((e, i, arr) => i === arr.length - 1 || arr[i + 1].w.at !== e.w.at)\n    .map((e) => e.w);\n}\n\n/**\n * The cursor's pose at `frame`, folding the path forward so a waypoint that\n * starts mid-travel takes over from where the cursor actually is. Pure: same\n * frame, same answer, whatever order Remotion renders in.\n *\n * ponytail: straight-line travel. If it reads robotic, add a per-leg arc here,\n * not a prop.\n */\nfunction cursorPoseAt(\n  frame: number,\n  path: CursorWaypoint[] = [],\n  clickFrames: number = CLICK_FRAMES,\n): CursorPose {\n  const moves = ordered(path);\n  if (moves.length === 0) return { x: 0.5, y: 0.5, click: 0, opacity: 0 };\n\n  // The cursor fades up over the first waypoint's own `duration`, so a track\n  // tunes its arrival without another prop. `showBefore` overrides this.\n  const first = moves[0];\n  const firstDur = first.duration ?? TRAVEL_FRAMES;\n  const opacity =\n    firstDur > 0\n      ? interpolate(frame, [first.at, first.at + firstDur], [0, 1], {\n          ...CLAMPCursorTrack,\n          easing: RING_EASE,\n        })\n      : frame >= first.at\n        ? 1\n        : 0;\n\n  // The first waypoint places the cursor — there is nothing to travel from.\n  let x = first.x;\n  let y = first.y;\n  for (let i = 1; i < moves.length; i++) {\n    const m = moves[i];\n    if (frame < m.at) break;\n    const dur = m.duration ?? TRAVEL_FRAMES;\n    // Truncated, never blended: a leg that overruns the next move's `at` stops\n    // contributing there, so the next leg starts from the pose actually on\n    // screen and the cursor never averages two destinations.\n    const until =\n      i + 1 < moves.length ? Math.min(frame, moves[i + 1].at) : frame;\n    const p =\n      dur > 0\n        ? interpolate(until, [m.at, m.at + dur], [0, 1], {\n            ...CLAMPCursorTrack,\n            easing: CURSOR_EASE,\n          })\n        : 1;\n    x += (m.x - x) * p;\n    y += (m.y - y) * p;\n  }\n\n  // The latest ring still alive wins, so two clicks close together do not stack\n  // two circles on one point. Progress is measured from the frame AFTER the\n  // click so `click === 0` reads as \"no ring up\" and the caller needs no second\n  // flag; one frame of a 14-frame ring is not something you can see.\n  let click = 0;\n  if (clickFrames > 0) {\n    for (const m of moves) {\n      if (!m.click) continue;\n      const at = m.at + (m.duration ?? TRAVEL_FRAMES);\n      if (frame >= at && frame < at + clickFrames) {\n        click = (frame - at + 1) / clickFrames;\n      }\n    }\n  }\n\n  return { x, y, click, opacity };\n}\n\n// --- Component -------------------------------------------------------------\n\nfunction CursorTrack({\n  children,\n  path = DEMO_PATH,\n  variant = \"arrow\",\n  size,\n  color,\n  outlineColor,\n  ringColor,\n  clickFrames = CLICK_FRAMES,\n  showBefore = false,\n  theme,\n  mode,\n  speed = 1,\n  className,\n}: CursorTrackProps) {\n  const frame = useCurrentFrame() * speed;\n  const t = useKitTheme(theme, mode);\n  const { width, height } = useVideoConfig();\n  const isRendering = getRemotionEnvironment().isRendering;\n  const shadowId = `cursor-shadow-${useId().replace(/:/g, \"\")}`;\n\n  const h = size ?? height * CURSOR_HEIGHT_RATIO;\n  const ink = color ?? t.foreground;\n  const outline = outlineColor ?? t.background;\n  const ring = ringColor ?? t.primary;\n\n  const pose = cursorPoseAt(frame, path, clickFrames);\n  const opacity = showBefore ? 1 : pose.opacity;\n  const hidden = path.length === 0 || opacity <= 0;\n\n  // Ring: eased radius, linear opacity. It is a circle, not type, so scaling it\n  // has none of the glyph-snapping failure modes the motion-quality skill warns\n  // about — and it rides the cursor, so a ring never detaches from the pointer.\n  const ringRadius = interpolate(\n    pose.click,\n    [0, 1],\n    [h * RING_START, h * RING_END],\n    {\n      ...CLAMPCursorTrack,\n      easing: RING_EASE,\n    },\n  );\n  const ringOpacity = 1 - pose.click;\n  const ringStroke = Math.max(1.5, h * 0.07);\n\n  return (\n    <AbsoluteFill showInTimeline={false} className={className}>\n      {children}\n      {!hidden && (\n        <AbsoluteFill showInTimeline={false} style={{ pointerEvents: \"none\" }}>\n          {/* The one element that transforms every frame, so the one place\n              will-change belongs — and only outside a render, where a stale\n              raster is inherited across parallel tabs (motion-quality skill). */}\n          <div\n            style={{\n              position: \"absolute\",\n              left: 0,\n              top: 0,\n              opacity,\n              transform: `translate(${pose.x * width}px, ${pose.y * height}px)`,\n              ...(isRendering ? {} : { willChange: \"transform\" as const }),\n            }}\n          >\n            {pose.click > 0 && (\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: -ringRadius,\n                  top: -ringRadius,\n                  width: ringRadius * 2,\n                  height: ringRadius * 2,\n                  borderRadius: \"50%\",\n                  border: `${ringStroke}px solid ${ring}`,\n                  backgroundColor: withAlpha(ring, 0.12),\n                  opacity: ringOpacity,\n                }}\n              />\n            )}\n            {variant === \"dot\" ? (\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: (-h * DOT_RATIO) / 2,\n                  top: (-h * DOT_RATIO) / 2,\n                  width: h * DOT_RATIO,\n                  height: h * DOT_RATIO,\n                  borderRadius: \"50%\",\n                  backgroundColor: withAlpha(ink, 0.42),\n                  border: `${Math.max(1.5, h * 0.05)}px solid ${outline}`,\n                }}\n              />\n            ) : (\n              <svg\n                viewBox={`0 0 ${ARROW_VIEW} ${ARROW_VIEW}`}\n                width={(h * ARROW_VIEW) / ARROW_INK}\n                height={(h * ARROW_VIEW) / ARROW_INK}\n                style={{\n                  // The hotspot is the tip, not the box's corner.\n                  position: \"absolute\",\n                  left: (-h * ARROW_TIP) / ARROW_INK,\n                  top: (-h * ARROW_TIP) / ARROW_INK,\n                  display: \"block\",\n                  overflow: \"visible\",\n                }}\n              >\n                <title>Pointer</title>\n                <defs>\n                  <filter\n                    id={shadowId}\n                    x=\"-30%\"\n                    y=\"-30%\"\n                    width=\"160%\"\n                    height=\"160%\"\n                  >\n                    <feDropShadow\n                      dx={0}\n                      dy={1}\n                      stdDeviation={0.8}\n                      floodOpacity={0.35}\n                    />\n                  </filter>\n                </defs>\n                {/* Rim first, then the ink over it: the site cursor, stroke\n                    for stroke. The rim is what carries it over footage. */}\n                <g filter={`url(#${shadowId})`}>\n                  <path\n                    d={ARROW_PATH}\n                    fill={outline}\n                    stroke={outline}\n                    strokeWidth={5}\n                    strokeLinejoin=\"round\"\n                  />\n                  <path\n                    d={ARROW_PATH}\n                    fill={ink}\n                    stroke={ink}\n                    strokeWidth={2}\n                    strokeLinejoin=\"round\"\n                  />\n                </g>\n              </svg>\n            )}\n          </div>\n        </AbsoluteFill>\n      )}\n    </AbsoluteFill>\n  );\n}\n\ninterface InputStyleContext {\n  idleBorder: string;\n  hoverBorder: string;\n  activeBorder: string;\n  invalidBorder: string;\n  ring: string;\n  invalidRing: string;\n  background: string;\n  hoverBackground: string;\n  foreground: string;\n  mutedForeground: string;\n}\n\nfunction inputStyleContext(theme: KitTheme): InputStyleContext {\n  return {\n    idleBorder: theme.input,\n    hoverBorder: mixOklch(theme.input, theme.foreground, 0.18),\n    activeBorder: theme.ring,\n    invalidBorder: theme.destructive,\n    ring: mixOklch(theme.background, theme.ring, 0.5),\n    invalidRing: mixOklch(theme.background, theme.destructive, 0.4),\n    background: theme.background,\n    hoverBackground: mixOklch(theme.background, theme.muted, 0.4),\n    foreground: theme.foreground,\n    mutedForeground: theme.mutedForeground,\n  };\n}\n\nconst { fontFamily: SANS } = loadSans(\"normal\", {\n  weights: [\"400\", \"500\"],\n  subsets: [\"latin\"],\n});\n\n/**\n * Click to type: a prompt composer whose placeholder writes itself while a\n * cursor flies in and clicks the field — then a hard cut into the field, where\n * the real prompt types at the caret and the send button arms.\n *\n * The composer is Prompt Send's: a glass panel over a soft accent wash, a\n * writing surface inside it, a round ink send button. Same paint, so the two\n * cut together.\n *\n * Two shots of one composer. The close-up is the same scene under a constant\n * camera scale, anchored on the text's first letter, so nothing scales while\n * it moves and the type has no pixel grid to climb.\n */\nexport interface ClickTypeProps {\n  /** Muted text that writes itself in the wide shot. */\n  placeholder?: string;\n  /** What gets typed after the click, in the close-up. */\n  prompt?: string;\n  /** Small label at the field's bottom-left. */\n  hint?: string;\n  /** The wash behind the composer. Defaults to the theme's primary. */\n  accentColor?: string;\n  theme?: Partial<KitTheme>;\n  mode?: \"light\" | \"dark\";\n  /** Time multiplier. */\n  speed?: number;\n  className?: string;\n}\n\n/** Cursor lands and clicks. */\nconst CLICK_AT = 30;\n/** The cut into the field. */\nconst CUT_AT = 34;\nconst TYPE_AT = CUT_AT + 4;\n\n/** At 720p. */\nconst PANEL_W = 920;\nconst PANEL_H = 260;\n/** The glass rim between panel and writing surface. */\nconst PAD = 7;\nconst RADIUS = 32;\nconst PAD_X = 34;\nconst PAD_Y = 34;\nconst TEXT = 30;\nconst SEND = 46;\nconst ZOOM = 1.9;\n/** Where the first letter lands in the close-up, as a fraction of the frame. */\nconst FOCUS = { x: 0.2, y: 0.4 };\n\nconst EASE = Easing.bezier(0.2, 0.6, 0.35, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\n/** Frame each character of `prompt` lands on, relative to TYPE_AT. A space costs a beat. */\nfunction keystrokes(prompt: string) {\n  const at: number[] = [];\n  let f = 0;\n  for (const ch of prompt) {\n    at.push(f);\n    f += ch === \" \" ? 2 : 1;\n  }\n  return { at, total: f };\n}\n\nconst PLUS = \"M12 7v10M7 12h10\";\nconst MIC =\n  \"M12 4.5a2.5 2.5 0 0 0-2.5 2.5v4.5a2.5 2.5 0 0 0 5 0V7A2.5 2.5 0 0 0 12 4.5zM7 11a5 5 0 0 0 10 0M12 16v3\";\nconst SPARK = \"M12 4v4M12 16v4M4 12h4M16 12h4M6.5 6.5l2.5 2.5M15 15l2.5 2.5\";\nconst ARROW = \"M12 19V5M5.5 11.5 12 5l6.5 6.5\";\n\nfunction ClickTypeScene({\n  placeholder = \"Describe what you want to build...\",\n  prompt = \"Build me a marketing site\",\n  hint = \"New suggestion\",\n  accentColor,\n  theme,\n  mode,\n  speed = 1,\n  className,\n}: ClickTypeProps) {\n  const frame = useCurrentFrame() * speed;\n  const { width, height } = useVideoConfig();\n  const t = useKitTheme(theme, mode);\n  const ui = inputStyleContext(t);\n  const s = height / 720;\n  const accent = accentColor ?? t.primary;\n\n  // Prompt Send's paint, token for token.\n  const glassy = withAlpha(t.card, 0.52);\n  const surface = withAlpha(t.card, 0.94);\n  const hairline = mixOklch(ui.idleBorder, t.background, 0.1);\n  const sendIdle = mixOklch(t.foreground, t.card, 0.55);\n\n  const close = frame >= CUT_AT;\n  const panelX = (width - PANEL_W * s) / 2;\n  const panelY = (height - PANEL_H * s) / 2;\n  const fieldX = panelX + PAD * s;\n  const fieldY = panelY + PAD * s;\n  const fieldW = (PANEL_W - PAD * 2) * s;\n  const fieldH = (PANEL_H - PAD * 2) * s;\n  const textX = fieldX + PAD_X * s;\n  const textY = fieldY + PAD_Y * s;\n\n  // Placeholder writes itself at ~1.5 chars a frame from frame 4.\n  const shown = Math.max(0, Math.floor((frame - 4) * 1.5));\n  const typed = keystrokes(prompt).at.filter(\n    (a) => frame >= TYPE_AT + a,\n  ).length;\n  const armed = close && typed > 0;\n  const enter = interpolate(frame, [0, 12], [0, 1], { ...CLAMP, easing: EASE });\n\n  const path = [\n    { at: 6, x: -0.04, y: 0.62, duration: 4 },\n    {\n      at: 10,\n      x: (textX + 8 * s) / width,\n      y: (textY + TEXT * 0.9 * s) / height,\n      duration: CLICK_AT - 10,\n      click: true,\n    },\n  ];\n\n  // The close-up: one constant camera, the first letter pinned to FOCUS.\n  const camera = close\n    ? `translate(${FOCUS.x * width - textX * ZOOM}px, ${FOCUS.y * height - textY * ZOOM}px) scale(${ZOOM})`\n    : \"none\";\n\n  const glyph = (d: string, color: string, size: number, stroke = 1.8) => (\n    <svg\n      viewBox=\"0 0 24 24\"\n      width={size}\n      height={size}\n      style={{ display: \"block\" }}\n    >\n      <title>Icon</title>\n      <path\n        d={d}\n        fill=\"none\"\n        stroke={color}\n        strokeWidth={stroke}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n  const iconButton = (d: string) => (\n    <div\n      style={{\n        width: SEND * s,\n        height: SEND * s,\n        boxSizing: \"border-box\",\n        borderRadius: 999,\n        border: `1px solid ${hairline}`,\n        background: t.card,\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n      }}\n    >\n      {glyph(d, ui.mutedForeground, 22 * s)}\n    </div>\n  );\n\n  const scene = (\n    <AbsoluteFill\n      showInTimeline={false}\n      className={className}\n      style={{\n        background: t.background,\n        fontFamily: SANS,\n        textRendering: \"geometricPrecision\",\n        overflow: \"hidden\",\n      }}\n    >\n      <AbsoluteFill\n        showInTimeline={false}\n        style={{ transformOrigin: \"0 0\", transform: camera }}\n      >\n        {/* Prompt Send's wash: a cool field falling from the top right, a\n            bright patch left of centre, a pale corner under it — alpha over\n            the page, never a hue mix through green. Oversized so the close-up\n            never finds its edge. */}\n        <div\n          style={{\n            position: \"absolute\",\n            left: -0.2 * width,\n            top: -0.2 * height,\n            width: 1.4 * width,\n            height: 1.4 * height,\n            background: t.background,\n            backgroundImage: [\n              `radial-gradient(${0.96 * width}px ${0.8 * height}px at ${0.26 * width}px ${1.18 * height}px, ${withAlpha(t.background, 0.9)} 0%, transparent 62%)`,\n              `radial-gradient(${0.74 * width}px ${0.62 * height}px at ${0.3 * width}px ${0.66 * height}px, ${withAlpha(t.card, 0.42)} 0%, transparent 66%)`,\n              `linear-gradient(215deg, ${withAlpha(accent, 0.5)} 0%, ${withAlpha(accent, 0.28)} 52%, ${withAlpha(accent, 0.14)} 100%)`,\n            ].join(\",\"),\n          }}\n        />\n        <AbsoluteFill\n          showInTimeline={false}\n          style={{\n            opacity: close ? 1 : enter,\n            transform: close\n              ? undefined\n              : `translateY(${(1 - enter) * 14 * s}px)`,\n          }}\n        >\n          {/* The glass panel. Hairline as an inset shadow, not a border. */}\n          <div\n            style={{\n              position: \"absolute\",\n              left: panelX,\n              top: panelY,\n              width: PANEL_W * s,\n              height: PANEL_H * s,\n              borderRadius: RADIUS * s,\n              background: glassy,\n              boxShadow: `inset 0 0 0 1px ${withAlpha(t.card, 0.6)}, 0 ${12 * s}px ${32 * s}px ${withAlpha(t.foreground, 0.05)}`,\n            }}\n          />\n          {/* The writing surface. */}\n          <div\n            style={{\n              position: \"absolute\",\n              left: fieldX,\n              top: fieldY,\n              width: fieldW,\n              height: fieldH,\n              borderRadius: (RADIUS - 2) * s,\n              background: surface,\n              boxShadow: `0 ${6 * s}px ${18 * s}px ${withAlpha(t.foreground, 0.05)}`,\n            }}\n          />\n          <div\n            style={{\n              position: \"absolute\",\n              left: textX,\n              top: textY,\n              right: width - (fieldX + fieldW) + PAD_X * s,\n              fontSize: TEXT * s,\n              lineHeight: 1.2,\n              fontWeight: 400,\n              letterSpacing: \"-0.01em\",\n              whiteSpace: \"nowrap\",\n              display: \"flex\",\n              alignItems: \"center\",\n            }}\n          >\n            {close ? (\n              <>\n                <span style={{ color: t.foreground }}>\n                  {prompt.slice(0, typed)}\n                </span>\n                <Caret\n                  color={t.foreground}\n                  width={Math.max(1.5, 2.4 * s)}\n                  height={TEXT * 1.15 * s}\n                  // Solid while it types, blinking once it waits.\n                  blink={typed === 0 || typed === prompt.length}\n                  blinkPerSecond={1.6}\n                  marginLeft={2 * s}\n                />\n              </>\n            ) : (\n              <span style={{ color: ui.mutedForeground }}>\n                {placeholder.slice(0, shown)}\n              </span>\n            )}\n          </div>\n          <div\n            style={{\n              position: \"absolute\",\n              left: textX,\n              right: width - (fieldX + fieldW) + 18 * s,\n              top: fieldY + fieldH - (SEND + 18) * s,\n              height: SEND * s,\n              display: \"flex\",\n              alignItems: \"center\",\n              gap: 10 * s,\n              fontSize: 19 * s,\n              fontWeight: 500,\n              color: ui.mutedForeground,\n            }}\n          >\n            {glyph(SPARK, ui.mutedForeground, 18 * s, 2)}\n            <span style={{ flex: 1 }}>{hint}</span>\n            {iconButton(PLUS)}\n            {iconButton(MIC)}\n            <div\n              style={{\n                width: SEND * s,\n                height: SEND * s,\n                borderRadius: 999,\n                background: armed ? t.foreground : sendIdle,\n                display: \"flex\",\n                alignItems: \"center\",\n                justifyContent: \"center\",\n              }}\n            >\n              {glyph(ARROW, t.card, SEND * 0.52 * s, 2.2)}\n            </div>\n          </div>\n        </AbsoluteFill>\n      </AbsoluteFill>\n    </AbsoluteFill>\n  );\n\n  // The cursor belongs to the wide shot; the cut leaves it behind.\n  return close ? (\n    scene\n  ) : (\n    <CursorTrack path={path} theme={theme} mode={mode} speed={speed}>\n      {scene}\n    </CursorTrack>\n  );\n}\n\n/* ─────────────────────────────────────────────────────────────────────────\n   Remotion Studio\n   ───────────────────────────────────────────────────────────────────────── */\n\ntype ClickTypeElementProps = Omit<\n  ComponentProps<typeof ClickTypeScene>,\n  | \"from\"\n  | \"durationInFrames\"\n  | \"trimBefore\"\n  | \"playbackRate\"\n  | \"loop\"\n  | \"freeze\"\n  | \"hidden\"\n  | \"name\"\n  | \"showInTimeline\"\n  | \"cropLeft\"\n  | \"cropRight\"\n  | \"cropTop\"\n  | \"cropBottom\"\n  | \"premountFor\"\n  | \"postmountFor\"\n  | \"styleWhilePremounted\"\n  | \"styleWhilePostmounted\"\n  | \"controls\"\n> & {\n  readonly style?: CSSProperties;\n};\n\n/** What a prop falls back to when Studio does not pass it, reset included. */\nconst ClickTypeDefaults = {\n  placeholder: \"Describe what you want to build...\",\n  prompt: \"Build me a marketing site\",\n  hint: \"New suggestion\",\n  accentColor: \"#3577e0\",\n  mode: \"light\",\n  speed: 1,\n} satisfies Partial<ClickTypeElementProps>;\n\n/** The Inspector's controls. Timing, transform, crop and premount come with `wrapInSequence`. */\nconst ClickTypeSchema = {\n  placeholder: {\n    type: \"text-content\",\n    default: \"Describe what you want to build...\",\n    description: \"Placeholder\",\n  },\n  prompt: {\n    type: \"text-content\",\n    default: \"Build me a marketing site\",\n    description: \"Prompt\",\n  },\n  hint: {\n    type: \"text-content\",\n    default: \"New suggestion\",\n    description: \"Hint\",\n  },\n  accentColor: {\n    type: \"color\",\n    default: \"#3577e0\",\n    description: \"Wash\",\n    keyframable: false,\n  },\n  mode: {\n    type: \"enum\",\n    default: \"light\",\n    description: \"Theme\",\n    variants: { light: {}, dark: {} },\n  },\n  speed: {\n    type: \"number\",\n    default: 1,\n    min: 0.25,\n    max: 4,\n    step: 0.25,\n    description: \"Speed\",\n    hiddenFromList: false,\n    keyframable: false,\n  },\n} as const satisfies InteractivitySchema;\n\n/**\n * In over the first frames, out over the last. Opacity only: nothing moves, so\n * no glyph can snap to the pixel grid on the way out.\n */\nfunction ClickTypeFade({ children }: { children: ReactNode }) {\n  const frame = useCurrentFrame();\n  const enter = Math.min(1, (frame + 1) / 6);\n  const { durationInFrames } = useVideoConfig();\n  const left = Math.min(1, Math.max(0, (durationInFrames - 1 - frame) / 12));\n  const leave = left * left;\n  return (\n    <AbsoluteFill showInTimeline={false} style={{ opacity: enter * leave }}>\n      {children}\n    </AbsoluteFill>\n  );\n}\n\nconst ClickTypeInner = forwardRef<HTMLDivElement, ClickTypeElementProps>(\n  ({ style, ...props }, ref) => {\n    // The layer's length, from the Sequence `wrapInSequence` puts around this.\n    const { durationInFrames } = useVideoConfig();\n    const rest = { ...ClickTypeDefaults, ...props };\n    // The scene measures its copy once, on mount. An Inspector edit changes the\n    // props without remounting it, so the key does.\n    const key = JSON.stringify(props, (k, v) =>\n      k === \"children\" ? undefined : v,\n    );\n\n    // width/height are what useVideoConfig() reports inside this Sequence, so\n    // the scene lays itself out in its stage rather than the whole composition.\n    // It is not a layer of its own: the one Studio shows is the wrapper's.\n    return (\n      <Sequence\n        layout=\"none\"\n        showInTimeline={false}\n        durationInFrames={durationInFrames}\n        width={1280}\n        height={720}\n      >\n        <div\n          ref={ref}\n          style={{\n            position: \"relative\",\n            width: 1280,\n            height: 720,\n            overflow: \"hidden\",\n            color: \"black\",\n            fontFamily: \"initial\",\n            fontSize: 16,\n            fontStyle: \"normal\",\n            fontVariant: \"normal\",\n            fontWeight: 400,\n            fontStretch: \"normal\",\n            fontKerning: \"auto\",\n            fontFeatureSettings: \"normal\",\n            fontVariationSettings: \"normal\",\n            lineHeight: \"normal\",\n            letterSpacing: \"normal\",\n            wordSpacing: \"normal\",\n            textAlign: \"start\",\n            textIndent: 0,\n            textTransform: \"none\",\n            textShadow: \"none\",\n            textRendering: \"auto\",\n            whiteSpace: \"normal\",\n            wordBreak: \"normal\",\n            overflowWrap: \"normal\",\n            hyphens: \"manual\",\n            direction: \"ltr\",\n            visibility: \"visible\",\n            ...style,\n          }}\n        >\n          <ClickTypeFade>\n            <ClickTypeScene key={key} {...rest} />\n          </ClickTypeFade>\n        </div>\n      </Sequence>\n    );\n  },\n);\n\nexport const ClickType = Interactive.withSchema({\n  Component: ClickTypeInner,\n  componentName: \"<ClickType>\",\n  schema: ClickTypeSchema,\n  wrapInSequence: true,\n});\n",
    "durationInFrames": 123,
    "installationMode": "component-owned-sequence"
  },
  "durationInFrames": 123
}
