@everymatrix/user-action-controller 1.52.4 → 1.52.6

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.
@@ -238,14 +238,22 @@ const TRANSLATIONS = {
238
238
  userNoticeText: 'Before you can proceed you must consent to the following',
239
239
  submitButtonText: 'Submit'
240
240
  },
241
- ro: {
242
- termsAndConditionsTitle: 'Termeni şi condiţii',
241
+ 'en-us': {
242
+ termsAndConditionsTitle: 'Terms and Conditions',
243
243
  smsTitle: 'SMS marketing',
244
244
  emailMarketingTitle: 'Email marketing',
245
245
  privacyPolicyTitle: 'Privacy Policy',
246
246
  userNoticeText: 'Before you can proceed you must consent to the following',
247
247
  submitButtonText: 'Submit'
248
248
  },
249
+ ro: {
250
+ termsAndConditionsTitle: 'Termeni și Condiții',
251
+ smsTitle: 'Marketing prin SMS',
252
+ emailMarketingTitle: 'Marketing prin Email',
253
+ privacyPolicyTitle: 'Politica de Confidențialitate',
254
+ userNoticeText: 'Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele',
255
+ submitButtonText: 'Trimite'
256
+ },
249
257
  hr: {
250
258
  termsAndConditionsTitle: 'Opći uvjeti i odredbe',
251
259
  smsTitle: 'SMS makretinški sadržaj',
@@ -255,12 +263,12 @@ const TRANSLATIONS = {
255
263
  submitButtonText: 'Pošalji'
256
264
  },
257
265
  fr: {
258
- termsAndConditionsTitle: 'Terms and Conditions',
259
- smsTitle: 'SMS marketing',
260
- emailMarketingTitle: 'Email marketing',
261
- privacyPolicyTitle: 'Privacy Policy',
262
- userNoticeText: 'Before you can proceed you must consent to the following',
263
- submitButtonText: 'Submit'
266
+ termsAndConditionsTitle: 'Termes et Conditions',
267
+ smsTitle: 'Marketing par SMS',
268
+ emailMarketingTitle: 'Marketing par Email',
269
+ privacyPolicyTitle: 'Politique de Confidentialité',
270
+ userNoticeText: 'Avant de continuer, vous devez consentir aux éléments suivants',
271
+ submitButtonText: 'Soumettre'
264
272
  },
265
273
  cs: {
266
274
  termsAndConditionsTitle: 'Terms and Conditions',
@@ -271,13 +279,45 @@ const TRANSLATIONS = {
271
279
  submitButtonText: 'Submit'
272
280
  },
273
281
  de: {
274
- termsAndConditionsTitle: 'Terms and Conditions',
275
- smsTitle: 'SMS marketing',
276
- emailMarketingTitle: 'Email marketing',
277
- privacyPolicyTitle: 'Privacy Policy',
278
- userNoticeText: 'Before you can proceed you must consent to the following',
279
- submitButtonText: 'Submit'
282
+ termsAndConditionsTitle: 'Allgemeine Geschäftsbedingungen',
283
+ smsTitle: 'SMS-Marketing',
284
+ emailMarketingTitle: 'E-Mail-Marketing',
285
+ privacyPolicyTitle: 'Datenschutzrichtlinie',
286
+ userNoticeText: 'Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen',
287
+ submitButtonText: 'Absenden'
288
+ },
289
+ es: {
290
+ termsAndConditionsTitle: 'Términos y Condiciones',
291
+ smsTitle: 'Marketing por SMS',
292
+ emailMarketingTitle: 'Marketing por Email',
293
+ privacyPolicyTitle: 'Política de Privacidad',
294
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
295
+ submitButtonText: 'Enviar'
296
+ },
297
+ pt: {
298
+ termsAndConditionsTitle: 'Termos e Condições',
299
+ smsTitle: 'Marketing por SMS',
300
+ emailMarketingTitle: 'Marketing por Email',
301
+ privacyPolicyTitle: 'Política de Privacidade',
302
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
303
+ submitButtonText: 'Enviar'
280
304
  },
305
+ 'es-mx': {
306
+ termsAndConditionsTitle: 'Términos y Condiciones',
307
+ smsTitle: 'Marketing por SMS',
308
+ emailMarketingTitle: 'Marketing por Email',
309
+ privacyPolicyTitle: 'Política de Privacidad',
310
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
311
+ submitButtonText: 'Enviar'
312
+ },
313
+ 'pt-br': {
314
+ termsAndConditionsTitle: 'Termos e Condições',
315
+ smsTitle: 'Marketing por SMS',
316
+ emailMarketingTitle: 'Marketing por Email',
317
+ privacyPolicyTitle: 'Política de Privacidade',
318
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
319
+ submitButtonText: 'Enviar'
320
+ }
281
321
  };
282
322
  const getTranslations = (url) => {
283
323
  return new Promise((resolve) => {
@@ -8,14 +8,22 @@ const TRANSLATIONS = {
8
8
  userNoticeText: 'Before you can proceed you must consent to the following',
9
9
  submitButtonText: 'Submit'
10
10
  },
11
- ro: {
12
- termsAndConditionsTitle: 'Termeni şi condiţii',
11
+ 'en-us': {
12
+ termsAndConditionsTitle: 'Terms and Conditions',
13
13
  smsTitle: 'SMS marketing',
14
14
  emailMarketingTitle: 'Email marketing',
15
15
  privacyPolicyTitle: 'Privacy Policy',
16
16
  userNoticeText: 'Before you can proceed you must consent to the following',
17
17
  submitButtonText: 'Submit'
18
18
  },
19
+ ro: {
20
+ termsAndConditionsTitle: 'Termeni și Condiții',
21
+ smsTitle: 'Marketing prin SMS',
22
+ emailMarketingTitle: 'Marketing prin Email',
23
+ privacyPolicyTitle: 'Politica de Confidențialitate',
24
+ userNoticeText: 'Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele',
25
+ submitButtonText: 'Trimite'
26
+ },
19
27
  hr: {
20
28
  termsAndConditionsTitle: 'Opći uvjeti i odredbe',
21
29
  smsTitle: 'SMS makretinški sadržaj',
@@ -25,12 +33,12 @@ const TRANSLATIONS = {
25
33
  submitButtonText: 'Pošalji'
26
34
  },
27
35
  fr: {
28
- termsAndConditionsTitle: 'Terms and Conditions',
29
- smsTitle: 'SMS marketing',
30
- emailMarketingTitle: 'Email marketing',
31
- privacyPolicyTitle: 'Privacy Policy',
32
- userNoticeText: 'Before you can proceed you must consent to the following',
33
- submitButtonText: 'Submit'
36
+ termsAndConditionsTitle: 'Termes et Conditions',
37
+ smsTitle: 'Marketing par SMS',
38
+ emailMarketingTitle: 'Marketing par Email',
39
+ privacyPolicyTitle: 'Politique de Confidentialité',
40
+ userNoticeText: 'Avant de continuer, vous devez consentir aux éléments suivants',
41
+ submitButtonText: 'Soumettre'
34
42
  },
35
43
  cs: {
36
44
  termsAndConditionsTitle: 'Terms and Conditions',
@@ -41,13 +49,45 @@ const TRANSLATIONS = {
41
49
  submitButtonText: 'Submit'
42
50
  },
43
51
  de: {
44
- termsAndConditionsTitle: 'Terms and Conditions',
45
- smsTitle: 'SMS marketing',
46
- emailMarketingTitle: 'Email marketing',
47
- privacyPolicyTitle: 'Privacy Policy',
48
- userNoticeText: 'Before you can proceed you must consent to the following',
49
- submitButtonText: 'Submit'
52
+ termsAndConditionsTitle: 'Allgemeine Geschäftsbedingungen',
53
+ smsTitle: 'SMS-Marketing',
54
+ emailMarketingTitle: 'E-Mail-Marketing',
55
+ privacyPolicyTitle: 'Datenschutzrichtlinie',
56
+ userNoticeText: 'Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen',
57
+ submitButtonText: 'Absenden'
58
+ },
59
+ es: {
60
+ termsAndConditionsTitle: 'Términos y Condiciones',
61
+ smsTitle: 'Marketing por SMS',
62
+ emailMarketingTitle: 'Marketing por Email',
63
+ privacyPolicyTitle: 'Política de Privacidad',
64
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
65
+ submitButtonText: 'Enviar'
66
+ },
67
+ pt: {
68
+ termsAndConditionsTitle: 'Termos e Condições',
69
+ smsTitle: 'Marketing por SMS',
70
+ emailMarketingTitle: 'Marketing por Email',
71
+ privacyPolicyTitle: 'Política de Privacidade',
72
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
73
+ submitButtonText: 'Enviar'
50
74
  },
75
+ 'es-mx': {
76
+ termsAndConditionsTitle: 'Términos y Condiciones',
77
+ smsTitle: 'Marketing por SMS',
78
+ emailMarketingTitle: 'Marketing por Email',
79
+ privacyPolicyTitle: 'Política de Privacidad',
80
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
81
+ submitButtonText: 'Enviar'
82
+ },
83
+ 'pt-br': {
84
+ termsAndConditionsTitle: 'Termos e Condições',
85
+ smsTitle: 'Marketing por SMS',
86
+ emailMarketingTitle: 'Marketing por Email',
87
+ privacyPolicyTitle: 'Política de Privacidade',
88
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
89
+ submitButtonText: 'Enviar'
90
+ }
51
91
  };
52
92
  export const getTranslations = (url) => {
53
93
  return new Promise((resolve) => {
@@ -234,14 +234,22 @@ const TRANSLATIONS = {
234
234
  userNoticeText: 'Before you can proceed you must consent to the following',
235
235
  submitButtonText: 'Submit'
236
236
  },
237
- ro: {
238
- termsAndConditionsTitle: 'Termeni şi condiţii',
237
+ 'en-us': {
238
+ termsAndConditionsTitle: 'Terms and Conditions',
239
239
  smsTitle: 'SMS marketing',
240
240
  emailMarketingTitle: 'Email marketing',
241
241
  privacyPolicyTitle: 'Privacy Policy',
242
242
  userNoticeText: 'Before you can proceed you must consent to the following',
243
243
  submitButtonText: 'Submit'
244
244
  },
245
+ ro: {
246
+ termsAndConditionsTitle: 'Termeni și Condiții',
247
+ smsTitle: 'Marketing prin SMS',
248
+ emailMarketingTitle: 'Marketing prin Email',
249
+ privacyPolicyTitle: 'Politica de Confidențialitate',
250
+ userNoticeText: 'Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele',
251
+ submitButtonText: 'Trimite'
252
+ },
245
253
  hr: {
246
254
  termsAndConditionsTitle: 'Opći uvjeti i odredbe',
247
255
  smsTitle: 'SMS makretinški sadržaj',
@@ -251,12 +259,12 @@ const TRANSLATIONS = {
251
259
  submitButtonText: 'Pošalji'
252
260
  },
253
261
  fr: {
254
- termsAndConditionsTitle: 'Terms and Conditions',
255
- smsTitle: 'SMS marketing',
256
- emailMarketingTitle: 'Email marketing',
257
- privacyPolicyTitle: 'Privacy Policy',
258
- userNoticeText: 'Before you can proceed you must consent to the following',
259
- submitButtonText: 'Submit'
262
+ termsAndConditionsTitle: 'Termes et Conditions',
263
+ smsTitle: 'Marketing par SMS',
264
+ emailMarketingTitle: 'Marketing par Email',
265
+ privacyPolicyTitle: 'Politique de Confidentialité',
266
+ userNoticeText: 'Avant de continuer, vous devez consentir aux éléments suivants',
267
+ submitButtonText: 'Soumettre'
260
268
  },
261
269
  cs: {
262
270
  termsAndConditionsTitle: 'Terms and Conditions',
@@ -267,13 +275,45 @@ const TRANSLATIONS = {
267
275
  submitButtonText: 'Submit'
268
276
  },
269
277
  de: {
270
- termsAndConditionsTitle: 'Terms and Conditions',
271
- smsTitle: 'SMS marketing',
272
- emailMarketingTitle: 'Email marketing',
273
- privacyPolicyTitle: 'Privacy Policy',
274
- userNoticeText: 'Before you can proceed you must consent to the following',
275
- submitButtonText: 'Submit'
278
+ termsAndConditionsTitle: 'Allgemeine Geschäftsbedingungen',
279
+ smsTitle: 'SMS-Marketing',
280
+ emailMarketingTitle: 'E-Mail-Marketing',
281
+ privacyPolicyTitle: 'Datenschutzrichtlinie',
282
+ userNoticeText: 'Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen',
283
+ submitButtonText: 'Absenden'
284
+ },
285
+ es: {
286
+ termsAndConditionsTitle: 'Términos y Condiciones',
287
+ smsTitle: 'Marketing por SMS',
288
+ emailMarketingTitle: 'Marketing por Email',
289
+ privacyPolicyTitle: 'Política de Privacidad',
290
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
291
+ submitButtonText: 'Enviar'
292
+ },
293
+ pt: {
294
+ termsAndConditionsTitle: 'Termos e Condições',
295
+ smsTitle: 'Marketing por SMS',
296
+ emailMarketingTitle: 'Marketing por Email',
297
+ privacyPolicyTitle: 'Política de Privacidade',
298
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
299
+ submitButtonText: 'Enviar'
276
300
  },
301
+ 'es-mx': {
302
+ termsAndConditionsTitle: 'Términos y Condiciones',
303
+ smsTitle: 'Marketing por SMS',
304
+ emailMarketingTitle: 'Marketing por Email',
305
+ privacyPolicyTitle: 'Política de Privacidad',
306
+ userNoticeText: 'Antes de continuar, debe dar su consentimiento a lo siguiente',
307
+ submitButtonText: 'Enviar'
308
+ },
309
+ 'pt-br': {
310
+ termsAndConditionsTitle: 'Termos e Condições',
311
+ smsTitle: 'Marketing por SMS',
312
+ emailMarketingTitle: 'Marketing por Email',
313
+ privacyPolicyTitle: 'Política de Privacidade',
314
+ userNoticeText: 'Antes de continuar, você deve consentir com o seguinte',
315
+ submitButtonText: 'Enviar'
316
+ }
277
317
  };
278
318
  const getTranslations = (url) => {
279
319
  return new Promise((resolve) => {
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -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-1fd217dd.js";const n={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."}},s=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{for(let i in t[e])n[e][i]=t[e][i]})),e(!0)}))})),a=(t,e,i)=>{let s=(a=n[e||"en"],t.split(".").reduce(((t,e)=>t&&void 0!==t[e]?t[e]:null),a));var a;if(null===s)return t;if(void 0!==i)for(const[t,e]of Object.entries(i)){const i=new RegExp(`{${t}}`,"g");s=s.replace(i,e)}return s},o=class{constructor(i){t(this,i),this.userLegislationConsent=e(this,"userLegislationConsent",7),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)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))},this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1}handleNewTranslations(){s(this.translationUrl)}handleStylingUrlChange(t,e){t!==e&&this.setClientStylingURL()}async componentWillLoad(){this.translationUrl.length>2&&await s(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStylingUrl&&this.setClientStylingURL(),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.tcLink",this.lang)),a("termsAndConditions.acceptPart2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacyLink",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.tcLink",this.lang)));if("privacypolicy"===this.consentType)return i("p",null,a("privacyPolicy.readUnderstandPart1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},a("privacyPolicy.privacyLink",this.lang)),a("privacyPolicy.readUnderstandPart2",this.lang))}return i("p",null,a(this.consentType,this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{key:"54601e536a075b95277641c2d123f21fb5b9a9e8",ref:t=>this.stylingContainer=t},i("p",{key:"8cceca5a2a2e69a4180e10848d0fea081fe7a78a",class:"ConsentTitle"},this.consentTitle),i("label",{key:"80f41a7876f3831c1030cba896282290f33c14b3",class:"UserConsent",htmlFor:"userConsent"},i("input",{key:"7db0bada1af6d9df763f63a4eb92e79615322801",ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{key:"ce67fcdf09cfefb48df87d043950fd4fba7fdb00",class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}}};o.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(--emw--color-primary);font-weight:bold}";const r={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"},"en-us":{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:"Marketing prin SMS",emailMarketingTitle:"Marketing prin Email",privacyPolicyTitle:"Politica de Confidențialitate",userNoticeText:"Înainte de a continua, trebuie să vă dați consimțământul pentru următoarele",submitButtonText:"Trimite"},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:"Termes et Conditions",smsTitle:"Marketing par SMS",emailMarketingTitle:"Marketing par Email",privacyPolicyTitle:"Politique de Confidentialité",userNoticeText:"Avant de continuer, vous devez consentir aux éléments suivants",submitButtonText:"Soumettre"},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:"Allgemeine Geschäftsbedingungen",smsTitle:"SMS-Marketing",emailMarketingTitle:"E-Mail-Marketing",privacyPolicyTitle:"Datenschutzrichtlinie",userNoticeText:"Bevor Sie fortfahren können, müssen Sie den folgenden Punkten zustimmen",submitButtonText:"Absenden"},es:{termsAndConditionsTitle:"Términos y Condiciones",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar"},pt:{termsAndConditionsTitle:"Termos e Condições",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar"},"es-mx":{termsAndConditionsTitle:"Términos y Condiciones",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidad",userNoticeText:"Antes de continuar, debe dar su consentimiento a lo siguiente",submitButtonText:"Enviar"},"pt-br":{termsAndConditionsTitle:"Termos e Condições",smsTitle:"Marketing por SMS",emailMarketingTitle:"Marketing por Email",privacyPolicyTitle:"Política de Privacidade",userNoticeText:"Antes de continuar, você deve consentir com o seguinte",submitButtonText:"Enviar"}},c=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{r[e]||(r[e]={});for(let i in t[e])r[e][i]=t[e][i]})),e(!0)}))})),d=(t,e,i)=>{let n=r[void 0!==e&&e in r?e:"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.mandatoryActions=["termsandconditions","privacypolicy"],this.userActions=[],this.consentTitles={termsandconditions:d("termsAndConditionsTitle",this.lang),sms:d("smsTitle",this.lang),emailmarketing:d("emailMarketingTitle",this.lang),privacypolicy:d("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=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))},this.endpoint=void 0,this.userSession=void 0,this.userId=void 0,this.lang="en",this.includeSubmitButton=void 0,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.mandatoryItems=void 0}handleNewTranslations(){c(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 c(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"},d("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-url":this.clientStylingUrl,"client-styling":this.clientStyling}))))),this.includeSubmitButton&&i("button",{class:"ConsentSubmitButton",disabled:!this.userActionsValidated,onClick:()=>this.handleApplyClick()},d("submitButtonText",this.lang))))):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(--emw--login-color-primary, var(--emw--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{o as player_user_consents,l as user_action_controller}
@@ -1 +1 @@
1
- import{p as n,b as e}from"./p-1fd217dd.js";export{s as setNonce}from"./p-1fd217dd.js";import{g as t}from"./p-e1255160.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["p-c46c2bdd",[[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"]],{translationUrl:["handleNewTranslations"],receivedQueryResponses:["handleQueryResponse"]}],[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"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]},null,{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}]]]],n))));
1
+ import{p as n,b as e}from"./p-1fd217dd.js";export{s as setNonce}from"./p-1fd217dd.js";import{g as t}from"./p-e1255160.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["p-0bb99851",[[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"]],{translationUrl:["handleNewTranslations"],receivedQueryResponses:["handleQueryResponse"]}],[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"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]},null,{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}]]]],n))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-action-controller",
3
- "version": "1.52.4",
3
+ "version": "1.52.6",
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,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-1fd217dd.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.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)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))},this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.gmVersion="",this.consentTitle="",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1}handleNewTranslations(){n(this.translationUrl)}handleStylingUrlChange(t,e){t!==e&&this.setClientStylingURL()}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.clientStylingUrl&&this.setClientStylingURL(),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",{key:"54601e536a075b95277641c2d123f21fb5b9a9e8",ref:t=>this.stylingContainer=t},i("p",{key:"8cceca5a2a2e69a4180e10848d0fea081fe7a78a",class:"ConsentTitle"},this.consentTitle),i("label",{key:"80f41a7876f3831c1030cba896282290f33c14b3",class:"UserConsent",htmlFor:"userConsent"},i("input",{key:"7db0bada1af6d9df763f63a4eb92e79615322801",ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{key:"ce67fcdf09cfefb48df87d043950fd4fba7fdb00",class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStylingUrl:["handleStylingUrlChange"]}}};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(--emw--color-primary);font-weight:bold}";const r={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"}},c=t=>new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{r[e]||(r[e]={});for(let i in t[e])r[e][i]=t[e][i]})),e(!0)}))})),d=(t,e,i)=>{let s=r[void 0!==e&&e in r?e:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");s=s.replace(i,e)}return s},l=class{constructor(e){t(this,e),this.mandatoryActions=["termsandconditions","privacypolicy"],this.userActions=[],this.consentTitles={termsandconditions:d("termsAndConditionsTitle",this.lang),sms:d("smsTitle",this.lang),emailmarketing:d("emailMarketingTitle",this.lang),privacypolicy:d("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=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))},this.endpoint=void 0,this.userSession=void 0,this.userId=void 0,this.lang="en",this.includeSubmitButton=void 0,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.mandatoryItems=void 0}handleNewTranslations(){c(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 c(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"},d("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-url":this.clientStylingUrl,"client-styling":this.clientStyling}))))),this.includeSubmitButton&&i("button",{class:"ConsentSubmitButton",disabled:!this.userActionsValidated,onClick:()=>this.handleApplyClick()},d("submitButtonText",this.lang))))):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(--emw--login-color-primary, var(--emw--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,l as user_action_controller}