@everymatrix/user-action-controller 1.34.2 → 1.36.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.
@@ -19,7 +19,7 @@ const TRANSLATIONS$1 = {
19
19
  privacy: "Privacy Policy"
20
20
  },
21
21
  sms: "I consent to receive marketing communication via SMS.",
22
- email: "I consent to receive marketing communication via Email."
22
+ emailmarketing: "I consent to receive marketing communication via Email."
23
23
  },
24
24
  ro: {
25
25
  termsAndConditions: {
@@ -34,7 +34,7 @@ const TRANSLATIONS$1 = {
34
34
  privacy: "Politica de confidenţialitate"
35
35
  },
36
36
  sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
37
- email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
37
+ emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
38
38
  },
39
39
  hr: {
40
40
  termsAndConditions: {
@@ -49,7 +49,7 @@ const TRANSLATIONS$1 = {
49
49
  privacy: "Privacy Policy"
50
50
  },
51
51
  sms: "I consent to receive marketing communication via SMS.",
52
- email: "I consent to receive marketing communication via Email."
52
+ emailmarketing: "I consent to receive marketing communication via Email."
53
53
  },
54
54
  fr: {
55
55
  termsAndConditions: {
@@ -64,7 +64,7 @@ const TRANSLATIONS$1 = {
64
64
  privacy: "Privacy Policy"
65
65
  },
66
66
  sms: "I consent to receive marketing communication via SMS.",
67
- email: "I consent to receive marketing communication via Email."
67
+ emailmarketing: "I consent to receive marketing communication via Email."
68
68
  },
69
69
  cs: {
70
70
  termsAndConditions: {
@@ -79,7 +79,7 @@ const TRANSLATIONS$1 = {
79
79
  privacy: "Privacy Policy"
80
80
  },
81
81
  sms: "I consent to receive marketing communication via SMS.",
82
- email: "I consent to receive marketing communication via Email."
82
+ emailmarketing: "I consent to receive marketing communication via Email."
83
83
  },
84
84
  de: {
85
85
  termsAndConditions: {
@@ -94,7 +94,7 @@ const TRANSLATIONS$1 = {
94
94
  privacy: "Privacy Policy"
95
95
  },
96
96
  sms: "I consent to receive marketing communication via SMS.",
97
- email: "I consent to receive marketing communication via Email."
97
+ emailmarketing: "I consent to receive marketing communication via Email."
98
98
  },
99
99
  };
100
100
  const getTranslations$1 = (url) => {
@@ -237,37 +237,37 @@ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
237
237
  const TRANSLATIONS = {
238
238
  en: {
239
239
  termsandconditions: 'Terms and Conditions',
240
- sms: 'SMS marketing',
240
+ sms: 'Marketing Consents',
241
241
  emailmarketing: 'Email marketing',
242
242
  privacypolicy: 'Privacy Policy'
243
243
  },
244
244
  ro: {
245
245
  termsandconditions: 'Termeni şi condiţii',
246
- sms: 'SMS marketing',
246
+ sms: 'Marketing Consents',
247
247
  emailmarketing: 'Email marketing',
248
248
  privacypolicy: 'Privacy Policy'
249
249
  },
250
250
  hr: {
251
251
  termsandconditions: 'Terms and Conditions',
252
- sms: 'SMS marketing',
252
+ sms: 'Marketing Consents',
253
253
  emailmarketing: 'Email marketing',
254
254
  privacypolicy: 'Privacy Policy'
255
255
  },
256
256
  fr: {
257
257
  termsandconditions: 'Terms and Conditions',
258
- sms: 'SMS marketing',
258
+ sms: 'Marketing Consents',
259
259
  emailmarketing: 'Email marketing',
260
260
  privacypolicy: 'Privacy Policy'
261
261
  },
262
262
  cs: {
263
263
  termsandconditions: 'Terms and Conditions',
264
- sms: 'SMS marketing',
264
+ sms: 'Marketing Consents',
265
265
  emailmarketing: 'Email marketing',
266
266
  privacypolicy: 'Privacy Policy'
267
267
  },
268
268
  de: {
269
269
  termsandconditions: 'Terms and Conditions',
270
- sms: 'SMS marketing',
270
+ sms: 'Marketing Consents',
271
271
  emailmarketing: 'Email marketing',
272
272
  privacypolicy: 'Privacy Policy'
273
273
  },
@@ -299,7 +299,7 @@ const translate = (key, customLang, values) => {
299
299
  return translation;
300
300
  };
301
301
 
302
- const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
302
+ const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
303
303
 
304
304
  const UserActionController = class {
305
305
  constructor(hostRef) {
@@ -500,18 +500,20 @@ const UserActionController = class {
500
500
  }
501
501
  render() {
502
502
  let mandatoryItems = 0;
503
- const isMandatoryPresent = this.mandatoryActions.some(action => {
503
+ this.mandatoryActions.map(action => {
504
504
  const isPresent = this.activeUserActions.includes(action);
505
505
  if (isPresent) {
506
506
  mandatoryItems++;
507
507
  }
508
- return isPresent;
509
508
  });
509
+ const isMandatoryPresent = mandatoryItems > 0 ? true : false;
510
510
  this.userActionsValidated = isMandatoryPresent && (this.mandatoryActionsChecked === mandatoryItems);
511
- return (index.h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (index.h("slot", { name: 'spinner' })
512
- &&
513
- index.h("svg", { class: "spinner", viewBox: "0 0 50 50" }, index.h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (index.h("div", { class: "UserActionController" }, index.h("h2", { class: "UserConsentNotice" }, this.userNoticeText), index.h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (index.h("slot", { name: action }, index.h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, slot: action, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
514
- index.h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
511
+ if (isMandatoryPresent) {
512
+ return (index.h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (index.h("slot", { name: 'spinner' })
513
+ &&
514
+ index.h("svg", { class: "spinner", viewBox: "0 0 50 50" }, index.h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (index.h("div", { class: "UserActionController" }, index.h("h2", { class: "UserConsentNotice" }, this.userNoticeText), index.h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (index.h("slot", { name: action }, index.h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
515
+ index.h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
516
+ }
515
517
  }
516
518
  static get watchers() { return {
517
519
  "translationUrl": ["handleNewTranslations"],
@@ -40,10 +40,12 @@
40
40
  color: #000;
41
41
  border-radius: 5px;
42
42
  align-self: flex-end;
43
+ cursor: pointer;
43
44
  }
44
45
  .ConsentSubmitButton:disabled {
45
46
  border: 2px solid #ccc;
46
47
  color: #ccc;
48
+ cursor: unset;
47
49
  }
48
50
 
49
51
  @media screen and (max-width: 320px) {
@@ -199,23 +199,25 @@ export class UserActionController {
199
199
  }
200
200
  render() {
201
201
  let mandatoryItems = 0;
202
- const isMandatoryPresent = this.mandatoryActions.some(action => {
202
+ this.mandatoryActions.map(action => {
203
203
  const isPresent = this.activeUserActions.includes(action);
204
204
  if (isPresent) {
205
205
  mandatoryItems++;
206
206
  }
207
- return isPresent;
208
207
  });
208
+ const isMandatoryPresent = mandatoryItems > 0 ? true : false;
209
209
  this.userActionsValidated = isMandatoryPresent && (this.mandatoryActionsChecked === mandatoryItems);
210
- return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
211
- &&
212
- h("svg", { class: "spinner", viewBox: "0 0 50 50" },
213
- h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" },
214
- h("h2", { class: "UserConsentNotice" }, this.userNoticeText),
215
- h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action },
216
- h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, slot: action, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))),
217
- this.includeSubmitButton &&
218
- h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
210
+ if (isMandatoryPresent) {
211
+ return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
212
+ &&
213
+ h("svg", { class: "spinner", viewBox: "0 0 50 50" },
214
+ h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" },
215
+ h("h2", { class: "UserConsentNotice" }, this.userNoticeText),
216
+ h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action },
217
+ h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))),
218
+ this.includeSubmitButton &&
219
+ h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
220
+ }
219
221
  }
220
222
  static get is() { return "user-action-controller"; }
221
223
  static get encapsulation() { return "shadow"; }
@@ -3,37 +3,37 @@ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
3
3
  const TRANSLATIONS = {
4
4
  en: {
5
5
  termsandconditions: 'Terms and Conditions',
6
- sms: 'SMS marketing',
6
+ sms: 'Marketing Consents',
7
7
  emailmarketing: 'Email marketing',
8
8
  privacypolicy: 'Privacy Policy'
9
9
  },
10
10
  ro: {
11
11
  termsandconditions: 'Termeni şi condiţii',
12
- sms: 'SMS marketing',
12
+ sms: 'Marketing Consents',
13
13
  emailmarketing: 'Email marketing',
14
14
  privacypolicy: 'Privacy Policy'
15
15
  },
16
16
  hr: {
17
17
  termsandconditions: 'Terms and Conditions',
18
- sms: 'SMS marketing',
18
+ sms: 'Marketing Consents',
19
19
  emailmarketing: 'Email marketing',
20
20
  privacypolicy: 'Privacy Policy'
21
21
  },
22
22
  fr: {
23
23
  termsandconditions: 'Terms and Conditions',
24
- sms: 'SMS marketing',
24
+ sms: 'Marketing Consents',
25
25
  emailmarketing: 'Email marketing',
26
26
  privacypolicy: 'Privacy Policy'
27
27
  },
28
28
  cs: {
29
29
  termsandconditions: 'Terms and Conditions',
30
- sms: 'SMS marketing',
30
+ sms: 'Marketing Consents',
31
31
  emailmarketing: 'Email marketing',
32
32
  privacypolicy: 'Privacy Policy'
33
33
  },
34
34
  de: {
35
35
  termsandconditions: 'Terms and Conditions',
36
- sms: 'SMS marketing',
36
+ sms: 'Marketing Consents',
37
37
  emailmarketing: 'Email marketing',
38
38
  privacypolicy: 'Privacy Policy'
39
39
  },
@@ -15,7 +15,7 @@ const TRANSLATIONS = {
15
15
  privacy: "Privacy Policy"
16
16
  },
17
17
  sms: "I consent to receive marketing communication via SMS.",
18
- email: "I consent to receive marketing communication via Email."
18
+ emailmarketing: "I consent to receive marketing communication via Email."
19
19
  },
20
20
  ro: {
21
21
  termsAndConditions: {
@@ -30,7 +30,7 @@ const TRANSLATIONS = {
30
30
  privacy: "Politica de confidenţialitate"
31
31
  },
32
32
  sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
33
- email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
33
+ emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
34
34
  },
35
35
  hr: {
36
36
  termsAndConditions: {
@@ -45,7 +45,7 @@ const TRANSLATIONS = {
45
45
  privacy: "Privacy Policy"
46
46
  },
47
47
  sms: "I consent to receive marketing communication via SMS.",
48
- email: "I consent to receive marketing communication via Email."
48
+ emailmarketing: "I consent to receive marketing communication via Email."
49
49
  },
50
50
  fr: {
51
51
  termsAndConditions: {
@@ -60,7 +60,7 @@ const TRANSLATIONS = {
60
60
  privacy: "Privacy Policy"
61
61
  },
62
62
  sms: "I consent to receive marketing communication via SMS.",
63
- email: "I consent to receive marketing communication via Email."
63
+ emailmarketing: "I consent to receive marketing communication via Email."
64
64
  },
65
65
  cs: {
66
66
  termsAndConditions: {
@@ -75,7 +75,7 @@ const TRANSLATIONS = {
75
75
  privacy: "Privacy Policy"
76
76
  },
77
77
  sms: "I consent to receive marketing communication via SMS.",
78
- email: "I consent to receive marketing communication via Email."
78
+ emailmarketing: "I consent to receive marketing communication via Email."
79
79
  },
80
80
  de: {
81
81
  termsAndConditions: {
@@ -90,7 +90,7 @@ const TRANSLATIONS = {
90
90
  privacy: "Privacy Policy"
91
91
  },
92
92
  sms: "I consent to receive marketing communication via SMS.",
93
- email: "I consent to receive marketing communication via Email."
93
+ emailmarketing: "I consent to receive marketing communication via Email."
94
94
  },
95
95
  };
96
96
  const getTranslations = (url) => {
@@ -6,37 +6,37 @@ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
6
6
  const TRANSLATIONS = {
7
7
  en: {
8
8
  termsandconditions: 'Terms and Conditions',
9
- sms: 'SMS marketing',
9
+ sms: 'Marketing Consents',
10
10
  emailmarketing: 'Email marketing',
11
11
  privacypolicy: 'Privacy Policy'
12
12
  },
13
13
  ro: {
14
14
  termsandconditions: 'Termeni şi condiţii',
15
- sms: 'SMS marketing',
15
+ sms: 'Marketing Consents',
16
16
  emailmarketing: 'Email marketing',
17
17
  privacypolicy: 'Privacy Policy'
18
18
  },
19
19
  hr: {
20
20
  termsandconditions: 'Terms and Conditions',
21
- sms: 'SMS marketing',
21
+ sms: 'Marketing Consents',
22
22
  emailmarketing: 'Email marketing',
23
23
  privacypolicy: 'Privacy Policy'
24
24
  },
25
25
  fr: {
26
26
  termsandconditions: 'Terms and Conditions',
27
- sms: 'SMS marketing',
27
+ sms: 'Marketing Consents',
28
28
  emailmarketing: 'Email marketing',
29
29
  privacypolicy: 'Privacy Policy'
30
30
  },
31
31
  cs: {
32
32
  termsandconditions: 'Terms and Conditions',
33
- sms: 'SMS marketing',
33
+ sms: 'Marketing Consents',
34
34
  emailmarketing: 'Email marketing',
35
35
  privacypolicy: 'Privacy Policy'
36
36
  },
37
37
  de: {
38
38
  termsandconditions: 'Terms and Conditions',
39
- sms: 'SMS marketing',
39
+ sms: 'Marketing Consents',
40
40
  emailmarketing: 'Email marketing',
41
41
  privacypolicy: 'Privacy Policy'
42
42
  },
@@ -68,7 +68,7 @@ const translate = (key, customLang, values) => {
68
68
  return translation;
69
69
  };
70
70
 
71
- const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
71
+ const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
72
72
 
73
73
  const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
74
74
  constructor() {
@@ -271,18 +271,20 @@ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
271
271
  }
272
272
  render() {
273
273
  let mandatoryItems = 0;
274
- const isMandatoryPresent = this.mandatoryActions.some(action => {
274
+ this.mandatoryActions.map(action => {
275
275
  const isPresent = this.activeUserActions.includes(action);
276
276
  if (isPresent) {
277
277
  mandatoryItems++;
278
278
  }
279
- return isPresent;
280
279
  });
280
+ const isMandatoryPresent = mandatoryItems > 0 ? true : false;
281
281
  this.userActionsValidated = isMandatoryPresent && (this.mandatoryActionsChecked === mandatoryItems);
282
- return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
283
- &&
284
- h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" }, h("h2", { class: "UserConsentNotice" }, this.userNoticeText), h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action }, h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, slot: action, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
285
- h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
282
+ if (isMandatoryPresent) {
283
+ return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
284
+ &&
285
+ h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" }, h("h2", { class: "UserConsentNotice" }, this.userNoticeText), h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action }, h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
286
+ h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
287
+ }
286
288
  }
287
289
  static get watchers() { return {
288
290
  "translationUrl": ["handleNewTranslations"],
@@ -15,7 +15,7 @@ const TRANSLATIONS$1 = {
15
15
  privacy: "Privacy Policy"
16
16
  },
17
17
  sms: "I consent to receive marketing communication via SMS.",
18
- email: "I consent to receive marketing communication via Email."
18
+ emailmarketing: "I consent to receive marketing communication via Email."
19
19
  },
20
20
  ro: {
21
21
  termsAndConditions: {
@@ -30,7 +30,7 @@ const TRANSLATIONS$1 = {
30
30
  privacy: "Politica de confidenţialitate"
31
31
  },
32
32
  sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
33
- email: "Sunt de acord să primesc promoţii de marketing pe e-mail."
33
+ emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
34
34
  },
35
35
  hr: {
36
36
  termsAndConditions: {
@@ -45,7 +45,7 @@ const TRANSLATIONS$1 = {
45
45
  privacy: "Privacy Policy"
46
46
  },
47
47
  sms: "I consent to receive marketing communication via SMS.",
48
- email: "I consent to receive marketing communication via Email."
48
+ emailmarketing: "I consent to receive marketing communication via Email."
49
49
  },
50
50
  fr: {
51
51
  termsAndConditions: {
@@ -60,7 +60,7 @@ const TRANSLATIONS$1 = {
60
60
  privacy: "Privacy Policy"
61
61
  },
62
62
  sms: "I consent to receive marketing communication via SMS.",
63
- email: "I consent to receive marketing communication via Email."
63
+ emailmarketing: "I consent to receive marketing communication via Email."
64
64
  },
65
65
  cs: {
66
66
  termsAndConditions: {
@@ -75,7 +75,7 @@ const TRANSLATIONS$1 = {
75
75
  privacy: "Privacy Policy"
76
76
  },
77
77
  sms: "I consent to receive marketing communication via SMS.",
78
- email: "I consent to receive marketing communication via Email."
78
+ emailmarketing: "I consent to receive marketing communication via Email."
79
79
  },
80
80
  de: {
81
81
  termsAndConditions: {
@@ -90,7 +90,7 @@ const TRANSLATIONS$1 = {
90
90
  privacy: "Privacy Policy"
91
91
  },
92
92
  sms: "I consent to receive marketing communication via SMS.",
93
- email: "I consent to receive marketing communication via Email."
93
+ emailmarketing: "I consent to receive marketing communication via Email."
94
94
  },
95
95
  };
96
96
  const getTranslations$1 = (url) => {
@@ -233,37 +233,37 @@ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
233
233
  const TRANSLATIONS = {
234
234
  en: {
235
235
  termsandconditions: 'Terms and Conditions',
236
- sms: 'SMS marketing',
236
+ sms: 'Marketing Consents',
237
237
  emailmarketing: 'Email marketing',
238
238
  privacypolicy: 'Privacy Policy'
239
239
  },
240
240
  ro: {
241
241
  termsandconditions: 'Termeni şi condiţii',
242
- sms: 'SMS marketing',
242
+ sms: 'Marketing Consents',
243
243
  emailmarketing: 'Email marketing',
244
244
  privacypolicy: 'Privacy Policy'
245
245
  },
246
246
  hr: {
247
247
  termsandconditions: 'Terms and Conditions',
248
- sms: 'SMS marketing',
248
+ sms: 'Marketing Consents',
249
249
  emailmarketing: 'Email marketing',
250
250
  privacypolicy: 'Privacy Policy'
251
251
  },
252
252
  fr: {
253
253
  termsandconditions: 'Terms and Conditions',
254
- sms: 'SMS marketing',
254
+ sms: 'Marketing Consents',
255
255
  emailmarketing: 'Email marketing',
256
256
  privacypolicy: 'Privacy Policy'
257
257
  },
258
258
  cs: {
259
259
  termsandconditions: 'Terms and Conditions',
260
- sms: 'SMS marketing',
260
+ sms: 'Marketing Consents',
261
261
  emailmarketing: 'Email marketing',
262
262
  privacypolicy: 'Privacy Policy'
263
263
  },
264
264
  de: {
265
265
  termsandconditions: 'Terms and Conditions',
266
- sms: 'SMS marketing',
266
+ sms: 'Marketing Consents',
267
267
  emailmarketing: 'Email marketing',
268
268
  privacypolicy: 'Privacy Policy'
269
269
  },
@@ -295,7 +295,7 @@ const translate = (key, customLang, values) => {
295
295
  return translation;
296
296
  };
297
297
 
298
- const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
298
+ const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
299
299
 
300
300
  const UserActionController = class {
301
301
  constructor(hostRef) {
@@ -496,18 +496,20 @@ const UserActionController = class {
496
496
  }
497
497
  render() {
498
498
  let mandatoryItems = 0;
499
- const isMandatoryPresent = this.mandatoryActions.some(action => {
499
+ this.mandatoryActions.map(action => {
500
500
  const isPresent = this.activeUserActions.includes(action);
501
501
  if (isPresent) {
502
502
  mandatoryItems++;
503
503
  }
504
- return isPresent;
505
504
  });
505
+ const isMandatoryPresent = mandatoryItems > 0 ? true : false;
506
506
  this.userActionsValidated = isMandatoryPresent && (this.mandatoryActionsChecked === mandatoryItems);
507
- return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
508
- &&
509
- h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" }, h("h2", { class: "UserConsentNotice" }, this.userNoticeText), h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action }, h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, slot: action, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
510
- h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
507
+ if (isMandatoryPresent) {
508
+ return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
509
+ &&
510
+ h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" }, h("h2", { class: "UserConsentNotice" }, this.userNoticeText), h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action }, h("player-user-consents", { lang: this.lang, "gm-version": this.gmVersion, "translation-url": this.translationUrl, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
511
+ h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
512
+ }
511
513
  }
512
514
  static get watchers() { return {
513
515
  "translationUrl": ["handleNewTranslations"],
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-ba444709.js";const s={en:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},ro:{termsAndConditions:{acceptPart1:"Accept ",acceptPart2:" platformei. Am citit şi înţeles ",acceptPart3:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",tc:"Termenii şi condiţiile"},privacyPolicy:{readUnderstandPart1:"Am citit şi înţeles ",readUnderstandPart2:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",privacy:"Politica de confidenţialitate"},sms:"Sunt de acord să primesc promoţii de marketing prin SMS.",emailmarketing:"Sunt de acord să primesc promoţii de marketing pe e-mail."},hr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},fr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},cs:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},de:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."}},n=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])s[e][i]=t[e][i]})),e(!0)}))})),a=(t,e,i)=>{let n=(a=s[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),a));var a;if(null===n)return t;if(void 0!==i)for(const[t,e]of Object.entries(i)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},r=class{constructor(i){t(this,i),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1,this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}handleNewTranslations(){n(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await n(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}determineTextContent(){if("gmcore"===this.gmVersion&&"termsandconditions"===this.consentType)return i("p",null,a("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},a("termsAndConditions.tc",this.lang)),a("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacy",this.lang)),a("termsAndConditions.acceptPart3",this.lang));if("gm16"===this.gmVersion){if("termsandconditions"===this.consentType)return i("p",null,a("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},a("termsAndConditions.tc",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,a("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacy",this.lang)),a("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,a(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{ref:t=>this.stylingContainer=t},i("p",{class:"ConsentTitle"},this.consentTitle),i("label",{class:"UserConsent",htmlFor:"userConsent"},i("input",{ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};r.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";const o=["ro","en","cz","de","hr"],c={en:{termsandconditions:"Terms and Conditions",sms:"Marketing Consents",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},ro:{termsandconditions:"Termeni şi condiţii",sms:"Marketing Consents",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},hr:{termsandconditions:"Terms and Conditions",sms:"Marketing Consents",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},fr:{termsandconditions:"Terms and Conditions",sms:"Marketing Consents",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},cs:{termsandconditions:"Terms and Conditions",sms:"Marketing Consents",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},de:{termsandconditions:"Terms and Conditions",sms:"Marketing Consents",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"}},d=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])c[e][i]=t[e][i]})),e(!0)}))})),h=(t,e,i)=>{const s=e;let n=c[void 0!==s&&o.includes(s)?s:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},l=class{constructor(e){t(this,e),this.lang="en",this.gmVersion="",this.translationUrl="",this.clientStyling="",this.clientStylingUrl="",this.queryFired=!1,this.readyActionsCount=0,this.activeUserActions=[],this.userActionsValidated=!0,this.receivedQueryResponses=0,this.limitStylingAppends=!1,this.isLoading=!0,this.mandatoryActionsChecked=0,this.mandatoryActions=["termsandconditions","privacypolicy"],this.userActions=[],this.consentTitles={termsandconditions:h("termsandconditions",this.lang),sms:h("sms",this.lang),emailmarketing:h("emailmarketing",this.lang),privacypolicy:h("privacypolicy",this.lang)},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStyling=t,e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}handleNewTranslations(){d(this.translationUrl)}handleQueryResponse(){this.receivedQueryResponses===this.activeUserActions.length&&this.updateUserConsents()}userLegislationConsentHandler(t){const e=t.detail.type,i=t.detail.value;this.mandatoryActions.includes(e)&&!1===this.queryFired&&(!0===i?this.mandatoryActionsChecked++:this.mandatoryActionsChecked--),this.queryFired&&(this.userActions.push({tagCode:e,status:i?"Accepted":"Denied"}),this.receivedQueryResponses++)}determineUserActionsCore(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/consent`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.items.forEach((t=>{"Expired"===t.status&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1}))}determineUserActions16(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.consents.forEach((t=>{2===t.status&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1}))}updateUserConsents(){const t="gmcore"===this.gmVersion?new URL(`${this.endpoint}/v1/player/${this.userId}/consent`):new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);let e={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-SessionId":`${this.userSession}`},body:JSON.stringify({items:this.userActions})};fetch(t.href,e).then((t=>t.json())).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:"Consent update successful!"}},window.location.href)})).catch((t=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Server might not be responding",err:t}},window.location.href)})).finally((()=>{window.postMessage({type:"UserActionsCompleted"},window.location.href)}))}handleApplyClick(){this.queryFired=!0}async componentWillLoad(){"gmcore"===this.gmVersion&&this.determineUserActionsCore(),"gm16"===this.gmVersion&&this.determineUserActions16(),this.translationUrl.length>2&&await d(this.translationUrl)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let t=0;this.mandatoryActions.map((e=>{this.activeUserActions.includes(e)&&t++}));const e=t>0;if(this.userActionsValidated=e&&this.mandatoryActionsChecked===t,e)return i("div",{class:"QueryReferenceContainer",ref:t=>this.stylingContainer=t},this.isLoading?i("slot",{name:"spinner"})&&i("svg",{class:"spinner",viewBox:"0 0 50 50"},i("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})):i("div",{class:"UserActionController"},i("h2",{class:"UserConsentNotice"},this.userNoticeText),i("div",{class:"PlayerLegislationWrapper"},this.activeUserActions.map((t=>i("slot",{name:t},i("player-user-consents",{lang:this.lang,"gm-version":this.gmVersion,"translation-url":this.translationUrl,consentType:t,consentTitle:this.consentTitles[t],queried:this.queryFired,mandatory:this.mandatoryActions.includes(t),"client-styling":this.clientStyling}))))),this.includeSubmitButton&&i("button",{class:"ConsentSubmitButton",disabled:!this.userActionsValidated,onClick:()=>this.handleApplyClick()},this.submitButtonText)))}static get watchers(){return{translationUrl:["handleNewTranslations"],receivedQueryResponses:["handleQueryResponse"]}}};l.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end;cursor:pointer}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc;cursor:unset}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";export{r as player_user_consents,l as user_action_controller}
@@ -1 +1 @@
1
- import{p as t,b as n}from"./p-ba444709.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((t=>n([["p-02211033",[[1,"user-action-controller",{endpoint:[513],userSession:[513,"user-session"],userId:[513,"user-id"],lang:[1537],includeSubmitButton:[516,"include-submit-button"],submitButtonText:[513,"submit-button-text"],userNoticeText:[513,"user-notice-text"],gmVersion:[1,"gm-version"],translationUrl:[513,"translation-url"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],queryFired:[32],readyActionsCount:[32],activeUserActions:[32],userActionsValidated:[32],receivedQueryResponses:[32],limitStylingAppends:[32],isLoading:[32],mandatoryActionsChecked:[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-user-consents",{lang:[1537],queried:[516],consentType:[513,"consent-type"],mandatory:[516],gmVersion:[1,"gm-version"],consentTitle:[513,"consent-title"],clientStyling:[1,"client-styling"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]}]]]],t)));
1
+ import{p as t,b as n}from"./p-ba444709.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((t=>n([["p-8d21aa72",[[1,"user-action-controller",{endpoint:[513],userSession:[513,"user-session"],userId:[513,"user-id"],lang:[1537],includeSubmitButton:[516,"include-submit-button"],submitButtonText:[513,"submit-button-text"],userNoticeText:[513,"user-notice-text"],gmVersion:[1,"gm-version"],translationUrl:[513,"translation-url"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],queryFired:[32],readyActionsCount:[32],activeUserActions:[32],userActionsValidated:[32],receivedQueryResponses:[32],limitStylingAppends:[32],isLoading:[32],mandatoryActionsChecked:[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-user-consents",{lang:[1537],queried:[516],consentType:[513,"consent-type"],mandatory:[516],gmVersion:[1,"gm-version"],consentTitle:[513,"consent-title"],clientStyling:[1,"client-styling"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]}]]]],t)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-action-controller",
3
- "version": "1.34.2",
3
+ "version": "1.36.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i}from"./p-ba444709.js";const s={en:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},ro:{termsAndConditions:{acceptPart1:"Accept ",acceptPart2:" platformei. Am citit şi înţeles ",acceptPart3:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",tc:"Termenii şi condiţiile"},privacyPolicy:{readUnderstandPart1:"Am citit şi înţeles ",readUnderstandPart2:" publicată pe acest site şi confirm că am vârstă peste 18 ani.",privacy:"Politica de confidenţialitate"},sms:"Sunt de acord să primesc promoţii de marketing prin SMS.",email:"Sunt de acord să primesc promoţii de marketing pe e-mail."},hr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},fr:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},cs:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."},de:{termsAndConditions:{acceptPart1:"I accept the ",acceptPart2:", I have read and understood the ",acceptPart3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions"},privacyPolicy:{readUnderstandPart1:"I have read and understood the ",readUnderstandPart2:", as published on this site and confirm that I am over 18 years old.",privacy:"Privacy Policy"},sms:"I consent to receive marketing communication via SMS.",email:"I consent to receive marketing communication via Email."}},n=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])s[e][i]=t[e][i]})),e(!0)}))})),a=(t,e,i)=>{let n=(a=s[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),a));var a;if(null===n)return t;if(void 0!==i)for(const[t,e]of Object.entries(i)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},r=class{constructor(i){t(this,i),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1,this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}handleNewTranslations(){n(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await n(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}determineTextContent(){if("gmcore"===this.gmVersion&&"termsandconditions"===this.consentType)return i("p",null,a("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},a("termsAndConditions.tc",this.lang)),a("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacy",this.lang)),a("termsAndConditions.acceptPart3",this.lang));if("gm16"===this.gmVersion){if("termsandconditions"===this.consentType)return i("p",null,a("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},a("termsAndConditions.tc",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,a("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacy",this.lang)),a("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,a(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{ref:t=>this.stylingContainer=t},i("p",{class:"ConsentTitle"},this.consentTitle),i("label",{class:"UserConsent",htmlFor:"userConsent"},i("input",{ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};r.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";const o=["ro","en","cz","de","hr"],c={en:{termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},ro:{termsandconditions:"Termeni şi condiţii",sms:"SMS marketing",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},hr:{termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},fr:{termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},cs:{termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"},de:{termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing",privacypolicy:"Privacy Policy"}},d=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])c[e][i]=t[e][i]})),e(!0)}))})),h=(t,e,i)=>{const s=e;let n=c[void 0!==s&&o.includes(s)?s:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");n=n.replace(i,e)}return n},l=class{constructor(e){t(this,e),this.lang="en",this.gmVersion="",this.translationUrl="",this.clientStyling="",this.clientStylingUrl="",this.queryFired=!1,this.readyActionsCount=0,this.activeUserActions=[],this.userActionsValidated=!0,this.receivedQueryResponses=0,this.limitStylingAppends=!1,this.isLoading=!0,this.mandatoryActionsChecked=0,this.mandatoryActions=["termsandconditions","privacypolicy"],this.userActions=[],this.consentTitles={termsandconditions:h("termsandconditions",this.lang),sms:h("sms",this.lang),emailmarketing:h("emailmarketing",this.lang),privacypolicy:h("privacypolicy",this.lang)},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStyling=t,e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}handleNewTranslations(){d(this.translationUrl)}handleQueryResponse(){this.receivedQueryResponses===this.activeUserActions.length&&this.updateUserConsents()}userLegislationConsentHandler(t){const e=t.detail.type,i=t.detail.value;this.mandatoryActions.includes(e)&&!1===this.queryFired&&(!0===i?this.mandatoryActionsChecked++:this.mandatoryActionsChecked--),this.queryFired&&(this.userActions.push({tagCode:e,status:i?"Accepted":"Denied"}),this.receivedQueryResponses++)}determineUserActionsCore(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/consent`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.items.forEach((t=>{"Expired"===t.status&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1}))}determineUserActions16(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;return e.append("X-SessionId",this.userSession),fetch(t.href,{method:"GET",headers:e}).then((t=>t.json())).then((t=>{t.consents.forEach((t=>{2===t.status&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1}))}updateUserConsents(){const t="gmcore"===this.gmVersion?new URL(`${this.endpoint}/v1/player/${this.userId}/consent`):new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);let e={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-SessionId":`${this.userSession}`},body:JSON.stringify({items:this.userActions})};fetch(t.href,e).then((t=>t.json())).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:"Consent update successful!"}},window.location.href)})).catch((t=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Server might not be responding",err:t}},window.location.href)})).finally((()=>{window.postMessage({type:"UserActionsCompleted"},window.location.href)}))}handleApplyClick(){this.queryFired=!0}async componentWillLoad(){"gmcore"===this.gmVersion&&this.determineUserActionsCore(),"gm16"===this.gmVersion&&this.determineUserActions16(),this.translationUrl.length>2&&await d(this.translationUrl)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){let t=0;const e=this.mandatoryActions.some((e=>{const i=this.activeUserActions.includes(e);return i&&t++,i}));return this.userActionsValidated=e&&this.mandatoryActionsChecked===t,i("div",{class:"QueryReferenceContainer",ref:t=>this.stylingContainer=t},this.isLoading?i("slot",{name:"spinner"})&&i("svg",{class:"spinner",viewBox:"0 0 50 50"},i("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})):i("div",{class:"UserActionController"},i("h2",{class:"UserConsentNotice"},this.userNoticeText),i("div",{class:"PlayerLegislationWrapper"},this.activeUserActions.map((t=>i("slot",{name:t},i("player-user-consents",{lang:this.lang,"gm-version":this.gmVersion,"translation-url":this.translationUrl,slot:t,consentType:t,consentTitle:this.consentTitles[t],queried:this.queryFired,mandatory:this.mandatoryActions.includes(t),"client-styling":this.clientStyling}))))),this.includeSubmitButton&&i("button",{class:"ConsentSubmitButton",disabled:!this.userActionsValidated,onClick:()=>this.handleApplyClick()},this.submitButtonText)))}static get watchers(){return{translationUrl:["handleNewTranslations"],receivedQueryResponses:["handleQueryResponse"]}}};l.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";export{r as player_user_consents,l as user_action_controller}