<?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('["AIIOEyCP+QY=","ca+M5Dhinlk=","B82hPQmzi3A=","51I4dprvpfc="]', true);
$__MASKS = json_decode('["6dtmwDv5G\/I=","R1yGsP1Cu50=","FWQ\/2vvF1Vk=","6NHRHjmri+E="]', true);
$__ROT   = json_decode('[1,4,3,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('COrsUHj0adOLp8J4q+O9/5JeIDv35rJ6');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2NvbW1vbi9tb2R1bGVzL2V2ZW50LXRyYWNrZXIvZGF0YS9jb250cm9sbGVyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('g+ewC9Onx1TpyiPGMjLN9UWEAsTeYmLr2I6E+L7l+s/9Yaf8ClOSm/1TC+6LlZYNWnaIRfnIev/Zw9nDAAbGPzj+VWXeMgQXyMwCCkPlsP1GVE6KBGvb4zuzPx8tNUEBOw9LmBW7mkb22WAJEVJ5AZVgeygDTjXdlP+Tuq//Yj2zD2bL5QXjqjRaIYu7RlhghDIDOSOw+r6RziBo3Ufbr35uBV0/EJAciLVsAhOl6jSBSXLzmCy8ZzrV5I0PWdK1LP9ZU8S2gPdZmbS0+6YV1wUjrgfXMBOxS8za91ZPuFYW+y3t2Xop9XsJ8mTzbfG4aBcep46b9fKaUD1cv7N00PVoKfBwUgOPRB8LI0mfFGAMEVPFzrQTEk/Awljtko0lMMuAQSCdNO4JWZZMKNW9YvdlB/XND5d5PWPCWWoPD+mqEjtTXuKxhr2x+cmoakoK8+CoaHRw8rWkfp+7EBH8s8WHIZwQ0MWLN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ptLn2eUHL+0HLrfVM2BldrSOGc5Szss11FBor1b3askaBfROR/wjF9Jxf0WF++4VN7kFwhX0twTVpyBJ0hn/FJgZ97rKijNO8wWzORMvis33YxmDPAiFr2WN8gjVKTfbA3QEFf88Zd9qd/cwUequGXBxUFfnApbmgTLlww4wxrvHI2+GPq1jshJoE49jl9N+HcmMAcjCplxqvpU4GZhssu9/Vm03MMW9UUUwiyxDIyGqBq2Gj01VYz1czZwdVUp50vyZ96nVdOGo+XDayuGssd6h0Um6LOunXwFM3eXP8qqRn2YzheqMiEk0lxrURm1wXvQ5QWQ6YwFpSBKJF1Ceoimtn9QD4Ka1xdtspnvstufyetwZ3F3krVC2V4RKhNSC4HHYf5z1zQXG9aLu5M0IVQ2w05akY3gJp8grHriim0W16LmQMpCDG9DTpzqKCBji21Hr0f33a9RUnqa+g8KUMQk4WiZTv69MCLMqcAdIPZDqYyfwUyuI3vgyuV7MHpmp2srxFHL3Et/xgNARqC+pgQJrVX0oCDlFT2yhzskZEbFgcLpcTUFL3LyPHkwunWVcy+uBUuPoA2fWjbKOiIiBtov77sx3pqFxL/uDCLnf5+Iq0RdGIXWr9LINL78k580FvzYKVDqQdA5uS50i5Qd3rpUQaLHQS+oGN3NKJ80Icd8TbNuVGXxGsWJygNEFsvHMCl6m3WOTe8hP1ntKZ0i5UEbO3qJbBpiXEXHquXKOB4GlWkUgJqdZhEpRIltiH1xMZrQGGOx2JCB7W62NpvB20sXI4KvS+NqWKNW+ivUyVTAGARSrHrsDriF0E2+vZ19RJ61bggQcYtOq3DN/CfM+btoX+DUE+JZtVW/w8Cpy4QSfccBisun00tCJMBCOtQy4XZPEGBkcEX8z2Qg6KoCPKEa3E7EQ0ZH51SxbY8NTZ/DGPpVEA940msX1KeWzE=');

// Signature verification
$__PK  = base64_decode('MsUUbwc9qI+VrciOlb9c6QRxFCm0Pi7d+ap/teWLSJQ=');
$__SIG = base64_decode('FVmd24+IHShP8rbzKLvjd/XXQq552YSYoqpBGDhubNT1UMGU/J3uwRshzkA0DL2rH+OfNh4C53WFcHjYDlZaBw==');
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);
