@everymatrix/user-action-controller 1.37.10 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/player-user-consents_2.cjs.entry.js +54 -42
- package/dist/cjs/user-action-controller.cjs.js +1 -1
- package/dist/collection/components/user-action-controller/user-action-controller.js +6 -40
- package/dist/collection/utils/locale.utils.js +36 -24
- package/dist/components/player-user-consents2.js +12 -12
- package/dist/components/user-action-controller.js +42 -32
- package/dist/esm/loader.js +1 -1
- package/dist/esm/player-user-consents_2.entry.js +54 -42
- package/dist/esm/user-action-controller.js +1 -1
- package/dist/types/components/user-action-controller/user-action-controller.d.ts +0 -8
- package/dist/types/components.d.ts +0 -16
- package/dist/user-action-controller/p-ebbb5e6f.entry.js +1 -0
- package/dist/user-action-controller/user-action-controller.esm.js +1 -1
- package/package.json +4 -1
- package/dist/user-action-controller/p-52129348.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"
|
|
17
|
+
return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"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],"mandatoryItems":[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]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -38,18 +38,18 @@ const TRANSLATIONS$1 = {
|
|
|
38
38
|
},
|
|
39
39
|
hr: {
|
|
40
40
|
termsAndConditions: {
|
|
41
|
-
acceptPart1: "
|
|
42
|
-
acceptPart2: "
|
|
43
|
-
acceptPart3: "
|
|
44
|
-
|
|
41
|
+
acceptPart1: "Prihvaćam Opće uvjete i odredbe ",
|
|
42
|
+
acceptPart2: "",
|
|
43
|
+
acceptPart3: "",
|
|
44
|
+
tcLink: "Opći uvjeti i odredbe"
|
|
45
45
|
},
|
|
46
46
|
privacyPolicy: {
|
|
47
|
-
readUnderstandPart1: "
|
|
48
|
-
readUnderstandPart2: ",
|
|
49
|
-
|
|
47
|
+
readUnderstandPart1: "Pročitao sam i razumijem Politiku Privatnosti ",
|
|
48
|
+
readUnderstandPart2: ", i potvrđujem da imam više od 18 godina",
|
|
49
|
+
privacyLink: "Politika Privatnosti"
|
|
50
50
|
},
|
|
51
|
-
sms: "
|
|
52
|
-
emailmarketing: "
|
|
51
|
+
sms: "Želim dobivati marketinški sadržaj putem sms",
|
|
52
|
+
emailmarketing: "Želim dobivati marketinški sadržaj putem e-maila"
|
|
53
53
|
},
|
|
54
54
|
fr: {
|
|
55
55
|
termsAndConditions: {
|
|
@@ -207,15 +207,15 @@ const PlayerUserConsents = class {
|
|
|
207
207
|
determineTextContent() {
|
|
208
208
|
if (this.gmVersion === 'gmcore') {
|
|
209
209
|
if (this.consentType === 'termsandconditions') {
|
|
210
|
-
return index.h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.
|
|
210
|
+
return index.h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.tcLink', this.lang)), translate$1('termsAndConditions.acceptPart2', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacyPolicy.privacyLink', this.lang)), translate$1('termsAndConditions.acceptPart3', this.lang));
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
if (this.gmVersion === 'gm16') {
|
|
214
214
|
if (this.consentType === 'termsandconditions') {
|
|
215
|
-
return index.h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.
|
|
215
|
+
return index.h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.tcLink', this.lang)));
|
|
216
216
|
}
|
|
217
217
|
if (this.consentType === 'privacypolicy') {
|
|
218
|
-
return index.h("p", null, translate$1('privacyPolicy.readUnderstandPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacyPolicy.
|
|
218
|
+
return index.h("p", null, translate$1('privacyPolicy.readUnderstandPart1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacyPolicy.privacyLink', this.lang)), translate$1('privacyPolicy.readUnderstandPart2', this.lang));
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
return index.h("p", null, translate$1(this.consentType, this.lang));
|
|
@@ -236,40 +236,52 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
236
236
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
|
|
237
237
|
const TRANSLATIONS = {
|
|
238
238
|
en: {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
240
|
+
smsTitle: 'SMS marketing',
|
|
241
|
+
emailMarketingTitle: 'Email marketing',
|
|
242
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
243
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
244
|
+
submitButtonText: 'Submit'
|
|
243
245
|
},
|
|
244
246
|
ro: {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
termsAndConditionsTitle: 'Termeni şi condiţii',
|
|
248
|
+
smsTitle: 'SMS marketing',
|
|
249
|
+
emailMarketingTitle: 'Email marketing',
|
|
250
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
251
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
252
|
+
submitButtonText: 'Submit'
|
|
249
253
|
},
|
|
250
254
|
hr: {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
termsAndConditionsTitle: 'Opći uvjeti i odredbe',
|
|
256
|
+
smsTitle: 'SMS makretinški sadržaj',
|
|
257
|
+
emailMarketingTitle: 'E-mail makretinški sadržaj',
|
|
258
|
+
privacyPolicyTitle: 'Politika Privatnosti',
|
|
259
|
+
userNoticeText: 'Prije nego što možete nastaviti, morate pristati na sljedeće',
|
|
260
|
+
submitButtonText: 'Pošalji'
|
|
255
261
|
},
|
|
256
262
|
fr: {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
263
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
264
|
+
smsTitle: 'SMS marketing',
|
|
265
|
+
emailMarketingTitle: 'Email marketing',
|
|
266
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
267
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
268
|
+
submitButtonText: 'Submit'
|
|
261
269
|
},
|
|
262
270
|
cs: {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
271
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
272
|
+
smsTitle: 'SMS marketing',
|
|
273
|
+
emailMarketingTitle: 'Email marketing',
|
|
274
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
275
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
276
|
+
submitButtonText: 'Submit'
|
|
267
277
|
},
|
|
268
278
|
de: {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
279
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
280
|
+
smsTitle: 'SMS marketing',
|
|
281
|
+
emailMarketingTitle: 'Email marketing',
|
|
282
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
283
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
284
|
+
submitButtonText: 'Submit'
|
|
273
285
|
},
|
|
274
286
|
};
|
|
275
287
|
const getTranslations = (url) => {
|
|
@@ -339,10 +351,10 @@ const UserActionController = class {
|
|
|
339
351
|
this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
|
|
340
352
|
this.userActions = [];
|
|
341
353
|
this.consentTitles = {
|
|
342
|
-
termsandconditions: translate('
|
|
343
|
-
sms: translate('
|
|
344
|
-
emailmarketing: translate('
|
|
345
|
-
privacypolicy: translate('
|
|
354
|
+
termsandconditions: translate('termsAndConditionsTitle', this.lang),
|
|
355
|
+
sms: translate('smsTitle', this.lang),
|
|
356
|
+
emailmarketing: translate('emailMarketingTitle', this.lang),
|
|
357
|
+
privacypolicy: translate('privacyPolicyTitle', this.lang)
|
|
346
358
|
};
|
|
347
359
|
this.setClientStyling = () => {
|
|
348
360
|
let sheet = document.createElement('style');
|
|
@@ -524,8 +536,8 @@ const UserActionController = class {
|
|
|
524
536
|
this.userActionsValidated = this.mandatoryActionsChecked === this.mandatoryItems;
|
|
525
537
|
return (index.h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (index.h("slot", { name: 'spinner' })
|
|
526
538
|
&&
|
|
527
|
-
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.
|
|
528
|
-
index.h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.
|
|
539
|
+
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" }, translate('userNoticeText', this.lang)), 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 &&
|
|
540
|
+
index.h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, translate('submitButtonText', this.lang))))));
|
|
529
541
|
}
|
|
530
542
|
else {
|
|
531
543
|
return;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"
|
|
18
|
+
return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"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],"mandatoryItems":[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]}]]]], options);
|
|
19
19
|
});
|
|
@@ -38,10 +38,10 @@ export class UserActionController {
|
|
|
38
38
|
this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
|
|
39
39
|
this.userActions = [];
|
|
40
40
|
this.consentTitles = {
|
|
41
|
-
termsandconditions: translate('
|
|
42
|
-
sms: translate('
|
|
43
|
-
emailmarketing: translate('
|
|
44
|
-
privacypolicy: translate('
|
|
41
|
+
termsandconditions: translate('termsAndConditionsTitle', this.lang),
|
|
42
|
+
sms: translate('smsTitle', this.lang),
|
|
43
|
+
emailmarketing: translate('emailMarketingTitle', this.lang),
|
|
44
|
+
privacypolicy: translate('privacyPolicyTitle', this.lang)
|
|
45
45
|
};
|
|
46
46
|
this.setClientStyling = () => {
|
|
47
47
|
let sheet = document.createElement('style');
|
|
@@ -225,11 +225,11 @@ export class UserActionController {
|
|
|
225
225
|
&&
|
|
226
226
|
h("svg", { class: "spinner", viewBox: "0 0 50 50" },
|
|
227
227
|
h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" },
|
|
228
|
-
h("h2", { class: "UserConsentNotice" }, this.
|
|
228
|
+
h("h2", { class: "UserConsentNotice" }, translate('userNoticeText', this.lang)),
|
|
229
229
|
h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action },
|
|
230
230
|
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 }))))),
|
|
231
231
|
this.includeSubmitButton &&
|
|
232
|
-
h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.
|
|
232
|
+
h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, translate('submitButtonText', this.lang))))));
|
|
233
233
|
}
|
|
234
234
|
else {
|
|
235
235
|
return;
|
|
@@ -330,40 +330,6 @@ export class UserActionController {
|
|
|
330
330
|
"attribute": "include-submit-button",
|
|
331
331
|
"reflect": true
|
|
332
332
|
},
|
|
333
|
-
"submitButtonText": {
|
|
334
|
-
"type": "string",
|
|
335
|
-
"mutable": false,
|
|
336
|
-
"complexType": {
|
|
337
|
-
"original": "string",
|
|
338
|
-
"resolved": "string",
|
|
339
|
-
"references": {}
|
|
340
|
-
},
|
|
341
|
-
"required": false,
|
|
342
|
-
"optional": false,
|
|
343
|
-
"docs": {
|
|
344
|
-
"tags": [],
|
|
345
|
-
"text": "the text of the button, if button is enabled"
|
|
346
|
-
},
|
|
347
|
-
"attribute": "submit-button-text",
|
|
348
|
-
"reflect": true
|
|
349
|
-
},
|
|
350
|
-
"userNoticeText": {
|
|
351
|
-
"type": "string",
|
|
352
|
-
"mutable": false,
|
|
353
|
-
"complexType": {
|
|
354
|
-
"original": "string",
|
|
355
|
-
"resolved": "string",
|
|
356
|
-
"references": {}
|
|
357
|
-
},
|
|
358
|
-
"required": false,
|
|
359
|
-
"optional": false,
|
|
360
|
-
"docs": {
|
|
361
|
-
"tags": [],
|
|
362
|
-
"text": "the title of the action group"
|
|
363
|
-
},
|
|
364
|
-
"attribute": "user-notice-text",
|
|
365
|
-
"reflect": true
|
|
366
|
-
},
|
|
367
333
|
"gmVersion": {
|
|
368
334
|
"type": "string",
|
|
369
335
|
"mutable": false,
|
|
@@ -2,40 +2,52 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
2
2
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
|
|
3
3
|
const TRANSLATIONS = {
|
|
4
4
|
en: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
6
|
+
smsTitle: 'SMS marketing',
|
|
7
|
+
emailMarketingTitle: 'Email marketing',
|
|
8
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
9
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
10
|
+
submitButtonText: 'Submit'
|
|
9
11
|
},
|
|
10
12
|
ro: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
termsAndConditionsTitle: 'Termeni şi condiţii',
|
|
14
|
+
smsTitle: 'SMS marketing',
|
|
15
|
+
emailMarketingTitle: 'Email marketing',
|
|
16
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
17
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
18
|
+
submitButtonText: 'Submit'
|
|
15
19
|
},
|
|
16
20
|
hr: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
termsAndConditionsTitle: 'Opći uvjeti i odredbe',
|
|
22
|
+
smsTitle: 'SMS makretinški sadržaj',
|
|
23
|
+
emailMarketingTitle: 'E-mail makretinški sadržaj',
|
|
24
|
+
privacyPolicyTitle: 'Politika Privatnosti',
|
|
25
|
+
userNoticeText: 'Prije nego što možete nastaviti, morate pristati na sljedeće',
|
|
26
|
+
submitButtonText: 'Pošalji'
|
|
21
27
|
},
|
|
22
28
|
fr: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
30
|
+
smsTitle: 'SMS marketing',
|
|
31
|
+
emailMarketingTitle: 'Email marketing',
|
|
32
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
33
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
34
|
+
submitButtonText: 'Submit'
|
|
27
35
|
},
|
|
28
36
|
cs: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
38
|
+
smsTitle: 'SMS marketing',
|
|
39
|
+
emailMarketingTitle: 'Email marketing',
|
|
40
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
41
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
42
|
+
submitButtonText: 'Submit'
|
|
33
43
|
},
|
|
34
44
|
de: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
46
|
+
smsTitle: 'SMS marketing',
|
|
47
|
+
emailMarketingTitle: 'Email marketing',
|
|
48
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
49
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
50
|
+
submitButtonText: 'Submit'
|
|
39
51
|
},
|
|
40
52
|
};
|
|
41
53
|
export const getTranslations = (url) => {
|
|
@@ -34,18 +34,18 @@ const TRANSLATIONS = {
|
|
|
34
34
|
},
|
|
35
35
|
hr: {
|
|
36
36
|
termsAndConditions: {
|
|
37
|
-
acceptPart1: "
|
|
38
|
-
acceptPart2: "
|
|
39
|
-
acceptPart3: "
|
|
40
|
-
|
|
37
|
+
acceptPart1: "Prihvaćam Opće uvjete i odredbe ",
|
|
38
|
+
acceptPart2: "",
|
|
39
|
+
acceptPart3: "",
|
|
40
|
+
tcLink: "Opći uvjeti i odredbe"
|
|
41
41
|
},
|
|
42
42
|
privacyPolicy: {
|
|
43
|
-
readUnderstandPart1: "
|
|
44
|
-
readUnderstandPart2: ",
|
|
45
|
-
|
|
43
|
+
readUnderstandPart1: "Pročitao sam i razumijem Politiku Privatnosti ",
|
|
44
|
+
readUnderstandPart2: ", i potvrđujem da imam više od 18 godina",
|
|
45
|
+
privacyLink: "Politika Privatnosti"
|
|
46
46
|
},
|
|
47
|
-
sms: "
|
|
48
|
-
emailmarketing: "
|
|
47
|
+
sms: "Želim dobivati marketinški sadržaj putem sms",
|
|
48
|
+
emailmarketing: "Želim dobivati marketinški sadržaj putem e-maila"
|
|
49
49
|
},
|
|
50
50
|
fr: {
|
|
51
51
|
termsAndConditions: {
|
|
@@ -205,15 +205,15 @@ const PlayerUserConsents = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
205
205
|
determineTextContent() {
|
|
206
206
|
if (this.gmVersion === 'gmcore') {
|
|
207
207
|
if (this.consentType === 'termsandconditions') {
|
|
208
|
-
return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.
|
|
208
|
+
return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)), translate('termsAndConditions.acceptPart2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacyLink', this.lang)), translate('termsAndConditions.acceptPart3', this.lang));
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (this.gmVersion === 'gm16') {
|
|
212
212
|
if (this.consentType === 'termsandconditions') {
|
|
213
|
-
return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.
|
|
213
|
+
return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)));
|
|
214
214
|
}
|
|
215
215
|
if (this.consentType === 'privacypolicy') {
|
|
216
|
-
return h("p", null, translate('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.
|
|
216
|
+
return h("p", null, translate('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacyLink', this.lang)), translate('privacyPolicy.readUnderstandPart2', this.lang));
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
return h("p", null, translate(this.consentType, this.lang));
|
|
@@ -5,40 +5,52 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
5
5
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
|
|
6
6
|
const TRANSLATIONS = {
|
|
7
7
|
en: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
9
|
+
smsTitle: 'SMS marketing',
|
|
10
|
+
emailMarketingTitle: 'Email marketing',
|
|
11
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
12
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
13
|
+
submitButtonText: 'Submit'
|
|
12
14
|
},
|
|
13
15
|
ro: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
termsAndConditionsTitle: 'Termeni şi condiţii',
|
|
17
|
+
smsTitle: 'SMS marketing',
|
|
18
|
+
emailMarketingTitle: 'Email marketing',
|
|
19
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
20
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
21
|
+
submitButtonText: 'Submit'
|
|
18
22
|
},
|
|
19
23
|
hr: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
termsAndConditionsTitle: 'Opći uvjeti i odredbe',
|
|
25
|
+
smsTitle: 'SMS makretinški sadržaj',
|
|
26
|
+
emailMarketingTitle: 'E-mail makretinški sadržaj',
|
|
27
|
+
privacyPolicyTitle: 'Politika Privatnosti',
|
|
28
|
+
userNoticeText: 'Prije nego što možete nastaviti, morate pristati na sljedeće',
|
|
29
|
+
submitButtonText: 'Pošalji'
|
|
24
30
|
},
|
|
25
31
|
fr: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
33
|
+
smsTitle: 'SMS marketing',
|
|
34
|
+
emailMarketingTitle: 'Email marketing',
|
|
35
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
36
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
37
|
+
submitButtonText: 'Submit'
|
|
30
38
|
},
|
|
31
39
|
cs: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
41
|
+
smsTitle: 'SMS marketing',
|
|
42
|
+
emailMarketingTitle: 'Email marketing',
|
|
43
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
44
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
45
|
+
submitButtonText: 'Submit'
|
|
36
46
|
},
|
|
37
47
|
de: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
49
|
+
smsTitle: 'SMS marketing',
|
|
50
|
+
emailMarketingTitle: 'Email marketing',
|
|
51
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
52
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
53
|
+
submitButtonText: 'Submit'
|
|
42
54
|
},
|
|
43
55
|
};
|
|
44
56
|
const getTranslations = (url) => {
|
|
@@ -110,10 +122,10 @@ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
110
122
|
this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
|
|
111
123
|
this.userActions = [];
|
|
112
124
|
this.consentTitles = {
|
|
113
|
-
termsandconditions: translate('
|
|
114
|
-
sms: translate('
|
|
115
|
-
emailmarketing: translate('
|
|
116
|
-
privacypolicy: translate('
|
|
125
|
+
termsandconditions: translate('termsAndConditionsTitle', this.lang),
|
|
126
|
+
sms: translate('smsTitle', this.lang),
|
|
127
|
+
emailmarketing: translate('emailMarketingTitle', this.lang),
|
|
128
|
+
privacypolicy: translate('privacyPolicyTitle', this.lang)
|
|
117
129
|
};
|
|
118
130
|
this.setClientStyling = () => {
|
|
119
131
|
let sheet = document.createElement('style');
|
|
@@ -295,8 +307,8 @@ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
295
307
|
this.userActionsValidated = this.mandatoryActionsChecked === this.mandatoryItems;
|
|
296
308
|
return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
|
|
297
309
|
&&
|
|
298
|
-
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.
|
|
299
|
-
h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.
|
|
310
|
+
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" }, translate('userNoticeText', this.lang)), 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 &&
|
|
311
|
+
h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, translate('submitButtonText', this.lang))))));
|
|
300
312
|
}
|
|
301
313
|
else {
|
|
302
314
|
return;
|
|
@@ -313,8 +325,6 @@ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
313
325
|
"userId": [513, "user-id"],
|
|
314
326
|
"lang": [1537],
|
|
315
327
|
"includeSubmitButton": [516, "include-submit-button"],
|
|
316
|
-
"submitButtonText": [513, "submit-button-text"],
|
|
317
|
-
"userNoticeText": [513, "user-notice-text"],
|
|
318
328
|
"gmVersion": [1, "gm-version"],
|
|
319
329
|
"translationUrl": [513, "translation-url"],
|
|
320
330
|
"clientStyling": [1537, "client-styling"],
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["player-user-consents_2",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"
|
|
13
|
+
return bootstrapLazy([["player-user-consents_2",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"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],"mandatoryItems":[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]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -34,18 +34,18 @@ const TRANSLATIONS$1 = {
|
|
|
34
34
|
},
|
|
35
35
|
hr: {
|
|
36
36
|
termsAndConditions: {
|
|
37
|
-
acceptPart1: "
|
|
38
|
-
acceptPart2: "
|
|
39
|
-
acceptPart3: "
|
|
40
|
-
|
|
37
|
+
acceptPart1: "Prihvaćam Opće uvjete i odredbe ",
|
|
38
|
+
acceptPart2: "",
|
|
39
|
+
acceptPart3: "",
|
|
40
|
+
tcLink: "Opći uvjeti i odredbe"
|
|
41
41
|
},
|
|
42
42
|
privacyPolicy: {
|
|
43
|
-
readUnderstandPart1: "
|
|
44
|
-
readUnderstandPart2: ",
|
|
45
|
-
|
|
43
|
+
readUnderstandPart1: "Pročitao sam i razumijem Politiku Privatnosti ",
|
|
44
|
+
readUnderstandPart2: ", i potvrđujem da imam više od 18 godina",
|
|
45
|
+
privacyLink: "Politika Privatnosti"
|
|
46
46
|
},
|
|
47
|
-
sms: "
|
|
48
|
-
emailmarketing: "
|
|
47
|
+
sms: "Želim dobivati marketinški sadržaj putem sms",
|
|
48
|
+
emailmarketing: "Želim dobivati marketinški sadržaj putem e-maila"
|
|
49
49
|
},
|
|
50
50
|
fr: {
|
|
51
51
|
termsAndConditions: {
|
|
@@ -203,15 +203,15 @@ const PlayerUserConsents = class {
|
|
|
203
203
|
determineTextContent() {
|
|
204
204
|
if (this.gmVersion === 'gmcore') {
|
|
205
205
|
if (this.consentType === 'termsandconditions') {
|
|
206
|
-
return h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.
|
|
206
|
+
return h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.tcLink', this.lang)), translate$1('termsAndConditions.acceptPart2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacyPolicy.privacyLink', this.lang)), translate$1('termsAndConditions.acceptPart3', this.lang));
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
if (this.gmVersion === 'gm16') {
|
|
210
210
|
if (this.consentType === 'termsandconditions') {
|
|
211
|
-
return h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.
|
|
211
|
+
return h("p", null, translate$1('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('termsAndConditions.tcLink', this.lang)));
|
|
212
212
|
}
|
|
213
213
|
if (this.consentType === 'privacypolicy') {
|
|
214
|
-
return h("p", null, translate$1('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacyPolicy.
|
|
214
|
+
return h("p", null, translate$1('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacyPolicy.privacyLink', this.lang)), translate$1('privacyPolicy.readUnderstandPart2', this.lang));
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
return h("p", null, translate$1(this.consentType, this.lang));
|
|
@@ -232,40 +232,52 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
232
232
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
|
|
233
233
|
const TRANSLATIONS = {
|
|
234
234
|
en: {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
236
|
+
smsTitle: 'SMS marketing',
|
|
237
|
+
emailMarketingTitle: 'Email marketing',
|
|
238
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
239
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
240
|
+
submitButtonText: 'Submit'
|
|
239
241
|
},
|
|
240
242
|
ro: {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
termsAndConditionsTitle: 'Termeni şi condiţii',
|
|
244
|
+
smsTitle: 'SMS marketing',
|
|
245
|
+
emailMarketingTitle: 'Email marketing',
|
|
246
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
247
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
248
|
+
submitButtonText: 'Submit'
|
|
245
249
|
},
|
|
246
250
|
hr: {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
+
termsAndConditionsTitle: 'Opći uvjeti i odredbe',
|
|
252
|
+
smsTitle: 'SMS makretinški sadržaj',
|
|
253
|
+
emailMarketingTitle: 'E-mail makretinški sadržaj',
|
|
254
|
+
privacyPolicyTitle: 'Politika Privatnosti',
|
|
255
|
+
userNoticeText: 'Prije nego što možete nastaviti, morate pristati na sljedeće',
|
|
256
|
+
submitButtonText: 'Pošalji'
|
|
251
257
|
},
|
|
252
258
|
fr: {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
260
|
+
smsTitle: 'SMS marketing',
|
|
261
|
+
emailMarketingTitle: 'Email marketing',
|
|
262
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
263
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
264
|
+
submitButtonText: 'Submit'
|
|
257
265
|
},
|
|
258
266
|
cs: {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
267
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
268
|
+
smsTitle: 'SMS marketing',
|
|
269
|
+
emailMarketingTitle: 'Email marketing',
|
|
270
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
271
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
272
|
+
submitButtonText: 'Submit'
|
|
263
273
|
},
|
|
264
274
|
de: {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
275
|
+
termsAndConditionsTitle: 'Terms and Conditions',
|
|
276
|
+
smsTitle: 'SMS marketing',
|
|
277
|
+
emailMarketingTitle: 'Email marketing',
|
|
278
|
+
privacyPolicyTitle: 'Privacy Policy',
|
|
279
|
+
userNoticeText: 'Before you can proceed you must consent to the following',
|
|
280
|
+
submitButtonText: 'Submit'
|
|
269
281
|
},
|
|
270
282
|
};
|
|
271
283
|
const getTranslations = (url) => {
|
|
@@ -335,10 +347,10 @@ const UserActionController = class {
|
|
|
335
347
|
this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
|
|
336
348
|
this.userActions = [];
|
|
337
349
|
this.consentTitles = {
|
|
338
|
-
termsandconditions: translate('
|
|
339
|
-
sms: translate('
|
|
340
|
-
emailmarketing: translate('
|
|
341
|
-
privacypolicy: translate('
|
|
350
|
+
termsandconditions: translate('termsAndConditionsTitle', this.lang),
|
|
351
|
+
sms: translate('smsTitle', this.lang),
|
|
352
|
+
emailmarketing: translate('emailMarketingTitle', this.lang),
|
|
353
|
+
privacypolicy: translate('privacyPolicyTitle', this.lang)
|
|
342
354
|
};
|
|
343
355
|
this.setClientStyling = () => {
|
|
344
356
|
let sheet = document.createElement('style');
|
|
@@ -520,8 +532,8 @@ const UserActionController = class {
|
|
|
520
532
|
this.userActionsValidated = this.mandatoryActionsChecked === this.mandatoryItems;
|
|
521
533
|
return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
|
|
522
534
|
&&
|
|
523
|
-
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.
|
|
524
|
-
h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.
|
|
535
|
+
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" }, translate('userNoticeText', this.lang)), 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 &&
|
|
536
|
+
h("button", { class: "ConsentSubmitButton", disabled: !this.userActionsValidated, onClick: () => this.handleApplyClick() }, translate('submitButtonText', this.lang))))));
|
|
525
537
|
}
|
|
526
538
|
else {
|
|
527
539
|
return;
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["player-user-consents_2",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"
|
|
16
|
+
return bootstrapLazy([["player-user-consents_2",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"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],"mandatoryItems":[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]}]]]], options);
|
|
17
17
|
});
|
|
@@ -24,14 +24,6 @@ export declare class UserActionController {
|
|
|
24
24
|
* whether or not to include the submit button (in case we want to compose a different )
|
|
25
25
|
*/
|
|
26
26
|
includeSubmitButton: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* the text of the button, if button is enabled
|
|
29
|
-
*/
|
|
30
|
-
submitButtonText: string;
|
|
31
|
-
/**
|
|
32
|
-
* the title of the action group
|
|
33
|
-
*/
|
|
34
|
-
userNoticeText: string;
|
|
35
27
|
/**
|
|
36
28
|
* Select GM version
|
|
37
29
|
*/
|
|
@@ -31,10 +31,6 @@ export namespace Components {
|
|
|
31
31
|
* Language
|
|
32
32
|
*/
|
|
33
33
|
"lang": string;
|
|
34
|
-
/**
|
|
35
|
-
* the text of the button, if button is enabled
|
|
36
|
-
*/
|
|
37
|
-
"submitButtonText": string;
|
|
38
34
|
/**
|
|
39
35
|
* Translation url
|
|
40
36
|
*/
|
|
@@ -43,10 +39,6 @@ export namespace Components {
|
|
|
43
39
|
* user id required for the update call
|
|
44
40
|
*/
|
|
45
41
|
"userId": string;
|
|
46
|
-
/**
|
|
47
|
-
* the title of the action group
|
|
48
|
-
*/
|
|
49
|
-
"userNoticeText": string;
|
|
50
42
|
/**
|
|
51
43
|
* user session required for the update call
|
|
52
44
|
*/
|
|
@@ -90,10 +82,6 @@ declare namespace LocalJSX {
|
|
|
90
82
|
* Language
|
|
91
83
|
*/
|
|
92
84
|
"lang"?: string;
|
|
93
|
-
/**
|
|
94
|
-
* the text of the button, if button is enabled
|
|
95
|
-
*/
|
|
96
|
-
"submitButtonText"?: string;
|
|
97
85
|
/**
|
|
98
86
|
* Translation url
|
|
99
87
|
*/
|
|
@@ -102,10 +90,6 @@ declare namespace LocalJSX {
|
|
|
102
90
|
* user id required for the update call
|
|
103
91
|
*/
|
|
104
92
|
"userId": string;
|
|
105
|
-
/**
|
|
106
|
-
* the title of the action group
|
|
107
|
-
*/
|
|
108
|
-
"userNoticeText"?: string;
|
|
109
93
|
/**
|
|
110
94
|
* user session required for the update call
|
|
111
95
|
*/
|
|
@@ -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:"Prihvaćam Opće uvjete i odredbe ",acceptPart2:"",acceptPart3:"",tcLink:"Opći uvjeti i odredbe"},privacyPolicy:{readUnderstandPart1:"Pročitao sam i razumijem Politiku Privatnosti ",readUnderstandPart2:", i potvrđujem da imam više od 18 godina",privacyLink:"Politika Privatnosti"},sms:"Želim dobivati marketinški sadržaj putem sms",emailmarketing:"Želim dobivati marketinški sadržaj putem e-maila"},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)}))})),o=(t,e,i)=>{let n=(o=s[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),o));var o;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},a=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,o("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},o("termsAndConditions.tcLink",this.lang)),o("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},o("privacyPolicy.privacyLink",this.lang)),o("termsAndConditions.acceptPart3",this.lang));if("gm16"===this.gmVersion){if("termsandconditions"===this.consentType)return i("p",null,o("termsAndConditions.acceptPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},o("termsAndConditions.tcLink",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,o("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},o("privacyPolicy.privacyLink",this.lang)),o("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,o(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"]}}};a.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 r=["ro","en","cz","de","hr"],c={en:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},ro:{termsAndConditionsTitle:"Termeni şi condiţii",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},hr:{termsAndConditionsTitle:"Opći uvjeti i odredbe",smsTitle:"SMS makretinški sadržaj",emailMarketingTitle:"E-mail makretinški sadržaj",privacyPolicyTitle:"Politika Privatnosti",userNoticeText:"Prije nego što možete nastaviti, morate pristati na sljedeće",submitButtonText:"Pošalji"},fr:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},cs:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"},de:{termsAndConditionsTitle:"Terms and Conditions",smsTitle:"SMS marketing",emailMarketingTitle:"Email marketing",privacyPolicyTitle:"Privacy Policy",userNoticeText:"Before you can proceed you must consent to the following",submitButtonText:"Submit"}},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)}))})),l=(t,e,i)=>{const s=e;let n=c[void 0!==s&&r.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},h=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:l("termsAndConditionsTitle",this.lang),sms:l("smsTitle",this.lang),emailmarketing:l("emailMarketingTitle",this.lang),privacypolicy:l("privacyPolicyTitle",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(Object.assign({tagCode:e,status:(t=>"gm16"===this.gmVersion?t?1:0:t?"Accepted":"Denied")(i)},"gm16"===this.gmVersion&&{note:""})),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})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}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&&"pepconsent"!==t.tagCode&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}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({consents: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)}calcMandatoryActions(){this.mandatoryItems=0,this.mandatoryActions.map((t=>{this.activeUserActions.includes(t)&&this.mandatoryItems++}))}render(){return this.mandatoryItems>0?(this.userActionsValidated=this.mandatoryActionsChecked===this.mandatoryItems,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"},l("userNoticeText",this.lang)),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()},l("submitButtonText",this.lang))))):void 0}static get watchers(){return{translationUrl:["handleNewTranslations"],receivedQueryResponses:["handleQueryResponse"]}}};h.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{a as player_user_consents,h as user_action_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as n,b as e}from"./p-ba444709.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((n=>e([["p-ebbb5e6f",[[1,"user-action-controller",{endpoint:[513],userSession:[513,"user-session"],userId:[513,"user-id"],lang:[1537],includeSubmitButton:[516,"include-submit-button"],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],mandatoryItems:[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]}]]]],n)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/user-action-controller",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -15,5 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@everymatrix/player-user-consents": "*"
|
|
18
21
|
}
|
|
19
22
|
}
|
|
@@ -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.",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:"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(Object.assign({tagCode:e,status:(t=>"gm16"===this.gmVersion?t?1:0:t?"Accepted":"Denied")(i)},"gm16"===this.gmVersion&&{note:""})),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})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}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&&"pepconsent"!==t.tagCode&&this.activeUserActions.push(t.tagCode)})),this.isLoading=!1})).catch((t=>{console.error("Error fetching data:",t),this.isLoading=!1})).finally((()=>{this.calcMandatoryActions(),window.postMessage({type:"UserActionsExists",displayUserActions:this.mandatoryItems>0},window.location.href)}))}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({consents: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)}calcMandatoryActions(){this.mandatoryItems=0,this.mandatoryActions.map((t=>{this.activeUserActions.includes(t)&&this.mandatoryItems++}))}render(){return this.mandatoryItems>0?(this.userActionsValidated=this.mandatoryActionsChecked===this.mandatoryItems,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)))):void 0}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}
|