/** Seconds as a timecode: 4973 → "1:22:53", 58 → "0:58". */ export function clock(s: number): string { const t = Math.max(0, Math.floor(s)); const h = Math.floor(t / 3600); const m = Math.floor((t % 3600) / 60); const sec = t % 60; const ss = String(sec).padStart(2, "0"); return h > 0 ? `${h}:${String(m).padStart(2, "0")}:${ss}` : `${m}:${ss}`; }