!function(t){t(function(){t(window).on("resize",OUGalleryLightbox._wrapperHeight)}),OUGalleryLightbox=function(t){this.selector=t.id,this.delegate=t.delegate,this.zoom=t.zoom,this.init()},OUGalleryLightbox.prototype={selector:"",delegate:"",zoom:300,init:function(){t(document).on("dom-change",function(){t("[data-entrance]").on("entrance",function(){var e=t(this),a=e.data("entrance"),i=e.data("delay")?e.data("delay"):0;a&&setTimeout(function(){e.addClass(a+" is-visible"),setTimeout(function(){e.removeClass(a+" is-visible").removeAttr("data-entrance"),e.attr("data-completed-entrance",a)},1e3)},parseInt(i))}),t("[data-trigger-entrances]").waypoint(function(){var e=t(this);setTimeout(function(){e.find("[data-entrance][data-chained]").each(function(){t(this).trigger("entrance")})},150)},{offset:"80%"})}).ready(function(){t(document).trigger("dom-change")}),this._wrapperHeight(),this._doMagnificPopup(),t(window).resize(t.proxy(this._wrapperHeight,this))},_doMagnificPopup:function(){if(!(t("body").hasClass("ct_inner")||t("body").hasClass("oxygen-builder-body")||t("body").hasClass("oxygen-builder-body"))){t(this.delegate).bind("touchstart",function(e){e.stopPropagation(),t(this).addClass("acf-touch-hovereffect"),t(this).find("h3").addClass("acf-touch-hovertransform")});var e=t("."+this.selector),a=this.selector,i=e.attr("data-close-btn");e.magnificPopup({midClick:!0,closeBtnInside:!1,fixedContentPos:!1,type:"image",delegate:this.delegate,fixedContentPos:"auto",closeMarkup:'<button title="%title%" type="button" class="ouacfg-close mfp-close"><svg id="svg-'+a+'"><use xlink:href="#'+i+'"></use></button>',gallery:{enabled:!0,tCounter:'<span class="mfp-counter">%curr% / %total%</span>'},removalDelay:500,callbacks:{beforeOpen:function(){"yes"==e.attr("data-site-scroll")&&t("body").addClass("ouacfg-off-scroll"),this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim"),this.st.mainClass=this.st.el.attr("data-effect")},beforeClose:function(){"yes"==e.attr("data-slider-lightbox")&&t("body").removeClass("ouacfg-off-scroll")}}})}},_wrapperHeight:function(){if(t("."+this.selector+" .ou-gallery-thumb").length>0){var e=acfgw=capH=gap=0;t("."+this.selector+" .ou-gallery-thumb").each(function(){var a=t(this).outerHeight(!0);a>e&&(e=a)}),t("."+this.selector+" .cap-align-below").length>0&&(t("."+this.selector+" .cap-align-below").each(function(){var e=t(this).outerHeight(!0);e>capH&&(capH=e)}),e+=capH),gap=t("."+this.selector+" .ou-gallery-height").innerWidth()-t("."+this.selector+" .ou-gallery-height").width(),t("."+this.selector+" .ou-gallery-height").css("height",e+gap),e=acfgw=capH=0}}}}(jQuery);