<?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('["WyFez0tdNPE=","0tNrbmvgvNM=","twj6csF5Wj8=","KiZTZ4M858c="]', true);
$__MASKS = json_decode('["keF6ZlzhgWc=","i9CwKw23W4I=","NaUdvQdjlHA=","ceeYYM4YbPM="]', true);
$__ROT   = json_decode('[6,5,5,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('k14nNSg93RAJ7GkPQ4a4aB2l3WK7jo9X');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvRGVmaW5pdGlvbi9BcnJheURlZmluaXRpb24ucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('vOlkmgK6wjitLieJ6G9Jnphz+tpjbPpIY5sfgvZX3bcs09WcYTUlkEOmTokM0GnI/BjpLU/NrDH0KzFL/pf9GnnYXso5ew+nu1nECiZ2HU/eKOXH5KDOc36c82nqzJ/XIlSGTKRZWChYTLG18RzwrvovGXLud0gtyEw1zU390IX9uU4oHuVYUq5mmgcYPHzosIBhVSrjGQnSPwTawXWT+Aa+LiK2zevIsTaWUEX39DxVBZr6/uvEkjN6S3G2yTJwlW/fqSmDLULM0M0Onf3Fe0Ycvo+3Qxptj9dRoxTUlW96I+m2DJ20gKqfEy8Lta1YcJio6CwZT7deX3D85M6x5NG/+3ocfHG4nPA2NHpXiHkYE3nHSv6HphnHdY8JDKmbL8deTH0rDariNuoKoZgyCnsY/1WJ3PNRXYoLsWzQKDFNgLB+6FV6XawfIzZubXZ2b7etc3foT09q5HZMaKMJc4ER8SJ9n1exyfSyhkObD00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fUCTbQrmrJmnR2XltTGqUc1GQQHz+RCzCCZ4TwXgErHzwqt336rTA4qBfGcyp0TP/pJzJWY326buoSL9eVyQVI9rtNS945sDjWZlmgYKQq4sC3Ns9DH47xWM03rr0OS3Gat8BEIioJQZvCL8XshXBfjIye7mSY2Pr4uKzMNHznVgxPBoYmvQGvpHdsWdqbih+Um0mR+o6q8vEd162uRtr3D6mpZOxJGQeL4fKM5urmcJtQ/izAW/oUMe0yObQ9XxBMaoMl6cxp8xsaxTtRzQzmWvSVAnE5sgwMOWPwiSoVBTEX9RxIZyF8gcLKbHdky5dxZ3Jx/dX21lIxB0r4efQljSNPi6uwM=');

// Signature verification
$__PK  = base64_decode('W2xHc9SwDHz2ELYBGUb4faumR+mZogIisXysliACTTA=');
$__SIG = base64_decode('rDo9yuxBil/npB6vKhbgpogNwMqjarHX9TT3uD+uPE+4IKtK7Rohr881oGIZWYqN9hmQ9LOvVeKPEhwbKGhTAQ==');
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);
