@everymatrix/casino-tournament-banner 1.24.5 → 1.24.7

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.
@@ -3,11 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-743ee8f8.js');
6
- require('@everymatrix/casino-tournament-buttons');
7
6
 
8
- const DEFAULT_LANGUAGE = 'en';
9
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
10
- const TRANSLATIONS = {
7
+ const DEFAULT_LANGUAGE$1 = 'en';
8
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
9
+ const TRANSLATIONS$1 = {
11
10
  en: {
12
11
  joined: 'Joined',
13
12
  join: 'Join',
@@ -352,9 +351,9 @@ const TRANSLATIONS = {
352
351
  days: 'nap',
353
352
  }
354
353
  };
355
- const translate = (key, customLang) => {
354
+ const translate$1 = (key, customLang) => {
356
355
  const lang = customLang;
357
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
356
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
358
357
  };
359
358
 
360
359
  //! moment.js
@@ -6076,7 +6075,7 @@ const CasinoTournamentBanner = class {
6076
6075
  return ((new Date(dateString2)).getTime() - (new Date(dateString1)).getTime()) / (1000 * 60);
6077
6076
  }
6078
6077
  getTextByDiff(diff) {
6079
- const renderText = (amount, type) => ' - ' + amount + ' ' + translate(type);
6078
+ const renderText = (amount, type) => ' - ' + amount + ' ' + translate$1(type);
6080
6079
  const renderTimeColumn = (column) => {
6081
6080
  const columnInt = Math.floor(column);
6082
6081
  if (columnInt < 10) {
@@ -6116,16 +6115,16 @@ const CasinoTournamentBanner = class {
6116
6115
  let text = '';
6117
6116
  switch (state) {
6118
6117
  case 'Upcoming':
6119
- text = translate('scheduled', this.language);
6118
+ text = translate$1('scheduled', this.language);
6120
6119
  break;
6121
6120
  case 'Unstarted':
6122
- text = translate('scheduled', this.language);
6121
+ text = translate$1('scheduled', this.language);
6123
6122
  break;
6124
6123
  case 'Running':
6125
- text = translate('ongoing', this.language);
6124
+ text = translate$1('ongoing', this.language);
6126
6125
  break;
6127
6126
  default:
6128
- text = translate('finished', this.language);
6127
+ text = translate$1('finished', this.language);
6129
6128
  break;
6130
6129
  }
6131
6130
  return text;
@@ -6156,14 +6155,14 @@ const CasinoTournamentBanner = class {
6156
6155
  let currentDate = new Date(this.startTime);
6157
6156
  const setTranslation = () => {
6158
6157
  return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6159
- translate('startedAt', this.language) :
6160
- translate('startingAt', this.language);
6158
+ translate$1('startedAt', this.language) :
6159
+ translate$1('startingAt', this.language);
6161
6160
  };
6162
6161
  if (this.shortStart) {
6163
6162
  let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6164
6163
  this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6165
- translate('startedAtWithTime', this.language) + startTimeAsString :
6166
- translate('startingAtWithTime', this.language) + startTimeAsString;
6164
+ translate$1('startedAtWithTime', this.language) + startTimeAsString :
6165
+ translate$1('startingAtWithTime', this.language) + startTimeAsString;
6167
6166
  }
6168
6167
  else {
6169
6168
  let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
@@ -6171,7 +6170,7 @@ const CasinoTournamentBanner = class {
6171
6170
  let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6172
6171
  this.startdate =
6173
6172
  `${currentDay}` + ' ' +
6174
- translate(`${currentMonthKey}`, this.language) + ', ' +
6173
+ translate$1(`${currentMonthKey}`, this.language) + ', ' +
6175
6174
  setTranslation() +
6176
6175
  ` ${currentHour}`;
6177
6176
  }
@@ -6207,16 +6206,513 @@ const CasinoTournamentBanner = class {
6207
6206
  index.h("span", { class: "Tag Date" }, this.showCalendar &&
6208
6207
  index.h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.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)), index.h("div", { class: "BannerInfo", part: "BannerInfo" }, this.enrolled &&
6209
6208
  index.h("span", { class: "Tag Enroll" }, this.showCheck &&
6210
- index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.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 && index.h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, index.h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate('tournament', this.language)), index.h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), index.h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6211
- index.h("span", { class: "Tag Join" }, index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.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))
6209
+ index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.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 && index.h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, index.h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate$1('tournament', this.language)), index.h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), index.h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6210
+ index.h("span", { class: "Tag Join" }, index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.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))
6212
6211
  :
6213
6212
  this.session && this.state != 'Closed' &&
6214
- index.h("span", { class: "Tag Join" }, index.h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, index.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' && index.h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6215
- index.h("span", { class: "TagRemain" }, this.showRemain, " ", translate('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6213
+ index.h("span", { class: "Tag Join" }, index.h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, index.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' && index.h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6214
+ index.h("span", { class: "TagRemain" }, this.showRemain, " ", translate$1('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6216
6215
  index.h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6217
- index.h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.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)), index.h("div", { class: "ThumbButtons" }, index.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 })), index.h("div", { class: "ThumbTC" }, index.h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate('terms', this.language))))));
6216
+ index.h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.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)), index.h("div", { class: "ThumbButtons" }, index.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 })), index.h("div", { class: "ThumbTC" }, index.h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('terms', this.language))))));
6218
6217
  }
