{"version":3,"file":"runTimelineCommand.mjs","names":[],"sources":["../../../src/hooks/core/runTimelineCommand.ts"],"sourcesContent":["import { timelineCommandInvalidInput } from '@techsquidtv/canvas-timeline-core';\nimport type { TimelineCommandResult } from '@techsquidtv/canvas-timeline-core';\n\n/** Converts expected input validation failures while preserving unexpected programming errors. */\nexport function runTimelineCommand<Value = void>(\n  command: () => TimelineCommandResult<Value>\n): TimelineCommandResult<Value> {\n  try {\n    return command();\n  } catch (error) {\n    if (error instanceof TypeError || error instanceof RangeError) {\n      return timelineCommandInvalidInput(error.message, error);\n    }\n    throw error;\n  }\n}\n"],"mappings":";;;AAIA,SAAgB,mBACd,SAC8B;CAC9B,IAAI;EACF,OAAO,QAAQ;CACjB,SAAS,OAAO;EACd,IAAI,iBAAiB,aAAa,iBAAiB,YACjD,OAAO,4BAA4B,MAAM,SAAS,KAAK;EAEzD,MAAM;CACR;AACF"}