import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import './index.css';

// Share the same backend origin with first-party scripts loaded by the app shell.
const notelyBackendUrl = (import.meta.env.VITE_NOTELY_BACKEND_URL as string | undefined)?.replace(/\/$/, '') || '';
(window as Window & { SS_API_BASE?: string }).SS_API_BASE = notelyBackendUrl;

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <App />
  </StrictMode>,
);
