@everymatrix/player-account-controller 1.66.1 → 1.67.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 (54) hide show
  1. package/components/{PlayerAccountController-CKNGbCDA.js → PlayerAccountController-BiEmKUTq.js} +90 -90
  2. package/components/PlayerAccountController-DET7Ledm.cjs +1 -0
  3. package/components/{PlayerAccountController-B61GC4da.js → PlayerAccountController-Df3HJNfF.js} +83 -83
  4. package/components/{PlayerAccountSelfExclusion-eVbVBZeH.js → PlayerAccountSelfExclusion-Bme3jA4c.js} +1 -0
  5. package/components/{PlayerAccountSelfExclusion-tbEoY1fJ.cjs → PlayerAccountSelfExclusion-CDEu24ob.cjs} +131 -131
  6. package/components/{PlayerAccountSelfExclusion-Dkhb_rb2.js → PlayerAccountSelfExclusion-CcQBa7WB.js} +1 -0
  7. package/components/{PlayerAccountTimeout-CgPnhFC2.js → PlayerAccountTimeout-9R54hZUl.js} +1 -1
  8. package/components/{PlayerAccountTimeout-B7te1qrD.cjs → PlayerAccountTimeout-BG_yWya9.cjs} +1 -1
  9. package/components/{PlayerAccountTimeout-BF6i8Aq1.js → PlayerAccountTimeout-CpDdajvl.js} +1 -1
  10. package/components/{PlayerAccountTransactionsHistory-_Sm0nfWr.cjs → PlayerAccountTransactionsHistory-BzB7rnla.cjs} +265 -265
  11. package/components/{PlayerAccountTransactionsHistory-DtHWhYf2.js → PlayerAccountTransactionsHistory-CRucfQT9.js} +1932 -1867
  12. package/components/{PlayerAccountTransactionsHistory-sQOFDhsn.js → PlayerAccountTransactionsHistory-D5xVdr5D.js} +1648 -1633
  13. package/components/{PlayerBonusHistory-B7mav-9J.js → PlayerBonusHistory-BQAF4bSM.js} +1 -1
  14. package/components/{PlayerBonusHistory-CIDfTu9W.cjs → PlayerBonusHistory-BfctVq0u.cjs} +1 -1
  15. package/components/{PlayerBonusHistory-ClKYGr0v.js → PlayerBonusHistory-wRNMiwgX.js} +1 -1
  16. package/components/{PlayerGamingHistory-C00k3Mj3.js → PlayerGamingHistory-BhmBAAFp.js} +1 -1
  17. package/components/{PlayerGamingHistory-Cqze0dx8.cjs → PlayerGamingHistory-Du5updfI.cjs} +1 -1
  18. package/components/{PlayerGamingHistory-CWN1CL1Y.js → PlayerGamingHistory-lkyuXLIU.js} +1 -1
  19. package/es2015/player-account-controller.cjs +1 -1
  20. package/es2015/player-account-controller.js +1 -1
  21. package/esnext/player-account-controller.js +1 -1
  22. package/package.json +1 -1
  23. package/stencil/{general-input-6HMiojaV.js → checkbox-group-input_14-BcBdDpf8.js} +7654 -3097
  24. package/stencil/{general-input-DGu8X142.js → checkbox-group-input_14-CJHYJs5Y.js} +7664 -3107
  25. package/stencil/checkbox-group-input_14-CNR6zkvw.cjs +5901 -0
  26. package/stencil/{index-9cd44522--OAp7ePk.js → index-13661b98-Bg3nkDqk.js} +88 -103
  27. package/stencil/index-13661b98-D16qyHKo.cjs +1 -0
  28. package/stencil/{index-9cd44522-C0ycW8_E.js → index-13661b98-DcT9swce.js} +84 -99
  29. package/stencil/pam-change-password-YhGkcb7G.js +25 -0
  30. package/stencil/{player-change-password-gm2-5cb5c6c1-Bi9IbxQV.js → pam-change-password-f4a1e7e7-CfVbvq6Y.js} +223 -74
  31. package/stencil/pam-change-password-f4a1e7e7-DtMPJ715.cjs +125 -0
  32. package/stencil/{player-change-password-gm2-5cb5c6c1-Bu5Dac83.js → pam-change-password-f4a1e7e7-e1XqJgP9.js} +223 -74
  33. package/stencil/pam-change-password-sLrzK4Qt.js +7 -0
  34. package/stencil/pam-change-password-uD3esedo.cjs +1 -0
  35. package/components/PlayerAccountController-B6D07zjj.cjs +0 -1
  36. package/stencil/checkbox-group-input_9-BVBeSmHl.js +0 -3895
  37. package/stencil/checkbox-group-input_9-CixpoaRc.cjs +0 -2
  38. package/stencil/checkbox-group-input_9-Ckf5IThK.js +0 -3895
  39. package/stencil/general-input-C54NeVAb.cjs +0 -5636
  40. package/stencil/index-9cd44522-CqgRbQOU.cjs +0 -1
  41. package/stencil/locale-CB060R77.cjs +0 -1
  42. package/stencil/locale-Cxpe53Ym.js +0 -153
  43. package/stencil/password-input_2-BWxS0D5h.js +0 -313
  44. package/stencil/password-input_2-Bz7EgS5w.cjs +0 -193
  45. package/stencil/password-input_2-KI96oR82.js +0 -313
  46. package/stencil/player-change-password-gm2-5cb5c6c1-B561Hszb.cjs +0 -1
  47. package/stencil/player-change-password-gm2-BRh6ZaCn.js +0 -25
  48. package/stencil/player-change-password-gm2-COxZYE4t.cjs +0 -1
  49. package/stencil/player-change-password-gm2-tu3usKOk.js +0 -7
  50. package/stencil/toggle-checkbox-input-BQz8G4GG.cjs +0 -1
  51. package/stencil/toggle-checkbox-input-Bhz93bXQ.js +0 -68
  52. package/stencil/toggle-checkbox-input-lRQooUAB.js +0 -68
  53. package/stencil/tooltipIcon-ee9760a8-BCCb4EU-.js +0 -4
  54. package/stencil/tooltipIcon-ee9760a8-Bd9l1O5C.cjs +0 -1
