PageSourceSearch

https://www.yorkshirewildlifepark.com/assets/media-gallery-r_Qedoag.js

js yorkshirewildlifepark.com collected 2026-09-24 19:02:34 UTC 5,634 bytes, 1 lines download raw bytes

1import{P as m}from"./photoswipe-DMiYfRFl.js";let h=null,n=!1,d=null,r=!1;const u=()=>{typeof YT>"u"&&!r&&(r=!0,d=document.createElement("script"),d.type="text/javascript",d.src="https://www.youtube.com/iframe_api",d.async=!0,document.head.appendChild(d))},g=()=>{n=!0,h=document.createElement("script"),h.type="text/javascript",h.src="https://player.vimeo.com/api/player.js",h.async=!0,document.head.appendChild(h)};class p{constructor(e){this.el=e,this.imageSizesOkay=!0,this.lightbox=null,this.activeIndex=0,this.main=e.querySelector(".media-gallery--main-image"),this.mainImg=e.querySelector(".media-gallery--main-image figure img"),this.mainImgFigCaption=e.querySelector(".media-gallery--main-image figure figcaption"),this.videos=[],this.videoIndex=-1,this.items=[];let i=e.querySelectorAll("ul li a");this.loop=i.length>1,i!=null&&[...i].forEach((t,a)=>{if(t.hasAttribute("data-pswp-video-id")){let o=t.dataset.pswpVideoId;this.items[a]={isVideo:!0,videoReady:!1,el:t,img:t.querySelector("img"),alt:t.querySelector("figcaption").innerText,figCaptionHTML:t.querySelector("figcaption").innerHTML},t.classList.contains("youtube")?(r||u(),this.items[a].videoType="youtube",this.items[a].iframeId=`youtube-${o}`,this.items[a].html=`<div class="pswp-video-wrapper"><div class="ratio ${t.classList.contains("portrait")?"ratio-9x16":"ratio-16x9"}"><iframe id="youtube-${o}" width="560" height="400" src="https://www.youtube.com/embed/${o}?enablejsapi=1&rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div></div>`):(n||g(),this.items[a].videoType="vimeo",this.items[a].iframeId=`vimeo-${o}`,this.items[a].html=`<div class="pswp-video-wrapper"><div class="ratio ${t.classList.contains("portrait")?"ratio-9x16":"ratio-16x9"}"><iframe id="vimeo-${o}" width="560" height="400" src="https://player.vimeo.com/video/${o}" title="Vimeo video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div></div>`),this.imageSizesOkay=!0}else{let o=t.dataset.pswpWidth,c=t.dataset.pswpHeight;this.items[a]={isVideo:!1,el:t,src:t.getAttribute("href"),width:parseFloat(o)>0?parseFloat(o):0,height:parseFloat(c)>0?parseFloat(c):0,img:t.querySelector("img"),alt:t.querySelector("figcaption").innerText,figCaptionHTML:t.querySelector("figcaption").innerHTML},this.imageSizesOkay=this.items[a].width>0&&this.items[a].height>0}}),this.main.onclick=t=>{t.stopPropagation(),t.preventDefault(),this.imageSizesOkay?this.createLightbox(this.activeIndex):this.getImageDimensions(this.activeIndex)};for(var s=0;s<this.items.length;s++){let t=s;this.items[s].el.onclick=a=>{a.stopPropagation(),a.preventDefault(),this.setActiveThumbnail(t)}}this.items[this.activeIndex].el.classList.add("active")}getImageDimensions(e){this.items[e].isVideo||(this.items[e].width==0||this.items[e].height==0?(this.items[e].image=new Image,this.items[e].image.onload=()=>{this.imageLoaded(e,!0)},this.items[e].image.src=this.items[e].src):this.createLightbox(e));for(var i=0;i<this.items.length;i++)if(i!==e&&!this.items[i].isVideo&&(this.items[i].width==0||this.items[i].height==0)){let s=i;this.items[i].image=new Image,this.items[i].image.onload=()=>{this.imageLoaded(s,!1)},this.items[i].image.src=this.items[i].src}}imageLoaded(e,i){let s=this.items[e].image.width,t=this.items[e].image.height;this.items[e].width=s,this.items[e].height=t,i?this.createLightbox():(this.lightbox.options.dataSource[e].width=s,this.lightbox.options.dataSource[e].height=t,this.lightbox.refreshSlideContent(e))}createLightbox(){let e=this;this.lightbox=new m({dataSource:this.items,loop:this.loop,index:this.activeIndex}),this.lightbox.on("openingAnimationEnd",()=>{window.requestAnimationFrame(()=>{this.videos=[],this.videoIndex=-1,this.items.forEach((i,s)=>{i.isVideo&&this.videos[s]==null&&(i.videoType=="youtube"?this.videos[s]=new YT.Player(i.iframeId,{events:{onReady:()=>{i.videoReady=!0,this.lightbox.currSlide.index==s&&(this.videos[s].playVideo(),this.videoIndex=s)}}}):(this.videos[s]=new Vimeo.Player(document.getElementById(i.iframeId)),i.videoReady=!0,this.lightbox.currSlide.index==s&&(this.videos[s].play(),this.videoIndex=s)))})})}),this.lightbox.on("change",()=>
1{if(this.setActiveThumbnail(this.lightbox.currSlide.index),this.videoIndex>-1&&this.videos[this.videoIndex]!=null){let s=this.videos[this.videoIndex];this.items[this.videoIndex].videoType=="youtube"?s.pauseVideo():s.getPaused().then(function(t){t||s.pause()}),this.videoIndex=-1}let i=this.lightbox.currSlide.index;this.items[i].isVideo&&this.videos[i]!=null&&(this.items[i].videoType=="youtube"?this.items[i].videoReady?this.videos[i].playVideo():this.videos[i]=new YT.Player(this.items[i].iframeId,{events:{onReady:()=>{this.items[i].videoReady=!0,this.lightbox.currSlide.index==i&&(this.videos[i].playVideo(),this.videoIndex=i)}}}):this.videos[i].getPaused().then(function(s){s&&e.videos[i].play()}),this.videoIndex=i)}),this.lightbox.init()}setActiveThumbnail(e){this.items[this.activeIndex].el.classList.remove("active"),this.items[e].el.classList.add("active"),this.mainImg.setAttribute("src",this.items[e].img.dataset.src),this.mainImg.setAttribute("srcset",this.items[e].img.dataset.srcset),this.mainImg.setAttribute("alt",this.items[e].img.getAttribute("alt")),this.mainImgFigCaption.innerHTML=this.items[e].figCaptionHTML,this.main.classList.toggle("video",this.items[e].isVideo),this.activeIndex=e}}function f(l){l.forEach(e=>{e.nodeType===1&&new p(e)})}export{f as createFrom};

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.