@everymatrix/player-account-anonymization 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-b17b388b.js +1226 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/player-account-anonymization.cjs.entry.js +229 -0
- package/dist/cjs/player-account-anonymization.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/player-account-anonymization/player-account-anonymization.css +85 -0
- package/dist/collection/components/player-account-anonymization/player-account-anonymization.js +225 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +111 -0
- package/dist/collection/utils/utils.js +17 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/player-account-anonymization.d.ts +11 -0
- package/dist/components/player-account-anonymization.js +252 -0
- package/dist/esm/index-3a22636c.js +1201 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/player-account-anonymization.entry.js +225 -0
- package/dist/esm/player-account-anonymization.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/player-account-anonymization/index.esm.js +0 -0
- package/dist/player-account-anonymization/p-78d850c9.js +1 -0
- package/dist/player-account-anonymization/p-8ff60fed.entry.js +1 -0
- package/dist/player-account-anonymization/player-account-anonymization.esm.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-account-anonymization/.stencil/packages/player-account-anonymization/stencil.config.d.ts +2 -0
- package/dist/types/components/player-account-anonymization/player-account-anonymization.d.ts +41 -0
- package/dist/types/components.d.ts +85 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b17b388b.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-account-anonymization.cjs",[[1,"player-account-anonymization",{"endpoint":[513],"language":[513],"session":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isMobile":[32],"displayConfirmationPopup":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b17b388b.js');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const TRANSLATIONS = {
|
|
9
|
+
en: {
|
|
10
|
+
"title": "Account Anonymization",
|
|
11
|
+
"description": "According to the General Data Protection Regulation (GDPR), you have the right to anonymize your personal information from the system. This process will take up to 30 days, once started.",
|
|
12
|
+
"confirmation": "Please confirm that you wish to start the personal information anonymization process.",
|
|
13
|
+
"btnSubmit": "Submit Request",
|
|
14
|
+
"btnCancel": "Cancel",
|
|
15
|
+
"btnOpenConfirmationPopup": "Request Anonymization",
|
|
16
|
+
"successMsg": "The anonymization process was started successfully.",
|
|
17
|
+
"errorMsg": "An error occurred. Please try again later."
|
|
18
|
+
},
|
|
19
|
+
ro: {
|
|
20
|
+
"title": "Anonimizarea contului",
|
|
21
|
+
"description": "Conform Regulamentului General privind Protecția Datelor (GDPR), aveți dreptul de a anonimiza informațiile dvs. personale din sistem. Acest proces va dura până la 30 de zile de la inițiere.",
|
|
22
|
+
"confirmation": "Vă rugăm să confirmați că doriți să începeți procesul de anonimizare a informațiilor personale.",
|
|
23
|
+
"btnSubmit": "Trimite solicitarea",
|
|
24
|
+
"btnCancel": "Anulează",
|
|
25
|
+
"btnOpenConfirmationPopup": "Solicită anonimizarea",
|
|
26
|
+
"successMsg": "Procesul de anonimizare a fost inițiat cu succes.",
|
|
27
|
+
"errorMsg": "A apărut o eroare. Vă rugăm să încercați din nou mai târziu."
|
|
28
|
+
},
|
|
29
|
+
fr: {
|
|
30
|
+
"title": "Anonymisation du compte",
|
|
31
|
+
"description": "Conformément au Règlement général sur la protection des données (RGPD), vous avez le droit d'anonymiser vos informations personnelles du système. Ce processus prendra jusqu'à 30 jours une fois commencé.",
|
|
32
|
+
"confirmation": "Veuillez confirmer que vous souhaitez commencer le processus d'anonymisation de vos informations personnelles.",
|
|
33
|
+
"btnSubmit": "Soumettre la demande",
|
|
34
|
+
"btnCancel": "Annuler",
|
|
35
|
+
"btnOpenConfirmationPopup": "Demander l'anonymisation",
|
|
36
|
+
"successMsg": "Le processus d'anonymisation a été lancé avec succès.",
|
|
37
|
+
"errorMsg": "Une erreur s'est produite. Veuillez réessayer plus tard."
|
|
38
|
+
},
|
|
39
|
+
hu: {
|
|
40
|
+
"title": "Fiók anonimizálása",
|
|
41
|
+
"description": "A General Data Protection Regulation (GDPR) szerint joga van anonimizálni személyes adatait a rendszerből. Ez a folyamat legfeljebb 30 napig tart, miután elindult.",
|
|
42
|
+
"confirmation": "Kérjük, erősítse meg, hogy el kívánja indítani a személyes adatok anonimizálási folyamatát.",
|
|
43
|
+
"btnSubmit": "Kérelem benyújtása",
|
|
44
|
+
"btnCancel": "Mégse",
|
|
45
|
+
"btnOpenConfirmationPopup": "Anonimizálás kérése",
|
|
46
|
+
"successMsg": "Az anonimizálási folyamat sikeresen elindult.",
|
|
47
|
+
"errorMsg": "Hiba történt. Kérjük, próbálja meg később."
|
|
48
|
+
},
|
|
49
|
+
tr: {
|
|
50
|
+
"title": "Hesap Anonimleştirme",
|
|
51
|
+
"description": "Genel Veri Koruma Yönetmeliği'ne (GDPR) göre, kişisel bilgilerinizi sistemden anonimleştirme hakkına sahipsiniz. Bu işlem başlatıldıktan sonra 30 güne kadar sürebilir.",
|
|
52
|
+
"confirmation": "Kişisel bilgilerin anonimleştirilme sürecini başlatmak istediğinizi lütfen onaylayın.",
|
|
53
|
+
"btnSubmit": "Talebi Gönder",
|
|
54
|
+
"btnCancel": "İptal",
|
|
55
|
+
"btnOpenConfirmationPopup": "Anonimleştirme Talebi",
|
|
56
|
+
"successMsg": "Anonimleştirme süreci başarıyla başlatıldı.",
|
|
57
|
+
"errorMsg": "Bir hata oluştu. Lütfen daha sonra tekrar deneyin."
|
|
58
|
+
},
|
|
59
|
+
el: {
|
|
60
|
+
"title": "Ανωνυμοποίηση Λογαριασμού",
|
|
61
|
+
"description": "Σύμφωνα με τον Γενικό Κανονισμό Προστασίας Δεδομένων (GDPR), έχετε το δικαίωμα να ανωνυμοποιήσετε τα προσωπικά σας δεδομένα από το σύστημα. Αυτή η διαδικασία θα διαρκέσει έως και 30 ημέρες από την έναρξή της.",
|
|
62
|
+
"confirmation": "Παρακαλούμε επιβεβαιώστε ότι επιθυμείτε να ξεκινήσετε τη διαδικασία ανωνυμοποίησης προσωπικών δεδομένων.",
|
|
63
|
+
"btnSubmit": "Υποβολή Αιτήματος",
|
|
64
|
+
"btnCancel": "Ακύρωση",
|
|
65
|
+
"btnOpenConfirmationPopup": "Αίτημα Ανωνυμοποίησης",
|
|
66
|
+
"successMsg": "Η διαδικασία ανωνυμοποίησης ξεκίνησε με επιτυχία.",
|
|
67
|
+
"errorMsg": "Παρουσιάστηκε σφάλμα. Παρακαλούμε δοκιμάστε ξανά αργότερα."
|
|
68
|
+
},
|
|
69
|
+
es: {
|
|
70
|
+
"title": "Anonimización de Cuenta",
|
|
71
|
+
"description": "De acuerdo con el Reglamento General de Protección de Datos (GDPR), tiene el derecho de anonimizar su información personal del sistema. Este proceso tardará hasta 30 días una vez iniciado.",
|
|
72
|
+
"confirmation": "Por favor, confirme que desea iniciar el proceso de anonimización de la información personal.",
|
|
73
|
+
"btnSubmit": "Enviar Solicitud",
|
|
74
|
+
"btnCancel": "Cancelar",
|
|
75
|
+
"btnOpenConfirmationPopup": "Solicitar Anonimización",
|
|
76
|
+
"successMsg": "El proceso de anonimización se ha iniciado correctamente.",
|
|
77
|
+
"errorMsg": "Ocurrió un error. Por favor, inténtelo de nuevo más tarde."
|
|
78
|
+
},
|
|
79
|
+
pt: {
|
|
80
|
+
"title": "Anonimização de Conta",
|
|
81
|
+
"description": "De acordo com o Regulamento Geral de Proteção de Dados (GDPR), você tem o direito de anonimizar suas informações pessoais do sistema. Este processo levará até 30 dias após o início.",
|
|
82
|
+
"confirmation": "Por favor, confirme que deseja iniciar o processo de anonimização das informações pessoais.",
|
|
83
|
+
"btnSubmit": "Enviar Solicitação",
|
|
84
|
+
"btnCancel": "Cancelar",
|
|
85
|
+
"btnOpenConfirmationPopup": "Solicitar Anonimização",
|
|
86
|
+
"successMsg": "O processo de anonimização foi iniciado com sucesso.",
|
|
87
|
+
"errorMsg": "Ocorreu um erro. Por favor, tente novamente mais tarde."
|
|
88
|
+
},
|
|
89
|
+
hr: {
|
|
90
|
+
"title": "Anonimizacija računa",
|
|
91
|
+
"description": "Prema Općoj uredbi o zaštiti podataka (GDPR), imate pravo anonimizirati svoje osobne podatke iz sustava. Ovaj proces može potrajati do 30 dana nakon početka.",
|
|
92
|
+
"confirmation": "Molimo potvrdite da želite započeti proces anonimizacije osobnih podataka.",
|
|
93
|
+
"btnSubmit": "Pošalji zahtjev",
|
|
94
|
+
"btnCancel": "Otkaži",
|
|
95
|
+
"btnOpenConfirmationPopup": "Zatraži anonimizaciju",
|
|
96
|
+
"successMsg": "Proces anonimizacije uspješno je započeo.",
|
|
97
|
+
"errorMsg": "Došlo je do pogreške. Molimo pokušajte ponovno kasnije."
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
const getTranslations = (url) => {
|
|
101
|
+
return new Promise((resolve) => {
|
|
102
|
+
fetch(url)
|
|
103
|
+
.then((res) => res.json())
|
|
104
|
+
.then((data) => {
|
|
105
|
+
Object.keys(data).forEach((item) => {
|
|
106
|
+
for (let key in data[item]) {
|
|
107
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
resolve(true);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const translate = (key, customLang) => {
|
|
115
|
+
const lang = customLang;
|
|
116
|
+
return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
function checkDeviceType() {
|
|
120
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
121
|
+
const width = screen.availWidth;
|
|
122
|
+
const height = screen.availHeight;
|
|
123
|
+
if (userAgent.includes('iphone')) {
|
|
124
|
+
return 'mobile';
|
|
125
|
+
}
|
|
126
|
+
if (userAgent.includes('android')) {
|
|
127
|
+
if (height > width && width < 800) {
|
|
128
|
+
return 'mobile';
|
|
129
|
+
}
|
|
130
|
+
if (width > height && height < 800) {
|
|
131
|
+
return 'tablet';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return 'desktop';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const playerAccountAnonymizationCss = ":host{display:block}.PlayerAccountAnonymization{font-family:inherit;width:100%;height:100%}.PlayerAccountAnonymization .Title{font-size:var(--emw--font-size-x-large, 26px);color:var(--emw--color-primary, #D0046C);font-weight:var(--emw--font-weight-semibold, 500)}.PlayerAccountAnonymization .Title.Mobile{font-size:var(--emw--font-size-x-large, 20px);color:var(--emw--color-primary, #D0046C)}.PlayerAccountAnonymization svg{fill:var(--emw--color-primary, #D0046C)}.PlayerAccountAnonymization .ButtonReturn{font-family:inherit;display:inline-flex;align-items:center;gap:10px}.PlayerAccountAnonymization .Button{font-family:inherit;border-radius:var(--emw--button-border-radius, var(--emw--border-radius-large, 50px));background:var(--emw--button-background-color, var(--emw--color-primary, #D0046C));border:var(--emw--button-border, 1px solid var(--emw--button-border-color, #D0046C));color:var(--emw--button-text-color, var(--emw--color-white, #FFFFFF));font-size:var(--emw--font-size-large, 20px);font-weight:var(--emw--font-weight-normal, 400);height:50px;width:100%;text-transform:uppercase;cursor:pointer}.PlayerAccountAnonymization .Button.Mobile{font-size:var(--emw--font-size-small, 14px);height:40px}.PlayerAccountAnonymization .Description{padding:10px;text-align:left;font-size:var(--emw--font-size-small, 14px)}.PlayerAccountAnonymization .ConfirmationPopupWindow{z-index:99999;background-color:var(--emw--color-gray-transparency-40, rgba(0, 0, 0, 0.4));display:flex;position:fixed;align-items:center;justify-content:center;top:0;left:0;width:100%;height:100%}.PlayerAccountAnonymization .ConfirmationPopupWindow .ConfirmationPopup{max-width:600px;max-height:800px;align-items:center;position:relative;border:1px solid black;background-color:var(--emw--color-background, #FFFFFF);display:flex;flex-direction:column;gap:100px;padding:15px;border-radius:10px}.PlayerAccountAnonymization .ConfirmationPopupWindow .ConfirmationPopup.Mobile{max-width:300px;max-height:600px}.PlayerAccountAnonymization .ConfirmationPopupWindow .ConfirmationPopup .ButtonContainer{width:100%;display:flex;flex-direction:row;gap:20px;align-items:center}";
|
|
138
|
+
|
|
139
|
+
const PlayerAccountAnonymization = class {
|
|
140
|
+
constructor(hostRef) {
|
|
141
|
+
index.registerInstance(this, hostRef);
|
|
142
|
+
this.isMobile = checkDeviceType() === 'mobile' || checkDeviceType() === 'tablet';
|
|
143
|
+
this.displayConfirmationPopup = false;
|
|
144
|
+
this.setClientStyling = () => {
|
|
145
|
+
const sheet = document.createElement('style');
|
|
146
|
+
sheet.innerHTML = this.clientStyling;
|
|
147
|
+
this.stylingContainer.prepend(sheet);
|
|
148
|
+
};
|
|
149
|
+
this.setClientStylingURL = () => {
|
|
150
|
+
const url = new URL(this.clientStylingUrl);
|
|
151
|
+
const cssFile = document.createElement('style');
|
|
152
|
+
fetch(url.href)
|
|
153
|
+
.then((res) => res.text())
|
|
154
|
+
.then((data) => {
|
|
155
|
+
cssFile.innerHTML = data;
|
|
156
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
157
|
+
})
|
|
158
|
+
.catch((err) => {
|
|
159
|
+
console.log('error ', err);
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
this.toggleScreen = () => {
|
|
163
|
+
window.postMessage({ type: 'PlayerAccountMenuActive', isMobile: this.isMobile }, window.location.href);
|
|
164
|
+
};
|
|
165
|
+
this.openConfirmationPopup = () => {
|
|
166
|
+
this.displayConfirmationPopup = true;
|
|
167
|
+
};
|
|
168
|
+
this.closeConfirmationPopup = () => {
|
|
169
|
+
this.displayConfirmationPopup = false;
|
|
170
|
+
};
|
|
171
|
+
this.submitRequest = () => {
|
|
172
|
+
const url = new URL(`${this.endpoint}/api/v1/players/legislation/anonymization`);
|
|
173
|
+
const headers = new Headers();
|
|
174
|
+
headers.append('X-SessionId', this.session);
|
|
175
|
+
const requestParams = {
|
|
176
|
+
method: 'POST',
|
|
177
|
+
headers: headers,
|
|
178
|
+
};
|
|
179
|
+
fetch(url.href, requestParams)
|
|
180
|
+
.then((res) => {
|
|
181
|
+
if (res.status < 300) {
|
|
182
|
+
window.postMessage({ type: 'PlayerAccountAnonymizationSuccessful' });
|
|
183
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMsg', this.language) } }, window.location.href);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: translate('errorMsg', this.language) } }, window.location.href);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
updateClientStyling() {
|
|
192
|
+
if (this.clientStyling)
|
|
193
|
+
this.setClientStyling();
|
|
194
|
+
if (this.clientStylingUrl)
|
|
195
|
+
this.setClientStylingURL();
|
|
196
|
+
}
|
|
197
|
+
async componentWillLoad() {
|
|
198
|
+
if (this.translationUrl) {
|
|
199
|
+
await getTranslations(this.translationUrl);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
componentDidLoad() {
|
|
203
|
+
if (this.clientStyling)
|
|
204
|
+
this.setClientStyling();
|
|
205
|
+
if (this.clientStylingUrl)
|
|
206
|
+
this.setClientStylingURL();
|
|
207
|
+
}
|
|
208
|
+
debounce(func, delay) {
|
|
209
|
+
return function (...args) {
|
|
210
|
+
clearTimeout(this.debounceTimer);
|
|
211
|
+
this.debounceTimer = setTimeout(() => {
|
|
212
|
+
func.apply(this, args);
|
|
213
|
+
}, delay);
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
render() {
|
|
217
|
+
return index.h("div", { class: "PlayerAccountAnonymization", ref: el => this.stylingContainer = el }, this.isMobile
|
|
218
|
+
? index.h("div", { class: "ButtonReturn", onClick: this.toggleScreen }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), index.h("h2", { class: "Title Mobile" }, translate('title', this.language)))
|
|
219
|
+
: index.h("h2", { class: "Title" }, translate('title', this.language)), index.h("div", { class: "Description" }, index.h("p", null, translate('description', this.language))), index.h("button", { class: "Button", onClick: this.openConfirmationPopup }, translate('btnOpenConfirmationPopup', this.language)), this.displayConfirmationPopup &&
|
|
220
|
+
index.h("div", { class: "ConfirmationPopupWindow" }, index.h("div", { class: 'ConfirmationPopup' + (this.isMobile ? ' Mobile' : '') }, index.h("div", { class: "Description" }, index.h("p", null, translate('confirmation', this.language))), index.h("div", { class: "ButtonContainer" }, index.h("button", { class: "Button" + (this.isMobile ? ' Mobile' : ''), onClick: this.debounce(this.submitRequest, 850) }, translate('btnSubmit', this.language)), index.h("button", { class: "Button" + (this.isMobile ? ' Mobile' : ''), onClick: this.closeConfirmationPopup }, translate('btnCancel', this.language))))));
|
|
221
|
+
}
|
|
222
|
+
static get watchers() { return {
|
|
223
|
+
"clientStyling": ["updateClientStyling"],
|
|
224
|
+
"clientStylingUrl": ["updateClientStyling"]
|
|
225
|
+
}; }
|
|
226
|
+
};
|
|
227
|
+
PlayerAccountAnonymization.style = playerAccountAnonymizationCss;
|
|
228
|
+
|
|
229
|
+
exports.player_account_anonymization = PlayerAccountAnonymization;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-b17b388b.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('player-account-anonymization.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-account-anonymization.cjs",[[1,"player-account-anonymization",{"endpoint":[513],"language":[513],"session":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isMobile":[32],"displayConfirmationPopup":[32]}]]]], options);
|
|
19
|
+
});
|
package/dist/collection/components/player-account-anonymization/player-account-anonymization.css
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.PlayerAccountAnonymization {
|
|
6
|
+
font-family: inherit;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
.PlayerAccountAnonymization .Title {
|
|
11
|
+
font-size: var(--emw--font-size-x-large, 26px);
|
|
12
|
+
color: var(--emw--color-primary, #D0046C);
|
|
13
|
+
font-weight: var(--emw--font-weight-semibold, 500);
|
|
14
|
+
}
|
|
15
|
+
.PlayerAccountAnonymization .Title.Mobile {
|
|
16
|
+
font-size: var(--emw--font-size-x-large, 20px);
|
|
17
|
+
color: var(--emw--color-primary, #D0046C);
|
|
18
|
+
}
|
|
19
|
+
.PlayerAccountAnonymization svg {
|
|
20
|
+
fill: var(--emw--color-primary, #D0046C);
|
|
21
|
+
}
|
|
22
|
+
.PlayerAccountAnonymization .ButtonReturn {
|
|
23
|
+
font-family: inherit;
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
}
|
|
28
|
+
.PlayerAccountAnonymization .Button {
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
border-radius: var(--emw--button-border-radius, var(--emw--border-radius-large, 50px));
|
|
31
|
+
background: var(--emw--button-background-color, var(--emw--color-primary, #D0046C));
|
|
32
|
+
border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #D0046C));
|
|
33
|
+
color: var(--emw--button-text-color, var(--emw--color-white, #FFFFFF));
|
|
34
|
+
font-size: var(--emw--font-size-large, 20px);
|
|
35
|
+
font-weight: var(--emw--font-weight-normal, 400);
|
|
36
|
+
height: 50px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
.PlayerAccountAnonymization .Button.Mobile {
|
|
42
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
43
|
+
height: 40px;
|
|
44
|
+
}
|
|
45
|
+
.PlayerAccountAnonymization .Description {
|
|
46
|
+
padding: 10px;
|
|
47
|
+
text-align: left;
|
|
48
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
49
|
+
}
|
|
50
|
+
.PlayerAccountAnonymization .ConfirmationPopupWindow {
|
|
51
|
+
z-index: 99999;
|
|
52
|
+
background-color: var(--emw--color-gray-transparency-40, rgba(0, 0, 0, 0.4));
|
|
53
|
+
display: flex;
|
|
54
|
+
position: fixed;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
.PlayerAccountAnonymization .ConfirmationPopupWindow .ConfirmationPopup {
|
|
63
|
+
max-width: 600px;
|
|
64
|
+
max-height: 800px;
|
|
65
|
+
align-items: center;
|
|
66
|
+
position: relative;
|
|
67
|
+
border: 1px solid black;
|
|
68
|
+
background-color: var(--emw--color-background, #FFFFFF);
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
gap: 100px;
|
|
72
|
+
padding: 15px;
|
|
73
|
+
border-radius: 10px;
|
|
74
|
+
}
|
|
75
|
+
.PlayerAccountAnonymization .ConfirmationPopupWindow .ConfirmationPopup.Mobile {
|
|
76
|
+
max-width: 300px;
|
|
77
|
+
max-height: 600px;
|
|
78
|
+
}
|
|
79
|
+
.PlayerAccountAnonymization .ConfirmationPopupWindow .ConfirmationPopup .ButtonContainer {
|
|
80
|
+
width: 100%;
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
gap: 20px;
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
package/dist/collection/components/player-account-anonymization/player-account-anonymization.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { Component, h, Prop, State, Watch } from '@stencil/core';
|
|
2
|
+
import { getTranslations, translate } from '../../utils/locale.utils';
|
|
3
|
+
import { checkDeviceType } from '../../utils/utils';
|
|
4
|
+
export class PlayerAccountAnonymization {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.isMobile = checkDeviceType() === 'mobile' || checkDeviceType() === 'tablet';
|
|
7
|
+
this.displayConfirmationPopup = false;
|
|
8
|
+
this.setClientStyling = () => {
|
|
9
|
+
const sheet = document.createElement('style');
|
|
10
|
+
sheet.innerHTML = this.clientStyling;
|
|
11
|
+
this.stylingContainer.prepend(sheet);
|
|
12
|
+
};
|
|
13
|
+
this.setClientStylingURL = () => {
|
|
14
|
+
const url = new URL(this.clientStylingUrl);
|
|
15
|
+
const cssFile = document.createElement('style');
|
|
16
|
+
fetch(url.href)
|
|
17
|
+
.then((res) => res.text())
|
|
18
|
+
.then((data) => {
|
|
19
|
+
cssFile.innerHTML = data;
|
|
20
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
21
|
+
})
|
|
22
|
+
.catch((err) => {
|
|
23
|
+
console.log('error ', err);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
this.toggleScreen = () => {
|
|
27
|
+
window.postMessage({ type: 'PlayerAccountMenuActive', isMobile: this.isMobile }, window.location.href);
|
|
28
|
+
};
|
|
29
|
+
this.openConfirmationPopup = () => {
|
|
30
|
+
this.displayConfirmationPopup = true;
|
|
31
|
+
};
|
|
32
|
+
this.closeConfirmationPopup = () => {
|
|
33
|
+
this.displayConfirmationPopup = false;
|
|
34
|
+
};
|
|
35
|
+
this.submitRequest = () => {
|
|
36
|
+
const url = new URL(`${this.endpoint}/api/v1/players/legislation/anonymization`);
|
|
37
|
+
const headers = new Headers();
|
|
38
|
+
headers.append('X-SessionId', this.session);
|
|
39
|
+
const requestParams = {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: headers,
|
|
42
|
+
};
|
|
43
|
+
fetch(url.href, requestParams)
|
|
44
|
+
.then((res) => {
|
|
45
|
+
if (res.status < 300) {
|
|
46
|
+
window.postMessage({ type: 'PlayerAccountAnonymizationSuccessful' });
|
|
47
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMsg', this.language) } }, window.location.href);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: translate('errorMsg', this.language) } }, window.location.href);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
updateClientStyling() {
|
|
56
|
+
if (this.clientStyling)
|
|
57
|
+
this.setClientStyling();
|
|
58
|
+
if (this.clientStylingUrl)
|
|
59
|
+
this.setClientStylingURL();
|
|
60
|
+
}
|
|
61
|
+
async componentWillLoad() {
|
|
62
|
+
if (this.translationUrl) {
|
|
63
|
+
await getTranslations(this.translationUrl);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
componentDidLoad() {
|
|
67
|
+
if (this.clientStyling)
|
|
68
|
+
this.setClientStyling();
|
|
69
|
+
if (this.clientStylingUrl)
|
|
70
|
+
this.setClientStylingURL();
|
|
71
|
+
}
|
|
72
|
+
debounce(func, delay) {
|
|
73
|
+
return function (...args) {
|
|
74
|
+
clearTimeout(this.debounceTimer);
|
|
75
|
+
this.debounceTimer = setTimeout(() => {
|
|
76
|
+
func.apply(this, args);
|
|
77
|
+
}, delay);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
return h("div", { class: "PlayerAccountAnonymization", ref: el => this.stylingContainer = el },
|
|
82
|
+
this.isMobile
|
|
83
|
+
? h("div", { class: "ButtonReturn", onClick: this.toggleScreen },
|
|
84
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" },
|
|
85
|
+
h("g", { transform: "translate(-20 -158)" },
|
|
86
|
+
h("g", { transform: "translate(20 158)" },
|
|
87
|
+
h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))),
|
|
88
|
+
h("h2", { class: "Title Mobile" }, translate('title', this.language)))
|
|
89
|
+
: h("h2", { class: "Title" }, translate('title', this.language)),
|
|
90
|
+
h("div", { class: "Description" },
|
|
91
|
+
h("p", null, translate('description', this.language))),
|
|
92
|
+
h("button", { class: "Button", onClick: this.openConfirmationPopup }, translate('btnOpenConfirmationPopup', this.language)),
|
|
93
|
+
this.displayConfirmationPopup &&
|
|
94
|
+
h("div", { class: "ConfirmationPopupWindow" },
|
|
95
|
+
h("div", { class: 'ConfirmationPopup' + (this.isMobile ? ' Mobile' : '') },
|
|
96
|
+
h("div", { class: "Description" },
|
|
97
|
+
h("p", null, translate('confirmation', this.language))),
|
|
98
|
+
h("div", { class: "ButtonContainer" },
|
|
99
|
+
h("button", { class: "Button" + (this.isMobile ? ' Mobile' : ''), onClick: this.debounce(this.submitRequest, 850) }, translate('btnSubmit', this.language)),
|
|
100
|
+
h("button", { class: "Button" + (this.isMobile ? ' Mobile' : ''), onClick: this.closeConfirmationPopup }, translate('btnCancel', this.language))))));
|
|
101
|
+
}
|
|
102
|
+
static get is() { return "player-account-anonymization"; }
|
|
103
|
+
static get encapsulation() { return "shadow"; }
|
|
104
|
+
static get originalStyleUrls() { return {
|
|
105
|
+
"$": ["player-account-anonymization.scss"]
|
|
106
|
+
}; }
|
|
107
|
+
static get styleUrls() { return {
|
|
108
|
+
"$": ["player-account-anonymization.css"]
|
|
109
|
+
}; }
|
|
110
|
+
static get properties() { return {
|
|
111
|
+
"endpoint": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "endpoint"
|
|
124
|
+
},
|
|
125
|
+
"attribute": "endpoint",
|
|
126
|
+
"reflect": true
|
|
127
|
+
},
|
|
128
|
+
"language": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "string",
|
|
133
|
+
"resolved": "string",
|
|
134
|
+
"references": {}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "language"
|
|
141
|
+
},
|
|
142
|
+
"attribute": "language",
|
|
143
|
+
"reflect": true
|
|
144
|
+
},
|
|
145
|
+
"session": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "string",
|
|
150
|
+
"resolved": "string",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "player session"
|
|
158
|
+
},
|
|
159
|
+
"attribute": "session",
|
|
160
|
+
"reflect": true
|
|
161
|
+
},
|
|
162
|
+
"clientStyling": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "string",
|
|
167
|
+
"resolved": "string",
|
|
168
|
+
"references": {}
|
|
169
|
+
},
|
|
170
|
+
"required": false,
|
|
171
|
+
"optional": false,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": "clientStyling"
|
|
175
|
+
},
|
|
176
|
+
"attribute": "client-styling",
|
|
177
|
+
"reflect": true
|
|
178
|
+
},
|
|
179
|
+
"clientStylingUrl": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"mutable": false,
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "string",
|
|
184
|
+
"resolved": "string",
|
|
185
|
+
"references": {}
|
|
186
|
+
},
|
|
187
|
+
"required": false,
|
|
188
|
+
"optional": false,
|
|
189
|
+
"docs": {
|
|
190
|
+
"tags": [],
|
|
191
|
+
"text": "clientStylingUrl"
|
|
192
|
+
},
|
|
193
|
+
"attribute": "client-styling-url",
|
|
194
|
+
"reflect": true
|
|
195
|
+
},
|
|
196
|
+
"translationUrl": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "string",
|
|
201
|
+
"resolved": "string",
|
|
202
|
+
"references": {}
|
|
203
|
+
},
|
|
204
|
+
"required": false,
|
|
205
|
+
"optional": false,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": "translationUrl"
|
|
209
|
+
},
|
|
210
|
+
"attribute": "translation-url",
|
|
211
|
+
"reflect": true
|
|
212
|
+
}
|
|
213
|
+
}; }
|
|
214
|
+
static get states() { return {
|
|
215
|
+
"isMobile": {},
|
|
216
|
+
"displayConfirmationPopup": {}
|
|
217
|
+
}; }
|
|
218
|
+
static get watchers() { return [{
|
|
219
|
+
"propName": "clientStyling",
|
|
220
|
+
"methodName": "updateClientStyling"
|
|
221
|
+
}, {
|
|
222
|
+
"propName": "clientStylingUrl",
|
|
223
|
+
"methodName": "updateClientStyling"
|
|
224
|
+
}]; }
|
|
225
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|