import 'flatpickr/dist/flatpickr.min.css'; import { handleCapitolEvents } from './events/events'; import { handleCapitolTours } from './tours/tours'; declare global { interface Window { MSCC_EVENTS_API_URL?: string; MSCC_TOURS_API_URL?: string; } } // Run the events and tours functionality when the DOM is loaded document.addEventListener('DOMContentLoaded', async () => { // If events page... if (document.getElementById('mscc-events')) { const MSCC_EVENTS_API_URL = window.MSCC_EVENTS_API_URL || null; if (!MSCC_EVENTS_API_URL) { throw new Error('Missing MSCC_EVENTS_API_URL'); } await handleCapitolEvents(MSCC_EVENTS_API_URL); } // Run the tours functionality if on the tours page if (document.getElementById('mscc-tours')) { const MSCC_TOURS_API_URL = window.MSCC_TOURS_API_URL || null; if (!MSCC_TOURS_API_URL) { throw new Error('Missing MSCC_TOURS_API_URL'); } await handleCapitolTours(MSCC_TOURS_API_URL); } });