var Se = (e, t, r) => new Promise((n, h) => {
  var E = (b) => {
    try {
      x(r.next(b));
    } catch (L) {
      h(L);
    }
  }, U = (b) => {
    try {
      x(r.throw(b));
    } catch (L) {
      h(L);
    }
  }, x = (b) => b.done ? n(b.value) : Promise.resolve(b.value).then(E, U);
  x((r = r.apply(e, t)).next());
});
import { r as Ke, h as p, F as We, g as ot, H as st } from "./index-2ff63899-BVVddQHZ.js";
const Ae = "__WIDGET_GLOBAL_STYLE_CACHE__";
function Ue(e, t) {
  if (e) {
    const r = document.createElement("style");
    r.innerHTML = t, e.appendChild(r);
  }
}
function He(e, t) {
  if (!e || !t)
    return;
  const r = new URL(t);
  fetch(r.href).then((n) => n.text()).then((n) => {
    const h = document.createElement("style");
    h.innerHTML = n, e && e.appendChild(h);
  }).catch((n) => {
    console.error("There was an error while trying to load client styling from URL", n);
  });
}
function Ze(e, t, r, n = !1) {
  if (!window.emMessageBus)
    return;
  if (!("adoptedStyleSheets" in Document.prototype) || !n)
    return r = dt(e, t), r;
  window[Ae] || (window[Ae] = {}), r = lt(e, t);
  const E = r.unsubscribe.bind(r), U = () => {
    if (window[Ae][t]) {
      const x = window[Ae][t];
      x.refCount > 1 ? x.refCount = x.refCount - 1 : delete window[Ae][t];
    }
    E();
  };
  return r.unsubscribe = U, r;
}
function dt(e, t) {
  const r = document.createElement("style");
  return window.emMessageBus.subscribe(t, (n) => {
    e && (r.innerHTML = n, e.appendChild(r));
  });
}
function lt(e, t) {
  return window.emMessageBus.subscribe(t, (r) => {
    if (!e)
      return;
    const n = e.getRootNode(), h = window[Ae];
    let E = h[t] && h[t].sheet;
    E ? h[t].refCount = h[t].refCount + 1 : (E = new CSSStyleSheet(), E.replaceSync(r), h[t] = {
      sheet: E,
      refCount: 1
    });
    const U = n.adoptedStyleSheets || [];
    U.includes(E) || (n.adoptedStyleSheets = [...U, E]);
  });
}
const ut = "en", Qe = {
  en: {
    popupMessage: "Please enter the security code received on your email address to perform the update.",
    popupMessageLastWarning: "If the next validation attempt is failed, you will be logged out and blocked temporarily.",
    minutes: "minutes",
    errorHeader: "Error",
    configError: "Unable to load OTP data. Please try again later.",
    otpHeading: "Enter OTP",
    resendOtp: "Resend OTP",
    submit: "Submit",
    close: "Close",
    invalidOtp: "The code you've sent is not valid. Please try again.",
    accountBlocked: "Too many attempts for OTP. Your account has been blocked for one hour.",
    submissionError: "Something went wrong. Please try again.",
    otpExpiredMessage: "Validation code has expired, please request a new one to continue.",
    otpDigit: "OTP digit",
    verifying: "Verifying...",
    otpVerified: "OTP Verified Successfully!"
  },
  ro: {
    popupMessage: "Introduceți codul de securitate primit pe adresa dvs. de e-mail pentru a efectua actualizarea.",
    popupMessageLastWarning: "Dacă următoarea încercare de validare eșuează, veți fi delogat și blocat temporar.",
    minutes: "minute",
    errorHeader: "Eroare",
    configError: "Nu s-a putut încărca datele OTP. Vă rugăm să încercați din nou mai târziu.",
    otpHeading: "Introduceți OTP",
    resendOtp: "Retrimitere OTP",
    submit: "Trimite",
    close: "Închide",
    invalidOtp: "Codul introdus nu este valid. Vă rugăm să încercați din nou.",
    accountBlocked: "Prea multe încercări de OTP. Contul dvs. a fost blocat timp de o oră.",
    submissionError: "Ceva a mers prost. Vă rugăm să încercați din nou.",
    otpExpiredMessage: "Codul de validare a expirat, vă rugăm să solicitați unul nou pentru a continua.",
    otpDigit: "Cifră OTP",
    verifying: "Se verifică...",
    otpVerified: "OTP verificat cu succes!"
  },
  fr: {
    popupMessage: "Veuillez entrer le code de sécurité reçu sur votre adresse e-mail pour effectuer la mise à jour.",
    popupMessageLastWarning: "Si la prochaine tentative de validation échoue, vous serez déconnecté et temporairement bloqué.",
    minutes: "minutes",
    errorHeader: "Erreur",
    configError: "Impossible de charger les données OTP. Veuillez réessayer plus tard.",
    otpHeading: "Entrez OTP",
    resendOtp: "Renvoyer OTP",
    submit: "Soumettre",
    close: "Fermer",
    invalidOtp: "Le code que vous avez saisi n’est pas valide. Veuillez réessayer.",
    accountBlocked: "Trop de tentatives OTP. Votre compte a été bloqué pendant une heure.",
    submissionError: "Quelque chose s'est mal passé. Veuillez réessayer.",
    otpExpiredMessage: "Le code de validation a expiré, veuillez en demander un nouveau pour continuer.",
    otpDigit: "Chiffre OTP",
    verifying: "Vérification...",
    otpVerified: "OTP vérifié avec succès!"
  },
  hu: {
    popupMessage: "Kérjük, adja meg az e-mail címére küldött biztonsági kódot a frissítés végrehajtásához.",
    popupMessageLastWarning: "Ha a következő érvényesítési kísérlet sikertelen, ki lesz jelentkeztetve és ideiglenesen letiltva.",
    minutes: "perc",
    errorHeader: "Hiba",
    configError: "Nem sikerült betölteni az OTP adatokat. Kérjük, próbálja újra később.",
    otpHeading: "OTP megadása",
    resendOtp: "Újraküldés",
    submit: "Beküldés",
    close: "Bezárás",
    invalidOtp: "A megadott kód érvénytelen. Kérjük, próbálja újra.",
    accountBlocked: "Túl sok OTP próbálkozás. A fiókja egy órára zárolva lett.",
    submissionError: "Valami hiba történt. Kérjük, próbálja újra.",
    otpExpiredMessage: "A megerősítő kód lejárt, kérjük, kérjen egy újat a folytatáshoz.",
    otpDigit: "OTP számjegy",
    verifying: "Ellenőrzés...",
    otpVerified: "OTP sikeresen ellenőrizve!"
  },
  tr: {
    popupMessage: "Güncellemeyi gerçekleştirmek için e-posta adresinize gelen güvenlik kodunu girin.",
    popupMessageLastWarning: "Bir sonraki doğrulama girişimi başarısız olursa, oturumunuz kapatılacak ve geçici olarak engelleneceksiniz.",
    minutes: "dakika",
    errorHeader: "Hata",
    configError: "OTP verisi yüklenemedi. Lütfen daha sonra tekrar deneyin.",
    otpHeading: "OTP Girin",
    resendOtp: "OTP'yi Yeniden Gönder",
    submit: "Gönder",
    close: "Kapat",
    invalidOtp: "Gönderdiğiniz kod geçersiz. Lütfen tekrar deneyin.",
    accountBlocked: "Çok fazla OTP denemesi yapıldı. Hesabınız bir saat boyunca kilitlendi.",
    submissionError: "Bir şeyler yanlış gitti. Lütfen tekrar deneyin.",
    otpExpiredMessage: "Doğrulama kodunun süresi doldu, devam etmek için lütfen yeni bir tane isteyin.",
    otpDigit: "OTP rakamı",
    verifying: "Doğrulanıyor...",
    otpVerified: "OTP başarıyla doğrulandı!"
  },
  el: {
    popupMessage: "Παρακαλώ εισάγετε τον κωδικό ασφαλείας που λάβατε στο email σας για να ολοκληρώσετε την ενημέρωση.",
    popupMessageLastWarning: "Αν η επόμενη προσπάθεια επικύρωσης αποτύχει, θα αποσυνδεθείτε και θα αποκλειστείτε προσωρινά.",
    minutes: "λεπτά",
    errorHeader: "Σφάλμα",
    configError: "Δεν ήταν δυνατή η φόρτωση των δεδομένων OTP. Παρακαλούμε προσπαθήστε ξανά αργότερα.",
    otpHeading: "Εισαγωγή OTP",
    resendOtp: "Αποστολή ξανά OTP",
    submit: "Υποβολή",
    close: "Κλείσιμο",
    invalidOtp: "Ο κωδικός που εισαγάγατε δεν είναι έγκυρος. Παρακαλώ προσπαθήστε ξανά.",
    accountBlocked: "Πάρα πολλές προσπάθειες OTP. Ο λογαριασμός σας έχει αποκλειστεί για μία ώρα.",
    submissionError: "Κάτι πήγε στραβά. Παρακαλώ προσπαθήστε ξανά.",
    otpExpiredMessage: "Ο κωδικός επαλήθευσης έχει λήξει, παρακαλώ ζητήστε έναν νέο για να συνεχίσετε.",
    otpDigit: "Ψηφίο OTP",
    verifying: "Επαλήθευση...",
    otpVerified: "Το OTP επαληθεύτηκε με επιτυχία!"
  },
  es: {
    popupMessage: "Por favor, introduzca el código de seguridad recibido en su correo electrónico para realizar la actualización.",
    popupMessageLastWarning: "Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",
    minutes: "minutos",
    errorHeader: "Error",
    configError: "No se pudo cargar los datos del OTP. Por favor, inténtelo de nuevo más tarde.",
    otpHeading: "Introducir OTP",
    resendOtp: "Reenviar OTP",
    submit: "Enviar",
    close: "Cerrar",
    invalidOtp: "El código que ingresaste no es válido. Por favor, inténtalo de nuevo.",
    accountBlocked: "Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",
    submissionError: "Algo salió mal. Por favor, inténtelo de nuevo.",
    otpExpiredMessage: "El código de validación ha expirado, por favor solicite uno nuevo para continuar.",
    otpDigit: "Dígito OTP",
    verifying: "Verificando...",
    otpVerified: "¡OTP verificado exitosamente!"
  },
  pt: {
    popupMessage: "Por favor, insira o código de segurança recebido no seu e-mail para realizar a atualização.",
    popupMessageLastWarning: "Se a próxima tentativa de validação falhar, será desconectado e temporariamente bloqueado.",
    minutes: "minutos",
    errorHeader: "Erro",
    configError: "Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",
    otpHeading: "Insira o OTP",
    resendOtp: "Reenviar OTP",
    submit: "Enviar",
    close: "Fechar",
    invalidOtp: "O código inserido não é válido. Por favor, tente novamente.",
    accountBlocked: "Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",
    submissionError: "Algo deu errado. Por favor, tente novamente.",
    otpExpiredMessage: "O código de validação expirou, por favor solicite um novo para continuar.",
    otpDigit: "Dígito OTP",
    verifying: "Verificando...",
    otpVerified: "OTP verificado com sucesso!"
  },
  hr: {
    popupMessage: "Unesite sigurnosni kod primljen na vašu e-mail adresu kako biste izvršili ažuriranje.",
    popupMessageLastWarning: "Ako sljedeći pokušaj provjere ne uspije, bit ćete odjavljeni i privremeno blokirani.",
    minutes: "minute",
    errorHeader: "Greška",
    configError: "Nije moguće učitati OTP podatke. Pokušajte ponovno kasnije.",
    otpHeading: "Unesite OTP",
    resendOtp: "Ponovno pošalji OTP",
    submit: "Pošalji",
    close: "Zatvori",
    invalidOtp: "Uneseni kod nije valjan. Molimo pokušajte ponovo.",
    accountBlocked: "Previše pokušaja unosa OTP-a. Vaš račun je blokiran na jedan sat.",
    submissionError: "Nešto je pošlo po zlu. Molimo pokušajte ponovo.",
    otpExpiredMessage: "Kod za potvrdu je istekao, molimo zatražite novi kako biste nastavili.",
    otpDigit: "OTP znamenka",
    verifying: "Provjera...",
    otpVerified: "OTP uspješno potvrđen!"
  },
  de: {
    popupMessage: "Bitte geben Sie den Sicherheitscode ein, den Sie an Ihre E-Mail-Adresse erhalten haben, um das Update durchzuführen.",
    popupMessageLastWarning: "Wenn der nächste Validierungsversuch fehlschlägt, werden Sie abgemeldet und vorübergehend gesperrt.",
    minutes: "Minuten",
    errorHeader: "Fehler",
    configError: "OTP-Daten konnten nicht geladen werden. Bitte versuchen Sie es später erneut.",
    otpHeading: "OTP eingeben",
    resendOtp: "OTP erneut senden",
    submit: "Absenden",
    close: "Schließen",
    invalidOtp: "Der eingegebene Code ist ungültig. Bitte versuchen Sie es erneut.",
    accountBlocked: "Zu viele OTP-Versuche. Ihr Konto wurde für eine Stunde gesperrt.",
    submissionError: "Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",
    otpExpiredMessage: "Der Bestätigungscode ist abgelaufen, bitte fordern Sie einen neuen an, um fortzufahren.",
    otpDigit: "OTP-Ziffer",
    verifying: "Wird geprüft...",
    otpVerified: "OTP erfolgreich verifiziert!"
  },
  "es-mx": {
    popupMessage: "Por favor, ingrese el código de seguridad recibido en su correo electrónico para realizar la actualización.",
    popupMessageLastWarning: "Si el siguiente intento de validación falla, se cerrará tu sesión y serás bloqueado temporalmente.",
    minutes: "minutos",
    errorHeader: "Error",
    configError: "No se pudieron cargar los datos del OTP. Inténtelo de nuevo más tarde.",
    otpHeading: "Ingrese OTP",
    resendOtp: "Reenviar OTP",
    submit: "Enviar",
    close: "Cerrar",
    invalidOtp: "El código que ingresó no es válido. Inténtelo de nuevo.",
    accountBlocked: "Demasiados intentos de OTP. Su cuenta ha sido bloqueada por una hora.",
    submissionError: "Algo salió mal. Por favor, inténtelo de nuevo.",
    otpExpiredMessage: "El código de validación ha expirado, por favor solicite uno nuevo para continuar.",
    otpDigit: "Dígito OTP",
    verifying: "Verificando...",
    otpVerified: "¡OTP verificado exitosamente!"
  },
  "pt-br": {
    popupMessage: "Por favor, digite o código de segurança recebido no seu e-mail para realizar a atualização.",
    popupMessageLastWarning: "Se a próxima tentativa de validação falhar, você será desconectado e bloqueado temporariamente.",
    minutes: "minutos",
    errorHeader: "Erro",
    configError: "Não foi possível carregar os dados do OTP. Tente novamente mais tarde.",
    otpHeading: "Digite o OTP",
    resendOtp: "Reenviar OTP",
    submit: "Enviar",
    close: "Fechar",
    invalidOtp: "O código informado não é válido. Tente novamente.",
    accountBlocked: "Muitas tentativas de OTP. Sua conta foi bloqueada por uma hora.",
    submissionError: "Algo deu errado. Por favor, tente novamente.",
    otpExpiredMessage: "O código de validação expirou, por favor solicite um novo para continuar.",
    otpDigit: "Dígito OTP",
    verifying: "Verificando...",
    otpVerified: "OTP verificado com sucesso!"
  }
}, Ye = (e) => new Promise((t) => {
  fetch(e).then((r) => r.json()).then((r) => {
    Object.keys(r).forEach((n) => {
      for (let h in r[n])
        Qe[n][h] = r[n][h];
    }), t(!0);
  });
}), k = (e, t) => {
  const r = t;
  return Qe[r !== void 0 ? r : ut][e];
}, ct = ".OtpPopupOverlay{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--emw--color-overlay, rgba(0, 0, 0, 0.5));display:flex;align-items:center;justify-content:center}.OtpButton{font-family:var(--emw--button-typography);border:var(--emw--button-border, none);border-radius:var(--emw--button-border-radius, 3px);border-color:var(--emw--button-border-color);background-color:var(--emw--button-background-color, var(--emw--color-primary, #007bff));color:var(--emw--button-typography, var(--emw--color-white, #fff));padding:10px 20px;cursor:pointer;font-size:16px}.OtpButton.error{background:var(--emw--color-error, #dd3434)}.OtpPopupContent{position:relative;background:var(--emw--color-white, #fff);padding:20px;border-radius:5px;text-align:center;min-width:25%;min-height:200px;display:flex;flex-direction:column;justify-content:center;gap:20px}.OtpPopupContent .OtpError{display:flex;flex-direction:column;gap:20px;align-items:center}.OtpPopupContent .OtpError .OtpErrorHeader{display:flex;justify-content:center;gap:5px}.OtpPopupContent .OtpError h2{margin:0}.OtpPopupContent .OtpError svg{width:25px;fill:var(--emw--color-error, #dd3434)}.OtpFieldWrapper{display:flex;flex-direction:column;gap:10px}.OtpFieldWrapper h2{margin:0}.OtpField{display:flex;justify-content:center}.OtpField input{width:24px;font-size:32px;padding:10px;text-align:center;border-radius:5px;margin:2px;border:2px solid var(--emw--otp-border-color, #55525c);font-weight:bold;outline:none;transition:all 0.1s}.OtpField input.space{margin-right:1rem !important}.OtpField input:focus{border:2px solid var(--emw--color-primary, #007bff);box-shadow:0 0 2px 2px var(--emw--color-primary, #007bff)}.OtpActionButtons{display:flex;justify-content:space-between}.OtpErrorMessage{color:var(--emw--color-error, #dd3434);font-weight:bold}.OtpLoaderContainer{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.OtpLoader{width:48px;height:48px;border:5px solid var(--emw--color-secondary, #b3d8ff);border-bottom-color:var(--emw--color-primary, #007bff);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}.OtpSuccessOverlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(var(--emw--color-green-rgb, 255, 255, 255), 0.95);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;z-index:10}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}", ht = ct, pt = class {
  /**
   * Watch for changes in the translation URL and fetch new translations
   */
  handleNewTranslations() {
    Ye(this.translationUrl);
  }
  /**
   * Watch for changes in the client styling and apply the new styling
   *
   * @param newValue - new client styling
   * @param oldValue - previous client styling
   */
  handleClientStylingChange(e, t) {
    e !== t && Ue(this.el, this.clientStyling);
  }
  /**
   * Watch for changes in the client styling URL and fetch the new CSS.
   *
   * @param newValue - new client styling URL
   * @param oldValue - previous client styling URL
   */
  handleClientStylingUrlChange(e, t) {
    e != t && this.clientStylingUrl && He(this.stylingContainer, this.clientStylingUrl);
  }
  /**
   * Handles the custom `stepUpAuthRequired` event fired on the window.
   * This event typically signals that step-up authentication is required.
   *
   * @param event - A CustomEvent that contains authentication-related details.
   *
   * Expected `event.detail` structure:
   * {
   *   'x-step-up-required': true,
   *   'x-step-up-token': string,
   *   'flow': string
   * }
   */
  handleStepUpAuthEvent(e) {
    return Se(this, null, function* () {
      var t;
      if (!((t = e.detail) === null || t === void 0) && t["x-step-up-required"]) {
        if (this.hasConfigErrors = !1, this.hasErrors = !1, this.errorMessage = "", this.showPopup = !0, this.token = e.detail["x-step-up-token"], this.flow = e.detail.flow, !this.token || !this.flow) {
          this.isLoading = !1, this.hasConfigErrors = !0, this.errorMessage = k("configError", this.language);
          return;
        }
        yield this.getConfig();
      }
    });
  }
  /**
   * Listens for the global 'closePopup' event to close the popup manually.
   */
  handleCloseWidget() {
    this.countdownTimer && (clearInterval(this.countdownTimer), this.countdownTimer = null), this.hasErrors = !1, this.hasConfigErrors = !1, this.errorMessage = "", this.showPopup = !1, this.isLastWarning = !1;
  }
  /**
   * Class constructor
   */
  constructor(e) {
    Ke(this, e), this.otpInputs = [], this.countdownTimer = null, this.expirationTimestamp = 0, this.mbSource = void 0, this.clientStyling = void 0, this.clientStylingUrl = void 0, this.language = "en", this.endpoint = void 0, this.userSession = void 0, this.translationUrl = "", this.showPopup = !1, this.otp = void 0, this.isLoading = !0, this.config = null, this.timeLeft = 0, this.expirationTime = "", this.serverTime = "", this.hasErrors = !1, this.hasConfigErrors = !1, this.errorMessage = "", this.token = "", this.flow = "", this.showResendOtp = !1, this.isLastWarning = !1, this.inputDisabled = !1, this.isValidating = !1, this.isSuccess = !1, this.shakeError = !1, this.handleResendOtp = this.handleResendOtp.bind(this), this.submitOtp = this.submitOtp.bind(this), this.handleCloseWidget = this.handleCloseWidget.bind(this), this.manualClosePopup = this.manualClosePopup.bind(this);
  }
  /**
     * Fetches OTP configuration from the endpoint.
     * Updates the OTP state, expiration time, and starts the countdown timer.
     * Handles specific errors like max attempts exceeded by closing the widget.
     */
  getConfig() {
    return Se(this, null, function* () {
      if (this.endpoint)
        try {
          const e = new URL(`/api/v1/mfa/challenge/${this.token}/config`, this.endpoint);
          this.isLoading = !0;
          const t = yield fetch(e.href), r = yield t.json();
          if (t.ok)
            this.config = r, this.otp = Array(this.config.inputLength).fill(""), this.isLoading = !1, this.showResendOtp = !1, this.expirationTime = this.config.expirationTime, this.serverTime = this.config.serverTime, this.config.numberOfValidateAttempts !== 0 && (this.hasErrors = !0, this.errorMessage = k("invalidOtp", this.language)), this.config.numberOfValidateAttempts === this.config.maxValidationAttempts - 1 && (this.isLastWarning = !0), this.calculateTimeLeft(), this.startCountdown();
          else if (r && r.details === "gm.twofa.token_max_attempts_exceeded")
            this.handleCloseWidget();
          else {
            const n = r && r.message || `Failed to load config. Status: ${t.status}`;
            throw new Error(n);
          }
        } catch (e) {
          this.isLoading = !1, this.hasConfigErrors = !0, this.errorMessage = k("configError", this.language), console.error("Error loading 2FA config:", e);
        }
    });
  }
  /**
   * Calculates the remaining time for OTP expiration.
   * Adjusts client time based on server offset.
   */
  calculateTimeLeft() {
    const e = new Date(this.expirationTime), t = new Date(this.serverTime), r = /* @__PURE__ */ new Date(), n = t.getTime() - r.getTime();
    this.expirationTimestamp = e.getTime() - n;
    const h = Date.now(), E = Math.max(0, Math.floor((this.expirationTimestamp - h) / 1e3));
    this.timeLeft = E;
  }
  /**
   * Starts a 1-second interval countdown for OTP expiration.
   * Updates `timeLeft` state. Enables "Resend OTP" when expired.
   */
  startCountdown() {
    this.countdownTimer && clearInterval(this.countdownTimer), this.countdownTimer = setInterval(() => {
      const e = Date.now(), t = Math.max(0, Math.floor((this.expirationTimestamp - e) / 1e3));
      this.timeLeft = t, this.inputDisabled = t <= 0, t <= 0 && (clearInterval(this.countdownTimer), this.countdownTimer = null, this.showResendOtp = !0, this.hasErrors = !1, this.isLastWarning = !1);
    }, 1e3);
  }
  /**
   * Formats time from seconds to MM:SS format.
   *
   * @param seconds - The time in seconds.
   * @returns A formatted string representing minutes and seconds.
   */
  formatTime(e) {
    const t = Math.floor(e / 60), r = e % 60;
    return `${t.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
  }
  /**
   * Sets a reference to the OTP inputs.
   *
   * @param el - The OTP input container element.
   */
  setOtpInputRef(e, t) {
    e && (this.otpInputs[t] = e);
  }
  /**
   * update otp state
   * by creating new array and assign to state, to make the UI trigger
   *
   * @param index - The index of the input field being updated.
   * @param value - The inputted value.
   */
  updateOtpState(e, t) {
    const r = [...this.otp];
    r[e] = t.toUpperCase(), this.otp = r;
  }
  /**
   * Handles pasting an OTP directly into the input fields.
   * Extracts characters from the clipboard and populates the OTP fields.
   *
   * @param e - The clipboard event containing pasted data.
   */
  handleOnPasteOtp(e) {
    var t, r, n;
    e.preventDefault();
    const E = (((r = (t = e.clipboardData) === null || t === void 0 ? void 0 : t.getData("text")) === null || r === void 0 ? void 0 : r.trim()) || "").slice(0, this.config.inputLength).split("");
    this.otp = [...E, ...Array(this.config.inputLength - E.length).fill("")], (n = this.otpInputs[E.length]) === null || n === void 0 || n.focus(), E.length === this.config.inputLength && this.submitOtp();
  }
  /**
   * Handles OTP input changes.
   * Allows only alphanumeric characters and moves focus to the next input field.
   *
   * @param e - The input event.
   * @param index - The index of the input field being updated.
   */
  handleOtpInput(e, t) {
    const r = e.target, n = r.value;
    if (/^[a-z0-9]$/i.test(n)) {
      this.updateOtpState(t, n);
      const h = this.otpInputs[t + 1];
      h == null || h.focus();
    }
    r.value = "";
  }
  /**
   * Handles key press events for OTP inputs.
   * Supports backspace for deleting characters and moving focus to the previous input field.
   *
   * @param e - The keyboard event.
   * @param index - The index of the input field.
   */
  handleKeyDown(e, t) {
    const r = e.key, n = e.ctrlKey || e.metaKey;
    if (/^[a-z0-9]$/i.test(r)) {
      if (n && r.toLowerCase() === "v")
        return;
      e.preventDefault(), this.updateOtpState(t, r);
      const h = this.otpInputs[t + 1];
      h == null || h.focus();
    } else if (r === "Backspace") {
      e.preventDefault(), this.otp[t] !== "" && this.updateOtpState(t, "");
      const h = this.otpInputs[t - 1];
      h == null || h.focus();
    }
  }
  /**
   * Handles resending the OTP when time expires.
   */
  handleResendOtp() {
    const e = new CustomEvent("otpResendRequested");
    window.dispatchEvent(e);
  }
  /**
   * Submits the entered OTP for validation.
   * Sends a request to the endpoint with the OTP and handles the response.
   */
  submitOtp() {
    return Se(this, null, function* () {
      if (this.otp.join("").length !== this.config.inputLength) {
        this.hasErrors = !0, this.errorMessage = k("invalidOtp", this.language), this.triggerShakeAnimation();
        return;
      }
      if (this.timeLeft <= 0) {
        this.hasErrors = !0, this.errorMessage = k("otpExpiredMessage", this.language), this.triggerShakeAnimation(), yield this.getConfig();
        return;
      }
      this.isLoading = !0, this.isValidating = !0, this.hasErrors = !1, this.errorMessage = "";
      const e = this.otp.join("");
      this.flow === "stateless" && this.handleOtpStateless(e), this.flow === "stateful" && (yield this.handleOtpStateful(e));
    });
  }
  /**
   * Handle stateless mode where we just need to send the otp value, max attempts and number of validated attempts
   * and the template will recall the endpoint with X-Step-Up-Token and X-Step-Up-Value (otp value)
   *
   * @param otpValue - Otp code.
   */
  handleOtpStateless(e) {
    window.dispatchEvent(new CustomEvent("otpSubmitted", {
      detail: {
        code: e,
        maxAttempts: this.config.maxValidationAttempts,
        validatedAttempts: this.config.numberOfValidateAttempts
      }
    }));
  }
  /**
   * Handle the stateful mode where we need to call validate endpoint.
   *
   * @param otpValue - Otp code.
   */
  handleOtpStateful(e) {
    return Se(this, null, function* () {
      const t = new URL(`/api/v1/mfa/challenge/${this.token}/validate`, this.endpoint);
      t.searchParams.append("input", e);
      try {
        const r = yield fetch(t.href, { method: "POST" });
        if (r.status === 200) {
          this.handleSuccess();
          return;
        }
        const h = (yield r.json()).message || "";
        if (h.toLowerCase().includes("expired")) {
          this.hasErrors = !0, this.errorMessage = k("otpExpiredMessage", this.language), this.triggerShakeAnimation(), yield this.getConfig();
          return;
        }
        throw new Error(h);
      } catch (r) {
        if (r.message === "gm.multifactorauthentication.challenge_internal_server_error" || r.message === "gm.multifactorauthentication.internal_server_error") {
          if (this.config.numberOfValidateAttempts === this.config.maxValidationAttempts - 1) {
            window.dispatchEvent(new CustomEvent("otpSetTimeout")), window.postMessage({
              type: "WidgetNotification",
              data: {
                type: "error",
                message: k("accountBlocked", this.language)
              }
            }, window.location.href), this.handleCloseWidget();
            return;
          }
          this.hasErrors = !0, this.errorMessage = k("invalidOtp", this.language), this.triggerShakeAnimation(), this.getConfig();
          return;
        }
        console.error("OTP submission failed:", r), this.hasErrors = !0, this.errorMessage = k("submissionError", this.language), this.triggerShakeAnimation();
      } finally {
        this.isLoading = !1, this.isValidating = !1;
      }
    });
  }
  /**
   * Handles successful OTP validation.
   * Closes the popup upon successful authentication.
   */
  handleSuccess() {
    return Se(this, null, function* () {
      this.isSuccess = !0, yield new Promise((e) => setTimeout(e, 1200)), window.dispatchEvent(new CustomEvent("otpSuccess", {
        detail: { message: "User successfully authenticated" }
      })), this.handleCloseWidget();
    });
  }
  /**
   * Triggers shake animation on OTP field wrapper for error feedback
   */
  triggerShakeAnimation() {
    this.shakeError = !0, setTimeout(() => {
      this.shakeError = !1;
    }, 650);
  }
  /**
   * Emits an event when the close button is pressed.
   */
  manualClosePopup() {
    window.dispatchEvent(new CustomEvent("manualClosePopup")), this.handleCloseWidget();
  }
  /**
   * Lifecycle method: Clean up event listeners when the component is removed
   */
  disconnectedCallback() {
    var e;
    this.countdownTimer && clearInterval(this.countdownTimer), (e = this.stylingSubscription) === null || e === void 0 || e.unsubscribe();
  }
  /**
   * Lifecycle method: Fetch translations on component load
   */
  componentWillLoad() {
    return Se(this, null, function* () {
      this.translationUrl.length > 2 && (yield Ye(this.translationUrl));
    });
  }
  /**
   * Lifecycle method: Set up event listeners after the component is rendered
   */
  componentDidLoad() {
    this.stylingContainer && (window.emMessageBuss != null ? Ze(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription) : (this.clientStyling && Ue(this.stylingContainer, this.clientStyling), this.clientStylingUrl && He(this.stylingContainer, this.clientStylingUrl)));
  }
  /**
   * Renders the OTP authentication component.
   * Displays the OTP popup, input fields, timer, and action buttons.
   */
  render() {
    return p("div", { key: "76ac4d8968da87098db7f2b7f78b27edb7928185", ref: (e) => this.stylingContainer = e }, this.showPopup && p("div", { key: "44909cc96a9b5e86cab28aa7fdca261d0b749253", class: "OtpPopupOverlay" }, p("div", { key: "6e424d5ae5dedae3f83782c9a4c9e483c88357aa", class: `OtpPopupContent ${this.shakeError ? "shake" : ""}` }, this.isLoading ? p("div", { class: "OtpLoaderContainer" }, p("span", { class: "OtpLoader" })) : this.hasConfigErrors ? p("div", { class: "OtpError" }, p("div", { class: "OtpErrorHeader" }, p("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, p("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" })), p("h2", null, k("errorHeader", this.language))), p("p", null, this.errorMessage), p("button", { class: "OtpButton error", onClick: this.manualClosePopup, "aria-label": k("close", this.language) }, k("close", this.language))) : p(We, null, p("div", { class: "otp-description" }, this.showResendOtp ? p("p", { class: "OtpNoticeMessage", role: "alert" }, k("otpExpiredMessage", this.language)) : p(We, null, p("p", { class: this.isLastWarning ? "LastWarningMessage" : "" }, k(this.isLastWarning ? "popupMessageLastWarning" : "popupMessage", this.language)), this.hasErrors && p("p", { class: "OtpErrorMessage", role: "alert" }, this.errorMessage))), p("div", { class: "OtpFieldWrapper" }, p("h2", null, k("otpHeading", this.language)), p("div", { class: "OtpField" }, this.otp.map((e, t) => {
      const r = this.config.inputLength % 2 === 0 && t === this.config.inputLength / 2 - 1;
      return p("input", { key: t, ref: (n) => this.setOtpInputRef(n, t), id: `otp-input-${t}`, type: "text", inputmode: "numeric", pattern: "[0-9]", class: `otp-box ${r ? "space" : ""} ${e ? "filled" : ""} ${this.hasErrors ? "error" : ""}`, maxLength: 1, value: e, onInput: (n) => this.handleOtpInput(n, t), onKeyDown: (n) => this.handleKeyDown(n, t), onPaste: (n) => this.handleOnPasteOtp(n), disabled: this.inputDisabled, autoComplete: "off", "aria-label": `${k("otpDigit", this.language)} ${t + 1}`, "aria-invalid": this.hasErrors });
    })), p("div", { class: "OtpTimerContainer" }, p("div", { class: `OtpTimer ${this.isLastWarning ? "warning" : ""} ${this.timeLeft < 60 ? "critical" : ""}`, role: "timer", "aria-live": "polite" }, p("svg", { class: "timer-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, p("path", { d: "M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" })), p("span", { class: "timer-text" }, this.formatTime(this.timeLeft), " ", k("minutes", this.language))))), this.isSuccess && p("div", { class: "OtpSuccessOverlay" }, p("svg", { class: "success-icon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, p("path", { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" })), p("span", null, k("otpVerified", this.language))), p("div", { class: "OtpActionButtons" }, this.showResendOtp ? p("button", { class: "OtpButton primary", onClick: this.handleResendOtp, disabled: this.isLoading, "aria-label": k("resendOtp", this.language) }, k("resendOtp", this.language)) : p("button", { class: `OtpButton primary ${this.isValidating ? "loading" : ""}`, onClick: this.submitOtp, disabled: this.otp.join("").length !== this.config.inputLength || this.isValidating || this.isLoading, "aria-label": k("submit", this.language), "aria-busy": this.isValidating }, this.isValidating ? p(We, null, p("span", { class: "button-spinner" }), p("span", { class: "button-text" }, k("verifying", this.language))) : p("span", { class: "button-text" }, k("submit", this.language))), p("button", { class: "OtpButton secondary", onClick: this.manualClosePopup, disabled: this.isValidating, "aria-label": k("close", this.language) }, k("close", this.language)))))));
  }
  get el() {
    return ot(this);
  }
  static get watchers() {
    return {
      translationUrl: ["handleNewTranslations"],
      clientStyling: ["handleClientStylingChange"],
      clientStylingUrl: ["handleClientStylingUrlChange"]
    };
  }
};
pt.style = ht;
const ft = "en", gt = ["ro", "en", "fr", "hr", "en-us", "es-mx", "pt-br", "es", "de", "pt", "tr"], Je = {
  en: {
    Deposit: "Deposit",
    Withdraw: "Withdraw",
    denyDeposit: "Please be informed that currently you are not allowed to initiate deposit transactions.",
    denyWithdrawal: "Please be informed that currently you are not allowed to initiate withdrawal transactions.",
    notFoundErrorCode: "Not found error code",
    errorCode21121: "Dear Player! Please be informed that currently you are allowed to initiate only withdrawal transactions from your player account. Error Code: 21121",
    errorCode21122: "Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",
    errorCode21123: "Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"
  },
  "en-us": {
    Deposit: "Deposit",
    Withdraw: "Withdraw",
    denyDeposit: "Please be informed that currently you are not allowed to initiate deposit transactions.",
    denyWithdrawal: "Please be informed that currently you are not allowed to initiate withdrawal transactions.",
    notFoundErrorCode: "Not found error code",
    errorCode21121: "Dear Player! Please be informed that currently you are allowed to initiate only withdrawal transactions from your player account. Error Code: 21121",
    errorCode21122: "Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",
    errorCode21123: "Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"
  },
  ro: {
    Deposit: "Depunere",
    Withdraw: "Retragere",
    denyDeposit: "Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.",
    denyWithdrawal: "Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.",
    notFoundErrorCode: "Cod de eroare negăsit",
    errorCode21122: "Stimate jucător! Vă informăm că în prezent nu aveți permisiunea de a iniția o tranzacție de retragere din contul dvs. de jucător. Cod de eroare: 21122",
    errorCode21123: "Stimate jucător! Vă informăm că în prezent nu aveți permisiunea de a efectua o depunere în contul dvs. de jucător. Cod de eroare: 21123"
  },
  fr: {
    Deposit: "Dépôt",
    Withdraw: "Retrait",
    denyDeposit: "Veuillez noter qu’actuellement vous n’êtes pas autorisé à initier des transactions de dépôt.",
    denyWithdrawal: "Veuillez noter qu’actuellement vous n’êtes pas autorisé à initier des transactions de retrait.",
    notFoundErrorCode: "Code d’erreur introuvable",
    errorCode21122: "Cher joueur ! Veuillez noter qu’actuellement vous n’êtes pas autorisé à initier une transaction de retrait depuis votre compte joueur. Code d’erreur : 21122",
    errorCode21123: "Cher joueur ! Veuillez noter qu’actuellement vous n’êtes pas autorisé à effectuer un dépôt sur votre compte joueur. Code d’erreur : 21123"
  },
  hr: {
    Deposit: "Uplata",
    Withdraw: "Isplata",
    denyDeposit: "Obavještavamo Vas da trenutno nemate mogućnost uplata.",
    denyWithdrawal: "Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.",
    notFoundErrorCode: "Not found error code",
    errorCode21122: "Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122",
    errorCode21123: "Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123"
  },
  de: {
    Deposit: "Einzahlung",
    Withdraw: "Abhebung",
    denyDeposit: "Bitte beachten Sie, dass Sie derzeit keine Einzahlungs-Transaktionen durchführen dürfen.",
    denyWithdrawal: "Bitte beachten Sie, dass Sie derzeit keine Abhebungs-Transaktionen durchführen dürfen.",
    notFoundErrorCode: "Fehlercode nicht gefunden",
    errorCode21122: "Sehr geehrter Spieler! Bitte beachten Sie, dass Sie derzeit keine Abhebung von Ihrem Spielerkonto durchführen dürfen. Fehlercode: 21122",
    errorCode21123: "Sehr geehrter Spieler! Bitte beachten Sie, dass Sie derzeit keine Einzahlung auf Ihr Spielerkonto durchführen dürfen. Fehlercode: 21123"
  },
  es: {
    Deposit: "Depósito",
    Withdraw: "Retiro",
    denyDeposit: "Le informamos que actualmente no tiene permitido iniciar transacciones de depósito.",
    denyWithdrawal: "Le informamos que actualmente no tiene permitido iniciar transacciones de retiro.",
    notFoundErrorCode: "Código de error no encontrado",
    errorCode21122: "¡Estimado jugador! Le informamos que actualmente no tiene permitido iniciar una transacción de retiro desde su cuenta de jugador. Código de error: 21122",
    errorCode21123: "¡Estimado jugador! Le informamos que actualmente no tiene permitido realizar un depósito en su cuenta de jugador. Código de error: 21123"
  },
  pt: {
    Deposit: "Depósito",
    Withdraw: "Levantamento",
    denyDeposit: "Informamos que atualmente não tem permissão para iniciar transações de depósito.",
    denyWithdrawal: "Informamos que atualmente não tem permissão para iniciar transações de levantamento.",
    notFoundErrorCode: "Código de erro não encontrado",
    errorCode21122: "Caro jogador! Informamos que atualmente não tem permissão para iniciar uma transação de levantamento na sua conta de jogador. Código de erro: 21122",
    errorCode21123: "Caro jogador! Informamos que atualmente não tem permissão para realizar um depósito na sua conta de jogador. Código de erro: 21123"
  },
  "es-mx": {
    Deposit: "Depósito",
    Withdraw: "Retiro",
    denyDeposit: "Le informamos que actualmente no tiene permitido iniciar transacciones de depósito.",
    denyWithdrawal: "Le informamos que actualmente no tiene permitido iniciar transacciones de retiro.",
    notFoundErrorCode: "Código de error no encontrado",
    errorCode21122: "¡Estimado jugador! Le informamos que actualmente no tiene permitido iniciar una transacción de retiro desde su cuenta de jugador. Código de error: 21122",
    errorCode21123: "¡Estimado jugador! Le informamos que actualmente no tiene permitido realizar un depósito en su cuenta de jugador. Código de error: 21123"
  },
  "pt-br": {
    Deposit: "Depósito",
    Withdraw: "Saque",
    denyDeposit: "Informamos que atualmente você não tem permissão para iniciar transações de depósito.",
    denyWithdrawal: "Informamos que atualmente você não tem permissão para iniciar transações de saque.",
    notFoundErrorCode: "Código de erro não encontrado",
    errorCode21122: "Caro jogador! Informamos que atualmente você não tem permissão para iniciar uma transação de saque em sua conta de jogador. Código de erro: 21122",
    errorCode21123: "Caro jogador! Informamos que atualmente você não tem permissão para realizar um depósito em sua conta de jogador. Código de erro: 21123"
  },
  tr: {
    Deposit: "Para Yatırma",
    Withdraw: "Para Çekme",
    denyDeposit: "Lütfen şu anda para yatırma işlemi başlatamayacağınızı bilgilerinize sunarız.",
    denyWithdrawal: "Lütfen şu anda para çekme işlemi başlatamayacağınızı bilgilerinize sunarız.",
    notFoundErrorCode: "Hata kodu bulunamadı",
    errorCode21122: "Değerli oyuncumuz! Lütfen şu anda oyuncu hesabınızdan para çekme işlemi başlatamayacağınızı bilgilerinize sunarız. Hata Kodu: 21122",
    errorCode21123: "Değerli oyuncumuz! Lütfen şu anda oyuncu hesabınıza para yatırma işlemi yapamayacağınızı bilgilerinize sunarız. Hata Kodu: 21123"
  }
}, mt = (e) => new Promise((t) => {
  fetch(e).then((r) => r.json()).then((r) => {
    Object.keys(r).forEach((n) => {
      for (let h in r[n])
        Je[n][h] = r[n][h];
    }), t(!0);
  });
}), Ce = (e, t) => {
  const r = t;
  return Je[r !== void 0 && gt.includes(r) ? r : ft][e];
}, vt = (e) => !!(e.toLowerCase().match(/android/i) || e.toLowerCase().match(/blackberry|bb/i) || e.toLowerCase().match(/iphone|ipad|ipod/i) || e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)), yt = (e) => {
  if (!e || typeof e != "string")
    return !1;
  const t = e.toLowerCase();
  return t.includes("voucher") || t.includes("offline");
};
var Ve = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, et = { exports: {} };
(function(e, t) {
  (function(r, n) {
    e.exports = n();
  })(Ve, function() {
    var r = 1e3, n = 6e4, h = 36e5, E = "millisecond", U = "second", x = "minute", b = "hour", L = "day", we = "week", W = "month", Te = "quarter", q = "year", re = "date", v = "Invalid Date", Y = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ue = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, ce = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(g) {
      var l = ["th", "st", "nd", "rd"], a = g % 100;
      return "[" + g + (l[(a - 20) % 10] || l[a] || l[0]) + "]";
    } }, A = function(g, l, a) {
      var u = String(g);
      return !u || u.length >= l ? g : "" + Array(l + 1 - u.length).join(a) + g;
    }, ie = { s: A, z: function(g) {
      var l = -g.utcOffset(), a = Math.abs(l), u = Math.floor(a / 60), s = a % 60;
      return (l <= 0 ? "+" : "-") + A(u, 2, "0") + ":" + A(s, 2, "0");
    }, m: function g(l, a) {
      if (l.date() < a.date())
        return -g(a, l);
      var u = 12 * (a.year() - l.year()) + (a.month() - l.month()), s = l.clone().add(u, W), m = a - s < 0, y = l.clone().add(u + (m ? -1 : 1), W);
      return +(-(u + (a - s) / (m ? s - y : y - s)) || 0);
    }, a: function(g) {
      return g < 0 ? Math.ceil(g) || 0 : Math.floor(g);
    }, p: function(g) {
      return { M: W, y: q, w: we, d: L, D: re, h: b, m: x, s: U, ms: E, Q: Te }[g] || String(g || "").toLowerCase().replace(/s$/, "");
    }, u: function(g) {
      return g === void 0;
    } }, ne = "en", Q = {};
    Q[ne] = ce;
    var he = "$isDayjsObject", Ee = function(g) {
      return g instanceof oe || !(!g || !g[he]);
    }, ae = function g(l, a, u) {
      var s;
      if (!l)
        return ne;
      if (typeof l == "string") {
        var m = l.toLowerCase();
        Q[m] && (s = m), a && (Q[m] = a, s = m);
        var y = l.split("-");
        if (!s && y.length > 1)
          return g(y[0]);
      } else {
        var T = l.name;
        Q[T] = l, s = T;
      }
      return !u && s && (ne = s), s || !u && ne;
    }, _ = function(g, l) {
      if (Ee(g))
        return g.clone();
      var a = typeof l == "object" ? l : {};
      return a.date = g, a.args = arguments, new oe(a);
    }, M = ie;
    M.l = ae, M.i = Ee, M.w = function(g, l) {
      return _(g, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
    };
    var oe = function() {
      function g(a) {
        this.$L = ae(a.locale, null, !0), this.parse(a), this.$x = this.$x || a.x || {}, this[he] = !0;
      }
      var l = g.prototype;
      return l.parse = function(a) {
        this.$d = function(u) {
          var s = u.date, m = u.utc;
          if (s === null)
            return /* @__PURE__ */ new Date(NaN);
          if (M.u(s))
            return /* @__PURE__ */ new Date();
          if (s instanceof Date)
            return new Date(s);
          if (typeof s == "string" && !/Z$/i.test(s)) {
            var y = s.match(Y);
            if (y) {
              var T = y[2] - 1 || 0, R = (y[7] || "0").substring(0, 3);
              return m ? new Date(Date.UTC(y[1], T, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, R)) : new Date(y[1], T, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, R);
            }
          }
          return new Date(s);
        }(a), this.init();
      }, l.init = function() {
        var a = this.$d;
        this.$y = a.getFullYear(), this.$M = a.getMonth(), this.$D = a.getDate(), this.$W = a.getDay(), this.$H = a.getHours(), this.$m = a.getMinutes(), this.$s = a.getSeconds(), this.$ms = a.getMilliseconds();
      }, l.$utils = function() {
        return M;
      }, l.isValid = function() {
        return this.$d.toString() !== v;
      }, l.isSame = function(a, u) {
        var s = _(a);
        return this.startOf(u) <= s && s <= this.endOf(u);
      }, l.isAfter = function(a, u) {
        return _(a) < this.startOf(u);
      }, l.isBefore = function(a, u) {
        return this.endOf(u) < _(a);
      }, l.$g = function(a, u, s) {
        return M.u(a) ? this[u] : this.set(s, a);
      }, l.unix = function() {
        return Math.floor(this.valueOf() / 1e3);
      }, l.valueOf = function() {
        return this.$d.getTime();
      }, l.startOf = function(a, u) {
        var s = this, m = !!M.u(u) || u, y = M.p(a), T = function(se, j) {
          var z = M.w(s.$u ? Date.UTC(s.$y, j, se) : new Date(s.$y, j, se), s);
          return m ? z : z.endOf(L);
        }, R = function(se, j) {
          return M.w(s.toDate()[se].apply(s.toDate("s"), (m ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(j)), s);
        }, H = this.$W, N = this.$M, Z = this.$D, be = "set" + (this.$u ? "UTC" : "");
        switch (y) {
          case q:
            return m ? T(1, 0) : T(31, 11);
          case W:
            return m ? T(1, N) : T(0, N + 1);
          case we:
            var pe = this.$locale().weekStart || 0, fe = (H < pe ? H + 7 : H) - pe;
            return T(m ? Z - fe : Z + (6 - fe), N);
          case L:
          case re:
            return R(be + "Hours", 0);
          case b:
            return R(be + "Minutes", 1);
          case x:
            return R(be + "Seconds", 2);
          case U:
            return R(be + "Milliseconds", 3);
          default:
            return this.clone();
        }
      }, l.endOf = function(a) {
        return this.startOf(a, !1);
      }, l.$set = function(a, u) {
        var s, m = M.p(a), y = "set" + (this.$u ? "UTC" : ""), T = (s = {}, s[L] = y + "Date", s[re] = y + "Date", s[W] = y + "Month", s[q] = y + "FullYear", s[b] = y + "Hours", s[x] = y + "Minutes", s[U] = y + "Seconds", s[E] = y + "Milliseconds", s)[m], R = m === L ? this.$D + (u - this.$W) : u;
        if (m === W || m === q) {
          var H = this.clone().set(re, 1);
          H.$d[T](R), H.init(), this.$d = H.set(re, Math.min(this.$D, H.daysInMonth())).$d;
        } else
          T && this.$d[T](R);
        return this.init(), this;
      }, l.set = function(a, u) {
        return this.clone().$set(a, u);
      }, l.get = function(a) {
        return this[M.p(a)]();
      }, l.add = function(a, u) {
        var s, m = this;
        a = Number(a);
        var y = M.p(u), T = function(N) {
          var Z = _(m);
          return M.w(Z.date(Z.date() + Math.round(N * a)), m);
        };
        if (y === W)
          return this.set(W, this.$M + a);
        if (y === q)
          return this.set(q, this.$y + a);
        if (y === L)
          return T(1);
        if (y === we)
          return T(7);
        var R = (s = {}, s[x] = n, s[b] = h, s[U] = r, s)[y] || 1, H = this.$d.getTime() + a * R;
        return M.w(H, this);
      }, l.subtract = function(a, u) {
        return this.add(-1 * a, u);
      }, l.format = function(a) {
        var u = this, s = this.$locale();
        if (!this.isValid())
          return s.invalidDate || v;
        var m = a || "YYYY-MM-DDTHH:mm:ssZ", y = M.z(this), T = this.$H, R = this.$m, H = this.$M, N = s.weekdays, Z = s.months, be = s.meridiem, pe = function(j, z, Oe, De) {
          return j && (j[z] || j(u, m)) || Oe[z].slice(0, De);
        }, fe = function(j) {
          return M.s(T % 12 || 12, j, "0");
        }, se = be || function(j, z, Oe) {
          var De = j < 12 ? "AM" : "PM";
          return Oe ? De.toLowerCase() : De;
        };
        return m.replace(ue, function(j, z) {
          return z || function(Oe) {
            switch (Oe) {
              case "YY":
                return String(u.$y).slice(-2);
              case "YYYY":
                return M.s(u.$y, 4, "0");
              case "M":
                return H + 1;
              case "MM":
                return M.s(H + 1, 2, "0");
              case "MMM":
                return pe(s.monthsShort, H, Z, 3);
              case "MMMM":
                return pe(Z, H);
              case "D":
                return u.$D;
              case "DD":
                return M.s(u.$D, 2, "0");
              case "d":
                return String(u.$W);
              case "dd":
                return pe(s.weekdaysMin, u.$W, N, 2);
              case "ddd":
                return pe(s.weekdaysShort, u.$W, N, 3);
              case "dddd":
                return N[u.$W];
              case "H":
                return String(T);
              case "HH":
                return M.s(T, 2, "0");
              case "h":
                return fe(1);
              case "hh":
                return fe(2);
              case "a":
                return se(T, R, !0);
              case "A":
                return se(T, R, !1);
              case "m":
                return String(R);
              case "mm":
                return M.s(R, 2, "0");
              case "s":
                return String(u.$s);
              case "ss":
                return M.s(u.$s, 2, "0");
              case "SSS":
                return M.s(u.$ms, 3, "0");
              case "Z":
                return y;
            }
            return null;
          }(j) || y.replace(":", "");
        });
      }, l.utcOffset = function() {
        return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
      }, l.diff = function(a, u, s) {
        var m, y = this, T = M.p(u), R = _(a), H = (R.utcOffset() - this.utcOffset()) * n, N = this - R, Z = function() {
          return M.m(y, R);
        };
        switch (T) {
          case q:
            m = Z() / 12;
            break;
          case W:
            m = Z();
            break;
          case Te:
            m = Z() / 3;
            break;
          case we:
            m = (N - H) / 6048e5;
            break;
          case L:
            m = (N - H) / 864e5;
            break;
          case b:
            m = N / h;
            break;
          case x:
            m = N / n;
            break;
          case U:
            m = N / r;
            break;
          default:
            m = N;
        }
        return s ? m : M.a(m);
      }, l.daysInMonth = function() {
        return this.endOf(W).$D;
      }, l.$locale = function() {
        return Q[this.$L];
      }, l.locale = function(a, u) {
        if (!a)
          return this.$L;
        var s = this.clone(), m = ae(a, u, !0);
        return m && (s.$L = m), s;
      }, l.clone = function() {
        return M.w(this.$d, this);
      }, l.toDate = function() {
        return new Date(this.valueOf());
      }, l.toJSON = function() {
        return this.isValid() ? this.toISOString() : null;
      }, l.toISOString = function() {
        return this.$d.toISOString();
      }, l.toString = function() {
        return this.$d.toUTCString();
      }, g;
    }(), Re = oe.prototype;
    return _.prototype = Re, [["$ms", E], ["$s", U], ["$m", x], ["$H", b], ["$W", L], ["$M", W], ["$y", q], ["$D", re]].forEach(function(g) {
      Re[g[1]] = function(l) {
        return this.$g(l, g[0], g[1]);
      };
    }), _.extend = function(g, l) {
      return g.$i || (g(l, oe, _), g.$i = !0), _;
    }, _.locale = ae, _.isDayjs = Ee, _.unix = function(g) {
      return _(1e3 * g);
    }, _.en = Q[ne], _.Ls = Q, _.p = {}, _;
  });
})(et);
const tt = et.exports;
var rt = { exports: {} };
(function(e, t) {
  (function(r, n) {
    e.exports = n();
  })(Ve, function() {
    var r = "minute", n = /[+-]\d\d(?::?\d\d)?/g, h = /([+-]|\d\d)/g;
    return function(E, U, x) {
      var b = U.prototype;
      x.utc = function(v) {
        var Y = { date: v, utc: !0, args: arguments };
        return new U(Y);
      }, b.utc = function(v) {
        var Y = x(this.toDate(), { locale: this.$L, utc: !0 });
        return v ? Y.add(this.utcOffset(), r) : Y;
      }, b.local = function() {
        return x(this.toDate(), { locale: this.$L, utc: !1 });
      };
      var L = b.parse;
      b.parse = function(v) {
        v.utc && (this.$u = !0), this.$utils().u(v.$offset) || (this.$offset = v.$offset), L.call(this, v);
      };
      var we = b.init;
      b.init = function() {
        if (this.$u) {
          var v = this.$d;
          this.$y = v.getUTCFullYear(), this.$M = v.getUTCMonth(), this.$D = v.getUTCDate(), this.$W = v.getUTCDay(), this.$H = v.getUTCHours(), this.$m = v.getUTCMinutes(), this.$s = v.getUTCSeconds(), this.$ms = v.getUTCMilliseconds();
        } else
          we.call(this);
      };
      var W = b.utcOffset;
      b.utcOffset = function(v, Y) {
        var ue = this.$utils().u;
        if (ue(v))
          return this.$u ? 0 : ue(this.$offset) ? W.call(this) : this.$offset;
        if (typeof v == "string" && (v = function(ne) {
          ne === void 0 && (ne = "");
          var Q = ne.match(n);
          if (!Q)
            return null;
          var he = ("" + Q[0]).match(h) || ["-", 0, 0], Ee = he[0], ae = 60 * +he[1] + +he[2];
          return ae === 0 ? 0 : Ee === "+" ? ae : -ae;
        }(v), v === null))
          return this;
        var ce = Math.abs(v) <= 16 ? 60 * v : v, A = this;
        if (Y)
          return A.$offset = ce, A.$u = v === 0, A;
        if (v !== 0) {
          var ie = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
          (A = this.local().add(ce + ie, r)).$offset = ce, A.$x.$localOffset = ie;
        } else
          A = this.utc();
        return A;
      };
      var Te = b.format;
      b.format = function(v) {
        var Y = v || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
        return Te.call(this, Y);
      }, b.valueOf = function() {
        var v = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
        return this.$d.valueOf() - 6e4 * v;
      }, b.isUTC = function() {
        return !!this.$u;
      }, b.toISOString = function() {
        return this.toDate().toISOString();
      }, b.toString = function() {
        return this.toDate().toUTCString();
      };
      var q = b.toDate;
      b.toDate = function(v) {
        return v === "s" && this.$offset ? x(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : q.call(this);
      };
      var re = b.diff;
      b.diff = function(v, Y, ue) {
        if (v && this.$u === v.$u)
          return re.call(this, v, Y, ue);
        var ce = this.local(), A = x(v).local();
        return re.call(ce, A, Y, ue);
      };
    };
  });
})(rt);
const St = rt.exports;
var je = { exports: {} };
/** @license
 * eventsource.js
 * Available under MIT License (MIT)
 * https://github.com/Yaffle/EventSource/
 */
(function(e, t) {
  (function(r) {
    var n = r.setTimeout, h = r.clearTimeout, E = r.XMLHttpRequest, U = r.XDomainRequest, x = r.ActiveXObject, b = r.EventSource, L = r.document, we = r.Promise, W = r.fetch, Te = r.Response, q = r.TextDecoder, re = r.TextEncoder, v = r.AbortController;
    if (typeof window != "undefined" && typeof L != "undefined" && !("readyState" in L) && L.body == null && (L.readyState = "loading", window.addEventListener("load", function(i) {
      L.readyState = "complete";
    }, !1)), E == null && x != null && (E = function() {
      return new x("Microsoft.XMLHTTP");
    }), Object.create == null && (Object.create = function(i) {
      function d() {
      }
      return d.prototype = i, new d();
    }), Date.now || (Date.now = function() {
      return (/* @__PURE__ */ new Date()).getTime();
    }), v == null) {
      var Y = W;
      W = function(i, d) {
        var c = d.signal;
        return Y(i, { headers: d.headers, credentials: d.credentials, cache: d.cache }).then(function(o) {
          var S = o.body.getReader();
          return c._reader = S, c._aborted && c._reader.cancel(), {
            status: o.status,
            statusText: o.statusText,
            headers: o.headers,
            body: {
              getReader: function() {
                return S;
              }
            }
          };
        });
      }, v = function() {
        this.signal = {
          _reader: null,
          _aborted: !1
        }, this.abort = function() {
          this.signal._reader != null && this.signal._reader.cancel(), this.signal._aborted = !0;
        };
      };
    }
    function ue() {
      this.bitsNeeded = 0, this.codePoint = 0;
    }
    ue.prototype.decode = function(i) {
      function d(D, P, w) {
        if (w === 1)
          return D >= 128 >> P && D << P <= 2047;
        if (w === 2)
          return D >= 2048 >> P && D << P <= 55295 || D >= 57344 >> P && D << P <= 65535;
        if (w === 3)
          return D >= 65536 >> P && D << P <= 1114111;
        throw new Error();
      }
      function c(D, P) {
        if (D === 6 * 1)
          return P >> 6 > 15 ? 3 : P > 31 ? 2 : 1;
        if (D === 6 * 2)
          return P > 15 ? 3 : 2;
        if (D === 6 * 3)
          return 3;
        throw new Error();
      }
      for (var o = 65533, S = "", f = this.bitsNeeded, C = this.codePoint, $ = 0; $ < i.length; $ += 1) {
        var O = i[$];
        f !== 0 && (O < 128 || O > 191 || !d(C << 6 | O & 63, f - 6, c(f, C))) && (f = 0, C = o, S += String.fromCharCode(C)), f === 0 ? (O >= 0 && O <= 127 ? (f = 0, C = O) : O >= 192 && O <= 223 ? (f = 6 * 1, C = O & 31) : O >= 224 && O <= 239 ? (f = 6 * 2, C = O & 15) : O >= 240 && O <= 247 ? (f = 6 * 3, C = O & 7) : (f = 0, C = o), f !== 0 && !d(C, f, c(f, C)) && (f = 0, C = o)) : (f -= 6, C = C << 6 | O & 63), f === 0 && (C <= 65535 ? S += String.fromCharCode(C) : (S += String.fromCharCode(55296 + (C - 65535 - 1 >> 10)), S += String.fromCharCode(56320 + (C - 65535 - 1 & 1023))));
      }
      return this.bitsNeeded = f, this.codePoint = C, S;
    };
    var ce = function() {
      try {
        return new q().decode(new re().encode("test"), { stream: !0 }) === "test";
      } catch (i) {
        console.debug("TextDecoder does not support streaming option. Using polyfill instead: " + i);
      }
      return !1;
    };
    (q == null || re == null || !ce()) && (q = ue);
    var A = function() {
    };
    function ie(i) {
      this.withCredentials = !1, this.readyState = 0, this.status = 0, this.statusText = "", this.responseText = "", this.onprogress = A, this.onload = A, this.onerror = A, this.onreadystatechange = A, this._contentType = "", this._xhr = i, this._sendTimeout = 0, this._abort = A;
    }
    ie.prototype.open = function(i, d) {
      this._abort(!0);
      var c = this, o = this._xhr, S = 1, f = 0;
      this._abort = function(w) {
        c._sendTimeout !== 0 && (h(c._sendTimeout), c._sendTimeout = 0), (S === 1 || S === 2 || S === 3) && (S = 4, o.onload = A, o.onerror = A, o.onabort = A, o.onprogress = A, o.onreadystatechange = A, o.abort(), f !== 0 && (h(f), f = 0), w || (c.readyState = 4, c.onabort(null), c.onreadystatechange())), S = 0;
      };
      var C = function() {
        if (S === 1) {
          var w = 0, I = "", ge = void 0;
          if ("contentType" in o)
            w = 200, I = "OK", ge = o.contentType;
          else
            try {
              w = o.status, I = o.statusText, ge = o.getResponseHeader("Content-Type");
            } catch (ke) {
              w = 0, I = "", ge = void 0;
            }
          w !== 0 && (S = 2, c.readyState = 2, c.status = w, c.statusText = I, c._contentType = ge, c.onreadystatechange());
        }
      }, $ = function() {
        if (C(), S === 2 || S === 3) {
          S = 3;
          var w = "";
          try {
            w = o.responseText;
          } catch (I) {
          }
          c.readyState = 3, c.responseText = w, c.onprogress();
        }
      }, O = function(w, I) {
        if ((I == null || I.preventDefault == null) && (I = {
          preventDefault: A
        }), $(), S === 1 || S === 2 || S === 3) {
          if (S = 4, f !== 0 && (h(f), f = 0), c.readyState = 4, w === "load")
            c.onload(I);
          else if (w === "error")
            c.onerror(I);
          else if (w === "abort")
            c.onabort(I);
          else
            throw new TypeError();
          c.onreadystatechange();
        }
      }, D = function(w) {
        o != null && (o.readyState === 4 ? (!("onload" in o) || !("onerror" in o) || !("onabort" in o)) && O(o.responseText === "" ? "error" : "load", w) : o.readyState === 3 ? "onprogress" in o || $() : o.readyState === 2 && C());
      }, P = function() {
        f = n(function() {
          P();
        }, 500), o.readyState === 3 && $();
      };
      "onload" in o && (o.onload = function(w) {
        O("load", w);
      }), "onerror" in o && (o.onerror = function(w) {
        O("error", w);
      }), "onabort" in o && (o.onabort = function(w) {
        O("abort", w);
      }), "onprogress" in o && (o.onprogress = $), "onreadystatechange" in o && (o.onreadystatechange = function(w) {
        D(w);
      }), ("contentType" in o || !("ontimeout" in E.prototype)) && (d += (d.indexOf("?") === -1 ? "?" : "&") + "padding=true"), o.open(i, d, !0), "readyState" in o && (f = n(function() {
        P();
      }, 0));
    }, ie.prototype.abort = function() {
      this._abort(!1);
    }, ie.prototype.getResponseHeader = function(i) {
      return this._contentType;
    }, ie.prototype.setRequestHeader = function(i, d) {
      var c = this._xhr;
      "setRequestHeader" in c && c.setRequestHeader(i, d);
    }, ie.prototype.getAllResponseHeaders = function() {
      return this._xhr.getAllResponseHeaders != null && this._xhr.getAllResponseHeaders() || "";
    }, ie.prototype.send = function() {
      if ((!("ontimeout" in E.prototype) || !("sendAsBinary" in E.prototype) && !("mozAnon" in E.prototype)) && L != null && L.readyState != null && L.readyState !== "complete") {
        var i = this;
        i._sendTimeout = n(function() {
          i._sendTimeout = 0, i.send();
        }, 4);
        return;
      }
      var d = this._xhr;
      "withCredentials" in d && (d.withCredentials = this.withCredentials);
      try {
        d.send(void 0);
      } catch (c) {
        throw c;
      }
    };
    function ne(i) {
      return i.replace(/[A-Z]/g, function(d) {
        return String.fromCharCode(d.charCodeAt(0) + 32);
      });
    }
    function Q(i) {
      for (var d = /* @__PURE__ */ Object.create(null), c = i.split(`\r
`), o = 0; o < c.length; o += 1) {
        var S = c[o], f = S.split(": "), C = f.shift(), $ = f.join(": ");
        d[ne(C)] = $;
      }
      this._map = d;
    }
    Q.prototype.get = function(i) {
      return this._map[ne(i)];
    }, E != null && E.HEADERS_RECEIVED == null && (E.HEADERS_RECEIVED = 2);
    function he() {
    }
    he.prototype.open = function(i, d, c, o, S, f, C) {
      i.open("GET", S);
      var $ = 0;
      i.onprogress = function() {
        var D = i.responseText, P = D.slice($);
        $ += P.length, c(P);
      }, i.onerror = function(D) {
        D.preventDefault(), o(new Error("NetworkError"));
      }, i.onload = function() {
        o(null);
      }, i.onabort = function() {
        o(null);
      }, i.onreadystatechange = function() {
        if (i.readyState === E.HEADERS_RECEIVED) {
          var D = i.status, P = i.statusText, w = i.getResponseHeader("Content-Type"), I = i.getAllResponseHeaders();
          d(D, P, w, new Q(I));
        }
      }, i.withCredentials = f;
      for (var O in C)
        Object.prototype.hasOwnProperty.call(C, O) && i.setRequestHeader(O, C[O]);
      return i.send(), i;
    };
    function Ee(i) {
      this._headers = i;
    }
    Ee.prototype.get = function(i) {
      return this._headers.get(i);
    };
    function ae() {
    }
    ae.prototype.open = function(i, d, c, o, S, f, C) {
      var $ = null, O = new v(), D = O.signal, P = new q();
      return W(S, {
        headers: C,
        credentials: f ? "include" : "same-origin",
        signal: D,
        cache: "no-store"
      }).then(function(w) {
        return $ = w.body.getReader(), d(w.status, w.statusText, w.headers.get("Content-Type"), new Ee(w.headers)), new we(function(I, ge) {
          var ke = function() {
            $.read().then(function(J) {
              if (J.done)
                I(void 0);
              else {
                var G = P.decode(J.value, { stream: !0 });
                c(G), ke();
              }
            }).catch(function(J) {
              ge(J);
            });
          };
          ke();
        });
      }).catch(function(w) {
        if (w.name !== "AbortError")
          return w;
      }).then(function(w) {
        o(w);
      }), {
        abort: function() {
          $ != null && $.cancel(), O.abort();
        }
      };
    };
    function _() {
      this._listeners = /* @__PURE__ */ Object.create(null);
    }
    function M(i) {
      n(function() {
        throw i;
      }, 0);
    }
    _.prototype.dispatchEvent = function(i) {
      i.target = this;
      var d = this._listeners[i.type];
      if (d != null)
        for (var c = d.length, o = 0; o < c; o += 1) {
          var S = d[o];
          try {
            typeof S.handleEvent == "function" ? S.handleEvent(i) : S.call(this, i);
          } catch (f) {
            M(f);
          }
        }
    }, _.prototype.addEventListener = function(i, d) {
      i = String(i);
      var c = this._listeners, o = c[i];
      o == null && (o = [], c[i] = o);
      for (var S = !1, f = 0; f < o.length; f += 1)
        o[f] === d && (S = !0);
      S || o.push(d);
    }, _.prototype.removeEventListener = function(i, d) {
      i = String(i);
      var c = this._listeners, o = c[i];
      if (o != null) {
        for (var S = [], f = 0; f < o.length; f += 1)
          o[f] !== d && S.push(o[f]);
        S.length === 0 ? delete c[i] : c[i] = S;
      }
    };
    function oe(i) {
      this.type = i, this.target = void 0;
    }
    function Re(i, d) {
      oe.call(this, i), this.data = d.data, this.lastEventId = d.lastEventId;
    }
    Re.prototype = Object.create(oe.prototype);
    function g(i, d) {
      oe.call(this, i), this.status = d.status, this.statusText = d.statusText, this.headers = d.headers;
    }
    g.prototype = Object.create(oe.prototype);
    function l(i, d) {
      oe.call(this, i), this.error = d.error;
    }
    l.prototype = Object.create(oe.prototype);
    var a = -1, u = 0, s = 1, m = 2, y = -1, T = 0, R = 1, H = 2, N = 3, Z = /^text\/event\-stream(;.*)?$/i, be = 1e3, pe = 18e6, fe = function(i, d) {
      var c = i == null ? d : parseInt(i, 10);
      return c !== c && (c = d), se(c);
    }, se = function(i) {
      return Math.min(Math.max(i, be), pe);
    }, j = function(i, d, c) {
      try {
        typeof d == "function" && d.call(i, c);
      } catch (o) {
        M(o);
      }
    };
    function z(i, d) {
      _.call(this), d = d || {}, this.onopen = void 0, this.onmessage = void 0, this.onerror = void 0, this.url = void 0, this.readyState = void 0, this.withCredentials = void 0, this.headers = void 0, this._close = void 0, it(this, i, d);
    }
    function Oe() {
      return E != null && "withCredentials" in E.prototype || U == null ? new E() : new U();
    }
    var De = W != null && Te != null && "body" in Te.prototype;
    function it(i, d, c) {
      d = String(d);
      var o = !!c.withCredentials, S = c.lastEventIdQueryParameterName || "lastEventId", f = se(1e3), C = fe(c.heartbeatTimeout, 45e3), $ = "", O = f, D = !1, P = 0, w = c.headers || {}, I = c.Transport, ge = De && I == null ? void 0 : new ie(I != null ? new I() : Oe()), ke = I != null && typeof I != "string" ? new I() : ge == null ? new ae() : new he(), J = void 0, G = 0, de = a, Pe = "", Le = "", me = "", $e = "", X = T, ze = 0, Me = 0, nt = function(V, F, ee, te) {
        if (de === u)
          if (V === 200 && ee != null && Z.test(ee)) {
            de = s, D = Date.now(), O = f, i.readyState = s;
            var K = new g("open", {
              status: V,
              statusText: F,
              headers: te
            });
            i.dispatchEvent(K), j(i, i.onopen, K);
          } else {
            var B = "";
            V !== 200 ? (F && (F = F.replace(/\s+/g, " ")), B = "EventSource's response has a status " + V + " " + F + " that is not 200. Aborting the connection.") : B = "EventSource's response has a Content-Type specifying an unsupported type: " + (ee == null ? "-" : ee.replace(/\s+/g, " ")) + ". Aborting the connection.", Fe();
            var K = new g("error", {
              status: V,
              statusText: F,
              headers: te
            });
            i.dispatchEvent(K), j(i, i.onerror, K), console.error(B);
          }
      }, at = function(V) {
        if (de === s) {
          for (var F = -1, ee = 0; ee < V.length; ee += 1) {
            var te = V.charCodeAt(ee);
            (te === 10 || te === 13) && (F = ee);
          }
          var K = (F !== -1 ? $e : "") + V.slice(0, F + 1);
          $e = (F === -1 ? $e : "") + V.slice(F + 1), V !== "" && (D = Date.now(), P += V.length);
          for (var B = 0; B < K.length; B += 1) {
            var te = K.charCodeAt(B);
            if (X === y && te === 10)
              X = T;
            else if (X === y && (X = T), te === 13 || te === 10) {
              if (X !== T) {
                X === R && (Me = B + 1);
                var ve = K.slice(ze, Me - 1), ye = K.slice(Me + (Me < B && K.charCodeAt(Me) === 32 ? 1 : 0), B);
                ve === "data" ? (Pe += `
`, Pe += ye) : ve === "id" ? Le = ye : ve === "event" ? me = ye : ve === "retry" ? (f = fe(ye, f), O = f) : ve === "heartbeatTimeout" && (C = fe(ye, C), G !== 0 && (h(G), G = n(function() {
                  _e();
                }, C)));
              }
              if (X === T) {
                if (Pe !== "") {
                  $ = Le, me === "" && (me = "message");
                  var xe = new Re(me, {
                    data: Pe.slice(1),
                    lastEventId: Le
                  });
                  if (i.dispatchEvent(xe), me === "open" ? j(i, i.onopen, xe) : me === "message" ? j(i, i.onmessage, xe) : me === "error" && j(i, i.onerror, xe), de === m)
                    return;
                }
                Pe = "", me = "";
              }
              X = te === 13 ? y : T;
            } else
              X === T && (ze = B, X = R), X === R ? te === 58 && (Me = B + 1, X = H) : X === H && (X = N);
          }
        }
      }, qe = function(V) {
        if (de === s || de === u) {
          de = a, G !== 0 && (h(G), G = 0), G = n(function() {
            _e();
          }, O), O = se(Math.min(f * 16, O * 2)), i.readyState = u;
          var F = new l("error", { error: V });
          i.dispatchEvent(F), j(i, i.onerror, F), V != null && console.error(V);
        }
      }, Fe = function() {
        de = m, J != null && (J.abort(), J = void 0), G !== 0 && (h(G), G = 0), i.readyState = m;
      }, _e = function() {
        if (G = 0, de !== a) {
          if (!D && J != null)
            qe(new Error("No activity within " + C + " milliseconds. " + (de === u ? "No response received." : P + " chars received.") + " Reconnecting.")), J != null && (J.abort(), J = void 0);
          else {
            var V = Math.max((D || Date.now()) + C - Date.now(), 1);
            D = !1, G = n(function() {
              _e();
            }, V);
          }
          return;
        }
        D = !1, P = 0, G = n(function() {
          _e();
        }, C), de = u, Pe = "", me = "", Le = $, $e = "", ze = 0, Me = 0, X = T;
        var F = d;
        if (d.slice(0, 5) !== "data:" && d.slice(0, 5) !== "blob:" && $ !== "") {
          var ee = d.indexOf("?");
          F = ee === -1 ? d : d.slice(0, ee + 1) + d.slice(ee + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(ye, xe) {
            return xe === S ? "" : ye;
          }), F += (d.indexOf("?") === -1 ? "?" : "&") + S + "=" + encodeURIComponent($);
        }
        var te = i.withCredentials, K = {};
        K.Accept = "text/event-stream";
        var B = i.headers;
        if (B != null)
          for (var ve in B)
            Object.prototype.hasOwnProperty.call(B, ve) && (K[ve] = B[ve]);
        try {
          J = ke.open(ge, nt, at, qe, F, te, K);
        } catch (ye) {
          throw Fe(), ye;
        }
      };
      i.url = d, i.readyState = u, i.withCredentials = o, i.headers = w, i._close = Fe, _e();
    }
    z.prototype = Object.create(_.prototype), z.prototype.CONNECTING = u, z.prototype.OPEN = s, z.prototype.CLOSED = m, z.prototype.close = function() {
      this._close();
    }, z.CONNECTING = u, z.OPEN = s, z.CLOSED = m, z.prototype.withCredentials = void 0;
    var Be = b;
    E != null && (b == null || !("withCredentials" in b.prototype)) && (Be = z), function(i) {
      {
        var d = i(t);
        d !== void 0 && (e.exports = d);
      }
    }(function(i) {
      i.EventSourcePolyfill = z, i.NativeEventSource = b, i.EventSource = Be;
    });
  })(typeof globalThis == "undefined" ? typeof window != "undefined" ? window : typeof self != "undefined" ? self : Ve : globalThis);
})(je, je.exports);
const Ge = "user-deposit-withdrawal", Xe = [
  "mm-hcback-to-merchant",
  "mm-hc-back-tomerchant",
  "mm-hc-sports",
  "mm-hc-casino",
  "mm-hc-contact",
  "mm-wm-hc-init-deposit",
  "mm-wm-hc-init-deposit-quick"
], Ne = {
  TWO_FACTOR_AUTH: "TWO_FACTOR_AUTH_NOTIFICATION",
  SESSION_EXPIRATION: "SESSION_EXPIRATION"
}, wt = {
  FAILED_2FA: "failed2FA"
}, le = {
  OPEN_FULL_CASHIER: "MMFE:openFullCashier",
  SET_QUICK_DEPOSIT_HEIGHT: "MMFE:setQuickDepositHeight",
  SET_IFRAME_HEIGHT: "MMFE:setIFrameHeight",
  SELECTED_PAYMENT_METHOD: "MMFE:selectedPaymentMethod",
  PROCEED_PAYMENT: "MMFE:proceedPayment",
  CANCEL_PAYMENT: "MMFE:cancelPayment",
  RESET_OTP: "MMFE:ResetOTP"
}, Et = () => {
}, Ie = {
  PROCEED: { [le.PROCEED_PAYMENT]: "true" },
  CANCEL: { [le.CANCEL_PAYMENT]: "true" },
  RESET: { [le.RESET_OTP]: "true" },
  PROCEED_FALSE: { [le.PROCEED_PAYMENT]: "false" }
}, bt = `:host {
  font: inherit;
  display: block;
  height: 100%;
  container-type: inline-size;
}

.DepositWithdrawalContainer {
  container-type: inline-size;
  container-name: deposit-container;
}

.CategoryTitle {
  font-size: var(--emw--font-size-x-large, 26px);
  color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
}

.MenuReturnButton {
  font: inherit;
  color: var(--emw--color-gray-300, #58586B);
  display: inline-flex;
  align-items: center;
  column-gap: 10px;
  margin-bottom: 10px;
}
.MenuReturnButton svg {
  fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
}
.MenuReturnButton h2.CategoryTitleMobile {
  font-size: 16px;
  color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));
}

.ErrorMessage {
  color: var(--emw--pam-color-typography, var(--emw--color-typography, #FFFFFF));
}

.DepositWithdrawalWrapper {
  width: 100%;
  margin: 0;
  padding: 50px;
  box-sizing: border-box;
  overflow-y: scroll;
}
.DepositWithdrawalWrapper iframe {
  border-width: 0;
}

.ShortCashier.DepositWithdrawalWrapper {
  height: 500px;
}
.ShortCashier.CategoryTitle.CategoryTitle {
  margin-right: 20px;
  padding-top: 20px;
  color: var(--emw--color-black, #000000);
}
.ShortCashier .ErrorMessage {
  margin: auto;
  width: 90%;
  margin-top: 70px;
  text-align: center;
  color: var(--emw--color-black, #000000);
}

@container (max-width: 768px) {
  .DepositWithdrawalWrapper {
    padding: 20px 15px;
  }
  .DepositWithdrawalWrapper:not(.ShortCashier) {
    overflow: visible;
  }
}`, Ct = bt;
tt.extend(St);
const Tt = class {
  constructor(e) {
    Ke(this, e), this.sseStream = null, this.selectedPaymentMethod = null, this.sseReconnectAttempts = 0, this.sseReconnectTimer = null, this.sseShouldStayConnected = !1, this.SSE_MAX_RECONNECT_ATTEMPTS = 5, this.SSE_RECONNECT_DELAY_BASE_MS = 1e3, this.bindedHandler = this.handleMessage.bind(this), this.userAgent = window.navigator.userAgent, this.isMobile = vt(this.userAgent), this.errorCodes = ["21123", "21122", "21121"], this.toggleScreen = () => {
      window.postMessage({ type: "PlayerAccountMenuActive", isMobile: this.isMobile }, window.location.href);
    }, this.mbSource = void 0, this.clientStyling = "", this.clientStylingUrl = "", this.translationUrl = "", this.endpoint = void 0, this.type = void 0, this.channel = void 0, this.language = void 0, this.productType = "", this.userId = void 0, this.session = void 0, this.successUrl = void 0, this.cancelUrl = void 0, this.failUrl = void 0, this.sportsUrl = void 0, this.casinoUrl = void 0, this.contactUrl = void 0, this.depositUrl = void 0, this.currency = "", this.showBonusSelectionInput = "true", this.isShortCashier = !1, this.homeUrl = void 0, this.beforeRedirect = Et, this.forwardCashierRedirects = !1, this.enableStepUpAuth = !1, this.dynamicHeight = void 0, this.cashierInfoUrl = void 0;
  }
  get typeParameter() {
    if (this.type === "deposit")
      return "Deposit";
    if (this.type === "withdraw")
      return "Withdraw";
  }
  handleClientStylingChange(e, t) {
    e != t && Ue(this.stylingContainer, this.clientStyling);
  }
  handleClientStylingChangeURL(e, t) {
    e != t && this.clientStylingUrl && He(this.stylingContainer, this.clientStylingUrl);
  }
  componentWillLoad() {
    return Se(this, null, function* () {
      if (yield this.loadWidget(), this.translationUrl)
        return mt(this.translationUrl);
    });
  }
  componentDidLoad() {
    this.stylingContainer && (window.emMessageBus != null ? Ze(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription) : (this.clientStyling && Ue(this.stylingContainer, this.clientStyling), this.clientStylingUrl && He(this.stylingContainer, this.clientStylingUrl))), window.addEventListener("message", this.bindedHandler, !1);
  }
  disconnectedCallback() {
    window.removeEventListener("message", this.bindedHandler, !1), this.stylingSubscription && this.stylingSubscription.unsubscribe(), this.closeSSEStream();
  }
  render() {
    return p(st, { key: "8bcf85e10168473086c2fc396d6e765ab83b7327" }, this.enableStepUpAuth && p("player-step-up-auth", { key: "8ebf6cde613402070345c2263466e1d533c76887", endpoint: this.endpoint, userSession: this.session, language: this.language, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl }), p("div", { key: "b8f01c9a533ad6609f4db2d0981a716930e21b52", ref: (e) => this.stylingContainer = e, class: "" }, p("div", { key: "74c808658271934aee5bc125f0663e56dfcf47b8", class: `DepositWithdrawalWrapper ${this.isShortCashier ? "ShortCashier" : ""}` }, !(this.isMobile && !this.isShortCashier) && p("h2", { key: "70f1afb63dd6fec358b864063123f7910ac25906", class: "CategoryTitle" }, Ce(this.typeParameter === "Withdraw" ? "Withdraw" : "Deposit", this.language)), p("div", { key: "83f0175347d8ab1260fa21dafeba9a4692a01b74", style: { marginTop: this.isShortCashier ? "30px" : "0" } }, this.isMobile && !this.isShortCashier ? p("div", { class: "MenuReturnButton", onClick: this.toggleScreen }, p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, p("defs", null), p("g", { transform: "translate(-20 -158)" }, p("g", { transform: "translate(20 158)" }, p("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), p("h2", { class: "CategoryTitleMobile" }, Ce(this.typeParameter === "Withdraw" ? "Withdraw" : "Deposit", this.language))) : null), this.cashierInfoUrl ? p("iframe", { ref: (e) => this.cashierIframeRef = e, width: "100%", allow: "payment", height: this.dynamicHeight, src: this.cashierInfoUrl }) : p("h3", { innerHTML: this.type === "deposit" ? Ce("denyDeposit", this.language) : Ce("denyWithdrawal", this.language), class: "ErrorMessage" }))));
  }
  loadWidget() {
    return Se(this, null, function* () {
      const e = {
        Channel: this.channel,
        Type: this.typeParameter,
        SuccessUrl: this.successUrl,
        CancelUrl: this.cancelUrl,
        FailUrl: this.failUrl,
        Language: this.language,
        productType: this.productType,
        isShortCashier: this.isShortCashier,
        currency: this.currency,
        showBonusSelectionInput: this.showBonusSelectionInput
      };
      if (!(Object.values(e).some((t) => t === void 0) || !this.endpoint))
        try {
          const t = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`, r = yield fetch(t, {
            method: "POST",
            headers: {
              "X-Sessionid": this.session,
              "Content-Type": "application/json",
              "X-Client-Request-Timestamp": tt.utc().format("YYYY-MM-DD HH:mm:ss.SSS")
            },
            body: JSON.stringify(e)
          });
          if (!r.ok) {
            const h = yield r.text();
            throw new Error(h);
          }
          const n = yield r.json();
          if (n.CashierInfo)
            this.cashierInfoUrl = n.CashierInfo.Url;
          else {
            let h;
            if (n.ResponseMessage) {
              let U = this.errorCodes.find((x) => n.ResponseMessage.includes(x)) || null;
              U ? h = Ce(`errorCode${U}`, this.language) : h = Ce("notFoundErrorCode", this.language);
            } else
              h = this.type === "deposit" ? Ce("denyDeposit", this.language) : Ce("denyWithdrawal", this.language);
            const E = { type: "error", message: h };
            window.postMessage({ type: "DenyDepositOrWithdrawal", data: E }, window.location.href);
          }
        } catch (t) {
          console.error(t);
        }
    });
  }
  handleEnableStepUpAuthChange(e) {
    !e && this.sseStream && this.closeSSEStream();
  }
  handleMessage(e) {
    const t = this.extractPayload(e);
    if (!t)
      return;
    this.applyLayoutHints(t);
    const r = this.extractCashierRedirectReason(t);
    if (!r || this.emitForwardedRedirect(e, r))
      return;
    const n = this.resolveRedirectPlan(r);
    n && this.doRedirect(n.reason, n.targetUrl);
  }
  extractCashierRedirectReason(e) {
    if (typeof (e == null ? void 0 : e.type) == "string" && Xe.includes(e.type))
      return e.type;
    if (typeof (e == null ? void 0 : e.redirect) == "string" && Xe.includes(e.redirect))
      return e.redirect;
  }
  extractPayload(e) {
    if (!(!(e != null && e.data) || typeof e.data != "object"))
      return e.data;
  }
  applyLayoutHints(e) {
    if (e[le.OPEN_FULL_CASHIER] === "true" && (window.postMessage({ type: "GoToDeposit" }, window.location.href), window.postMessage({ type: "CloseShortCashier" }, window.location.href)), e[le.SET_QUICK_DEPOSIT_HEIGHT] && this.isShortCashier && (this.dynamicHeight = e[le.SET_QUICK_DEPOSIT_HEIGHT].toString() + "px"), e[le.SET_IFRAME_HEIGHT] && (this.dynamicHeight = e[le.SET_IFRAME_HEIGHT].toString() + "px"), e[le.SELECTED_PAYMENT_METHOD]) {
      const t = e[le.SELECTED_PAYMENT_METHOD];
      this.selectedPaymentMethod !== t && (this.selectedPaymentMethod = t, this.sseStream && this.closeSSEStream(), this.type === "withdraw" && yt(t) && this.enableStepUpAuth && this.initializeSSE());
    }
    if (e["MMFE:vendorRedirect"]) {
      const t = e["MMFE:vendorRedirect"];
      window.postMessage({ type: `${Ge}:mm-open-vendor`, url: t }, window.location.href);
    }
  }
  resolveRedirectPlan(e) {
    switch (e) {
      case "mm-hcback-to-merchant":
      case "mm-hc-back-tomerchant":
        return this.buildRedirectPlan(e, this.homeUrl);
      case "mm-hc-sports":
        return this.buildRedirectPlan(e, this.sportsUrl);
      case "mm-hc-casino":
        return this.buildRedirectPlan(window.location.href, this.casinoUrl);
      case "mm-hc-contact":
        return window.postMessage({ type: "CloseShortCashier" }, window.location.href), this.buildRedirectPlan(window.location.href, this.contactUrl);
      case "mm-wm-hc-init-deposit":
      case "mm-wm-hc-init-deposit-quick":
        return window.postMessage({ type: "CloseShortCashier" }, window.location.href), this.buildRedirectPlan(window.location.href, this.depositUrl);
      default:
        return;
    }
  }
  buildRedirectPlan(e, t) {
    if (t)
      return { reason: e, targetUrl: t };
  }
  emitForwardedRedirect(e, t) {
    if (!this.forwardCashierRedirects)
      return !1;
    const r = {
      type: `${Ge}:${t}`,
      originalType: t,
      payload: e.data,
      origin: e.origin
    };
    return window.postMessage(r, window.location.href), !0;
  }
  doRedirect(e, t) {
    const r = { reason: e, url: t, cancel: !1 };
    if (this.beforeRedirect(r), !r.cancel) {
      if (!r.url) {
        window.location.href = "/";
        return;
      }
      window.location.href = r.url;
    }
  }
  initializeSSE() {
    if (!(this.sseStream && this.sseStream.readyState !== je.exports.EventSourcePolyfill.CLOSED)) {
      if (!this.endpoint || !this.userId || !this.session || this.type !== "withdraw") {
        console.warn("[SSE] initializeSSE - missing required props, cannot initialize");
        return;
      }
      this.sseShouldStayConnected = !0, this.sseReconnectAttempts = 0, this.connectSSE();
    }
  }
  connectSSE() {
    if (this.sseStream) {
      try {
        this.sseStream.close();
      } catch (e) {
        console.warn("[SSE] closeSSEStream - error closing stream:", e);
      }
      this.sseStream = null;
    }
    if (this.sseShouldStayConnected)
      try {
        const e = new URL(`/v1/player/${this.userId}/information/updates`, this.endpoint), t = {
          accept: "text/event-stream",
          "X-SessionId": this.session
        };
        this.sseStream = new je.exports.EventSourcePolyfill(e, { headers: t }), this.sseStream.addEventListener("open", this.handleSSEOpen.bind(this)), this.sseStream.addEventListener("message", this.handleSSEMessage.bind(this)), this.sseStream.addEventListener("error", this.handleSSEError.bind(this));
      } catch (e) {
        console.error("[SSE] connectSSE - Failed to create EventSourcePolyfill:", e), this.scheduleReconnect();
      }
  }
  handleSSEOpen(e) {
    console.info("[SSE] handleSSEOpen - connection opened successfully"), this.sseReconnectAttempts = 0, this.sseReconnectTimer && (clearTimeout(this.sseReconnectTimer), this.sseReconnectTimer = null);
  }
  handleSSEMessage(e) {
    if (this.enableStepUpAuth)
      try {
        const t = JSON.parse(e.data), r = t.type;
        if (r === Ne.TWO_FACTOR_AUTH) {
          const { body: { challengeId: n } = {} } = t;
          n ? this.triggerStepUpAuth(n) : console.error(`${Ne.TWO_FACTOR_AUTH} received but challengeId not found in body`);
        } else
          r === Ne.SESSION_EXPIRATION && (console.info("[SSE] SESSION_EXPIRATION received, closing connection"), window.postMessage({ type: "SessionExpiration", reason: wt.FAILED_2FA }, window.location.href), this.closeSSEStream());
      } catch (t) {
        console.error("Error parsing SSE message:", t);
      }
  }
  handleSSEError(e) {
    console.warn("[SSE] connection error"), this.sseShouldStayConnected && this.sseReconnectAttempts < this.SSE_MAX_RECONNECT_ATTEMPTS ? this.scheduleReconnect() : this.sseReconnectAttempts >= this.SSE_MAX_RECONNECT_ATTEMPTS && (console.error("[SSE] handleSSEError - max reconnection attempts reached, giving up"), this.closeSSEStream());
  }
  scheduleReconnect() {
    if (!this.sseShouldStayConnected)
      return;
    this.sseReconnectTimer && clearTimeout(this.sseReconnectTimer), this.sseReconnectAttempts++;
    const e = this.SSE_RECONNECT_DELAY_BASE_MS * Math.pow(2, this.sseReconnectAttempts - 1);
    this.sseReconnectTimer = setTimeout(() => {
      this.sseReconnectTimer = null, this.sseShouldStayConnected && this.connectSSE();
    }, e);
  }
  closeSSEStream() {
    if (this.sseShouldStayConnected = !1, this.sseReconnectTimer && (clearTimeout(this.sseReconnectTimer), this.sseReconnectTimer = null), this.sseStream) {
      try {
        this.sseStream.close();
      } catch (e) {
        console.warn("[SSE] closeSSEStream - error closing stream:", e);
      }
      this.sseStream = null;
    }
    this.sseReconnectAttempts = 0;
  }
  triggerStepUpAuth(e) {
    this.enableStepUpAuth && window.dispatchEvent(new CustomEvent("stepUpAuthRequired", {
      detail: {
        "x-step-up-required": !0,
        "x-step-up-token": e,
        flow: "stateful"
      }
    }));
  }
  getCashierOrigin() {
    if (!this.cashierInfoUrl)
      return "*";
    try {
      return new URL(this.cashierInfoUrl).origin;
    } catch (e) {
      return console.warn("Failed to parse cashier URL origin, using wildcard:", e), "*";
    }
  }
  sendMessageToCashier(e) {
    var t;
    if (!(!((t = this.cashierIframeRef) === null || t === void 0) && t.contentWindow)) {
      console.warn("Cashier iframe not available for postMessage");
      return;
    }
    const r = this.getCashierOrigin();
    this.cashierIframeRef.contentWindow.postMessage(e, r);
  }
  handleOtpSuccess() {
    this.enableStepUpAuth && (this.sendMessageToCashier(Ie.PROCEED), this.closeSSEStream());
  }
  handleManualClosePopup() {
    this.enableStepUpAuth && (this.sendMessageToCashier(Ie.CANCEL), this.closeSSEStream());
  }
  handleOtpResendRequested() {
    this.enableStepUpAuth && (window.dispatchEvent(new CustomEvent("closePopup")), this.sendMessageToCashier(Ie.RESET));
  }
  handleOtpSetTimeout() {
    this.enableStepUpAuth && this.sendMessageToCashier(Ie.PROCEED_FALSE);
  }
  static get watchers() {
    return {
      clientStyling: ["handleClientStylingChange"],
      clientStylingUrl: ["handleClientStylingChangeURL"],
      enableStepUpAuth: ["handleEnableStepUpAuthChange"]
    };
  }
};
Tt.style = Ct;
export {
  pt as player_step_up_auth,
  Tt as user_deposit_withdrawal
};
