var __assign=function(){return(__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o':"";this.settings.actualSize&&(e+=''),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},e.prototype.enableZoom=function(e){var t=this,o=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?o=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){t.isImageSlide(t.core.index)&&(t.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===t.core.index&&t.setZoomEssentials())},o+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(lGEvents.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},e.prototype.getSwipeCords=function(e){return{x:e.touches[0].pageX,y:e.touches[0].pageY}},e.prototype.getDragAllowedAxises=function(e,t){var o=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),i=0,s=0,a=o.getBoundingClientRect(),s=e?(i=o.offsetHeight*e,o.offsetWidth*e):t?(i=a.height+t*a.height,a.width+t*a.width):(i=a.height,a.width),o=i>this.containerRect.height;return{allowX:s>this.containerRect.width,allowY:o}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(e,t,o,i){var s,a,n,r,l,g,c,h;Math.abs(t)<=0||(l=this.containerRect.width/2+this.containerRect.left,c=this.containerRect.height/2+this.containerRect.top+this.scrollTop,1===e&&(this.positionChanged=!1),s=(a=this.getDragAllowedAxises(0,t)).allowY,a=a.allowX,this.positionChanged&&(n=this.left/(this.scale-t),r=this.top/(this.scale-t),this.pageX=l-n,this.pageY=c-r,this.positionChanged=!1),n=this.getPossibleSwipeDragCords(t),r=l-this.pageX,l=c-this.pageY,c=1n.maxX&&(g=n.maxX)),s?this.isBeyondPossibleTop(c,n.minY)?c=n.minY:this.isBeyondPossibleBottom(c,n.maxY)&&(c=n.maxY):1n.maxY&&(c=n.maxY))),this.setZoomStyles({x:g,y:c,scale:e}),this.left=g,this.top=c,i&&this.setZoomImageSize())},e.prototype.resetImageTranslate=function(e){var t;this.isImageSlide(e)&&(t=this.core.getSlideItem(e).find(".lg-image").first(),this.imageReset=!1,t.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),t.css("width","auto").css("height","auto"),setTimeout(function(){t.removeClass("no-transition")},10))},e.prototype.setZoomImageSize=function(){var t=this,o=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var e=t.getCurrentImageActualSizeScale();t.scale>=e&&(o.addClass("no-transition"),t.imageReset=!0)},ZOOM_TRANSITION_DURATION),setTimeout(function(){var e=t.getCurrentImageActualSizeScale();t.scale>=e&&(e=t.getDragAllowedAxises(t.scale),o.css("width",o.get().naturalWidth+"px").css("height",o.get().naturalHeight+"px"),t.core.outer.addClass("lg-actual-size"),e.allowX&&e.allowY?o.addClass("reset-transition"):e.allowX&&!e.allowY?o.addClass("reset-transition-x"):!e.allowX&&e.allowY&&o.addClass("reset-transition-y"))},ZOOM_TRANSITION_DURATION+50)},e.prototype.setZoomStyles=function(e){var t=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),o=this.core.getSlideItem(this.core.index).find(".lg-image").first(),i=this.core.outer.find(".lg-current .lg-dummy-img").first(),o=(this.scale=e.scale,o.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),i.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),"translate3d("+e.x+"px, "+e.y+"px, 0)");t.css("transform",o)},e.prototype.setActualSize=function(e,o){var i,s=this;this.zoomInProgress||(this.zoomInProgress=!0,i=this.core.galleryItems[this.core.index],this.resetImageTranslate(e),setTimeout(function(){var e,t;i.src&&!s.core.outer.hasClass("lg-first-slide-loading")&&(e=s.getCurrentImageActualSizeScale(),t=s.scale,s.core.outer.hasClass("lg-zoomed")?s.scale=1:s.scale=s.getScale(e),s.setPageCords(o),s.beginZoom(s.scale),s.zoomImage(s.scale,s.scale-t,!0,!0))},50),setTimeout(function(){s.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){s.zoomInProgress=!1},ZOOM_TRANSITION_DURATION+110))},e.prototype.getNaturalWidth=function(e){var t=this.core.getSlideItem(e).find(".lg-image").first(),e=this.core.galleryItems[e].width;return e?parseFloat(e):t.get().naturalWidth},e.prototype.getActualSizeScale=function(e,t){e=t<=e?e/t||2:1;return e},e.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first().get().offsetWidth,t=this.getNaturalWidth(this.core.index)||e;return this.getActualSizeScale(t,e)},e.prototype.getPageCords=function(e){var t={};return e?(t.x=e.pageX||e.touches[0].pageX,t.y=e.pageY||e.touches[0].pageY):(e=this.core.$content.get().getBoundingClientRect(),t.x=e.width/2+e.left,t.y=e.height/2+this.scrollTop+e.top),t},e.prototype.setPageCords=function(e){e=this.getPageCords(e);this.pageX=e.x,this.pageY=e.y},e.prototype.manageActualPixelClassNames=function(){this.core.getElementById("lg-actual-size").removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),1=e&&(t=e-o.scale,o.zoomImage(e,t=0===t?.01:t,!1,!0)),o.manageActualPixelClassNames(),o.core.outer.addClass("lg-zoomed")),o.core.touchAction=void 0)})},e.prototype.touchendZoom=function(e,t,o,i,s){var a=t.x-e.x,t=t.y-e.y,e=Math.abs(a)/s+1,s=Math.abs(t)/s+1,e=(2