@everymatrix/casino-tournament-duration 1.27.10 → 1.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{p as t,b as n}from"./p-efeaf265.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((t=>n([["p-45164f4e",[[1,"casino-tournament-duration",{startTime:[1,"start-time"],endTime:[1,"end-time"],status:[1],language:[1],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],tournamentUntilStartDays:[32],tournamentLeftDays:[32],showRemain:[32],limitStylingAppends:[32],stylingContainer:[32],durationInterval:[32]}]]]],t)));
1
+ import{p as t,b as n}from"./p-d2646fd8.js";(()=>{const n=import.meta.url,i={};return""!==n&&(i.resourcesUrl=new URL(".",n).href),t(i)})().then((t=>n([["p-3db0fdf5",[[1,"casino-tournament-duration",{startTime:[1,"start-time"],endTime:[1,"end-time"],status:[1],language:[1],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],tournamentUntilStartDays:[32],tournamentLeftDays:[32],showRemain:[32],limitStylingAppends:[32],durationInterval:[32]}]]]],t)));
@@ -0,0 +1 @@
1
+ import{r as t,h as s,g as i}from"./p-d2646fd8.js";const e=["ro","en","hr","zh-hk","fr","hu","tr","el","es","pt"],r={en:{finished:"Finished",starting:"Starting in ",left:"left",minutes:"minutes",hours:"hours",days:"days"},hr:{finished:"Gotovo",starting:"Počinje u ",left:"lijevo",minutes:"minute",hours:"sati",days:"dani"},"zh-hk":{finished:"完成的",starting:"開始於",left:"剩下",minutes:"分鐘",hours:"小時",days:"天"},fr:{finished:"Fini",starting:"Début dans ",left:"restant",minutes:"minutes",hours:"heures",days:"jours"},ro:{finished:"Finalizat",starting:"Începe în",left:"rămase",minutes:"minute",hours:"ore",days:"zile"},tr:{finished:"Sona ermiş",starting:"Başlamasına ",left:"kaldı",minutes:"dakika",hours:"saat",days:"gün"},el:{finished:"Ολοκληρωμένα",starting:"Αρχίζει σε ",left:"απομένουν",minutes:"λεπτά",hours:"ώρες",days:"ημέρες"},es:{finished:"Finalizado",starting:"Iniciando en ",left:"izquierda",minutes:"minutos",hours:"horas",days:"días"},hu:{finished:"Befejezve",starting:"Kezdésig",left:"bal",minutes:"perc",hours:"óra",days:"nap"},pt:{finished:"Finalizado",starting:"Começando em",left:"Abandonou",minutes:"Minutos",hours:"Horas",days:"Dias"}},n=(t,s)=>{const i=s;return r[void 0!==i&&e.includes(i)?i:"en"][t]},a=class{constructor(s){t(this,s),this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1}getDateTimeDiff(t,s){return(new Date(s).getTime()-new Date(t).getTime())/6e4}getDuration(){const t=new Date;this.tournamentLeftDays=this.getDateTimeDiff(t,this.endTime),this.tournamentUntilStartDays=this.getDateTimeDiff(t,this.startTime),this.showRemain=this.getTextByDiff(this.tournamentLeftDays)}formatDate(t){let s=new Date(t),i=new Intl.DateTimeFormat(this.language,{month:"long"}).format(s);return`${s.getDate()} ${i}, ${s.toLocaleString("en-GB",{hour:"numeric",minute:"numeric"})}, ${s.getUTCFullYear()}`}getTextByDiff(t){if(t<1440){const s=t%60;return[t/60,s,60*(s-Math.floor(s))].map((t=>(t=>{const s=Math.floor(t);return s<10?`0${s}`:`${s}`})(t))).join(":")}return Math.ceil(t/1440)+" "+n("days")}getProgress(){if(this.tournamentLeftDays<=0)return 100;const t=this.getDateTimeDiff(this.startTime,this.endTime);return Math.floor(100/t*(t-this.tournamentLeftDays))}componentWillLoad(){this.startTime&&this.endTime&&(this.getDuration(),this.getTextByDiff(this.tournamentLeftDays)),this.tournamentLeftDays<1440&&this.tournamentLeftDays>0?this.durationInterval=window.setInterval((()=>{this.startTime&&this.endTime&&this.getDuration()}),1e3):clearInterval(this.durationInterval)}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 s=new CSSStyleSheet;s.replace(t),this.host.shadowRoot.adoptedStyleSheets=[...this.host.shadowRoot.adoptedStyleSheets,s]}))}render(){if(this.startTime&&this.endTime)return s("div",{class:"TournamentDurationWrap"},s("div",{class:"TournamentDuration"},s("div",{class:"TournamentDates"},s("div",{class:"StartDate",part:"StartDate"},this.formatDate(this.startTime)),s("div",{class:"EndDate",part:"EndDate"},this.formatDate(this.endTime))),s("div",{class:"ProgressBarWrapper"},s("div",{class:"ProgressBar",part:"ProgressBar"},"Finished"==this.status||"Closing"==this.status||"Closed"==this.status?s("div",null,s("div",{class:"ProgressBarFillEnd",part:"ProgressBarFillEnd"}),s("div",{class:"Finished",part:"Finished"},n("finished",this.language))):this.tournamentUntilStartDays>0?s("div",null,s("div",{class:"ProgressBarFillStarting",part:"ProgressBarFillStarting"}),s("div",{class:"Remaining",part:"Remaining"},n("starting",this.language)," ",this.getTextByDiff(this.tournamentUntilStartDays))):s("div",null,s("div",{class:"ProgressBarFill",part:"ProgressBarFill",style:{width:`${this.getProgress()}%`}}),this.tournamentLeftDays>0&&s("div",{class:"Remaining",part:"Remaining"},this.showRemain," ",n("left",this.language)))))))}get host(){return i(this)}};a.style=":host{display:block}.TournamentDates{display:flex;justify-content:space-between}.StartDate{font-size:10px;font-weight:700;color:var(--emfe-w-color-gray-300, #58586B)}.EndDate{font-size:10px;font-weight:700;align-content:flex-end;color:var(--emfe-w-color-gray-300, #58586B)}.ProgressBar{margin:5px 0;height:8px;background:var(--emfe-w-color-white, #FFFFFF)}.ProgressBarInactive{margin:5px 20px 10px 20px;height:8px;background:var(--emfe-w-color-gray-100, #E6E6E6)}.ProgressBarFill{background-color:var(--emfe-w-color-green, #48952a);height:8px}.ProgressBarFillEnd{background-color:var(--emfe-w-color-green, #48952a);height:8px}.ProgressBarFillStarting{background-color:var(--emfe-w-color-gray-300, #58586B);height:8px}.Remaining,.Finished{font-size:10px;font-weight:700;padding-top:6px;text-align:right;text-transform:uppercase}.Finished{color:var(--emfe-w-color-green, #48952a)}";export{a as casino_tournament_duration}
@@ -0,0 +1 @@
1
+ let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",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)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?d(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=d(e,null);return c.u=t,r.length>0&&(c.$=r),c},d=(e,t)=>({t:0,h:e,i:t,m:null,$:null,u:null}),h={},y=(e,t,n,l,s,o)=>{if(n!==l){let r=H(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,s=p(n),o=p(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else{const i=f(l);if((r||i&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&o||s)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,r=t.u||a;for(l in o)l in r||y(s,l,o[l],void 0,n,t.t);for(l in r)y(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,i=n.$[l],c=0;if(null!==i.i)o=i.m=s.createTextNode(i.i);else if(o=i.m=s.createElement(i.h),b(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.$)for(c=0;c<i.$.length;++c)r=w(t,i,c),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=w(null,l,o),i&&(s[o].m=i,c.insertBefore(i,n)))},g=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.m.remove()},j=(e,t)=>e.h===t.h,M=(e,t)=>{const n=t.m=e.m,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],$=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==$?$=l[--a]:j(c,f)?(M(c,f),c=t[++o],f=l[++r]):j(u,$)?(M(u,$),u=t[--i],$=l[--a]):j(c,$)?(M(c,$),e.insertBefore(c.m,u.m.nextSibling),c=t[++o],$=l[--a]):j(u,f)?(M(u,f),e.insertBefore(u.m,c.m),u=t[--i],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&c.m.parentNode.insertBefore(s,c.m));o>i?S(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&g(t,o,i)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},v=e=>q(e).p,k=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.g),Y((()=>O(e,t)));e.t|=512},O=(e,t)=>{const n=e.j;let l;return t&&(l=N(n,"componentWillLoad")),R(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.p,l=t.t,o=((e,t)=>{let n=u(t),l=B.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=c.get(e=e.head||e);o||c.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);x(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.p,o=n.v||d(null,null),r=(e=>e&&e.h===h)(l)?l:$(null,null,l);t=s.tagName,r.h=null,r.t|=4,n.v=r,r.m=o.m=s.shadowRoot||s,e=s["s-sc"],M(o,r)})(n,l)}catch(e){V(e,n.p)}return null},E=e=>{const t=e.p,n=e.g;N(e.j,"componentDidRender"),64&e.t||(e.t|=64,T(t),e.k(t),n||L()),e.S&&(e.S(),e.S=void 0),512&e.t&&X((()=>C(e,!1))),e.t&=-517},L=()=>{T(s.documentElement),X((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"casino-tournament-duration"}});return e.dispatchEvent(t),t})(l)))},N=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){V(e)}},R=(e,t)=>e&&e.then?e.then(t):t(),T=e=>e.classList.add("hydrated"),W=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>q(this).O.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=q(e),o=s.O.get(t),r=s.t,i=s.j;n=((e,t)=>null==e||f(e)?e:1&t?e+"":e)(n,l.C[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.O.set(t,n),i&&2==(18&r)&&C(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},A=(e,t={})=>{const n=[],r=t.exclude||[],c=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),d=[];let h,y=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],C:t[2],P:t[3]};l.C=t[2];const s=l.o,a=class extends HTMLElement{constructor(e){super(e),F(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),y?d.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=q(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=z(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(W(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){V(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=u(n);if(!B.has(t)){const l=()=>{};((e,t,n)=>{let l=B.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,B.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>C(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return q(this).L}};l.N=e[0],r.includes(s)||c.get(s)||(n.push(s),c.define(s,W(a,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),y=!1,d.length?d.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(L,30)))},U=new WeakMap,q=e=>U.get(e),D=(e,t)=>U.set(t.j=e,t),F=(e,t)=>{const n={t:0,p:e,M:t,O:new Map};return n.L=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],U.set(e,n)},H=(e,t)=>t in e,V=(e,t)=>(0,console.error)(e,t),_=new Map,z=e=>{const t=e.o.replace(/-/g,"_"),n=e.N,l=_.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(_.set(n,e),e[t])),V)},B=new Map,G=[],I=[],J=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?X(Q):o.raf(Q))},K=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){V(e)}e.length=0},Q=()=>{K(G),K(I),(n=G.length>0)&&o.raf(Q)},X=e=>r().then(e),Y=J(I,!0);export{A as b,v as g,$ as h,r as p,D as r}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8e0377fe.js');
5
+ const index = require('./index-6c229e88.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
@@ -168,7 +168,7 @@ const CasinoTournamentDuration = class {
168
168
  }
169
169
  }
