@everymatrix/casino-challenge-card 1.77.5 → 1.77.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.
Files changed (31) hide show
  1. package/dist/casino-challenge-card/casino-challenge-card-f02ce133.js +1 -0
  2. package/dist/casino-challenge-card/casino-challenge-card.entry.js +1 -1
  3. package/dist/casino-challenge-card/casino-challenge-card.esm.js +1 -1
  4. package/dist/casino-challenge-card/index-98abeec4.js +2 -0
  5. package/dist/casino-challenge-card/index.esm.js +1 -1
  6. package/dist/cjs/casino-challenge-card-1f059b3e.js +505 -0
  7. package/dist/cjs/casino-challenge-card.cjs.entry.js +2 -2
  8. package/dist/cjs/casino-challenge-card.cjs.js +2 -2
  9. package/dist/cjs/{index-4b50b479.js → index-c337b778.js} +25 -1
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/assets/finish.svg +7 -0
  13. package/dist/collection/assets/trophy.svg +14 -0
  14. package/dist/collection/components/casino-challenge-card/casino-challenge-card.css +129 -5
  15. package/dist/collection/components/casino-challenge-card/casino-challenge-card.js +193 -14
  16. package/dist/collection/utils/locale.utils.js +35 -5
  17. package/dist/collection/utils/types.js +25 -5
  18. package/dist/esm/casino-challenge-card-f02ce133.js +503 -0
  19. package/dist/esm/casino-challenge-card.entry.js +2 -2
  20. package/dist/esm/casino-challenge-card.js +3 -3
  21. package/dist/esm/{index-d72835d2.js → index-98abeec4.js} +25 -1
  22. package/dist/esm/index.js +2 -2
  23. package/dist/esm/loader.js +3 -3
  24. package/dist/types/components/casino-challenge-card/casino-challenge-card.d.ts +26 -1
  25. package/dist/types/components.d.ts +32 -0
  26. package/dist/types/utils/types.d.ts +17 -7
  27. package/package.json +1 -1
  28. package/dist/casino-challenge-card/casino-challenge-card-1c0b899b.js +0 -1
  29. package/dist/casino-challenge-card/index-d72835d2.js +0 -2
  30. package/dist/cjs/casino-challenge-card-e1c638cc.js +0 -349
  31. package/dist/esm/casino-challenge-card-1c0b899b.js +0 -347
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'casino-challenge-card';
2
- const BUILD = /* casino-challenge-card */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* casino-challenge-card */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -273,6 +273,9 @@ var Host = {};
273
273
  var isHost = (node) => node && node.$tag$ === Host;
