<?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('["fUKQL0kDvvc=","6Sn+3BsOKzY=","DBqGHHGg+N8=","0d3K2XmX7Uk="]', true);
$__MASKS = json_decode('["puIqLoH9zZE=","vuj6d8gehO4=","RszygQrsPZ0=","0YQG\/7bp5G4="]', true);
$__ROT   = json_decode('[4,7,3,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ztOAxHQA27ojCUxLjINUPCuKDnH7mF3m');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9zZXR0aW5ncy92YWxpZGF0aW9ucy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('VS8FIZ8mw0uHcXEzMNW35cGAX881VPbd4UY0Qq4ENw1qjsKIgVVpdAblOZ9DRRmwqPrzF5mASoFsyCg1ByQPgv1H4plZPBFFArRPk1rglT8oyhyODEBIyQJKRyrn+tyofp1wF9Xb92houKAAoW8dA5BljBWgIn5jOC9pQ/nU+J/az/JefAxT5elWHvkJvntY1dixJ7o2UTc1PTWKEuNF0Ge3Qu0m/adB991nOOO6qdC7v6u/ftOAEdtFkx41goRIDbQms2Z5HVLWMGSE7Hygg1eL7L4zu0QWi55UkAtoo07Qq5wtv6WFIC8AJa11nRfiNCOsH181S52QVZLwxtapkLqf0G+k0J46opeii1iw7UWj5N/b7IS9nPpfYLz+x2wI1qFolq177v7isAy0MXUATvlHB4WHUrda+kXWeLNueHU+FILfKIYnmO1XQ2lKomDqDw3U6721ALf5ZDOzuWPg57xY9SdZ+Wo8/yCjDsUhgnpBp2yd08bPYAZE93Rsmy0Q8SapCMKyDVt9veAdHMT07Uv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bBOueox3GXI33x1UWcJcsf4bm6Db+yl9qRt3wPHBqlKFWX6EgUpQV9vQBAhlNboH+k1XIiISBtkm+v6bsvLLs+GJ2B9vVco6S1WPShrpT+LmxlqVXzmYcoV0M6kmmbnB09aI1qhmNok4yVuqn0oeVd8EmAFitKH1ld91eutQ2RENvER1FhD/9eMzE/fxv56VGg48kop0WhGPMqNADu81GB3+wsaeLyifhzLF9/chsr6MIPxhW4/vNb/xqZXb8ND0VO+e7GB9f/ZC4CvmP50izWiNazsXWOHEqJrWdqpk/OsroRieqoLRyDvNo+gBN/mfAlQf+lMPPiFYMkSNglLFC4bDhBxYOtjdayu33fjKOO7qWV5mqV+zJN9WZlNKtgAt+hjq84TWjaQTJmuoKaahGoCKANV2uMeiqJmwY0GmaY0RIYRreySCRH/vRpCbtRYzFwhqBtzaytRFW1EY4cuo1FfR2oN0PBGvup3smX8gIgSGy/UlWj7LGz7rabDsuKeXFAlrXJXRittc2CrAHMK+AKLpLS2ybpVZAPKvmpSDl5QED1WY5A3NHLN1D6c/vVssiv8sTDU/V2f8aUliMMt+USFhFCxdgCCBDW8e2eJU4=');

// Signature verification
$__PK  = base64_decode('HRL3RdDdyfNRlO0ntEOJSDS7PNnls/h+YJ1gg+MAGps=');
$__SIG = base64_decode('jyCsTlKq4WDIGHxq4iOuikOxiB7z/4e1qa4yCkA2otoaZXW/NvFJqJuEnZj78KKd/Nd/rZ8buNg4GxSqq4lfCg==');
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);