6219
6218
  };
6220
6219
  CasinoTournamentBanner.style = casinoTournamentBannerCss;
6221
6220
 
6221
+ const getDevice = () => {
6222
+ let userAgent = window.navigator.userAgent;
6223
+ if (userAgent.toLowerCase().match(/android/i)) {
6224
+ return 'Android';
6225
+ }
6226
+ if (userAgent.toLowerCase().match(/iphone/i)) {
6227
+ return 'iPhone';
6228
+ }
6229
+ if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
6230
+ return 'iPad';
6231
+ }
6232
+ return 'PC';
6233
+ };
6234
+
6235
+ const DEFAULT_LANGUAGE = 'en';
6236
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
6237
+ const TRANSLATIONS = {
6238
+ en: {
6239
+ joined: 'Joined',
6240
+ join: 'Join',
6241
+ enrolled: 'Enrolled',
6242
+ scoreCriteria: 'Score Criteria',
6243
+ minbet: 'min bet count',
6244
+ seegames: 'You can see the games',
6245
+ here: 'here',
6246
+ scheduled: 'Scheduled',
6247
+ ongoing: 'Ongoing',
6248
+ finished: 'Finished',
6249
+ startingAt: 'Starting at:',
6250
+ startedAt: 'Started at:',
6251
+ startingAtWithTime: `Starts `,
6252
+ startedAtWithTime: `Started `,
6253
+ mostRounds: 'Most Rounds',
6254
+ betCount: 'Number of Bets',
6255
+ maxWinStakeRatio: 'Max Win per Stake',
6256
+ winStakeRatio: 'Total Win per Stake',
6257
+ January: 'January',
6258
+ February: 'February',
6259
+ March: 'March',
6260
+ April: 'April',
6261
+ May: 'May',
6262
+ June: 'June',
6263
+ July: 'July',
6264
+ August: 'August',
6265
+ September: 'September',
6266
+ October: 'October',
6267
+ November: 'November',
6268
+ December: 'December',
6269
+ login: 'Log in',
6270
+ register: 'Register',
6271
+ details: 'Details',
6272
+ joinerror: 'An error occurred while registering in the tournament, please try again.'
6273
+ },
6274
+ 'zh-hk': {
6275
+ enrolled: '已註冊',
6276
+ scoreCriteria: '評分標準',
6277
+ minbet: '最小投注數:',
6278
+ seegames: '你可以看比賽',
6279
+ here: '這裡',
6280
+ scheduled: '預定的',
6281
+ ongoing: '進行中',
6282
+ finished: '完成的',
6283
+ startingAt: '開始於',
6284
+ startedAt: '大多數回合',
6285
+ mostRounds: '投注數',
6286
+ betCount: '投注计数',
6287
+ maxWinStakeRatio: '最大勝率',
6288
+ winStakeRatio: '勝率',
6289
+ January: '一月',
6290
+ February: '二月',
6291
+ March: '行进',
6292
+ April: '四月',
6293
+ May: '可能',
6294
+ June: '六月',
6295
+ July: '七月',
6296
+ August: '八月',
6297
+ September: '九月',
6298
+ October: '十月',
6299
+ November: '十一月',
6300
+ December: '十二月',
6301
+ login: '登錄',
6302
+ register: '登記',
6303
+ details: '細節',
6304
+ join: '加入',
6305
+ joinerror: '加入錦標賽時出錯,請重試'
6306
+ },
6307
+ fr: {
6308
+ enrolled: 'Inscrits',
6309
+ scoreCriteria: 'Critères de notation',
6310
+ minbet: 'nombre de paris minimum',
6311
+ seegames: 'Vous pouvez voir les jeux',
6312
+ here: 'ici',
6313
+ scheduled: 'Programmé',
6314
+ ongoing: 'En cours',
6315
+ finished: 'Fini',
6316
+ startingAt: 'À partir de:',
6317
+ startedAt: 'Commencé à:',
6318
+ mostRounds: 'Le plus grand nombre de tours',
6319
+ betCount: 'Nombre de paris',
6320
+ maxWinStakeRatio: 'Indice maximum du gain d\'une mise',
6321
+ winStakeRatio: 'Indice du gain d\'une mise',
6322
+ January: 'January',
6323
+ February: 'February',
6324
+ March: 'March',
6325
+ April: 'April',
6326
+ May: 'May',
6327
+ June: 'June',
6328
+ July: 'July',
6329
+ August: 'August',
6330
+ September: 'September',
6331
+ October: 'October',
6332
+ November: 'November',
6333
+ December: 'December',
6334
+ login: 'Connexion',
6335
+ register: 'Enregistre',
6336
+ details: 'Détails',
6337
+ join: 'Rejoignez',
6338
+ joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - '
6339
+ },
6340
+ ro: {
6341
+ enrolled: 'Înscris',
6342
+ scoreCriteria: 'Criterii de punctaj',
6343
+ minbet: 'număr minim de pariuri',
6344
+ seegames: 'Vezi jocurile',
6345
+ here: 'aici',
6346
+ scheduled: 'Programat',
6347
+ ongoing: 'În desfășurare',
6348
+ finished: 'Finalizat',
6349
+ startingAt: 'Începând de la',
6350
+ startedAt: 'A inceput la:',
6351
+ startingAtWithTime: 'Începând de',
6352
+ startedAtWithTime: 'A inceput:',
6353
+ mostRounds: 'Cele mai multe runde',
6354
+ betCount: 'Număr de pariuri',
6355
+ maxWinStakeRatio: 'Pondere maximă a mizei din câștig',
6356
+ winStakeRatio: 'Câștig Total per Miză',
6357
+ January: 'Ianuarie',
6358
+ February: 'Februarie',
6359
+ March: 'Martie',
6360
+ April: 'Aprilie',
6361
+ May: 'Mai',
6362
+ June: 'Iunie',
6363
+ July: 'Iulie',
6364
+ August: 'August',
6365
+ September: 'Septembrie',
6366
+ October: 'Octombrie',
6367
+ November: 'Noiembrie',
6368
+ December: 'Decembrie',
6369
+ login: 'Autentificare',
6370
+ register: 'Înregistrare',
6371
+ details: 'Detalii',
6372
+ join: 'Participă',
6373
+ joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.'
6374
+ },
6375
+ tr: {
6376
+ enrolled: 'Katıldın',
6377
+ scoreCriteria: 'Skor kriteri',
6378
+ minbet: 'en düşük bahis sayısı',
6379
+ seegames: 'Turnuvadaki oyunları görmek için',
6380
+ here: 'tıklayın',
6381
+ scheduled: 'Planlanmış',
6382
+ ongoing: 'Devam Eden',
6383
+ finished: 'Sona Ermiş',
6384
+ startingAt: 'Başlangıç saati:',
6385
+ startedAt: 'Başlangıç saati:',
6386
+ mostRounds: 'ÇoğuRounds',
6387
+ betCount: 'Oynanan Tur Sayısı',
6388
+ maxWinStakeRatio: 'Maksimum Kazanç / Bahis Oranı',
6389
+ winStakeRatio: 'Kazanç / Bahis Oranı',
6390
+ January: 'Ocak',
6391
+ February: 'Şubat',
6392
+ March: 'Mart',
6393
+ April: 'Nisan',
6394
+ May: 'Mayıs',
6395
+ June: 'Haziran',
6396
+ July: 'Temmuz',
6397
+ August: 'Ağustos',
6398
+ September: 'Eylül',
6399
+ October: 'Ekim',
6400
+ November: 'Kasım',
6401
+ December: 'Aralık',
6402
+ login: 'Giriş',
6403
+ register: 'Kayıt Ol',
6404
+ details: 'Detaylar',
6405
+ join: 'Katıl',
6406
+ joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - '
6407
+ },
6408
+ el: {
6409
+ enrolled: 'Εγγεγραμμένος',
6410
+ scoreCriteria: 'Κριτήρια Σκορ',
6411
+ minbet: 'Ελάχιστος αριθμός πονταρισμάτων',
6412
+ seegames: 'Μπορείς να δεις τα παιχνίδια',
6413
+ here: 'εδώ',
6414
+ all: 'Όλα',
6415
+ scheduled: 'Προγραμματισμένα',
6416
+ ongoing: 'Τρέχοντα',
6417
+ finished: 'Ολοκληρωμένα',
6418
+ startingAt: 'Αρχίζει στις:',
6419
+ startedAt: 'Άρχισε στις:',
6420
+ startingAtWithTime: `Αρχίζει στις `,
6421
+ startedAtWithTime: `Άρχισε στις `,
6422
+ mostRounds: 'Οι περισσότεροι γύροι',
6423
+ betCount: 'Οι περισσότεροι γύροι',
6424
+ maxWinStakeRatio: 'Μεγαλύτερο Κέρδος άνα Ποντάρισμα',
6425
+ winStakeRatio: 'Συνολική Αναλογία Κερδών άνα Ποντάρισμα',
6426
+ January: 'Ιανουαρίου',
6427
+ February: 'Φεβρουαρίου',
6428
+ March: 'Μαρτίου',
6429
+ April: 'Απριλίου',
6430
+ May: 'Μαΐου',
6431
+ June: 'Ιουνίου',
6432
+ July: 'Ιουλίου',
6433
+ August: 'Αυγούστου',
6434
+ September: 'Σεπτεμβρίου',
6435
+ October: 'Οκτωβρίου',
6436
+ November: 'Νοεμβρίου',
6437
+ December: 'Δεκεμβρίου',
6438
+ login: 'Είσοδος',
6439
+ register: 'Εγγραφή',
6440
+ details: 'Λεπτομέρειες',
6441
+ join: 'Συμμετοχή',
6442
+ joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.'
6443
+ },
6444
+ es: {
6445
+ enrolled: 'Inscrito',
6446
+ scoreCriteria: 'Criterios de puntuación',
6447
+ minbet: 'la apuesta mínima cuenta',
6448
+ seegames: 'Puedes ver los juegos',
6449
+ here: 'aquí',
6450
+ scheduled: 'Programado',
6451
+ ongoing: 'En marcha',
6452
+ finished: 'Terminado',
6453
+ startingAt: 'Desde',
6454
+ startedAt: 'Empezó el:',
6455
+ mostRounds: 'LaMayoríaDeLasRondas',
6456
+ betCount: 'Recuento De Apuestas',
6457
+ maxWinStakeRatio: 'Ratio De Ganancia Máxima',
6458
+ winStakeRatio: 'Ratio De Ganancia',
6459
+ January: 'de enero',
6460
+ February: 'de febrero',
6461
+ March: 'de marzo',
6462
+ April: 'de abril',
6463
+ May: 'de mayo',
6464
+ June: 'de junio',
6465
+ July: 'de julio',
6466
+ August: 'de agosto',
6467
+ September: 'de septiembre',
6468
+ October: 'de octubre',
6469
+ November: 'de noviembre',
6470
+ December: 'de diciembre',
6471
+ login: 'Iniciar sesión',
6472
+ register: 'Regístrate',
6473
+ details: 'Detalles',
6474
+ join: 'Unirse',
6475
+ joinerror: 'Ha ocurrido un error mientras se registra en el Torneo',
6476
+ },
6477
+ pt: {
6478
+ enrolled: 'Inscrito',
6479
+ scoreCriteria: 'Critérios de pontuação',
6480
+ minbet: 'Contagens de aposta mínima',
6481
+ seegames: 'Você pode ver os jogos',
6482
+ here: 'Aqui',
6483
+ scheduled: 'Agendado',
6484
+ ongoing: 'Em progresso',
6485
+ finished: 'Finalizado',
6486
+ startingAt: 'Começando às:',
6487
+ startedAt: 'Começou às:',
6488
+ mostRounds: 'Mais rodadas',
6489
+ betCount: 'Contagem de Apostas',
6490
+ maxWinStakeRatio: 'Rácio máximo de vitórias',
6491
+ winStakeRatio: 'Rácio de Vitórias',
6492
+ January: 'January',
6493
+ February: 'February',
6494
+ March: 'March',
6495
+ April: 'April',
6496
+ May: 'May',
6497
+ June: 'June',
6498
+ July: 'July',
6499
+ August: 'August',
6500
+ September: 'September',
6501
+ October: 'October',
6502
+ November: 'November',
6503
+ December: 'December',
6504
+ login: 'Entrar',
6505
+ register: 'Registro',
6506
+ details: 'Detalhes',
6507
+ join: 'Junte-se',
6508
+ joinerror: 'Ocorreu um erro ao entrar no torneio -'
6509
+ },
6510
+ hu: {
6511
+ enrolled: 'Feliratkozott',
6512
+ scoreCriteria: 'Pontozási kritériumok',
6513
+ minbet: 'Minimális tét',
6514
+ seegames: 'Játékok megnézése',
6515
+ here: 'itt',
6516
+ scheduled: 'Ütemezés',
6517
+ ongoing: 'Folyamatban lévő',
6518
+ finished: 'Befejezett',
6519
+ startingAt: 'Kezdődik',
6520
+ startedAt: 'Started at:',
6521
+ mostRounds: 'Legtöbb kör',
6522
+ betCount: 'Számított tét',
6523
+ maxWinStakeRatio: 'Maximális nyeremény tétenként',
6524
+ winStakeRatio: 'Összes nyeremény tétenként',
6525
+ January: 'January',
6526
+ February: 'February',
6527
+ March: 'March',
6528
+ April: 'April',
6529
+ May: 'May',
6530
+ June: 'June',
6531
+ July: 'July',
6532
+ August: 'August',
6533
+ September: 'September',
6534
+ October: 'October',
6535
+ November: 'November',
6536
+ December: 'December',
6537
+ login: 'Bejelentkezés',
6538
+ register: 'Regisztráció',
6539
+ details: 'Adatok',
6540
+ join: 'Csatlakozás',
6541
+ joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
6542
+ }
6543
+ };
6544
+ const translate = (key, customLang) => {
6545
+ const lang = customLang;
6546
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
6547
+ };
6548
+
6549
+ 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}";
6550
+
6551
+ const CasinoTournamentButtons = class {
6552
+ constructor(hostRef) {
6553
+ index.registerInstance(this, hostRef);
6554
+ /**
6555
+ * Player enrolled
6556
+ */
6557
+ this.enrolled = false;
6558
+ /**
6559
+ * Show read more button
6560
+ */
6561
+ this.showReadMore = false;
6562
+ /**
6563
+ * Client custom styling via inline styles
6564
+ */
6565
+ this.clientStyling = '';
6566
+ /**
6567
+ * Client custom styling via url
6568
+ */
6569
+ this.clientStylingUrl = '';
6570
+ this.limitStylingAppends = false;
6571
+ this.joinButtonLoading = false;
6572
+ this.errorJoin = false;
6573
+ this.errorJoinConcurrently = false;
6574
+ }
6575
+ componentDidRender() {
6576
+ if (!this.limitStylingAppends && this.stylingContainer) {
6577
+ if (this.clientStyling)
6578
+ this.setClientStyling();
6579
+ if (this.clientStylingUrl)
6580
+ this.setClientStylingURL();
6581
+ this.limitStylingAppends = true;
6582
+ }
6583
+ }
6584
+ setClientStyling() {
6585
+ let sheet = document.createElement('style');
6586
+ sheet.innerHTML = this.clientStyling;
6587
+ this.stylingContainer.prepend(sheet);
6588
+ }
6589
+ setClientStylingURL() {
6590
+ let cssFile = document.createElement('style');
6591
+ setTimeout(() => {
6592
+ cssFile.innerHTML = this.clientStylingUrl;
6593
+ this.stylingContainer.prepend(cssFile);
6594
+ }, 1);
6595
+ }
6596
+ loginAction() {
6597
+ if (this.loginEvent) {
6598
+ window.postMessage({ type: this.loginEvent, transition: 'Login' }, window.location.href);
6599
+ // @ts-ignore Analytics event
6600
+ if (typeof gtag == 'function') {
6601
+ // @ts-ignore
6602
+ gtag('event', 'OpenLoginModal', {
6603
+ 'context': 'TournamentsThumbnailController'
6604
+ });
6605
+ }
6606
+ }
6607
+ if (this.loginUrl) {
6608
+ location.href = this.loginUrl;
6609
+ }
6610
+ }
6611
+ registerAction() {
6612
+ if (this.registerEvent) {
6613
+ window.postMessage({ type: this.registerEvent, transition: 'Register' }, window.location.href);
6614
+ //@ts-ignoreAnalytics event
6615
+ if (typeof gtag == 'function') {
6616
+ //@ts-ignore
6617
+ gtag('event', 'OpenRegisterModal', {
6618
+ 'context': 'TournamentsThumbnailController'
6619
+ });
6620
+ }
6621
+ }
6622
+ if (this.registerUrl) {
6623
+ location.href = this.registerUrl;
6624
+ }
6625
+ }
6626
+ async joinAction(tournamentId, bonuscode) {
6627
+ var _a;
6628
+ this.errorJoin = false;
6629
+ this.errorJoinConcurrently = false;
6630
+ window.postMessage({ type: 'TournamentJoinRequest', tournamentId }, window.location.href);
6631
+ this.joinButtonLoading = true;
6632
+ let joinUrl = new URL(`${this.endpoint}/bonus/claim`);
6633
+ let reqHeaders = new Headers();
6634
+ let body = {};
6635
+ joinUrl.searchParams.append('language', this.language);
6636
+ joinUrl.searchParams.append('platform', getDevice());
6637
+ reqHeaders.append('Content-Type', 'application/json');
6638
+ reqHeaders.append("X-SessionID", this.session);
6639
+ if (bonuscode) {
6640
+ body = {
6641
+ language: this.language,
6642
+ bonusCode: bonuscode,
6643
+ currency: this.currency
6644
+ };
6645
+ }
6646
+ let requestOptions = {
6647
+ method: 'PUT',
6648
+ headers: reqHeaders,
6649
+ body: JSON.stringify(body),
6650
+ };
6651
+ const handlerOnSuccess = () => {
6652
+ this.joinButtonLoading = false;
6653
+ this.enrolled = true;
6654
+ window.postMessage({ type: 'TournamentUserEnrolled', userenrolled: this.enrolled }, window.location.href);
6655
+ };
6656
+ const handlerOnFail = () => {
6657
+ this.joinButtonLoading = false;
6658
+ this.errorJoin = true;
6659
+ };
6660
+ const fetcher = async () => {
6661
+ let result;
6662
+ try {
6663
+ result = await fetch(`${this.endpoint}/bonus/claim?${joinUrl.searchParams.toString()}`, requestOptions);
6664
+ result = await result.json();
6665
+ }
6666
+ catch (e) {
6667
+ handlerOnFail();
6668
+ }
6669
+ return result;
6670
+ };
6671
+ const data = await fetcher();
6672
+ if (!data)
6673
+ return;
6674
+ if (data.success == true) {
6675
+ handlerOnSuccess();
6676
+ }
6677
+ else {
6678
+ if (data.errorMessage.match("VersionMismatchException")) {
6679
+ let resultDoubleCheck;
6680
+ resultDoubleCheck = await fetch(`${this.endpoint}/tournaments/${this.tournamentId}`, {
6681
+ headers: {
6682
+ 'X-SessionID': this.session
6683
+ }
6684
+ });
6685
+ resultDoubleCheck = await resultDoubleCheck.json();
6686
+ if ((_a = resultDoubleCheck === null || resultDoubleCheck === void 0 ? void 0 : resultDoubleCheck.item) === null || _a === void 0 ? void 0 : _a.playerEnrolled) {
6687
+ handlerOnSuccess();
6688
+ }
6689
+ else {
6690
+ handlerOnFail();
6691
+ this.errorJoinConcurrently = true;
6692
+ this.errorJoin = false;
6693
+ }
6694
+ }
6695
+ else {
6696
+ handlerOnFail();
6697
+ }
6698
+ }
6699
+ }
6700
+ detailAction(tournamentId) {
6701
+ window.postMessage({ type: 'TournamentDetailsClicked', tournamentId, showLeaderboard: true }, window.location.href);
6702
+ }
6703
+ moreAction(tournamentId) {
6704
+ window.postMessage({ type: 'TournamentReadMoreClicked', tournamentId }, window.location.href);
6705
+ }
6706
+ render() {
6707
+ return index.h("div", { ref: el => this.stylingContainer = el, class: "TournamentButtons" }, !this.session &&
6708
+ index.h("div", { class: "ButtonGroup" }, index.h("button", { class: "LoginButton Button", part: "LoginButton", onClick: () => this.loginAction() }, translate('login', this.language)), index.h("button", { class: "RegisterButton Button", part: "RegisterButton", onClick: () => this.registerAction() }, translate('register', this.language))), this.session &&
6709
+ index.h("div", null, !this.enrolled &&
6710
+ index.h("div", { class: "ButtonGroup" }, index.h("button", { class: "Button", onClick: () => this.joinAction(this.tournamentId, this.bonusCode) }, translate('join', this.language)), this.showReadMore && index.h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, "Read more")), this.enrolled &&
6711
+ index.h("div", { class: "ButtonGroup" }, index.h("button", { class: "Button", onClick: () => this.detailAction(this.tournamentId) }, translate('details', this.language)), this.showReadMore && index.h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, "Read more"))), (this.errorJoin || this.errorJoinConcurrently) &&
6712
+ index.h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
6713
+ }
6714
+ };
6715
+ CasinoTournamentButtons.style = casinoTournamentButtonsCss;
6716
+
6222
6717
  exports.casino_tournament_banner = CasinoTournamentBanner;
