@everymatrix/user-login 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 (48) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-465784fc.js +1240 -0
  3. package/dist/cjs/loader.cjs.js +7 -13
  4. package/dist/cjs/user-login.cjs.entry.js +301 -328
  5. package/dist/cjs/user-login.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/user-login/index.js +1 -0
  8. package/dist/collection/components/user-login/user-login.js +397 -443
  9. package/dist/collection/utils/locale.utils.js +110 -110
  10. package/dist/collection/utils/utils.js +1 -1
  11. package/dist/esm/app-globals-0f993ce5.js +3 -0
  12. package/dist/esm/index-4e85bfaa.js +1214 -0
  13. package/dist/esm/loader.js +7 -13
  14. package/dist/esm/user-login.entry.js +301 -328
  15. package/dist/esm/user-login.js +14 -11
  16. package/dist/stencil.config.dev.js +17 -0
  17. package/dist/stencil.config.js +14 -19
  18. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.d.ts +2 -0
  19. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-login/.stencil/packages/stencil/user-login/stencil.config.dev.d.ts +2 -0
  20. package/dist/types/components/user-login/index.d.ts +1 -0
  21. package/dist/types/components/user-login/user-login.d.ts +80 -80
  22. package/dist/types/stencil-public-runtime.d.ts +142 -33
  23. package/dist/user-login/p-11519ff0.entry.js +1 -0
  24. package/dist/user-login/p-a86a26ad.js +2 -0
  25. package/dist/user-login/p-e1255160.js +1 -0
  26. package/dist/user-login/user-login.esm.js +1 -1
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +8 -1
  34. package/dist/cjs/index-5d65f61a.js +0 -1233
  35. package/dist/components/index.d.ts +0 -26
  36. package/dist/components/index.js +0 -1
  37. package/dist/components/user-login.d.ts +0 -11
  38. package/dist/components/user-login.js +0 -389
  39. package/dist/esm/index-20da8fd1.js +0 -1208
  40. package/dist/esm/polyfills/core-js.js +0 -11
  41. package/dist/esm/polyfills/css-shim.js +0 -1
  42. package/dist/esm/polyfills/dom.js +0 -79
  43. package/dist/esm/polyfills/es5-html-element.js +0 -1
  44. package/dist/esm/polyfills/index.js +0 -34
  45. package/dist/esm/polyfills/system.js +0 -6
  46. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-login/.stencil/packages/user-login/stencil.config.d.ts +0 -2
  47. package/dist/user-login/p-272dfe10.entry.js +0 -1
  48. package/dist/user-login/p-55726395.js +0 -1
