import{r as registerInstance,c as createEvent,h}from"./index-2bbac65f.js";import{f as fitText}from"./fittext-97aa564e.js";const prestoCtaOverlayUiCss=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999;user-select:none}*{box-sizing:border-box}a{color:#fff}.wrapper{height:100%;position:relative;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif)}.overlay{position:relative;display:flex;align-items:center;justify-content:center;padding:48px;height:100%}.overlay.has-link{cursor:pointer}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-cta-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-cta-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.content{width:80%;max-width:600px}.content *~*{margin-top:22px}button{background:var(--plyr-color-main, #000);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;color:#fff;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-cta-border-radius, 0) var(--presto-player-cta-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:white 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}h1{font-size:1.5em;font-weight:500;margin:0;line-height:1.1em}.skip,.rewatch{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}.rewatch{display:inline-flex;align-items:center;right:auto;left:0}.rewatch .icon{margin-right:5px}p{font-size:0.85em;margin:0;margin-top:1.5em;line-height:1.4em;opacity:0.75}p.is-small{font-size:0.85em;margin:1.5em 0px 0px;line-height:0.1em;opacity:0.75}.is-centered{text-align:center}',CTAOverlayUI=class{constructor(t){registerInstance(this,t),this.skip=createEvent(this,"skip",7),this.rewatch=createEvent(this,"rewatch",7),this.headline=void 0,this.defaultHeadline=void 0,this.bottomText=void 0,this.showButton=void 0,this.buttonText=void 0,this.buttonType=void 0,this.buttonLink=void 0,this.allowRewatch=void 0,this.allowSkip=void 0,this.direction=void 0,this.i18n=void 0,this.provider=void 0,this.type=void 0,this.isAudioProvider=void 0}componentDidLoad(){let t=this.type||this.provider;this.isAudioProvider="audio"===t,fitText(this.textInput,3,{maxFontSize:!0===this.isAudioProvider?15:20,minFontSize:8})}handleCTAClick(t){var i;(null===(i=this.buttonLink)||void 0===i?void 0:i.url)&&(t.preventDefault(),t.stopPropagation(),this.handleLink())}handleLink(){var t,i,e;(null===(t=this.buttonLink)||void 0===t?void 0:t.opensInNewTab)?window.open(null===(i=this.buttonLink)||void 0===i?void 0:i.url,"_blank"):window.location.href=null===(e=this.buttonLink)||void 0===e?void 0:e.url}render(){var t,i,e,o,n;return h("div",{class:"wrapper",ref:t=>this.textInput=t},h("div",{onClick:t=>this.handleCTAClick(t),class:`overlay ${"rtl"===this.direction?"rtl":""} ${(null===(t=this.buttonLink)||void 0===t?void 0:t.url)?"has-link":""}`},h("div",{class:this.isAudioProvider?"content is-centered":"content"},h("h1",{part:"cta-headline"},this.headline||this.defaultHeadline),this.bottomText&&h("p",{class:this.isAudioProvider&&"is-small",part:"cta-bottom-text",innerHTML:this.bottomText}),this.showButton&&h("presto-player-button",{full:!0,onClick:t=>this.handleCTAClick(t),part:"cta-button",href:null===(i=null==this?void 0:this.buttonLink)||void 0===i?void 0:i.url,target:(null===(e=null==this?void 0:this.buttonLink)||void 0===e?void 0:e.opensInNewTab)?"_blank":"_self",class:"button",type:"primary"},this.buttonText))),!!this.allowRewatch&&h("div",{class:"rewatch",onClick:t=>{t.preventDefault(),t.stopImmediatePropagation(),this.rewatch.emit()}},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-corner-up-left"},h("polyline",{points:"9 14 4 9 9 4"}),h("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})),null===(o=null==this?void 0:this.i18n)||void 0===o?void 0:o.rewatch),!!this.allowSkip&&h("div",{class:"skip",onClick:t=>{t.preventDefault(),this.skip.emit()}},null===(n=null==this?void 0:this.i18n)||void 0===n?void 0:n.skip," →"))}};CTAOverlayUI.style=prestoCtaOverlayUiCss;export{CTAOverlayUI as presto_cta_overlay_ui};