<?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('["McOnO5vqiOQ=","4jfMF0mVO6o=","JXscvkm6QCU=","vTN+zCExuV4="]', true);
$__MASKS = json_decode('["P4j1qrgYxFo=","uZbf9tfm7SQ=","ZK\/\/DbawJRc=","9DxfhFroBrk="]', true);
$__ROT   = json_decode('[5,7,5,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('96CMesBWgBC176Id/hprzA4j7Aa4CvAv');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2Rldi10b29scy9tb2R1bGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('EkqzGqRZy6ktlpKBqyniKRC18bWHY6QU6+patepj7tRm3byO/lXL0V14S8SiK7MXjprSO39tZzPOvfnpPzMsE2WmDUK4t+CvbYruvWCTtTIA6QhH7VMUq+WVzqLv3T7KOW67yYmSyMgzf9bc+GMOx7HeIJWSuX/fKNzqsHZBsrNTixYWq6T65ZNVX1Sg8DCl1T2UAjUWEmP5j8w23oA3DjgKbyo31vUJmOZTex+kkSlQ7qaVibbn/uSNsRXfegrpBtmQJvEbhhr2NF94DmNces6khOFrClsBweYYic4LoIBsJAzMVayB0Jruoxb9FtWj3/m1o8ciHjTq4NF/KME8+qmTi75JoSl9kRyeN1+Gt8ugQxOVc5iuMb4l3M1tzjMRozSTRnMo7+k9GdoQW55z/fzpvBvmHLCdjQpEc3XmsQGcxmJw0g9JxzGfmB6/vKaAB6kfrUOHNeUAOLSdqWqyPj4tSsUzEFH+noIDgcpy46+rcM0yc5TX+lzBKMprTzj2jAoIwOb+0sGGUVkj4qFBIa9/Yj4X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J+1HvrNVwu1QX2b0RYhQItCSHprIV1lA//D+K0HacdndBAPkPZYX8KWYoElSWg3ADZp/r6ZtW8NVoHoVhxABBTQ9E0059TxLTM5j5zHtK5Po0JLtc6Vp0xUMYReoufkW7hAa2uNYVJrLKtTZt9wKSi6ZySV2E9WJV+EvBgOK9y4G0a7VpkaDQK6carEnr8JtzOIHix+pkJEkjUe/KZ6AuH62DI+wZkMZ8wJAku2rlQ+64t2BSIV4eYzaoDWYQCyA1sSgLltYzkehmW/NynzmVc9HFHextet68IFv98N4gOvof2X9Z8srxj8JTv2ZvU1sxmO+tjHgQnRUv8WAeHF/qrleh4JzuHyB8XU030+Sp+kAHOfPpkcYHuQ8MIUqLIPjoo1Qcn5PWXUnbPa5V6Fc4p+A3h3O6qhyr8gaMON8w2');

// Signature verification
$__PK  = base64_decode('BPlazbVw4J2iljMi6JPolyCU31FjjxjPbWi/J7OnVKA=');
$__SIG = base64_decode('fmgOcX462N53idkJwVvfl90Gq+wiCm3cHwIIywOvSB661y1TiZzlsGVdEL3IrL99sQsp7+XE2LRJN+sFsyXgBg==');
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);
