import{h}from"@stencil/core";export class PrestoCTAOverlay{componentWillLoad(){this.player&&(this.player.on("ended",()=>this.setEnded()),this.player.on("timeupdate",e=>this.setCurrentTime(e)))}setEnded(){this.ended=!0}setCurrentTime(e){var t,r;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var e;return h("presto-cta-overlay-controller",{key:"8ee64dc818a0256e6674c9c2b0f33916374c89fa",ended:this.ended,currentTime:this.currentTime,duration:this.duration,direction:this.direction,cta:null===(e=this.preset)||void 0===e?void 0:e.cta,i18n:this.i18n,provider:this.provider})}static get is(){return"presto-cta-overlay"}static get originalStyleUrls(){return{$:["presto-cta-overlay.css"]}}static get styleUrls(){return{$:["presto-cta-overlay.css"]}}static get properties(){return{player:{type:"any",attribute:"player",mutable:!1,complexType:{original:"any",resolved:"any",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},direction:{type:"string",attribute:"direction",mutable:!1,complexType:{original:"'rtl'",resolved:'"rtl"',references:{}},required:!1,optional:!0,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},preset:{type:"unknown",attribute:"preset",mutable:!1,complexType:{original:"presetAttributes",resolved:"presetAttributes",references:{presetAttributes:{location:"import",path:"../../../../../interfaces",id:"src/interfaces.ts::presetAttributes"}}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1},i18n:{type:"unknown",attribute:"i-1-8n",mutable:!1,complexType:{original:"i18nConfig",resolved:"i18nConfig",references:{i18nConfig:{location:"import",path:"../../../../../interfaces",id:"src/interfaces.ts::i18nConfig"}}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1},provider:{type:"string",attribute:"provider",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1}}}static get states(){return{currentTime:{},duration:{},ended:{}}}}