@everymatrix/user-action-controller 1.32.4 → 1.33.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.
Files changed (50) hide show
  1. package/dist/cjs/index-87049e21.js +1300 -0
  2. package/dist/cjs/index.cjs.js +2 -0
  3. package/dist/cjs/loader.cjs.js +21 -0
  4. package/dist/cjs/player-user-consents_2.cjs.entry.js +455 -0
  5. package/dist/cjs/user-action-controller.cjs.js +19 -0
  6. package/dist/collection/collection-manifest.json +19 -0
  7. package/dist/collection/components/user-action-controller/user-action-controller.css +89 -0
  8. package/dist/collection/components/user-action-controller/user-action-controller.js +440 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +60 -0
  11. package/dist/collection/utils/utils.js +3 -0
  12. package/dist/components/index.d.ts +26 -0
  13. package/dist/components/index.js +1 -0
  14. package/dist/components/player-user-consents.js +6 -0
  15. package/dist/components/player-user-consents2.js +199 -0
  16. package/dist/components/user-action-controller.d.ts +11 -0
  17. package/dist/components/user-action-controller.js +323 -0
  18. package/dist/esm/index-71f14530.js +1274 -0
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/loader.js +17 -0
  21. package/dist/esm/player-user-consents_2.entry.js +450 -0
  22. package/dist/esm/polyfills/core-js.js +11 -0
  23. package/dist/esm/polyfills/css-shim.js +1 -0
  24. package/dist/esm/polyfills/dom.js +79 -0
  25. package/dist/esm/polyfills/es5-html-element.js +1 -0
  26. package/dist/esm/polyfills/index.js +34 -0
  27. package/dist/esm/polyfills/system.js +6 -0
  28. package/dist/esm/user-action-controller.js +17 -0
  29. package/dist/index.cjs.js +1 -0
  30. package/dist/index.js +1 -0
  31. package/dist/stencil.config.js +22 -0
  32. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-action-controller/.stencil/packages/user-action-controller/stencil.config.d.ts +2 -0
  33. package/dist/types/components/user-action-controller/user-action-controller.d.ts +78 -0
  34. package/dist/types/components.d.ts +125 -0
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  37. package/dist/types/utils/locale.utils.d.ts +2 -0
  38. package/dist/types/utils/utils.d.ts +1 -0
  39. package/dist/user-action-controller/index.esm.js +0 -0
  40. package/dist/user-action-controller/p-ba444709.js +1 -0
  41. package/dist/user-action-controller/p-d1fdbddb.entry.js +1 -0
  42. package/dist/user-action-controller/user-action-controller.esm.js +1 -0
  43. package/loader/cdn.js +3 -0
  44. package/loader/index.cjs.js +3 -0
  45. package/loader/index.d.ts +12 -0
  46. package/loader/index.es2017.js +3 -0
  47. package/loader/index.js +4 -0
  48. package/loader/package.json +10 -0
  49. package/package.json +2 -3
  50. package/LICENSE +0 -21
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-87049e21.js');
6
+
7
+ /*
8
+ Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
9
+ */
10
+ const patchEsm = () => {
11
+ return index.promiseResolve();
12
+ };
13
+
14
+ const defineCustomElements = (win, options) => {
15
+ if (typeof window === 'undefined') return Promise.resolve();
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"],"submitButtonText":[513,"submit-button-text"],"userNoticeText":[513,"user-notice-text"],"gmVersion":[1,"gm-version"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"queryFired":[32],"readyActionsCount":[32],"activeUserActions":[32],"userActionsValidated":[32],"receivedQueryResponses":[32],"limitStylingAppends":[32],"isLoading":[32],"mandatoryActionsChecked":[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
18
+ });
19
+ };
20
+
21
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,455 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-87049e21.js');
6
+
7
+ const DEFAULT_LANGUAGE$1 = 'en';
8
+ const TRANSLATIONS$1 = {
9
+ en: {
10
+ termsandconditions1: "I accept the ",
11
+ termsandconditions2: ", I have read and understood the ",
12
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
13
+ tc: "Terms and Conditions",
14
+ privacy: "Privacy Policy",
15
+ sms: "I consent to receive marketing communication via SMS.",
16
+ emailmarketing: "I consent to receive marketing communication via Email."
17
+ },
18
+ ro: {
19
+ termsandconditions1: "I accept the ",
20
+ termsandconditions2: ", I have read and understood the ",
21
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
22
+ tc: "Terms and Conditions",
23
+ privacy: "Privacy Policy",
24
+ sms: "I consent to receive marketing communication via SMS.",
25
+ emailmarketing: "I consent to receive marketing communication via Email."
26
+ },
27
+ hr: {
28
+ termsandconditions1: "I accept the ",
29
+ termsandconditions2: ", I have read and understood the ",
30
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
31
+ tc: "Terms and Conditions",
32
+ privacy: "Privacy Policy",
33
+ sms: "I consent to receive marketing communication via SMS.",
34
+ emailmarketing: "I consent to receive marketing communication via Email."
35
+ },
36
+ fr: {
37
+ termsandconditions1: "I accept the ",
38
+ termsandconditions2: ", I have read and understood the ",
39
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
40
+ tc: "Terms and Conditions",
41
+ privacy: "Privacy Policy",
42
+ sms: "I consent to receive marketing communication via SMS.",
43
+ emailmarketing: "I consent to receive marketing communication via Email."
44
+ },
45
+ cs: {
46
+ termsandconditions1: "I accept the ",
47
+ termsandconditions2: ", I have read and understood the ",
48
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
49
+ tc: "Terms and Conditions",
50
+ privacy: "Privacy Policy",
51
+ sms: "I consent to receive marketing communication via SMS.",
52
+ emailmarketing: "I consent to receive marketing communication via Email."
53
+ },
54
+ de: {
55
+ termsandconditions1: "I accept the ",
56
+ termsandconditions2: ", I have read and understood the ",
57
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
58
+ tc: "Terms and Conditions",
59
+ privacy: "Privacy Policy",
60
+ sms: "I consent to receive marketing communication via SMS.",
61
+ emailmarketing: "I consent to receive marketing communication via Email."
62
+ },
63
+ };
64
+ const getTranslations$1 = (url) => {
65
+ // fetch url, get the data, replace the TRANSLATIONS content
66
+ return new Promise((resolve) => {
67
+ fetch(url)
68
+ .then((res) => res.json())
69
+ .then((data) => {
70
+ Object.keys(data).forEach((item) => {
71
+ for (let key in data[item]) {
72
+ TRANSLATIONS$1[item][key] = data[item][key];
73
+ }
74
+ });
75
+ resolve(true);
76
+ });
77
+ });
78
+ };
79
+ const translate$1 = (key, customLang, values) => {
80
+ const lang = customLang;
81
+ let translation = TRANSLATIONS$1[lang !== undefined ? lang : DEFAULT_LANGUAGE$1][key];
82
+ if (values !== undefined) {
83
+ for (const [key, value] of Object.entries(values.values)) {
84
+ const regex = new RegExp(`{${key}}`, 'g');
85
+ translation = translation.replace(regex, value);
86
+ }
87
+ }
88
+ return translation;
89
+ };
90
+
91
+ const playerUserConsentsCss = ":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}";
92
+
93
+ const PlayerUserConsents = class {
94
+ constructor(hostRef) {
95
+ index.registerInstance(this, hostRef);
96
+ this.userLegislationConsent = index.createEvent(this, "userLegislationConsent", 7);
97
+ /**
98
+ * Language
99
+ */
100
+ this.lang = 'en';
101
+ /**
102
+ * 'true' when parent expects component to emit it's current value
103
+ */
104
+ this.queried = false;
105
+ /**
106
+ * the type of the consent, used to determine render details
107
+ */
108
+ this.consentType = '';
109
+ /**
110
+ * wether or not this consent is mandatory. Used for render details
111
+ */
112
+ this.mandatory = false;
113
+ /**
114
+ * the title of the consent to be displayed
115
+ */
116
+ this.consentTitle = '';
117
+ /**
118
+ * Client custom styling via inline style
119
+ */
120
+ this.clientStyling = '';
121
+ /**
122
+ * Translation url
123
+ */
124
+ this.translationUrl = '';
125
+ /**
126
+ * the text content to be rendered by the component. Determined at runtime
127
+ */
128
+ this.textContent = '';
129
+ this.limitStylingAppends = false;
130
+ this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
131
+ this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
132
+ this.setClientStyling = () => {
133
+ let sheet = document.createElement('style');
134
+ sheet.innerHTML = this.clientStyling;
135
+ this.stylingContainer.prepend(sheet);
136
+ };
137
+ }
138
+ handleNewTranslations() {
139
+ getTranslations$1(this.translationUrl);
140
+ }
141
+ async componentWillLoad() {
142
+ if (this.translationUrl.length > 2) {
143
+ await getTranslations$1(this.translationUrl);
144
+ }
145
+ }
146
+ userLegislationConsentHandler() {
147
+ this.userLegislationConsent.emit({
148
+ type: this.consentType,
149
+ value: this.checkboxInput.checked
150
+ });
151
+ }
152
+ componentDidRender() {
153
+ // start custom styling area
154
+ if (!this.limitStylingAppends && this.stylingContainer) {
155
+ if (this.clientStyling)
156
+ this.setClientStyling();
157
+ this.limitStylingAppends = true;
158
+ }
159
+ // end custom styling area
160
+ }
161
+ determineTextContent() {
162
+ return this.consentType === 'termsandconditions' ?
163
+ index.h("p", null, translate$1('termsandconditions1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate$1('tc', this.lang)), translate$1('termsandconditions2', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate$1('privacy', this.lang)), translate$1('termsandconditions3', this.lang))
164
+ : index.h("p", null, translate$1('consentType', this.lang));
165
+ }
166
+ render() {
167
+ if (this.queried) {
168
+ this.userLegislationConsentHandler();
169
+ }
170
+ return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("p", { class: "ConsentTitle" }, this.consentTitle), index.h("label", { class: "UserConsent", htmlFor: "userConsent" }, index.h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && index.h("span", { class: "MandatoryItem" }, "*"))));
171
+ }
172
+ static get watchers() { return {
173
+ "translationUrl": ["handleNewTranslations"]
174
+ }; }
175
+ };
176
+ PlayerUserConsents.style = playerUserConsentsCss;
177
+
178
+ const DEFAULT_LANGUAGE = 'en';
179
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
180
+ const TRANSLATIONS = {
181
+ en: {
182
+ termsandconditions: 'Terms and Conditions',
183
+ sms: 'SMS marketing',
184
+ emailmarketing: 'Email marketing'
185
+ },
186
+ ro: {
187
+ termsandconditions: 'Terms and Conditions',
188
+ sms: 'SMS marketing',
189
+ emailmarketing: 'Email marketing'
190
+ },
191
+ hr: {
192
+ termsandconditions: 'Terms and Conditions',
193
+ sms: 'SMS marketing',
194
+ emailmarketing: 'Email marketing'
195
+ },
196
+ fr: {
197
+ termsandconditions: 'Terms and Conditions',
198
+ sms: 'SMS marketing',
199
+ emailmarketing: 'Email marketing'
200
+ },
201
+ cs: {
202
+ termsandconditions: 'Terms and Conditions',
203
+ sms: 'SMS marketing',
204
+ emailmarketing: 'Email marketing'
205
+ },
206
+ de: {
207
+ termsandconditions: 'Terms and Conditions',
208
+ sms: 'SMS marketing',
209
+ emailmarketing: 'Email marketing'
210
+ },
211
+ };
212
+ const getTranslations = (url) => {
213
+ // fetch url, get the data, replace the TRANSLATIONS content
214
+ return new Promise((resolve) => {
215
+ fetch(url)
216
+ .then((res) => res.json())
217
+ .then((data) => {
218
+ Object.keys(data).forEach((item) => {
219
+ for (let key in data[item]) {
220
+ TRANSLATIONS[item][key] = data[item][key];
221
+ }
222
+ });
223
+ resolve(true);
224
+ });
225
+ });
226
+ };
227
+ const translate = (key, customLang, values) => {
228
+ const lang = customLang;
229
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
230
+ if (values !== undefined) {
231
+ for (const [key, value] of Object.entries(values.values)) {
232
+ const regex = new RegExp(`{${key}}`, 'g');
233
+ translation = translation.replace(regex, value);
234
+ }
235
+ }
236
+ return translation;
237
+ };
238
+
239
+ const userActionControllerCss = ":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}.spinner{animation:rotate 2s linear infinite;z-index:2;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;width:50px;height:50px}.spinner .path{stroke:var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}";
240
+
241
+ const UserActionController = class {
242
+ constructor(hostRef) {
243
+ index.registerInstance(this, hostRef);
244
+ /**
245
+ * Language
246
+ */
247
+ this.lang = 'en';
248
+ /**
249
+ * Select GM version
250
+ */
251
+ this.gmVersion = '';
252
+ /**
253
+ * Translation url
254
+ */
255
+ this.translationUrl = '';
256
+ /**
257
+ * Client custom styling via inline style
258
+ */
259
+ this.clientStyling = '';
260
+ /**
261
+ * Client custom styling via url
262
+ */
263
+ this.clientStylingUrl = '';
264
+ /**
265
+ * Which actions are required in order to activate the "Apply" button. Other actions are considered optional.
266
+ */
267
+ this.queryFired = false;
268
+ this.readyActionsCount = 0;
269
+ this.activeUserActions = [];
270
+ this.userActionsValidated = true;
271
+ this.receivedQueryResponses = 0;
272
+ this.limitStylingAppends = false;
273
+ this.isLoading = true;
274
+ this.mandatoryActionsChecked = 0;
275
+ //for now this variable is hardcoded bcs we have only terms and conditions mandatory and we dont receive with these new functionality the mandatory actions
276
+ this.mandatoryActions = ['termsandconditions'];
277
+ this.userActions = [];
278
+ this.consentTitles = {
279
+ termsandconditions: translate('termsandconditions', this.lang),
280
+ sms: translate('sms', this.lang),
281
+ emailmarketing: translate('emailmarketing', this.lang)
282
+ };
283
+ this.setClientStyling = () => {
284
+ let sheet = document.createElement('style');
285
+ sheet.innerHTML = this.clientStyling;
286
+ this.stylingContainer.prepend(sheet);
287
+ };
288
+ this.setClientStylingURL = () => {
289
+ let url = new URL(this.clientStylingUrl);
290
+ let cssFile = document.createElement('style');
291
+ fetch(url.href)
292
+ .then((res) => res.text())
293
+ .then((data) => {
294
+ this.clientStyling = data;
295
+ cssFile.innerHTML = data;
296
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
297
+ })
298
+ .catch((err) => {
299
+ console.log('error ', err);
300
+ });
301
+ };
302
+ }
303
+ handleNewTranslations() {
304
+ getTranslations(this.translationUrl);
305
+ }
306
+ handleQueryResponse() {
307
+ if (this.receivedQueryResponses === this.activeUserActions.length) {
308
+ this.updateUserConsents();
309
+ }
310
+ }
311
+ userLegislationConsentHandler(event) {
312
+ const actionType = event.detail.type;
313
+ const actionTypeChecked = event.detail.value;
314
+ if (this.mandatoryActions.includes(actionType) && this.queryFired === false) {
315
+ actionTypeChecked === true ? this.mandatoryActionsChecked++ : this.mandatoryActionsChecked--;
316
+ }
317
+ // Register final user choices only if we're ready to update
318
+ if (this.queryFired) {
319
+ this.userActions.push({ tagCode: actionType, status: actionTypeChecked ? 'Accepted' : 'Denied' });
320
+ this.receivedQueryResponses++;
321
+ }
322
+ }
323
+ determineUserActions() {
324
+ const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
325
+ const headers = new Headers();
326
+ headers.append('X-SessionId', this.userSession);
327
+ let requestOptions;
328
+ requestOptions = {
329
+ method: 'GET',
330
+ headers
331
+ };
332
+ if (url && requestOptions) {
333
+ return fetch(url.href, requestOptions)
334
+ .then(res => res.json())
335
+ .then(data => {
336
+ const actionItems = data.items;
337
+ actionItems.forEach(element => {
338
+ if (element.status === 'Expired') {
339
+ this.activeUserActions.push(element.tagCode);
340
+ }
341
+ });
342
+ this.isLoading = false;
343
+ })
344
+ .catch(error => {
345
+ console.error('Error fetching data:', error);
346
+ this.isLoading = false;
347
+ });
348
+ }
349
+ else {
350
+ return Promise.reject('Unsupported endpoint');
351
+ }
352
+ }
353
+ updateUserConsents() {
354
+ let url;
355
+ let requestOptions;
356
+ url = (this.gmVersion === 'gmcore')
357
+ ? new URL(`${this.endpoint}/v1/player/${this.userId}/consent`)
358
+ : new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
359
+ const body = (this.gmVersion === 'gmcore')
360
+ ? {
361
+ items: this.userActions
362
+ }
363
+ : {
364
+ consents: [
365
+ {
366
+ tagCode: "termsandconditions",
367
+ note: "",
368
+ status: 1
369
+ }
370
+ ]
371
+ };
372
+ requestOptions = {
373
+ method: 'POST',
374
+ headers: {
375
+ 'Content-Type': 'application/json',
376
+ 'Accept': 'application/json',
377
+ 'X-SessionId': `${this.userSession}`,
378
+ },
379
+ body: JSON.stringify(body)
380
+ };
381
+ if (url && requestOptions) {
382
+ fetch(url.href, requestOptions)
383
+ .then(res => res.json())
384
+ .then(() => {
385
+ window.postMessage({
386
+ type: 'WidgetNotification',
387
+ data: {
388
+ type: 'success',
389
+ message: 'Consent update successful!'
390
+ }
391
+ }, window.location.href);
392
+ })
393
+ .catch((err) => {
394
+ window.postMessage({
395
+ type: 'WidgetNotification',
396
+ data: {
397
+ type: 'error',
398
+ message: 'Server might not be responding',
399
+ err
400
+ }
401
+ }, window.location.href);
402
+ })
403
+ .finally(() => {
404
+ window.postMessage({ type: 'UserActionsCompleted' }, window.location.href);
405
+ });
406
+ }
407
+ }
408
+ handleApplyClick() {
409
+ this.queryFired = true;
410
+ }
411
+ async componentWillLoad() {
412
+ if (this.gmVersion === 'gmcore') {
413
+ return this.determineUserActions();
414
+ }
415
+ else {
416
+ this.activeUserActions = ['termsandconditions'];
417
+ this.isLoading = false;
418
+ }
419
+ if (this.translationUrl.length > 2) {
420
+ await getTranslations(this.translationUrl);
421
+ }
422
+ }
423
+ componentDidRender() {
424
+ // start custom styling area
425
+ if (!this.limitStylingAppends && this.stylingContainer) {
426
+ if (this.clientStyling)
427
+ this.setClientStyling();
428
+ if (this.clientStylingUrl)
429
+ this.setClientStylingURL();
430
+ this.limitStylingAppends = true;
431
+ }
432
+ // end custom styling area
433
+ }
434
+ render() {
435
+ const isMandatoryPresent = this.mandatoryActions.every(action => this.activeUserActions.includes(action));
436
+ if (isMandatoryPresent) {
437
+ this.userActionsValidated = !(this.mandatoryActionsChecked === this.mandatoryActions.length);
438
+ }
439
+ else {
440
+ this.userActionsValidated = false;
441
+ }
442
+ return (index.h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (index.h("slot", { name: 'spinner' })
443
+ &&
444
+ index.h("svg", { class: "spinner", viewBox: "0 0 50 50" }, index.h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (index.h("div", { class: "UserActionController" }, index.h("h2", { class: "UserConsentNotice" }, this.userNoticeText), index.h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (index.h("slot", { name: action }, index.h("player-user-consents", { lang: this.lang, "translation-url": this.translationUrl, slot: action, consentType: action, consentTitle: this.consentTitles[action], queried: this.queryFired, mandatory: this.mandatoryActions.includes(action), "client-styling": this.clientStyling }))))), this.includeSubmitButton &&
445
+ index.h("button", { class: "ConsentSubmitButton", disabled: this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
446
+ }
447
+ static get watchers() { return {
448
+ "translationUrl": ["handleNewTranslations"],
449
+ "receivedQueryResponses": ["handleQueryResponse"]
450
+ }; }
451
+ };
452
+ UserActionController.style = userActionControllerCss;
453
+
454
+ exports.player_user_consents = PlayerUserConsents;
455
+ exports.user_action_controller = UserActionController;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-87049e21.js');
4
+
5
+ /*
6
+ Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ const patchBrowser = () => {
9
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-action-controller.cjs.js', document.baseURI).href));
10
+ const opts = {};
11
+ if (importMeta !== '') {
12
+ opts.resourcesUrl = new URL('.', importMeta).href;
13
+ }
14
+ return index.promiseResolve(opts);
15
+ };
16
+
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"],"submitButtonText":[513,"submit-button-text"],"userNoticeText":[513,"user-notice-text"],"gmVersion":[1,"gm-version"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"queryFired":[32],"readyActionsCount":[32],"activeUserActions":[32],"userActionsValidated":[32],"receivedQueryResponses":[32],"limitStylingAppends":[32],"isLoading":[32],"mandatoryActionsChecked":[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
19
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "entries": [
3
+ "./components/user-action-controller/user-action-controller.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "2.15.2",
8
+ "typescriptVersion": "4.5.4"
9
+ },
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/player-user-consents",
13
+ "tags": [
14
+ "player-user-consents"
15
+ ]
16
+ }
17
+ ],
18
+ "bundles": []
19
+ }
@@ -0,0 +1,89 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .QueryReferenceContainer {
6
+ height: 100%;
7
+ width: 100%;
8
+ }
9
+
10
+ .UserConsentNotice {
11
+ font-size: 1.2rem;
12
+ font-weight: 200;
13
+ text-align: center;
14
+ }
15
+
16
+ .CloseButton {
17
+ width: 25px;
18
+ height: 25px;
19
+ align-self: flex-end;
20
+ }
21
+
22
+ .UserActionController {
23
+ font-family: Arial, Helvetica, sans-serif;
24
+ font-weight: 100;
25
+ height: 100%;
26
+ width: 100%;
27
+ padding: 1rem 1.5rem 2rem;
28
+ background-color: #fff;
29
+ display: flex;
30
+ flex-direction: column;
31
+ justify-content: space-between;
32
+ border-radius: 5%;
33
+ }
34
+
35
+ .ConsentSubmitButton {
36
+ font-size: 1rem;
37
+ padding: 0.4rem 1.4rem;
38
+ background: #fff;
39
+ border: 2px solid #000;
40
+ color: #000;
41
+ border-radius: 5px;
42
+ align-self: flex-end;
43
+ }
44
+ .ConsentSubmitButton:disabled {
45
+ border: 2px solid #ccc;
46
+ color: #ccc;
47
+ }
48
+
49
+ @media screen and (max-width: 320px) {
50
+ .QueryReferenceContainer {
51
+ font-size: 0.8rem;
52
+ color: blue;
53
+ }
54
+ }
55
+ .spinner {
56
+ animation: rotate 2s linear infinite;
57
+ z-index: 2;
58
+ position: absolute;
59
+ top: 50%;
60
+ left: 50%;
61
+ margin: -25px 0 0 -25px;
62
+ width: 50px;
63
+ height: 50px;
64
+ }
65
+ .spinner .path {
66
+ stroke: var(--emfe-w-login-color-primary, var(--emfe-w-color-primary, #D0046C));
67
+ stroke-linecap: round;
68
+ animation: dash 1.5s ease-in-out infinite;
69
+ }
70
+
71
+ @keyframes rotate {
72
+ 100% {
73
+ transform: rotate(360deg);
74
+ }
75
+ }
76
+ @keyframes dash {
77
+ 0% {
78
+ stroke-dasharray: 1, 150;
79
+ stroke-dashoffset: 0;
80
+ }
81
+ 50% {
82
+ stroke-dasharray: 90, 150;
83
+ stroke-dashoffset: -35;
84
+ }
85
+ 100% {
86
+ stroke-dasharray: 90, 150;
87
+ stroke-dashoffset: -124;
88
+ }
89
+ }