<!doctype html>
<html lang="en" data-theme="sos-light">
    <head>
        <meta charset="UTF-8" />
        <!-- URL prefix placeholder. Built assets are relative; the per-environment
             prefix is injected here after build by scripts/set-url-prefix.mjs. -->
        <base href="/" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <script>
            /*
             * Claims this window's alert-cabinet coordination lock before the
             * app bundle is even fetched. We place it here so that the locks
             * can be claimed as early as possible.
             *
             * If we place it anywhere else, we will encounter timing issues
             * as the app loads its dependencies in
             */
            window.__sosCabinetPresence = (function () {
                try {
                    const path = window.location.pathname;
                    if (!path.includes('work-station')) {
                        return null;
                    }

                    /* Mirrors getCabinetLockName: scoped by the customer view org. */
                    const org = new URLSearchParams(window.location.search).get('org');
                    const scope = org && /^\d+$/.test(org) ? org : 'own';
                    const lock = path.includes('alert-cabinets') ? 'sos.alert-cabinet.cabinets' : 'sos.alert-cabinet.app';
                    const name = lock + ':' + scope;

                    let release;
                    let markGranted;

                    const untilReleased = new Promise((resolve) => {
                        release = resolve;
                    });

                    const granted = new Promise((resolve) => {
                        markGranted = resolve;
                    });

                    navigator.locks
                        .request(name, { mode: 'shared' }, () => {
                            markGranted();
                            return untilReleased;
                        })
                        .catch(() => {
                            markGranted();
                        });

                    return { name, release, granted };
                } catch (error) {
                    /* No Web Locks here; the app falls back to claiming late. */
                    return null;
                }
            })();
        </script>
        <title>SOS Portal</title>
        <script>
            /*
             * Applies the dark theme before first paint, so a dark-mode user never
             * sees the light theme flash. Mirrors resolveColorScheme: the key, mode
             * values and theme id must match LOCAL_STORAGE_KEY.THEME_MODE, ThemeMode
             * and THEME_ID.
             */
            (function () {
                let mode = null;

                try {
                    mode = localStorage.getItem('theme_mode');
                } catch (error) {
                    /* Storage can be blocked; follow the OS. */
                }

                const prefersDark = typeof window.matchMedia === 'function' && window.matchMedia('(prefers-color-scheme: dark)').matches;
                const isDark = mode === 'dark' || (mode !== 'day' && prefersDark);

                if (isDark) {
                    document.documentElement.setAttribute('data-theme', 'sos-dark');
                }
            })();
        </script>
        <style>
            .splash-loader {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100%;
                height: 100vh;
                background-color: var(--sos-surface-primary);
            }

            html[data-theme='sos-dark'] {
                color-scheme: dark;
            }

            html[data-theme='sos-dark'] .splash-loader {
                background-color: var(--sos-surface-primary, #111b28);
            }

            .splash-spinner {
                position: relative;
                width: 100px;
                height: 100px;
                display: inline-block;
            }

            .splash-spinner::before {
                content: '';
                display: block;
                padding-top: 100%;
            }

            .splash-spinner-svg {
                animation: splash-rotate 2s linear infinite;
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                margin: auto;
                width: 100%;
                height: 100%;
                transform-origin: center center;
            }

            .splash-spinner-circle {
                stroke-dasharray: 89, 200;
                stroke-dashoffset: -35px;
                animation:
                    splash-dash 1.5s ease-in-out infinite,
                    splash-color 6s ease-in-out infinite;
                stroke-linecap: round;
            }

            @keyframes splash-rotate {
                100% {
                    transform: rotate(360deg);
                }
            }

            @keyframes splash-dash {
                0% {
                    stroke-dasharray: 1, 200;
                    stroke-dashoffset: 0;
                }
                50% {
                    stroke-dasharray: 89, 200;
                    stroke-dashoffset: -35px;
                }
                100% {
                    stroke-dasharray: 89, 200;
                    stroke-dashoffset: -124px;
                }
            }

            @keyframes splash-color {
                100%,
                0% {
                    stroke: #d62d20;
                }
                40% {
                    stroke: #0057e7;
                }
                66% {
                    stroke: #008744;
                }
                80%,
                90% {
                    stroke: #ffa700;
                }
            }
        </style>
      <script type="module" crossorigin src="./assets/index-G6rse_EC.js"></script>
      <link rel="stylesheet" crossorigin href="./assets/index-BNnAjZb3.css">
    <link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
    <body>
        <div id="root">
            <div class="splash-loader">
                <div class="splash-spinner">
                    <svg class="splash-spinner-svg" viewBox="25 25 50 50" style="animation-duration: 2s">
                        <circle class="splash-spinner-circle" cx="50" cy="50" r="20" fill="none" stroke-width="4" stroke-miterlimit="10"></circle>
                    </svg>
                </div>
            </div>
        </div>
    </body>
</html>
