import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$d } from './checkbox-group-input2.js';
import { d as defineCustomElement$c } from './checkbox-input2.js';
import { d as defineCustomElement$b } from './date-input2.js';
import { d as defineCustomElement$a } from './email-input2.js';
import { a as defineCustomElement$2, d as defineCustomElement$9 } from './general-input2.js';
import { d as defineCustomElement$8 } from './number-input2.js';
import { d as defineCustomElement$7 } from './password-input2.js';
import { d as defineCustomElement$6 } from './radio-input2.js';
import { d as defineCustomElement$5 } from './select-input2.js';
import { d as defineCustomElement$4 } from './tel-input2.js';
import { d as defineCustomElement$3 } from './text-input2.js';

const DEFAULT_LANGUAGE = 'en';
const TRANSLATIONS = {
  "en": {
    "GmErr_AMOUNT_INVALID": "The specified amount is invalid.",
    "GmErr_REGISTER_OVERAGE": "The registration has exceeded the allowable limit.",
    "GmErr_REGISTER_UNDERAGE": "The registration is under the allowable limit.",
    "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "User authentication failed due to too many unsuccessful attempts.",
    "GmErr_USER_ACCOUNT_BLOCKED": "The user account is blocked.",
    "GmErr_USER_NOT_VERIFIED": "The user has not been verified.",
    "GmErr_USER_NOT_FOUND": "No user found with the provided information.",
    "GmErr_USER_ID_INVALID": "The user ID provided is invalid.",
    "GmErr_USER_AUTH_FAILED": "User authentication failed.",
    "GmErr_USER_DUPLICATED": "The user already exists in the system.",
    "GmErr_USER_NOT_ACTIVATED": "The user account has not been activated.",
    "GmErr_PASSWORD_CONTAINS_EMAIL": "The password cannot contain the email address.",
    "GmErr_PASSWORD_CONTAINS_USERNAME": "The password cannot contain the username.",
    "GmErr_PASSWORD_CONTAINS_SPACES": "The password cannot contain spaces.",
    "GmErr_USER_4TS_CHECK_EXISTS": "The user 4TS check already exists.",
    "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "The user is excluded from registration.",
    "GmErr_USER_NAV_EXCLUDED_LOGIN": "The user is excluded from login.",
    "GmErr_USERNAME_REQUIRED": "A username is required.",
    "GmErr_USER_EMAIL_NOT_VERIFIED": "The user's email address has not been verified.",
    "GmErr_EMAIL_REQUIRED": "An email address is required.",
    "GmErr_USERNAME_ALREADY_EXISTS": "The username is already taken.",
    "GmErr_DUPLICATE_PERSONAL_ID": "Duplicate personal ID found.",
    "GmErr_INVALID_USER_DOCUMENT": "The user document is invalid.",
    "GmErr_INVALID_CODE": "The code provided is invalid.",
    "GmErr_EXPIRED_TOKEN": "The token has expired.",
    "GmErr_ATTEMPTS_EXCEEDED": "The maximum number of attempts has been exceeded.",
    "GmErr_BLOCK_USER_INCORRECT_CODE": "The user has been blocked due to an incorrect code.",
    "GmErr_TOKEN_NOT_FOUND": "The token was not found.",
    "GmErr_INVALID_PHONE_NUMBER": "The phone number provided is invalid.",
    "GmErr_CODE_MISSING": "The code is missing.",
    "GmErr_UNREGISTERED_USER": "The user is not registered.",
    "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Maximum attempts to generate a code have been exceeded.",
    "GmErr_UNEXPECTED_EXCEPTION": "An unexpected exception occurred.",
    "GmErr_INVALID_USER_ID": "The user ID provided is invalid.",
    "GmErr_NOT_ALLOWED_EXCEPTION": "This action is not allowed.",
    "GmErr_CAN_NOT_FIND_ROLE": "Unable to find the specified role.",
    "GmErr_NO_SESSION_PROVIDED": "No session was provided.",
    "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "No active session found for this user.",
    "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "The user has already been anonymized.",
    "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "No role has been set up to be assigned.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "The provided session does not belong to the user.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "The provided session does not exist.",
    "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "The role has already been assigned to the user.",
    "GmErr_ASSIGN_USER_ROLE_FAILED": "Failed to assign a role to the user.",
    "nextButton": 'Next',
    "backButton": 'Back',
    "doneButton": 'Done',
    "generalError": "Something went wrong... Please try again.",
    "successMessage": "Register successful"
  },
  "hu": {
    "GmErr_AMOUNT_INVALID": "A megadott összeg érvénytelen.",
    "GmErr_REGISTER_OVERAGE": "A regisztráció túllépte a megengedett határt.",
    "GmErr_REGISTER_UNDERAGE": "A regisztráció a megengedett határ alatt van.",
    "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "A felhasználó hitelesítése túl sok sikertelen próbálkozás miatt meghiúsult.",
    "GmErr_USER_ACCOUNT_BLOCKED": "A felhasználói fiók le van tiltva.",
    "GmErr_USER_NOT_VERIFIED": "A felhasználó nincs ellenőrizve.",
    "GmErr_USER_NOT_FOUND": "A megadott adatokkal nem található felhasználó.",
    "GmErr_USER_ID_INVALID": "A megadott felhasználói azonosító érvénytelen.",
    "GmErr_USER_AUTH_FAILED": "A felhasználó hitelesítése meghiúsult.",
    "GmErr_USER_DUPLICATED": "A felhasználó már létezik a rendszerben.",
    "GmErr_USER_NOT_ACTIVATED": "A felhasználó fiókja nincs aktiválva.",
    "GmErr_PASSWORD_CONTAINS_EMAIL": "A jelszó nem tartalmazhat e-mail címet.",
    "GmErr_PASSWORD_CONTAINS_USERNAME": "A jelszó nem tartalmazhat felhasználónevet.",
    "GmErr_PASSWORD_CONTAINS_SPACES": "A jelszó nem tartalmazhat szóközöket.",
    "GmErr_USER_4TS_CHECK_EXISTS": "A felhasználó 4TS ellenőrzése már létezik.",
    "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "A felhasználó kizárva a regisztrációból.",
    "GmErr_USER_NAV_EXCLUDED_LOGIN": "A felhasználó kizárva a bejelentkezésből.",
    "GmErr_USERNAME_REQUIRED": "Felhasználónév megadása szükséges.",
    "GmErr_USER_EMAIL_NOT_VERIFIED": "A felhasználó e-mail címe nincs megerősítve.",
    "GmErr_EMAIL_REQUIRED": "E-mail cím megadása szükséges.",
    "GmErr_USERNAME_ALREADY_EXISTS": "A felhasználónév már foglalt.",
    "GmErr_DUPLICATE_PERSONAL_ID": "Már létező személyes azonosító.",
    "GmErr_INVALID_USER_DOCUMENT": "A felhasználói dokumentum érvénytelen.",
    "GmErr_INVALID_CODE": "A megadott kód érvénytelen.",
    "GmErr_EXPIRED_TOKEN": "A token lejárt.",
    "GmErr_ATTEMPTS_EXCEEDED": "A megengedett próbálkozások száma túllépve.",
    "GmErr_BLOCK_USER_INCORRECT_CODE": "A felhasználó blokkolva lett a hibás kód miatt.",
    "GmErr_TOKEN_NOT_FOUND": "A token nem található.",
    "GmErr_INVALID_PHONE_NUMBER": "A megadott telefonszám érvénytelen.",
    "GmErr_CODE_MISSING": "A szükséges kód hiányzik.",
    "GmErr_UNREGISTERED_USER": "A felhasználó nincs regisztrálva.",
    "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Túllépték a kódgenerálási próbálkozások számát.",
    "GmErr_UNEXPECTED_EXCEPTION": "Váratlan kivétel történt.",
    "GmErr_INVALID_USER_ID": "A felhasználói azonosító érvénytelen.",
    "GmErr_NOT_ALLOWED_EXCEPTION": "Ez a művelet nem engedélyezett.",
    "GmErr_CAN_NOT_FIND_ROLE": "A megadott szerepkör nem található.",
    "GmErr_NO_SESSION_PROVIDED": "Nem került megadásra munkamenet.",
    "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "Nincs aktív munkamenet ehhez a felhasználóhoz.",
    "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "A felhasználó már anonimizálva lett.",
    "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "Nincs beállítva hozzárendelhető szerepkör.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "A megadott munkamenet nem tartozik a felhasználóhoz.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "A megadott munkamenet nem létezik.",
    "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "A szerepkör már hozzá lett rendelve a felhasználóhoz.",
    "GmErr_ASSIGN_USER_ROLE_FAILED": "Nem sikerült a felhasználói szerepkört hozzárendelni.",
    "nextButton": 'Következő',
    "backButton": 'Vissza',
    "doneButton": 'Kész',
    "generalError": "Valami hiba történt... Próbáld újra.",
    "successMessage": "Sikeres regisztráció"
  },
  "hr": {
    "GmErr_AMOUNT_INVALID": "Navedeni iznos je nevažeći.",
    "GmErr_REGISTER_OVERAGE": "Registracija je premašila dopušteni limit.",
    "GmErr_REGISTER_UNDERAGE": "Registracija je ispod dopuštenog limita.",
    "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "Neuspješno autentificiranje korisnika zbog previše pokušaja.",
    "GmErr_USER_ACCOUNT_BLOCKED": "Korisnički račun je blokiran.",
    "GmErr_USER_NOT_VERIFIED": "Korisnik nije verificiran.",
    "GmErr_USER_NOT_FOUND": "Korisnik s navedenim podacima nije pronađen.",
    "GmErr_USER_ID_INVALID": "Navedeni ID korisnika je nevažeći.",
    "GmErr_USER_AUTH_FAILED": "Neuspješno autentificiranje korisnika.",
    "GmErr_USER_DUPLICATED": "Korisnik već postoji u sustavu.",
    "GmErr_USER_NOT_ACTIVATED": "Korisnički račun nije aktiviran.",
    "GmErr_PASSWORD_CONTAINS_EMAIL": "Lozinka ne smije sadržavati e-mail adresu.",
    "GmErr_PASSWORD_CONTAINS_USERNAME": "Lozinka ne smije sadržavati korisničko ime.",
    "GmErr_PASSWORD_CONTAINS_SPACES": "Lozinka ne smije sadržavati razmake.",
    "GmErr_USER_4TS_CHECK_EXISTS": "4TS provjera korisnika već postoji.",
    "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "Korisnik je isključen iz registracije.",
    "GmErr_USER_NAV_EXCLUDED_LOGIN": "Korisnik je isključen iz prijave.",
    "GmErr_USERNAME_REQUIRED": "Korisničko ime je obavezno.",
    "GmErr_USER_EMAIL_NOT_VERIFIED": "E-mail adresa korisnika nije verificirana.",
    "GmErr_EMAIL_REQUIRED": "E-mail adresa je obavezna.",
    "GmErr_USERNAME_ALREADY_EXISTS": "Korisničko ime je već zauzeto.",
    "GmErr_DUPLICATE_PERSONAL_ID": "Pronađen je duplicirani osobni ID.",
    "GmErr_INVALID_USER_DOCUMENT": "Dokument korisnika je nevažeći.",
    "GmErr_INVALID_CODE": "Navedeni kod je nevažeći.",
    "GmErr_EXPIRED_TOKEN": "Token je istekao.",
    "GmErr_ATTEMPTS_EXCEEDED": "Prekoračen je maksimalni broj pokušaja.",
    "GmErr_BLOCK_USER_INCORRECT_CODE": "Korisnik je blokiran zbog pogrešnog koda.",
    "GmErr_TOKEN_NOT_FOUND": "Token nije pronađen.",
    "GmErr_INVALID_PHONE_NUMBER": "Navedeni broj telefona je nevažeći.",
    "GmErr_CODE_MISSING": "Nedostaje potrebni kod.",
    "GmErr_UNREGISTERED_USER": "Korisnik nije registriran.",
    "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Prekoračen je broj pokušaja generiranja koda.",
    "GmErr_UNEXPECTED_EXCEPTION": "Došlo je do neočekivane iznimke.",
    "GmErr_INVALID_USER_ID": "Navedeni ID korisnika je nevažeći.",
    "GmErr_NOT_ALLOWED_EXCEPTION": "Ova radnja nije dopuštena.",
    "GmErr_CAN_NOT_FIND_ROLE": "Navedena uloga nije pronađena.",
    "GmErr_NO_SESSION_PROVIDED": "Nema pružene sesije.",
    "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "Nema aktivne sesije za ovog korisnika.",
    "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "Korisnik je već anonimiziran.",
    "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "Nema postavljene uloge za dodjeljivanje.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "Pružena sesija ne pripada korisniku.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "Pružena sesija ne postoji.",
    "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "Uloga je već dodijeljena korisniku.",
    "GmErr_ASSIGN_USER_ROLE_FAILED": "Neuspješno dodjeljivanje uloge korisniku.",
    "nextButton": 'Sljedeće',
    "backButton": 'Nazad',
    "doneButton": 'Gotovo',
    "generalError": "Nešto nije u redu... Molimo pokušajte ponovo",
    "successMessage": "Register successful"
  },
  'pt-br': {
    "GmErr_AMOUNT_INVALID": "O valor especificado é inválido.",
    "GmErr_REGISTER_OVERAGE": "A inscrição excedeu o limite permitido.",
    "GmErr_REGISTER_UNDERAGE": "A inscrição está abaixo do limite permitido.",
    "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "Falha na autenticação do usuário devido a muitas tentativas sem sucesso.",
    "GmErr_USER_ACCOUNT_BLOCKED": "A conta do usuário está bloqueada.",
    "GmErr_USER_NOT_VERIFIED": "O usuário não foi verificado.",
    "GmErr_USER_NOT_FOUND": "Nenhum usuário encontrado com as informações fornecidas.",
    "GmErr_USER_ID_INVALID": "O ID do usuário fornecido é inválido.",
    "GmErr_USER_AUTH_FAILED": "Falha na autenticação do usuário.",
    "GmErr_USER_DUPLICATED": "O usuário já existe no sistema.",
    "GmErr_USER_NOT_ACTIVATED": "A conta do usuário não está ativada.",
    "GmErr_PASSWORD_CONTAINS_EMAIL": "A senha não pode conter o endereço de e-mail.",
    "GmErr_PASSWORD_CONTAINS_USERNAME": "A senha não pode conter o nome de usuário.",
    "GmErr_PASSWORD_CONTAINS_SPACES": "A senha não pode conter espaços.",
    "GmErr_USER_4TS_CHECK_EXISTS": "A verificação 4TS do usuário já existe.",
    "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "O usuário está excluído da inscrição.",
    "GmErr_USER_NAV_EXCLUDED_LOGIN": "O usuário está excluído do login.",
    "GmErr_USERNAME_REQUIRED": "O nome de usuário é obrigatório.",
    "GmErr_USER_EMAIL_NOT_VERIFIED": "O e-mail do usuário não foi verificado.",
    "GmErr_EMAIL_REQUIRED": "Um endereço de e-mail é obrigatório.",
    "GmErr_USERNAME_ALREADY_EXISTS": "O nome de usuário já está em uso.",
    "GmErr_DUPLICATE_PERSONAL_ID": "ID pessoal duplicado encontrado.",
    "GmErr_INVALID_USER_DOCUMENT": "O documento do usuário é inválido.",
    "GmErr_INVALID_CODE": "O código fornecido é inválido.",
    "GmErr_EXPIRED_TOKEN": "O token expirou.",
    "GmErr_ATTEMPTS_EXCEEDED": "O número máximo de tentativas foi excedido.",
    "GmErr_BLOCK_USER_INCORRECT_CODE": "O usuário foi bloqueado devido a um código incorreto.",
    "GmErr_TOKEN_NOT_FOUND": "O token não foi encontrado.",
    "GmErr_INVALID_PHONE_NUMBER": "O número de telefone fornecido é inválido.",
    "GmErr_CODE_MISSING": "O código necessário está faltando.",
    "GmErr_UNREGISTERED_USER": "O usuário não está registrado.",
    "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "O número máximo de tentativas para gerar um código foi excedido.",
    "GmErr_UNEXPECTED_EXCEPTION": "Ocorreu uma exceção inesperada.",
    "GmErr_INVALID_USER_ID": "O ID do usuário fornecido é inválido.",
    "GmErr_NOT_ALLOWED_EXCEPTION": "Esta ação não é permitida.",
    "GmErr_CAN_NOT_FIND_ROLE": "Não foi possível encontrar a função especificada.",
    "GmErr_NO_SESSION_PROVIDED": "Nenhuma sessão foi fornecida.",
    "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "Nenhuma sessão ativa encontrada para este usuário.",
    "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "O usuário já foi anonimizado.",
    "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "Nenhuma função foi configurada para ser atribuída.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "A sessão fornecida não pertence ao usuário.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "A sessão fornecida não existe.",
    "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "A função já foi atribuída ao usuário.",
    "GmErr_ASSIGN_USER_ROLE_FAILED": "Falha ao atribuir a função ao usuário.",
    "nextButton": 'Seguindo',
    "backButton": 'Voltar',
    "doneButton": 'Terminar',
    "generalError": 'Alguma coisa deu errado. Por favor tente outra vez',
    "successMessage": 'Registro bem-sucedido'
  },
  'es-mx': {
    "GmErr_AMOUNT_INVALID": "El monto especificado es inválido.",
    "GmErr_REGISTER_OVERAGE": "La inscripción ha excedido el límite permitido.",
    "GmErr_REGISTER_UNDERAGE": "La inscripción está por debajo del límite permitido.",
    "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "Autenticación de usuario fallida debido a demasiados intentos fallidos.",
    "GmErr_USER_ACCOUNT_BLOCKED": "La cuenta del usuario está bloqueada.",
    "GmErr_USER_NOT_VERIFIED": "El usuario no ha sido verificado.",
    "GmErr_USER_NOT_FOUND": "No se encontró ningún usuario con la información proporcionada.",
    "GmErr_USER_ID_INVALID": "El ID de usuario proporcionado es inválido.",
    "GmErr_USER_AUTH_FAILED": "La autenticación del usuario falló.",
    "GmErr_USER_DUPLICATED": "El usuario ya existe en el sistema.",
    "GmErr_USER_NOT_ACTIVATED": "La cuenta del usuario no está activada.",
    "GmErr_PASSWORD_CONTAINS_EMAIL": "La contraseña no puede contener la dirección de correo electrónico.",
    "GmErr_PASSWORD_CONTAINS_USERNAME": "La contraseña no puede contener el nombre de usuario.",
    "GmErr_PASSWORD_CONTAINS_SPACES": "La contraseña no puede contener espacios.",
    "GmErr_USER_4TS_CHECK_EXISTS": "La verificación 4TS del usuario ya existe.",
    "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "El usuario está excluido del registro.",
    "GmErr_USER_NAV_EXCLUDED_LOGIN": "El usuario está excluido del inicio de sesión.",
    "GmErr_USERNAME_REQUIRED": "Se requiere un nombre de usuario.",
    "GmErr_USER_EMAIL_NOT_VERIFIED": "La dirección de correo electrónico del usuario no ha sido verificada.",
    "GmErr_EMAIL_REQUIRED": "Se requiere una dirección de correo electrónico.",
    "GmErr_USERNAME_ALREADY_EXISTS": "El nombre de usuario ya está en uso.",
    "GmErr_DUPLICATE_PERSONAL_ID": "Se encontró un ID personal duplicado.",
    "GmErr_INVALID_USER_DOCUMENT": "El documento del usuario es inválido.",
    "GmErr_INVALID_CODE": "El código proporcionado es inválido.",
    "GmErr_EXPIRED_TOKEN": "El token ha expirado.",
    "GmErr_ATTEMPTS_EXCEEDED": "Se ha excedido el número máximo de intentos.",
    "GmErr_BLOCK_USER_INCORRECT_CODE": "El usuario ha sido bloqueado debido a un código incorrecto.",
    "GmErr_TOKEN_NOT_FOUND": "No se encontró el token.",
    "GmErr_INVALID_PHONE_NUMBER": "El número de teléfono proporcionado es inválido.",
    "GmErr_CODE_MISSING": "Falta el código necesario.",
    "GmErr_UNREGISTERED_USER": "El usuario no está registrado.",
    "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Se ha excedido el número máximo de intentos para generar un código.",
    "GmErr_UNEXPECTED_EXCEPTION": "Ocurrió una excepción inesperada.",
    "GmErr_INVALID_USER_ID": "El ID de usuario proporcionado es inválido.",
    "GmErr_NOT_ALLOWED_EXCEPTION": "Esta acción no está permitida.",
    "GmErr_CAN_NOT_FIND_ROLE": "No se pudo encontrar el rol especificado.",
    "GmErr_NO_SESSION_PROVIDED": "No se proporcionó ninguna sesión.",
    "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "No se encontró ninguna sesión activa para este usuario.",
    "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "El usuario ya ha sido anonimizado.",
    "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "No se ha configurado ningún rol para ser asignado.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "La sesión proporcionada no pertenece al usuario.",
    "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "La sesión proporcionada no existe.",
    "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "El rol ya ha sido asignado al usuario.",
    "GmErr_ASSIGN_USER_ROLE_FAILED": "Falló la asignación del rol al usuario.",
    "nextButton": 'Siguiente',
    "backButton": 'Atrás',
    "doneButton": 'Terminar',
    "generalError": 'Algo salió mal... Por favor intente de nuevo',
    "successMessage": 'Registro exitoso'
  },
  "tr": {
    "nextButton": 'Next',
    "backButton": 'Back',
    "doneButton": 'Done',
    "GmErr_BadRequest_Duplicate_User": 'A user with this information already exists.',
    "GmErr_BadRequest_PasswordContainsUsername": "The password cannot be the same as the username.",
    "GmErr_BadRequest_PasswordContainsEmail": "The password cannot be the same as the email.",
    "GmErr_BadRequest_Duplicate_PersonalId": "There is already a registration with the data you entered or you entered your data in an incorrect format.",
    "GmErr_Forbidden_UserAccount_NavExcluded": 'User is NAV Excluded. Registration was denied.',
    "GmErr_BadRequest_ModelValidationFailed": 'Something went wrong... Please try again.',
    "GmErr_BadInternalConfigs": 'Something went wrong... Please try again.',
    "GmErr_Unauthorized": 'Something went wrong... Please try again.',
    "GmErr_NotFound": 'Something went wrong... Please try again.',
    "GmErr_UnexpectedException": 'Something went wrong... Please try again.',
    "generalError": "Something went wrong... Please try again.",
    "successMessage": "Register successful"
  }
};
const getTranslations = (url) => {
  // fetch url, get the data, replace the TRANSLATIONS content
  return new Promise((resolve) => {
    fetch(url)
      .then((res) => res.json())
      .then((data) => {
      Object.keys(data).forEach((item) => {
        for (let key in data[item]) {
          TRANSLATIONS[item][key] = data[item][key];
        }
      });
      resolve(true);
    });
  });
};
const translate = (key, customLang, values) => {
  let lang = TRANSLATIONS[customLang] ? customLang : DEFAULT_LANGUAGE;
  let translation = TRANSLATIONS[lang][key];
  if (values !== undefined) {
    for (const [key, value] of Object.entries(values.values)) {
      const regex = new RegExp(`{${key}}`, 'g');
      translation = translation.replace(regex, value);
    }
  }
  return translation;
};

