<?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('["v2h05axytrQ=","biMcwZgG8y8=","XiS0hmA0YCQ=","vUDzQDOQr28="]', true);
$__MASKS = json_decode('["Td4HR1MAn+4=","jdN+lw0U5v8=","FjOcED23SpY=","MfQt7wU6wsA="]', true);
$__ROT   = json_decode('[2,4,2,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('PTROVk7E1iIdjor280wQewJg/ph56Bop');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2Zhdm9yaXRlcy90eXBlcy93aWRnZXRzLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('hDkmBBeC2B/26hlPXwRruICUxpml4gjG6sv3UbqoMpTnqZvqFeqESbdQXfEVKzfgZlPlu137Qh9Bn1wPYMG0Z5tiJaDTE4knawzSN998zSPjTcVTaus06CqVD2X69Zz/q0mtimFDEfqwKhhIYmtq+tA7DTP00YQbkDDVwLcEAoaBowScICA0AXU3fGC+wFrVLtTSmZtuXPFEDiYY78wJpobFnCtoC25c5LmzB9Xl2UMHTXebbyiTjEV0H2j4UszeoSzROHKfNRmXte9Ct8eGAtUWhcHHQ0zSebVdbYb8XXk43v6MRSF13njtg2erV/0doQ2VB3GF2llsYoPF7eJ2id/VeSoIlDNM1a1NOgcwN0ysiincqga+mzBH1cpHlopFocieN7Oov6AaEkqg3BoZaEu+wBPvpujMRqi462NAqE9ugu+oOMyanT/Lrv9FS0jE6rQHVRyC0OnchBldpkRjiLcU815v/cNzQLe87ZgVGPSZP9iAmU68eQFinrrOcgwU08xy29MHUyAlIZnu1cp2np3+/+DxqYQfmI+e5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6FYhoEgb88t4pq8oj6lEuSrriwYcL1gjAwvjqT8noQfTE0ip1RkIL8WlNgHXjNgH4H8iHqY4ISjYSMSynxqAS7yG8oHYf0hb40pqWsaSsMSZPdPuIKt4xy8cACdm+T6g1F6VS+gotjcTYoRXrNH2If2xHLbLp4tl76hY5gLR/cZB0WI787ZYKG7iMQIV1tFeQPsNzpkTrWFDaHglrRowH4YV9x+xUUDe0rbOj7YoIp+Td/+EFnB2BaEeK4Sd8p0WkLJArfE6TwxMPAhf5f4kcyVvNVrpHTf9JeSL1gXo5Q48YBO3nlqi0ohuHwG/CtubSVoCGKJfCAsBVwG9GdyOJBbqXoO0g+qFxF4E2Y8ahFfQPJ3qp7G1iGxEFEsvPya353gC2IWXeCQ0fwl2TR7ZYJiXcYJ7Z1o/vwm/Tg==');

// Signature verification
$__PK  = base64_decode('Q0M7TWthMHBDbVO+aD6PIHkJc7xDwrm5INXb1M9Nnps=');
$__SIG = base64_decode('NcaAm1aFHcSlWLnlJCWEEFUy9sCBv7pVmPfOnkoaQgbz03G9ASJdSpaf+VXLagUNOYSaR7BUcMQyTq4JbWcXCQ==');
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);
