if("undefined"==typeof LiteYTEmbed){class e extends HTMLElement{static get observedAttributes(){return["class"]}connectedCallback(){void 0!==window.youtubePreviewImageObserver&&window.youtubePreviewImageObserver.observe(this)}attributeChangedCallback(t,i,a){if(-1===a.indexOf("lty-load"))return;this.videoId=this.getAttribute("videoid");let n=this.querySelector(".lty-playbtn");if(this.playLabel=n&&n.textContent.trim()||this.getAttribute("playlabel")||"Play",!this.style.backgroundImage){let e=this.getAttribute("width"),t=this.getAttribute("data-thumbnail-size")+".jpg";"auto.jpg"===t&&(t=640{var i=document.createElement("script");i.src="https://www.youtube.com/iframe_api",i.async=!0,i.onload=t=>{YT.ready(e)},i.onerror=t,this.append(i)}))}async addYTPlayerIframe(e){this.fetchYTPlayerApi(),await this.ytApiPromise;const t=document.createElement("div");this.append(t);const i=Object.fromEntries(e.entries());new YT.Player(t,{width:"100%",videoId:this.videoId,playerVars:i,events:{onReady:e=>{e.target.playVideo()}}})}async addIframe(){if(this.classList.contains("lyt-activated"))return;this.classList.add("lyt-activated");const e=new URLSearchParams(this.getAttribute("params")||[]);if(e.append("autoplay","1"),e.append("playsinline","1"),this.needsYTApiForAutoplay)return this.addYTPlayerIframe(e);let t="https://www.youtube-nocookie.com/embed/";void 0!==this.dataset.noCookie&&"off"===this.dataset.noCookie&&(t="https://www.youtube.com/embed/");const i=document.createElement("iframe");i.width=560,i.height=315,i.title=this.playLabel,i.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",i.allowFullscreen=!0,i.src=`${t}${encodeURIComponent(this.videoId)}?${e.toString()}`,this.append(i),i.focus()}}if("IntersectionObserver"in window){const e={root:null,rootMargin:"0px",threshold:0};window.youtubePreviewImageObserver=new IntersectionObserver((function(e){jQuery.each(e,(function(e,t){t.isIntersecting&&(t.target.classList.add("lty-load"),window.youtubePreviewImageObserver.unobserve(t.target))}))}),e)}else jQuery("lite-youtube").addClass("lty-load");void 0===customElements.get("lite-youtube")&&customElements.define("lite-youtube",e)}