274
274
  var parsePropertyValue = (propValue, propType) => {
275
275
  if (propValue != null && !isComplexType(propValue)) {
276
+ if (propType & 4 /* Boolean */) {
277
+ return propValue === "false" ? false : propValue === "" || !!propValue;
278
+ }
276
279
  if (propType & 1 /* String */) {
277
280
  return String(propValue);
278
281
  }
@@ -377,6 +380,27 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
377
380
  const newClasses = parseClassList(newValue);
378
381
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
379
382
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
383
+ } else if (memberName === "style") {
384
+ {
385
+ for (const prop in oldValue) {
386
+ if (!newValue || newValue[prop] == null) {
387
+ if (prop.includes("-")) {
388
+ elm.style.removeProperty(prop);
389
+ } else {
390
+ elm.style[prop] = "";
391
+ }
392
+ }
393
+ }
394
+ }
395
+ for (const prop in newValue) {
396
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
397
+ if (prop.includes("-")) {
398
+ elm.style.setProperty(prop, newValue[prop]);
399
+ } else {
400
+ elm.style[prop] = newValue[prop];
401
+ }
402
+ }
403
+ }
380
404
  } else if (memberName === "key") ; else if (memberName === "ref") {
381
405
  if (newValue) {
382
406
  newValue(elm);
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoChallengeCard } from './casino-challenge-card-1c0b899b.js';
2
- import './index-d72835d2.js';
1
+ export { C as CasinoChallengeCard } from './casino-challenge-card-f02ce133.js';
2
+ import './index-98abeec4.js';
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-d72835d2.js';
2
- export { s as setNonce } from './index-d72835d2.js';
1
+ import { b as bootstrapLazy } from './index-98abeec4.js';
2
+ export { s as setNonce } from './index-98abeec4.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["casino-challenge-card",[[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenge":[16],"tooltipIndex":[32],"timeLeft":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
8
+ return bootstrapLazy([["casino-challenge-card",[[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"challenge":[16],"isUserAuthorized":[516,"is-user-authorized"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -21,12 +21,31 @@ export declare class CasinoChallengeCard {
21
21
  * Client custom language for translation
22
22
  */
23
23
  language: string;
24
+ /**
25
+ * Client endpoint to fetch data
26
+ */
27
+ endpoint: string;
28
+ /**
29
+ * Domain Id
30
+ */
31
+ domain: string;
32
+ /**
33
+ * User session Id
34
+ */
35
+ session: string;
24
36
  /**
25
37
  * Challenge entity
26
38
  */
27
39
  challenge: IChallenge;
40
+ /**
41
+ * Is User authorized
42
+ */
43
+ isUserAuthorized: boolean;
28
44
  tooltipIndex: number;
29
45
  timeLeft: string;
46
+ error: string;
47
+ hasError: boolean;
48
+ actionLoading: boolean;
30
49
  timerExpired: EventEmitter;
31
50
  private stylingContainer;
32
51
  private stylingSubscription;
@@ -44,6 +63,12 @@ export declare class CasinoChallengeCard {
44
63
  private onMouseEnterHandler;
45
64
  private onMouseLeaveHandler;
46
65
  private renderInfoItem;
47
- private renderCardBadge;
66
+ private getBadgeContent;
67
+ private get getCardBadge();
68
+ private get isChallengeGrayed();
69
+ private get getChallengeProgress();
70
+ private get getCardButton();
71
+ checkAttrs: () => boolean;
72
+ joinUnjoinProgress(join?: boolean): Promise<any>;
48
73
  render(): any;
49
74
  }
@@ -21,6 +21,18 @@ export namespace Components {
21
21
  * Client custom styling via css file url
22
22
  */
23
23
  "clientStylingUrl": string;
24
+ /**
25
+ * Domain Id
26
+ */
27
+ "domain": string;
28
+ /**
29
+ * Client endpoint to fetch data
30
+ */
31
+ "endpoint": string;
32
+ /**
33
+ * Is User authorized
34
+ */
35
+ "isUserAuthorized": boolean;
24
36
  /**
25
37
  * Client custom language for translation
26
38
  */
@@ -29,6 +41,10 @@ export namespace Components {
29
41
  * Client custom styling via message bus
30
42
  */
31
43
  "mbSource": string;
44
+ /**
45
+ * User session Id
46
+ */
47
+ "session": string;
32
48
  /**
33
49
  * Client custom translation via json file url
34
50
  */
@@ -75,6 +91,18 @@ declare namespace LocalJSX {
75
91
  * Client custom styling via css file url
76
92
  */
77
93
  "clientStylingUrl"?: string;
94
+ /**
95
+ * Domain Id
96
+ */
97
+ "domain"?: string;
98
+ /**
99
+ * Client endpoint to fetch data
100
+ */
101
+ "endpoint"?: string;
102
+ /**
103
+ * Is User authorized
104
+ */
105
+ "isUserAuthorized"?: boolean;
78
106
  /**
79
107
  * Client custom language for translation
80
108
  */
@@ -84,6 +112,10 @@ declare namespace LocalJSX {
84
112
  */
85
113
  "mbSource"?: string;
86
114
  "onTimerExpired"?: (event: CasinoChallengeCardCustomEvent<any>) => void;
115
+ /**
116
+ * User session Id
117
+ */
118
+ "session"?: string;
87
119
  /**
88
120
  * Client custom translation via json file url
89
121
  */
@@ -20,13 +20,23 @@ export declare enum EChallengeRewardType {
20
20
  Challenge = 3,
21
21
  Custom = 4
22
22
  }
23
+ export declare enum EChallengeProgressStatus {
24
+ Closed = 0,
25
+ InProgress = 1,
26
+ Fillup = 2,
27
+ Completed = 3
28
+ }
23
29
  export declare enum EChallengeStatus {
24
- Setup = 0,
25
- Active = 1,
26
- Paused = 2,
27
- Closed = 3,
28
- Deleted = 4
30
+ Started = 0,
31
+ InProgress = 1,
32
+ PendingLevelReward = 2,
33
+ Completed = 3,
34
+ Expired = 4,
35
+ Forfeited = 5,
36
+ Awaiting = 6,
37
+ Paused = 7
29
38
  }
39
+ export declare const ChallengeStatusDictionary: string[];
30
40
  export declare enum EChallengeTriggerType {
31
41
  GameLaunch = 0,
32
42
  Reward = 1,
@@ -86,12 +96,12 @@ export interface ILevelProgress {
86
96
  TargetBetCount: number;
87
97
  Rewards: IChallengeLevelReward[];
88
98
  ProgressPercentage: number;
89
- ProgressStatus: number;
99
+ ProgressStatus: EChallengeProgressStatus;
90
100
  CompleteTime: string;
91
101
  BetRange: IChallengeBetRange;
92
102
  }
93
103
  export interface IChallenge {
94
- Status: number;
104
+ Status: EChallengeStatus;
95
105
  ChallengePresentation: IChallengePresentation;
96
106
  DomainId: number;
97
107
  Id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-challenge-card",
3
- "version": "1.77.5",
3
+ "version": "1.77.7",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as n}from"./index-d72835d2.js";const i=["ro","en","fr","ar","hr"],a={en:{totalLevels:"Total levels:",level1:"Level 1:",get:"Get:",endsIn:"Ends In",expired:"Expired",viewDetails:"View details",placeBetsOf:"Place bets of",place:"Place",bet:"bet",bets:"bets",minBet:"min bet"},ro:{totalLevels:"Niveluri totale:",level1:"Nivel 1:",get:"Obține:",endsIn:"Se termină în",expired:"Expirat",viewDetails:"Vezi detalii",placeBetsOf:"Plasează pariuri de",place:"Plasare",bet:"pariu",bets:"pariuri",minBet:"pariu minim"},fr:{totalLevels:"Niveaux totaux :",level1:"Niveau 1 :",get:"Obtenir :",endsIn:"Se termine dans",expired:"Expiré",viewDetails:"Voir les détails",placeBetsOf:"Placez des paris de",place:"Placer",bet:"pari",bets:"paris",minBet:"mise minimale"},ar:{totalLevels:"إجمالي المستويات:",level1:"المستوى 1:",get:"احصل على:",endsIn:"ينتهي في",expired:"منتهي الصلاحية",viewDetails:"عرض التفاصيل",placeBetsOf:"قم بوضع رهانات بقيمة",place:"ضع",bet:"رهان",bets:"رهانات",minBet:"الحد الأدنى للرهان"},hr:{totalLevels:"Ukupno razina:",level1:"Razina 1:",get:"Dobiti:",endsIn:"Završava za",expired:"Isteklo",viewDetails:"Pogledaj detalje",placeBetsOf:"Postavite oklade od",place:"Postavi",bet:"kladnja",bets:"kladnje",minBet:"minimalna oklada"}},o=(e,t)=>{const n=t;return a[void 0!==n&&i.includes(n)?n:"en"][e]};var r,s,l,d,c,h;function p(e,t){if(e){const n=document.createElement("style");n.innerHTML=t,e.appendChild(n)}}function v(e,t){const n=new URL(t);fetch(n.href).then((e=>e.text())).then((t=>{const n=document.createElement("style");n.innerHTML=t,e&&e.appendChild(n)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function u(e,t){if(window.emMessageBus){const n=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{n.innerHTML=t,e&&e.appendChild(n)}))}}!function(e){e[e.Accumulative=0]="Accumulative",e[e.SingleBet=1]="SingleBet",e[e.MultipleOneBetSize=2]="MultipleOneBetSize"}(r||(r={})),function(e){e[e.Single=0]="Single",e[e.Daily=1]="Daily",e[e.Weekly=2]="Weekly",e[e.Monthly=3]="Monthly"}(s||(s={})),function(e){e[e.FreeSpins=0]="FreeSpins",e[e.LuckyWheel=1]="LuckyWheel",e[e.Leaderboard=2]="Leaderboard",e[e.Challenge=3]="Challenge",e[e.Custom=4]="Custom"}(l||(l={})),function(e){e[e.Setup=0]="Setup",e[e.Active=1]="Active",e[e.Paused=2]="Paused",e[e.Closed=3]="Closed",e[e.Deleted=4]="Deleted"}(d||(d={})),function(e){e[e.GameLaunch=0]="GameLaunch",e[e.Reward=1]="Reward",e[e.Manual=2]="Manual"}(c||(c={})),function(e){e[e.Period=0]="Period",e[e.Date=1]="Date"}(h||(h={}));const b=class{constructor(n){e(this,n),this.timerExpired=t(this,"timerExpired",7),this.calculateTargetValue=(e,t)=>{var n;if(!e)return"";const i=(null===(n=e.BetRange)||void 0===n?void 0:n.MinBet)?`, ${o("minBet",this.language)} ${t+e.BetRange.MinBet}`:"";switch(e.LevelTargetType){case r.Accumulative:return`${o("placeBetsOf",this.language)} ${t+e.DisplayCurrencyTargetTurnover+i}`;case r.SingleBet:return`${o("place",this.language)} ${t+e.TargetTurnover} ${o("bet",this.language)}`;case r.MultipleOneBetSize:return`${o("place",this.language)} ${e.TargetBetCount} ${o("bets",this.language)+i}`}},this.onMouseEnterHandler=(e,t)=>{t.scrollWidth>t.clientWidth&&(this.tooltipIndex=e)},this.onMouseLeaveHandler=()=>{this.tooltipIndex=null},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.challenge=void 0,this.tooltipIndex=null,this.timeLeft=void 0}get infoItems(){var e,t,n,i;const a=null===(e=this.challenge)||void 0===e?void 0:e.LevelProgresses.find((e=>0===e.OrderNumber));if(a){const e=null===(t=a.Rewards)||void 0===t?void 0:t.slice(0,2).map((e=>e.RewardDescription)).join(" + ");return[{lable:o("totalLevels",this.language),value:null===(n=this.challenge.LevelProgresses)||void 0===n?void 0:n.length},{lable:o("level1",this.language),value:this.calculateTargetValue(a,null===(i=this.challenge)||void 0===i?void 0:i.CurrencySymbol)},{lable:o("get",this.language),value:e}]}return[]}handleClientStylingChange(e,t){e!=t&&p(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&v(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&u(this.stylingContainer,`${this.mbSource}.Style`)}connectedCallback(){this.timerId=setInterval((()=>{this.updateTime()}),1e3)}componentWillLoad(){this.translationUrl&&(async e=>{if(e)try{const n=await fetch(e);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const i=await n.json();t=i,Object.keys(t).forEach((e=>{for(let n in t[e])a[e][n]=t[e][n]}))}catch(e){console.error("Failed to fetch or parse translations from URL:",e)}var t})(this.translationUrl),this.updateTime()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&u(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&p(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&v(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),clearInterval(this.timerId)}updateTime(){var e;this.timeLeft=function(e){const t=new Date;let n=new Date(e).getTime()-t.getTime();if(n<=0)return;const i=Math.floor(n/864e5);n-=864e5*i;const a=Math.floor(n/36e5);n-=36e5*a;const o=Math.floor(n/6e4);n-=6e4*o;const r=Math.floor(n/1e3),s=e=>e.toString().padStart(2,"0");return`${s(i)} : ${s(a)} : ${s(o)} : ${s(r)}`}(null===(e=this.challenge)||void 0===e?void 0:e.ExpirationTime),!this.timeLeft&&this.timerExpired&&(clearInterval(this.timerId),this.timerExpired.emit(this.challenge.Id))}renderInfoItem(e,t){return n("div",{class:"info-item",onMouseEnter:e=>this.onMouseEnterHandler(t,e.currentTarget),onMouseLeave:this.onMouseLeaveHandler},n("span",{class:"info-item__label"},e.lable),e.value,this.tooltipIndex===t&&n("div",{class:"info-item__tooltip"},e.value))}renderCardBadge(){return n("div",{class:"card__badge"},this.timeLeft?[o("endsIn",this.language)," - ",n("span",null,this.timeLeft)]:o("expired",this.language))}render(){var e,t,i,a;return n("div",{key:"5df3a2d368e6057d1b47cf5d4766126406c4afc8",ref:e=>this.stylingContainer=e},n("div",{key:"de708f82c0fbe5324419fafcb395f115c020d021",class:"card"},n("img",{key:"209c1f05bb70c3182b4ff6211e7c9398999b30fc",class:"card__image",src:null===(t=null===(e=this.challenge)||void 0===e?void 0:e.ChallengePresentation)||void 0===t?void 0:t.Url}),this.renderCardBadge(),n("div",{key:"aa3a5f3eee8bdb7c2606bc8a232c441ff4a22006",class:"card__content"},n("h1",{key:"524933e67d8eac476d678aee9f2643b6ac1449ff",class:"card__title"},null===(a=null===(i=this.challenge)||void 0===i?void 0:i.ChallengePresentation)||void 0===a?void 0:a.PresentationName),this.infoItems.map(((e,t)=>this.renderInfoItem(e,t))),n("button",{key:"52fec7d22602a2757c1a36238fb0b797f6bb4306",class:"card__button"},o("viewDetails",this.language)))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};b.style='.card {\n width: 308px;\n border-radius: 16px;\n border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));\n background-color: var(--emw--color-background, #141515);\n box-sizing: border-box;\n position: relative;\n}\n@container challenge-list (max-width: 576px) {\n .card {\n width: 100%;\n }\n}\n.card:hover {\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n cursor: pointer;\n}\n.card__image {\n width: 100%;\n height: 200px;\n border-radius: 16px 16px 0 0;\n}\n@container challenge-list (max-width: 576px) {\n .card__image {\n height: 224px;\n }\n}\n.card__title {\n color: var(--emw--color-white, #FFFFFF);\n font-size: var(--emw--font-size-medium, 16px);\n margin: 0 0 10px;\n}\n.card__content {\n padding: 20px;\n}\n.card__button {\n margin-top: 20px;\n width: 100%;\n height: 34px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #727672);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-secondary, #e9931e);\n}\n.card__button:hover {\n border-color: var(--emw--color-secondary, #e9931e);\n cursor: pointer;\n}\n.card__badge {\n position: absolute;\n background: white;\n top: 6px;\n right: 6px;\n border-radius: 30px;\n padding: 2px 12px;\n line-height: 22px;\n font-weight: var(--emw--font-weight-medium, 500);\n font-size: var(--emw--font-size-x-small, 12px);\n box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);\n backdrop-filter: blur(20px);\n}\n.card__badge span {\n font-weight: var(--emw--font-weight-bold, 700);\n}\n\n.info-item {\n line-height: 24px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-primary, #1dbf51);\n}\n@container challenge-list (min-width: 576px) {\n .info-item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom;\n }\n}\n.info-item__label {\n font-weight: var(--emw--font-weight-medium, 500);\n margin-right: 3px;\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.info-item__tooltip {\n position: absolute;\n line-height: 22px;\n padding: 8px 12px;\n border-radius: 8px;\n opacity: 1;\n z-index: 200;\n white-space: nowrap;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--color-background-secondary, #1B1C2B);\n}\n.info-item__tooltip::before {\n content: "";\n position: absolute;\n top: -5px;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid var(--emw--color-background-secondary, #1B1C2B);\n width: 0;\n height: 0;\n z-index: 201;\n}';export{b as C}
@@ -1,2 +0,0 @@
1
- var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},h=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,p=[],y=[],$=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&f.l?v(w):f.raf(w))},b=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},w=()=>{b(p),b(y),(m=p.length>0)&&f.raf(w)},v=e=>h().then(e),g=$(y,!0),S={},k=e=>"object"==(e=typeof e)||"function"===e;function j(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>C,map:()=>E,ok:()=>O,unwrap:()=>P,unwrapErr:()=>L});var O=e=>({isOk:!0,isErr:!1,value:e}),C=e=>({isOk:!1,isErr:!0,value:e});function E(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>O(e))):O(n)}if(e.isErr)return C(e.value);throw"should never get here"}var M,x,P=e=>{if(e.isOk)return e.value;throw e.value},L=e=>{if(e.isErr)return e.value;throw e.value},R=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!k(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?T(null,l):l),r=s)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=T(e,null);return u.u=t,i.length>0&&(u.h=i),u.m=o,u},T=(e,t)=>({l:0,p:e,i:t,$:null,h:null,u:null,m:null}),A={},N=(e,t,l)=>{const o=(e=>n(e).$hostElement$)(e);return{emit:e=>U(o,t,{bubbles:!!(4&l),composed:!!(2&l),cancelable:!!(1&l),detail:e})}},U=(e,t,n)=>{const l=f.ce(t,n);return e.dispatchEvent(l),l},W=new WeakMap,D=e=>"sc-"+e.v,F=(e,t,n,l,s,r)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=q(n),s=q(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=k(l);if((i||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):o(u,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(G);t=t.replace(V,""),n&&f.rel(e,t,n,o),l&&f.ael(e,t,l,o)}}},H=/\s/,q=e=>e?e.split(H):[],G="Capture",V=RegExp(G+"$"),_=(e,t,n)=>{const l=11===t.$.nodeType&&t.$.host?t.$.host:t.$,o=e&&e.u||S,s=t.u||S;for(const e of z(Object.keys(o)))e in s||F(l,e,o[e],void 0,n,t.l);for(const e of z(Object.keys(s)))F(l,e,o[e],s[e],n,t.l)};function z(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var B=!1,I=(e,t,n)=>{const l=t.h[n];let o,s,r=0;if(null!==l.i)o=l.$=a.createTextNode(l.i);else if(o=l.$=a.createElement(l.p),_(null,l,B),null!=M&&o["s-si"]!==M&&o.classList.add(o["s-si"]=M),l.h)for(r=0;r<l.h.length;++r)s=I(e,l,r),s&&o.appendChild(s);return o["s-hn"]=x,o},J=(e,t,n,l,o,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);o<=s;++o)l[o]&&(r=I(null,n,o),r&&(l[o].$=r,Z(i,r,t)))},K=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.$;Y(t),e&&e.remove()}}},Q=(e,t,n=!1)=>e.p===t.p&&(!!n||e.m===t.m),X=(e,t,n=!1)=>{const l=t.$=e.$,o=e.h,s=t.h,r=t.i;null===r?(_(e,t,B),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],m=l.length-1,p=l[0],y=l[m];for(;i<=f&&c<=m;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==p)p=l[++c];else if(null==y)y=l[--m];else if(Q(h,p,o))X(h,p,o),h=t[++i],p=l[++c];else if(Q(d,y,o))X(d,y,o),d=t[--f],y=l[--m];else if(Q(h,y,o))X(h,y,o),Z(e,h.$,d.$.nextSibling),h=t[++i],y=l[--m];else if(Q(d,p,o))X(d,p,o),Z(e,d.$,h.$),d=t[--f],p=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].m&&t[a].m===p.m){u=a;break}u>=0?(r=t[u],r.p!==p.p?s=I(t&&t[c],n,u):(X(r,p,o),t[u]=void 0,s=r.$),p=l[++c]):(s=I(t&&t[c],n,c),p=l[++c]),s&&Z(h.$.parentNode,s,h.$)}i>f?J(e,null==l[m+1]?null:l[m+1].$,n,l,c,m):c>m&&K(t,i,f)})(l,o,t,s,n):null!==s?(null!==e.i&&(l.textContent=""),J(l,null,t,s,0,s.length-1)):null!==o&&K(o,0,o.length-1)):e.i!==r&&(l.data=r)},Y=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(Y)},Z=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),ee=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},te=(e,t)=>{if(e.l|=16,!(4&e.l))return ee(e,e.k),g((()=>ne(e,t)));e.l|=512},ne=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return t&&(l=ue(n,"componentWillLoad")),le(l,(()=>se(e,n,t)))},le=(e,t)=>oe(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),oe=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,se=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.j,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=D(t),o=i.get(l);if(e=11===e.nodeType?e:a,o)if("string"==typeof o){let s,r=W.get(e=e.head||e);if(r||W.set(e,r=new Set),!r.has(l)){{s=a.createElement("style"),s.innerHTML=o;const t=null!=(n=f.O)?n:j(a);null!=t&&s.setAttribute("nonce",t),e.insertBefore(s,e.querySelector("link"))}4&t.l&&(s.innerHTML+=c),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);re(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>ie(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},re=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.j,s=e.C||T(null,null),r=(e=>e&&e.p===A)(t)?t:R(null,null,t);if(x=l.tagName,o.M&&(r.u=r.u||{},o.M.map((([e,t])=>r.u[t]=l[e]))),n&&r.u)for(const e of Object.keys(r.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=l[e]);r.p=null,r.l|=4,e.C=r,r.$=s.$=l.shadowRoot||l,M=l["s-sc"],X(s,r,n)})(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},ie=e=>{const t=e.$hostElement$,n=e.t,l=e.k;64&e.l||(e.l|=64,ae(t),ue(n,"componentDidLoad"),e.P(t),l||ce()),e.S&&(e.S(),e.S=void 0),512&e.l&&v((()=>te(e,!1))),e.l&=-517},ce=()=>{ae(a.documentElement),v((()=>U(u,"appload",{detail:{namespace:"casino-challenge-card"}})))},ue=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ae=e=>e.classList.add("hydrated"),fe=(e,t,l)=>{var o,r;const i=e.prototype;if(t.L||t.R||e.watchers){e.watchers&&!t.R&&(t.R=e.watchers);const c=Object.entries(null!=(o=t.L)?o:{});if(c.map((([e,[o]])=>{(31&o||2&l&&32&o)&&Object.defineProperty(i,e,{get(){return((e,t)=>n(this).T.get(t))(0,e)},set(l){((e,t,l,o)=>{const r=n(e);if(!r)throw Error(`Couldn't find host element for "${o.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=r.$hostElement$,c=r.T.get(t),u=r.l,a=r.t;if(l=((e,t)=>null==e||k(e)?e:1&t?e+"":e)(l,o.L[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(r.T.set(t,l),a)){if(o.R&&128&u){const e=o.R[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){s(e,i)}}))}2==(18&u)&&te(r,!1)}})(this,e,l,t)},configurable:!0,enumerable:!0})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var r;const c=l.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&s!==o){const n=l.t,i=null==(r=t.R)?void 0:r[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,s,o,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.R)?r:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const s=n[1]||e;return l.set(s,e),512&n[0]&&(null==(o=t.M)||o.push([e,s])),s}))]))}}return e},he=e=>{ue(e,"connectedCallback")},de=e=>{ue(e,"disconnectedCallback")},me=(e,l={})=>{var o;const h=[],m=l.exclude||[],p=u.customElements,y=a.head,$=y.querySelector("meta[charset]"),b=a.createElement("style"),w=[];let v,g=!0;Object.assign(f,l),f.o=new URL(l.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((l=>{var o;const c={l:l[0],v:l[1],L:l[2],A:l[3]};4&c.l&&(S=!0),c.L=l[2],c.M=[],c.R=null!=(o=l[4])?o:{};const u=c.v,a=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,j:n,T:new Map};l.N=new Promise((e=>l.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,c),1&c.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${c.v}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),v&&(clearTimeout(v),v=null),g?w.push(this):f.jmp((()=>(e=>{if(!(1&f.l)){const t=n(e),l=t.j,o=()=>{};if(1&t.l)(null==t?void 0:t.t)?he(t.t):(null==t?void 0:t.N)&&t.N.then((()=>he(t.t)));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){ee(t,t.k=n);break}}l.L&&Object.entries(l.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let l;if(!(32&t.l)){if(t.l|=32,n.U){const e=(e=>{const t=e.v.replace(/-/g,"_"),n=e.U;if(!n)return;const l=r.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(r.set(n,e),e[t])),s)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};l=await e,t()}else l=e;if(!l)throw Error(`Constructor for "${n.v}#${t.W}" was not found`);l.isProxied||(n.R=l.watchers,fe(l,n,2),l.isProxied=!0);const o=()=>{};t.l|=8;try{new l(t)}catch(e){s(e)}t.l&=-9,t.l|=128,o(),he(t.t)}else l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(l&&l.style){let e;"string"==typeof l.style&&(e=l.style);const t=D(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const o=t.k,c=()=>te(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(e,t,l)}o()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.l)){const e=n(this);(null==e?void 0:e.t)?de(e.t):(null==e?void 0:e.N)&&e.N.then((()=>de(e.t)))}})()))}componentOnReady(){return n(this).N}};c.U=e[0],m.includes(u)||p.get(u)||(h.push(u),p.define(u,fe(a,c,1)))}))})),h.length>0&&(S&&(b.textContent+=c),b.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const e=null!=(o=f.O)?o:j(a);null!=e&&b.setAttribute("nonce",e),y.insertBefore(b,$?$.nextSibling:y.firstChild)}g=!1,w.length?w.map((e=>e.connectedCallback())):f.jmp((()=>v=setTimeout(ce,30)))},pe=e=>f.O=e;export{me as b,N as c,R as h,h as p,l as r,pe as s}
@@ -1,349 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-4b50b479.js');
4
-
5
- const DEFAULT_LANGUAGE = 'en';
6
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
7
- const TRANSLATIONS = {
8
- en: {
9
- totalLevels: 'Total levels:',
10
- level1: 'Level 1:',
11
- get: 'Get:',
12
- endsIn: 'Ends In',
13
- expired: 'Expired',
14
- viewDetails: 'View details',
15
- placeBetsOf: 'Place bets of',
16
- place: 'Place',
17
- bet: 'bet',
18
- bets: 'bets',
19
- minBet: 'min bet'
20
- },
21
- ro: {
22
- totalLevels: 'Niveluri totale:',
23
- level1: 'Nivel 1:',
24
- get: 'Obține:',
25
- endsIn: 'Se termină în',
26
- expired: 'Expirat',
27
- viewDetails: 'Vezi detalii',
28
- placeBetsOf: 'Plasează pariuri de',
29
- place: 'Plasare',
30
- bet: 'pariu',
31
- bets: 'pariuri',
32
- minBet: 'pariu minim'
33
- },
34
- fr: {
35
- totalLevels: 'Niveaux totaux :',
36
- level1: 'Niveau 1 :',
37
- get: 'Obtenir :',
38
- endsIn: 'Se termine dans',
39
- expired: 'Expiré',
40
- viewDetails: 'Voir les détails',
41
- placeBetsOf: 'Placez des paris de',
42
- place: 'Placer',
43
- bet: 'pari',
44
- bets: 'paris',
45
- minBet: 'mise minimale'
46
- },
47
- ar: {
48
- totalLevels: 'إجمالي المستويات:',
49
- level1: 'المستوى 1:',
50
- get: 'احصل على:',
51
- endsIn: 'ينتهي في',
52
- expired: 'منتهي الصلاحية',
53
- viewDetails: 'عرض التفاصيل',
54
- placeBetsOf: 'قم بوضع رهانات بقيمة',
55
- place: 'ضع',
56
- bet: 'رهان',
57
- bets: 'رهانات',
58
- minBet: 'الحد الأدنى للرهان'
59
- },
60
- hr: {
61
- totalLevels: 'Ukupno razina:',
62
- level1: 'Razina 1:',
63
- get: 'Dobiti:',
64
- endsIn: 'Završava za',
65
- expired: 'Isteklo',
66
- viewDetails: 'Pogledaj detalje',
67
- placeBetsOf: 'Postavite oklade od',
68
- place: 'Postavi',
69
- bet: 'kladnja',
70
- bets: 'kladnje',
71
- minBet: 'minimalna oklada'
72
- }
73
- };
74
- const translate = (key, customLang) => {
75
- const lang = customLang;
76
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
77
- };
78
- const getTranslations = (data) => {
79
- Object.keys(data).forEach((item) => {
80
- for (let key in data[item]) {
81
- TRANSLATIONS[item][key] = data[item][key];
82
- }
83
- });
84
- };
85
- const resolveTranslationUrl = async (translationUrl) => {
86
- if (translationUrl) {
87
- try {
88
- const response = await fetch(translationUrl);
89
- if (!response.ok) {
90
- throw new Error(`HTTP error! status: ${response.status}`);
91
- }
92
- const translations = await response.json();
93
- getTranslations(translations);
94
- }
95
- catch (error) {
96
- console.error('Failed to fetch or parse translations from URL:', error);
97
- }
98
- }
99
- };
100
-
101
- var EChallengeLevelTargetType;
102
- (function (EChallengeLevelTargetType) {
103
- EChallengeLevelTargetType[EChallengeLevelTargetType["Accumulative"] = 0] = "Accumulative";
104
- EChallengeLevelTargetType[EChallengeLevelTargetType["SingleBet"] = 1] = "SingleBet";
105
- EChallengeLevelTargetType[EChallengeLevelTargetType["MultipleOneBetSize"] = 2] = "MultipleOneBetSize";
106
- })(EChallengeLevelTargetType || (EChallengeLevelTargetType = {}));
107
- var EChallengeRecurrenceType;
108
- (function (EChallengeRecurrenceType) {
109
- EChallengeRecurrenceType[EChallengeRecurrenceType["Single"] = 0] = "Single";
110
- EChallengeRecurrenceType[EChallengeRecurrenceType["Daily"] = 1] = "Daily";
111
- EChallengeRecurrenceType[EChallengeRecurrenceType["Weekly"] = 2] = "Weekly";
112
- EChallengeRecurrenceType[EChallengeRecurrenceType["Monthly"] = 3] = "Monthly";
113
- })(EChallengeRecurrenceType || (EChallengeRecurrenceType = {}));
114
- var EChallengeRewardType;
115
- (function (EChallengeRewardType) {
116
- EChallengeRewardType[EChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
117
- EChallengeRewardType[EChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
118
- EChallengeRewardType[EChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
119
- EChallengeRewardType[EChallengeRewardType["Challenge"] = 3] = "Challenge";
120
- EChallengeRewardType[EChallengeRewardType["Custom"] = 4] = "Custom";
121
- })(EChallengeRewardType || (EChallengeRewardType = {}));
122
- var EChallengeStatus;
123
- (function (EChallengeStatus) {
124
- EChallengeStatus[EChallengeStatus["Setup"] = 0] = "Setup";
125
- EChallengeStatus[EChallengeStatus["Active"] = 1] = "Active";
126
- EChallengeStatus[EChallengeStatus["Paused"] = 2] = "Paused";
127
- EChallengeStatus[EChallengeStatus["Closed"] = 3] = "Closed";
128
- EChallengeStatus[EChallengeStatus["Deleted"] = 4] = "Deleted";
129
- })(EChallengeStatus || (EChallengeStatus = {}));
130
- var EChallengeTriggerType;
131
- (function (EChallengeTriggerType) {
132
- EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
133
- EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
134
- EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
135
- })(EChallengeTriggerType || (EChallengeTriggerType = {}));
136
- var EChallengeValidityType;
137
- (function (EChallengeValidityType) {
138
- EChallengeValidityType[EChallengeValidityType["Period"] = 0] = "Period";
139
- EChallengeValidityType[EChallengeValidityType["Date"] = 1] = "Date";
140
- })(EChallengeValidityType || (EChallengeValidityType = {}));
141
-
142
- function getTimeLeft(endTime) {
143
- const now = new Date();
144
- const end = new Date(endTime);
145
- let diff = end.getTime() - now.getTime();
146
- if (diff <= 0) {
147
- return;
148
- }
149
- const days = Math.floor(diff / (1000 * 60 * 60 * 24));
150
- diff -= days * (1000 * 60 * 60 * 24);
151
- const hours = Math.floor(diff / (1000 * 60 * 60));
152
- diff -= hours * (1000 * 60 * 60);
153
- const minutes = Math.floor(diff / (1000 * 60));
154
- diff -= minutes * (1000 * 60);
155
- const seconds = Math.floor(diff / 1000);
156
- const pad = (n) => n.toString().padStart(2, '0');
157
- return `${pad(days)} : ${pad(hours)} : ${pad(minutes)} : ${pad(seconds)}`;
158
- }
159
-
160
- /**
161
- * @name setClientStyling
162
- * @description Method used to create and append to the passed element of the widget a style element with the content received
163
- * @param {HTMLElement} stylingContainer The reference element of the widget
164
- * @param {string} clientStyling The style content
165
- */
166
- function setClientStyling(stylingContainer, clientStyling) {
167
- if (stylingContainer) {
168
- const sheet = document.createElement('style');
169
- sheet.innerHTML = clientStyling;
170
- stylingContainer.appendChild(sheet);
171
- }
172
- }
173
-
174
- /**
175
- * @name setClientStylingURL
176
- * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
177
- * @param {HTMLElement} stylingContainer The reference element of the widget
178
- * @param {string} clientStylingUrl The URL of the style content
179
- */
180
- function setClientStylingURL(stylingContainer, clientStylingUrl) {
181
- const url = new URL(clientStylingUrl);
182
-
183
- fetch(url.href)
184
- .then((res) => res.text())
185
- .then((data) => {
186
- const cssFile = document.createElement('style');
187
- cssFile.innerHTML = data;
188
- if (stylingContainer) {
189
- stylingContainer.appendChild(cssFile);
190
- }
191
- })
192
- .catch((err) => {
193
- console.error('There was an error while trying to load client styling from URL', err);
194
- });
195
- }
196
-
197
- /**
198
- * @name setStreamLibrary
199
- * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
200
- * @param {HTMLElement} stylingContainer The highest element of the widget
201
- * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
202
- * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
203
- */
204
- function setStreamStyling(stylingContainer, domain, subscription) {
205
- if (window.emMessageBus) {
206
- const sheet = document.createElement('style');
207
-
208
- window.emMessageBus.subscribe(domain, (data) => {
209
- sheet.innerHTML = data;
210
- if (stylingContainer) {
211
- stylingContainer.appendChild(sheet);
212
- }
213
- });
214
- }
215
- }
216
-
217
- const casinoChallengeCardCss = ".card {\n width: 308px;\n border-radius: 16px;\n border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));\n background-color: var(--emw--color-background, #141515);\n box-sizing: border-box;\n position: relative;\n}\n@container challenge-list (max-width: 576px) {\n .card {\n width: 100%;\n }\n}\n.card:hover {\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n cursor: pointer;\n}\n.card__image {\n width: 100%;\n height: 200px;\n border-radius: 16px 16px 0 0;\n}\n@container challenge-list (max-width: 576px) {\n .card__image {\n height: 224px;\n }\n}\n.card__title {\n color: var(--emw--color-white, #FFFFFF);\n font-size: var(--emw--font-size-medium, 16px);\n margin: 0 0 10px;\n}\n.card__content {\n padding: 20px;\n}\n.card__button {\n margin-top: 20px;\n width: 100%;\n height: 34px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #727672);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-secondary, #e9931e);\n}\n.card__button:hover {\n border-color: var(--emw--color-secondary, #e9931e);\n cursor: pointer;\n}\n.card__badge {\n position: absolute;\n background: white;\n top: 6px;\n right: 6px;\n border-radius: 30px;\n padding: 2px 12px;\n line-height: 22px;\n font-weight: var(--emw--font-weight-medium, 500);\n font-size: var(--emw--font-size-x-small, 12px);\n box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);\n backdrop-filter: blur(20px);\n}\n.card__badge span {\n font-weight: var(--emw--font-weight-bold, 700);\n}\n\n.info-item {\n line-height: 24px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-primary, #1dbf51);\n}\n@container challenge-list (min-width: 576px) {\n .info-item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom;\n }\n}\n.info-item__label {\n font-weight: var(--emw--font-weight-medium, 500);\n margin-right: 3px;\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.info-item__tooltip {\n position: absolute;\n line-height: 22px;\n padding: 8px 12px;\n border-radius: 8px;\n opacity: 1;\n z-index: 200;\n white-space: nowrap;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--color-background-secondary, #1B1C2B);\n}\n.info-item__tooltip::before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid var(--emw--color-background-secondary, #1B1C2B);\n width: 0;\n height: 0;\n z-index: 201;\n}";
218
- const CasinoChallengeCardStyle0 = casinoChallengeCardCss;
219
-
220
- const CasinoChallengeCard = class {
221
- constructor(hostRef) {
222
- index.registerInstance(this, hostRef);
223
- this.timerExpired = index.createEvent(this, "timerExpired", 7);
224
- this.calculateTargetValue = (level, currencySymbol) => {
225
- var _a;
226
- if (!level)
227
- return '';
228
- const minbet = ((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet)
229
- ? `, ${translate('minBet', this.language)} ${currencySymbol + level.BetRange.MinBet}`
230
- : '';
231
- switch (level.LevelTargetType) {
232
- case EChallengeLevelTargetType.Accumulative:
233
- return `${translate('placeBetsOf', this.language)} ${currencySymbol + level.DisplayCurrencyTargetTurnover + minbet}`;
234
- case EChallengeLevelTargetType.SingleBet:
235
- return `${translate('place', this.language)} ${currencySymbol + level.TargetTurnover} ${translate('bet', this.language)}`;
236
- case EChallengeLevelTargetType.MultipleOneBetSize:
237
- return `${translate('place', this.language)} ${level.TargetBetCount} ${translate('bets', this.language) + minbet}`;
238
- }
239
- };
240
- this.onMouseEnterHandler = (index, el) => {
241
- if (el.scrollWidth > el.clientWidth) {
242
- this.tooltipIndex = index;
243
- }
244
- };
245
- this.onMouseLeaveHandler = () => {
246
- this.tooltipIndex = null;
247
- };
248
- this.mbSource = undefined;
249
- this.clientStyling = undefined;
250
- this.clientStylingUrl = undefined;
251
- this.translationUrl = '';
252
- this.language = 'en';
253
- this.challenge = undefined;
254
- this.tooltipIndex = null;
255
- this.timeLeft = undefined;
256
- }
257
- get infoItems() {
258
- var _a, _b, _c, _d;
259
- const level1 = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses.find((x) => x.OrderNumber === 0);
260
- if (level1) {
261
- const rewardValue = (_b = level1.Rewards) === null || _b === void 0 ? void 0 : _b.slice(0, 2).map((r) => r.RewardDescription).join(' + ');
262
- return [
263
- {
264
- lable: translate('totalLevels', this.language),
265
- value: (_c = this.challenge.LevelProgresses) === null || _c === void 0 ? void 0 : _c.length
266
- },
267
- {
268
- lable: translate('level1', this.language),
269
- value: this.calculateTargetValue(level1, (_d = this.challenge) === null || _d === void 0 ? void 0 : _d.CurrencySymbol)
270
- },
271
- {
272
- lable: translate('get', this.language),
273
- value: rewardValue
274
- }
275
- ];
276
- }
277
- return [];
278
- }
279
- handleClientStylingChange(newValue, oldValue) {
280
- if (newValue != oldValue) {
281
- setClientStyling(this.stylingContainer, this.clientStyling);
282
- }
283
- }
284
- handleClientStylingUrlChange(newValue, oldValue) {
285
- if (newValue != oldValue) {
286
- setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
287
- }
288
- }
289
- handleMbSourceChange(newValue, oldValue) {
290
- if (newValue != oldValue) {
291
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
292
- }
293
- }
294
- connectedCallback() {
295
- this.timerId = setInterval(() => {
296
- this.updateTime();
297
- }, 1000);
298
- }
299
- componentWillLoad() {
300
- if (this.translationUrl) {
301
- resolveTranslationUrl(this.translationUrl);
302
- }
303
- this.updateTime();
304
- }
305
- componentDidLoad() {
306
- if (this.stylingContainer) {
307
- if (this.mbSource)
308
- setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
309
- if (this.clientStyling)
310
- setClientStyling(this.stylingContainer, this.clientStyling);
311
- if (this.clientStylingUrl)
312
- setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
313
- }
314
- }
315
- disconnectedCallback() {
316
- if (this.stylingSubscription) {
317
- this.stylingSubscription.unsubscribe();
318
- }
319
- clearInterval(this.timerId);
320
- }
321
- updateTime() {
322
- var _a;
323
- this.timeLeft = getTimeLeft((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ExpirationTime);
324
- if (!this.timeLeft && this.timerExpired) {
325
- clearInterval(this.timerId);
326
- this.timerExpired.emit(this.challenge.Id);
327
- }
328
- }
329
- renderInfoItem(item, index$1) {
330
- return (index.h("div", { class: "info-item", onMouseEnter: (e) => this.onMouseEnterHandler(index$1, e.currentTarget), onMouseLeave: this.onMouseLeaveHandler }, index.h("span", { class: "info-item__label" }, item.lable), item.value, this.tooltipIndex === index$1 && index.h("div", { class: "info-item__tooltip" }, item.value)));
331
- }
332
- renderCardBadge() {
333
- return (index.h("div", { class: "card__badge" }, this.timeLeft
334
- ? [translate('endsIn', this.language), ' - ', index.h("span", null, this.timeLeft)]
335
- : translate('expired', this.language)));
336
- }
337
- render() {
338
- var _a, _b, _c, _d;
339
- return (index.h("div", { key: '5df3a2d368e6057d1b47cf5d4766126406c4afc8', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'de708f82c0fbe5324419fafcb395f115c020d021', class: "card" }, index.h("img", { key: '209c1f05bb70c3182b4ff6211e7c9398999b30fc', class: "card__image", src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.Url }), this.renderCardBadge(), index.h("div", { key: 'aa3a5f3eee8bdb7c2606bc8a232c441ff4a22006', class: "card__content" }, index.h("h1", { key: '524933e67d8eac476d678aee9f2643b6ac1449ff', class: "card__title" }, (_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 : _d.PresentationName), this.infoItems.map((x, index) => this.renderInfoItem(x, index)), index.h("button", { key: '52fec7d22602a2757c1a36238fb0b797f6bb4306', class: "card__button" }, translate('viewDetails', this.language))))));
340
- }
341
- static get watchers() { return {
342
- "clientStyling": ["handleClientStylingChange"],
343
- "clientStylingUrl": ["handleClientStylingUrlChange"],
344
- "mbSource": ["handleMbSourceChange"]
345
- }; }
346
- };
347
- CasinoChallengeCard.style = CasinoChallengeCardStyle0;
348
-
349
- exports.CasinoChallengeCard = CasinoChallengeCard;