text: /*!
  	By André Rinas, www.andrerinas.de
  	Documentation, www.simplelightbox.de
  	Available for use under the MIT License
  	Version 2.2.2
  */
  "use strict";function _createForOfIteratorHelper(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=_unsupportedIterableToArray(t))){var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,n,o=!0,a=!1;return{s:function(){s=t[Symbol.iterator]()},n:function(){var t=s.next();return o=t.done,t},e:function(t){a=!0,n=t},f:function(){try{o||null==s.return||s.return()}finally{if(a)throw n}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),t}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var SimpleLightbox=function(){function s(t,e){var i=this;_classCallCheck(this,s),_defineProperty(this,"a",{sourceAttr:"href",overlay:!0,spinner:!0,nav:!0,navText:["&lsaquo;","&rsaquo;"],captions:!0,captionDelay:0,captionSelector:"img",captionType:"attr",captionsData:"title",captionPosition:"bottom",captionClass:"",close:!0,closeText:"&times;",swipeClose:!0,showCounter:!0,fileExt:"png|jpg|jpeg|gif|webp",animationSlide:!0,animationSpeed:250,preloading:!0,enableKeyboard:!0,loop:!0,rel:!1,docClose:!0,swipeTolerance:50,className:"simple-lightbox",widthRatio:.8,heightRatio:.9,scaleImageToRatio:!1,disableRightClick:!1,disableScroll:!0,alertError:!0,alertErrorMessage:"Image not found, next image will be loaded",additionalHtml:!1,history:!0,throttleInterval:0,doubleTapZoom:2,maxZoom:10,htmlClass:"has-lightbox",rtl:!1,fixedClass:"sl-fixed"}),_defineProperty(this,"b",void 0),_defineProperty(this,"c",!1),_defineProperty(this,"d","ontouchstart"in window),_defineProperty(this,"e",void 0),_defineProperty(this,"f","pushState"in history),_defineProperty(this,"g",!1),_defineProperty(this,"h",!1),_defineProperty(this,"i",!1),_defineProperty(this,"j",!1),_defineProperty(this,"k",!1),_defineProperty(this,"l",!1),_defineProperty(this,"m",!1),_defineProperty(this,"n",null),_defineProperty(this,"o",void 0),_defineProperty(this,"p","simplelightbox"),_defineProperty(this,"q",{}),_defineProperty(this,"r",[]),_defineProperty(this,"s",0),_defineProperty(this,"t",0),_defineProperty(this,"u",null),_defineProperty(this,"v",0),_defineProperty(this,"w",{a:0,b:0,c:0,d:0,e:0,f:0,g:!1,h:0,i:!1,j:0,k:0,l:0,m:0,n:0,o:0,p:!1,q:0,r:0,s:0,t:0,u:0,v:0,w:1,x:0,y:0,z:0,A:0,B:0,C:0,D:0,E:0,F:0,G:0,H:0,I:0,J:0,K:0,L:0,M:!1,N:0}),this.options=Object.assign(this.a,e),"string"==typeof t?(this.u=t,this.elements=Array.from(document.querySelectorAll(t))):this.elements=void 0!==t.length&&0<t.length?Array.from(t):[t],this.relatedElements=[],this.b=this.calculateTransitionPrefix(),this.c=!1!==this.b,this.e=this.hash,this.options.rel&&(this.elements=this.getRelated(this.options.rel)),this.createDomNodes(),this.options.close&&this.q.a.appendChild(this.q.b),this.options.nav&&this.q.a.appendChild(this.q.c),this.options.spinner&&this.q.a.appendChild(this.q.d),this.addEventListener(this.elements,"click."+this.p,function(t){if(i.isValidLink(t.currentTarget)){if(t.preventDefault(),i.h)return!1;i.s=i.elements.indexOf(t.currentTarget),i.openImage(t.currentTarget)}}),this.options.docClose&&this.addEventListener(this.q.e,["click."+this.p,"touchstart."+this.p],function(t){i.g&&i.close()}),this.options.disableRightClick&&this.addEventListener(document.body,"contextmenu."+this.p,function(t){t.target.classList.contains("sl-overlay")&&t.preventDefault()}),this.options.enableKeyboard&&this.addEventListener(document.body,"keyup."+this.p,this.throttle(function(t){if(i.w.a=0,i.h&&"Escape"===t.key)return i.o.setAttribute("src",""),i.h=!1,i.close();i.g&&(t.preventDefault(),"Escape"===t.key&&i.close(),!i.h&&-1<["ArrowLeft","ArrowRight"].indexOf(t.key)&&i.loadImage("ArrowRight"===t.key?1:-1))},this.options.throttleInterval)),this.addEvents()}return _createClass(s,[{key:"createDomNodes",value:function(){this.q.e=document.createElement("div"),this.q.e.classList.add("sl-overlay"),this.q.e.dataset.opacityTarget=".7",this.q.b=document.createElement("button"),this.q.b.classList.add("sl-close"),this.q.b.innerHTML=this.options.closeText,this.q.d=document.createElement("div"),this.q.d.classList.add("sl-spinner"),this.q.d.innerHTML="<div></div>",this.q.c=document.createElement("div"),this.q.c.classList.add("sl-navigation"),this.q.c.innerHTML='<button class="sl-prev">'.concat(this.options.navText[0],'</button><button class="sl-next">').concat(this.options.navText[1],"</button>"),this.q.f=document.createElement("div"),this.q.f.classList.add("sl-counter"),this.q.f.innerHTML='<span class="sl-current"></span>/<span class="sl-total"></span>',this.q.g=document.createElement("div"),this.q.g.classList.add("sl-caption","pos-"+this.options.captionPosition),this.options.captionClass&&this.q.g.classList.add(this.options.captionClass),this.q.h=document.createElement("div"),this.q.h.classList.add("sl-image"),this.q.a=document.createElement("div"),this.q.a.classList.add("sl-wrapper"),this.options.className&&this.q.a.classList.add(this.options.className),this.options.rtl&&this.q.a.classList.add("sl-dir-rtl")}},{key:"throttle",value:function(t,e){var i;return function(){i||(t.apply(this,arguments),i=!0,setTimeout(function(){return i=!1},e))}}},{key:"isValidLink",value:function(t){return!this.options.fileExt||"pathname"in t&&new RegExp("("+this.options.fileExt+")$","i").test(t.pathname)}},{key:"calculateTransitionPrefix",value:function(){var t=(document.body||document.documentElement).style;return"transition"in t?"":"WebkitTransition"in t?"-webkit-":"MozTransition"in t?"-moz-":"OTransition"in t&&"-o"}},{key:"toggleScrollbar",value:function(t){var s=0,e=[].slice.call(document.querySelectorAll("."+this.options.fixedClass));if("hide"===t){var i=window.innerWidth;if(!i){var n=document.documentElement.getBoundingClientRect();i=n.right-Math.abs(n.left)}if(document.body.clientWidth<i){var o=document.createElement("div"),a=parseInt(document.body.style.paddingRight||0,10);o.classList.add("sl-scrollbar-measure"),document.body.appendChild(o),s=o.offsetWidth-o.clientWidth,document.body.removeChild(o),document.body.dataset.originalPaddingRight=a,0<s&&(document.body.classList.add("hidden-scroll"),document.body.style.paddingRight=a+s+"px",e.forEach(function(t){var e=t.style.paddingRight,i=window.getComputedStyle(t)["padding-right"];t.dataset.originalPaddingRight=e,t.style.paddingRight="".concat(parseFloat(i)+s,"px")}))}}else document.body.classList.remove("hidden-scroll"),document.body.style.paddingRight=document.body.dataset.originalPaddingRight,e.forEach(function(t){var e=t.dataset.originalPaddingRight;void 0!==e&&(t.style.paddingRight=e)});return s}},{key:"close",value:function(){var t=this;if(!this.g||this.h||this.i)return!1;this.i=!0;var e=this.relatedElements[this.oIndex];for(var i in e.dispatchEvent(new Event("close.simplelightbox")),this.options.history&&(this.m=!1,this.l||this.resetHash()),this.fadeOut(document.querySelectorAll(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter"),300,function(){t.options.disableScroll&&t.toggleScrollbar("show"),t.options.htmlClass&&""!==t.options.htmlClass&&document.querySelector("html").classList.remove(t.options.htmlClass),document.body.removeChild(t.q.a),document.body.removeChild(t.q.e),t.q.i=null,e.dispatchEvent(new Event("closed.simplelightbox")),t.i=!1}),this.o=null,this.g=!1,this.h=!1,this.w)this.w[i]=0;this.w.g=!1,this.w.i=!1,this.w.p=!1,this.w.w=this.minMax(1,1,this.options.maxZoom),this.w.M=!1}},{key:"preload",value:function(){var i=this,s=this.oIndex,t=this.relatedElements.length,e=s+1<0?t-1:t-1<=s+1?0:s+1,n=s-1<0?t-1:t-1<=s-1?0:s-1,o=new Image,a=new Image;o.addEventListener("load",function(t){var e=t.target.getAttribute("src");-1===i.r.indexOf(e)&&i.r.push(e),i.relatedElements[s].dispatchEvent(new Event("nextImageLoaded."+i.p))}),o.setAttribute("src",this.relatedElements[e].getAttribute(this.options.sourceAttr)),a.addEventListener("load",function(t){var e=t.target.getAttribute("src");-1===i.r.indexOf(e)&&i.r.push(e),i.relatedElements[s].dispatchEvent(new Event("prevImageLoaded."+i.p))}),a.setAttribute("src",this.relatedElements[n].getAttribute(this.options.sourceAttr))}},{key:"loadImage",value:function(t){var e=this,i=t;this.options.rtl&&(t=-t),this.relatedElements[this.oIndex].dispatchEvent(new Event("change."+this.p)),this.relatedElements[this.oIndex].dispatchEvent(new Event((1===t?"next":"prev")+"."+this.p));var s=this.oIndex+t;if(this.h||(s<0||s>=this.relatedElements.length)&&!1===this.options.loop)return!1;this.oIndex=s<0?this.relatedElements.length-1:s>this.relatedElements.length-1?0:s,this.q.f.querySelector(".sl-current").innerHTML=this.oIndex+1,this.options.animationSlide&&this.slide(this.options.animationSpeed/1e3,-100*i-this.w.a+"px"),this.fadeOut(this.q.h,300,function(){e.h=!0,setTimeout(function(){var t=e.relatedElements[e.oIndex];e.o.setAttribute("src",t.getAttribute(e.options.sourceAttr)),-1===e.r.indexOf(t.getAttribute(e.options.sourceAttr))&&e.show(e.q.d),e.q.h.contains(e.q.g)&&e.q.h.removeChild(e.q.g),e.adjustImage(i),e.options.preloading&&e.preload()},100)})}},{key:"adjustImage",value:function(a){var r=this;if(!this.o)return!1;var t=new Image,l=window.innerWidth*this.options.widthRatio,h=window.innerHeight*this.options.heightRatio;t.setAttribute("src",this.o.getAttribute("src")),this.o.dataset.scale=1,this.o.dataset.translateX=0,this.o.dataset.translateY=0,this.zoomPanElement(0,0,1),t.addEventListener("error",function(t){r.relatedElements[r.oIndex].dispatchEvent(new Event("error."+r.p)),r.h=!1,r.g=!1,r.q.d.style.display="none";var e=1===a||-1===a;if(r.s===r.oIndex&&e)return r.close();r.options.alertError&&alert(r.options.alertErrorMessage),r.loadImage(e?a:1)}),t.addEventListener("load",function(t){void 0!==a&&(r.relatedElements[r.oIndex].dispatchEvent(new Event("changed."+r.p)),r.relatedElements[r.oIndex].dispatchEvent(new Event((1===a?"nextDone":"prevDone")+"."+r.p))),r.options.history&&r.updateURL(),-1===r.r.indexOf(r.o.getAttribute("src"))&&r.r.push(r.o.getAttribute("src"));var e=t.target.width,i=t.target.height;if(r.options.scaleImageToRatio||l<e||h<i){var s=l/h<e/i?e/l:i/h;e/=s,i/=s}r.q.h.style.top=(window.innerHeight-i)/2+"px",r.q.h.style.left=(window.innerWidth-e-r.v)/2+"px",r.q.h.style.width=e+"px",r.q.h.style.height=i+"px",r.q.d.style.display="none",r.fadeIn(r.o,300),r.g=!0;var n,o="self"===r.options.captionSelector?r.relatedElements[r.oIndex]:r.relatedElements[r.oIndex].querySelector(r.options.captionSelector);r.options.captions&&o&&(n="data"===r.options.captionType?o.dataset[r.options.captionsData]:"text"===r.options.captionType?o.innerHTML:o.getAttribute(r.options.captionsData)),r.options.loop||(0===r.oIndex&&r.hide(r.q.c.querySelector(".sl-prev")),r.oIndex>=r.relatedElements.length-1&&r.hide(r.q.c.querySelector(".sl-next")),0<r.oIndex&&r.show(r.q.c.querySelector(".sl-prev")),r.oIndex<r.relatedElements.length-1&&r.show(r.q.c.querySelector(".sl-next"))),1===r.relatedElements.length?r.hide(r.q.c.querySelectorAll(".sl-prev, .sl-next")):r.show(r.q.c.querySelectorAll(".sl-prev, .sl-next")),1===a||-1===a?(r.options.animationSlide&&(r.slide(0,100*a+"px"),setTimeout(function(){r.slide(r.options.animationSpeed/1e3,"0px")},50)),r.fadeIn(r.q.h,300,function(){r.h=!1,r.setCaption(n,e)})):(r.h=!1,r.setCaption(n,e)),r.options.additionalHtml&&!r.q.i&&(r.q.i=document.createElement("div"),r.q.i.classList.add("sl-additional-html"),r.q.i.innerHTML=r.options.additionalHtml,r.q.h.appendChild(r.q.i))})}},{key:"zoomPanElement",value:function(t,e,i){this.o.style[this.b+"transform"]="translate("+t+","+e+") scale("+i+")"}},{key:"minMax",value:function(t,e,i){return t<e?e:i<t?i:t}},{key:"setZoomData",value:function(t,e,i){this.o.dataset.scale=t,this.o.dataset.translateX=e,this.o.dataset.translateY=i}},{key:"hashchangeHandler",value:function(){this.g&&this.hash===this.e&&(this.l=!0,this.close())}},{key:"addEvents",value:function(){var i=this;this.addEventListener(window,"resize."+this.p,function(t){i.g&&i.adjustImage()}),this.addEventListener(this.q.b,["click."+this.p,"touchstart."+this.p],this.close.bind(this)),this.options.history&&setTimeout(function(){i.addEventListener(window,"hashchange."+i.p,function(t){i.g&&i.hashchangeHandler()})},40),this.addEventListener(this.q.c.getElementsByTagName("button"),"click."+this.p,function(t){if(!t.currentTarget.tagName.match(/button/i))return!0;t.preventDefault(),i.w.a=0,i.loadImage(t.currentTarget.classList.contains("sl-next")?1:-1)}),this.addEventListener(this.q.h,["touchstart."+this.p,"mousedown."+this.p],function(t){if("A"===t.target.tagName&&"touchstart"===t.type)return!0;if("mousedown"===t.type)i.w.s=t.clientX,i.w.t=t.clientY,i.w.j=i.getDimensions(i.q.h).height,i.w.k=i.getDimensions(i.q.h).width,i.w.n=i.getDimensions(i.o).height,i.w.o=i.getDimensions(i.o).width,i.w.l=i.q.h.offsetLeft,i.w.m=i.q.h.offsetTop,i.w.q=parseFloat(i.o.dataset.translateX),i.w.r=parseFloat(i.o.dataset.translateY),i.w.p=!0;else{if(i.w.L=t.touches.length,i.w.s=t.touches[0].clientX,i.w.t=t.touches[0].clientY,i.w.j=i.getDimensions(i.q.h).height,i.w.k=i.getDimensions(i.q.h).width,i.w.n=i.getDimensions(i.o).height,i.w.o=i.getDimensions(i.o).width,i.w.l=i.q.h.offsetLeft,i.w.m=i.q.h.offsetTop,1===i.w.L){if(i.w.M)return i.o.classList.add("sl-transition"),i.w.i?(i.w.w=1,i.setZoomData(i.w.w,0,0),i.zoomPanElement("0px","0px",i.w.w),i.w.i=!1):(i.w.w=i.options.doubleTapZoom,i.setZoomData(i.w.w,0,0),i.zoomPanElement("0px","0px",i.w.w),i.q.g.style.opacity||"none"===i.q.g.style.display||i.fadeOut(i.q.g,200),i.w.i=!0),setTimeout(function(){i.o&&i.o.classList.remove("sl-transition")},200),!1;i.w.M=!0,setTimeout(function(){i.w.M=!1},300),i.w.q=parseFloat(i.o.dataset.translateX),i.w.r=parseFloat(i.o.dataset.translateY)}else 2===i.w.L&&(i.w.s2=t.touches[1].clientX,i.w.t2=t.touches[1].clientY,i.w.q=parseFloat(i.o.dataset.translateX),i.w.r=parseFloat(i.o.dataset.translateY),i.w.F=(i.w.s+i.w.s2)/2,i.w.G=(i.w.t+i.w.t2)/2,i.w.x=Math.sqrt((i.w.s-i.w.s2)*(i.w.s-i.w.s2)+(i.w.t-i.w.t2)*(i.w.t-i.w.t2)));i.w.p=!0}return!!i.w.g||(i.c&&(i.w.h=parseInt(i.q.h.style.left,10)),i.w.g=!0,i.w.a=0,i.w.b=0,i.w.c=t.pageX||t.touches[0].pageX,i.w.e=t.pageY||t.touches[0].pageY,!1)}),this.addEventListener(this.q.h,["touchmove."+this.p,"mousemove."+this.p,"MSPointerMove"],function(t){if(!i.w.g)return!0;if(t.preventDefault(),"touchmove"===t.type){if(!1===i.w.p)return!1;i.w.y=t.touches[0].clientX,i.w.z=t.touches[0].clientY,i.w.L=t.touches.length,i.w.N++,1<i.w.L?(i.w.y2=t.touches[1].clientX,i.w.z2=t.touches[1].clientY,i.w.K=Math.sqrt((i.w.y-i.w.y2)*(i.w.y-i.w.y2)+(i.w.z-i.w.z2)*(i.w.z-i.w.z2)),null===i.w.x&&(i.w.x=i.w.K),1<=Math.abs(i.w.x-i.w.K)&&(i.w.E=i.minMax(i.w.K/i.w.x*i.w.w,1,i.options.maxZoom),i.w.H=(i.w.o*i.w.E-i.w.k)/2,i.w.I=(i.w.n*i.w.E-i.w.j)/2,i.w.J=i.w.E-i.w.w,i.w.C=i.w.o*i.w.E<=i.w.k?0:i.minMax(i.w.q-(i.w.F-i.w.l-i.w.k/2-i.w.q)/(i.w.E-i.w.J)*i.w.J,-1*i.w.H,i.w.H),i.w.D=i.w.n*i.w.E<=i.w.j?0:i.minMax(i.w.r-(i.w.G-i.w.m-i.w.j/2-i.w.r)/(i.w.E-i.w.J)*i.w.J,-1*i.w.I,i.w.I),i.zoomPanElement(i.w.C+"px",i.w.D+"px",i.w.E),1<i.w.E&&(i.w.i=!0,i.q.g.style.opacity||"none"===i.q.g.style.display||i.fadeOut(i.q.g,200)),i.w.x=i.w.K,i.w.w=i.w.E,i.w.q=i.w.C,i.w.r=i.w.D)):(i.w.E=i.w.w,i.w.H=(i.w.o*i.w.E-i.w.k)/2,i.w.I=(i.w.n*i.w.E-i.w.j)/2,i.w.C=i.w.o*i.w.E<=i.w.k?0:i.minMax(i.w.y-(i.w.s-i.w.q),-1*i.w.H,i.w.H),i.w.D=i.w.n*i.w.E<=i.w.j?0:i.minMax(i.w.z-(i.w.t-i.w.r),-1*i.w.I,i.w.I),Math.abs(i.w.C)===Math.abs(i.w.H)&&(i.w.q=i.w.C,i.w.s=i.w.y),Math.abs(i.w.D)===Math.abs(i.w.I)&&(i.w.r=i.w.D,i.w.t=i.w.z),i.setZoomData(i.w.w,i.w.C,i.w.D),i.zoomPanElement(i.w.C+"px",i.w.D+"px",i.w.E))}if("mousemove"===t.type&&i.w.g){if("touchmove"==t.type)return!0;if(!1===i.w.p)return!1;i.w.y=t.clientX,i.w.z=t.clientY,i.w.E=i.w.w,i.w.H=(i.w.o*i.w.E-i.w.k)/2,i.w.I=(i.w.n*i.w.E-i.w.j)/2,i.w.C=i.w.o*i.w.E<=i.w.k?0:i.minMax(i.w.y-(i.w.s-i.w.q),-1*i.w.H,i.w.H),i.w.D=i.w.n*i.w.E<=i.w.j?0:i.minMax(i.w.z-(i.w.t-i.w.r),-1*i.w.I,i.w.I),Math.abs(i.w.C)===Math.abs(i.w.H)&&(i.w.q=i.w.C,i.w.s=i.w.y),Math.abs(i.w.D)===Math.abs(i.w.I)&&(i.w.r=i.w.D,i.w.t=i.w.z),i.setZoomData(i.w.w,i.w.C,i.w.D),i.zoomPanElement(i.w.C+"px",i.w.D+"px",i.w.E)}i.w.i||(i.w.d=t.pageX||t.touches[0].pageX,i.w.f=t.pageY||t.touches[0].pageY,i.w.a=i.w.c-i.w.d,i.w.b=i.w.e-i.w.f,i.options.animationSlide&&i.slide(0,-i.w.a+"px"))}),this.addEventListener(this.q.h,["touchend."+this.p,"mouseup."+this.p,"touchcancel."+this.p,"mouseleave."+this.p,"pointerup","pointercancel","MSPointerUp","MSPointerCancel"],function(t){if(i.d&&"touchend"===t.type&&(i.w.L=t.touches.length,0===i.w.L?(i.o&&i.setZoomData(i.w.w,i.w.C,i.w.D),1===i.w.w&&(i.w.i=!1,"none"===i.q.g.style.display&&i.fadeIn(i.q.g,200)),i.w.x=null,i.w.p=!1):1===i.w.L?(i.w.s=t.touches[0].clientX,i.w.t=t.touches[0].clientY):1<i.w.L&&(i.w.x=null)),i.w.g){var e=!(i.w.g=!1);i.options.loop||(0===i.oIndex&&i.w.a<0&&(e=!1),i.oIndex>=i.relatedElements.length-1&&0<i.w.a&&(e=!1)),Math.abs(i.w.a)>i.options.swipeTolerance&&e?i.loadImage(0<i.w.a?1:-1):i.options.animationSlide&&i.slide(i.options.animationSpeed/1e3,"0px"),i.options.swipeClose&&50<Math.abs(i.w.b)&&Math.abs(i.w.a)<i.options.swipeTolerance&&i.close()}}),this.addEventListener(this.q.h,["dblclick"],function(t){if(!i.d)return i.w.s=t.clientX,i.w.t=t.clientY,i.w.j=i.getDimensions(i.q.h).height,i.w.k=i.getDimensions(i.q.h).width,i.w.n=i.getDimensions(i.o).height,i.w.o=i.getDimensions(i.o).width,i.w.l=i.q.h.offsetLeft,i.w.m=i.q.h.offsetTop,i.o.classList.add("sl-transition"),i.w.i?(i.w.w=1,i.setZoomData(i.w.w,0,0),i.zoomPanElement("0px","0px",i.w.w),i.w.i=!1,"none"===i.q.g.style.display&&i.fadeIn(i.q.g,200)):(i.w.w=i.options.doubleTapZoom,i.setZoomData(i.w.w,0,0),i.zoomPanElement("0px","0px",i.w.w),i.q.g.style.opacity||"none"===i.q.g.style.display||i.fadeOut(i.q.g,200),i.w.i=!0),setTimeout(function(){i.o&&i.o.classList.remove("sl-transition")},200),!(i.w.p=!0)})}},{key:"getDimensions",value:function(t){var e=window.getComputedStyle(t),i=t.offsetHeight,s=t.offsetWidth,n=parseFloat(e.borderTopWidth);return{height:i-parseFloat(e.borderBottomWidth)-n-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom),width:s-parseFloat(e.borderLeftWidth)-parseFloat(e.borderRightWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)}}},{key:"updateHash",value:function(){var t="pid="+(this.oIndex+1),e=window.location.href.split("#")[0]+"#"+t;this.l=!1,this.f?window.history[this.m?"replaceState":"pushState"]("",document.title,e):this.m?window.location.replace(e):window.location.hash=t,this.m||(this.k=!0),this.m=!0}},{key:"resetHash",value:function(){this.l=!0,this.k?history.back():this.f?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.hash="",clearTimeout(this.n)}},{key:"updateURL",value:function(){clearTimeout(this.n),this.m?this.n=setTimeout(this.updateHash.bind(this),800):this.updateHash()}},{key:"setCaption",value:function(t,e){var i=this;this.options.captions&&t&&""!==t&&void 0!==t&&(this.hide(this.q.g),this.q.g.style.width=e+"px",this.q.g.innerHTML=t,this.q.h.appendChild(this.q.g),setTimeout(function(){i.fadeIn(i.q.g,300)},this.options.captionDelay))}},{key:"slide",value:function(t,e){if(!this.c)return this.q.h.style.left=e;this.q.h.style[this.b+"transform"]="translateX("+e+")",this.q.h.style[this.b+"transition"]=this.b+"transform "+t+"s linear"}},{key:"getRelated",value:function(e){return e&&!1!==e&&"nofollow"!==e?Array.from(this.elements).filter(function(t){return t.getAttribute("rel")===e}):this.elements}},{key:"openImage",value:function(t){var e=this;t.dispatchEvent(new Event("show."+this.p)),this.options.disableScroll&&(this.v=this.toggleScrollbar("hide")),this.options.htmlClass&&""!==this.options.htmlClass&&document.querySelector("html").classList.add(this.options.htmlClass),document.body.appendChild(this.q.a),this.q.a.appendChild(this.q.h),this.options.overlay&&document.body.appendChild(this.q.e),this.relatedElements=this.getRelated(t.rel),this.options.showCounter&&(1==this.relatedElements.length&&this.q.a.contains(this.q.f)?this.q.a.removeChild(this.q.f):1<this.relatedElements.length&&!this.q.a.contains(this.q.f)&&this.q.a.appendChild(this.q.f)),this.h=!0,this.oIndex=this.relatedElements.indexOf(t);var i=t.getAttribute(this.options.sourceAttr);this.o=document.createElement("img"),this.o.style.display="none",this.o.setAttribute("src",i),this.o.dataset.scale=1,this.o.dataset.translateX=0,this.o.dataset.translateY=0,-1===this.r.indexOf(i)&&this.r.push(i),this.q.h.innerHTML="",this.q.h.setAttribute("style",""),this.q.h.appendChild(this.o),this.fadeIn(this.q.e,300),this.fadeIn([this.q.f,this.q.c,this.q.b],300),this.show(this.q.d),this.q.f.querySelector(".sl-current").innerHTML=this.oIndex+1,this.q.f.querySelector(".sl-total").innerHTML=this.relatedElements.length,this.adjustImage(),this.options.preloading&&this.preload(),setTimeout(function(){t.dispatchEvent(new Event("shown."+e.p))},this.options.animationSpeed)}},{key:"addEventListener",value:function(t,e,i,s){t=this.wrap(t),e=this.wrap(e);var n,o=_createForOfIteratorHelper(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;a.namespaces||(a.namespaces={});var r,l=_createForOfIteratorHelper(e);try{for(l.s();!(r=l.n()).done;){var h=r.value,d=s||!1;a.namespaces[h]=i,a.addEventListener(h.split(".")[0],i,d)}}catch(t){l.e(t)}finally{l.f()}}}catch(t){o.e(t)}finally{o.f()}}},{key:"removeEventListener",value:function(t,e){t=this.wrap(t),e=this.wrap(e);var i,s=_createForOfIteratorHelper(t);try{for(s.s();!(i=s.n()).done;){var n,o=i.value,a=_createForOfIteratorHelper(e);try{for(a.s();!(n=a.n()).done;){var r=n.value;o.removeEventListener(r.split(".")[0],o.namespaces[r]),delete o.namespaces[r]}}catch(t){a.e(t)}finally{a.f()}}}catch(t){s.e(t)}finally{s.f()}}},{key:"fadeOut",value:function(r,t,l){var e,h=this,i=_createForOfIteratorHelper(r=this.wrap(r));try{for(i.s();!(e=i.n()).done;){e.value.style.opacity=1}}catch(t){i.e(t)}finally{i.f()}this.j=!1;var d=16.66666/(t||300);!function t(){var e=parseFloat(r[0].style.opacity);if((e-=d)<0){var i,s=_createForOfIteratorHelper(r);try{for(s.s();!(i=s.n()).done;){var n=i.value;n.style.display="none",n.style.opacity=""}}catch(t){s.e(t)}finally{s.f()}l&&l.call(h,r)}else{var o,a=_createForOfIteratorHelper(r);try{for(a.s();!(o=a.n()).done;){o.value.style.opacity=e}}catch(t){a.e(t)}finally{a.f()}requestAnimationFrame(t)}}()}},{key:"fadeIn",value:function(a,t,r,e){var i,l=this,s=_createForOfIteratorHelper(a=this.wrap(a));try{for(s.s();!(i=s.n()).done;){var n=i.value;n.style.opacity=0,n.style.display=e||"block"}}catch(t){s.e(t)}finally{s.f()}this.j=!0;var h=parseFloat(a[0].dataset.opacityTarget||1),d=16.66666*h/(t||300);!function t(){var e=parseFloat(a[0].style.opacity);if((e+=d)>h){var i,s=_createForOfIteratorHelper(a);try{for(s.s();!(i=s.n()).done;){i.value.style.opacity=""}}catch(t){s.e(t)}finally{s.f()}r&&r.call(l,a)}else{var n,o=_createForOfIteratorHelper(a);try{for(o.s();!(n=o.n()).done;){n.value.style.opacity=e}}catch(t){o.e(t)}finally{o.f()}if(!l.j)return;requestAnimationFrame(t)}}()}},{key:"hide",value:function(t){var e,i=_createForOfIteratorHelper(t=this.wrap(t));try{for(i.s();!(e=i.n()).done;){var s=e.value;s.dataset.initialDisplay=s.style.display,s.style.display="none"}}catch(t){i.e(t)}finally{i.f()}}},{key:"show",value:function(t,e){var i,s=_createForOfIteratorHelper(t=this.wrap(t));try{for(s.s();!(i=s.n()).done;){var n=i.value;n.style.display=n.dataset.initialDisplay||e||"block"}}catch(t){s.e(t)}finally{s.f()}}},{key:"wrap",value:function(t){return"function"==typeof t[Symbol.iterator]&&"string"!=typeof t?t:[t]}},{key:"on",value:function(t,e){t=this.wrap(t);var i,s=_createForOfIteratorHelper(this.elements);try{for(s.s();!(i=s.n()).done;){var n=i.value;n.fullyNamespacedEvents||(n.fullyNamespacedEvents={});var o,a=_createForOfIteratorHelper(t);try{for(a.s();!(o=a.n()).done;){var r=o.value;n.fullyNamespacedEvents[r]=e,n.addEventListener(r,e)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){s.e(t)}finally{s.f()}return this}},{key:"off",value:function(t){t=this.wrap(t);var e,i=_createForOfIteratorHelper(this.elements);try{for(i.s();!(e=i.n()).done;){var s,n=e.value,o=_createForOfIteratorHelper(t);try{for(o.s();!(s=o.n()).done;){var a=s.value;void 0!==n.fullyNamespacedEvents&&a in n.fullyNamespacedEvents&&n.removeEventListener(a,n.fullyNamespacedEvents[a])}}catch(t){o.e(t)}finally{o.f()}}}catch(t){i.e(t)}finally{i.f()}return this}},{key:"open",value:function(t){t=t||this.elements[0],"undefined"!=typeof jQuery&&t instanceof jQuery&&(t=t.get(0)),this.s=this.elements.indexOf(t),-1<this.s&&this.openImage(t)}},{key:"next",value:function(){this.loadImage(1)}},{key:"prev",value:function(){this.loadImage(-1)}},{key:"destroy",value:function(){this.off(["close."+this.p,"closed."+this.p,"nextImageLoaded."+this.p,"prevImageLoaded."+this.p,"change."+this.p,"nextDone."+this.p,"prevDone."+this.p,"error."+this.p,"changed."+this.p,"next."+this.p,"prev."+this.p,"show."+this.p,"shown."+this.p]),this.removeEventListener(this.elements,"click."+this.p),this.removeEventListener(document.body,"contextmenu."+this.p),this.removeEventListener(document.body,"keyup."+this.p),this.removeEventListener(this.q.c.getElementsByTagName("button"),"click."+this.p),this.removeEventListener(this.q.b,"click."+this.p),this.removeEventListener(window,"resize."+this.p),this.removeEventListener(window,"hashchange."+this.p),this.close(),this.g&&(document.body.removeChild(this.q.a),document.body.removeChild(this.q.e)),this.elements=null}},{key:"refresh",value:function(){if(!this.u)throw"refreshing only works when you initialize using a selector!";var t=this.options,e=this.u;return this.destroy(),this.constructor(e,t),this}},{key:"hash",get:function(){return window.location.hash.substring(1)}}]),s}();