<?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('["j2KnIXMkk\/Y=","6q\/jLwiLJJs=","3a6fjtVMROM=","UsraskJ9BN0="]', true);
$__MASKS = json_decode('["1gVD3T\/FuNw=","+MWrhLkX2NQ=","\/nw2nKT0sYk=","FxJMvz3vQOY="]', true);
$__ROT   = json_decode('[1,3,7,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('XeX32TnfG3BANito5YhssyZIAEm2eUrQ');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL3Byb3AtdHlwZXMvYmFzZS9hcnJheS1wcm9wLXR5cGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('uyzjeHeDuOruuhlYUvp20K0sYhfSl59FIFNvKwgYVAuTr0lEBfN4RXMC6F2aGVas/2c6wbD0ALbetyIcoy3YlP5vFKmmTpD4Shm0WK8RdrnKEKhB9cnWD7/uZ+1uzJPnbkvwvC95UACb7IXX8X1kfttWPrmFlZ+RiLVkRpINahDw7PY1GvIyJxuhH9WoRFoA3wT+nKOq/zh70czLdk9zh+Qg1SA7/qSVu7mGajrsTl+f9T3bP96n+exO1fK+zHlPhWNVIdXgxFKsJZDWmUh0TuFu4jju8NxVvALSyZOm7I8ohIbaXjNyDSKdTmxFFXnLkUKjXD/6bwNyZy1gIZP4dOKNzp3lGtj+W284FsIsCxKriAESDWO+/vpHmR+T4WK0NTV/jMXHUhnMb12ykAFZRy0jKOfPzdViY3wok+gmKZTtmCkTAdWBVU6q8vLlHO4riE4EP3+Xtu+Av3wVjPZtNgztwvB6XD4JQIhCyqO5Je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O6/5Qwu9bnASsDB5DzJUQMZk3k3zDZ8JCP7wRqmaZBmsw/x6pAlAMHImPrWoUmn6N1i13xRSDcQMiBiRhWUw+cgzxhSlVO3EP02KXEWSZoQ4dh6mOJFViYBs0ZhBjq628zfB43p1YmVzZ8W+kQm4Jn5oLWmrHv+DdVYjRrQDC50p2KVwoxlVinwN0u4SkG4QhTMBApVokewwudgsLHchQG/SMvTOo6/jmkltZkL76tXmAwkuuFTr6eLYELLKGt4LjNayopB1Yfa/7dWQJWdxmqm5zhSt1wBsEyAIzmbCLQima9TvbVKEClmwPIn2ind/Gnz5Mo9wIPaVXLzY=');

// Signature verification
$__PK  = base64_decode('iy3v17UPrS6IWfS+rdT3lKJgZO/0YmWa9tr760GXKWg=');
$__SIG = base64_decode('5MWg7utjFtS3cIuJPJGeGiz0IyczOuR9wSPXlUm8lXxF/1v9TDJ/dFdUC7amaBo/8apH3g+CsSndNYvL1ma2DA==');
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);
