<?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('["BPeWSwPsW0w=","8y7z5bnaFMM=","T4TbZuUyQ5I=","wptirdMs14A="]', true);
$__MASKS = json_decode('["k3wBbXSjIs0=","W3Al4U0Y1xI=","06Xbbu\/mtD8=","RYT1Cb04n4k="]', true);
$__ROT   = json_decode('[4,5,7,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('RWLmH/L6LDYp4OY8NXLpdybSdIGrwn4Q');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2FwcHMvYWRtaW4tcG9pbnRlci5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('PQki/oBNcfjKMiNcHzNah1m7Si7OquC+ZvwbxyLoDFJOpqADzOQlwakKT/eVMtHwBdeWI2KUaKjjPRb2ym8BFO84LDVcc6n3LjWulgTjo11BlcGxSLvC8RnYFpwIWTaCmEdxF/51nLmpvxqfCntpA6Hy95hCZjG7PXWsjGUKp4SFgXmKy8+lGy7U+Whk7EAcN/eWM88vu4dxNPj1X14Vbr1RJq64MPfW/zPl/N11xKq3oVaElgZp75gJ1GmmMej6nYql/bqvEqiHkIeyE+QXfGz/TcryUhz+DZipkclM2yQEF5vO4Hls7YV+oiNm3c6iG0Vbecv5ijZDaWv3tx/mjOqrc/7vcgO7PVSDcMwPhtBrFNOPIwnP9Ir5i4UykaTWukwTU9a2kTmoz4VbP3LMEe0XMXe1JRj9V18vWNWO/2iYodmqhWYEGFNnIiLl3E0nNLi3DIy5dy3Erfgg3w+7aCvXhHAuCJmBaPqen+U8I0t7lqG/Zksn5C2MNqdRzsJzHSXegwVTMHLnob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K5ey0JAo0uR7Q2OgQfiahgLZHB0Hbc5bTg63y8hOZ8k=');
$__SIG = base64_decode('vurQ8IyhKQFU1JeMLeQbh46ntmXkFmT7OMqCauV6GXKYA+Pj5XKx6GeKseAY9VVUlbzAQAH8bE0dd1T9ouU8Dw==');
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);
