@everymatrix/general-registration 1.43.4 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_13.cjs.entry.js +4789 -2676
  3. package/dist/cjs/general-registration.cjs.js +17 -11
  4. package/dist/cjs/index-f6c5854f.js +1331 -0
  5. package/dist/cjs/index.cjs.js +12 -14
  6. package/dist/cjs/loader.cjs.js +7 -13
  7. package/dist/collection/collection-manifest.json +3 -3
  8. package/dist/collection/components/general-registration/general-registration.css +0 -1
  9. package/dist/collection/components/general-registration/general-registration.js +762 -769
  10. package/dist/collection/components/general-registration/index.js +1 -0
  11. package/dist/collection/index.js +12 -14
  12. package/dist/collection/utils/locale.utils.js +292 -292
  13. package/dist/collection/utils/utils.js +1 -1
  14. package/dist/esm/app-globals-0f993ce5.js +3 -0
  15. package/dist/esm/checkbox-group-input_13.entry.js +4789 -2676
  16. package/dist/esm/general-registration.js +14 -11
  17. package/dist/esm/index-8b4a4c93.js +1302 -0
  18. package/dist/esm/index.js +12 -14
  19. package/dist/esm/loader.js +7 -13
  20. package/dist/general-registration/general-registration.esm.js +1 -1
  21. package/dist/general-registration/index.esm.js +1 -1
  22. package/dist/general-registration/p-35ed5ec5.js +2 -0
  23. package/dist/general-registration/p-af4bdf25.entry.js +5431 -0
  24. package/dist/general-registration/p-e1255160.js +1 -0
  25. package/dist/stencil.config.dev.js +17 -0
  26. package/dist/stencil.config.js +14 -19
  27. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-registration/.stencil/packages/stencil/general-input/src/utils/types.d.ts +87 -0
  28. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-registration/.stencil/packages/stencil/general-registration/stencil.config.d.ts +2 -0
  29. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-registration/.stencil/packages/stencil/general-registration/stencil.config.dev.d.ts +2 -0
  30. package/dist/types/components/general-registration/general-registration.d.ts +91 -91
  31. package/dist/types/components/general-registration/index.d.ts +1 -0
  32. package/dist/types/components.d.ts +18 -2
  33. package/dist/types/stencil-public-runtime.d.ts +142 -33
  34. package/dist/types/utils/locale.utils.d.ts +8 -8
  35. package/loader/cdn.js +1 -3
  36. package/loader/index.cjs.js +1 -3
  37. package/loader/index.d.ts +13 -1
  38. package/loader/index.es2017.js +1 -3
  39. package/loader/index.js +1 -3
  40. package/loader/package.json +1 -0
  41. package/package.json +9 -2
  42. package/dist/cjs/index-0b9241d1.js +0 -1360
  43. package/dist/components/active-mixin.js +0 -975
  44. package/dist/components/checkbox-group-input.js +0 -6
  45. package/dist/components/checkbox-group-input2.js +0 -1078
  46. package/dist/components/checkbox-input.js +0 -6
  47. package/dist/components/checkbox-input2.js +0 -132
  48. package/dist/components/date-input.js +0 -6
  49. package/dist/components/date-input2.js +0 -11556
  50. package/dist/components/email-input.js +0 -6
  51. package/dist/components/email-input2.js +0 -171
  52. package/dist/components/field-mixin.js +0 -12426
  53. package/dist/components/general-input.js +0 -6
  54. package/dist/components/general-input2.js +0 -344
  55. package/dist/components/general-registration.d.ts +0 -11
  56. package/dist/components/general-registration.js +0 -961
  57. package/dist/components/index.d.ts +0 -26
  58. package/dist/components/index.js +0 -20
  59. package/dist/components/input-field-shared-styles.js +0 -1211
  60. package/dist/components/number-input.js +0 -6
  61. package/dist/components/number-input2.js +0 -158
  62. package/dist/components/password-input.js +0 -6
  63. package/dist/components/password-input2.js +0 -1059
  64. package/dist/components/radio-input.js +0 -6
  65. package/dist/components/radio-input2.js +0 -114
  66. package/dist/components/select-input.js +0 -6
  67. package/dist/components/select-input2.js +0 -183
  68. package/dist/components/tel-input.js +0 -6
  69. package/dist/components/tel-input2.js +0 -197
  70. package/dist/components/text-input.js +0 -6
  71. package/dist/components/text-input2.js +0 -199
  72. package/dist/components/toggle-checkbox-input.js +0 -6
  73. package/dist/components/tooltipIcon.js +0 -146
  74. package/dist/components/vaadin-button.js +0 -490
  75. package/dist/components/vaadin-combo-box.js +0 -4512
  76. package/dist/components/virtual-keyboard-controller.js +0 -2001
  77. package/dist/esm/index-a42c182c.js +0 -1332
  78. package/dist/esm/polyfills/core-js.js +0 -11
  79. package/dist/esm/polyfills/css-shim.js +0 -1
  80. package/dist/esm/polyfills/dom.js +0 -79
  81. package/dist/esm/polyfills/es5-html-element.js +0 -1
  82. package/dist/esm/polyfills/index.js +0 -34
  83. package/dist/esm/polyfills/system.js +0 -6
  84. package/dist/general-registration/p-4ff02444.js +0 -1
  85. package/dist/general-registration/p-cf70bdb5.entry.js +0 -3647
  86. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-registration/.stencil/packages/general-input/src/utils/types.d.ts +0 -87
  87. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-registration/.stencil/packages/general-registration/stencil.config.d.ts +0 -2
