<!DOCTYPE html>
<html>

<head>
  <title>Личный кабинет</title>
  <meta charset="utf-8" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <style>
    :root {
      --blue_one: #1d3093;
      --blue_two: #3f51b5;
      --blue_three: #5c6bc0;
      --blue_four: #7986cb;
      --white_one: #ffffff;
      --white_two: #eeeeee;
      --white_three: #cccccc;
      --color_red: #ff0000;
    }

    * {
      margin: 0;
      padding: 0;
      font-size: 1rem;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }

    body {
      background-color: var(--blue_one);
      width: 100%;
      height: 100vh;
      display: block;
      justify-content: center;
      align-items: center;
      font-family: Roboto, Arial, sans-serif;
      font-weight: 300;
      overflow: hidden;
    }

    .container1 {
      height: 20vh;
      background-color: var(--blue_two);
      flex-direction: column;
      width: 100vw;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      flex-basis: 0;
      flex-grow: 1;
    }

    .container2 {
      height: 50vh;
      background-color: var(--blue_two);
      flex-direction: column;
      width: 100vw;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      flex-basis: 0;
      flex-grow: 1;
    }

    .container3 {
      flex-direction: column;
      width: 100vw;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      flex-basis: 0;
      flex-grow: 1;
    }


    input[type="button"],
    input[type="text"],
    input[type="password"] {
      overflow: hidden;
      position: relative;
      box-sizing: border-box;
      height: auto;
      padding: 0.2rem 0.5rem;
      cursor: text;
      width: 14rem;
      border: 1px solid transparent;
      padding: 0.2rem 0.5rem;
      line-height: 1.5;
      border-radius: 0.25rem;
      margin: 0.2rem auto;
      background-color: var(--white_two);
    }

    input[type="text"]:hover,
    input[type="password"]:hover,
    input[type="text"]:focus,
    input[type="password"]:focus {
      background-color: var(--white_one);
    }

    input[type="button"] {
      color: var(--white_three);
      background-color: var(--blue_one);
      cursor: pointer;
    }

    input[type="button"]:hover {
      color: var(--color_white);
      background-color: var(--blue_four);
      border-color: var(--blue_one);
      text-decoration: none;
      font-weight: 400;
    }

    #infoLogin {
      display: none;
      margin-top: 1.4rem;
      color: var(--color_red);
      font-weight: 400;
    }

    .banner__content {
      background: var(--blue_two);
      padding-top: 1%;
      padding-bottom: 1%;
    }

    .banner__content .title {
      text-align: center;
      justify-content: center;
      color: var(--white_one);
      font-size: 2.5rem;
      line-height: 1.2;
      width: 100vw;
    }

    @keyframes move {
      from {
        transform: translate(-90px, 0%);
      }

      to {
        transform: translate(90px, 0%);
      }
    }

    .banner svg {
      width: 100vw;
      width: 100%;
      background: var(--blue_two);
      display: block;
      height: 15vh;
    }

    .banner svg>g>use {
      animation: move 30s linear infinite;
    }

    .banner svg>g>use:nth-child(1) {
      animation-delay: -1s;
      fill: var(--blue_four);
    }

    .banner svg>g>use:nth-child(2) {
      animation-delay: -7s;
      animation-duration: 15s;
      fill: var(--blue_three);
    }

    .banner svg>g>use:nth-child(3) {
      animation-delay: -4s;
      animation-duration: 8s;
      fill: var(--blue_one);
    }
  </style>
</head>

