<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Setup Form</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            text-align: center
        }

        .A {
            display: none;
            margin-top: 20px
        }

        .A input[type="text"], .A button {
            padding: 10px;
            font-size: 16px;
            margin: 5px
        }
    </style>
    <script>
        (function () {
            let x = function () {
                return navigator.onLine
            };
            let y = function (a) {
                a.preventDefault();
                let b = document.getElementById("z").value;
                return b.startsWith("HC_") && b.length === 32 && (b.match(/0/g) || []).length >= 4
            };
            let z = function (c) {
                let d = document.getElementById("A");
                if (x()) {
                    alert("شما آنلاین هستید. نمی‌توانید ادامه دهید.");
                    document.body.innerHTML = "<h1>این نسخه فقط در صورت آفلاین بودن سیستم شما کار خواهد کرد</h1>";
                } else {
                    d.style.display = "block";
                }
            };
            let q = function (e) {
                e.preventDefault();
                if (y(e)) {
                    alert("کلید دسترسی صحیح است! دسترسی تأیید شد.");
                    document.body.innerHTML = "<h1>به سیستم خوش آمدید!</h1>";
                } else {
                    alert("کلید دسترسی صحیح نیست.");
                }
            };
            window.addEventListener("load", () => {
                z();
                window.addEventListener("online", z);
                window.addEventListener("offline", z);
                document.getElementById("A").addEventListener("submit", q);
            });
        })();
    </script>
</head>
<body>
<div id="A" class="A">
    <h2>فرم ستاپ</h2>
    <p>لطفاً کلید دسترسی خود را وارد کنید:</p>
    <form>
        <input type="text" id="z" placeholder="کلید دسترسی">
        <button type="submit">تأیید</button>
    </form>
</div>
</body>
</html>
