
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Checking your browser...</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
            background: #f1f5f9;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .card {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.08);
            padding: 36px 40px 32px;
            width: 340px;
            text-align: left;
        }

        .cf-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 24px;
        }

        .cf-logo svg {
            width: 32px;
            height: 32px;
            flex-shrink: 0;
        }

        .cf-logo-text {
            font-size: 13px;
            font-weight: 600;
            color: #1a1a2e;
            line-height: 1.2;
        }

        .cf-logo-sub {
            font-size: 11px;
            font-weight: 400;
            color: #64748b;
        }

        .headline {
            font-size: 17px;
            font-weight: 600;
            color: #0f172a;
            margin-bottom: 6px;
        }

        .subline {
            font-size: 13px;
            color: #64748b;
            margin-bottom: 20px;
            line-height: 1.5;
        }

        /* Checkbox widget */
        .widget {
            border: 1px solid #d1d5db;
            border-radius: 6px;
            padding: 14px 16px;
            display: flex;
            align-items: center;
            gap: 14px;
            background: #f8fafc;
            margin-bottom: 16px;
            cursor: pointer;
            user-select: none;
            transition: border-color 0.15s, background 0.15s;
        }

        .widget:hover {
            border-color: #94a3b8;
            background: #f1f5f9;
        }

        .widget.verifying {
            cursor: default;
            border-color: #cbd5e1;
        }

        .widget.verified {
            border-color: #22c55e;
            background: #f0fdf4;
            cursor: default;
        }

        /* The actual checkbox */
        .cb-box {
            width: 24px;
            height: 24px;
            border: 2px solid #9ca3af;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            background: #fff;
            transition: border-color 0.15s, background 0.15s;
            position: relative;
        }

        .widget:hover .cb-box {
            border-color: #6b7280;
        }

        .widget.verifying .cb-box,
        .widget.verified .cb-box {
            border-color: transparent;
            background: transparent;
        }

        /* Spinner */
        .spinner {
            display: none;
            width: 22px;
            height: 22px;
            border: 2.5px solid #e5e7eb;
            border-top-color: #f6821f;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
            flex-shrink: 0;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Checkmark */
        .checkmark {
            display: none;
            width: 22px;
            height: 22px;
            flex-shrink: 0;
        }

        .checkmark circle {
            fill: #22c55e;
        }

        .checkmark path {
            fill: none;
            stroke: #fff;
            stroke-width: 2.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .widget-label {
            font-size: 14px;
            color: #374151;
            font-weight: 500;
        }

        .widget.verified .widget-label {
            color: #15803d;
        }

        /* CF branding footer */
        .cf-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 5px;
            font-size: 10px;
            color: #94a3b8;
        }

        .cf-footer svg {
            width: 14px;
            height: 14px;
            opacity: 0.5;
        }

        .error-msg {
            display: none;
            font-size: 12px;
            color: #dc2626;
            margin-top: 8px;
        }
    </style>
</head>
<body>
<div class="card" role="main">


</div>

<script>
(function() {
    var done = false;
    var retryCount = 0;

    window.startVerify = function() {
        if (done) return;
        done = true;

        var widget  = document.getElementById('widget');
        var spinner = document.getElementById('spinner');
        var check   = document.getElementById('checkmark');
        var label   = document.getElementById('widget-label');
        var errMsg  = document.getElementById('error-msg');
        var cbBox   = document.getElementById('cb-box');

        // Transition to "verifying" state. Every element is optional: when the
        // challenge content is hidden (Visible=false) none of these nodes exist,
        // but verification must still proceed so the bypass cookie gets set.
        if (widget) {
            widget.classList.add('verifying');
            if (widget.hasAttribute('aria-checked')) {
                widget.setAttribute('aria-checked', 'mixed');
            }
        }
        if (cbBox) { cbBox.style.display = 'none'; }
        if (spinner) { spinner.style.display = 'block'; }
        if (label) { label.textContent = 'Verifying\u2026'; }

        // POST nonce to verification endpoint
        fetch('/_challenge/complete', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({
                nonce: "d447219fdf38b68b133709e1aa3984a7.1782584311.3448fe317b91b0501267ad60e5be9fa7f49f2d7b6f09245f205e2aafccf7cf3d",
                path:  "/feed/"
            }),
            credentials: 'same-origin'
        })
        .then(function(res) {
            if (!res.ok) { throw new Error('bad status ' + res.status); }
            return res.json();
        })
        .then(function(data) {
            if (!data.success) { throw new Error('not ok'); }

            // Transition to "verified" state (cosmetic; nodes may be absent)
            if (spinner) { spinner.style.display = 'none'; }
            if (check) { check.style.display = 'block'; }
            if (widget) {
                widget.classList.remove('verifying');
                widget.classList.add('verified');
                if (widget.hasAttribute('aria-checked')) {
                    widget.setAttribute('aria-checked', 'true');
                }
            }
            if (label) { label.textContent = 'Verified'; }

            setTimeout(function() {
                window.location.replace(data.redirect || '/');
            }, 600);
        })
        .catch(function() {
            done = false;
            
            // js_probe: silently retry once before surfacing the error.
            if (retryCount < 1) {
                retryCount++;
                setTimeout(window.startVerify, 2000);
                return;
            }
            
            if (spinner) { spinner.style.display = 'none'; }
            if (cbBox) { cbBox.style.display = 'block'; }
            if (widget) {
                widget.classList.remove('verifying');
                if (widget.hasAttribute('aria-checked')) {
                    widget.setAttribute('aria-checked', 'false');
                }
            }
            if (label) { label.textContent = 'I am human'; }
            if (errMsg) { errMsg.style.display = 'block'; }
        });
    };

    
    // js_probe mode: auto-fire after configured delay — no user interaction required.
    window.addEventListener('DOMContentLoaded', function() {
        setTimeout(window.startVerify, 501);
    });
    
}());
</script>
</body>
</html>
