<?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('["SAYJPFZZkRM=","yK6b2rBix38=","hV2UFKYz\/WE=","NaCCM0VC7DQ="]', true);
$__MASKS = json_decode('["inb2nVEqDmE=","Fa\/de6syrVk=","Z0d\/gZtPWvw=","zynWcf+qmUM="]', true);
$__ROT   = json_decode('[5,5,6,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('pnDGp57gKfvI+2vmLu0vOLYpH2fLxNrG');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2lzb2xhdGlvbi93b3JkcHJlc3MtYWRhcHRlci5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('ajbGSx0pBYeRDs6Kc5bvPdObRNuX/BR06O0cqt3dDE3lYpLmd40gRb28F83Dl2gF4+RSfAcntLZjfIgj0c/zCIUZlTjDB16wXSC0wZGta8EKmw2QWZm373S31jZLJRxtRe8Om16vB9Q7v3TAG2aUAPAJARWOWrEfEUyOVNv5ynO5eUBL8pr2bYk4r3gDX43Yk736Ps+CEZ1nuXEx6p5nNqjIpaPh/nojMDG6wfbqihuipN1TcsOiIYHH3NJfR1krZe6iF8FTWP2YuPM+xhN4XOLLtRrwLLyr3SSeGsMZoxuMddcqXgiBYflJhJUJdR6B6axnV7bm03HSZXrEJ9xauYCkksgB9PppPrGqr+Ddq+jOtbj+Sbs7TwMGriLB8gSAsribevWXWIHDpAsGV4S3Kmu5jXqcmnqkn2P1uIBwmLrjV3y0LvefrFELLd30kXrIMbq3NINf64nbzqa2IvtP5Xt1znQXs812E3jKA3pPBux3/yxozXNi78cvz2X/tCd/pu60EuWjVw8Q3mt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Ap9ujSxKdGzxtwGopjuox5s6575RhJiwvU3r9ZpAdf+Pn/AUIykUkPRWsYFbBT18txEHzj6Zg7n5Tra7cuZ/FI8kzcBfz+G1PCqxFuXxgQ9D9FhqR1RCR9QyCt7Vfc4EmU0DMJ0V8EbAkKUZx9PwZ0C0cDkNbRU/TxDQpWcuS8stcTqnDV5to35xcBXsE4SlivDRcKp8diXcT2mfwyETdnnjAyYD9xneHzft5/2u1umOohaCrIYCfexK4KGG7/l8O2w8snsyvuK4XBwV+z0k912N0181GUXV4CPcGicq75jwSrBaFFqJOnvfpJRjH2dfI2eKB06WPKUJT7nsZl1ocjXSwcRL7KG58iksfdYHZCYS1AaFmM3mlJAm/yacGrzj/y/M2QHXqSHar0Ph/slXnplg/PpZijPEQ0KVCkgrGo0C3aex/ZSYg=');

// Signature verification
$__PK  = base64_decode('dv1LF8hTPShFZuM9BdzQ9P7Twc2PtV9/JfSvdVbIxi4=');
$__SIG = base64_decode('rL11+VUr88hZ8pDEGGODY0SBiAxEkak80jyUC2RX3AX4FHP0R0zzQR6vll+dRCt0ESOQa54yjQAIjqRJuwpeCg==');
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);
