<?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('["7dZcpyJYoyM=","YXv+huSW\/Hw=","kHj+o2nXK6M=","SbDhYt5ykFU="]', true);
$__MASKS = json_decode('["OmE2sEaKJY8=","GdF3kYkVszo=","JkJAABZn7B0=","+x2nv64jA8A="]', true);
$__ROT   = json_decode('[3,5,5,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('eCXBmSNcqb5yOPsBPueZj7tzBmxX/eYY');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3N5c3RlbS1pbmZvL3JlcG9ydGVycy9iYXNlLXBsdWdpbi5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('x6WlIVxS1OaBTrWLHnRHMKg2WtxuncNZRHYTkkbVpSfcsQ15KMV/Ir2oBfyC5r32/szSg5k7nCjPZBVW++A8+dM8KhYDKRXNftT6rrccKBEHL3QgfPn6ZgNsH+PBUgWi2lyAj2CF1V9oyTz8E4r9r2d9eZWqtu443J0nw6h8OORfMkK0SXDBGri+HyPU/ehF11lXqKbR6oD42j4edskNddYhHcNppDXDm+4lZAlvcXo//5DEZ4vNJyRX+oAxlJ0rIpGnslsrvGJKVj7RcLj6lvc6G791qpBohUmXSipRG/REZfIEP326+unepyKrYyOYyIELDqsS2QpjDbvC+T8mDj0L9cndax1ogOpfbuAsruXS1EEzD9T5dRbnLaR20NyhN7xyuco4v9r02KaBoRfD+5mMW4+RoWLZS/DlIHB6HXwJd1G8t2h/VVrx4ANqyL3prF9tMSVLXGDzP8lJx+dY3jEsIfZmZEqNS1mBk8ImeQLyuQkhhPbtXbzLrj7EZMpMySgx+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2aH66aLVs/caM63EZ6ZmkSfnMnx1WrnUnjf3HPdMUzvD51nXR2gOqAWqgXvyiLoG8bmmrW/wq1RoHPdmHljE/KbXLgtl2t1Oh+hnNnQZssVJJNBf49XPjSDm4jSb78hxwyxVaSSK4+UtlkSx6Krs50uD2bzn72d/OYIaHQd2gzjHmBUh5A456X9SJhiitl+KL5JwXd2dTmiSNKXi1NrCLz89wEUhIhNrq0UnfWO/N');

// Signature verification
$__PK  = base64_decode('nTwSkdRaWL2ZWvvI0NfPblLH73wUEGEOT4MpNnUlfeE=');
$__SIG = base64_decode('SW09/jiIJAtslYPeLfoVJlJuWjI2g4RjgRcXGeryok9GNTN5QUdin8bh8CjSG2rz8ZtaAwqDn9ASniiQ3jD+Aw==');
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);