170
170
  componentDidRender() {
171
- if (!this.limitStylingAppends && this.stylingContainer) {
171
+ if (!this.limitStylingAppends && this.host) {
172
172
  if (this.clientStyling)
173
173
  this.setClientStyling();
174
174
  if (this.clientStylingUrl)
@@ -177,20 +177,27 @@ const CasinoTournamentDuration = class {
177
177
  }
178
178
  }
179
179
  setClientStyling() {
180
- let sheet = document.createElement('style');
181
- sheet.innerHTML = this.clientStyling;
182
- this.stylingContainer.prepend(sheet);
180
+ const sheet = new CSSStyleSheet();
181
+ // @ts-ignore
182
+ sheet.replace(this.clientStyling);
183
+ // @ts-ignore
184
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
183
185
  }
184
186
  setClientStylingURL() {
185
- let cssFile = document.createElement('style');
186
- setTimeout(() => {
187
- cssFile.innerHTML = this.clientStylingUrl;
188
- this.stylingContainer.prepend(cssFile);
189
- }, 1);
187
+ let url = new URL(this.clientStylingUrl);
188
+ fetch(url.href)
189
+ .then((res) => res.text())
190
+ .then((data) => {
191
+ const sheet = new CSSStyleSheet();
192
+ // @ts-ignore
193
+ sheet.replace(data);
194
+ // @ts-ignore
195
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
196
+ });
190
197
  }
191
198
  render() {
192
199
  if (this.startTime && this.endTime) {
193
- return index.h("div", { ref: el => this.stylingContainer = el }, index.h("div", { class: "TournamentDuration" }, index.h("div", { class: "TournamentDates" }, index.h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), index.h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), index.h("div", { class: "ProgressBarWrapper" }, index.h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
200
+ return index.h("div", { class: "TournamentDurationWrap" }, index.h("div", { class: "TournamentDuration" }, index.h("div", { class: "TournamentDates" }, index.h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), index.h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), index.h("div", { class: "ProgressBarWrapper" }, index.h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
194
201
  index.h("div", null, index.h("div", { class: "ProgressBarFillEnd", part: "ProgressBarFillEnd" }), index.h("div", { class: "Finished", part: "Finished" }, translate('finished', this.language))) :
195
202
  this.tournamentUntilStartDays > 0 ?
196
203
  index.h("div", null, index.h("div", { class: "ProgressBarFillStarting", part: "ProgressBarFillStarting" }), index.h("div", { class: "Remaining", part: "Remaining" }, translate('starting', this.language), " ", this.getTextByDiff(this.tournamentUntilStartDays))) :
@@ -198,6 +205,7 @@ const CasinoTournamentDuration = class {
198
205
  index.h("div", { class: "Remaining", part: "Remaining" }, this.showRemain, " ", translate('left', this.language)))))));
199
206
  }
200
207
  }
208
+ get host() { return index.getElement(this); }
201
209
  };
202
210
  CasinoTournamentDuration.style = casinoTournamentDurationCss;
203
211
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-8e0377fe.js');
3
+ const index = require('./index-6c229e88.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["casino-tournament-duration.cjs",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"stylingContainer":[32],"durationInterval":[32]}]]]], options);
18
+ return index.bootstrapLazy([["casino-tournament-duration.cjs",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"durationInterval":[32]}]]]], options);
19
19
  });
