"use strict";define(["notifications","throttle","debounce","oakleyGenerics"],function(m,r,i,g){var e=function(){};return e.prototype.init=function(e,t,a){switch(this.selector="lazyLoad",$.currentMedia){case"mobileMedia":this.offset=100;break;case"tabletMedia":this.offset=200;break;default:this.offset=500}window.lazyLoadBindExec=window.lazyLoadBindExec||[],window.lazyLoadBindExec[this.selector]&&!a||this.setup()},e.prototype.setup=function(){$("."+this.selector).each(function(){var e=$(this);"true"!==$(this).attr("data-loader")&&(e.attr({"data-loader":"true"}),e.is("a")&&e.attr({"data-backgroundImage":e.data("src"),"aria-label":e.attr("aria-label")}))})},e.prototype.scrollEventBind=function(){if("oakleyosi"!==Oakley.siteId&&"oakleyosi_ca"!==Oakley.siteId&&!$("body").hasClass("page-checkoutpage")&&!$("body").hasClass("page-orderconfirmation")){var a=this,e=new MutationObserver(function(e){e.forEach(function(e){$(e.target).find(".lazyLoad").each(function(){a.restoreImage($(this))})})});null!==document.querySelector(".firstLevelMenu")&&(e.observe(document.querySelector(".firstLevelMenu"),{attributeFilter:["class"]}),$(".secondLevelMenu").each(function(){e.observe(this,{attributeFilter:["class"]})}))}if(!window.lazyLoadBindExec[this.selector])if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&0==$("body.cm-preview").length){a=this;var t=[].slice.call(document.querySelectorAll("."+a.selector)),s=new IntersectionObserver(function(e){e.forEach(function(e){if(e.isIntersecting){var t=e.target;$(t).hasClass("loaded")&&!$(t).closest(".oo-hdr-ddm-lvl2").length||a.restoreImage($(t))}})},{rootMargin:"10px"});t.forEach(function(e){s.observe(e)})}else window.addEventListener("scroll",r(this.scrollChecker.bind(this),1e3)),window.addEventListener("scroll",i(this.scrollChecker.bind(this),1e3)),$.subscribe(m.LAZY_LOAD_CHECKER,this.scrollChecker.bind(this)),-1===window.location.href.indexOf("scrollTo=")&&(window.onload=this.scrollChecker,this.scrollChecker()),window.lazyLoadBindExec[this.selector]=!0},e.prototype.scrollChecker=function(){var i=this,o=document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.clientHeight;$("."+this.selector).each(function(e,t){var a=$(t),s=a.outerHeight(),r=a.offset().top;(r");e.attr("class",o.attr("data-class")),e.attr("data-element-id",o.attr("data-id")),o.removeAttr("data-id"),g.isBrowserIE()&&e.attr("src",o.find("source:first-child").attr("srcset")),0===o.find("img").length&&o.append(e),o.next(".lazyLoadLoader").remove(),o.closest(".lxteaser").removeClass("hasSkeleton"),$.publish(m.LAZY_LOAD_IMAGE_LOADED,o)}if(o.is("a")&&""!==r.attr("data-backgroundimage")){var t=r.attr("data-backgroundimage");window.matchMedia("all and (max-width: 991px)").matches&&o.hasClass("preview_image-hover")||o.css({"background-image":"url("+t+")","background-size":""})}if((o.is("div")||o.is("span")||o.is("li"))&&""!==r.attr("data-backgroundimage")&&o.css({"background-image":"url("+r.attr("data-backgroundimage")+")","background-size":""}),o.is("video")&&!v){if(f)var a=o.attr("data-posterDesktopUrl"),s=o.attr("data-videoDesktopUrl");if(h)a=o.attr("data-posterMobileUrl"),s=o.attr("data-videoMobileUrl");if(u)a=o.attr("data-posterTabletUrl"),s=o.attr("data-videoTabletUrl");s?(o.attr({poster:a}),o.parents(".video-component").removeClass("video-initialized"),require(["videoManager"],function(e){e.init()})):o.attr({poster:a}),o.removeClass("lazyLoad")}o.is("video")&&v&&(o.parents(".video-component").find(".tah-helper-img img").css({visibility:"visibile"}),o.removeClass("lazyLoad")),o.removeClass(d),o.addClass("loaded"),o.closest(".prod-tile-wrapper").removeClass("hasSkeleton"),o.is("div")&&o.css({transform:"",transition:""}),"function"==typeof i&&i($(r))}:o.css({"background-image":"","background-size":""})}}},e});