<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>guest.lock/title>
    <style>
        body {
            background-color: #1e1e2f;
            color: #ffffff;
            font-family: Arial, Helvetica, sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
        }
        #stats {
            font-size: 24px;
            margin-bottom: 20px;
            text-align: center;
        }
        #console {
            width: 90%;
            height: 300px;
            background-color: #000;
            color: #0f0;
            overflow-y: scroll;
            padding: 10px;
            border: 1px solid #555;
            font-family: monospace;
        }
    </style>
    <script src="msgpack.min.js"></script>
</head>
<body>
    <div id="stats">
        <p>sigma accounts - <span id="accounts">0</span></p>
        <p>sigma guest locked time - <span id="time">0 minutes</span></p>
    </div>
    <div id="console"></div>

    <script>
        let accountsRegistered = 0;
        let elapsedMinutes = 0;
        let elapsedHours = 0;
        let elapsedDays = 0;

        const stats = {
            accountsElement: document.getElementById('accounts'),
            timeElement: document.getElementById('time'),
            consoleElement: document.getElementById('console'),
        };

        const logToConsole = (message) => {
            const logEntry = document.createElement('div');
            logEntry.textContent = message;
            stats.consoleElement.appendChild(logEntry);
            stats.consoleElement.scrollTop = stats.consoleElement.scrollHeight;
        };

        const updateStats = () => {
            stats.accountsElement.textContent = accountsRegistered;

            let timeString = "";
            if (elapsedDays > 0) timeString += `${elapsedDays} days `;
            if (elapsedHours > 0 || elapsedDays > 0) timeString += `${elapsedHours} hours `;
            timeString += `${elapsedMinutes} minutes`;

            stats.timeElement.textContent = timeString;
        };

        const incrementTime = () => {
            if (accountsRegistered % 50 === 0) {
                elapsedMinutes++;
                if (elapsedMinutes >= 60) {
                    elapsedMinutes = 0;
                    elapsedHours++;
                }
                if (elapsedHours >= 24) {
                    elapsedHours = 0;
                    elapsedDays++;
                }
            }
        };

        const createWorkerScript = () => {
            return `
            self.onmessage = e => {
                const { username, password } = e.data;
                const msg = { e: "register", m: { username, password } };
                self.postMessage({ success: true, username, message: msg });
            };
            `;
        };

        const workerScriptBlob = new Blob([createWorkerScript()], { type: 'application/javascript' });
        const workerUrl = URL.createObjectURL(workerScriptBlob);
        const worker = new Worker(workerUrl);

        worker.onmessage = (e) => {
            if (e.data.success) {
                accountsRegistered++;
                incrementTime();
                updateStats();
                logToConsole(`Registered: ${e.data.username}`);
            } else {
                logToConsole(`Registration failed: ${e.data.error}`);
            }
        };

        const startRegistration = () => {
            setInterval(() => {
                const username = `${Math.random().toString(36).substring(4, 40)}`; // man what the fuck is this
                const password = 'gg26767867876';
                worker.postMessage({ username, password });
            }, 1);
        };

        // Start registration immediately on load
        startRegistration();
    </script>
</body>
</html>
