1class LiteYTEmbed extends HTMLElement{connectedCallback(){this.videoId=this.getAttribute("videoid");let playBtnEl=this.querySelector(".lty-playbtn");if(this.playLabel=playBtnEl&&playBtnEl.textContent.trim()||this.getAttribute("playlabel")||"Play",this.style.backgroundImage||(this.style.backgroundImage=`url("https://i.ytimg.com/vi/${this.videoId}/maxresdefault.jpg")`),playBtnEl||(playBtnEl=document.createElement("button"),playBtnEl.type="button",playBtnEl.classList.add("lty-playbtn"),this.append(playBtnEl)),!playBtnEl.textContent){const playBtnLabelEl=document.createElement("span");playBtnLabelEl.className="lyt-visually-hidden",playBtnLabelEl.textContent=this.playLabel,playBtnEl.append(playBtnLabelEl)}playBtnEl.removeAttribute("href"),this.addEventListener("pointerover",LiteYTEmbed.warmConnections,{once:!0}),this.addEventListener("click",this.addIframe),this.needsYTApiForAutoplay=navigator.vendor.includes("Apple")||navigator.userAgent.includes("Mobi")}static addPrefetch(kind,url,as){const linkEl=document.createElement("link");linkEl.rel=kind,linkEl.href=url,as&&(linkEl.as=as),document.head.append(linkEl)}static warmConnections(){LiteYTEmbed.preconnected||(LiteYTEmbed.addPrefetch("preconnect","https://www.youtube-nocookie.com"),LiteYTEmbed.addPrefetch("preconnect","https://www.google.com"),LiteYTEmbed.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),LiteYTEmbed.addPrefetch("preconnect","https://static.doubleclick.net"),LiteYTEmbed.preconnected=!0)}fetchYTPlayerApi(){window.YT||window.YT&&window.YT.Player||(this.ytApiPromise=new Promise((res,rej)=>{var el=document.createElement("script");el.src="https://www.youtube.com/iframe_api",el.async=!0,el.onload=_=>{YT.ready(res)},el.onerror=rej,this.append(el)}))}async addYTPlayerIframe(params){this.fetchYTPlayerApi(),await this.ytApiPromise;const videoPlaceholderEl=document.createElement("div");this.append(videoPlaceholderEl);const paramsObj=Object.fromEntries(params.entries());new YT.Player(videoPlaceholderEl,{width:"100%",videoId:this.videoId,playerVars:paramsObj,events:{onReady:event=>{event.target.playVideo()}}})}async addIframe(){if(this.classList.contains("lyt-activated"))return;this.classList.add("lyt-activated");const params=new URLSearchParams(this.getAttribute("params")||[]);if(params.append("autoplay","1"),params.append("playsinline","1"),this.needsYTApiForAutoplay)return this.addYTPlayerIframe(params);const iframeEl=document.createElement("iframe");iframeEl.width=560,iframeEl.height=315,iframeEl.title=this.playLabel,iframeEl.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",iframeEl.allowFullscreen=!0,iframeEl.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${params.toString()}`,this.append(iframeEl),iframeEl.focus()}}customElements.define("lite-youtube",LiteYTEmbed); 2//# sourceMappingURL=/cdn/shop/t/334/assets/lite-yt-embed.js.map?v=135008103053494374171790871676
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.