PageSourceSearch

https://dz.diesel.com/on/demandware.static/Sites-DieselWW-Site/-/e…/js/component-PDVideoComponent.chunks.js

js diesel.com collected 2026-09-24 08:42:53 UTC 2,957 bytes, 1 lines download raw bytes

1(self.webpackChunkapp_project=self.webpackChunkapp_project||[]).push([[6247],{83507:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>l});var i=s(12737),a=s(38302);const o=s(11253).Z;class l extends a.default{constructor(e){super(e),this.videos=[...this.element.querySelectorAll(".pd-video")],this.videos.length&&(this.mobileVideo=this.element.querySelector(".js-pd-video-mobile"),this.desktopVideo=this.element.querySelector(".js-pd-video-desktop"),this.playPauseButton=this.element.querySelector(".js-pd-video-playpause"),this.activeVideo=null,this.playPauseButton&&(this.playLabel=this.playPauseButton.dataset.playLabel||"Play",this.pauseLabel=this.playPauseButton.dataset.pauseLabel||"Pause"),this.reflectPlayState=this.reflectPlayState.bind(this),this.onBreakpointChange=this.onBreakpointChange.bind(this),this.onPlayPauseClick=this.onPlayPauseClick.bind(this),this.init())}init(){this.observer=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.autoplay(e.target)}))}),{threshold:.25}),this.videos.forEach((e=>{e.addEventListener("play",this.reflectPlayState),e.addEventListener("pause",this.reflectPlayState)})),this.playPauseButton&&this.playPauseButton.addEventListener("click",this.onPlayPauseClick),this.activateVisibleVideo(),i.Z.on("breakpoint:change",this.onBreakpointChange)}activateVisibleVideo(){const e=this.getVisibleVideo();e&&e!==this.activeVideo&&(this.activeVideo&&(this.observer.unobserve(this.activeVideo),this.activeVideo.pause()),this.activeVideo=e,this.loadVideo(e),this.observer.observe(e),this.reflectPlayState())}getVisibleVideo(){return this.mobileVideo?this.desktopVideo&&o.atLeast("large")?this.desktopVideo:this.mobileVideo:this.desktopVideo}loadVideo(e){const t=e.querySelector("source[data-src]");t&&(t.setAttribute("src",t.dataset.src),t.removeAttribute("data-src"),e.load())}autoplay(e){e===this.activeVideo&&e.classList.contains("pd-video--autoplay")&&(e.classList.contains("pd-video--has-autoplayed")||window.matchMedia("(prefers-reduced-motion: reduce)").matches||(e.classList.add("pd-video--has-autoplayed"),this.play(e,(()=>e.classList.remove("pd-video--has-autoplayed")))))}play(e,t){const s=e.play();s&&"function"==typeof s.catch&&s.catch((()=>{t&&t()}))}onBreakpointChange(){this.activateVisibleVideo()}onPlayPauseClick(){const e=this.activeVideo;e&&(e.paused?this.play(e):e.pause())}reflectPlayState(){if(!this.playPauseButton)return;const e=!!this.activeVideo&&!this.activeVideo.paused;this.playPauseButton.classList.toggle("is-playing",e),this.playPauseButton.setAttribute("aria-label",e?this.pauseLabel:this.playLabel)}destroy(){this.observer?(this.observer.disconnect(),i.Z.off("breakpoint:change",this.onBreakpointChange),this.videos.forEach((e=>{e.removeEventListener("play",this.reflectPlayState),e.removeEventListener("pause",this.reflectPlayState)})),this.playPauseButton&&this.playPauseButton.removeEventListener("click",this.onPlayPauseClick),super.destroy()):super.destroy()}}}}]);

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.