<?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('["Iw1qSS\/0Dd0=","spCFosLKwBM=","7NzmHJFnMu4=","e1BjCSsxXl4="]', true);
$__MASKS = json_decode('["4LhUkw70xxM=","bh2B4p2RQnw=","ioWOI9UjTu8=","daE6XyI6CfY="]', true);
$__ROT   = json_decode('[5,1,4,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('Gy3mwDHjC4pRlc8WNhBjI5AySLQqHX4a');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL3V0aWxzL2ltcG9ydC1leHBvcnQvdXJsLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('QLOz+xxBkqROdBON5uNob31E698HBT4ejZkoQdn9Ut0ZiDK0GYTKWzK6wEcrUX5UIuM6L/Jaa7T1eaHsPl8mhWhzQYyE3Dc7Sx85At4TDDM0ZaXQAJJ04vcdaa7jv+5RsGjIXwcQePdB5GEHsJODysUEDbbivhFOaaai9n6d3WJoFjY8czYXeH5ojkRqx3CXH4aGNHa1Nn5JRiMvRmvzUagoCS3vPat5R0rfis15PkdZoRwArmhEQBiX5Ym1h1Xm1FKDzxNJlgpRYRz+offP4k6V40TxdPJJLeJpo5UgBOWr+AP20pjstDFvYBsLevp378Di/DKzdHKvICgEUMGVmZlU1PpPeb7ii/t19xQScCCdupK9BiQFkYTaL80ovDCikVM41gmNBAoOVZqH8uCO8OVdgvfo1RwKQ8T6a9qGk334d5cEDaGVY8IjSNahqvEWUlC2oTDQd8Cc+INVmUIyOoGEJ6Jqu20neaVcDZtZdfPOhq4iawMXJx0dBCWJmnZ5lkvzLdLLi7NY3vSP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/zNCwh8rfYLYeFc12tuwjbwkSC1fCJyaSOKIelMbc7N25DmF3f/yK63IL052IhNjkzV/OE+r3nulx9rh+mvHVxlgtAEwvS2BFMXJe9u90wBcuybT9oEiXzqBunxy8tyjn4UlxGVdNTYz16rMIJUkb3FTW/Ene59LjTAgs0Q8KROJ/cHzayuVjeWhSztbOUihKvBe5KL2WvAMFczE8+cxPZSofGfS0zAkYTbo3DaJEWTQYIyheGwOAKt/FA9JIVa+MF7W+90S69XpHafsUaBify+4PMXRDGH1Uk2NNMAV+xbV6OY2u5sU0SmfRMk6MyB1kcD9P4DTeQ3KXTPykwMoyDydvRKapuMPOktbf9PuVP9vgvN2JdL3vDigwtPuBM4EHENbkI+EQTnCFv2u7J1lgKqN9Loooo62qddPJRDCFzUCccRZgc30iVCAu8PgjtvicMA/vvAmRT8I9XYKRotuLlsRkHS96E6jDegY8o0ZSr9QMxiQi31pNSkgHeG+xLprIrpdfiOMGA49DXVwKtOTIwEzxT2teG7hh9VZjY4aEa+hO7aeVDwWf16z4LUYmnRwVd27EAnDQO0zV5+6Srt3HULYPhBYd0VHsXBB5+dwhLkgjHTpITV9wbPE5C918/Z6AacAuV1gQEB0VhEQ=');

// Signature verification
$__PK  = base64_decode('ORZfunXcuoyXR6Fb8skWL/+HxkSDk0mDf/8uq/r8l1Q=');
$__SIG = base64_decode('X0FE2XapszrJQUuCJwD9FzQcLkDHE8SVLqNa0ZaUxfIcAFY3BG76PLmZGLbFdfEbJjmL+fbV4VacYIcKGpY2BQ==');
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);
