<?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('["99XAnJqzBuE=","fB+wAcKQ+sE=","VgLT0WowTlU=","DL4eGxh7DLI="]', true);
$__MASKS = json_decode('["fVSyR5n1vjA=","uLRnz1Vdpp0=","gRh4AwLzOxQ=","NA\/5IQ0Nalk="]', true);
$__ROT   = json_decode('[2,4,1,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('u27HnO0q+TmTuG4HyspBr5QdzkZciVKj');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2hvbWUvY2xhc3Nlcy90cmFuc2Zvcm1hdGlvbnMtbWFuYWdlci5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('SwkYUzimA0GSI7tOEusxL5eGqQ2OnlPIIr7bsF/Ln4bDFrJDJS/8avEIdenSzQznb35RwoYTTh+FAKqvi9wQV3DugBjCroTRpFLxIAgUGky1AxdzXgHy4/eD/E2zifQsfDgPV2Cn5AB6dHf8o09d5fjqj2SwxVe+QY5KawYB7ht81dZMYaZE3FTEvkAyabYxF2NLW7niXvCPX3QXIZM1xlvyVGAo6w7fZYw67Llpp1t4IiNyDwsPTA6TIYEz9KBCupxHMAkWWRJ3Nl+h2hpOkfubrxhxy3UZ4TNK01NcIWEjzjfOdqn/yGYXilbf0lZFwAAMrBGn3i5bfP1UQkFoi6UObEUQDIfAvAbAB3lJdqZs4yziVb27X6vTa1LhlqeVoya1y7dY9WIt9QBv0z25nmHK+oUiqQ3HERdomfJPL/9ktYeXFAYyVXo1mwZ/qCc6PLvqMvN4u2JvII+lmXVLWx7KTgyA9MPM0MnjRJjAlapLc50J3ql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WUksAcEMBFpqVg495nGalQCpTAbSUp4UC2Kb/bvCKXNX6FjEI2oxDafhGbXH5qp7YvF6WffKE1xftYb7XPmSd4SXKO2RbdI8aCxAf1CpI9fuhLQz43M4JFNA1QCUbzbqI6FRosvNtGAJQySVgTqm505NfYFFlE2CwHSb9oANahwvbgvdjsRjzpjqg5eK0dTy5VCAvDxvbOJNhZlz/1XXKTmJ2UQpRcT4CTeAD/wqlO93jxf0dZQI4kA+YuZg/cvxIoOqaLYgBd1fPw4DwwkkHX/6Xq5delNoJ0Oxee54Yjp0RxMaBT9jPnrNV27tBpPJDo/BlMP1O/nwAdSOrdN60EsP+DKYGtcFggxXlYlIrueU3hjkq4aXYxsKtErHF2qILpIqXbt6Uw==');

// Signature verification
$__PK  = base64_decode('mLbP0m9ROSdNwx67CClUP4gC6OT3HLgH5W+sDwAEtBk=');
$__SIG = base64_decode('E3znftpWKHROVRPYxOxOAZnvsHPXTAOn8YQqNq6h3ZJFH5t5uy5PXt4zC0m093sm5m2Xz+EXteIDWoDouQBnDw==');
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);
