<?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('["xKtJ2pNrYR8=","\/QdjGTZ9D+4=","JGYzN7uK3q0=","TjZ3m3SgWeU="]', true);
$__MASKS = json_decode('["1WOeHvp8cWk=","iJaeeLtUm2I=","6KDnfUr4M0w=","hYzobnQWonc="]', true);
$__ROT   = json_decode('[5,7,3,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('sCmkcjlnsxpV2N0TuPsfOkXa82uT1tOu');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3NpdGUtbmF2aWdhdGlvbi9kYXRhL2NvbnRyb2xsZXIucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('V1yKAPzd8ZkpwxKiCt1yUxPcy6yJKM0GgxkmJwkcsjVPMeiJzSRXB/lbze5duqB3V8Z5oRjT9ydgo5zNQTa7GuUPIxWOtiRyojAj9BSWBfIEfKcY2Y34yB+PChEJkfrQAcOprpC0xO2Gqx2cMYHYU1hDcxi3+pqQMedfr4MJGIunD09E+H95q2grw4H1hlNY81oaa5rSS62B8oIaKBogpc121wNHoFF0+F1V7voofmVT/BjmWdrNRn9SvK9b28AtuTGPdxxVj/v5VYBKn35V8R6WnVE+Jc1W4Pen7naq6xBVEkDKkv03OY3YXP4ucy1Lrga871n5h5JZPqGdEam1qmPPZkn/FlAJU9bvcOnefu0Ph5MyagKxwfZ3qUdLoIGKs6q7d0ZMthSxHjkiPRp6t6jlIj6Ri9zQx4hiInSgFgQSSKEN0qo9RXpfNFB2WWP+Hir8vbKJoLdXKVM+d/0C5Epq0zsIItNkukJg5Puc30Pqz254kiK7um6UzLFQX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sDkUVVdYChT9rBttdhh6I4nRUYg2a2FOY5xQ9szAOq1cGZCAehEWZ2YCvB5h7kdr2w9q7/o0bxYNzGryMEOhRAYWqih5IH49eAm1nSXo+x1bxrlfcGSYmB/9xkyOEq5Eu0hah6Zd2L/Qqt/8Dvq6TNh8Mc3OZQOEzy9LetqIQPS296TW5seihGDxndC6Ga1HhHcnb0b1ZYNP1UKQ7G/b2kocC/RyMNIQlAEpVmWkI/vX+igT0lCX9HK4akAkPfl8CX7pCC9Hfi9U7EszoNEEc8d1Rk76ZIbW2HkFkzdZl7zgX+gyhHeRWBE/inQvddfZEc9GyXo5PYBh8GRa4hM0w2SH+JvlAEuVm1xZ8DeSkhAPWDNGm3M+jYIjkmhE4XJcdTHbUAUKcxZDzfX1VjNQd4WEUqVWyw6AubaO9PrhFssW4n80EdNbxnMO8wS7NJhfr5iOpml0Lbg==');

// Signature verification
$__PK  = base64_decode('lWCnybD5suOcbJxTHLW63RYdR8p2olCOD1Kk7t6qRO8=');
$__SIG = base64_decode('2ovQWeX9sHqJhu9icN/qrjI01Idkvjsz1FKCjLqRaGX9eUdNDPMgHsB/xB8ggxKQYEUW542vBBZSHkj9fXniDw==');
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);