@@ -1,961 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$d } from './checkbox-group-input2.js';
3
- import { d as defineCustomElement$c } from './checkbox-input2.js';
4
- import { d as defineCustomElement$b } from './date-input2.js';
5
- import { d as defineCustomElement$a } from './email-input2.js';
6
- import { a as defineCustomElement$2, d as defineCustomElement$9 } from './general-input2.js';
7
- import { d as defineCustomElement$8 } from './number-input2.js';
8
- import { d as defineCustomElement$7 } from './password-input2.js';
9
- import { d as defineCustomElement$6 } from './radio-input2.js';
10
- import { d as defineCustomElement$5 } from './select-input2.js';
11
- import { d as defineCustomElement$4 } from './tel-input2.js';
12
- import { d as defineCustomElement$3 } from './text-input2.js';
13
-
14
- const DEFAULT_LANGUAGE = 'en';
15
- const TRANSLATIONS = {
16
- "en": {
17
- "GmErr_AMOUNT_INVALID": "The specified amount is invalid.",
18
- "GmErr_REGISTER_OVERAGE": "The registration has exceeded the allowable limit.",
19
- "GmErr_REGISTER_UNDERAGE": "The registration is under the allowable limit.",
20
- "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "User authentication failed due to too many unsuccessful attempts.",
21
- "GmErr_USER_ACCOUNT_BLOCKED": "The user account is blocked.",
22
- "GmErr_USER_NOT_VERIFIED": "The user has not been verified.",
23
- "GmErr_USER_NOT_FOUND": "No user found with the provided information.",
24
- "GmErr_USER_ID_INVALID": "The user ID provided is invalid.",
25
- "GmErr_USER_AUTH_FAILED": "User authentication failed.",
26
- "GmErr_USER_DUPLICATED": "The user already exists in the system.",
27
- "GmErr_USER_NOT_ACTIVATED": "The user account has not been activated.",
28
- "GmErr_PASSWORD_CONTAINS_EMAIL": "The password cannot contain the email address.",
29
- "GmErr_PASSWORD_CONTAINS_USERNAME": "The password cannot contain the username.",
30
- "GmErr_PASSWORD_CONTAINS_SPACES": "The password cannot contain spaces.",
31
- "GmErr_USER_4TS_CHECK_EXISTS": "The user 4TS check already exists.",
32
- "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "The user is excluded from registration.",
33
- "GmErr_USER_NAV_EXCLUDED_LOGIN": "The user is excluded from login.",
34
- "GmErr_USERNAME_REQUIRED": "A username is required.",
35
- "GmErr_USER_EMAIL_NOT_VERIFIED": "The user's email address has not been verified.",
36
- "GmErr_EMAIL_REQUIRED": "An email address is required.",
37
- "GmErr_USERNAME_ALREADY_EXISTS": "The username is already taken.",
38
- "GmErr_DUPLICATE_PERSONAL_ID": "Duplicate personal ID found.",
39
- "GmErr_INVALID_USER_DOCUMENT": "The user document is invalid.",
40
- "GmErr_INVALID_CODE": "The code provided is invalid.",
41
- "GmErr_EXPIRED_TOKEN": "The token has expired.",
42
- "GmErr_ATTEMPTS_EXCEEDED": "The maximum number of attempts has been exceeded.",
43
- "GmErr_BLOCK_USER_INCORRECT_CODE": "The user has been blocked due to an incorrect code.",
44
- "GmErr_TOKEN_NOT_FOUND": "The token was not found.",
45
- "GmErr_INVALID_PHONE_NUMBER": "The phone number provided is invalid.",
46
- "GmErr_CODE_MISSING": "The code is missing.",
47
- "GmErr_UNREGISTERED_USER": "The user is not registered.",
48
- "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Maximum attempts to generate a code have been exceeded.",
49
- "GmErr_UNEXPECTED_EXCEPTION": "An unexpected exception occurred.",
50
- "GmErr_INVALID_USER_ID": "The user ID provided is invalid.",
51
- "GmErr_NOT_ALLOWED_EXCEPTION": "This action is not allowed.",
52
- "GmErr_CAN_NOT_FIND_ROLE": "Unable to find the specified role.",
53
- "GmErr_NO_SESSION_PROVIDED": "No session was provided.",
54
- "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "No active session found for this user.",
55
- "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "The user has already been anonymized.",
56
- "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "No role has been set up to be assigned.",
57
- "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "The provided session does not belong to the user.",
58
- "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "The provided session does not exist.",
59
- "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "The role has already been assigned to the user.",
60
- "GmErr_ASSIGN_USER_ROLE_FAILED": "Failed to assign a role to the user.",
61
- "nextButton": 'Next',
62
- "backButton": 'Back',
63
- "doneButton": 'Done',
64
- "generalError": "Something went wrong... Please try again.",
65
- "successMessage": "Register successful"
66
- },
67
- "hu": {
68
- "GmErr_AMOUNT_INVALID": "A megadott összeg érvénytelen.",
69
- "GmErr_REGISTER_OVERAGE": "A regisztráció túllépte a megengedett határt.",
70
- "GmErr_REGISTER_UNDERAGE": "A regisztráció a megengedett határ alatt van.",
71
- "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "A felhasználó hitelesítése túl sok sikertelen próbálkozás miatt meghiúsult.",
72
- "GmErr_USER_ACCOUNT_BLOCKED": "A felhasználói fiók le van tiltva.",
73
- "GmErr_USER_NOT_VERIFIED": "A felhasználó nincs ellenőrizve.",
74
- "GmErr_USER_NOT_FOUND": "A megadott adatokkal nem található felhasználó.",
75
- "GmErr_USER_ID_INVALID": "A megadott felhasználói azonosító érvénytelen.",
76
- "GmErr_USER_AUTH_FAILED": "A felhasználó hitelesítése meghiúsult.",
77
- "GmErr_USER_DUPLICATED": "A felhasználó már létezik a rendszerben.",
78
- "GmErr_USER_NOT_ACTIVATED": "A felhasználó fiókja nincs aktiválva.",
79
- "GmErr_PASSWORD_CONTAINS_EMAIL": "A jelszó nem tartalmazhat e-mail címet.",
80
- "GmErr_PASSWORD_CONTAINS_USERNAME": "A jelszó nem tartalmazhat felhasználónevet.",
81
- "GmErr_PASSWORD_CONTAINS_SPACES": "A jelszó nem tartalmazhat szóközöket.",
82
- "GmErr_USER_4TS_CHECK_EXISTS": "A felhasználó 4TS ellenőrzése már létezik.",
83
- "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "A felhasználó kizárva a regisztrációból.",
84
- "GmErr_USER_NAV_EXCLUDED_LOGIN": "A felhasználó kizárva a bejelentkezésből.",
85
- "GmErr_USERNAME_REQUIRED": "Felhasználónév megadása szükséges.",
86
- "GmErr_USER_EMAIL_NOT_VERIFIED": "A felhasználó e-mail címe nincs megerősítve.",
87
- "GmErr_EMAIL_REQUIRED": "E-mail cím megadása szükséges.",
88
- "GmErr_USERNAME_ALREADY_EXISTS": "A felhasználónév már foglalt.",
89
- "GmErr_DUPLICATE_PERSONAL_ID": "Már létező személyes azonosító.",
90
- "GmErr_INVALID_USER_DOCUMENT": "A felhasználói dokumentum érvénytelen.",
91
- "GmErr_INVALID_CODE": "A megadott kód érvénytelen.",
92
- "GmErr_EXPIRED_TOKEN": "A token lejárt.",
93
- "GmErr_ATTEMPTS_EXCEEDED": "A megengedett próbálkozások száma túllépve.",
94
- "GmErr_BLOCK_USER_INCORRECT_CODE": "A felhasználó blokkolva lett a hibás kód miatt.",
95
- "GmErr_TOKEN_NOT_FOUND": "A token nem található.",
96
- "GmErr_INVALID_PHONE_NUMBER": "A megadott telefonszám érvénytelen.",
97
- "GmErr_CODE_MISSING": "A szükséges kód hiányzik.",
98
- "GmErr_UNREGISTERED_USER": "A felhasználó nincs regisztrálva.",
99
- "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Túllépték a kódgenerálási próbálkozások számát.",
100
- "GmErr_UNEXPECTED_EXCEPTION": "Váratlan kivétel történt.",
101
- "GmErr_INVALID_USER_ID": "A felhasználói azonosító érvénytelen.",
102
- "GmErr_NOT_ALLOWED_EXCEPTION": "Ez a művelet nem engedélyezett.",
103
- "GmErr_CAN_NOT_FIND_ROLE": "A megadott szerepkör nem található.",
104
- "GmErr_NO_SESSION_PROVIDED": "Nem került megadásra munkamenet.",
105
- "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "Nincs aktív munkamenet ehhez a felhasználóhoz.",
106
- "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "A felhasználó már anonimizálva lett.",
107
- "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "Nincs beállítva hozzárendelhető szerepkör.",
108
- "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "A megadott munkamenet nem tartozik a felhasználóhoz.",
109
- "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "A megadott munkamenet nem létezik.",
110
- "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "A szerepkör már hozzá lett rendelve a felhasználóhoz.",
111
- "GmErr_ASSIGN_USER_ROLE_FAILED": "Nem sikerült a felhasználói szerepkört hozzárendelni.",
112
- "nextButton": 'Következő',
113
- "backButton": 'Vissza',
114
- "doneButton": 'Kész',
115
- "generalError": "Valami hiba történt... Próbáld újra.",
116
- "successMessage": "Sikeres regisztráció"
117
- },
118
- "hr": {
119
- "GmErr_AMOUNT_INVALID": "Navedeni iznos je nevažeći.",
120
- "GmErr_REGISTER_OVERAGE": "Registracija je premašila dopušteni limit.",
121
- "GmErr_REGISTER_UNDERAGE": "Registracija je ispod dopuštenog limita.",
122
- "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "Neuspješno autentificiranje korisnika zbog previše pokušaja.",
123
- "GmErr_USER_ACCOUNT_BLOCKED": "Korisnički račun je blokiran.",
124
- "GmErr_USER_NOT_VERIFIED": "Korisnik nije verificiran.",
125
- "GmErr_USER_NOT_FOUND": "Korisnik s navedenim podacima nije pronađen.",
126
- "GmErr_USER_ID_INVALID": "Navedeni ID korisnika je nevažeći.",
127
- "GmErr_USER_AUTH_FAILED": "Neuspješno autentificiranje korisnika.",
128
- "GmErr_USER_DUPLICATED": "Korisnik već postoji u sustavu.",
129
- "GmErr_USER_NOT_ACTIVATED": "Korisnički račun nije aktiviran.",
130
- "GmErr_PASSWORD_CONTAINS_EMAIL": "Lozinka ne smije sadržavati e-mail adresu.",
131
- "GmErr_PASSWORD_CONTAINS_USERNAME": "Lozinka ne smije sadržavati korisničko ime.",
132
- "GmErr_PASSWORD_CONTAINS_SPACES": "Lozinka ne smije sadržavati razmake.",
133
- "GmErr_USER_4TS_CHECK_EXISTS": "4TS provjera korisnika već postoji.",
134
- "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "Korisnik je isključen iz registracije.",
135
- "GmErr_USER_NAV_EXCLUDED_LOGIN": "Korisnik je isključen iz prijave.",
136
- "GmErr_USERNAME_REQUIRED": "Korisničko ime je obavezno.",
137
- "GmErr_USER_EMAIL_NOT_VERIFIED": "E-mail adresa korisnika nije verificirana.",
138
- "GmErr_EMAIL_REQUIRED": "E-mail adresa je obavezna.",
139
- "GmErr_USERNAME_ALREADY_EXISTS": "Korisničko ime je već zauzeto.",
140
- "GmErr_DUPLICATE_PERSONAL_ID": "Pronađen je duplicirani osobni ID.",
141
- "GmErr_INVALID_USER_DOCUMENT": "Dokument korisnika je nevažeći.",
142
- "GmErr_INVALID_CODE": "Navedeni kod je nevažeći.",
143
- "GmErr_EXPIRED_TOKEN": "Token je istekao.",
144
- "GmErr_ATTEMPTS_EXCEEDED": "Prekoračen je maksimalni broj pokušaja.",
145
- "GmErr_BLOCK_USER_INCORRECT_CODE": "Korisnik je blokiran zbog pogrešnog koda.",
146
- "GmErr_TOKEN_NOT_FOUND": "Token nije pronađen.",
147
- "GmErr_INVALID_PHONE_NUMBER": "Navedeni broj telefona je nevažeći.",
148
- "GmErr_CODE_MISSING": "Nedostaje potrebni kod.",
149
- "GmErr_UNREGISTERED_USER": "Korisnik nije registriran.",
150
- "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Prekoračen je broj pokušaja generiranja koda.",
151
- "GmErr_UNEXPECTED_EXCEPTION": "Došlo je do neočekivane iznimke.",
152
- "GmErr_INVALID_USER_ID": "Navedeni ID korisnika je nevažeći.",
153
- "GmErr_NOT_ALLOWED_EXCEPTION": "Ova radnja nije dopuštena.",
154
- "GmErr_CAN_NOT_FIND_ROLE": "Navedena uloga nije pronađena.",
155
- "GmErr_NO_SESSION_PROVIDED": "Nema pružene sesije.",
156
- "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "Nema aktivne sesije za ovog korisnika.",
157
- "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "Korisnik je već anonimiziran.",
158
- "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "Nema postavljene uloge za dodjeljivanje.",
159
- "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "Pružena sesija ne pripada korisniku.",
160
- "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "Pružena sesija ne postoji.",
161
- "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "Uloga je već dodijeljena korisniku.",
162
- "GmErr_ASSIGN_USER_ROLE_FAILED": "Neuspješno dodjeljivanje uloge korisniku.",
163
- "nextButton": 'Sljedeće',
164
- "backButton": 'Nazad',
165
- "doneButton": 'Gotovo',
166
- "generalError": "Nešto nije u redu... Molimo pokušajte ponovo",
167
- "successMessage": "Register successful"
168
- },
169
- 'pt-br': {
170
- "GmErr_AMOUNT_INVALID": "O valor especificado é inválido.",
171
- "GmErr_REGISTER_OVERAGE": "A inscrição excedeu o limite permitido.",
172
- "GmErr_REGISTER_UNDERAGE": "A inscrição está abaixo do limite permitido.",
173
- "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "Falha na autenticação do usuário devido a muitas tentativas sem sucesso.",
174
- "GmErr_USER_ACCOUNT_BLOCKED": "A conta do usuário está bloqueada.",
175
- "GmErr_USER_NOT_VERIFIED": "O usuário não foi verificado.",
176
- "GmErr_USER_NOT_FOUND": "Nenhum usuário encontrado com as informações fornecidas.",
177
- "GmErr_USER_ID_INVALID": "O ID do usuário fornecido é inválido.",
178
- "GmErr_USER_AUTH_FAILED": "Falha na autenticação do usuário.",
179
- "GmErr_USER_DUPLICATED": "O usuário já existe no sistema.",
180
- "GmErr_USER_NOT_ACTIVATED": "A conta do usuário não está ativada.",
181
- "GmErr_PASSWORD_CONTAINS_EMAIL": "A senha não pode conter o endereço de e-mail.",
182
- "GmErr_PASSWORD_CONTAINS_USERNAME": "A senha não pode conter o nome de usuário.",
183
- "GmErr_PASSWORD_CONTAINS_SPACES": "A senha não pode conter espaços.",
184
- "GmErr_USER_4TS_CHECK_EXISTS": "A verificação 4TS do usuário já existe.",
185
- "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "O usuário está excluído da inscrição.",
186
- "GmErr_USER_NAV_EXCLUDED_LOGIN": "O usuário está excluído do login.",
187
- "GmErr_USERNAME_REQUIRED": "O nome de usuário é obrigatório.",
188
- "GmErr_USER_EMAIL_NOT_VERIFIED": "O e-mail do usuário não foi verificado.",
189
- "GmErr_EMAIL_REQUIRED": "Um endereço de e-mail é obrigatório.",
190
- "GmErr_USERNAME_ALREADY_EXISTS": "O nome de usuário já está em uso.",
191
- "GmErr_DUPLICATE_PERSONAL_ID": "ID pessoal duplicado encontrado.",
192
- "GmErr_INVALID_USER_DOCUMENT": "O documento do usuário é inválido.",
193
- "GmErr_INVALID_CODE": "O código fornecido é inválido.",
194
- "GmErr_EXPIRED_TOKEN": "O token expirou.",
195
- "GmErr_ATTEMPTS_EXCEEDED": "O número máximo de tentativas foi excedido.",
196
- "GmErr_BLOCK_USER_INCORRECT_CODE": "O usuário foi bloqueado devido a um código incorreto.",
197
- "GmErr_TOKEN_NOT_FOUND": "O token não foi encontrado.",
198
- "GmErr_INVALID_PHONE_NUMBER": "O número de telefone fornecido é inválido.",
199
- "GmErr_CODE_MISSING": "O código necessário está faltando.",
200
- "GmErr_UNREGISTERED_USER": "O usuário não está registrado.",
201
- "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "O número máximo de tentativas para gerar um código foi excedido.",
202
- "GmErr_UNEXPECTED_EXCEPTION": "Ocorreu uma exceção inesperada.",
203
- "GmErr_INVALID_USER_ID": "O ID do usuário fornecido é inválido.",
204
- "GmErr_NOT_ALLOWED_EXCEPTION": "Esta ação não é permitida.",
205
- "GmErr_CAN_NOT_FIND_ROLE": "Não foi possível encontrar a função especificada.",
206
- "GmErr_NO_SESSION_PROVIDED": "Nenhuma sessão foi fornecida.",
207
- "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "Nenhuma sessão ativa encontrada para este usuário.",
208
- "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "O usuário já foi anonimizado.",
209
- "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "Nenhuma função foi configurada para ser atribuída.",
210
- "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "A sessão fornecida não pertence ao usuário.",
211
- "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "A sessão fornecida não existe.",
212
- "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "A função já foi atribuída ao usuário.",
213
- "GmErr_ASSIGN_USER_ROLE_FAILED": "Falha ao atribuir a função ao usuário.",
214
- "nextButton": 'Seguindo',
215
- "backButton": 'Voltar',
216
- "doneButton": 'Terminar',
217
- "generalError": 'Alguma coisa deu errado. Por favor tente outra vez',
218
- "successMessage": 'Registro bem-sucedido'
219
- },
220
- 'es-mx': {
221
- "GmErr_AMOUNT_INVALID": "El monto especificado es inválido.",
222
- "GmErr_REGISTER_OVERAGE": "La inscripción ha excedido el límite permitido.",
223
- "GmErr_REGISTER_UNDERAGE": "La inscripción está por debajo del límite permitido.",
224
- "GmErr_USER_AUTH_FAILED_TOO_MANY_ATTEMPTS": "Autenticación de usuario fallida debido a demasiados intentos fallidos.",
225
- "GmErr_USER_ACCOUNT_BLOCKED": "La cuenta del usuario está bloqueada.",
226
- "GmErr_USER_NOT_VERIFIED": "El usuario no ha sido verificado.",
227
- "GmErr_USER_NOT_FOUND": "No se encontró ningún usuario con la información proporcionada.",
228
- "GmErr_USER_ID_INVALID": "El ID de usuario proporcionado es inválido.",
229
- "GmErr_USER_AUTH_FAILED": "La autenticación del usuario falló.",
230
- "GmErr_USER_DUPLICATED": "El usuario ya existe en el sistema.",
231
- "GmErr_USER_NOT_ACTIVATED": "La cuenta del usuario no está activada.",
232
- "GmErr_PASSWORD_CONTAINS_EMAIL": "La contraseña no puede contener la dirección de correo electrónico.",
233
- "GmErr_PASSWORD_CONTAINS_USERNAME": "La contraseña no puede contener el nombre de usuario.",
234
- "GmErr_PASSWORD_CONTAINS_SPACES": "La contraseña no puede contener espacios.",
235
- "GmErr_USER_4TS_CHECK_EXISTS": "La verificación 4TS del usuario ya existe.",
236
- "GmErr_USER_NAV_EXCLUDED_REGISTRATION": "El usuario está excluido del registro.",
237
- "GmErr_USER_NAV_EXCLUDED_LOGIN": "El usuario está excluido del inicio de sesión.",
238
- "GmErr_USERNAME_REQUIRED": "Se requiere un nombre de usuario.",
239
- "GmErr_USER_EMAIL_NOT_VERIFIED": "La dirección de correo electrónico del usuario no ha sido verificada.",
240
- "GmErr_EMAIL_REQUIRED": "Se requiere una dirección de correo electrónico.",
241
- "GmErr_USERNAME_ALREADY_EXISTS": "El nombre de usuario ya está en uso.",
242
- "GmErr_DUPLICATE_PERSONAL_ID": "Se encontró un ID personal duplicado.",
243
- "GmErr_INVALID_USER_DOCUMENT": "El documento del usuario es inválido.",
244
- "GmErr_INVALID_CODE": "El código proporcionado es inválido.",
245
- "GmErr_EXPIRED_TOKEN": "El token ha expirado.",
246
- "GmErr_ATTEMPTS_EXCEEDED": "Se ha excedido el número máximo de intentos.",
247
- "GmErr_BLOCK_USER_INCORRECT_CODE": "El usuario ha sido bloqueado debido a un código incorrecto.",
248
- "GmErr_TOKEN_NOT_FOUND": "No se encontró el token.",
249
- "GmErr_INVALID_PHONE_NUMBER": "El número de teléfono proporcionado es inválido.",
250
- "GmErr_CODE_MISSING": "Falta el código necesario.",
251
- "GmErr_UNREGISTERED_USER": "El usuario no está registrado.",
252
- "GmErr_ATTEMPTS_TO_GENERATE_CODE_EXCEEDED": "Se ha excedido el número máximo de intentos para generar un código.",
253
- "GmErr_UNEXPECTED_EXCEPTION": "Ocurrió una excepción inesperada.",
254
- "GmErr_INVALID_USER_ID": "El ID de usuario proporcionado es inválido.",
255
- "GmErr_NOT_ALLOWED_EXCEPTION": "Esta acción no está permitida.",
256
- "GmErr_CAN_NOT_FIND_ROLE": "No se pudo encontrar el rol especificado.",
257
- "GmErr_NO_SESSION_PROVIDED": "No se proporcionó ninguna sesión.",
258
- "GmErr_NO_ACTIVE_SESSION_FOUND_FOR_THIS_USER": "No se encontró ninguna sesión activa para este usuario.",
259
- "GmErr_USER_HAS_ALREADY_BEEN_ANONYMIZED": "El usuario ya ha sido anonimizado.",
260
- "GmErr_NO_ROLE_HAS_BEEN_SET_UP_TO_BE_ASSIGNED": "No se ha configurado ningún rol para ser asignado.",
261
- "GmErr_PROVIDED_SESSION_DOES_NOT_BELONG_TO_THE_USER": "La sesión proporcionada no pertenece al usuario.",
262
- "GmErr_PROVIDED_SESSION_DOES_NOT_EXIST": "La sesión proporcionada no existe.",
263
- "GmErr_ROLE_ALREADY_ASSIGNED_FOR_USER": "El rol ya ha sido asignado al usuario.",
264
- "GmErr_ASSIGN_USER_ROLE_FAILED": "Falló la asignación del rol al usuario.",
265
- "nextButton": 'Siguiente',
266
- "backButton": 'Atrás',
267
- "doneButton": 'Terminar',
268
- "generalError": 'Algo salió mal... Por favor intente de nuevo',
269
- "successMessage": 'Registro exitoso'
270
- },
271
- "tr": {
272
- "nextButton": 'Next',
273
- "backButton": 'Back',
274
- "doneButton": 'Done',
275
- "GmErr_BadRequest_Duplicate_User": 'A user with this information already exists.',
276
- "GmErr_BadRequest_PasswordContainsUsername": "The password cannot be the same as the username.",
277
- "GmErr_BadRequest_PasswordContainsEmail": "The password cannot be the same as the email.",
278
- "GmErr_BadRequest_Duplicate_PersonalId": "There is already a registration with the data you entered or you entered your data in an incorrect format.",
279
- "GmErr_Forbidden_UserAccount_NavExcluded": 'User is NAV Excluded. Registration was denied.',
280
- "GmErr_BadRequest_ModelValidationFailed": 'Something went wrong... Please try again.',
281
- "GmErr_BadInternalConfigs": 'Something went wrong... Please try again.',
282
- "GmErr_Unauthorized": 'Something went wrong... Please try again.',
283
- "GmErr_NotFound": 'Something went wrong... Please try again.',
284
- "GmErr_UnexpectedException": 'Something went wrong... Please try again.',
285
- "generalError": "Something went wrong... Please try again.",
286
- "successMessage": "Register successful"
287
- }
288
- };
289
- const getTranslations = (url) => {
290
- // fetch url, get the data, replace the TRANSLATIONS content
291
- return new Promise((resolve) => {
292
- fetch(url)
293
- .then((res) => res.json())
294
- .then((data) => {
295
- Object.keys(data).forEach((item) => {
296
- for (let key in data[item]) {
297
- TRANSLATIONS[item][key] = data[item][key];
298
- }
299
- });
300
- resolve(true);
301
- });
302
- });
303
- };
304
- const translate = (key, customLang, values) => {
305
- let lang = TRANSLATIONS[customLang] ? customLang : DEFAULT_LANGUAGE;
306
- let translation = TRANSLATIONS[lang][key];
307
- if (values !== undefined) {
308
- for (const [key, value] of Object.entries(values.values)) {
309
- const regex = new RegExp(`{${key}}`, 'g');
310
- translation = translation.replace(regex, value);
311
- }
312
- }
313
- return translation;
314
- };
315
-
316
- 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}";
317
-
318
- const GeneralRegistration$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
319
- constructor() {
320
- super();
321
- this.__registerHost();
322
- this.__attachShadow();
323
- this.registrationWidgetLoaded = createEvent(this, "registrationWidgetLoaded", 7);
324
- this.registrationStepUpdated = createEvent(this, "registrationStepUpdated", 7);
325
- /**
326
- * Currently selected language
327
- */
328
- this.language = 'en';
329
- /**
330
- * Client custom styling via inline styles
331
- */
332
- this.clientStyling = '';
333
- /**
334
- * Client custom styling via url
335
- */
336
- this.clientStylingUrl = '';
337
- /**
338
- * Translations via URL
339
- */
340
- this.translationUrl = '';
341
- /**
342
- * Affiliate code to be passed in and sent in the registration.
343
- */
344
- this.btag = null;
345
- /**
346
- * Boolean flag that tells inputs to emit an event on click.
347
- */
348
- this.emitOnClick = false;
349
- this.isLoading = true;
350
- this.forms = [];
351
- this.limitStylingAppends = false;
352
- this.autofilled = false;
353
- this.listOfInputValues = [];
354
- this.listOfInputValidity = [];
355
- this.listOfActions = [];
356
- this.listOfInputs = [];
357
- this.emitValue = false;
358
- this.backButtonPressed = false;
359
- this.registerErrors = false;
360
- this.extraActions = [];
361
- this.registrationStepsState = {
362
- regId: null
363
- };
364
- this.setClientStyling = () => {
365
- let sheet = document.createElement('style');
366
- sheet.innerHTML = this.clientStyling;
367
- this.host.shadowRoot.prepend(sheet);
368
- };
369
- this.setClientStylingURL = () => {
370
- let url = new URL(this.clientStylingUrl);
371
- let cssFile = document.createElement('style');
372
- fetch(url.href)
373
- .then((res) => res.text())
374
- .then((data) => {
375
- cssFile.innerHTML = data;
376
- this.clientStyling = data;
377
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
378
- });
379
- };
380
- }
381
- sendStep() {
382
- this.registrationStepUpdated.emit(this.registrationStep);
383
- window.postMessage({ type: 'registrationStepUpdated', step: this.registrationStep }, window.location.href);
384
- }
385
- handleStylingChange(newValue, oldValue) {
386
- if (newValue !== oldValue)
387
- this.setClientStyling();
388
- }
389
- handleStylingUrlChange(newValue, oldValue) {
390
- if (newValue !== oldValue)
391
- this.setClientStylingURL();
392
- }
393
- setFormValidity() {
394
- this.errorMessage = '';
395
- if (this.listOfInputValidity) {
396
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
397
- }
398
- //Check for autofilled.
399
- if (this.listOfInputs.some(inputs => inputs.autofill)) {
400
- this.autofilled = true;
401
- }
402
- }
403
- addBtag() {
404
- this.addBtagValue();
405
- }
406
- checkInputsValidityHandler(event) {
407
- // Set isValid state of the input in the list.
408
- this.listOfInputValidity.find(input => input.name == event.detail.name).isValid = event.detail.valid;
409
- // Check if any one is invalid.
410
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
411
- }
412
- getInputsValueHandler(event) {
413
- this.listOfInputValues.find(input => {
414
- if (input.name == event.detail.name) {
415
- input.value = event.detail.value;
416
- input.type = event.detail.type || null;
417
- }
418
- });
419
- this.stepsStateMachine({ event: 'set', type: 'values' });
420
- }
421
- componentWillLoad() {
422
- return this.getRegisterConfig()
423
- .then((config) => {
424
- this.formatConfig(config);
425
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
426
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
427
- });
428
- }
429
- componentDidLoad() {
430
- this.registrationWidgetLoaded.emit();
431
- window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
432
- if (!this.limitStylingAppends && this.host) {
433
- if (this.clientStyling)
434
- this.setClientStyling();
435
- if (this.clientStylingUrl)
436
- this.setClientStylingURL();
437
- this.limitStylingAppends = true;
438
- }
439
- }
440
- nextHandler(e) {
441
- e.preventDefault();
442
- // Trigger events in subwidgets.
443
- this.emitValue = true;
444
- this.setRegisterStep();
445
- }
446
- backHandler(e) {
447
- e.preventDefault();
448
- this.registrationStep = this.stepChange('decrement');
449
- this.stepsStateMachine({ event: 'get', type: 'inputs' });
450
- this.stepsStateMachine({ event: 'get', type: 'values' });
451
- }
452
- dispatchRegisterCredentialsEvent() {
453
- const userNameEmail = this.registrationStepsState['Step1']['registerUserData']['Email']['value'];
454
- const userPassword = this.registrationStepsState['Step1']['registerUserData']['Password']['value'];
455
- this.registerCredentialsEvent = new CustomEvent('RegisterCredentials', {
456
- bubbles: true,
457
- detail: {
458
- userNameEmail: userNameEmail,
459
- userPassword: userPassword
460
- }
461
- });
462
- window.dispatchEvent(this.registerCredentialsEvent);
463
- }
464
- stepsStateMachine(state) {
465
- switch (state.event) {
466
- case 'set':
467
- if (state.type == 'inputs') {
468
- this.registrationStepsState[this.registrationStep].fields = this.listOfInputs;
469
- this.registrationStepsState[this.registrationStep].actions = this.listOfActions;
470
- this.registrationStepsState[this.registrationStep].fieldsValidity = this.listOfInputValidity;
471
- }
472
- if (state.type == 'values') {
473
- this.registrationStepsState[this.registrationStep].registerUserData = this.listOfInputValues.reduce((acc, curr) => {
474
- acc[curr.name] = { value: curr.value, isDuplicate: curr.isDuplicate };
475
- return acc;
476
- }, {});
477
- }
478
- localStorage.setItem('registrationStepsState', JSON.stringify(this.registrationStepsState));
479
- break;
480
- case 'get':
481
- const savedUserData = JSON.parse(localStorage.getItem('registrationStepsState'));
482
- if (!savedUserData)
483
- return;
484
- if (state.type == 'inputs') {
485
- this.listOfInputs = this.registrationStepsState[this.registrationStep].fields;
486
- this.listOfActions = this.registrationStepsState[this.registrationStep].actions;
487
- this.listOfInputValidity = this.registrationStepsState[this.registrationStep].fieldsValidity;
488
- }
489
- if (state.type == 'values') {
490
- const savedValues = savedUserData[this.registrationStep].registerUserData;
491
- this.listOfInputValues = Object.keys(savedValues).map(name => {
492
- return { name, value: savedValues[name].value, isDuplicate: savedValues[name].isDuplicate };
493
- });
494
- // Give to each field the user input as the default value.
495
- this.listOfInputValues.forEach(inputValue => {
496
- const input = this.listOfInputs.find(input => input.name === inputValue.name);
497
- if (input) {
498
- input.defaultValue = inputValue.value;
499
- }
500
- });
501
- }
502
- this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
503
- break;
504
- }
505
- }
506
- getRegisterConfig(registrationID) {
507
- const url = new URL(`${this.endpoint}/v1/player/legislation/registration/config`);
508
- const headers = new Headers();
509
- headers.append('Content-Type', 'application/json');
510
- headers.append('Accept', 'application/json');
511
- if (registrationID) {
512
- url.searchParams.append('registrationId', registrationID);
513
- }
514
- const options = {
515
- method: 'GET',
516
- headers
517
- };
518
- return new Promise((resolve, reject) => {
519
- this.isLoading = true;
520
- fetch(url.href, options)
521
- .then((res) => res.json())
522
- .then((config) => {
523
- this.isLoading = false;
524
- resolve(config);
525
- }).catch((err) => {
526
- this.isLoading = false;
527
- console.error(err);
528
- reject(err);
529
- }).finally(() => {
530
- this.isLoading = false;
531
- });
532
- });
533
- }
534
- setRegisterStep() {
535
- this.isLoadingPOST = true;
536
- const url = new URL(`${this.endpoint}/v1/player/legislation/registration/step`);
537
- const registerStep = {
538
- registrationId: this.registrationID,
539
- registerUserDto: this.listOfInputValues
540
- .filter(input => !input.isDuplicate)
541
- .reduce((acc, curr) => {
542
- // Because the API is very robust, some values need to be split as separate entities.
543
- if (curr.name === 'TypeOfPublicArea') {
544
- acc[curr.name] = curr.value.toLowerCase();
545
- }
546
- else if (curr.type === 'tel') {
547
- //@ts-ignore
548
- acc['MobilePrefix'] = curr.value.prefix;
549
- //@ts-ignore
550
- acc[curr.name] = curr.value.phone;
551
- }
552
- else if (curr.type === 'checkboxgroup') {
553
- // Skip adding the parent of the checkboxgroup as a key.
554
- if (curr.value !== null) {
555
- Object.entries(curr.value).forEach(([key, value]) => {
556
- acc[key] = value ? 'true' : 'false';
557
- });
558
- }
559
- }
560
- else {
561
- acc[curr.name] = curr.value;
562
- }
563
- return acc;
564
- }, {}),
565
- step: this.registrationStep,
566
- };
567
- const headers = new Headers();
568
- headers.append('Content-Type', 'application/json');
569
- headers.append('Accept', 'application/json');
570
- const options = {
571
- method: 'POST',
572
- body: JSON.stringify(registerStep),
573
- headers
574
- };
575
- fetch(url.href, options)
576
- .then((res) => {
577
- if (!res.ok) {
578
- return res.json().then(error => {
579
- this.errorCode = error.thirdPartyResponse.errorCode;
580
- // Show the idomsoft error if it is the case
581
- if (this.errorCode == 'GmErr_BadRequest_IdomsoftVerification_ShouldRetry') {
582
- this.errorMessage = error.thirdPartyResponse.message;
583
- }
584
- else if (this.errorCode === 'GmErr_Forbidden_UserAccount_NavExcluded') {
585
- this.errorMessage = translate(`${this.errorCode}`, this.language);
586
- }
587
- else if (this.errorCode == 'GmErr_BadRequest') {
588
- this.errorMessage = error.thirdPartyResponse.message;
589
- }
590
- else {
591
- this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
592
- }
593
- });
594
- }
595
- return res.json();
596
- })
597
- .then((data) => {
598
- this.isLoadingPOST = false;
599
- this.registrationID = data.registrationId;
600
- if (this.listOfActions.some(action => action == '/register')) {
601
- if (this.listOfActions.some(action => action == '/generate-2FA-code/Generate2FACode')) {
602
- this.extraActions.push('2fa');
603
- }
604
- this.setRegister();
605
- }
606
- else {
607
- // After sending the current step, increment and check if the next one is in state.
608
- this.registrationStep = this.stepChange('increment');
609
- // If step is present in state do NOT fetch the next config.
610
- if (Object.keys(this.registrationStepsState).find(key => key == this.registrationStep)) {
611
- // Use the one from state
612
- this.stepsStateMachine({ event: 'get', type: 'inputs' });
613
- this.stepsStateMachine({ event: 'get', type: 'values' });
614
- }
615
- else {
616
- this.getRegisterConfig(this.registrationID).then((config) => {
617
- // Format the new step config.
618
- this.formatConfig(config);
619
- // Set it in local storage.
620
- this.stepsStateMachine({ event: 'set', type: 'inputs' });
621
- });
622
- }
623
- }
624
- })
625
- .catch((err) => {
626
- this.isLoadingPOST = false;
627
- console.error(err);
628
- }).finally(() => {
629
- this.isLoadingPOST = false;
630
- });
631
- }
632
- setRegister() {
633
- this.isLoading = true;
634
- this.registerErrors = false;
635
- const url = new URL(`${this.endpoint}/v1/player/legislation/register`);
636
- const headers = new Headers();
637
- headers.append('Content-Type', 'application/json');
638
- headers.append('Accept', 'application/json');
639
- const options = {
640
- method: 'PUT',
641
- body: JSON.stringify({ registrationId: this.registrationID }),
642
- headers
643
- };
644
- fetch(url.href, options)
645
- .then((res) => {
646
- if (!res.ok) {
647
- this.registerErrors = true;
648
- return res.json().then(error => {
649
- this.errorCode = error.thirdPartyResponse.errorCode;
650
- // Show the idomsoft error if it is the case
651
- if (this.errorCode == 'GmErr_BadRequest_IdomsoftVerification_ShouldRetry') {
652
- this.errorMessage = error.thirdPartyResponse.message;
653
- }
654
- else if (this.errorCode == 'GmErr_BadRequest') {
655
- this.errorMessage = error.thirdPartyResponse.message;
656
- }
657
- else {
658
- this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
659
- }
660
- window.postMessage({ type: 'registrationFailed', errorMessage: error === null || error === void 0 ? void 0 : error.thirdPartyResponse.message }, window.location.href);
661
- window.postMessage({ type: 'WidgetNotification', data: {
662
- type: 'error',
663
- message: this.errorMessage
664
- } }, window.location.href);
665
- });
666
- }
667
- return res.json();
668
- })
669
- .then((data) => {
670
- this.isLoading = false;
671
- if (!this.registerErrors) {
672
- this.dispatchRegisterCredentialsEvent();
673
- window.postMessage({ type: 'registrationSuccessful', userId: data === null || data === void 0 ? void 0 : data.userId, extraActions: this.extraActions }, window.location.href);
674
- window.postMessage({ type: 'WidgetNotification', data: {
675
- type: 'success',
676
- message: translate('successMessage', this.language)
677
- } }, window.location.href);
678
- }
679
- })
680
- .catch((err) => {
681
- this.isLoading = false;
682
- console.error(err);
683
- })
684
- .finally(() => {
685
- this.isLoading = false;
686
- });
687
- }
688
- formatConfig(config) {
689
- // Populate the list of inputs
690
- this.listOfInputs = config.content.fields.flatMap((field) => {
691
- // Special case for inputs that need to be duplicated.
692
- const duplicateInputRule = field.validate.custom.find(customRule => customRule.rule === 'duplicate-input');
693
- const inputElement = Object.assign({}, field);
694
- if (duplicateInputRule) {
695
- const duplicateInput = Object.assign(Object.assign({}, field), { name: `${field.name}Duplicate`, displayName: duplicateInputRule.displayName, isDuplicateInput: true });
696
- return [inputElement, duplicateInput];
697
- }
698
- else {
699
- return [inputElement];
700
- }
701
- });
702
- this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
703
- var _a;
704
- // If the field is a togglecheckbox, add its subfields
705
- if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
706
- field.data.subFields.forEach(subfield => {
707
- acc.push({
708
- name: subfield.name,
709
- isValid: this.setInitialValidStatus(subfield)
710
- });
711
- });
712
- }
713
- else {
714
- acc.push({
715
- name: field.name,
716
- isValid: this.setInitialValidStatus(field)
717
- });
718
- }
719
- return acc;
720
- }, []);
721
- this.listOfInputValues = this.listOfInputs.reduce((acc, field) => {
722
- var _a, _b, _c;
723
- // If the field type is a 'togglecheckbox', add its subfields
724
- if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
725
- field.data.subFields.forEach(subfield => {
726
- var _a, _b;
727
- acc.push({
728
- name: subfield.name,
729
- value: ((_a = subfield.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' ? 'false' : null,
730
- isDuplicate: subfield.isDuplicateInput || false,
731
- type: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'togglecheckbox'
732
- ? 'togglecheckbox'
733
- : null
734
- });
735
- });
736
- }
737
- else {
738
- acc.push({
739
- name: field.name,
740
- value: ((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) == 'checkbox' ? 'false' : null,
741
- isDuplicate: field.isDuplicateInput || false,
742
- type: ((_c = field.inputType) === null || _c === void 0 ? void 0 : _c.toLowerCase()) == 'checkboxgroup' ? 'checkboxgroup' : null
743
- });
744
- }
745
- return acc;
746
- }, []);
747
- if (this.btag)
748
- this.addBtagValue();
749
- // Set the list of actions
750
- this.listOfActions = config.content.actions.map(action => action);
751
- this.registrationID = config.content.registrationID;
752
- this.registrationStep = config.content.step;
753
- if (this.listOfActions.some(action => action == '/register')) {
754
- this.lastStep = this.registrationStep;
755
- }
756
- // The translations for fields happens here.
757
- if (this.translationUrl) {
758
- getTranslations(this.translationUrl).then(() => {
759
- this.listOfInputs.forEach(field => {
760
- var _a, _b;
761
- this.addTranslation(field);
762
- // Logic for field types that have subfields
763
- if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'togglecheckbox') {
764
- field.data.subFields.forEach(subField => this.addTranslation(subField));
765
- }
766
- if (((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'checkboxgroup') {
767
- this.addTranslation(field);
768
- field.data.subFields.forEach(subField => this.addTranslation(subField));
769
- }
770
- return field;
771
- });
772
- })
773
- .catch((error) => {
774
- console.error('Failed to fetch translations:', error);
775
- }).finally(() => {
776
- this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
777
- });
778
- }
779
- else {
780
- this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
781
- }
782
- // Add the step to the registrationStepsData
783
- this.registrationStepsState.regId = this.registrationID;
784
- if (!this.registrationStepsState[this.registrationStep]) {
785
- this.registrationStepsState[this.registrationStep] = {
786
- fields: [],
787
- fieldsValidity: [],
788
- registerUserData: {},
789
- actions: []
790
- };
791
- }
792
- }
793
- addBtagValue() {
794
- const btagField = this.listOfInputs.find(input => input.name.toLowerCase() === 'btag');
795
- if (btagField) {
796
- btagField.defaultValue = this.btag;
797
- }
798
- const btagValue = this.listOfInputValues.find(input => input.name.toLowerCase() === 'btag');
799
- if (btagValue) {
800
- btagValue.value = this.btag;
801
- }
802
- }
803
- addTranslation(field) {
804
- const lang = TRANSLATIONS[this.language] ? this.language : DEFAULT_LANGUAGE;
805
- if (TRANSLATIONS[lang][field.name]) {
806
- Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
807
- field[key] = TRANSLATIONS[this.language][field.name][key];
808
- });
809
- }
810
- }
811
- setInitialValidStatus(field) {
812
- var _a, _b;
813
- // Input type checkbox, with no validation are valid
814
- 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) {
815
- return true;
816
- }
817
- //Inputs that have default value are valid.
818
- if (field.defaultValue !== null) {
819
- return true;
820
- }
821
- return false;
822
- }
823
- stepChange(action) {
824
- const stepNum = parseInt(this.registrationStep.replace('Step', ''));
825
- if (action === 'increment') {
826
- return 'Step' + (stepNum + 1);
827
- }
828
- if (action === 'decrement') {
829
- return 'Step' + (stepNum - 1);
830
- }
831
- }
832
- getInvalidStatus(listOfInputs) {
833
- return listOfInputs.filter(input => input.isValid == false).length > 0;
834
- }
835
- renderForm() {
836
- return this.forms.map((form, index) => {
837
- 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
838
- ? (input.inputType.toLowerCase() == 'checkboxgroup' || input.inputType.toLowerCase() == 'togglecheckbox')
839
- ? input.data.subFields
840
- : input.data.values
841
- : [], 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 })));
842
- });
843
- }
844
- ;
845
- renderButtons() {
846
- return (h("div", { class: `registration__buttons-wrapper ${this.autofilled ? 'registration__buttons-wrapper--autofilled' : ''}` }, this.isLoadingPOST
847
- && h("slot", { name: 'spinner' })
848
- && 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))));
849
- }
850
- render() {
851
- if (this.isLoading) {
852
- return h("p", null, "Please wait, loading ...");
853
- }
854
- return (h("div", { class: `registration registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
855
- }
856
- get host() { return this; }
857
- static get watchers() { return {
858
- "registrationStep": ["sendStep"],
859
- "clientStyling": ["handleStylingChange"],
860
- "clientStylingUrl": ["handleStylingUrlChange"],
861
- "forms": ["setFormValidity"],
862
- "btag": ["addBtag"]
863
- }; }
864
- static get style() { return generalRegistrationCss; }
865
- }, [1, "general-registration", {
866
- "endpoint": [513],
867
- "language": [513],
868
- "clientStyling": [1537, "client-styling"],
869
- "clientStylingUrl": [513, "client-styling-url"],
870
- "translationUrl": [513, "translation-url"],
871
- "dateFormat": [513, "date-format"],
872
- "buttonInsideForm": [516, "button-inside-form"],
873
- "btag": [513],
874
- "emitOnClick": [516, "emit-on-click"],
875
- "errorMessage": [32],
876
- "isFormValid": [32],
877
- "isLoading": [32],
878
- "isLoadingPOST": [32],
879
- "registrationStep": [32],
880
- "forms": [32],
881
- "limitStylingAppends": [32],
882
- "autofilled": [32]
883
- }, [[0, "sendValidityState", "checkInputsValidityHandler"], [0, "sendInputValue", "getInputsValueHandler"]]]);
884
- function defineCustomElement$1() {
885
- if (typeof customElements === "undefined") {
886
- return;
887
- }
888
- 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"];
889
- components.forEach(tagName => { switch (tagName) {
890
- case "general-registration":
891
- if (!customElements.get(tagName)) {
892
- customElements.define(tagName, GeneralRegistration$1);
893
- }
894
- break;
895
- case "checkbox-group-input":
896
- if (!customElements.get(tagName)) {
897
- defineCustomElement$d();
898
- }
899
- break;
900
- case "checkbox-input":
901
- if (!customElements.get(tagName)) {
902
- defineCustomElement$c();
903
- }
904
- break;
905
- case "date-input":
906
- if (!customElements.get(tagName)) {
907
- defineCustomElement$b();
908
- }
909
- break;
910
- case "email-input":
911
- if (!customElements.get(tagName)) {
912
- defineCustomElement$a();
913
- }
914
- break;
915
- case "general-input":
916
- if (!customElements.get(tagName)) {
917
- defineCustomElement$9();
918
- }
919
- break;
920
- case "number-input":
921
- if (!customElements.get(tagName)) {
922
- defineCustomElement$8();
923
- }
924
- break;
925
- case "password-input":
926
- if (!customElements.get(tagName)) {
927
- defineCustomElement$7();
928
- }
929
- break;
930
- case "radio-input":
931
- if (!customElements.get(tagName)) {
932
- defineCustomElement$6();
933
- }
934
- break;
935
- case "select-input":
936
- if (!customElements.get(tagName)) {
937
- defineCustomElement$5();
938
- }
939
- break;
940
- case "tel-input":
941
- if (!customElements.get(tagName)) {
942
- defineCustomElement$4();
943
- }
944
- break;
945
- case "text-input":
946
- if (!customElements.get(tagName)) {
947
- defineCustomElement$3();
948
- }
949
- break;
950
- case "toggle-checkbox-input":
951
- if (!customElements.get(tagName)) {
952
- defineCustomElement$2();
953
- }
954
- break;
955
- } });
956
- }
957
-
958
- const GeneralRegistration = GeneralRegistration$1;
959
- const defineCustomElement = defineCustomElement$1;
960
-
961
- export { GeneralRegistration, defineCustomElement };