@everymatrix/pam-player-addresses 0.11.0 → 0.11.3

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.
@@ -385,7 +385,7 @@ const isMobile = (userAgent) => {
385
385
  userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
386
386
  };
387
387
 
388
- const pamPlayerAddressesCss = ":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.PamPlayerAddressesWrapper {\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.PamPlayerAddressesWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent {\n display: grid;\n max-height: 0;\n padding-bottom: 0;\n margin-top: 0;\n overflow: hidden;\n transition: ease-in-out var(--emw--transition-medium, 250ms);\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field input:focus, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent.Active {\n max-height: 800px;\n padding-bottom: 30px;\n margin-top: 20px;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerAddressesWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionTitle {\n width: 200px;\n margin-bottom: 30px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n max-height: 100%;\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n height: 60px;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.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 .PamPlayerAddressesWrapper {\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 .PamPlayerAddressesWrapper .HeaderText {\n display: none;\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerAddressesWrapper 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 .PamPlayerAddressesWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerAddressesWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerAddressesWrapper.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}";
388
+ const pamPlayerAddressesCss = ":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.errorContainer {\n font-family: \"Roboto\";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n}\n.errorContainer .errorMessage {\n color: var(--emw--color-error, var(--emw--color-red, #ed0909));\n font-size: var(--emw-font-size-small, 13px);\n display: block;\n justify-content: center;\n text-align: center;\n}\n\n.PamPlayerAddressesWrapper {\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.PamPlayerAddressesWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent {\n display: grid;\n max-height: 0;\n padding-bottom: 0;\n margin-top: 0;\n overflow: hidden;\n transition: ease-in-out var(--emw--transition-medium, 250ms);\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field input:focus, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent.Active {\n max-height: 800px;\n padding-bottom: 30px;\n margin-top: 20px;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerAddressesWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionTitle {\n width: 200px;\n margin-bottom: 30px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n max-height: 100%;\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n height: 60px;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.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 .PamPlayerAddressesWrapper {\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 .PamPlayerAddressesWrapper .HeaderText {\n display: none;\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerAddressesWrapper 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 .PamPlayerAddressesWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerAddressesWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerAddressesWrapper.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}";
389
389
  const PamPlayerAddressesStyle0 = pamPlayerAddressesCss;
390
390
 
391
391
  const PamPlayerAddresses = class {
@@ -421,6 +421,35 @@ const PamPlayerAddresses = class {
421
421
  break;
422
422
  }
423
423
  };
