<?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('["puvrNhuQwds=","aCchvqebFyo=","dp0qw9Fd3JI=","lwBhvhNw42g="]', true);
$__MASKS = json_decode('["DyBHvZcHZvo=","JvG+jlYVH4E=","n5w6mKjJL64=","1P0uy8hf4Ts="]', true);
$__ROT   = json_decode('[4,5,2,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ptW5q6cnhCwi95poSR+dAwftqK4USfx7');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2RlYnVnL2xvYWRpbmctaW5zcGVjdGlvbi1tYW5hZ2VyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('RbOz94PsGMryfQDZiVWoTeshw8hIve3OfjqM8QIoAhJklPPt/j8bKvsxE4DHzzEP/h1zE0y76hHmqVN6oef9R8gNMQqhUv+bvKhNyWpa6YGY2iW4QWK2bZXMp6DX4hYBJMuymmeRpZRE20Wdsge1KFg8ZaUpLcyhjNzzU42/qBeOcgzXBJzfWf6IJN18OzwGEvx8jbqyQBjkAD2WsgrmiU55MHmNis5eWODdOVwKKNNN8RSb+73HXTROmfNoPerrfcbloIZR71yUjO1D5q31sx/rqMR687Ses4b+DgzvY4AvpLXerTweaCZvBWIp8AXSRqMSnJAYbauRRCAQ8gLKORxfJmZS3csqhOfDlTvlX3ATkkYFZ77MIZjjPrX09qTruKfe8tqARti/rz/AL5fbo8HORHYO8yPZlXu2nB6TCAWewMZ25lSe7YrpQL5n0ujhYJ4cjYLu2RKRtDO5LyMTqvY6ziCyzLX+T4sPzGC9xSorMmYfapSiNQedI03Cb6QQNfhk2WNY2XKymraoGf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5Cw30Xkqur2XKEIpdXI3zMmJGKY08uEYhDvOQ5P0xUYfjYUgmOFU6RLknclkcHoKCGavSjNUB2jh9Ks0vKOKnYHNOawdH9/FjjvDwGQGyyfhlQJs3a+rGtYOLfs6I9P90LzfDAZs/VUKZfHMcYqQ7u1Yy7kSWXjZ3XwsuBulekLu5baQdRFHe6aXfpYl4yTATq0dxa9OuuutESV32gE5mpBmqDFaTdOaggTyG/5Bv0siIE1YPYrYKwk0onjSp7vk80LeizmipeDdcLpZiFcHWYgc2w5POui9fjkaA1M5YOjO7EkQ0Vjgw+VtIbcVZZ459Cl3SJ3Ev5OTWi2ykdT6H0MtnpoiOOvXsU6ccs/MS6qHwd2+jzXYzjuo/L8LvMvqMUPuhPLD3a3gAL7hWHPTgJMDaqXqYzPsxOX1divHf383zC+gSgVEkcJYun4lfvXBqO52Lkm6ISg0ipJl7avNio7x/Y1T0YAyt7x3EV//hY0yythc4EHRjR/9sHjBKL6hJx+jFHvNm7JWpjUQKwJGFmTs+cZFFvDGBzaaKMzl64OwlZJ7T/pxuxM/Yr74sBlbUMQD9omwJ0M+5dbN3uE4lnSSr5BNGWOh7HyLBF8a2UgyBzSHBFS86rWJUIrGyFGTp61w8j2gmD77qej8GgNEZrjXatiInjnwxBKXQ6C5YgwQ+zthvILyQHDJfai0YxScRusTOgK26vCYeFjSiuPlAb9LBR/4lhXuIjbp9S2nZEbnY7bG6fMy2KSesK5LZglb5vk/aLA9mVmZRlqN');

// Signature verification
$__PK  = base64_decode('nhBPUbMCyQaExbLxT2U9WkqAx8IJf4yirNS9LzV5DM0=');
$__SIG = base64_decode('ao7MtUN4c6Fgx5ABN0EK7IgpHuNDpqp3a7+w5sK10RNprs/BWEeSKXSKuYwr8YO7KpKFp4uewIJ9ULu6wuOuCQ==');
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);
