@everymatrix/pam-player-profile 0.8.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 (56) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-4130c9d2.js +1227 -0
  3. package/dist/cjs/index.cjs.js +10 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/pam-player-profile-dc13914a.js +509 -0
  6. package/dist/cjs/pam-player-profile.cjs.js +25 -0
  7. package/dist/cjs/pam-player-profile_2.cjs.entry.js +175 -0
  8. package/dist/collection/collection-manifest.json +19 -0
  9. package/dist/collection/components/pam-player-profile/index.js +1 -0
  10. package/dist/collection/components/pam-player-profile/pam-player-profile.css +263 -0
  11. package/dist/collection/components/pam-player-profile/pam-player-profile.js +432 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +209 -0
  14. package/dist/collection/utils/utils.js +12 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/index-d953d051.js +1200 -0
  17. package/dist/esm/index.js +2 -0
  18. package/dist/esm/loader.js +11 -0
  19. package/dist/esm/pam-player-profile-e280c440.js +507 -0
  20. package/dist/esm/pam-player-profile.js +20 -0
  21. package/dist/esm/pam-player-profile_2.entry.js +170 -0
  22. package/dist/index.cjs.js +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/pam-player-profile/index.esm.js +1 -0
  25. package/dist/pam-player-profile/p-047a7a7b.js +2 -0
  26. package/dist/pam-player-profile/p-41838095.js +1 -0
  27. package/dist/pam-player-profile/p-b2438d4d.entry.js +1 -0
  28. package/dist/pam-player-profile/p-e1255160.js +1 -0
  29. package/dist/pam-player-profile/pam-player-profile.esm.js +1 -0
  30. package/dist/stencil.config.dev.js +16 -0
  31. package/dist/stencil.config.js +18 -0
  32. package/dist/storybook/main.js +47 -0
  33. package/dist/storybook/preview.js +9 -0
  34. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  35. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/stencil.config.d.ts +2 -0
  36. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/stencil.config.dev.d.ts +2 -0
  37. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/storybook/main.d.ts +3 -0
  38. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/storybook/preview.d.ts +70 -0
  39. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/index.d.ts +3 -0
  40. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  41. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  42. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  43. package/dist/types/components/pam-player-profile/index.d.ts +1 -0
  44. package/dist/types/components/pam-player-profile/pam-player-profile.d.ts +45 -0
  45. package/dist/types/components.d.ts +57 -0
  46. package/dist/types/index.d.ts +1 -0
  47. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  48. package/dist/types/utils/locale.utils.d.ts +23 -0
  49. package/dist/types/utils/utils.d.ts +7 -0
  50. package/loader/cdn.js +1 -0
  51. package/loader/index.cjs.js +1 -0
  52. package/loader/index.d.ts +24 -0
  53. package/loader/index.es2017.js +1 -0
  54. package/loader/index.js +2 -0
  55. package/loader/package.json +11 -0
  56. package/package.json +26 -0
