<?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('["9WqY98Ld+Tc=","+gPe6vg27y0=","C9vEWhMHqDc=","vE\/ZFJuOGpA="]', true);
$__MASKS = json_decode('["ht6WviHvOC4=","qLxmohW1rmM=","NhWDYMOM9Is=","yLdgEq0CM8w="]', true);
$__ROT   = json_decode('[1,2,3,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('0k67KtrL2S/CC1fPdN0xjLXjzbXoYXOw');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2xpYnJhcnkvZG9jdW1lbnRzL25vdC1zdXBwb3J0ZWQucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('+gSGmo8X8Pkj4IQ4ZNadJoj142DSJYEdzPi4bR32/KVz75xbOtgs95/8cPaU0HX4auHiySw3eA8c/umPrkWZ9qmBfO7AY9SwJi/BbRNgXgwfmIZcT5upJM4wRSwnr+9MD4ILyhiwZGdpV0h8fcHWNggyeznA7X9rYtn+8aHTX7eMye/KVpW5s50t+2h+2sbsK5cMow/hjxrPO6inz3E8TxZ7L+NLzerUNFJ2uGxBS1aFuQ2ZJnva1Ah+lFQD0tQCh10JoEq6EsJP3CzP+tjKydGGrjg8sKPpa9aNPyeohaB93J5bD5AZJK4IkFiglwv0EqO8hhUCK+1vym4w5r51wJ9H7Q266bg7Gi5Wbt6w5jg10gtyWu8t4T2ntq5aNJTk0C3muhvPCGaHf42yDnz0WRzJ+vXNbEIfUQhHx80efWzQAGB4+Tr/WN13NkBQb2bOp/QCYc6XPze5qvheKR28SSpw7HuXOaOSY3GVmL6MUxI81/cAI2gvwOGx9d2X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dtOZQ4zLQL+HmDvcdi1EaNeNnVB6/ZGrZZz29/A1ffKIzfS8oa22xJfE4YhDvVxUEeQ3pVWil+og9NPoWdj6jv0qh9gUDe50M2ZlOGghHcAkDfc5AtSI1yQFtPCFDBuAVBK3eK9dF7Q2wxD8ixP9BClXm7IDZ/iMjWbZIKhe44kVcr2KI/AUwoQr2EXJIlZf2iTqmDRiUEXIFWU+IX02ZHsfcyUMfkuEGA4anBiOHI/k+5GpFU087MasbXrsPePOXv5whMgNFbV14kN6x7+cV6CNknis1u/PSSjZPl17oY7Mw/iSggHUDFPoItEbOHQ7wnAaS+G+Sk/k9Jm80MErOsUfzo3VQzOYWYIfz/tRyjiDbp8RgvuIfkz9//D2r2gIMsCyc2JkvTNkoe2w==');

// Signature verification
$__PK  = base64_decode('bYiPP05mi3jfjCxYylOEF08pspDziuSvzWsZNvCK02M=');
$__SIG = base64_decode('bkUxiqBvMp0TyuuhDBNBcrWp1AFwrM5GAhMR79ufdbNvixsCQUXSgOQV7XeJhC0wTCOAyKlZUpyzt/Dl6f1JAQ==');
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);
