AssParser
The Kotlin ASS dialogue tier: SubStation Alpha (.ssa) and Advanced SubStation Alpha (.ass) parsed in pure commonMain onto the engine's own cue model.
What it maps: styles and the dialogue-grade override subset. Fonts, colours, outline and shadow, positioning (\pos, and \move's start point), alignment (\an and legacy \a), margins, bold, italic, underline, strike-out, and basic fades (\fad). Line breaks (\N, \n, \h), style resets (\r) and wrap style (\q) are honoured; karaoke timing tags are stripped with their text kept; vector drawings (\p) are dropped whole. Everything beyond that (rotation, shear, clipping, animated \t, \fade's seven-argument form) is the optional libass module's job, and unknown override tags are ignored rather than shown.
Two entries, one grammar. parse takes a whole document, the external-file case. trackParser takes just the header (a container's codec extradata carries exactly that) and returns a parser for the per-packet event lines FFmpeg-normalised containers ship.
Functions
Parses a whole .ass/.ssa document into timed cues, event order preserved.
Builds a per-event parser from an ASS HEADER (everything before [Events]' Dialogue lines; a Matroska ass track's codec extradata is exactly this). Malformed headers yield a parser with default styles rather than failing: an unstyled subtitle beats none.