<?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('["lBOu700Qn98=","aLci33AcbDM=","zm6DEuIzT\/U=","GHYalCv6LPg="]', true);
$__MASKS = json_decode('["O8kzA66dJbI=","bVQaaAr8hRw=","uvyElLJVsqQ=","9+pQXJJK6Io="]', true);
$__ROT   = json_decode('[3,3,2,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ray38VxNQk9yAnzqAjqDmHDme0LUsWqv');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2NvbW1vbi9tb2R1bGVzL2ZpbmRlci90ZW1wbGF0ZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('2sFaGMP4S0FRf/XB1JsQ3mrP+vZHlFa5YLI6T7gdzfogYQxtm7icvFy4F6d8PRnzhw3j+YJBWL+YiGog7NqFXpG8icV7Lju7aeeO4/kohbsHCkhfAAcpToBpwV13BjX0R3XB1JYb1PuSaXBKAyAk8bzFRuR2iaItLtfns5tsneLkmLHkBFogHlgIIrjFpr8ZYxWoy5GAbDE+Kna6vM7uloDshP9U7Ehz7e0610KH8uKAfmfEYDBT/mq/lg+Hzl8gOuKpnH1LN+zCW2B/lLAm3zxgZaqQN5rSkqvBowD3nlxMilxQoLtcxoWOjnlgLQCEzvodo5dmsoxXyuxqP1d32cSBCdAnqW8QOUX6vYU0bMyj9V9uhCVC78DTcq0SfSHs6Pu6zjpMWTzN+VG5b86lfGbu8qjVqI5f9fVoz1ylj0QLESNM078CAyTm3b7wnznzA42mWyniUMnU6bPR2R7myCyJDBGabW3jCRjELfNF1B8tMpZNg4Szps6yql8D4LabsSojJYy5aY1sM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mILY=');
$__SIG = base64_decode('74jJVXHfbuDhgZkRKy9nIncJ/ERRdvNiVfFGakupWz+M+nSc2n7BDoDtFqzUHPeVenvO31gjV2hPjxKQGOGJAA==');
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);
