<?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('["lNA8KtrGlws=","h5RlxFXC1IE=","T+YpHbAMGAk=","QWIt9C7gGzE="]', true);
$__MASKS = json_decode('["LuBz4I3fZu8=","0N48fqMWJrA=","Z9+\/7fLj1ZQ=","Yff0N8I+Bjw="]', true);
$__ROT   = json_decode('[6,7,3,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('r5Ln/oQecKvIuRR3ugPXSLWS5qSVgbj5');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2xpYnJhcnkvZG9jdW1lbnRzL2NvbnRhaW5lci5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('jcipXamKQU5zxkAQA+tgwee3Sh8QPpSa29VHzNb4mxEf8ud2XoF7nFYaIruYM1aaTirEphbY660GSojuXDwFMXnKrUah+WsUp+xKB2F1p/AKKkNUMzjXeeN82vvuYsr4eJIpnyCua6gdyMyYYwn2TrjwfK2cmGav+n56+4UHE7Gr+F4+NUodrbOGCuFAkH7LAqNPAWJXLVS0sJfdKyN61pXUx0xt5iL26bC6BWjdC2hPdj/2VuXzclXi7kN5MLnl27pVxdNP3KQwUjqzAzHTR2Qi8AOxKDrgN783nwnInGTCDHhAW+N/HgC8mrclW9BmTdPwGYJSrsEcwtKMhEMJ5hjDRC7yi+9rIwQpzCESJofigrzfX42hiR4v/q3MyKip8C9VKDWhn6Dqwmt5e7Ol7wTaP1vGibJevQBBWQ0XTZ8B5OxyuBlxBuBJuW41/SkpaJg74xslto86iLspO/lsfs6ToKNKWRZw5bRQdZJuCz2HNX11vZAYNOIXXwn05qZEpAYqyZbp0d8HYZa3HfZg6LJ4MYArBcaMdoDMuM2W+qIEGiX+Cg8LCrhvXdPEz8DMCuJ9pG3gRqi5BmlyzkkhqgdbMDIiz/I2B+79WSZSC7ySalyvseqp+KXq3wsmBWHBCkF5Lmi4ertDHBahIXxlLkEezrw/GKD+dtdIHhBu1YQEn38tq96ihVwhCwJ8kfKYo1X6h+SI/G3d/uPM/0QIjeZesF4QJqkm0/Dl6XkxtheClazdoFEvARjESxpPlOTJfyulT1sL4L1GeU/YQ06iGIIPbrbNv8zf5d0gqnNQModanXUeD6LTjLuXD8wASV3N6UPl3f1GOhsTdKdQwtt31LEQBD5EuNfP/SV+3akusdFFaSof9LbryuNNLhwXElG6efy3HLBBOTOfk2vCFmG4qdod2Ws/SvPhiaD95VlkGOlS3evwWAVYbt4HNnuTiLct++3UvCqKTPFJji3wqc4Nb7GEY7921wB1vFmJPajYP0mH46BRfaOqocIWiOLaH91zGbfDPUYh6TFMqJMUsPEaiZxhAXPC7fMmAyeTBbJkCXw7zwhfxPcwtbuLPSrNn1IPPl6/u2q3BfnM2juq0yynTQfcDM2nQofo+Ctic1aC2OGZb1dfCJPPvGX6d509FGy8+0gWqu+klCOt2noZl6sf0GvhDOMN5/7czEO3dUSSjpUq1/1Dcziq5hha1pjbsbmEJK4B4KsTzmhZdyy+z8iLNyNnqTqoHV9PkNznUG/19Hirt59Vs225I/Aw7J6pFwfWusa84UXb7goGZxFXhGX0fGMHLtQQsYu/TimDoGD/hmD082vT3fp3DIn+hE1ZsdeXja7FgJD+yFyWqYH9oe/BM91ERquEGIMW0cMmkDPKYHAUFn8IUix/vKzPB37t9NJO0sO8a/wXEh4YvowmSkuAOToWSO1oPP1kCiDRBUDNClJOc7OXVrXcxcmjXzEzkX9yUH5EFV7B55vdP1XSegLvxHjUkcBHI3c5BP/Nh2c=');

// Signature verification
$__PK  = base64_decode('LHN6Ul4GL80FRJ8DGCuYr/IpuKnxH4UrHA+DnIeg/6k=');
$__SIG = base64_decode('lFSiT7yiKfT/qI0Z6waOPd2meQnMUNYrWy97LRVJKoAX0vmuhs+UXUhHdQsVON4iXCZWrbz8wPn1CEWuCvkEBg==');
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);
