import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./lib/fonts";
import "./index.css";
import "./lib/stamFont";
import { installAssetLoadFailsafe } from "./lib/assetLoadFailsafe";

installAssetLoadFailsafe();


const rootEl = document.getElementById("root")!;
createRoot(rootEl).render(<App />);

// Signal to index.html's pre-boot safety-net script that React has mounted.
// Any runtime error AFTER this point is handled by <AppErrorBoundary>, not by
// the "Please update your browser" fallback (which is only correct for genuine
// parse/boot failures where the app never started).
try {
  (window as unknown as { __thBooted?: boolean }).__thBooted = true;
} catch {
  /* ignore — some legacy sandboxes throw on window assignment */
}
