@everymatrix/player-sms-verification 0.0.1 → 1.30.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.
@@ -14,7 +14,7 @@ const TRANSLATIONS = {
14
14
  msgResendNotice: 'A new verification code has been sent to your phone number',
15
15
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
16
16
  errInvalidCode: 'The code is incorrect',
17
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
17
+ errExceededAttempts: 'Too many attempts. Try again later',
18
18
  errExpiredToken: 'The code expired, resend code'
19
19
  },
20
20
  ro: {
@@ -25,7 +25,7 @@ const TRANSLATIONS = {
25
25
  msgResendNotice: 'A new verification code has been sent to your phone number',
26
26
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
27
27
  errInvalidCode: 'The code is incorrect',
28
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
28
+ errExceededAttempts: 'Too many attempts. Try again later',
29
29
  errExpiredToken: 'The code expired, resend code'
30
30
  },
31
31
  fr: {
@@ -36,7 +36,7 @@ const TRANSLATIONS = {
36
36
  msgResendNotice: 'A new verification code has been sent to your phone number',
37
37
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
38
38
  errInvalidCode: 'The code is incorrect',
39
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
39
+ errExceededAttempts: 'Too many attempts. Try again later',
40
40
  errExpiredToken: 'The code expired, resend code'
41
41
  },
42
42
  hu: {
@@ -47,7 +47,7 @@ const TRANSLATIONS = {
47
47
  msgResendNotice: 'A new verification code has been sent to your phone number',
48
48
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
49
49
  errInvalidCode: 'The code is incorrect',
50
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
50
+ errExceededAttempts: 'Too many attempts. Try again later',
51
51
  errExpiredToken: 'The code expired, resend code'
52
52
  },
53
53
  tr: {
@@ -58,7 +58,7 @@ const TRANSLATIONS = {
58
58
  msgResendNotice: 'A new verification code has been sent to your phone number',
59
59
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
60
60
  errInvalidCode: 'The code is incorrect',
61
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
61
+ errExceededAttempts: 'Too many attempts. Try again later',
62
62
  errExpiredToken: 'The code expired, resend code'
63
63
  },
64
64
  el: {
@@ -69,7 +69,7 @@ const TRANSLATIONS = {
69
69
  msgResendNotice: 'A new verification code has been sent to your phone number',
70
70
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
71
71
  errInvalidCode: 'The code is incorrect',
72
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
72
+ errExceededAttempts: 'Too many attempts. Try again later',
73
73
  errExpiredToken: 'The code expired, resend code'
74
74
  },
75
75
  es: {
@@ -80,7 +80,7 @@ const TRANSLATIONS = {
80
80
  msgResendNotice: 'A new verification code has been sent to your phone number',
81
81
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
82
82
  errInvalidCode: 'The code is incorrect',
83
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
83
+ errExceededAttempts: 'Too many attempts. Try again later',
84
84
  errExpiredToken: 'The code expired, resend code'
85
85
  },
86
86
  pt: {
@@ -91,7 +91,7 @@ const TRANSLATIONS = {
91
91
  msgResendNotice: 'A new verification code has been sent to your phone number',
92
92
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
93
93
  errInvalidCode: 'The code is incorrect',
94
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
94
+ errExceededAttempts: 'Too many attempts. Try again later',
95
95
  errExpiredToken: 'The code expired, resend code'
96
96
  },
97
97
  hr: {
@@ -102,7 +102,7 @@ const TRANSLATIONS = {
102
102
  msgResendNotice: 'A new verification code has been sent to your phone number',
103
103
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
104
104
  errInvalidCode: 'The code is incorrect',
105
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
105
+ errExceededAttempts: 'Too many attempts. Try again later',
106
106
  errExpiredToken: 'The code expired, resend code'
107
107
  },
108
108
  };
@@ -270,7 +270,7 @@ const PlayerSmsVerification = class {
270
270
  else if (res.thirdPartyResponse) {
271
271
  this.setErrMsg(res.thirdPartyResponse.message);
272
272
  if (this.errMsg === 'errExceededAttempts') {
273
- window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
273
+ window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
274
274
  }
275
275
  }
276
276
  })
@@ -142,7 +142,7 @@ export class PlayerSmsVerification {
142
142
  else if (res.thirdPartyResponse) {
143
143
  this.setErrMsg(res.thirdPartyResponse.message);
144
144
  if (this.errMsg === 'errExceededAttempts') {
145
- window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
145
+ window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
146
146
  }
147
147
  }
148
148
  })
@@ -8,7 +8,7 @@ const TRANSLATIONS = {
8
8
  msgResendNotice: 'A new verification code has been sent to your phone number',
9
9
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
10
10
  errInvalidCode: 'The code is incorrect',
11
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
11
+ errExceededAttempts: 'Too many attempts. Try again later',
12
12
  errExpiredToken: 'The code expired, resend code'
13
13
  },
14
14
  ro: {
@@ -19,7 +19,7 @@ const TRANSLATIONS = {
19
19
  msgResendNotice: 'A new verification code has been sent to your phone number',
20
20
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
21
21
  errInvalidCode: 'The code is incorrect',
22
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
22
+ errExceededAttempts: 'Too many attempts. Try again later',
23
23
  errExpiredToken: 'The code expired, resend code'
24
24
  },
25
25
  fr: {
@@ -30,7 +30,7 @@ const TRANSLATIONS = {
30
30
  msgResendNotice: 'A new verification code has been sent to your phone number',
31
31
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
32
32
  errInvalidCode: 'The code is incorrect',
33
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
33
+ errExceededAttempts: 'Too many attempts. Try again later',
34
34
  errExpiredToken: 'The code expired, resend code'
35
35
  },
36
36
  hu: {
@@ -41,7 +41,7 @@ const TRANSLATIONS = {
41
41
  msgResendNotice: 'A new verification code has been sent to your phone number',
42
42
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
43
43
  errInvalidCode: 'The code is incorrect',
44
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
44
+ errExceededAttempts: 'Too many attempts. Try again later',
45
45
  errExpiredToken: 'The code expired, resend code'
46
46
  },
47
47
  tr: {
@@ -52,7 +52,7 @@ const TRANSLATIONS = {
52
52
  msgResendNotice: 'A new verification code has been sent to your phone number',
53
53
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
54
54
  errInvalidCode: 'The code is incorrect',
55
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
55
+ errExceededAttempts: 'Too many attempts. Try again later',
56
56
  errExpiredToken: 'The code expired, resend code'
57
57
  },
58
58
  el: {
@@ -63,7 +63,7 @@ const TRANSLATIONS = {
63
63
  msgResendNotice: 'A new verification code has been sent to your phone number',
64
64
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
65
65
  errInvalidCode: 'The code is incorrect',
66
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
66
+ errExceededAttempts: 'Too many attempts. Try again later',
67
67
  errExpiredToken: 'The code expired, resend code'
68
68
  },
69
69
  es: {
@@ -74,7 +74,7 @@ const TRANSLATIONS = {
74
74
  msgResendNotice: 'A new verification code has been sent to your phone number',
75
75
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
76
76
  errInvalidCode: 'The code is incorrect',
77
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
77
+ errExceededAttempts: 'Too many attempts. Try again later',
78
78
  errExpiredToken: 'The code expired, resend code'
79
79
  },
80
80
  pt: {
@@ -85,7 +85,7 @@ const TRANSLATIONS = {
85
85
  msgResendNotice: 'A new verification code has been sent to your phone number',
86
86
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
87
87
  errInvalidCode: 'The code is incorrect',
88
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
88
+ errExceededAttempts: 'Too many attempts. Try again later',
89
89
  errExpiredToken: 'The code expired, resend code'
90
90
  },
91
91
  hr: {
@@ -96,7 +96,7 @@ const TRANSLATIONS = {
96
96
  msgResendNotice: 'A new verification code has been sent to your phone number',
97
97
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
98
98
  errInvalidCode: 'The code is incorrect',
99
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
99
+ errExceededAttempts: 'Too many attempts. Try again later',
100
100
  errExpiredToken: 'The code expired, resend code'
101
101
  },
102
102
  };
@@ -10,7 +10,7 @@ const TRANSLATIONS = {
10
10
  msgResendNotice: 'A new verification code has been sent to your phone number',
11
11
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
12
12
  errInvalidCode: 'The code is incorrect',
13
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
13
+ errExceededAttempts: 'Too many attempts. Try again later',
14
14
  errExpiredToken: 'The code expired, resend code'
15
15
  },
16
16
  ro: {
@@ -21,7 +21,7 @@ const TRANSLATIONS = {
21
21
  msgResendNotice: 'A new verification code has been sent to your phone number',
22
22
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
23
23
  errInvalidCode: 'The code is incorrect',
24
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
24
+ errExceededAttempts: 'Too many attempts. Try again later',
25
25
  errExpiredToken: 'The code expired, resend code'
26
26
  },
27
27
  fr: {
@@ -32,7 +32,7 @@ const TRANSLATIONS = {
32
32
  msgResendNotice: 'A new verification code has been sent to your phone number',
33
33
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
34
34
  errInvalidCode: 'The code is incorrect',
35
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
35
+ errExceededAttempts: 'Too many attempts. Try again later',
36
36
  errExpiredToken: 'The code expired, resend code'
37
37
  },
38
38
  hu: {
@@ -43,7 +43,7 @@ const TRANSLATIONS = {
43
43
  msgResendNotice: 'A new verification code has been sent to your phone number',
44
44
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
45
45
  errInvalidCode: 'The code is incorrect',
46
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
46
+ errExceededAttempts: 'Too many attempts. Try again later',
47
47
  errExpiredToken: 'The code expired, resend code'
48
48
  },
49
49
  tr: {
@@ -54,7 +54,7 @@ const TRANSLATIONS = {
54
54
  msgResendNotice: 'A new verification code has been sent to your phone number',
55
55
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
56
56
  errInvalidCode: 'The code is incorrect',
57
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
57
+ errExceededAttempts: 'Too many attempts. Try again later',
58
58
  errExpiredToken: 'The code expired, resend code'
59
59
  },
60
60
  el: {
@@ -65,7 +65,7 @@ const TRANSLATIONS = {
65
65
  msgResendNotice: 'A new verification code has been sent to your phone number',
66
66
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
67
67
  errInvalidCode: 'The code is incorrect',
68
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
68
+ errExceededAttempts: 'Too many attempts. Try again later',
69
69
  errExpiredToken: 'The code expired, resend code'
70
70
  },
71
71
  es: {
@@ -76,7 +76,7 @@ const TRANSLATIONS = {
76
76
  msgResendNotice: 'A new verification code has been sent to your phone number',
77
77
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
78
78
  errInvalidCode: 'The code is incorrect',
79
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
79
+ errExceededAttempts: 'Too many attempts. Try again later',
80
80
  errExpiredToken: 'The code expired, resend code'
81
81
  },
82
82
  pt: {
@@ -87,7 +87,7 @@ const TRANSLATIONS = {
87
87
  msgResendNotice: 'A new verification code has been sent to your phone number',
88
88
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
89
89
  errInvalidCode: 'The code is incorrect',
90
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
90
+ errExceededAttempts: 'Too many attempts. Try again later',
91
91
  errExpiredToken: 'The code expired, resend code'
92
92
  },
93
93
  hr: {
@@ -98,7 +98,7 @@ const TRANSLATIONS = {
98
98
  msgResendNotice: 'A new verification code has been sent to your phone number',
99
99
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
100
100
  errInvalidCode: 'The code is incorrect',
101
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
101
+ errExceededAttempts: 'Too many attempts. Try again later',
102
102
  errExpiredToken: 'The code expired, resend code'
103
103
  },
104
104
  };
@@ -268,7 +268,7 @@ const PlayerSmsVerification$1 = /*@__PURE__*/ proxyCustomElement(class extends H
268
268
  else if (res.thirdPartyResponse) {
269
269
  this.setErrMsg(res.thirdPartyResponse.message);
270
270
  if (this.errMsg === 'errExceededAttempts') {
271
- window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
271
+ window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
272
272
  }
273
273
  }
274
274
  })
@@ -10,7 +10,7 @@ const TRANSLATIONS = {
10
10
  msgResendNotice: 'A new verification code has been sent to your phone number',
11
11
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
12
12
  errInvalidCode: 'The code is incorrect',
13
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
13
+ errExceededAttempts: 'Too many attempts. Try again later',
14
14
  errExpiredToken: 'The code expired, resend code'
15
15
  },
16
16
  ro: {
@@ -21,7 +21,7 @@ const TRANSLATIONS = {
21
21
  msgResendNotice: 'A new verification code has been sent to your phone number',
22
22
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
23
23
  errInvalidCode: 'The code is incorrect',
24
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
24
+ errExceededAttempts: 'Too many attempts. Try again later',
25
25
  errExpiredToken: 'The code expired, resend code'
26
26
  },
27
27
  fr: {
@@ -32,7 +32,7 @@ const TRANSLATIONS = {
32
32
  msgResendNotice: 'A new verification code has been sent to your phone number',
33
33
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
34
34
  errInvalidCode: 'The code is incorrect',
35
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
35
+ errExceededAttempts: 'Too many attempts. Try again later',
36
36
  errExpiredToken: 'The code expired, resend code'
37
37
  },
38
38
  hu: {
@@ -43,7 +43,7 @@ const TRANSLATIONS = {
43
43
  msgResendNotice: 'A new verification code has been sent to your phone number',
44
44
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
45
45
  errInvalidCode: 'The code is incorrect',
46
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
46
+ errExceededAttempts: 'Too many attempts. Try again later',
47
47
  errExpiredToken: 'The code expired, resend code'
48
48
  },
49
49
  tr: {
@@ -54,7 +54,7 @@ const TRANSLATIONS = {
54
54
  msgResendNotice: 'A new verification code has been sent to your phone number',
55
55
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
56
56
  errInvalidCode: 'The code is incorrect',
57
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
57
+ errExceededAttempts: 'Too many attempts. Try again later',
58
58
  errExpiredToken: 'The code expired, resend code'
59
59
  },
60
60
  el: {
@@ -65,7 +65,7 @@ const TRANSLATIONS = {
65
65
  msgResendNotice: 'A new verification code has been sent to your phone number',
66
66
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
67
67
  errInvalidCode: 'The code is incorrect',
68
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
68
+ errExceededAttempts: 'Too many attempts. Try again later',
69
69
  errExpiredToken: 'The code expired, resend code'
70
70
  },
71
71
  es: {
@@ -76,7 +76,7 @@ const TRANSLATIONS = {
76
76
  msgResendNotice: 'A new verification code has been sent to your phone number',
77
77
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
78
78
  errInvalidCode: 'The code is incorrect',
79
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
79
+ errExceededAttempts: 'Too many attempts. Try again later',
80
80
  errExpiredToken: 'The code expired, resend code'
81
81
  },
82
82
  pt: {
@@ -87,7 +87,7 @@ const TRANSLATIONS = {
87
87
  msgResendNotice: 'A new verification code has been sent to your phone number',
88
88
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
89
89
  errInvalidCode: 'The code is incorrect',
90
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
90
+ errExceededAttempts: 'Too many attempts. Try again later',
91
91
  errExpiredToken: 'The code expired, resend code'
92
92
  },
93
93
  hr: {
@@ -98,7 +98,7 @@ const TRANSLATIONS = {
98
98
  msgResendNotice: 'A new verification code has been sent to your phone number',
99
99
  errGenerateCode: 'An error occurred while generating your code. Please click the resend button to generate a new code',
100
100
  errInvalidCode: 'The code is incorrect',
101
- errExceededAttempts: 'You have exceeded the maximum number of tries. Please try again later',
101
+ errExceededAttempts: 'Too many attempts. Try again later',
102
102
  errExpiredToken: 'The code expired, resend code'
103
103
  },
104
104
  };
@@ -266,7 +266,7 @@ const PlayerSmsVerification = class {
266
266
  else if (res.thirdPartyResponse) {
267
267
  this.setErrMsg(res.thirdPartyResponse.message);
268
268
  if (this.errMsg === 'errExceededAttempts') {
269
- window.postMessage({ type: 'SmsVerificationErrExceededAttempts' }, window.location.href);
269
+ window.postMessage({ type: 'SmsVerificationErrExceededAttempts', data: translate(this.errMsg) }, window.location.href);
270
270
  }
271
271
  }
272
272
  })
@@ -0,0 +1 @@
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}
@@ -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-3bfbf014",[[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-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)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-sms-verification",
3
- "version": "0.0.1",
3
+ "version": "1.30.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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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:"You have exceeded the maximum number of tries. Please 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"},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")},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))}.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{n as player_sms_verification}