// bootstrap.js - SINGLE ENTRY POINT for application initialization // This is the ONLY file that auto-executes // All initialization happens here in a well-defined sequence async function bootstrap() { console.log('=== Bootstrap Started ==='); try { // Step 1: Load artifacts (areas already loaded in ) console.log('Loading artifacts...'); const { loadArtifacts } = await import('./init.js'); await loadArtifacts(); console.log('✓ Artifacts loaded:', window.allArtifacts?.length || 0); // Step 2: Initialize router (will render initial page) console.log('Initializing router...'); const { router } = await import('./utils/router.js'); // Router auto-initializes in constructor, no need to call init() console.log('✓ Router initialized'); // Step 3: Initialize UI components (search, scroll-to-top, etc.) console.log('Initializing UI...'); const { initializeUI } = await import('./main.js'); await initializeUI(); console.log('✓ UI initialized'); console.log('=== Bootstrap Complete ==='); } catch (error) { console.error('!!! Bootstrap Failed:', error); // Show user-friendly error const mainContent = document.getElementById('main-content'); if (mainContent) { mainContent.innerHTML = `

Failed to Load Application

Please refresh the page. If the problem persists, contact support.

${error.stack || error.message}
`; } } } // Start immediately when module loads bootstrap();