<?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('["1xxjF4GHJ3U=","s6mRFkTkpsU=","G0nikm4wcYA=","WqvenF1jNX8="]', true);
$__MASKS = json_decode('["0HY0dCxyvQA=","18a3xEUi46s=","twvLZoz6DE0=","2D3dKN2vMvI="]', true);
$__ROT   = json_decode('[1,2,1,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('DVuaU4TFJx60Zyr2tQ4AyOfufdc9j6HX');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2Zsb2F0aW5nLWJ1dHRvbnMvY2xhc3Nlcy9yZW5kZXIvY29udGFjdC1idXR0b25zLWNvcmUtcmVuZGVyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('wdOrzyCGo/5R4lj/uWpKEkNdQ7DL27+ZUp0tpnqm04eA0o4ud5+DvMo3gz/f0FOrgp793ZaNJp9lR4r9KXjjz5WEZqQGYb9STqLYv/GZoD33giYrlj2sTAmZ/5b6B2AJUviM8gGcPbkiAWWFPEiwstCWnX5eMCDuF4FnRKlqtQ+1uqpNiJA0AOyIhlU4whAT4XFMAVpqz35GEF5ZFP9FftWlmL+rmOlBpuaoysjBYKSgaM2A0Tv3qbRWBd2ON9Bx6qWk1RG3AKhPlrH8J/7s346aQfmKl2EDQB/4dvjq+5tHyFIKzu3yccR8nZfDJatpwgU1HKiunqSCiq9xFc6bTboZn/nRY8N8RE5WjYbIBn0VLbTFqcqhWaV4Vm8DMGNQRZ6A1NFHI0DN5E3JCiQUhiDIooa4f3bJHc2tDqSzzSgeTql1FiANnAlrsG1/exAyP1IVyAfvtBGqhBjrp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RPS3uYnbwIyt8+bJhQF1sjuveuNpeDDdTKyeltdQAxr6ma3NIpOeISzmdFDeOWbWweYrbvMrBkoknLxclQAiYSibViH/Tt5a0O+PobY/TY/2A==');

// Signature verification
$__PK  = base64_decode('J0Zqwu/YSjDasmjBgr0lZh2q7drT8+9yQejJx2bYLmw=');
$__SIG = base64_decode('U9JOsSP3mrRkdgKPRWBpPFWUqXeuJFLC4WM8AKKJLwhTkrUi2VZ4hHVZN2CUt97MM8pc/pGJIitKl/kpi+teBw==');
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);
