!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(h,i,e,t){var m={features:null,bind:function(e,t,n,i){var o=(i?"remove":"add")+"EventListener";t=t.split(" ");for(var a=0;af.currItem.fitRatio?we||(qt(f.currItem,!1,!0),we=!0):we&&(qt(f.currItem),we=!1)),De(te,de.x,de.y,y))},ke=function(e){e.container&&De(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},_e=function(e,t){t[M]=b+e+"px, 0px"+w},Oe=function(e,t){if(!v.loop&&t){var n=g+(fe.x*he-e)/fe.x,i=Math.round(e-ct.x);(n<0&&0=jt()-1&&i<0)&&(e=ct.x+i*v.mainScrollEndFriction)}ct.x=e,_e(e,r)},Le=function(e,t){var n=dt[e]-me[e];return ce[e]+ue[e]+n-n*(t/p)},Ae=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Pe=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Re=null,ze=function(){Re&&(m.unbind(document,"mousemove",ze),m.addClass(h,"pswp--has_mouse"),v.mouseUsed=!0,Te("mouseUsed")),Re=setTimeout(function(){Re=null},100)},Ze=function(e,t){var n=Xt(f.currItem,pe,e);return t&&(ee=n),n},Ne=function(e){return e||(e=f.currItem),e.initialZoomLevel},Be=function(e){return e||(e=f.currItem),0t.min[e]?(n[e]=t.min[e],!0):n[e]=jt())&&(g=0),f.currItem=Bt(g),(Z.isOldIOSPhone||Z.isOldAndroid)&&(ge=!1),h.setAttribute("aria-hidden","false"),v.modal&&(ge?h.style.position="fixed":(h.style.position="absolute",h.style.top=m.getScrollY()+"px")),void 0===z&&(Te("initialLayout"),z=P=m.getScrollY());var n="pswp--open ";for(v.mainClass&&(n+=v.mainClass+" "),v.showHideOpacity&&(n+="pswp--animate_opacity "),n+=_?"pswp--touch":"pswp--notouch",n+=Z.animationName?" pswp--css_animation":"",n+=Z.svg?" pswp--svg":"",m.addClass(h,n),f.updateSize(),s=-1,ve=null,e=0;e<3;e++)_e((e+s)*fe.x,E[e].el.style);R||m.bind(f.scrollWrap,c,f),Ie("initialZoomInEnd",function(){f.setContent(E[0],g-1),f.setContent(E[2],g+1),E[0].el.style.display=E[2].el.style.display="block",v.focus&&h.focus(),m.bind(document,"keydown",f),Z.transform&&m.bind(f.scrollWrap,"click",f),v.mouseUsed||m.bind(document,"mousemove",ze),m.bind(window,"resize scroll orientationchange",f),Te("bindEvents")}),f.setContent(E[1],g),f.updateCurrItem(),Te("afterInit"),ge||(x=setInterval(function(){Xe||X||J||y!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),m.addClass(h,"pswp--visible")}},close:function(){l&&(o=!(l=!1),Te("close"),m.unbind(window,"resize scroll orientationchange",f),m.unbind(window,"scroll",d.scroll),m.unbind(document,"keydown",f),m.unbind(document,"mousemove",ze),Z.transform&&m.unbind(f.scrollWrap,"click",f),X&&m.unbind(window,u,f),clearTimeout(N),Te("unbindEvents"),Ht(f.currItem,null,!0,f.destroy))},destroy:function(){Te("destroy"),Rt&&clearTimeout(Rt),h.setAttribute("aria-hidden","true"),h.className=A,x&&clearInterval(x),m.unbind(f.scrollWrap,c,f),m.unbind(window,"scroll",f),mt(),$e(),Ee=null},panTo:function(e,t,n){n||(e>ee.min.x?e=ee.min.x:eee.min.y?t=ee.min.y:tee.min[e]||ree.min[e]&&(n=v.panEndFriction,ee.min[e],i=ee.min[e]-ce[e]),(i<=0||u<0)&&1ot.x&&(a=ot.x)):ee.min.x!==ee.max.x&&(o=r)):(rf.currItem.fitRatio&&(de[e]+=t[e]*n)):(void 0!==a&&(Oe(a,!0),q=a!==ot.x),ee.min.x!==ee.max.x&&(void 0!==o?de.x=o:q||(de.x+=t.x*n)),void 0!==a)},St=function(e){if(!("mousedown"===e.type&&0f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(se=!0);var i=1,o=Ne(),a=Be();if(nf.currItem.fitRatio&&Ot(H))}},_t=function(){var t,n,i={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){n=1ee.min[t]?i.backAnimDestination[t]=ee.min[t]:de[t]=jt()&&(g=v.loop?0:jt()-1,o=!0),o&&!v.loop||(ve+=i,he-=i,n=!0));var s,l=fe.x*he,u=Math.abs(l-ct.x);return s=n||l>ct.x==0The image could not be loaded.',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return zt.length}},Xt=function(e,t,n){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}},e.initialPosition=e.bounds.center,e.bounds;var i,o,a,r,s=!n;if(s&&(e.vGap||(e.vGap={top:0,bottom:0}),Te("parseVerticalMargin",e)),Wt.x=t.x,Wt.y=t.y-e.vGap.top-e.vGap.bottom,s){var l=Wt.x/e.w,u=Wt.y/e.h;e.fitRatio=lWt.x?Math.round(Wt.x-o):r.center.x,r.max.y=a>Wt.y?Math.round(Wt.y-a)+i.vGap.top:r.center.y,r.min.x=o>Wt.x?0:r.center.x,r.min.y=a>Wt.y?i.vGap.top:r.center.y,s&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},Yt=function(e,t,n,i,o,a){t.loadError||i&&(t.imageAppended=!0,qt(t,i,t===f.currItem&&we),n.appendChild(i),a&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},Gt=function(e){e.loading=!0,e.loaded=!1;var t=e.img=m.createEl("pswp__img","img"),n=function(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,t.onload=t.onerror=null,t=null};return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t},$t=function(e,t){if(e.src&&e.loadError&&e.container)return t&&(e.container.innerHTML=""),e.container.innerHTML=v.errorMsg.replace("%url%",e.src),!0},qt=function(e,t,n){if(e.src){t||(t=e.container.lastChild);var i=n?e.w:Math.round(e.w*e.fitRatio),o=n?e.h:Math.round(e.h*e.fitRatio);e.placeholder&&!e.loaded&&(e.placeholder.style.width=i+"px",e.placeholder.style.height=o+"px"),t.style.width=i+"px",t.style.height=o+"px"}},Vt=function(){if(Ut.length){for(var e,t=0;t=ee.max.x&&n<=ee.min.y&&n>=ee.max.y)&&e.preventDefault(),f.panTo(t,n)},toggleDesktopZoom:function(e){e=e||{x:pe.x/2+me.x,y:pe.y/2+me.y};var t=v.getDoubleTapZoom(!0,f.currItem),n=y===t;f.mouseZoomedIn=!n,f.zoomTo(n?f.currItem.initialZoomLevel:t,e,333),m[(n?"remove":"add")+"Class"](h,"pswp--zoomed-in")}}});var nn,on,an,rn,sn,ln,un,cn,dn,pn,hn,mn,fn={history:!0,galleryUID:1},vn=function(){return hn.hash.substring(1)},gn=function(){nn&&clearTimeout(nn),an&&clearTimeout(an)},yn=function(){var e=vn(),t={};if(e.length<5)return t;var n,i=e.split("&");for(n=0;n