@everymatrix/player-sms-verification 1.30.0 → 1.31.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.
@@ -7,6 +7,8 @@ const index = require('./index-64b46357.js');
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const TRANSLATIONS = {
9
9
  en: {
10
+ title: 'SMS Verification required',
11
+ subtitle: 'You need to verify your phone number',
10
12
  btnSend: 'Send Code',
11
13
  btnResend: 'Resend Code',
12
14
  btnActivate: 'Activate',
@@ -18,6 +20,8 @@ const TRANSLATIONS = {
18
20
  errExpiredToken: 'The code expired, resend code'
19
21
  },
20
22
  ro: {
23
+ title: 'SMS Verification required',
24
+ subtitle: 'You need to verify your phone number',
21
25
  btnSend: 'Send Code',
22
26
  btnResend: 'Resend Code',
23
27
  btnActivate: 'Activate',
@@ -29,6 +33,8 @@ const TRANSLATIONS = {
29
33
  errExpiredToken: 'The code expired, resend code'
30
34
  },
31
35
  fr: {
36
+ title: 'SMS Verification required',
37
+ subtitle: 'You need to verify your phone number',
32
38
  btnSend: 'Send Code',
33
39
  btnResend: 'Resend Code',
34
40
  btnActivate: 'Activate',
@@ -40,6 +46,8 @@ const TRANSLATIONS = {
40
46
  errExpiredToken: 'The code expired, resend code'
41
47
  },
42
48
  hu: {
49
+ title: 'SMS Verification required',
50
+ subtitle: 'You need to verify your phone number',
43
51
  btnSend: 'Send Code',
44
52
  btnResend: 'Resend Code',
45
53
  btnActivate: 'Activate',
@@ -51,6 +59,8 @@ const TRANSLATIONS = {
51
59
  errExpiredToken: 'The code expired, resend code'
52
60
  },
53
61
  tr: {
62
+ title: 'SMS Verification required',
63
+ subtitle: 'You need to verify your phone number',
54
64
  btnSend: 'Send Code',
55
65
  btnResend: 'Resend Code',
56
66
  btnActivate: 'Activate',
@@ -62,6 +72,8 @@ const TRANSLATIONS = {
62
72
  errExpiredToken: 'The code expired, resend code'
63
73
  },
64
74
  el: {
75
+ title: 'SMS Verification required',
76
+ subtitle: 'You need to verify your phone number',
65
77
  btnSend: 'Send Code',
66
78
  btnResend: 'Resend Code',
67
79
  btnActivate: 'Activate',
@@ -73,6 +85,8 @@ const TRANSLATIONS = {
73
85
  errExpiredToken: 'The code expired, resend code'
74
86
  },
75
87
  es: {
88
+ title: 'SMS Verification required',
89
+ subtitle: 'You need to verify your phone number',
76
90
  btnSend: 'Send Code',
77
91
  btnResend: 'Resend Code',
78
92
  btnActivate: 'Activate',
@@ -84,6 +98,8 @@ const TRANSLATIONS = {
84
98
  errExpiredToken: 'The code expired, resend code'
85
99
  },
86
100
  pt: {
101
+ title: 'SMS Verification required',
102
+ subtitle: 'You need to verify your phone number',
87
103
  btnSend: 'Send Code',
88
104
  btnResend: 'Resend Code',
89
105
  btnActivate: 'Activate',
@@ -95,6 +111,8 @@ const TRANSLATIONS = {
95
111
  errExpiredToken: 'The code expired, resend code'
96
112
  },
97
113
  hr: {
114
+ title: 'SMS Verification required',
115
+ subtitle: 'You need to verify your phone number',
98
116
  btnSend: 'Send Code',
99
117
  btnResend: 'Resend Code',
100
118
  btnActivate: 'Activate',
@@ -125,7 +143,7 @@ const translate = (key, customLang) => {
125
143
  return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
126
144
  };
127
145
 
128
- const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:30px}.PlayerSmsVerificationButtonContainer{width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
146
+ const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
129
147
 
130
148
  const PlayerSmsVerification = class {
131
149
  constructor(hostRef) {
@@ -288,9 +306,9 @@ const PlayerSmsVerification = class {
288
306
  this.code = event.target.value;
289
307
  }
290
308
  render() {
291
- return index.h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, index.h("div", { class: "PlayerSmsVerificationContainer" }, index.h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " " + "Hidden") }, translate(this.msgEnterCode, this.lang)), index.h("div", { class: "PlayerSmsVerificationInput" }, index.h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
309
+ return index.h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, index.h("div", { class: "PlayerSmsVerificationTitleContainer" }, index.h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), index.h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), index.h("div", { class: "PlayerSmsVerificationContainer" }, index.h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), index.h("div", { class: "PlayerSmsVerificationInput" }, index.h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
292
310
  ? index.h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
293
- : index.h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " " + "Hidden") }, translate('msgResendNotice', this.lang))), index.h("div", { class: "PlayerSmsVerificationButtonContainer" }, index.h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), index.h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
311
+ : index.h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))), index.h("div", { class: "PlayerSmsVerificationButtonContainer" }, index.h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), index.h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
294
312
  }
295
313
  static get watchers() { return {
296
314
  "clientStyling": ["updateClientStyling"],
@@ -10,15 +10,36 @@
10
10
  background: var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8));
11
11
  }
12
12
 
13
+ .PlayerSmsVerificationTitleContainer {
14
+ position: relative;
15
+ display: flex;
16
+ flex-direction: column;
17
+ width: 100%;
18
+ margin-bottom: 60px;
19
+ }
20
+
21
+ .PlayerSmsVerificationTitle {
22
+ font-size: 20px;
23
+ font-weight: 300;
24
+ text-transform: uppercase;
25
+ padding: 0;
26
+ margin: 0;
27
+ }
28
+
29
+ .PlayerSmsVerificationSubitle {
30
+ font-size: 14px;
31
+ }
32
+
13
33
  .PlayerSmsVerificationContainer {
14
34
  position: relative;
15
35
  width: 100%;
16
36
  display: flex;
17
37
  flex-direction: column;
18
- margin-bottom: 30px;
38
+ margin-bottom: 75px;
19
39
  }
20
40
 
21
41
  .PlayerSmsVerificationButtonContainer {
42
+ position: relative;
22
43
  width: 100%;
23
44
  display: flex;
24
45
  flex-direction: column;
@@ -161,13 +161,16 @@ export class PlayerSmsVerification {
161
161
  }
162
162
  render() {
163
163
  return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el },
164
+ h("div", { class: "PlayerSmsVerificationTitleContainer" },
165
+ h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)),
166
+ h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))),
164
167
  h("div", { class: "PlayerSmsVerificationContainer" },
165
- h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " " + "Hidden") }, translate(this.msgEnterCode, this.lang)),
168
+ h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)),
166
169
  h("div", { class: "PlayerSmsVerificationInput" },
167
170
  h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })),
