<?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('["\/TnOGlEmLhQ=","49c4m9ejdaI=","Bk8eWLsrN1o=","Db4IkWE6wj8="]', true);
$__MASKS = json_decode('["6fWw1s2ImIg=","bCx9nBhQGP8=","sGg63UVLZ9E=","LnHyJ3q4Fq4="]', true);
$__ROT   = json_decode('[2,2,6,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('bXBzTdZLrqbnmJPDadSq1+B0qte56hRi');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9idXR0b24ucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('IrXn1qVrVt1KpM1lqXQ8zra3OLxG+qXsKf5HBQifQPzb6cb5+7vik7z4Z+f+Ntgc/aiNyEu2j/xU8QNB6jmTwrxGGRHUWeUpXduXj5jp+jD28PqD37luVQFHuu+oXIL+3fQClpmRbFEH1Z7jwzKJRjLHVYsQSG8Kr/tvl7ICFC3rUpLsfmeNHUFDrGKx51jq29Y9DoI/zhkiqxJBJDnbKV/9IO27jVOy+5N6mIP61snMNCM5T/V5YbvwDjloOVKuUATJtUFY4rFNbllmBYsEFrtQDukBr5ZrtL2Oae0g2PzQMzFlP/Y349QA25IxOiHal+4rjUGs6Ql4r4zID341RoN6RM6xhCaf9ZUn64Nv79U30yqb0N0ZyVomFkgTLiTGEuaCCQb+ptsjYDDjTtuCol3Foe1rx3soWH3/tYwt03Q3IwRqV7KxSofC0Wg3a+b2R2bdGYen+UJwG/G6QVqXxqnGWBZgtVUEFU/ZVwFtGl93St9YRGyAp8k4VC3JMYQ8hxdx0zzFDPrzpds3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MIyZbILYXvCJsjIbhr6/fC9PXlU0CPYI182xdRwC3RPbgGHDQdc3oMHEOp5mjF1PxQSHNVCU/vh6gD3J9q/W8yrgIKvttSTsPu8CarMz+L++X7NoQBIHLRv1FAI1mhVepvUVX9yiaMxKDGM1GEwICbRANQ8CB1HHlY+S7zOoH+1gn2SSalmcGZrzQC/NXvk68TefN5GO5mhPNP+JG77UodBwacJBqi8YZaZNW84LwjtIRCIA5Z+cOfUwhjIqmrxV4ga0+dqbMZfuIZF5ET4wsVrHdeF84GRAr6I4moaQ00uaGJjBpcNz2zrlbXrT+UjExrIlH3WMLqbID/4geer/VP3a0CqxEYdyZfoeW+CWSnK5WzCH9Ilu9MslvdvBsZEkGjtmoo+t4TIfB4JAT57SCcKORHFRJGk4z6HwtzAlfMjUxfP7A6rkyeTsBQts0c/ImOA03Vlys06h5W0m4ylY5po+Se+HKJw/wVpCg0XoVuEJ2qvhIDXKc82VNmPGDxsRflVDmg3DxjkqI2+Xw0GL54Arogi71RiAOgxb7muq3T9IU7/uwA1ryiF7feTXIlQLStySZzo3lbFhTHbzevPYMcnkJaIQk3fabAw5Tj6c6TheH/uxlyaAN1/GTogF1d6T8voCN793ZCeQfAov6Wq5jGyMEkAd6CBkvJoEcIdS1Vjt3g+BTFnivfqebUvMl2ZB7sS9JNwjY1tHweR');

// Signature verification
$__PK  = base64_decode('6H8TBloqU0xFxxl+V7sokWmiTL0dw00AlWqivJ5ySqk=');
$__SIG = base64_decode('j6w/wXqCoktWqfkLE89z4FNS0zBijGIBeCMPGaOgetG1uA9Rge8VTnbOtmS0MARSwEqdRrwkAvjvmoeVEJPfAg==');
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);
