@everymatrix/player-limit-notification-nd 0.1.10 → 0.1.12

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const playerLimitNotificationNd = require('./player-limit-notification-nd-c65673d9.js');
5
+ const playerLimitNotificationNd = require('./player-limit-notification-nd-597c8caa.js');
6
6
  require('./index-8f6e611d.js');
7
7
 
8
8
 
@@ -7192,12 +7192,13 @@ const PlayerLimitNotificationNd = class {
7192
7192
  };
7193
7193
  }
7194
7194
  handleSelectLimitType(e, item) {
7195
+ var _a;
7195
7196
  const selectedKey = e.target.value;
7196
7197
  const selectedOption = this.limitTypeOptions.find((item) => item.selectedKey === selectedKey);
7197
7198
  Object.assign(item, Object.assign(Object.assign({}, selectedOption), { selectedKey, typeErrorMessage: null }));
7198
7199
  // trigger rerender
7199
7200
  this.limitItems = [...this.limitItems];
7200
- if (this.isDisabledPeriod(item, item.period)) {
7201
+ if (this.isDisabledPeriod(item, item.period) || !((_a = item.periodOptions) === null || _a === void 0 ? void 0 : _a.includes(item.period))) {
7201
7202
  // reset duplicate periods
7202
7203
  item.period = null;
7203
7204
  }
@@ -7492,7 +7493,7 @@ const PlayerLimitNotificationNd = class {
7492
7493
  `, disabled: this.isDisabledPeriod(limitItem, period), onClick: () => this.handleSelectLimitPeriod(period, limitItem) }, translate(period, this.language)))))), index.h("small", { class: "error-message" }, limitItem.periodErrorMessage)));
7493
7494
  }
7494
7495
  render() {
7495
- return (index.h("div", { key: 'ae3dad7b876e7d9ceb250f234c3e1747fdc889d6', class: "player-limit-modal", ref: (el) => (this.stylingContainer = el) }, index.h("section", { key: '1c1ff957e5d7fa274e92a5962185e6dcc5ca2472', class: "limit-modal-container" }, index.h("div", { key: '3043c525a39bf35f91614deadbd808d3bad4758b', class: "limit-modal-title" }, index.h("h2", { key: '88160571e334767c68269ed6fcb44c467617f4c6' }, translate('limitNotificationTitle', this.language)), index.h("p", { key: '0cdd7545ef845e0f22d74386df28d9a5e97ec3e5' }, translate('limitNotificationSubTitle', this.language))), index.h("div", { key: '78119df2f63cca751404d0f749a686336256e6ab', class: `limit-modal-content ${this.skipLimit || this.loading ? 'disable-content' : ''}` }, this.limitItems.map((item, index$1) => (index.h("div", { class: "limit-item" }, index.h("div", { class: "limit-item-type" }, index.h("label", { class: "type-select-label" }, translate('selectLimitTypeLabel', this.language)), index.h("div", null, index.h("vaadin-combo-box", { value: item.selectedKey, items: this.limitTypeOptions, "no-vertical-overlap": true, "item-label-path": "label", "item-value-path": "selectedKey", placeholder: translate('selectLimitTypePlaceholder', this.language), onChange: (e) => this.handleSelectLimitType(e, item) })), index.h("small", { class: "error-message" }, item.typeErrorMessage)), this.renderPeriodButtons(item), index.h("div", { class: "limit-item-amount" }, index.h("div", { class: "amount-input" }, index.h("label", { class: "amount-input-label" }, translate('limitNotificationAmountLabel', this.language)), index.h("div", { class: "amount-input-wrapper" }, index.h("div", { class: "amount-input-content" }, index.h("input", { class: "amount-input-inner", type: "number", pattern: "[0-9]*", value: item.amount, onWheel: this.handleBlockInputWheel, onInput: (e) => this.handleInputLimitAmount(e, item) }), index.h("span", { class: "amount-input-suffix" }, index.h("i", null, this.currencySymbolMap[this.currency]))), index.h("button", { onClick: () => this.handleRemoveLimit(index$1), class: "remove-limit-button" }, index.h("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z" })))))), index.h("small", { class: "error-message" }, item.amountErrorMessage))))), index.h("div", { key: '23139e7d1b327533489ce4b3f2e432230a3f7645', class: "checkbox-container" }, index.h("label", { key: '334c57934771223af2403998ddb20b7536c1a959' }, index.h("span", { key: '04ccbafd91a90ff474bfabd3337a987a953766b9', class: "custom-checkbox" }, index.h("input", { key: '734547aa3750a0d12fc1e9056092fce2ea1b957c', disabled: this.loading, onChange: (e) => this.handleSkipLimitChange(e), type: "checkbox", class: "checkbox-original" }), index.h("span", { key: '63f3ce41d763ad6b16b16aa7b39bc74432a9fd3a', class: "checkbox-custom" })), index.h("span", { key: 'c8f24246e5335e86a76b1e495d410fe2d2ec30fc', class: "checkbox-label" }, translate('skipLimitLimitDescription', this.language)))), index.h("div", { key: '41cdf413024f032b4120be47b300d26a413dfd8b', class: "limit-buttons" }, index.h("button", { key: 'cebe997da3cce9473c5f7519d433b3a646f945e2', class: "add-limit", disabled: this.skipLimit || this.loading, onClick: () => this.handleAddLimit() }, index.h("svg", { key: '8f4e2b46602dd8ca2a8470d1ca33712a359d7fb5', class: "add-limit-mark", width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '98f33783a2c5c9a2b26978b657b69a4d0d1cb8cd', d: "M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z" })), index.h("span", { key: '46c37e85b147a3870a183ebf5cae1a1a10d4c1af' }, translate('addLimitType', this.language))), index.h("button", { key: '2284595e04d263234d7fca37549738df3424278b', class: "save-limit", disabled: this.loading, onClick: () => this.handleSaveLimit() }, translate('savePlayerLimit', this.language)))), this.confirmPopupVisibility ? (index.h("section", { class: "confirm-modal" }, index.h("div", { class: "confirm-modal-content" }, index.h("h2", { class: "confirm-modal-title" }, translate('limitNotificationTitle', this.language)), index.h("p", null, translate('confirmLimitNotification', this.language)), index.h("div", { class: "confirm-modal-buttons" }, index.h("button", { class: "confirm-limit-close", onClick: () => this.handleCloseConfirm() }, translate('confirmLimitClose', this.language)), index.h("button", { class: "confirm-limit-save", onClick: () => this.handleSaveSkip() }, translate('confirmLimitSave', this.language)))))) : null));
7496
+ return (index.h("div", { key: 'e907bea0d1b02a7b789eca048e81d503a0ad86db', class: "player-limit-modal", ref: (el) => (this.stylingContainer = el) }, index.h("section", { key: 'cdb971abe4fa4a2057fab98ecd807911ea0c8543', class: "limit-modal-container" }, index.h("div", { key: 'c2ce6f6d70ff1dea8c9029e3a11c11c6ee63e958', class: "limit-modal-title" }, index.h("h2", { key: 'ec32ab8cd35c99368e8a96987ebfe52114688f73' }, translate('limitNotificationTitle', this.language)), index.h("p", { key: '2267e8b1ee037b4ea465a9ee4f7a9795bc5222af' }, translate('limitNotificationSubTitle', this.language))), index.h("div", { key: '0d12dde0ed543c620f5548f7edecbf85cd799008', class: `limit-modal-content ${this.skipLimit || this.loading ? 'disable-content' : ''}` }, this.limitItems.map((item, index$1) => (index.h("div", { class: "limit-item" }, index.h("div", { class: "limit-item-type" }, index.h("label", { class: "type-select-label" }, translate('selectLimitTypeLabel', this.language)), index.h("div", null, index.h("vaadin-combo-box", { value: item.selectedKey, items: this.limitTypeOptions, "no-vertical-overlap": true, "item-label-path": "label", "item-value-path": "selectedKey", placeholder: translate('selectLimitTypePlaceholder', this.language), onChange: (e) => this.handleSelectLimitType(e, item) })), index.h("small", { class: "error-message" }, item.typeErrorMessage)), this.renderPeriodButtons(item), index.h("div", { class: "limit-item-amount" }, index.h("div", { class: "amount-input" }, index.h("label", { class: "amount-input-label" }, translate('limitNotificationAmountLabel', this.language)), index.h("div", { class: "amount-input-wrapper" }, index.h("div", { class: "amount-input-content" }, index.h("input", { class: "amount-input-inner", type: "number", pattern: "[0-9]*", value: item.amount, onWheel: this.handleBlockInputWheel, onInput: (e) => this.handleInputLimitAmount(e, item) }), index.h("span", { class: "amount-input-suffix" }, index.h("i", null, this.currencySymbolMap[this.currency]))), index.h("button", { onClick: () => this.handleRemoveLimit(index$1), class: "remove-limit-button" }, index.h("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z" })))))), index.h("small", { class: "error-message" }, item.amountErrorMessage))))), index.h("div", { key: 'eeaef4d6a7e8429a850e66e1ffd73a0d71f90a6e', class: "checkbox-container" }, index.h("label", { key: 'f76e4ed26b72fb7a70ccb5ddccdd1abafd9578a2' }, index.h("span", { key: 'a6c1adf2b0cb8619f635ef839295977072f09186', class: "custom-checkbox" }, index.h("input", { key: '5a214509f0ab2f91da812f651d0eea9967359a35', disabled: this.loading, onChange: (e) => this.handleSkipLimitChange(e), type: "checkbox", class: "checkbox-original" }), index.h("span", { key: '71c77085cbbafba14cbdcd74df35f245d2dfe2ac', class: "checkbox-custom" })), index.h("span", { key: '463b2bc90b6f88789babf99f37da8d216e48ce9e', class: "checkbox-label" }, translate('skipLimitLimitDescription', this.language)))), index.h("div", { key: '8a92743753704aa756cd89416b22a38d373aa01a', class: "limit-buttons" }, index.h("button", { key: '4374f39ee73bd0ea1e57658f0ff0a5160f9c0aac', class: "add-limit", disabled: this.skipLimit || this.loading, onClick: () => this.handleAddLimit() }, index.h("svg", { key: '4484225e22b062aac67f469c224c81247971bfef', class: "add-limit-mark", width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '52f8ef1656f4dd2af073a5f4bfee272d9775c0ac', d: "M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z" })), index.h("span", { key: '0bc916f56e50700529bee96436f7ca355433881b' }, translate('addLimitType', this.language))), index.h("button", { key: '605934d7491c89a3685de636a0cae4f7803932e6', class: "save-limit", disabled: this.loading, onClick: () => this.handleSaveLimit() }, translate('savePlayerLimit', this.language)))), this.confirmPopupVisibility ? (index.h("section", { class: "confirm-modal" }, index.h("div", { class: "confirm-modal-content" }, index.h("h2", { class: "confirm-modal-title" }, translate('limitNotificationTitle', this.language)), index.h("p", null, translate('confirmLimitNotification', this.language)), index.h("div", { class: "confirm-modal-buttons" }, index.h("button", { class: "confirm-limit-close", onClick: () => this.handleCloseConfirm() }, translate('confirmLimitClose', this.language)), index.h("button", { class: "confirm-limit-save", onClick: () => this.handleSaveSkip() }, translate('confirmLimitSave', this.language)))))) : null));
7496
7497
  }
7497
7498
  static get watchers() { return {
7498
7499
  "clientStyling": ["handleClientStylingChange"],
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const playerLimitNotificationNd = require('./player-limit-notification-nd-c65673d9.js');
5
+ const playerLimitNotificationNd = require('./player-limit-notification-nd-597c8caa.js');
6
6
  require('./index-8f6e611d.js');
7
7
 
8
8
 
@@ -268,12 +268,13 @@ export class PlayerLimitNotificationNd {
268
268
  };
269
269
  }
270
270
  handleSelectLimitType(e, item) {
271
+ var _a;
271
272
  const selectedKey = e.target.value;
272
273
  const selectedOption = this.limitTypeOptions.find((item) => item.selectedKey === selectedKey);
273
274
  Object.assign(item, Object.assign(Object.assign({}, selectedOption), { selectedKey, typeErrorMessage: null }));
274
275
  // trigger rerender
275
276
  this.limitItems = [...this.limitItems];
276
- if (this.isDisabledPeriod(item, item.period)) {
277
+ if (this.isDisabledPeriod(item, item.period) || !((_a = item.periodOptions) === null || _a === void 0 ? void 0 : _a.includes(item.period))) {
277
278
  // reset duplicate periods
278
279
  item.period = null;
279
280
  }
@@ -568,7 +569,7 @@ export class PlayerLimitNotificationNd {
568
569
  `, disabled: this.isDisabledPeriod(limitItem, period), onClick: () => this.handleSelectLimitPeriod(period, limitItem) }, translate(period, this.language)))))), h("small", { class: "error-message" }, limitItem.periodErrorMessage)));
