/* global React, ReactDOM, HomePage, TreatmentsPage, PillarPage, DoctorsPage, DoctorProfilePage, AboutPage, LocationPage, BeforeAfterPage, ContactPage, Navbar, Footer, BookingFlow, CONTACT, COPY, useTweaks, TweaksPanel, TweakSection, TweakColor, TweakRadio, TweakSelect, TweakToggle */
const { useState, useEffect } = React;
const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
"palette": "porcelain",
"accent": "#B8995A",
"fontDisplay": "Cormorant Garamond",
"monoMarquee": true,
"navStyle": "centered",
"language": "en"
}/*EDITMODE-END*/;
const PALETTES = {
porcelain: { theme: "", lbl: "Porcelain" },
rose: { theme: "theme-rose", lbl: "Pâle rosée" },
noir: { theme: "theme-noir", lbl: "Nuit Lutétia" }
};
const FONT_OPTIONS = ["Cormorant Garamond", "Fraunces", "Libre Caslon Text", "Playfair Display"];
const App = () => {
const [route, setRoute] = useState({ page: "home", slug: null });
const [booking, setBooking] = useState(false);
const [t, setTweak] = useTweaks(TWEAK_DEFAULTS);
const go = (page, slug = null) => {
setRoute({ page, slug });
window.scrollTo({ top: 0, behavior: "smooth" });
};
// Apply accent + palette
useEffect(() => {
const root = document.documentElement;
root.style.setProperty("--champagne", t.accent);
// derive darker tone
root.style.setProperty("--champagne-deep", shade(t.accent, -22));
root.style.setProperty("--font-display", `"${t.fontDisplay}", "Cormorant Garamond", "Times New Roman", serif`);
// palette theme class
document.body.className = PALETTES[t.palette]?.theme || "";
// language direction
document.documentElement.dir = COPY[t.language]?.dir || "ltr";
document.documentElement.lang = t.language;
}, [t.accent, t.fontDisplay, t.palette, t.language]);
const setLang = (l) => setTweak("language", l);
const openBooking = () => setBooking(true);
const closeBooking = () => setBooking(false);
let pageEl = null;
if (route.page === "home") pageEl =