@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,199 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const TRANSLATIONS = {
5
+ en: {
6
+ termsandconditions1: "I accept the ",
7
+ termsandconditions2: ", I have read and understood the ",
8
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
9
+ tc: "Terms and Conditions",
10
+ privacy: "Privacy Policy",
11
+ sms: "I consent to receive marketing communication via SMS.",
12
+ emailmarketing: "I consent to receive marketing communication via Email."
13
+ },
14
+ ro: {
15
+ termsandconditions1: "I accept the ",
16
+ termsandconditions2: ", I have read and understood the ",
17
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
18
+ tc: "Terms and Conditions",
19
+ privacy: "Privacy Policy",
20
+ sms: "I consent to receive marketing communication via SMS.",
21
+ emailmarketing: "I consent to receive marketing communication via Email."
22
+ },
23
+ hr: {
24
+ termsandconditions1: "I accept the ",
25
+ termsandconditions2: ", I have read and understood the ",
26
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
27
+ tc: "Terms and Conditions",
28
+ privacy: "Privacy Policy",
29
+ sms: "I consent to receive marketing communication via SMS.",
30
+ emailmarketing: "I consent to receive marketing communication via Email."
31
+ },
32
+ fr: {
33
+ termsandconditions1: "I accept the ",
34
+ termsandconditions2: ", I have read and understood the ",
35
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
36
+ tc: "Terms and Conditions",
37
+ privacy: "Privacy Policy",
38
+ sms: "I consent to receive marketing communication via SMS.",
39
+ emailmarketing: "I consent to receive marketing communication via Email."
40
+ },
41
+ cs: {
42
+ termsandconditions1: "I accept the ",
43
+ termsandconditions2: ", I have read and understood the ",
44
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
45
+ tc: "Terms and Conditions",
46
+ privacy: "Privacy Policy",
47
+ sms: "I consent to receive marketing communication via SMS.",
48
+ emailmarketing: "I consent to receive marketing communication via Email."
49
+ },
50
+ de: {
51
+ termsandconditions1: "I accept the ",
52
+ termsandconditions2: ", I have read and understood the ",
53
+ termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
54
+ tc: "Terms and Conditions",
55
+ privacy: "Privacy Policy",
56
+ sms: "I consent to receive marketing communication via SMS.",
57
+ emailmarketing: "I consent to receive marketing communication via Email."
58
+ },
59
+ };
60
+ const getTranslations = (url) => {
61
+ // fetch url, get the data, replace the TRANSLATIONS content
62
+ return new Promise((resolve) => {
63
+ fetch(url)
64
+ .then((res) => res.json())
65
+ .then((data) => {
66
+ Object.keys(data).forEach((item) => {
67
+ for (let key in data[item]) {
68
+ TRANSLATIONS[item][key] = data[item][key];
69
+ }
70
+ });
71
+ resolve(true);
72
+ });
73
+ });
74
+ };
75
+ const translate = (key, customLang, values) => {
76
+ const lang = customLang;
77
+ let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
78
+ if (values !== undefined) {
79
+ for (const [key, value] of Object.entries(values.values)) {
80
+ const regex = new RegExp(`{${key}}`, 'g');
81
+ translation = translation.replace(regex, value);
82
+ }
83
+ }
84
+ return translation;
85
+ };
86
+
87
+ 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}";
88
+
89
+ const PlayerUserConsents = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
90
+ constructor() {
91
+ super();
92
+ this.__registerHost();
93
+ this.__attachShadow();
94
+ this.userLegislationConsent = createEvent(this, "userLegislationConsent", 7);
95
+ /**
96
+ * Language
97
+ */
98
+ this.lang = 'en';
99
+ /**
100
+ * 'true' when parent expects component to emit it's current value
101
+ */
102
+ this.queried = false;
103
+ /**
104
+ * the type of the consent, used to determine render details
105
+ */
106
+ this.consentType = '';
107
+ /**
108
+ * wether or not this consent is mandatory. Used for render details
109
+ */
110
+ this.mandatory = false;
111
+ /**
112
+ * the title of the consent to be displayed
113
+ */
114
+ this.consentTitle = '';
115
+ /**
116
+ * Client custom styling via inline style
117
+ */
118
+ this.clientStyling = '';
119
+ /**
120
+ * Translation url
121
+ */
122
+ this.translationUrl = '';
123
+ /**
124
+ * the text content to be rendered by the component. Determined at runtime
125
+ */
126
+ this.textContent = '';
127
+ this.limitStylingAppends = false;
128
+ this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
129
+ this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
130
+ this.setClientStyling = () => {
131
+ let sheet = document.createElement('style');
132
+ sheet.innerHTML = this.clientStyling;
133
+ this.stylingContainer.prepend(sheet);
134
+ };
135
+ }
136
+ handleNewTranslations() {
137
+ getTranslations(this.translationUrl);
138
+ }
139
+ async componentWillLoad() {
140
+ if (this.translationUrl.length > 2) {
141
+ await getTranslations(this.translationUrl);
142
+ }
143
+ }
144
+ userLegislationConsentHandler() {
145
+ this.userLegislationConsent.emit({
146
+ type: this.consentType,
147
+ value: this.checkboxInput.checked
148
+ });
149
+ }
150
+ componentDidRender() {
151
+ // start custom styling area
152
+ if (!this.limitStylingAppends && this.stylingContainer) {
153
+ if (this.clientStyling)
154
+ this.setClientStyling();
155
+ this.limitStylingAppends = true;
156
+ }
157
+ // end custom styling area
158
+ }
159
+ determineTextContent() {
160
+ return this.consentType === 'termsandconditions' ?
161
+ h("p", null, translate('termsandconditions1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
162
+ : h("p", null, translate('consentType', this.lang));
163
+ }
164
+ render() {
165
+ if (this.queried) {
166
+ this.userLegislationConsentHandler();
167
+ }
168
+ return (h("div", { ref: el => this.stylingContainer = el }, h("p", { class: "ConsentTitle" }, this.consentTitle), h("label", { class: "UserConsent", htmlFor: "userConsent" }, h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
169
+ }
170
+ static get watchers() { return {
171
+ "translationUrl": ["handleNewTranslations"]
172
+ }; }
173
+ static get style() { return playerUserConsentsCss; }
174
+ }, [1, "player-user-consents", {
175
+ "lang": [1537],
176
+ "queried": [516],
177
+ "consentType": [513, "consent-type"],
178
+ "mandatory": [516],
179
+ "consentTitle": [513, "consent-title"],
180
+ "clientStyling": [1, "client-styling"],
181
+ "translationUrl": [513, "translation-url"],
182
+ "textContent": [32],
183
+ "limitStylingAppends": [32]
184
+ }]);
185
+ function defineCustomElement() {
186
+ if (typeof customElements === "undefined") {
187
+ return;
188
+ }
189
+ const components = ["player-user-consents"];
190
+ components.forEach(tagName => { switch (tagName) {
191
+ case "player-user-consents":
192
+ if (!customElements.get(tagName)) {
193
+ customElements.define(tagName, PlayerUserConsents);
194
+ }
195
+ break;
196
+ } });
197
+ }
198
+
199
+ export { PlayerUserConsents as P, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface UserActionController extends Components.UserActionController, HTMLElement {}
4
+ export const UserActionController: {
5
+ prototype: UserActionController;
6
+ new (): UserActionController;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,323 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './player-user-consents2.js';
3
+
4
+ const DEFAULT_LANGUAGE = 'en';
5
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'cz', 'de', 'hr'];
6
+ const TRANSLATIONS = {
7
+ en: {
8
+ termsandconditions: 'Terms and Conditions',
9
+ sms: 'SMS marketing',
10
+ emailmarketing: 'Email marketing'
11
+ },
12
+ ro: {
13
+ termsandconditions: 'Terms and Conditions',
14
+ sms: 'SMS marketing',
15
+ emailmarketing: 'Email marketing'
16
+ },
17
+ hr: {
18
+ termsandconditions: 'Terms and Conditions',
19
+ sms: 'SMS marketing',
20
+ emailmarketing: 'Email marketing'
21
+ },
22
+ fr: {
23
+ termsandconditions: 'Terms and Conditions',
24
+ sms: 'SMS marketing',
25
+ emailmarketing: 'Email marketing'
26
+ },
27
+ cs: {
28
+ termsandconditions: 'Terms and Conditions',
29
+ sms: 'SMS marketing',
30
+ emailmarketing: 'Email marketing'
31
+ },
32
+ de: {
33
+ termsandconditions: 'Terms and Conditions',
34
+ sms: 'SMS marketing',
35
+ emailmarketing: 'Email marketing'
36
+ },
37
+ };
38
+ const getTranslations = (url) => {
39
+ // fetch url, get the data, replace the TRANSLATIONS content
40
+ return new Promise((resolve) => {
41
+ fetch(url)
42
+ .then((res) => res.json())
43
+ .then((data) => {
44
+ Object.keys(data).forEach((item) => {
45
+ for (let key in data[item]) {
46
+ TRANSLATIONS[item][key] = data[item][key];
47
+ }
48
+ });
49
+ resolve(true);
50
+ });
51
+ });
52
+ };
53
+ const translate = (key, customLang, values) => {
54
+ const lang = customLang;
55
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
56
+ if (values !== undefined) {
57
+ for (const [key, value] of Object.entries(values.values)) {
58
+ const regex = new RegExp(`{${key}}`, 'g');
59
+ translation = translation.replace(regex, value);
60
+ }
61
+ }
62
+ return translation;
63
+ };
64
+
65
+ 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}}";
66
+
67
+ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
68
+ constructor() {
69
+ super();
70
+ this.__registerHost();
71
+ this.__attachShadow();
72
+ /**
73
+ * Language
74
+ */
75
+ this.lang = 'en';
76
+ /**
77
+ * Select GM version
78
+ */
79
+ this.gmVersion = '';
80
+ /**
81
+ * Translation url
82
+ */
83
+ this.translationUrl = '';
84
+ /**
85
+ * Client custom styling via inline style
86
+ */
87
+ this.clientStyling = '';
88
+ /**
89
+ * Client custom styling via url
90
+ */
91
+ this.clientStylingUrl = '';
92
+ /**
93
+ * Which actions are required in order to activate the "Apply" button. Other actions are considered optional.
94
+ */
95
+ this.queryFired = false;
96
+ this.readyActionsCount = 0;
97
+ this.activeUserActions = [];
98
+ this.userActionsValidated = true;
99
+ this.receivedQueryResponses = 0;
100
+ this.limitStylingAppends = false;
101
+ this.isLoading = true;
102
+ this.mandatoryActionsChecked = 0;
103
+ //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
104
+ this.mandatoryActions = ['termsandconditions'];
105
+ this.userActions = [];
106
+ this.consentTitles = {
107
+ termsandconditions: translate('termsandconditions', this.lang),
108
+ sms: translate('sms', this.lang),
109
+ emailmarketing: translate('emailmarketing', this.lang)
110
+ };
111
+ this.setClientStyling = () => {
112
+ let sheet = document.createElement('style');
113
+ sheet.innerHTML = this.clientStyling;
114
+ this.stylingContainer.prepend(sheet);
115
+ };
116
+ this.setClientStylingURL = () => {
117
+ let url = new URL(this.clientStylingUrl);
118
+ let cssFile = document.createElement('style');
119
+ fetch(url.href)
120
+ .then((res) => res.text())
121
+ .then((data) => {
122
+ this.clientStyling = data;
123
+ cssFile.innerHTML = data;
124
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
125
+ })
126
+ .catch((err) => {
127
+ console.log('error ', err);
128
+ });
129
+ };
130
+ }
131
+ handleNewTranslations() {
132
+ getTranslations(this.translationUrl);
133
+ }
134
+ handleQueryResponse() {
135
+ if (this.receivedQueryResponses === this.activeUserActions.length) {
136
+ this.updateUserConsents();
137
+ }
138
+ }
139
+ userLegislationConsentHandler(event) {
140
+ const actionType = event.detail.type;
141
+ const actionTypeChecked = event.detail.value;
142
+ if (this.mandatoryActions.includes(actionType) && this.queryFired === false) {
143
+ actionTypeChecked === true ? this.mandatoryActionsChecked++ : this.mandatoryActionsChecked--;
144
+ }
145
+ // Register final user choices only if we're ready to update
146
+ if (this.queryFired) {
147
+ this.userActions.push({ tagCode: actionType, status: actionTypeChecked ? 'Accepted' : 'Denied' });
148
+ this.receivedQueryResponses++;
149
+ }
150
+ }
151
+ determineUserActions() {
152
+ const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
153
+ const headers = new Headers();
154
+ headers.append('X-SessionId', this.userSession);
155
+ let requestOptions;
156
+ requestOptions = {
157
+ method: 'GET',
158
+ headers
159
+ };
160
+ if (url && requestOptions) {
161
+ return fetch(url.href, requestOptions)
162
+ .then(res => res.json())
163
+ .then(data => {
164
+ const actionItems = data.items;
165
+ actionItems.forEach(element => {
166
+ if (element.status === 'Expired') {
167
+ this.activeUserActions.push(element.tagCode);
168
+ }
169
+ });
170
+ this.isLoading = false;
171
+ })
172
+ .catch(error => {
173
+ console.error('Error fetching data:', error);
174
+ this.isLoading = false;
175
+ });
176
+ }
177
+ else {
178
+ return Promise.reject('Unsupported endpoint');
179
+ }
180
+ }
181
+ updateUserConsents() {
182
+ let url;
183
+ let requestOptions;
184
+ url = (this.gmVersion === 'gmcore')
185
+ ? new URL(`${this.endpoint}/v1/player/${this.userId}/consent`)
186
+ : new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`);
187
+ const body = (this.gmVersion === 'gmcore')
188
+ ? {
189
+ items: this.userActions
190
+ }
191
+ : {
192
+ consents: [
193
+ {
194
+ tagCode: "termsandconditions",
195
+ note: "",
196
+ status: 1
197
+ }
198
+ ]
199
+ };
200
+ requestOptions = {
201
+ method: 'POST',
202
+ headers: {
203
+ 'Content-Type': 'application/json',
204
+ 'Accept': 'application/json',
205
+ 'X-SessionId': `${this.userSession}`,
206
+ },
207
+ body: JSON.stringify(body)
208
+ };
209
+ if (url && requestOptions) {
210
+ fetch(url.href, requestOptions)
211
+ .then(res => res.json())
212
+ .then(() => {
213
+ window.postMessage({
214
+ type: 'WidgetNotification',
215
+ data: {
216
+ type: 'success',
217
+ message: 'Consent update successful!'
218
+ }
219
+ }, window.location.href);
220
+ })
221
+ .catch((err) => {
222
+ window.postMessage({
223
+ type: 'WidgetNotification',
224
+ data: {
225
+ type: 'error',
226
+ message: 'Server might not be responding',
227
+ err
228
+ }
229
+ }, window.location.href);
230
+ })
231
+ .finally(() => {
232
+ window.postMessage({ type: 'UserActionsCompleted' }, window.location.href);
233
+ });
234
+ }
235
+ }
236
+ handleApplyClick() {
237
+ this.queryFired = true;
238
+ }
239
+ async componentWillLoad() {
240
+ if (this.gmVersion === 'gmcore') {
241
+ return this.determineUserActions();
242
+ }
243
+ else {
244
+ this.activeUserActions = ['termsandconditions'];
245
+ this.isLoading = false;
246
+ }
247
+ if (this.translationUrl.length > 2) {
248
+ await getTranslations(this.translationUrl);
249
+ }
250
+ }
251
+ componentDidRender() {
252
+ // start custom styling area
253
+ if (!this.limitStylingAppends && this.stylingContainer) {
254
+ if (this.clientStyling)
255
+ this.setClientStyling();
256
+ if (this.clientStylingUrl)
257
+ this.setClientStylingURL();
258
+ this.limitStylingAppends = true;
259
+ }
260
+ // end custom styling area
261
+ }
262
+ render() {
263
+ const isMandatoryPresent = this.mandatoryActions.every(action => this.activeUserActions.includes(action));
264
+ if (isMandatoryPresent) {
265
+ this.userActionsValidated = !(this.mandatoryActionsChecked === this.mandatoryActions.length);
266
+ }
267
+ else {
268
+ this.userActionsValidated = false;
269
+ }
270
+ return (h("div", { class: "QueryReferenceContainer", ref: el => this.stylingContainer = el }, this.isLoading ? (h("slot", { name: 'spinner' })
271
+ &&
272
+ h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))) : (h("div", { class: "UserActionController" }, h("h2", { class: "UserConsentNotice" }, this.userNoticeText), h("div", { class: "PlayerLegislationWrapper" }, this.activeUserActions.map(action => (h("slot", { name: action }, h("player-user-consents", { lang: this.lang, "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 &&
273
+ h("button", { class: "ConsentSubmitButton", disabled: this.userActionsValidated, onClick: () => this.handleApplyClick() }, this.submitButtonText)))));
274
+ }
275
+ static get watchers() { return {
276
+ "translationUrl": ["handleNewTranslations"],
277
+ "receivedQueryResponses": ["handleQueryResponse"]
278
+ }; }
279
+ static get style() { return userActionControllerCss; }
280
+ }, [1, "user-action-controller", {
281
+ "endpoint": [513],
282
+ "userSession": [513, "user-session"],
283
+ "userId": [513, "user-id"],
284
+ "lang": [1537],
285
+ "includeSubmitButton": [516, "include-submit-button"],
286
+ "submitButtonText": [513, "submit-button-text"],
287
+ "userNoticeText": [513, "user-notice-text"],
288
+ "gmVersion": [1, "gm-version"],
289
+ "translationUrl": [513, "translation-url"],
290
+ "clientStyling": [1537, "client-styling"],
291
+ "clientStylingUrl": [513, "client-styling-url"],
292
+ "queryFired": [32],
293
+ "readyActionsCount": [32],
294
+ "activeUserActions": [32],
295
+ "userActionsValidated": [32],
296
+ "receivedQueryResponses": [32],
297
+ "limitStylingAppends": [32],
298
+ "isLoading": [32],
299
+ "mandatoryActionsChecked": [32]
300
+ }, [[0, "userLegislationConsent", "userLegislationConsentHandler"]]]);
301
+ function defineCustomElement$1() {
302
+ if (typeof customElements === "undefined") {
303
+ return;
304
+ }
305
+ const components = ["user-action-controller", "player-user-consents"];
306
+ components.forEach(tagName => { switch (tagName) {
307
+ case "user-action-controller":
308
+ if (!customElements.get(tagName)) {
309
+ customElements.define(tagName, UserActionController$1);
310
+ }
311
+ break;
312
+ case "player-user-consents":
313
+ if (!customElements.get(tagName)) {
314
+ defineCustomElement$2();
315
+ }
316
+ break;
317
+ } });
318
+ }
319
+
320
+ const UserActionController = UserActionController$1;
321
+ const defineCustomElement = defineCustomElement$1;
322
+
323
+ export { UserActionController, defineCustomElement };