569
570
  }
570
571
  render() {
571
- return (h("div", { key: 'ae3dad7b876e7d9ceb250f234c3e1747fdc889d6', class: "player-limit-modal", ref: (el) => (this.stylingContainer = el) }, h("section", { key: '1c1ff957e5d7fa274e92a5962185e6dcc5ca2472', class: "limit-modal-container" }, h("div", { key: '3043c525a39bf35f91614deadbd808d3bad4758b', class: "limit-modal-title" }, h("h2", { key: '88160571e334767c68269ed6fcb44c467617f4c6' }, translate('limitNotificationTitle', this.language)), h("p", { key: '0cdd7545ef845e0f22d74386df28d9a5e97ec3e5' }, translate('limitNotificationSubTitle', this.language))), h("div", { key: '78119df2f63cca751404d0f749a686336256e6ab', class: `limit-modal-content ${this.skipLimit || this.loading ? 'disable-content' : ''}` }, this.limitItems.map((item, index) => (h("div", { class: "limit-item" }, h("div", { class: "limit-item-type" }, h("label", { class: "type-select-label" }, translate('selectLimitTypeLabel', this.language)), h("div", null, h("vaadin-combo-box", { value: item.selectedKey, items: this.limitTypeOptions, "no-vertical-overlap": true, "item-label-path": "label", "item-value-path": "selectedKey", placeholder: translate('selectLimitTypePlaceholder', this.language), onChange: (e) => this.handleSelectLimitType(e, item) })), h("small", { class: "error-message" }, item.typeErrorMessage)), this.renderPeriodButtons(item), h("div", { class: "limit-item-amount" }, h("div", { class: "amount-input" }, h("label", { class: "amount-input-label" }, translate('limitNotificationAmountLabel', this.language)), h("div", { class: "amount-input-wrapper" }, h("div", { class: "amount-input-content" }, h("input", { class: "amount-input-inner", type: "number", pattern: "[0-9]*", value: item.amount, onWheel: this.handleBlockInputWheel, onInput: (e) => this.handleInputLimitAmount(e, item) }), h("span", { class: "amount-input-suffix" }, h("i", null, this.currencySymbolMap[this.currency]))), h("button", { onClick: () => this.handleRemoveLimit(index), class: "remove-limit-button" }, h("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z" })))))), h("small", { class: "error-message" }, item.amountErrorMessage))))), h("div", { key: '23139e7d1b327533489ce4b3f2e432230a3f7645', class: "checkbox-container" }, h("label", { key: '334c57934771223af2403998ddb20b7536c1a959' }, h("span", { key: '04ccbafd91a90ff474bfabd3337a987a953766b9', class: "custom-checkbox" }, h("input", { key: '734547aa3750a0d12fc1e9056092fce2ea1b957c', disabled: this.loading, onChange: (e) => this.handleSkipLimitChange(e), type: "checkbox", class: "checkbox-original" }), h("span", { key: '63f3ce41d763ad6b16b16aa7b39bc74432a9fd3a', class: "checkbox-custom" })), h("span", { key: 'c8f24246e5335e86a76b1e495d410fe2d2ec30fc', class: "checkbox-label" }, translate('skipLimitLimitDescription', this.language)))), h("div", { key: '41cdf413024f032b4120be47b300d26a413dfd8b', class: "limit-buttons" }, h("button", { key: 'cebe997da3cce9473c5f7519d433b3a646f945e2', class: "add-limit", disabled: this.skipLimit || this.loading, onClick: () => this.handleAddLimit() }, h("svg", { key: '8f4e2b46602dd8ca2a8470d1ca33712a359d7fb5', class: "add-limit-mark", width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '98f33783a2c5c9a2b26978b657b69a4d0d1cb8cd', d: "M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z" })), h("span", { key: '46c37e85b147a3870a183ebf5cae1a1a10d4c1af' }, translate('addLimitType', this.language))), h("button", { key: '2284595e04d263234d7fca37549738df3424278b', class: "save-limit", disabled: this.loading, onClick: () => this.handleSaveLimit() }, translate('savePlayerLimit', this.language)))), this.confirmPopupVisibility ? (h("section", { class: "confirm-modal" }, h("div", { class: "confirm-modal-content" }, h("h2", { class: "confirm-modal-title" }, translate('limitNotificationTitle', this.language)), h("p", null, translate('confirmLimitNotification', this.language)), h("div", { class: "confirm-modal-buttons" }, h("button", { class: "confirm-limit-close", onClick: () => this.handleCloseConfirm() }, translate('confirmLimitClose', this.language)), h("button", { class: "confirm-limit-save", onClick: () => this.handleSaveSkip() }, translate('confirmLimitSave', this.language)))))) : null));
572
+ return (h("div", { key: 'e907bea0d1b02a7b789eca048e81d503a0ad86db', class: "player-limit-modal", ref: (el) => (this.stylingContainer = el) }, h("section", { key: 'cdb971abe4fa4a2057fab98ecd807911ea0c8543', class: "limit-modal-container" }, h("div", { key: 'c2ce6f6d70ff1dea8c9029e3a11c11c6ee63e958', class: "limit-modal-title" }, h("h2", { key: 'ec32ab8cd35c99368e8a96987ebfe52114688f73' }, translate('limitNotificationTitle', this.language)), h("p", { key: '2267e8b1ee037b4ea465a9ee4f7a9795bc5222af' }, translate('limitNotificationSubTitle', this.language))), h("div", { key: '0d12dde0ed543c620f5548f7edecbf85cd799008', class: `limit-modal-content ${this.skipLimit || this.loading ? 'disable-content' : ''}` }, this.limitItems.map((item, index) => (h("div", { class: "limit-item" }, h("div", { class: "limit-item-type" }, h("label", { class: "type-select-label" }, translate('selectLimitTypeLabel', this.language)), h("div", null, h("vaadin-combo-box", { value: item.selectedKey, items: this.limitTypeOptions, "no-vertical-overlap": true, "item-label-path": "label", "item-value-path": "selectedKey", placeholder: translate('selectLimitTypePlaceholder', this.language), onChange: (e) => this.handleSelectLimitType(e, item) })), h("small", { class: "error-message" }, item.typeErrorMessage)), this.renderPeriodButtons(item), h("div", { class: "limit-item-amount" }, h("div", { class: "amount-input" }, h("label", { class: "amount-input-label" }, translate('limitNotificationAmountLabel', this.language)), h("div", { class: "amount-input-wrapper" }, h("div", { class: "amount-input-content" }, h("input", { class: "amount-input-inner", type: "number", pattern: "[0-9]*", value: item.amount, onWheel: this.handleBlockInputWheel, onInput: (e) => this.handleInputLimitAmount(e, item) }), h("span", { class: "amount-input-suffix" }, h("i", null, this.currencySymbolMap[this.currency]))), h("button", { onClick: () => this.handleRemoveLimit(index), class: "remove-limit-button" }, h("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z" })))))), h("small", { class: "error-message" }, item.amountErrorMessage))))), h("div", { key: 'eeaef4d6a7e8429a850e66e1ffd73a0d71f90a6e', class: "checkbox-container" }, h("label", { key: 'f76e4ed26b72fb7a70ccb5ddccdd1abafd9578a2' }, h("span", { key: 'a6c1adf2b0cb8619f635ef839295977072f09186', class: "custom-checkbox" }, h("input", { key: '5a214509f0ab2f91da812f651d0eea9967359a35', disabled: this.loading, onChange: (e) => this.handleSkipLimitChange(e), type: "checkbox", class: "checkbox-original" }), h("span", { key: '71c77085cbbafba14cbdcd74df35f245d2dfe2ac', class: "checkbox-custom" })), h("span", { key: '463b2bc90b6f88789babf99f37da8d216e48ce9e', class: "checkbox-label" }, translate('skipLimitLimitDescription', this.language)))), h("div", { key: '8a92743753704aa756cd89416b22a38d373aa01a', class: "limit-buttons" }, h("button", { key: '4374f39ee73bd0ea1e57658f0ff0a5160f9c0aac', class: "add-limit", disabled: this.skipLimit || this.loading, onClick: () => this.handleAddLimit() }, h("svg", { key: '4484225e22b062aac67f469c224c81247971bfef', class: "add-limit-mark", width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '52f8ef1656f4dd2af073a5f4bfee272d9775c0ac', d: "M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z" })), h("span", { key: '0bc916f56e50700529bee96436f7ca355433881b' }, translate('addLimitType', this.language))), h("button", { key: '605934d7491c89a3685de636a0cae4f7803932e6', class: "save-limit", disabled: this.loading, onClick: () => this.handleSaveLimit() }, translate('savePlayerLimit', this.language)))), this.confirmPopupVisibility ? (h("section", { class: "confirm-modal" }, h("div", { class: "confirm-modal-content" }, h("h2", { class: "confirm-modal-title" }, translate('limitNotificationTitle', this.language)), h("p", null, translate('confirmLimitNotification', this.language)), h("div", { class: "confirm-modal-buttons" }, h("button", { class: "confirm-limit-close", onClick: () => this.handleCloseConfirm() }, translate('confirmLimitClose', this.language)), h("button", { class: "confirm-limit-save", onClick: () => this.handleSaveSkip() }, translate('confirmLimitSave', this.language)))))) : null));
572
573
  }