@@ -1,5 +1,5 @@
1
- import { r as w, h as i } from "./index-9cd44522--OAp7ePk.js";
2
- const p = "en", h = {
1
+ import { r as p, h as e } from "./index-13661b98-Bg3nkDqk.js";
2
+ const w = "en", h = {
3
3
  en: {
4
4
  title: "Change Password",
5
5
  btnSubmit: "Change Password",
@@ -112,152 +112,301 @@ const p = "en", h = {
112
112
  "gm.pms.password_not_verified_unauthorized": "A megadott jelenlegi jelszó helytelen",
113
113
  "gm.pms.password_policy_failed": "A jelszó nem egyezhet meg az utolsó {forbiddenLastPasswordsCount} jelszóval. A jelszó nem változtatható meg {minimumPasswordAgeLimitHours} {hours}-on belül az utolsó módosítás óta."
114
114
  }
115
- }, g = (e) => new Promise((s) => {
116
- fetch(e).then((a) => a.json()).then((a) => {
117
- Object.keys(a).forEach((t) => {
118
- for (let r in a[t])
119
- h[t][r] = a[t][r];
120
- }), s(!0);
115
+ }, g = (s) => new Promise((t) => {
116
+ fetch(s).then((a) => a.json()).then((a) => {
117
+ Object.keys(a).forEach((n) => {
118
+ for (let i in a[n])
119
+ h[n][i] = a[n][i];
120
+ }), t(!0);
121
121
  });
122
- }), o = (e, s, a) => {
123
- const t = s;
124
- let r = h[t !== void 0 ? t : p][e];
122
+ }), r = (s, t, a) => {
123
+ const n = t;
124
+ let i = h[n !== void 0 ? n : w][s];
125
125
  if (a !== void 0)
126
- for (const [l, n] of Object.entries(a.values)) {
126
+ for (const [l, o] of Object.entries(a.values)) {
127
127
  const m = new RegExp(`{${l}}`, "g");
128
- r = r.replace(m, n);
128
+ i = i.replace(m, o);
129
129
  }
130
- return r;
130
+ return i;
131
131
  };
132
132
  function d() {
133
- const e = navigator.userAgent.toLowerCase(), s = screen.availWidth, a = screen.availHeight;
134
- if (e.includes("iphone"))
133
+ const s = navigator.userAgent.toLowerCase(), t = screen.availWidth, a = screen.availHeight;
134
+ if (s.includes("iphone"))
135
135
  return "mobile";
136
- if (e.includes("android")) {
137
- if (a > s && s < 800)
136
+ if (s.includes("android")) {
137
+ if (a > t && t < 800)
138
138
  return "mobile";
139
- if (s > a && a < 800)
139
+ if (t > a && a < 800)
140
140
  return "tablet";
141
141
  }
142
142
  return "desktop";
143
143
  }
144
- function c(e, s) {
145
- if (e) {
144
+ function c(s, t) {
145
+ if (s) {
146
146
  const a = document.createElement("style");
147
- a.innerHTML = s, e.appendChild(a);
147
+ a.innerHTML = t, s.appendChild(a);
148
148
  }
149
149
  }
150
- function u(e, s) {
151
- const a = new URL(s);
152
- fetch(a.href).then((t) => t.text()).then((t) => {
153
- const r = document.createElement("style");
154
- r.innerHTML = t, e && e.appendChild(r);
155
- }).catch((t) => {
156
- console.error("There was an error while trying to load client styling from URL", t);
150
+ function u(s, t) {
151
+ const a = new URL(t);
152
+ fetch(a.href).then((n) => n.text()).then((n) => {
153
+ const i = document.createElement("style");
154
+ i.innerHTML = n, s && s.appendChild(i);
155
+ }).catch((n) => {
156
+ console.error("There was an error while trying to load client styling from URL", n);
157
157
  });
158
158
  }
159
- function f(e, s, a) {
159
+ function P(s, t, a) {
160
160
  if (window.emMessageBus) {
161
- const t = document.createElement("style");
162
- window.emMessageBus.subscribe(s, (r) => {
163
- t.innerHTML = r, e && e.appendChild(t);
161
+ const n = document.createElement("style");
162
+ window.emMessageBus.subscribe(t, (i) => {
163
+ n.innerHTML = i, s && s.appendChild(n);
164
164
  });
165
165
  }
166
166
  }
167
- const P = ":host{display:block}.PlayerChangePassword{font-family:inherit;width:100%;height:100%;container-type:inline-size}.PlayerChangePassword .Wrapper{display:flex;justify-content:center;align-items:center}.PlayerChangePassword .Title{font-size:var(--emw--font-size-x-large, 26px);color:var(--emw--color-primary, #22B04E);font-weight:var(--emw--font-weight-semibold, 500)}.PlayerChangePassword .TitleMobile{font-size:var(--emw--font-size-x-large, 20px);color:var(--emw--color-primary, #22B04E)}.PlayerChangePassword svg{fill:var(--emw--color-primary, #22B04E)}.PlayerChangePassword .ButtonReturn{font-family:inherit;display:inline-flex;align-items:center;gap:10px}.PlayerChangePassword .Form{display:grid;grid-template-columns:repeat(1, 1fr);gap:40px;justify-items:stretch;align-content:flex-start;overflow:auto;width:100%;height:100%}.PlayerChangePassword .Form .FieldsSection{display:flex;flex-direction:column;gap:30px}.PlayerChangePassword .Form .ButtonsSection{display:flex;flex-direction:column;justify-content:space-around;align-items:center;position:relative}.PlayerChangePassword .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, #22B04E));border:var(--emw--button-border, 1px solid var(--emw--button-border-color, #22B04E));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}.PlayerChangePassword .Button:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:var(--emw--button-border, 1px solid var(--emw--button-border-color, #828282));pointer-events:none;cursor:not-allowed}", y = P, b = class {
168
- constructor(e) {
169
- w(this, e), this.currentPasswordValue = "", this.newPasswordValue = "", this.confirmPasswordValue = "", this.isCurrentPasswordValid = !1, this.isNewPasswordValid = !1, this.isConfirmPasswordValid = !1, this.errorMsg = "", this.currentPasswordValidationSchema = { mandatory: !0, custom: [] }, this.newPasswordValidationSchema = { mandatory: !0, custom: [] }, this.confirmPasswordValidationSchema = { mandatory: !0, custom: [] }, this.initValidationSchemas = () => {
170
- this.policy && (this.newPasswordValidationSchema.custom = this.policy.customValidationRules, this.newPasswordValidationSchema.maxLength = this.policy.maximumPasswordLength, this.newPasswordValidationSchema.minLength = this.policy.minimumPasswordLength);
171
- }, this.setErrorMsg = (s) => {
172
- switch (s) {
167
+ const f = `:host {
168
+ display: block;
169
+ }
170
+
171
+ .PlayerChangePassword {
172
+ font-family: inherit;
173
+ width: 100%;
174
+ height: 100%;
175
+ container-type: inline-size;
176
+ opacity: 1;
177
+ animation-name: fadeIn;
178
+ animation-iteration-count: 1;
179
+ animation-timing-function: ease-in;
180
+ animation-duration: 0.3s;
181
+ container-type: inline-size;
182
+ }
183
+ .PlayerChangePassword .Wrapper {
184
+ display: flex;
185
+ justify-content: center;
186
+ align-items: center;
187
+ }
188
+ .PlayerChangePassword .Title {
189
+ background-color: transparent;
190
+ font-size: var(--emw--font-size-x-large, 26px);
191
+ color: var(--emw--color-primary, #22B04E);
192
+ font-weight: var(--emw--font-weight-semibold, 500);
193
+ }
194
+ .PlayerChangePassword .TitleMobile {
195
+ font-size: var(--emw--font-size-x-large, 20px);
196
+ color: var(--emw--color-primary, #22B04E);
197
+ }
198
+ .PlayerChangePassword svg {
199
+ fill: var(--emw--color-primary, #22B04E);
200
+ }
201
+ .PlayerChangePassword .ButtonReturn {
202
+ display: none;
203
+ font-family: inherit;
204
+ align-items: center;
205
+ gap: 10px;
206
+ }
207
+ .PlayerChangePassword .Form {
208
+ display: grid;
209
+ grid-template-columns: repeat(1, 1fr);
210
+ gap: 40px;
211
+ justify-items: stretch;
212
+ align-content: flex-start;
213
+ overflow: auto;
214
+ width: 100%;
215
+ height: 100%;
216
+ }
217
+ .PlayerChangePassword .Form .FieldsSection {
218
+ display: flex;
219
+ flex-direction: column;
220
+ gap: 30px;
221
+ }
222
+ .PlayerChangePassword .Form .ButtonsSection {
223
+ display: flex;
224
+ flex-direction: column;
225
+ justify-content: space-around;
226
+ align-items: center;
227
+ position: relative;
228
+ }
229
+ .PlayerChangePassword .Button {
230
+ font-family: inherit;
231
+ border-radius: var(--emw--button-border-radius, var(--emw--border-radius-large, 50px));
232
+ background: var(--emw--button-background-color, var(--emw--color-primary, #22B04E));
233
+ border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #22B04E));
234
+ color: var(--emw--button-text-color, var(--emw--color-white, #FFFFFF));
235
+ font-size: var(--emw--font-size-large, 20px);
236
+ font-weight: var(--emw--font-weight-normal, 400);
237
+ height: 50px;
238
+ width: 100%;
239
+ text-transform: uppercase;
240
+ cursor: pointer;
241
+ }
242
+ .PlayerChangePassword .Button:disabled {
243
+ background: var(--emfe-w-color-gray-100, #E6E6E6);
244
+ border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #828282));
245
+ pointer-events: none;
246
+ cursor: not-allowed;
247
+ }
248
+ .PlayerChangePassword.skeleton .Form .ButtonReturn {
249
+ width: 150px;
250
+ height: 30px;
251
+ margin-top: 15px;
252
+ display: block;
253
+ }
254
+ .PlayerChangePassword.skeleton .Form .FieldsSection {
255
+ display: block;
256
+ }
257
+ .PlayerChangePassword.skeleton .Form .FieldsSection .FieldContainer .FieldTitle {
258
+ width: 100px;
259
+ margin-top: 30px;
260
+ margin-bottom: 15px;
261
+ }
262
+ .PlayerChangePassword.skeleton .Form .ButtonsSection .Button {
263
+ font-family: inherit;
264
+ border-radius: 50px;
265
+ background: transparent;
266
+ border: none;
267
+ overflow: hidden;
268
+ }
269
+ @container (max-width: 425px) {
270
+ .PlayerChangePassword .Form .ButtonReturn {
271
+ display: inline-flex;
272
+ }
273
+ .PlayerChangePassword .Form .Title {
274
+ display: none;
275
+ }
276
+ }
277
+
278
+ @keyframes fadeIn {
279
+ 0% {
280
+ opacity: 0.01;
281
+ }
282
+ 1% {
283
+ opacity: 0;
284
+ }
285
+ 50% {
286
+ opacity: 0;
287
+ }
288
+ 100% {
289
+ opacity: 1;
290
+ }
291
+ }`, y = f, b = class {
292
+ constructor(s) {
293
+ p(this, s), this.currentPasswordValue = "", this.newPasswordValue = "", this.confirmPasswordValue = "", this.isCurrentPasswordValid = !1, this.isNewPasswordValid = !1, this.isConfirmPasswordValid = !1, this.errorMsg = "", this.currentPasswordValidationSchema = { mandatory: !0, custom: [] }, this.newPasswordValidationSchema = { mandatory: !0, custom: [] }, this.confirmPasswordValidationSchema = { mandatory: !0, custom: [] }, this.initValidationSchemas = () => {
294
+ this.confirmPasswordValidationSchema = {
295
+ mandatory: !0,
296
+ maxLength: this.policy.maximumPasswordLength,
297
+ minLength: this.policy.minimumPasswordLength,
298
+ custom: [
299
+ this.policy.customValidationRules.find((t) => t.rule === "duplicate-input")
300
+ ]
301
+ }, this.newPasswordValidationSchema = {
302
+ mandatory: !0,
303
+ maxLength: this.policy.maximumPasswordLength,
304
+ minLength: this.policy.minimumPasswordLength,
305
+ custom: this.policy.customValidationRules
306
+ }, this.currentPasswordValidationSchema = {
307
+ mandatory: !0,
308
+ maxLength: this.policy.maximumPasswordLength,
309
+ minLength: this.policy.minimumPasswordLength,
310
+ custom: this.policy.customValidationRules
311
+ };
312
+ }, this.setErrorMsg = (t) => {
313
+ switch (t) {
173
314
  case "gm.pms.password_policy_failed":
174
315
  const a = {
175
316
  forbiddenLastPasswordsCount: this.policy.forbiddenLastPasswordsCount,
176
317
  minimumPasswordAgeLimitHours: this.policy.minimumPasswordAgeLimitHours,
177
318
  hours: this.policy.minimumPasswordAgeLimitHours > 1 ? "hours" : "hour"
178
319
  };
179
- this.errorMsg = o(s, this.language, { values: a });
320
+ this.errorMsg = r(t, this.language, { values: a });
180
321
  break;
181
322
  case "gm.pms.password_not_verified_unauthorized":
182
- this.errorMsg = o(s, this.language);
323
+ this.errorMsg = r(t, this.language);
183
324
  break;
184
325
  default:
185
- this.errorMsg = o("errorMsgGeneric", this.language);
326
+ this.errorMsg = r("errorMsgGeneric", this.language);
186
327
  }
187
328
  }, this.toggleScreen = () => {
188
329
  window.postMessage({ type: "PlayerAccountMenuActive", isMobile: this.isMobile }, window.location.href);
189
330
  }, this.getPolicy = () => {
190
- const s = new URL("/api/v1/players/password-management/password", this.endpoint), a = new Headers();
191
- a.append("Accept", "text/plain");
192
- const t = {
331
+ const t = new URL("/api/v1/players/password-management/password", this.endpoint), a = new Headers();
332
+ a.append("Accept", "text/plain"), a.append("Content-Type", "application/json-patch+json");
333
+ const n = {
193
334
  method: "GET",
194
335
  headers: a
195
336
  };
196
- fetch(s.href, t).then((r) => r.status === 200 && r.json()).then((r) => this.policy = r).catch((r) => console.error(r));
197
- }, this.submitNewPassword = (s) => {
198
- if (s.preventDefault(), this.isBtnSubmitEnabled) {
199
- const a = new URL("/api/v1/players/password-management/password", this.endpoint), t = new Headers();
200
- t.append("accept", "text/plain"), t.append("Content-Type", "application/json-patch+json");
201
- const r = JSON.stringify({
337
+ fetch(t.href, n).then((i) => i.status === 200 && i.json()).then((i) => {
338
+ this.policy = i, this.policy.customValidationRules.forEach((l) => {
339
+ l.rule = l.rule.toLowerCase(), l.rule === "duplicateinput" && (l.rule = "duplicate-input");
340
+ }), this.initValidationSchemas();
341
+ }).catch((i) => {
342
+ console.error(`${r("errorMsgGeneric", this.language)}:`, i), window.postMessage({ type: "WidgetNotification", data: { type: "error", message: r("errorMsgGeneric", this.language) } }, window.location.href);
343
+ }).finally(() => {
344
+ this.isSkeletonLoading = !1;
345
+ });
346
+ }, this.submitNewPassword = (t) => {
347
+ if (t.preventDefault(), this.isBtnSubmitEnabled) {
348
+ const a = new URL("/api/v1/players/password-management/password", this.endpoint), n = new Headers();
349
+ n.append("accept", "text/plain"), n.append("Content-Type", "application/json-patch+json");
350
+ const i = JSON.stringify({
202
351
  token: this.forgotMode === "true" ? this.token : this.session,
203
352
  oldPassword: this.currentPasswordValue,
204
353
  newPassword: this.confirmPasswordValue
205
354
  }), l = {
206
355
  method: "PUT",
207
- headers: t,
208
- body: r
356
+ headers: n,
357
+ body: i
209
358
  };
210
- fetch(a.href, l).then((n) => n.json()).then((n) => {
211
- n.errorCode === null && n.message === "pms.password.update.success" ? (window.postMessage({ type: "PasswordChangedSuccessfully" }), window.postMessage({ type: "WidgetNotification", data: { type: "success", message: o("successMsg", this.language) } }, window.location.href)) : (this.setErrorMsg(n.message), window.postMessage({ type: "WidgetNotification", data: { type: "error", message: this.errorMsg } }, window.location.href));
212
- }).catch((n) => console.error(n));
359
+ fetch(a.href, l).then((o) => o.json()).then((o) => {
360
+ o.errorCode === null && o.message === "pms.password.update.success" ? (window.postMessage({ type: "PasswordChangedSuccessfully" }), window.postMessage({ type: "WidgetNotification", data: { type: "success", message: r("successMsg", this.language) } }, window.location.href)) : (this.setErrorMsg(o.message), window.postMessage({ type: "WidgetNotification", data: { type: "error", message: this.errorMsg } }, window.location.href));
361
+ }).catch((o) => console.error(o));
213
362
  }
214
- }, this.language = "en", this.endpoint = "", this.session = "", this.token = "", this.forgotMode = "", this.clientStyling = "", this.clientStylingUrl = "", this.mbSource = void 0, this.translationUrl = "", this.isBtnSubmitEnabled = !1, this.isMobile = d() === "mobile" || d() === "tablet";
363
+ }, this.language = "en", this.endpoint = "", this.session = "", this.token = "", this.forgotMode = "", this.clientStyling = "", this.clientStylingUrl = "", this.mbSource = void 0, this.translationUrl = "", this.isBtnSubmitEnabled = !1, this.isSkeletonLoading = !0, this.isMobile = d() === "mobile" || d() === "tablet";
215
364
  }
216
- handleClientStylingChange(e, s) {
217
- e != s && c(this.stylingContainer, this.clientStyling);
365
+ handleClientStylingChange(s, t) {
366
+ s != t && c(this.stylingContainer, this.clientStyling);
218
367
  }
219
- handleClientStylingUrlChange(e, s) {
220
- e != s && this.clientStylingUrl && u(this.stylingContainer, this.clientStylingUrl);
368
+ handleClientStylingUrlChange(s, t) {
369
+ s != t && this.clientStylingUrl && u(this.stylingContainer, this.clientStylingUrl);
221
370
  }
222
- sendValidityStateHandler(e) {
223
- switch (this.isBtnSubmitEnabled = !1, e.detail.name) {
371
+ sendValidityStateHandler(s) {
372
+ switch (this.isBtnSubmitEnabled = !1, s.detail.name) {
224
373
  case "password":
225
- this.isCurrentPasswordValid = e.detail.valid;
374
+ this.isCurrentPasswordValid = s.detail.valid;
226
375
  break;
227
376
  case "newPassword":
228
- this.isNewPasswordValid = e.detail.valid;
377
+ this.isNewPasswordValid = s.detail.valid;
229
378
  break;
230
379
  case "newPasswordDuplicate":
231
- this.isConfirmPasswordValid = e.detail.valid;
380
+ this.isConfirmPasswordValid = s.detail.valid;
232
381
  break;
233
382
  }
234
383
  (this.forgotMode === "true" || this.isCurrentPasswordValid) && this.isNewPasswordValid && this.isConfirmPasswordValid && (this.isBtnSubmitEnabled = !0);
235
384
  }
236
- sendInputValueHandler(e) {
237
- switch (e.detail.name) {
385
+ sendInputValueHandler(s) {
386
+ switch (s.detail.name) {
238
387
  case "password":
239
- this.currentPasswordValue = e.detail.value;
388
+ this.currentPasswordValue = s.detail.value;
240
389
  break;
241
390
  case "newPassword":
242
- this.newPasswordValue = e.detail.value;
391
+ this.newPasswordValue = s.detail.value;
243
392
  break;
244
393
  case "newPasswordDuplicate":
245
- this.confirmPasswordValue = e.detail.value;
394
+ this.confirmPasswordValue = s.detail.value;
246
395
  break;
247
396
  }
248
397
  }
249
398
  componentWillLoad() {
250
- if (this.getPolicy(), this.initValidationSchemas(), this.translationUrl)
399
+ if (this.getPolicy(), this.translationUrl)
251
400
  return g(this.translationUrl);
252
401
  }
253
402
  componentDidLoad() {
254
- this.stylingContainer && (window.emMessageBus != null ? f(this.stylingContainer, `${this.mbSource}.Style`) : (this.clientStyling && c(this.stylingContainer, this.clientStyling), this.clientStylingUrl && u(this.stylingContainer, this.clientStylingUrl)));
403
+ this.stylingContainer && (window.emMessageBus != null ? P(this.stylingContainer, `${this.mbSource}.Style`) : (this.clientStyling && c(this.stylingContainer, this.clientStyling), this.clientStylingUrl && u(this.stylingContainer, this.clientStylingUrl)));
255
404
  }
256
405
  disconnectedCallback() {
257
406
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
258
407
  }
259
408
  render() {
260
- return i("div", { key: "9a8f54fe541ef6409f7cc21bb8431c850d031830", class: "PlayerChangePassword", ref: (e) => this.stylingContainer = e }, i("form", { key: "8a3aaa6a96b16a26477657f0216a7a0a2e2e0869", class: "Form" }, this.isMobile ? i("div", { class: "ButtonReturn", onClick: this.toggleScreen }, i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, i("g", { transform: "translate(-20 -158)" }, i("g", { transform: "translate(20 158)" }, i("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)" })))), i("h2", { class: "TitleMobile" }, o("title", this.language))) : i("h2", { class: "Title" }, o("title", this.language)), i("section", { key: "47a7214266e06ef9f8ded9f86f76e15ce4f6fc3a", class: "FieldsSection" }, this.forgotMode === "false" && i("password-input", { key: "41b721a65332283a3699ab8e838dadb8d73913fa", language: this.language, name: "password", "display-name": o("passwordDisplayText", this.language), placeholder: o("passwordPlaceholderText", this.language), validation: this.currentPasswordValidationSchema, clientStyling: this.clientStyling, "mb-source": this.mbSource }), i("password-input", { key: "eb7c697eb1900ed580ff17a4cd56819993599924", language: this.language, name: "newPassword", "display-name": o("newPasswordDisplayText", this.language), placeholder: o("newPasswordPlaceholderText", this.language), validation: this.newPasswordValidationSchema, clientStyling: this.clientStyling, "mb-source": this.mbSource }), i("password-input", { key: "4b12c17b882fe8117f9c49ad296c5918198e18f0", language: this.language, name: "newPasswordDuplicate", "display-name": o("confirmPasswordDisplayText", this.language), placeholder: o("confirmPasswordPlaceholderText", this.language), validation: this.confirmPasswordValidationSchema, "is-duplicate-input": !0, clientStyling: this.clientStyling, "mb-source": this.mbSource })), i("section", { key: "a0cd6777b46ac8e4ba5eef6c42f77531a9c7ee0b", class: "ButtonsSection" }, i("button", { key: "d21c481e07a7c7762bf0fa7acbb4f1d68ac92d4d", class: "Button", disabled: !this.isBtnSubmitEnabled, onClick: this.submitNewPassword }, o("btnSubmit", this.language)))));
409
+ return this.isSkeletonLoading ? e("div", { class: "PlayerChangePassword skeleton" }, e("form", { class: "Form" }, e("div", { class: "ButtonReturn" }, e("ui-skeleton", { structure: "text", width: "auto", height: "30px" })), e("section", { class: "FieldsSection" }, e("div", { class: "FieldContainer" }, e("div", { class: "FieldTitle" }, e("ui-skeleton", { structure: "title", width: "auto", height: "10px" })), e("ui-skeleton", { structure: "rectangle", width: "auto", height: "35px" })), e("div", { class: "FieldContainer" }, e("div", { class: "FieldTitle" }, e("ui-skeleton", { structure: "title", width: "auto", height: "10px" })), e("ui-skeleton", { structure: "rectangle", width: "auto", height: "35px" })), e("div", { class: "FieldContainer" }, e("div", { class: "FieldTitle" }, e("ui-skeleton", { structure: "title", width: "auto", height: "10px" })), e("ui-skeleton", { structure: "rectangle", width: "auto", height: "35px" }))), e("section", { class: "ButtonsSection" }, e("div", { class: "Button" }, e("ui-skeleton", { structure: "rectangle", width: "auto", height: "50px" }))))) : e("div", { class: "PlayerChangePassword", ref: (s) => this.stylingContainer = s }, e("form", { class: "Form" }, e("div", { class: "ButtonReturn", onClick: this.toggleScreen }, e("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, e("g", { transform: "translate(-20 -158)" }, e("g", { transform: "translate(20 158)" }, e("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)" })))), e("h2", { class: "TitleMobile" }, r("title", this.language))), e("h2", { class: "Title" }, r("title", this.language)), e("section", { class: "FieldsSection" }, this.forgotMode === "false" && e("general-input", { type: "password", action: "input", name: "password", language: this.language, "display-name": r("passwordDisplayText", this.language), placeholder: r("passwordPlaceholderText", this.language), validation: this.currentPasswordValidationSchema, clientStyling: this.clientStyling, "mb-source": this.mbSource, "hide-password-complexity": !0 }), e("general-input", { type: "password", action: "input", name: "newPassword", language: this.language, "display-name": r("newPasswordDisplayText", this.language), placeholder: r("newPasswordPlaceholderText", this.language), validation: this.newPasswordValidationSchema, clientStyling: this.clientStyling, "mb-source": this.mbSource }), e("general-input", { type: "password", action: "input", name: "newPasswordDuplicate", language: this.language, "display-name": r("confirmPasswordDisplayText", this.language), placeholder: r("confirmPasswordPlaceholderText", this.language), validation: this.confirmPasswordValidationSchema, "is-duplicate-input": !0, clientStyling: this.clientStyling, "mb-source": this.mbSource })), e("section", { class: "ButtonsSection" }, e("button", { class: "Button", disabled: !this.isBtnSubmitEnabled, onClick: this.submitNewPassword }, r("btnSubmit", this.language)))));
261
410
  }
262
411
  static get watchers() {
263
412
  return {
@@ -0,0 +1,125 @@
1
+ "use strict";const e=require("./index-13661b98-D16qyHKo.cjs"),w="en",h={en:{title:"Change Password",btnSubmit:"Change Password",passwordPlaceholderText:"Please enter your password",newPasswordPlaceholderText:"Please enter your new password",confirmPasswordPlaceholderText:"Please confirm your new password",passwordDisplayText:"Current Password",newPasswordDisplayText:"New Password",confirmPasswordDisplayText:"Confirm Password",successMsg:"Password changed successfully",errorMsgGeneric:"There was an error when attempting to change your password","gm.pms.password_not_verified_unauthorized":"The current password you have entered is incorrect","gm.pms.password_policy_failed":"Password cannot be the same as any of the {forbiddenLastPasswordsCount} previous passwords. Password cannot be changed sooner than {minimumPasswordAgeLimitHours} {hours} after the last change."},fr:{title:"Changer le mot de passe",btnSubmit:"Changer le mot de passe",passwordPlaceholderText:"Veuillez entrer votre mot de passe",newPasswordPlaceholderText:"Veuillez entrer votre nouveau mot de passe",confirmPasswordPlaceholderText:"Veuillez confirmer votre nouveau mot de passe",passwordDisplayText:"Mot de passe actuel",newPasswordDisplayText:"Nouveau mot de passe",confirmPasswordDisplayText:"Confirmer le mot de passe",successMsg:"Mot de passe changé avec succès",errorMsgGeneric:"Une erreur est survenue lors de la tentative de changement de mot de passe","gm.pms.password_not_verified_unauthorized":"Le mot de passe actuel que vous avez entré est incorrect","gm.pms.password_policy_failed":"Le mot de passe ne peut pas être identique à l'un des {forbiddenLastPasswordsCount} derniers mots de passe. Le mot de passe ne peut pas être changé avant {minimumPasswordAgeLimitHours} {hours} après le dernier changement."},ro:{title:"Schimbă Parola",btnSubmit:"Schimbă Parola",passwordPlaceholderText:"Vă rugăm să introduceți parola",newPasswordPlaceholderText:"Vă rugăm să introduceți noua parolă",confirmPasswordPlaceholderText:"Vă rugăm să confirmați noua parolă",passwordDisplayText:"Parolă Curentă",newPasswordDisplayText:"Parolă Nouă",confirmPasswordDisplayText:"Confirmă Parola",successMsg:"Parola a fost schimbată cu succes",errorMsgGeneric:"A apărut o eroare la încercarea de schimbare a parolei","gm.pms.password_not_verified_unauthorized":"Parola curentă introdusă este incorectă","gm.pms.password_policy_failed":"Parola nu poate fi aceeași cu oricare dintre ultimele {forbiddenLastPasswordsCount} parole. Parola nu poate fi schimbată mai devreme de {minimumPasswordAgeLimitHours} {hours} după ultima schimbare."},es:{title:"Cambiar Contraseña",btnSubmit:"Cambiar Contraseña",passwordPlaceholderText:"Por favor, introduce tu contraseña",newPasswordPlaceholderText:"Por favor, introduce tu nueva contraseña",confirmPasswordPlaceholderText:"Por favor, confirma tu nueva contraseña",passwordDisplayText:"Contraseña Actual",newPasswordDisplayText:"Nueva Contraseña",confirmPasswordDisplayText:"Confirmar Contraseña",successMsg:"Contraseña cambiada con éxito",errorMsgGeneric:"Hubo un error al intentar cambiar tu contraseña","gm.pms.password_not_verified_unauthorized":"La contraseña actual que has introducido es incorrecta","gm.pms.password_policy_failed":"La contraseña no puede ser la misma que cualquiera de las {forbiddenLastPasswordsCount} contraseñas anteriores. La contraseña no se puede cambiar antes de {minimumPasswordAgeLimitHours} {hours} después del último cambio."},pt:{title:"Alterar Senha",btnSubmit:"Alterar Senha",passwordPlaceholderText:"Por favor, insira sua senha",newPasswordPlaceholderText:"Por favor, insira sua nova senha",confirmPasswordPlaceholderText:"Por favor, confirme sua nova senha",passwordDisplayText:"Senha Atual",newPasswordDisplayText:"Nova Senha",confirmPasswordDisplayText:"Confirmar Senha",successMsg:"Senha alterada com sucesso",errorMsgGeneric:"Ocorreu um erro ao tentar alterar sua senha","gm.pms.password_not_verified_unauthorized":"A senha atual que você inseriu está incorreta","gm.pms.password_policy_failed":"A senha não pode ser a mesma que qualquer uma das últimas {forbiddenLastPasswordsCount} senhas. A senha não pode ser alterada antes de {minimumPasswordAgeLimitHours} {hours} após a última alteração."},hr:{title:"Promijeni lozinku",btnSubmit:"Promijeni lozinku",passwordPlaceholderText:"Unesite svoju lozinku",newPasswordPlaceholderText:"Unesite novu lozinku",confirmPasswordPlaceholderText:"Potvrdite novu lozinku",passwordDisplayText:"Trenutna lozinka",newPasswordDisplayText:"Nova lozinka",confirmPasswordDisplayText:"Potvrdite lozinku",successMsg:"Lozinka je uspješno promijenjena",errorMsgGeneric:"Došlo je do pogreške prilikom pokušaja promjene lozinke","gm.pms.password_not_verified_unauthorized":"Unesena trenutna lozinka nije ispravna","gm.pms.password_policy_failed":"Lozinka ne može biti ista kao bilo koja od posljednjih {forbiddenLastPasswordsCount} lozinki. Lozinka se ne može promijeniti prije nego što prođe {minimumPasswordAgeLimitHours} {hours} od posljednje promjene."},tr:{title:"Şifreyi Değiştir",btnSubmit:"Şifreyi Değiştir",passwordPlaceholderText:"Lütfen şifrenizi girin",newPasswordPlaceholderText:"Lütfen yeni şifrenizi girin",confirmPasswordPlaceholderText:"Lütfen yeni şifrenizi onaylayın",passwordDisplayText:"Mevcut Şifre",newPasswordDisplayText:"Yeni Şifre",confirmPasswordDisplayText:"Şifreyi Onaylayın",successMsg:"Şifre başarıyla değiştirildi",errorMsgGeneric:"Şifrenizi değiştirirken bir hata oluştu","gm.pms.password_not_verified_unauthorized":"Girdiğiniz mevcut şifre yanlış","gm.pms.password_policy_failed":"Şifre, son {forbiddenLastPasswordsCount} şifreden herhangi biriyle aynı olamaz. Şifre, son değişiklikten sonra {minimumPasswordAgeLimitHours} {hours} içinde değiştirilemez."},hu:{title:"Jelszó megváltoztatása",btnSubmit:"Jelszó megváltoztatása",passwordPlaceholderText:"Kérjük, adja meg a jelszavát",newPasswordPlaceholderText:"Kérjük, adja meg az új jelszavát",confirmPasswordPlaceholderText:"Kérjük, erősítse meg az új jelszavát",passwordDisplayText:"Jelenlegi jelszó",newPasswordDisplayText:"Új jelszó",confirmPasswordDisplayText:"Jelszó megerősítése",successMsg:"A jelszó sikeresen megváltozott",errorMsgGeneric:"Hiba történt a jelszó megváltoztatásakor","gm.pms.password_not_verified_unauthorized":"A megadott jelenlegi jelszó helytelen","gm.pms.password_policy_failed":"A jelszó nem egyezhet meg az utolsó {forbiddenLastPasswordsCount} jelszóval. A jelszó nem változtatható meg {minimumPasswordAgeLimitHours} {hours}-on belül az utolsó módosítás óta."}},g=s=>new Promise(t=>{fetch(s).then(a=>a.json()).then(a=>{Object.keys(a).forEach(n=>{for(let i in a[n])h[n][i]=a[n][i]}),t(!0)})}),r=(s,t,a)=>{const n=t;let i=h[n!==void 0?n:w][s];if(a!==void 0)for(const[l,o]of Object.entries(a.values)){const p=new RegExp(`{${l}}`,"g");i=i.replace(p,o)}return i};function d(){const s=navigator.userAgent.toLowerCase(),t=screen.availWidth,a=screen.availHeight;if(s.includes("iphone"))return"mobile";if(s.includes("android")){if(a>t&&t<800)return"mobile";if(t>a&&a<800)return"tablet"}return"desktop"}function c(s,t){if(s){const a=document.createElement("style");a.innerHTML=t,s.appendChild(a)}}function u(s,t){const a=new URL(t);fetch(a.href).then(n=>n.text()).then(n=>{const i=document.createElement("style");i.innerHTML=n,s&&s.appendChild(i)}).catch(n=>{console.error("There was an error while trying to load client styling from URL",n)})}function P(s,t,a){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(t,i=>{n.innerHTML=i,s&&s.appendChild(n)})}}const f=`:host {
2
+ display: block;
3
+ }
4
+
5
+ .PlayerChangePassword {
6
+ font-family: inherit;
7
+ width: 100%;
8
+ height: 100%;
9
+ container-type: inline-size;
10
+ opacity: 1;
11
+ animation-name: fadeIn;
12
+ animation-iteration-count: 1;
13
+ animation-timing-function: ease-in;
14
+ animation-duration: 0.3s;
15
+ container-type: inline-size;
16
+ }
17
+ .PlayerChangePassword .Wrapper {
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ }
22
+ .PlayerChangePassword .Title {
23
+ background-color: transparent;
24
+ font-size: var(--emw--font-size-x-large, 26px);
25
+ color: var(--emw--color-primary, #22B04E);
26
+ font-weight: var(--emw--font-weight-semibold, 500);
27
+ }
28
+ .PlayerChangePassword .TitleMobile {
29
+ font-size: var(--emw--font-size-x-large, 20px);
30
+ color: var(--emw--color-primary, #22B04E);
31
+ }
32
+ .PlayerChangePassword svg {
33
+ fill: var(--emw--color-primary, #22B04E);
34
+ }
35
+ .PlayerChangePassword .ButtonReturn {
36
+ display: none;
37
+ font-family: inherit;
38
+ align-items: center;
39
+ gap: 10px;
40
+ }
41
+ .PlayerChangePassword .Form {
42
+ display: grid;
43
+ grid-template-columns: repeat(1, 1fr);
44
+ gap: 40px;
45
+ justify-items: stretch;
46
+ align-content: flex-start;
47
+ overflow: auto;
48
+ width: 100%;
49
+ height: 100%;
50
+ }
51
+ .PlayerChangePassword .Form .FieldsSection {
52
+ display: flex;
53
+ flex-direction: column;
54
+ gap: 30px;
55
+ }
56
+ .PlayerChangePassword .Form .ButtonsSection {
57
+ display: flex;
58
+ flex-direction: column;
59
+ justify-content: space-around;
60
+ align-items: center;
61
+ position: relative;
62
+ }
63
+ .PlayerChangePassword .Button {
64
+ font-family: inherit;
65
+ border-radius: var(--emw--button-border-radius, var(--emw--border-radius-large, 50px));
66
+ background: var(--emw--button-background-color, var(--emw--color-primary, #22B04E));
67
+ border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #22B04E));
68
+ color: var(--emw--button-text-color, var(--emw--color-white, #FFFFFF));
69
+ font-size: var(--emw--font-size-large, 20px);
70
+ font-weight: var(--emw--font-weight-normal, 400);
71
+ height: 50px;
72
+ width: 100%;
73
+ text-transform: uppercase;
74
+ cursor: pointer;
75
+ }
76
+ .PlayerChangePassword .Button:disabled {
77
+ background: var(--emfe-w-color-gray-100, #E6E6E6);
78
+ border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #828282));
79
+ pointer-events: none;
80
+ cursor: not-allowed;
81
+ }
82
+ .PlayerChangePassword.skeleton .Form .ButtonReturn {
83
+ width: 150px;
84
+ height: 30px;
85
+ margin-top: 15px;
86
+ display: block;
87
+ }
88
+ .PlayerChangePassword.skeleton .Form .FieldsSection {
89
+ display: block;
90
+ }
91
+ .PlayerChangePassword.skeleton .Form .FieldsSection .FieldContainer .FieldTitle {
92
+ width: 100px;
93
+ margin-top: 30px;
94
+ margin-bottom: 15px;
95
+ }
96
+ .PlayerChangePassword.skeleton .Form .ButtonsSection .Button {
97
+ font-family: inherit;
98
+ border-radius: 50px;
99
+ background: transparent;
100
+ border: none;
101
+ overflow: hidden;
102
+ }
103
+ @container (max-width: 425px) {
104
+ .PlayerChangePassword .Form .ButtonReturn {
105
+ display: inline-flex;
106
+ }
107
+ .PlayerChangePassword .Form .Title {
108
+ display: none;
109
+ }
110
+ }
111
+
112
+ @keyframes fadeIn {
113
+ 0% {
114
+ opacity: 0.01;
115
+ }
116
+ 1% {
117
+ opacity: 0;
118
+ }
119
+ 50% {
120
+ opacity: 0;
121
+ }
122
+ 100% {
123
+ opacity: 1;
124
+ }
125
+ }`,y=f,m=class{constructor(s){e.registerInstance(this,s),this.currentPasswordValue="",this.newPasswordValue="",this.confirmPasswordValue="",this.isCurrentPasswordValid=!1,this.isNewPasswordValid=!1,this.isConfirmPasswordValid=!1,this.errorMsg="",this.currentPasswordValidationSchema={mandatory:!0,custom:[]},this.newPasswordValidationSchema={mandatory:!0,custom:[]},this.confirmPasswordValidationSchema={mandatory:!0,custom:[]},this.initValidationSchemas=()=>{this.confirmPasswordValidationSchema={mandatory:!0,maxLength:this.policy.maximumPasswordLength,minLength:this.policy.minimumPasswordLength,custom:[this.policy.customValidationRules.find(t=>t.rule==="duplicate-input")]},this.newPasswordValidationSchema={mandatory:!0,maxLength:this.policy.maximumPasswordLength,minLength:this.policy.minimumPasswordLength,custom:this.policy.customValidationRules},this.currentPasswordValidationSchema={mandatory:!0,maxLength:this.policy.maximumPasswordLength,minLength:this.policy.minimumPasswordLength,custom:this.policy.customValidationRules}},this.setErrorMsg=t=>{switch(t){case"gm.pms.password_policy_failed":const a={forbiddenLastPasswordsCount:this.policy.forbiddenLastPasswordsCount,minimumPasswordAgeLimitHours:this.policy.minimumPasswordAgeLimitHours,hours:this.policy.minimumPasswordAgeLimitHours>1?"hours":"hour"};this.errorMsg=r(t,this.language,{values:a});break;case"gm.pms.password_not_verified_unauthorized":this.errorMsg=r(t,this.language);break;default:this.errorMsg=r("errorMsgGeneric",this.language)}},this.toggleScreen=()=>{window.postMessage({type:"PlayerAccountMenuActive",isMobile:this.isMobile},window.location.href)},this.getPolicy=()=>{const t=new URL("/api/v1/players/password-management/password",this.endpoint),a=new Headers;a.append("Accept","text/plain"),a.append("Content-Type","application/json-patch+json");const n={method:"GET",headers:a};fetch(t.href,n).then(i=>i.status===200&&i.json()).then(i=>{this.policy=i,this.policy.customValidationRules.forEach(l=>{l.rule=l.rule.toLowerCase(),l.rule==="duplicateinput"&&(l.rule="duplicate-input")}),this.initValidationSchemas()}).catch(i=>{console.error(`${r("errorMsgGeneric",this.language)}:`,i),window.postMessage({type:"WidgetNotification",data:{type:"error",message:r("errorMsgGeneric",this.language)}},window.location.href)}).finally(()=>{this.isSkeletonLoading=!1})},this.submitNewPassword=t=>{if(t.preventDefault(),this.isBtnSubmitEnabled){const a=new URL("/api/v1/players/password-management/password",this.endpoint),n=new Headers;n.append("accept","text/plain"),n.append("Content-Type","application/json-patch+json");const i=JSON.stringify({token:this.forgotMode==="true"?this.token:this.session,oldPassword:this.currentPasswordValue,newPassword:this.confirmPasswordValue}),l={method:"PUT",headers:n,body:i};fetch(a.href,l).then(o=>o.json()).then(o=>{o.errorCode===null&&o.message==="pms.password.update.success"?(window.postMessage({type:"PasswordChangedSuccessfully"}),window.postMessage({type:"WidgetNotification",data:{type:"success",message:r("successMsg",this.language)}},window.location.href)):(this.setErrorMsg(o.message),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMsg}},window.location.href))}).catch(o=>console.error(o))}},this.language="en",this.endpoint="",this.session="",this.token="",this.forgotMode="",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.isBtnSubmitEnabled=!1,this.isSkeletonLoading=!0,this.isMobile=d()==="mobile"||d()==="tablet"}handleClientStylingChange(s,t){s!=t&&c(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(s,t){s!=t&&this.clientStylingUrl&&u(this.stylingContainer,this.clientStylingUrl)}sendValidityStateHandler(s){switch(this.isBtnSubmitEnabled=!1,s.detail.name){case"password":this.isCurrentPasswordValid=s.detail.valid;break;case"newPassword":this.isNewPasswordValid=s.detail.valid;break;case"newPasswordDuplicate":this.isConfirmPasswordValid=s.detail.valid;break}(this.forgotMode==="true"||this.isCurrentPasswordValid)&&this.isNewPasswordValid&&this.isConfirmPasswordValid&&(this.isBtnSubmitEnabled=!0)}sendInputValueHandler(s){switch(s.detail.name){case"password":this.currentPasswordValue=s.detail.value;break;case"newPassword":this.newPasswordValue=s.detail.value;break;case"newPasswordDuplicate":this.confirmPasswordValue=s.detail.value;break}}componentWillLoad(){if(this.getPolicy(),this.translationUrl)return g(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(window.emMessageBus!=null?P(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&c(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&u(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return this.isSkeletonLoading?e.h("div",{class:"PlayerChangePassword skeleton"},e.h("form",{class:"Form"},e.h("div",{class:"ButtonReturn"},e.h("ui-skeleton",{structure:"text",width:"auto",height:"30px"})),e.h("section",{class:"FieldsSection"},e.h("div",{class:"FieldContainer"},e.h("div",{class:"FieldTitle"},e.h("ui-skeleton",{structure:"title",width:"auto",height:"10px"})),e.h("ui-skeleton",{structure:"rectangle",width:"auto",height:"35px"})),e.h("div",{class:"FieldContainer"},e.h("div",{class:"FieldTitle"},e.h("ui-skeleton",{structure:"title",width:"auto",height:"10px"})),e.h("ui-skeleton",{structure:"rectangle",width:"auto",height:"35px"})),e.h("div",{class:"FieldContainer"},e.h("div",{class:"FieldTitle"},e.h("ui-skeleton",{structure:"title",width:"auto",height:"10px"})),e.h("ui-skeleton",{structure:"rectangle",width:"auto",height:"35px"}))),e.h("section",{class:"ButtonsSection"},e.h("div",{class:"Button"},e.h("ui-skeleton",{structure:"rectangle",width:"auto",height:"50px"}))))):e.h("div",{class:"PlayerChangePassword",ref:s=>this.stylingContainer=s},e.h("form",{class:"Form"},e.h("div",{class:"ButtonReturn",onClick:this.toggleScreen},e.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},e.h("g",{transform:"translate(-20 -158)"},e.h("g",{transform:"translate(20 158)"},e.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)"})))),e.h("h2",{class:"TitleMobile"},r("title",this.language))),e.h("h2",{class:"Title"},r("title",this.language)),e.h("section",{class:"FieldsSection"},this.forgotMode==="false"&&e.h("general-input",{type:"password",action:"input",name:"password",language:this.language,"display-name":r("passwordDisplayText",this.language),placeholder:r("passwordPlaceholderText",this.language),validation:this.currentPasswordValidationSchema,clientStyling:this.clientStyling,"mb-source":this.mbSource,"hide-password-complexity":!0}),e.h("general-input",{type:"password",action:"input",name:"newPassword",language:this.language,"display-name":r("newPasswordDisplayText",this.language),placeholder:r("newPasswordPlaceholderText",this.language),validation:this.newPasswordValidationSchema,clientStyling:this.clientStyling,"mb-source":this.mbSource}),e.h("general-input",{type:"password",action:"input",name:"newPasswordDuplicate",language:this.language,"display-name":r("confirmPasswordDisplayText",this.language),placeholder:r("confirmPasswordPlaceholderText",this.language),validation:this.confirmPasswordValidationSchema,"is-duplicate-input":!0,clientStyling:this.clientStyling,"mb-source":this.mbSource})),e.h("section",{class:"ButtonsSection"},e.h("button",{class:"Button",disabled:!this.isBtnSubmitEnabled,onClick:this.submitNewPassword},r("btnSubmit",this.language)))))}static get watchers(){return{clientStyling:["handleClientStylingChange","handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};m.style=y;exports.PamChangePassword=m;