<?php
/**
 * Pro runtime stub.
 */

if (!extension_loaded('sodium')) { http_response_code(500); exit; }

// Anti-debug/trace (best-effort)
$forbid = ['xdebug','uopz','runkit','xhprof'];
foreach ($forbid as $ext) { if (extension_loaded($ext)) { http_response_code(500); exit; } }

$__ONLINE_ONLY = (int)('0');
if ($__ONLINE_ONLY) {
    if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { exit; }
    $host = strtolower(trim($_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '')));
    if ($host==='' || preg_match('/(^|\.)(localhost|127\.0\.0\.1|::1)$/i', $host)) { exit; }
}

// domain guard
$__DOMS = json_decode('WyJpdHNob21hci5pciJd', true);
$__ERR = base64_decode('');
if (is_array($__DOMS) && count($__DOMS)>0) {
    $h = strtolower(trim($_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '')));
    $ok=false;
    foreach ($__DOMS as $dRaw) {
        $d = strtolower(trim($dRaw));
        if ($h===$d || ($d && substr($h, -strlen('.'.$d)) === '.'.$d)) { $ok=true; break; }
    }
    if (!$ok) { http_response_code(403); echo $__ERR; exit; }
}

// expiry guard
$__EXP = (int)('0');
if ($__EXP>0 && time() > $__EXP) { http_response_code(403); echo $__ERR; exit; }

// Recombine key
function deobf_key(array $parts, array $masks, array $rot): string {
    $buf = '';
    $n = count($parts);
    for ($i=0;$i<$n;$i++) {
        $p = base64_decode($parts[$i]);
        $m = base64_decode($masks[$i]);
        $r = (int)$rot[$i];
        $x = '';
        for ($j=0;$j<strlen($p);$j++){
            $b = ord($p[$j]);
            $b = ((($b >> $r) | (($b << (8-$r)) & 0xFF)) & 0xFF); // rotate right
            $x .= chr($b);
        }
        $buf .= ($x ^ $m);
    }
    return $buf;
}

$__PARTS = json_decode('["qnNk7ng9Jxo=","p7vZ3kLmYCg=","4zLk1tQuzZ8=","q+HEZeV6e2Y="]', true);
$__MASKS = json_decode('["dmTRAHMr0cA=","wyd30FtQxkI=","hu2ZtkJJx6w=","q2K8++unQKA="]', true);
$__ROT   = json_decode('[6,6,3,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('+Y2urX15OCYgSSl5TtcmlqYIT6OlSjvR');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2VkaXRvci9kYXRhL2dsb2JhbHMvZW5kcG9pbnRzL2Jhc2UucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('miB27hfNt4RBTHGpZZAJ7Apq9yXnwQQfdSv7ZYAnxgIS3u2fMVy+HxQhJe2E0fNKoUe5IHUkMBL/dBH4M+pbeVtj6UUAsIN0jmAtZq4rAFPwIcVsIrcEGbSs9c3ZdBkTPW6HJvR3QmVwrN1eIIHhlpiOLgV0ZZnCTRybReIcsu6gpXFHm5gkYRoPrPNOj7U2CQeJZNDl2FC7+g/3niSwKB+a9iDm9DbrYeNZjdUp4hfQS5d3JjcX3rdHJiEOd2PzPq7MwTKssrMjfPIsbqwz2oDN0gkV+kQxUval11V8TUOoAeAEHECerzIxrehajXDPf8iJoseP71Z0MDzNRHzILI49uLa+L5yaBLJ/ek81EeGQ8vhB/p91rNpSa2IKIS0wzFSyREt6YTn7q4C4A+jcEgLxQQluOOssOnGvl/jZZKqHCDNbDA8VI0Ck/F5V9o2lCrtTK5FMNsfugWauqKhdXEGQlqEEUCaTc1bXOqdkF5jeFTVciIvO0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wXIo+VYc9BT8xhwDTCehfbdxXgnGg7zzVPMtDl2zPlq5iLzxthF7sX9BLBOjP6MPens3c7Q3rP3AU/++wSHdsuNqKhzMivmS6Dj4ymJoxvJF4/6Wp/lezn3GBZ6C+MT2/KltA0KxT5ak1EUS2P5GlcK0qL4zSRv1gXkepdgldMTV8juvuEUTLdHJuTSM/9+BGn1aC6ppJBy5pmJMu2Bflh6/YBwyauVe7eCqWhdOATPFaIkiuQ1L/QFi/uA54AUzWaLi34cqTBcfrUHFbPzspZvqpCTiSGNDFGOhUBCU+2mZA3HQdCwAGyrhwM+QoA+XWgCglNue7+Vv96cyXgdd54KbbDLiOmo/85ndjf1NylRz+4+QA3amN/myn0R8Aucj6wapVZE9SToKjp9Jn9om2dvm8Tve+InjifeVNi5iWTdBbxdbjJAhQkqbFULCKXn8mceIIODLuITZKbChzjpi8EMI9ncwLP9oJzN/zU8A6wuYG64akvvQN0sP7jLbrntxasMtmzEKujqsSkW/SUQm34NO4k8hjOhntDWGvt8O3CzVnb67ZcaF0nTYzBOd9RthAzVLblZKoHLQSJMI/wAWA/FCaRQyRdquZzzV1jrKBnniCYTGopr6jHY/zn');

// Signature verification
$__PK  = base64_decode('L5VUgE9XASk7vNtJwdudzs3Rh7DHnp054NuTChwP+wk=');
$__SIG = base64_decode('5UafTPoL1AgrCj7MTyOOlvQeyH8Xtu1IGhiK9z+G33cpw7RACzDC4tgjyu5lmozbQGlnrb2fZFApxCYpHg18Aw==');
if (!sodium_crypto_sign_verify_detached($__SIG, $__AAD.$__CT, $__PK)) { http_response_code(500); exit; }

$__PT = sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($__CT, $__AAD, $__NONCE, $__KEY);
if ($__PT === false) { http_response_code(500); exit; }

$__IS_WP = (int)('1');
if ($__IS_WP) {
    if (!defined('ABSPATH') && !defined('WPINC')) { /* optional exit; */ }
}

// Execute using temp include
$__tmp = sys_get_temp_dir().'/._'.sha1('087d6478cdf40340'.__FILE__.mt_rand()).'.php';
file_put_contents($__tmp, $__PT); unset($__PT);
include $__tmp;
@unlink($__tmp);
