import{h}from"@stencil/core";export class PrestoEmailOverlay{constructor(){this.player=void 0,this.direction=void 0,this.preset=void 0,this.videoId=void 0,this.i18n=void 0,this.provider=void 0,this.currentTime=void 0,this.duration=void 0,this.ended=void 0}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,i;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var e,t;return h("presto-email-overlay-controller",{ended:this.ended,currentTime:this.currentTime,videoId:this.videoId,duration:this.duration,direction:this.direction,presetId:null===(e=this.preset)||void 0===e?void 0:e.id,emailCollection:null===(t=this.preset)||void 0===t?void 0:t.email_collection,i18n:this.i18n,provider:this.provider})}static get is(){return"presto-email-overlay"}static get originalStyleUrls(){return{$:["presto-email-overlay.css"]}}static get styleUrls(){return{$:["presto-email-overlay.css"]}}static get properties(){return{player:{type:"any",mutable:!1,complexType:{original:"any",resolved:"any",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"player",reflect:!1},direction:{type:"string",mutable:!1,complexType:{original:"'rtl'",resolved:'"rtl"',references:{}},required:!1,optional:!0,docs:{tags:[],text:""},attribute:"direction",reflect:!1},preset:{type:"unknown",mutable:!1,complexType:{original:"presetAttributes",resolved:"presetAttributes",references:{presetAttributes:{location:"import",path:"../../../../../interfaces"}}},required:!1,optional:!1,docs:{tags:[],text:""}},videoId:{type:"number",mutable:!1,complexType:{original:"number",resolved:"number",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"video-id",reflect:!1},i18n:{type:"unknown",mutable:!1,complexType:{original:"i18nConfig",resolved:"i18nConfig",references:{i18nConfig:{location:"import",path:"../../../../../interfaces"}}},required:!1,optional:!1,docs:{tags:[],text:""}},provider:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"provider",reflect:!1}}}static get states(){return{currentTime:{},duration:{},ended:{}}}}