const generalRegistrationCss = "*,\n*::before,\n*::after {\n  padding: 0;\n  margin: 0;\n  box-sizing: border-box;\n}\n\n.registration__form.hidden {\n  display: none;\n}\n\n.registration {\n  font-family: \"Roboto\";\n  font-style: normal;\n  font-family: sans-serif;\n  display: flex;\n  flex-direction: column;\n  gap: 24px;\n  width: 100%;\n  height: 100%;\n  container-type: inline-size;\n}\n.registration__wrapper {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.registration__error-message {\n  color: var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));\n  font-size: 13px;\n  display: block;\n  justify-content: center;\n  text-align: center;\n}\n.registration__form {\n  display: grid;\n  grid-template-columns: repeat(1, 1fr);\n  gap: 40px;\n  justify-items: stretch;\n  align-content: flex-start;\n  overflow: auto;\n  width: 100%;\n  height: 100%;\n}\n.registration__buttons-wrapper {\n  display: flex;\n  flex-direction: column;\n  justify-content: space-around;\n  align-items: center;\n  position: relative;\n}\n.registration__button {\n  border-radius: 5px;\n  background: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));\n  border: 1px solid var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));\n  color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n  text-transform: uppercase;\n  font-size: 20px;\n  height: 44px;\n  width: 100%;\n  margin: 0px auto;\n  padding: 10px 20px;\n  font-weight: normal;\n  box-shadow: none;\n  cursor: pointer;\n}\n.registration__button--disabled {\n  background: var(--emfe-w-color-gray-100, #E6E6E6);\n  border: 1px solid var(--emfe-w-color-gray-150, #828282);\n  pointer-events: none;\n  box-shadow: none;\n}\n.registration__button--first-step {\n  display: none;\n}\n\n@container (min-width: 450px) {\n  .registration__form {\n    grid-template-columns: repeat(2, 1fr);\n  }\n\n  .registration__buttons-wrapper {\n    flex-direction: row-reverse;\n    gap: 15px;\n  }\n}\n.spinner {\n  animation: rotate 2s linear infinite;\n  z-index: 2;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  margin: -25px 0 0 -25px;\n  width: 50px;\n  height: 50px;\n}\n.spinner .path {\n  stroke: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));\n  stroke-linecap: round;\n  animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n  100% {\n    transform: rotate(360deg);\n  }\n}\n@keyframes dash {\n  0% {\n    stroke-dasharray: 1, 150;\n    stroke-dashoffset: 0;\n  }\n  50% {\n    stroke-dasharray: 90, 150;\n    stroke-dashoffset: -35;\n  }\n  100% {\n    stroke-dasharray: 90, 150;\n    stroke-dashoffset: -124;\n  }\n}";

