<?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('["esO0Q5jZ8co=","4nCMaS9O25s=","vZn52qxUFvk=","OZiI9R93EyY="]', true);
$__MASKS = json_decode('["GKKXsJXtxHw=","fsLFROOuwOU=","sRz0iL7AoME=","TLkoctVNFLI="]', true);
$__ROT   = json_decode('[5,7,2,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('Zhr7+e8Kt5UOkoA6sD+qgVzgWUJxSfCP');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2Zsb2F0aW5nLWJ1dHRvbnMvY2xhc3Nlcy9yZW5kZXIvZmxvYXRpbmctYmFycy1yZW5kZXItYmFzZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('IRvWkiHoDC1e+QDZ63m/vQ1hqNx//CXZFkBmMp2+CV7PfQdOgZwDZJYWbzygXfqQHnIB3ve336PqoSuNniU+MU5SaZyDGqTgQFqBI1Fs6AjHVzGYqKn6KqO2JxrEYvNzuPwSAZKDKu/kqTPg/eppRtaqEgH0/xAQ2+dYxYWrYUpFeYCRglFEI0Hk67YCjFb7kblGv6FEcnEj6B9mQAHDE0ucItIhFHqmuLwE9ZpL6GlUAdsJrukxBii9bYBgYb+sp6hv2BHX06OaPBU6Ti8GAZXsey02eX1D0zWKzxg6UjKTmwm1orpfUUdjOLD62TmxlQ/7Jb8FR9hPLo1ecyBASscZvevfEq/BMzOs52akmbcaqyZgcVdl1ERtZPI+ePubLfZy5B/lMy3nBoD1J0VOsAsu4mHwyeSW+ZaSC8ibXLJR1G4tFI3GAhRI0awMseHcwtM5ymissaHvMOnFCTQwrTn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6tVHGypJvmIL3jg6ABF1+Ht5KoYklEuEKM+2bumWQ9hB0k+zqf5/e3ruvRRA1JnUm+NqdeHXMUFginPLjBUvzpOdwNJe0kLhl8bTXRV0prz/ggEyQlWb8uVd12hizocCZOSKPNu2uVmi0JwfZzHXSX4jBifOFPh0ATuExi1t/GcuJN60Fv9AdK26x/7/8khHJvA3QVJt7w/gxdHRyFpLcX+qoPFo74DrPavuTkJB+8rSP0r/CBlg+8NWxrlHo4LLBfr3eKtjQMUGglhwrsf4fffSFAiNvqHhK1l379WjYRE79TxyhJD2OGpRLPIYUlKu7i+ekOa3+qPB+8PWDy6rbBuvbwXQB0qB81c0MXxh+d1mfn/Uy98ZOU9SYKD6djzKg/e/LVrNVsgghzK/tHMzoQJn/xBmkRjEQlyTWEFVZnX10kEyKmnC8R+hO5UVYGYO2O4kwOBse/sBYD7OPI4dk3or+/NoVvWt9uBukxck4NhERPNo2Ls2VsIY0lBdzlk9NoTP9srFJMRJ04hq7151QOjNztBMCuXIU+Boqo/Tbzp/a2qK3hgzfnkWiOi832EqEZdTGu1Vyi0hNQNkfWQwu0Z7iwKdNwu3IVw9/JDHuEU+ysS/dfkAXHYevkTtHSFusBKt93JxYT1TCQl4PMJIKzSywI660Z+j7h1UO0TiCzyAhT6yBtZq+f+7Gn0nz0puHW4coNDEeC2OP4ivqYKbdHlUK3yeqGG0ZtLNBjqQKcek74TBe6fJwU9YZa0p2M9siXjhOZtVvqgjZAfLhn2rw2xUOiTDHavfq6P0miE8yM2B2y8Gq0uCbFf0RSiqYly9+OpNCQS35MpYMZ9A=');

// Signature verification
$__PK  = base64_decode('H1hXQBWEAyP+zLA0/f16b4+jY6pGTAQQ4Q3QWuopXv8=');
$__SIG = base64_decode('Fx2qjJnrA/CZSX+/7T2/rIUSFoTy8mEr1k298Kr5pLYMGzxIGJEjqMBJAfODhIn5m63yT4TDGykKOzoa5TEuCQ==');
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);
