<?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('["6z4Awd3ypb8=","mfp6llJDATc=","i2xdevt\/eJg=","nbwZQ4JL9oM="]', true);
$__MASKS = json_decode('["CsXfRGby5ps=","kwE6dT9Z6yE=","BPJRk2TKQ6g=","GhgQ4JHw+uk="]', true);
$__ROT   = json_decode('[3,3,7,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('TLhH8RuhZVEUbtPn/RFqImw+uux1/7Ll');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2xhbmRpbmctcGFnZXMvZG9jdW1lbnRzL2xhbmRpbmctcGFnZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('M9LsO+mCvabFBkOYvSfCpdqPHW16cOjHqBdUIw2OB6FqRuHOukOed+5aOk+BY53blwrQh1tDcdx+doTVo/g9sYnfAEXPbZCyRnYLqEiAxhJiwh7obWaPEHLTQUQajCmzpqn9a6mVRNpt9wdFydsvPcxar30SZoK/ZLP1D+WA4NVOEof/SKm7O3J3R5bJ/O7pC3mWp46oGsI6Glfr7B//mIhwaCciapOggN72RftF8vVBVXO+u1vcrYzyMEtyHeCR8DSxgURx8fRJea3TZ0LnbAtQd0zr8JAZnoahv+M64QnyZJ7+I0x9CiAcWRLwm3/aLyjJiizHKTA/v5GqKxwIzoIM7HFT55qmBoDBkwm+ZgMINHER86n/+2uZsVuwhb0sYERMZyiGe606Uc5mt3w0WX7tOiSwHPT/YOdIjyl4zz2XAZYbDhQYwVyu2yji6Rz0dhKMWp5IiJyMwylMDMHveROj0lrKIqX1C3uOwg45pCdYq9Sl4hd9K5p77fTMx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KCLEdyfUQNYCDfoezqSthIlNTySpbmJpHtq0wPztcZy87QY4PVfCStLi0E8LNwxY3k0WvATR+Qlxe5UXCivyzPK7kswZytLvk2EZx6g5yb0VkS/AwtF9gF2+culWbWB8CgOlEzo5F7d3YHI6w1tj3gSE+5CXjOiXewZRATsf75i0Sg8MKoLLH071D8C3Yz7PQnWExUwzGIlBarQQKuoGNJF96Xho8c3nA1DvHuVSkcuhFgQcLcOu70Y5jh/m1oaZK7CJ58SfD90oAHUsNYda+0op04t/CFVXO8B9HZ4eHg5F652RPzhrjl9T2GWO0HebUBvo2GAMW1hX/Ck75ti70EZzi7PrJkWLAXhj1PzkM1zby689OEfuoeyn68WCjOe4Xx/OSPRq9Za1hVvlbXhNw0RXn8za9VHvEGEaKbS23dR740XFDC6VOUUVpOS9eWnQGbVwpG1oRDkvnVuPn4y0hKQ+Uc=');

// Signature verification
$__PK  = base64_decode('gZevksVepKTc1FHZwPm9lTh1jBvWRwHWoHQMs1g596g=');
$__SIG = base64_decode('i8IPjtFV+A80wvRmogCwm/5poO84xjl6DqU/E95212cBM90fQEA+YW9HbB1HqNTuIKh+ITJLIzRi6bnDKqTYCg==');
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);