573
574
  static get is() { return "player-limit-notification-nd"; }
574
575
  static get encapsulation() { return "shadow"; }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PlayerLimitNotificationNd } from './player-limit-notification-nd-c9cf02e4.js';
1
+ export { P as PlayerLimitNotificationNd } from './player-limit-notification-nd-f1195ebc.js';
2
2
  import './index-92f4161f.js';
@@ -7190,12 +7190,13 @@ const PlayerLimitNotificationNd = class {
7190
7190
  };
7191
7191
  }
7192
7192
  handleSelectLimitType(e, item) {
7193
+ var _a;
7193
7194
  const selectedKey = e.target.value;
7194
7195
  const selectedOption = this.limitTypeOptions.find((item) => item.selectedKey === selectedKey);
7195
7196
  Object.assign(item, Object.assign(Object.assign({}, selectedOption), { selectedKey, typeErrorMessage: null }));
7196
7197
  // trigger rerender
7197
7198
  this.limitItems = [...this.limitItems];
7198
- if (this.isDisabledPeriod(item, item.period)) {
7199
+ if (this.isDisabledPeriod(item, item.period) || !((_a = item.periodOptions) === null || _a === void 0 ? void 0 : _a.includes(item.period))) {
7199
7200
  // reset duplicate periods
7200
7201
  item.period = null;
7201
7202
  }
@@ -7490,7 +7491,7 @@ const PlayerLimitNotificationNd = class {
7490
7491
  `, disabled: this.isDisabledPeriod(limitItem, period), onClick: () => this.handleSelectLimitPeriod(period, limitItem) }, translate(period, this.language)))))), h("small", { class: "error-message" }, limitItem.periodErrorMessage)));
7491
7492
  }
7492
7493
  render() {
7493
- return (h("div", { key: 'ae3dad7b876e7d9ceb250f234c3e1747fdc889d6', class: "player-limit-modal", ref: (el) => (this.stylingContainer = el) }, h("section", { key: '1c1ff957e5d7fa274e92a5962185e6dcc5ca2472', class: "limit-modal-container" }, h("div", { key: '3043c525a39bf35f91614deadbd808d3bad4758b', class: "limit-modal-title" }, h("h2", { key: '88160571e334767c68269ed6fcb44c467617f4c6' }, translate('limitNotificationTitle', this.language)), h("p", { key: '0cdd7545ef845e0f22d74386df28d9a5e97ec3e5' }, translate('limitNotificationSubTitle', this.language))), h("div", { key: '78119df2f63cca751404d0f749a686336256e6ab', class: `limit-modal-content ${this.skipLimit || this.loading ? 'disable-content' : ''}` }, this.limitItems.map((item, index) => (h("div", { class: "limit-item" }, h("div", { class: "limit-item-type" }, h("label", { class: "type-select-label" }, translate('selectLimitTypeLabel', this.language)), h("div", null, h("vaadin-combo-box", { value: item.selectedKey, items: this.limitTypeOptions, "no-vertical-overlap": true, "item-label-path": "label", "item-value-path": "selectedKey", placeholder: translate('selectLimitTypePlaceholder', this.language), onChange: (e) => this.handleSelectLimitType(e, item) })), h("small", { class: "error-message" }, item.typeErrorMessage)), this.renderPeriodButtons(item), h("div", { class: "limit-item-amount" }, h("div", { class: "amount-input" }, h("label", { class: "amount-input-label" }, translate('limitNotificationAmountLabel', this.language)), h("div", { class: "amount-input-wrapper" }, h("div", { class: "amount-input-content" }, h("input", { class: "amount-input-inner", type: "number", pattern: "[0-9]*", value: item.amount, onWheel: this.handleBlockInputWheel, onInput: (e) => this.handleInputLimitAmount(e, item) }), h("span", { class: "amount-input-suffix" }, h("i", null, this.currencySymbolMap[this.currency]))), h("button", { onClick: () => this.handleRemoveLimit(index), class: "remove-limit-button" }, h("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z" })))))), h("small", { class: "error-message" }, item.amountErrorMessage))))), h("div", { key: '23139e7d1b327533489ce4b3f2e432230a3f7645', class: "checkbox-container" }, h("label", { key: '334c57934771223af2403998ddb20b7536c1a959' }, h("span", { key: '04ccbafd91a90ff474bfabd3337a987a953766b9', class: "custom-checkbox" }, h("input", { key: '734547aa3750a0d12fc1e9056092fce2ea1b957c', disabled: this.loading, onChange: (e) => this.handleSkipLimitChange(e), type: "checkbox", class: "checkbox-original" }), h("span", { key: '63f3ce41d763ad6b16b16aa7b39bc74432a9fd3a', class: "checkbox-custom" })), h("span", { key: 'c8f24246e5335e86a76b1e495d410fe2d2ec30fc', class: "checkbox-label" }, translate('skipLimitLimitDescription', this.language)))), h("div", { key: '41cdf413024f032b4120be47b300d26a413dfd8b', class: "limit-buttons" }, h("button", { key: 'cebe997da3cce9473c5f7519d433b3a646f945e2', class: "add-limit", disabled: this.skipLimit || this.loading, onClick: () => this.handleAddLimit() }, h("svg", { key: '8f4e2b46602dd8ca2a8470d1ca33712a359d7fb5', class: "add-limit-mark", width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '98f33783a2c5c9a2b26978b657b69a4d0d1cb8cd', d: "M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z" })), h("span", { key: '46c37e85b147a3870a183ebf5cae1a1a10d4c1af' }, translate('addLimitType', this.language))), h("button", { key: '2284595e04d263234d7fca37549738df3424278b', class: "save-limit", disabled: this.loading, onClick: () => this.handleSaveLimit() }, translate('savePlayerLimit', this.language)))), this.confirmPopupVisibility ? (h("section", { class: "confirm-modal" }, h("div", { class: "confirm-modal-content" }, h("h2", { class: "confirm-modal-title" }, translate('limitNotificationTitle', this.language)), h("p", null, translate('confirmLimitNotification', this.language)), h("div", { class: "confirm-modal-buttons" }, h("button", { class: "confirm-limit-close", onClick: () => this.handleCloseConfirm() }, translate('confirmLimitClose', this.language)), h("button", { class: "confirm-limit-save", onClick: () => this.handleSaveSkip() }, translate('confirmLimitSave', this.language)))))) : null));
7494
+ return (h("div", { key: 'e907bea0d1b02a7b789eca048e81d503a0ad86db', class: "player-limit-modal", ref: (el) => (this.stylingContainer = el) }, h("section", { key: 'cdb971abe4fa4a2057fab98ecd807911ea0c8543', class: "limit-modal-container" }, h("div", { key: 'c2ce6f6d70ff1dea8c9029e3a11c11c6ee63e958', class: "limit-modal-title" }, h("h2", { key: 'ec32ab8cd35c99368e8a96987ebfe52114688f73' }, translate('limitNotificationTitle', this.language)), h("p", { key: '2267e8b1ee037b4ea465a9ee4f7a9795bc5222af' }, translate('limitNotificationSubTitle', this.language))), h("div", { key: '0d12dde0ed543c620f5548f7edecbf85cd799008', class: `limit-modal-content ${this.skipLimit || this.loading ? 'disable-content' : ''}` }, this.limitItems.map((item, index) => (h("div", { class: "limit-item" }, h("div", { class: "limit-item-type" }, h("label", { class: "type-select-label" }, translate('selectLimitTypeLabel', this.language)), h("div", null, h("vaadin-combo-box", { value: item.selectedKey, items: this.limitTypeOptions, "no-vertical-overlap": true, "item-label-path": "label", "item-value-path": "selectedKey", placeholder: translate('selectLimitTypePlaceholder', this.language), onChange: (e) => this.handleSelectLimitType(e, item) })), h("small", { class: "error-message" }, item.typeErrorMessage)), this.renderPeriodButtons(item), h("div", { class: "limit-item-amount" }, h("div", { class: "amount-input" }, h("label", { class: "amount-input-label" }, translate('limitNotificationAmountLabel', this.language)), h("div", { class: "amount-input-wrapper" }, h("div", { class: "amount-input-content" }, h("input", { class: "amount-input-inner", type: "number", pattern: "[0-9]*", value: item.amount, onWheel: this.handleBlockInputWheel, onInput: (e) => this.handleInputLimitAmount(e, item) }), h("span", { class: "amount-input-suffix" }, h("i", null, this.currencySymbolMap[this.currency]))), h("button", { onClick: () => this.handleRemoveLimit(index), class: "remove-limit-button" }, h("svg", { width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z" })))))), h("small", { class: "error-message" }, item.amountErrorMessage))))), h("div", { key: 'eeaef4d6a7e8429a850e66e1ffd73a0d71f90a6e', class: "checkbox-container" }, h("label", { key: 'f76e4ed26b72fb7a70ccb5ddccdd1abafd9578a2' }, h("span", { key: 'a6c1adf2b0cb8619f635ef839295977072f09186', class: "custom-checkbox" }, h("input", { key: '5a214509f0ab2f91da812f651d0eea9967359a35', disabled: this.loading, onChange: (e) => this.handleSkipLimitChange(e), type: "checkbox", class: "checkbox-original" }), h("span", { key: '71c77085cbbafba14cbdcd74df35f245d2dfe2ac', class: "checkbox-custom" })), h("span", { key: '463b2bc90b6f88789babf99f37da8d216e48ce9e', class: "checkbox-label" }, translate('skipLimitLimitDescription', this.language)))), h("div", { key: '8a92743753704aa756cd89416b22a38d373aa01a', class: "limit-buttons" }, h("button", { key: '4374f39ee73bd0ea1e57658f0ff0a5160f9c0aac', class: "add-limit", disabled: this.skipLimit || this.loading, onClick: () => this.handleAddLimit() }, h("svg", { key: '4484225e22b062aac67f469c224c81247971bfef', class: "add-limit-mark", width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '52f8ef1656f4dd2af073a5f4bfee272d9775c0ac', d: "M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z" })), h("span", { key: '0bc916f56e50700529bee96436f7ca355433881b' }, translate('addLimitType', this.language))), h("button", { key: '605934d7491c89a3685de636a0cae4f7803932e6', class: "save-limit", disabled: this.loading, onClick: () => this.handleSaveLimit() }, translate('savePlayerLimit', this.language)))), this.confirmPopupVisibility ? (h("section", { class: "confirm-modal" }, h("div", { class: "confirm-modal-content" }, h("h2", { class: "confirm-modal-title" }, translate('limitNotificationTitle', this.language)), h("p", null, translate('confirmLimitNotification', this.language)), h("div", { class: "confirm-modal-buttons" }, h("button", { class: "confirm-limit-close", onClick: () => this.handleCloseConfirm() }, translate('confirmLimitClose', this.language)), h("button", { class: "confirm-limit-save", onClick: () => this.handleSaveSkip() }, translate('confirmLimitSave', this.language)))))) : null));
7494
7495
  }
7495
7496
  static get watchers() { return {
7496
7497
  "clientStyling": ["handleClientStylingChange"],
@@ -1,2 +1,2 @@
1
- export { P as player_limit_notification_nd } from './player-limit-notification-nd-c9cf02e4.js';
1
+ export { P as player_limit_notification_nd } from './player-limit-notification-nd-f1195ebc.js';
2
2
  import './index-92f4161f.js';
@@ -1 +1 @@
1
- export{P as PlayerLimitNotificationNd}from"./player-limit-notification-nd-c9cf02e4.js";import"./index-92f4161f.js";
1
+ export{P as PlayerLimitNotificationNd}from"./player-limit-notification-nd-f1195ebc.js";import"./index-92f4161f.js";
@@ -6654,4 +6654,4 @@ Ut("vaadin-tabs",T`
6654
6654
  </div>
6655
6655
 
6656
6656
  <div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
6657
- `}static get is(){return"vaadin-tabs"}}x(_l);const xl=class{constructor(e){t(this,e),this.MATCH_CONFIG_AMOUNT=/^(\w+)\((\w+)\):(\d+)-(\d+)$/,this.MATCH_CONFIG_PERIOD=/^(\w+)\((\w+)\):([A-Z\-]+)$/,this.defaultPeriods=[h.DAILY,h.WEEKLY,h.MONTHLY],this.fetchSkipLimit=()=>{const t=new URL(`${this.endpoint}/api/pam/v1/player-notifications`);t.searchParams.append("createNotificationIfNotFound","true"),this.loading=!0,fetch(t,{headers:{"X-SessionId":this.session,"Content-Type":"application/json"},method:"PATCH",body:JSON.stringify({type:1,interval:5,ackNotification:!0,ackNotificationTimestamp:(new Date).toISOString()})}).then((t=>{if(t.ok)return t.json();throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:o("limitNotificationFail",this.language)}},window.location.href),new Error("Error while skipping the limit setting")})).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("setLimitSuccessful",this.language)}},window.location.href),window.postMessage({type:"SubmitLimitNotificationSuccess"},window.location.href)})).catch((t=>{console.error(t)})).finally((()=>{this.loading=!1}))},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.session=void 0,this.userid=void 0,this.language=void 0,this.endpoint=void 0,this.limitsamount=void 0,this.limitsperiods=void 0,this.currency=void 0,this.customcurrencysymbols=void 0,this.translationurl="",this.limitItems=[{}],this.limitTypeOptions=[],this.skipLimit=!1,this.loading=!1,this.confirmPopupVisibility=!1}get currencySymbolMap(){const t={};return this.customcurrencysymbols&&this.customcurrencysymbols.split(",").forEach((e=>{let i=e.split(":");t[i[0].trim()]=i[1].trim()})),Object.assign(Object.assign({},{EUR:"€",RON:" lei",USD:"$"}),t)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&n(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&n(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}async componentWillLoad(){var t;this.translationurl.length>2&&await(t=this.translationurl,new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{s[e]||(s[e]={});for(let i in t[e])s[e][i]=t[e][i]})),e(!0)}))}))),await this.parseLimitConfigs()}eventParamsToTranslationKeys(t){return`dataLayer-${t}`}emitGtag(t,e){"function"==typeof gtag&&gtag({event:t,limit_category:o(this.eventParamsToTranslationKeys(e.product.toLowerCase()),this.language)||e.product,limit_type:o(this.eventParamsToTranslationKeys(e.type.toLowerCase()))||e.type,limit_period:o(this.eventParamsToTranslationKeys(e.period),this.language)||e.period,limit_amount:e.amount})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}parsePeriodsConfig(t){const e=t.match(this.MATCH_CONFIG_PERIOD),i={D:"daily",W:"weekly",M:"monthly",N:"none"},s=[];if(e){const[,,,t]=e;t.split("-").forEach((t=>{if(!i[t])throw new Error(`Unknown period code: ${t}`);s.push(i[t])}))}return s}async parseLimitConfigs(){const t=this.limitsamount.replace(/\s/g,"").split("|"),e=this.limitsperiods.replace(/\s/g,"").split("|");if(0===t.length)throw new Error("Please provide a full limits configuration.");if(t.length!==e.length)throw new Error("Please make sure that the limit configuration parameters specify the same number of tabs.");try{for(let i=0;i<t.length;i++){const s=e[i],o=t[i].split(","),r=s.split(",");o.forEach(((t,e)=>{const i=t.match(this.MATCH_CONFIG_AMOUNT);if(i){const t=this.parsePeriodsConfig(r[e]),[,s,o,a,n]=i,l={type:o,product:s,min:parseInt(a,10),max:parseInt(n,10),label:`${c[o].title} - ${s}`,periodOptions:t,selectedKey:`${o}-${s}`};this.limitTypeOptions.push(l)}}))}}catch(t){throw new Error(`Error parsing limit config: ${t}`)}await this.filterExistingLimits(),this.limitTypeOptions=[...this.limitTypeOptions]}async filterExistingLimits(){try{const{sessionLimit:t,cumulativeSessionLimits:e,monetaryLimits:i}=await this.getLimits16();t&&(this.limitTypeOptions=this.limitTypeOptions.filter((t=>t.type===l.SESSION_LIMIT)));const s=new Map;i.forEach((t=>{var e;const i=`${null===(e=t.products)||void 0===e?void 0:e[0]}-${t.type}`.toLowerCase(),o=s.get(i)||new Set;o.add(t.period.toLowerCase()),s.set(i,o)})),this.limitTypeOptions=this.limitTypeOptions.map((t=>{const i=`${t.product}-${t.type}`.toLowerCase();let o=s.get(i)||new Set;t.type===l.CUMULATIVE_SESSION&&e&&(o=new Set(e.map((t=>t.period.toLowerCase()))));const r=t.periodOptions.filter((t=>!o.has(t)));return r.length>0?Object.assign(Object.assign({},t),{periodOptions:r}):null})).filter(Boolean)}catch(t){console.error("error getting limits",t)}}async getLimits16(){const t=this.limitTypeOptions.some((t=>t.type===l.SESSION_LIMIT||t.type===l.CUMULATIVE_SESSION)),e=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/monetary`),i={method:"GET",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"}},s=await fetch(e.href,i);if(s.status>=300)throw new Error("An error occured during the fetch request");const o=await s.json(),r=(null==o?void 0:o.limits)||[];let a=null,n=null;if(t){const t=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/session`),e=await fetch(t.href,i);if(e.status>=300)throw new Error("An error occured during the fetch request");const s=await e.json();a=null==s?void 0:s.sessionLimit,n=null==s?void 0:s.cumulativeSessionLimits}return{sessionLimit:a,cumulativeSessionLimits:n,monetaryLimits:r}}handleSelectLimitType(t,e){const i=t.target.value,s=this.limitTypeOptions.find((t=>t.selectedKey===i));Object.assign(e,Object.assign(Object.assign({},s),{selectedKey:i,typeErrorMessage:null})),this.limitItems=[...this.limitItems],this.isDisabledPeriod(e,e.period)&&(e.period=null)}handleSelectLimitPeriod(t,e){Object.assign(e,{period:t,periodErrorMessage:null}),this.limitItems=[...this.limitItems]}isDisabledPeriod(t,e){return!!t.type&&this.limitItems.filter((e=>e!==t&&e.selectedKey===t.selectedKey)).some((t=>t.period===e))}validateSave(){if(this.skipLimit)return!0;let t=!0;return this.limitItems.forEach((e=>{var i;Object.assign(e,{amountErrorMessage:null,periodErrorMessage:null,typeErrorMessage:null}),e.amountErrorMessage=this.getAmountErrorMsg(e),e.period||(null===(i=e.periodOptions)||void 0===i?void 0:i.includes(h.NONE))||(e.periodErrorMessage=o("emptyPeriodWarning",this.language)),e.type||(e.typeErrorMessage=o("emptyLimitTypeWarning",this.language)),(e.amountErrorMessage||e.typeErrorMessage||e.periodErrorMessage)&&(t=!1)})),this.limitItems=[...this.limitItems],t}handleSaveLimit(){var t,e,i;if(this.validateSave())if(this.skipLimit){const s="number"==typeof(null===(t=this.limitItems[0])||void 0===t?void 0:t.amount)||(null===(e=this.limitItems[0])||void 0===e?void 0:e.period)||(null===(i=this.limitItems[0])||void 0===i?void 0:i.type);this.limitItems.length>1||s?this.doubleConfirmSkip():this.fetchSkipLimit()}else this.fetchUpdateLimit()}doubleConfirmSkip(){this.confirmPopupVisibility=!0}handleCloseConfirm(){this.confirmPopupVisibility=!1}handleSaveSkip(){this.handleCloseConfirm(),this.fetchSkipLimit()}async fetchUpdateLimit(){this.loading=!0;const t=[];this.limitItems.forEach((e=>{switch(e.type){case"lugas":t.push(this.createSubmitLimitCall(this.updateLugasCall,e));break;case"sessionLimit":t.push(this.createSubmitLimitCall(this.updateSingleSessionLimit16Call,e));break;case"cumulativeSession":t.push(this.createSubmitLimitCall(this.updateCumulativeSessionLimit16Call,e));break;default:t.push(this.createSubmitLimitCall(this.updateMonetaryLimits16Call,e))}}));const e=await Promise.allSettled(t.map((t=>t()))),i=e.filter((t=>"fulfilled"===t.status)),s=e.filter((t=>"rejected"===t.status));if(this.loading=!1,s.length!==t.length)return i.length===t.length?(window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("setLimitSuccessful",this.language)}}),void window.postMessage({type:"SubmitLimitNotificationSuccess"},window.location.href)):void(s.length&&(window.postMessage({type:"WidgetNotification",data:{type:"info",config:{enableHtml:!0},message:o("partialFailedUpdateLimit",this.language,{values:{accountLimitPath:`/${this.language}/account/limits`}})}},window.location.href),window.postMessage({type:"SubmitLimitNotificationSuccess"},window.location.href)));window.postMessage({type:"WidgetNotification",data:{type:"error",message:o("limitNotificationFail",this.language)}},window.location.href)}createSubmitLimitCall(t,e){return async()=>{try{if((await t.bind(this)(e)).status>=300)throw new Error("An error occured during the fetch request");this.emitGtag("self_limitation_success",e)}catch(t){throw console.error("error while updating limit",t),new Error(`error while updating limit: ${t}`)}}}updateLugasCall(t){const e=new URL(`${this.endpoint}/v2/player/${this.userid}/limit/lugas`);let i={method:"POST",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({amount:t.amount,roleLimitAmount:0,softMigration:!1,keepLimit:!1})};return fetch(e.href,i)}updateSingleSessionLimit16Call(t){const e=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/session/`);let i={method:"PUT",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({sessionLimit:t.amount,sessionLimitUnit:"minute"})};return fetch(e.href,i)}capitalizeFirst(t){return t[0].toUpperCase()+t.substring(1)}updateCumulativeSessionLimit16Call(t){const e=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/session/`),i={cumulativeSessionLimits:[{period:this.capitalizeFirst(t.period),minutes:t.amount}]};let s={method:"PUT",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)};return fetch(e.href,s)}updateMonetaryLimits16Call(t){var e;const i=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/monetary/`),s={amount:t.amount,currency:this.currency,period:this.capitalizeFirst(t.period),type:c[t.type].callValue16,products:[null!==(e=t.product)&&void 0!==e?e:"All"],walletTypes:["Deposit","NetDeposit"].includes(c[t.type].callValue16)?["All"]:["RealCash"]};let o={method:"POST",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(s)};return fetch(i.href,o)}handleBlockInputWheel(t){t.preventDefault()}handleSkipLimitChange(t){this.skipLimit=t.target.checked}handleAddLimit(){this.limitItems=[...this.limitItems,{}]}handleRemoveLimit(t){this.limitItems.splice(t,1),this.limitItems=[...this.limitItems]}handleInputLimitAmount(t,e){const i=Number(t.target.value);if("number"!=typeof i||Number.isNaN(i))return void(e.amountErrorMessage=o("invalidAmount",this.language));const s=Number.isInteger(i)?i:Math.round(i);e.amount=s,e.amountErrorMessage=this.getAmountErrorMsg(e),this.limitItems=[...this.limitItems]}getAmountErrorMsg(t){if("number"!=typeof t.amount||Number.isNaN(t.amount))return o("invalidAmount",this.language);let e=null;return t.amount<t.min&&(e=o("invalidInputMessageLimitMin",this.language,{values:{minValue:t.min,currency:this.currency}})),t.amount>t.max&&(e=o("invalidInputMessageLimitMax",this.language,{values:{maxValue:t.max,currency:this.currency}})),e}renderPeriodButtons(t){const s=t.periodOptions||this.defaultPeriods;return s.includes(h.NONE)?"":e(i,null,e("div",{class:"limit-item-period"},e("label",{class:"limit-period-label"},o("selectLimitPeriodLabel",this.language)),e("div",{class:"limit-period-wrapper"},s.map((i=>e("button",{class:`\n limit-period-option\n ${t.period===i?"selected":""}\n `,disabled:this.isDisabledPeriod(t,i),onClick:()=>this.handleSelectLimitPeriod(i,t)},o(i,this.language)))))),e("small",{class:"error-message"},t.periodErrorMessage))}render(){return e("div",{key:"ae3dad7b876e7d9ceb250f234c3e1747fdc889d6",class:"player-limit-modal",ref:t=>this.stylingContainer=t},e("section",{key:"1c1ff957e5d7fa274e92a5962185e6dcc5ca2472",class:"limit-modal-container"},e("div",{key:"3043c525a39bf35f91614deadbd808d3bad4758b",class:"limit-modal-title"},e("h2",{key:"88160571e334767c68269ed6fcb44c467617f4c6"},o("limitNotificationTitle",this.language)),e("p",{key:"0cdd7545ef845e0f22d74386df28d9a5e97ec3e5"},o("limitNotificationSubTitle",this.language))),e("div",{key:"78119df2f63cca751404d0f749a686336256e6ab",class:"limit-modal-content "+(this.skipLimit||this.loading?"disable-content":"")},this.limitItems.map(((t,i)=>e("div",{class:"limit-item"},e("div",{class:"limit-item-type"},e("label",{class:"type-select-label"},o("selectLimitTypeLabel",this.language)),e("div",null,e("vaadin-combo-box",{value:t.selectedKey,items:this.limitTypeOptions,"no-vertical-overlap":!0,"item-label-path":"label","item-value-path":"selectedKey",placeholder:o("selectLimitTypePlaceholder",this.language),onChange:e=>this.handleSelectLimitType(e,t)})),e("small",{class:"error-message"},t.typeErrorMessage)),this.renderPeriodButtons(t),e("div",{class:"limit-item-amount"},e("div",{class:"amount-input"},e("label",{class:"amount-input-label"},o("limitNotificationAmountLabel",this.language)),e("div",{class:"amount-input-wrapper"},e("div",{class:"amount-input-content"},e("input",{class:"amount-input-inner",type:"number",pattern:"[0-9]*",value:t.amount,onWheel:this.handleBlockInputWheel,onInput:e=>this.handleInputLimitAmount(e,t)}),e("span",{class:"amount-input-suffix"},e("i",null,this.currencySymbolMap[this.currency]))),e("button",{onClick:()=>this.handleRemoveLimit(i),class:"remove-limit-button"},e("svg",{width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z"})))))),e("small",{class:"error-message"},t.amountErrorMessage))))),e("div",{key:"23139e7d1b327533489ce4b3f2e432230a3f7645",class:"checkbox-container"},e("label",{key:"334c57934771223af2403998ddb20b7536c1a959"},e("span",{key:"04ccbafd91a90ff474bfabd3337a987a953766b9",class:"custom-checkbox"},e("input",{key:"734547aa3750a0d12fc1e9056092fce2ea1b957c",disabled:this.loading,onChange:t=>this.handleSkipLimitChange(t),type:"checkbox",class:"checkbox-original"}),e("span",{key:"63f3ce41d763ad6b16b16aa7b39bc74432a9fd3a",class:"checkbox-custom"})),e("span",{key:"c8f24246e5335e86a76b1e495d410fe2d2ec30fc",class:"checkbox-label"},o("skipLimitLimitDescription",this.language)))),e("div",{key:"41cdf413024f032b4120be47b300d26a413dfd8b",class:"limit-buttons"},e("button",{key:"cebe997da3cce9473c5f7519d433b3a646f945e2",class:"add-limit",disabled:this.skipLimit||this.loading,onClick:()=>this.handleAddLimit()},e("svg",{key:"8f4e2b46602dd8ca2a8470d1ca33712a359d7fb5",class:"add-limit-mark",width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"98f33783a2c5c9a2b26978b657b69a4d0d1cb8cd",d:"M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z"})),e("span",{key:"46c37e85b147a3870a183ebf5cae1a1a10d4c1af"},o("addLimitType",this.language))),e("button",{key:"2284595e04d263234d7fca37549738df3424278b",class:"save-limit",disabled:this.loading,onClick:()=>this.handleSaveLimit()},o("savePlayerLimit",this.language)))),this.confirmPopupVisibility?e("section",{class:"confirm-modal"},e("div",{class:"confirm-modal-content"},e("h2",{class:"confirm-modal-title"},o("limitNotificationTitle",this.language)),e("p",null,o("confirmLimitNotification",this.language)),e("div",{class:"confirm-modal-buttons"},e("button",{class:"confirm-limit-close",onClick:()=>this.handleCloseConfirm()},o("confirmLimitClose",this.language)),e("button",{class:"confirm-limit-save",onClick:()=>this.handleSaveSkip()},o("confirmLimitSave",this.language))))):null)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};xl.style='@charset "UTF-8";*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}:host{--vaadin-input-field-invalid-hover-highlight:transparent;--vaadin-input-field-label-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-background:var(--emw--modal-input-bg, #4f4f4f);--vaadin-input-field-hovered-label-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-value-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-focused-label-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-placeholder-color:var(--emw--modal-label-color, #ababab)}vaadin-combo-box{border:none;width:100%;background-color:transparent}vaadin-combo-box::part(input-field){padding-left:15px;height:40px}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.type-select-label,.limit-period-label,.amount-input-label{display:inline-block;font-size:14px;color:var(--emw--modal-label-color, #ababab);margin:0;padding-bottom:8px;font-weight:400}.player-limit-modal{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:200;top:0;left:0;padding:0 10px;background-color:rgba(0, 0, 0, 0.7)}.player-limit-modal .limit-modal-container{color:var(--emw--modal-font-color, #fff);padding:15px;max-width:700px;min-width:300px;max-height:90vh;overflow-y:auto;position:relative;min-height:200px;border-radius:4px;background-color:var(--emw--color-modal-background, #353535)}.player-limit-modal .limit-modal-container .limit-modal-content.disable-content{pointer-events:none;cursor:not-allowed;opacity:0.4}.player-limit-modal .limit-modal-container .error-message{display:block;color:var(--emw--color-error, red);min-height:16px}.player-limit-modal .limit-modal-container .limit-modal-title h2{font-size:16px;font-weight:500;margin-top:15px;margin-bottom:15px}.player-limit-modal .limit-modal-container .limit-item:nth-of-type(1) .remove-limit-button{display:none}.player-limit-modal .limit-modal-container .limit-item:not(:nth-of-type(1)){padding:9px;margin:14px 0;border-radius:6px;border:1px solid #6a6a6a}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper{display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:4px}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper .limit-period-option{flex-grow:1;border:1px solid transparent;cursor:pointer;background:var(--emw--modal-input-bg, #4f4f4f);width:100px;height:40px;font-size:14px;border-radius:4px;color:var(--emw--modal-font-color, #fff);transition:0.5s}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper .limit-period-option:disabled{cursor:not-allowed;opacity:0.4}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper .limit-period-option.selected{border-color:var(--emw--color-primary, #ffe30c)}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-wrapper{display:flex;flex-wrap:nowrap}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content{position:relative;flex:1;margin-right:6px}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content .amount-input-inner{padding-right:30px;padding-left:15px;outline:none;border:none;height:40px;color:var(--emw--modal-label-color, #ababab);background-color:var(--emw--modal-input-bg, #4f4f4f);width:100%;border-radius:4px}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content .amount-input-suffix{width:20px;height:20px;background-color:var(--emw--modal-label-color, #ababab);border-radius:50%;position:absolute;right:0px;transform:translate(-50%, -50%);top:50%;text-align:center;pointer-events:none}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content .amount-input-suffix i{color:var(--emw--modal-input-bg, #4f4f4f)}.player-limit-modal .limit-modal-container .limit-item-amount .remove-limit-button{width:40px;height:40px;border:none;border-radius:4px;cursor:pointer;background-color:color-mix(in srgb, var(--emw--color-primary, #ffe30c) 20%, transparent 80%);transition:2s}.player-limit-modal .limit-modal-container .limit-item-amount .remove-limit-button:hover{background-color:color-mix(in srgb, var(--emw--color-primary, #ffe30c) 50%, white 50%)}.player-limit-modal .limit-modal-container .limit-item-amount .remove-limit-button svg{fill:var(--emw--color-primary, #ffe30c)}.player-limit-modal .limit-modal-container .checkbox-container label{display:flex;align-items:center;gap:6px}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-original{opacity:0;width:0;height:0;z-index:-1;position:absolute}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-original:checked+.checkbox-custom::after{opacity:1}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-custom{display:inline-block;width:18px;height:18px;background:var(--emw--modal-input-bg, #4f4f4f);border-radius:3px;position:relative;transition:0.2s}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-custom::after{content:"✔";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);color:var(--emw--modal-font-color, #fff);font-size:12px;opacity:0;transition:opacity 0.2s}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-label{color:var(--emw--modal-label-color, #ababab);font-size:14px;cursor:pointer;user-select:none}.player-limit-modal .limit-modal-container .limit-buttons{display:flex;justify-content:space-around;align-items:center;gap:10px;margin-top:10px}.player-limit-modal .limit-modal-container .limit-buttons .add-limit{display:inline-flex;align-items:center;justify-content:center;gap:5px;cursor:pointer;border:1px solid var(--emw--modal-font-color, #fff);width:150px;height:40px;background:transparent;border-radius:6px;color:var(--emw--modal-font-color, #fff)}.player-limit-modal .limit-modal-container .limit-buttons .add-limit:disabled{cursor:not-allowed;opacity:0.4}.player-limit-modal .limit-modal-container .limit-buttons .add-limit .add-limit-mark{text-align:center;font-size:14px;fill:var(--emw--modal-font-color, #fff)}.player-limit-modal .limit-modal-container .limit-buttons .save-limit{cursor:pointer;border:1px solid var(--emw--color-primary, #ffe30c);background:var(--emw--color-primary, #ffe30c);width:150px;height:40px;border-radius:6px;color:var(--emw--color-black, black)}.player-limit-modal .limit-modal-container .limit-buttons .save-limit:disabled{cursor:not-allowed;opacity:0.4}.player-limit-modal .confirm-modal{background-color:rgba(0, 0, 0, 0.7);position:fixed;z-index:210;top:0;left:0;padding:0 10px;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.player-limit-modal .confirm-modal .confirm-modal-content{color:var(--emw--modal-font-color, #fff);padding:15px;padding-top:10px;box-sizing:padding-box;width:336px;overflow-y:auto;position:relative;border-radius:4px;background-color:var(--emw--color-modal-background, #353535)}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-title{font-size:16px;font-weight:500;margin-top:15px;margin-bottom:15px}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-buttons{display:flex;justify-content:space-around;align-items:center;gap:10px;margin-top:10px}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-buttons .confirm-limit-close{cursor:pointer;border:1px solid var(--emw--modal-font-color, #fff);width:150px;height:40px;background:transparent;border-radius:6px;color:var(--emw--modal-font-color, #fff)}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-buttons .confirm-limit-save{cursor:pointer;border:1px solid var(--emw--color-primary, #ffe30c);background:var(--emw--color-primary, #ffe30c);width:150px;height:40px;border-radius:6px;color:var(--emw--color-black, black)}';export{xl as P}
6657
+ `}static get is(){return"vaadin-tabs"}}x(_l);const xl=class{constructor(e){t(this,e),this.MATCH_CONFIG_AMOUNT=/^(\w+)\((\w+)\):(\d+)-(\d+)$/,this.MATCH_CONFIG_PERIOD=/^(\w+)\((\w+)\):([A-Z\-]+)$/,this.defaultPeriods=[h.DAILY,h.WEEKLY,h.MONTHLY],this.fetchSkipLimit=()=>{const t=new URL(`${this.endpoint}/api/pam/v1/player-notifications`);t.searchParams.append("createNotificationIfNotFound","true"),this.loading=!0,fetch(t,{headers:{"X-SessionId":this.session,"Content-Type":"application/json"},method:"PATCH",body:JSON.stringify({type:1,interval:5,ackNotification:!0,ackNotificationTimestamp:(new Date).toISOString()})}).then((t=>{if(t.ok)return t.json();throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:o("limitNotificationFail",this.language)}},window.location.href),new Error("Error while skipping the limit setting")})).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("setLimitSuccessful",this.language)}},window.location.href),window.postMessage({type:"SubmitLimitNotificationSuccess"},window.location.href)})).catch((t=>{console.error(t)})).finally((()=>{this.loading=!1}))},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.session=void 0,this.userid=void 0,this.language=void 0,this.endpoint=void 0,this.limitsamount=void 0,this.limitsperiods=void 0,this.currency=void 0,this.customcurrencysymbols=void 0,this.translationurl="",this.limitItems=[{}],this.limitTypeOptions=[],this.skipLimit=!1,this.loading=!1,this.confirmPopupVisibility=!1}get currencySymbolMap(){const t={};return this.customcurrencysymbols&&this.customcurrencysymbols.split(",").forEach((e=>{let i=e.split(":");t[i[0].trim()]=i[1].trim()})),Object.assign(Object.assign({},{EUR:"€",RON:" lei",USD:"$"}),t)}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&a(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&n(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&n(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))}async componentWillLoad(){var t;this.translationurl.length>2&&await(t=this.translationurl,new Promise((e=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{s[e]||(s[e]={});for(let i in t[e])s[e][i]=t[e][i]})),e(!0)}))}))),await this.parseLimitConfigs()}eventParamsToTranslationKeys(t){return`dataLayer-${t}`}emitGtag(t,e){"function"==typeof gtag&&gtag({event:t,limit_category:o(this.eventParamsToTranslationKeys(e.product.toLowerCase()),this.language)||e.product,limit_type:o(this.eventParamsToTranslationKeys(e.type.toLowerCase()))||e.type,limit_period:o(this.eventParamsToTranslationKeys(e.period),this.language)||e.period,limit_amount:e.amount})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}parsePeriodsConfig(t){const e=t.match(this.MATCH_CONFIG_PERIOD),i={D:"daily",W:"weekly",M:"monthly",N:"none"},s=[];if(e){const[,,,t]=e;t.split("-").forEach((t=>{if(!i[t])throw new Error(`Unknown period code: ${t}`);s.push(i[t])}))}return s}async parseLimitConfigs(){const t=this.limitsamount.replace(/\s/g,"").split("|"),e=this.limitsperiods.replace(/\s/g,"").split("|");if(0===t.length)throw new Error("Please provide a full limits configuration.");if(t.length!==e.length)throw new Error("Please make sure that the limit configuration parameters specify the same number of tabs.");try{for(let i=0;i<t.length;i++){const s=e[i],o=t[i].split(","),r=s.split(",");o.forEach(((t,e)=>{const i=t.match(this.MATCH_CONFIG_AMOUNT);if(i){const t=this.parsePeriodsConfig(r[e]),[,s,o,a,n]=i,l={type:o,product:s,min:parseInt(a,10),max:parseInt(n,10),label:`${c[o].title} - ${s}`,periodOptions:t,selectedKey:`${o}-${s}`};this.limitTypeOptions.push(l)}}))}}catch(t){throw new Error(`Error parsing limit config: ${t}`)}await this.filterExistingLimits(),this.limitTypeOptions=[...this.limitTypeOptions]}async filterExistingLimits(){try{const{sessionLimit:t,cumulativeSessionLimits:e,monetaryLimits:i}=await this.getLimits16();t&&(this.limitTypeOptions=this.limitTypeOptions.filter((t=>t.type===l.SESSION_LIMIT)));const s=new Map;i.forEach((t=>{var e;const i=`${null===(e=t.products)||void 0===e?void 0:e[0]}-${t.type}`.toLowerCase(),o=s.get(i)||new Set;o.add(t.period.toLowerCase()),s.set(i,o)})),this.limitTypeOptions=this.limitTypeOptions.map((t=>{const i=`${t.product}-${t.type}`.toLowerCase();let o=s.get(i)||new Set;t.type===l.CUMULATIVE_SESSION&&e&&(o=new Set(e.map((t=>t.period.toLowerCase()))));const r=t.periodOptions.filter((t=>!o.has(t)));return r.length>0?Object.assign(Object.assign({},t),{periodOptions:r}):null})).filter(Boolean)}catch(t){console.error("error getting limits",t)}}async getLimits16(){const t=this.limitTypeOptions.some((t=>t.type===l.SESSION_LIMIT||t.type===l.CUMULATIVE_SESSION)),e=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/monetary`),i={method:"GET",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"}},s=await fetch(e.href,i);if(s.status>=300)throw new Error("An error occured during the fetch request");const o=await s.json(),r=(null==o?void 0:o.limits)||[];let a=null,n=null;if(t){const t=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/session`),e=await fetch(t.href,i);if(e.status>=300)throw new Error("An error occured during the fetch request");const s=await e.json();a=null==s?void 0:s.sessionLimit,n=null==s?void 0:s.cumulativeSessionLimits}return{sessionLimit:a,cumulativeSessionLimits:n,monetaryLimits:r}}handleSelectLimitType(t,e){var i;const s=t.target.value,o=this.limitTypeOptions.find((t=>t.selectedKey===s));Object.assign(e,Object.assign(Object.assign({},o),{selectedKey:s,typeErrorMessage:null})),this.limitItems=[...this.limitItems],!this.isDisabledPeriod(e,e.period)&&(null===(i=e.periodOptions)||void 0===i?void 0:i.includes(e.period))||(e.period=null)}handleSelectLimitPeriod(t,e){Object.assign(e,{period:t,periodErrorMessage:null}),this.limitItems=[...this.limitItems]}isDisabledPeriod(t,e){return!!t.type&&this.limitItems.filter((e=>e!==t&&e.selectedKey===t.selectedKey)).some((t=>t.period===e))}validateSave(){if(this.skipLimit)return!0;let t=!0;return this.limitItems.forEach((e=>{var i;Object.assign(e,{amountErrorMessage:null,periodErrorMessage:null,typeErrorMessage:null}),e.amountErrorMessage=this.getAmountErrorMsg(e),e.period||(null===(i=e.periodOptions)||void 0===i?void 0:i.includes(h.NONE))||(e.periodErrorMessage=o("emptyPeriodWarning",this.language)),e.type||(e.typeErrorMessage=o("emptyLimitTypeWarning",this.language)),(e.amountErrorMessage||e.typeErrorMessage||e.periodErrorMessage)&&(t=!1)})),this.limitItems=[...this.limitItems],t}handleSaveLimit(){var t,e,i;if(this.validateSave())if(this.skipLimit){const s="number"==typeof(null===(t=this.limitItems[0])||void 0===t?void 0:t.amount)||(null===(e=this.limitItems[0])||void 0===e?void 0:e.period)||(null===(i=this.limitItems[0])||void 0===i?void 0:i.type);this.limitItems.length>1||s?this.doubleConfirmSkip():this.fetchSkipLimit()}else this.fetchUpdateLimit()}doubleConfirmSkip(){this.confirmPopupVisibility=!0}handleCloseConfirm(){this.confirmPopupVisibility=!1}handleSaveSkip(){this.handleCloseConfirm(),this.fetchSkipLimit()}async fetchUpdateLimit(){this.loading=!0;const t=[];this.limitItems.forEach((e=>{switch(e.type){case"lugas":t.push(this.createSubmitLimitCall(this.updateLugasCall,e));break;case"sessionLimit":t.push(this.createSubmitLimitCall(this.updateSingleSessionLimit16Call,e));break;case"cumulativeSession":t.push(this.createSubmitLimitCall(this.updateCumulativeSessionLimit16Call,e));break;default:t.push(this.createSubmitLimitCall(this.updateMonetaryLimits16Call,e))}}));const e=await Promise.allSettled(t.map((t=>t()))),i=e.filter((t=>"fulfilled"===t.status)),s=e.filter((t=>"rejected"===t.status));if(this.loading=!1,s.length!==t.length)return i.length===t.length?(window.postMessage({type:"WidgetNotification",data:{type:"success",message:o("setLimitSuccessful",this.language)}}),void window.postMessage({type:"SubmitLimitNotificationSuccess"},window.location.href)):void(s.length&&(window.postMessage({type:"WidgetNotification",data:{type:"info",config:{enableHtml:!0},message:o("partialFailedUpdateLimit",this.language,{values:{accountLimitPath:`/${this.language}/account/limits`}})}},window.location.href),window.postMessage({type:"SubmitLimitNotificationSuccess"},window.location.href)));window.postMessage({type:"WidgetNotification",data:{type:"error",message:o("limitNotificationFail",this.language)}},window.location.href)}createSubmitLimitCall(t,e){return async()=>{try{if((await t.bind(this)(e)).status>=300)throw new Error("An error occured during the fetch request");this.emitGtag("self_limitation_success",e)}catch(t){throw console.error("error while updating limit",t),new Error(`error while updating limit: ${t}`)}}}updateLugasCall(t){const e=new URL(`${this.endpoint}/v2/player/${this.userid}/limit/lugas`);let i={method:"POST",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({amount:t.amount,roleLimitAmount:0,softMigration:!1,keepLimit:!1})};return fetch(e.href,i)}updateSingleSessionLimit16Call(t){const e=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/session/`);let i={method:"PUT",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({sessionLimit:t.amount,sessionLimitUnit:"minute"})};return fetch(e.href,i)}capitalizeFirst(t){return t[0].toUpperCase()+t.substring(1)}updateCumulativeSessionLimit16Call(t){const e=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/session/`),i={cumulativeSessionLimits:[{period:this.capitalizeFirst(t.period),minutes:t.amount}]};let s={method:"PUT",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)};return fetch(e.href,s)}updateMonetaryLimits16Call(t){var e;const i=new URL(`${this.endpoint}/v1/player/${this.userid}/limits/monetary/`),s={amount:t.amount,currency:this.currency,period:this.capitalizeFirst(t.period),type:c[t.type].callValue16,products:[null!==(e=t.product)&&void 0!==e?e:"All"],walletTypes:["Deposit","NetDeposit"].includes(c[t.type].callValue16)?["All"]:["RealCash"]};let o={method:"POST",headers:{"X-SessionID":this.session,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(s)};return fetch(i.href,o)}handleBlockInputWheel(t){t.preventDefault()}handleSkipLimitChange(t){this.skipLimit=t.target.checked}handleAddLimit(){this.limitItems=[...this.limitItems,{}]}handleRemoveLimit(t){this.limitItems.splice(t,1),this.limitItems=[...this.limitItems]}handleInputLimitAmount(t,e){const i=Number(t.target.value);if("number"!=typeof i||Number.isNaN(i))return void(e.amountErrorMessage=o("invalidAmount",this.language));const s=Number.isInteger(i)?i:Math.round(i);e.amount=s,e.amountErrorMessage=this.getAmountErrorMsg(e),this.limitItems=[...this.limitItems]}getAmountErrorMsg(t){if("number"!=typeof t.amount||Number.isNaN(t.amount))return o("invalidAmount",this.language);let e=null;return t.amount<t.min&&(e=o("invalidInputMessageLimitMin",this.language,{values:{minValue:t.min,currency:this.currency}})),t.amount>t.max&&(e=o("invalidInputMessageLimitMax",this.language,{values:{maxValue:t.max,currency:this.currency}})),e}renderPeriodButtons(t){const s=t.periodOptions||this.defaultPeriods;return s.includes(h.NONE)?"":e(i,null,e("div",{class:"limit-item-period"},e("label",{class:"limit-period-label"},o("selectLimitPeriodLabel",this.language)),e("div",{class:"limit-period-wrapper"},s.map((i=>e("button",{class:`\n limit-period-option\n ${t.period===i?"selected":""}\n `,disabled:this.isDisabledPeriod(t,i),onClick:()=>this.handleSelectLimitPeriod(i,t)},o(i,this.language)))))),e("small",{class:"error-message"},t.periodErrorMessage))}render(){return e("div",{key:"e907bea0d1b02a7b789eca048e81d503a0ad86db",class:"player-limit-modal",ref:t=>this.stylingContainer=t},e("section",{key:"cdb971abe4fa4a2057fab98ecd807911ea0c8543",class:"limit-modal-container"},e("div",{key:"c2ce6f6d70ff1dea8c9029e3a11c11c6ee63e958",class:"limit-modal-title"},e("h2",{key:"ec32ab8cd35c99368e8a96987ebfe52114688f73"},o("limitNotificationTitle",this.language)),e("p",{key:"2267e8b1ee037b4ea465a9ee4f7a9795bc5222af"},o("limitNotificationSubTitle",this.language))),e("div",{key:"0d12dde0ed543c620f5548f7edecbf85cd799008",class:"limit-modal-content "+(this.skipLimit||this.loading?"disable-content":"")},this.limitItems.map(((t,i)=>e("div",{class:"limit-item"},e("div",{class:"limit-item-type"},e("label",{class:"type-select-label"},o("selectLimitTypeLabel",this.language)),e("div",null,e("vaadin-combo-box",{value:t.selectedKey,items:this.limitTypeOptions,"no-vertical-overlap":!0,"item-label-path":"label","item-value-path":"selectedKey",placeholder:o("selectLimitTypePlaceholder",this.language),onChange:e=>this.handleSelectLimitType(e,t)})),e("small",{class:"error-message"},t.typeErrorMessage)),this.renderPeriodButtons(t),e("div",{class:"limit-item-amount"},e("div",{class:"amount-input"},e("label",{class:"amount-input-label"},o("limitNotificationAmountLabel",this.language)),e("div",{class:"amount-input-wrapper"},e("div",{class:"amount-input-content"},e("input",{class:"amount-input-inner",type:"number",pattern:"[0-9]*",value:t.amount,onWheel:this.handleBlockInputWheel,onInput:e=>this.handleInputLimitAmount(e,t)}),e("span",{class:"amount-input-suffix"},e("i",null,this.currencySymbolMap[this.currency]))),e("button",{onClick:()=>this.handleRemoveLimit(i),class:"remove-limit-button"},e("svg",{width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M3 18C2.45 18 1.97934 17.8043 1.588 17.413C1.19667 17.0217 1.00067 16.5507 1 16V3C0.71667 3 0.479337 2.904 0.288004 2.712C0.0966702 2.52 0.000670115 2.28267 3.44827e-06 2C-0.000663218 1.71733 0.0953369 1.48 0.288004 1.288C0.48067 1.096 0.718003 1 1 1H5C5 0.716667 5.096 0.479333 5.288 0.288C5.48 0.0966668 5.71734 0.000666667 6 0H10C10.2833 0 10.521 0.0960001 10.713 0.288C10.905 0.48 11.0007 0.717333 11 1H15C15.2833 1 15.521 1.096 15.713 1.288C15.905 1.48 16.0007 1.71733 16 2C15.9993 2.28267 15.9033 2.52033 15.712 2.713C15.5207 2.90567 15.2833 3.00133 15 3V16C15 16.55 14.8043 17.021 14.413 17.413C14.0217 17.805 13.5507 18.0007 13 18H3ZM6 14C6.28334 14 6.521 13.904 6.713 13.712C6.905 13.52 7.00067 13.2827 7 13V6C7 5.71667 6.904 5.47933 6.712 5.288C6.52 5.09667 6.28267 5.00067 6 5C5.71734 4.99933 5.48 5.09533 5.288 5.288C5.096 5.48067 5 5.718 5 6V13C5 13.2833 5.096 13.521 5.288 13.713C5.48 13.905 5.71734 14.0007 6 14ZM10 14C10.2833 14 10.521 13.904 10.713 13.712C10.905 13.52 11.0007 13.2827 11 13V6C11 5.71667 10.904 5.47933 10.712 5.288C10.52 5.09667 10.2827 5.00067 10 5C9.71734 4.99933 9.48 5.09533 9.288 5.288C9.096 5.48067 9 5.718 9 6V13C9 13.2833 9.096 13.521 9.288 13.713C9.48 13.905 9.71734 14.0007 10 14Z"})))))),e("small",{class:"error-message"},t.amountErrorMessage))))),e("div",{key:"eeaef4d6a7e8429a850e66e1ffd73a0d71f90a6e",class:"checkbox-container"},e("label",{key:"f76e4ed26b72fb7a70ccb5ddccdd1abafd9578a2"},e("span",{key:"a6c1adf2b0cb8619f635ef839295977072f09186",class:"custom-checkbox"},e("input",{key:"5a214509f0ab2f91da812f651d0eea9967359a35",disabled:this.loading,onChange:t=>this.handleSkipLimitChange(t),type:"checkbox",class:"checkbox-original"}),e("span",{key:"71c77085cbbafba14cbdcd74df35f245d2dfe2ac",class:"checkbox-custom"})),e("span",{key:"463b2bc90b6f88789babf99f37da8d216e48ce9e",class:"checkbox-label"},o("skipLimitLimitDescription",this.language)))),e("div",{key:"8a92743753704aa756cd89416b22a38d373aa01a",class:"limit-buttons"},e("button",{key:"4374f39ee73bd0ea1e57658f0ff0a5160f9c0aac",class:"add-limit",disabled:this.skipLimit||this.loading,onClick:()=>this.handleAddLimit()},e("svg",{key:"4484225e22b062aac67f469c224c81247971bfef",class:"add-limit-mark",width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"52f8ef1656f4dd2af073a5f4bfee272d9775c0ac",d:"M13 8H8V13C8 13.2652 7.89464 13.5196 7.70711 13.7071C7.51957 13.8946 7.26522 14 7 14C6.73478 14 6.48043 13.8946 6.29289 13.7071C6.10536 13.5196 6 13.2652 6 13V8H1C0.734784 8 0.48043 7.89464 0.292893 7.70711C0.105357 7.51957 0 7.26522 0 7C0 6.73478 0.105357 6.48043 0.292893 6.29289C0.48043 6.10536 0.734784 6 1 6H6V1C6 0.734784 6.10536 0.480429 6.29289 0.292893C6.48043 0.105357 6.73478 0 7 0C7.26522 0 7.51957 0.105357 7.70711 0.292893C7.89464 0.480429 8 0.734784 8 1V6H13C13.2652 6 13.5196 6.10536 13.7071 6.29289C13.8946 6.48043 14 6.73478 14 7C14 7.26522 13.8946 7.51957 13.7071 7.70711C13.5196 7.89464 13.2652 8 13 8Z"})),e("span",{key:"0bc916f56e50700529bee96436f7ca355433881b"},o("addLimitType",this.language))),e("button",{key:"605934d7491c89a3685de636a0cae4f7803932e6",class:"save-limit",disabled:this.loading,onClick:()=>this.handleSaveLimit()},o("savePlayerLimit",this.language)))),this.confirmPopupVisibility?e("section",{class:"confirm-modal"},e("div",{class:"confirm-modal-content"},e("h2",{class:"confirm-modal-title"},o("limitNotificationTitle",this.language)),e("p",null,o("confirmLimitNotification",this.language)),e("div",{class:"confirm-modal-buttons"},e("button",{class:"confirm-limit-close",onClick:()=>this.handleCloseConfirm()},o("confirmLimitClose",this.language)),e("button",{class:"confirm-limit-save",onClick:()=>this.handleSaveSkip()},o("confirmLimitSave",this.language))))):null)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};xl.style='@charset "UTF-8";*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}:host{--vaadin-input-field-invalid-hover-highlight:transparent;--vaadin-input-field-label-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-background:var(--emw--modal-input-bg, #4f4f4f);--vaadin-input-field-hovered-label-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-value-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-focused-label-color:var(--emw--modal-label-color, #ababab);--vaadin-input-field-placeholder-color:var(--emw--modal-label-color, #ababab)}vaadin-combo-box{border:none;width:100%;background-color:transparent}vaadin-combo-box::part(input-field){padding-left:15px;height:40px}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.type-select-label,.limit-period-label,.amount-input-label{display:inline-block;font-size:14px;color:var(--emw--modal-label-color, #ababab);margin:0;padding-bottom:8px;font-weight:400}.player-limit-modal{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:200;top:0;left:0;padding:0 10px;background-color:rgba(0, 0, 0, 0.7)}.player-limit-modal .limit-modal-container{color:var(--emw--modal-font-color, #fff);padding:15px;max-width:700px;min-width:300px;max-height:90vh;overflow-y:auto;position:relative;min-height:200px;border-radius:4px;background-color:var(--emw--color-modal-background, #353535)}.player-limit-modal .limit-modal-container .limit-modal-content.disable-content{pointer-events:none;cursor:not-allowed;opacity:0.4}.player-limit-modal .limit-modal-container .error-message{display:block;color:var(--emw--color-error, red);min-height:16px}.player-limit-modal .limit-modal-container .limit-modal-title h2{font-size:16px;font-weight:500;margin-top:15px;margin-bottom:15px}.player-limit-modal .limit-modal-container .limit-item:nth-of-type(1) .remove-limit-button{display:none}.player-limit-modal .limit-modal-container .limit-item:not(:nth-of-type(1)){padding:9px;margin:14px 0;border-radius:6px;border:1px solid #6a6a6a}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper{display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:4px}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper .limit-period-option{flex-grow:1;border:1px solid transparent;cursor:pointer;background:var(--emw--modal-input-bg, #4f4f4f);width:100px;height:40px;font-size:14px;border-radius:4px;color:var(--emw--modal-font-color, #fff);transition:0.5s}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper .limit-period-option:disabled{cursor:not-allowed;opacity:0.4}.player-limit-modal .limit-modal-container .limit-item-period .limit-period-wrapper .limit-period-option.selected{border-color:var(--emw--color-primary, #ffe30c)}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-wrapper{display:flex;flex-wrap:nowrap}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content{position:relative;flex:1;margin-right:6px}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content .amount-input-inner{padding-right:30px;padding-left:15px;outline:none;border:none;height:40px;color:var(--emw--modal-label-color, #ababab);background-color:var(--emw--modal-input-bg, #4f4f4f);width:100%;border-radius:4px}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content .amount-input-suffix{width:20px;height:20px;background-color:var(--emw--modal-label-color, #ababab);border-radius:50%;position:absolute;right:0px;transform:translate(-50%, -50%);top:50%;text-align:center;pointer-events:none}.player-limit-modal .limit-modal-container .limit-item-amount .amount-input .amount-input-content .amount-input-suffix i{color:var(--emw--modal-input-bg, #4f4f4f)}.player-limit-modal .limit-modal-container .limit-item-amount .remove-limit-button{width:40px;height:40px;border:none;border-radius:4px;cursor:pointer;background-color:color-mix(in srgb, var(--emw--color-primary, #ffe30c) 20%, transparent 80%);transition:2s}.player-limit-modal .limit-modal-container .limit-item-amount .remove-limit-button:hover{background-color:color-mix(in srgb, var(--emw--color-primary, #ffe30c) 50%, white 50%)}.player-limit-modal .limit-modal-container .limit-item-amount .remove-limit-button svg{fill:var(--emw--color-primary, #ffe30c)}.player-limit-modal .limit-modal-container .checkbox-container label{display:flex;align-items:center;gap:6px}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-original{opacity:0;width:0;height:0;z-index:-1;position:absolute}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-original:checked+.checkbox-custom::after{opacity:1}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-custom{display:inline-block;width:18px;height:18px;background:var(--emw--modal-input-bg, #4f4f4f);border-radius:3px;position:relative;transition:0.2s}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-custom::after{content:"✔";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);color:var(--emw--modal-font-color, #fff);font-size:12px;opacity:0;transition:opacity 0.2s}.player-limit-modal .limit-modal-container .checkbox-container .checkbox-label{color:var(--emw--modal-label-color, #ababab);font-size:14px;cursor:pointer;user-select:none}.player-limit-modal .limit-modal-container .limit-buttons{display:flex;justify-content:space-around;align-items:center;gap:10px;margin-top:10px}.player-limit-modal .limit-modal-container .limit-buttons .add-limit{display:inline-flex;align-items:center;justify-content:center;gap:5px;cursor:pointer;border:1px solid var(--emw--modal-font-color, #fff);width:150px;height:40px;background:transparent;border-radius:6px;color:var(--emw--modal-font-color, #fff)}.player-limit-modal .limit-modal-container .limit-buttons .add-limit:disabled{cursor:not-allowed;opacity:0.4}.player-limit-modal .limit-modal-container .limit-buttons .add-limit .add-limit-mark{text-align:center;font-size:14px;fill:var(--emw--modal-font-color, #fff)}.player-limit-modal .limit-modal-container .limit-buttons .save-limit{cursor:pointer;border:1px solid var(--emw--color-primary, #ffe30c);background:var(--emw--color-primary, #ffe30c);width:150px;height:40px;border-radius:6px;color:var(--emw--color-black, black)}.player-limit-modal .limit-modal-container .limit-buttons .save-limit:disabled{cursor:not-allowed;opacity:0.4}.player-limit-modal .confirm-modal{background-color:rgba(0, 0, 0, 0.7);position:fixed;z-index:210;top:0;left:0;padding:0 10px;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.player-limit-modal .confirm-modal .confirm-modal-content{color:var(--emw--modal-font-color, #fff);padding:15px;padding-top:10px;box-sizing:padding-box;width:336px;overflow-y:auto;position:relative;border-radius:4px;background-color:var(--emw--color-modal-background, #353535)}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-title{font-size:16px;font-weight:500;margin-top:15px;margin-bottom:15px}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-buttons{display:flex;justify-content:space-around;align-items:center;gap:10px;margin-top:10px}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-buttons .confirm-limit-close{cursor:pointer;border:1px solid var(--emw--modal-font-color, #fff);width:150px;height:40px;background:transparent;border-radius:6px;color:var(--emw--modal-font-color, #fff)}.player-limit-modal .confirm-modal .confirm-modal-content .confirm-modal-buttons .confirm-limit-save{cursor:pointer;border:1px solid var(--emw--color-primary, #ffe30c);background:var(--emw--color-primary, #ffe30c);width:150px;height:40px;border-radius:6px;color:var(--emw--color-black, black)}';export{xl as P}
@@ -1 +1 @@
1
- export{P as player_limit_notification_nd}from"./player-limit-notification-nd-c9cf02e4.js";import"./index-92f4161f.js";
1
+ export{P as player_limit_notification_nd}from"./player-limit-notification-nd-f1195ebc.js";import"./index-92f4161f.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-limit-notification-nd",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",