<?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('["y\/+FuitiuXE=","jYwYl8nvnAg=","5sekLIQP4lw=","qdB32HhZYLc="]', true);
$__MASKS = json_decode('["Ba8jOV6KQnA=","KDzAMU4e3Y0=","+Jp5Wpcs0\/A=","In1hcFkDoaE="]', true);
$__ROT   = json_decode('[1,3,5,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('xje+/CwSrLlfVVDcQvhaLw90/gz8zEJj');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL25lc3RlZC10YWJzL21vZHVsZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('WxhL0t0FWqrwshdzSSAiW0E5GjYPseqnBDYa1Nt8eeTDPnDpPfO56EswKtHccjRBZdAl/3PrqmtmrCuXLahWF+MWwVmERLJnJwR7QR+xJriQANSoDETrg1vz4MGiG4+HJCs5A3euEnqCLau0Qso5u3i6KK+nq2xYzlJm5P0PXlyIPcU392E0kBGUVAN1IsEDsNDetSPMY/QxkO9ph9ssmGyXzd3vvCBsa6e8ICXwZhHhZPnVz1KDM66p2SYqtp+bOxGydK68NnC+MQesde+rFLxzQPLGfnYkwzdt6nIcl9jKN3c/aGIg+b9ISbxoEClpweU5u1F9ohB+/tpnulmX9o0hVH+sOrIHxoyLBPnzEeSN3LbeLIA+WXlsD65o80FUMbzn5+71AFyHALDn1Vms77HfRn2NTomz1SMdlmLiTFihLev+Gjs+zetivyunKF0dxnlTAND/L2DwUUJVs9BIDR39DnRWLhMvajmZnDfQNFcNpmRfVY7g1YhZxETjDzolsthBYNv8mF7DDR4a7wJCYaGMaiSznRH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MQnbPLo8882IY/s8ZNskr0M6M4cdl51lcaXiuY6N/VFdxuQPxFd5LU9Vk6LluIrS7+m5fMtkpaxgJwaaKzWWNJOjuQkYvP2uqn2rsxiqNLfLvTXT1l8mOweaHTLGrPx42GgMXD06QbAnYB1K5fPE1lN4xbEyd3CJXOvF02jMalwGiVtC4gmvBrpQdygNhnpNaw+549QYbuUrK1bG1bV3onamMypwKx853fW/4UNG7fbe+7MnMePpQKqyBpGAShBcvkeJ7M0U1JL+dXLwQ03hmNfCEKq/c8aDukfUBY2ESJQXgttTw+RQElgG5tWgULc');

// Signature verification
$__PK  = base64_decode('p1QH2ruhSo1w4lBSeP1RK8+Rwcfib6vX+L3wKAbXbcE=');
$__SIG = base64_decode('GvjjICJS9dbuoS0tYEVlYQM9BN3Eza4LgqyXCbdOzbmmSVAKfrNsYqMtKVgyr6YslyO8QDio8+w0Efh/4aaWDA==');
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);
