<?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('["1NSYllkrGys=","9kpSO0Pz+Yo=","qelXedtDfNM=","uYp\/JNGvmBI="]', true);
$__MASKS = json_decode('["usP39+P9s68=","hvNCX8VQQvg=","wCw11J3Xphw=","CYuEvrnry0k="]', true);
$__ROT   = json_decode('[4,4,5,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('GrBGHgc1F+kuow6FBb9Y21kLZFqotMba');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL25vdGVzL21vZHVsZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('dJEAsrOyWXbUfRZfMqv1LlcRx32oZJGz157dwn9Jzn0PcB+oLBWa4qXvUEpFb4ne3esqZB2bHrGaFLVPBvBuaZ/FMu+k8LIJ2WfGneBM5Kd2TLpcQ99Qv0ToKJIA1xoufYrmh6C+4zVPfyKyl+MF/aQpTfFfDSWnaT0rcgJTHPWDNSRNI62rZtMf0BEKJMsG010jLe64Od0nj4BO0W3cVzRbMqTcjkhM20dKLuK6JbBx3vQkob2wIFU6DBs+Jlf2FnNO+sq4sxsvT+7ONZjaD6h82OAkXV4aOL0cZMO1a/Ig0bKfDphLArFB7dtAGHEw6BUEWUoRx5aprDVxExrQ8uXENt3/fzFhrt2mchyBA/wLEeevpCl5U1nXksHHt7KPRR5CoU3WLD/UQ2fmWwT2BKCJah5RLj1SkaQIxHdeounLg1jNzG5wetf4Sts1tFyd/ez6XLDje21w1tU1N7CyGvOMFgCbnbU/8nbprBigvkWvBP5uLK9zQ6soKK12Ui77CpJhgynfyRvqghiFV/4C9QKPX0JUiWM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sh9yRtUQGReIzCUOJQa4JTouQR78tEknBSMds8l4S4NqtIzLN4K64RMYW1Etus5tQX');

// Signature verification
$__PK  = base64_decode('OJyqsva2BfTaZQAyv8apyLxKlSdYpwHQIEb58r+60PE=');
$__SIG = base64_decode('HnNOOkXVGZYopg3mRq8pJIz1bkO77FZ8cV2x4j/6K/y+Ho1eVx6zxBh6y47fJ7HYmiFKLB0CvgxXrZ6bMzd2Bg==');
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);
