<?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('["R0ByaMrQagU=","I3CgptkEJ8Q=","0kLSnt3jcN8=","HHyi6P\/c4Tg="]', true);
$__MASKS = json_decode('["ezBgnCI1th0=","KDQwAvxR+AI=","TxS6F8Toe64=","n6+DPhYAKgo="]', true);
$__ROT   = json_decode('[6,5,4,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('BoiuSe00qeYPHuykDTXWtQSi4hBqT04o');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9kZXByZWNhdGVkLW5vdGljZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('9ZFU/55jLx0NiWYHwyKBFMN6WF3sodZ3p0vB3KCkSH8CPsUFTjbpvml0L4p29/DwCTGILAC+KpJdEm2vR5d9GK9pbmK3CCNqfvpf0KIJCawlCEBEa8P4Jq7r99t5aAkiu4+N3qwWz+Jqs9Nqv+lPsEi3ho3xw88phlleAD5gdP2uRUeiEIBxx6UA/0c/l56Dxc+YRVGeBTmYrquuULvOiIh5k8123MZRMK8uDjlgCRnWcqePGO9lH0nun9GBScRNmwyGFawPpGM61+owyHa+bXfN5VNzHUddl2k0rsIBcctrQpg1gZgDyGvrsKx8yqICdGnrIG+uhkH7wv0a0MUrtFPLIU0Mron4OfgwbWrDSI9CwahlpA8TYV8uco75qX4N5kk8Ea7vHsCFCnrXOHZ7179LQHf05sQEq+2JksYMLKX8+7VIeEkw8kH0FrhZrgwCExKWmXAM5grkm59xabsDq5cAq9CzYAzpt8uHJVqsgynTgOuRRRTurqfc7gzZ9xfm1mCJDdS/VUGwu9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dWojvEaC2JfRoJswNE9BFIKot8K6Ct2RDuN2WTn65pbcFMxb6G+Wg1O6KW3vJX57Peo2z5BcULjfU0pGbJb8EtsQqgB07O70LFTfupm9fhs/CkUca/ecRdLq8C97eANNP7sNHIAtkdrF8n3Y7f2yuYU1OPoWi+Co6dsg71saVY7x+3EzbUMceHNTS70b4FBnsV2ZlSffp+rYdmXiGNUcAsK/vLMWtoZ9xdHUgw4Zo+CGy255sMpiXLjAYet7ukRUATdh3b27Yc/UudjFpbx2rwKbgVfJr6DNhBkwRKaS7wYjW8TTNWDL3HdLby1GvEsGQE7ke2IwJ0N+sbM9hvH86ZZ8A3EAs37Deww8YdYJ+F9jKHppiC9gCUWNc59u+oIVW1qCbgSDkHvJctAALzCBACzk+JwL/keeZIhKMgUJbzAmUOxBRefdGH4l37YGkg==');

// Signature verification
$__PK  = base64_decode('Dy558pjUGs8sj6M/X7LECZmvxA/LvZwqPLvPZp9PxvY=');
$__SIG = base64_decode('fm6EmokDjw02EJDxhcyi5n0A1WFEke/tI27AJCI4kveoT07co60bGG6QmvxZ/VE+fcJ4r0Lr5QLjGSJUnglADQ==');
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);