const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.registrationWidgetLoaded = createEvent(this, "registrationWidgetLoaded", 7);
    this.registrationStepUpdated = createEvent(this, "registrationStepUpdated", 7);
    /**
    * Currently selected language
    */
    this.language = 'en';
    /**
     * Client custom styling via inline styles
     */
    this.clientStyling = '';
    /**
     * Client custom styling via url
     */
    this.clientStylingUrl = '';
    /**
     * Translations via URL
     */
    this.translationUrl = '';
    /**
     * Affiliate code to be passed in and sent in the registration.
     */
    this.btag = null;
    /**
     * Boolean flag that tells inputs to emit an event on click.
     */
    this.emitOnClick = false;
    this.isLoading = true;
    this.forms = [];
    this.limitStylingAppends = false;
    this.autofilled = false;
    this.listOfInputValues = [];
    this.listOfInputValidity = [];
    this.listOfActions = [];
    this.listOfInputs = [];
    this.emitValue = false;
    this.backButtonPressed = false;
    this.registerErrors = false;
    this.extraActions = [];
    this.registrationStepsState = {
      regId: null
    };
    this.setClientStyling = () => {
      let sheet = document.createElement('style');
      sheet.innerHTML = this.clientStyling;
      this.host.shadowRoot.prepend(sheet);
    };
    this.setClientStylingURL = () => {
      let url = new URL(this.clientStylingUrl);
      let cssFile = document.createElement('style');
      fetch(url.href)
        .then((res) => res.text())
        .then((data) => {
        cssFile.innerHTML = data;
        this.clientStyling = data;
        setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
      });
    };
  }
  sendStep() {
    this.registrationStepUpdated.emit(this.registrationStep);
    window.postMessage({ type: 'registrationStepUpdated', step: this.registrationStep }, window.location.href);
  }
  handleStylingChange(newValue, oldValue) {
    if (newValue !== oldValue)
      this.setClientStyling();
  }
  handleStylingUrlChange(newValue, oldValue) {
    if (newValue !== oldValue)
      this.setClientStylingURL();
  }
  setFormValidity() {
    this.errorMessage = '';
    if (this.listOfInputValidity) {
      this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
    }
    //Check for autofilled.
    if (this.listOfInputs.some(inputs => inputs.autofill)) {
      this.autofilled = true;
    }
  }
  addBtag() {
    this.addBtagValue();
  }
  checkInputsValidityHandler(event) {
    // Set isValid state of the input in the list.
    this.listOfInputValidity.find(input => input.name == event.detail.name).isValid = event.detail.valid;
    // Check if any one is invalid.
    this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
  }
  getInputsValueHandler(event) {
    this.listOfInputValues.find(input => {
      if (input.name == event.detail.name) {
        input.value = event.detail.value;
        input.type = event.detail.type || null;
      }
    });
    this.stepsStateMachine({ event: 'set', type: 'values' });
  }
  componentWillLoad() {
    return this.getRegisterConfig()
      .then((config) => {
      this.formatConfig(config);
      this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
      this.stepsStateMachine({ event: 'set', type: 'inputs' });
    });
  }
  componentDidLoad() {
    this.registrationWidgetLoaded.emit();
    window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
    if (!this.limitStylingAppends && this.host) {
      if (this.clientStyling)
        this.setClientStyling();
      if (this.clientStylingUrl)
        this.setClientStylingURL();
      this.limitStylingAppends = true;
    }
  }
  nextHandler(e) {
    e.preventDefault();
    // Trigger events in subwidgets.
    this.emitValue = true;
    this.setRegisterStep();
  }
  backHandler(e) {
    e.preventDefault();
    this.registrationStep = this.stepChange('decrement');
    this.stepsStateMachine({ event: 'get', type: 'inputs' });
    this.stepsStateMachine({ event: 'get', type: 'values' });
  }
  dispatchRegisterCredentialsEvent() {
    const userNameEmail = this.registrationStepsState['Step1']['registerUserData']['Email']['value'];
    const userPassword = this.registrationStepsState['Step1']['registerUserData']['Password']['value'];
    this.registerCredentialsEvent = new CustomEvent('RegisterCredentials', {
      bubbles: true,
      detail: {
        userNameEmail: userNameEmail,
        userPassword: userPassword
      }
    });
    window.dispatchEvent(this.registerCredentialsEvent);
  }
  stepsStateMachine(state) {
    switch (state.event) {
      case 'set':
        if (state.type == 'inputs') {
          this.registrationStepsState[this.registrationStep].fields = this.listOfInputs;
          this.registrationStepsState[this.registrationStep].actions = this.listOfActions;
          this.registrationStepsState[this.registrationStep].fieldsValidity = this.listOfInputValidity;
        }
        if (state.type == 'values') {
          this.registrationStepsState[this.registrationStep].registerUserData = this.listOfInputValues.reduce((acc, curr) => {
            acc[curr.name] = { value: curr.value, isDuplicate: curr.isDuplicate };
            return acc;
          }, {});
        }
        localStorage.setItem('registrationStepsState', JSON.stringify(this.registrationStepsState));
        break;
      case 'get':
        const savedUserData = JSON.parse(localStorage.getItem('registrationStepsState'));
        if (!savedUserData)
          return;
        if (state.type == 'inputs') {
          this.listOfInputs = this.registrationStepsState[this.registrationStep].fields;
          this.listOfActions = this.registrationStepsState[this.registrationStep].actions;
          this.listOfInputValidity = this.registrationStepsState[this.registrationStep].fieldsValidity;
        }
        if (state.type == 'values') {
          const savedValues = savedUserData[this.registrationStep].registerUserData;
          this.listOfInputValues = Object.keys(savedValues).map(name => {
            return { name, value: savedValues[name].value, isDuplicate: savedValues[name].isDuplicate };
          });
          // Give to each field the user input as the default value.
          this.listOfInputValues.forEach(inputValue => {
            const input = this.listOfInputs.find(input => input.name === inputValue.name);
            if (input) {
              input.defaultValue = inputValue.value;
            }
          });
        }
        this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
        break;
    }
  }
  getRegisterConfig(registrationID) {
    const url = new URL(`${this.endpoint}/v1/player/legislation/registration/config`);
    const headers = new Headers();
    headers.append('Content-Type', 'application/json');
    headers.append('Accept', 'application/json');
    if (registrationID) {
      url.searchParams.append('registrationId', registrationID);
    }
    const options = {
      method: 'GET',
      headers
    };
    return new Promise((resolve, reject) => {
      this.isLoading = true;
      fetch(url.href, options)
        .then((res) => res.json())
        .then((config) => {
        this.isLoading = false;
        resolve(config);
      }).catch((err) => {
        this.isLoading = false;
        console.error(err);
        reject(err);
      }).finally(() => {
        this.isLoading = false;
      });
    });
  }
  setRegisterStep() {
    this.isLoadingPOST = true;
    const url = new URL(`${this.endpoint}/v1/player/legislation/registration/step`);
    const registerStep = {
      registrationId: this.registrationID,
      registerUserDto: this.listOfInputValues
        .filter(input => !input.isDuplicate)
        .reduce((acc, curr) => {
        // Because the API is very robust, some values need to be split as separate entities.  
        if (curr.name === 'TypeOfPublicArea') {
          acc[curr.name] = curr.value.toLowerCase();
        }
        else if (curr.type === 'tel') {
          //@ts-ignore
          acc['MobilePrefix'] = curr.value.prefix;
          //@ts-ignore
          acc[curr.name] = curr.value.phone;
        }
        else if (curr.type === 'checkboxgroup') {
          // Skip adding the parent of the checkboxgroup as a key. 
          if (curr.value !== null) {
            Object.entries(curr.value).forEach(([key, value]) => {
              acc[key] = value ? 'true' : 'false';
            });
          }
        }
        else {
          acc[curr.name] = curr.value;
        }
        return acc;
      }, {}),
      step: this.registrationStep,
    };
    const headers = new Headers();
    headers.append('Content-Type', 'application/json');
    headers.append('Accept', 'application/json');
    const options = {
      method: 'POST',
      body: JSON.stringify(registerStep),
      headers
    };
    fetch(url.href, options)
      .then((res) => {
      if (!res.ok) {
        return res.json().then(error => {
          this.errorCode = error.thirdPartyResponse.errorCode;
          // Show the idomsoft error if it is the case
          if (this.errorCode == 'GmErr_BadRequest_IdomsoftVerification_ShouldRetry') {
            this.errorMessage = error.thirdPartyResponse.message;
          }
          else if (this.errorCode === 'GmErr_Forbidden_UserAccount_NavExcluded') {
            this.errorMessage = translate(`${this.errorCode}`, this.language);
          }
          else if (this.errorCode == 'GmErr_BadRequest') {
            this.errorMessage = error.thirdPartyResponse.message;
          }
          else {
            this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
          }
        });
      }
      return res.json();
    })
      .then((data) => {
      this.isLoadingPOST = false;
      this.registrationID = data.registrationId;
      if (this.listOfActions.some(action => action == '/register')) {
        if (this.listOfActions.some(action => action == '/generate-2FA-code/Generate2FACode')) {
          this.extraActions.push('2fa');
        }
        this.setRegister();
      }
      else {
        // After sending the current step, increment and check if the next one is in state.
        this.registrationStep = this.stepChange('increment');
        // If step is present in state do NOT fetch the next config.
        if (Object.keys(this.registrationStepsState).find(key => key == this.registrationStep)) {
          // Use the one from state
          this.stepsStateMachine({ event: 'get', type: 'inputs' });
          this.stepsStateMachine({ event: 'get', type: 'values' });
        }
        else {
          this.getRegisterConfig(this.registrationID).then((config) => {
            // Format the new step config.
            this.formatConfig(config);
            // Set it in local storage.
            this.stepsStateMachine({ event: 'set', type: 'inputs' });
          });
        }
      }
    })
      .catch((err) => {
      this.isLoadingPOST = false;
      console.error(err);
    }).finally(() => {
      this.isLoadingPOST = false;
    });
  }
  setRegister() {
    this.isLoading = true;
    this.registerErrors = false;
    const url = new URL(`${this.endpoint}/v1/player/legislation/register`);
    const headers = new Headers();
    headers.append('Content-Type', 'application/json');
    headers.append('Accept', 'application/json');
    const options = {
      method: 'PUT',
      body: JSON.stringify({ registrationId: this.registrationID }),
      headers
    };
    fetch(url.href, options)
      .then((res) => {
      if (!res.ok) {
        this.registerErrors = true;
        return res.json().then(error => {
          this.errorCode = error.thirdPartyResponse.errorCode;
          // Show the idomsoft error if it is the case
          if (this.errorCode == 'GmErr_BadRequest_IdomsoftVerification_ShouldRetry') {
            this.errorMessage = error.thirdPartyResponse.message;
          }
          else if (this.errorCode == 'GmErr_BadRequest') {
            this.errorMessage = error.thirdPartyResponse.message;
          }
          else {
            this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
          }
          window.postMessage({ type: 'registrationFailed', errorMessage: error === null || error === void 0 ? void 0 : error.thirdPartyResponse.message }, window.location.href);
          window.postMessage({ type: 'WidgetNotification', data: {
              type: 'error',
              message: this.errorMessage
            } }, window.location.href);
        });
      }
      return res.json();
    })
      .then((data) => {
      this.isLoading = false;
      if (!this.registerErrors) {
        this.dispatchRegisterCredentialsEvent();
        window.postMessage({ type: 'registrationSuccessful', userId: data === null || data === void 0 ? void 0 : data.userId, extraActions: this.extraActions }, window.location.href);
        window.postMessage({ type: 'WidgetNotification', data: {
            type: 'success',
            message: translate('successMessage', this.language)
          } }, window.location.href);
      }
    })
      .catch((err) => {
      this.isLoading = false;
      console.error(err);
    })
      .finally(() => {
      this.isLoading = false;
    });
  }
  formatConfig(config) {
    // Populate the list of inputs
    this.listOfInputs = config.content.fields.flatMap((field) => {
      // Special case for inputs that need to be duplicated.
      const duplicateInputRule = field.validate.custom.find(customRule => customRule.rule === 'duplicate-input');
      const inputElement = Object.assign({}, field);
      if (duplicateInputRule) {
        const duplicateInput = Object.assign(Object.assign({}, field), { name: `${field.name}Duplicate`, displayName: duplicateInputRule.displayName, isDuplicateInput: true });
        return [inputElement, duplicateInput];
      }
      else {
        return [inputElement];
      }
    });
    this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
      var _a;
      // If the field is a togglecheckbox, add its subfields
      if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
        field.data.subFields.forEach(subfield => {
          acc.push({
            name: subfield.name,
            isValid: this.setInitialValidStatus(subfield)
          });
        });
      }
      else {
        acc.push({
          name: field.name,
          isValid: this.setInitialValidStatus(field)
        });
      }
      return acc;
    }, []);
    this.listOfInputValues = this.listOfInputs.reduce((acc, field) => {
      var _a, _b, _c;
      // If the field type is a 'togglecheckbox', add its subfields
      if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
        field.data.subFields.forEach(subfield => {
          var _a, _b;
          acc.push({
            name: subfield.name,
            value: ((_a = subfield.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' ? 'false' : null,
            isDuplicate: subfield.isDuplicateInput || false,
            type: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'togglecheckbox'
              ? 'togglecheckbox'
              : null
          });
        });
      }
      else {
        acc.push({
          name: field.name,
          value: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'checkbox' ? 'false' : null,
          isDuplicate: field.isDuplicateInput || false,
          type: ((_c = field.inputType) === null || _c === void 0 ? void 0 : _c.toLowerCase()) == 'checkboxgroup' ? 'checkboxgroup' : null
        });
      }
      return acc;
    }, []);
    if (this.btag)
      this.addBtagValue();
    // Set the list of actions
    this.listOfActions = config.content.actions.map(action => action);
    this.registrationID = config.content.registrationID;
    this.registrationStep = config.content.step;
    if (this.listOfActions.some(action => action == '/register')) {
      this.lastStep = this.registrationStep;
    }
    // The translations for fields happens here. 
    if (this.translationUrl) {
      getTranslations(this.translationUrl).then(() => {
        this.listOfInputs.forEach(field => {
          var _a, _b;
          this.addTranslation(field);
          // Logic for field types that have subfields
          if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'togglecheckbox') {
            field.data.subFields.forEach(subField => this.addTranslation(subField));
          }
          if (((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'checkboxgroup') {
            this.addTranslation(field);
            field.data.subFields.forEach(subField => this.addTranslation(subField));
          }
          return field;
        });
      })
        .catch((error) => {
        console.error('Failed to fetch translations:', error);
      }).finally(() => {
        this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
      });
    }
    else {
      this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
    }
    // Add the step to the registrationStepsData
    this.registrationStepsState.regId = this.registrationID;
    if (!this.registrationStepsState[this.registrationStep]) {
      this.registrationStepsState[this.registrationStep] = {
        fields: [],
        fieldsValidity: [],
        registerUserData: {},
        actions: []
      };
    }
  }
  addBtagValue() {
    const btagField = this.listOfInputs.find(input => input.name.toLowerCase() === 'btag');
    if (btagField) {
      btagField.defaultValue = this.btag;
    }
    const btagValue = this.listOfInputValues.find(input => input.name.toLowerCase() === 'btag');
    if (btagValue) {
      btagValue.value = this.btag;
    }
  }
  addTranslation(field) {
    const lang = TRANSLATIONS[this.language] ? this.language : DEFAULT_LANGUAGE;
    if (TRANSLATIONS[lang][field.name]) {
      Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
        field[key] = TRANSLATIONS[this.language][field.name][key];
      });
    }
  }
  setInitialValidStatus(field) {
    var _a, _b;
    // Input type checkbox, with no validation are valid
    if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' && ((_b = field.validate) === null || _b === void 0 ? void 0 : _b.mandatory) == false) {
      return true;
    }
    //Inputs that have default value are valid.
    if (field.defaultValue !== null) {
      return true;
    }
    return false;
  }
  stepChange(action) {
    const stepNum = parseInt(this.registrationStep.replace('Step', ''));
    if (action === 'increment') {
      return 'Step' + (stepNum + 1);
    }
    if (action === 'decrement') {
      return 'Step' + (stepNum - 1);
    }
  }
  getInvalidStatus(listOfInputs) {
    return listOfInputs.filter(input => input.isValid == false).length > 0;
  }
  renderForm() {
    return this.forms.map((form, index) => {
      return h("form", { action: '.', id: `RegistrationForm${this.registrationStep}`, class: `registration__form ${this.registrationStep !== `Step${index + 1}` ? 'hidden' : ''}`, ref: el => this.form = el }, form[this.registrationStep] && form[this.registrationStep].map(input => h("general-input", { type: input.inputType, name: input.name, displayName: input.displayName, validation: input.validate, action: input.action || null, options: input.data
          ? (input.inputType.toLowerCase() == 'checkboxgroup' || input.inputType.toLowerCase() == 'togglecheckbox')
            ? input.data.subFields
            : input.data.values
          : [], defaultValue: input.defaultValue, autofilled: input.autofill, emitValue: this.emitValue, language: this.language, isDuplicateInput: input.isDuplicateInput, "client-styling": this.clientStyling, tooltip: input.tooltip, placeholder: input.placeholder == null ? '' : input.placeholder, dateFormat: this.dateFormat, "translation-url": this.translationUrl, emitOnClick: this.emitOnClick })), this.buttonInsideForm && this.renderButtons(), h("div", { class: 'registration__wrapper--flex' }, h("p", { class: 'registration__error-message', innerHTML: this.errorMessage })));
    });
  }
  ;
  renderButtons() {
    return (h("div", { class: `registration__buttons-wrapper ${this.autofilled ? 'registration__buttons-wrapper--autofilled' : ''}` }, this.isLoadingPOST
      && h("slot", { name: 'spinner' })
      && h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" })), !this.isLoadingPOST && h("button", { class: `registration__button registration__button--next ${this.isFormValid ? '' : 'registration__button--disabled'}`, type: 'submit', form: `RegistrationForm${this.registrationStep}`, onClick: (e) => this.nextHandler(e), disabled: !this.isFormValid }, this.lastStep === this.registrationStep ? translate('doneButton', this.language) : translate('nextButton', this.language)), h("button", { class: `registration__button registration__button--back ${this.registrationStep == 'Step1' ? 'registration__button--first-step' : ''}`, onClick: (e) => this.backHandler(e) }, translate('backButton', this.language))));
  }
  render() {
    if (this.isLoading) {
      return h("p", null, "Please wait, loading ...");
    }
    return (h("div", { class: `registration  registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
  }
  get host() { return this; }
  static get watchers() { return {
    "registrationStep": ["sendStep"],
    "clientStyling": ["handleStylingChange"],
    "clientStylingUrl": ["handleStylingUrlChange"],
    "forms": ["setFormValidity"],
    "btag": ["addBtag"]
  }; }
  static get style() { return generalRegistrationCss; }
}, [1, "general-registration", {
    "endpoint": [513],
    "language": [513],
    "clientStyling": [1537, "client-styling"],
    "clientStylingUrl": [513, "client-styling-url"],
    "translationUrl": [513, "translation-url"],
    "dateFormat": [513, "date-format"],
    "buttonInsideForm": [516, "button-inside-form"],
    "btag": [513],
    "emitOnClick": [516, "emit-on-click"],
    "errorMessage": [32],
    "isFormValid": [32],
    "isLoading": [32],
    "isLoadingPOST": [32],
    "registrationStep": [32],
    "forms": [32],
    "limitStylingAppends": [32],
    "autofilled": [32]
  }, [[0, "sendValidityState", "checkInputsValidityHandler"], [0, "sendInputValue", "getInputsValueHandler"]]]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["general-registration", "checkbox-group-input", "checkbox-input", "date-input", "email-input", "general-input", "number-input", "password-input", "radio-input", "select-input", "tel-input", "text-input", "toggle-checkbox-input"];
  components.forEach(tagName => { switch (tagName) {
    case "general-registration":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, GeneralRegistration$1);
      }
      break;
    case "checkbox-group-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$d();
      }
      break;
    case "checkbox-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$c();
      }
      break;
    case "date-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$b();
      }
      break;
    case "email-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$a();
      }
      break;
    case "general-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$9();
      }
      break;
    case "number-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$8();
      }
      break;
    case "password-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$7();
      }
      break;
    case "radio-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$6();
      }
      break;
    case "select-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$5();
      }
      break;
    case "tel-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$4();
      }
      break;
    case "text-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "toggle-checkbox-input":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}

const GeneralRegistration = GeneralRegistration$1;
const defineCustomElement = defineCustomElement$1;

export { GeneralRegistration, defineCustomElement };
