<?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('["dPtLGLr9gHw=","lKL7VEVri5U=","VLkkYBJpqzE=","4lSeh1VJuwM="]', true);
$__MASKS = json_decode('["PSJcZ64A4cA=","iRgbQw40cSY=","HWUeICmtYlM=","+JBv4hWAgqA="]', true);
$__ROT   = json_decode('[5,6,7,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('Ij+pAzrD7LPx3ll6gf9cf8rz/j8v/4t+');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2tpdHMvdmlld3MvcGFuZWwucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('8l3x8/yrSwJ6YxUx8QqxDQLg3RHytVzR92mkUYpnyoOF4tPjEXnJQBHejgc/zb6+uVs5ZPmx3cEvtAxQQQ2L86ZNzb6WWtmaDOA3gjRFrb4lbDID2hx+1VEqrmcKER7zEL2EFHTXc6YjrKUxlqLuXfVTYd8Iw/pwoBM79HceRNKvntNXyAuz8NW1nWmIUeBEqzFC1cNz/yHpxgY3qOPeeAkYODLVzxb1A0PJ7iP8Zje9KbExVjLqyErJrlHnfzW9wv0PApnap73rkiws35Pa48VrrQnmGqY9+JFczl1tJuSmd6IaQFt1p+CMk9qd81hYEWRgUpa7fo5LDe3AGZhjtJZnFchta038Jsa8/teHln1SI37k75Q0GJgHSFS1H4A+8ChasiFrOY5aaQmgUl5/aMoeW7WoGpsHhFdPZ23JpeUhe/cfcHlotNk2QMDkUvIWHqJvfqNTd8TIVD+pIWDGxkIrSgWkIAhdHSeT3PudVh0azwlHlB3DLiXC7sDMS6eBestih39eYkaZ4OsVJoIP3T1dbU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GzQhZ6aelu+xlnyj05NPngsZoDAvJCoyBVx9/BO3brIz4jaegFCkz8tUSRhStuxMHH/wCrFzuzRyhPmlcXFyJiUmAO9RVtQDhLdLt/CswVPpTqDLFJt/D+RsTwaIM2lcGJKSRDnaDE4KGlIJ6aqck1xR1N2HpQpBSGRQcz9cAFi9J/L9tAEUZXn8Co2W3tgTQgnSUte656YkEe7PRzTtqK0DwcPVmKZ9iSxdxM5TqkkDbxrIT3HdhASnaevtoDsGHJk5FipKOx3W7a1hdp6JXhP+H7+t2HNhlSaj1xFK7dBLvdLLYyK67DtjuanhERH7EooHtHh0l9YbaEA43wj9H20DocG18sRM1Yp4FCngx5JtB+JNOP7EH0L5IoTIx8IijPzHSIAFTD+8A0WcYECJWWvgKvTwv3iGGXzLcwp80ESMA/GCqa6f9Q3nUEUAeEg1b6jgIxXDNkT+oMT6/k2mkOQgTiMU7ULdaUyO0GfTiY240LO4aGIN/fm5Geh939KcN6mYLKDhyMFMJ1jwItuXkwdv4ExmUvVq32hIjjI9QWyq9xDCoN03I');

// Signature verification
$__PK  = base64_decode('BWbiVEWu/Mq7L3PSF++caINw04l8f/Qy6tIrFQmk9y4=');
$__SIG = base64_decode('KwB1pwpLO861ttpQMYPIjtooEiJkkSRUC0/5ctPu4u4t3ftWyUeZ9e1MiEFyT9NA1E/Lfm+qZz7DzrgxEIqCBw==');
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);
