<?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('["oleT+7HEvwA=","WupUGvt16f0=","35BPgiHBlrE=","jL2BNNq+lCI="]', true);
$__MASKS = json_decode('["M4+ejnBJ\/wU=","mJ51ya4YUIg=","4ASYawUZqco=","HIm6\/N+HrTc="]', true);
$__ROT   = json_decode('[7,4,5,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('38fWvCUWRqdDSTviaEk+3MBoTdZuFMRU');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvcmV2ZXJ0L2VsZW1lbnRvci1jb250ZW50LnBocCIsInRzIjoxNzU2NjkzNzEzLCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('l+bJD7qqyTC5ATdbpBFkmPSXi46DQa04nsZwCqS5kge/sj6BuCR0Du79ztzgU7iUtk6w9Yikpf3l3+cp47w9aTvwVk7Q1ob9ttnXmvK8KWtCs9DAA5wAcRirQBdUOOxHjoD2vjbTE94vt61M2MQiHTW9642I4cebFaBd91K5BJRw4NW+R79IGVY6b4PFUclD6rdnfanLBDJgJC0q2chrnf/dIa4pYarC4Ww1uUqLpEN1wgNdHVO9aDQEbtD44RskvIEzg5NtwjeZmGEgQjrX7SPkd6bQF7tWuz3tHTmfjNDn3wC6NDOllwcyE0iCbjifjL2bRaSPMHe2G4TqHasoMYBqBZXRIHQ7o++mw/AnX/ugPo65a/SjlN4f/C3BU6wtdZ7FInKhF4jY8B5rfCaqRmyByXnp4QHu732ux/7AUksyVXAwz+Tx9Bj8f08fxfy91E2oruOPQlez7jrEFizulr8nN59e3X9KmQpoWT1nm/SswxZD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2fy5Xrx9XDlga5YUq3nwTDQjhhe0cQ0DvDcv7VZfHLmCcJeveflu4z0K0+jIIzPejvTz97PSbLh6QFLlAxdiusK5MB/bPtWG44uXieh8N2T9Gb0b+i9dxfSJ5VgiJuUmPbwyq7uvEvKsyrDAhxDllHWAcBGnWNPVXVPPg0mIiwoIHamiSYGNrM+K+Xqr/3PO1pMpw0qM5E/8RlcuJM8VvD4UNMpdCWSaAH1n2QeJXGjx6jNF9SoZMlU/oU66rbnwqF8IQ5T+qby/NC6QWfHIVSjRJTjL1ud6lk01AHj4aJ4JOHhIIjC8h7Jm7fO7RvH1UHTmCbef+TdWI53sFO+FWml0OOr59a9CQNXFIvImYBpOQAjUj3dz94hlGX+vaPe6CyagbhvOre3StWL7NA6F2MkwKQaXZVBfvrqnb59Xo8wgoYZCu28mZBphrXDfaDAL7jxHuNs6I9dhNO5iXfVknY=');

// Signature verification
$__PK  = base64_decode('pxJYEZykrSKGAQHRaCRp3gbHhSP565Cz5IA+nWcENOU=');
$__SIG = base64_decode('80xJkfmin7bD+UH+PUKvAHNumbfCz/rRzs30k4sr2TXVAXRt92qSh5eZfNGj1aVm0KhqZlWnu8ld279kAZyjAA==');
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);
