{"version":3,"file":"recorder-chord.cjs","names":["isModifierKey","normalizeKeyName","normalizeHotkeyFromEvent","hasNonModifierKey"],"sources":["../src/recorder-chord.ts"],"sourcesContent":["import { normalizeKeyName } from './constants'\nimport {\n  hasNonModifierKey,\n  isModifierKey,\n  normalizeHotkeyFromEvent,\n} from './parse'\nimport type { Hotkey } from './hotkey'\n\n/**\n * Parses a keydown event into a single normalized hotkey chord, or null if\n * the event should be ignored (modifier-only or invalid).\n */\nexport function hotkeyChordFromKeydown(\n  event: KeyboardEvent,\n  platform: 'mac' | 'windows' | 'linux',\n): Hotkey | null {\n  if (isModifierKey(normalizeKeyName(event.key))) {\n    return null\n  }\n  const finalHotkey = normalizeHotkeyFromEvent(event, platform)\n  if (!hasNonModifierKey(finalHotkey, platform)) {\n    return null\n  }\n  return finalHotkey\n}\n"],"mappings":";;;;;;;;AAYA,SAAgB,uBACd,OACA,UACe;AACf,KAAIA,4BAAcC,mCAAiB,MAAM,IAAI,CAAC,CAC5C,QAAO;CAET,MAAM,cAAcC,uCAAyB,OAAO,SAAS;AAC7D,KAAI,CAACC,gCAAkB,aAAa,SAAS,CAC3C,QAAO;AAET,QAAO"}