const EPG_SOURCES = ; const L = ; const ALLOW_PERSONAL_EPG = ; // Index of the currently selected source. let activeSourceIndex = 0; const DEFAULT_EPG_URL = EPG_SOURCES[0]?.epg_url ?? ''; const DEFAULT_M3U_URL = EPG_SOURCES[0]?.m3u_url ?? ''; const PX_PER_MIN = 5; const GRID_HOURS = 72; const CORS_PROXY = '/proxy.php?url='; // Anchor the grid 2 hours before "now", rounded down to the previous quarter-hour. const _d = new Date(); _d.setMinutes(Math.floor(_d.getMinutes()/15)*15, 0, 0); const GRID_START = new Date(_d.getTime() - 2*3600000); const GRID_END = new Date(GRID_START.getTime() + GRID_HOURS*3600000); const TOTAL_WIDTH_PX = GRID_HOURS * 60 * PX_PER_MIN; function msToX(ms) { return (ms - GRID_START.getTime()) / 60000 * PX_PER_MIN; }