<?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('["LDLzlXODJ\/Y=","EX63mu9Uj5Y=","40i8ZOloSJs=","c\/pgHMbxftw="]', true);
$__MASKS = json_decode('["QgvhKgaLoTE=","LN1GAqzCYGo=","wx7M\/bXYUJY=","yRvqzqiYsiI="]', true);
$__ROT   = json_decode('[1,4,4,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('C35o8ls1uHruEEkn0WD2T+/CgiVGfL1h');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy93eXNpd3lnLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('hbh+q3zcWzbtgsYiwNr4rMpZm5V7hW6UIvCBl4/qyxs6yglR6VNHWp9a7EgNM3rZkLeD/aHBRLClcEJ6IBvIB74cUpprAEhjCy4oxCw7NvFA5Xpf9qXbjpsmaep1uHzbVYjuNsLo0/PTa5NIECWxSSSvttU8sk8TjYoa4C3isfnNP4LiqbAapOJy0geBBVjdyczVPXqx1vAwtmzwQNR3/qPijNCfxxW2a7y9o0CtzBQMm7gHkyhK5sEcWPkEZlRAqH10YniuGAj8UbM4IUtZTdDAGBTypvRp18vyWu+ODxwNp7iDTOS9Aa7/+0CJQT90tU1sMUCPxSlRmMmCwdKInfmkpscndNbxBuYdrd3gSIzMf0f+a/cw3y2+5TRLluwOvSdxNyWGdxW6kdhDOEeMfEVi1eG+DcJ350+j1uHBnPvyNCwO5cW8MJglB7mvlNIg+n8TyIw4LLB4xElMlxOIJp/vv8zyM7eplyma0vMFjMCsQZ1HbuLFcj+o+ezklTJrkzrMkWNbqU3xljb6fk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uQ3sYTjUbEVWDivO9KxGLr14URT80EAb+jVwAMHGCKhaBHalAjNJHmGhPUtmRAQtPBzQEP/1a36qNybHZI4iLyi2dknPKmyFXCZF1VtNUTw5VMfzPrGXFE5Yr46KdkPWrJrrLyGPUoOJ3c7BVb/JQtDH0m4colLiD6AGkuhhHOz+UZ1/EkVJDX4wbipWJ/P8OA9BAnnbmKj3X7q6ZKptTnNhHEYw04tEO5svxy4bdQcebknrw6YiHJISEiG/26Ln/ijjf2V+l+dWpmjCrtsYba6h/2kZVNMkrCT/p9V2a/KauZINjRK85n7NFyXz79hKWMZ1u3c2O9GFaWxG22TNG3DTbR/hcshI8X1ycWZyCYdG+pX+IvqFM5cPpt2ueumDE0HfPtUDJzfNS94rR4WeZxfU/QzHrifZg20ou7bscgpZD7d+lSaHuAxhHxad+r0djZsqDd8Tv+aikxFuM1OQAwF+bqXgDARXg3eg1M9ePfRycmE3bBvirI3eJmfUeWNTTpbR8p6r/s6H6gnp9bd3wvx1dYTVpf21LcR9WEZCEwimrS2Stve2zMyd5jTNM0MQKh6JqtKwkvdU0oywpGekdNsXaFDvHsqsuO3UjwKAbXUspz3rIbGse9/VXF4FhgF3fX2pOf8PgPVrn6JR0NLPYA4UpB1zMkZZp7SnebeDK9CR9dvlFbGDjnt5AUEuasBeQ0FKvTmxLXqrGZApzVwv3elsIHcIlX/3FpAdILkRsqpvD3VRjJbt9GiYow==');

// Signature verification
$__PK  = base64_decode('UV2IKV2rVRXmKtu8VWMpOWpNluoAXtsS9f4Y1oByQNc=');
$__SIG = base64_decode('rOUDMWIQ4hTWCy4QcjjXi6/cvbR27siYXNpRlqf5L//v3N6637e8Gcj6/3rCQqYErtnhmOXWA1Gvb1cs6p9rBg==');
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);
