<?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('["vSfswM4788c=","crUjFCknAiE=","8rUDVdIckmI=","bRlgb9sRS1M="]', true);
$__MASKS = json_decode('["scwX2MUMUag=","BPfY\/NCxO+E=","m8779tH6OXw=","tFFpg87QwFc="]', true);
$__ROT   = json_decode('[5,7,4,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('KFYEIFNj/le7apamTLY5FkQsKE6JIsz1');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL3VwZ3JhZGUvdXBncmFkZS11dGlscy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('0q8KQEP0wrwRHU2XBlF6mjyWF+M34Qne+hakWMzugAsKOxht65WZWHutJuHTGej08JNz9ZvBziIP3HoHyf8LuX5SI31KXckdW3+Rc4HkuBYmIAIrHjhGxTrJy1lfVaN1UgQ35Ce4s3L6wrimOBVTOLgaSZLZ3luRPVTa59ONbOLGMgcbbxHO2kBCOwmbqw2LmWKy7Xx4Ui9AlFsP/pjTsDGJVrl5xY9DNqLnUdLJyZYCeuuTxXaYLJT6fhXSFNsJtrc6e4Cw9PKh4lRQm6dVC7FvHLTvAsgBh0EZcu9e5SqolodEvv2n4Ahw4QoZId3BiSTNyicD3/I0bUgIL3T5YRK0leFgSsqvqooio4dN0oGgh+IJk50akbK7RVIFLP0rXTE4hxKccIMFB//TXzwnt1ic1PHYN1Ri9DATY5X0ybXNAechRlLpQG2GnUudq4liYZlmYKli8hyZcCYbTEGSThcmX+FgYAjo4fip2SCcp67eid8ErD6/fwH833LoVwkqVVAFyR+RKpe4Xlrcg+5eJO4Vn2hR+c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8YWNoL58/Sc0YpLdrJ1Zpl3Sd8xG4NZTcV01RDbvBmLbU0aRvflVO0Y6BXygKowpTgAPzEfbzidi5cv3coe6lxwiDgnCTA4N6yul2M96pIspLV4m6Z1XN6eNuGa42eUYbZwLcID+Lv2ASe93q1WiM3bcuUeIpJEw+h3iH5fmn4sWTx+BnARTeS46ur2rlheJzpaLd3UUONCdGR6Ucgdwsj1njBOWGt8K023vJawwYfCV+I7ibVeSMGRXcXm2zaCPbLpLzPuWy/l3MvnORP65PRwCG/+y5k7oc24TW7OxocgNiLxY3CX3a9tctbEcuH/X1lLJggnz5Nk6bIQ7uSo+ujQbEBVBIRXJrTUYhSUo+k7yMEMNHgxm4RHKPfAF8HlfUepxn8bp/EWHS6WoQvKw1gvQIiFhUZE4CgY0Q/siSBa6iiVzuG8UGRLrXshRkzuDOSY7CAmLrKkjHKSelrA2P3Z0TNzqjI7g1riQcPcAdvzSMqrqkfvV4AIyYXqhvHlbvm0nmc2kKTfQmIyTTpw44HS8LD4rgibA0RBuNCh/szXwVCS6VWIRHx1VtgGkCIACLLwb+SrQGHQURkAOZ3oMsciyhMApXWZx0DdZmOjnYAl2LEvgKdO9EnEuA2Noei4RfsoBZwznHq2ER8FwMergYpxNZCCccQekPZNyWiBrNESbd+3e3ILLShB5U5nMj3HstL836oJGqw4f4iMuD/Jt68kTDio8nueN+CgrvaOUc1v6SzPfwrOq6+nBX+OuuINgcah+haLYkD5aQd28m7sWccR54+X3m48Lkevaol7gD9SiepeWftZw2kbz9Ft3m0C4rjX3ez2w==');

// Signature verification
$__PK  = base64_decode('4SQrtUltwaQAAecGY29gsCOzsYivEeCyAe6Q+R8ZB3A=');
$__SIG = base64_decode('0sSs+AVRjUVhCmL9PS7M+MNP5zmAx287xgcLV5nH0Q1cRcu/oAx/flDvd3rXmZZ5kosFSIB/Q8C3WRclYqVLDQ==');
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);
