"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-1d07a497.js"),fittext=require("./fittext-4b7a2bcb.js"),prestoDynamicOverlayUiCss=":host{display:block}.overlay-text{text-decoration:none;display:inline-block;user-select:none;line-height:1;opacity:var(--presto-dynamic-overlay-opacity, 1);font-size:var(--presto-dynamic-overlay-font-size, 18px);padding:var(--presto-dynamic-overlay-padding, 0.65em 0.85em);font-weight:var(--presto-dynamic-overlay-font-weight, 500);border-radius:var(--presto-dynamic-overlay-radius, 0.25em);background:var(--presto-dynamic-overlay-background, rgba(0, 0, 0, 0.8));color:var(--presto-dynamic-overlay-color, #fff);opacity:var(--presto-dynamic-overlay-opacity, 1);word-break:break-word}a.overlay-text{cursor:pointer}",PrestoDynamicOverlayUi=class{constructor(e){index.registerInstance(this,e),this.href=void 0,this.target=void 0,this.position="top-right"}closestElement(e,t){return t&&t!=document&&t!=window&&t.closest(e)||t&&this.closestElement(e,t.getRootNode().host)}componentDidLoad(){let e=this.closestElement("presto-player",this.el);fittext.fitText(this.text,3,{maxFontSize:16,minFontSize:10,container:e})}render(){const e=this.href?"a":"span";return index.h(e,{class:{"overlay-text":!0,"overlay--top-left":"top-left"===this.position,"overlay--top-right":"top-right"===this.position},href:this.href,target:this.target,part:"overlay-text",ref:e=>this.text=e},index.h("slot",null))}get el(){return index.getElement(this)}};PrestoDynamicOverlayUi.style=prestoDynamicOverlayUiCss,exports.presto_dynamic_overlay_ui=PrestoDynamicOverlayUi;