1import{d as k,r as s,aw as g,s as V,w as P,_ as $,o as d,e as u,j as l,h as p}from"./nWjHe5r5.js";import{_ as L}from"./CrtUrIAb.js";const R=k({name:"YouTubeElement",props:{link:{type:String,required:!0},poster:{type:Object,required:!1,default:()=>({id:null})}},setup(e){const o=s(!0),i=s(!1),r=s(null),a=s(null),n=s(!1),t=g(),{youtubeAccepted:w}=V(t),f=()=>{o.value=!1,i.value=!0,r.value.addEventListener("load",()=>{r.value.contentWindow.document.body.click()})},b=(c=>{const v=/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.{11})/i,m=c.match(v);return m?m[1]:null})(e.link),y=s(`https://www.youtube.com/embed/${b}`);function h(){if(w.value===!1&&n.value===!1&&a.value!==null&&window&&window.lwAddPlaceholderWithCallbackToNode)try{n.value=!0,window.lwAddPlaceholderWithCallbackToNode(a.value,"embeddings_youtube",()=>{t.setYoutube(!0)})}catch(c){console.error("error with lwAddPlaceholderWithCallbackToNode",c)}}return P(a,()=>{h()},{immediate:!0,flush:"post"}),h(),{legalWebPlaceholderRef:a,youtubeAccepted:w,embedLink:y,showPoster:o,showVideo:i,player:r,playVideo:f}}}),C={ref:"legalWebPlaceholderRef"},A=["src"],T=["data-src"],U=["data-src"],W=["data-src"],Y=["data-src"],N=["src"];function B(e,o,i,r,a,n){return d(),u("div",{class:"relative overflow-hidden w-full m-auto aspect-video cursor-pointer youtube-video",onClick:o[2]||(o[2]=(...t)=>e.playVideo&&e.playVideo(...t))},[l("div",C,null,512),e.youtubeAccepted&&(e.showVideo||!e.poster||!e.poster.id)?(d(),u("iframe",{key:0,ref:"player",loading:"lazy",class:"w-full m-auto aspect-video",type:"text/html",src:e.embedLink,frameborder:"0",allowfullscreen:"",title:"YouTube Video"},null,8,A)):p("",!0),e.youtubeAccepted&&e.poster&&e.showPoster?(d(),u("picture",{key:1,class:"absolute top-0 left-0",onClick:o[0]||(o[0]=(...t)=>e.playVideo&&e.playVideo(...t))},[l("source",{"data-src":e.$assetURL({file:e.poster,width:768}),media:"(max-width: 767px)"},null,8,T),l("source",{"data-src":e.$assetURL({file:e.poster,width:991}),media:"(min-width: 768px) and (max-width: 991px)"},null,8,U),l("source",{"data-src":e.$assetURL({file:e.poster,width:1301}),media:"(min-width: 992px) and (max-width: 1301px)"},null,8,W),l("source",{"data-src":e.$assetURL({file:e.poster,width:1920}),media:"(min-width: 1302px)"},null,8,Y),l("img",{loading:"lazy",src:e.$assetURL({file:e.poster,width:1301}),alt:""},null,8,N)])):p("",!0),e.showPoster&&e.poster&&e.poster.id?(d(),u("img",{key:2,loading:"lazy",class:"absolute play-button w-25 aspect-square",src:L,alt:"Play Button",onClick:o[1]||(o[1]=(...t)=>e.playVideo&&e.playVideo(...t))})):p("",!0)])}const E=$(R,[["render",B]]);export{E as default};
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.