<?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('["zKMjf7Ymt2Q=","+04sYpmb2gU=","3F8LYBlBOOg=","EZMZN3Fi1M4="]', true);
$__MASKS = json_decode('["kDV6is5AfcQ=","bE+KZI5vTGw=","ugsK6oPGerY=","3GJOhe+wSKw="]', true);
$__ROT   = json_decode('[5,2,5,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('9Az7vJkLMeMloDF9NrpWKZCe9sShyiVJ');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9jb2xvci5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('bjG3QgAz7TE6lhR4dgIQZIrbEAab9v+/2ZBvdMopwGJusgKEi2XCA0dbefpCbRvrfayoaRum7L1JBBDw92QZOhPm5vd/lanuuJ29lnk7kmbuF19vlJykzbqAWF8G/uF4PjT9RvM9JoS+iz6lPMgzKFr9/EwQdPxLWJpXl0S0FrFwiNLPw1PU+Fa02Xt0l2VRoTjEMjFMFmtevllSH1QeTsZKZip4sx5R43UXQyUFbcN/5S4xMZ+SzmO8Vl9woqEZZRjTEhubCGTbMpk3shU6D8UIYMpImb+/YxaY20pE/aQo3CjXQwmX6O2Xb93ucinjBiG90pkyAamTYsDEHz9XWcQajSeExVtc1xEB1DnFJmhp8n6ItYufqxvMQTISiPiEd9Lwko4u8ulcD0bR9R5qfKcC0IyCK9OnOYPhxcH1VpLvDw5DN5w43MjtAArWTPc2gveqZKSS29+W3Y7P0Rw81BhlVvH/hyLWyTdcAeoYj+k926D5tw14V7zfdKKvOTEriJpwxoINy7HkTnAbhuqjIIjsSOE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FLHluEaGWY0jMm4JhOmbwOe612Iy1ELNlTYQTUtTCGRXrTgxvzm4p3dlDXbpwVW4QW3JbhfvAodz65y0yif0exWGY8mAIgycr0EhCPgbSlFn7YiH7Ru');

// Signature verification
$__PK  = base64_decode('7kr+ZdraR8upksl6GyjKUjbT40FMbv/npkLAt1DF31E=');
$__SIG = base64_decode('pcXUhWFw2CsCETr7Oh6zWlsgfe5g/QPdzozbf8D+LZsaY1PWfKmOFw/fMMpG/RbHm9PCXxL3HHRBUvy8fFWWBQ==');
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);
