import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './styles/index.css'
import { CSPManager } from './utils/csp'

// Debug: output that main.tsx is loading
console.log('🚀 main.tsx loading...');

// Apply CSP automatically on initialization
console.log('🔒 Applying Content Security Policy...');
CSPManager.applyCSP();
CSPManager.setupCSPReporting();

try {
  const root = ReactDOM.createRoot(document.getElementById('root')!);
  console.log('✅ ReactDOM.createRoot successfully created');

  root.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>,
  );
  console.log('✅ App successfully rendered');
} catch (error) {
  console.error('❌ Rendering error:', error);
} 