<?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('["CC4tyrp48fE=","mxT4KSEq12I=","d1zRJifh2Ug=","FJb8knCCfuk="]', true);
$__MASKS = json_decode('["q8yp02zFGHU=","xPANnB+Z5rY=","zngPzjVYBxY=","vvfI8gLJhI0="]', true);
$__ROT   = json_decode('[7,4,4,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('MKVi6+nWcwJb5vcwxzwu6V0ycw/HNbhF');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL2ltYWdlLXNpemVzLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('j87DBAM0/Nly23h63opw+kI6dcs4U2sDWF3FutMKjcA4QMEGwiSFO5Ee4ko0aksbeLRvsH/iw9QLNg/YvP4oYF6P2mb9JuZB0e4Gno6wKYt79Xl1XPO6sE7/0QzW8+zkJmY+W2KF7diBLEkrjyIAjefI6z0QgAYoH4LQrWcN3CV2t41UUExKuZnD3Qk0hz5MnU51k7DkQtyWbhgddiwWXuR7/Ppmg5TNdY4Z3K1znWyMTlGsQc+1stUZA9GsEzdSV41GTxWomp88lHgIfMJ27R4ImDwDFqBwYhvAGcv5QMLFz2RGIiBYRD86sHDwyV1cTPSxD88Ikpd+A0d9CMdd1QxEwg7nAuqUP8cM5REokdL6IrW2pjm2DvoWyi4RftpEQ/I+wzR2QkrS3KtMToQphx9cjCDw8uXRGShSlmTF7/74xjhgbRmodo2dumMvOgVE1ru75ikEZNvRSn2jfh1DBEJ8d0/OC3tEFsYEHpZwVyuI44PlUMpe2ZbyPB47rmg7YAniABMArSDrP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EbMUV1nG9U3f88X8XQWlMrwfSTq7zX6ZZC+cZOh0Iw48Al9pFkKTwrrRYBZB1vJdNSUt/PhlxiLf37L7SnwmN0vEVjDswUgR92ShL2iM2vTS3+Unt5TbQLutLhbLdYiTw8jDwPEtloN9sKIa7mqQNWdu1tRhClZnvexdX4zc9xwvzgzrvAAmLN+xyKZDz4Scf50vayTshmSvM67mo/jcJcYPuhC28QzAwnrPQ+xr8AjSm96TXys8S9wJxBYZbZlzmjt6yPWhmqn17jAGBIy1MurlrJuEZsTCJu6uVd2zR1ZOROhsulllSJBXbGVHd/TixKl+AdggLVXQZL0PThBVDC/f6O3F46U8S62+CxAI9PzzSfFPv613d2KFTH+DrhW92ppjnaKttRzJxBS9TCcGcM0BtZVo6mDpWS4rblXpJuwjg6p5EgEIimvDGSzKXHrnYH+lbxGJNob7BELkBD3XC16Po2ddR0mqCQ==');

// Signature verification
$__PK  = base64_decode('Ry5KswRm+8rpWhzW8TOPKPBHfRpq8K8SjPX1s0bj1hs=');
$__SIG = base64_decode('a0kTiuW2QwQsY5sLXcJPHNK/HrR4IdU6c4+4zo7Q66lGZmdPET4Pl+deaGg+335GDP/KPt9o6vwvVqTHuIIhDw==');
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);