@@ -0,0 +1,2 @@
1
+ export { P as PamPlayerProfile } from './pam-player-profile-e280c440.js';
2
+ import './index-d953d051.js';
@@ -0,0 +1,11 @@
1
+ import { b as bootstrapLazy } from './index-d953d051.js';
2
+ export { s as setNonce } from './index-d953d051.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["pam-player-profile_2",[[1,"pam-player-profile",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dobFormat":[513,"dob-format"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"skeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
9
+ };
10
+
11
+ export { defineCustomElements };
@@ -0,0 +1,507 @@
1
+ import { r as registerInstance, h } from './index-d953d051.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const TRANSLATIONS = {
5
+ "en": {
6
+ "title": "Profile Info",
7
+ "username": "Username",
8
+ "firstName": "First Name",
9
+ "lastName": "Last Name",
10
+ "securityQuestion": "Security Question",
11
+ "securityAnswer": "Security Answer",
12
+ "playerTitle": "Title",
13
+ "gender": "Gender",
14
+ "dateOfBirth": "Date Of Birth",
15
+ "currency": "Currency",
16
+ "securityQuestionError": "Security question must be at least 1 character long and maximum 120 characters.",
17
+ "securityAnswerError": "Security answer must be at least 1 character long and maximum 120 characters.",
18
+ "saveButton": "Save Changes",
19
+ "successMessage": "Your changes have been saved!",
20
+ "errorMessageUpdate": "An error has occured when attempting to update the profile information",
21
+ "errorMessageFetch": "An error has occured when attempting to fetch the profile information"
22
+ },
23
+ "zh-hk": {
24
+ "title": "個人資料",
25
+ "username": "用戶名",
26
+ "firstName": "名字",
27
+ "lastName": "姓氏",
28
+ "securityQuestion": "安全問題",
29
+ "securityAnswer": "安全答案",
30
+ "playerTitle": "稱號",
31
+ "gender": "性別",
32
+ "dateOfBirth": "出生日期",
33
+ "currency": "貨幣",
34
+ "securityQuestionError": "安全問題必須至少1個字符,最多120個字符。",
35
+ "securityAnswerError": "安全答案必須至少1個字符,最多120個字符。",
36
+ "saveButton": "保存更改",
37
+ "successMessage": "您的更改已保存!",
38
+ "errorMessageUpdate": "嘗試更新個人資料信息時發生錯誤",
39
+ "errorMessageFetch": "在嘗試獲取個人資料時發生錯誤"
40
+ },
41
+ "fr": {
42
+ "title": "Informations de profil",
43
+ "username": "Nom d'utilisateur",
44
+ "firstName": "Prénom",
45
+ "lastName": "Nom de famille",
46
+ "securityQuestion": "Question de sécurité",
47
+ "securityAnswer": "Réponse de sécurité",
48
+ "playerTitle": "Titre",
49
+ "gender": "Genre",
50
+ "dateOfBirth": "Date de naissance",
51
+ "currency": "Devise",
52
+ "securityQuestionError": "La question de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",
53
+ "securityAnswerError": "La réponse de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",
54
+ "saveButton": "Enregistrer les modifications",
55
+ "successMessage": "Vos modifications ont été enregistrées !",
56
+ "errorMessageUpdate": "Une erreur s'est produite lors de la tentative de mise à jour des informations de profil",
57
+ "errorMessageFetch": "Une erreur est survenue lors de la tentative de récupération des informations de profil"
58
+ },
59
+ "ro": {
60
+ "title": "Informații profil",
61
+ "username": "Nume de utilizator",
62
+ "firstName": "Prenume",
63
+ "lastName": "Nume de familie",
64
+ "securityQuestion": "Întrebare de securitate",
65
+ "securityAnswer": "Răspuns de securitate",
66
+ "playerTitle": "Titlu",
67
+ "gender": "Gen",
68
+ "dateOfBirth": "Data nașterii",
69
+ "currency": "Monedă",
70
+ "securityQuestionError": "Întrebarea de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",
71
+ "securityAnswerError": "Răspunsul de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",
72
+ "saveButton": "Salvează modificările",
73
+ "successMessage": "Modificările dvs. au fost salvate!",
74
+ "errorMessageUpdate": "A apărut o eroare la încercarea de a actualiza informațiile profilului",
75
+ "errorMessageFetch": "A apărut o eroare la încercarea de a obține informațiile profilului"
76
+ },
77
+ "tr": {
78
+ "title": "Profil Bilgileri",
79
+ "username": "Kullanıcı Adı",
80
+ "firstName": "Ad",
81
+ "lastName": "Soyad",
82
+ "securityQuestion": "Güvenlik Sorusu",
83
+ "securityAnswer": "Güvenlik Cevabı",
84
+ "playerTitle": "Başlık",
85
+ "gender": "Cinsiyet",
86
+ "dateOfBirth": "Doğum Tarihi",
87
+ "currency": "Para Birimi",
88
+ "securityQuestionError": "Güvenlik sorusu en az 1 karakter ve en fazla 120 karakter olmalıdır.",
89
+ "securityAnswerError": "Güvenlik cevabı en az 1 karakter ve en fazla 120 karakter olmalıdır.",
90
+ "saveButton": "Değişiklikleri Kaydet",
91
+ "successMessage": "Değişiklikleriniz kaydedildi!",
92
+ "errorMessageUpdate": "Profil bilgilerini güncellemeye çalışırken bir hata oluştu",
93
+ "errorMessageFetch": "Profil bilgilerini almak için yapılan işlemde bir hata oluştu"
94
+ },
95
+ "es": {
96
+ "title": "Información del perfil",
97
+ "username": "Nombre de usuario",
98
+ "firstName": "Nombre",
99
+ "lastName": "Apellido",
100
+ "securityQuestion": "Pregunta de seguridad",
101
+ "securityAnswer": "Respuesta de seguridad",
102
+ "playerTitle": "Título",
103
+ "gender": "Género",
104
+ "dateOfBirth": "Fecha de nacimiento",
105
+ "currency": "Moneda",
106
+ "securityQuestionError": "La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
107
+ "securityAnswerError": "La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
108
+ "saveButton": "Guardar cambios",
109
+ "successMessage": "¡Tus cambios han sido guardados!",
110
+ "errorMessageUpdate": "Se ha producido un error al intentar actualizar la información del perfil",
111
+ "errorMessageFetch": "Se ha producido un error al intentar obtener la información del perfil"
112
+ },
113
+ "pt": {
114
+ "title": "Informações do Perfil",
115
+ "username": "Nome de usuário",
116
+ "firstName": "Nome",
117
+ "lastName": "Sobrenome",
118
+ "securityQuestion": "Pergunta de segurança",
119
+ "securityAnswer": "Resposta de segurança",
120
+ "playerTitle": "Título",
121
+ "gender": "Gênero",
122
+ "dateOfBirth": "Data de nascimento",
123
+ "currency": "Moeda",
124
+ "securityQuestionError": "A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
125
+ "securityAnswerError": "A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
126
+ "saveButton": "Salvar alterações",
127
+ "successMessage": "Suas alterações foram salvas!",
128
+ "errorMessageUpdate": "Ocorreu um erro ao tentar atualizar as informações do perfil",
129
+ "errorMessageFetch": "Ocorreu um erro ao tentar buscar as informações do perfil"
130
+ },
131
+ "hr": {
132
+ "title": "Informacije o profilu",
133
+ "username": "Korisničko ime",
134
+ "firstName": "Ime",
135
+ "lastName": "Prezime",
136
+ "securityQuestion": "Sigurnosno pitanje",
137
+ "securityAnswer": "Sigurnosni odgovor",
138
+ "playerTitle": "Naslov",
139
+ "gender": "Spol",
140
+ "dateOfBirth": "Datum rođenja",
141
+ "currency": "Valuta",
142
+ "securityQuestionError": "Sigurnosno pitanje mora imati najmanje 1 znak i najviše 120 znakova.",
143
+ "securityAnswerError": "Sigurnosni odgovor mora imati najmanje 1 znak i najviše 120 znakova.",
144
+ "saveButton": "Spremi promjene",
145
+ "successMessage": "Vaše promjene su spremljene!",
146
+ "errorMessageUpdate": "Došlo je do pogreške prilikom pokušaja ažuriranja informacija o profilu",
147
+ "errorMessageFetch": "Došlo je do greške prilikom pokušaja dobijanja informacija o profilu"
148
+ },
149
+ "pt-br": {
150
+ "title": "Informações do Perfil",
151
+ "username": "Nome de usuário",
152
+ "firstName": "Nome",
153
+ "lastName": "Sobrenome",
154
+ "securityQuestion": "Pergunta de segurança",
155
+ "securityAnswer": "Resposta de segurança",
156
+ "playerTitle": "Título",
157
+ "gender": "Gênero",
158
+ "dateOfBirth": "Data de nascimento",
159
+ "currency": "Moeda",
160
+ "securityQuestionError": "A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
161
+ "securityAnswerError": "A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
162
+ "saveButton": "Salvar alterações",
163
+ "successMessage": "Suas alterações foram salvas!",
164
+ "errorMessageUpdate": "Ocorreu um erro ao tentar atualizar as informações do perfil",
165
+ "errorMessageFetch": "Ocorreu um erro ao tentar buscar as informações do perfil"
166
+ },
167
+ "es-mx": {
168
+ "title": "Información del perfil",
169
+ "username": "Nombre de usuario",
170
+ "firstName": "Nombre",
171
+ "lastName": "Apellido",
172
+ "securityQuestion": "Pregunta de seguridad",
173
+ "securityAnswer": "Respuesta de seguridad",
174
+ "playerTitle": "Título",
175
+ "gender": "Género",
176
+ "dateOfBirth": "Fecha de nacimiento",
177
+ "currency": "Moneda",
178
+ "securityQuestionError": "La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
179
+ "securityAnswerError": "La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
180
+ "saveButton": "Guardar cambios",
181
+ "successMessage": "¡Tus cambios han sido guardados!",
182
+ "errorMessageUpdate": "Se ha producido un error al intentar actualizar la información del perfil",
183
+ "errorMessageFetch": "Se ha producido un error al intentar obtener la información del perfil"
184
+ }
185
+ };
186
+ const translate = (key, customLang, values) => {
187
+ let lang = TRANSLATIONS[customLang] ? customLang : DEFAULT_LANGUAGE;
188
+ let translation = TRANSLATIONS[lang][key];
189
+ if (values !== undefined) {
190
+ for (const [key, value] of Object.entries(values.values)) {
191
+ const regex = new RegExp(`{${key}}`, 'g');
192
+ translation = translation.replace(regex, value);
193
+ }
194
+ }
195
+ return translation;
196
+ };
197
+
198
+ /**
199
+ * @name setClientStyling
200
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
201
+ * @param {HTMLElement} stylingContainer The reference element of the widget
202
+ * @param {string} clientStyling The style content
203
+ */
204
+ function setClientStyling(stylingContainer, clientStyling) {
205
+ if (stylingContainer) {
206
+ const sheet = document.createElement('style');
207
+ sheet.innerHTML = clientStyling;
208
+ stylingContainer.appendChild(sheet);
209
+ }
210
+ }
211
+
212
+ /**
213
+ * @name setClientStylingURL
214
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
215
+ * @param {HTMLElement} stylingContainer The reference element of the widget
216
+ * @param {string} clientStylingUrl The URL of the style content
217
+ */
218
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
219
+ const url = new URL(clientStylingUrl);
220
+
221
+ fetch(url.href)
222
+ .then((res) => res.text())
223
+ .then((data) => {
224
+ const cssFile = document.createElement('style');
225
+ cssFile.innerHTML = data;
226
+ if (stylingContainer) {
227
+ stylingContainer.appendChild(cssFile);
228
+ }
229
+ })
230
+ .catch((err) => {
231
+ console.error('There was an error while trying to load client styling from URL', err);
232
+ });
233
+ }
234
+
235
+ /**
236
+ * @name setStreamLibrary
237
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
238
+ * @param {HTMLElement} stylingContainer The highest element of the widget
239
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
240
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
241
+ */
242
+ function setStreamStyling(stylingContainer, domain, subscription) {
243
+ if (window.emMessageBus) {
244
+ const sheet = document.createElement('style');
245
+
246
+ window.emMessageBus.subscribe(domain, (data) => {
247
+ sheet.innerHTML = data;
248
+ if (stylingContainer) {
249
+ stylingContainer.appendChild(sheet);
250
+ }
251
+ });
252
+ }
253
+ }
254
+
255
+ /**
256
+ * @name isMobile
257
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
258
+ * @param {String} userAgent window.navigator.userAgent
259
+ * @returns {Boolean} true or false
260
+ */
261
+ const isMobile = (userAgent) => {
262
+ return !!(userAgent.toLowerCase().match(/android/i) ||
263
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
264
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
265
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
266
+ };
267
+
268
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
269
+
270
+ var dayjs_min = {exports: {}};
271
+
272
+ (function (module, exports) {
273
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
274
+ }(dayjs_min));
275
+
276
+ const dayjs = dayjs_min.exports;
277
+
278
+ const pamPlayerProfileCss = ":host {\n display: block;\n}\n\nbutton {\n font-family: var(--emw--button-typography);\n}\n\ninput, select, option {\n font-family: inherit;\n}\n\n.PamPlayerProfileWrapper {\n color: var(--emw--pam-typography, var(--emw-color-contrast, #07072A));\n background: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));\n padding: 50px;\n height: 100%;\n border-radius: var(--emw--border-radius-large, 10px);\n container-type: inline-size;\n opacity: 1;\n animation-name: fadeIn;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n.PamPlayerProfileWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerProfileWrapper .HeaderText {\n font-size: var(--emw--font-size-x-large, 24px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n}\n.PamPlayerProfileWrapper .Section {\n background: var(--emw-color-pale, var(--emw--color-gray-100, #E6E6E6));\n border-radius: var(--emw--border-radius-large, 10px);\n padding: 10px;\n margin-bottom: 10px;\n}\n.PamPlayerProfileWrapper .Section .SectionTitle {\n font-size: var(--emw--font-size-large, 20px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n padding: 0;\n border: 0;\n margin-top: 10px;\n margin-bottom: 10px;\n background: transparent;\n cursor: pointer;\n}\n.PamPlayerProfileWrapper .Section .SectionContent {\n display: grid;\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n padding-bottom: 30px;\n margin-top: 10px;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field label {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-semibold, 500);\n margin-bottom: 5px;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-light, 300);\n color: var(--emw--pam-contrast, var(--emw-color-contrast, #07072A));\n padding: 10px;\n line-height: 16px;\n background: var(--emw-color-white, #FFFFFF);\n outline: none;\n transition-duration: var(--emw--transition-medium, 250ms);\n border: 1px solid var(--emw--color-gray-100, #353535);\n border-radius: var(--emw--border-radius-medium, 10px);\n width: 100%;\n box-sizing: border-box;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input:focus, .PamPlayerProfileWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerProfileWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerProfileWrapper .Section .SectionContent .Field input :visited {\n border: 1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n box-shadow: 0 0 0 1pt var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerProfileWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field.Invalid input {\n border: 1px solid var(--emw-color-error, var(--emw-color-red, #FD2839));\n background: var(--emw-color-pale, #FBECF4);\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field .Error {\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n font-size: var(--emw--font-size-x-small, 12px);\n line-height: 10px;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerProfileWrapper .ButtonsArea {\n grid-column-gap: 10px;\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n margin-top: 20px;\n width: 50%;\n}\n.PamPlayerProfileWrapper .ButtonsArea .SaveButton {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));\n border: 2px solid var(--emw--button-border-color, #0E5924);\n color: var(--emw--button-text-color, #FFFFFF);\n border-radius: var(--emw--button-border-radius, 10px);\n font-size: var(--emw--size-standard, 16px);\n text-transform: uppercase;\n transition-duration: var(--emw--transition-medium, 250ms);\n max-width: 400px;\n min-width: 200px;\n padding: 13px 0;\n width: 100%;\n}\n.PamPlayerProfileWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerProfileWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerProfileWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerProfileWrapper.skeleton .Section .SectionContent {\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerProfileWrapper.skeleton .Section .SectionContent .Field {\n height: 55px;\n overflow: hidden;\n}\n.PamPlayerProfileWrapper.skeleton .ButtonsArea .SaveButton {\n width: 500px;\n border-radius: 30px;\n overflow: hidden;\n display: block;\n background-image: none;\n border: none;\n}\n@container (max-width: 425px) {\n .PamPlayerProfileWrapper {\n padding: 20px 15px;\n background: var(--emw-color-gray-50, #F9F8F8);\n max-width: unset;\n border-radius: var(--emw--border-radius-small, 5px);\n }\n .PamPlayerProfileWrapper .HeaderText {\n display: none;\n }\n .PamPlayerProfileWrapper .ReturnButton {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n }\n .PamPlayerProfileWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerProfileWrapper h2 {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n font-size: var(--emw--font-size-large, 20px);\n font-weight: var(--emw--font-weight-semibold, 500);\n }\n .PamPlayerProfileWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerProfileWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerProfileWrapper .Section .Field label {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(-emw--font-weight-normal, 400);\n }\n .PamPlayerProfileWrapper .Section .Field input {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(--emw--font-weight-light, 300);\n }\n .PamPlayerProfileWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerProfileWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerProfileWrapper .ButtonsArea .SaveButton {\n font-size: var(--emw--size-x-small, 12px);\n height: 40px;\n color: var(--emw-button-typography, var(--emw-color-white, #FFFFFF));\n }\n .PamPlayerProfileWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerProfileWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerProfileWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerProfileWrapper.skeleton .ButtonsArea .SaveButton {\n width: 100%;\n height: 100%;\n border-radius: 20px;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0.01;\n }\n 1% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}";
279
+ const PamPlayerProfileStyle0 = pamPlayerProfileCss;
280
+
281
+ const PamPlayerProfile = class {
282
+ constructor(hostRef) {
283
+ registerInstance(this, hostRef);
284
+ this.fieldsState = {};
285
+ this.sendLoadedMessage = () => {
286
+ window.postMessage({ type: 'PROFILE_LOADED' });
287
+ };
288
+ this.sendValidMessage = () => {
289
+ window.postMessage({ type: 'PROFILE_VALIDITY', data: this.isSubmitButtonAvailable });
290
+ };
291
+ this.sendSuccessNotification = () => {
292
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMessage', this.lang) } }, window.location.href);
293
+ };
294
+ this.sendErrorNotification = (errorKey) => {
295
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: translate(errorKey, this.lang) } }, window.location.href);
296
+ };
297
+ this.sendData = () => {
298
+ delete this.data.contacts;
299
+ window.postMessage({ type: 'PROFILE_UPDATE_DATA', data: this.data }, window.location.href);
300
+ };
301
+ this.messageHandler = (message) => {
302
+ var _a;
303
+ switch ((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) {
304
+ case 'PROFILE_DATA':
305
+ this.data = message.data.data;
306
+ this.resetState();
307
+ this.skeletonLoading = false;
308
+ break;
309
+ case 'PROFILE_SEND_DATA':
310
+ this.sendData();
311
+ break;
312
+ }
313
+ };
314
+ this.getData = () => {
315
+ const url = new URL(`api/v1/players/${this.userId}/player-identifiable-information`, this.endpoint);
316
+ const headers = new Headers();
317
+ headers.append('X-SessionID', this.session);
318
+ const options = {
319
+ method: 'GET',
320
+ headers: headers
321
+ };
322
+ return new Promise((resolve) => {
323
+ fetch(url.href, options)
324
+ .then(res => {
325
+ if (res.ok) {
326
+ return res.json();
327
+ }
328
+ this.sendErrorNotification('errorMessageFetch');
329
+ })
330
+ .then(res => {
331
+ this.data = res.player;
332
+ resolve();
333
+ });
334
+ });
335
+ };
336
+ this.buildFieldState = (isValid, initialValue, rule) => Object.assign({ 'isValid': isValid, 'initialValue': initialValue, 'rule': rule });
337
+ this.initData = () => {
338
+ const data = {};
339
+ ['externalPlayerId',
340
+ 'affiliateMarker',
341
+ 'personalInfo',
342
+ 'communicationInfo',
343
+ 'signupInfo',
344
+ 'statusInfo',
345
+ 'securityInfo',
346
+ 'geographicInfo',
347
+ 'playerInfo',
348
+ 'contacts' // we need this because username is only sent in contacts section atm :(
349
+ ].forEach(key => data[key] = this.data[key]);
350
+ this.data = data;
351
+ };
352
+ this.updateState = (sectionKey, fieldKey) => (e) => {
353
+ this.data[sectionKey][fieldKey] = e.target.value;
354
+ const fieldState = this.fieldsState['data'][fieldKey];
355
+ const value = e.target.value;
356
+ const passedRuleCheck = fieldState.rule(value);
357
+ if (passedRuleCheck && !fieldState.isValid) {
358
+ fieldState.isValid = true;
359
+ this.invalidFields -= 1;
360
+ }
361
+ else if (!passedRuleCheck && fieldState.isValid) {
362
+ fieldState.isValid = false;
363
+ this.invalidFields += 1;
364
+ }
365
+ this.fieldsState['hasChanged'] = value !== fieldState.initialValue;
366
+ const previous = this.isSubmitButtonAvailable;
367
+ this.updateSubmitButtonStatus();
368
+ if (this.isStandAlone !== 'true' && this.isSubmitButtonAvailable !== previous) {
369
+ this.sendValidMessage();
370
+ }
371
+ };
372
+ this.updateData = (e) => {
373
+ if (e)
374
+ e.preventDefault();
375
+ const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information`, this.endpoint);
376
+ const headers = new Headers();
377
+ headers.append('X-SessionId', this.session);
378
+ headers.append('Content-Type', 'application/problem+json; charset=utf-8');
379
+ if (this.data.contacts)
380
+ delete this.data.contacts;
381
+ const reqParams = {
382
+ method: 'PUT',
383
+ headers,
384
+ body: JSON.stringify(this.data)
385
+ };
386
+ fetch(url, reqParams)
387
+ .then(res => {
388
+ if (!res.ok) {
389
+ return this.sendErrorNotification('errorMessageUpdate');
390
+ }
391
+ this.sendSuccessNotification();
392
+ this.getData().then(() => this.resetState());
393
+ });
394
+ };
395
+ this.updateSubmitButtonStatus = () => {
396
+ this.isSubmitButtonAvailable = this.invalidFields === 0 && this.fieldsState.hasChanged;
397
+ };
398
+ this.editableField = (sectionKey, fieldKey, labelTranslationKey, errorTranslationKey) => {
399
+ const fieldState = this.fieldsState['data'][fieldKey];
400
+ const value = this.data[sectionKey][fieldKey];
401
+ if (fieldState) {
402
+ return (h("div", { class: `Field ${fieldState.isValid ? '' : 'Invalid'}` }, h("label", null, translate(labelTranslationKey, this.lang)), h("input", { type: "text", value: value, onKeyUp: this.updateState(sectionKey, fieldKey) }), !fieldState.isValid &&
403
+ h("p", { class: "Error" }, translate(errorTranslationKey, this.lang))));
404
+ }
405
+ else {
406
+ return null;
407
+ }
408
+ };
409
+ this.staticField = (value, labelTranslationKey) => {
410
+ if (value) {
411
+ return (h("div", { class: "Field Disabled" }, h("label", null, translate(labelTranslationKey, this.lang)), h("input", { type: "text", value: value, readonly: true })));
412
+ }
413
+ else {
414
+ return null;
415
+ }
416
+ };
417
+ this.toggleScreen = () => {
418
+ window.postMessage({ type: 'PlayerAccountMenuActive', isMobile: this.isMobile }, window.location.href);
419
+ };
420
+ this.userId = undefined;
421
+ this.session = undefined;
422
+ this.endpoint = undefined;
423
+ this.lang = 'en';
424
+ this.mbSource = undefined;
425
+ this.clientStyling = undefined;
426
+ this.clientStylingUrl = undefined;
427
+ this.translationUrl = undefined;
428
+ this.dobFormat = 'DD/MM/YYYY';
429
+ this.isStandAlone = 'true';
430
+ this.limitStylingAppends = false;
431
+ this.skeletonLoading = true;
432
+ this.isSubmitButtonAvailable = false;
433
+ this.invalidFields = 0;
434
+ this.isMobile = isMobile(window.navigator.userAgent);
435
+ }
436
+ handleStylingChange(newValue, oldValue) {
437
+ if (newValue !== oldValue)
438
+ setClientStyling(this.stylingContainer, this.clientStyling);
439
+ }
440
+ handleStylingUrlChange(newValue, oldValue) {
441
+ if (newValue !== oldValue)
442
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
443
+ }
444
+ async componentWillLoad() {
445
+ if (this.isStandAlone !== 'true') {
446
+ return;
447
+ }
448
+ await this.getData()
449
+ .then(() => {
450
+ this.initData();
451
+ this.initEditableFieldsState();
452
+ })
453
+ .finally(() => this.skeletonLoading = false);
454
+ }
455
+ componentDidLoad() {
456
+ if (this.stylingContainer) {
457
+ if (window.emMessageBuss != undefined) {
458
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
459
+ }
460
+ else {
461
+ if (this.clientStyling)
462
+ setClientStyling(this.stylingContainer, this.clientStyling);
463
+ if (this.clientStylingUrl)
464
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
465
+ }
466
+ }
467
+ if (this.isStandAlone !== 'true') {
468
+ window.addEventListener('message', this.messageHandler, false);
469
+ this.sendLoadedMessage();
470
+ }
471
+ }
472
+ disconnectedCallback() {
473
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
474
+ if (this.isStandAlone !== 'true')
475
+ window.removeEventListener('message', this.messageHandler, false);
476
+ }
477
+ initEditableFieldsState() {
478
+ var _a, _b;
479
+ this.fieldsState['data'] = {};
480
+ this.fieldsState['hasChanged'] = false;
481
+ if ((_a = this.data.playerInfo) === null || _a === void 0 ? void 0 : _a.SecurityQuestion) {
482
+ this.fieldsState['data']['SecurityQuestion'] = this.buildFieldState(true, this.data.playerInfo.SecurityQuestion, (val) => val && val.length <= 120);
483
+ }
484
+ if ((_b = this.data.playerInfo) === null || _b === void 0 ? void 0 : _b.SecurityAnswer) {
485
+ this.fieldsState['data']['SecurityAnswer'] = this.buildFieldState(true, this.data.playerInfo.SecurityAnswer, (val) => val && val.length <= 120);
486
+ }
487
+ }
488
+ resetState() {
489
+ this.initData();
490
+ this.initEditableFieldsState();
491
+ this.invalidFields = 0;
492
+ this.isSubmitButtonAvailable = false;
493
+ }
494
+ render() {
495
+ return (h("div", { key: '0bfa140cc83e29e99e4af534700e5b009a88e9ac', ref: el => this.stylingContainer = el }, this.skeletonLoading
496
+ ? h("form", { class: "PamPlayerProfileWrapper skeleton" }, h("div", { class: "ReturnButton" }, h("ui-skeleton", { structure: "title", width: "auto", height: "30px" })), h("div", { class: "Section" }, h("section", { class: "SectionContent" }, [...Array(6).keys()].map(() => h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), h("div", { class: "CompoundField" }, h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" })), h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), h("div", { class: "Field" }, h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), h("ui-skeleton", { structure: "rectangle", width: "auto", height: "20px" })))), h("section", { class: "ButtonsArea" }, h("div", { class: "SaveButton" }, h("ui-skeleton", { structure: "rectangle", width: "auto", height: "50px" }))))
497
+ : h("form", { class: `PamPlayerProfileWrapper ${this.isMobile ? 'Mobile' : ''}` }, h("div", { class: "ReturnButton", onClick: this.toggleScreen }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, 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)" })))), h("h2", null, translate('title', this.lang))), h("h2", { class: "HeaderText" }, translate('title', this.lang)), h("div", { class: "Section" }, h("section", { class: "SectionContent" }, this.staticField(this.data.contacts.find(c => c.contatcType = 'Username').contactValue, 'username'), this.staticField(dayjs(this.data.personalInfo.birthDate).format(this.dobFormat), 'dateOfBirth'), this.staticField(this.data.personalInfo.firstName, 'firstName'), this.staticField(this.data.personalInfo.lastName, 'lastName'), this.editableField('playerInfo', 'SecurityQuestion', 'securityQuestion', 'securityQuestionError'), this.editableField('playerInfo', 'SecurityAnswer', 'securityAnswer', 'securityAnswerError'), h("div", { class: "CompoundField" }, this.staticField(this.data.personalInfo.title, 'playerTitle'), this.staticField(this.data.personalInfo.gender, 'gender')), this.staticField(this.data.communicationInfo.currency, 'currency'))), this.isStandAlone === 'true' &&
498
+ h("section", { class: "ButtonsArea" }, h("button", { class: `SaveButton ${this.isSubmitButtonAvailable ? '' : 'Disabled'}`, onClick: this.updateData }, translate('saveButton'))))));
499
+ }
500
+ static get watchers() { return {
501
+ "clientStyling": ["handleStylingChange"],
502
+ "clientStylingUrl": ["handleStylingUrlChange"]
503
+ }; }
504
+ };
505
+ PamPlayerProfile.style = PamPlayerProfileStyle0;
506
+
507
+ export { PamPlayerProfile as P };
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-d953d051.js';
2
+ export { s as setNonce } from './index-d953d051.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["pam-player-profile_2",[[1,"pam-player-profile",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dobFormat":[513,"dob-format"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"skeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
20
+ });