@everymatrix/casino-tournament-banner 1.29.4 → 1.29.6

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,5 +1,4 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt', 'hr'];
3
2
  const TRANSLATIONS = {
4
3
  en: {
5
4
  joined: 'Joined',
@@ -155,6 +154,7 @@ const TRANSLATIONS = {
155
154
  minutes: 'minute',
156
155
  hours: 'ore',
157
156
  days: 'zile',
157
+ tournament: 'turneu'
158
158
  },
159
159
  tr: {
160
160
  enrolled: 'Katıldın',
@@ -386,6 +386,14 @@ const TRANSLATIONS = {
386
386
  }
387
387
  };
388
388
  export const translate = (key, customLang) => {
389
+ var _a, _b;
389
390
  const lang = customLang;
390
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
391
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
392
+ };
393
+ export const getTranslations = (data) => {
394
+ Object.keys(data).forEach((item) => {
395
+ for (let key in data[item]) {
396
+ TRANSLATIONS[item][key] = data[item][key];
397
+ }
398
+ });
391
399
  };
@@ -2,7 +2,6 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
2
2
  import { d as defineCustomElement$2 } from './casino-tournament-buttons2.js';
3
3
 
4
4
  const DEFAULT_LANGUAGE = 'en';
5
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt', 'hr'];
6
5
  const TRANSLATIONS = {
7
6
  en: {
8
7
  joined: 'Joined',
@@ -158,6 +157,7 @@ const TRANSLATIONS = {
158
157
  minutes: 'minute',
159
158
  hours: 'ore',
160
159
  days: 'zile',
160
+ tournament: 'turneu'
161
161
  },
162
162
  tr: {
163
163
  enrolled: 'Katıldın',
@@ -389,8 +389,16 @@ const TRANSLATIONS = {
389
389
  }
390
390
  };
391
391
  const translate = (key, customLang) => {
392
+ var _a, _b;
392
393
  const lang = customLang;
393
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
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]);
395
+ };
396
+ const getTranslations = (data) => {
397
+ Object.keys(data).forEach((item) => {
398
+ for (let key in data[item]) {
399
+ TRANSLATIONS[item][key] = data[item][key];
400
+ }
401
+ });
394
402
  };
395
403
 
396
404
  //! moment.js
@@ -6222,6 +6230,12 @@ const CasinoTournamentBanner$1 = /*@__PURE__*/ proxyCustomElement(class extends
6222
6230
  }
6223
6231
  }
6224
6232
  componentWillLoad() {
6233
+ if (this.translationData) {
6234
+ getTranslations(JSON.parse(this.translationData));
6235
+ if (this.state) {
6236
+ this.stateText = this.getStateText(this.state);
6237
+ }
6238
+ }
6225
6239
  if (!this.useEvent && this.startTime) {
6226
6240
  this.formatDate();
6227
6241
  }
@@ -6259,7 +6273,7 @@ const CasinoTournamentBanner$1 = /*@__PURE__*/ proxyCustomElement(class extends
6259
6273
  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 &&
6260
6274
  h("span", { class: "TagRemain" }, this.showRemain, " ", translate('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6261
6275
  h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6262
- 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 })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate('terms', this.language))))));
6276
+ 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))))));
6263
6277
  }
6264
6278
  get host() { return this; }
6265
6279
  static get style() { return casinoTournamentBannerCss; }
