@everymatrix/player-elevate-level 1.94.37 → 1.94.38

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.
@@ -185,7 +185,7 @@ var MOVE_TO;
185
185
  MOVE_TO[MOVE_TO["slideToLeft"] = -1] = "slideToLeft";
186
186
  })(MOVE_TO || (MOVE_TO = {}));
187
187
 
188
- const elevateLevelListCss = "elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";
188
+ const elevateLevelListCss = "elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}.LevelItems.Mobile.SingleItem{left:0 !important;width:100%;display:flex;justify-content:center;flex-wrap:nowrap;padding:0}.LevelItems.Mobile.SingleItem .Item{flex-grow:0;flex-shrink:0}";
189
189
  const ElevateLevelListStyle0 = elevateLevelListCss;
190
190
 
191
191
  const ElevateLevelList = class {
@@ -202,51 +202,189 @@ const ElevateLevelList = class {
202
202
  this.touchPosEnd = undefined;
203
203
  this.offset = 0;
204
204
  }
205
+ centerLevelItem(index) {
206
+ if (!this.isMobile ||
207
+ !this.levelsElement ||
208
+ index < 0 ||
209
+ !this.levelsElement.children[index]) {
210
+ return;
211
+ }
212
+ const wrapper = this.levelsElement.parentElement;
213
+ if (!wrapper) {
214
+ return;
215
+ }
216
+ const item = this.levelsElement.children[index];
217
+ const wrapperWidth = wrapper.clientWidth;
218
+ const contentWidth = this.levelsElement.scrollWidth;
219
+ const minOffset = Math.min(0, wrapperWidth - contentWidth);
220
+ const itemLeft = item.offsetLeft;
221
+ const itemWidth = item.offsetWidth;
222
+ let newOffset = wrapperWidth / 2 - (itemLeft + itemWidth / 2);
223
+ newOffset = newOffset < minOffset
224
+ ? minOffset
225
+ : newOffset > 0
226
+ ? 0
227
+ : newOffset;
228
+ this.minOffset = minOffset;
229
+ this.offset = newOffset;
230
+ }
231
+ moveToLevelItem(index, centerItem = false) {
232
+ if (!this.levelsElement ||
233
+ index < 0 ||
234
+ !this.levelsElement.children[index]) {
235
+ return;
236
+ }
237
+ const wrapper = this.levelsElement.parentElement;
238
+ if (!wrapper) {
239
+ return;
240
+ }
241
+ const item = this.levelsElement.children[index];
242
+ const wrapperWidth = wrapper.clientWidth;
243
+ const contentWidth = this.isMobile
244
+ ? this.levelsElement.scrollWidth
245
+ : this.levelsElement.clientWidth;
246
+ const minOffset = Math.min(0, wrapperWidth - contentWidth);
247
+ if (contentWidth <= wrapperWidth) {
248
+ this.minOffset = 0;
249
+ this.offset = 0;
250
+ return;
251
+ }
252
+ const itemLeft = item.offsetLeft;
253
+ const itemWidth = item.offsetWidth;
254
+ let newOffset;
255
+ if (centerItem) {
256
+ newOffset = wrapperWidth / 2 - (itemLeft + itemWidth / 2);
257
+ }
258
+ else {
259
+ const currentLeft = -this.offset;
260
+ const currentRight = currentLeft + wrapperWidth;
261
+ const itemRight = itemLeft + itemWidth;
262
+ if (itemLeft >= currentLeft && itemRight <= currentRight) {
263
+ return;
264
+ }
265
+ newOffset = itemLeft < currentLeft
266
+ ? -itemLeft
267
+ : wrapperWidth - itemRight;
268
+ }
269
+ newOffset = newOffset < minOffset
270
+ ? minOffset
271
+ : newOffset > 0
272
+ ? 0
273
+ : newOffset;
274
+ this.minOffset = minOffset;
275
+ this.offset = newOffset;
276
+ }
205
277
  onLevelClicked(elevateLevel) {
278
+ var _a, _b;
206
279
  this.selectedLevelChanged.emit({ level: elevateLevel });
207
280
  this.selectedLevelId = elevateLevel.id;
281
+ if (this.isMobile) {
282
+ const levelIndex = (_b = (_a = this.levels) === null || _a === void 0 ? void 0 : _a.findIndex((level) => level.id === elevateLevel.id)) !== null && _b !== void 0 ? _b : -1;
283
+ requestAnimationFrame(() => {
284
+ this.centerLevelItem(levelIndex);
285
+ });
286
+ }
208
287
  }
209
288
  levelsChangedHandler() {
210
289
  this.initOffsetOfLevelItems();
211
290
  }
212
291
  initOffsetOfLevelItems() {
213
- if (!this.levels || this.levels.length == 0 || !this.selectedLevelId) {
292
+ if (!this.levels || this.levels.length === 0 || !this.selectedLevelId) {
214
293
  return;
215
294
  }
216
295
  const currentLevelIndex = this.levels.findIndex((item) => {
217
- return this.selectedLevelId == item.id;
296
+ return this.selectedLevelId === item.id;
218
297
  });
219
- this.onLevelClicked(this.levels[currentLevelIndex == -1 ? 0 : currentLevelIndex]);
220
- //do not need change the slider offset when level items less than moveCountForOneTouch
221
- if (this.levels.length <= this.moveCountForOneTouch) {
298
+ if (currentLevelIndex === -1 && this.levels[0]) {
299
+ this.selectedLevelId = this.levels[0].id;
222
300
  return;
223
301
  }
224
- //to avoid the slider do not move when currentLevelIndex = moveCountForOneTouch - 1
225
- let newOffset = Math.floor((currentLevelIndex == -1 ? 1 : currentLevelIndex + 1) / this.moveCountForOneTouch)
226
- * this.moveCountForOneTouch * this.childElementWidth * (-1);
227
- this.offset = newOffset <= this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
302
+ if (this.levels.length <= 1) {
303
+ this.offset = 0;
304
+ return;
305
+ }
306
+ const targetIndex = currentLevelIndex === -1 ? 0 : currentLevelIndex;
307
+ requestAnimationFrame(() => {
308
+ var _a;
309
+ if (this.isMobile) {
310
+ this.moveToLevelItem(targetIndex, true);
311
+ return;
312
+ }
313
+ const wrapper = (_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.parentElement;
314
+ if (!wrapper || !this.levelsElement) {
315
+ return;
316
+ }
317
+ const wrapperWidth = wrapper.clientWidth;
318
+ const contentWidth = this.levelsElement.clientWidth;
319
+ if (contentWidth <= wrapperWidth) {
320
+ this.offset = 0;
321
+ this.minOffset = 0;
322
+ return;
323
+ }
324
+ // Desktop carousel
325
+ this.moveToLevelItem(targetIndex, false);
326
+ });
228
327
  }
229
328
  onTouchStart(e) {
230
- this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
329
+ if (!this.isMobile) {
330
+ return;
331
+ }
332
+ this.touchPosStart = {
333
+ clientX: e.touches[0].clientX,
334
+ clientY: e.touches[0].clientY
335
+ };
336
+ this.touchPosEnd = this.touchPosStart;
231
337
  }
232
338
  onTouchMove(e) {
233
- this.touchPosEnd = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
339
+ if (!this.isMobile) {
340
+ return;
341
+ }
342
+ this.touchPosEnd = {
343
+ clientX: e.touches[0].clientX,
344
+ clientY: e.touches[0].clientY
345
+ };
346
+ }
347
+ onTouchEnd() {
348
+ if (!this.isMobile || !this.touchPosStart || !this.touchPosEnd || !this.levels || this.levels.length <= 1) {
349
+ return;
350
+ }
234
351
  const diffX = this.touchPosEnd.clientX - this.touchPosStart.clientX;
235
352
  const diffY = this.touchPosEnd.clientY - this.touchPosStart.clientY;
236
- if (Math.abs(diffX) > Math.abs(diffY)) {
237
- this.slideTo(diffX > 0 ? MOVE_TO.slideToRight : MOVE_TO.slideToLeft);
353
+ const threshold = 30;
354
+ if (Math.abs(diffX) <= threshold || Math.abs(diffX) <= Math.abs(diffY)) {
355
+ return;
356
+ }
357
+ if (diffX > 0) {
358
+ // Move right, Go to previous item
359
+ this.slideTo(MOVE_TO.slideToRight);
360
+ }
361
+ else {
362
+ // Move left, Go to next item
363
+ this.slideTo(MOVE_TO.slideToLeft);
238
364
  }
239
365
  }
240
366
  slideTo(direction) {
241
- let newOffset = this.levelsElement.offsetLeft +
242
- (this.childElementWidth) * this.moveCountForOneTouch * direction;
243
- if (newOffset % this.childElementWidth != 0) {
244
- const leftOfPreNode = (Math.floor(newOffset / this.childElementWidth)) * this.childElementWidth;
245
- const leftOfNextNode = (Math.ceil(newOffset / this.childElementWidth)) * this.childElementWidth;
246
- //touchmove to right, get left of pre-node; touchmove to left, get left of next-node
247
- newOffset = direction == MOVE_TO.slideToRight ? leftOfPreNode : leftOfNextNode;
367
+ if (!this.levelsElement || !this.childElementWidth || !this.moveCountForOneTouch || this.levelsElement.childElementCount <= 1) {
368
+ this.offset = 0;
369
+ return;
370
+ }
371
+ const currentOffset = this.isMobile
372
+ ? this.offset
373
+ : this.levelsElement.offsetLeft;
374
+ let newOffset = currentOffset +
375
+ this.childElementWidth * this.moveCountForOneTouch * direction;
376
+ if (newOffset % this.childElementWidth !== 0) {
377
+ const leftOfPreNode = Math.floor(newOffset / this.childElementWidth) * this.childElementWidth;
378
+ const leftOfNextNode = Math.ceil(newOffset / this.childElementWidth) * this.childElementWidth;
379
+ newOffset = direction === MOVE_TO.slideToRight
380
+ ? leftOfPreNode
381
+ : leftOfNextNode;
248
382
  }
249
- this.offset = newOffset < this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
383
+ this.offset = newOffset < this.minOffset
384
+ ? this.minOffset
385
+ : newOffset >= 0
386
+ ? 0
387
+ : newOffset;
250
388
  }
251
389
  initLevelSlider() {
252
390
  var _a;
@@ -254,12 +392,34 @@ const ElevateLevelList = class {
254
392
  console.log('Widget[elevate-level-list] DOM is not ready.');
255
393
  return;
256
394
  }
257
- this.showSliderButton = !this.isMobile && (this.levelsElement.clientWidth > this.levelsElement.parentElement.clientWidth);
258
- this.minOffset = this.levelsElement.parentElement.clientWidth - this.levelsElement.clientWidth;
259
- this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
260
- this.moveCountForOneTouch = Math.ceil(this.levelsElement.parentElement.clientWidth / this.childElementWidth) - 1;
395
+ const wrapperWidth = this.levelsElement.parentElement.clientWidth;
396
+ // Desktop, Use clientWidth
397
+ // Mobile, Use scrollWidth
398
+ const contentWidth = this.isMobile
399
+ ? this.levelsElement.scrollWidth
400
+ : this.levelsElement.clientWidth;
261
401
  const childElementCount = this.levelsElement.childElementCount;
262
- this.childElementWidth += (this.levelsElement.clientWidth - this.childElementWidth * childElementCount) / (childElementCount - 1);
402
+ // If childElementCount === 0 or 1, No carousel
403
+ if (childElementCount <= 1) {
404
+ this.showSliderButton = false;
405
+ this.minOffset = 0;
406
+ this.offset = 0;
407
+ this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
408
+ this.moveCountForOneTouch = 1;
409
+ return;
410
+ }
411
+ // keep original logic for desktop
412
+ this.showSliderButton =
413
+ !this.isMobile &&
414
+ this.levelsElement.clientWidth > wrapperWidth;
415
+ this.minOffset = wrapperWidth - contentWidth;
416
+ this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
417
+ if (childElementCount > 1) {
418
+ const gap = (contentWidth - this.childElementWidth * childElementCount) /
419
+ (childElementCount - 1);
420
+ this.childElementWidth += gap;
421
+ }
422
+ this.moveCountForOneTouch = Math.max(1, Math.ceil(wrapperWidth / this.childElementWidth) - 1);
263
423
  }
264
424
  debounce(callback, delay) {
265
425
  {
@@ -291,12 +451,13 @@ const ElevateLevelList = class {
291
451
  });
292
452
  }
293
453
  render() {
294
- return (index.h(index.Host, { key: 'c2eb983ff3df4868204eec8e527efa08c9e5afa0' }, this.levels && [
295
- index.h("div", { key: '9f6563c030a7725761b9a73cffb8e2d8d8f47c32', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, index.h("svg", { key: '9e3d3422bd2171d26821c1f74e3ab7418b97643d', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: 'ac0002e40e037edd0c0893c9250f36e18e451f16', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
296
- index.h("div", { key: '242903f38deb464844d722e0e7fe90665de99d6a', class: 'LevelItemsWrapper' }, index.h("div", { key: '739328ff99ecd777b9e2ff6914034a5bbc7eac90', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
454
+ var _a;
455
+ return (index.h(index.Host, { key: '780e54c101e1dd10513f959b08e3b7425ebba3ec' }, this.levels && [
456
+ index.h("div", { key: '70e7265746f1cb4788d137c43b9addf1443a6ae3', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, index.h("svg", { key: '20184f3e02bebe818f5119b9b71105a1d7e11681', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '351e4a93e390f430045642692b585867e9569b6a', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
457
+ index.h("div", { key: 'd21722ad058c4e83d23dfaa6822850557de4e620', class: 'LevelItemsWrapper' }, index.h("div", { key: '03dccfd305222e9e4eb53277efeef43711f3b664', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''} ${this.isMobile && ((_a = this.levels) === null || _a === void 0 ? void 0 : _a.length) === 1 ? 'SingleItem' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
297
458
  return (index.h("div", { class: `Item ${this.selectedLevelId == level.id ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, index.h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), index.h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), index.h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', this.convertNumberToCompactForm(level.firstEntryPoints), ' ', translate('points', this.language))));
298
459
  }))),
299
- index.h("div", { key: '2366c09b46bfec309bd4f8d5991d457f04dbf038', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, index.h("svg", { key: 'c52ef4f99444d1185e9b8ce4287f0f2886c622ae', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: 'acc266646133bb636b52f8776380e6aedc93f937', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
460
+ index.h("div", { key: '6fe81dc6338a8dc29e2a9dc7aedcbdb618660c82', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, index.h("svg", { key: '26e11511a54ac6d43fab18d39f0483f86af470cf', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '6f3d02eb56c674a82a008022b0f8304a9c4bd72f', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
300
461
  ]));
301
462
  }
302
463
  get host() { return index.getElement(this); }
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["bonus-elevate-levels_8.cjs",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card.cjs",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard.cjs",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card.cjs",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
11
+ return index.bootstrapLazy([["bonus-elevate-levels_8.cjs",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card.cjs",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard.cjs",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card.cjs",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["bonus-elevate-levels_8.cjs",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card.cjs",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard.cjs",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card.cjs",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
22
+ return index.bootstrapLazy([["bonus-elevate-levels_8.cjs",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card.cjs",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard.cjs",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card.cjs",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -181,7 +181,7 @@ var MOVE_TO;
181
181
  MOVE_TO[MOVE_TO["slideToLeft"] = -1] = "slideToLeft";
182
182
  })(MOVE_TO || (MOVE_TO = {}));
183
183
 
184
- const elevateLevelListCss = "elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";
184
+ const elevateLevelListCss = "elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}.LevelItems.Mobile.SingleItem{left:0 !important;width:100%;display:flex;justify-content:center;flex-wrap:nowrap;padding:0}.LevelItems.Mobile.SingleItem .Item{flex-grow:0;flex-shrink:0}";
185
185
  const ElevateLevelListStyle0 = elevateLevelListCss;
186
186
 
187
187
  const ElevateLevelList = class {
@@ -198,51 +198,189 @@ const ElevateLevelList = class {
198
198
  this.touchPosEnd = undefined;
199
199
  this.offset = 0;
200
200
  }
201
+ centerLevelItem(index) {
202
+ if (!this.isMobile ||
203
+ !this.levelsElement ||
204
+ index < 0 ||
205
+ !this.levelsElement.children[index]) {
206
+ return;
207
+ }
208
+ const wrapper = this.levelsElement.parentElement;
209
+ if (!wrapper) {
210
+ return;
211
+ }
212
+ const item = this.levelsElement.children[index];
213
+ const wrapperWidth = wrapper.clientWidth;
214
+ const contentWidth = this.levelsElement.scrollWidth;
215
+ const minOffset = Math.min(0, wrapperWidth - contentWidth);
216
+ const itemLeft = item.offsetLeft;
217
+ const itemWidth = item.offsetWidth;
218
+ let newOffset = wrapperWidth / 2 - (itemLeft + itemWidth / 2);
219
+ newOffset = newOffset < minOffset
220
+ ? minOffset
221
+ : newOffset > 0
222
+ ? 0
223
+ : newOffset;
224
+ this.minOffset = minOffset;
225
+ this.offset = newOffset;
226
+ }
227
+ moveToLevelItem(index, centerItem = false) {
228
+ if (!this.levelsElement ||
229
+ index < 0 ||
230
+ !this.levelsElement.children[index]) {
231
+ return;
232
+ }
233
+ const wrapper = this.levelsElement.parentElement;
234
+ if (!wrapper) {
235
+ return;
236
+ }
237
+ const item = this.levelsElement.children[index];
238
+ const wrapperWidth = wrapper.clientWidth;
239
+ const contentWidth = this.isMobile
240
+ ? this.levelsElement.scrollWidth
241
+ : this.levelsElement.clientWidth;
242
+ const minOffset = Math.min(0, wrapperWidth - contentWidth);
243
+ if (contentWidth <= wrapperWidth) {
244
+ this.minOffset = 0;
245
+ this.offset = 0;
246
+ return;
247
+ }
248
+ const itemLeft = item.offsetLeft;
249
+ const itemWidth = item.offsetWidth;
250
+ let newOffset;
251
+ if (centerItem) {
252
+ newOffset = wrapperWidth / 2 - (itemLeft + itemWidth / 2);
253
+ }
254
+ else {
255
+ const currentLeft = -this.offset;
256
+ const currentRight = currentLeft + wrapperWidth;
257
+ const itemRight = itemLeft + itemWidth;
258
+ if (itemLeft >= currentLeft && itemRight <= currentRight) {
259
+ return;
260
+ }
261
+ newOffset = itemLeft < currentLeft
262
+ ? -itemLeft
263
+ : wrapperWidth - itemRight;
264
+ }
265
+ newOffset = newOffset < minOffset
266
+ ? minOffset
267
+ : newOffset > 0
268
+ ? 0
269
+ : newOffset;
270
+ this.minOffset = minOffset;
271
+ this.offset = newOffset;
272
+ }
201
273
  onLevelClicked(elevateLevel) {
274
+ var _a, _b;
202
275
  this.selectedLevelChanged.emit({ level: elevateLevel });
203
276
  this.selectedLevelId = elevateLevel.id;
277
+ if (this.isMobile) {
278
+ const levelIndex = (_b = (_a = this.levels) === null || _a === void 0 ? void 0 : _a.findIndex((level) => level.id === elevateLevel.id)) !== null && _b !== void 0 ? _b : -1;
279
+ requestAnimationFrame(() => {
280
+ this.centerLevelItem(levelIndex);
281
+ });
282
+ }
204
283
  }
205
284
  levelsChangedHandler() {
206
285
  this.initOffsetOfLevelItems();
207
286
  }
208
287
  initOffsetOfLevelItems() {
209
- if (!this.levels || this.levels.length == 0 || !this.selectedLevelId) {
288
+ if (!this.levels || this.levels.length === 0 || !this.selectedLevelId) {
210
289
  return;
211
290
  }
212
291
  const currentLevelIndex = this.levels.findIndex((item) => {
213
- return this.selectedLevelId == item.id;
292
+ return this.selectedLevelId === item.id;
214
293
  });
215
- this.onLevelClicked(this.levels[currentLevelIndex == -1 ? 0 : currentLevelIndex]);
216
- //do not need change the slider offset when level items less than moveCountForOneTouch
217
- if (this.levels.length <= this.moveCountForOneTouch) {
294
+ if (currentLevelIndex === -1 && this.levels[0]) {
295
+ this.selectedLevelId = this.levels[0].id;
218
296
  return;
219
297
  }
220
- //to avoid the slider do not move when currentLevelIndex = moveCountForOneTouch - 1
221
- let newOffset = Math.floor((currentLevelIndex == -1 ? 1 : currentLevelIndex + 1) / this.moveCountForOneTouch)
222
- * this.moveCountForOneTouch * this.childElementWidth * (-1);
223
- this.offset = newOffset <= this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
298
+ if (this.levels.length <= 1) {
299
+ this.offset = 0;
300
+ return;
301
+ }
302
+ const targetIndex = currentLevelIndex === -1 ? 0 : currentLevelIndex;
303
+ requestAnimationFrame(() => {
304
+ var _a;
305
+ if (this.isMobile) {
306
+ this.moveToLevelItem(targetIndex, true);
307
+ return;
308
+ }
309
+ const wrapper = (_a = this.levelsElement) === null || _a === void 0 ? void 0 : _a.parentElement;
310
+ if (!wrapper || !this.levelsElement) {
311
+ return;
312
+ }
313
+ const wrapperWidth = wrapper.clientWidth;
314
+ const contentWidth = this.levelsElement.clientWidth;
315
+ if (contentWidth <= wrapperWidth) {
316
+ this.offset = 0;
317
+ this.minOffset = 0;
318
+ return;
319
+ }
320
+ // Desktop carousel
321
+ this.moveToLevelItem(targetIndex, false);
322
+ });
224
323
  }
225
324
  onTouchStart(e) {
226
- this.touchPosStart = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
325
+ if (!this.isMobile) {
326
+ return;
327
+ }
328
+ this.touchPosStart = {
329
+ clientX: e.touches[0].clientX,
330
+ clientY: e.touches[0].clientY
331
+ };
332
+ this.touchPosEnd = this.touchPosStart;
227
333
  }
228
334
  onTouchMove(e) {
229
- this.touchPosEnd = { clientX: e.touches[0].clientX, clientY: e.touches[0].clientY };
335
+ if (!this.isMobile) {
336
+ return;
337
+ }
338
+ this.touchPosEnd = {
339
+ clientX: e.touches[0].clientX,
340
+ clientY: e.touches[0].clientY
341
+ };
342
+ }
343
+ onTouchEnd() {
344
+ if (!this.isMobile || !this.touchPosStart || !this.touchPosEnd || !this.levels || this.levels.length <= 1) {
345
+ return;
346
+ }
230
347
  const diffX = this.touchPosEnd.clientX - this.touchPosStart.clientX;
231
348
  const diffY = this.touchPosEnd.clientY - this.touchPosStart.clientY;
232
- if (Math.abs(diffX) > Math.abs(diffY)) {
233
- this.slideTo(diffX > 0 ? MOVE_TO.slideToRight : MOVE_TO.slideToLeft);
349
+ const threshold = 30;
350
+ if (Math.abs(diffX) <= threshold || Math.abs(diffX) <= Math.abs(diffY)) {
351
+ return;
352
+ }
353
+ if (diffX > 0) {
354
+ // Move right, Go to previous item
355
+ this.slideTo(MOVE_TO.slideToRight);
356
+ }
357
+ else {
358
+ // Move left, Go to next item
359
+ this.slideTo(MOVE_TO.slideToLeft);
234
360
  }
235
361
  }
236
362
  slideTo(direction) {
237
- let newOffset = this.levelsElement.offsetLeft +
238
- (this.childElementWidth) * this.moveCountForOneTouch * direction;
239
- if (newOffset % this.childElementWidth != 0) {
240
- const leftOfPreNode = (Math.floor(newOffset / this.childElementWidth)) * this.childElementWidth;
241
- const leftOfNextNode = (Math.ceil(newOffset / this.childElementWidth)) * this.childElementWidth;
242
- //touchmove to right, get left of pre-node; touchmove to left, get left of next-node
243
- newOffset = direction == MOVE_TO.slideToRight ? leftOfPreNode : leftOfNextNode;
363
+ if (!this.levelsElement || !this.childElementWidth || !this.moveCountForOneTouch || this.levelsElement.childElementCount <= 1) {
364
+ this.offset = 0;
365
+ return;
366
+ }
367
+ const currentOffset = this.isMobile
368
+ ? this.offset
369
+ : this.levelsElement.offsetLeft;
370
+ let newOffset = currentOffset +
371
+ this.childElementWidth * this.moveCountForOneTouch * direction;
372
+ if (newOffset % this.childElementWidth !== 0) {
373
+ const leftOfPreNode = Math.floor(newOffset / this.childElementWidth) * this.childElementWidth;
374
+ const leftOfNextNode = Math.ceil(newOffset / this.childElementWidth) * this.childElementWidth;
375
+ newOffset = direction === MOVE_TO.slideToRight
376
+ ? leftOfPreNode
377
+ : leftOfNextNode;
244
378
  }
245
- this.offset = newOffset < this.minOffset ? this.minOffset : (newOffset >= 0 ? 0 : newOffset);
379
+ this.offset = newOffset < this.minOffset
380
+ ? this.minOffset
381
+ : newOffset >= 0
382
+ ? 0
383
+ : newOffset;
246
384
  }
247
385
  initLevelSlider() {
248
386
  var _a;
@@ -250,12 +388,34 @@ const ElevateLevelList = class {
250
388
  console.log('Widget[elevate-level-list] DOM is not ready.');
251
389
  return;
252
390
  }
253
- this.showSliderButton = !this.isMobile && (this.levelsElement.clientWidth > this.levelsElement.parentElement.clientWidth);
254
- this.minOffset = this.levelsElement.parentElement.clientWidth - this.levelsElement.clientWidth;
255
- this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
256
- this.moveCountForOneTouch = Math.ceil(this.levelsElement.parentElement.clientWidth / this.childElementWidth) - 1;
391
+ const wrapperWidth = this.levelsElement.parentElement.clientWidth;
392
+ // Desktop, Use clientWidth
393
+ // Mobile, Use scrollWidth
394
+ const contentWidth = this.isMobile
395
+ ? this.levelsElement.scrollWidth
396
+ : this.levelsElement.clientWidth;
257
397
  const childElementCount = this.levelsElement.childElementCount;
258
- this.childElementWidth += (this.levelsElement.clientWidth - this.childElementWidth * childElementCount) / (childElementCount - 1);
398
+ // If childElementCount === 0 or 1, No carousel
399
+ if (childElementCount <= 1) {
400
+ this.showSliderButton = false;
401
+ this.minOffset = 0;
402
+ this.offset = 0;
403
+ this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
404
+ this.moveCountForOneTouch = 1;
405
+ return;
406
+ }
407
+ // keep original logic for desktop
408
+ this.showSliderButton =
409
+ !this.isMobile &&
410
+ this.levelsElement.clientWidth > wrapperWidth;
411
+ this.minOffset = wrapperWidth - contentWidth;
412
+ this.childElementWidth = this.levelsElement.firstElementChild.clientWidth;
413
+ if (childElementCount > 1) {
414
+ const gap = (contentWidth - this.childElementWidth * childElementCount) /
415
+ (childElementCount - 1);
416
+ this.childElementWidth += gap;
417
+ }
418
+ this.moveCountForOneTouch = Math.max(1, Math.ceil(wrapperWidth / this.childElementWidth) - 1);
259
419
  }
260
420
  debounce(callback, delay) {
261
421
  {
@@ -287,12 +447,13 @@ const ElevateLevelList = class {
287
447
  });
288
448
  }
289
449
  render() {
290
- return (h(Host, { key: 'c2eb983ff3df4868204eec8e527efa08c9e5afa0' }, this.levels && [
291
- h("div", { key: '9f6563c030a7725761b9a73cffb8e2d8d8f47c32', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, h("svg", { key: '9e3d3422bd2171d26821c1f74e3ab7418b97643d', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'ac0002e40e037edd0c0893c9250f36e18e451f16', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
292
- h("div", { key: '242903f38deb464844d722e0e7fe90665de99d6a', class: 'LevelItemsWrapper' }, h("div", { key: '739328ff99ecd777b9e2ff6914034a5bbc7eac90', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
450
+ var _a;
451
+ return (h(Host, { key: '780e54c101e1dd10513f959b08e3b7425ebba3ec' }, this.levels && [
452
+ h("div", { key: '70e7265746f1cb4788d137c43b9addf1443a6ae3', class: `SliderButton LeftButton ${this.offset == 0 ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToRight) }, h("svg", { key: '20184f3e02bebe818f5119b9b71105a1d7e11681', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '351e4a93e390f430045642692b585867e9569b6a', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))),
453
+ h("div", { key: 'd21722ad058c4e83d23dfaa6822850557de4e620', class: 'LevelItemsWrapper' }, h("div", { key: '03dccfd305222e9e4eb53277efeef43711f3b664', style: { 'left': `${this.offset}px` }, class: `LevelItems ${this.isMobile ? 'Mobile' : ''} ${this.isMobile && ((_a = this.levels) === null || _a === void 0 ? void 0 : _a.length) === 1 ? 'SingleItem' : ''}`, id: 'levelItems', ref: (el) => { this.levelsElement = el; } }, this.levels.map((level, idx) => {
293
454
  return (h("div", { class: `Item ${this.selectedLevelId == level.id ? 'Active' : ''}`, onClick: this.onLevelClicked.bind(this, level) }, h("img", { alt: `Presentation Icon for ${level.presentation.displayName}`, class: "LevelImg", src: level.presentation.asset }), h("span", { class: "LevelName", title: level.presentation.displayName }, level.presentation.displayName), h("span", { class: "LevelPoints" }, idx == 0 ? '' : '>', this.convertNumberToCompactForm(level.firstEntryPoints), ' ', translate('points', this.language))));
294
455
  }))),
295
- h("div", { key: '2366c09b46bfec309bd4f8d5991d457f04dbf038', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, h("svg", { key: 'c52ef4f99444d1185e9b8ce4287f0f2886c622ae', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'acc266646133bb636b52f8776380e6aedc93f937', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
456
+ h("div", { key: '6fe81dc6338a8dc29e2a9dc7aedcbdb618660c82', class: `SliderButton RightButton ${this.offset <= this.minOffset ? 'Disabled' : ''} ${this.showSliderButton ? '' : 'Hidden'}`, onClick: () => this.slideTo(MOVE_TO.slideToLeft) }, h("svg", { key: '26e11511a54ac6d43fab18d39f0483f86af470cf', fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '6f3d02eb56c674a82a008022b0f8304a9c4bd72f', "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))
296
457
  ]));
297
458
  }
298
459
  get host() { return getElement(this); }
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["bonus-elevate-levels_8",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
8
+ return bootstrapLazy([["bonus-elevate-levels_8",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["bonus-elevate-levels_8",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
19
+ return bootstrapLazy([["bonus-elevate-levels_8",[[1,"player-elevate-level",{"endpoint":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"userLevelId":[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"endpoint":[513],"language":[513],"translationUrl":[513,"translation-url"],"selectedLevelId":[1537,"selected-level-id"],"showDefault":[4,"show-default"],"elevateLevelParamProxy":[32],"elevateLevels":[32],"currentLevel":[32],"errorMessage":[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{"selectedLevelId":["selectedLevelIdChangedHandler"],"elevateLevels":["selectedLevelIdChangedHandler"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"translationUrl":["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{"levels":[16],"language":[1],"selectedLevelId":[1537,"selected-level-id"],"showSliderButton":[32],"touchPosStart":[32],"touchPosEnd":[32],"offset":[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{"selectedLevelId":["levelsChangedHandler"]}],[0,"elevate-level-presentation",{"elevateLevel":[16]}],[0,"elevate-levels-data",{"scopeParams":[1544,"scope-params"]}],[0,"player-elevate-card-data",{"params":[8],"playerElevateLevel":[32],"pointExpireString":[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{"params":["onParamsChanged"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"mbSource":["handleMbSourceChange"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]],["player-elevate-card",[[1,"player-elevate-card",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"playerName":[513,"player-name"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerLevelFlag":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard",[[1,"player-elevate-pointcard",{"endpoint":[513],"theme":[513],"session":[513],"playerAvatarUrl":[513,"player-avatar-url"],"language":[513],"mbSource":[513,"mb-source"],"playerName":[513,"player-name"],"cardTitle":[513,"card-title"],"buttonType":[513,"button-type"],"dateFormat":[513,"date-format"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"pointExpireString":[32],"playerElevateLevel":[32],"elevateWalletTotal":[32],"elevateSPTotal":[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"]}]]],["player-rakeback-card",[[1,"player-rakeback-card",{"endpoint":[513],"theme":[513],"session":[513],"language":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"show":[516],"rakebackInfo":[32],"isLoading":[32],"coolingOffPeriod":[32],"showTheWidget":[32]},[[8,"message","handleMessage"]],{"session":["onSessionOrEndpointChange"],"endpoint":["onSessionOrEndpointChange"],"language":["onSessionOrEndpointChange"],"show":["onShowOrHasRakebackWalletChange"],"rakebackInfo":["onShowOrHasRakebackWalletChange"]}]]]], options);
20
20
  });
@@ -1 +1 @@
1
- import{r as e,h as t,c as n,H as i,g as l,a,F as s}from"./index-8b0eeaf7.js";import{t as o,T as r}from"./locale.utils-10bf5b6c.js";import{r as d,t as h,g as c,P as v,a as f,b as p,L as g}from"./player-elevate-card-items-27a86262.js";const b={en:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},fr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},hr:{level:"Razina",seeAll:"Vidi sve",privilegesFor:"Privilegije za",termsAndConditions:"Uvjeti i odredbe",noLevelsSet:"There is no level set",points:"Points"},ro:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},tr:{level:"seviye",seeAll:"Tümünü Gör",termsAndConditions:"Şartlar ve Koşullar",loadElevateLevelErrorMessage:"Seviyeler yüklenirken hata oluştu",noLevelsSet:"Tanımlı seviye bulunmuyor",points:"Puanlar"}},u=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{b[t]||(b[t]={});for(let n in e[t])b[t][n]=e[t][n]})),t(!0)})).catch((e=>{console.error("Failed to load translations:",e),t(!1)}))})),y=(e,t,n)=>{let i=b[void 0!==t&&t in b?t:"en"][e]||e;if(null==n?void 0:n.values)for(const[e,t]of Object.entries(n.values)){const n=new RegExp(`{${e}}`,"g");i=i.replace(n,t)}return i},w=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.translationUrl="",this.selectedLevelId=void 0,this.showDefault=void 0,this.elevateLevelParamProxy=void 0,this.elevateLevels=[],this.currentLevel=void 0,this.errorMessage=void 0}selectedLevelChangedHandler(e){e.detail&&(this.currentLevel=Object.assign({},e.detail.level))}selectedLevelIdChangedHandler(){if(this.selectedLevelId&&this.elevateLevels){const e=this.elevateLevels.filter((e=>e.id==this.selectedLevelId))[0];this.currentLevel=Object.assign({},e)}}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language:this.language})}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.currentLevel&&(this.currentLevel=Object.assign({},e.detail.currentLevel)),e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=y("loadElevateLevelErrorMessage",this.language)))}onTCClick(){window.postMessage({type:"termAndConditionClicked"},window.location.href)}handleNewTranslations(){u(this.translationUrl)}async componentWillLoad(){this.elevateLevelParamProxy={endpoint:this.endpoint,language:this.language,selectedLevelId:this.selectedLevelId,showDefault:this.showDefault},this.translationUrl&&await u(this.translationUrl)}render(){var e;return t("div",{key:"c506affafae3a59eb45b22d0a73d0f3e070767a4",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"90159b78c27186afbda74016cce2172fa051430d",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"02518d5c73df9144f274891778d10c4df04bff92",class:"LevelContent"},(null===(e=this.elevateLevels)||void 0===e?void 0:e.length)?t("elevate-level-list",{language:this.language,selectedLevelId:this.selectedLevelId,levels:this.elevateLevels}):y("noLevelsSet",this.language),this.currentLevel&&t("elevate-level-presentation",{key:"3c25372f312b38a780ad1d5823a3872d3a9de929",elevateLevel:this.currentLevel})),this.errorMessage&&t("div",{key:"00ee0bdab9f324a309a925f3d1465eceffae502d"},this.errorMessage),t("general-styling-wrapper",{key:"e9e36fd78d644bb2035256ff06a4118d776b1778",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:b,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}}};var m;w.style=":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}",function(e){e[e.slideToRight=1]="slideToRight",e[e.slideToLeft=-1]="slideToLeft"}(m||(m={}));const x=class{constructor(t){var i;e(this,t),this.selectedLevelChanged=n(this,"selectedLevelChanged",7),this.minOffset=0,this.isMobile=!!((i=window.navigator.userAgent).toLowerCase().match(/android/i)||i.toLowerCase().match(/blackberry|bb/i)||i.toLowerCase().match(/iphone|ipad|ipod/i)||i.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.levels=void 0,this.language=void 0,this.selectedLevelId=void 0,this.showSliderButton=!1,this.touchPosStart=void 0,this.touchPosEnd=void 0,this.offset=0}onLevelClicked(e){this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=e.id}levelsChangedHandler(){this.initOffsetOfLevelItems()}initOffsetOfLevelItems(){if(!this.levels||0==this.levels.length||!this.selectedLevelId)return;const e=this.levels.findIndex((e=>this.selectedLevelId==e.id));if(this.onLevelClicked(this.levels[-1==e?0:e]),this.levels.length<=this.moveCountForOneTouch)return;let t=Math.floor((-1==e?1:e+1)/this.moveCountForOneTouch)*this.moveCountForOneTouch*this.childElementWidth*-1;this.offset=t<=this.minOffset?this.minOffset:t>=0?0:t}onTouchStart(e){this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}}onTouchMove(e){this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY};const t=this.touchPosEnd.clientX-this.touchPosStart.clientX,n=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(t)>Math.abs(n)&&this.slideTo(t>0?m.slideToRight:m.slideToLeft)}slideTo(e){let t=this.levelsElement.offsetLeft+this.childElementWidth*this.moveCountForOneTouch*e;if(t%this.childElementWidth!=0){const n=Math.floor(t/this.childElementWidth)*this.childElementWidth,i=Math.ceil(t/this.childElementWidth)*this.childElementWidth;t=e==m.slideToRight?n:i}this.offset=t<this.minOffset?this.minOffset:t>=0?0:t}initLevelSlider(){var e;if(!(null===(e=this.levelsElement)||void 0===e?void 0:e.firstElementChild))return void console.log("Widget[elevate-level-list] DOM is not ready.");this.showSliderButton=!this.isMobile&&this.levelsElement.clientWidth>this.levelsElement.parentElement.clientWidth,this.minOffset=this.levelsElement.parentElement.clientWidth-this.levelsElement.clientWidth,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,this.moveCountForOneTouch=Math.ceil(this.levelsElement.parentElement.clientWidth/this.childElementWidth)-1;const t=this.levelsElement.childElementCount;this.childElementWidth+=(this.levelsElement.clientWidth-this.childElementWidth*t)/(t-1)}debounce(e,t){{let n;return()=>{clearTimeout(n),n=setTimeout((()=>{e()}),t)}}}convertNumberToCompactForm(e){return e>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"b":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"m":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":e.toString()}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){return t(i,{key:"c2eb983ff3df4868204eec8e527efa08c9e5afa0"},this.levels&&[t("div",{key:"9f6563c030a7725761b9a73cffb8e2d8d8f47c32",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(m.slideToRight)},t("svg",{key:"9e3d3422bd2171d26821c1f74e3ab7418b97643d",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"ac0002e40e037edd0c0893c9250f36e18e451f16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"242903f38deb464844d722e0e7fe90665de99d6a",class:"LevelItemsWrapper"},t("div",{key:"739328ff99ecd777b9e2ff6914034a5bbc7eac90",style:{left:`${this.offset}px`},class:"LevelItems "+(this.isMobile?"Mobile":""),id:"levelItems",ref:e=>{this.levelsElement=e}},this.levels.map(((e,n)=>t("div",{class:"Item "+(this.selectedLevelId==e.id?"Active":""),onClick:this.onLevelClicked.bind(this,e)},t("img",{alt:`Presentation Icon for ${e.presentation.displayName}`,class:"LevelImg",src:e.presentation.asset}),t("span",{class:"LevelName",title:e.presentation.displayName},e.presentation.displayName),t("span",{class:"LevelPoints"},0==n?"":">",this.convertNumberToCompactForm(e.firstEntryPoints)," ",y("points",this.language))))))),t("div",{key:"2366c09b46bfec309bd4f8d5991d457f04dbf038",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(m.slideToLeft)},t("svg",{key:"c52ef4f99444d1185e9b8ce4287f0f2886c622ae",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"acc266646133bb636b52f8776380e6aedc93f937","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return l(this)}static get watchers(){return{selectedLevelId:["levelsChangedHandler"]}}};x.style="elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}";const L=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(i,{key:"16d128717e716f7ca7d3bb77fc3a2e67209318b6"},t("div",{key:"658657abdfc64844bd2af40562efe40385e1735a",class:"Row Desc"},t("h3",{key:"ec5871c2f810c8c120bf99510717381175bc1ef4"},this.elevateLevel.presentation.displayName),t("p",{key:"865915c6eea90295238fb47eaa91c8f968199ca5"},t("span",{key:"2b90c6c5d6957b73fc4a0f53d53da0ca023a4f0a",class:"TxtDesc",innerHTML:this.elevateLevel.presentation.description}))))}};L.style=":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";var I,k,C,E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},P={exports:{}};I=P,k=P.exports,C=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==E)return E;throw new Error("unable to locate global object")}(),I.exports=k=C.fetch,C.fetch&&(k.default=C.fetch.bind(C)),k.Headers=C.Headers,k.Request=C.Request,k.Response=C.Response;const S=P.exports,T=class{constructor(t){e(this,t),this.elevateLevelsDataChange=n(this,"elevateLevelsDataChange",7),this.scopeParams=void 0}async componentWillRender(){if(!this.scopeParams.endpoint)return;let e=new URL(`${this.scopeParams.endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);await S(e.href).then((e=>e.json())).then((e=>{const t=e.data.sort(((e,t)=>e.firstEntryPoints<t.firstEntryPoints?-1:1));let n=this.scopeParams.selectedLevelId;if(!n&&this.scopeParams.showDefault&&t.length>0&&(n=t[0].id),n){const e=t.filter((e=>e.id==n))[0];this.elevateLevelsDataChange.emit({currentLevel:e})}this.elevateLevelsDataChange.emit({clearError:!0}),this.elevateLevelsDataChange.emit({elevateLevels:t})})).catch((e=>{this.elevateLevelsDataChange.emit({errorMessage:{type:"errorWhenLoadElevateLevels",err:e}}),console.error(e)}))}};T.style=":host{display:block}";const R="__WIDGET_GLOBAL_STYLE_CACHE__";function _(e,t){if(e){const n=document.createElement("style");n.innerHTML=t,e.appendChild(n)}}function D(e,t){if(!e||!t)return;const n=new URL(t);fetch(n.href).then((e=>e.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,e&&e.appendChild(n)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function M(e,t,n,i=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!i)return n=function(e,t){const n=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(n.innerHTML=t,e.appendChild(n))}))}(e,t),n;window[R]||(window[R]={}),n=function(e,t){return window.emMessageBus.subscribe(t,(n=>{if(!e)return;const i=e.getRootNode(),l=window[R];let a=l[t]&&l[t].sheet;a?l[t].refCount=l[t].refCount+1:(a=new CSSStyleSheet,a.replaceSync(n),l[t]={sheet:a,refCount:1});const s=i.adoptedStyleSheets||[];s.includes(a)||(i.adoptedStyleSheets=[...s,a])}))}(e,t);const l=n.unsubscribe.bind(n);return n.unsubscribe=()=>{if(window[R][t]){const e=window[R][t];e.refCount>1?e.refCount=e.refCount-1:delete window[R][t]}l()},n}const O=class{constructor(t){e(this,t),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(this.mbSource&&M(this.el,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&_(this.el,this.clientStyling),this.clientStylingUrl&&D(this.el,this.clientStylingUrl),this.stylingAppends=!0)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleMbSourceChange(e,t){e!=t&&M(this.el,`${this.mbSource}.Style`,this.stylingSubscription)}handleClientStylingChange(e,t){e!=t&&_(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&D(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&_(this.el,this.clientStyling),this.clientStylingUrl&&D(this.el,this.clientStylingUrl),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const i=(t=this.translationUrl,n=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{n[e]=n[e]||{},Object.keys(t[e]).forEach((i=>{if(!n.en[i])return;const l=n.en[i];"object"==typeof t[e][i]?(n[e][i]=n[e][i]||Object.assign({},l),Object.keys(t[e][i]).forEach((l=>{n[e][i][l]=t[e][i][l]}))):n[e][i]=t[e][i]||Object.assign({},l)}))})),e(!0)})).catch((t=>{console.error("Failed to load translations:",t),e(!1)}))})));e.push(i)}var t,n;return await Promise.all(e)}render(){return t("div",{key:"e660ceb69f5e848c788c3924fc814c0fa7a777a2",class:"StyleShell"},t("slot",{key:"35014b6c0c32532af11e6a629ba9b13942504d21",name:"mainContent"}))}get el(){return l(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};function $(e){d(1,arguments);var t=h(e);return t.setHours(0,0,0,0),t}function B(e,t){return d(2,arguments),h(e).getTime()-h(t).getTime()}O.style=":host{display:block}";var A={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function j(e){return e?A[e]:A.trunc}const z=class{constructor(t){e(this,t),this.playerElevateLeveLoaded=n(this,"playerElevateLeveLoaded",7),this.params=void 0,this.playerElevateLevel=void 0,this.pointExpireString=void 0}handleWindowResizs(){this.initLevelProgressbar()}onParamsChanged(){this.loadElevateInfo()}redeemGiftButtonHandler(){this.loadElevateInfo()}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}loadLevels(){let e=new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);return new Promise(((t,n)=>fetch(e.href,{method:"GET"}).then((e=>e.json())).then((e=>{this.levels=e.data,t(!0)})).catch((e=>{n(e)}))))}calcuatePointsToBeExpired(e,t){let n="";if(!e||!e.aboutToExpire||0==e.aboutToExpire.length||e.aboutToExpire[0].points<=0)return n;e.aboutToExpire.sort(((e,t)=>function(e,t){d(2,arguments);var n=h(e),i=h(t);return n.getTime()<i.getTime()}(new Date(e.expireTime),new Date(t.expireTime))?-1:1));const i=e.aboutToExpire[0],l=function(e,t){d(2,arguments);var n=$(e),i=$(t),l=n.getTime()-c(n),a=i.getTime()-c(i);return Math.round((l-a)/864e5)}(new Date(i.expireTime),new Date);let a=0,s=0,r=0===l?`${t}Day`:t;return l<=0&&(a=function(e,t,n){d(2,arguments);var i=B(e,t)/36e5;return j(null==n?void 0:n.roundingMethod)(i)}(new Date(i.expireTime),new Date,{roundingMethod:"floor"}),r=a>1?`${t}Hours`:`${t}Hour`,a<=0&&(s=function(e,t,n){d(2,arguments);var i=B(e,t)/6e4;return j(null==n?void 0:n.roundingMethod)(i)}(new Date(i.expireTime),new Date,{roundingMethod:"floor"}),r=s>1?`${t}Minutes`:`${t}Minute`)),n=o(r,{expirationPoints:i.points,expireDay:Math.max(l,a,s),lang:this.params.language}),n}loadPlayerLevelInfo(){let e=new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);return new Promise(((t,n)=>fetch(e.href,{method:"GET",headers:{"X-Sessionid":this.params.session,"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{var i,l,a,s,o;if(!e.success)return console.error("Exception when fetch user elevateinfo, ",e.errorCode,e.errorMessage),void n(!0);window.postMessage({type:"UpdateGamificationXp",points:null===(l=null===(i=e.data)||void 0===i?void 0:i.level)||void 0===l?void 0:l.loyaltyPoints},window.location.href);let r=e.data;this.playerElevateLevel=r.level,this.playerElevateLevel.name=this.playerElevateLevel.presentation.displayName||this.playerElevateLevel.name,this.playerElevateLevel.spendablePoints=(null===(a=r.spendableWallet)||void 0===a?void 0:a.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const d=null===(s=e.data.spendableWallet)||void 0===s?void 0:s.total,h=null===(o=e.data.loyaltyWallet)||void 0===o?void 0:o.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:d,loyaltyWalletTotal:h});let c=this.calcuatePointsToBeExpired(d,"coinsToBeExpired"),v=this.calcuatePointsToBeExpired(h,"pointsToBeExpired");(c||v)&&this.playerElevateLeveLoaded.emit({pointExpireString:c,xpExpireString:v}),t(this.playerElevateLevel)})).catch((e=>{console.log("error ",e),n(!0)}))))}setLoyaltyProgress(e){!function(e,t){const n=e.querySelector("#total_level"),i=n.getBBox().width,l=t>1?1:t,a=l*i-17<0?0:l*i-17,s=e.querySelector("#current_level"),o=e.querySelector("#filter_current_level"),r=e.querySelector("#circle_current_level");n.setAttribute("viewbox",`0 0 ${a} 28`),s.setAttribute("width",`${a}`),r.setAttribute("cx",`${a<6.5?6.5:a}`),o.setAttribute("x",""+(a-8));const d=e.querySelector("#lock"),h=e.querySelector("#filter_heart_ball"),c=e.querySelector("#filter_ball"),v=e.querySelector("#filter_heart"),f=e.querySelector("#filter_lock"),p=e.querySelector("#paint0_linear_ball"),g=e.querySelector("#paint1_linear_lock"),b=e.querySelector("#lock_box"),u=e.querySelector("#heart_box"),y=i-10;d.setAttribute("cx",`${y}`),g.setAttribute("x1",`${y}`),g.setAttribute("x2",`${y}`),p.setAttribute("x1",""+(y-6)),p.setAttribute("x2",""+(y-6+11.2)),f.setAttribute("x",""+(y-6)),v.setAttribute("x",""+(y-6-2)),c.setAttribute("x",""+(y-6-2-2)),h.setAttribute("x",""+(y-6-2-2-4)),b.setAttribute("x",""+(y-6)),u.setAttribute("x",""+(y-6)),n.parentElement.style.opacity="1"}(this.loyaltyProgressEle,e)}initLevelProgressbar(){setTimeout((()=>{this.loyaltyProgressEle=this.elevateCardRef.parentElement.querySelector("#LevelProgress"),this.loyaltyProgressEle&&(this.setLoyaltyProgress(this.playerElevateLevel.nextLevel?this.playerElevateLevel.loyaltyPoints/this.playerElevateLevel.nextLevel.entryPoints:1),this.params.playerElevateLevel=this.playerElevateLevel)}),80)}componentDidRender(){this.initLevelProgressbar()}loadElevateInfo(){if(!this.params.endpoint||!this.params.session)return;const e=[];e.push(this.loadPlayerLevelInfo()),this.params.calculateLevelFlag&&e.push(this.loadLevels()),Promise.all(e).then((e=>{if(console.log("elevate-init",e),this.initLevelProgressbar(),!this.levels)return;this.levels.sort(((e,t)=>e.firstEntryPoints>t.firstEntryPoints?1:-1));const t=this.playerElevateLevel.loyaltyPoints;let n=0;this.levels.forEach(((e,i)=>{t>e.firstEntryPoints&&(n=i)})),this.playerElevateLeveLoaded.emit({calculatedLevelFlag:n})}))}componentWillLoad(){this.loadElevateInfo()}get elevateCardRef(){return l(this)}static get watchers(){return{params:["onParamsChanged"]}}};z.style=':host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emw--color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emw--color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: "";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level0-bg0, #E2792C) 0%, var(--emw--elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level1-bg0, #BEBFED) 0%, var(--emw--elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level2-bg0, #FCC410) 0%, var(--emw--elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level3-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level4-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emw--elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: var(--emw--border-radius-medium, 10px);\n background: var(--emw--elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);\n}\n.Inner .Row .RedeemButton span {\n color: var(--emw--color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emw--color-red, #9e595f);\n}';const N=class{constructor(t){e(this,t),this.endpoint=void 0,this.session=void 0,this.playerAvatarUrl=void 0,this.language=void 0,this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.userLevelId=void 0}setPlayerElevateLevelInfo(e){"playerElevateLeveLoaded"===e.type&&e.detail.elevateLevel&&(this.userLevelId=e.detail.elevateLevel.id)}render(){return t(i,{key:"6fe9245d801450135e6bcbde98e695274c96843d"},t("div",{key:"4f54bdcab376982cabe42bbbc5789e1d00381617",class:"PlayerElevateCard"},t("player-elevate-loyaltycard",{key:"fcae0187fc7df6760124288049e785c7bcbd4c7a",playerName:this.playerName,dateFormat:this.dateFormat,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,mbSource:this.mbSource,clientStyling:`${this.clientStyling} .Outer{height: 185px}`,endpoint:this.endpoint,language:this.language,session:this.session})),t("div",{key:"4056a7ee6d4069466f92bd089979cef530af2f41",class:"ElevateLevelsInfo"},t("bonus-elevate-levels",{key:"b7ec448dd2c24afb967afcef9f7f975e5d86576c",selectedLevelId:this.userLevelId,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,mbSource:this.mbSource,language:this.language,endpoint:this.endpoint})),t("general-styling-wrapper",{key:"b8371fd6be5555f9dc0cc5314ab64798f5e7f364",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource}))}};N.style=":host{display:block}.PlayerElevateCard{height:160px;width:100%;overflow:hidden}.ElevateLevelsInfo{background-color:var(--emw--color-background, #e6e8ea)}";const U=class{constructor(t){e(this,t),this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.playerAvatarUrl=void 0,this.language="en",this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.pointExpireString=void 0,this.playerElevateLevel=void 0,this.elevateWalletTotal=void 0}onSessionOrEndpointChange(){this.paramProxy=Object.assign(Object.assign({},this.paramProxy),{session:this.session,endpoint:this.endpoint,language:this.language})}playerElevateLeveLoadedHandler(e){e.detail&&(e.detail.elevateLevelWalletTotal&&(this.elevateWalletTotal=e.detail.elevateLevelWalletTotal),e.detail.elevateLevel&&(this.playerElevateLevel=e.detail.elevateLevel),e.detail.xpExpireString&&(this.pointExpireString=e.detail.xpExpireString))}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}componentWillLoad(){this.paramProxy={endpoint:this.endpoint,session:this.session,language:this.language}}getNextLevelPoints(){var e,t;return(null===(e=this.playerElevateLevel)||void 0===e?void 0:e.nextLevel)?null===(t=this.playerElevateLevel)||void 0===t?void 0:t.nextLevel.entryPoints:-1}getNextLevelTips(){var e;let t=null===(e=this.playerElevateLevel)||void 0===e?void 0:e.nextLevel;if(this.playerElevateLevel&&t){const e=(t.entryPoints-this.playerElevateLevel.loyaltyPoints).toFixed(2);return o("tipsForNextLevel",{pointsToReach:e,levelName:t.name,lang:this.language})}return""}render(){const e=a("../static/card-ground.svg"),n=a("../static/card-ground-over.svg");return t("div",{key:"9f673b8dccc848d11f0836c15f1f5da5e242e3b3",class:`ElevateCardWrapper ${this.theme}`},t("div",{key:"419c71a612c3cdfebaece1e90345c6324c68348e",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},t("general-styling-wrapper",{key:"04c1098bf16e683f30d211dfb9ebc0b319076258",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:r,translationUrl:this.translationUrl,mbSource:this.mbSource}),t("player-elevate-card-data",{key:"a9c57ef6c5c3381c7e9bf2f041a190f3de3a0423",params:this.paramProxy}),t("div",{key:"402ceddce75abb2ee6b59db730418efc006e5c60",class:"OuterCover Inner",style:{backgroundImage:`url(${n}`}},t("div",{key:"844cba8ae40b9dd55129f7b0d52a208ea72e72cf",class:"Content Row"},this.playerElevateLevel&&t(s,{key:"d365971e66cbdc81d4b1758c045a76ad50a68729"},t("div",{key:"2e017a95d80098565d17807c6f8dae51a6b89090",class:"PlayerImg"},t(v,{key:"5aaf4b8e2b8ea67fa0fed1a07dde9caf2551a3bd",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),t("div",{key:"6e332314f4c4a233dd353130266a4d0368b0de45",class:`LevelInfo ${this.playerElevateLevel.name}`},t("div",{key:"06311b5920ac4126536760049bf3664d92cc247f",class:"CardCell ElevateLevel"},t("span",{key:"4538afdef55cd520e2d213e6a97d209234deabe5",class:"LevelName",title:this.playerElevateLevel.name},this.playerElevateLevel.name)),t("div",{key:"cb2764c587a2fe1719b2ff6e045866ee032d5a66",class:"PointsRange"},t(f,{key:"c794dc4acd33555811187df5b2748b012af77cbf",loyaltyPoints:this.playerElevateLevel.loyaltyPoints<=0?0:this.playerElevateLevel.loyaltyPoints,language:this.language}),t(f,{key:"b88eb09ad61ea38214df4877976c6481626ae005",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),t(p,{key:"91fba9132a54ea109bd17a9844390947cf65b902"}),t("div",{key:"950323f3966e6db2c41e06fe6d7be123d09cc496",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&t("div",{key:"2ee3c2b317274fdef1cf1a9b2905d023b7485c22",class:"PointsInfo ExpirationPoints"},this.pointExpireString," "),this.playerElevateLevel.expireTime&&t(g,{key:"db5824c90848a51566ff2a158ff6dc6a292009b2",expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat,language:this.language})))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};U.style=":host{display:block}@media screen and (min-width: 501px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:nowrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:6px;margin-left:0px}}@media screen and (max-width: 500px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:wrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:0px;margin-left:0px}}.LoyaltyCard .Inner .LevelProgress{margin-left:0px}.LoyaltyCard .Inner .Row .PointsInfo.ExpirationPoints{text-align:left;color:var(--emw--color-red-50, red)}.LoyaltyCard .Inner .PlayerAvatar .Avatar{display:none}.LoyaltyCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%}.LoyaltyCard .Inner .LevelInfo .ElevateLevel{display:flex;flex:1;align-items:center}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{position:relative;padding-left:0px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate .ExpireTime{margin-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .LevelName{padding-left:0;font-size:var(--emw--elevate-fontsize-2xlarge, 21px);position:relative;width:auto;color:var(--emw--elevate-color-levelname, #FFBD2B);font-weight:bold}.LoyaltyCard .PointsRange{display:flex;justify-content:space-between}.LoyaltyCard .PointsRange .PointsInfo{width:auto}.LoyaltyCard .NextLevelTip{text-align:right;font-size:11px;color:var(--emw--color-black, #000);opacity:0.8;font-weight:bold}";export{w as bonus_elevate_levels,x as elevate_level_list,L as elevate_level_presentation,T as elevate_levels_data,O as general_styling_wrapper,z as player_elevate_card_data,N as player_elevate_level,U as player_elevate_loyaltycard}
1
+ import{r as e,h as t,c as i,H as n,g as l,a as s,F as a}from"./index-8b0eeaf7.js";import{t as o,T as r}from"./locale.utils-10bf5b6c.js";import{r as d,t as h,g as c,P as v,a as f,b as p,L as g}from"./player-elevate-card-items-27a86262.js";const u={en:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},fr:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},hr:{level:"Razina",seeAll:"Vidi sve",privilegesFor:"Privilegije za",termsAndConditions:"Uvjeti i odredbe",noLevelsSet:"There is no level set",points:"Points"},ro:{level:"level",seeAll:"See All",termsAndConditions:"Terms & Conditions",loadElevateLevelErrorMessage:"Error when load elevate levels",noLevelsSet:"There is no level set",points:"Points"},tr:{level:"seviye",seeAll:"Tümünü Gör",termsAndConditions:"Şartlar ve Koşullar",loadElevateLevelErrorMessage:"Seviyeler yüklenirken hata oluştu",noLevelsSet:"Tanımlı seviye bulunmuyor",points:"Puanlar"}},b=e=>new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{u[t]||(u[t]={});for(let i in e[t])u[t][i]=e[t][i]})),t(!0)})).catch((e=>{console.error("Failed to load translations:",e),t(!1)}))})),y=(e,t,i)=>{let n=u[void 0!==t&&t in u?t:"en"][e]||e;if(null==i?void 0:i.values)for(const[e,t]of Object.entries(i.values)){const i=new RegExp(`{${e}}`,"g");n=n.replace(i,t)}return n},w=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.endpoint=void 0,this.language="en",this.translationUrl="",this.selectedLevelId=void 0,this.showDefault=void 0,this.elevateLevelParamProxy=void 0,this.elevateLevels=[],this.currentLevel=void 0,this.errorMessage=void 0}selectedLevelChangedHandler(e){e.detail&&(this.currentLevel=Object.assign({},e.detail.level))}selectedLevelIdChangedHandler(){if(this.selectedLevelId&&this.elevateLevels){const e=this.elevateLevels.filter((e=>e.id==this.selectedLevelId))[0];this.currentLevel=Object.assign({},e)}}onSessionOrEndpointChange(){this.elevateLevelParamProxy=Object.assign(Object.assign({},this.elevateLevelParamProxy),{endpoint:this.endpoint,language:this.language})}elevateLevelsDataChangeHandler(e){e.detail&&(e.detail.currentLevel&&(this.currentLevel=Object.assign({},e.detail.currentLevel)),e.detail.elevateLevels&&(this.elevateLevels=[...e.detail.elevateLevels]),e.detail.clearError&&(this.errorMessage=null),e.detail.errorMessage&&e.detail.errorMessage.errorWhenLoadElevateLevels&&(this.errorMessage=y("loadElevateLevelErrorMessage",this.language)))}onTCClick(){window.postMessage({type:"termAndConditionClicked"},window.location.href)}handleNewTranslations(){b(this.translationUrl)}async componentWillLoad(){this.elevateLevelParamProxy={endpoint:this.endpoint,language:this.language,selectedLevelId:this.selectedLevelId,showDefault:this.showDefault},this.translationUrl&&await b(this.translationUrl)}render(){var e;return t("div",{key:"c506affafae3a59eb45b22d0a73d0f3e070767a4",class:"ElevateLevelContent"},t("elevate-levels-data",{key:"90159b78c27186afbda74016cce2172fa051430d",scopeParams:this.elevateLevelParamProxy}),t("div",{key:"02518d5c73df9144f274891778d10c4df04bff92",class:"LevelContent"},(null===(e=this.elevateLevels)||void 0===e?void 0:e.length)?t("elevate-level-list",{language:this.language,selectedLevelId:this.selectedLevelId,levels:this.elevateLevels}):y("noLevelsSet",this.language),this.currentLevel&&t("elevate-level-presentation",{key:"3c25372f312b38a780ad1d5823a3872d3a9de929",elevateLevel:this.currentLevel})),this.errorMessage&&t("div",{key:"00ee0bdab9f324a309a925f3d1465eceffae502d"},this.errorMessage),t("general-styling-wrapper",{key:"e9e36fd78d644bb2035256ff06a4118d776b1778",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:u,translationUrl:this.translationUrl,mbSource:this.mbSource}))}static get watchers(){return{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}}};var m;w.style=":host{display:block}.ElevateLevelContent{padding:20px;position:relative}.ElevateLevelContent .Privileges{padding-bottom:30px}.ElevateLevelContent .tc{position:absolute;right:10px;bottom:10px;text-align:right;display:none}",function(e){e[e.slideToRight=1]="slideToRight",e[e.slideToLeft=-1]="slideToLeft"}(m||(m={}));const x=class{constructor(t){var n;e(this,t),this.selectedLevelChanged=i(this,"selectedLevelChanged",7),this.minOffset=0,this.isMobile=!!((n=window.navigator.userAgent).toLowerCase().match(/android/i)||n.toLowerCase().match(/blackberry|bb/i)||n.toLowerCase().match(/iphone|ipad|ipod/i)||n.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.levels=void 0,this.language=void 0,this.selectedLevelId=void 0,this.showSliderButton=!1,this.touchPosStart=void 0,this.touchPosEnd=void 0,this.offset=0}centerLevelItem(e){if(!this.isMobile||!this.levelsElement||e<0||!this.levelsElement.children[e])return;const t=this.levelsElement.parentElement;if(!t)return;const i=this.levelsElement.children[e],n=t.clientWidth,l=Math.min(0,n-this.levelsElement.scrollWidth);let s=n/2-(i.offsetLeft+i.offsetWidth/2);s=s<l?l:s>0?0:s,this.minOffset=l,this.offset=s}moveToLevelItem(e,t=!1){if(!this.levelsElement||e<0||!this.levelsElement.children[e])return;const i=this.levelsElement.parentElement;if(!i)return;const n=this.levelsElement.children[e],l=i.clientWidth,s=this.isMobile?this.levelsElement.scrollWidth:this.levelsElement.clientWidth,a=Math.min(0,l-s);if(s<=l)return this.minOffset=0,void(this.offset=0);const o=n.offsetLeft,r=n.offsetWidth;let d;if(t)d=l/2-(o+r/2);else{const e=-this.offset,t=o+r;if(o>=e&&t<=e+l)return;d=o<e?-o:l-t}d=d<a?a:d>0?0:d,this.minOffset=a,this.offset=d}onLevelClicked(e){var t,i;if(this.selectedLevelChanged.emit({level:e}),this.selectedLevelId=e.id,this.isMobile){const n=null!==(i=null===(t=this.levels)||void 0===t?void 0:t.findIndex((t=>t.id===e.id)))&&void 0!==i?i:-1;requestAnimationFrame((()=>{this.centerLevelItem(n)}))}}levelsChangedHandler(){this.initOffsetOfLevelItems()}initOffsetOfLevelItems(){if(!this.levels||0===this.levels.length||!this.selectedLevelId)return;const e=this.levels.findIndex((e=>this.selectedLevelId===e.id));if(-1===e&&this.levels[0])return void(this.selectedLevelId=this.levels[0].id);if(this.levels.length<=1)return void(this.offset=0);const t=-1===e?0:e;requestAnimationFrame((()=>{var e;if(this.isMobile)return void this.moveToLevelItem(t,!0);const i=null===(e=this.levelsElement)||void 0===e?void 0:e.parentElement;return i&&this.levelsElement?this.levelsElement.clientWidth<=i.clientWidth?(this.offset=0,void(this.minOffset=0)):void this.moveToLevelItem(t,!1):void 0}))}onTouchStart(e){this.isMobile&&(this.touchPosStart={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY},this.touchPosEnd=this.touchPosStart)}onTouchMove(e){this.isMobile&&(this.touchPosEnd={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY})}onTouchEnd(){if(!this.isMobile||!this.touchPosStart||!this.touchPosEnd||!this.levels||this.levels.length<=1)return;const e=this.touchPosEnd.clientX-this.touchPosStart.clientX,t=this.touchPosEnd.clientY-this.touchPosStart.clientY;Math.abs(e)<=30||Math.abs(e)<=Math.abs(t)||this.slideTo(e>0?m.slideToRight:m.slideToLeft)}slideTo(e){if(!this.levelsElement||!this.childElementWidth||!this.moveCountForOneTouch||this.levelsElement.childElementCount<=1)return void(this.offset=0);let t=(this.isMobile?this.offset:this.levelsElement.offsetLeft)+this.childElementWidth*this.moveCountForOneTouch*e;if(t%this.childElementWidth!=0){const i=Math.floor(t/this.childElementWidth)*this.childElementWidth,n=Math.ceil(t/this.childElementWidth)*this.childElementWidth;t=e===m.slideToRight?i:n}this.offset=t<this.minOffset?this.minOffset:t>=0?0:t}initLevelSlider(){var e;if(!(null===(e=this.levelsElement)||void 0===e?void 0:e.firstElementChild))return void console.log("Widget[elevate-level-list] DOM is not ready.");const t=this.levelsElement.parentElement.clientWidth,i=this.isMobile?this.levelsElement.scrollWidth:this.levelsElement.clientWidth,n=this.levelsElement.childElementCount;if(n<=1)return this.showSliderButton=!1,this.minOffset=0,this.offset=0,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,void(this.moveCountForOneTouch=1);this.showSliderButton=!this.isMobile&&this.levelsElement.clientWidth>t,this.minOffset=t-i,this.childElementWidth=this.levelsElement.firstElementChild.clientWidth,n>1&&(this.childElementWidth+=(i-this.childElementWidth*n)/(n-1)),this.moveCountForOneTouch=Math.max(1,Math.ceil(t/this.childElementWidth)-1)}debounce(e,t){{let i;return()=>{clearTimeout(i),i=setTimeout((()=>{e()}),t)}}}convertNumberToCompactForm(e){return e>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"b":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"m":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":e.toString()}handleResize(){this.debounce(this.initLevelSlider.bind(this),200)()}componentDidRender(){this.host.componentOnReady().then((()=>{this.initLevelSlider()}))}render(){var e;return t(n,{key:"780e54c101e1dd10513f959b08e3b7425ebba3ec"},this.levels&&[t("div",{key:"70e7265746f1cb4788d137c43b9addf1443a6ae3",class:`SliderButton LeftButton ${0==this.offset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(m.slideToRight)},t("svg",{key:"20184f3e02bebe818f5119b9b71105a1d7e11681",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"351e4a93e390f430045642692b585867e9569b6a","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{key:"d21722ad058c4e83d23dfaa6822850557de4e620",class:"LevelItemsWrapper"},t("div",{key:"03dccfd305222e9e4eb53277efeef43711f3b664",style:{left:`${this.offset}px`},class:`LevelItems ${this.isMobile?"Mobile":""} ${this.isMobile&&1===(null===(e=this.levels)||void 0===e?void 0:e.length)?"SingleItem":""}`,id:"levelItems",ref:e=>{this.levelsElement=e}},this.levels.map(((e,i)=>t("div",{class:"Item "+(this.selectedLevelId==e.id?"Active":""),onClick:this.onLevelClicked.bind(this,e)},t("img",{alt:`Presentation Icon for ${e.presentation.displayName}`,class:"LevelImg",src:e.presentation.asset}),t("span",{class:"LevelName",title:e.presentation.displayName},e.presentation.displayName),t("span",{class:"LevelPoints"},0==i?"":">",this.convertNumberToCompactForm(e.firstEntryPoints)," ",y("points",this.language))))))),t("div",{key:"6fe81dc6338a8dc29e2a9dc7aedcbdb618660c82",class:`SliderButton RightButton ${this.offset<=this.minOffset?"Disabled":""} ${this.showSliderButton?"":"Hidden"}`,onClick:()=>this.slideTo(m.slideToLeft)},t("svg",{key:"26e11511a54ac6d43fab18d39f0483f86af470cf",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"6f3d02eb56c674a82a008022b0f8304a9c4bd72f","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))])}get host(){return l(this)}static get watchers(){return{selectedLevelId:["levelsChangedHandler"]}}};x.style="elevate-level-list{display:flex;flex-direction:row}.LevelItemsWrapper{display:flex;flex:1;margin-top:10px;min-height:30px;transition-property:all;position:relative;height:138px;overflow-x:hidden}.Mobile.LevelItems{overflow-x:hidden}.LevelItems{overflow-x:auto;display:flex;flex-direction:row;gap:10px;left:0;position:absolute;transition:left 0.5s ease-in-out}.LevelItems .Item:hover,.LevelItems .Item.Active{background-color:var(--emw--color-gray-50, rgb(244, 244, 244));box-shadow:0px 4px 13px 0px rgba(0, 0, 0, 0.25)}.LevelItems .Item{width:86px;height:125px;border-radius:15px;text-align:center;display:flex;flex-direction:column;cursor:pointer}.LevelItems .Item .LevelName{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.LevelItems .Item .LevelPoints{color:var(--emw--color-gray-100, rgb(118, 113, 113));font-size:10px}.LevelItems .Item .LevelImg{width:65px;height:68px;margin:11px auto}.SliderButton{display:flex;width:29px;align-items:center;cursor:pointer}.SliderButton.Disabled svg{stroke:var(--emw--color-gray-50, #cbc5c5)}.SliderButton.Hidden{display:none}.LevelItems.Mobile.SingleItem{left:0 !important;width:100%;display:flex;justify-content:center;flex-wrap:nowrap;padding:0}.LevelItems.Mobile.SingleItem .Item{flex-grow:0;flex-shrink:0}";const L=class{constructor(t){e(this,t),this.elevateLevel=void 0}render(){return t(n,{key:"16d128717e716f7ca7d3bb77fc3a2e67209318b6"},t("div",{key:"658657abdfc64844bd2af40562efe40385e1735a",class:"Row Desc"},t("h3",{key:"ec5871c2f810c8c120bf99510717381175bc1ef4"},this.elevateLevel.presentation.displayName),t("p",{key:"865915c6eea90295238fb47eaa91c8f968199ca5"},t("span",{key:"2b90c6c5d6957b73fc4a0f53d53da0ca023a4f0a",class:"TxtDesc",innerHTML:this.elevateLevel.presentation.description}))))}};L.style=":host{display:block}.PriviliegeList{padding-inline-start:5px}.PriviliegeList li{display:flex}.PriviliegeList li .Img{width:80px}.PriviliegeList li .Img img{width:60px;margin:10px}.PriviliegeList li .Content h4{text-transform:capitalize;margin-block-start:10px}";var I,k,C,E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},S={exports:{}};I=S,k=S.exports,C=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==E)return E;throw new Error("unable to locate global object")}(),I.exports=k=C.fetch,C.fetch&&(k.default=C.fetch.bind(C)),k.Headers=C.Headers,k.Request=C.Request,k.Response=C.Response;const P=S.exports,T=class{constructor(t){e(this,t),this.elevateLevelsDataChange=i(this,"elevateLevelsDataChange",7),this.scopeParams=void 0}async componentWillRender(){if(!this.scopeParams.endpoint)return;let e=new URL(`${this.scopeParams.endpoint}/v1/elevate/levels?language=${this.scopeParams.language}`);await P(e.href).then((e=>e.json())).then((e=>{const t=e.data.sort(((e,t)=>e.firstEntryPoints<t.firstEntryPoints?-1:1));let i=this.scopeParams.selectedLevelId;if(!i&&this.scopeParams.showDefault&&t.length>0&&(i=t[0].id),i){const e=t.filter((e=>e.id==i))[0];this.elevateLevelsDataChange.emit({currentLevel:e})}this.elevateLevelsDataChange.emit({clearError:!0}),this.elevateLevelsDataChange.emit({elevateLevels:t})})).catch((e=>{this.elevateLevelsDataChange.emit({errorMessage:{type:"errorWhenLoadElevateLevels",err:e}}),console.error(e)}))}};T.style=":host{display:block}";const R="__WIDGET_GLOBAL_STYLE_CACHE__";function M(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function _(e,t){if(!e||!t)return;const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function D(e,t,i,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return i=function(e,t){const i=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(i.innerHTML=t,e.appendChild(i))}))}(e,t),i;window[R]||(window[R]={}),i=function(e,t){return window.emMessageBus.subscribe(t,(i=>{if(!e)return;const n=e.getRootNode(),l=window[R];let s=l[t]&&l[t].sheet;s?l[t].refCount=l[t].refCount+1:(s=new CSSStyleSheet,s.replaceSync(i),l[t]={sheet:s,refCount:1});const a=n.adoptedStyleSheets||[];a.includes(s)||(n.adoptedStyleSheets=[...a,s])}))}(e,t);const l=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[R][t]){const e=window[R][t];e.refCount>1?e.refCount=e.refCount-1:delete window[R][t]}l()},i}const $=class{constructor(t){e(this,t),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(this.mbSource&&D(this.el,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&M(this.el,this.clientStyling),this.clientStylingUrl&&_(this.el,this.clientStylingUrl),this.stylingAppends=!0)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleMbSourceChange(e,t){e!=t&&D(this.el,`${this.mbSource}.Style`,this.stylingSubscription)}handleClientStylingChange(e,t){e!=t&&M(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&_(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&M(this.el,this.clientStyling),this.clientStylingUrl&&_(this.el,this.clientStylingUrl),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const n=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]||{},Object.keys(t[e]).forEach((n=>{if(!i.en[n])return;const l=i.en[n];"object"==typeof t[e][n]?(i[e][n]=i[e][n]||Object.assign({},l),Object.keys(t[e][n]).forEach((l=>{i[e][n][l]=t[e][n][l]}))):i[e][n]=t[e][n]||Object.assign({},l)}))})),e(!0)})).catch((t=>{console.error("Failed to load translations:",t),e(!1)}))})));e.push(n)}var t,i;return await Promise.all(e)}render(){return t("div",{key:"e660ceb69f5e848c788c3924fc814c0fa7a777a2",class:"StyleShell"},t("slot",{key:"35014b6c0c32532af11e6a629ba9b13942504d21",name:"mainContent"}))}get el(){return l(this)}static get watchers(){return{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};function O(e){d(1,arguments);var t=h(e);return t.setHours(0,0,0,0),t}function A(e,t){return d(2,arguments),h(e).getTime()-h(t).getTime()}$.style=":host{display:block}";var B={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function j(e){return e?B[e]:B.trunc}const z=class{constructor(t){e(this,t),this.playerElevateLeveLoaded=i(this,"playerElevateLeveLoaded",7),this.params=void 0,this.playerElevateLevel=void 0,this.pointExpireString=void 0}handleWindowResizs(){this.initLevelProgressbar()}onParamsChanged(){this.loadElevateInfo()}redeemGiftButtonHandler(){this.loadElevateInfo()}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}loadLevels(){let e=new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);return new Promise(((t,i)=>fetch(e.href,{method:"GET"}).then((e=>e.json())).then((e=>{this.levels=e.data,t(!0)})).catch((e=>{i(e)}))))}calcuatePointsToBeExpired(e,t){let i="";if(!e||!e.aboutToExpire||0==e.aboutToExpire.length||e.aboutToExpire[0].points<=0)return i;e.aboutToExpire.sort(((e,t)=>function(e,t){d(2,arguments);var i=h(e),n=h(t);return i.getTime()<n.getTime()}(new Date(e.expireTime),new Date(t.expireTime))?-1:1));const n=e.aboutToExpire[0],l=function(e,t){d(2,arguments);var i=O(e),n=O(t),l=i.getTime()-c(i),s=n.getTime()-c(n);return Math.round((l-s)/864e5)}(new Date(n.expireTime),new Date);let s=0,a=0,r=0===l?`${t}Day`:t;return l<=0&&(s=function(e,t,i){d(2,arguments);var n=A(e,t)/36e5;return j(null==i?void 0:i.roundingMethod)(n)}(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),r=s>1?`${t}Hours`:`${t}Hour`,s<=0&&(a=function(e,t,i){d(2,arguments);var n=A(e,t)/6e4;return j(null==i?void 0:i.roundingMethod)(n)}(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),r=a>1?`${t}Minutes`:`${t}Minute`)),i=o(r,{expirationPoints:n.points,expireDay:Math.max(l,s,a),lang:this.params.language}),i}loadPlayerLevelInfo(){let e=new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);return new Promise(((t,i)=>fetch(e.href,{method:"GET",headers:{"X-Sessionid":this.params.session,"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{var n,l,s,a,o;if(!e.success)return console.error("Exception when fetch user elevateinfo, ",e.errorCode,e.errorMessage),void i(!0);window.postMessage({type:"UpdateGamificationXp",points:null===(l=null===(n=e.data)||void 0===n?void 0:n.level)||void 0===l?void 0:l.loyaltyPoints},window.location.href);let r=e.data;this.playerElevateLevel=r.level,this.playerElevateLevel.name=this.playerElevateLevel.presentation.displayName||this.playerElevateLevel.name,this.playerElevateLevel.spendablePoints=(null===(s=r.spendableWallet)||void 0===s?void 0:s.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const d=null===(a=e.data.spendableWallet)||void 0===a?void 0:a.total,h=null===(o=e.data.loyaltyWallet)||void 0===o?void 0:o.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:d,loyaltyWalletTotal:h});let c=this.calcuatePointsToBeExpired(d,"coinsToBeExpired"),v=this.calcuatePointsToBeExpired(h,"pointsToBeExpired");(c||v)&&this.playerElevateLeveLoaded.emit({pointExpireString:c,xpExpireString:v}),t(this.playerElevateLevel)})).catch((e=>{console.log("error ",e),i(!0)}))))}setLoyaltyProgress(e){!function(e,t){const i=e.querySelector("#total_level"),n=i.getBBox().width,l=t>1?1:t,s=l*n-17<0?0:l*n-17,a=e.querySelector("#current_level"),o=e.querySelector("#filter_current_level"),r=e.querySelector("#circle_current_level");i.setAttribute("viewbox",`0 0 ${s} 28`),a.setAttribute("width",`${s}`),r.setAttribute("cx",`${s<6.5?6.5:s}`),o.setAttribute("x",""+(s-8));const d=e.querySelector("#lock"),h=e.querySelector("#filter_heart_ball"),c=e.querySelector("#filter_ball"),v=e.querySelector("#filter_heart"),f=e.querySelector("#filter_lock"),p=e.querySelector("#paint0_linear_ball"),g=e.querySelector("#paint1_linear_lock"),u=e.querySelector("#lock_box"),b=e.querySelector("#heart_box"),y=n-10;d.setAttribute("cx",`${y}`),g.setAttribute("x1",`${y}`),g.setAttribute("x2",`${y}`),p.setAttribute("x1",""+(y-6)),p.setAttribute("x2",""+(y-6+11.2)),f.setAttribute("x",""+(y-6)),v.setAttribute("x",""+(y-6-2)),c.setAttribute("x",""+(y-6-2-2)),h.setAttribute("x",""+(y-6-2-2-4)),u.setAttribute("x",""+(y-6)),b.setAttribute("x",""+(y-6)),i.parentElement.style.opacity="1"}(this.loyaltyProgressEle,e)}initLevelProgressbar(){setTimeout((()=>{this.loyaltyProgressEle=this.elevateCardRef.parentElement.querySelector("#LevelProgress"),this.loyaltyProgressEle&&(this.setLoyaltyProgress(this.playerElevateLevel.nextLevel?this.playerElevateLevel.loyaltyPoints/this.playerElevateLevel.nextLevel.entryPoints:1),this.params.playerElevateLevel=this.playerElevateLevel)}),80)}componentDidRender(){this.initLevelProgressbar()}loadElevateInfo(){if(!this.params.endpoint||!this.params.session)return;const e=[];e.push(this.loadPlayerLevelInfo()),this.params.calculateLevelFlag&&e.push(this.loadLevels()),Promise.all(e).then((e=>{if(console.log("elevate-init",e),this.initLevelProgressbar(),!this.levels)return;this.levels.sort(((e,t)=>e.firstEntryPoints>t.firstEntryPoints?1:-1));const t=this.playerElevateLevel.loyaltyPoints;let i=0;this.levels.forEach(((e,n)=>{t>e.firstEntryPoints&&(i=n)})),this.playerElevateLeveLoaded.emit({calculatedLevelFlag:i})}))}componentWillLoad(){this.loadElevateInfo()}get elevateCardRef(){return l(this)}static get watchers(){return{params:["onParamsChanged"]}}};z.style=':host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emw--color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emw--color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: "";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level0-bg0, #E2792C) 0%, var(--emw--elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level1-bg0, #BEBFED) 0%, var(--emw--elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level2-bg0, #FCC410) 0%, var(--emw--elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level3-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emw--elevate-color-level4-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emw--elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: var(--emw--border-radius-medium, 10px);\n background: var(--emw--elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);\n}\n.Inner .Row .RedeemButton span {\n color: var(--emw--color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emw--color-red, #9e595f);\n}';const N=class{constructor(t){e(this,t),this.endpoint=void 0,this.session=void 0,this.playerAvatarUrl=void 0,this.language=void 0,this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.userLevelId=void 0}setPlayerElevateLevelInfo(e){"playerElevateLeveLoaded"===e.type&&e.detail.elevateLevel&&(this.userLevelId=e.detail.elevateLevel.id)}render(){return t(n,{key:"6fe9245d801450135e6bcbde98e695274c96843d"},t("div",{key:"4f54bdcab376982cabe42bbbc5789e1d00381617",class:"PlayerElevateCard"},t("player-elevate-loyaltycard",{key:"fcae0187fc7df6760124288049e785c7bcbd4c7a",playerName:this.playerName,dateFormat:this.dateFormat,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,mbSource:this.mbSource,clientStyling:`${this.clientStyling} .Outer{height: 185px}`,endpoint:this.endpoint,language:this.language,session:this.session})),t("div",{key:"4056a7ee6d4069466f92bd089979cef530af2f41",class:"ElevateLevelsInfo"},t("bonus-elevate-levels",{key:"b7ec448dd2c24afb967afcef9f7f975e5d86576c",selectedLevelId:this.userLevelId,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,translationUrl:this.translationUrl,mbSource:this.mbSource,language:this.language,endpoint:this.endpoint})),t("general-styling-wrapper",{key:"b8371fd6be5555f9dc0cc5314ab64798f5e7f364",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource}))}};N.style=":host{display:block}.PlayerElevateCard{height:160px;width:100%;overflow:hidden}.ElevateLevelsInfo{background-color:var(--emw--color-background, #e6e8ea)}";const U=class{constructor(t){e(this,t),this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.playerAvatarUrl=void 0,this.language="en",this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.pointExpireString=void 0,this.playerElevateLevel=void 0,this.elevateWalletTotal=void 0}onSessionOrEndpointChange(){this.paramProxy=Object.assign(Object.assign({},this.paramProxy),{session:this.session,endpoint:this.endpoint,language:this.language})}playerElevateLeveLoadedHandler(e){e.detail&&(e.detail.elevateLevelWalletTotal&&(this.elevateWalletTotal=e.detail.elevateLevelWalletTotal),e.detail.elevateLevel&&(this.playerElevateLevel=e.detail.elevateLevel),e.detail.xpExpireString&&(this.pointExpireString=e.detail.xpExpireString))}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}componentWillLoad(){this.paramProxy={endpoint:this.endpoint,session:this.session,language:this.language}}getNextLevelPoints(){var e,t;return(null===(e=this.playerElevateLevel)||void 0===e?void 0:e.nextLevel)?null===(t=this.playerElevateLevel)||void 0===t?void 0:t.nextLevel.entryPoints:-1}getNextLevelTips(){var e;let t=null===(e=this.playerElevateLevel)||void 0===e?void 0:e.nextLevel;if(this.playerElevateLevel&&t){const e=(t.entryPoints-this.playerElevateLevel.loyaltyPoints).toFixed(2);return o("tipsForNextLevel",{pointsToReach:e,levelName:t.name,lang:this.language})}return""}render(){const e=s("../static/card-ground.svg"),i=s("../static/card-ground-over.svg");return t("div",{key:"9f673b8dccc848d11f0836c15f1f5da5e242e3b3",class:`ElevateCardWrapper ${this.theme}`},t("div",{key:"419c71a612c3cdfebaece1e90345c6324c68348e",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},t("general-styling-wrapper",{key:"04c1098bf16e683f30d211dfb9ebc0b319076258",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:r,translationUrl:this.translationUrl,mbSource:this.mbSource}),t("player-elevate-card-data",{key:"a9c57ef6c5c3381c7e9bf2f041a190f3de3a0423",params:this.paramProxy}),t("div",{key:"402ceddce75abb2ee6b59db730418efc006e5c60",class:"OuterCover Inner",style:{backgroundImage:`url(${i}`}},t("div",{key:"844cba8ae40b9dd55129f7b0d52a208ea72e72cf",class:"Content Row"},this.playerElevateLevel&&t(a,{key:"d365971e66cbdc81d4b1758c045a76ad50a68729"},t("div",{key:"2e017a95d80098565d17807c6f8dae51a6b89090",class:"PlayerImg"},t(v,{key:"5aaf4b8e2b8ea67fa0fed1a07dde9caf2551a3bd",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),t("div",{key:"6e332314f4c4a233dd353130266a4d0368b0de45",class:`LevelInfo ${this.playerElevateLevel.name}`},t("div",{key:"06311b5920ac4126536760049bf3664d92cc247f",class:"CardCell ElevateLevel"},t("span",{key:"4538afdef55cd520e2d213e6a97d209234deabe5",class:"LevelName",title:this.playerElevateLevel.name},this.playerElevateLevel.name)),t("div",{key:"cb2764c587a2fe1719b2ff6e045866ee032d5a66",class:"PointsRange"},t(f,{key:"c794dc4acd33555811187df5b2748b012af77cbf",loyaltyPoints:this.playerElevateLevel.loyaltyPoints<=0?0:this.playerElevateLevel.loyaltyPoints,language:this.language}),t(f,{key:"b88eb09ad61ea38214df4877976c6481626ae005",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),t(p,{key:"91fba9132a54ea109bd17a9844390947cf65b902"}),t("div",{key:"950323f3966e6db2c41e06fe6d7be123d09cc496",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&t("div",{key:"2ee3c2b317274fdef1cf1a9b2905d023b7485c22",class:"PointsInfo ExpirationPoints"},this.pointExpireString," "),this.playerElevateLevel.expireTime&&t(g,{key:"db5824c90848a51566ff2a158ff6dc6a292009b2",expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat,language:this.language})))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};U.style=":host{display:block}@media screen and (min-width: 501px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:nowrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:6px;margin-left:0px}}@media screen and (max-width: 500px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:wrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:0px;margin-left:0px}}.LoyaltyCard .Inner .LevelProgress{margin-left:0px}.LoyaltyCard .Inner .Row .PointsInfo.ExpirationPoints{text-align:left;color:var(--emw--color-red-50, red)}.LoyaltyCard .Inner .PlayerAvatar .Avatar{display:none}.LoyaltyCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%}.LoyaltyCard .Inner .LevelInfo .ElevateLevel{display:flex;flex:1;align-items:center}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{position:relative;padding-left:0px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate .ExpireTime{margin-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .LevelName{padding-left:0;font-size:var(--emw--elevate-fontsize-2xlarge, 21px);position:relative;width:auto;color:var(--emw--elevate-color-levelname, #FFBD2B);font-weight:bold}.LoyaltyCard .PointsRange{display:flex;justify-content:space-between}.LoyaltyCard .PointsRange .PointsInfo{width:auto}.LoyaltyCard .NextLevelTip{text-align:right;font-size:11px;color:var(--emw--color-black, #000);opacity:0.8;font-weight:bold}";export{w as bonus_elevate_levels,x as elevate_level_list,L as elevate_level_presentation,T as elevate_levels_data,$ as general_styling_wrapper,z as player_elevate_card_data,N as player_elevate_level,U as player_elevate_loyaltycard}
@@ -1 +1 @@
1
- import{p as e,b as a}from"./index-8b0eeaf7.js";export{s as setNonce}from"./index-8b0eeaf7.js";import{g as l}from"./app-globals-0f993ce5.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["bonus-elevate-levels_8",[[1,"player-elevate-level",{endpoint:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],playerName:[513,"player-name"],dateFormat:[513,"date-format"],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],userLevelId:[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],endpoint:[513],language:[513],translationUrl:[513,"translation-url"],selectedLevelId:[1537,"selected-level-id"],showDefault:[4,"show-default"],elevateLevelParamProxy:[32],elevateLevels:[32],currentLevel:[32],errorMessage:[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{endpoint:[513],theme:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],playerName:[513,"player-name"],dateFormat:[513,"date-format"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],pointExpireString:[32],playerElevateLevel:[32],elevateWalletTotal:[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{levels:[16],language:[1],selectedLevelId:[1537,"selected-level-id"],showSliderButton:[32],touchPosStart:[32],touchPosEnd:[32],offset:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[9,"resize","handleResize"]],{selectedLevelId:["levelsChangedHandler"]}],[0,"elevate-level-presentation",{elevateLevel:[16]}],[0,"elevate-levels-data",{scopeParams:[1544,"scope-params"]}],[0,"player-elevate-card-data",{params:[8],playerElevateLevel:[32],pointExpireString:[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{params:["onParamsChanged"]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[1,"translation-url"],targetTranslations:[16]},null,{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]],["player-elevate-card",[[1,"player-elevate-card",{endpoint:[513],theme:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],playerName:[513,"player-name"],dateFormat:[513,"date-format"],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],pointExpireString:[32],playerLevelFlag:[32],playerElevateLevel:[32],elevateWalletTotal:[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard",[[1,"player-elevate-pointcard",{endpoint:[513],theme:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],mbSource:[513,"mb-source"],playerName:[513,"player-name"],cardTitle:[513,"card-title"],buttonType:[513,"button-type"],dateFormat:[513,"date-format"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],pointExpireString:[32],playerElevateLevel:[32],elevateWalletTotal:[32],elevateSPTotal:[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}]]],["player-rakeback-card",[[1,"player-rakeback-card",{endpoint:[513],theme:[513],session:[513],language:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],show:[516],rakebackInfo:[32],isLoading:[32],coolingOffPeriod:[32],showTheWidget:[32]},[[8,"message","handleMessage"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],show:["onShowOrHasRakebackWalletChange"],rakebackInfo:["onShowOrHasRakebackWalletChange"]}]]]],e))));
1
+ import{p as e,b as a}from"./index-8b0eeaf7.js";export{s as setNonce}from"./index-8b0eeaf7.js";import{g as l}from"./app-globals-0f993ce5.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["bonus-elevate-levels_8",[[1,"player-elevate-level",{endpoint:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],playerName:[513,"player-name"],dateFormat:[513,"date-format"],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],userLevelId:[32]},[[0,"playerElevateLeveLoaded","setPlayerElevateLevelInfo"]]],[1,"bonus-elevate-levels",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],mbSource:[513,"mb-source"],endpoint:[513],language:[513],translationUrl:[513,"translation-url"],selectedLevelId:[1537,"selected-level-id"],showDefault:[4,"show-default"],elevateLevelParamProxy:[32],elevateLevels:[32],currentLevel:[32],errorMessage:[32]},[[0,"selectedLevelChanged","selectedLevelChangedHandler"],[2,"elevateLevelsDataChange","elevateLevelsDataChangeHandler"]],{selectedLevelId:["selectedLevelIdChangedHandler"],elevateLevels:["selectedLevelIdChangedHandler"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],translationUrl:["handleNewTranslations"]}],[1,"player-elevate-loyaltycard",{endpoint:[513],theme:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],playerName:[513,"player-name"],dateFormat:[513,"date-format"],mbSource:[1,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],pointExpireString:[32],playerElevateLevel:[32],elevateWalletTotal:[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}],[0,"elevate-level-list",{levels:[16],language:[1],selectedLevelId:[1537,"selected-level-id"],showSliderButton:[32],touchPosStart:[32],touchPosEnd:[32],offset:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"],[9,"resize","handleResize"]],{selectedLevelId:["levelsChangedHandler"]}],[0,"elevate-level-presentation",{elevateLevel:[16]}],[0,"elevate-levels-data",{scopeParams:[1544,"scope-params"]}],[0,"player-elevate-card-data",{params:[8],playerElevateLevel:[32],pointExpireString:[32]},[[9,"resize","handleWindowResizs"],[8,"redeemGiftButton","redeemGiftButtonHandler"]],{params:["onParamsChanged"]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[1,"translation-url"],targetTranslations:[16]},null,{mbSource:["handleMbSourceChange"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]],["player-elevate-card",[[1,"player-elevate-card",{endpoint:[513],theme:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],playerName:[513,"player-name"],dateFormat:[513,"date-format"],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],pointExpireString:[32],playerLevelFlag:[32],playerElevateLevel:[32],elevateWalletTotal:[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}]]],["player-elevate-pointcard",[[1,"player-elevate-pointcard",{endpoint:[513],theme:[513],session:[513],playerAvatarUrl:[513,"player-avatar-url"],language:[513],mbSource:[513,"mb-source"],playerName:[513,"player-name"],cardTitle:[513,"card-title"],buttonType:[513,"button-type"],dateFormat:[513,"date-format"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],pointExpireString:[32],playerElevateLevel:[32],elevateWalletTotal:[32],elevateSPTotal:[32]},[[0,"playerElevateLeveLoaded","playerElevateLeveLoadedHandler"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}]]],["player-rakeback-card",[[1,"player-rakeback-card",{endpoint:[513],theme:[513],session:[513],language:[513],mbSource:[513,"mb-source"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],show:[516],rakebackInfo:[32],isLoading:[32],coolingOffPeriod:[32],showTheWidget:[32]},[[8,"message","handleMessage"]],{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],show:["onShowOrHasRakebackWalletChange"],rakebackInfo:["onShowOrHasRakebackWalletChange"]}]]]],e))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-elevate-level",
3
- "version": "1.94.37",
3
+ "version": "1.94.38",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",