{"version":3,"sources":["../../src/components/predictive-textarea.tsx","../../src/components/content-prediction.tsx","../../src/utils/cn.ts","../../src/hooks/use-caret-position.ts","../../src/utils/get-text-up-until-caret-in-element.ts","../../src/utils/is-caret-at-line-end.ts","../../src/hooks/use-content-prediction.ts","../../src/utils/hash.ts"],"sourcesContent":["'use client'\n\nimport React, { useRef, SyntheticEvent, KeyboardEvent, FocusEvent, useState, useEffect, CSSProperties } from 'react'\n\nimport { ContentPrediction } from '@/components/content-prediction'\nimport { useCaretPosition } from '@/hooks/use-caret-position'\nimport { useContentPrediction } from '@/hooks/use-content-prediction'\nimport { PredictiveTextareaProps } from '@/types'\nimport { cn } from '@/utils/cn'\n\n\nconst DEFAULT_LINE_HEIGHT_PX = 30\n\n// Screen reader only styles\nconst srOnlyStyles: CSSProperties = {\n  position: 'absolute',\n  width: '1px',\n  height: '1px',\n  padding: 0,\n  margin: '-1px',\n  overflow: 'hidden',\n  clip: 'rect(0, 0, 0, 0)',\n  whiteSpace: 'nowrap',\n  borderWidth: 0\n}\n\n/**\n * A rich text input with AI-powered autocomplete content predictions.\n *\n * Uses contentEditable instead of a traditional textarea to enable\n * content prediction display inline with text.\n */\nfunction PredictiveTextarea({\n  getContentPredictionFn,\n  debounceTime,\n  disabled,\n  disableAutocomplete = false,\n  placeholder = '',\n  value: controlledValue = '',\n  rows = 1,\n  className,\n  predictionClassName,\n  ...props\n}: PredictiveTextareaProps): React.ReactElement {\n  const textareaRef = useRef<HTMLDivElement>(null)\n  const [hasFocus, setHasFocus] = useState(false)\n  const [internalValue, setInternalValue] = useState(controlledValue)\n\n  const { getTextAtCaret, isAtLineEnd, insertTextAtCaret } = useCaretPosition({ textareaRef })\n\n  const { prediction, setInputText, clearPrediction } = useContentPrediction(getContentPredictionFn, { debounceTime })\n\n  // Update internal value and textarea content when controlled value changes\n  useEffect(() => {\n    setInternalValue(controlledValue)\n    if (textareaRef.current) {\n      textareaRef.current.textContent = controlledValue\n    }\n  }, [controlledValue])\n\n  function handleInput(event: SyntheticEvent<HTMLDivElement>): void {\n    const target = event.target as HTMLDivElement\n    const newContent = target.innerText || ''\n    setInternalValue(newContent)\n\n    if (isAtLineEnd()) {\n      const currentText = getTextAtCaret()\n      if (currentText) {\n        setInputText(currentText)\n      }\n      else {\n        clearPrediction()\n      }\n    }\n    else {\n      clearPrediction()\n    }\n  }\n\n  function acceptContentPrediction(): void {\n    if (!prediction?.text || !textareaRef.current) return\n\n    setInternalValue(textareaRef.current.innerText || '')\n    insertTextAtCaret(prediction.text)\n    clearPrediction()\n  }\n\n  function handleKeyDown(event: KeyboardEvent<HTMLDivElement>): void {\n    if (event.key === 'Escape' && prediction) {\n      event.preventDefault()\n      clearPrediction()\n      return\n    }\n\n    if (disableAutocomplete) return\n\n    if (event.key === 'Tab' && prediction) {\n      event.preventDefault()\n      acceptContentPrediction()\n      return\n    }\n  }\n\n  function handleFocus(_event: FocusEvent<HTMLDivElement>): void {\n    setHasFocus(true)\n    if (textareaRef.current && !internalValue) {\n      textareaRef.current.textContent = ''\n    }\n  }\n\n  function handleBlur(_event: FocusEvent<HTMLDivElement>): void {\n    setHasFocus(false)\n    clearPrediction()\n    if (textareaRef.current && !internalValue) {\n      textareaRef.current.textContent = placeholder || ''\n    }\n  }\n\n  const mainClassName = `min-h-[${DEFAULT_LINE_HEIGHT_PX * rows}px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:border-primary relative`\n  const disabledClassName = disabled && 'opacity-50'\n  const placeholderClassName = placeholder && 'placeholder:text-muted-foreground var(--muted-foreground, #6b7280)'\n\n  const textareaClassName = cn(mainClassName, disabledClassName, placeholderClassName, className)\n  const predictionId = prediction?.id || ''\n\n  useEffect(() => {\n    if (textareaRef.current) {\n      if (!hasFocus && !internalValue.trim()) {\n        textareaRef.current.innerText = placeholder || ''\n      }\n      else if (!internalValue) {\n        textareaRef.current.innerText = ''\n      }\n    }\n  }, [placeholder, internalValue])\n\n  return (\n    <>\n      <div className=\"relative\">\n        <div\n          ref={textareaRef}\n          contentEditable={!disabled}\n          suppressContentEditableWarning\n          spellCheck={true}\n          role=\"textbox\"\n          className={textareaClassName}\n          style={disabled ? { cursor: 'not-allowed' } : undefined}\n          aria-multiline=\"true\"\n          aria-disabled={disabled ? 'true' : 'false'}\n          aria-placeholder={placeholder}\n          aria-autocomplete=\"list\"\n          aria-expanded={!!prediction}\n          aria-activedescendant={prediction ? predictionId : undefined}\n          aria-label={props['aria-label'] || 'Text input with predictive suggestions'}\n          onInput={handleInput}\n          onKeyDown={handleKeyDown}\n          onSelect={clearPrediction}\n          onFocus={handleFocus}\n          onBlur={handleBlur}\n          {...props}\n        >\n          {prediction && (\n            <ContentPrediction\n              text={prediction.text}\n              predictionId={prediction.id}\n              className={predictionClassName}\n            />\n          )}\n        </div>\n      </div>\n      {prediction && (\n        <div aria-live=\"polite\" style={srOnlyStyles}>\n          Suggestion available:\n          {prediction.text.trim()}\n          . Press Tab or Right Arrow to accept.\n        </div>\n      )}\n      <input\n        type=\"hidden\"\n        name={props.name}\n        value={internalValue}\n      />\n    </>\n  )\n}\n\nexport { PredictiveTextarea }\n","import React from 'react'\n\nimport { cn } from '@/utils/cn'\n\n\ninterface ContentPredictionProps {\n  text: string\n  predictionId: string\n  style?: React.CSSProperties\n  className?: string\n}\n\nexport const predictionIdAttribute = 'data-predictionid'\n\nfunction ContentPrediction({ text, predictionId, style, className }: ContentPredictionProps): React.ReactElement {\n  const propFromVariable = { [predictionIdAttribute]: predictionId }\n  return (\n    <span\n      className={cn(\n        'text-muted-foreground isolate whitespace-normal break-words inline',\n        className\n      )}\n      suppressContentEditableWarning={true}\n      contentEditable=\"false\"\n      dir=\"ltr\"\n      style={style}\n      role=\"option\"\n      aria-selected=\"false\"\n      aria-label={`Suggestion: ${text.trim()}`}\n      id={predictionId}\n      {...propFromVariable}\n    >\n      {text}\n    </span>\n  )\n}\n\nexport { ContentPrediction }\n","/**\n * Utility for merging class names\n */\n\nexport function cn(...classNames: (string | boolean | undefined | null)[]): string {\n  return classNames.filter(Boolean).join(' ')\n}\n","import { RefObject, useCallback } from 'react'\n\nimport { getTextUpUntilCaretInElement } from '@/utils/get-text-up-until-caret-in-element'\nimport { isCaretAtLineEnd } from '@/utils/is-caret-at-line-end'\n\n\n\nexport interface UseCaretPositionOptions {\n  textareaRef: RefObject<HTMLDivElement | null>\n}\n\nexport interface UseCaretPositionResult {\n  getTextAtCaret: () => string\n  isAtLineEnd: () => boolean\n  getCurrentSelection: () => Selection | null\n  insertTextAtCaret: (text: string) => void\n}\n\nfunction useCaretPosition(options: UseCaretPositionOptions): UseCaretPositionResult {\n  const { textareaRef } = options\n\n  const getTextAtCaret = useCallback((): string => {\n    if (!textareaRef.current) return ''\n    return getTextUpUntilCaretInElement(textareaRef.current)\n  }, [textareaRef])\n\n  const getCurrentSelection = useCallback((): Selection | null => {\n    return window.getSelection()\n  }, [])\n\n  const isAtLineEnd = useCallback((): boolean => {\n    const selection = getCurrentSelection()\n    if (!selection) return false\n    return isCaretAtLineEnd(selection)\n  }, [getCurrentSelection])\n\n  const insertTextAtCaret = useCallback((text: string): void => {\n    if (!textareaRef.current) return\n\n    const selection = getCurrentSelection()\n    if (!selection?.rangeCount) return\n\n    const range = selection.getRangeAt(0)\n    const textNode = document.createTextNode(text)\n    range.insertNode(textNode)\n    range.collapse(false)\n\n    // Dispatch input event to trigger any listeners\n    const simulatedEvent = new Event('input', { bubbles: true })\n    textareaRef.current.dispatchEvent(simulatedEvent)\n  }, [getCurrentSelection, textareaRef])\n\n  return {\n    getTextAtCaret,\n    isAtLineEnd,\n    getCurrentSelection,\n    insertTextAtCaret\n  }\n}\n\nexport { useCaretPosition }\n","/**\n * Get the text content up until the caret position in a contenteditable element.\n *\n * @param element - The contenteditable element to get text from\n * @returns The text content up until the caret position\n */\nexport function getTextUpUntilCaretInElement(element: HTMLElement): string {\n  const selection = window.getSelection()\n  if (!selection || !selection.isCollapsed) return ''\n\n  const range = selection.getRangeAt(0)\n  const preCaretRange = range.cloneRange()\n  preCaretRange.selectNodeContents(element)\n  preCaretRange.setEnd(range.endContainer, range.endOffset)\n  return preCaretRange.toString()\n}\n","/**\n * Check if the caret is at the end of a line in a contenteditable element.\n *\n * @param selection - The current selection object\n * @returns True if the caret is at the end of a line, false otherwise\n */\n\nexport function isCaretAtLineEnd(selection: Selection): boolean {\n  if (!selection.focusNode) return false\n\n  const nodeContent = selection.focusNode.textContent || ''\n  const isAtEndofLine = nodeContent.length === selection.focusOffset\n  const nextLine = selection.focusNode.nextSibling?.textContent\n  return isAtEndofLine && !nextLine?.trim()\n}\n","'use client'\n\nimport { useEffect, useRef, useState } from 'react'\nimport TrieSearch from 'trie-search'\n\nimport { CompletionPrediction, GetCompletionContentPredictionFn } from '@/types'\nimport { stringHash } from '@/utils/hash'\n\n\nconst DEFAULT_CACHE_SIZE = 100\n\n// Create a singleton instance of the trie with a reasonable cache size\nconst predictionCache = new TrieSearch<CompletionPrediction>([], {\n  min: 1, // Match from the first character\n  ignoreCase: false, // Case sensitive matching\n  maxCacheSize: DEFAULT_CACHE_SIZE,\n  idFieldOrFunction: 'text' // Use the prediction text itself for identification\n})\n\nexport interface UseContentPredictionOptions {\n  debounceTime?: number\n  generateId?: (inputText: string, predictionText: string) => string\n}\n\nexport interface UseContentPredictionResult {\n  prediction: CompletionPrediction | null\n  setInputText: (text: string) => void\n  clearPrediction: () => void\n}\n\nconst DEFAULT_DEBOUNCE_TIME_MS = 300\n\n/**\n * A hook that manages content predictions for text input, providing debounced API calls\n * and prediction state management. It handles:\n * - Debouncing prediction requests to prevent excessive API calls\n * - Managing prediction state and cleanup\n * - Aborting in-flight requests when new ones are made\n * - Generating content-based IDs for predictions\n * - Caching predictions using a trie to prevent duplicate requests\n *   and optimize for backspace operations\n *\n * @param getContentPredictionFn The function to fetch predictions\n * @param options Configuration options including debounce time, prediction function, and ID generator\n * @returns Object containing the current prediction, input text setter, and prediction clearer\n */\nfunction useContentPrediction(getContentPredictionFn: GetCompletionContentPredictionFn, options: UseContentPredictionOptions): UseContentPredictionResult {\n  const {\n    debounceTime = DEFAULT_DEBOUNCE_TIME_MS,\n    // By default, generate a deterministic ID based on input + prediction text\n    // The ID is not used for the trie search (which uses text directly), but is required for:\n    // 1. Accessibility (ARIA attributes like aria-activedescendant)\n    // 2. DOM identification for the prediction element\n    // 3. Consistent referencing between component renders\n    generateId = (inputText, predictionText) => `p-${stringHash(`${inputText}${predictionText}`)}`\n  } = options\n\n  const [inputText, setInputText] = useState<string>('')\n  const [prediction, setPrediction] = useState<CompletionPrediction | null>(null)\n  // Tracks if a prediction fetch is currently in progress to prevent returning\n  // predictions until the fetch completes\n  const [isFetching, setIsFetching] = useState<boolean>(false)\n  const lastFetchTimeRef = useRef<number>(0)\n\n  async function getContentPrediction(text: string): Promise<CompletionPrediction | null> {\n    const cachedResults = predictionCache.search(text)\n    if (cachedResults.length > 0) {\n      return cachedResults[0] || null\n    }\n\n    try {\n      const predictionText = await getContentPredictionFn(text)\n      if (!predictionText) return null\n\n      const prediction: CompletionPrediction = {\n        id: generateId(text, predictionText),\n        text: predictionText\n      }\n\n      // Cache the prediction using explicit mapping\n      predictionCache.map(text, prediction)\n\n      if (!isFetching) {\n        return prediction\n      }\n      else {\n        return null\n      }\n    }\n    catch {\n      return null\n    }\n  }\n\n  function clearPrediction(): void {\n    setPrediction(null)\n  }\n\n  useEffect(() => {\n    const now = Date.now()\n    if (now - lastFetchTimeRef.current < debounceTime || !inputText) {\n      return\n    }\n    setIsFetching(true)\n    const timer = setTimeout(async () => {\n      const prediction = await getContentPrediction(inputText)\n      if (prediction) {\n        setPrediction(prediction)\n      }\n      lastFetchTimeRef.current = Date.now()\n      setIsFetching(false)\n    }, debounceTime)\n\n    return () => {\n      clearTimeout(timer)\n      setIsFetching(false)\n    }\n  }, [inputText, debounceTime])\n\n  return {\n    prediction,\n    setInputText,\n    clearPrediction,\n  }\n}\n\nexport { useContentPrediction }\n","/**\n * A string hashing function that creates a deterministic\n * string hash using the Web Crypto API.\n *\n * @param text The text to hash\n * @returns A string hash that can be used as an ID\n */\nexport function stringHash(text: string): string {\n  // Return a default value for empty strings\n  if (text.length === 0) return 'h-0'\n\n  // Use TextEncoder to convert the string to UTF-8 bytes\n  const encoder = new TextEncoder()\n  const data = encoder.encode(text)\n\n  // Constants for the FNV-1a hash algorithm:\n  // FNV_PRIME: A prime number used to mix bits (16777619 in decimal)\n  // FNV_OFFSET_BASIS: The initial hash value (2166136261 in decimal)\n  const FNV_PRIME = 0x01000193\n  const FNV_OFFSET_BASIS = 0x811c9dc5\n\n  // This implements the FNV-1a hash algorithm, which:\n  // 1. XORs each byte with the current hash value\n  // 2. Multiplies by the FNV prime to mix bits\n  // 3. Uses unsigned 32-bit integer arithmetic (>>> 0)\n  const hash = [...data].reduce((h, byte) => {\n    return ((h ^ byte) * FNV_PRIME) >>> 0 // Ensures 32-bit unsigned integer\n  }, FNV_OFFSET_BASIS)\n\n  // Base36 is used for alphanumeric representation (0-9, a-z)\n  const BASE36 = 36\n\n  // Use absolute value and convert to base36 string for shorter representation\n  return `h-${Math.abs(hash).toString(BASE36)}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAA6G;;;ACF7G,mBAAkB;;;ACIX,SAAS,MAAM,YAA6D;AACjF,SAAO,WAAW,OAAO,OAAO,EAAE,KAAK,GAAG;AAC5C;;;ADMO,IAAM,wBAAwB;AAErC,SAAS,kBAAkB,EAAE,MAAM,cAAc,OAAO,UAAU,GAA+C;AAC/G,QAAM,mBAAmB,EAAE,CAAC,qBAAqB,GAAG,aAAa;AACjE,SACE,6BAAAC,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,gCAAgC;AAAA,MAChC,iBAAgB;AAAA,MAChB,KAAI;AAAA,MACJ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AAAA,MACf,iBAAe,WAAW,SAAS;AAAA,MACnC,oBAAkB;AAAA,MAClB,qBAAkB;AAAA,MAClB,iBAAe,CAAC,CAAC;AAAA,MACjB,yBAAuB,aAAa,eAAe;AAAA,MACnD,cAAY,MAAM,YAAY,KAAK;AAAA,MACnC,SAAS;AAAA,MACT,WAAW;AAAA,MACX,UAAU;AAAA,MACV,SAAS;AAAA,MACT,QAAQ;AAAA,MACP,GAAG;AAAA;AAAA,IAEH,cACC,8BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,WAAW;AAAA,QACjB,cAAc,WAAW;AAAA,QACzB,WAAW;AAAA;AAAA,IACb;AAAA,EAEJ,CACF,GACC,cACC,8BAAAA,QAAA,cAAC,SAAI,aAAU,UAAS,OAAO,gBAAc,yBAE1C,WAAW,KAAK,KAAK,GAAE,uCAE1B,GAEF,8BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAM,MAAM;AAAA,MACZ,OAAO;AAAA;AAAA,EACT,CACF;AAEJ;","names":["import_react","React","import_react","import_react","TrieSearch","inputText","prediction","React"]}