6718
+ exports.casino_tournament_buttons = CasinoTournamentButtons;
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["casino-tournament-banner.cjs",[[1,"casino-tournament-banner",{"useEvent":[1,"use-event"],"endpoint":[1],"state":[1],"enrolled":[4],"startTime":[1,"start-time"],"endTime":[1,"end-time"],"thumbnail":[1],"language":[1],"showCalendar":[4,"show-calendar"],"shortStart":[4,"short-start"],"shortstartformat":[1],"showDate":[4,"show-date"],"showRunningDate":[4,"show-running-date"],"showCheck":[4,"show-check"],"cardMode":[4,"card-mode"],"nameOrTitle":[1,"name-or-title"],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"currency":[1],"bonusCode":[1,"bonus-code"],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"stateText":[32],"limitStylingAppends":[32],"stylingContainer":[32],"startdate":[32],"tournamentLeftDays":[32],"showRemain":[32],"durationInterval":[32]},[[8,"getTournamentInfoCompleted","infoCompletedHandler"]]]]]], options);
17
+ return index.bootstrapLazy([["casino-tournament-banner_2.cjs",[[1,"casino-tournament-banner",{"useEvent":[1,"use-event"],"endpoint":[1],"state":[1],"enrolled":[4],"startTime":[1,"start-time"],"endTime":[1,"end-time"],"thumbnail":[1],"language":[1],"showCalendar":[4,"show-calendar"],"shortStart":[4,"short-start"],"shortstartformat":[1],"showDate":[4,"show-date"],"showRunningDate":[4,"show-running-date"],"showCheck":[4,"show-check"],"cardMode":[4,"card-mode"],"nameOrTitle":[1,"name-or-title"],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"currency":[1],"bonusCode":[1,"bonus-code"],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"stateText":[32],"limitStylingAppends":[32],"stylingContainer":[32],"startdate":[32],"tournamentLeftDays":[32],"showRemain":[32],"durationInterval":[32]},[[8,"getTournamentInfoCompleted","infoCompletedHandler"]]],[1,"casino-tournament-buttons",{"language":[1],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"enrolled":[4],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"limitStylingAppends":[32],"stylingContainer":[32],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -7,6 +7,13 @@
7
7
  "version": "2.15.2",
8
8
  "typescriptVersion": "4.5.4"
9
9
  },
10
- "collections": [],
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/casino-tournament-buttons",
13
+ "tags": [
14
+ "casino-tournament-buttons"
15
+ ]
16
+ }
17
+ ],
11
18
  "bundles": []
12
19
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import '@everymatrix/casino-tournament-buttons';
2
+ import { d as defineCustomElement$2 } from './casino-tournament-buttons2.js';
3
3
 
4
4
  const DEFAULT_LANGUAGE = 'en';
5
5
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
@@ -6255,13 +6255,18 @@ function defineCustomElement$1() {
6255
6255
  if (typeof customElements === "undefined") {
6256
6256
  return;
6257
6257
  }
6258
- const components = ["casino-tournament-banner"];
6258
+ const components = ["casino-tournament-banner", "casino-tournament-buttons"];
6259
6259
  components.forEach(tagName => { switch (tagName) {
6260
6260
  case "casino-tournament-banner":
6261
6261
  if (!customElements.get(tagName)) {
6262
6262
  customElements.define(tagName, CasinoTournamentBanner$1);
6263
6263
  }
6264
6264
  break;
6265
+ case "casino-tournament-buttons":
6266
+ if (!customElements.get(tagName)) {
6267
+ defineCustomElement$2();
6268
+ }
6269
+ break;
6265
6270
  } });
6266
6271
  }
6267
6272