1import{_ as _slicedToArray,a as _inherits,b as _createSuper,c as _createClass,d as _classCallCheck,e as _classPrivateMethodInitSpec,f as _assertThisInitialized,g as _classPrivateMethodGet,h as _wrapNativeSuper}from"./_rollupPluginBabelHelpers-18ddf178.js";import{u as u$1}from"./fluorescent-dom.es-0c4d37e6.js";function getMediaQuery(querySize){var value=getComputedStyle(document.documentElement).getPropertyValue("--media-".concat(querySize));return value||(console.warn("Invalid querySize passed to getMediaQuery"),!1)}var n,e,i,o,t,r,f,d,p,u=[];function w(n2,a){return e=window.pageXOffset,o=window.pageYOffset,r=window.innerHeight,d=window.innerWidth,i===void 0&&(i=e),t===void 0&&(t=o),p===void 0&&(p=d),f===void 0&&(f=r),(a||o!==t||e!==i||r!==f||d!==p)&&((function(n3){for(var w2=0;w2<u.length;w2++)u[w2]({x:e,y:o,px:i,py:t,vh:r,pvh:f,vw:d,pvw:p},n3)})(n2),i=e,t=o,f=r,p=d),requestAnimationFrame(w)}function srraf(e2){return u.indexOf(e2)<0&&u.push(e2),n=n||w(performance.now()),{update:function(){return w(performance.now(),!0),this},destroy:function(){u.splice(u.indexOf(e2),1)}}}var atBreakpointChange=function(breakpointToWatch,callback){var _screenUnderBP=function(){var viewportWidth=window.innerWidth||document.documentElement.clientWidth;return viewportWidth<=breakpointToWatch},screenUnderBP=_screenUnderBP(),widthWatcher=srraf(function(_ref){var vw=_ref.vw,currentScreenWidthUnderBP=vw<=breakpointToWatch;if(currentScreenWidthUnderBP!==screenUnderBP)return screenUnderBP=currentScreenWidthUnderBP,callback()}),unload=function(){widthWatcher.destroy()};return{unload:unload}},videoIntersectionWatcher=(function(node){var options=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{instant:!1,callback:!1},margin=window.matchMedia(getMediaQuery("above-720")).matches?200:100,threshold=0;options.instant||(threshold=Math.min(margin/node.offsetHeight,.5));var observer=new IntersectionObserver(function(_ref){var _ref2=_slicedToArray(_ref,1),visible=_ref2[0].isIntersecting;options.callback?options.callback(visible):visible&&(u$1(node,"is-visible"),observer.disconnect())},{threshold:threshold});return observer.observe(node),{destroy:function(){observer==null||observer.disconnect()}}});window.theme.strings.accessibility;var prefersReducedMotion=function(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches},_initResponsiveVideoTemplate=new WeakSet,_setVideoTemplate=new WeakSet,_videoA11yHandler=new WeakSet,_visibleVideoWatcher=new WeakSet,_setPlayPause=new WeakSet,BackgroundVideo=(function(_HTMLElement){_inherits(BackgroundVideo2,_HTMLElement);var _super=_createSuper(BackgroundVideo2);function BackgroundVideo2(){var _this;_classCallCheck(this,BackgroundVideo2);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _this=_super.call.apply(_super,[this].concat(args)),_classPrivateMethodInitSpec(_assertThisInitialized(_this),_setPlayPause),_classPrivateMethodInitSpec(_assertThisInitialized(_this),_visibleVideoWatcher),_classPrivateMethodInitSpec(_assertThisInitialized(_this),_videoA11yHandler),_classPrivateMethodInitSpec(_assertThisInitialized(_this),_setVideoTemplate),_classPrivateMethodInitSpec(_assertThisInitialized(_this),_initResponsiveVideoTemplate),_this}return _createClass(BackgroundVideo2,[{key:"connectedCallback",value:function(){var videoTemplate=this.querySelector("[js-background-video-template]"),hasVideo=this.dataset.hasVideo==="true",hasMobileVideo=this.dataset.hasMobileVideo==="true";if(hasVideo&&!hasMobileVideo)_classPrivateMethodGet(this,_setVideoTemplate,_setVideoTemplate2).call(this,videoTemplate,this);else if(hasVideo&hasMobileVideo){var videoMobileTemplate=this.querySelector("[js-mobile-background-video-template]");_classPrivateMethodGet(this,_initResponsiveVideoTemplate,_initResponsiveVideoTemplate2).call(this,this,videoTemplate,videoMobileTemplate)}}},{key:"disconnectedCallback",value:function(){this.removeEventListener("toggle",this.handleToggle,!0)}}
1]),BackgroundVideo2})(_wrapNativeSuper(HTMLElement));function _initResponsiveVideoTemplate2(container,videoTemplate,videoMobileTemplate){var _this2=this,setTemplateByWidth=function(){window.matchMedia(getMediaQuery("above-720")).matches?_classPrivateMethodGet(_this2,_setVideoTemplate,_setVideoTemplate2).call(_this2,videoTemplate,container):_classPrivateMethodGet(_this2,_setVideoTemplate,_setVideoTemplate2).call(_this2,videoMobileTemplate,container)};setTemplateByWidth(),atBreakpointChange(720,setTemplateByWidth)}function _setVideoTemplate2(videoTemplate,container){var _this3=this,pauseBtn=container.querySelector("[js-video-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);var videoWatcherCallback=function(visible){return _classPrivateMethodGet(_this3,_visibleVideoWatcher,_visibleVideoWatcher2).call(_this3,currentVideoEl,pauseBtn,visible)};_classPrivateMethodGet(this,_setPlayPause,_setPlayPause2).call(this,currentVideoEl,pauseBtn,"pause"),_classPrivateMethodGet(this,_videoA11yHandler,_videoA11yHandler2).call(this,currentVideoEl,pauseBtn),videoIntersectionWatcher(currentVideoEl,{callback:videoWatcherCallback})}function _videoA11yHandler2(video,pauseBtn){var _this4=this;!pauseBtn||!video||pauseBtn.addEventListener("click",function(e2){e2.preventDefault(),video.paused?(_classPrivateMethodGet(_this4,_setPlayPause,_setPlayPause2).call(_this4,video,pauseBtn,"play"),video.dataset.a11yPriorityPause=!1):(_classPrivateMethodGet(_this4,_setPlayPause,_setPlayPause2).call(_this4,video,pauseBtn,"pause"),video.dataset.a11yPriorityPause=!0)})}function _visibleVideoWatcher2(video,pauseBtn,visible){prefersReducedMotion()||(visible&&video.paused&&(video.dataset.videoLoaded==="false"&&(video.classList.add("background-video-fade-in"),video.dataset.videoLoaded="true"),video.dataset.a11yPriorityPause==="false"&&_classPrivateMethodGet(this,_setPlayPause,_setPlayPause2).call(this,video,pauseBtn,"play")),!visible&&!video.paused&&_classPrivateMethodGet(this,_setPlayPause,_setPlayPause2).call(this,video,pauseBtn,"pause"))}function _setPlayPause2(video,pauseBtn,state){var _window$theme=window.theme,strings=_window$theme.strings.accessibility,icons=_window$theme.icons;state==="pause"?(video.pause(),pauseBtn.dataset.pauseButtonContent==="icon"?pauseBtn.innerHTML=icons.play:pauseBtn.innerText=strings.play_video):(video.play(),pauseBtn.dataset.pauseButtonContent==="icon"?pauseBtn.innerHTML=icons.pause:pauseBtn.innerText=strings.pause_video)}customElements.get("background-video")||customElements.define("background-video",BackgroundVideo); 2//# sourceMappingURL=/cdn/shop/t/298/assets/background-video.js.map?v=55032746807162915021771748230
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.