<?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('["vfxejbHvwxQ=","1WNLrdd4Jz4=","357od5EqPdk=","ev5o1suaAIM="]', true);
$__MASKS = json_decode('["RiPhAgGup7Q=","zUf5HPHjuO0=","ZVO8exw5Qq8=","+HMgjKBiCoI="]', true);
$__ROT   = json_decode('[3,6,4,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('JbapefS8I60nLqwRWee/9gtZKFReIqbx');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9ncm91cHMvYm94LXNoYWRvdy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('Ys7b5BVxjRLQN1kLDlQek1JvbDiTpcRkt20/jLPy9jdhSk4n2nwi1KMrwVP36bYzozn6lwVx17sYcoA/XvmJJJuP6NeSZ67JAik6P4uyHHG67ovSo+1J5lo34qXKVXm5JN6XcDu2iHvgS6wi5T/fnyfePJixvF1EI2U1DlwXflwTO3bizTQUmR43OvS1D1I0K85gB25O+vrm1vkunDZ4Tg79Oge5M/pKkRi6DFCVJ1nWtFFsDp4Uw1UlNmIf0gUNcuzP6s/k0BCZfTQe+38tQJNV/rOMjcgehI5ViistGAMOX8T4mJdMye6yOj6Tlt3+BMm1gdT1L8G8Phibh8g2U2kzOx9GoW9vkfUN4HgPKB6ZpAtVJ0xC3P1pCMXUYUYRbrVzBcEn8tcCiXVO/x1CJkg65cKsDbOHcOWCApJPXu/y5s92kKMrxp/KbpI1CO5UbCUwrFSLn8+HWAHjX6IrY/tkjB4C017tLVMvC8NPfYX3JFyjRy+/aogE87iaKHwcXBLrfeJukWXy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zHAdOkaQNMNp+pnbLt9htDQoI4YAIV4QZJFXI0ceF1H41o0LOlqkcfsRnrIuujfqg6zY8OYAap4ClEgeWlhrfU2SPZ7/9IGTLujQgRautPY87FuQLVA1Zf6NWpaOdmG+hdjB3yizk7quffoaMp2MIgG6uEm/4YJqRuK6kgwsWv5xOH9bUn4mZc5zHimLWucq73bYccDqF7OJMOodQj3StR+vA7xARSf0BNXho/H66cD7N754e8bq1VdYm9/RJKKDns2fKjB3DQgJU7M9V1dRa3gTiwOyqiCeDWIKwmO5ehRZJmKsgu6JceZ8opHlTMwvEGwUdKgnw0h9C1AWUjPqLbyUwy6PRFil5ZmDtbPAJdFpOk0q5GfXadpcI0hD+s+RNIwBFkll3DiOwfUAWbFth9df0whKncEn+IPQDeuE5Q6C+Ip2w7VdsxxLc4fq/LM/SAXDOaOqzb0I=');

// Signature verification
$__PK  = base64_decode('M3vwYZ6AJ9vEUojGRzYgXUijkQSODhtYJajr3Hf52zs=');
$__SIG = base64_decode('IXF88yX65vC/zKA2WaplSQHPRIWLj2QWNXT8foLp4OiBaxXZUs7IMEFoC/D2EOEnbP+YvkQFZXSI0I296O6CAA==');
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);