@@ -259,12 +259,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
259
259
  }
260
260
  }
261
261
  }
262
- else if (memberName === 'ref') {
263
- // minifier will clean this up
264
- if (newValue) {
265
- newValue(elm);
266
- }
267
- }
268
262
  else {
269
263
  // Set property if it exists and it's not a SVG
270
264
  const isComplex = isComplexType(newValue);
@@ -382,7 +376,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
382
376
  for (; startIdx <= endIdx; ++startIdx) {
383
377
  if ((vnode = vnodes[startIdx])) {
384
378
  elm = vnode.$elm$;
385
- callNodeRefs(vnode);
386
379
  // remove the vnode's element from the dom
387
380
  elm.remove();
388
381
  }
@@ -501,12 +494,6 @@ const patch = (oldVNode, newVNode) => {
501
494
  elm.data = text;
502
495
  }
503
496
  };
504
- const callNodeRefs = (vNode) => {
505
- {
506
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
507
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
508
- }
509
- };
510
497
  const renderVdom = (hostRef, renderFnResults) => {
511
498
  const hostElm = hostRef.$hostElement$;
512
499
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -522,6 +509,7 @@ const renderVdom = (hostRef, renderFnResults) => {
522
509
  // synchronous patch
523
510
  patch(oldVNode, rootVnode);
524
511
  };
512
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
525
513
  /**
526
514
  * Helper function to create & dispatch a custom Event on a provided target
527
515
  * @param elm the target of the Event
@@ -1133,6 +1121,7 @@ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1133
1121
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1134
1122
 
1135
1123
  exports.bootstrapLazy = bootstrapLazy;
1124
+ exports.getElement = getElement;
1136
1125
  exports.h = h;
1137
1126
  exports.promiseResolve = promiseResolve;
1138
1127
  exports.registerInstance = registerInstance;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-8e0377fe.js');
5
+ const index = require('./index-6c229e88.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["casino-tournament-duration.cjs",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"stylingContainer":[32],"durationInterval":[32]}]]]], options);
17
+ return index.bootstrapLazy([["casino-tournament-duration.cjs",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"durationInterval":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -1,4 +1,4 @@
1
- import { Component, Prop, h, State } from '@stencil/core';
1
+ import { Component, Prop, h, State, Element } from '@stencil/core';
2
2
  import { translate } from '../../utils/locale.utils';
3
3
  export class CasinoTournamentDuration {
4
4
  constructor() {
@@ -72,7 +72,7 @@ export class CasinoTournamentDuration {
72
72
  }
73
73
  }
74
74
  componentDidRender() {
75
- if (!this.limitStylingAppends && this.stylingContainer) {
75
+ if (!this.limitStylingAppends && this.host) {
76
76
  if (this.clientStyling)
77
77
  this.setClientStyling();
78
78
  if (this.clientStylingUrl)
@@ -81,20 +81,27 @@ export class CasinoTournamentDuration {
81
81
  }
82
82
  }
83
83
  setClientStyling() {
84
- let sheet = document.createElement('style');
85
- sheet.innerHTML = this.clientStyling;
86
- this.stylingContainer.prepend(sheet);
84
+ const sheet = new CSSStyleSheet();
85
+ // @ts-ignore
86
+ sheet.replace(this.clientStyling);
87
+ // @ts-ignore
88
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
87
89
  }
88
90
  setClientStylingURL() {
89
- let cssFile = document.createElement('style');
90
- setTimeout(() => {
91
- cssFile.innerHTML = this.clientStylingUrl;
92
- this.stylingContainer.prepend(cssFile);
93
- }, 1);
91
+ let url = new URL(this.clientStylingUrl);
92
+ fetch(url.href)
93
+ .then((res) => res.text())
94
+ .then((data) => {
95
+ const sheet = new CSSStyleSheet();
96
+ // @ts-ignore
97
+ sheet.replace(data);
98
+ // @ts-ignore
99
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
100
+ });
94
101
  }
95
102
  render() {
96
103
  if (this.startTime && this.endTime) {
97
- return h("div", { ref: el => this.stylingContainer = el },
104
+ return h("div", { class: "TournamentDurationWrap" },
98
105
  h("div", { class: "TournamentDuration" },
99
106
  h("div", { class: "TournamentDates" },
100
107
  h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)),
@@ -239,7 +246,7 @@ export class CasinoTournamentDuration {
239
246
  "tournamentLeftDays": {},
240
247
  "showRemain": {},
241
248
  "limitStylingAppends": {},
242
- "stylingContainer": {},
243
249
  "durationInterval": {}
244
250
  }; }
251
+ static get elementRef() { return "host"; }
245
252
  }
@@ -166,7 +166,7 @@ const CasinoTournamentDuration$1 = /*@__PURE__*/ proxyCustomElement(class extend
166
166
  }
167
167
  }
168
168
  componentDidRender() {
169
- if (!this.limitStylingAppends && this.stylingContainer) {
169
+ if (!this.limitStylingAppends && this.host) {
170
170
  if (this.clientStyling)
171
171
  this.setClientStyling();
172
172
  if (this.clientStylingUrl)
@@ -175,20 +175,27 @@ const CasinoTournamentDuration$1 = /*@__PURE__*/ proxyCustomElement(class extend
175
175
  }
176
176
  }
177
177
  setClientStyling() {
178
- let sheet = document.createElement('style');
179
- sheet.innerHTML = this.clientStyling;
180
- this.stylingContainer.prepend(sheet);
178
+ const sheet = new CSSStyleSheet();
179
+ // @ts-ignore
180
+ sheet.replace(this.clientStyling);
181
+ // @ts-ignore
182
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
181
183
  }
182
184
  setClientStylingURL() {
183
- let cssFile = document.createElement('style');
184
- setTimeout(() => {
185
- cssFile.innerHTML = this.clientStylingUrl;
186
- this.stylingContainer.prepend(cssFile);
187
- }, 1);
185
+ let url = new URL(this.clientStylingUrl);
186
+ fetch(url.href)
187
+ .then((res) => res.text())
188
+ .then((data) => {
189
+ const sheet = new CSSStyleSheet();
190
+ // @ts-ignore
191
+ sheet.replace(data);
192
+ // @ts-ignore
193
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
194
+ });
188
195
  }
189
196
  render() {
190
197
  if (this.startTime && this.endTime) {
191
- return h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "TournamentDuration" }, h("div", { class: "TournamentDates" }, h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), h("div", { class: "ProgressBarWrapper" }, h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
198
+ return h("div", { class: "TournamentDurationWrap" }, h("div", { class: "TournamentDuration" }, h("div", { class: "TournamentDates" }, h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), h("div", { class: "ProgressBarWrapper" }, h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
192
199
  h("div", null, h("div", { class: "ProgressBarFillEnd", part: "ProgressBarFillEnd" }), h("div", { class: "Finished", part: "Finished" }, translate('finished', this.language))) :
193
200
  this.tournamentUntilStartDays > 0 ?
194
201
  h("div", null, h("div", { class: "ProgressBarFillStarting", part: "ProgressBarFillStarting" }), h("div", { class: "Remaining", part: "Remaining" }, translate('starting', this.language), " ", this.getTextByDiff(this.tournamentUntilStartDays))) :
@@ -196,6 +203,7 @@ const CasinoTournamentDuration$1 = /*@__PURE__*/ proxyCustomElement(class extend
196
203
  h("div", { class: "Remaining", part: "Remaining" }, this.showRemain, " ", translate('left', this.language)))))));
197
204
  }
198
205
  }
206
+ get host() { return this; }
199
207
  static get style() { return casinoTournamentDurationCss; }
200
208
  }, [1, "casino-tournament-duration", {
201
209
  "startTime": [1, "start-time"],
@@ -208,7 +216,6 @@ const CasinoTournamentDuration$1 = /*@__PURE__*/ proxyCustomElement(class extend
208
216
  "tournamentLeftDays": [32],
209
217
  "showRemain": [32],
210
218
  "limitStylingAppends": [32],
211
- "stylingContainer": [32],
212
219
  "durationInterval": [32]
213
220
  }]);
214
221
  function defineCustomElement$1() {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-a10d1dd0.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-9969d68d.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
@@ -164,7 +164,7 @@ const CasinoTournamentDuration = class {
164
164
  }
165
165
  }
166
166
  componentDidRender() {
167
- if (!this.limitStylingAppends && this.stylingContainer) {
167
+ if (!this.limitStylingAppends && this.host) {
168
168
  if (this.clientStyling)
169
169
  this.setClientStyling();
170
170
  if (this.clientStylingUrl)
@@ -173,20 +173,27 @@ const CasinoTournamentDuration = class {
173
173
  }
174
174
  }
175
175
  setClientStyling() {
176
- let sheet = document.createElement('style');
177
- sheet.innerHTML = this.clientStyling;
178
- this.stylingContainer.prepend(sheet);
176
+ const sheet = new CSSStyleSheet();
177
+ // @ts-ignore
178
+ sheet.replace(this.clientStyling);
179
+ // @ts-ignore
180
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
179
181
  }
180
182
  setClientStylingURL() {
181
- let cssFile = document.createElement('style');
182
- setTimeout(() => {
183
- cssFile.innerHTML = this.clientStylingUrl;
184
- this.stylingContainer.prepend(cssFile);
185
- }, 1);
183
+ let url = new URL(this.clientStylingUrl);
184
+ fetch(url.href)
185
+ .then((res) => res.text())
186
+ .then((data) => {
187
+ const sheet = new CSSStyleSheet();
188
+ // @ts-ignore
189
+ sheet.replace(data);
190
+ // @ts-ignore
191
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
192
+ });
186
193
  }
187
194
  render() {
188
195
  if (this.startTime && this.endTime) {
189
- return h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "TournamentDuration" }, h("div", { class: "TournamentDates" }, h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), h("div", { class: "ProgressBarWrapper" }, h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
196
+ return h("div", { class: "TournamentDurationWrap" }, h("div", { class: "TournamentDuration" }, h("div", { class: "TournamentDates" }, h("div", { class: "StartDate", part: "StartDate" }, this.formatDate(this.startTime)), h("div", { class: "EndDate", part: "EndDate" }, this.formatDate(this.endTime))), h("div", { class: "ProgressBarWrapper" }, h("div", { class: "ProgressBar", part: "ProgressBar" }, this.status == 'Finished' || this.status == 'Closing' || this.status == 'Closed' ?
190
197
  h("div", null, h("div", { class: "ProgressBarFillEnd", part: "ProgressBarFillEnd" }), h("div", { class: "Finished", part: "Finished" }, translate('finished', this.language))) :
191
198
  this.tournamentUntilStartDays > 0 ?
192
199
  h("div", null, h("div", { class: "ProgressBarFillStarting", part: "ProgressBarFillStarting" }), h("div", { class: "Remaining", part: "Remaining" }, translate('starting', this.language), " ", this.getTextByDiff(this.tournamentUntilStartDays))) :
@@ -194,6 +201,7 @@ const CasinoTournamentDuration = class {
194
201
  h("div", { class: "Remaining", part: "Remaining" }, this.showRemain, " ", translate('left', this.language)))))));
195
202
  }
196
203
  }
204
+ get host() { return getElement(this); }
197
205
  };
198
206
  CasinoTournamentDuration.style = casinoTournamentDurationCss;
199
207
 
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-a10d1dd0.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-9969d68d.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["casino-tournament-duration",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"stylingContainer":[32],"durationInterval":[32]}]]]], options);
16
+ return bootstrapLazy([["casino-tournament-duration",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"durationInterval":[32]}]]]], options);
17
17
  });
