<!doctype html>
<html lang="fr">
  <head>
    <meta charset="UTF-8" />
    <meta name="google-site-verification" content="eFJ58aXLuO53yrizs-jZitRiDmCYAoKw_PxREOw-JGw" />
    <meta name="description" content="TravelChat by OneHote Pro — Application SaaS de gestion locative pour hôtes professionnels." />
    <link rel="icon" type="image/svg+xml" href="/icons/icon.svg?v=1.0.5" />
    <link rel="icon" type="image/png" sizes="16x16" href="/icons/icon-16x16.png?v=1.0.5" />
    <link rel="icon" type="image/png" sizes="32x32" href="/icons/icon-32x32.png?v=1.0.5" />
    <link rel="icon" type="image/png" sizes="48x48" href="/icons/icon-48x48.png?v=1.0.5" />
    <link rel="icon" type="image/png" sizes="96x96" href="/icons/icon-96x96.png?v=1.0.5" />
    <link rel="icon" type="image/png" sizes="192x192" href="/icons/icon-192x192.png?v=1.0.5" />
    <link rel="icon" type="image/png" sizes="512x512" href="/icons/icon-512x512.png?v=1.0.5" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    
    <!-- PWA Meta Tags -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="apple-mobile-web-app-title" content="OneHote">
    <meta name="theme-color" content="#1a1a1a">
    
    <!-- Touch Icons -->
    <link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180x180.png?v=1.0.5">
    <link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png?v=1.0.5">
    <link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png?v=1.0.5">
    <link rel="manifest" href="/manifest.json?v=1.0.5">
    
    <title>TravelChat by OneHote Pro</title>

    <!-- Contenu public pour validateurs (sans JavaScript) -->
    <noscript>
      <div style="font-family:system-ui,sans-serif;max-width:720px;margin:24px auto;padding:24px;line-height:1.6;color:#1f2937">
        <h1>TravelChat by OneHote Pro</h1>
        <p>Plateforme SaaS de gestion locative courte durée pour hôtes et conciergeries : réservations, messagerie voyageurs, mail intelligent Gmail, entretien et paiements.</p>
        <p><a href="/oauth-branding">En savoir plus</a> · <a href="/login">Se connecter</a> · <a href="/privacy-policy">Confidentialité</a></p>
      </div>
    </noscript>
    
    <!-- Script d'initialisation du thème + purge SW en dev local (évite page blanche) -->
    <script>
      (function() {
        var isDevHost =
          location.hostname === 'localhost' ||
          location.hostname === '127.0.0.1' ||
          location.port === '5173' ||
          location.port === '5176';
        if (isDevHost) {
          console.log('[OneHote dev] Chargement index.html — purge SW/cache…');
          if ('serviceWorker' in navigator) {
            navigator.serviceWorker.getRegistrations().then(function(regs) {
              regs.forEach(function(r) { r.unregister(); });
            });
          }
          if ('caches' in window) {
            caches.keys().then(function(keys) {
              keys.forEach(function(k) { caches.delete(k); });
            });
          }
        }

        try {
          const path = window.location.pathname;
          const isPublicGuideClient = /^\/guide\/[^/]+$/.test(path);

          if (isPublicGuideClient) {
            document.documentElement.classList.remove('dark');
            document.documentElement.style.colorScheme = 'light';
          } else {
            // Récupérer le thème sauvegardé
            const savedTheme = localStorage.getItem('theme') || 'auto';
            var shouldBeDark = false;
            var html = document.documentElement;

            if (savedTheme === 'dark') {
              shouldBeDark = true;
              html.style.colorScheme = 'dark';
            } else if (savedTheme === 'light') {
              shouldBeDark = false;
              html.style.colorScheme = 'light';
            } else {
              html.style.colorScheme = 'light dark';
              var ua = navigator.userAgent || '';
              var isMobile = /iPhone|iPad|iPod|Android/i.test(ua);
              if (isMobile) {
                shouldBeDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
              } else {
                var hour = 12;
                try {
                  var parts = new Intl.DateTimeFormat('en-GB', {
                    timeZone: 'Europe/Paris',
                    hour: 'numeric',
                    hourCycle: 'h23'
                  }).formatToParts(new Date());
                  for (var i = 0; i < parts.length; i++) {
                    if (parts[i].type === 'hour') hour = parseInt(parts[i].value, 10);
                  }
                } catch (eHour) {
                  hour = new Date().getHours();
                }
                shouldBeDark = hour < 7 || hour >= 21;
              }
            }

            if (shouldBeDark) {
              html.classList.add('dark');
            } else {
              html.classList.remove('dark');
            }
          }
        } catch (e) {
          console.warn('Erreur initialisation thème:', e);
        }
      })();
    </script>
    <script type="module" crossorigin src="/assets/index.Cz6ajeXh.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index.CtCVRj1d.css">
  </head>
  <body>
    <div id="root"></div>
    <!-- Form sheets / overlays — au-dessus du header (z max). -->
    <div id="modal-root"></div>
    <!-- Toasts — après modal-root pour rester visibles pendant et après une feuille. -->
    <div id="toast-root"></div>
  </body>
</html>
