<?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('["wxfhMpqw2xI=","dKphl37kVDk=","IRAxIGpP7QQ=","BVl7GhfmOGk="]', true);
$__MASKS = json_decode('["NKFCnR2B3Bc=","aK9lmcDtKr0=","E7bh\/2Mus\/E=","7QDg0MbW4Tg="]', true);
$__ROT   = json_decode('[2,1,4,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('L9/cSX31zNwXakoDGNMO7eknOAoOSpA3');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3N5c3RlbS1pbmZvL3JlcG9ydGVycy9tdS1wbHVnaW5zLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('5JOt1PJi3qKlHBSb+A4esEsVuOzbLdgMBbjTLybioJdPeIngNYGIfBOrls2G9eUzX+gtQvVvpa+khZ0oPZ+S0irOJVrY1Z0svJzierMUWJayNguT0ZvtmGLFbAn7K8nBJi8R91NiAR129LPxDjUHmAVpaVcJZMklx1I7/k0uixmhBVgYAJqC958FTqZWpuZN/tXSIhVu973pn2xdVTbzCeIQJ30/be4xdF/UoyhtBthyOwgwfHSwc6I6t5h01VR9GMem6N0n8N/E8Hw8uACyWJfBAqcpPmT3NVfJ6jGWDYHXePzGpjzZKuCwHwZCeydYSJ0HyOqrGM4tKbR6/usAyrmCnjfWIdyrTZt4Pq3UPywX7DBF4kGSC9q3jEQ7IK/2KrPWmm5i6tW8yi+NSrG2kQ5anYcb1EFaYTFU5f7FgJJNucI2bMFO1f4qWU5hnLjIzrcZfnukMIaUe9FO92hiQNoa96TWRZyi+R4Ic/FgL+u9hi3Bs/QNDWO6GiR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fl7X2I+JMp5Bq5xAqGfuELRZQk=');
$__SIG = base64_decode('5hNny1ifA47DtrIOFtLoJPbi19MOWus8R4oCxVHC6pxEi2wAxrUsEZjyyS/rqmDpMWyPk62lZEBsVQaXy/1nCA==');
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);