@@ -6291,6 +6305,7 @@ const CasinoTournamentBanner$1 = /*@__PURE__*/ proxyCustomElement(class extends
6291
6305
  "showReadMore": [4, "show-read-more"],
6292
6306
  "clientStyling": [1, "client-styling"],
6293
6307
  "clientStylingUrl": [1, "client-styling-url"],
6308
+ "translationData": [520, "translation-data"],
6294
6309
  "stateText": [32],
6295
6310
  "limitStylingAppends": [32],
6296
6311
  "startdate": [32],
@@ -15,7 +15,6 @@ const getDevice = () => {
15
15
  };
16
16
 
17
17
  const DEFAULT_LANGUAGE = 'en';
18
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt', 'hr'];
19
18
  const TRANSLATIONS = {
20
19
  en: {
21
20
  joined: 'Joined',
@@ -364,8 +363,16 @@ const TRANSLATIONS = {
364
363
  }
365
364
  };
366
365
  const translate = (key, customLang) => {
366
+ var _a, _b;
367
367
  const lang = customLang;
368
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
368
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
369
+ };
370
+ const getTranslations = (data) => {
371
+ Object.keys(data).forEach((item) => {
372
+ for (let key in data[item]) {
373
+ TRANSLATIONS[item][key] = data[item][key];
374
+ }
375
+ });
369
376
  };
370
377
 
371
378
  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}";
@@ -396,6 +403,11 @@ const CasinoTournamentButtons = /*@__PURE__*/ proxyCustomElement(class extends H
396
403
  this.errorJoin = false;
397
404
  this.errorJoinConcurrently = false;
398
405
  }
406
+ componentWillLoad() {
407
+ if (this.translationData) {
408
+ getTranslations(JSON.parse(this.translationData));
409
+ }
410
+ }
399
411
  componentDidRender() {
400
412
  if (!this.limitStylingAppends && this.host) {
401
413
  if (this.clientStyling)
@@ -538,8 +550,8 @@ const CasinoTournamentButtons = /*@__PURE__*/ proxyCustomElement(class extends H
538
550
  return h("div", { class: "TournamentButtons" }, !this.session &&
539
551
  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 &&
540
552
  h("div", null, !this.enrolled &&
541
- 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) }, "Read more")), this.enrolled &&
542
- 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) }, "Read more"))), (this.errorJoin || this.errorJoinConcurrently) &&
553
+ 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 &&
554
+ 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) &&
543
555
  h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
544
556
  }
545
557
  get host() { return this; }
@@ -559,6 +571,7 @@ const CasinoTournamentButtons = /*@__PURE__*/ proxyCustomElement(class extends H
559
571
  "showReadMore": [4, "show-read-more"],
560
572
  "clientStyling": [1, "client-styling"],
561
573
  "clientStylingUrl": [1, "client-styling-url"],
574
+ "translationData": [520, "translation-data"],
562
575
  "limitStylingAppends": [32],
563
576
  "joinButtonLoading": [32],
564
577
  "errorJoin": [32],
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-0d4c091f.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-be35c232.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["casino-tournament-banner_2",[[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],"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],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
16
+ return bootstrapLazy([["casino-tournament-banner_2",[[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"],"translationData":[520,"translation-data"],"stateText":[32],"limitStylingAppends":[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"],"translationData":[520,"translation-data"],"limitStylingAppends":[32],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
17
17
  });
@@ -1,7 +1,6 @@
1
- import { r as registerInstance, h, g as getElement } from './index-0d4c091f.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-be35c232.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE$1 = 'en';
4
- const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt', 'hr'];
5
4
  const TRANSLATIONS$1 = {
6
5
  en: {
7
6
  joined: 'Joined',
@@ -157,6 +156,7 @@ const TRANSLATIONS$1 = {
157
156
  minutes: 'minute',
158
157
  hours: 'ore',
159
158
  days: 'zile',
159
+ tournament: 'turneu'
160
160
  },
161
161
  tr: {
162
162
  enrolled: 'Katıldın',
@@ -388,8 +388,16 @@ const TRANSLATIONS$1 = {
388
388
  }
389
389
  };
390
390
  const translate$1 = (key, customLang) => {
391
+ var _a, _b;
391
392
  const lang = customLang;
392
- return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][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]);
394
+ };
395
+ const getTranslations$1 = (data) => {
396
+ Object.keys(data).forEach((item) => {
397
+ for (let key in data[item]) {
398
+ TRANSLATIONS$1[item][key] = data[item][key];
399
+ }
400
+ });
393
401
  };
394
402
 
395
403
  //! moment.js
@@ -6219,6 +6227,12 @@ const CasinoTournamentBanner = class {
6219
6227
  }
6220
6228
  }
6221
6229
  componentWillLoad() {
6230
+ if (this.translationData) {
6231
+ getTranslations$1(JSON.parse(this.translationData));
6232
+ if (this.state) {
6233
+ this.stateText = this.getStateText(this.state);
6234
+ }
6235
+ }
6222
6236
  if (!this.useEvent && this.startTime) {
6223
6237
  this.formatDate();
6224
6238
  }
@@ -6256,7 +6270,7 @@ const CasinoTournamentBanner = class {
6256
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 &&
6257
6271
  h("span", { class: "TagRemain" }, this.showRemain, " ", translate$1('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6258
6272
  h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6259
- 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 })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('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))))));
6260
6274
  }
6261
6275
  get host() { return getElement(this); }
6262
6276
  };
@@ -6277,7 +6291,6 @@ const getDevice = () => {
6277
6291
  };
6278
6292
 
6279
6293
  const DEFAULT_LANGUAGE = 'en';
6280
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt', 'hr'];
6281
6294
  const TRANSLATIONS = {
6282
6295
  en: {
6283
6296
  joined: 'Joined',
@@ -6626,8 +6639,16 @@ const TRANSLATIONS = {
6626
6639
  }
6627
6640
  };
6628
6641
  const translate = (key, customLang) => {
6642
+ var _a, _b;
6629
6643
  const lang = customLang;
6630
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
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
+ });
6631
6652
  };
6632
6653
 
6633
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}";
@@ -6656,6 +6677,11 @@ const CasinoTournamentButtons = class {
6656
6677
  this.errorJoin = false;
6657
6678
  this.errorJoinConcurrently = false;
6658
6679
  }
6680
+ componentWillLoad() {
6681
+ if (this.translationData) {
6682
+ getTranslations(JSON.parse(this.translationData));
6683
+ }
6684
+ }
6659
6685
  componentDidRender() {
6660
6686
  if (!this.limitStylingAppends && this.host) {
6661
6687
  if (this.clientStyling)
@@ -6798,8 +6824,8 @@ const CasinoTournamentButtons = class {
6798
6824
  return h("div", { class: "TournamentButtons" }, !this.session &&
6799
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 &&
6800
6826
  h("div", null, !this.enrolled &&
6801
- 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) }, "Read more")), this.enrolled &&
6802
- 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) }, "Read more"))), (this.errorJoin || this.errorJoinConcurrently) &&
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) &&
6803
6829
  h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
