/** * Stadium Finder UI Panel Component */ import { escapeHTML, setHTML } from '../utils/dom.js'; export class StadiumFinderPanel { constructor(containerEl, venueMapService) { this.containerEl = containerEl; this.venueMapService = venueMapService; } async render() { if (!this.containerEl) return; const venue = await this.venueMapService.findNearestVenue(); const route = this.venueMapService.getAccessibleRoute(venue.id, 'gate-7'); const safeDensity = (value) => { const density = String(value || 'low').toLowerCase(); return ['low', 'medium', 'high'].includes(density) ? density : 'low'; }; const gatesHTML = venue.gates.map(g => `
${escapeHTML(venue.city)} · ${Number(venue.distanceKm) || 0} km away
Destination: ${escapeHTML(route.destination)} (${escapeHTML(route.totalDistance)}, ~${escapeHTML(route.estimatedTime)})