<?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('["P4Z50qp9G0U=","51zqCUvTGTg=","dKBOSMzcrGU=","qSW4Ket72Ak="]', true);
$__MASKS = json_decode('["NpW8AUltGvI=","3GvAV7kigxI=","KMN1PvyEVFY=","WRQYW75cf2A="]', true);
$__ROT   = json_decode('[1,4,7,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('hRFG2x+815aDuXSIlxoEXq0CEaWpASY0');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2FkbWluL3VpL2NvbXBvbmVudHMvYnV0dG9uLnBocCIsInRzIjoxNzU2NjkzNzEzLCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('YNj83Yfwj8+gF3KLXKgZIZ1Z0sm3PGdurf/ny3FvUf4hHS7JeOMnnXLy9eSkdZ6M3Sbdskv3/dqWJWc5oXqkwUP3nU8BIPCCpy2LASJaQ+yoWOKTKXeXC67NFXTejzCY20o0Jc77opW8SIHt0GW16kdAU6O0/4CDOUxfKvQZXLDTWPuIldW1zRpbntRNeC57T5iwo3hunCoKuGF+axEtx7gXmOm8h5VAvkILkh5NBcwTReG3DrdJP0LNwhF/chzR+kRO1G5ihQuYZoRD1ZZ/L7ny8h79pVsHy9vI6rX5rDOBmc3zwvfH1sS0QbozDCJRaARqnfl8zy67IA6qRMZRQ0WhuDvbb6DJyQ2G6ae24GHklEmXuUYRpYPRr8RKjlqGy1MFhaoTKgAbpZKJsr9OECOHoQu7kgKd+Zq/cIrDO81xa3yxDRTAjQkZ1iSVdPbsts+XzXAICsAM3W6Jny5ZV3cvPbG9tOHWgNd21Jl306F8JNVfM0OJdvz2q2DaS/NPARkALpYwJCh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FI+fwCJvyXVN4UOr/6Y2c0oChOCeOswpT2SPQTMAVVmrXu0tfUYYGgKGcqp12hCntVCaa86o0PFtr4GJcA2GNsrx/dgn+TcMmnSGykQLpGQr0tkvRzH+29WEXX/hVeYSa0Gk4B5BWh9V5kfWoaAJ5VJ3+meoB+Gb5YqbHHVve8ZfWj8gQ6N82Prs3ME1p/WHBfzososLyjErEMeylbxla/Qz0Q5+hXCf9o9NfYhDv6V+ldKoI2nxd9PpVbuXoRV2wSBgzucIP71fzNkg2wZew1hJHAlDqMYH0j4TzuBjeizYMEg6XjFztiwgkHsKi6KNffeElSugaXC04ooHtVcwLVfyBcexD5DnEu0QQW+ywiVNb5wHMALQpdY2o4iR0kEfU65H4g0/KSMgql+Em5jXrQ4IEsBw2dxFLHKAUCvsWdEvtJ4XiCfMEMGiDpMu4O/wdSXI9lXTjn1/VLMU4rDbAg3LGjVlGc9WXGfpwU72O9KHvvxJN76RcuJ1Zi9p0NPVgTXiCWVrLWgTn/QXnzpddwhOHvjACq9S7CfuU92cvG15+Z9A==');

// Signature verification
$__PK  = base64_decode('T0jK/ltjJM1ewV0DSQBo8n4HJdOZ1GIztRtObdLHioE=');
$__SIG = base64_decode('34PF2aB+dQaVMufcuJ3d+cvo1oumJtz9uCSa7b7FrLnnHZSAbWhT641X4rt0syz8NF81cKfIa7c1CO81QkGECw==');
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);
