https://cieleathletics.com/cdn/shop/t/130/assets/background-video.js?v=94463821086259040741788332014
1import{g as getMediaQuery}from"./media-queries-5a9283a8.js";import{a as atBreakpointChange}from"./at-breakpoint-change-929474bb.js";import{i as intersectionWatcher}from"./intersection-watcher-50753dc4.js";import"./srraf.es-487187f3.js";const prefersReducedMotion=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;class BackgroundVideo extends HTMLElement{connectedCallback(){const videoTemplate=this.querySelector("[js-background-video-template]"),hasVideo=this.dataset.hasVideo==="true",hasMobileVideo=this.dataset.hasMobileVideo==="true";if(hasVideo&&!hasMobileVideo)this.#setVideoTemplate(videoTemplate,this);else if(hasVideo&hasMobileVideo){const videoMobileTemplate=this.querySelector("[js-mobile-background-video-template]");this.#initResponsiveVideoTemplate(this,videoTemplate,videoMobileTemplate)}}disconnectedCallback(){this.removeEventListener("toggle",this.handleToggle,!0)}#initResponsiveVideoTemplate(container,videoTemplate,videoMobileTemplate){const setTemplateByWidth=()=>{window.matchMedia(getMediaQuery("tablet")).matches?this.#setVideoTemplate(videoTemplate,container):this.#setVideoTemplate(videoMobileTemplate,container)};setTemplateByWidth(),atBreakpointChange(720,setTemplateByWidth)}#setVideoTemplate(videoTemplate,container){const pauseBtn=container.querySelector("[js-vi
1deo-pause-button]"),currentVideoContainer=container.querySelector("[js-current-background-video-container]"),currentVideoTemplate=videoTemplate.content.cloneNode(!0),currentVideoEl=currentVideoTemplate.querySelector("[data-background-video]");currentVideoEl&&(currentVideoEl.muted=!0),currentVideoContainer.innerHTML="",currentVideoContainer.appendChild(currentVideoTemplate);const videoWatcherCallback=visible=>this.#visibleVideoWatcher(currentVideoEl,pauseBtn,visible);this.#setPlayPause(currentVideoEl,pauseBtn,"pause"),this.#videoA11yHandler(currentVideoEl,pauseBtn),intersectionWatcher(currentVideoEl,{callback:videoWatcherCallback})}#videoA11yHandler(video,pauseBtn){!pauseBtn||!video||pauseBtn.addEventListener("click",e=>{e.preventDefault(),video.paused?(this.#setPlayPause(video,pauseBtn,"play"),video.dataset.a11yPriorityPause=!1):(this.#setPlayPause(video,pauseBtn,"pause"),video.dataset.a11yPriorityPause=!0)})}#visibleVideoWatcher(video,pauseBtn,visible){prefersReducedMotion()||(visible&&video.paused&&(video.dataset.videoLoaded==="false"&&(video.classList.add("background-video__video--fade-in"),video.dataset.videoLoaded="true"),video.dataset.a11yPriorityPause==="false"&&this.#setPlayPause(video,pauseBtn,"play")),!visible&&!video.paused&&this.#setPlayPause(video,pauseBtn,"pause"))}#setPlayPause(video,pauseBtn,state){const{strings:{accessibility:strings},icons}=window.theme;state==="pause"?(video.pause(),pauseBtn.dataset.pauseButtonContent==="icon"?pauseBtn.innerHTML=icons.play:pauseBtn.innerText=strings.playVideo):(video.play(),pauseBtn.dataset.pauseButtonContent==="icon"?pauseBtn.innerHTML=icons.pause:pauseBtn.innerText=strings.pauseVideo)}}customElements.get("background-video")||customElements.define("background-video",BackgroundVideo); 2//# sourceMappingURL=/cdn/shop/t/130/assets/background-video.js.map?v=94463821086259040741788332014
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.