@everymatrix/casino-engagement-suite-tournament 1.77.0 → 1.77.2
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.
- package/dist/casino-engagement-suite-tournament/casino-engagement-suite-progress-bar_8.entry.js +1 -1
- package/dist/casino-engagement-suite-tournament/casino-engagement-suite-tournament.esm.js +1 -1
- package/dist/cjs/casino-engagement-suite-progress-bar_8.cjs.entry.js +113 -32
- package/dist/cjs/casino-engagement-suite-tournament.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/esm/casino-engagement-suite-progress-bar_8.entry.js +113 -32
- package/dist/esm/casino-engagement-suite-tournament.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/index.d.ts +1 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-engagement-suite-tournament/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/package.json +1 -1
package/dist/casino-engagement-suite-tournament/casino-engagement-suite-progress-bar_8.entry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,g as i,c as s,H as n}from"./index-487913af.js";import{c as r,D as a,i as o,r as h,t as l,L as c,g as d,a as g,f as m}from"./casino-engagement-suite-tournament-12623c2a.js";export{C as casino_engagement_suite_tournament}from"./casino-engagement-suite-tournament-12623c2a.js";import"@everymatrix/ui-image";const u=class{constructor(t){e(this,t),this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.value=0,this.disabled=!1,this.hidePercent=!1,this.indeterminate=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent||this.indeterminate}}getProgressBarLineTemplate(){return t("div",this.indeterminate?{class:"ProgressBarLine Indeterminate",part:"ProgressBarLine Indeterminate"}:{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})}render(){return t("div",{key:"ecce3a26a92d2e090c1db84bdc1bdbeb505080ed",class:this.getProgressBarClasses(),part:"ProgressBar"},t("div",{key:"649fe1103d222200f2a1ad3b5967e37da1f1ab3d",class:"ProgressBarInfo",part:"ProgressBarInfo"},t("slot",{key:"49dc180eedd823f0027f75099813fb9d91bcd938",name:"Title"},t("div",{key:"e6e59da3fe7bbcb37e118e7fd23a8ff35587aca5"})),t("slot",{key:"3dc8e5fd1dbc8c268b9c76e393b751cb53605e7e",name:"Percent"},t("div",{key:"6a9e880f3ee3c4f26e8577c69be5db5f8e2d10ad",class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),t("div",{key:"141106e77caad7b04bb199f911e87c0c6f0adc2d",class:"ProgressBarBackground",part:"ProgressBarBackground"},this.getProgressBarLineTemplate()))}get host(){return i(this)}};function b(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function k(e,t){const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}u.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:var(--emw--font-size-small, 14px);line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-gray-300, #666178);border-radius:var(--emw--border-radius-small, 4px);position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:var(--emw--border-radius-small, 4px);background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-gray-300, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";const w=class{constructor(t){e(this,t),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(null!=window.emMessageBus?function(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}(this.el,`${this.mbSource}.Style`):(this.clientStyling&&b(this.el,this.clientStyling),this.clientStylingUrl&&k(this.el,this.clientStylingUrl),this.stylingAppends=!0))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClientStylingChange(e,t){e!=t&&b(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&k(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&b(this.el,this.clientStyling),this.clientStylingUrl&&k(this.el,this.clientStylingUrl),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const s=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]||{},Object.keys(t[e]).forEach((s=>{if(!i.en[s])return;const n=i.en[s];"object"==typeof t[e][s]?(i[e][s]=i[e][s]||Object.assign({},n),Object.keys(t[e][s]).forEach((n=>{i[e][s][n]=t[e][s][n]}))):i[e][s]=t[e][s]||Object.assign({},n)}))})),e(!0)})).catch((t=>{console.error("Failed to load translations:",t),e(!1)}))})));e.push(s)}var t,i;return await Promise.all(e)}render(){return t("div",{key:"09ad83748bbad518743c8671b986c541c52bf3f0",class:"StyleShell"},t("slot",{key:"3b28b776d3944410c717b002b70946d274a4e8e7",name:"mainContent"}))}get el(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};w.style=":host{display:block}";const f=class{constructor(t){e(this,t),this.clickToTournamentDetail=s(this,"clickToTournamentDetail",7),this.tournament=void 0,this.isNew=void 0,this.tid=void 0,this.language="en"}goToDetail(){this.clickToTournamentDetail.emit(this.tournament)}onTournamentUpdateEvent(e){const{detail:t}=e;t.id===this.tournament.id&&(this.tournament=Object.assign({},t))}render(){const e=this.tournament;return t("div",{key:"836c6720a7be8c1a97f43245908fc2b6d535c50e",class:r("LeaderboardsItem",e.isPlayerAcknowledged?" GradientRounded Hollow":"",e.isUnjoined?"Unjoined":""),onClick:this.goToDetail.bind(this)},t("div",{key:"a6b131a60c7484dd33f963b769b7db47438460f1",class:"LeaderboardsItemContainer"},t("tournament-item-title",{key:"0e229e79322889c168a7ec4f35bd0ae0fde61a96",tournament:e,language:this.language}),t("tournament-timer",{key:"6f486b88ae367bef631779bfc92b995516bfd8c0",tournament:e})),t("div",{key:"00e40f6bc6102da356f1d781506ceba4c7ae340e",class:"LeaderboardLabels"},this.isNew&&t("div",{key:"5aa6fced7c55d5bb7911c2590611008389f51042",class:"LeaderboardLabel"},t("span",{key:"b89b5825d0902545ea44105ce9f3b8a8a2c98676"},"new"))))}},v=class{constructor(t){e(this,t),this.unjoinTournamentConfirmEvent=s(this,"unjoinTournamentConfirmEvent",7),this.joinTournamentEvent=s(this,"joinTournamentEvent",7),this.tournament=void 0,this.language="en",this.isButtonDisabed=!1}onTournamentChanged(e){this.isButtonDisabed=!0===e.isActionJoinPending}onClickItemJoin(){this.isButtonDisabed||(this.isButtonDisabed=!this.tournament.isPlayerAcknowledged,this.tournament.isPlayerAcknowledged?this.unjoinTournamentConfirmEvent.emit({type:a.unjoin,tournament:this.tournament}):this.joinTournamentEvent.emit(this.tournament))}componentDidLoad(){this.isButtonDisabed=!0===this.tournament.isActionJoinPending}render(){return t("div",{key:"3123b0ffd6335833a5938b13e4c620ded693da38",class:"TitleContainer"},t("div",{key:"88977f242dd5cce6265c679ae55dc1dfdecd7fd0",class:"Title"},this.tournament.nameOrTitle),!o(this.tournament)&&t("div",{key:"bf2aad175409e687ed2bd42350a7f8585d86c112"},h({statedClasses:{isHollow:this.tournament.isPlayerAcknowledged,isPending:this.isButtonDisabed},onClick:e=>{e.stopPropagation(),this.onClickItemJoin()},innerHTML:l(this.tournament.isPlayerAcknowledged?"Unjoin":"Join",this.language)})))}static get watchers(){return{tournament:["onTournamentChanged"]}}},p=class{constructor(t){e(this,t),this.tournament=void 0,this.isDetail=!1,this.timeHolder=void 0,this.timeClock=!0,this.lastTimeDiff=void 0,this.lastProgress=void 0}containerPageChangeHandler(e){this.timeClock=e.detail.page===c.list&&!this.isDetail||e.detail.page===c.item&&this.isDetail}componentWillLoad(){this.lastProgress=d(this.tournament.startTime,this.tournament.endTime),this.lastTimeDiff=g(new Date,this.tournament.endTime,this.lastProgress)}setTimeInterval(){this.timeHolder=setInterval((()=>{const e=d(this.tournament.startTime,this.tournament.endTime),t=g(new Date,this.tournament.endTime,e);!this.timeClock||o(this.tournament)||t==this.lastTimeDiff&&e==this.lastProgress||(this.lastProgress=e,this.lastTimeDiff=t)}),2e3)}connectedCallback(){this.setTimeInterval()}disconnectedCallback(){clearInterval(this.timeHolder)}render(){return t("section",{key:"11426165a8f384d97f2b0158f7435f80ac0965a2",class:"TimeContainer"},t("div",{key:"b86c8a42a73b358fcc855a853cb322d1d314471a",class:"Time"},"Running"===this.tournament.state?t("div",{class:"Running"},t("div",null,this.lastTimeDiff),t("div",null,h({statedClasses:{isHollow:!0,isPending:!!this.tournament.isActionJoinPending},innerHTML:`${this.lastProgress}%`}))):[t("div",{class:"NotRunning"},m(this.tournament.startTime)),t("div",null,m(this.tournament.endTime))]),t("casino-engagement-suite-progress-bar",{key:"7f98e88679f30d0a0737d94ee806b1d92800b6a3",indeterminate:!1,value:Number(this.lastProgress>=100?100:this.lastProgress),"hide-percent":!0}))}},y=class{constructor(t){e(this,t),this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.styles=void 0,this.detectDistance="200px",this.imgLoaded=!1,this.shouldLoad=!1}handleSrc(){if(!this.shouldLoad)return;const e=new Image;e.onload=()=>{this.image&&(this.image.src=this.src,this.imgLoaded=!0,e.onload=null)},e.src=this.src}componentDidLoad(){"IntersectionObserver"in window?(this.el.__uxComponent=this,window.EMUxObserver||(window.EMUxObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.__uxComponent;t&&(t.shouldLoad=!0,t.handleSrc()),window.EMUxObserver.unobserve(e.target)}}))}),{rootMargin:this.detectDistance})),window.EMUxObserver.observe(this.el)):(this.shouldLoad=!0,this.handleSrc())}render(){return t(n,{key:"f506ba73852f257ad80bf59ca177d2065a5f365e",class:"HostContainer"},!this.imgLoaded&&t("ui-skeleton",{key:"564ebfab701f827ddc2debccb7615926dbc9e876",class:"UiContainer",structure:"image",width:"100%",height:"100%"}),t("img",{key:"2188ca4494c10587f064acc5459ffc468948f497",ref:e=>this.image=e,src:this.shouldLoad?this.src:void 0,onLoad:()=>this.imgLoaded=!0,style:this.styles,class:"UiContainer "+(this.imgLoaded?"Visible":"Hidden"),alt:this.alt,width:this.width,height:this.height,loading:"lazy"}))}get el(){return i(this)}static get watchers(){return{src:["handleSrc"]}}};y.style=".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}";const x=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,i)=>t("div",{key:i,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"e6b885bfd985ce7663d990756fe9101e25eb97f0"},t("style",{key:"06ae24c7bb74f4dacfc12ae58085333f9dc89da5"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};x.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{u as casino_engagement_suite_progress_bar,w as general_styling_wrapper,f as tournament_item,v as tournament_item_title,p as tournament_timer,y as ui_image,x as ui_skeleton}
|
|
1
|
+
import{r as e,h as t,g as i,c as s,H as n}from"./index-487913af.js";import{c as r,D as a,i as o,r as h,t as l,L as d,g as c,a as g,f as m}from"./casino-engagement-suite-tournament-12623c2a.js";export{C as casino_engagement_suite_tournament}from"./casino-engagement-suite-tournament-12623c2a.js";import"@everymatrix/ui-image";const u=class{constructor(t){e(this,t),this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.host.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.host.prepend(t)}),1)})).catch((e=>{console.log("Error ",e)}))},this.value=0,this.disabled=!1,this.hidePercent=!1,this.indeterminate=!1,this.clientStyling="",this.clientStylingUrl="",this.limitStylingAppends=!1}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}getProgressBarClasses(){return{ProgressBar:!0,Completed:100===this.value,Disabled:this.disabled,HidePercent:this.hidePercent||this.indeterminate}}getProgressBarLineTemplate(){return t("div",this.indeterminate?{class:"ProgressBarLine Indeterminate",part:"ProgressBarLine Indeterminate"}:{class:"ProgressBarLine",part:"ProgressBarLine",style:{width:this.value+"%"}})}render(){return t("div",{key:"ecce3a26a92d2e090c1db84bdc1bdbeb505080ed",class:this.getProgressBarClasses(),part:"ProgressBar"},t("div",{key:"649fe1103d222200f2a1ad3b5967e37da1f1ab3d",class:"ProgressBarInfo",part:"ProgressBarInfo"},t("slot",{key:"49dc180eedd823f0027f75099813fb9d91bcd938",name:"Title"},t("div",{key:"e6e59da3fe7bbcb37e118e7fd23a8ff35587aca5"})),t("slot",{key:"3dc8e5fd1dbc8c268b9c76e393b751cb53605e7e",name:"Percent"},t("div",{key:"6a9e880f3ee3c4f26e8577c69be5db5f8e2d10ad",class:"ProgressBarPercent",part:"ProgressBarPercent"},this.value,"%"))),t("div",{key:"141106e77caad7b04bb199f911e87c0c6f0adc2d",class:"ProgressBarBackground",part:"ProgressBarBackground"},this.getProgressBarLineTemplate()))}get host(){return i(this)}};function b(e,t){if(e){const i=document.createElement("style");i.innerHTML=t,e.appendChild(i)}}function k(e,t){const i=new URL(t);fetch(i.href).then((e=>e.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,e&&e.appendChild(i)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}u.style=":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:var(--emw--font-size-small, 14px);line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-gray-300, #666178);border-radius:var(--emw--border-radius-small, 4px);position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:var(--emw--border-radius-small, 4px);background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-x-small, 12px);line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:var(--emw--engagement-suite-gradient-button, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-gray-300, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";const w=class{constructor(t){e(this,t),this.stylingAppends=!1,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.targetTranslations=void 0}componentDidLoad(){this.el&&(null!=window.emMessageBus?function(e,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,e&&e.appendChild(i)}))}}(this.el,`${this.mbSource}.Style`):(this.clientStyling&&b(this.el,this.clientStyling),this.clientStylingUrl&&k(this.el,this.clientStylingUrl),this.stylingAppends=!0))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClientStylingChange(e,t){e!=t&&b(this.el,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&this.clientStylingUrl&&k(this.el,this.clientStylingUrl)}componentDidRender(){this.stylingAppends||(this.clientStyling&&b(this.el,this.clientStyling),this.clientStylingUrl&&k(this.el,this.clientStylingUrl),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const s=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]||{},Object.keys(t[e]).forEach((s=>{if(!i.en[s])return;const n=i.en[s];"object"==typeof t[e][s]?(i[e][s]=i[e][s]||Object.assign({},n),Object.keys(t[e][s]).forEach((n=>{i[e][s][n]=t[e][s][n]}))):i[e][s]=t[e][s]||Object.assign({},n)}))})),e(!0)})).catch((t=>{console.error("Failed to load translations:",t),e(!1)}))})));e.push(s)}var t,i;return await Promise.all(e)}render(){return t("div",{key:"09ad83748bbad518743c8671b986c541c52bf3f0",class:"StyleShell"},t("slot",{key:"3b28b776d3944410c717b002b70946d274a4e8e7",name:"mainContent"}))}get el(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};w.style=":host{display:block}";const f=class{constructor(t){e(this,t),this.clickToTournamentDetail=s(this,"clickToTournamentDetail",7),this.tournament=void 0,this.isNew=void 0,this.tid=void 0,this.language="en"}goToDetail(){this.clickToTournamentDetail.emit(this.tournament)}onTournamentUpdateEvent(e){const{detail:t}=e;t.id===this.tournament.id&&(this.tournament=Object.assign({},t))}render(){const e=this.tournament;return t("div",{key:"836c6720a7be8c1a97f43245908fc2b6d535c50e",class:r("LeaderboardsItem",e.isPlayerAcknowledged?" GradientRounded Hollow":"",e.isUnjoined?"Unjoined":""),onClick:this.goToDetail.bind(this)},t("div",{key:"a6b131a60c7484dd33f963b769b7db47438460f1",class:"LeaderboardsItemContainer"},t("tournament-item-title",{key:"0e229e79322889c168a7ec4f35bd0ae0fde61a96",tournament:e,language:this.language}),t("tournament-timer",{key:"6f486b88ae367bef631779bfc92b995516bfd8c0",tournament:e})),t("div",{key:"00e40f6bc6102da356f1d781506ceba4c7ae340e",class:"LeaderboardLabels"},this.isNew&&t("div",{key:"5aa6fced7c55d5bb7911c2590611008389f51042",class:"LeaderboardLabel"},t("span",{key:"b89b5825d0902545ea44105ce9f3b8a8a2c98676"},"new"))))}},v=class{constructor(t){e(this,t),this.unjoinTournamentConfirmEvent=s(this,"unjoinTournamentConfirmEvent",7),this.joinTournamentEvent=s(this,"joinTournamentEvent",7),this.tournament=void 0,this.language="en",this.isButtonDisabed=!1}onTournamentChanged(e){this.isButtonDisabed=!0===e.isActionJoinPending}onClickItemJoin(){this.isButtonDisabed||(this.isButtonDisabed=!this.tournament.isPlayerAcknowledged,this.tournament.isPlayerAcknowledged?this.unjoinTournamentConfirmEvent.emit({type:a.unjoin,tournament:this.tournament}):this.joinTournamentEvent.emit(this.tournament))}componentDidLoad(){this.isButtonDisabed=!0===this.tournament.isActionJoinPending}render(){return t("div",{key:"3123b0ffd6335833a5938b13e4c620ded693da38",class:"TitleContainer"},t("div",{key:"88977f242dd5cce6265c679ae55dc1dfdecd7fd0",class:"Title"},this.tournament.nameOrTitle),!o(this.tournament)&&t("div",{key:"bf2aad175409e687ed2bd42350a7f8585d86c112"},h({statedClasses:{isHollow:this.tournament.isPlayerAcknowledged,isPending:this.isButtonDisabed},onClick:e=>{e.stopPropagation(),this.onClickItemJoin()},innerHTML:l(this.tournament.isPlayerAcknowledged?"Unjoin":"Join",this.language)})))}static get watchers(){return{tournament:["onTournamentChanged"]}}},p=class{constructor(t){e(this,t),this.tournament=void 0,this.isDetail=!1,this.timeHolder=void 0,this.timeClock=!0,this.lastTimeDiff=void 0,this.lastProgress=void 0}containerPageChangeHandler(e){this.timeClock=e.detail.page===d.list&&!this.isDetail||e.detail.page===d.item&&this.isDetail}componentWillLoad(){this.lastProgress=c(this.tournament.startTime,this.tournament.endTime),this.lastTimeDiff=g(new Date,this.tournament.endTime,this.lastProgress)}setTimeInterval(){this.timeHolder=setInterval((()=>{const e=c(this.tournament.startTime,this.tournament.endTime),t=g(new Date,this.tournament.endTime,e);!this.timeClock||o(this.tournament)||t==this.lastTimeDiff&&e==this.lastProgress||(this.lastProgress=e,this.lastTimeDiff=t)}),2e3)}connectedCallback(){this.setTimeInterval()}disconnectedCallback(){clearInterval(this.timeHolder)}render(){return t("section",{key:"11426165a8f384d97f2b0158f7435f80ac0965a2",class:"TimeContainer"},t("div",{key:"b86c8a42a73b358fcc855a853cb322d1d314471a",class:"Time"},"Running"===this.tournament.state?t("div",{class:"Running"},t("div",null,this.lastTimeDiff),t("div",null,h({statedClasses:{isHollow:!0,isPending:!!this.tournament.isActionJoinPending},innerHTML:`${this.lastProgress}%`}))):[t("div",{class:"NotRunning"},m(this.tournament.startTime)),t("div",null,m(this.tournament.endTime))]),t("casino-engagement-suite-progress-bar",{key:"7f98e88679f30d0a0737d94ee806b1d92800b6a3",indeterminate:!1,value:Number(this.lastProgress>=100?100:this.lastProgress),"hide-percent":!0}))}},y=class{constructor(t){e(this,t),this.hasStarted=!1,this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.styles=void 0,this.detectDistance="200px",this.loading="lazy",this.imgLoaded=!1}onSrcChange(){"eager"!==this.loading&&(this.imgLoaded=!1,this.hasStarted=!1,"undefined"!=typeof window&&"IntersectionObserver"in window||this.beginLoad())}onLoadingChange(e,t){e!==t&&(this.cleanupObserver(),this.detachImgHandlers(),"eager"===e?(this.imgEl&&this.src&&(this.imgEl.src=this.src),this.hasStarted=!0):(this.imgLoaded=!1,this.hasStarted=!1,this.setupObserver()))}componentDidLoad(){"eager"!==this.loading&&this.setupObserver()}disconnectedCallback(){this.cleanupObserver(),this.detachImgHandlers()}canUseIO(){return"undefined"!=typeof window&&"IntersectionObserver"in window}setupObserver(){"eager"!==this.loading&&(this.canUseIO()?(this.io=new IntersectionObserver((e=>{var t;for(const i of e)if(i.isIntersecting){this.beginLoad(),null===(t=this.io)||void 0===t||t.unobserve(i.target),this.cleanupObserver();break}}),{root:null,rootMargin:this.detectDistance,threshold:0}),this.io.observe(this.el)):this.beginLoad())}cleanupObserver(){var e;null===(e=this.io)||void 0===e||e.disconnect(),this.io=void 0}wireOnceHandlers(){this.imgEl&&(this.detachImgHandlers(),this._onLoad=()=>{var e;this.currentSrc&&(null===(e=this.imgEl)||void 0===e?void 0:e.currentSrc)&&!this.imgEl.currentSrc.includes(this.currentSrc)||(this.imgLoaded=!0)},this._onError=()=>{console.error("Load image failed:",this.src)},this.imgEl.addEventListener("load",this._onLoad,{once:!0}),this.imgEl.addEventListener("error",this._onError,{once:!0}))}detachImgHandlers(){this.imgEl&&(this._onLoad&&this.imgEl.removeEventListener("load",this._onLoad),this._onError&&this.imgEl.removeEventListener("error",this._onError),this._onLoad=void 0,this._onError=void 0)}beginLoad(){this.hasStarted||this.imgEl&&this.src&&(this.hasStarted=!0,this.wireOnceHandlers(),this.imgEl.complete&&this.imgEl.naturalWidth>0?this.imgLoaded=!0:(this.currentSrc=this.src,this.imgEl.src=this.src,this.imgEl.complete&&this.imgEl.naturalWidth>0&&(this.imgLoaded=!0)))}get showSkeleton(){return"eager"!==this.loading&&!this.imgLoaded}renderEager(){return t(n,{class:"HostContainer"},t("img",{src:this.src,decoding:"async",style:this.styles,class:"UiContainer Visible",alt:this.alt,width:this.width,height:this.height,loading:"eager"}))}renderLazy(){return t(n,{class:"HostContainer","aria-busy":this.imgLoaded?"false":"true"},this.showSkeleton&&t("ui-skeleton",{class:"UiContainer",structure:"image",width:"100%",height:"100%"}),t("img",{ref:e=>this.imgEl=e,src:void 0,decoding:"async",style:this.styles,class:"UiContainer "+(this.imgLoaded?"Visible":"Hidden"),alt:this.alt,width:this.width,height:this.height,loading:"lazy"}))}render(){return"eager"===this.loading?this.renderEager():this.renderLazy()}get el(){return i(this)}static get watchers(){return{src:["onSrcChange"],loading:["onLoadingChange"]}}};y.style=".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}";const x=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Logo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"Image "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Title "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,i)=>t("div",{key:i,class:"Text "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Rectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"Circle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"e6b885bfd985ce7663d990756fe9101e25eb97f0"},t("style",{key:"06ae24c7bb74f4dacfc12ae58085333f9dc89da5"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};x.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{u as casino_engagement_suite_progress_bar,w as general_styling_wrapper,f as tournament_item,v as tournament_item_title,p as tournament_timer,y as ui_image,x as ui_skeleton}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as e}from"./index-487913af.js";export{s as setNonce}from"./index-487913af.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["casino-engagement-suite-progress-bar_8",[[1,"casino-engagement-suite-tournament",{language:[1],show:[4],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],device:[1],orientation:[1],leaderboardsInit:[16],tipsHideDelay:[514,"tips-hide-delay"],tab:[32],locale:[32],tournamentItem:[32],tournamentList:[32],leaderboards:[32],isDialogOpen:[32],isShowInfo:[32],page:[32],tournamentInDialog:[32],dialog:[32],newIdList:[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{newIdList:["watchPropHandler"],language:["watchPropHandler"],tournamentList:["syncBarState"],show:["showPropWatcher"]}],[0,"tournament-item",{tournament:[16],isNew:[4,"is-new"],tid:[1],language:[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{src:[1],width:[1],height:[1],alt:[1],styles:[8],detectDistance:[1,"detect-distance"],
|
|
1
|
+
import{p as n,b as e}from"./index-487913af.js";export{s as setNonce}from"./index-487913af.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const e=import.meta.url,t={};return""!==e&&(t.resourcesUrl=new URL(".",e).href),n(t)})().then((async n=>(await t(),e([["casino-engagement-suite-progress-bar_8",[[1,"casino-engagement-suite-tournament",{language:[1],show:[4],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],device:[1],orientation:[1],leaderboardsInit:[16],tipsHideDelay:[514,"tips-hide-delay"],tab:[32],locale:[32],tournamentItem:[32],tournamentList:[32],leaderboards:[32],isDialogOpen:[32],isShowInfo:[32],page:[32],tournamentInDialog:[32],dialog:[32],newIdList:[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{newIdList:["watchPropHandler"],language:["watchPropHandler"],tournamentList:["syncBarState"],show:["showPropWatcher"]}],[0,"tournament-item",{tournament:[16],isNew:[4,"is-new"],tid:[1],language:[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{src:[1],width:[1],height:[1],alt:[1],styles:[8],detectDistance:[1,"detect-distance"],loading:[1],imgLoaded:[32]},null,{src:["onSrcChange"],loading:["onLoadingChange"]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[1,"translation-url"],targetTranslations:[16]},null,{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}],[0,"tournament-timer",{tournament:[16],isDetail:[4,"is-detail"],timeHolder:[32],timeClock:[32],lastTimeDiff:[32],lastProgress:[32]},[[16,"tournamentTimer","containerPageChangeHandler"]]],[0,"tournament-item-title",{tournament:[16],language:[1],isButtonDisabed:[32]},null,{tournament:["onTournamentChanged"]}],[0,"ui-skeleton",{structure:[1],width:[1],height:[1],borderRadius:[8,"border-radius"],marginBottom:[8,"margin-bottom"],marginTop:[8,"margin-top"],marginLeft:[8,"margin-left"],marginRight:[8,"margin-right"],animation:[4],rows:[2],size:[1]},null,{structure:["handleStructureChange"]}],[1,"casino-engagement-suite-progress-bar",{value:[2],disabled:[4],hidePercent:[4,"hide-percent"],indeterminate:[4],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],limitStylingAppends:[32]}]]]],n))));
|
|
@@ -356,59 +356,140 @@ const UiImageStyle0 = uiImageCss;
|
|
|
356
356
|
const UiImage = class {
|
|
357
357
|
constructor(hostRef) {
|
|
358
358
|
index.registerInstance(this, hostRef);
|
|
359
|
+
this.hasStarted = false;
|
|
359
360
|
this.src = undefined;
|
|
360
361
|
this.width = undefined;
|
|
361
362
|
this.height = undefined;
|
|
362
363
|
this.alt = undefined;
|
|
363
364
|
this.styles = undefined;
|
|
364
365
|
this.detectDistance = '200px';
|
|
366
|
+
this.loading = 'lazy';
|
|
365
367
|
this.imgLoaded = false;
|
|
366
|
-
this.shouldLoad = false;
|
|
367
368
|
}
|
|
368
|
-
|
|
369
|
-
if (
|
|
369
|
+
onSrcChange() {
|
|
370
|
+
if (this.loading === 'eager')
|
|
370
371
|
return;
|
|
372
|
+
this.imgLoaded = false;
|
|
373
|
+
this.hasStarted = false;
|
|
374
|
+
if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
|
|
375
|
+
this.beginLoad();
|
|
371
376
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
377
|
+
}
|
|
378
|
+
onLoadingChange(newVal, oldVal) {
|
|
379
|
+
if (newVal === oldVal)
|
|
380
|
+
return;
|
|
381
|
+
this.cleanupObserver();
|
|
382
|
+
this.detachImgHandlers();
|
|
383
|
+
if (newVal === 'eager') {
|
|
384
|
+
if (this.imgEl && this.src) {
|
|
385
|
+
this.imgEl.src = this.src;
|
|
378
386
|
}
|
|
379
|
-
|
|
380
|
-
|
|
387
|
+
this.hasStarted = true;
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
this.imgLoaded = false;
|
|
391
|
+
this.hasStarted = false;
|
|
392
|
+
this.setupObserver();
|
|
393
|
+
}
|
|
381
394
|
}
|
|
382
395
|
componentDidLoad() {
|
|
383
|
-
if ('
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
if (this.loading === 'eager')
|
|
397
|
+
return;
|
|
398
|
+
this.setupObserver();
|
|
399
|
+
}
|
|
400
|
+
disconnectedCallback() {
|
|
401
|
+
this.cleanupObserver();
|
|
402
|
+
this.detachImgHandlers();
|
|
403
|
+
}
|
|
404
|
+
canUseIO() {
|
|
405
|
+
return typeof window !== 'undefined' && 'IntersectionObserver' in window;
|
|
406
|
+
}
|
|
407
|
+
setupObserver() {
|
|
408
|
+
if (this.loading === 'eager')
|
|
409
|
+
return;
|
|
410
|
+
if (!this.canUseIO()) {
|
|
411
|
+
this.beginLoad();
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
this.io = new IntersectionObserver((entries) => {
|
|
415
|
+
var _a;
|
|
416
|
+
for (const entry of entries) {
|
|
417
|
+
if (entry.isIntersecting) {
|
|
418
|
+
this.beginLoad();
|
|
419
|
+
(_a = this.io) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target);
|
|
420
|
+
this.cleanupObserver();
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
398
423
|
}
|
|
399
|
-
|
|
424
|
+
}, { root: null, rootMargin: this.detectDistance, threshold: 0 });
|
|
425
|
+
this.io.observe(this.el);
|
|
426
|
+
}
|
|
427
|
+
cleanupObserver() {
|
|
428
|
+
var _a;
|
|
429
|
+
(_a = this.io) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
430
|
+
this.io = undefined;
|
|
431
|
+
}
|
|
432
|
+
wireOnceHandlers() {
|
|
433
|
+
if (!this.imgEl)
|
|
434
|
+
return;
|
|
435
|
+
this.detachImgHandlers();
|
|
436
|
+
this._onLoad = () => {
|
|
437
|
+
var _a;
|
|
438
|
+
if (this.currentSrc && ((_a = this.imgEl) === null || _a === void 0 ? void 0 : _a.currentSrc) && !this.imgEl.currentSrc.includes(this.currentSrc))
|
|
439
|
+
return;
|
|
440
|
+
this.imgLoaded = true;
|
|
441
|
+
};
|
|
442
|
+
this._onError = () => {
|
|
443
|
+
console.error('Load image failed:', this.src);
|
|
444
|
+
};
|
|
445
|
+
this.imgEl.addEventListener('load', this._onLoad, { once: true });
|
|
446
|
+
this.imgEl.addEventListener('error', this._onError, { once: true });
|
|
447
|
+
}
|
|
448
|
+
detachImgHandlers() {
|
|
449
|
+
if (!this.imgEl)
|
|
450
|
+
return;
|
|
451
|
+
if (this._onLoad)
|
|
452
|
+
this.imgEl.removeEventListener('load', this._onLoad);
|
|
453
|
+
if (this._onError)
|
|
454
|
+
this.imgEl.removeEventListener('error', this._onError);
|
|
455
|
+
this._onLoad = undefined;
|
|
456
|
+
this._onError = undefined;
|
|
457
|
+
}
|
|
458
|
+
beginLoad() {
|
|
459
|
+
if (this.hasStarted)
|
|
460
|
+
return;
|
|
461
|
+
if (!this.imgEl)
|
|
462
|
+
return;
|
|
463
|
+
if (!this.src)
|
|
464
|
+
return;
|
|
465
|
+
this.hasStarted = true;
|
|
466
|
+
this.wireOnceHandlers();
|
|
467
|
+
if (this.imgEl.complete && this.imgEl.naturalWidth > 0) {
|
|
468
|
+
this.imgLoaded = true;
|
|
469
|
+
return;
|
|
400
470
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
471
|
+
this.currentSrc = this.src;
|
|
472
|
+
this.imgEl.src = this.src;
|
|
473
|
+
if (this.imgEl.complete && this.imgEl.naturalWidth > 0) {
|
|
474
|
+
this.imgLoaded = true;
|
|
404
475
|
}
|
|
405
476
|
}
|
|
477
|
+
get showSkeleton() {
|
|
478
|
+
return this.loading !== 'eager' && !this.imgLoaded;
|
|
479
|
+
}
|
|
480
|
+
renderEager() {
|
|
481
|
+
return (index.h(index.Host, { class: "HostContainer" }, index.h("img", { src: this.src, decoding: "async", style: this.styles, class: "UiContainer Visible", alt: this.alt, width: this.width, height: this.height, loading: "eager" })));
|
|
482
|
+
}
|
|
483
|
+
renderLazy() {
|
|
484
|
+
return (index.h(index.Host, { class: "HostContainer", "aria-busy": !this.imgLoaded ? 'true' : 'false' }, this.showSkeleton && (index.h("ui-skeleton", { class: "UiContainer", structure: "image", width: "100%", height: "100%" })), index.h("img", { ref: (el) => (this.imgEl = el), src: undefined, decoding: "async", style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
485
|
+
}
|
|
406
486
|
render() {
|
|
407
|
-
return
|
|
487
|
+
return this.loading === 'eager' ? this.renderEager() : this.renderLazy();
|
|
408
488
|
}
|
|
409
489
|
get el() { return index.getElement(this); }
|
|
410
490
|
static get watchers() { return {
|
|
411
|
-
"src": ["
|
|
491
|
+
"src": ["onSrcChange"],
|
|
492
|
+
"loading": ["onLoadingChange"]
|
|
412
493
|
}; }
|
|
413
494
|
};
|
|
414
495
|
UiImage.style = UiImageStyle0;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["casino-engagement-suite-progress-bar_8.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"
|
|
22
|
+
return index.bootstrapLazy([["casino-engagement-suite-progress-bar_8.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"loading":[1],"imgLoaded":[32]},null,{"src":["onSrcChange"],"loading":["onLoadingChange"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"tournament-timer",{"tournament":[16],"isDetail":[4,"is-detail"],"timeHolder":[32],"timeClock":[32],"lastTimeDiff":[32],"lastProgress":[32]},[[16,"tournamentTimer","containerPageChangeHandler"]]],[0,"tournament-item-title",{"tournament":[16],"language":[1],"isButtonDisabed":[32]},null,{"tournament":["onTournamentChanged"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["casino-engagement-suite-progress-bar_8.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"
|
|
11
|
+
return index.bootstrapLazy([["casino-engagement-suite-progress-bar_8.cjs",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"loading":[1],"imgLoaded":[32]},null,{"src":["onSrcChange"],"loading":["onLoadingChange"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"tournament-timer",{"tournament":[16],"isDetail":[4,"is-detail"],"timeHolder":[32],"timeClock":[32],"lastTimeDiff":[32],"lastProgress":[32]},[[16,"tournamentTimer","containerPageChangeHandler"]]],[0,"tournament-item-title",{"tournament":[16],"language":[1],"isButtonDisabed":[32]},null,{"tournament":["onTournamentChanged"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -353,59 +353,140 @@ const UiImageStyle0 = uiImageCss;
|
|
|
353
353
|
const UiImage = class {
|
|
354
354
|
constructor(hostRef) {
|
|
355
355
|
registerInstance(this, hostRef);
|
|
356
|
+
this.hasStarted = false;
|
|
356
357
|
this.src = undefined;
|
|
357
358
|
this.width = undefined;
|
|
358
359
|
this.height = undefined;
|
|
359
360
|
this.alt = undefined;
|
|
360
361
|
this.styles = undefined;
|
|
361
362
|
this.detectDistance = '200px';
|
|
363
|
+
this.loading = 'lazy';
|
|
362
364
|
this.imgLoaded = false;
|
|
363
|
-
this.shouldLoad = false;
|
|
364
365
|
}
|
|
365
|
-
|
|
366
|
-
if (
|
|
366
|
+
onSrcChange() {
|
|
367
|
+
if (this.loading === 'eager')
|
|
367
368
|
return;
|
|
369
|
+
this.imgLoaded = false;
|
|
370
|
+
this.hasStarted = false;
|
|
371
|
+
if (typeof window === 'undefined' || !('IntersectionObserver' in window)) {
|
|
372
|
+
this.beginLoad();
|
|
368
373
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
374
|
+
}
|
|
375
|
+
onLoadingChange(newVal, oldVal) {
|
|
376
|
+
if (newVal === oldVal)
|
|
377
|
+
return;
|
|
378
|
+
this.cleanupObserver();
|
|
379
|
+
this.detachImgHandlers();
|
|
380
|
+
if (newVal === 'eager') {
|
|
381
|
+
if (this.imgEl && this.src) {
|
|
382
|
+
this.imgEl.src = this.src;
|
|
375
383
|
}
|
|
376
|
-
|
|
377
|
-
|
|
384
|
+
this.hasStarted = true;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
this.imgLoaded = false;
|
|
388
|
+
this.hasStarted = false;
|
|
389
|
+
this.setupObserver();
|
|
390
|
+
}
|
|
378
391
|
}
|
|
379
392
|
componentDidLoad() {
|
|
380
|
-
if ('
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
if (this.loading === 'eager')
|
|
394
|
+
return;
|
|
395
|
+
this.setupObserver();
|
|
396
|
+
}
|
|
397
|
+
disconnectedCallback() {
|
|
398
|
+
this.cleanupObserver();
|
|
399
|
+
this.detachImgHandlers();
|
|
400
|
+
}
|
|
401
|
+
canUseIO() {
|
|
402
|
+
return typeof window !== 'undefined' && 'IntersectionObserver' in window;
|
|
403
|
+
}
|
|
404
|
+
setupObserver() {
|
|
405
|
+
if (this.loading === 'eager')
|
|
406
|
+
return;
|
|
407
|
+
if (!this.canUseIO()) {
|
|
408
|
+
this.beginLoad();
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
this.io = new IntersectionObserver((entries) => {
|
|
412
|
+
var _a;
|
|
413
|
+
for (const entry of entries) {
|
|
414
|
+
if (entry.isIntersecting) {
|
|
415
|
+
this.beginLoad();
|
|
416
|
+
(_a = this.io) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target);
|
|
417
|
+
this.cleanupObserver();
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
395
420
|
}
|
|
396
|
-
|
|
421
|
+
}, { root: null, rootMargin: this.detectDistance, threshold: 0 });
|
|
422
|
+
this.io.observe(this.el);
|
|
423
|
+
}
|
|
424
|
+
cleanupObserver() {
|
|
425
|
+
var _a;
|
|
426
|
+
(_a = this.io) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
427
|
+
this.io = undefined;
|
|
428
|
+
}
|
|
429
|
+
wireOnceHandlers() {
|
|
430
|
+
if (!this.imgEl)
|
|
431
|
+
return;
|
|
432
|
+
this.detachImgHandlers();
|
|
433
|
+
this._onLoad = () => {
|
|
434
|
+
var _a;
|
|
435
|
+
if (this.currentSrc && ((_a = this.imgEl) === null || _a === void 0 ? void 0 : _a.currentSrc) && !this.imgEl.currentSrc.includes(this.currentSrc))
|
|
436
|
+
return;
|
|
437
|
+
this.imgLoaded = true;
|
|
438
|
+
};
|
|
439
|
+
this._onError = () => {
|
|
440
|
+
console.error('Load image failed:', this.src);
|
|
441
|
+
};
|
|
442
|
+
this.imgEl.addEventListener('load', this._onLoad, { once: true });
|
|
443
|
+
this.imgEl.addEventListener('error', this._onError, { once: true });
|
|
444
|
+
}
|
|
445
|
+
detachImgHandlers() {
|
|
446
|
+
if (!this.imgEl)
|
|
447
|
+
return;
|
|
448
|
+
if (this._onLoad)
|
|
449
|
+
this.imgEl.removeEventListener('load', this._onLoad);
|
|
450
|
+
if (this._onError)
|
|
451
|
+
this.imgEl.removeEventListener('error', this._onError);
|
|
452
|
+
this._onLoad = undefined;
|
|
453
|
+
this._onError = undefined;
|
|
454
|
+
}
|
|
455
|
+
beginLoad() {
|
|
456
|
+
if (this.hasStarted)
|
|
457
|
+
return;
|
|
458
|
+
if (!this.imgEl)
|
|
459
|
+
return;
|
|
460
|
+
if (!this.src)
|
|
461
|
+
return;
|
|
462
|
+
this.hasStarted = true;
|
|
463
|
+
this.wireOnceHandlers();
|
|
464
|
+
if (this.imgEl.complete && this.imgEl.naturalWidth > 0) {
|
|
465
|
+
this.imgLoaded = true;
|
|
466
|
+
return;
|
|
397
467
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
468
|
+
this.currentSrc = this.src;
|
|
469
|
+
this.imgEl.src = this.src;
|
|
470
|
+
if (this.imgEl.complete && this.imgEl.naturalWidth > 0) {
|
|
471
|
+
this.imgLoaded = true;
|
|
401
472
|
}
|
|
402
473
|
}
|
|
474
|
+
get showSkeleton() {
|
|
475
|
+
return this.loading !== 'eager' && !this.imgLoaded;
|
|
476
|
+
}
|
|
477
|
+
renderEager() {
|
|
478
|
+
return (h(Host, { class: "HostContainer" }, h("img", { src: this.src, decoding: "async", style: this.styles, class: "UiContainer Visible", alt: this.alt, width: this.width, height: this.height, loading: "eager" })));
|
|
479
|
+
}
|
|
480
|
+
renderLazy() {
|
|
481
|
+
return (h(Host, { class: "HostContainer", "aria-busy": !this.imgLoaded ? 'true' : 'false' }, this.showSkeleton && (h("ui-skeleton", { class: "UiContainer", structure: "image", width: "100%", height: "100%" })), h("img", { ref: (el) => (this.imgEl = el), src: undefined, decoding: "async", style: this.styles, class: `UiContainer ${this.imgLoaded ? 'Visible' : 'Hidden'}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" })));
|
|
482
|
+
}
|
|
403
483
|
render() {
|
|
404
|
-
return
|
|
484
|
+
return this.loading === 'eager' ? this.renderEager() : this.renderLazy();
|
|
405
485
|
}
|
|
406
486
|
get el() { return getElement(this); }
|
|
407
487
|
static get watchers() { return {
|
|
408
|
-
"src": ["
|
|
488
|
+
"src": ["onSrcChange"],
|
|
489
|
+
"loading": ["onLoadingChange"]
|
|
409
490
|
}; }
|
|
410
491
|
};
|
|
411
492
|
UiImage.style = UiImageStyle0;
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["casino-engagement-suite-progress-bar_8",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"
|
|
19
|
+
return bootstrapLazy([["casino-engagement-suite-progress-bar_8",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"loading":[1],"imgLoaded":[32]},null,{"src":["onSrcChange"],"loading":["onLoadingChange"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"tournament-timer",{"tournament":[16],"isDetail":[4,"is-detail"],"timeHolder":[32],"timeClock":[32],"lastTimeDiff":[32],"lastProgress":[32]},[[16,"tournamentTimer","containerPageChangeHandler"]]],[0,"tournament-item-title",{"tournament":[16],"language":[1],"isButtonDisabed":[32]},null,{"tournament":["onTournamentChanged"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
20
20
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["casino-engagement-suite-progress-bar_8",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"
|
|
8
|
+
return bootstrapLazy([["casino-engagement-suite-progress-bar_8",[[1,"casino-engagement-suite-tournament",{"language":[1],"show":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"device":[1],"orientation":[1],"leaderboardsInit":[16],"tipsHideDelay":[514,"tips-hide-delay"],"tab":[32],"locale":[32],"tournamentItem":[32],"tournamentList":[32],"leaderboards":[32],"isDialogOpen":[32],"isShowInfo":[32],"page":[32],"tournamentInDialog":[32],"dialog":[32],"newIdList":[32]},[[8,"message","handleEvent"],[16,"clickToTournamentDetail","handleClickToTournamentDetail"],[16,"joinTournamentEvent","handleJoinTournamentEvent"],[16,"unjoinTournamentConfirmEvent","handleUnjoinTournamentEvent"],[10,"click","handleClickOutside"]],{"newIdList":["watchPropHandler"],"language":["watchPropHandler"],"tournamentList":["syncBarState"],"show":["showPropWatcher"]}],[0,"tournament-item",{"tournament":[16],"isNew":[4,"is-new"],"tid":[1],"language":[1]},[[16,"pendingChangeEvent","onTournamentUpdateEvent"]]],[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"loading":[1],"imgLoaded":[32]},null,{"src":["onSrcChange"],"loading":["onLoadingChange"]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[0,"tournament-timer",{"tournament":[16],"isDetail":[4,"is-detail"],"timeHolder":[32],"timeClock":[32],"lastTimeDiff":[32],"lastProgress":[32]},[[16,"tournamentTimer","containerPageChangeHandler"]]],[0,"tournament-item-title",{"tournament":[16],"language":[1],"isButtonDisabed":[32]},null,{"tournament":["onTournamentChanged"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}],[1,"casino-engagement-suite-progress-bar",{"value":[2],"disabled":[4],"hidePercent":[4,"hide-percent"],"indeterminate":[4],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"limitStylingAppends":[32]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|