@everymatrix/casino-tournament-banner 1.30.0 → 1.30.1

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.
@@ -1,8 +1,7 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-be35c232.js';
2
- import '@everymatrix/casino-tournament-buttons';
3
2
 
4
- const DEFAULT_LANGUAGE = 'en';
5
- const TRANSLATIONS = {
3
+ const DEFAULT_LANGUAGE$1 = 'en';
4
+ const TRANSLATIONS$1 = {
6
5
  en: {
7
6
  joined: 'Joined',
8
7
  join: 'Join',
@@ -388,15 +387,15 @@ const TRANSLATIONS = {
388
387
  days: 'dani',
389
388
  }
390
389
  };
391
- const translate = (key, customLang) => {
390
+ const translate$1 = (key, customLang) => {
392
391
  var _a, _b;
393
392
  const lang = customLang;
394
- return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
393
+ return ((_a = TRANSLATIONS$1[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS$1[DEFAULT_LANGUAGE$1]) === null || _b === void 0 ? void 0 : _b[key]);
395
394
  };
396
- const getTranslations = (data) => {
395
+ const getTranslations$1 = (data) => {
397
396
  Object.keys(data).forEach((item) => {
398
397
  for (let key in data[item]) {
399
- TRANSLATIONS[item][key] = data[item][key];
398
+ TRANSLATIONS$1[item][key] = data[item][key];
400
399
  }
401
400
  });
402
401
  };
@@ -6120,7 +6119,7 @@ const CasinoTournamentBanner = class {
6120
6119
  return ((new Date(dateString2)).getTime() - (new Date(dateString1)).getTime()) / (1000 * 60);
6121
6120
  }
6122
6121
  getTextByDiff(diff) {
6123
- const renderText = (amount, type) => ' - ' + amount + ' ' + translate(type);
6122
+ const renderText = (amount, type) => ' - ' + amount + ' ' + translate$1(type);
6124
6123
  const renderTimeColumn = (column) => {
6125
6124
  const columnInt = Math.floor(column);
6126
6125
  if (columnInt < 10) {
@@ -6160,16 +6159,16 @@ const CasinoTournamentBanner = class {
6160
6159
  let text = '';
6161
6160
  switch (state) {
6162
6161
  case 'Upcoming':
6163
- text = translate('scheduled', this.language);
6162
+ text = translate$1('scheduled', this.language);
6164
6163
  break;
6165
6164
  case 'Unstarted':
6166
- text = translate('scheduled', this.language);
6165
+ text = translate$1('scheduled', this.language);
6167
6166
  break;
6168
6167
  case 'Running':
6169
- text = translate('ongoing', this.language);
6168
+ text = translate$1('ongoing', this.language);
6170
6169
  break;
6171
6170
  default:
6172
- text = translate('finished', this.language);
6171
+ text = translate$1('finished', this.language);
6173
6172
  break;
6174
6173
  }
6175
6174
  return text;
@@ -6207,14 +6206,14 @@ const CasinoTournamentBanner = class {
6207
6206
  let currentDate = new Date(this.startTime);
6208
6207
  const setTranslation = () => {
6209
6208
  return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6210
- translate('startedAt', this.language) :
6211
- translate('startingAt', this.language);
6209
+ translate$1('startedAt', this.language) :
6210
+ translate$1('startingAt', this.language);
6212
6211
  };
6213
6212
  if (this.shortStart) {
6214
6213
  let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6215
6214
  this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6216
- translate('startedAtWithTime', this.language) + startTimeAsString :
6217
- translate('startingAtWithTime', this.language) + startTimeAsString;
6215
+ translate$1('startedAtWithTime', this.language) + startTimeAsString :
6216
+ translate$1('startingAtWithTime', this.language) + startTimeAsString;
6218
6217
  }
6219
6218
  else {
6220
6219
  let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
@@ -6222,14 +6221,14 @@ const CasinoTournamentBanner = class {
6222
6221
  let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6223
6222
  this.startdate =
6224
6223
  `${currentDay}` + ' ' +
6225
- translate(`${currentMonthKey}`, this.language) + ', ' +
6224
+ translate$1(`${currentMonthKey}`, this.language) + ', ' +
6226
6225
  setTranslation() +
6227
6226
  ` ${currentHour}`;
6228
6227
  }
6229
6228
  }
6230
6229
  componentWillLoad() {
6231
6230
  if (this.translationData) {
6232
- getTranslations(JSON.parse(this.translationData));
6231
+ getTranslations$1(JSON.parse(this.translationData));
6233
6232
  if (this.state) {
6234
6233
  this.stateText = this.getStateText(this.state);
6235
6234
  }
@@ -6264,17 +6263,573 @@ const CasinoTournamentBanner = class {
6264
6263
  h("span", { class: "Tag Date" }, this.showCalendar &&
6265
6264
  h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "BannerInfo", part: "BannerInfo" }, this.enrolled &&
6266
6265
  h("span", { class: "Tag Enroll" }, this.showCheck &&
6267
- h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate('enrolled', this.language)))), this.cardMode && h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate('tournament', this.language)), h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6268
- h("span", { class: "Tag Join" }, h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate('joined', this.language))
6266
+ h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('enrolled', this.language)))), this.cardMode && h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate$1('tournament', this.language)), h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6267
+ h("span", { class: "Tag Join" }, h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('joined', this.language))
6269
6268
  :
6270
6269
  this.session && this.state != 'Closed' &&
6271
- h("span", { class: "Tag Join" }, h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate('join', this.language)), this.state == 'Running' && h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6272
- h("span", { class: "TagRemain" }, this.showRemain, " ", translate('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6270
+ h("span", { class: "Tag Join" }, h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate$1('join', this.language)), this.state == 'Running' && h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6271
+ h("span", { class: "TagRemain" }, this.showRemain, " ", translate$1('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6273
6272
  h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6274
- h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "ThumbButtons" }, h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-data": this.translationData })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate('terms', this.language))))));
6273
+ h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "ThumbButtons" }, h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-data": this.translationData })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('terms', this.language))))));
6275
6274
  }
6276
6275
  get host() { return getElement(this); }
6277
6276
  };
6278
6277
  CasinoTournamentBanner.style = casinoTournamentBannerCss;
6279
6278
 
6280
- export { CasinoTournamentBanner as casino_tournament_banner };
6279
+ const getDevice = () => {
6280
+ let userAgent = window.navigator.userAgent;
6281
+ if (userAgent.toLowerCase().match(/android/i)) {
6282
+ return 'Android';
6283
+ }
6284
+ if (userAgent.toLowerCase().match(/iphone/i)) {
6285
+ return 'iPhone';
6286
+ }
6287
+ if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
6288
+ return 'iPad';
6289
+ }
6290
+ return 'PC';
6291
+ };
6292
+
6293
+ const DEFAULT_LANGUAGE = 'en';
6294
+ const TRANSLATIONS = {
6295
+ en: {
6296
+ joined: 'Joined',
6297
+ join: 'Join',
6298
+ enrolled: 'Enrolled',
6299
+ scoreCriteria: 'Score Criteria',
6300
+ minbet: 'min bet count',
6301
+ seegames: 'You can see the games',
6302
+ here: 'here',
6303
+ scheduled: 'Scheduled',
6304
+ ongoing: 'Ongoing',
6305
+ finished: 'Finished',
6306
+ startingAt: 'Starting at:',
6307
+ startedAt: 'Started at:',
6308
+ startingAtWithTime: `Starts `,
6309
+ startedAtWithTime: `Started `,
6310
+ mostRounds: 'Most Rounds',
6311
+ betCount: 'Number of Bets',
6312
+ maxWinStakeRatio: 'Max Win per Stake',
6313
+ winStakeRatio: 'Total Win per Stake',
6314
+ January: 'January',
6315
+ February: 'February',
6316
+ March: 'March',
6317
+ April: 'April',
6318
+ May: 'May',
6319
+ June: 'June',
6320
+ July: 'July',
6321
+ August: 'August',
6322
+ September: 'September',
6323
+ October: 'October',
6324
+ November: 'November',
6325
+ December: 'December',
6326
+ login: 'Log in',
6327
+ register: 'Register',
6328
+ details: 'Details',
6329
+ joinerror: 'An error occurred while registering in the tournament, please try again.'
6330
+ },
6331
+ 'zh-hk': {
6332
+ enrolled: '已註冊',
6333
+ scoreCriteria: '評分標準',
6334
+ minbet: '最小投注數:',
6335
+ seegames: '你可以看比賽',
6336
+ here: '這裡',
6337
+ scheduled: '預定的',
6338
+ ongoing: '進行中',
6339
+ finished: '完成的',
6340
+ startingAt: '開始於',
6341
+ startedAt: '大多數回合',
6342
+ mostRounds: '投注數',
6343
+ betCount: '投注计数',
6344
+ maxWinStakeRatio: '最大勝率',
6345
+ winStakeRatio: '勝率',
6346
+ January: '一月',
6347
+ February: '二月',
6348
+ March: '行进',
6349
+ April: '四月',
6350
+ May: '可能',
6351
+ June: '六月',
6352
+ July: '七月',
6353
+ August: '八月',
6354
+ September: '九月',
6355
+ October: '十月',
6356
+ November: '十一月',
6357
+ December: '十二月',
6358
+ login: '登錄',
6359
+ register: '登記',
6360
+ details: '細節',
6361
+ join: '加入',
6362
+ joinerror: '加入錦標賽時出錯,請重試'
6363
+ },
6364
+ fr: {
6365
+ enrolled: 'Inscrits',
6366
+ scoreCriteria: 'Critères de notation',
6367
+ minbet: 'nombre de paris minimum',
6368
+ seegames: 'Vous pouvez voir les jeux',
6369
+ here: 'ici',
6370
+ scheduled: 'Programmé',
6371
+ ongoing: 'En cours',
6372
+ finished: 'Fini',
6373
+ startingAt: 'À partir de:',
6374
+ startedAt: 'Commencé à:',
6375
+ mostRounds: 'Le plus grand nombre de tours',
6376
+ betCount: 'Nombre de paris',
6377
+ maxWinStakeRatio: 'Indice maximum du gain d\'une mise',
6378
+ winStakeRatio: 'Indice du gain d\'une mise',
6379
+ January: 'January',
6380
+ February: 'February',
6381
+ March: 'March',
6382
+ April: 'April',
6383
+ May: 'May',
6384
+ June: 'June',
6385
+ July: 'July',
6386
+ August: 'August',
6387
+ September: 'September',
6388
+ October: 'October',
6389
+ November: 'November',
6390
+ December: 'December',
6391
+ login: 'Connexion',
6392
+ register: 'Enregistre',
6393
+ details: 'Détails',
6394
+ join: 'Rejoignez',
6395
+ joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - '
6396
+ },
6397
+ ro: {
6398
+ enrolled: 'Înscris',
6399
+ scoreCriteria: 'Criterii de punctaj',
6400
+ minbet: 'număr minim de pariuri',
6401
+ seegames: 'Vezi jocurile',
6402
+ here: 'aici',
6403
+ scheduled: 'Programat',
6404
+ ongoing: 'În desfășurare',
6405
+ finished: 'Finalizat',
6406
+ startingAt: 'Începând de la',
6407
+ startedAt: 'A inceput la:',
6408
+ startingAtWithTime: 'Începând de',
6409
+ startedAtWithTime: 'A inceput:',
6410
+ mostRounds: 'Cele mai multe runde',
6411
+ betCount: 'Număr de pariuri',
6412
+ maxWinStakeRatio: 'Pondere maximă a mizei din câștig',
6413
+ winStakeRatio: 'Câștig Total per Miză',
6414
+ January: 'Ianuarie',
6415
+ February: 'Februarie',
6416
+ March: 'Martie',
6417
+ April: 'Aprilie',
6418
+ May: 'Mai',
6419
+ June: 'Iunie',
6420
+ July: 'Iulie',
6421
+ August: 'August',
6422
+ September: 'Septembrie',
6423
+ October: 'Octombrie',
6424
+ November: 'Noiembrie',
6425
+ December: 'Decembrie',
6426
+ login: 'Autentificare',
6427
+ register: 'Înregistrare',
6428
+ details: 'Detalii',
6429
+ join: 'Participă',
6430
+ joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.'
6431
+ },
6432
+ tr: {
6433
+ enrolled: 'Katıldın',
6434
+ scoreCriteria: 'Skor kriteri',
6435
+ minbet: 'en düşük bahis sayısı',
6436
+ seegames: 'Turnuvadaki oyunları görmek için',
6437
+ here: 'tıklayın',
6438
+ scheduled: 'Planlanmış',
6439
+ ongoing: 'Devam Eden',
6440
+ finished: 'Sona Ermiş',
6441
+ startingAt: 'Başlangıç saati:',
6442
+ startedAt: 'Başlangıç saati:',
6443
+ mostRounds: 'ÇoğuRounds',
6444
+ betCount: 'Oynanan Tur Sayısı',
6445
+ maxWinStakeRatio: 'Maksimum Kazanç / Bahis Oranı',
6446
+ winStakeRatio: 'Kazanç / Bahis Oranı',
6447
+ January: 'Ocak',
6448
+ February: 'Şubat',
6449
+ March: 'Mart',
6450
+ April: 'Nisan',
6451
+ May: 'Mayıs',
6452
+ June: 'Haziran',
6453
+ July: 'Temmuz',
6454
+ August: 'Ağustos',
6455
+ September: 'Eylül',
6456
+ October: 'Ekim',
6457
+ November: 'Kasım',
6458
+ December: 'Aralık',
6459
+ login: 'Giriş',
6460
+ register: 'Kayıt Ol',
6461
+ details: 'Detaylar',
6462
+ join: 'Katıl',
6463
+ joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - '
6464
+ },
6465
+ el: {
6466
+ enrolled: 'Εγγεγραμμένος',
6467
+ scoreCriteria: 'Κριτήρια Σκορ',
6468
+ minbet: 'Ελάχιστος αριθμός πονταρισμάτων',
6469
+ seegames: 'Μπορείς να δεις τα παιχνίδια',
6470
+ here: 'εδώ',
6471
+ all: 'Όλα',
6472
+ scheduled: 'Προγραμματισμένα',
6473
+ ongoing: 'Τρέχοντα',
6474
+ finished: 'Ολοκληρωμένα',
6475
+ startingAt: 'Αρχίζει στις:',
6476
+ startedAt: 'Άρχισε στις:',
6477
+ startingAtWithTime: `Αρχίζει στις `,
6478
+ startedAtWithTime: `Άρχισε στις `,
6479
+ mostRounds: 'Οι περισσότεροι γύροι',
6480
+ betCount: 'Οι περισσότεροι γύροι',
6481
+ maxWinStakeRatio: 'Μεγαλύτερο Κέρδος άνα Ποντάρισμα',
6482
+ winStakeRatio: 'Συνολική Αναλογία Κερδών άνα Ποντάρισμα',
6483
+ January: 'Ιανουαρίου',
6484
+ February: 'Φεβρουαρίου',
6485
+ March: 'Μαρτίου',
6486
+ April: 'Απριλίου',
6487
+ May: 'Μαΐου',
6488
+ June: 'Ιουνίου',
6489
+ July: 'Ιουλίου',
6490
+ August: 'Αυγούστου',
6491
+ September: 'Σεπτεμβρίου',
6492
+ October: 'Οκτωβρίου',
6493
+ November: 'Νοεμβρίου',
6494
+ December: 'Δεκεμβρίου',
6495
+ login: 'Είσοδος',
6496
+ register: 'Εγγραφή',
6497
+ details: 'Λεπτομέρειες',
6498
+ join: 'Συμμετοχή',
6499
+ joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.'
6500
+ },
6501
+ es: {
6502
+ enrolled: 'Inscrito',
6503
+ scoreCriteria: 'Criterios de puntuación',
6504
+ minbet: 'la apuesta mínima cuenta',
6505
+ seegames: 'Puedes ver los juegos',
6506
+ here: 'aquí',
6507
+ scheduled: 'Programado',
6508
+ ongoing: 'En marcha',
6509
+ finished: 'Terminado',
6510
+ startingAt: 'Desde',
6511
+ startedAt: 'Empezó el:',
6512
+ mostRounds: 'LaMayoríaDeLasRondas',
6513
+ betCount: 'Recuento De Apuestas',
6514
+ maxWinStakeRatio: 'Ratio De Ganancia Máxima',
6515
+ winStakeRatio: 'Ratio De Ganancia',
6516
+ January: 'de enero',
6517
+ February: 'de febrero',
6518
+ March: 'de marzo',
6519
+ April: 'de abril',
6520
+ May: 'de mayo',
6521
+ June: 'de junio',
6522
+ July: 'de julio',
6523
+ August: 'de agosto',
6524
+ September: 'de septiembre',
6525
+ October: 'de octubre',
6526
+ November: 'de noviembre',
6527
+ December: 'de diciembre',
6528
+ login: 'Iniciar sesión',
6529
+ register: 'Regístrate',
6530
+ details: 'Detalles',
6531
+ join: 'Unirse',
6532
+ joinerror: 'Ha ocurrido un error mientras se registra en el Torneo',
6533
+ },
6534
+ pt: {
6535
+ enrolled: 'Inscrito',
6536
+ scoreCriteria: 'Critérios de pontuação',
6537
+ minbet: 'Contagens de aposta mínima',
6538
+ seegames: 'Você pode ver os jogos',
6539
+ here: 'Aqui',
6540
+ scheduled: 'Agendado',
6541
+ ongoing: 'Em progresso',
6542
+ finished: 'Finalizado',
6543
+ startingAt: 'Começando às:',
6544
+ startedAt: 'Começou às:',
6545
+ mostRounds: 'Mais rodadas',
6546
+ betCount: 'Contagem de Apostas',
6547
+ maxWinStakeRatio: 'Rácio máximo de vitórias',
6548
+ winStakeRatio: 'Rácio de Vitórias',
6549
+ January: 'January',
6550
+ February: 'February',
6551
+ March: 'March',
6552
+ April: 'April',
6553
+ May: 'May',
6554
+ June: 'June',
6555
+ July: 'July',
6556
+ August: 'August',
6557
+ September: 'September',
6558
+ October: 'October',
6559
+ November: 'November',
6560
+ December: 'December',
6561
+ login: 'Entrar',
6562
+ register: 'Registro',
6563
+ details: 'Detalhes',
6564
+ join: 'Junte-se',
6565
+ joinerror: 'Ocorreu um erro ao entrar no torneio -'
6566
+ },
6567
+ hu: {
6568
+ enrolled: 'Feliratkozott',
6569
+ scoreCriteria: 'Pontozási kritériumok',
6570
+ minbet: 'Minimális tét',
6571
+ seegames: 'Játékok megnézése',
6572
+ here: 'itt',
6573
+ scheduled: 'Ütemezés',
6574
+ ongoing: 'Folyamatban lévő',
6575
+ finished: 'Befejezett',
6576
+ startingAt: 'Kezdődik',
6577
+ startedAt: 'Started at:',
6578
+ mostRounds: 'Legtöbb kör',
6579
+ betCount: 'Számított tét',
6580
+ maxWinStakeRatio: 'Maximális nyeremény tétenként',
6581
+ winStakeRatio: 'Összes nyeremény tétenként',
6582
+ January: 'January',
6583
+ February: 'February',
6584
+ March: 'March',
6585
+ April: 'April',
6586
+ May: 'May',
6587
+ June: 'June',
6588
+ July: 'July',
6589
+ August: 'August',
6590
+ September: 'September',
6591
+ October: 'October',
6592
+ November: 'November',
6593
+ December: 'December',
6594
+ login: 'Bejelentkezés',
6595
+ register: 'Regisztráció',
6596
+ details: 'Adatok',
6597
+ join: 'Csatlakozás',
6598
+ joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
6599
+ },
6600
+ hr: {
6601
+ joined: 'Pridružen',
6602
+ enrolled: 'Upisan',
6603
+ scoreCriteria: 'Kriteriji bodovanja',
6604
+ minbet: 'minimalni broj beta',
6605
+ seegames: 'Možete vidjeti igre',
6606
+ here: 'Ovdje',
6607
+ scheduled: 'Zakazano',
6608
+ ongoing: 'U tijeku',
6609
+ finished: 'Gotovo',
6610
+ startingAt: 'S početkom u',
6611
+ startedAt: 'Započelo u',
6612
+ startingAtWithTime: `Počinje `,
6613
+ startedAtWithTime: `Započelo `,
6614
+ mostRounds: 'Najviše rundi',
6615
+ betCount: 'Broj betova',
6616
+ maxWinStakeRatio: 'Maksimalni dobitak po ulogu',
6617
+ winStakeRatio: 'Ukupni dobitak po ulogu',
6618
+ January: 'Siječanj',
6619
+ February: 'Veljača',
6620
+ March: 'Ožujak',
6621
+ April: 'Travanj',
6622
+ May: 'Svibanj',
6623
+ June: 'Lipanj',
6624
+ July: 'Srpanj',
6625
+ August: 'Kolovoz',
6626
+ September: 'Rujan',
6627
+ October: 'Listopad',
6628
+ November: 'Studeni',
6629
+ December: 'Prosinac',
6630
+ login: 'Prijaviti se',
6631
+ register: 'Registracija',
6632
+ details: 'Detalji',
6633
+ join: 'join',
6634
+ joinerror: 'Došlo je do pogreške prilikom registracije na turnir, pokušajte ponovno.',
6635
+ left: 'lijevo',
6636
+ minutes: 'minute',
6637
+ hours: 'sati',
6638
+ days: 'dani',
6639
+ }
6640
+ };
6641
+ const translate = (key, customLang) => {
6642
+ var _a, _b;
6643
+ const lang = customLang;
6644
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
6645
+ };
6646
+ const getTranslations = (data) => {
6647
+ Object.keys(data).forEach((item) => {
6648
+ for (let key in data[item]) {
6649
+ TRANSLATIONS[item][key] = data[item][key];
6650
+ }
6651
+ });
6652
+ };
6653
+
6654
+ const casinoTournamentButtonsCss = ":host{display:block}.ButtonGroup{display:flex;gap:4px}.Button{padding:6px 8px;border-radius:2px;border:1px solid #fff;color:#fff;background:none;position:relative;cursor:pointer}.Button.NoBorder{border:0;padding:7px 8px}.Button::after{content:\"\";display:block;position:absolute;border-radius:2px;left:0;top:0;width:100%;height:100%;opacity:0;transition:all 0.5s;box-shadow:0 0 10px 10px white}.Button:active::after{box-shadow:0 0 0 0 white;position:absolute;border-radius:2px;left:0;top:0;opacity:1;transition:0s}.Button:active{top:1px}";
6655
+
6656
+ const CasinoTournamentButtons = class {
6657
+ constructor(hostRef) {
6658
+ registerInstance(this, hostRef);
6659
+ /**
6660
+ * Player enrolled
6661
+ */
6662
+ this.enrolled = false;
6663
+ /**
6664
+ * Show read more button
6665
+ */
6666
+ this.showReadMore = false;
6667
+ /**
6668
+ * Client custom styling via inline styles
6669
+ */
6670
+ this.clientStyling = '';
6671
+ /**
6672
+ * Client custom styling via url
6673
+ */
6674
+ this.clientStylingUrl = '';
6675
+ this.limitStylingAppends = false;
6676
+ this.joinButtonLoading = false;
6677
+ this.errorJoin = false;
6678
+ this.errorJoinConcurrently = false;
6679
+ }
6680
+ componentWillLoad() {
6681
+ if (this.translationData) {
6682
+ getTranslations(JSON.parse(this.translationData));
6683
+ }
6684
+ }
6685
+ componentDidRender() {
6686
+ if (!this.limitStylingAppends && this.host) {
6687
+ if (this.clientStyling)
6688
+ this.setClientStyling();
6689
+ if (this.clientStylingUrl)
6690
+ this.setClientStylingURL();
6691
+ this.limitStylingAppends = true;
6692
+ }
6693
+ }
6694
+ setClientStyling() {
6695
+ const sheet = new CSSStyleSheet();
6696
+ // @ts-ignore
6697
+ sheet.replace(this.clientStyling);
6698
+ // @ts-ignore
6699
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
6700
+ }
6701
+ setClientStylingURL() {
6702
+ let url = new URL(this.clientStylingUrl);
6703
+ fetch(url.href)
6704
+ .then((res) => res.text())
6705
+ .then((data) => {
6706
+ const sheet = new CSSStyleSheet();
6707
+ // @ts-ignore
6708
+ sheet.replace(data);
6709
+ // @ts-ignore
6710
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
6711
+ });
6712
+ }
6713
+ loginAction() {
6714
+ if (this.loginEvent) {
6715
+ window.postMessage({ type: this.loginEvent, transition: 'Login' }, window.location.href);
6716
+ // @ts-ignore Analytics event
6717
+ if (typeof gtag == 'function') {
6718
+ // @ts-ignore
6719
+ gtag('event', 'OpenLoginModal', {
6720
+ 'context': 'TournamentsThumbnailController'
6721
+ });
6722
+ }
6723
+ }
6724
+ if (this.loginUrl) {
6725
+ location.href = this.loginUrl;
6726
+ }
6727
+ }
6728
+ registerAction() {
6729
+ if (this.registerEvent) {
6730
+ window.postMessage({ type: this.registerEvent, transition: 'Register' }, window.location.href);
6731
+ //@ts-ignoreAnalytics event
6732
+ if (typeof gtag == 'function') {
6733
+ //@ts-ignore
6734
+ gtag('event', 'OpenRegisterModal', {
6735
+ 'context': 'TournamentsThumbnailController'
6736
+ });
6737
+ }
6738
+ }
6739
+ if (this.registerUrl) {
6740
+ location.href = this.registerUrl;
6741
+ }
6742
+ }
6743
+ async joinAction(tournamentId, bonuscode) {
6744
+ var _a;
6745
+ this.errorJoin = false;
6746
+ this.errorJoinConcurrently = false;
6747
+ window.postMessage({ type: 'TournamentJoinRequest', tournamentId }, window.location.href);
6748
+ this.joinButtonLoading = true;
6749
+ let joinUrl = new URL(`${this.endpoint}/v1/bonus/claim`);
6750
+ let reqHeaders = new Headers();
6751
+ let body = {};
6752
+ joinUrl.searchParams.append('language', this.language);
6753
+ joinUrl.searchParams.append('platform', getDevice());
6754
+ reqHeaders.append('Content-Type', 'application/json');
6755
+ reqHeaders.append("X-SessionID", this.session);
6756
+ if (bonuscode) {
6757
+ body = {
6758
+ language: this.language,
6759
+ bonusCode: bonuscode,
6760
+ currency: this.currency
6761
+ };
6762
+ }
6763
+ let requestOptions = {
6764
+ method: 'PUT',
6765
+ headers: reqHeaders,
6766
+ body: JSON.stringify(body),
6767
+ };
6768
+ const handlerOnSuccess = () => {
6769
+ this.joinButtonLoading = false;
6770
+ this.enrolled = true;
6771
+ window.postMessage({ type: 'TournamentUserEnrolled', userenrolled: this.enrolled }, window.location.href);
6772
+ };
6773
+ const handlerOnFail = () => {
6774
+ this.joinButtonLoading = false;
6775
+ this.errorJoin = true;
6776
+ };
6777
+ const fetcher = async () => {
6778
+ let result;
6779
+ try {
6780
+ result = await fetch(`${this.endpoint}/v1/bonus/claim?${joinUrl.searchParams.toString()}`, requestOptions);
6781
+ result = await result.json();
6782
+ }
6783
+ catch (e) {
6784
+ handlerOnFail();
6785
+ }
6786
+ return result;
6787
+ };
6788
+ const data = await fetcher();
6789
+ if (!data)
6790
+ return;
6791
+ if (data.success == true) {
6792
+ handlerOnSuccess();
6793
+ }
6794
+ else {
6795
+ if (data.errorMessage.match("VersionMismatchException")) {
6796
+ let resultDoubleCheck;
6797
+ resultDoubleCheck = await fetch(`${this.endpoint}/v1/tournaments/${this.tournamentId}`, {
6798
+ headers: {
6799
+ 'X-SessionID': this.session
6800
+ }
6801
+ });
6802
+ resultDoubleCheck = await resultDoubleCheck.json();
6803
+ if ((_a = resultDoubleCheck === null || resultDoubleCheck === void 0 ? void 0 : resultDoubleCheck.item) === null || _a === void 0 ? void 0 : _a.playerEnrolled) {
6804
+ handlerOnSuccess();
6805
+ }
6806
+ else {
6807
+ handlerOnFail();
6808
+ this.errorJoinConcurrently = true;
6809
+ this.errorJoin = false;
6810
+ }
6811
+ }
6812
+ else {
6813
+ handlerOnFail();
6814
+ }
6815
+ }
6816
+ }
6817
+ detailAction(tournamentId) {
6818
+ window.postMessage({ type: 'TournamentDetailsClicked', tournamentId, showLeaderboard: true }, window.location.href);
6819
+ }
6820
+ moreAction(tournamentId) {
6821
+ window.postMessage({ type: 'TournamentReadMoreClicked', tournamentId }, window.location.href);
6822
+ }
6823
+ render() {
6824
+ return h("div", { class: "TournamentButtons" }, !this.session &&
6825
+ h("div", { class: "ButtonGroup" }, h("button", { class: "LoginButton Button", part: "LoginButton", onClick: () => this.loginAction() }, translate('login', this.language)), h("button", { class: "RegisterButton Button", part: "RegisterButton", onClick: () => this.registerAction() }, translate('register', this.language))), this.session &&
6826
+ h("div", null, !this.enrolled &&
6827
+ h("div", { class: "ButtonGroup" }, h("button", { class: "Button", onClick: () => this.joinAction(this.tournamentId, this.bonusCode) }, translate('join', this.language)), this.showReadMore && h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, translate('readmore', this.language))), this.enrolled &&
6828
+ h("div", { class: "ButtonGroup" }, h("button", { class: "Button", onClick: () => this.detailAction(this.tournamentId) }, translate('details', this.language)), this.showReadMore && h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, translate('readmore', this.language)))), (this.errorJoin || this.errorJoinConcurrently) &&
6829
+ h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
6830
+ }
6831
+ get host() { return getElement(this); }
6832
+ };
6833
+ CasinoTournamentButtons.style = casinoTournamentButtonsCss;
6834
+
6835
+ export { CasinoTournamentBanner as casino_tournament_banner, CasinoTournamentButtons as casino_tournament_buttons };