424
+ /**
425
+ * Promise for fetching the response and returning the response or the erorr message
426
+ * @param res - response from the API
427
+ */
428
+ this.handleFetchResponse = async (res) => {
429
+ var _a;
430
+ if (res.status >= 300) {
431
+ this.isError = true;
432
+ let response = await res.json();
433
+ this.errorCode = (_a = response.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
434
+ this.errorMessage = this.errorCode ? translate(this.errorCode, this.lang) : translate('errorMessageFetch', this.lang);
435
+ window.postMessage({
436
+ type: 'WidgetNotification',
437
+ data: {
438
+ type: 'error',
439
+ message: this.errorMessage
440
+ }
441
+ }, window.location.href);
442
+ return Promise.reject(this.errorMessage);
443
+ }
444
+ else {
445
+ this.isError = false;
446
+ if (res.headers.get('content-type')) {
447
+ let response = await res.json();
448
+ return Promise.resolve(response);
449
+ }
450
+ return Promise.resolve();
451
+ }
452
+ };
424
453
  this.getData = () => {
425
454
  const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/`, this.endpoint);
426
455
  const headers = new Headers();
@@ -429,17 +458,16 @@ const PamPlayerAddresses = class {
429
458
  method: 'GET',
430
459
  headers: headers
431
460
  };
432
- return new Promise((resolve) => {
461
+ return new Promise((resolve, reject) => {
433
462
  fetch(url.href, options)
434
- .then(res => {
435
- if (res.ok) {
436
- return res.json();
437
- }
438
- this.sendErrorNotification('errorMessageFetch');
439
- })
463
+ .then((res) => this.handleFetchResponse(res))
440
464
  .then(res => {
441
465
  this.data = res;
442
466
  resolve();
467
+ })
468
+ .catch((error) => {
469
+ console.error(error);
470
+ reject(error);
443
471
  });
444
472
  });
445
473
  };
@@ -483,7 +511,7 @@ const PamPlayerAddresses = class {
483
511
  if (!this.fieldsState[addressType]['hasChanged'])
484
512
  continue;
485
513
  const address = this.dataRef[addressType];
486
- const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${address['addressId']}`, this.endpoint);
514
+ const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${address['addressId']}/`, this.endpoint);
487
515
  const headers = new Headers();
488
516
  headers.append('X-SessionId', this.session);
489
517
  headers.append('Content-Type', 'application/json-patch+json');
@@ -577,6 +605,9 @@ const PamPlayerAddresses = class {
577
605
  this.isMobile = isMobile(window.navigator.userAgent);
578
606
  this.isPermanentAddressSectionActive = true;
579
607
  this.isTemporaryAddressSectionActive = false;
608
+ this.isError = false;
609
+ this.errorMessage = '';
610
+ this.errorCode = '';
580
611
  }
581
612
  handleStylingChange(newValue, oldValue) {
582
613
  if (newValue !== oldValue)
@@ -667,7 +698,10 @@ const PamPlayerAddresses = class {
667
698
  }
668
699
  }
669
700
  render() {
670
- return (h("div", { key: 'f273967a4c5ead5e29d5f475eb564f4f5c183134', ref: el => this.stylingContainer = el }, this.isSkeletonLoading
701
+ if (!this.isSkeletonLoading && this.isError) {
702
+ return (h("div", { class: "errorContainer" }, h("p", { class: "errorMessage", innerHTML: this.errorMessage })));
703
+ }
704
+ return (h("div", { ref: el => this.stylingContainer = el }, this.isSkeletonLoading
671
705
  ? h("form", { class: "PamPlayerAddressesWrapper 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" }))))
672
706
  : h("form", { class: "PamPlayerAddressesWrapper" }, 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)), this.dataRef['Temporary'] && this.section('Temporary', this.isTemporaryAdressEditable === 'true'), this.dataRef['Permanent'] && this.section('Permanent', this.isPermanentAdressEditable === 'true'), this.isStandAlone === 'true' &&
673
707
  h("section", { class: "ButtonsArea" }, h("button", { class: `SaveButton ${this.isSubmitButtonAvailable ? '' : 'Disabled'}`, onClick: this.updateData }, translate('saveButton'))))));
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["pam-player-addresses_2",[[1,"pam-player-addresses",{"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"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[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);
19
+ return bootstrapLazy([["pam-player-addresses_2",[[1,"pam-player-addresses",{"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"],"isFullAddressDisplayed":[513,"is-full-address-displayed"],"isPermanentAdressEditable":[513,"is-permanent-adress-editable"],"isTemporaryAdressEditable":[513,"is-temporary-adress-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isPermanentAddressSectionActive":[32],"isTemporaryAddressSectionActive":[32],"isError":[32],"errorMessage":[32],"errorCode":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
20
20
  });
@@ -1,32 +1,58 @@
1
- export { P as pam_player_addresses } from './pam-player-addresses-911649b4.js';
1
+ export { P as pam_player_addresses } from './pam-player-addresses-6572a14c.js';
2
2
  import { r as registerInstance, h, H as Host } from './index-79695a92.js';
3
3
 
4
- const uiSkeletonCss = ":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";
4
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
5
5
  const UiSkeletonStyle0 = uiSkeletonCss;
6
6
 
7
7
  const UiSkeleton = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
+ this.stylingValue = {
11
+ width: this.handleStylingProps(this.width),
12
+ height: this.handleStylingProps(this.height),
13
+ borderRadius: this.handleStylingProps(this.borderRadius),
14
+ marginBottom: this.handleStylingProps(this.marginBottom),
15
+ marginTop: this.handleStylingProps(this.marginTop),
16
+ marginLeft: this.handleStylingProps(this.marginLeft),
17
+ marginRight: this.handleStylingProps(this.marginRight),
18
+ size: this.handleStylingProps(this.size)
19
+ };
10
20
  this.structure = undefined;
11
- this.width = undefined;
12
- this.height = undefined;
13
- this.borderRadius = undefined;
14
- this.marginBottom = undefined;
15
- this.marginTop = undefined;
16
- this.marginLeft = undefined;
17
- this.marginRight = undefined;
21
+ this.width = 'unset';
22
+ this.height = 'unset';
23
+ this.borderRadius = 'unset';
24
+ this.marginBottom = 'unset';
25
+ this.marginTop = 'unset';
26
+ this.marginLeft = 'unset';
27
+ this.marginRight = 'unset';
18
28
  this.animation = true;
19
- this.rows = undefined;
20
- this.size = undefined;
21
- this.color = undefined;
22
- this.primaryColor = undefined;
23
- this.secondaryColor = undefined;
29
+ this.rows = 0;
30
+ this.size = '100%';
24
31
  }
25
32
  handleStructureChange(newValue, oldValue) {
26
33
  if (oldValue !== newValue) {
27
34
  this.handleStructure(newValue);
28
35
  }
29
36
  }
37
+ handleStylingProps(value) {
38
+ switch (typeof value) {
39
+ case 'number':
40
+ return value === 0 ? 0 : `${value}px`;
41
+ case 'undefined':
42
+ return 'unset';
43
+ case 'string':
44
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
45
+ value.endsWith('px') ||
46
+ value.endsWith('%')) {
47
+ return value;
48
+ }
49
+ else {
50
+ return 'unset';
51
+ }
52
+ default:
53
+ return 'unset';
54
+ }
55
+ }
30
56
  handleStructure(structure) {
31
57
  switch (structure) {
32
58
  case 'logo':
@@ -46,22 +72,22 @@ const UiSkeleton = class {
46
72
  }
47
73
  }
48
74
  renderLogo() {
49
- return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Logo " + (this.animation ? 'Skeleton' : '') })));
75
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Logo ' + (this.animation ? 'Skeleton' : '') })));
50
76
  }
51
77
  renderImage() {
52
- return (h("div", { class: "Image " + (this.animation ? 'Skeleton' : '') }));
78
+ return h("div", { class: 'Image ' + (this.animation ? 'Skeleton' : '') });
53
79
  }
54
80
  renderTitle() {
55
- return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Title " + (this.animation ? 'Skeleton' : '') })));
81
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Title ' + (this.animation ? 'Skeleton' : '') })));
56
82
  }
57
83
  renderText() {
58
- return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: "Text " + (this.animation ? 'Skeleton' : '') })))));
84
+ return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: 'Text ' + (this.animation ? 'Skeleton' : '') })))));
59
85
  }
60
86
  renderRectangle() {
61
- return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Rectangle " + (this.animation ? 'Skeleton' : '') })));
87
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Rectangle ' + (this.animation ? 'Skeleton' : '') })));
62
88
  }
63
89
  renderCircle() {
64
- return (h("div", { class: "SkeletonContainer" }, h("div", { class: "Circle " + (this.animation ? 'Skeleton' : '') })));
90
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Circle ' + (this.animation ? 'Skeleton' : '') })));
65
91
  }
66
92
  render() {
67
93
  let styleBlock = '';
@@ -69,97 +95,79 @@ const UiSkeleton = class {
69
95
  case 'logo':
70
96
  styleBlock = `
71
97
  :host {
72
- --emw-skeleton-logo-width: ${this.width};
73
- --emw-skeleton-logo-height: ${this.height};
74
- --emw-skeleton-logo-border-radius: ${this.borderRadius}px;
75
- --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;
76
- --emw-skeleton-logo-margin-top: ${this.marginTop}px;
77
- --emw-skeleton-logo-margin-left: ${this.marginLeft}px;
78
- --emw-skeleton-logo-margin-right: ${this.marginRight}px;
79
- --emw-skeleton-logo-background: ${this.color};
80
- --emw-skeleton-primary-color: ${this.primaryColor};
81
- --emw-skeleton-secondary-color: ${this.secondaryColor};
98
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
99
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
100
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
101
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
102
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
103
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
104
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
82
105
  }
83
106
  `;
84
107
  break;
85
108
  case 'image':
86
109
  styleBlock = `
87
110
  :host {
88
- --emw-skeleton-image-width: ${this.width};
89
- --emw-skeleton-image-height: ${this.height};
90
- --emw-skeleton-image-border-radius: ${this.borderRadius}px;
91
- --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;
92
- --emw-skeleton-image-margin-top: ${this.marginTop}px;
93
- --emw-skeleton-image-margin-left: ${this.marginLeft}px;
94
- --emw-skeleton-image-margin-right: ${this.marginRight}px;
95
- --emw-skeleton-image-background: ${this.color};
96
- --emw-skeleton-primary-color: ${this.primaryColor};
97
- --emw-skeleton-secondary-color: ${this.secondaryColor};
111
+ --emw-skeleton-image-width: ${this.stylingValue.width};
112
+ --emw-skeleton-image-height: ${this.stylingValue.height};
113
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
114
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
115
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
116
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
117
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
98
118
  }
99
119
  `;
100
120
  break;
101
121
  case 'title':
102
122
  styleBlock = `
103
123
  :host {
104
- --emw-skeleton-title-width: ${this.width};
105
- --emw-skeleton-title-height: ${this.height};
106
- --emw-skeleton-title-border-radius: ${this.borderRadius}px;
107
- --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;
108
- --emw-skeleton-title-margin-top: ${this.marginTop}px;
109
- --emw-skeleton-title-margin-left: ${this.marginLeft}px;
110
- --emw-skeleton-title-margin-right: ${this.marginRight}px;
111
- --emw-skeleton-title-background: ${this.color};
112
- --emw-skeleton-primary-color: ${this.primaryColor};
113
- --emw-skeleton-secondary-color: ${this.secondaryColor};
124
+ --emw-skeleton-title-width: ${this.stylingValue.width};
125
+ --emw-skeleton-title-height: ${this.stylingValue.height};
126
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
127
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
128
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
129
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
130
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
114
131
  }
115
132
  `;
116
133
  break;
117
134
  case 'text':
118
135
  styleBlock = `
119
136
  :host {
120
- --emw-skeleton-text-width: ${this.width};
121
- --emw-skeleton-text-height: ${this.height};
122
- --emw-skeleton-text-border-radius: ${this.borderRadius}px;
123
- --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;
124
- --emw-skeleton-text-margin-top: ${this.marginTop}px;
125
- --emw-skeleton-text-margin-left: ${this.marginLeft}px;
126
- --emw-skeleton-text-margin-right: ${this.marginRight}px;
127
- --emw-skeleton-text-background: ${this.color};
128
- --emw-skeleton-primary-color: ${this.primaryColor};
129
- --emw-skeleton-secondary-color: ${this.secondaryColor};
137
+ --emw-skeleton-text-width: ${this.stylingValue.width};
138
+ --emw-skeleton-text-height: ${this.stylingValue.height};
139
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
140
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
141
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
142
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
143
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
130
144
  }
131
145
  `;
132
146
  break;
133
147
  case 'rectangle':
134
148
  styleBlock = `
135
149
  :host {
136
- --emw-skeleton-rectangle-width: ${this.width};
137
- --emw-skeleton-rectangle-height: ${this.height};
138
- --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;
139
- --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;
140
- --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;
141
- --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;
142
- --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;
143
- --emw-skeleton-rectangle-background: ${this.color};
144
- --emw-skeleton-primary-color: ${this.primaryColor};
145
- --emw-skeleton-secondary-color: ${this.secondaryColor};
150
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
151
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
152
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
153
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
154
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
155
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
156
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
146
157
  }
147
158
  `;
148
159
  break;
149
160
  case 'circle':
150
161
  styleBlock = `
151
162
  :host {
152
- --emw-skeleton-circle-size: ${this.size};
153
- --emw-skeleton-circle-background: ${this.color};
154
- --emw-skeleton-primary-color: ${this.primaryColor};
155
- --emw-skeleton-secondary-color: ${this.secondaryColor};
163
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
156
164
  }
157
165
  `;
158
166
  break;
159
167
  default:
160
168
  styleBlock = '';
161
169
  }
162
- return (h(Host, { key: '3bb792a149db7fe732d5cbfa092cdb4d6ca0689e' }, h("style", { key: 'a4607599b60659f385ae2660513e38b383739674' }, styleBlock), this.handleStructure(this.structure)));
170
+ return (h(Host, { key: 'e6b885bfd985ce7663d990756fe9101e25eb97f0' }, h("style", { key: '06ae24c7bb74f4dacfc12ae58085333f9dc89da5' }, styleBlock), this.handleStructure(this.structure)));
163
171
  }
164
172
  static get watchers() { return {
165
173
  "structure": ["handleStructureChange"]
@@ -1 +1 @@
1
- export{P as PamPlayerAddresses}from"./pam-player-addresses-911649b4.js";import"./index-79695a92.js";
1
+ export{P as PamPlayerAddresses}from"./pam-player-addresses-6572a14c.js";import"./index-79695a92.js";
@@ -0,0 +1 @@
1
+ import{r as e,h as r}from"./index-79695a92.js";function t(e,r){if(e){const t=document.createElement("style");t.innerHTML=r,e.appendChild(t)}}function a(e,r){const t=new URL(r);fetch(t.href).then((e=>e.text())).then((r=>{const t=document.createElement("style");t.innerHTML=r,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}const n={en:{title:"Addresses",titlePermanentAddress:"Permanent Address",titleTemporaryAddress:"Temporary Address",line1:"Address Line 1",line2:"Address Line 2",line3:"Address Line 3",country:"Country",city:"City",stateProvince:"State Province",postalCode:"Postal Code",floor:"Floor",doorCode:"Door Code",buildingName:"Building Name",additionalInstructions:"Additional Instructions",line1Error:"This field must be at least 1 character long and at most 100 characters.",line2Error:"This field must be at least 1 character long and at most 100 characters.",line3Error:"This field must be at least 1 character long and at most 100 characters.",cityError:"City must be at least 1 character long and at most 100 characters.",stateProvinceError:"State Province must be at most 100 characters",postalCodeError:"Postal Code length must be at least 1 character long and at most 20 characters.",floorError:"Floor must be less than 10 characters",doorCodeError:"Door Code must be less than 10 characters",buildingNameError:"Building Name must be less than 50 characters",additionalInstructionsError:"Additional Instructions must be less than 120 characters",saveButton:"Save Changes",successMessage:"Your changes have been saved!",errorMessageUpdate:"An error has occured when attempting to update the address information",errorMessageFetch:"An error has occured when attempting to fetch the address information"},"zh-hk":{title:"地址",titlePermanentAddress:"永久地址",titleTemporaryAddress:"臨時地址",line1:"地址行1",line2:"地址行2",line3:"地址行3",country:"國家",city:"城市",stateProvince:"省/州",postalCode:"郵政編碼",floor:"樓層",doorCode:"門碼",buildingName:"建築名稱",additionalInstructions:"附加說明",line1Error:"此字段必須至少1個字符,最多100個字符。",line2Error:"此字段必須至少1個字符,最多100個字符。",line3Error:"此字段必須至少1個字符,最多100個字符。",cityError:"城市必須至少1個字符,最多100個字符。",stateProvinceError:"省/州必須最多100個字符",postalCodeError:"郵政編碼長度必須至少1個字符,最多20個字符。",floorError:"樓層必須少於10個字符",doorCodeError:"門碼必須少於10個字符",buildingNameError:"建築名稱必須少於50個字符",additionalInstructionsError:"附加說明必須少於120個字符",saveButton:"保存更改",successMessage:"您的更改已保存!",errorMessageUpdate:"嘗試更新地址信息時發生錯誤",errorMessageFetch:"在嘗試獲取地址信息時發生錯誤"},fr:{title:"Adresses",titlePermanentAddress:"Adresse permanente",titleTemporaryAddress:"Adresse temporaire",line1:"Adresse ligne 1",line2:"Adresse ligne 2",line3:"Adresse ligne 3",country:"Pays",city:"Ville",stateProvince:"État/Province",postalCode:"Code postal",floor:"Étage",doorCode:"Code de porte",buildingName:"Nom du bâtiment",additionalInstructions:"Instructions supplémentaires",line1Error:"Ce champ doit comporter au moins 1 caractère et au maximum 100 caractères.",line2Error:"Ce champ doit comporter au moins 1 caractère et au maximum 100 caractères.",line3Error:"Ce champ doit comporter au moins 1 caractère et au maximum 100 caractères.",cityError:"La ville doit comporter au moins 1 caractère et au maximum 100 caractères.",stateProvinceError:"L'État/Province doit comporter au maximum 100 caractères",postalCodeError:"La longueur du code postal doit être d'au moins 1 caractère et au maximum 20 caractères.",floorError:"L'étage doit comporter moins de 10 caractères",doorCodeError:"Le code de porte doit comporter moins de 10 caractères",buildingNameError:"Le nom du bâtiment doit comporter moins de 50 caractères",additionalInstructionsError:"Les instructions supplémentaires doivent comporter moins de 120 caractères",saveButton:"Enregistrer les modifications",successMessage:"Vos modifications ont été enregistrées !",errorMessageUpdate:"Une erreur s'est produite lors de la tentative de mise à jour des informations d'adresse",errorMessageFetch:"Une erreur est survenue lors de la tentative de récupération des informations d'adresse"},ro:{title:"Adrese",titlePermanentAddress:"Adresă permanentă",titleTemporaryAddress:"Adresă temporară",line1:"Linia adresei 1",line2:"Linia adresei 2",line3:"Linia adresei 3",country:"Țară",city:"Oraș",stateProvince:"Stat/Provincie",postalCode:"Cod poștal",floor:"Etaj",doorCode:"Cod ușă",buildingName:"Numele clădirii",additionalInstructions:"Instrucțiuni suplimentare",line1Error:"Acest câmp trebuie să aibă cel puțin 1 caracter și maximum 100 de caractere.",line2Error:"Acest câmp trebuie să aibă cel puțin 1 caracter și maximum 100 de caractere.",line3Error:"Acest câmp trebuie să aibă cel puțin 1 caracter și maximum 100 de caractere.",cityError:"Orașul trebuie să aibă cel puțin 1 caracter și maximum 100 de caractere.",stateProvinceError:"Statul/Provincia trebuie să aibă maximum 100 de caractere",postalCodeError:"Lungimea codului poștal trebuie să fie de cel puțin 1 caracter și maximum 20 de caractere.",floorError:"Etajul trebuie să aibă mai puțin de 10 caractere",doorCodeError:"Codul ușii trebuie să aibă mai puțin de 10 caractere",buildingNameError:"Numele clădirii trebuie să aibă mai puțin de 50 de caractere",additionalInstructionsError:"Instrucțiunile suplimentare trebuie să aibă mai puțin de 120 de caractere",saveButton:"Salvează modificările",successMessage:"Modificările dvs. au fost salvate!",errorMessageUpdate:"A apărut o eroare la încercarea de a actualiza informațiile adresei",errorMessageFetch:"A apărut o eroare la încercarea de a obține informațiile adresei"},tr:{title:"Adresler",titlePermanentAddress:"Kalıcı Adres",titleTemporaryAddress:"Geçici Adres",line1:"Adres Satırı 1",line2:"Adres Satırı 2",line3:"Adres Satırı 3",country:"Ülke",city:"Şehir",stateProvince:"Eyalet/İl",postalCode:"Posta Kodu",floor:"Kat",doorCode:"Kapı Kodu",buildingName:"Bina Adı",additionalInstructions:"Ek Talimatlar",line1Error:"Bu alan en az 1 karakter uzunluğunda ve en fazla 100 karakter uzunluğunda olmalıdır.",line2Error:"Bu alan en az 1 karakter uzunluğunda ve en fazla 100 karakter uzunluğunda olmalıdır.",line3Error:"Bu alan en az 1 karakter uzunluğunda ve en fazla 100 karakter uzunluğunda olmalıdır.",cityError:"Şehir en az 1 karakter uzunluğunda ve en fazla 100 karakter uzunluğunda olmalıdır.",stateProvinceError:"Eyalet/İl en fazla 100 karakter uzunluğunda olmalıdır",postalCodeError:"Posta Kodu uzunluğu en az 1 karakter ve en fazla 20 karakter olmalıdır.",floorError:"Kat en fazla 10 karakter uzunluğunda olmalıdır",doorCodeError:"Kapı Kodu en fazla 10 karakter uzunluğunda olmalıdır",buildingNameError:"Bina Adı en fazla 50 karakter uzunluğunda olmalıdır",additionalInstructionsError:"Ek Talimatlar en fazla 120 karakter uzunluğunda olmalıdır",saveButton:"Değişiklikleri Kaydet",successMessage:"Değişiklikleriniz kaydedildi!",errorMessageUpdate:"Adres bilgilerini güncellemeye çalışırken bir hata oluştu",errorMessageFetch:"Adres bilgilerini almak için yapılan işlemde bir hata oluştu"},es:{title:"Direcciones",titlePermanentAddress:"Dirección Permanente",titleTemporaryAddress:"Dirección Temporal",line1:"Línea de Dirección 1",line2:"Línea de Dirección 2",line3:"Línea de Dirección 3",country:"País",city:"Ciudad",stateProvince:"Estado/Provincia",postalCode:"Código Postal",floor:"Piso",doorCode:"Código de Puerta",buildingName:"Nombre del Edificio",additionalInstructions:"Instrucciones Adicionales",line1Error:"Este campo debe tener al menos 1 carácter y un máximo de 100 caracteres.",line2Error:"Este campo debe tener al menos 1 carácter y un máximo de 100 caracteres.",line3Error:"Este campo debe tener al menos 1 carácter y un máximo de 100 caracteres.",cityError:"La ciudad debe tener al menos 1 carácter y un máximo de 100 caracteres.",stateProvinceError:"El Estado/Provincia debe tener un máximo de 100 caracteres",postalCodeError:"La longitud del código postal debe ser de al menos 1 carácter y un máximo de 20 caracteres.",floorError:"El piso debe tener menos de 10 caracteres",doorCodeError:"El código de puerta debe tener menos de 10 caracteres",buildingNameError:"El nombre del edificio debe tener menos de 50 caracteres",additionalInstructionsError:"Las instrucciones adicionales deben tener menos de 120 caracteres",saveButton:"Guardar cambios",successMessage:"¡Tus cambios han sido guardados!",errorMessageUpdate:"Se ha producido un error al intentar actualizar la información de la dirección",errorMessageFetch:"Se ha producido un error al intentar obtener la información de la dirección"},pt:{title:"Endereços",titlePermanentAddress:"Endereço Permanente",titleTemporaryAddress:"Endereço Temporário",line1:"Linha de Endereço 1",line2:"Linha de Endereço 2",line3:"Linha de Endereço 3",country:"País",city:"Cidade",stateProvince:"Estado/Província",postalCode:"Código Postal",floor:"Andar",doorCode:"Código da Porta",buildingName:"Nome do Edifício",additionalInstructions:"Instruções Adicionais",line1Error:"Este campo deve ter pelo menos 1 caractere e no máximo 100 caracteres.",line2Error:"Este campo deve ter pelo menos 1 caractere e no máximo 100 caracteres.",line3Error:"Este campo deve ter pelo menos 1 caractere e no máximo 100 caracteres.",cityError:"A cidade deve ter pelo menos 1 caractere e no máximo 100 caracteres.",stateProvinceError:"O Estado/Província deve ter no máximo 100 caracteres",postalCodeError:"O comprimento do código postal deve ser de pelo menos 1 caractere e no máximo 20 caracteres.",floorError:"O andar deve ter menos de 10 caracteres",doorCodeError:"O código da porta deve ter menos de 10 caracteres",buildingNameError:"O nome do edifício deve ter menos de 50 caracteres",additionalInstructionsError:"As instruções adicionais devem ter menos de 120 caracteres",saveButton:"Salvar alterações",successMessage:"Suas alterações foram salvas!",errorMessageUpdate:"Ocorreu um erro ao tentar atualizar as informações do endereço",errorMessageFetch:"Ocorreu um erro ao tentar buscar as informações do endereço"},hr:{title:"Adrese",titlePermanentAddress:"Stalna Adresa",titleTemporaryAddress:"Privremena Adresa",line1:"Adresa Linija 1",line2:"Adresa Linija 2",line3:"Adresa Linija 3",country:"Država",city:"Grad",stateProvince:"Država/Provincija",postalCode:"Poštanski Broj",floor:"Kat",doorCode:"Šifra Vrata",buildingName:"Ime Zgrade",additionalInstructions:"Dodatne Upute",line1Error:"Ovo polje mora imati najmanje 1 znak i najviše 100 znakova.",line2Error:"Ovo polje mora imati najmanje 1 znak i najviše 100 znakova.",line3Error:"Ovo polje mora imati najmanje 1 znak i najviše 100 znakova.",cityError:"Grad mora imati najmanje 1 znak i najviše 100 znakova.",stateProvinceError:"Država/Provincija mora imati najviše 100 znakova",postalCodeError:"Duljina poštanskog broja mora biti najmanje 1 znak i najviše 20 znakova.",floorError:"Kat mora imati manje od 10 znakova",doorCodeError:"Šifra vrata mora imati manje od 10 znakova",buildingNameError:"Ime zgrade mora imati manje od 50 znakova",additionalInstructionsError:"Dodatne upute moraju imati manje od 120 znakova",saveButton:"Spremi promjene",successMessage:"Vaše promjene su spremljene!",errorMessageUpdate:"Došlo je do pogreške prilikom pokušaja ažuriranja informacija o adresi",errorMessageFetch:"Došlo je do greške prilikom pokušaja dobijanja informacija o adresi"},"pt-br":{title:"Endereços",titlePermanentAddress:"Endereço Permanente",titleTemporaryAddress:"Endereço Temporário",line1:"Linha de Endereço 1",line2:"Linha de Endereço 2",line3:"Linha de Endereço 3",country:"País",city:"Cidade",stateProvince:"Estado/Província",postalCode:"Código Postal",floor:"Andar",doorCode:"Código da Porta",buildingName:"Nome do Edifício",additionalInstructions:"Instruções Adicionais",line1Error:"Este campo deve ter pelo menos 1 caractere e no máximo 100 caracteres.",line2Error:"Este campo deve ter pelo menos 1 caractere e no máximo 100 caracteres.",line3Error:"Este campo deve ter pelo menos 1 caractere e no máximo 100 caracteres.",cityError:"A cidade deve ter pelo menos 1 caractere e no máximo 100 caracteres.",stateProvinceError:"O Estado/Província deve ter no máximo 100 caracteres",postalCodeError:"O comprimento do código postal deve ser de pelo menos 1 caractere e no máximo 20 caracteres.",floorError:"O andar deve ter menos de 10 caracteres",doorCodeError:"O código da porta deve ter menos de 10 caracteres",buildingNameError:"O nome do edifício deve ter menos de 50 caracteres",additionalInstructionsError:"As instruções adicionais devem ter menos de 120 caracteres",saveButton:"Salvar alterações",successMessage:"Suas alterações foram salvas!",errorMessageUpdate:"Ocorreu um erro ao tentar atualizar as informações do endereço",errorMessageFetch:"Ocorreu um erro ao tentar buscar as informações do endereço"},"es-mx":{title:"Direcciones",titlePermanentAddress:"Dirección Permanente",titleTemporaryAddress:"Dirección Temporal",line1:"Línea de Dirección 1",line2:"Línea de Dirección 2",line3:"Línea de Dirección 3",country:"País",city:"Ciudad",stateProvince:"Estado/Provincia",postalCode:"Código Postal",floor:"Piso",doorCode:"Código de Puerta",buildingName:"Nombre del Edificio",additionalInstructions:"Instrucciones Adicionales",line1Error:"Este campo debe tener al menos 1 carácter y un máximo de 100 caracteres.",line2Error:"Este campo debe tener al menos 1 carácter y un máximo de 100 caracteres.",line3Error:"Este campo debe tener al menos 1 carácter y un máximo de 100 caracteres.",cityError:"La ciudad debe tener al menos 1 carácter y un máximo de 100 caracteres.",stateProvinceError:"El Estado/Provincia debe tener un máximo de 100 caracteres",postalCodeError:"La longitud del código postal debe ser de al menos 1 carácter y un máximo de 20 caracteres.",floorError:"El piso debe tener menos de 10 caracteres",doorCodeError:"El código de puerta debe tener menos de 10 caracteres",buildingNameError:"El nombre del edificio debe tener menos de 50 caracteres",additionalInstructionsError:"Las instrucciones adicionales deben tener menos de 120 caracteres",saveButton:"Guardar cambios",successMessage:"¡Tus cambios han sido guardados!",errorMessageUpdate:"Se ha producido un error al intentar actualizar la información de la dirección",errorMessageFetch:"Se ha producido un error al intentar obtener la información de la dirección"}},o=(e,r,t)=>{let a=n[n[r]?r:"en"][e];if(void 0!==t)for(const[e,r]of Object.entries(t.values)){const t=new RegExp(`{${e}}`,"g");a=a.replace(t,r)}return a},i=class{constructor(t){var a;e(this,t),this.dataRef={},this.fieldsState={},this.sendLoadedMessage=()=>{window.postMessage({type:"ADDRESSES_LOADED"})},this.sendValidMessage=()=>{window.postMessage({type:"ADDRESSES_VALIDITY",data:this.isSubmitButtonAvailable})},this.sendSuccessNotification=()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("successMessage",this.lang)}},window.location.href)},this.sendErrorNotification=e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:o(e,this.lang)}},window.location.href)},this.sendData=()=>{window.postMessage({type:"ADDRESSES_UPDATE_DATA",data:this.data},window.location.href)},this.messageHandler=e=>{var r;switch(null===(r=e.data)||void 0===r?void 0:r.type){case"ADDRESSES_DATA":this.data=e.data.data,this.resetState(),this.isSkeletonLoading=!1;break;case"ADDRESSES_SEND_DATA":this.sendData()}},this.handleFetchResponse=async e=>{var r;if(e.status>=300){this.isError=!0;let t=await e.json();return this.errorCode=null===(r=t.thirdPartyResponse)||void 0===r?void 0:r.errorCode,this.errorMessage=o(this.errorCode?this.errorCode:"errorMessageFetch",this.lang),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href),Promise.reject(this.errorMessage)}if(this.isError=!1,e.headers.get("content-type")){let r=await e.json();return Promise.resolve(r)}return Promise.resolve()},this.getData=()=>{const e=new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/`,this.endpoint),r=new Headers;r.append("X-SessionID",this.session);const t={method:"GET",headers:r};return new Promise(((r,a)=>{fetch(e.href,t).then((e=>this.handleFetchResponse(e))).then((e=>{this.data=e,r()})).catch((e=>{console.error(e),a(e)}))}))},this.buildFieldState=(e,r,t)=>Object.assign({isValid:e,initialValue:r,rule:t}),this.resetState=()=>{this.initData(),this.initEditableFieldsState(),this.invalidFields=0,this.isSubmitButtonAvailable=!1},this.updateState=(e,r,t)=>a=>{r?this.dataRef[e][r][t]=a.target.value:this.dataRef[e][t]=a.target.value;const n=this.fieldsState[e].data[t],o=a.target.value,i=n.rule(o);i&&!n.isValid?(n.isValid=!0,this.invalidFields-=1):!i&&n.isValid&&(n.isValid=!1,this.invalidFields+=1),this.fieldsState[e].hasChanged=o!==n.initialValue;const s=this.isSubmitButtonAvailable;this.updateSubmitButtonStatus(),"true"!==this.isStandAlone&&this.isSubmitButtonAvailable!==s&&this.sendValidMessage()},this.updateData=e=>{e&&e.preventDefault();const r=[];for(const e of Object.keys(this.fieldsState)){if(!this.fieldsState[e].hasChanged)continue;const t=this.dataRef[e],a=new URL(`/api/v1/players/${this.userId}/player-identifiable-information/addresses/${t.addressId}/`,this.endpoint),n=new Headers;n.append("X-SessionId",this.session),n.append("Content-Type","application/json-patch+json");const o={method:"PUT",headers:n,body:JSON.stringify(t)};r.push(fetch(a,o))}Promise.all(r).then((e=>{if(e.some((e=>!e.ok)))return this.sendErrorNotification("errorMessageUpdate");this.sendSuccessNotification(),this.getData().then((()=>this.resetState()))}))},this.updateSubmitButtonStatus=()=>{this.isSubmitButtonAvailable=0===this.invalidFields&&Object.values(this.fieldsState).some((e=>e.hasChanged))},this.editableField=(e,t=null,a,n,i)=>{const s=this.fieldsState[e].data[a];let d;return d=t?this.dataRef[e][t][a]:this.dataRef[e][a],s?r("div",{class:"Field "+(s.isValid?"":"Invalid")},r("label",null,o(n,this.lang)),r("input",{type:"text",value:d,onKeyUp:this.updateState(e,t,a)}),!s.isValid&&r("p",{class:"Error"},o(i,this.lang))):null},this.staticField=(e,t)=>e?r("div",{class:"Field Disabled"},r("label",null,o(t,this.lang)),r("input",{type:"text",value:e,readonly:!0})):null,this.section=(e,t)=>{let a="Permanent"===e?this.isPermanentAddressSectionActive:this.isTemporaryAddressSectionActive;return t?r("div",{class:"Section"},r("button",{class:"SectionTitle",onClick:this.toggleSection(e)},o(`title${e}Address`)),r("section",{class:a?"SectionContent Active":"SectionContent"},this.editableField(e,null,"line1","line1","line1Error"),this.staticField(this.dataRef[e].country,"country"),this.editableField(e,null,"line2","line2","line2Error"),this.editableField(e,null,"stateProvince","stateProvince","stateProvinceError"),this.editableField(e,null,"line3","line3","line3Error"),this.editableField(e,null,"city","city","cityError"),this.editableField(e,null,"postalCode","postalCode","postalCodeError"),"true"==this.isFullAddressDisplayed&&r("div",{class:"CompoundField"},this.editableField(e,"addressInfo","floor","floor","floorError"),this.editableField(e,"addressInfo","doorCode","doorCode","doorCodeError")),"true"==this.isFullAddressDisplayed&&this.editableField(e,"addressInfo","buildingName","buildingName","buildingNameError"),"true"==this.isFullAddressDisplayed&&this.editableField(e,"addressInfo","additionalInstructions","additionalInstructions","additionalInstructionsError"))):r("div",{class:"Section"},r("button",{class:"SectionTitle",onClick:this.toggleSection(e)},o(`title${e}Address`,this.lang)),r("section",{class:a?"SectionContent Active":"SectionContent"},this.staticField(this.dataRef[e].line1,"line1"),this.staticField(this.dataRef[e].country,"country"),this.staticField(this.dataRef[e].line2,"line2"),this.staticField(this.dataRef[e].stateProvince,"stateProvince"),this.staticField(this.dataRef[e].line3,"line3"),this.staticField(this.dataRef[e].city,"city"),this.staticField(this.dataRef[e].postalCode,"postalCode"),"true"==this.isFullAddressDisplayed&&r("div",{class:"CompoundField"},this.staticField(this.dataRef[e].addressInfo.floor,"floor"),this.staticField(this.dataRef[e].addressInfo.doorCode,"doorCode")),"true"==this.isFullAddressDisplayed&&this.staticField(this.dataRef[e].addressInfo.buildingName,"buildingName"),"true"==this.isFullAddressDisplayed&&this.staticField(this.dataRef[e].addressInfo.additionalInstructions,"additionalInstructions")))},this.toggleScreen=()=>{window.postMessage({type:"PlayerAccountMenuActive",isMobile:this.isMobile},window.location.href)},this.toggleSection=e=>r=>{switch(r.preventDefault(),e){case"Permanent":this.isPermanentAddressSectionActive=!this.isPermanentAddressSectionActive;break;case"Temporary":this.isTemporaryAddressSectionActive=!this.isTemporaryAddressSectionActive}},this.userId=void 0,this.session=void 0,this.endpoint=void 0,this.lang="en",this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl=void 0,this.isFullAddressDisplayed="false",this.isPermanentAdressEditable="false",this.isTemporaryAdressEditable="true",this.isStandAlone="true",this.limitStylingAppends=!1,this.isSkeletonLoading=!0,this.isSubmitButtonAvailable=!1,this.invalidFields=0,this.isMobile=!!((a=window.navigator.userAgent).toLowerCase().match(/android/i)||a.toLowerCase().match(/blackberry|bb/i)||a.toLowerCase().match(/iphone|ipad|ipod/i)||a.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.isPermanentAddressSectionActive=!0,this.isTemporaryAddressSectionActive=!1,this.isError=!1,this.errorMessage="",this.errorCode=""}handleStylingChange(e,r){e!==r&&t(this.stylingContainer,this.clientStyling)}handleStylingUrlChange(e,r){e!==r&&a(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.isStandAlone&&await this.getData().then((()=>{this.initData(),this.initEditableFieldsState()})).finally((()=>this.isSkeletonLoading=!1))}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,r){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(r,(r=>{t.innerHTML=r,e&&e.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&t(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))),"true"!==this.isStandAlone&&(window.addEventListener("message",this.messageHandler,!1),this.sendLoadedMessage())}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),"true"!==this.isStandAlone&&window.removeEventListener("message",this.messageHandler,!1)}initData(){for(const e of this.data.addresses)this.dataRef[e.type]=e;this.dataRef.Temporary&&this.isSkeletonLoading&&(this.isPermanentAddressSectionActive=!1,this.isTemporaryAddressSectionActive=!0)}initEditableFieldsState(){for(const[e,r]of Object.entries(this.dataRef)){if("Permanent"===e&&"true"!==this.isPermanentAdressEditable||"Temporary"===e&&"true"!==this.isTemporaryAdressEditable)continue;const t={};["line1","line2","line3"].forEach((e=>{r[e]&&(t[e]=this.buildFieldState(!0,r[e],(e=>e&&e.length<=100)))})),r.city&&(t.city=this.buildFieldState(!0,r.city,(e=>e&&e.length<=50))),r.postalCode&&(t.postalCode=this.buildFieldState(!0,r.postalCode,(e=>e&&e.length<=20))),r.stateProvince&&(t.stateProvince=this.buildFieldState(!0,r.stateProvince,(e=>e&&e.length<=50))),Object.keys(r.addressInfo).length>0&&(r.addressInfo.floor&&(t.floor=this.buildFieldState(!0,r.addressInfo.floor,(e=>e&&e.length<=10))),r.addressInfo.doorCode&&(t.doorCode=this.buildFieldState(!0,r.addressInfo.doorCode,(e=>e&&e.length<=10))),r.addressInfo.buildingName&&(t.buildingName=this.buildFieldState(!0,r.addressInfo.buildingName,(e=>e&&e.length<=50))),r.addressInfo.additionalInstructions&&(t.additionalInstructions=this.buildFieldState(!0,r.addressInfo.additionalInstructions,(e=>e&&e.length<=120)))),this.fieldsState[e]={},this.fieldsState[e].data=t,this.fieldsState[e].hasChanged=!1}}render(){return!this.isSkeletonLoading&&this.isError?r("div",{class:"errorContainer"},r("p",{class:"errorMessage",innerHTML:this.errorMessage})):r("div",{ref:e=>this.stylingContainer=e},this.isSkeletonLoading?r("form",{class:"PamPlayerAddressesWrapper skeleton"},r("div",{class:"ReturnButton"},r("ui-skeleton",{structure:"title",width:"auto",height:"30px"})),r("div",{class:"Section"},r("section",{class:"SectionContent"},[...Array(6).keys()].map((()=>r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"})))),r("div",{class:"CompoundField"},r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"})),r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"}))),r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"auto",height:"20px"})))),r("section",{class:"ButtonsArea"},r("div",{class:"SaveButton"},r("ui-skeleton",{structure:"rectangle",width:"auto",height:"50px"})))):r("form",{class:"PamPlayerAddressesWrapper"},r("div",{class:"ReturnButton",onClick:this.toggleScreen},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},r("g",{transform:"translate(-20 -158)"},r("g",{transform:"translate(20 158)"},r("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)"})))),r("h2",null,o("title",this.lang))),r("h2",{class:"HeaderText"},o("title",this.lang)),this.dataRef.Temporary&&this.section("Temporary","true"===this.isTemporaryAdressEditable),this.dataRef.Permanent&&this.section("Permanent","true"===this.isPermanentAdressEditable),"true"===this.isStandAlone&&r("section",{class:"ButtonsArea"},r("button",{class:"SaveButton "+(this.isSubmitButtonAvailable?"":"Disabled"),onClick:this.updateData},o("saveButton")))))}static get watchers(){return{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}}};i.style=':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.errorContainer {\n font-family: "Roboto";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n}\n.errorContainer .errorMessage {\n color: var(--emw--color-error, var(--emw--color-red, #ed0909));\n font-size: var(--emw-font-size-small, 13px);\n display: block;\n justify-content: center;\n text-align: center;\n}\n\n.PamPlayerAddressesWrapper {\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.PamPlayerAddressesWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent {\n display: grid;\n max-height: 0;\n padding-bottom: 0;\n margin-top: 0;\n overflow: hidden;\n transition: ease-in-out var(--emw--transition-medium, 250ms);\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field input:focus, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerAddressesWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerAddressesWrapper .Section .SectionContent.Active {\n max-height: 800px;\n padding-bottom: 30px;\n margin-top: 20px;\n}\n.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .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.PamPlayerAddressesWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerAddressesWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionTitle {\n width: 200px;\n margin-bottom: 30px;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n max-height: 100%;\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n height: 60px;\n overflow: hidden;\n}\n.PamPlayerAddressesWrapper.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 .PamPlayerAddressesWrapper {\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 .PamPlayerAddressesWrapper .HeaderText {\n display: none;\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerAddressesWrapper 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 .PamPlayerAddressesWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerAddressesWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerAddressesWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerAddressesWrapper .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 .PamPlayerAddressesWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerAddressesWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerAddressesWrapper.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}';export{i as P}
@@ -1 +1 @@
1
- import{p as e,b as i}from"./index-79695a92.js";export{s as setNonce}from"./index-79695a92.js";import{g as r}from"./app-globals-0f993ce5.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((async e=>(await r(),i([["pam-player-addresses_2",[[1,"pam-player-addresses",{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"],isFullAddressDisplayed:[513,"is-full-address-displayed"],isPermanentAdressEditable:[513,"is-permanent-adress-editable"],isTemporaryAdressEditable:[513,"is-temporary-adress-editable"],isStandAlone:[513,"is-stand-alone"],limitStylingAppends:[32],isSkeletonLoading:[32],isSubmitButtonAvailable:[32],invalidFields:[32],isMobile:[32],isPermanentAddressSectionActive:[32],isTemporaryAddressSectionActive:[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"]}]]]],e))));
1
+ import{p as e,b as i}from"./index-79695a92.js";export{s as setNonce}from"./index-79695a92.js";import{g as r}from"./app-globals-0f993ce5.js";(()=>{const i=import.meta.url,r={};return""!==i&&(r.resourcesUrl=new URL(".",i).href),e(r)})().then((async e=>(await r(),i([["pam-player-addresses_2",[[1,"pam-player-addresses",{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"],isFullAddressDisplayed:[513,"is-full-address-displayed"],isPermanentAdressEditable:[513,"is-permanent-adress-editable"],isTemporaryAdressEditable:[513,"is-temporary-adress-editable"],isStandAlone:[513,"is-stand-alone"],limitStylingAppends:[32],isSkeletonLoading:[32],isSubmitButtonAvailable:[32],invalidFields:[32],isMobile:[32],isPermanentAddressSectionActive:[32],isTemporaryAddressSectionActive:[32],isError:[32],errorMessage:[32],errorCode:[32]},null,{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1]},null,{structure:["handleStructureChange"]}]]]],e))));
@@ -1 +1 @@
1
- export{P as pam_player_addresses}from"./pam-player-addresses-911649b4.js";import{r as e,h as t,H as n}from"./index-79695a92.js";const o=class{constructor(t){e(this,t),this.structure=void 0,this.width=void 0,this.height=void 0,this.borderRadius=void 0,this.marginBottom=void 0,this.marginTop=void 0,this.marginLeft=void 0,this.marginRight=void 0,this.animation=!0,this.rows=void 0,this.size=void 0,this.color=void 0,this.primaryColor=void 0,this.secondaryColor=void 0}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.width};\n --emw-skeleton-logo-height: ${this.height};\n --emw-skeleton-logo-border-radius: ${this.borderRadius}px;\n --emw-skeleton-logo-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-logo-margin-top: ${this.marginTop}px;\n --emw-skeleton-logo-margin-left: ${this.marginLeft}px;\n --emw-skeleton-logo-margin-right: ${this.marginRight}px;\n --emw-skeleton-logo-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.width};\n --emw-skeleton-image-height: ${this.height};\n --emw-skeleton-image-border-radius: ${this.borderRadius}px;\n --emw-skeleton-image-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-image-margin-top: ${this.marginTop}px;\n --emw-skeleton-image-margin-left: ${this.marginLeft}px;\n --emw-skeleton-image-margin-right: ${this.marginRight}px;\n --emw-skeleton-image-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.width};\n --emw-skeleton-title-height: ${this.height};\n --emw-skeleton-title-border-radius: ${this.borderRadius}px;\n --emw-skeleton-title-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-title-margin-top: ${this.marginTop}px;\n --emw-skeleton-title-margin-left: ${this.marginLeft}px;\n --emw-skeleton-title-margin-right: ${this.marginRight}px;\n --emw-skeleton-title-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.width};\n --emw-skeleton-text-height: ${this.height};\n --emw-skeleton-text-border-radius: ${this.borderRadius}px;\n --emw-skeleton-text-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-text-margin-top: ${this.marginTop}px;\n --emw-skeleton-text-margin-left: ${this.marginLeft}px;\n --emw-skeleton-text-margin-right: ${this.marginRight}px;\n --emw-skeleton-text-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.width};\n --emw-skeleton-rectangle-height: ${this.height};\n --emw-skeleton-rectangle-border-radius: ${this.borderRadius}px;\n --emw-skeleton-rectangle-margin-bottom: ${this.marginBottom}px;\n --emw-skeleton-rectangle-margin-top: ${this.marginTop}px;\n --emw-skeleton-rectangle-margin-left: ${this.marginLeft}px;\n --emw-skeleton-rectangle-margin-right: ${this.marginRight}px;\n --emw-skeleton-rectangle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.size};\n --emw-skeleton-circle-background: ${this.color};\n --emw-skeleton-primary-color: ${this.primaryColor};\n --emw-skeleton-secondary-color: ${this.secondaryColor};\n }\n `;break;default:e=""}return t(n,{key:"3bb792a149db7fe732d5cbfa092cdb4d6ca0689e"},t("style",{key:"a4607599b60659f385ae2660513e38b383739674"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};o.style=":host{display:block;--emw-skeleton-rectangle-background:#c2c2c2;--emw-skeleton-circle-background:#c2c2c2;--emw-skeleton-text-background:#c2c2c2;--emw-skeleton-title-background:#c2c2c2;--emw-skeleton-image-background:#c2c2c2;--emw-skeleton-logo-background:#c2c2c2;--emw-skeleton-primary-color:#e0e0e0;--emw-skeleton-secondary-color:#f0f0f0}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 2px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 5px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:var(--emw-skeleton-text-width-100, 300px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 5px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, inherit)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 5px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, var(--emw-skeleton-color-0, #c2c2c2))}100%{background-color:var(--emw-skeleton-secondary-color, var(--emw-skeleton-color-100, #f0f0f0))}}";export{o as ui_skeleton}
1
+ export{P as pam_player_addresses}from"./pam-player-addresses-6572a14c.js";import{r as e,h as t,H as n}from"./index-79695a92.js";const i=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"e6b885bfd985ce7663d990756fe9101e25eb97f0"},t("style",{key:"06ae24c7bb74f4dacfc12ae58085333f9dc89da5"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};i.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{i as ui_skeleton}
@@ -19,6 +19,9 @@ export declare class PamPlayerAddresses {
19
19
  isMobile: boolean;
20
20
  isPermanentAddressSectionActive: boolean;
21
21
  isTemporaryAddressSectionActive: boolean;
22
+ isError: boolean;
23
+ errorMessage: string;
24
+ errorCode: string;
22
25
  private stylingContainer;
23
26
  private stylingSubscription;
24
27
  data: any;
@@ -35,6 +38,11 @@ export declare class PamPlayerAddresses {
35
38
  sendErrorNotification: (errorKey: string) => void;
36
39
  sendData: () => void;
37
40
  messageHandler: (message: MessageEvent) => void;
41
+ /**
42
+ * Promise for fetching the response and returning the response or the erorr message
43
+ * @param res - response from the API
44
+ */
45
+ handleFetchResponse: (res: Response) => Promise<any>;
38
46
  getData: () => Promise<void>;
39
47
  initData(): void;
40
48
  buildFieldState: (isValid: any, initialValue: any, rule: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/pam-player-addresses",
3
- "version": "0.11.0",
3
+ "version": "0.11.3",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",