168
171
  this.errMsg
169
172
  ? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
170
- : h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " " + "Hidden") }, translate('msgResendNotice', this.lang))),
173
+ : h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))),
171
174
  h("div", { class: "PlayerSmsVerificationButtonContainer" },
172
175
  h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)),
173
176
  h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
@@ -1,6 +1,8 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
2
  const TRANSLATIONS = {
3
3
  en: {
4
+ title: 'SMS Verification required',
5
+ subtitle: 'You need to verify your phone number',
4
6
  btnSend: 'Send Code',
5
7
  btnResend: 'Resend Code',
6
8
  btnActivate: 'Activate',
@@ -12,6 +14,8 @@ const TRANSLATIONS = {
12
14
  errExpiredToken: 'The code expired, resend code'
13
15
  },
14
16
  ro: {
17
+ title: 'SMS Verification required',
18
+ subtitle: 'You need to verify your phone number',
15
19
  btnSend: 'Send Code',
16
20
  btnResend: 'Resend Code',
17
21
  btnActivate: 'Activate',
@@ -23,6 +27,8 @@ const TRANSLATIONS = {
23
27
  errExpiredToken: 'The code expired, resend code'
24
28
  },
25
29
  fr: {
30
+ title: 'SMS Verification required',
31
+ subtitle: 'You need to verify your phone number',
26
32
  btnSend: 'Send Code',
27
33
  btnResend: 'Resend Code',
28
34
  btnActivate: 'Activate',
@@ -34,6 +40,8 @@ const TRANSLATIONS = {
34
40
  errExpiredToken: 'The code expired, resend code'
35
41
  },
36
42
  hu: {
43
+ title: 'SMS Verification required',
44
+ subtitle: 'You need to verify your phone number',
37
45
  btnSend: 'Send Code',
38
46
  btnResend: 'Resend Code',
39
47
  btnActivate: 'Activate',
@@ -45,6 +53,8 @@ const TRANSLATIONS = {
45
53
  errExpiredToken: 'The code expired, resend code'
46
54
  },
47
55
  tr: {
56
+ title: 'SMS Verification required',
57
+ subtitle: 'You need to verify your phone number',
48
58
  btnSend: 'Send Code',
49
59
  btnResend: 'Resend Code',
50
60
  btnActivate: 'Activate',
@@ -56,6 +66,8 @@ const TRANSLATIONS = {
56
66
  errExpiredToken: 'The code expired, resend code'
57
67
  },
58
68
  el: {
69
+ title: 'SMS Verification required',
70
+ subtitle: 'You need to verify your phone number',
59
71
  btnSend: 'Send Code',
60
72
  btnResend: 'Resend Code',
61
73
  btnActivate: 'Activate',
@@ -67,6 +79,8 @@ const TRANSLATIONS = {
67
79
  errExpiredToken: 'The code expired, resend code'
68
80
  },
69
81
  es: {
82
+ title: 'SMS Verification required',
83
+ subtitle: 'You need to verify your phone number',
70
84
  btnSend: 'Send Code',
71
85
  btnResend: 'Resend Code',
72
86
  btnActivate: 'Activate',
@@ -78,6 +92,8 @@ const TRANSLATIONS = {
78
92
  errExpiredToken: 'The code expired, resend code'
79
93
  },
80
94
  pt: {
95
+ title: 'SMS Verification required',
96
+ subtitle: 'You need to verify your phone number',
81
97
  btnSend: 'Send Code',
82
98
  btnResend: 'Resend Code',
83
99
  btnActivate: 'Activate',
@@ -89,6 +105,8 @@ const TRANSLATIONS = {
89
105
  errExpiredToken: 'The code expired, resend code'
90
106
  },
91
107
  hr: {
108
+ title: 'SMS Verification required',
109
+ subtitle: 'You need to verify your phone number',
92
110
  btnSend: 'Send Code',
93
111
  btnResend: 'Resend Code',
94
112
  btnActivate: 'Activate',
@@ -3,6 +3,8 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
5
5
  en: {
6
+ title: 'SMS Verification required',
7
+ subtitle: 'You need to verify your phone number',
6
8
  btnSend: 'Send Code',
7
9
  btnResend: 'Resend Code',
8
10
  btnActivate: 'Activate',
@@ -14,6 +16,8 @@ const TRANSLATIONS = {
14
16
  errExpiredToken: 'The code expired, resend code'
15
17
  },
16
18
  ro: {
19
+ title: 'SMS Verification required',
20
+ subtitle: 'You need to verify your phone number',
17
21
  btnSend: 'Send Code',
18
22
  btnResend: 'Resend Code',
19
23
  btnActivate: 'Activate',
@@ -25,6 +29,8 @@ const TRANSLATIONS = {
25
29
  errExpiredToken: 'The code expired, resend code'
26
30
  },
27
31
  fr: {
32
+ title: 'SMS Verification required',
33
+ subtitle: 'You need to verify your phone number',
28
34
  btnSend: 'Send Code',
29
35
  btnResend: 'Resend Code',
30
36
  btnActivate: 'Activate',
@@ -36,6 +42,8 @@ const TRANSLATIONS = {
36
42
  errExpiredToken: 'The code expired, resend code'
37
43
  },
38
44
  hu: {
45
+ title: 'SMS Verification required',
46
+ subtitle: 'You need to verify your phone number',
39
47
  btnSend: 'Send Code',
40
48
  btnResend: 'Resend Code',
41
49
  btnActivate: 'Activate',
@@ -47,6 +55,8 @@ const TRANSLATIONS = {
47
55
  errExpiredToken: 'The code expired, resend code'
48
56
  },
49
57
  tr: {
58
+ title: 'SMS Verification required',
59
+ subtitle: 'You need to verify your phone number',
50
60
  btnSend: 'Send Code',
51
61
  btnResend: 'Resend Code',
52
62
  btnActivate: 'Activate',
@@ -58,6 +68,8 @@ const TRANSLATIONS = {
58
68
  errExpiredToken: 'The code expired, resend code'
59
69
  },
60
70
  el: {
71
+ title: 'SMS Verification required',
72
+ subtitle: 'You need to verify your phone number',
61
73
  btnSend: 'Send Code',
62
74
  btnResend: 'Resend Code',
63
75
  btnActivate: 'Activate',
@@ -69,6 +81,8 @@ const TRANSLATIONS = {
69
81
  errExpiredToken: 'The code expired, resend code'
70
82
  },
71
83
  es: {
84
+ title: 'SMS Verification required',
85
+ subtitle: 'You need to verify your phone number',
72
86
  btnSend: 'Send Code',
73
87
  btnResend: 'Resend Code',
74
88
  btnActivate: 'Activate',
@@ -80,6 +94,8 @@ const TRANSLATIONS = {
80
94
  errExpiredToken: 'The code expired, resend code'
81
95
  },
82
96
  pt: {
97
+ title: 'SMS Verification required',
98
+ subtitle: 'You need to verify your phone number',
83
99
  btnSend: 'Send Code',
84
100
  btnResend: 'Resend Code',
85
101
  btnActivate: 'Activate',
@@ -91,6 +107,8 @@ const TRANSLATIONS = {
91
107
  errExpiredToken: 'The code expired, resend code'
92
108
  },
93
109
  hr: {
110
+ title: 'SMS Verification required',
111
+ subtitle: 'You need to verify your phone number',
94
112
  btnSend: 'Send Code',
95
113
  btnResend: 'Resend Code',
96
114
  btnActivate: 'Activate',
@@ -121,7 +139,7 @@ const translate = (key, customLang) => {
121
139
  return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
122
140
  };
123
141
 
124
- const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:30px}.PlayerSmsVerificationButtonContainer{width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
142
+ const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
125
143
 
126
144
  const PlayerSmsVerification$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
127
145
  constructor() {
@@ -286,9 +304,9 @@ const PlayerSmsVerification$1 = /*@__PURE__*/ proxyCustomElement(class extends H
286
304
  this.code = event.target.value;
287
305
  }
288
306
  render() {
289
- return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " " + "Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { class: "PlayerSmsVerificationInput" }, h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
307
+ return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationTitleContainer" }, h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { class: "PlayerSmsVerificationInput" }, h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
290
308
  ? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
291
- : h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " " + "Hidden") }, translate('msgResendNotice', this.lang))), h("div", { class: "PlayerSmsVerificationButtonContainer" }, h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
309
+ : h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))), h("div", { class: "PlayerSmsVerificationButtonContainer" }, h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
292
310
  }
293
311
  static get watchers() { return {
294
312
  "clientStyling": ["updateClientStyling"],
@@ -3,6 +3,8 @@ import { r as registerInstance, h } from './index-87b20f11.js';
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
5
5
  en: {
6
+ title: 'SMS Verification required',
7
+ subtitle: 'You need to verify your phone number',
6
8
  btnSend: 'Send Code',
7
9
  btnResend: 'Resend Code',
8
10
  btnActivate: 'Activate',
@@ -14,6 +16,8 @@ const TRANSLATIONS = {
14
16
  errExpiredToken: 'The code expired, resend code'
15
17
  },
16
18
  ro: {
19
+ title: 'SMS Verification required',
20
+ subtitle: 'You need to verify your phone number',
17
21
  btnSend: 'Send Code',
18
22
  btnResend: 'Resend Code',
19
23
  btnActivate: 'Activate',
@@ -25,6 +29,8 @@ const TRANSLATIONS = {
25
29
  errExpiredToken: 'The code expired, resend code'
26
30
  },
27
31
  fr: {
32
+ title: 'SMS Verification required',
33
+ subtitle: 'You need to verify your phone number',
28
34
  btnSend: 'Send Code',
29
35
  btnResend: 'Resend Code',
30
36
  btnActivate: 'Activate',
@@ -36,6 +42,8 @@ const TRANSLATIONS = {
36
42
  errExpiredToken: 'The code expired, resend code'
37
43
  },
38
44
  hu: {
45
+ title: 'SMS Verification required',
46
+ subtitle: 'You need to verify your phone number',
39
47
  btnSend: 'Send Code',
40
48
  btnResend: 'Resend Code',
41
49
  btnActivate: 'Activate',
@@ -47,6 +55,8 @@ const TRANSLATIONS = {
47
55
  errExpiredToken: 'The code expired, resend code'
48
56
  },
49
57
  tr: {
58
+ title: 'SMS Verification required',
59
+ subtitle: 'You need to verify your phone number',
50
60
  btnSend: 'Send Code',
51
61
  btnResend: 'Resend Code',
52
62
  btnActivate: 'Activate',
@@ -58,6 +68,8 @@ const TRANSLATIONS = {
58
68
  errExpiredToken: 'The code expired, resend code'
59
69
  },
60
70
  el: {
71
+ title: 'SMS Verification required',
72
+ subtitle: 'You need to verify your phone number',
61
73
  btnSend: 'Send Code',
62
74
  btnResend: 'Resend Code',
63
75
  btnActivate: 'Activate',
@@ -69,6 +81,8 @@ const TRANSLATIONS = {
69
81
  errExpiredToken: 'The code expired, resend code'
70
82
  },
71
83
  es: {
84
+ title: 'SMS Verification required',
85
+ subtitle: 'You need to verify your phone number',
72
86
  btnSend: 'Send Code',
73
87
  btnResend: 'Resend Code',
74
88
  btnActivate: 'Activate',
@@ -80,6 +94,8 @@ const TRANSLATIONS = {
80
94
  errExpiredToken: 'The code expired, resend code'
81
95
  },
82
96
  pt: {
97
+ title: 'SMS Verification required',
98
+ subtitle: 'You need to verify your phone number',
83
99
  btnSend: 'Send Code',
84
100
  btnResend: 'Resend Code',
85
101
  btnActivate: 'Activate',
@@ -91,6 +107,8 @@ const TRANSLATIONS = {
91
107
  errExpiredToken: 'The code expired, resend code'
92
108
  },
93
109
  hr: {
110
+ title: 'SMS Verification required',
111
+ subtitle: 'You need to verify your phone number',
94
112
  btnSend: 'Send Code',
95
113
  btnResend: 'Resend Code',
96
114
  btnActivate: 'Activate',
@@ -121,7 +139,7 @@ const translate = (key, customLang) => {
121
139
  return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
122
140
  };
123
141
 
124
- const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:30px}.PlayerSmsVerificationButtonContainer{width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
142
+ const playerSmsVerificationCss = ":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";
125
143
 
126
144
  const PlayerSmsVerification = class {
127
145
  constructor(hostRef) {
@@ -284,9 +302,9 @@ const PlayerSmsVerification = class {
284
302
  this.code = event.target.value;
285
303
  }
286
304
  render() {
287
- return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " " + "Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { class: "PlayerSmsVerificationInput" }, h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
305
+ return h("div", { class: "PlayerSmsVerification", ref: el => this.stylingContainer = el }, h("div", { class: "PlayerSmsVerificationTitleContainer" }, h("h4", { class: "PlayerSmsVerificationTitle" }, translate('title', this.lang)), h("p", { class: "PlayerSmsVerificationSubtitle" }, translate('subtitle', this.lang))), h("div", { class: "PlayerSmsVerificationContainer" }, h("p", { class: "PlayerSmsVerificationMsg" + (this.msgEnterCode ? "" : " Hidden") }, translate(this.msgEnterCode, this.lang)), h("div", { class: "PlayerSmsVerificationInput" }, h("input", { type: "text", onInput: (event) => this.handleInput(event), value: this.code })), this.errMsg
288
306
  ? h("p", { class: "PlayerSmsVerificationErrMsg" }, translate(this.errMsg, this.lang))
289
- : h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " " + "Hidden") }, translate('msgResendNotice', this.lang))), h("div", { class: "PlayerSmsVerificationButtonContainer" }, h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
307
+ : h("p", { class: "PlayerSmsVerificationMsg" + (!this.isBtnSendAvailable && this.isCodeSentOnce ? "" : " Hidden") }, translate('msgResendNotice', this.lang))), h("div", { class: "PlayerSmsVerificationButtonContainer" }, h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleSendCode.bind(this), 850), disabled: !this.isBtnSendAvailable }, this.isCodeSentOnce ? this.isBtnSendAvailable ? translate('btnResend', this.lang) : this.tempBtnResendCount : translate('btnSend', this.lang)), h("button", { class: "PlayerSmsVerificationButton", onClick: this.debounce(this.handleCheckCode.bind(this), 850), disabled: !this.isCodeSentOnce || this.code === '' || this.code === undefined }, translate('btnActivate', this.lang))));
290
308
  }
291
309
  static get watchers() { return {
292
310
  "clientStyling": ["updateClientStyling"],
@@ -0,0 +1 @@
1
+ import{r as e,h as t}from"./p-616d438d.js";const r={en:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},ro:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},fr:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},hu:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},tr:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},el:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},es:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},pt:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},hr:{title:"SMS Verification required",subtitle:"You need to verify your phone number",btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"}},i=(e,t)=>r[void 0!==t?t:"en"][e],n=class{constructor(t){e(this,t),this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.code="",this.errMsg="",this.msgEnterCode="",this.btnResendCount=60,this.isCodeSentOnce=!1,this.isBtnSendAvailable=!0,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.stylingContainer.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.stylingContainer.prepend(t)}),1)})).catch((e=>{console.log("error ",e)}))}}updateClientStyling(){this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}componentWillLoad(){if(this.translationUrl)return e=this.translationUrl,new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])r[t][i]=e[t][i]})),t(!0)}))}));var e;this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}startTimerBtnResendCode(){this.isBtnSendAvailable=!1,this.tempBtnResendCount=this.btnResendCount,this.btnResendTimer=setInterval((()=>{this.tempBtnResendCount--,this.tempBtnResendCount<0&&(clearInterval(this.btnResendTimer),this.isBtnSendAvailable=!0)}),1e3)}setErrMsg(e){"INVALID_CODE"===e?this.errMsg="errInvalidCode":"BLOCK_USER_INCORRECT_CODE"===e?this.errMsg="errExceededAttempts":"ExpiredToken"===e?this.errMsg="errExpiredToken":"errGenerateCode"===e&&(this.errMsg="errGenerateCode")}debounce(e,t){return function(...r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e.apply(this,r)}),t)}}handleSendCode(){this.errMsg="";let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);const t={method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:`${this.userId}`})};fetch(e.href,t).then((()=>{this.msgEnterCode="msgEnterCode",this.isCodeSentOnce&&this.startTimerBtnResendCode(),this.isCodeSentOnce=!0})).catch((e=>{this.setErrMsg("errGenerateCode"),window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)}))}handleCheckCode(){let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);e.searchParams.append("userId",this.userId),e.searchParams.append("code",this.code),fetch(e.href,{method:"GET",headers:{accept:"application/json"}}).then((e=>e.json())).then((e=>{200===e.httpStatusCode?(this.errMsg="",window.postMessage({type:"SmsVerificationSuccess"},window.location.href)):e.thirdPartyResponse&&(this.setErrMsg(e.thirdPartyResponse.message),"errExceededAttempts"===this.errMsg&&window.postMessage({type:"SmsVerificationErrExceededAttempts",data:i(this.errMsg)},window.location.href))})).catch((e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)})).finally((()=>{this.code=""}))}handleInput(e){this.code=e.target.value}render(){return t("div",{class:"PlayerSmsVerification",ref:e=>this.stylingContainer=e},t("div",{class:"PlayerSmsVerificationTitleContainer"},t("h4",{class:"PlayerSmsVerificationTitle"},i("title",this.lang)),t("p",{class:"PlayerSmsVerificationSubtitle"},i("subtitle",this.lang))),t("div",{class:"PlayerSmsVerificationContainer"},t("p",{class:"PlayerSmsVerificationMsg"+(this.msgEnterCode?"":" Hidden")},i(this.msgEnterCode,this.lang)),t("div",{class:"PlayerSmsVerificationInput"},t("input",{type:"text",onInput:e=>this.handleInput(e),value:this.code})),this.errMsg?t("p",{class:"PlayerSmsVerificationErrMsg"},i(this.errMsg,this.lang)):t("p",{class:"PlayerSmsVerificationMsg"+(!this.isBtnSendAvailable&&this.isCodeSentOnce?"":" Hidden")},i("msgResendNotice",this.lang))),t("div",{class:"PlayerSmsVerificationButtonContainer"},t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleSendCode.bind(this),850),disabled:!this.isBtnSendAvailable},this.isCodeSentOnce?this.isBtnSendAvailable?i("btnResend",this.lang):this.tempBtnResendCount:i("btnSend",this.lang)),t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleCheckCode.bind(this),850),disabled:!this.isCodeSentOnce||""===this.code||void 0===this.code},i("btnActivate",this.lang))))}static get watchers(){return{clientStyling:["updateClientStyling"],clientStylingUrl:["updateClientStyling"]}}};n.style=":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationTitleContainer{position:relative;display:flex;flex-direction:column;width:100%;margin-bottom:60px}.PlayerSmsVerificationTitle{font-size:20px;font-weight:300;text-transform:uppercase;padding:0;margin:0}.PlayerSmsVerificationSubitle{font-size:14px}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:75px}.PlayerSmsVerificationButtonContainer{position:relative;width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";export{n as player_sms_verification}
@@ -1 +1 @@
1
- import{p as n,b as t}from"./p-616d438d.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-5a63187f",[[1,"player-sms-verification",{endpoint:[513],userId:[513,"user-id"],lang:[513],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],tempBtnResendCount:[32],code:[32],errMsg:[32],msgEnterCode:[32]}]]]],n)));
1
+ import{p as n,b as t}from"./p-616d438d.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((n=>t([["p-7554f89f",[[1,"player-sms-verification",{endpoint:[513],userId:[513,"user-id"],lang:[513],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],tempBtnResendCount:[32],code:[32],errMsg:[32],msgEnterCode:[32]}]]]],n)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-sms-verification",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as e,h as t}from"./p-616d438d.js";const r={en:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},ro:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},fr:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},hu:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},tr:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},el:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},es:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},pt:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"},hr:{btnSend:"Send Code",btnResend:"Resend Code",btnActivate:"Activate",msgEnterCode:"Please enter the verification code you received on your number",msgResendNotice:"A new verification code has been sent to your phone number",errGenerateCode:"An error occurred while generating your code. Please click the resend button to generate a new code",errInvalidCode:"The code is incorrect",errExceededAttempts:"Too many attempts. Try again later",errExpiredToken:"The code expired, resend code"}},n=(e,t)=>r[void 0!==t?t:"en"][e],i=class{constructor(t){e(this,t),this.lang="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.code="",this.errMsg="",this.msgEnterCode="",this.btnResendCount=60,this.isCodeSentOnce=!1,this.isBtnSendAvailable=!0,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.stylingContainer.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.stylingContainer.prepend(t)}),1)})).catch((e=>{console.log("error ",e)}))}}updateClientStyling(){this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}componentWillLoad(){if(this.translationUrl)return e=this.translationUrl,new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let n in e[t])r[t][n]=e[t][n]})),t(!0)}))}));var e;this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL()}startTimerBtnResendCode(){this.isBtnSendAvailable=!1,this.tempBtnResendCount=this.btnResendCount,this.btnResendTimer=setInterval((()=>{this.tempBtnResendCount--,this.tempBtnResendCount<0&&(clearInterval(this.btnResendTimer),this.isBtnSendAvailable=!0)}),1e3)}setErrMsg(e){"INVALID_CODE"===e?this.errMsg="errInvalidCode":"BLOCK_USER_INCORRECT_CODE"===e?this.errMsg="errExceededAttempts":"ExpiredToken"===e?this.errMsg="errExpiredToken":"errGenerateCode"===e&&(this.errMsg="errGenerateCode")}debounce(e,t){return function(...r){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{e.apply(this,r)}),t)}}handleSendCode(){this.errMsg="";let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);const t={method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:`${this.userId}`})};fetch(e.href,t).then((()=>{this.msgEnterCode="msgEnterCode",this.isCodeSentOnce&&this.startTimerBtnResendCode(),this.isCodeSentOnce=!0})).catch((e=>{this.setErrMsg("errGenerateCode"),window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)}))}handleCheckCode(){let e=new URL(`${this.endpoint}/v1/player/legislation/generate2FACode`);e.searchParams.append("userId",this.userId),e.searchParams.append("code",this.code),fetch(e.href,{method:"GET",headers:{accept:"application/json"}}).then((e=>e.json())).then((e=>{200===e.httpStatusCode?(this.errMsg="",window.postMessage({type:"SmsVerificationSuccess"},window.location.href)):e.thirdPartyResponse&&(this.setErrMsg(e.thirdPartyResponse.message),"errExceededAttempts"===this.errMsg&&window.postMessage({type:"SmsVerificationErrExceededAttempts",data:n(this.errMsg)},window.location.href))})).catch((e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:e}},window.location.href)})).finally((()=>{this.code=""}))}handleInput(e){this.code=e.target.value}render(){return t("div",{class:"PlayerSmsVerification",ref:e=>this.stylingContainer=e},t("div",{class:"PlayerSmsVerificationContainer"},t("p",{class:"PlayerSmsVerificationMsg"+(this.msgEnterCode?"":" Hidden")},n(this.msgEnterCode,this.lang)),t("div",{class:"PlayerSmsVerificationInput"},t("input",{type:"text",onInput:e=>this.handleInput(e),value:this.code})),this.errMsg?t("p",{class:"PlayerSmsVerificationErrMsg"},n(this.errMsg,this.lang)):t("p",{class:"PlayerSmsVerificationMsg"+(!this.isBtnSendAvailable&&this.isCodeSentOnce?"":" Hidden")},n("msgResendNotice",this.lang))),t("div",{class:"PlayerSmsVerificationButtonContainer"},t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleSendCode.bind(this),850),disabled:!this.isBtnSendAvailable},this.isCodeSentOnce?this.isBtnSendAvailable?n("btnResend",this.lang):this.tempBtnResendCount:n("btnSend",this.lang)),t("button",{class:"PlayerSmsVerificationButton",onClick:this.debounce(this.handleCheckCode.bind(this),850),disabled:!this.isCodeSentOnce||""===this.code||void 0===this.code},n("btnActivate",this.lang))))}static get watchers(){return{clientStyling:["updateClientStyling"],clientStylingUrl:["updateClientStyling"]}}};i.style=":host{display:block}.PlayerSmsVerification{padding:30px;display:flex;align-items:center;flex-direction:column;background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8))}.PlayerSmsVerificationContainer{position:relative;width:100%;display:flex;flex-direction:column;margin-bottom:30px}.PlayerSmsVerificationButtonContainer{width:100%;display:flex;flex-direction:column;gap:25px}.PlayerSmsVerificationButton{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;font-family:inherit}.PlayerSmsVerificationButton:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);cursor:not-allowed}.PlayerSmsVerificationInput{color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B));display:flex;flex-direction:column;position:relative;width:100%}.PlayerSmsVerificationInput input{width:100%;height:44px;border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;text-align:center;line-height:18px;font-family:inherit}.PlayerSmsVerificationInput.Hidden{display:none}.PlayerSmsVerificationMsg{font-size:12px;color:var(--emfe-w-registration-contrast, var(--emfe-w-color-gray-300, #58586B))}.PlayerSmsVerificationMsg.Hidden{display:none}.PlayerSmsVerificationErrMsg{font-size:12px;color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909))}";export{i as player_sms_verification}