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E,IAAI,CAAC,MAAM,EACnB,IAAI,EAAC,cAAc,EACnB,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,GAAG,EAAuB,CAAC,EAAA,EAEhD,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACJ;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"sources":["src/components/core/features/presto-dynamic-overlays/ui/presto-dynamic-overlay-ui.scss?tag=presto-dynamic-overlay-ui&encapsulation=shadow","src/components/core/features/presto-dynamic-overlays/ui/presto-dynamic-overlay-ui.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.overlay-text {\n text-decoration: none;\n display: inline-block;\n user-select: none;\n line-height: 1;\n opacity: var(--presto-dynamic-overlay-opacity, 1);\n font-size: var(--presto-dynamic-overlay-font-size, 18px);\n padding: var(--presto-dynamic-overlay-padding, 0.65em 0.85em);\n font-weight: var(--presto-dynamic-overlay-font-weight, 500);\n border-radius: var(--presto-dynamic-overlay-radius, 0.25em);\n background: var(--presto-dynamic-overlay-background, rgba(0, 0, 0, 0.8));\n color: var(--presto-dynamic-overlay-color, #fff);\n opacity: var(--presto-dynamic-overlay-opacity, 1);\n word-break: break-word;\n}\n\na.overlay-text {\n cursor: pointer;\n}\n","import { Component, Element, h, Prop } from '@stencil/core';\nimport fitText from '../../../../../library/fittext.js';\n\n@Component({\n tag: 'presto-dynamic-overlay-ui',\n styleUrl: 'presto-dynamic-overlay-ui.scss',\n shadow: true,\n})\nexport class PrestoDynamicOverlayUi {\n @Element() el: HTMLElement;\n\n private text: HTMLAnchorElement;\n\n /** When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */\n @Prop() href: string;\n\n /** Tells the browser where to open the link. Only used when `href` is set. */\n @Prop() target: '_blank' | '_parent' | '_self' | '_top';\n\n @Prop() position: 'top-left' | 'top-right' = 'top-right';\n\n closestElement(selector, el) {\n return (el && el != document && el != window && el.closest(selector)) || (el && this.closestElement(selector, el.getRootNode().host));\n }\n\n componentDidLoad() {\n let player = this.closestElement('presto-player', this.el) as HTMLPrestoPlayerElement;\n fitText(this.text, 3, {\n maxFontSize: 16,\n minFontSize: 10,\n container: player,\n });\n }\n\n render() {\n const Tag = this.href ? 'a' : ('span' as keyof JSX.IntrinsicElements);\n return (\n <Tag\n class={{\n 'overlay-text': true,\n 'overlay--top-left': this.position === 'top-left',\n 'overlay--top-right': this.position === 'top-right',\n }}\n href={this.href}\n target={this.target}\n part=\"overlay-text\"\n ref={el => (this.text = el as HTMLAnchorElement)}\n >\n <slot />\n </Tag>\n );\n }\n}\n"],"version":3}