@everymatrix/casino-tournament-slider 1.0.69

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 (44) hide show
  1. package/dist/casino-tournament-slider/casino-tournament-slider.esm.js +1 -0
  2. package/dist/casino-tournament-slider/index.esm.js +0 -0
  3. package/dist/casino-tournament-slider/p-01da553f.entry.js +1 -0
  4. package/dist/casino-tournament-slider/p-c541e3cd.js +2 -0
  5. package/dist/casino-tournament-slider/p-e1255160.js +1 -0
  6. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  7. package/dist/cjs/casino-tournament-slider.cjs.js +25 -0
  8. package/dist/cjs/casino-tournament-slider_2.cjs.entry.js +352 -0
  9. package/dist/cjs/index-e4a7f235.js +1279 -0
  10. package/dist/cjs/index.cjs.js +2 -0
  11. package/dist/cjs/loader.cjs.js +15 -0
  12. package/dist/collection/collection-manifest.json +19 -0
  13. package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.css +62 -0
  14. package/dist/collection/components/casino-tournament-slider/casino-tournament-slider.js +345 -0
  15. package/dist/collection/components/casino-tournament-slider/index.js +1 -0
  16. package/dist/collection/index.js +1 -0
  17. package/dist/collection/utils/locale.utils.js +39 -0
  18. package/dist/collection/utils/utils.js +3 -0
  19. package/dist/esm/app-globals-0f993ce5.js +3 -0
  20. package/dist/esm/casino-tournament-slider.js +20 -0
  21. package/dist/esm/casino-tournament-slider_2.entry.js +347 -0
  22. package/dist/esm/index-e38437e9.js +1252 -0
  23. package/dist/esm/index.js +1 -0
  24. package/dist/esm/loader.js +11 -0
  25. package/dist/index.cjs.js +1 -0
  26. package/dist/index.js +1 -0
  27. package/dist/stencil.config.dev.js +17 -0
  28. package/dist/stencil.config.js +17 -0
  29. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-tournament-slider/.stencil/packages/stencil/casino-tournament-slider/stencil.config.d.ts +2 -0
  30. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/casino-tournament-slider/.stencil/packages/stencil/casino-tournament-slider/stencil.config.dev.d.ts +2 -0
  31. package/dist/types/components/casino-tournament-slider/casino-tournament-slider.d.ts +30 -0
  32. package/dist/types/components/casino-tournament-slider/index.d.ts +1 -0
  33. package/dist/types/components.d.ts +61 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  36. package/dist/types/utils/locale.utils.d.ts +1 -0
  37. package/dist/types/utils/utils.d.ts +1 -0
  38. package/loader/cdn.js +1 -0
  39. package/loader/index.cjs.js +1 -0
  40. package/loader/index.d.ts +24 -0
  41. package/loader/index.es2017.js +1 -0
  42. package/loader/index.js +2 -0
  43. package/loader/package.json +11 -0
  44. package/package.json +29 -0
