@everymatrix/user-login 1.13.16 → 1.15.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.
- package/dist/cjs/{index-59191539.js → index-fe0c4e58.js} +0 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/user-login.cjs.entry.js +24 -14
- package/dist/cjs/user-login.cjs.js +2 -2
- package/dist/collection/components/user-login/user-login.js +66 -20
- package/dist/components/user-login.js +26 -14
- package/dist/esm/{index-58908c9a.js → index-eac3e5db.js} +0 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/user-login.entry.js +24 -14
- package/dist/esm/user-login.js +2 -2
- package/dist/types/components/user-login/user-login.d.ts +12 -4
- package/dist/types/components.d.ts +24 -8
- package/dist/user-login/p-09aa993f.entry.js +1 -0
- package/dist/user-login/{p-5c2c28b2.js → p-0c865c25.js} +1 -1
- package/dist/user-login/user-login.esm.js +1 -1
- package/package.json +3 -3
- package/dist/user-login/p-cd262cc8.entry.js +0 -1
- /package/dist/types/Users/{user/workspace/everymatrix → adrian.pripon/Documents/Work}/widgets-stencil/packages/user-login/.stencil/packages/user-login/stencil.config.d.ts +0 -0
|
@@ -768,11 +768,6 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
768
768
|
const parsePropertyValue = (propValue, propType) => {
|
|
769
769
|
// ensure this value is of the correct prop type
|
|
770
770
|
if (propValue != null && !isComplexType(propValue)) {
|
|
771
|
-
if (propType & 4 /* Boolean */) {
|
|
772
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
773
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
774
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
775
|
-
}
|
|
776
771
|
if (propType & 1 /* String */) {
|
|
777
772
|
// could have been passed as a number or boolean
|
|
778
773
|
// but we still want it as a string
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-fe0c4e58.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[
|
|
17
|
+
return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"isValidPassword":[32],"isPasswordVisible":[32],"limitStylingAppends":[32],"errorMessage":[32],"checkValid":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-fe0c4e58.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de'];
|
|
@@ -96,17 +96,25 @@ const UserLogin = class {
|
|
|
96
96
|
*/
|
|
97
97
|
this.translationUrl = '';
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Password reset
|
|
100
100
|
*/
|
|
101
|
-
this.passwordReset = false;
|
|
101
|
+
this.passwordReset = 'false';
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* User email regex
|
|
104
104
|
*/
|
|
105
105
|
this.userEmailRegex = '^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})$';
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* User email regex options
|
|
108
|
+
*/
|
|
109
|
+
this.userEmailRegexOptions = 'i';
|
|
110
|
+
/**
|
|
111
|
+
* Password regex
|
|
108
112
|
*/
|
|
109
113
|
this.passwordRegex = '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\w\\s]).{8,20}$';
|
|
114
|
+
/**
|
|
115
|
+
* Password regex options
|
|
116
|
+
*/
|
|
117
|
+
this.passwordRegexOptions = '';
|
|
110
118
|
/**
|
|
111
119
|
* Username
|
|
112
120
|
*/
|
|
@@ -144,15 +152,17 @@ const UserLogin = class {
|
|
|
144
152
|
this.isFormValid(this.errorMessage = '');
|
|
145
153
|
}
|
|
146
154
|
else {
|
|
147
|
-
|
|
148
|
-
this.errorMessage = error;
|
|
155
|
+
this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
|
|
149
156
|
this.isFormValid(this.errorMessage);
|
|
150
|
-
window.postMessage({ type: "HasError", error }, window.location.href);
|
|
157
|
+
window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
|
|
151
158
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
152
159
|
type: 'error',
|
|
153
|
-
message:
|
|
160
|
+
message: this.errorMessage
|
|
154
161
|
} }, window.location.href);
|
|
155
162
|
}
|
|
163
|
+
}).catch((err) => {
|
|
164
|
+
this.errorMessage = err;
|
|
165
|
+
console.log('Error', err);
|
|
156
166
|
});
|
|
157
167
|
};
|
|
158
168
|
this.isFormValid = (error) => {
|
|
@@ -186,11 +196,11 @@ const UserLogin = class {
|
|
|
186
196
|
}
|
|
187
197
|
};
|
|
188
198
|
this.userEmailValidation = (input) => {
|
|
189
|
-
const regex = new RegExp(this.userEmailRegex,
|
|
199
|
+
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
190
200
|
return regex.test(input);
|
|
191
201
|
};
|
|
192
202
|
this.passwordValidation = (input) => {
|
|
193
|
-
const regex = new RegExp(this.passwordRegex,
|
|
203
|
+
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
194
204
|
return regex.test(input);
|
|
195
205
|
};
|
|
196
206
|
this.togglePassword = () => {
|
|
@@ -223,12 +233,12 @@ const UserLogin = class {
|
|
|
223
233
|
let visibilityIcon = index.h("span", { class: "InputIcon" }, this.isPasswordVisible &&
|
|
224
234
|
index.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" }, index.h("g", { transform: "translate(-110.856 -23.242)" }, index.h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), index.h("g", { transform: "translate(117.499 27.37)" }, index.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)" }), index.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)" })), index.h("g", { transform: "translate(110.856 24.899)" }, index.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)" }), index.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)" })), index.h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
225
235
|
index.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" }, index.h("g", { transform: "translate(-14.185 -27.832)" }, index.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)" }), index.h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
226
|
-
let userIdentification = index.h("div", { class: "FormBox"
|
|
236
|
+
let userIdentification = index.h("div", { class: "FormBox" }, index.h("div", { class: "FormValue" }, index.h("div", { class: (!this.isValidUserEmail || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' }, index.h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), required: true }), index.h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || !this.checkValid ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
227
237
|
index.h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), index.h("div", { class: (!this.isValidPassword || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, index.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 }), index.h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || !this.checkValid ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
|
|
228
|
-
index.h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset &&
|
|
238
|
+
index.h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
229
239
|
index.h("div", { class: "ForgotPassword" }, index.h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), index.h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.userLogin({ username: this.userNameEmail, password: this.userPassword }) }, translate('login', this.lang)), this.errorMessage &&
|
|
230
240
|
index.h("p", { class: "CredentialsError" }, this.errorMessage)));
|
|
231
|
-
return index.h("section",
|
|
241
|
+
return index.h("section", { ref: el => this.stylingContainer = el }, userIdentification);
|
|
232
242
|
}
|
|
233
243
|
static get watchers() { return {
|
|
234
244
|
"translationUrl": ["handleNewTranslations"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-fe0c4e58.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[
|
|
18
|
+
return index.bootstrapLazy([["user-login.cjs",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"isValidPassword":[32],"isPasswordVisible":[32],"limitStylingAppends":[32],"errorMessage":[32],"checkValid":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -23,17 +23,25 @@ export class UserLogin {
|
|
|
23
23
|
*/
|
|
24
24
|
this.translationUrl = '';
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Password reset
|
|
27
27
|
*/
|
|
28
|
-
this.passwordReset = false;
|
|
28
|
+
this.passwordReset = 'false';
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* User email regex
|
|
31
31
|
*/
|
|
32
32
|
this.userEmailRegex = '^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})$';
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* User email regex options
|
|
35
|
+
*/
|
|
36
|
+
this.userEmailRegexOptions = 'i';
|
|
37
|
+
/**
|
|
38
|
+
* Password regex
|
|
35
39
|
*/
|
|
36
40
|
this.passwordRegex = '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\w\\s]).{8,20}$';
|
|
41
|
+
/**
|
|
42
|
+
* Password regex options
|
|
43
|
+
*/
|
|
44
|
+
this.passwordRegexOptions = '';
|
|
37
45
|
/**
|
|
38
46
|
* Username
|
|
39
47
|
*/
|
|
@@ -71,15 +79,17 @@ export class UserLogin {
|
|
|
71
79
|
this.isFormValid(this.errorMessage = '');
|
|
72
80
|
}
|
|
73
81
|
else {
|
|
74
|
-
|
|
75
|
-
this.errorMessage = error;
|
|
82
|
+
this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
|
|
76
83
|
this.isFormValid(this.errorMessage);
|
|
77
|
-
window.postMessage({ type: "HasError", error }, window.location.href);
|
|
84
|
+
window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
|
|
78
85
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
79
86
|
type: 'error',
|
|
80
|
-
message:
|
|
87
|
+
message: this.errorMessage
|
|
81
88
|
} }, window.location.href);
|
|
82
89
|
}
|
|
90
|
+
}).catch((err) => {
|
|
91
|
+
this.errorMessage = err;
|
|
92
|
+
console.log('Error', err);
|
|
83
93
|
});
|
|
84
94
|
};
|
|
85
95
|
this.isFormValid = (error) => {
|
|
@@ -113,11 +123,11 @@ export class UserLogin {
|
|
|
113
123
|
}
|
|
114
124
|
};
|
|
115
125
|
this.userEmailValidation = (input) => {
|
|
116
|
-
const regex = new RegExp(this.userEmailRegex,
|
|
126
|
+
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
117
127
|
return regex.test(input);
|
|
118
128
|
};
|
|
119
129
|
this.passwordValidation = (input) => {
|
|
120
|
-
const regex = new RegExp(this.passwordRegex,
|
|
130
|
+
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
121
131
|
return regex.test(input);
|
|
122
132
|
};
|
|
123
133
|
this.togglePassword = () => {
|
|
@@ -164,7 +174,7 @@ export class UserLogin {
|
|
|
164
174
|
h("g", { transform: "translate(-14.185 -27.832)" },
|
|
165
175
|
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)" }),
|
|
166
176
|
h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
167
|
-
let userIdentification = h("div", { class: "FormBox"
|
|
177
|
+
let userIdentification = h("div", { class: "FormBox" },
|
|
168
178
|
h("div", { class: "FormValue" },
|
|
169
179
|
h("div", { class: (!this.isValidUserEmail || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' },
|
|
170
180
|
h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), required: true }),
|
|
@@ -177,13 +187,13 @@ export class UserLogin {
|
|
|
177
187
|
h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || !this.checkValid ? 'FieldInvalid' : '') }, translate('password', this.lang)),
|
|
178
188
|
!this.isValidPassword &&
|
|
179
189
|
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))),
|
|
180
|
-
this.passwordReset &&
|
|
190
|
+
this.passwordReset == 'true' &&
|
|
181
191
|
h("div", { class: "ForgotPassword" },
|
|
182
192
|
h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))),
|
|
183
193
|
h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.userLogin({ username: this.userNameEmail, password: this.userPassword }) }, translate('login', this.lang)),
|
|
184
194
|
this.errorMessage &&
|
|
185
195
|
h("p", { class: "CredentialsError" }, this.errorMessage)));
|
|
186
|
-
return h("section",
|
|
196
|
+
return h("section", { ref: el => this.stylingContainer = el }, userIdentification);
|
|
187
197
|
}
|
|
188
198
|
static get is() { return "user-login"; }
|
|
189
199
|
static get encapsulation() { return "shadow"; }
|
|
@@ -285,22 +295,22 @@ export class UserLogin {
|
|
|
285
295
|
"defaultValue": "''"
|
|
286
296
|
},
|
|
287
297
|
"passwordReset": {
|
|
288
|
-
"type": "
|
|
298
|
+
"type": "string",
|
|
289
299
|
"mutable": false,
|
|
290
300
|
"complexType": {
|
|
291
|
-
"original": "
|
|
292
|
-
"resolved": "
|
|
301
|
+
"original": "string",
|
|
302
|
+
"resolved": "string",
|
|
293
303
|
"references": {}
|
|
294
304
|
},
|
|
295
305
|
"required": false,
|
|
296
306
|
"optional": false,
|
|
297
307
|
"docs": {
|
|
298
308
|
"tags": [],
|
|
299
|
-
"text": "
|
|
309
|
+
"text": "Password reset"
|
|
300
310
|
},
|
|
301
311
|
"attribute": "password-reset",
|
|
302
312
|
"reflect": true,
|
|
303
|
-
"defaultValue": "false"
|
|
313
|
+
"defaultValue": "'false'"
|
|
304
314
|
},
|
|
305
315
|
"userEmailRegex": {
|
|
306
316
|
"type": "string",
|
|
@@ -314,12 +324,30 @@ export class UserLogin {
|
|
|
314
324
|
"optional": false,
|
|
315
325
|
"docs": {
|
|
316
326
|
"tags": [],
|
|
317
|
-
"text": "
|
|
327
|
+
"text": "User email regex"
|
|
318
328
|
},
|
|
319
329
|
"attribute": "user-email-regex",
|
|
320
330
|
"reflect": true,
|
|
321
331
|
"defaultValue": "'^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4})$'"
|
|
322
332
|
},
|
|
333
|
+
"userEmailRegexOptions": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"mutable": false,
|
|
336
|
+
"complexType": {
|
|
337
|
+
"original": "string",
|
|
338
|
+
"resolved": "string",
|
|
339
|
+
"references": {}
|
|
340
|
+
},
|
|
341
|
+
"required": false,
|
|
342
|
+
"optional": false,
|
|
343
|
+
"docs": {
|
|
344
|
+
"tags": [],
|
|
345
|
+
"text": "User email regex options"
|
|
346
|
+
},
|
|
347
|
+
"attribute": "user-email-regex-options",
|
|
348
|
+
"reflect": true,
|
|
349
|
+
"defaultValue": "'i'"
|
|
350
|
+
},
|
|
323
351
|
"passwordRegex": {
|
|
324
352
|
"type": "string",
|
|
325
353
|
"mutable": false,
|
|
@@ -332,11 +360,29 @@ export class UserLogin {
|
|
|
332
360
|
"optional": false,
|
|
333
361
|
"docs": {
|
|
334
362
|
"tags": [],
|
|
335
|
-
"text": "
|
|
363
|
+
"text": "Password regex"
|
|
336
364
|
},
|
|
337
365
|
"attribute": "password-regex",
|
|
338
366
|
"reflect": true,
|
|
339
367
|
"defaultValue": "'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\\\w\\\\s]).{8,20}$'"
|
|
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": "''"
|
|
340
386
|
}
|
|
341
387
|
}; }
|
|
342
388
|
static get states() { return {
|
|
@@ -94,17 +94,25 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
94
94
|
*/
|
|
95
95
|
this.translationUrl = '';
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* Password reset
|
|
98
98
|
*/
|
|
99
|
-
this.passwordReset = false;
|
|
99
|
+
this.passwordReset = 'false';
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* User email regex
|
|
102
102
|
*/
|
|
103
103
|
this.userEmailRegex = '^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})$';
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* User email regex options
|
|
106
|
+
*/
|
|
107
|
+
this.userEmailRegexOptions = 'i';
|
|
108
|
+
/**
|
|
109
|
+
* Password regex
|
|
106
110
|
*/
|
|
107
111
|
this.passwordRegex = '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\w\\s]).{8,20}$';
|
|
112
|
+
/**
|
|
113
|
+
* Password regex options
|
|
114
|
+
*/
|
|
115
|
+
this.passwordRegexOptions = '';
|
|
108
116
|
/**
|
|
109
117
|
* Username
|
|
110
118
|
*/
|
|
@@ -142,15 +150,17 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
142
150
|
this.isFormValid(this.errorMessage = '');
|
|
143
151
|
}
|
|
144
152
|
else {
|
|
145
|
-
|
|
146
|
-
this.errorMessage = error;
|
|
153
|
+
this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
|
|
147
154
|
this.isFormValid(this.errorMessage);
|
|
148
|
-
window.postMessage({ type: "HasError", error }, window.location.href);
|
|
155
|
+
window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
|
|
149
156
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
150
157
|
type: 'error',
|
|
151
|
-
message:
|
|
158
|
+
message: this.errorMessage
|
|
152
159
|
} }, window.location.href);
|
|
153
160
|
}
|
|
161
|
+
}).catch((err) => {
|
|
162
|
+
this.errorMessage = err;
|
|
163
|
+
console.log('Error', err);
|
|
154
164
|
});
|
|
155
165
|
};
|
|
156
166
|
this.isFormValid = (error) => {
|
|
@@ -184,11 +194,11 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
184
194
|
}
|
|
185
195
|
};
|
|
186
196
|
this.userEmailValidation = (input) => {
|
|
187
|
-
const regex = new RegExp(this.userEmailRegex,
|
|
197
|
+
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
188
198
|
return regex.test(input);
|
|
189
199
|
};
|
|
190
200
|
this.passwordValidation = (input) => {
|
|
191
|
-
const regex = new RegExp(this.passwordRegex,
|
|
201
|
+
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
192
202
|
return regex.test(input);
|
|
193
203
|
};
|
|
194
204
|
this.togglePassword = () => {
|
|
@@ -221,12 +231,12 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
221
231
|
let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
|
|
222
232
|
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" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, 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)" }), 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)" })), h("g", { transform: "translate(110.856 24.899)" }, 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)" }), 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)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
223
233
|
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" }, h("g", { transform: "translate(-14.185 -27.832)" }, 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)" }), h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
224
|
-
let userIdentification = h("div", { class: "FormBox"
|
|
234
|
+
let userIdentification = h("div", { class: "FormBox" }, h("div", { class: "FormValue" }, h("div", { class: (!this.isValidUserEmail || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || !this.checkValid ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
225
235
|
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { class: (!this.isValidPassword || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, 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 }), h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || !this.checkValid ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
|
|
226
|
-
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset &&
|
|
236
|
+
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
227
237
|
h("div", { class: "ForgotPassword" }, h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.userLogin({ username: this.userNameEmail, password: this.userPassword }) }, translate('login', this.lang)), this.errorMessage &&
|
|
228
238
|
h("p", { class: "CredentialsError" }, this.errorMessage)));
|
|
229
|
-
return h("section",
|
|
239
|
+
return h("section", { ref: el => this.stylingContainer = el }, userIdentification);
|
|
230
240
|
}
|
|
231
241
|
static get watchers() { return {
|
|
232
242
|
"translationUrl": ["handleNewTranslations"]
|
|
@@ -238,9 +248,11 @@ const UserLogin$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
238
248
|
"clientStyling": [513, "client-styling"],
|
|
239
249
|
"clientStylingUrl": [513, "client-styling-url"],
|
|
240
250
|
"translationUrl": [513, "translation-url"],
|
|
241
|
-
"passwordReset": [
|
|
251
|
+
"passwordReset": [513, "password-reset"],
|
|
242
252
|
"userEmailRegex": [513, "user-email-regex"],
|
|
253
|
+
"userEmailRegexOptions": [513, "user-email-regex-options"],
|
|
243
254
|
"passwordRegex": [513, "password-regex"],
|
|
255
|
+
"passwordRegexOptions": [513, "password-regex-options"],
|
|
244
256
|
"userNameEmail": [32],
|
|
245
257
|
"userPassword": [32],
|
|
246
258
|
"isValidUserEmail": [32],
|
|
@@ -746,11 +746,6 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
746
746
|
const parsePropertyValue = (propValue, propType) => {
|
|
747
747
|
// ensure this value is of the correct prop type
|
|
748
748
|
if (propValue != null && !isComplexType(propValue)) {
|
|
749
|
-
if (propType & 4 /* Boolean */) {
|
|
750
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
751
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
752
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
753
|
-
}
|
|
754
749
|
if (propType & 1 /* String */) {
|
|
755
750
|
// could have been passed as a number or boolean
|
|
756
751
|
// but we still want it as a string
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-eac3e5db.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[
|
|
13
|
+
return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"isValidPassword":[32],"isPasswordVisible":[32],"limitStylingAppends":[32],"errorMessage":[32],"checkValid":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-eac3e5db.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de'];
|
|
@@ -92,17 +92,25 @@ const UserLogin = class {
|
|
|
92
92
|
*/
|
|
93
93
|
this.translationUrl = '';
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* Password reset
|
|
96
96
|
*/
|
|
97
|
-
this.passwordReset = false;
|
|
97
|
+
this.passwordReset = 'false';
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* User email regex
|
|
100
100
|
*/
|
|
101
101
|
this.userEmailRegex = '^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4})$';
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* User email regex options
|
|
104
|
+
*/
|
|
105
|
+
this.userEmailRegexOptions = 'i';
|
|
106
|
+
/**
|
|
107
|
+
* Password regex
|
|
104
108
|
*/
|
|
105
109
|
this.passwordRegex = '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\w\\s]).{8,20}$';
|
|
110
|
+
/**
|
|
111
|
+
* Password regex options
|
|
112
|
+
*/
|
|
113
|
+
this.passwordRegexOptions = '';
|
|
106
114
|
/**
|
|
107
115
|
* Username
|
|
108
116
|
*/
|
|
@@ -140,15 +148,17 @@ const UserLogin = class {
|
|
|
140
148
|
this.isFormValid(this.errorMessage = '');
|
|
141
149
|
}
|
|
142
150
|
else {
|
|
143
|
-
|
|
144
|
-
this.errorMessage = error;
|
|
151
|
+
this.errorMessage = (_a = data === null || data === void 0 ? void 0 : data.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message;
|
|
145
152
|
this.isFormValid(this.errorMessage);
|
|
146
|
-
window.postMessage({ type: "HasError", error }, window.location.href);
|
|
153
|
+
window.postMessage({ type: "HasError", error: this.errorMessage }, window.location.href);
|
|
147
154
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
148
155
|
type: 'error',
|
|
149
|
-
message:
|
|
156
|
+
message: this.errorMessage
|
|
150
157
|
} }, window.location.href);
|
|
151
158
|
}
|
|
159
|
+
}).catch((err) => {
|
|
160
|
+
this.errorMessage = err;
|
|
161
|
+
console.log('Error', err);
|
|
152
162
|
});
|
|
153
163
|
};
|
|
154
164
|
this.isFormValid = (error) => {
|
|
@@ -182,11 +192,11 @@ const UserLogin = class {
|
|
|
182
192
|
}
|
|
183
193
|
};
|
|
184
194
|
this.userEmailValidation = (input) => {
|
|
185
|
-
const regex = new RegExp(this.userEmailRegex,
|
|
195
|
+
const regex = new RegExp(this.userEmailRegex, this.userEmailRegexOptions);
|
|
186
196
|
return regex.test(input);
|
|
187
197
|
};
|
|
188
198
|
this.passwordValidation = (input) => {
|
|
189
|
-
const regex = new RegExp(this.passwordRegex,
|
|
199
|
+
const regex = new RegExp(this.passwordRegex, this.passwordRegexOptions);
|
|
190
200
|
return regex.test(input);
|
|
191
201
|
};
|
|
192
202
|
this.togglePassword = () => {
|
|
@@ -219,12 +229,12 @@ const UserLogin = class {
|
|
|
219
229
|
let visibilityIcon = h("span", { class: "InputIcon" }, this.isPasswordVisible &&
|
|
220
230
|
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" }, h("g", { transform: "translate(-110.856 -23.242)" }, h("circle", { class: "PasswordVisibilityIcon", cx: "0.05", cy: "0.05", r: "0.05", transform: "translate(121.017 31.148)" }), h("g", { transform: "translate(117.499 27.37)" }, 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)" }), 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)" })), h("g", { transform: "translate(110.856 24.899)" }, 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)" }), 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)" })), h("rect", { class: "PasswordVisibilityIcon", width: "0.972", height: "15.861", rx: "0.486", transform: "translate(114.827 23.858) rotate(-39.315)" }))), !this.isPasswordVisible &&
|
|
221
231
|
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" }, h("g", { transform: "translate(-14.185 -27.832)" }, 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)" }), h("circle", { class: "PasswordVisibilityIcon", cx: "2.779", cy: "2.779", r: "2.779", transform: "translate(20.827 30.303)" }))));
|
|
222
|
-
let userIdentification = h("div", { class: "FormBox"
|
|
232
|
+
let userIdentification = h("div", { class: "FormBox" }, h("div", { class: "FormValue" }, h("div", { class: (!this.isValidUserEmail || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' }, h("input", { type: "text", placeholder: '', value: this.userNameEmail, onFocus: (event) => this.handleInputChange(event, 'user'), onInput: (event) => this.handleInputChange(event, 'user'), required: true }), h("label", { class: (this.userNameEmail ? 'FieldFilledIn' : '') + ' ' + (!this.isValidUserEmail || !this.checkValid ? 'FieldInvalid' : '') }, translate('userEmail', this.lang)), !this.isValidUserEmail &&
|
|
223
233
|
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), h("div", { class: (!this.isValidPassword || !this.checkValid) ? 'InputBox InputInvalidBox' : 'InputBox' }, visibilityIcon, 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 }), h("label", { class: (this.userPassword ? 'FieldFilledIn' : '') + ' ' + (!this.isValidPassword || !this.checkValid ? 'FieldInvalid' : '') }, translate('password', this.lang)), !this.isValidPassword &&
|
|
224
|
-
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset &&
|
|
234
|
+
h("p", { class: "InvalidField" }, translate('invalidField', this.lang))), this.passwordReset == 'true' &&
|
|
225
235
|
h("div", { class: "ForgotPassword" }, h("button", { onClick: () => this.resetPassword() }, translate('forgotPassword', this.lang))), h("button", { disabled: (!this.isValidUserEmail || !this.isValidPassword || !this.userNameEmail || !this.userPassword), class: "SubmitCredentials", onClick: () => this.userLogin({ username: this.userNameEmail, password: this.userPassword }) }, translate('login', this.lang)), this.errorMessage &&
|
|
226
236
|
h("p", { class: "CredentialsError" }, this.errorMessage)));
|
|
227
|
-
return h("section",
|
|
237
|
+
return h("section", { ref: el => this.stylingContainer = el }, userIdentification);
|
|
228
238
|
}
|
|
229
239
|
static get watchers() { return {
|
|
230
240
|
"translationUrl": ["handleNewTranslations"]
|
package/dist/esm/user-login.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-eac3e5db.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[
|
|
16
|
+
return bootstrapLazy([["user-login",[[1,"user-login",{"endpoint":[513],"lang":[1537],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"passwordReset":[513,"password-reset"],"userEmailRegex":[513,"user-email-regex"],"userEmailRegexOptions":[513,"user-email-regex-options"],"passwordRegex":[513,"password-regex"],"passwordRegexOptions":[513,"password-regex-options"],"userNameEmail":[32],"userPassword":[32],"isValidUserEmail":[32],"isValidPassword":[32],"isPasswordVisible":[32],"limitStylingAppends":[32],"errorMessage":[32],"checkValid":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -20,17 +20,25 @@ export declare class UserLogin {
|
|
|
20
20
|
*/
|
|
21
21
|
translationUrl: string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Password reset
|
|
24
24
|
*/
|
|
25
|
-
passwordReset:
|
|
25
|
+
passwordReset: string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* User email regex
|
|
28
28
|
*/
|
|
29
29
|
userEmailRegex: string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* User email regex options
|
|
32
|
+
*/
|
|
33
|
+
userEmailRegexOptions: string;
|
|
34
|
+
/**
|
|
35
|
+
* Password regex
|
|
32
36
|
*/
|
|
33
37
|
passwordRegex: string;
|
|
38
|
+
/**
|
|
39
|
+
* Password regex options
|
|
40
|
+
*/
|
|
41
|
+
passwordRegexOptions: string;
|
|
34
42
|
/**
|
|
35
43
|
* Username
|
|
36
44
|
*/
|
|
@@ -24,21 +24,29 @@ export namespace Components {
|
|
|
24
24
|
*/
|
|
25
25
|
"lang": string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Password regex
|
|
28
28
|
*/
|
|
29
29
|
"passwordRegex": string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Password regex options
|
|
32
|
+
*/
|
|
33
|
+
"passwordRegexOptions": string;
|
|
34
|
+
/**
|
|
35
|
+
* Password reset
|
|
32
36
|
*/
|
|
33
|
-
"passwordReset":
|
|
37
|
+
"passwordReset": string;
|
|
34
38
|
/**
|
|
35
39
|
* Translation url
|
|
36
40
|
*/
|
|
37
41
|
"translationUrl": string;
|
|
38
42
|
/**
|
|
39
|
-
*
|
|
43
|
+
* User email regex
|
|
40
44
|
*/
|
|
41
45
|
"userEmailRegex": string;
|
|
46
|
+
/**
|
|
47
|
+
* User email regex options
|
|
48
|
+
*/
|
|
49
|
+
"userEmailRegexOptions": string;
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
declare global {
|
|
@@ -71,21 +79,29 @@ declare namespace LocalJSX {
|
|
|
71
79
|
*/
|
|
72
80
|
"lang"?: string;
|
|
73
81
|
/**
|
|
74
|
-
*
|
|
82
|
+
* Password regex
|
|
75
83
|
*/
|
|
76
84
|
"passwordRegex"?: string;
|
|
77
85
|
/**
|
|
78
|
-
*
|
|
86
|
+
* Password regex options
|
|
87
|
+
*/
|
|
88
|
+
"passwordRegexOptions"?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Password reset
|
|
79
91
|
*/
|
|
80
|
-
"passwordReset"?:
|
|
92
|
+
"passwordReset"?: string;
|
|
81
93
|
/**
|
|
82
94
|
* Translation url
|
|
83
95
|
*/
|
|
84
96
|
"translationUrl"?: string;
|
|
85
97
|
/**
|
|
86
|
-
*
|
|
98
|
+
* User email regex
|
|
87
99
|
*/
|
|
88
100
|
"userEmailRegex"?: string;
|
|
101
|
+
/**
|
|
102
|
+
* User email regex options
|
|
103
|
+
*/
|
|
104
|
+
"userEmailRegexOptions"?: string;
|
|
89
105
|
}
|
|
90
106
|
interface IntrinsicElements {
|
|
91
107
|
"user-login": UserLogin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,h as s}from"./p-0c865c25.js";const t=["ro","en","cz","de"],o={en:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"},ro:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"},fr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"},cs:{invalidField:"Ovo polje je nevažeće.",forgotPassword:"Zaboravio sam lozinku ",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava"},de:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"}},e=i=>new Promise((s=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((s=>{for(let t in i[s])o[s][t]=i[s][t]})),s(!0)}))})),r=(i,s,e)=>{const r=s;let n=o[void 0!==r&&t.includes(r)?r:"en"][i];if(void 0!==e)for(const[i,s]of Object.entries(e.values)){const t=new RegExp(`{${i}}`,"g");n=n.replace(t,s)}return n},n=class{constructor(s){i(this,s),this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset="false",this.userEmailRegex="^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4})$",this.userEmailRegexOptions="i",this.passwordRegex="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\w\\s]).{8,20}$",this.passwordRegexOptions="",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.isValidPassword=!0,this.isPasswordVisible=!1,this.limitStylingAppends=!1,this.errorMessage="",this.checkValid=!0,this.userLogin=async({username:i,password:s})=>{let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i,password:s})};fetch(`${this.endpoint}/player/legislation/login`,t).then((i=>i.json())).then((i=>{var s;i.sessionId?(window.postMessage({type:"UserSessionID",session:i.sessionID,userid:i.universalID},window.location.href),this.isFormValid(this.errorMessage="")):(this.errorMessage=null===(s=null==i?void 0:i.thirdPartyResponse)||void 0===s?void 0:s.message,this.isFormValid(this.errorMessage),window.postMessage({type:"HasError",error:this.errorMessage},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href))})).catch((i=>{this.errorMessage=i,console.log("Error",i)}))},this.isFormValid=i=>{this.checkValid=""===i},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.appendChild(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(i.href).then((i=>i.text())).then((i=>{s.innerHTML=i,setTimeout((()=>{this.stylingContainer.appendChild(s)}),1)}))},this.handleInputChange=(i,s)=>{this.checkValid=!0;const t=i.target.value;"user"===s?(this.userNameEmail=t,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=t,this.isValidPassword=this.passwordValidation(t))},this.userEmailValidation=i=>new RegExp(this.userEmailRegex,this.userEmailRegexOptions).test(i),this.passwordValidation=i=>new RegExp(this.passwordRegex,this.passwordRegexOptions).test(i),this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"ResetPassword"},window.location.href)}}handleNewTranslations(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let i=s("span",{class:"InputIcon"},this.isPasswordVisible&&s("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"},s("g",{transform:"translate(-110.856 -23.242)"},s("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),s("g",{transform:"translate(117.499 27.37)"},s("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),s("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),s("g",{transform:"translate(110.856 24.899)"},s("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)"}),s("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)"})),s("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&s("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"},s("g",{transform:"translate(-14.185 -27.832)"},s("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)"}),s("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),t=s("div",{class:"FormBox"},s("div",{class:"FormValue"},s("div",{class:this.isValidUserEmail&&this.checkValid?"InputBox":"InputBox InputInvalidBox"},s("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:i=>this.handleInputChange(i,"user"),onInput:i=>this.handleInputChange(i,"user"),required:!0}),s("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(this.isValidUserEmail&&this.checkValid?"":"FieldInvalid")},r("userEmail",this.lang)),!this.isValidUserEmail&&s("p",{class:"InvalidField"},r("invalidField",this.lang))),s("div",{class:this.isValidPassword&&this.checkValid?"InputBox":"InputBox InputInvalidBox"},i,s("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:i=>this.handleInputChange(i,"password"),onInput:i=>this.handleInputChange(i,"password"),required:!0}),s("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(this.isValidPassword&&this.checkValid?"":"FieldInvalid")},r("password",this.lang)),!this.isValidPassword&&s("p",{class:"InvalidField"},r("invalidField",this.lang))),"true"==this.passwordReset&&s("div",{class:"ForgotPassword"},s("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),s("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.userLogin({username:this.userNameEmail,password:this.userPassword})},r("login",this.lang)),this.errorMessage&&s("p",{class:"CredentialsError"},this.errorMessage)));return s("section",{ref:i=>this.stylingContainer=i},t)}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};n.style=':host{display:block;font-family:"Roboto", sans-serif}section{min-height:100vh;width:100%;background-position:center;background-size:cover}.FormBox{height:100vh;display:flex;position:relative;background:#082649;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:#fff;background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{n as user_login}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let e,t,n=!1,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},r={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=new WeakMap,a=e=>"sc-"+e.o,f={},h=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!h(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?p(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.h=r),c},p=(e,t)=>({t:0,$:e,i:t,p:null,h:null,u:null}),y={},d=(e,t,n,l,o,i)=>{if(n!==l){let c=V(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=w(n),o=w(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const s=h(l);if((c||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):V(s,u)?u.slice(2):u[2]+t.slice(3),n&&r.rel(e,t,n,!1),l&&r.ael(e,t,l,!1)}},m=/\s/,w=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.p.nodeType&&t.p.host?t.p.host:t.p,o=e&&e.u||f,r=t.u||f;for(l in o)l in r||d(s,l,o[l],void 0,n,t.t);for(l in r)d(s,l,o[l],r[l],n,t.t)},g=(t,l,s)=>{let r,i,c=l.h[s],u=0;if(null!==c.i)r=c.p=o.createTextNode(c.i);else{if(n||(n="svg"===c.$),r=c.p=o.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.$),n&&"foreignObject"===c.$&&(n=!1),b(null,c,n),null!=e&&r["s-si"]!==e&&r.classList.add(r["s-si"]=e),c.h)for(u=0;u<c.h.length;++u)i=g(t,c,u),i&&r.appendChild(i);"svg"===c.$?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=g(null,l,o),i&&(s[o].p=i,c.insertBefore(i,n)))},j=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.p,M(l),s.remove())},v=(e,t)=>e.$===t.$,O=(e,t)=>{const l=t.p=e.p,s=e.h,o=t.h,r=t.$,i=t.i;null===i?(n="svg"===r||"foreignObject"!==r&&n,b(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],h=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==h?h=l[--a]:v(c,f)?(O(c,f),c=t[++o],f=l[++r]):v(u,h)?(O(u,h),u=t[--i],h=l[--a]):v(c,h)?(O(c,h),e.insertBefore(c.p,u.p.nextSibling),c=t[++o],h=l[--a]):v(u,f)?(O(u,f),e.insertBefore(u.p,c.p),u=t[--i],f=l[++r]):(s=g(t&&t[r],n,r),f=l[++r],s&&c.p.parentNode.insertBefore(s,c.p));o>i?S(e,null==l[a+1]?null:l[a+1].p,n,l,r,a):r>a&&j(t,o,i)})(l,s,t,o):null!==o?(null!==e.i&&(l.textContent=""),S(l,null,t,o,0,o.length-1)):null!==s&&j(s,0,s.length-1),n&&"svg"===r&&(n=!1)):e.i!==i&&(l.data=i)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(M)},k=(e,t)=>{t&&!e.m&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.m=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.g),Z((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.S;let l;return t&&(l=R(n,"componentWillLoad")),T(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.j,s=l["s-rc"];n&&(e=>{const t=e.v,n=e.j,l=t.t,s=((e,t)=>{let n=a(t),l=G.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=u.get(e=e.head||e);s||u.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);E(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},E=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.v,r=n.O||p(null,null),i=(e=>e&&e.$===y)(l)?l:$(null,null,l);t=s.tagName,o.M&&(i.u=i.u||{},o.M.map((([e,t])=>i.u[t]=s[e]))),i.$=null,i.t|=4,n.O=i,i.p=r.p=s.shadowRoot||s,e=s["s-sc"],O(r,i)})(n,l)}catch(e){_(e,n.j)}return null},L=e=>{const t=e.j,n=e.g;R(e.S,"componentDidRender"),64&e.t||(e.t|=64,W(t),e.k(t),n||N()),e.m&&(e.m(),e.m=void 0),512&e.t&&Y((()=>C(e,!1))),e.t&=-517},N=()=>{W(o.documentElement),Y((()=>(e=>{const t=r.ce("appload",{detail:{namespace:"user-login"}});return e.dispatchEvent(t),t})(s)))},R=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){_(e)}},T=(e,t)=>e&&e.then?e.then(t):t(),W=e=>e.classList.add("hydrated"),A=(e,t,n)=>{if(t.C){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>D(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=D(e),o=s.j,r=s.L.get(t),i=s.t,c=s.S;if(n=((e,t)=>null==e||h(e)?e:
|
|
1
|
+
let e,t,n=!1,l=!1;const s="undefined"!=typeof window?window:{},o=s.document||{head:{}},r={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=new WeakMap,a=e=>"sc-"+e.o,f={},h=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!h(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?p(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.h=r),c},p=(e,t)=>({t:0,$:e,i:t,p:null,h:null,u:null}),y={},d=(e,t,n,l,o,i)=>{if(n!==l){let c=V(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=w(n),o=w(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const s=h(l);if((c||s&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||o)&&!s&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):V(s,u)?u.slice(2):u[2]+t.slice(3),n&&r.rel(e,t,n,!1),l&&r.ael(e,t,l,!1)}},m=/\s/,w=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.p.nodeType&&t.p.host?t.p.host:t.p,o=e&&e.u||f,r=t.u||f;for(l in o)l in r||d(s,l,o[l],void 0,n,t.t);for(l in r)d(s,l,o[l],r[l],n,t.t)},g=(t,l,s)=>{let r,i,c=l.h[s],u=0;if(null!==c.i)r=c.p=o.createTextNode(c.i);else{if(n||(n="svg"===c.$),r=c.p=o.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.$),n&&"foreignObject"===c.$&&(n=!1),b(null,c,n),null!=e&&r["s-si"]!==e&&r.classList.add(r["s-si"]=e),c.h)for(u=0;u<c.h.length;++u)i=g(t,c,u),i&&r.appendChild(i);"svg"===c.$?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=g(null,l,o),i&&(s[o].p=i,c.insertBefore(i,n)))},j=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.p,M(l),s.remove())},v=(e,t)=>e.$===t.$,O=(e,t)=>{const l=t.p=e.p,s=e.h,o=t.h,r=t.$,i=t.i;null===i?(n="svg"===r||"foreignObject"!==r&&n,b(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],h=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==h?h=l[--a]:v(c,f)?(O(c,f),c=t[++o],f=l[++r]):v(u,h)?(O(u,h),u=t[--i],h=l[--a]):v(c,h)?(O(c,h),e.insertBefore(c.p,u.p.nextSibling),c=t[++o],h=l[--a]):v(u,f)?(O(u,f),e.insertBefore(u.p,c.p),u=t[--i],f=l[++r]):(s=g(t&&t[r],n,r),f=l[++r],s&&c.p.parentNode.insertBefore(s,c.p));o>i?S(e,null==l[a+1]?null:l[a+1].p,n,l,r,a):r>a&&j(t,o,i)})(l,s,t,o):null!==o?(null!==e.i&&(l.textContent=""),S(l,null,t,o,0,o.length-1)):null!==s&&j(s,0,s.length-1),n&&"svg"===r&&(n=!1)):e.i!==i&&(l.data=i)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(M)},k=(e,t)=>{t&&!e.m&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.m=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.g),Z((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.S;let l;return t&&(l=R(n,"componentWillLoad")),T(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.j,s=l["s-rc"];n&&(e=>{const t=e.v,n=e.j,l=t.t,s=((e,t)=>{let n=a(t),l=G.get(n);if(e=11===e.nodeType?e:o,l)if("string"==typeof l){let t,s=u.get(e=e.head||e);s||u.set(e,s=new Set),s.has(n)||(t=o.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);E(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},E=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.v,r=n.O||p(null,null),i=(e=>e&&e.$===y)(l)?l:$(null,null,l);t=s.tagName,o.M&&(i.u=i.u||{},o.M.map((([e,t])=>i.u[t]=s[e]))),i.$=null,i.t|=4,n.O=i,i.p=r.p=s.shadowRoot||s,e=s["s-sc"],O(r,i)})(n,l)}catch(e){_(e,n.j)}return null},L=e=>{const t=e.j,n=e.g;R(e.S,"componentDidRender"),64&e.t||(e.t|=64,W(t),e.k(t),n||N()),e.m&&(e.m(),e.m=void 0),512&e.t&&Y((()=>C(e,!1))),e.t&=-517},N=()=>{W(o.documentElement),Y((()=>(e=>{const t=r.ce("appload",{detail:{namespace:"user-login"}});return e.dispatchEvent(t),t})(s)))},R=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){_(e)}},T=(e,t)=>e&&e.then?e.then(t):t(),W=e=>e.classList.add("hydrated"),A=(e,t,n)=>{if(t.C){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>D(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=D(e),o=s.j,r=s.L.get(t),i=s.t,c=s.S;if(n=((e,t)=>null==e||h(e)?e:1&t?e+"":e)(n,l.C[t][0]),(!(8&i)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(s.L.set(t,n),c)){if(l.P&&128&i){const e=l.P[t];e&&e.map((e=>{try{c[e](n,r,t)}catch(e){_(e,o)}}))}2==(18&i)&&C(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){r.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.M.push([e,s]),s}))}}return e},U=(e,t={})=>{const n=[],l=t.exclude||[],i=s.customElements,u=o.head,f=u.querySelector("meta[charset]"),h=o.createElement("style"),$=[];let p,y=!0;Object.assign(r,t),r.l=new URL(t.resourcesUrl||"./",o.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],o:t[1],C:t[2],N:t[3]};s.C=t[2],s.M=[],s.P={};const o=s.o,u=class extends HTMLElement{constructor(e){super(e),H(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),y?$.push(this):r.jmp((()=>(e=>{if(0==(1&r.t)){const t=D(e),n=t.v,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=B(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,A(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){_(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=a(n);if(!G.has(t)){const l=()=>{};((e,t,n)=>{let l=G.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,G.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>C(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){r.jmp((()=>{}))}componentOnReady(){return D(this).R}};s.T=e[0],l.includes(o)||i.get(o)||(n.push(o),i.define(o,A(u,s,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,f?f.nextSibling:u.firstChild),y=!1,$.length?$.map((e=>e.connectedCallback())):r.jmp((()=>p=setTimeout(N,30)))},q=new WeakMap,D=e=>q.get(e),F=(e,t)=>q.set(t.S=e,t),H=(e,t)=>{const n={t:0,j:e,v:t,L:new Map};return n.R=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],q.set(e,n)},V=(e,t)=>t in e,_=(e,t)=>(0,console.error)(e,t),z=new Map,B=e=>{const t=e.o.replace(/-/g,"_"),n=e.T,l=z.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(z.set(n,e),e[t])),_)},G=new Map,I=[],J=[],K=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&r.t?Y(X):r.raf(X))},Q=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){_(e)}e.length=0},X=()=>{Q(I),Q(J),(l=I.length>0)&&r.raf(X)},Y=e=>i().then(e),Z=K(J,!0);export{U as b,$ as h,i as p,F as r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as s,b as e}from"./p-
|
|
1
|
+
import{p as s,b as e}from"./p-0c865c25.js";(()=>{const e=import.meta.url,r={};return""!==e&&(r.resourcesUrl=new URL(".",e).href),s(r)})().then((s=>e([["p-09aa993f",[[1,"user-login",{endpoint:[513],lang:[1537],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],passwordReset:[513,"password-reset"],userEmailRegex:[513,"user-email-regex"],userEmailRegexOptions:[513,"user-email-regex-options"],passwordRegex:[513,"password-regex"],passwordRegexOptions:[513,"password-regex-options"],userNameEmail:[32],userPassword:[32],isValidUserEmail:[32],isValidPassword:[32],isPasswordVisible:[32],limitStylingAppends:[32],errorMessage:[32],checkValid:[32]}]]]],s)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/user-login",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"types": "./dist/types/index.d.ts",
|
|
9
9
|
"collection": "./dist/collection/collection-manifest.json",
|
|
10
10
|
"collection:main": "./dist/collection/index.js",
|
|
11
|
-
"unpkg": "./dist/user-login/user-login.js",
|
|
11
|
+
"unpkg": "./dist/user-login/user-login.esm.js",
|
|
12
12
|
"files": [
|
|
13
13
|
"dist/",
|
|
14
14
|
"loader/"
|
|
15
15
|
],
|
|
16
|
-
"publishConfig":
|
|
16
|
+
"publishConfig":{
|
|
17
17
|
"access": "public"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as s}from"./p-5c2c28b2.js";const t=["ro","en","cz","de"],o={en:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"},ro:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"},fr:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"},cs:{invalidField:"Ovo polje je nevažeće.",forgotPassword:"Zaboravio sam lozinku ",userEmail:"Korisničko ime ili email",password:"Lozinka",login:"Prijava"},de:{invalidField:"This field is invalid",forgotPassword:"Forgot Password",userEmail:"Username or Email",password:"Password",login:"Login"}},e=i=>new Promise((s=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((s=>{for(let t in i[s])o[s][t]=i[s][t]})),s(!0)}))})),r=(i,s,e)=>{const r=s;let n=o[void 0!==r&&t.includes(r)?r:"en"][i];if(void 0!==e)for(const[i,s]of Object.entries(e.values)){const t=new RegExp(`{${i}}`,"g");n=n.replace(t,s)}return n},n=class{constructor(s){i(this,s),this.endpoint="",this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.passwordReset=!1,this.userEmailRegex="^(?:[A-Z0-9][A-Z0-9._%@+-]{5,30}|[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4})$",this.passwordRegex="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[^\\w\\s]).{8,20}$",this.userNameEmail="",this.userPassword="",this.isValidUserEmail=!0,this.isValidPassword=!0,this.isPasswordVisible=!1,this.limitStylingAppends=!1,this.errorMessage="",this.checkValid=!0,this.userLogin=async({username:i,password:s})=>{let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:i,password:s})};fetch(`${this.endpoint}/player/legislation/login`,t).then((i=>i.json())).then((i=>{var s;if(i.sessionId)window.postMessage({type:"UserSessionID",session:i.sessionID,userid:i.universalID},window.location.href),this.isFormValid(this.errorMessage="");else{let t=null===(s=null==i?void 0:i.thirdPartyResponse)||void 0===s?void 0:s.message;this.errorMessage=t,this.isFormValid(this.errorMessage),window.postMessage({type:"HasError",error:t},window.location.href),window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.href)}}))},this.isFormValid=i=>{this.checkValid=""===i},this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.appendChild(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(i.href).then((i=>i.text())).then((i=>{s.innerHTML=i,setTimeout((()=>{this.stylingContainer.appendChild(s)}),1)}))},this.handleInputChange=(i,s)=>{this.checkValid=!0;const t=i.target.value;"user"===s?(this.userNameEmail=t,this.isValidUserEmail=this.userEmailValidation(this.userNameEmail)):(this.userPassword=t,this.isValidPassword=this.passwordValidation(t))},this.userEmailValidation=i=>new RegExp(this.userEmailRegex,"i").test(i),this.passwordValidation=i=>new RegExp(this.passwordRegex,"").test(i),this.togglePassword=()=>{this.isPasswordVisible=!this.isPasswordVisible},this.resetPassword=()=>{window.postMessage({type:"ResetPassword"},window.location.href)}}handleNewTranslations(){e(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await e(this.translationUrl)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let i=s("span",{class:"InputIcon"},this.isPasswordVisible&&s("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"},s("g",{transform:"translate(-110.856 -23.242)"},s("circle",{class:"PasswordVisibilityIcon",cx:"0.05",cy:"0.05",r:"0.05",transform:"translate(121.017 31.148)"}),s("g",{transform:"translate(117.499 27.37)"},s("path",{class:"PasswordVisibilityIcon",d:"M147.413,43.174a2.774,2.774,0,0,0-3.229-3.943Z",transform:"translate(-142.164 -39.123)"}),s("path",{class:"PasswordVisibilityIcon",d:"M137.031,43.1a2.778,2.778,0,0,0,3.447,4.209Z",transform:"translate(-136.413 -42.068)"})),s("g",{transform:"translate(110.856 24.899)"},s("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)"}),s("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)"})),s("rect",{class:"PasswordVisibilityIcon",width:"0.972",height:"15.861",rx:"0.486",transform:"translate(114.827 23.858) rotate(-39.315)"}))),!this.isPasswordVisible&&s("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"},s("g",{transform:"translate(-14.185 -27.832)"},s("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)"}),s("circle",{class:"PasswordVisibilityIcon",cx:"2.779",cy:"2.779",r:"2.779",transform:"translate(20.827 30.303)"})))),t=s("div",{class:"FormBox",ref:i=>this.stylingContainer=i},s("div",{class:"FormValue"},s("div",{class:this.isValidUserEmail&&this.checkValid?"InputBox":"InputBox InputInvalidBox"},s("input",{type:"text",placeholder:"",value:this.userNameEmail,onFocus:i=>this.handleInputChange(i,"user"),onInput:i=>this.handleInputChange(i,"user"),required:!0}),s("label",{class:(this.userNameEmail?"FieldFilledIn":"")+" "+(this.isValidUserEmail&&this.checkValid?"":"FieldInvalid")},r("userEmail",this.lang)),!this.isValidUserEmail&&s("p",{class:"InvalidField"},r("invalidField",this.lang))),s("div",{class:this.isValidPassword&&this.checkValid?"InputBox":"InputBox InputInvalidBox"},i,s("input",{type:this.isPasswordVisible?"text":"password",placeholder:"",value:this.userPassword,onFocus:i=>this.handleInputChange(i,"password"),onInput:i=>this.handleInputChange(i,"password"),required:!0}),s("label",{class:(this.userPassword?"FieldFilledIn":"")+" "+(this.isValidPassword&&this.checkValid?"":"FieldInvalid")},r("password",this.lang)),!this.isValidPassword&&s("p",{class:"InvalidField"},r("invalidField",this.lang))),this.passwordReset&&s("div",{class:"ForgotPassword"},s("button",{onClick:()=>this.resetPassword()},r("forgotPassword",this.lang))),s("button",{disabled:!(this.isValidUserEmail&&this.isValidPassword&&this.userNameEmail&&this.userPassword),class:"SubmitCredentials",onClick:()=>this.userLogin({username:this.userNameEmail,password:this.userPassword})},r("login",this.lang)),this.errorMessage&&s("p",{class:"CredentialsError"},this.errorMessage)));return s("section",null,t)}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};n.style=':host{display:block;font-family:"Roboto", sans-serif}section{min-height:100vh;width:100%;background-position:center;background-size:cover}.FormBox{height:100vh;display:flex;position:relative;background:#082649;border:none;backdrop-filter:blur(15px) brightness(80%);justify-content:center;align-items:center}.InputBox{position:relative;margin:30px 0;width:310px;border-bottom:2px solid #0797B9}.InputBox.InputInvalidBox::after{content:"";height:2px;width:100%;transition:width 0.6s linear;background:#C23135}.InputBox::after{content:"";display:block;width:0;height:2px;position:relative;top:2px}.InputBox .PasswordVisibilityIcon{fill:#0797B9}.InputBox .InputIcon .TogglePasswordVisibility{cursor:pointer;position:absolute;top:18px;right:0}.InputBox .InputIcon .TogglePasswordVisibility.PasswordVisible{top:19.5px}.InputBox label{position:absolute;top:50%;left:5px;transform:translateY(-50%);color:#0797B9;font-size:1em;pointer-events:none;transition:0.5s}.InputBox label.FieldInvalid{color:#C23135}.InputBox input{width:100%;height:50px;background:transparent;border:none;outline:none;font-size:1em;padding:0 35px 0 5px;color:#fff;box-sizing:border-box}input:focus~label,label.FieldFilledIn{top:-3px;font-size:0.7em}.ForgotPassword button{margin:-10px 0 17px;font-size:0.9em;color:#0797B9;display:flex;justify-content:space-between;background-color:transparent;padding:0;height:unset;border:0;cursor:pointer}.ForgotPassword button:hover{color:#fff}.SubmitCredentials{display:block;margin:0 auto;padding:10px 20px;border-radius:5px;color:#fff;background:linear-gradient(to right, #EA0C66, #77318F);border:none;outline:none;cursor:pointer;font-size:1em}.SubmitCredentials:disabled{background:#707070}.Register{font-size:0.9em;color:#fff;text-align:center;margin:25px 0 10px}.Register p a{text-decoration:none;color:#fff;font-weight:600}.Register p a:hover{text-decoration:underline}.InvalidField{position:absolute;top:45px;color:#C23135;font-size:0.7em}.SubmitCredentials{margin-bottom:20px}.CredentialsError{color:#C23135;font-size:0.7em;padding:0 0 20px 0;margin:0}@media screen and (max-width: 480px){.FormBox{width:100%;border-radius:0px}}';export{n as user_login}
|