@@ -1,453 +1,407 @@
1
- import { Component, Prop, State, Watch, h } from '@stencil/core';
2
- import { getTranslations, translate } from '../../utils/locale.utils';
1
+ import { h } from "@stencil/core";
2
+ import { getTranslations, translate } from "../../utils/locale.utils";
3
3
  export class UserLogin {
4
- constructor() {
5
- /**
6
- * Endpoint
7
- */
8
- this.endpoint = '';
9
- /**
10
- * Language
11
- */
12
- this.lang = 'en';
13
- /**
14
- * Client styling
15
- */
16
- this.clientStyling = '';
17
- /**
18
- * Client styling by url
19
- */
20
- this.clientStylingUrl = '';
21
- /**
22
- * Translation url
23
- */
24
- this.translationUrl = '';
25
- /**
26
- * Password reset
27
- */
28
- this.passwordReset = 'false';
29
- /**
30
- * User email regex options
31
- */
32
- this.userEmailRegexOptions = 'i';
33
- /**
34
- * Password regex options
35
- */
36
- this.passwordRegexOptions = '';
37
- /**
38
- * Username
39
- */
40
- this.userNameEmail = '';
41
- /**
42
- * Password
43
- */
44
- this.userPassword = '';
45
- this.isValidUserEmail = true;
46
- this.isValidPassword = true;
47
- this.isPasswordVisible = false;
48
- this.limitStylingAppends = false;
49
- this.errorMessage = '';
50
- this.hasError = false;
51
- this.errorCode = '';
52
- this.setClientStyling = () => {
53
- let sheet = document.createElement('style');
54
- sheet.innerHTML = this.clientStyling;
55
- this.stylingContainer.appendChild(sheet);
56
- };
57
- this.setClientStylingURL = () => {
58
- let url = new URL(this.clientStylingUrl);
59
- let cssFile = document.createElement('style');
60
- fetch(url.href)
61
- .then((res) => res.text())
62
- .then((data) => {
63
- cssFile.innerHTML = data;
64
- setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
65
- });
66
- };
67
- this.autofillCredentialsHandler = (e) => {
68
- this.userNameEmail = e.detail.userNameEmail;
69
- this.userPassword = e.detail.userPassword;
70
- this.handleLogin();
71
- };
72
- this.userLogin = async ({ username, password }) => {
73
- let headers = {
74
- 'Content-Type': 'application/json'
75
- };
76
- let bodyData = {
77
- username,
78
- password
79
- };
80
- let options = {
81
- method: 'POST',
82
- headers,
83
- body: JSON.stringify(bodyData),
84
- };
85
- fetch(`${this.endpoint}/v1/player/legislation/login`, options)
86
- .then((res) => {
87
- return res.json();
88
- }).then((data) => {
89
- var _a, _b, _c;
90
- if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
91
- window.postMessage({ type: 'PlayerActions', gmversion: 'gm16' }, window.location.href);
4
+ constructor() {
5
+ this.errorCode = '';
6
+ this.setClientStyling = () => {
7
+ let sheet = document.createElement('style');
8
+ sheet.innerHTML = this.clientStyling;
9
+ this.stylingContainer.appendChild(sheet);
10
+ };
11
+ this.setClientStylingURL = () => {
12
+ let url = new URL(this.clientStylingUrl);
13
+ let cssFile = document.createElement('style');
14
+ fetch(url.href)
15
+ .then((res) => res.text())
16
+ .then((data) => {
17
+ cssFile.innerHTML = data;
18
+ setTimeout(() => { this.stylingContainer.appendChild(cssFile); }, 1);
19
+ });
20
+ };
21
+ this.autofillCredentialsHandler = (e) => {
22
+ this.userNameEmail = e.detail.userNameEmail;
23
+ this.userPassword = e.detail.userPassword;
24
+ this.handleLogin();
25
+ };
26
+ this.userLogin = async ({ username, password }) => {
27
+ let headers = {
28
+ 'Content-Type': 'application/json'
29
+ };
30
+ let bodyData = {
31
+ username,
32
+ password
33
+ };
34
+ let options = {
35
+ method: 'POST',
36
+ headers,
37
+ body: JSON.stringify(bodyData),
38
+ };
39
+ fetch(`${this.endpoint}/v1/player/legislation/login`, options)
40
+ .then((res) => {
41
+ return res.json();
42
+ }).then((data) => {
43
+ var _a, _b, _c;
44
+ if ((_a = data.sessionBlockers) === null || _a === void 0 ? void 0 : _a.includes('has-to-set-consents')) {
45
+ window.postMessage({ type: 'PlayerActions', gmversion: 'gm16' }, window.location.href);
46
+ }
47
+ if ((data === null || data === void 0 ? void 0 : data.hasToSetPass) === true) {
48
+ window.postMessage({ type: 'HasToSetPass' }, window.location.href);
49
+ }
50
+ if (data.sessionId) {
51
+ window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
52
+ window.postMessage({ type: 'WidgetNotification', data: {
53
+ type: 'success',
54
+ message: translate('successMessage', this.lang)
55
+ } }, window.location.href);
56
+ this.hasError = false;
57
+ }
58
+ else {
59
+ // handles errors thrown by api
60
+ this.hasError = true;
61
+ this.errorCode = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.errorCode;
62
+ this.errorMessage = translate(`${this.errorCode}`, this.lang) || ((_c = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _c === void 0 ? void 0 : _c.message) || translate('genericError', this.lang);
63
+ if (this.errorMessage) {
64
+ console.error(this.errorMessage);
65
+ this.sendErrorNotification(this.errorMessage);
66
+ }
67
+ }
68
+ }).catch((err) => {
69
+ // handles unexpected errors
70
+ console.error(err);
71
+ this.hasError = true;
72
+ this.errorMessage = translate('genericError', this.lang);
73
+ this.sendErrorNotification(this.errorMessage);
74
+ });
75
+ };
76
+ this.debouncedUserLogin = this.debounce(this.userLogin, 850);
77
+ this.handleLogin = () => {
78
+ this.debouncedUserLogin({
79
+ username: this.userNameEmail,
80
+ password: this.userPassword
81
+ });
82
+ this.dispatchUpdateLoginCredentialsEvent();
83
+ };
84
+ this.handleInputChange = (event, location) => {
85
+ this.hasError = false;
86
+ const inputValue = event.target.value;
87
+ if (location === 'user') {
88
+ this.userNameEmail = inputValue;
89
+ this.isValidUserEmail = this.userEmailValidation(this.userNameEmail);
90
+ }
91
+ else {
92
+ this.userPassword = inputValue;
93
+ this.isValidPassword = this.passwordValidation(inputValue);
94
+ }
95
+ };
96
+ this.userEmailValidation = (input) => {
97
+ const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
98
+ return regex.test(input);
99
+ };
100
+ this.passwordValidation = (input) => {
101
+ const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
102
+ return regex.test(input);
103
+ };
104
+ this.togglePassword = () => {
105
+ this.isPasswordVisible = !this.isPasswordVisible;
106
+ };
107
+ this.resetPassword = () => {
108
+ window.postMessage({ type: "NavForgotPassword" }, window.location.href);
109
+ };
110
+ this.endpoint = '';
111
+ this.lang = 'en';
112
+ this.clientStyling = '';
113
+ this.clientStylingUrl = '';
114
+ this.translationUrl = '';
115
+ this.passwordReset = 'false';
116
+ this.userEmailRegex = undefined;
117
+ this.userEmailRegexOptions = 'i';
118
+ this.passwordRegex = undefined;
119
+ this.passwordRegexOptions = '';
120
+ this.userNameEmail = '';
121
+ this.userPassword = '';
122
+ this.isValidUserEmail = true;
123
+ this.isValidPassword = true;
124
+ this.isPasswordVisible = false;
125
+ this.limitStylingAppends = false;
126
+ this.errorMessage = '';
127
+ this.hasError = false;
128
+ }
129
+ handleNewTranslations() {
130
+ getTranslations(this.translationUrl);
131
+ }
132
+ async componentWillLoad() {
133
+ if (this.translationUrl.length > 2) {
134
+ await getTranslations(this.translationUrl);
92
135
  }
93
- if ((data === null || data === void 0 ? void 0 : data.hasToSetPass) === true) {
94
- window.postMessage({ type: 'HasToSetPass' }, window.location.href);
136
+ }
137
+ componentDidLoad() {
138
+ window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
139
+ window.postMessage({ type: 'UserLoginDidLoad' });
140
+ }
141
+ componentDidRender() {
142
+ // start custom styling area
143
+ if (!this.limitStylingAppends && this.stylingContainer) {
144
+ if (this.clientStyling)
145
+ this.setClientStyling();
146
+ if (this.clientStylingUrl)
147
+ this.setClientStylingURL();
148
+ this.limitStylingAppends = true;
95
149
  }
96
- if (data.sessionId) {
97
- window.postMessage({ type: 'UserSessionID', session: data.sessionId, userid: data.userId }, window.location.href);
98
- window.postMessage({ type: 'WidgetNotification', data: {
99
- type: 'success',
100
- message: translate('successMessage', this.lang)
150
+ // end custom styling area
151
+ }
152
+ disconnectedCallback() {
153
+ window.removeEventListener('LoginCredentials', this.autofillCredentialsHandler);
154
+ }
155
+ sendErrorNotification(errorMessage) {
156
+ window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
157
+ window.postMessage({ type: 'WidgetNotification', data: {
158
+ type: 'error',
159
+ message: errorMessage
101
160
  } }, window.location.href);
102
- this.hasError = false;
103
- }
104
- else {
105
- // handles errors thrown by api
106
- this.hasError = true;
107
- this.errorCode = (_b = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _b === void 0 ? void 0 : _b.errorCode;
108
- this.errorMessage = translate(`${this.errorCode}`, this.lang) || ((_c = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _c === void 0 ? void 0 : _c.message) || translate('genericError', this.lang);
109
- if (this.errorMessage) {
110
- console.error(this.errorMessage);
111
- this.sendErrorNotification(this.errorMessage);
112
- }
113
- }
114
- }).catch((err) => {
115
- // handles unexpected errors
116
- console.error(err);
117
- this.hasError = true;
118
- this.errorMessage = translate('genericError', this.lang);
119
- this.sendErrorNotification(this.errorMessage);
120
- });
121
- };
122
- this.debouncedUserLogin = this.debounce(this.userLogin, 850);
123
- this.handleLogin = () => {
124
- this.debouncedUserLogin({
125
- username: this.userNameEmail,
126
- password: this.userPassword
127
- });
128
- this.dispatchUpdateLoginCredentialsEvent();
129
- };
130
- this.handleInputChange = (event, location) => {
131
- this.hasError = false;
132
- const inputValue = event.target.value;
133
- if (location === 'user') {
134
- this.userNameEmail = inputValue;
135
- this.isValidUserEmail = this.userEmailValidation(this.userNameEmail);
136
- }
137
- else {
138
- this.userPassword = inputValue;
139
- this.isValidPassword = this.passwordValidation(inputValue);
140
- }
141
- };
142
- this.userEmailValidation = (input) => {
143
- const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
144
- return regex.test(input);
145
- };
146
- this.passwordValidation = (input) => {
147
- const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
148
- return regex.test(input);
149
- };
150
- this.togglePassword = () => {
151
- this.isPasswordVisible = !this.isPasswordVisible;
152
- };
153
- this.resetPassword = () => {
154
- window.postMessage({ type: "NavForgotPassword" }, window.location.href);
155
- };
156
- }
157
- handleNewTranslations() {
158
- getTranslations(this.translationUrl);
159
- }
160
- async componentWillLoad() {
161
- if (this.translationUrl.length > 2) {
162
- await getTranslations(this.translationUrl);
163
161
  }
164
- }
165
- componentDidLoad() {
166
- window.addEventListener('LoginCredentials', this.autofillCredentialsHandler);
167
- window.postMessage({ type: 'UserLoginDidLoad' });
168
- }
169
- componentDidRender() {
170
- // start custom styling area
171
- if (!this.limitStylingAppends && this.stylingContainer) {
172
- if (this.clientStyling)
173
- this.setClientStyling();
174
- if (this.clientStylingUrl)
175
- this.setClientStylingURL();
176
- this.limitStylingAppends = true;
162
+ debounce(func, delay) {
163
+ let timer;
164
+ return function (...args) {
165
+ clearTimeout(timer);
166
+ timer = setTimeout(() => {
167
+ func.apply(this, args);
168
+ }, delay);
169
+ };
177
170
  }
178
- // end custom styling area
179
- }
180
- disconnectedCallback() {
181
- window.removeEventListener('LoginCredentials', this.autofillCredentialsHandler);
182
- }
183
- sendErrorNotification(errorMessage) {
184
- window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
185
- window.postMessage({ type: 'WidgetNotification', data: {
186
- type: 'error',
187
- message: errorMessage
188
- } }, window.location.href);
189
- }
190
- debounce(func, delay) {
191
- let timer;
192
- return function (...args) {
193
- clearTimeout(timer);
194
- timer = setTimeout(() => {
195
- func.apply(this, args);
196
- }, delay);
197
- };
198
- }
199
- dispatchUpdateLoginCredentialsEvent() {
200
- if (!this.hasError) {
201
- this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
202
- bubbles: true,
203
- detail: {
204
- userNameEmail: this.userNameEmail,
205
- userPassword: this.userPassword
171
+ dispatchUpdateLoginCredentialsEvent() {
172
+ if (!this.hasError) {
173
+ this.updateLoginCredentialsEvent = new CustomEvent("UpdateLoginCredentials", {
174
+ bubbles: true,
175
+ detail: {
176
+ userNameEmail: this.userNameEmail,
177
+ userPassword: this.userPassword
178
+ }
179
+ });
180
+ window.dispatchEvent(this.updateLoginCredentialsEvent);
206
181
  }
207
- });
208
- window.dispatchEvent(this.updateLoginCredentialsEvent);
209
182
  }
210
- }
211
- ;
212
- render() {
213
- let visibilityIcon = h("span", { class: "InputIcon" },
214
- this.isPasswordVisible &&
215
- h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" },
216
- h("g", { transform: "translate(-110.856 -23.242)" },
217
- h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }),
218
- h("g", { transform: "translate(117.499 27.37)" },
219
- h("path", { class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }),
220
- h("path", { class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })),
221
- h("g", { transform: "translate(110.856 24.899)" },
222
- h("path", { class: "PasswordVisibilityIcon", d: "M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z", transform: "translate(-110.856 -33.157)" }),
223
- h("path", { class: "PasswordVisibilityIcon", d: "M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z", transform: "translate(-130.743 -29.617)" })),
224
- h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))),
225
- !this.isPasswordVisible &&
226
- h("svg", { onClick: () => this.togglePassword(), class: "TogglePasswordVisibility PasswordVisible", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.843", height: "10.5", viewBox: "0 0 18.843 10.5" },
227
- h("g", { transform: "translate(-14.185 -27.832)" },
228
- h("path", { class: "PasswordVisibilityIcon", d: "M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z", transform: "translate(0)" }),
229
- h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
230
- let userIdentification = h("div", { class: "FormBox" },
231
- h("div", { class: "FormValue" },
232
- h("div", { class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' },
233
- h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), required: true }),
234
- h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)),
235
- !this.isValidUserEmail &&
236
- h("p", { class: "InvalidField" }, translate('invalidField', this.lang))),
237
- h("div", { class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' },
238
- visibilityIcon,
239
- h("input", { type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: (event) => this.handleInputChange(event, 'password'), onInput: (event) => this.handleInputChange(event, 'password'), required: true }),
240
- h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang)),
241
- !this.isValidPassword &&
242
- h("p", { class: "InvalidField" }, translate('invalidField', this.lang))),
243
- this.passwordReset == 'true' &&
244
- h("div", { class: "ForgotPassword" },
245
- h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))),
246
- h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.handleLogin() }, translate('login', this.lang)),
247
- this.hasError &&
248
- h("p", { class: "CredentialsError" }, this.errorMessage)));
249
- return h("section", { ref: el => this.stylingContainer = el }, userIdentification);
250
- }
251
- static get is() { return "user-login"; }
252
- static get encapsulation() { return "shadow"; }
253
- static get originalStyleUrls() { return {
254
- "$": ["user-login.scss"]
255
- }; }
256
- static get styleUrls() { return {
257
- "$": ["user-login.css"]
258
- }; }
259
- static get properties() { return {
260
- "endpoint": {
261
- "type": "string",
262
- "mutable": false,
263
- "complexType": {
264
- "original": "string",
265
- "resolved": "string",
266
- "references": {}
267
- },
268
- "required": false,
269
- "optional": false,
270
- "docs": {
271
- "tags": [],
272
- "text": "Endpoint"
273
- },
274
- "attribute": "endpoint",
275
- "reflect": true,
276
- "defaultValue": "''"
277
- },
278
- "lang": {
279
- "type": "string",
280
- "mutable": true,
281
- "complexType": {
282
- "original": "string",
283
- "resolved": "string",
284
- "references": {}
285
- },
286
- "required": false,
287
- "optional": false,
288
- "docs": {
289
- "tags": [],
290
- "text": "Language"
291
- },
292
- "attribute": "lang",
293
- "reflect": true,
294
- "defaultValue": "'en'"
295
- },
296
- "clientStyling": {
297
- "type": "string",
298
- "mutable": false,
299
- "complexType": {
300
- "original": "string",
301
- "resolved": "string",
302
- "references": {}
303
- },
304
- "required": false,
305
- "optional": false,
306
- "docs": {
307
- "tags": [],
308
- "text": "Client styling"
309
- },
310
- "attribute": "client-styling",
311
- "reflect": true,
312
- "defaultValue": "''"
313
- },
314
- "clientStylingUrl": {
315
- "type": "string",
316
- "mutable": false,
317
- "complexType": {
318
- "original": "string",
319
- "resolved": "string",
320
- "references": {}
321
- },
322
- "required": false,
323
- "optional": false,
324
- "docs": {
325
- "tags": [],
326
- "text": "Client styling by url"
327
- },
328
- "attribute": "client-styling-url",
329
- "reflect": true,
330
- "defaultValue": "''"
331
- },
332
- "translationUrl": {
333
- "type": "string",
334
- "mutable": false,
335
- "complexType": {
336
- "original": "string",
337
- "resolved": "string",
338
- "references": {}
339
- },
340
- "required": false,
341
- "optional": false,
342
- "docs": {
343
- "tags": [],
344
- "text": "Translation url"
345
- },
346
- "attribute": "translation-url",
347
- "reflect": true,
348
- "defaultValue": "''"
349
- },
350
- "passwordReset": {
351
- "type": "string",
352
- "mutable": false,
353
- "complexType": {
354
- "original": "string",
355
- "resolved": "string",
356
- "references": {}
357
- },
358
- "required": false,
359
- "optional": false,
360
- "docs": {
361
- "tags": [],
362
- "text": "Password reset"
363
- },
364
- "attribute": "password-reset",
365
- "reflect": true,
366
- "defaultValue": "'false'"
367
- },
368
- "userEmailRegex": {
369
- "type": "string",
370
- "mutable": false,
371
- "complexType": {
372
- "original": "string",
373
- "resolved": "string",
374
- "references": {}
375
- },
376
- "required": false,
377
- "optional": false,
378
- "docs": {
379
- "tags": [],
380
- "text": "User email regex"
381
- },
382
- "attribute": "user-email-regex",
383
- "reflect": true
384
- },
385
- "userEmailRegexOptions": {
386
- "type": "string",
387
- "mutable": false,
388
- "complexType": {
389
- "original": "string",
390
- "resolved": "string",
391
- "references": {}
392
- },
393
- "required": false,
394
- "optional": false,
395
- "docs": {
396
- "tags": [],
397
- "text": "User email regex options"
398
- },
399
- "attribute": "user-email-regex-options",
400
- "reflect": true,
401
- "defaultValue": "'i'"
402
- },
403
- "passwordRegex": {
404
- "type": "string",
405
- "mutable": false,
406
- "complexType": {
407
- "original": "string",
408
- "resolved": "string",
409
- "references": {}
410
- },
411
- "required": false,
412
- "optional": false,
413
- "docs": {
414
- "tags": [],
415
- "text": "Password regex"
416
- },
417
- "attribute": "password-regex",
418
- "reflect": true
419
- },
420
- "passwordRegexOptions": {
421
- "type": "string",
422
- "mutable": false,
423
- "complexType": {
424
- "original": "string",
425
- "resolved": "string",
426
- "references": {}
427
- },
428
- "required": false,
429
- "optional": false,
430
- "docs": {
431
- "tags": [],
432
- "text": "Password regex options"
433
- },
434
- "attribute": "password-regex-options",
435
- "reflect": true,
436
- "defaultValue": "''"
183
+ ;
184
+ render() {
185
+ let visibilityIcon = h("span", { key: '4ccb9d4b1c8209e22320c3667101b9e435d1b604', class: "InputIcon" }, this.isPasswordVisible &&
186
+ h("svg", { key: 'fd168b4ec7ed18213aef15d5c7bcb89183b5626d', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.844", height: "12.887", viewBox: "0 0 18.844 12.887" }, h("g", { key: '3ab8953db8743082bb19d4f97ae6191724145a0e', transform: "translate(-110.856 -23.242)" }, h("circle", { key: '716eb0de02150f4d5791cb7cf1cf7e904de4e8b9', class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { key: '4ca623e6f31b09dbf6495fe657e9f6b67bfddbd8', transform: "translate(117.499 27.37)" }, h("path", { key: '0377c51b5536b07d0cefb77ed82d714fc82b5d9e', class: "PasswordVisibilityIcon", d: "M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z", transform: "translate(-142.164 -39.123)" }), h("path", { key: '3ee2f6849511a3ce18ccfcaea0b503f1b9e57329', class: "PasswordVisibilityIcon", d: "M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z", transform: "translate(-136.413 -42.068)" })), h("g", { key: '24fab8dc6f6ef08ef1a36227156b768925a2a7ba', transform: "translate(110.856 24.899)" }, h("path", { key: 'b41b45065b8f55772bbdfbced34ef4d7736c133a', class: "PasswordVisibilityIcon", d: "M122.538,42.061a7.043,7.043,0,0,1-2.325.53,10.373,10.373,0,0,1-4.393-1.482,36.509,36.509,0,0,1-3.873-2.391.13.13,0,0,1,0-.208,44.141,44.141,0,0,1,3.873-2.651c.394-.233.768-.437,1.13-.622l-.686-.838c-.322.167-.651.347-.99.55a37.989,37.989,0,0,0-3.977,2.729,1.21,1.21,0,0,0-.442.962,1.1,1.1,0,0,0,.494.936,34.416,34.416,0,0,0,3.977,2.469,11.468,11.468,0,0,0,4.886,1.611,8.427,8.427,0,0,0,3.039-.725Z", transform: "translate(-110.856 -33.157)" }), h("path", { key: '39f77d5f4028baf654fdc07a2f03525b994d508f', class: "PasswordVisibilityIcon", d: "M149.119,34.14a45.875,45.875,0,0,0-4.055-2.729,20.541,20.541,0,0,0-2.547-1.248,5.6,5.6,0,0,0-4.79-.017l.7.856a5.254,5.254,0,0,1,1.672-.346,10.072,10.072,0,0,1,4.445,1.663,34.132,34.132,0,0,1,3.925,2.651.13.13,0,0,1,0,.208,40.2,40.2,0,0,1-3.925,2.391c-.179.092-.352.176-.525.26l.684.835c.1-.054.2-.1.309-.159a36.356,36.356,0,0,0,4.055-2.469,1.067,1.067,0,0,0,.52-.936A1.159,1.159,0,0,0,149.119,34.14Z", transform: "translate(-130.743 -29.617)" })), h("rect", { key: '74bdc0477190de8bd67e30e0799ed1d4c255fff0', class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
187
+ h("svg", { key: '89e71e7d5fc2af237c7a0af69838a60f997dc0ee', onClick: () => this.togglePassword(), class: "TogglePasswordVisibility PasswordVisible", part: "TogglePasswordVisibility", xmlns: "http://www.w3.org/2000/svg", width: "18.843", height: "10.5", viewBox: "0 0 18.843 10.5" }, h("g", { key: '97447b59b0e079f3b2a154681aef2cef572e445b', transform: "translate(-14.185 -27.832)" }, h("path", { key: 'c35b80be71460f5fc0c469ee807e3f83f5ab1cb9', class: "PasswordVisibilityIcon", d: "M23.541,38.332a11.467,11.467,0,0,1-4.886-1.611,34.413,34.413,0,0,1-3.976-2.469,1.1,1.1,0,0,1-.494-.936,1.21,1.21,0,0,1,.442-.962A37.986,37.986,0,0,1,18.6,29.625a16.06,16.06,0,0,1,2.521-1.248,6.862,6.862,0,0,1,2.417-.546,6.862,6.862,0,0,1,2.417.546,20.541,20.541,0,0,1,2.547,1.248,45.872,45.872,0,0,1,4.054,2.729,1.159,1.159,0,0,1,.468.962,1.067,1.067,0,0,1-.52.936,36.353,36.353,0,0,1-4.054,2.469A11.2,11.2,0,0,1,23.541,38.332Zm0-9.46a9.813,9.813,0,0,0-4.392,1.663,44.138,44.138,0,0,0-3.873,2.651.13.13,0,0,0,0,.208,36.5,36.5,0,0,0,3.873,2.391,10.372,10.372,0,0,0,4.392,1.481,11.051,11.051,0,0,0,4.444-1.481,40.2,40.2,0,0,0,3.925-2.391.13.13,0,0,0,0-.208h0a34.132,34.132,0,0,0-3.925-2.651A10.072,10.072,0,0,0,23.541,28.872Z", transform: "translate(0)" }), h("circle", { key: '3a6bfc9d02b7c66ecd0e07481e1963a6bcab3fb0', class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
188
+ let userIdentification = h("div", { key: '5b43adf706d46ce330b81e0bc5e8bbd1bfc2b883', class: "FormBox" }, h("div", { key: '0c53a0428fbcb10876e16d0505cf895c5bffa3bd', class: "FormValue" }, h("div", { key: '8aeda926da67db1e58595287f15d815e7887dc45', class: (!this.isValidUserEmail || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { key: 'bf82f8b419fe217143d3928262b9b256e43a9f79', type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), autocapitalize: "none", required: true }), h("label", { key: '7a0f71f2c013c8d00d0d7c66452e09badfd17bb3', class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || this.hasError ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
189
+ h("p", { key: 'ed3453e628b9d60f8df2c3c1e04024706c532bfd', class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { key: 'c778082662a1f29bdb6b19799c702ce3b4773a0a', class: (!this.isValidPassword || this.hasError) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, h("input", { key: '7cbdd79f39f986efc4cfadf0577782c86af8eec9', type: this.isPasswordVisible ? "text" : "password", placeholder: '', value: this.userPassword, onFocus: (event) => this.handleInputChange(event, 'password'), onInput: (event) => this.handleInputChange(event, 'password'), autocapitalize: "none", required: true }), h("label", { key: '94d576059031cb459757f417245a241a768137fe', class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || this.hasError ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
190
+ h("p", { key: '9c961763ac1a5c3af53d63b4b4423f22d341f2a4', class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
191
+ h("div", { key: '9f0730d9d3000def2d5b0edb2fcef7c2b77633cf', class: "ForgotPassword" }, h("button", { key: '3bd5379cf60cba95c1338968c451366264bec081', onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), h("button", { key: '7a5ac0291a075d7c4f1a1f235dc6be2ccfa2239e', disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.handleLogin() }, translate('login', this.lang)), this.hasError &&
192
+ h("p", { key: 'f40b7b875d615bb6af19dac753910763638409a8', class: "CredentialsError" }, this.errorMessage)));
193
+ return h("section", { key: '6c0b3e43c5fdd9993a02f11b9bfa817b2a5069f2', ref: el => this.stylingContainer = el }, userIdentification);
194
+ }
195
+ static get is() { return "user-login"; }
196
+ static get encapsulation() { return "shadow"; }
197
+ static get originalStyleUrls() {
198
+ return {
199
+ "$": ["user-login.scss"]
200
+ };
201
+ }
202
+ static get styleUrls() {
203
+ return {
204
+ "$": ["user-login.css"]
205
+ };
206
+ }
207
+ static get properties() {
208
+ return {
209
+ "endpoint": {
210
+ "type": "string",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "string",
214
+ "resolved": "string",
215
+ "references": {}
216
+ },
217
+ "required": false,
218
+ "optional": false,
219
+ "docs": {
220
+ "tags": [],
221
+ "text": "Endpoint"
222
+ },
223
+ "attribute": "endpoint",
224
+ "reflect": true,
225
+ "defaultValue": "''"
226
+ },
227
+ "lang": {
228
+ "type": "string",
229
+ "mutable": true,
230
+ "complexType": {
231
+ "original": "string",
232
+ "resolved": "string",
233
+ "references": {}
234
+ },
235
+ "required": false,
236
+ "optional": false,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": "Language"
240
+ },
241
+ "attribute": "lang",
242
+ "reflect": true,
243
+ "defaultValue": "'en'"
244
+ },
245
+ "clientStyling": {
246
+ "type": "string",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "string",
250
+ "resolved": "string",
251
+ "references": {}
252
+ },
253
+ "required": false,
254
+ "optional": false,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": "Client styling"
258
+ },
259
+ "attribute": "client-styling",
260
+ "reflect": true,
261
+ "defaultValue": "''"
262
+ },
263
+ "clientStylingUrl": {
264
+ "type": "string",
265
+ "mutable": false,
266
+ "complexType": {
267
+ "original": "string",
268
+ "resolved": "string",
269
+ "references": {}
270
+ },
271
+ "required": false,
272
+ "optional": false,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "Client styling by url"
276
+ },
277
+ "attribute": "client-styling-url",
278
+ "reflect": true,
279
+ "defaultValue": "''"
280
+ },
281
+ "translationUrl": {
282
+ "type": "string",
283
+ "mutable": false,
284
+ "complexType": {
285
+ "original": "string",
286
+ "resolved": "string",
287
+ "references": {}
288
+ },
289
+ "required": false,
290
+ "optional": false,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "Translation url"
294
+ },
295
+ "attribute": "translation-url",
296
+ "reflect": true,
297
+ "defaultValue": "''"
298
+ },
299
+ "passwordReset": {
300
+ "type": "string",
301
+ "mutable": false,
302
+ "complexType": {
303
+ "original": "string",
304
+ "resolved": "string",
305
+ "references": {}
306
+ },
307
+ "required": false,
308
+ "optional": false,
309
+ "docs": {
310
+ "tags": [],
311
+ "text": "Password reset"
312
+ },
313
+ "attribute": "password-reset",
314
+ "reflect": true,
315
+ "defaultValue": "'false'"
316
+ },
317
+ "userEmailRegex": {
318
+ "type": "string",
319
+ "mutable": false,
320
+ "complexType": {
321
+ "original": "string",
322
+ "resolved": "string",
323
+ "references": {}
324
+ },
325
+ "required": false,
326
+ "optional": false,
327
+ "docs": {
328
+ "tags": [],
329
+ "text": "User email regex"
330
+ },
331
+ "attribute": "user-email-regex",
332
+ "reflect": true
333
+ },
334
+ "userEmailRegexOptions": {
335
+ "type": "string",
336
+ "mutable": false,
337
+ "complexType": {
338
+ "original": "string",
339
+ "resolved": "string",
340
+ "references": {}
341
+ },
342
+ "required": false,
343
+ "optional": false,
344
+ "docs": {
345
+ "tags": [],
346
+ "text": "User email regex options"
347
+ },
348
+ "attribute": "user-email-regex-options",
349
+ "reflect": true,
350
+ "defaultValue": "'i'"
351
+ },
352
+ "passwordRegex": {
353
+ "type": "string",
354
+ "mutable": false,
355
+ "complexType": {
356
+ "original": "string",
357
+ "resolved": "string",
358
+ "references": {}
359
+ },
360
+ "required": false,
361
+ "optional": false,
362
+ "docs": {
363
+ "tags": [],
364
+ "text": "Password regex"
365
+ },
366
+ "attribute": "password-regex",
367
+ "reflect": true
368
+ },
369
+ "passwordRegexOptions": {
370
+ "type": "string",
371
+ "mutable": false,
372
+ "complexType": {
373
+ "original": "string",
374
+ "resolved": "string",
375
+ "references": {}
376
+ },
377
+ "required": false,
378
+ "optional": false,
379
+ "docs": {
380
+ "tags": [],
381
+ "text": "Password regex options"
382
+ },
383
+ "attribute": "password-regex-options",
384
+ "reflect": true,
385
+ "defaultValue": "''"
386
+ }
387
+ };
388
+ }
389
+ static get states() {
390
+ return {
391
+ "userNameEmail": {},
392
+ "userPassword": {},
393
+ "isValidUserEmail": {},
394
+ "isValidPassword": {},
395
+ "isPasswordVisible": {},
396
+ "limitStylingAppends": {},
397
+ "errorMessage": {},
398
+ "hasError": {}
399
+ };
400
+ }
401
+ static get watchers() {
402
+ return [{
403
+ "propName": "translationUrl",
404
+ "methodName": "handleNewTranslations"
405
+ }];
437
406
  }
438
- }; }
439
- static get states() { return {
440
- "userNameEmail": {},
441
- "userPassword": {},
442
- "isValidUserEmail": {},
443
- "isValidPassword": {},
444
- "isPasswordVisible": {},
445
- "limitStylingAppends": {},
446
- "errorMessage": {},
447
- "hasError": {}
448
- }; }
449
- static get watchers() { return [{
450
- "propName": "translationUrl",
451
- "methodName": "handleNewTranslations"
452
- }]; }
453
407
  }