blob: f5137948e7e840c7bf4eb13e80bcbab354b781ec [file]
import { mount } from "svelte";
import App from "./App.svelte";
import EmbedAgenda from "./components/EmbedAgenda.svelte";
import { isEmbedRoute } from "./lib/embed";
import "./app.css";
const target = document.getElementById("app");
if (!target) throw new Error("No #app element to mount into");
// The embed is a different, much smaller app: no header, no filters, no
// session. Choosing here rather than inside App keeps it from firing off the
// session and calendar requests it has no use for.
function start() {
if (!isEmbedRoute(globalThis.location?.pathname ?? "/")) {
return mount(App, { target: target! });
}
document.documentElement.classList.add("embedded");
return mount(EmbedAgenda, { target: target! });
}
export default start();