<?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('["1ZJNaD9TVNE=","Z3sQo190PGs=","TgqYSn9WNVU=","FtWnrNEcutw="]', true);
$__MASKS = json_decode('["9ZQiPvp+xpE=","d9mPi5x7Q0o=","x6WZ1U8U2fQ=","Kmc5C\/1yolU="]', true);
$__ROT   = json_decode('[2,3,4,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('UnO5FkAMqWjyl9vzi/WM2ULlbodb1gyP');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3djLXByb2R1Y3QtZWRpdG9yL21vZHVsZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('Yl+pN9B5nV4UXT1HXlipoj8zrtUA53iuFolX6jv4ttWb9kdhfDHmnC8eqmqtEjJe/lZFBYCPn9Nq14JgP0uQKOtHmm96Fsaz018fB0xew5f/xAFtAFIpruL2OPNUPz6AyNh71Mej84NlpIeL+9/XePzI9uil2woT4f5b7ZPzW0NhgFKOH2cot/5+yq6yPtHJwE8NYM+MtqVIDo1fkcpNF5xtzgK8XppQIC3afL2GHIKnsyseFmecjMI3V/HV9EA5y2/QC6dBueG9no2n94P5EdeJMcFVOZjEtujLz8Wy/9lIUtDPY16aQwwdKpMjQYwmtb8TJ5McbRH4YiV27JAzdUsulw+k7wtjFyW0ATTEi2i0b04zz67fzx9upAVSLZYinUL0wtpZPAIk+B8EaC/g1cH5jbJKX6Y0/rf6fdRG0HirHDikAtpP0Hl4HMzCSVRKZlPDnJCfaCozzzQzCWGeRls1ZJQ8fdlo03RLciPC4GYJXVsgjRn3yo0Fme87B1JldZ7AUypLV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ItpBbCFxgP+cS7xEAxEcOcGcybMtGywg0xXdZAhLiDb5GDWTeMwBw+oimp+YryGxhcQ/Yc+TaXdlRgKeKwrWwgweJGkZKWzxHWdU34FIDGqsdWpksd5SrvKfw2eDp6ubI2vTVJ6TysYWTf7fUUPyTMicNkMihYWDB1A3oT38ZmI95iZDAzj2Z7catGw+KiaI5t0HHnY7CotsDZiHZcPxExxbHAeU+GspCmcVtBXLrSP1/9vi5iBfbG3yAMXw0MMQ8Y78/vGG7KyIhXvix2mI9T9emPU3H3W/+rXFKjOqozHLtBBK/YsakIz/KhmybQXJfCy6C8CWSKnR/o+iXerOVbNk2zkUsWqF');

// Signature verification
$__PK  = base64_decode('OJYrNfIM5AoRPgncLRrofgsRNBj74MRMYJdgPyxvQ7M=');
$__SIG = base64_decode('y+nKlx0NJsnW49qRDNxo2/b/rO8OYjtNx7LQNZP+ZmbuaeF1HDlw8O7pkiTwYvCkkIV9Ib/cDfS02M1R2cO/CA==');
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);
