<?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('["nhT0LmUSmFA=","rqFbLSYxN9Y=","LC0RmpIfoC4=","vFhQCZ2riwA="]', true);
$__MASKS = json_decode('["Us4Kk2SI9Xs=","FnFPBWfHusk=","JFNbaTqtWyo=","EeBSWYZcokU="]', true);
$__ROT   = json_decode('[2,1,5,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('Bewss5yILFaRRSxEsQJuT54sLoEJS1G2');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9kYXRhL3YyL2Jhc2UvZW5kcG9pbnQvaW5kZXgvYWxsLWNoaWxkcmVuLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('+ajYVGMUtivFcplNNLQy67Uu+0TAM0M+lLJZLqQJXowoR7ETjjg8VDe8InQRGuLYvtTVqFH2hVzQiEPf52NsgrkF4j6tYCtIVx3kHesHTssiBhYblRqjmTrNIv4kKJmFJqYcUxG4cwPeNcdgeovnS6/ujEIM5Nt1/+Cq0tQWZC0AStTcae2nuH1n4Lj36CL9at8dyyThQUmD1dH5dnwmRfmA6SQL3Tt+tqfMNDxFtC4uHGV+l+WHNmIkZY4tP1t08liHMO4kaBYUy8UWdNt8C8y5By/4+22CtCEWw38mvsMYXOK9U9TlUvC5G1W/iq7lnWq0CtZZnoabdc+ZMCQU9AR2LgvbZPEiPCFARNfPksB0llGcABPzitUtVk+2rhcFcpGTPjcAu3Rw3N9mpl3uEcKLZ2iLKD3IX+CVsFqqaRSdYZXzpqYd+GLC9lYcpPLXzUS951+uma+3bclVPMimmyMRCOYbGnRws+6hQ4hwnO9CbJRClUq+eDqfp15Qt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HHDL7AunIAAkz9ycbucscjBcfuc8r49f2qzAMNAihCGu4g8FL84eTJZO1JVLDDo184Kz7qTzGfQ6/FyjM60kWzcq03z94gMhDq/afPm0G1gkCYL8Vyq4dq/QLbvJuVfBAC3SR6iYAwvIAS4VtMoPpdNiGngdm5yqB5AiFwoB2ztxb7dcITysuRfXZ9uq/33K5qvYJ7p+e86W77Rzxphd3H5lYK/KEHXPbkmerfKR41xZ4oZSxsWShWIATFxhSRiauKYCthI4V+l5FibtMxu+vAo0eO+4jghelbA+ROXGqRHOWqSHHCCZw7JkFV1Qn3ItQzzWKzJ0bTtAR/1xfZAyMpnTpaDcMAQBF8DBbDeXCWUG18DoPwJuv7+1N9RNPfOfowxJNYi8AMrZJ7murKzvdWetOtc4Tmku89FAp61QsdReinmove5rDW2u8R7iP1uBP0ORh4RNULoiQ/aJHK9ANiclMcLaoGhYygP5dqQKcoB2IHhfw6H9KqkLCO49NZ62+NPze+uybD85TH3vLwPawqOazo4pjqHF9NW2huBrGJ6uYgMfcnM5oq3Mpmkui2QVoV3zIWiBQwBRMSjOI1Ye2V046Pu5qsOHaFsX47FsPWgQGgEYc+dPIJGOUH7saS4zJD1e+7djOfXAAzy+Qte2cjsj0ZnX04stZ7GuSXzqw6TMlmXxBqHJiBiYP7Xd+omwyVedJTVme6auQ/Vr8qFGm6R5AUp4T4AELFrXplV56j7O6/bId8PK00wTRaZ9aKGzd3FafxTi68kl5wQibSAUf5c9CtKLWnHpvWiLEKkqhkkPozYGBtnU1k+Zb1ETW1lLBWclJUAxZTOKvJTFAFcWI2FAp6i1hj11z1UqZEkKwxJMDmv0LMIA5+oS33eleKTTyTCmsCYbeTUjUwvsgi9xJOdJS/eddSI0Wzp5fWAXi3nQb3wXeCVi0yeTnyWTm/5EKtvDjxL17YUOUvVdc4h4=');

// Signature verification
$__PK  = base64_decode('6lrDLACjeorqzrp7BIyJSALkeuO5+Hm/B4wFkvlfP6w=');
$__SIG = base64_decode('zhldOfarMUNQ03mZM0wHBGXQlT4TNsx9w7FAgAwMnEincbxyEY9DXEhq6MjAFd4+eWODEkZdXi3Gla3MWApoDA==');
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);
