import { useEffect, useRef, useState, type CSSProperties, type ReactNode, } from 'react'; export interface VideoChapter { /** Stable id — React key. */ id: string; /** Display label. */ label: string; /** Chapter start time in seconds. */ startSeconds: number; } export interface VideoCaption { /** Stable id. */ id: string; /** Caption start in seconds. */ start: number; /** Caption end in seconds. */ end: number; /** Display text. */ text: string; } export interface VideoPlayerProps { /** Video source URL. */ src: string; /** Optional poster image. */ poster?: string; /** Optional chapter list — rendered as buttons under the player. */ chapters?: VideoChapter[]; /** * Optional in-memory caption track. When provided, the active line is * rendered as an aria-live caption strip below the video. * Hosts that prefer real elements can pass `captionsTrackUrl` * instead via the `slot` prop and skip this list. */ captions?: VideoCaption[]; /** Slot rendered above the chapter list — e.g. native . */ slot?: ReactNode; width?: number; height?: number; ariaLabel?: string; className?: string; style?: CSSProperties; } /** * `` — minimal token-themed video wrapper with chapter * navigation + optional caption rail. * * Wave 13.G.4. Uses the native `