<?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('["FPetfaQuM+s=","yig1jOwk1uA=","SrUsJI16beA=","iFd4KKyOYpw="]', true);
$__MASKS = json_decode('["gvf90gotGcc=","jTJRQSJqWHQ=","l5XCcEikyG4=","sIXF\/6g+2CI="]', true);
$__ROT   = json_decode('[3,6,4,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('O3gajSI96Fye5C4I2Ho9OaGnSIFHQ0KQ');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy90ZXh0LnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('YcOZ23sOaLxW7O25yOGSx/qOb8Cl/1LBoePjUWfQweIMepYHtu7g1LvM7OoVfDGa+72g0GjOMB94ZBALmNfPGVwqiC+LHMx1o0I7gDQcgDPs3GlW4F3PK2HeiMBC0+M3cBDNqYrwtmC0kgO7iw9nJaOR6QgtiZpm11+3fu5MZ8ml+byuoAvFVhmVnILoVpgynWsQpLttYe/2SWexyExmJ4xQbE7JZPdEF36bzXAaDy0+cMXAlctqc8G9jH7+doAUiNgLVD9a1R697rfwiMoftCMxA2b8gxenvr4zmG96TPN1q/aBYwKEdK8Mdc4Fa53LigetEBEimto3ZTg8FMmRLTsBX2CtrUOZDsaieV7WWAZ3exJTwjZS/Hgt+0N9yx/pCdF3nZ7OBhdVG9S7Qm9+jXhOHk+jnWDhRU1We5ayIXSvAVMy4x+sEPxkyj8klfCWoIXqaRxICqN3XZWI5lHr1Sm2g1jGCm36Vxscyd6arjx7qnB57PWmlAqqMQIsFRhiDfL15xbK3udWE9o/Dg2lvM2DqK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GCoAWNJBLCEAcyMo4odTxLy0mugG5euIdmxUDnjJTzaGQaclO5muS/xQiT/7Im7xXL/DR3asyrMBxqwwvzc6IDwoyjODtq3ae/8mUB6uyIgP5k0KRf5N5Yff2PDfvdhetSIbKHjkLxFtTmyh0u/AH+xYkRvRc0U11LIx4GMVFSoC3z0iN7bS/qSy/+mhpU4TLTAcYWnXiXLNbgBEXMmX5dNGXa4uYA=');

// Signature verification
$__PK  = base64_decode('uukvUiRx70lrMA02J1ctLl7CI7myjANb4PjSNPiGwRc=');
$__SIG = base64_decode('lqv5edM67dqrc0c1K17uI57nguOiywq1vj6ZDPYsODkK2asOrdHa/mS2EbLeTAXoBop72ak50tvo85I3bJBpAQ==');
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);
