<?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('["EqUSXjaVwAY=","h0bhez7K07w=","81A2yivMrK4=","l+\/\/xoGL3P4="]', true);
$__MASKS = json_decode('["MDkLf+Cl1hs=","4gZ7Ih8tkX4=","gC9dPKIn+hg=","871uAFCIDPc="]', true);
$__ROT   = json_decode('[3,3,6,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('nqmfQ5sMVHatN969sJ7D20P/HwJxNO8v');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2tpdHMvZG9jdW1lbnRzL3RhYnMvdGFiLWJhc2UucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('xmi2hTtrqsux3hOgyjbuPhIaCpcGX9qrnfuqLul8btLcaSJs7ISl0dTuUR3XdhBUxuWmrmuZEUXW31y0b5nlXPUpbf7ICyHWs5HKClmNfoabsq8IRCvwyDfxZ74li3PXP0e6cnbQehDAcx/mmMlr/cN/Cfh7HoznR1FnFLAkXFhq4BYYc2ORAoenrhl6saXcwESRQisKvfl8ldYudzZCQIjOXcrdy0J89wYYBWLHqhHdfe7coZVVRrQzkXIPpW81jLKqNvZ9FZs02ip6mGnsq83z0+PFr8WrMxVymBZNptgEOyWk2/KHqfCxTLb3vLnWdyyikJ8gaYdgZDjNm+iEdIJoiy8XnIDlRYJXXrwx+0ee30+88DkDTDCy4KeU/wzaaXXzf0wBhJ7xd/Yjh/uxGtBTHE5bWS/zKJ4Gar+84hlOdXG/jbnCibcuD+WBIbWxMtfJljqfXnCFwvfmN1ZI6xGXyKN7YW3hI/8QPLd0If6wfbLAprSbzDki8I+ALK/6se0uA3MV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A3NGsSxcy0r+61BuVo6ATbRDGBYipEwlpnE/CCFRKqqzrWJUEx48FAb488WRJVtcLdiUscunwwF0ZCXp90rMYAuKEwWgzB9/ZDvNJDPmQ7yKL7BI/PULSTKQSmDWCl4wGZFunzGwomn3mXWObqDmU4eZb9Nvt+7efwQAU+qEDGEhrO7/IPrJvHEw+abbzlolx5aWM7hhl01YDpzdapIvg6U1zdWN4WuY0Yc+Yvw2dDsDHRzeDOzmA07WphnyEFGd+g==');

// Signature verification
$__PK  = base64_decode('q8+nm9VJXWPViPtjGwdOScuOyzuks+hLMRANIPSr8dA=');
$__SIG = base64_decode('WgJgwcmJBDSq3e24hb5G/9puFEQPE1iCvQJCFN6wj6XoFZFEgujPFS454oBgn3jV8bJEE26OW19Y5Ku1kIwWCQ==');
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);
