{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "prompt-box-modes",
  "type": "registry:component",
  "title": "Prompt Box Modes",
  "description": "A composer with file attachments, Search, Think and Create mode chips that retint the box, and a send button that morphs into a Stop pill while a response is running. Enter sends, Escape stops.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "agent-kit",
    "prompt",
    "composer",
    "attachments",
    "modes",
    "chat",
    "send"
  ],
  "docs": "https://hyperblur.dev/effects/prompt-box-modes",
  "files": [
    {
      "path": "registry/hyperblur/prompt-box-modes.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/prompt-box-modes.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type PromptAttachmentKind = \"pdf\" | \"image\" | \"sheet\" | \"code\" | \"doc\";\n\nexport interface PromptAttachment {\n  id: string;\n  name: string;\n  size: string;\n  kind: PromptAttachmentKind;\n}\n\nexport interface PromptMode {\n  id: string;\n  label: string;\n  placeholder: string;\n  working: string;\n  color: string;\n  icon?: \"search\" | \"think\" | \"create\";\n}\n\nexport interface PromptBoxSubmit {\n  text: string;\n  mode: string;\n  attachments: PromptAttachment[];\n}\n\nexport interface PromptBoxModesProps extends Omit<React.HTMLAttributes<HTMLFormElement>, \"onSubmit\"> {\n  modes?: PromptMode[];\n  mode?: string;\n  defaultMode?: string;\n  onModeChange?: (mode: string) => void;\n  defaultValue?: string;\n  defaultAttachments?: PromptAttachment[];\n  onSubmit?: (payload: PromptBoxSubmit) => void;\n  onStop?: () => void;\n  workingTime?: number;\n  maxRows?: number;\n}\n\nconst defaultModes: PromptMode[] = [\n  { id: \"search\", label: \"Search\", placeholder: \"Search the web and your files...\", working: \"Reading 14 sources\", color: \"#4c8dff\", icon: \"search\" },\n  { id: \"think\", label: \"Think\", placeholder: \"Ask something that needs a careful answer...\", working: \"Thinking it through\", color: \"#a37bff\", icon: \"think\" },\n  { id: \"create\", label: \"Create\", placeholder: \"Describe what you want to make...\", working: \"Drafting your first version\", color: \"#ffad42\", icon: \"create\" },\n];\n\nconst defaultAttachments: PromptAttachment[] = [\n  { id: \"a1\", name: \"Q3-board-deck.pdf\", size: \"2.4 MB\", kind: \"pdf\" },\n  { id: \"a2\", name: \"churn-cohorts.csv\", size: \"184 KB\", kind: \"sheet\" },\n];\n\nconst kindColor: Record<PromptAttachmentKind, string> = {\n  pdf: \"#ff5d5d\",\n  image: \"#ff8ad8\",\n  sheet: \"#3ccf7a\",\n  code: \"#7fb3ff\",\n  doc: \"#ffc24a\",\n};\n\nfunction kindOf(name: string): PromptAttachmentKind {\n  const ext = name.split(\".\").pop()?.toLowerCase() ?? \"\";\n  if (ext === \"pdf\") return \"pdf\";\n  if ([\"png\", \"jpg\", \"jpeg\", \"gif\", \"webp\", \"svg\", \"avif\"].includes(ext)) return \"image\";\n  if ([\"csv\", \"xls\", \"xlsx\", \"numbers\", \"tsv\"].includes(ext)) return \"sheet\";\n  if ([\"ts\", \"tsx\", \"js\", \"jsx\", \"py\", \"json\", \"go\", \"rs\", \"rb\", \"css\", \"html\", \"md\"].includes(ext)) return \"code\";\n  return \"doc\";\n}\n\nfunction formatSize(bytes: number) {\n  if (bytes < 1024) return `${bytes} B`;\n  if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;\n  return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\nfunction ModeIcon({ name }: { name?: PromptMode[\"icon\"] }) {\n  if (name === \"think\")\n    return (\n      <svg width=\"13\" height=\"13\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n        <path d=\"M8 1.8l1.5 3.4 3.7.4-2.8 2.5.8 3.6L8 9.9l-3.2 1.8.8-3.6L2.8 5.6l3.7-.4L8 1.8z\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" />\n      </svg>\n    );\n  if (name === \"create\")\n    return (\n      <svg width=\"13\" height=\"13\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n        <path d=\"M10.6 2.6l2.8 2.8L6 12.8l-3.4.6.6-3.4 7.4-7.4z\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" />\n        <path d=\"M9.2 4l2.8 2.8\" stroke=\"currentColor\" strokeWidth=\"1.4\" />\n      </svg>\n    );\n  return (\n    <svg width=\"13\" height=\"13\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n      <circle cx=\"7\" cy=\"7\" r=\"4.6\" stroke=\"currentColor\" strokeWidth=\"1.4\" />\n      <path d=\"M10.5 10.5l3 3\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" />\n    </svg>\n  );\n}\n\nconst css = `\n.hb-vl7 {\n  --hb-vl7-m: #4c8dff;\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  width: 100%;\n  padding: 10px;\n  border-radius: 20px;\n  background: linear-gradient(180deg, #19191c 0%, #121214 100%);\n  box-shadow:\n    inset 0 1px 0 rgba(255, 255, 255, 0.06),\n    0 0 0 1px rgba(255, 255, 255, 0.08),\n    0 24px 48px -28px rgba(0, 0, 0, 0.9);\n  color: #ededed;\n  font-family: inherit;\n  box-sizing: border-box;\n  transition: box-shadow 0.4s ease;\n}\n.hb-vl7 *, .hb-vl7 *::before, .hb-vl7 *::after { box-sizing: border-box; }\n.hb-vl7:focus-within {\n  box-shadow:\n    inset 0 1px 0 rgba(255, 255, 255, 0.06),\n    0 0 0 1px color-mix(in srgb, var(--hb-vl7-m) 55%, transparent),\n    0 0 0 4px color-mix(in srgb, var(--hb-vl7-m) 14%, transparent),\n    0 24px 48px -28px rgba(0, 0, 0, 0.9);\n}\n.hb-vl7-glow {\n  position: absolute;\n  inset: -1px;\n  border-radius: inherit;\n  pointer-events: none;\n  background: radial-gradient(60% 80% at 10% 0%, color-mix(in srgb, var(--hb-vl7-m) 16%, transparent), transparent 70%);\n  transition: background 0.5s ease;\n}\n.hb-vl7-files { display: flex; gap: 6px; margin: 0 0 6px; padding: 0; overflow-x: auto; scrollbar-width: none; list-style: none; }\n.hb-vl7-files::-webkit-scrollbar { display: none; }\n.hb-vl7-file {\n  position: relative;\n  display: flex;\n  flex: none;\n  align-items: center;\n  gap: 8px;\n  max-width: 190px;\n  padding: 5px 26px 5px 5px;\n  border-radius: 11px;\n  background: #1f1f23;\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);\n  animation: hb-vl7-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;\n}\n@keyframes hb-vl7-pop { from { opacity: 0; transform: scale(0.85) translateY(4px); } }\n.hb-vl7-badge {\n  display: grid;\n  flex: none;\n  place-items: center;\n  width: 26px;\n  height: 26px;\n  border-radius: 7px;\n  background: color-mix(in srgb, var(--hb-vl7-k) 18%, #141416);\n  color: var(--hb-vl7-k);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 8px;\n  font-weight: 700;\n  letter-spacing: 0.04em;\n  text-transform: uppercase;\n}\n.hb-vl7-badge[data-kind=\"image\"] { background: linear-gradient(135deg, #ff8ad8, #7f6bff 55%, #2f7bff); color: transparent; }\n.hb-vl7-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }\n.hb-vl7-name { overflow: hidden; font-size: 11.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }\n.hb-vl7-size { font-size: 10px; color: #8f8f8f; }\n.hb-vl7-x {\n  position: absolute;\n  top: 50%;\n  right: 5px;\n  display: grid;\n  place-items: center;\n  width: 17px;\n  height: 17px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  border-radius: 50%;\n  background: transparent;\n  color: #8f8f8f;\n  cursor: pointer;\n  transform: translateY(-50%);\n  transition: background 0.2s ease, color 0.2s ease;\n}\n.hb-vl7-x:hover { background: rgba(255, 255, 255, 0.1); color: #ededed; }\n.hb-vl7-x:focus-visible { outline: 2px solid var(--hb-vl7-m); }\n.hb-vl7-status {\n  display: flex;\n  align-items: center;\n  gap: 7px;\n  height: 0;\n  overflow: hidden;\n  padding: 0 4px;\n  font-size: 11.5px;\n  color: #a1a1a1;\n  opacity: 0;\n  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;\n}\n.hb-vl7[data-state=\"working\"] .hb-vl7-status { height: 22px; opacity: 1; }\n.hb-vl7-shimmer {\n  background: linear-gradient(90deg, #8f8f8f 0%, #ededed 45%, #8f8f8f 70%) 0 0 / 200% 100%;\n  -webkit-background-clip: text;\n  background-clip: text;\n  color: transparent;\n  animation: hb-vl7-sweep 1.6s linear infinite;\n}\n@keyframes hb-vl7-sweep { to { background-position: -200% 0; } }\n.hb-vl7-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--hb-vl7-m); animation: hb-vl7-beat 1.1s ease-in-out infinite; }\n@keyframes hb-vl7-beat { 50% { transform: scale(0.55); opacity: 0.5; } }\n.hb-vl7-field { position: relative; }\n.hb-vl7-ta {\n  display: block;\n  width: 100%;\n  min-height: 42px;\n  margin: 0;\n  padding: 8px 6px 6px;\n  border: 0;\n  outline: none;\n  resize: none;\n  background: transparent;\n  color: #ededed;\n  font: inherit;\n  font-size: 14px;\n  line-height: 1.5;\n}\n.hb-vl7-ph {\n  position: absolute;\n  left: 6px;\n  right: 6px;\n  top: 8px;\n  overflow: hidden;\n  font-size: 14px;\n  line-height: 1.5;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  color: #6f6f75;\n  pointer-events: none;\n  animation: hb-vl7-ph 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;\n}\n@keyframes hb-vl7-ph { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }\n.hb-vl7-bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }\n.hb-vl7-icon {\n  display: grid;\n  flex: none;\n  place-items: center;\n  width: 30px;\n  height: 30px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  border-radius: 10px;\n  background: transparent;\n  color: #a1a1a1;\n  cursor: pointer;\n  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;\n}\n.hb-vl7-icon:hover { background: rgba(255, 255, 255, 0.07); color: #ededed; }\n.hb-vl7-icon:active { transform: scale(0.92); }\n.hb-vl7-icon:focus-visible { outline: 2px solid var(--hb-vl7-m); outline-offset: 1px; }\n.hb-vl7-modes {\n  position: relative;\n  display: flex;\n  min-width: 0;\n  padding: 2px;\n  border-radius: 999px;\n  background: #0d0d0f;\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);\n}\n.hb-vl7-ind {\n  position: absolute;\n  top: 2px;\n  bottom: 2px;\n  left: 0;\n  width: 0;\n  border-radius: 999px;\n  background: color-mix(in srgb, var(--hb-vl7-m) 18%, #1d1d21);\n  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hb-vl7-m) 45%, transparent);\n  transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.64, 1), width 0.5s cubic-bezier(0.34, 1.3, 0.64, 1), background 0.4s ease;\n}\n.hb-vl7-chip {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 5px;\n  padding: 5px 10px;\n  border: 0;\n  border-radius: 999px;\n  background: transparent;\n  color: #8f8f8f;\n  font: inherit;\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  white-space: nowrap;\n  transition: color 0.3s ease;\n}\n.hb-vl7-chip[aria-checked=\"true\"] { color: var(--hb-vl7-c); }\n.hb-vl7-chip:hover { color: #ededed; }\n.hb-vl7-chip[aria-checked=\"true\"]:hover { color: var(--hb-vl7-c); }\n.hb-vl7-chip:focus-visible { outline: 2px solid var(--hb-vl7-m); outline-offset: 1px; }\n.hb-vl7-spacer { flex: 1 1 auto; }\n.hb-vl7-send {\n  position: relative;\n  display: inline-flex;\n  flex: none;\n  align-items: center;\n  justify-content: center;\n  gap: 6px;\n  width: 32px;\n  height: 32px;\n  margin: 0;\n  padding: 0;\n  overflow: hidden;\n  border: 0;\n  border-radius: 999px;\n  background: #ededed;\n  color: #0a0a0a;\n  font: inherit;\n  font-size: 12px;\n  font-weight: 600;\n  cursor: pointer;\n  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 4px 14px -4px rgba(255, 255, 255, 0.3);\n  transition: width 0.45s cubic-bezier(0.34, 1.3, 0.64, 1), background 0.3s ease, color 0.3s ease, transform 0.2s ease, opacity 0.2s ease;\n}\n.hb-vl7-send:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }\n.hb-vl7-send:not(:disabled):active { transform: scale(0.92); }\n.hb-vl7-send:focus-visible { outline: 2px solid var(--hb-vl7-m); outline-offset: 2px; }\n.hb-vl7[data-state=\"working\"] .hb-vl7-send { width: 78px; background: #26262b; color: #ededed; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }\n.hb-vl7[data-state=\"done\"] .hb-vl7-send { background: var(--hb-vl7-m); color: #0a0a0a; }\n.hb-vl7-arrow { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease; }\n.hb-vl7-send:not(:disabled):hover .hb-vl7-arrow { transform: translateY(-2px); }\n.hb-vl7-ring { animation: hb-vl7-spin 0.9s linear infinite; transform-origin: 50% 50%; }\n@keyframes hb-vl7-spin { to { transform: rotate(360deg); } }\n.hb-vl7-check path { stroke-dasharray: 14; stroke-dashoffset: 14; animation: hb-vl7-draw 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; }\n@keyframes hb-vl7-draw { to { stroke-dashoffset: 0; } }\n.hb-vl7-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@container (max-width: 330px) {\n  .hb-vl7-chip { padding: 5px 7px; }\n  .hb-vl7-chip .hb-vl7-lbl { display: none; }\n  .hb-vl7-chip[aria-checked=\"true\"] .hb-vl7-lbl { display: inline; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vl7 *, .hb-vl7 *::before, .hb-vl7 *::after { transition: none !important; animation: none !important; }\n  .hb-vl7-check path { stroke-dashoffset: 0; }\n}\n`;\n\nexport function PromptBoxModes({\n  modes = defaultModes,\n  mode,\n  defaultMode,\n  onModeChange,\n  defaultValue = \"\",\n  defaultAttachments: initialFiles = defaultAttachments,\n  onSubmit,\n  onStop,\n  workingTime = 2600,\n  maxRows = 6,\n  className,\n  style,\n  ...rest\n}: PromptBoxModesProps) {\n  const [innerMode, setInnerMode] = React.useState(defaultMode ?? modes[0]?.id ?? \"\");\n  const current = mode ?? innerMode;\n  const active = modes.find((m) => m.id === current) ?? modes[0];\n  const [text, setText] = React.useState(defaultValue);\n  const [files, setFiles] = React.useState<PromptAttachment[]>(initialFiles);\n  const [state, setState] = React.useState<\"idle\" | \"working\" | \"done\">(\"idle\");\n  const taRef = React.useRef<HTMLTextAreaElement>(null);\n  const fileRef = React.useRef<HTMLInputElement>(null);\n  const modesRef = React.useRef<HTMLDivElement>(null);\n  const indRef = React.useRef<HTMLSpanElement>(null);\n  const timer = React.useRef<number | undefined>(undefined);\n  const counter = React.useRef(0);\n  const uid = React.useId();\n\n  React.useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  React.useLayoutEffect(() => {\n    const wrap = modesRef.current;\n    const ind = indRef.current;\n    if (!wrap || !ind) return;\n    const place = () => {\n      const chip = wrap.querySelector<HTMLElement>('[aria-checked=\"true\"]');\n      if (!chip) return;\n      ind.style.width = `${chip.offsetWidth}px`;\n      ind.style.transform = `translateX(${chip.offsetLeft}px)`;\n    };\n    place();\n    const ro = new ResizeObserver(place);\n    ro.observe(wrap);\n    return () => ro.disconnect();\n  }, [current, modes]);\n\n  React.useLayoutEffect(() => {\n    const ta = taRef.current;\n    if (!ta) return;\n    ta.style.height = \"auto\";\n    const line = parseFloat(getComputedStyle(ta).lineHeight) || 21;\n    ta.style.height = `${Math.min(ta.scrollHeight, line * maxRows + 14)}px`;\n  }, [text, maxRows]);\n\n  const pickMode = (id: string) => {\n    if (mode === undefined) setInnerMode(id);\n    onModeChange?.(id);\n  };\n\n  const onModeKey = (event: React.KeyboardEvent, index: number) => {\n    const n = modes.length;\n    let next = -1;\n    if (event.key === \"ArrowRight\" || event.key === \"ArrowDown\") next = (index + 1) % n;\n    else if (event.key === \"ArrowLeft\" || event.key === \"ArrowUp\") next = (index - 1 + n) % n;\n    if (next < 0) return;\n    event.preventDefault();\n    pickMode(modes[next].id);\n    modesRef.current?.querySelectorAll<HTMLButtonElement>(\"button\")[next]?.focus();\n  };\n\n  const stop = () => {\n    window.clearTimeout(timer.current);\n    setState(\"idle\");\n    onStop?.();\n    taRef.current?.focus();\n  };\n\n  const submit = () => {\n    if (state === \"working\") {\n      stop();\n      return;\n    }\n    const value = text.trim();\n    if (!value && files.length === 0) return;\n    onSubmit?.({ text: value, mode: active?.id ?? \"\", attachments: files });\n    setText(\"\");\n    setFiles([]);\n    setState(\"working\");\n    window.clearTimeout(timer.current);\n    timer.current = window.setTimeout(() => {\n      setState(\"done\");\n      timer.current = window.setTimeout(() => setState(\"idle\"), 900);\n    }, workingTime);\n  };\n\n  const addFiles = (list: FileList | null) => {\n    if (!list || list.length === 0) return;\n    const next = Array.from(list).map((file) => {\n      counter.current += 1;\n      return { id: `f${counter.current}`, name: file.name, size: formatSize(file.size), kind: kindOf(file.name) };\n    });\n    setFiles((prev) => [...prev, ...next]);\n  };\n\n  const canSend = state === \"working\" || text.trim().length > 0 || files.length > 0;\n  const accentStyle = { \"--hb-vl7-m\": active?.color ?? \"#4c8dff\", containerType: \"inline-size\", ...style } as React.CSSProperties;\n\n  return (\n    <form\n      className={[\"hb-vl7\", className].filter(Boolean).join(\" \")}\n      style={accentStyle}\n      data-state={state}\n      onSubmit={(event) => {\n        event.preventDefault();\n        submit();\n      }}\n      {...rest}\n    >\n      <style href=\"hb-prompt-box-modes\" precedence=\"default\">{css}</style>\n      <span className=\"hb-vl7-glow\" aria-hidden=\"true\" />\n      {files.length > 0 && (\n        <ul className=\"hb-vl7-files\" aria-label=\"Attachments\">\n          {files.map((file) => (\n            <li key={file.id} className=\"hb-vl7-file\" style={{ \"--hb-vl7-k\": kindColor[file.kind] } as React.CSSProperties}>\n              <span className=\"hb-vl7-badge\" data-kind={file.kind} aria-hidden=\"true\">\n                {file.kind === \"sheet\" ? \"csv\" : file.kind === \"code\" ? \"</>\" : file.kind}\n              </span>\n              <span className=\"hb-vl7-meta\">\n                <span className=\"hb-vl7-name\">{file.name}</span>\n                <span className=\"hb-vl7-size\">{file.size}</span>\n              </span>\n              <button\n                type=\"button\"\n                className=\"hb-vl7-x\"\n                aria-label={`Remove ${file.name}`}\n                onClick={() => setFiles((prev) => prev.filter((f) => f.id !== file.id))}\n              >\n                <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n                  <path d=\"M1.5 1.5l5 5M6.5 1.5l-5 5\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" />\n                </svg>\n              </button>\n            </li>\n          ))}\n        </ul>\n      )}\n      <div className=\"hb-vl7-status\" role=\"status\" aria-live=\"polite\">\n        {state === \"working\" && (\n          <>\n            <span className=\"hb-vl7-pulse\" />\n            <span className=\"hb-vl7-shimmer\">{active?.working}</span>\n          </>\n        )}\n      </div>\n      <div className=\"hb-vl7-field\">\n        <label htmlFor={`${uid}-ta`} className=\"hb-vl7-hidden\">\n          Message\n        </label>\n        <textarea\n          id={`${uid}-ta`}\n          ref={taRef}\n          className=\"hb-vl7-ta\"\n          rows={1}\n          value={text}\n          onChange={(event) => setText(event.target.value)}\n          onKeyDown={(event) => {\n            if (event.key === \"Enter\" && !event.shiftKey && !event.nativeEvent.isComposing) {\n              event.preventDefault();\n              if (state !== \"working\") submit();\n            } else if (event.key === \"Escape\" && state === \"working\") {\n              event.preventDefault();\n              stop();\n            }\n          }}\n        />\n        {text.length === 0 && (\n          <span key={active?.id} className=\"hb-vl7-ph\" aria-hidden=\"true\">\n            {active?.placeholder}\n          </span>\n        )}\n      </div>\n      <div className=\"hb-vl7-bar\">\n        <input ref={fileRef} type=\"file\" multiple className=\"hb-vl7-hidden\" tabIndex={-1} aria-hidden=\"true\" onChange={(event) => {\n          addFiles(event.target.files);\n          event.target.value = \"\";\n        }} />\n        <button type=\"button\" className=\"hb-vl7-icon\" aria-label=\"Attach files\" onClick={() => fileRef.current?.click()}>\n          <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n            <path d=\"M13.2 7.6l-5 5a3.2 3.2 0 01-4.6-4.5l5.4-5.4a2.1 2.1 0 013 3l-5.3 5.3a1 1 0 01-1.5-1.4l4.8-4.8\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n          </svg>\n        </button>\n        <div ref={modesRef} className=\"hb-vl7-modes\" role=\"radiogroup\" aria-label=\"Mode\">\n          <span ref={indRef} className=\"hb-vl7-ind\" aria-hidden=\"true\" />\n          {modes.map((m, i) => (\n            <button\n              key={m.id}\n              type=\"button\"\n              role=\"radio\"\n              aria-checked={m.id === active?.id}\n              tabIndex={m.id === active?.id ? 0 : -1}\n              className=\"hb-vl7-chip\"\n              style={{ \"--hb-vl7-c\": m.color } as React.CSSProperties}\n              onClick={() => pickMode(m.id)}\n              onKeyDown={(event) => onModeKey(event, i)}\n            >\n              <ModeIcon name={m.icon} />\n              <span className=\"hb-vl7-lbl\">{m.label}</span>\n            </button>\n          ))}\n        </div>\n        <span className=\"hb-vl7-spacer\" />\n        <button\n          type=\"submit\"\n          className=\"hb-vl7-send\"\n          disabled={!canSend}\n          aria-label={state === \"working\" ? \"Stop\" : \"Send\"}\n        >\n          {state === \"working\" ? (\n            <>\n              <svg className=\"hb-vl7-ring\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n                <circle cx=\"7\" cy=\"7\" r=\"5.5\" stroke=\"rgba(255,255,255,0.18)\" strokeWidth=\"1.8\" />\n                <path d=\"M7 1.5a5.5 5.5 0 015.5 5.5\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" />\n              </svg>\n              Stop\n            </>\n          ) : state === \"done\" ? (\n            <svg className=\"hb-vl7-check\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n              <path d=\"M3 7.3l2.6 2.6L11 4.4\" stroke=\"currentColor\" strokeWidth=\"1.9\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n            </svg>\n          ) : (\n            <svg className=\"hb-vl7-arrow\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\">\n              <path d=\"M7 11.5V2.8M3.2 6.4L7 2.6l3.8 3.8\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n            </svg>\n          )}\n        </button>\n      </div>\n    </form>\n  );\n}\n"
    }
  ]
}