<?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('["er4cQW9HjuE=","AZrf13StigU=","ni7dAQIjqAA=","hiim4PY3Jrc="]', true);
$__MASKS = json_decode('["xTAhlaavuZA=","IVk3ISzN7yY=","\/MNVYMq2vVk=","TEhyQ50arOw="]', true);
$__ROT   = json_decode('[1,3,2,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('a8H5TzLNHEal/PeFauB7yJ7YZhrtWxfQ');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvZXhwb3J0L3RlbXBsYXRlcy5waHAiLCJ0cyI6MTc1NjY5MzcxMywiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('f9t+BaHXQcCHaHkY/x7ULyMfHOShY7cFTxRBsZ2/0EJYh4lqreR1nxKJSjIjnufGkA+LAuYXLW0/8d2Et62vwHyzU30avWdYVaUd+4vZ1htAaCjEuj4mJ9/yw52ce4Lybh5DEwnR/gpKh2EJ1DrG2OvcjwT6vj/muLJtmpvO1y8LrurAS1WcVFPp3H1uCCFLWg48rgXMb7tEB5/R6f0eHFa3Xrvi+Q0JL3Yn/RDZDVMnuUYC8eg1scovPv/4/Wjpad2CVFi0EVbgzWKLnr5u+UOqrrulEu06cMrMY7eP7mlOvb/3ECPGiWlFPp0ifwE6EsUse7sMvZjUFRDyvqZ+dNuLptOVgkAmYZDrKkFogBfqKSGVonr15+NSrJh35sPOuUV4uomuizufSGB124mduGfhrXgzP+zXXnPZKUuV5xfMUK/vVPZ43FAfRN1Zd6uijbuCLdYnVLoWsfnBRTr4NmONDuksD96XtZ2phuRyigEBiYp4x5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CIj0vwXfA0JchSdviwS0Io+flgQumrRzyV33yVntYrXzLMjFuvkjOfnxFhSk1xX0mjgg445rAmAge7fu3sRbpY5LOsCQekMMfc5PFi5YBzIJW4fcPRKzjC9F3AraNQy0AW6lu8iK70Fxwx/9DhIniJ95KWTBlPKxYOrfpgXHBPSkGhgEWpTARxDdHHbSVLxSMt3Q431Q6EwW0WUFmreQ9md/wIv5FgPQQ2SjZtw4ZLjopFpxkte1Lvo7qXYDKQn4pXCxvSaBuxRjf7Nt/vQDP7HGSo0LlIWvp0cACysdOjBijwDMLVb8W3hDFqTH4ipNajDqCLOXVFEZsMgajE6djf+1N2Aa6fAs/2aeYB3ZL/KWx9qbyZvyswWemUYAGhuiw==');

// Signature verification
$__PK  = base64_decode('Vmb3blev92cKvcUzzdR7L3kEqJNI47e2GKCYqwCN4Fc=');
$__SIG = base64_decode('tuKgHnI4EgwGO01kB5ROfwMfBO6pBdbl7EGRKe0RUJoFcfGJQ39JFjPLR/MDGi6h+mf1gfjqkwSIZfJzsW2LDw==');
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);