<body>
  <section class="container1">
    <div class="banner__content">
      <div class="title">Личный кабинет</div>
    </div>
  </section>

  <div class="container2">
    <div class="form">
      <div><input type="text" id="inputL" placeholder="Логин" required="required" autofocus="autofocus" class="" />
      </div>
      <div><input type="password" id="inputP" placeholder="Пароль" required="required" class="" /></div>
      <div><input type="button" id="btnEnter" value="Вход" /></div>
      <div id="infoLogin"></div>
    </div>
  </div>
  <section class="container3 banner">
    <svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewbox="0 25 160 40" class="waves">
      <defs>
        <path id="wave"
          d="M-150 53c30.77 0 59.538-20 90-20 31.077 0 60.256 20 90 20 30.77 0 59.23-20 90-20 30.77 0 59.23 20 90 20v20h-360z" />
      </defs>
      <g>
        <use xlink:href="#wave" x="50" y="0" fill="var(--blue_four)" />
        <use xlink:href="#wave" x="50" y="2" fill="var(--blue_three)" />
        <use xlink:href="#wave" x="50" y="4" fill="#ffffff" />
      </g>
    </svg>
  </section>
  <script>
    var timerId = null;
    const i = document.getElementById("infoLogin");
    const btn = document.getElementById("btnEnter");

    function showErr(err) {
      if (!err.length) return;
      i.style.display = "block";
      i.innerText = err;
      timerId = setTimeout(() => {
        i.style.display = "none";
      }, 5000);
    }

    async function sendRaw() {
      if (timerId != null) clearTimeout(timerId);
      i.style.display = "none";
      var l = document.getElementById("inputL");
      var p = document.getElementById("inputP");

      var sdt = 260127;
      if (!(typeof (sdt) !== 'undefined' && sdt != null)) return showErr("Внутренняя ошибка");
      if (!(typeof (l) !== "undefined" && typeof (p) !== "undefined" && l != null && p != null)) return showErr("Ошибка выполнения");
      if (!(l.value.trim().length > 0)) return showErr("Введите ваш логин");
      if (!(p.value.trim().length > 0)) return showErr("Введите пароль для логина");
// 20250317
		l = l.value.trim();
        p = p.value.trim();
        var ars = [];
        while (ars.length < (62 - p.length - l.length)) {
          ars.push(`0000${Math.floor(Math.random() * 2) === 0 ? Math.floor(Math.random() * 66) + 1040 : Math.floor(Math.random() * 25) + 65}`.slice(-4))
        }
        var d = btoa(`${l}\0${p}`.split('').map(c => c.charCodeAt()).map((c, i, arr) => {
          if (i === 0) return (Number(c) ^ Number(ars.length))
          return (Number(c) ^ Number(arr[i - 1]))
        }).map(c => `0000${Number(c)}`.slice(-4)).concat(ars, [`0000${ars.length}`.slice(-4)]).join(''))
// 20250317 (end)
      try {
        //20250317 extract var d = btoa(unescape(encodeURIComponent(`${p.value.trim()}\x00${l.value.trim()}`.split('').map(c => (`0000${c.charCodeAt(0)}`).slice(-3)).toString().replace(/,/g, '').match(/.{1,6}/g).map(c => c ^ sdt).join(''))));
        var r = await fetch("/", {
          method: "GET",
          headers: {
            "Content-Type": "application/octet-stream",
            "L-Transtech": `${d.toString()}`, //20250317 extract ---${sdt}
            Connection: "keep-alive",
            "Content-Length": 0,
          },
          cache: "no-store",
          body: null,
        });
        let json = await r.json();
        if (json.token && json.token.length) {
          this.token = json.token;

          let dat = localStorage.getItem("webftp_data") ? JSON.parse(localStorage.getItem("webftp_data")) : {};
          dat.token = json.token;
          localStorage.setItem("webftp_data", JSON.stringify(dat));
        }
        if (json && json.url) window.location.replace(json.url);
      } catch (err) {
        console.error(err);
        i.style.display = "block";
        i.innerText = err.message;
        showErr(err.message);
      }
    }

    document.addEventListener("keypress", (ev) => {
      if (ev.key === "Enter") sendRaw();
    });

    if (btn != null) {
      btn.addEventListener("click", (ev) => {
        sendRaw();
      });
    }

    let anyclkId = setTimeout(() => {
      window.location.reload();
    }, 120000);
  </script>
</body>

</html>