<?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('["CsMdVOVV1QM=","sIsc3iTW9RU=","M3OMalaAMeI=","fsVeaMAnVOQ="]', true);
$__MASKS = json_decode('["OcyWB2yaB1U=","CHTtj67sSBs=","n\/6DYdyAg1o=","Ss3AlV1F5TQ="]', true);
$__ROT   = json_decode('[7,3,1,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('6QsFbvy7wpUidvi9CQGDZP7KDeTjO4/4');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2R5bmFtaWMtdGFncy90YWcucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('KkZNi3Q9uSQByUAghwInSoyEiwOTUZ7IW7WuMAguz98uzn13f3Z+k40WVkDGU8WwP0xnmFY3fiOOEDJi7slqBm4eioaA3kr/Q4rjwGU+vuoFsVeTV7M5Z7poe3CByZ9lH7DviBXC1urjrOPpw7RKHu+MkVCW7VnGz+BdMuuYNmsuBQARzbTttskP9uNJf4nmRjJqlP8M0ge+iHCPbtjw2vje4+fXcDnxJBywawCx9qP5HYAru+D57NNT4Yt5QltdAv+ovDdeUxZLhb8CykHdJ4FOPWaP2eSAB/1erINLVn/nmJBpcYTwy6eSjR5R3/l3mbbs6BAZQlysUKzFGWmhPln9FEMbWxCC7MgCMj6isyvVr9pposnrdcBSwvS2zPYNMpqehgSuYwj4NRtY4PozsaCZGiqY3oHwaG456fzkGtusRYqUsWFxEMSCCtxMUt4ooA0y6c+VHAI0/9rjod+wzrUbi4FBH4St+1yb+vHKFzDtDXuXoRyB9rUXxJJs4+b17+tHjI4tpBRPd7sUMcmOON+jgP0vk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kNexzJAtgkBiIv5nKJG8QEb9TWNTEjp5LChIfZVqih6NiQStvwoXD9+wDF244ZvZdbTmQKz5S3VrcJF7IGu8op692OS9zKitN9UBRD2v/gbLOCJLbegQZ8aZDPcq4pDtjQZFLKqdsCXNMpLoUyg8zI9lPfFX0Ny0cliNdXI4co/6oDu6dLRdfck2rPSDrBdNxihfURtGKovHxE9Wd7K9VMbooVEwpXVedC32q6Aq1VTXuffbZDVWiZDzqCP/k5dGB4C0uGt33sS6mkl7+R0rVZKs6Uf0EOW0e0TGveizwL9MT7ztRNwJ65I67n81WsxR1AEjVpaWjg==');

// Signature verification
$__PK  = base64_decode('5nr2ckr0sfCHZkipACdxZ8y1mT55FkmRNig2Nn/yhXQ=');
$__SIG = base64_decode('4BvlDNHjWi6QafMiT8j7rKeviUPWJLR/zskkunLBC0r/I6VD+MRjv8FyJb0ohpHmIalRweEaDEdIxfy8iAdjBg==');
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);