6804
6830
  }
6805
6831
  get host() { return getElement(this); }
@@ -553,9 +553,14 @@ const patch = (oldVNode, newVNode) => {
553
553
  };
554
554
  const renderVdom = (hostRef, renderFnResults) => {
555
555
  const hostElm = hostRef.$hostElement$;
556
+ const cmpMeta = hostRef.$cmpMeta$;
556
557
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
557
558
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
558
559
  hostTagName = hostElm.tagName;
560
+ if (cmpMeta.$attrsToReflect$) {
561
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
562
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
563
+ }
559
564
  rootVnode.$tag$ = null;
560
565
  rootVnode.$flags$ |= 4 /* isHost */;
561
566
  hostRef.$vnode$ = rootVnode;
@@ -896,6 +901,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
896
901
  .map(([propName, m]) => {
897
902
  const attrName = m[1] || propName;
898
903
  attrNameToPropName.set(attrName, propName);
904
+ if (m[0] & 512 /* ReflectAttr */) {
905
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
906
+ }
899
907
  return attrName;
900
908
  });
901
909
  }
@@ -1056,6 +1064,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1056
1064
  {
1057
1065
  cmpMeta.$listeners$ = compactMeta[3];
1058
1066
  }
1067
+ {
1068
+ cmpMeta.$attrsToReflect$ = [];
1069
+ }
1059
1070
  const tagName = cmpMeta.$tagName$;
1060
1071
  const HostElement = class extends HTMLElement {
1061
1072
  // StencilLazyHost
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-0d4c091f.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-be35c232.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["casino-tournament-banner_2",[[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],"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],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
13
+ return bootstrapLazy([["casino-tournament-banner_2",[[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"],"translationData":[520,"translation-data"],"stateText":[32],"limitStylingAppends":[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"],"translationData":[520,"translation-data"],"limitStylingAppends":[32],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -108,6 +108,10 @@ export declare class CasinoTournamentBanner {
108
108
  * Client custom styling via url
109
109
  */
110
110
  clientStylingUrl?: string;
111
+ /**
112
+ * Translations via parent component
113
+ */
114
+ translationData?: any;
111
115
  stateText: string;
112
116
  limitStylingAppends: boolean;
113
117
  startdate: string;
@@ -111,6 +111,10 @@ export namespace Components {
111
111
  * Tournament ID
112
112
  */
113
113
  "tournamentId"?: string;
114
+ /**
115
+ * Translations via parent component
116
+ */
117
+ "translationData"?: any;
114
118
  /**
115
119
  * Use event to load data
116
120
  */
@@ -234,6 +238,10 @@ declare namespace LocalJSX {
234
238
  * Tournament ID
235
239
  */
236
240
  "tournamentId"?: string;
241
+ /**
242
+ * Translations via parent component
243
+ */
244
+ "translationData"?: any;
237
245
  /**
238
246
  * Use event to load data
239
247
  */
@@ -1 +1,2 @@
1
1
  export declare const translate: (key: string, customLang?: any) => string;
2
+ export declare const getTranslations: (data: any) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-tournament-banner",
3
- "version": "1.29.4",
3
+ "version": "1.29.6",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",