@@ -0,0 +1 @@
1
+ import{p as e,b as t}from"./p-c541e3cd.js";export{s as setNonce}from"./p-c541e3cd.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-01da553f",[[1,"casino-tournament-slider",{useEvent:[1,"use-event"],endpoint:[1],tournamentId:[1,"tournament-id"],session:[1],language:[1],gamesLimit:[2,"games-limit"],offset:[2],slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],showTitle:[4,"show-title"],limitStylingAppends:[32],games:[32],hover:[32],hoverIndex:[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],showArrow:[4,"show-arrow"],showButton:[4,"show-button"],autoSlide:[4,"auto-slide"],loopTime:[2,"loop-time"],autoItemHeight:[4,"auto-item-height"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],currentSlideNumber:[32],slidesCount:[32],limitStylingAppends:[32]}]]]],e))));
File without changes
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as e}from"./p-c541e3cd.js";const s={en:{playNow:"Play now",sliderTitle:"Participanting games"},"zh-hk":{playNow:"现在播放"},fr:{playNow:"Joue maintenant"},ro:{playNow:"Joaca acum"},hu:{playNow:"Játsszon most"},tr:{playNow:"Şimdi oyna"},el:{playNow:"Παίξε τώρα"},es:{playNow:"Jugar Ya"},pt:{playNow:"Jogue agora"},hr:{playNow:"IGRAJ SADA"}},h=(t,i)=>{var e,h;return(null===(e=s[i])||void 0===e?void 0:e[t])||(null===(h=s.en)||void 0===h?void 0:h[t])},o=class{constructor(i){t(this,i),this.enter=t=>{this.hover=!0,this.hoverIndex=t},this.leave=()=>{this.hover=!1,this.hoverIndex=-1},this.gameClicked=t=>{window.postMessage({type:"TournamentGameAction",gameId:t.id,name:t.name},window.location.href)},this.useEvent=void 0,this.endpoint=void 0,this.tournamentId=void 0,this.session=void 0,this.language=void 0,this.gamesLimit=30,this.offset=0,this.slideNumber=3,this.slideShow=3,this.clientStyling="",this.clientStylingUrl="",this.showTitle=!1,this.limitStylingAppends=!1,this.games=void 0,this.hover=void 0,this.hoverIndex=void 0}todoCompletedHandler(t){if(t.detail&&this.useEvent){if(!t.detail.games)return;this.games=t.detail.games.items}}getTournamentInfo(){let t=new URL(this.endpoint+`/v1/tournaments/${this.tournamentId}`),i=new Headers;t.searchParams.append("expand","games"),t.searchParams.append("language",this.language),t.searchParams.append("pagination",`games(limit=${this.gamesLimit},offset=${this.offset})`),t.searchParams.append("fields","games(id,name,thumbnail)"),this.session&&i.append("X-SessionId",this.session),fetch(t.href,{method:"GET",headers:i}).then((t=>t.json())).then((t=>{this.games=t.item.games.items}))}componentWillLoad(){!this.useEvent&&this.endpoint&&this.tournamentId&&this.getTournamentInfo()}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"f16db0fd04952457c6e637e34e3295de9f2ab00e",class:"TournamentSliderWrap"},i("div",{key:"246d6bae2b600ebc97e8cfbdf707ae284f0cef20",class:"TournamentSlider"},this.showTitle&&this.games&&i("div",{key:"d9760b0b053aa103a8bb1d24e860d83225aba17b",class:"SliderTitle"},i("svg",{key:"47e2a1441fa2eb68510eb9a775ff14e6b5221afd",xmlns:"http://www.w3.org/2000/svg",width:"21",height:"25",viewBox:"0 0 21 25",fill:"none"},i("path",{key:"566c04c19cbd24b79fba1c87f9872e28689178e3",d:"M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z",fill:"white"})),i("span",{key:"6a6e5fc1e888de1ace0b0c577cc96b98c55a65bd",class:"Title"},h("sliderTitle",this.language))),i("div",{key:"0d18223f0d9603ba8e94a87725bfc52592f5a120",class:"Items"},this.games&&i("general-slider",{key:"d56409e9730aeae803bb2a54951d9ba0912dbf51","slide-number":this.slideNumber,"slide-show":this.slideShow},this.games&&this.games.map(((t,e)=>i("li",{class:"Item",onMouseEnter:()=>this.enter(e),onMouseLeave:()=>this.leave()},i("span",{class:"PlayNowButton "+(this.hoverIndex==e?"ItemHover":""),onClick:()=>{this.gameClicked(t)}},h("playNow",this.language)),i("img",{class:"Img",src:t.thumbnail,alt:t.name,title:t.name}))))))))}get host(){return e(this)}};o.style=":host{display:block}.Item{color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.Item .Img{width:100%;height:100%}.PlayNowButton{position:absolute;background:var(--emfe-w-color-green, #48952a);display:block;box-sizing:border-box;padding:0.8rem 0.5rem;color:var(--emfe-w-color-white, #FFFFFF);text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity 0.4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ItemHover{opacity:1}.Items .Item:first-child{margin-left:0}.Items .Item:last-child{margin-right:0}.SliderTitle{display:flex;align-items:center;padding:6px 0;gap:11px}.Title{color:#fff;font-size:14px;font-weight:600}";const a=class{constructor(i){t(this,i),this.slides=null,this.slideWidth=0,this.currentPage=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null,this.slideNumber=3,this.slideShow=3,this.showArrow=!0,this.showButton=!1,this.autoSlide=!1,this.loopTime=1,this.autoItemHeight=!1,this.clientStyling="",this.clientStylingUrl="",this.currentSlideNumber=0,this.slidesCount=0,this.limitStylingAppends=!1}slide(t){let i=0;i=t?this.currentSlideNumber+this.slideNumber:this.currentSlideNumber-this.slideNumber,i<0||i>=this.slidesCount||(this.currentSlideNumber=i,this.currentPage=this.currentSlideNumber/this.slideNumber,this.updateListStyle())}slideTo(t){this.currentSlideNumber=t*this.slideNumber,this.currentPage=t,this.updateListStyle()}updateControls(){this.switchControl("Prev",0!==this.currentSlideNumber),this.switchControl("Next",this.currentSlideNumber!==this.slidesCount-this.slideShow)}switchControl(t,i){this.controls[t]&&(this.controls[t].disabled=!i)}componentWillLoad(){this.slideNumber||(this.slideNumber=1),this.slideShow||(this.slideShow=1)}componentDidLoad(){this.slides=this.slotEl.assignedElements(),this.slidesCount=this.slides.length;for(let t in this.controls)this.controls[t]=this.el.shadowRoot.querySelector(".Button"+t);this.autoSlide&&this.setSlideAutoInterval(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}componentDidRender(){this.slides&&(this.slideWidth=this.slides[0].offsetWidth),this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.updateListStyle(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}updateListStyle(){this.autoItemHeight&&null!==this.slides&&this.slides.forEach(((t,i)=>{i>=this.currentPage*this.slideNumber&&i<(this.currentPage+1)*this.slideNumber?t.classList.remove("hide"):t.classList.add("hide")}))}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove)}handleTouchStart(t){const i=this.getTouches(t)[0];this.xDown=i.clientX,this.yDown=i.clientY,clearInterval(this.sliderInterval)}getTouches(t){return t.touches||t.originalEvent.touches}handleTouchMove(t){if(!this.xDown||!this.yDown)return;let i=this.xDown-t.touches[0].clientX,e=this.yDown-t.touches[0].clientY;Math.abs(i)>Math.abs(e)&&this.slide(i>0),this.xDown=null,this.yDown=null,this.autoSlide&&this.setSlideAutoInterval()}setSlideAutoInterval(){0!=this.loopTime&&(clearInterval(this.sliderInterval),this.sliderInterval=setInterval((()=>{this.slideTo(this.currentPage+1<this.slidesCount/this.slideNumber?this.currentPage+1:0)}),1e3*Number(this.loopTime)))}componentDidUpdate(){this.sliderEl.style.transform=`translateX(${this.currentSlideNumber*this.slideWidth*-1}px)`,this.updateControls()}switchLoopStatus(t){this.autoSlide&&this.loopTime>0&&(t?clearInterval(this.sliderInterval):this.setSlideAutoInterval())}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"b8c30bef4c9ca004256c94cb642e8acb350afea4",class:"GeneralSlider"},i("div",{key:"27d6869ae4f675f5e14d17fae20718ec24391e1b",class:"Slider"},this.showArrow&&i("div",{key:"61acebc8e1a0ecf02ae6dad1ecc6f618424d05d5"},i("button",{key:"c593883f94b693d6dfe741b2b4ed08185db36ef2",type:"button",class:"Button ButtonNext",onClick:this.slide.bind(this,!0),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},">"),i("button",{key:"2bea5e3e9f36443e78bc25f0556dce2adb7111a0",type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")),i("ul",{key:"6643c865256f26b5d06ec78044a2b595832ecb5e",class:`SliderList Col-${this.slideShow}`,part:"SliderList",onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1),ref:t=>this.sliderEl=t},i("slot",{key:"48f1ad37b771f32ecc27f3065d58bc7ef1a8a021",ref:t=>this.slotEl=t}))),this.showButton&&this.slidesCount>0&&i("div",{key:"d125efa8c68a6e913664d01fb395ed6cada71f5b",class:"PageButtons",part:"PageButtons"},[...Array(this.slidesCount/this.slideNumber)].map(((t,e)=>i("div",{class:"PageButton "+(this.currentPage==e?"active":""),title:`page${e}`,onClick:this.slideTo.bind(this,e),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)}," ")))))}get el(){return e(this)}};a.style=":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{o as casino_tournament_slider,a as general_slider}
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),o=(e,n)=>t.set(n.t=e,n),l=(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={o:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),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})(),p=!1,m=[],y=[],w=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&f.o?b($):f.raf($))},v=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},$=()=>{v(m),v(y),(p=m.length>0)&&f.raf($)},b=e=>h().then(e),g=w(y,!0),S={},j=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>O,unwrap:()=>x,unwrapErr:()=>P});var O=e=>({isOk:!0,isErr:!1,value:e}),E=e=>({isOk:!1,isErr:!0,value:e});function C(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 E(e.value);throw"should never get here"}var M,x=e=>{if(e.isOk)return e.value;throw e.value},P=e=>{if(e.isErr)return e.value;throw e.value},D=(e,t,...n)=>{let o=null,l=null,s=!1,r=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof e&&!j(o))&&(o+=""),s&&r?i[i.length-1].i+=o:i.push(s?R(null,o):o),r=s)};if(c(n),t){t.key&&(l=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=R(e,null);return u.u=t,i.length>0&&(u.h=i),u.p=l,u},R=(e,t)=>({o:0,m:e,i:t,v:null,h:null,u:null,p:null}),A={},L=e=>n(e).$hostElement$,T=new WeakMap,U=e=>"sc-"+e.$,F=(e,t,n,o,s,r)=>{if(n!==o){let i=l(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,l=N(n),s=N(o);t.remove(...l.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!l.includes(e))))}else if("key"===t);else if("ref"===t)o&&o(e);else if(i||"o"!==t[0]||"n"!==t[1]){const l=j(o);if((i||l&&null!==o)&&!s)try{if(e.tagName.includes("-"))e[t]=o;else{const l=null==o?"":o;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==o||!1===o?!1===o&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&r||s)&&!l&&e.setAttribute(t,o=!0===o?"":o)}else if(t="-"===t[2]?t.slice(3):l(u,c)?c.slice(2):c[2]+t.slice(3),n||o){const l=t.endsWith(W);t=t.replace(q,""),n&&f.rel(e,t,n,l),o&&f.ael(e,t,o,l)}}},H=/\s/,N=e=>e?e.split(H):[],W="Capture",q=RegExp(W+"$"),G=(e,t,n)=>{const o=11===t.v.nodeType&&t.v.host?t.v.host:t.v,l=e&&e.u||S,s=t.u||S;for(const e of V(Object.keys(l)))e in s||F(o,e,l[e],void 0,n,t.o);for(const e of V(Object.keys(s)))F(o,e,l[e],s[e],n,t.o)};function V(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var _=!1,z=!1,B=(e,t,n)=>{const o=t.h[n];let l,s,r=0;if(null!==o.i)l=o.v=a.createTextNode(o.i);else{if(z||(z="svg"===o.m),l=o.v=a.createElementNS(z?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.m),z&&"foreignObject"===o.m&&(z=!1),G(null,o,z),l.getRootNode().querySelector("body"),o.h)for(r=0;r<o.h.length;++r)s=B(e,o,r),s&&l.appendChild(s);"svg"===o.m?z=!1:"foreignObject"===l.tagName&&(z=!0)}return l["s-hn"]=M,l},I=(e,t,n,o,l,s)=>{let r,i=e;for(i.shadowRoot&&i.tagName===M&&(i=i.shadowRoot);l<=s;++l)o[l]&&(r=B(null,n,l),r&&(o[l].v=r,Y(i,r,t)))},J=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.v;X(t),e&&e.remove()}}},K=(e,t,n=!1)=>e.m===t.m&&(!!n||e.p===t.p),Q=(e,t,n=!1)=>{const o=t.v=e.v,l=e.h,s=t.h,r=t.m,i=t.i;null===i?(z="svg"===r||"foreignObject"!==r&&z,("slot"!==r||_)&&G(e,t,z),null!==l&&null!==s?((e,t,n,o,l=!1)=>{let s,r,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],p=o.length-1,m=o[0],y=o[p];for(;i<=f&&c<=p;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==m)m=o[++c];else if(null==y)y=o[--p];else if(K(h,m,l))Q(h,m,l),h=t[++i],m=o[++c];else if(K(d,y,l))Q(d,y,l),d=t[--f],y=o[--p];else if(K(h,y,l))Q(h,y,l),Y(e,h.v,d.v.nextSibling),h=t[++i],y=o[--p];else if(K(d,m,l))Q(d,m,l),Y(e,d.v,h.v),d=t[--f],m=o[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===m.p){u=a;break}u>=0?(r=t[u],r.m!==m.m?s=B(t&&t[c],n,u):(Q(r,m,l),t[u]=void 0,s=r.v),m=o[++c]):(s=B(t&&t[c],n,c),m=o[++c]),s&&Y(h.v.parentNode,s,h.v)}i>f?I(e,null==o[p+1]?null:o[p+1].v,n,o,c,p):c>p&&J(t,i,f)})(o,l,t,s,n):null!==s?(null!==e.i&&(o.textContent=""),I(o,null,t,s,0,s.length-1)):!n&&null!==l&&J(l,0,l.length-1),z&&"svg"===r&&(z=!1)):e.i!==i&&(o.data=i)},X=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(X)},Y=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Z=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},ee=(e,t)=>{if(e.o|=16,!(4&e.o))return Z(e,e.j),g((()=>te(e,t)));e.o|=512},te=(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 o;return t&&(e.o|=256,e.k&&(e.k.map((([e,t])=>ce(n,e,t))),e.k=void 0),o=ce(n,"componentWillLoad")),ne(o,(()=>le(e,n,t)))},ne=(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,le=async(e,t,n)=>{var o;const l=e.$hostElement$,s=l["s-rc"];n&&(e=>{const t=e.O,n=e.$hostElement$,o=t.o,l=((e,t)=>{var n;const o=U(t),l=i.get(o);if(e=11===e.nodeType?e:a,l)if("string"==typeof l){let s,r=T.get(e=e.head||e);if(r||T.set(e,r=new Set),!r.has(o)){{s=a.createElement("style"),s.innerHTML=l;const o=null!=(n=f.C)?n:k(a);null!=o&&s.setAttribute("nonce",o),(!(1&t.o)||1&t.o&&"HEAD"!==e.nodeName)&&e.insertBefore(s,e.querySelector("link"))}4&t.o&&(s.innerHTML+=c),r&&r.add(o)}}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(e);se(e,t,l,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=null!=(o=l["s-p"])?o:[],n=()=>re(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}},se=(e,t,n,o)=>{try{t=t.render(),e.o&=-17,e.o|=2,((e,t,n=!1)=>{const o=e.$hostElement$,l=e.O,s=e.M||R(null,null),r=(e=>e&&e.m===A)(t)?t:D(null,null,t);if(M=o.tagName,n&&r.u)for(const e of Object.keys(r.u))o.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.u[e]=o[e]);r.m=null,r.o|=4,e.M=r,r.v=s.v=o.shadowRoot||o,_=!!(1&l.o),Q(s,r,n)})(e,t,o)}catch(t){s(t,e.$hostElement$)}return null},re=e=>{const t=e.$hostElement$,n=e.t,o=e.j;ce(n,"componentDidRender"),64&e.o?ce(n,"componentDidUpdate"):(e.o|=64,ue(t),ce(n,"componentDidLoad"),e.P(t),o||ie()),e.S&&(e.S(),e.S=void 0),512&e.o&&b((()=>ee(e,!1))),e.o&=-517},ie=()=>{ue(a.documentElement),b((()=>(e=>{const t=f.ce("appload",{detail:{namespace:"casino-tournament-slider"}});return e.dispatchEvent(t),t})(u)))},ce=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e)}},ue=e=>e.classList.add("hydrated"),ae=(e,t,o)=>{var l,s;const r=e.prototype;if(t.D){const i=Object.entries(null!=(l=t.D)?l:{});if(i.map((([e,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(r,e,{get(){return((e,t)=>n(this).R.get(t))(0,e)},set(o){((e,t,o,l)=>{const s=n(e);if(!s)throw Error(`Couldn't find host element for "${l.$}" 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 r=s.R.get(t),i=s.o,c=s.t;o=((e,t)=>null==e||j(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(o,l.D[t][0]),8&i&&void 0!==r||o===r||Number.isNaN(r)&&Number.isNaN(o)||(s.R.set(t,o),c&&2==(18&i)&&ee(s,!1))})(this,e,o,t)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;r.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var i;const c=o.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const o=n(this),r=null==o?void 0:o.o;if(r&&!(8&r)&&128&r&&s!==l){const n=o.t,r=null==(i=t.A)?void 0:i[e];null==r||r.forEach((t=>{null!=n[t]&&n[t].call(n,s,l,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=t.A)?s:{}),...i.filter((([e,t])=>15&t[0])).map((([e,t])=>{const n=t[1]||e;return o.set(n,e),n}))]))}}return e},fe=e=>{ce(e,"disconnectedCallback")},he=(e,o={})=>{var l;const h=[],p=o.exclude||[],m=u.customElements,y=a.head,w=y.querySelector("meta[charset]"),v=a.createElement("style"),$=[];let b,g=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let S=!1;if(e.map((e=>{e[1].map((o=>{const l={o:o[0],$:o[1],D:o[2],L:o[3]};4&l.o&&(S=!0),l.D=o[2],l.L=o[3];const c=l.$,u=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const o={o:0,$hostElement$:e,O:n,R:new Map};o.T=new Promise((e=>o.P=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,o)})(e=this,l),1&l.o)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.$}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){const e=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,de(this,e,l.L)),b&&(clearTimeout(b),b=null),g?$.push(this):f.jmp((()=>(e=>{if(!(1&f.o)){const t=n(e),o=t.O,l=()=>{};if(1&t.o)de(e,t,o.L),(null==t?void 0:t.t)||(null==t?void 0:t.T)&&t.T.then((()=>{}));else{t.o|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){Z(t,t.j=n);break}}o.D&&Object.entries(o.D).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let o;if(!(32&t.o)){if(t.o|=32,n.U){const e=(e=>{const t=e.$.replace(/-/g,"_"),n=e.U;if(!n)return;const o=r.get(n);return o?o[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=()=>{};o=await e,t()}else o=e;if(!o)throw Error(`Constructor for "${n.$}#${t.F}" was not found`);o.isProxied||(ae(o,n,2),o.isProxied=!0);const l=()=>{};t.o|=8;try{new o(t)}catch(e){s(e)}t.o&=-9,l()}else o=e.constructor,customElements.whenDefined(e.localName).then((()=>t.o|=128));if(o&&o.style){let e;"string"==typeof o.style&&(e=o.style);const t=U(n);if(!i.has(t)){const o=()=>{};((e,t,n)=>{let o=i.get(e);d&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,i.set(e,o)})(t,e,!!(1&n.o)),o()}}}const l=t.j,c=()=>ee(t,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(e,t,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const e=n(this);e.H&&(e.H.map((e=>e())),e.H=void 0),(null==e?void 0:e.t)?fe(e.t):(null==e?void 0:e.T)&&e.T.then((()=>fe(e.t)))}})()))}componentOnReady(){return n(this).T}};l.U=e[0],p.includes(c)||m.get(c)||(h.push(c),m.define(c,ae(u,l,1)))}))})),h.length>0&&(S&&(v.textContent+=c),v.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const e=null!=(l=f.C)?l:k(a);null!=e&&v.setAttribute("nonce",e),y.insertBefore(v,w?w.nextSibling:y.firstChild)}g=!1,$.length?$.map((e=>e.connectedCallback())):f.jmp((()=>b=setTimeout(ie,30)))},de=(e,t,n)=>{n&&n.map((([n,o,l])=>{const s=me(e,n),r=pe(t,l),i=ye(n);f.ael(s,o,r,i),(t.H=t.H||[]).push((()=>f.rel(s,o,r,i)))}))},pe=(e,t)=>n=>{var o;try{256&e.o?null==(o=e.t)||o[t](n):(e.k=e.k||[]).push([t,n])}catch(e){s(e)}},me=(e,t)=>8&t?u:e,ye=e=>({passive:!!(1&e),capture:!!(2&e)}),we=e=>f.C=e;export{he as b,L as g,D as h,h as p,o as r,we as s}
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e4a7f235.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('casino-tournament-slider.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["casino-tournament-slider_2.cjs",[[1,"casino-tournament-slider",{"useEvent":[1,"use-event"],"endpoint":[1],"tournamentId":[1,"tournament-id"],"session":[1],"language":[1],"gamesLimit":[2,"games-limit"],"offset":[2],"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"showTitle":[4,"show-title"],"limitStylingAppends":[32],"games":[32],"hover":[32],"hoverIndex":[32]},[[8,"getTournamentInfoCompleted","todoCompletedHandler"]]],[1,"general-slider",{"slideNumber":[2,"slide-number"],"slideShow":[2,"slide-show"],"showArrow":[4,"show-arrow"],"showButton":[4,"show-button"],"autoSlide":[4,"auto-slide"],"loopTime":[2,"loop-time"],"autoItemHeight":[4,"auto-item-height"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;
@@ -0,0 +1,352 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e4a7f235.js');
6
+
7
+ const DEFAULT_LANGUAGE = 'en';
8
+ const TRANSLATIONS = {
9
+ en: {
10
+ playNow: 'Play now',
11
+ sliderTitle: 'Participanting games'
12
+ },
13
+ 'zh-hk': {
14
+ playNow: '现在播放',
15
+ },
16
+ fr: {
17
+ playNow: 'Joue maintenant',
18
+ },
19
+ ro: {
20
+ playNow: 'Joaca acum',
21
+ },
22
+ hu: {
23
+ playNow: 'Játsszon most',
24
+ },
25
+ tr: {
26
+ playNow: 'Şimdi oyna',
27
+ },
28
+ el: {
29
+ playNow: 'Παίξε τώρα',
30
+ },
31
+ es: {
32
+ playNow: 'Jugar Ya',
33
+ },
34
+ pt: {
35
+ playNow: 'Jogue agora',
36
+ },
37
+ hr: {
38
+ playNow: 'IGRAJ SADA',
39
+ }
40
+ };
41
+ const translate = (key, customLang) => {
42
+ var _a, _b;
43
+ const lang = customLang;
44
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
45
+ };
46
+
47
+ const casinoTournamentSliderCss = ":host{display:block}.Item{color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.Item .Img{width:100%;height:100%}.PlayNowButton{position:absolute;background:var(--emfe-w-color-green, #48952a);display:block;box-sizing:border-box;padding:0.8rem 0.5rem;color:var(--emfe-w-color-white, #FFFFFF);text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity 0.4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ItemHover{opacity:1}.Items .Item:first-child{margin-left:0}.Items .Item:last-child{margin-right:0}.SliderTitle{display:flex;align-items:center;padding:6px 0;gap:11px}.Title{color:#fff;font-size:14px;font-weight:600}";
48
+ const CasinoTournamentSliderStyle0 = casinoTournamentSliderCss;
49
+
50
+ const CasinoTournamentSlider = class {
51
+ constructor(hostRef) {
52
+ index.registerInstance(this, hostRef);
53
+ this.enter = (index) => {
54
+ this.hover = true;
55
+ this.hoverIndex = index;
56
+ };
57
+ this.leave = () => {
58
+ this.hover = false;
59
+ this.hoverIndex = -1;
60
+ };
61
+ this.gameClicked = (item) => {
62
+ window.postMessage({ type: 'TournamentGameAction', gameId: item.id, name: item.name }, window.location.href);
63
+ };
64
+ this.useEvent = undefined;
65
+ this.endpoint = undefined;
66
+ this.tournamentId = undefined;
67
+ this.session = undefined;
68
+ this.language = undefined;
69
+ this.gamesLimit = 30;
70
+ this.offset = 0;
71
+ this.slideNumber = 3;
72
+ this.slideShow = 3;
73
+ this.clientStyling = '';
74
+ this.clientStylingUrl = '';
75
+ this.showTitle = false;
76
+ this.limitStylingAppends = false;
77
+ this.games = undefined;
78
+ this.hover = undefined;
79
+ this.hoverIndex = undefined;
80
+ }
81
+ todoCompletedHandler(event) {
82
+ if (event.detail && this.useEvent) {
83
+ if (!event.detail.games)
84
+ return;
85
+ this.games = event.detail.games.items;
86
+ }
87
+ }
88
+ getTournamentInfo() {
89
+ let url = new URL(this.endpoint + `/v1/tournaments/${this.tournamentId}`);
90
+ let reqHeaders = new Headers();
91
+ url.searchParams.append('expand', 'games');
92
+ url.searchParams.append('language', this.language);
93
+ url.searchParams.append('pagination', `games(limit=${this.gamesLimit},offset=${this.offset})`);
94
+ url.searchParams.append('fields', 'games(id,name,thumbnail)');
95
+ if (this.session) {
96
+ reqHeaders.append('X-SessionId', this.session);
97
+ }
98
+ let requestOptions = {
99
+ method: 'GET',
100
+ headers: reqHeaders,
101
+ };
102
+ fetch(url.href, requestOptions).then((res) => res.json())
103
+ .then((res) => {
104
+ this.games = res.item.games.items;
105
+ });
106
+ }
107
+ componentWillLoad() {
108
+ if (!this.useEvent && this.endpoint && this.tournamentId) {
109
+ this.getTournamentInfo();
110
+ }
111
+ }
112
+ componentDidRender() {
113
+ if (!this.limitStylingAppends && this.host) {
114
+ if (this.clientStyling)
115
+ this.setClientStyling();
116
+ if (this.clientStylingUrl)
117
+ this.setClientStylingURL();
118
+ this.limitStylingAppends = true;
119
+ }
120
+ }
121
+ setClientStyling() {
122
+ const sheet = new CSSStyleSheet();
123
+ // @ts-ignore
124
+ sheet.replace(this.clientStyling);
125
+ // @ts-ignore
126
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
127
+ }
128
+ setClientStylingURL() {
129
+ let url = new URL(this.clientStylingUrl);
130
+ fetch(url.href)
131
+ .then((res) => res.text())
132
+ .then((data) => {
133
+ const sheet = new CSSStyleSheet();
134
+ // @ts-ignore
135
+ sheet.replace(data);
136
+ // @ts-ignore
137
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
138
+ });
139
+ }
140
+ render() {
141
+ return index.h("div", { key: 'f16db0fd04952457c6e637e34e3295de9f2ab00e', class: "TournamentSliderWrap" }, index.h("div", { key: '246d6bae2b600ebc97e8cfbdf707ae284f0cef20', class: "TournamentSlider" }, this.showTitle && this.games &&
142
+ index.h("div", { key: 'd9760b0b053aa103a8bb1d24e860d83225aba17b', class: "SliderTitle" }, index.h("svg", { key: '47e2a1441fa2eb68510eb9a775ff14e6b5221afd', xmlns: "http://www.w3.org/2000/svg", width: "21", height: "25", viewBox: "0 0 21 25", fill: "none" }, index.h("path", { key: '566c04c19cbd24b79fba1c87f9872e28689178e3', d: "M6.1774 22.1728C6.36493 22.2725 6.56274 22.0566 6.44793 21.8779C5.82475 20.908 5.23463 19.2759 6.17483 17.174C7.74273 13.6689 8.6968 11.8535 8.6968 11.8535C8.6968 11.8535 9.20426 13.9721 10.5799 15.8558C11.9038 17.6687 12.6285 19.9488 11.4602 21.8482C11.3506 22.0265 11.5439 22.2368 11.7302 22.1415C13.1763 21.4017 14.7983 19.9179 14.9813 16.965C15.0488 16.0627 14.9476 14.7995 14.4416 13.2054C13.791 11.185 12.9911 10.2423 12.5283 9.83741C12.3899 9.71629 12.1746 9.82363 12.1859 10.0072C12.3208 12.1872 11.5007 12.7404 11.0339 11.4937C10.8474 10.9957 10.7387 10.1344 10.7387 9.08558C10.7387 7.3394 10.2321 5.54188 9.1152 4.0812C8.82475 3.70134 8.4849 3.3464 8.09498 3.04372C7.95382 2.93411 7.74919 3.04428 7.76212 3.22252C7.84788 4.40628 7.77018 7.79884 4.79383 11.8519C2.09515 15.6115 3.14088 18.4989 3.51195 19.281C4.2214 20.7791 5.21098 21.6589 6.1774 22.1728Z", fill: "white" })), index.h("span", { key: '6a6e5fc1e888de1ace0b0c577cc96b98c55a65bd', class: "Title" }, translate('sliderTitle', this.language))), index.h("div", { key: '0d18223f0d9603ba8e94a87725bfc52592f5a120', class: "Items" }, this.games &&
143
+ index.h("general-slider", { key: 'd56409e9730aeae803bb2a54951d9ba0912dbf51', "slide-number": this.slideNumber, "slide-show": this.slideShow }, this.games && this.games.map((game, i) => {
144
+ return index.h("li", { class: "Item", onMouseEnter: () => this.enter(i), onMouseLeave: () => this.leave() }, index.h("span", { class: `PlayNowButton ${this.hoverIndex == i ? 'ItemHover' : ''}`, onClick: () => { this.gameClicked(game); } }, translate('playNow', this.language)), index.h("img", { class: "Img", src: game.thumbnail, alt: game.name, title: game.name }));
145
+ })))));
146
+ }
147
+ get host() { return index.getElement(this); }
148
+ };
149
+ CasinoTournamentSlider.style = CasinoTournamentSliderStyle0;
150
+
151
+ const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
152
+ const GeneralSliderStyle0 = generalSliderCss;
153
+
154
+ const GeneralSlider = class {
155
+ constructor(hostRef) {
156
+ index.registerInstance(this, hostRef);
157
+ this.slides = null;
158
+ this.slideWidth = 0;
159
+ this.currentPage = 0;
160
+ this.controls = {
161
+ Prev: null,
162
+ Next: null
163
+ };
164
+ this.xDown = null;
165
+ this.yDown = null;
166
+ this.slideNumber = 3;
167
+ this.slideShow = 3;
168
+ this.showArrow = true;
169
+ this.showButton = false;
170
+ this.autoSlide = false;
171
+ this.loopTime = 1;
172
+ this.autoItemHeight = false;
173
+ this.clientStyling = '';
174
+ this.clientStylingUrl = '';
175
+ this.currentSlideNumber = 0;
176
+ this.slidesCount = 0;
177
+ this.limitStylingAppends = false;
178
+ }
179
+ slide(next) {
180
+ let slideTo = 0;
181
+ if (next) {
182
+ slideTo = this.currentSlideNumber + this.slideNumber;
183
+ }
184
+ else {
185
+ slideTo = this.currentSlideNumber - this.slideNumber;
186
+ }
187
+ if (slideTo < 0 || slideTo >= this.slidesCount)
188
+ return;
189
+ this.currentSlideNumber = slideTo;
190
+ this.currentPage = this.currentSlideNumber / this.slideNumber;
191
+ this.updateListStyle();
192
+ }
193
+ slideTo(page) {
194
+ this.currentSlideNumber = page * this.slideNumber;
195
+ this.currentPage = page;
196
+ this.updateListStyle();
197
+ }
198
+ updateControls() {
199
+ this.switchControl('Prev', (this.currentSlideNumber === 0) ? false : true);
200
+ this.switchControl('Next', (this.currentSlideNumber === this.slidesCount - this.slideShow) ? false : true);
201
+ }
202
+ switchControl(type, enabled) {
203
+ if (this.controls[type]) {
204
+ this.controls[type].disabled = !enabled;
205
+ }
206
+ }
207
+ componentWillLoad() {
208
+ if (!this.slideNumber)
209
+ this.slideNumber = 1;
210
+ if (!this.slideShow)
211
+ this.slideShow = 1;
212
+ }
213
+ componentDidLoad() {
214
+ this.slides = this.slotEl.assignedElements();
215
+ this.slidesCount = this.slides.length;
216
+ for (let type in this.controls) {
217
+ this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
218
+ }
219
+ if (this.autoSlide) {
220
+ this.setSlideAutoInterval();
221
+ }
222
+ if (!this.limitStylingAppends && this.el.shadowRoot) {
223
+ if (this.clientStyling)
224
+ this.setClientStyling();
225
+ if (this.clientStylingUrl)
226
+ this.setClientStylingURL();
227
+ this.limitStylingAppends = true;
228
+ }
229
+ }
230
+ componentDidRender() {
231
+ if (this.slides)
232
+ this.slideWidth = this.slides[0].offsetWidth;
233
+ this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
234
+ this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
235
+ this.updateListStyle();
236
+ if (!this.limitStylingAppends && this.el.shadowRoot) {
237
+ if (this.clientStyling)
238
+ this.setClientStyling();
239
+ if (this.clientStylingUrl)
240
+ this.setClientStylingURL();
241
+ this.limitStylingAppends = true;
242
+ }
243
+ }
244
+ updateListStyle() {
245
+ if (!this.autoItemHeight)
246
+ return;
247
+ if (this.slides === null)
248
+ return;
249
+ this.slides.forEach((li, index) => {
250
+ if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
251
+ li.classList.remove('hide');
252
+ }
253
+ else {
254
+ li.classList.add('hide');
255
+ }
256
+ });
257
+ }
258
+ disconnectedCallback() {
259
+ this.el.removeEventListener('touchstart', this.handleTouchStart);
260
+ this.el.removeEventListener('touchmove', this.handleTouchMove);
261
+ }
262
+ handleTouchStart(evt) {
263
+ const firstTouch = this.getTouches(evt)[0];
264
+ this.xDown = firstTouch.clientX;
265
+ this.yDown = firstTouch.clientY;
266
+ clearInterval(this.sliderInterval);
267
+ }
268
+ getTouches(evt) {
269
+ return evt.touches || evt.originalEvent.touches;
270
+ }
271
+ handleTouchMove(evt) {
272
+ if (!this.xDown || !this.yDown)
273
+ return;
274
+ let xUp = evt.touches[0].clientX;
275
+ let yUp = evt.touches[0].clientY;
276
+ let xDiff = this.xDown - xUp;
277
+ let yDiff = this.yDown - yUp;
278
+ if (Math.abs(xDiff) > Math.abs(yDiff)) {
279
+ if (xDiff > 0) {
280
+ this.slide(true);
281
+ }
282
+ else {
283
+ this.slide(false);
284
+ }
285
+ }
286
+ this.xDown = null;
287
+ this.yDown = null;
288
+ if (this.autoSlide) {
289
+ this.setSlideAutoInterval();
290
+ }
291
+ }
292
+ ;
293
+ setSlideAutoInterval() {
294
+ if (this.loopTime == 0) {
295
+ return;
296
+ }
297
+ clearInterval(this.sliderInterval);
298
+ this.sliderInterval = setInterval(() => {
299
+ if (this.currentPage + 1 < this.slidesCount / this.slideNumber) {
300
+ this.slideTo(this.currentPage + 1);
301
+ }
302
+ else {
303
+ this.slideTo(0);
304
+ }
305
+ }, Number(this.loopTime) * 1000);
306
+ }
307
+ componentDidUpdate() {
308
+ this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
309
+ this.updateControls();
310
+ }
311
+ switchLoopStatus(isMouseMoveEnter) {
312
+ if (!this.autoSlide)
313
+ return;
314
+ if (this.loopTime > 0) {
315
+ if (isMouseMoveEnter) {
316
+ clearInterval(this.sliderInterval);
317
+ }
318
+ else {
319
+ this.setSlideAutoInterval();
320
+ }
321
+ }
322
+ }
323
+ setClientStyling() {
324
+ const sheet = new CSSStyleSheet();
325
+ // @ts-ignore
326
+ sheet.replace(this.clientStyling);
327
+ // @ts-ignore
328
+ this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
329
+ }
330
+ setClientStylingURL() {
331
+ let url = new URL(this.clientStylingUrl);
332
+ fetch(url.href)
333
+ .then((res) => res.text())
334
+ .then((data) => {
335
+ const sheet = new CSSStyleSheet();
336
+ // @ts-ignore
337
+ sheet.replace(data);
338
+ // @ts-ignore
339
+ this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
340
+ });
341
+ }
342
+ render() {
343
+ return (index.h("div", { key: 'b8c30bef4c9ca004256c94cb642e8acb350afea4', class: "GeneralSlider" }, index.h("div", { key: '27d6869ae4f675f5e14d17fae20718ec24391e1b', class: "Slider" }, this.showArrow &&
344
+ index.h("div", { key: '61acebc8e1a0ecf02ae6dad1ecc6f618424d05d5' }, index.h("button", { key: 'c593883f94b693d6dfe741b2b4ed08185db36ef2', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), index.h("button", { key: '2bea5e3e9f36443e78bc25f0556dce2adb7111a0', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), index.h("ul", { key: '6643c865256f26b5d06ec78044a2b595832ecb5e', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el }, index.h("slot", { key: '48f1ad37b771f32ecc27f3065d58bc7ef1a8a021', ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
345
+ index.h("div", { key: 'd125efa8c68a6e913664d01fb395ed6cada71f5b', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => index.h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0")))));
346
+ }
347
+ get el() { return index.getElement(this); }
348
+ };
349
+ GeneralSlider.style = GeneralSliderStyle0;
350
+
351
+ exports.casino_tournament_slider = CasinoTournamentSlider;
352
+ exports.general_slider = GeneralSlider;