@@ -237,12 +237,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
237
237
  }
238
238
  }
239
239
  }
240
- else if (memberName === 'ref') {
241
- // minifier will clean this up
242
- if (newValue) {
243
- newValue(elm);
244
- }
245
- }
246
240
  else {
247
241
  // Set property if it exists and it's not a SVG
248
242
  const isComplex = isComplexType(newValue);
@@ -360,7 +354,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
360
354
  for (; startIdx <= endIdx; ++startIdx) {
361
355
  if ((vnode = vnodes[startIdx])) {
362
356
  elm = vnode.$elm$;
363
- callNodeRefs(vnode);
364
357
  // remove the vnode's element from the dom
365
358
  elm.remove();
366
359
  }
@@ -479,12 +472,6 @@ const patch = (oldVNode, newVNode) => {
479
472
  elm.data = text;
480
473
  }
481
474
  };
482
- const callNodeRefs = (vNode) => {
483
- {
484
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
485
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
486
- }
487
- };
488
475
  const renderVdom = (hostRef, renderFnResults) => {
489
476
  const hostElm = hostRef.$hostElement$;
490
477
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -500,6 +487,7 @@ const renderVdom = (hostRef, renderFnResults) => {
500
487
  // synchronous patch
501
488
  patch(oldVNode, rootVnode);
502
489
  };
490
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
503
491
  /**
504
492
  * Helper function to create & dispatch a custom Event on a provided target
505
493
  * @param elm the target of the Event
@@ -1110,4 +1098,4 @@ const flush = () => {
1110
1098
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1111
1099
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1112
1100
 
1113
- export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };
1101
+ export { bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-a10d1dd0.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-9969d68d.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["casino-tournament-duration",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"stylingContainer":[32],"durationInterval":[32]}]]]], options);
13
+ return bootstrapLazy([["casino-tournament-duration",[[1,"casino-tournament-duration",{"startTime":[1,"start-time"],"endTime":[1,"end-time"],"status":[1],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"tournamentUntilStartDays":[32],"tournamentLeftDays":[32],"showRemain":[32],"limitStylingAppends":[32],"durationInterval":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -27,8 +27,8 @@ export declare class CasinoTournamentDuration {
27
27
  tournamentLeftDays: number;
28
28
  showRemain: string;
29
29
  limitStylingAppends: boolean;
30
- stylingContainer: HTMLElement;
31
30
  durationInterval: number;
31
+ host: HTMLElement;
32
32
  getDateTimeDiff(dateString1: any, dateString2: string): number;
33
33
  getDuration(): void;
34
34
  formatDate(date: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-tournament-duration",
3
- "version": "1.27.10",
3
+ "version": "1.28.4",
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 t,h as i}from"./p-efeaf265.js";const s=["ro","en","hr","zh-hk","fr","hu","tr","el","es","pt"],e={en:{finished:"Finished",starting:"Starting in ",left:"left",minutes:"minutes",hours:"hours",days:"days"},hr:{finished:"Gotovo",starting:"Počinje u ",left:"lijevo",minutes:"minute",hours:"sati",days:"dani"},"zh-hk":{finished:"完成的",starting:"開始於",left:"剩下",minutes:"分鐘",hours:"小時",days:"天"},fr:{finished:"Fini",starting:"Début dans ",left:"restant",minutes:"minutes",hours:"heures",days:"jours"},ro:{finished:"Finalizat",starting:"Începe în",left:"rămase",minutes:"minute",hours:"ore",days:"zile"},tr:{finished:"Sona ermiş",starting:"Başlamasına ",left:"kaldı",minutes:"dakika",hours:"saat",days:"gün"},el:{finished:"Ολοκληρωμένα",starting:"Αρχίζει σε ",left:"απομένουν",minutes:"λεπτά",hours:"ώρες",days:"ημέρες"},es:{finished:"Finalizado",starting:"Iniciando en ",left:"izquierda",minutes:"minutos",hours:"horas",days:"días"},hu:{finished:"Befejezve",starting:"Kezdésig",left:"bal",minutes:"perc",hours:"óra",days:"nap"},pt:{finished:"Finalizado",starting:"Começando em",left:"Abandonou",minutes:"Minutos",hours:"Horas",days:"Dias"}},r=(t,i)=>{const r=i;return e[void 0!==r&&s.includes(r)?r:"en"][t]},n=class{constructor(i){t(this,i),this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1}getDateTimeDiff(t,i){return(new Date(i).getTime()-new Date(t).getTime())/6e4}getDuration(){const t=new Date;this.tournamentLeftDays=this.getDateTimeDiff(t,this.endTime),this.tournamentUntilStartDays=this.getDateTimeDiff(t,this.startTime),this.showRemain=this.getTextByDiff(this.tournamentLeftDays)}formatDate(t){let i=new Date(t),s=new Intl.DateTimeFormat(this.language,{month:"long"}).format(i);return`${i.getDate()} ${s}, ${i.toLocaleString("en-GB",{hour:"numeric",minute:"numeric"})}, ${i.getUTCFullYear()}`}getTextByDiff(t){if(t<1440){const i=t%60;return[t/60,i,60*(i-Math.floor(i))].map((t=>(t=>{const i=Math.floor(t);return i<10?`0${i}`:`${i}`})(t))).join(":")}return Math.ceil(t/1440)+" "+r("days")}getProgress(){if(this.tournamentLeftDays<=0)return 100;const t=this.getDateTimeDiff(this.startTime,this.endTime);return Math.floor(100/t*(t-this.tournamentLeftDays))}componentWillLoad(){this.startTime&&this.endTime&&(this.getDuration(),this.getTextByDiff(this.tournamentLeftDays)),this.tournamentLeftDays<1440&&this.tournamentLeftDays>0?this.durationInterval=window.setInterval((()=>{this.startTime&&this.endTime&&this.getDuration()}),1e3):clearInterval(this.durationInterval)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}setClientStyling(){let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}setClientStylingURL(){let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrl,this.stylingContainer.prepend(t)}),1)}render(){if(this.startTime&&this.endTime)return i("div",{ref:t=>this.stylingContainer=t},i("div",{class:"TournamentDuration"},i("div",{class:"TournamentDates"},i("div",{class:"StartDate",part:"StartDate"},this.formatDate(this.startTime)),i("div",{class:"EndDate",part:"EndDate"},this.formatDate(this.endTime))),i("div",{class:"ProgressBarWrapper"},i("div",{class:"ProgressBar",part:"ProgressBar"},"Finished"==this.status||"Closing"==this.status||"Closed"==this.status?i("div",null,i("div",{class:"ProgressBarFillEnd",part:"ProgressBarFillEnd"}),i("div",{class:"Finished",part:"Finished"},r("finished",this.language))):this.tournamentUntilStartDays>0?i("div",null,i("div",{class:"ProgressBarFillStarting",part:"ProgressBarFillStarting"}),i("div",{class:"Remaining",part:"Remaining"},r("starting",this.language)," ",this.getTextByDiff(this.tournamentUntilStartDays))):i("div",null,i("div",{class:"ProgressBarFill",part:"ProgressBarFill",style:{width:`${this.getProgress()}%`}}),this.tournamentLeftDays>0&&i("div",{class:"Remaining",part:"Remaining"},this.showRemain," ",r("left",this.language)))))))}};n.style=":host{display:block}.TournamentDates{display:flex;justify-content:space-between}.StartDate{font-size:10px;font-weight:700;color:var(--emfe-w-color-gray-300, #58586B)}.EndDate{font-size:10px;font-weight:700;align-content:flex-end;color:var(--emfe-w-color-gray-300, #58586B)}.ProgressBar{margin:5px 0;height:8px;background:var(--emfe-w-color-white, #FFFFFF)}.ProgressBarInactive{margin:5px 20px 10px 20px;height:8px;background:var(--emfe-w-color-gray-100, #E6E6E6)}.ProgressBarFill{background-color:var(--emfe-w-color-green, #48952a);height:8px}.ProgressBarFillEnd{background-color:var(--emfe-w-color-green, #48952a);height:8px}.ProgressBarFillStarting{background-color:var(--emfe-w-color-gray-300, #58586B);height:8px}.Remaining,.Finished{font-size:10px;font-weight:700;padding-top:6px;text-align:right;text-transform:uppercase}.Finished{color:var(--emfe-w-color-green, #48952a)}";export{n as casino_tournament_duration}
@@ -1 +0,0 @@
1
- let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",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)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?d(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=d(e,null);return c.u=t,r.length>0&&(c.$=r),c},d=(e,t)=>({t:0,h:e,i:t,m:null,$:null,u:null}),h={},y=(e,t,n,l,s,o)=>{if(n!==l){let r=H(e,t);if(t.toLowerCase(),"class"===t){const t=e.classList,s=p(n),o=p(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("ref"===t)l&&l(e);else{const i=f(l);if((r||i&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{let s=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&o||s)&&!i&&e.setAttribute(t,l=!0===l?"":l)}}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,r=t.u||a;for(l in o)l in r||y(s,l,o[l],void 0,n,t.t);for(l in r)y(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,i=n.$[l],c=0;if(null!==i.i)o=i.m=s.createTextNode(i.i);else if(o=i.m=s.createElement(i.h),b(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.$)for(c=0;c<i.$.length;++c)r=w(t,i,c),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=w(null,l,o),i&&(s[o].m=i,c.insertBefore(i,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,v(l),s.remove())},j=(e,t)=>e.h===t.h,M=(e,t)=>{const n=t.m=e.m,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],$=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==$?$=l[--a]:j(c,f)?(M(c,f),c=t[++o],f=l[++r]):j(u,$)?(M(u,$),u=t[--i],$=l[--a]):j(c,$)?(M(c,$),e.insertBefore(c.m,u.m.nextSibling),c=t[++o],$=l[--a]):j(u,f)?(M(u,f),e.insertBefore(u.m,c.m),u=t[--i],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&c.m.parentNode.insertBefore(s,c.m));o>i?S(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&g(t,o,i)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},v=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(v)},k=(e,t)=>{t&&!e.p&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.p=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.S),Y((()=>O(e,t)));e.t|=512},O=(e,t)=>{const n=e.g;let l;return t&&(l=N(n,"componentWillLoad")),R(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.j,l=t.t,o=((e,t)=>{let n=u(t),l=B.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=c.get(e=e.head||e);o||c.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);x(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.v||d(null,null),r=(e=>e&&e.h===h)(l)?l:$(null,null,l);t=s.tagName,r.h=null,r.t|=4,n.v=r,r.m=o.m=s.shadowRoot||s,e=s["s-sc"],M(o,r)})(n,l)}catch(e){V(e,n.j)}return null},E=e=>{const t=e.j,n=e.S;N(e.g,"componentDidRender"),64&e.t||(e.t|=64,T(t),e.k(t),n||L()),e.p&&(e.p(),e.p=void 0),512&e.t&&X((()=>C(e,!1))),e.t&=-517},L=()=>{T(s.documentElement),X((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"casino-tournament-duration"}});return e.dispatchEvent(t),t})(l)))},N=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){V(e)}},R=(e,t)=>e&&e.then?e.then(t):t(),T=e=>e.classList.add("hydrated"),W=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>q(this).O.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=q(e),o=s.O.get(t),r=s.t,i=s.g;n=((e,t)=>null==e||f(e)?e:1&t?e+"":e)(n,l.C[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.O.set(t,n),i&&2==(18&r)&&C(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},A=(e,t={})=>{const n=[],r=t.exclude||[],c=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),d=[];let h,y=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],C:t[2],P:t[3]};l.C=t[2];const s=l.o,a=class extends HTMLElement{constructor(e){super(e),F(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),y?d.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=q(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(t,t.S=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=z(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(W(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){V(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=u(n);if(!B.has(t)){const l=()=>{};((e,t,n)=>{let l=B.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,B.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.S,r=()=>C(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return q(this).L}};l.N=e[0],r.includes(s)||c.get(s)||(n.push(s),c.define(s,W(a,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),y=!1,d.length?d.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(L,30)))},U=new WeakMap,q=e=>U.get(e),D=(e,t)=>U.set(t.g=e,t),F=(e,t)=>{const n={t:0,j:e,M:t,O:new Map};return n.L=new Promise((e=>n.k=e)),e["s-p"]=[],e["s-rc"]=[],U.set(e,n)},H=(e,t)=>t in e,V=(e,t)=>(0,console.error)(e,t),_=new Map,z=e=>{const t=e.o.replace(/-/g,"_"),n=e.N,l=_.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(_.set(n,e),e[t])),V)},B=new Map,G=[],I=[],J=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?X(Q):o.raf(Q))},K=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){V(e)}e.length=0},Q=()=>{K(G),K(I),(n=G.length>0)&&o.raf(Q)},X=e=>r().then(e),Y=J(I,!0);export{A as b,$ as h,r as p,D as r}
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;