function Layzr(t){this._lastScroll=0,this._ticking=!1,t=t||{},this._optionsContainer=document.querySelector(t.container)||window,this._optionsSelector=t.selector||"[data-layzr]",this._optionsAttr=t.attr||"data-layzr",this._optionsAttrSrcSet=t.attrSrcSet||"data-layzr-srcset",this._optionsAttrRetina=t.retinaAttr||"data-layzr-retina",this._optionsAttrBg=t.bgAttr||"data-layzr-bg",this._optionsAttrHidden=t.hiddenAttr||"data-layzr-hidden",this._optionsThreshold=t.threshold||0,this._optionsBefore=t.before||null,this._optionsAfter=t.after||null,this._optionsCallback=t.callback||null,this._retina=window.devicePixelRatio>1,this._srcAttr=this._retina?this._optionsAttrRetina:this._optionsAttr,this._nodes=document.querySelectorAll(this._optionsSelector),this._handlerBind=this._requestScroll.bind(this),this._create()}function simple_tooltip(t,e){jQuery(t).each((function(t){jQuery("body").append("
"+jQuery(this).find("span.tooltip-c").html()+"
");var i=jQuery("#"+e+t);jQuery(this).removeAttr("title").mouseover((function(){i.css({opacity:1,display:"none"}).fadeIn(400)})).mousemove((function(t){var e,s,n=jQuery(window).scrollTop(),o=jQuery(window).width(),a=15;e=o-30>=i.width()+t.pageX?t.pageX+a:o-i.width()-a,s=n+30>=t.pageY-i.height()?n+a:t.pageY-i.height()-33,i.css({left:e,top:s})})).mouseout((function(){i.css({left:"-9999px"})}))}))} jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(t,e,i,s,n){return jQuery.easing[jQuery.easing.def](t,e,i,s,n)},easeInQuad:function(t,e,i,s,n){return s*(e/=n)*e+i},easeOutQuad:function(t,e,i,s,n){return-s*(e/=n)*(e-2)+i},easeInOutQuad:function(t,e,i,s,n){return(e/=n/2)<1?s/2*e*e+i:-s/2*(--e*(e-2)-1)+i},easeInCubic:function(t,e,i,s,n){return s*(e/=n)*e*e+i},easeOutCubic:function(t,e,i,s,n){return s*((e=e/n-1)*e*e+1)+i},easeInOutCubic:function(t,e,i,s,n){return(e/=n/2)<1?s/2*e*e*e+i:s/2*((e-=2)*e*e+2)+i},easeInQuart:function(t,e,i,s,n){return s*(e/=n)*e*e*e+i},easeOutQuart:function(t,e,i,s,n){return-s*((e=e/n-1)*e*e*e-1)+i},easeInOutQuart:function(t,e,i,s,n){return(e/=n/2)<1?s/2*e*e*e*e+i:-s/2*((e-=2)*e*e*e-2)+i},easeInQuint:function(t,e,i,s,n){return s*(e/=n)*e*e*e*e+i},easeOutQuint:function(t,e,i,s,n){return s*((e=e/n-1)*e*e*e*e+1)+i},easeInOutQuint:function(t,e,i,s,n){return(e/=n/2)<1?s/2*e*e*e*e*e+i:s/2*((e-=2)*e*e*e*e+2)+i},easeInSine:function(t,e,i,s,n){return-s*Math.cos(e/n*(Math.PI/2))+s+i},easeOutSine:function(t,e,i,s,n){return s*Math.sin(e/n*(Math.PI/2))+i},easeInOutSine:function(t,e,i,s,n){return-s/2*(Math.cos(Math.PI*e/n)-1)+i},easeInExpo:function(t,e,i,s,n){return 0==e?i:s*Math.pow(2,10*(e/n-1))+i},easeOutExpo:function(t,e,i,s,n){return e==n?i+s:s*(1-Math.pow(2,-10*e/n))+i},easeInOutExpo:function(t,e,i,s,n){return 0==e?i:e==n?i+s:(e/=n/2)<1?s/2*Math.pow(2,10*(e-1))+i:s/2*(2-Math.pow(2,-10*--e))+i},easeInCirc:function(t,e,i,s,n){return-s*(Math.sqrt(1-(e/=n)*e)-1)+i},easeOutCirc:function(t,e,i,s,n){return s*Math.sqrt(1-(e=e/n-1)*e)+i},easeInOutCirc:function(t,e,i,s,n){return(e/=n/2)<1?-s/2*(Math.sqrt(1-e*e)-1)+i:s/2*(Math.sqrt(1-(e-=2)*e)+1)+i},easeInElastic:function(t,e,i,s,n){var o=1.70158,a=0,r=s;if(0==e)return i;if(1==(e/=n))return i+s;if(a||(a=.3*n),r=e-o&&s<=i+o&&!t.hasAttribute(this._optionsAttrHidden)},Layzr.prototype._reveal=function(t){var e=t.getAttribute(this._srcAttr)||t.getAttribute(this._optionsAttr),i=this;"function"==typeof this._optionsCallback&&(t.addEventListener?t.addEventListener("load",(function(){i._optionsCallback.call(t)})):t.attachEvent("onload",(function(){i._optionsCallback.call(t)})));"function"==typeof this._optionsBefore&&this._optionsBefore.call(t),t.hasAttribute(this._optionsAttrBg)?t.style.backgroundImage="url("+e+")":(e&&t.setAttribute("src",e),t.hasAttribute(this._optionsAttrSrcSet)&&t.setAttribute("srcset",t.getAttribute(this._optionsAttrSrcSet))),"function"==typeof this._optionsAfter&&this._optionsAfter.call(t),t.removeAttribute(this._optionsAttr),t.removeAttribute(this._optionsAttrSrcSet),t.removeAttribute(this._optionsAttrRetina),t.removeAttribute(this._optionsAttrBg),t.removeAttribute(this._optionsAttrHidden)},Layzr.prototype.updateSelector=function(){this._nodes=document.querySelectorAll(this._optionsSelector),this._prepareItems()},Layzr.prototype._prepareItems=function(){this._nodes.forEach((function(t){if(t.hasAttribute("data-src"))var e=t.getAttribute("data-src"),i=e.substring(e.lastIndexOf(".")+1);"png"!==i&&"svg"!==i||t.parentNode.classList.add("layzr-bg-transparent")}))},Layzr.prototype.update=function(){for(var t=this._nodes.length,e=[],i=0;i0,window.requestAnimationFrame&&(i.raf=window.requestAnimationFrame,i.caf=window.cancelAnimationFrame),i.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!i.pointerEvent){var s=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var o=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);o&&o.length>0&&((o=parseInt(o[1],10))>=1&&o<8&&(i.isOldIOSPhone=!0))}var a=s.match(/Android\s([0-9\.]*)/),r=a?a[1]:0;(r=parseFloat(r))>=1&&(r<4.4&&(i.isOldAndroid=!0),i.androidVersion=r),i.isMobileOpera=/opera mini|opera mobi/i.test(s)}for(var l,d,c=["transform","perspective","animationName"],h=["","webkit","Moz","ms","O"],u=0;u<4;u++){e=h[u];for(var p=0;p<3;p++)l=c[p],d=e+(e?l.charAt(0).toUpperCase()+l.slice(1):l),!i[l]&&d in t&&(i[l]=d);e&&!i.raf&&(e=e.toLowerCase(),i.raf=window[e+"RequestAnimationFrame"],i.raf&&(i.caf=window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"]))}if(!i.raf){var f=0;i.raf=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-f)),s=window.setTimeout((function(){t(e+i)}),i);return f=e+i,s},i.caf=function(t){clearTimeout(t)}}return i.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,n.features=i,i}};n.detectFeatures(),n.features.oldIE&&(n.bind=function(t,e,i,s){e=e.split(" ");for(var n,o=(s?"detach":"attach")+"Event",a=function(){i.handleEvent.call(i)},r=0;re-1?t-e:t<0?e+t:t},xt={},It=function(t,e){return xt[t]||(xt[t]=[]),xt[t].push(e)},St=function(t){var e=xt[t];if(e){var i=Array.prototype.slice.call(arguments);i.shift();for(var s=0;so.currItem.fitRatio?bt||(Ze(o.currItem,!1,!0),bt=!0):bt&&(Ze(o.currItem),bt=!1)),zt(et,ht.x,ht.y,g))},Et=function(t){t.container&&zt(t.container.style,t.initialPosition.x,t.initialPosition.y,t.initialZoomLevel,t)},Mt=function(t,e){e[z]=w+t+"px, 0px"+y},At=function(t,e){if(!a.loop&&e){var i=c+(mt.x*pt-t)/mt.x,s=Math.round(t-ce.x);(i<0&&s>0||i>=je()-1&&s<0)&&(t=ce.x+s*a.mainScrollEndFriction)}ce.x=t,Mt(t,h)},Pt=function(t,e){var i=he[t]-ft[t];return ct[t]+dt[t]+i-i*(e/v)},Ot=function(t,e){t.x=e.x,t.y=e.y,e.id&&(t.id=e.id)},Dt=function(t){t.x=Math.round(t.x),t.y=Math.round(t.y)},Ht=null,Ft=function(){Ht&&(n.unbind(document,"mousemove",Ft),n.addClass(t,"pswp--has_mouse"),a.mouseUsed=!0,St("mouseUsed")),Ht=setTimeout((function(){Ht=null}),100)},Wt=function(t,e){var i=qe(o.currItem,ut,t);return e&&(tt=i),i},Bt=function(t){return t||(t=o.currItem),t.initialZoomLevel},Rt=function(t){return t||(t=o.currItem),t.w>0?a.maxSpreadZoom:1},jt=function(t,e,i,s){return s===o.currItem.initialZoomLevel?(i[t]=o.currItem.initialPosition[t],!0):(i[t]=Pt(t,s),i[t]>e.min[t]?(i[t]=e.min[t],!0):i[t]=s)return Ut(t),o(i),void(a&&a());o((i-e)*n(r/s)+e),Nt[t].raf=M(d)}};d()},Qt={shout:St,listen:It,viewportSize:ut,options:a,isMainScrollAnimating:function(){return it},getZoomLevel:function(){return g},getCurrentIndex:function(){return c},isDragging:function(){return N},isZooming:function(){return K},setScrollOffset:function(t,e){ft.x=t,H=ft.y=e,St("updateScrollOffset",ft)},applyZoomPan:function(t,e,i,s){ht.x=e,ht.y=i,g=t,Lt(s)},init:function(){if(!r&&!l){var i;o.framework=n,o.template=t,o.bg=n.getChildByClass(t,"pswp__bg"),P=t.className,r=!0,F=n.detectFeatures(),M=F.raf,A=F.caf,z=F.transform,D=F.oldIE,o.scrollWrap=n.getChildByClass(t,"pswp__scroll-wrap"),o.container=n.getChildByClass(o.scrollWrap,"pswp__container"),h=o.container.style,o.itemHolders=_=[{el:o.container.children[0],wrap:0,index:-1},{el:o.container.children[1],wrap:0,index:-1},{el:o.container.children[2],wrap:0,index:-1}],_[0].el.style.display=_[2].el.style.display="none",function(){if(z){var e=F.perspective&&!E;return w="translate"+(e?"3d(":"("),void(y=F.perspective?", 0px)":")")}z="left",n.addClass(t,"pswp--ie"),Mt=function(t,e){e.left=t+"px"},Et=function(t){var e=t.fitRatio>1?1:t.fitRatio,i=t.container.style,s=e*t.w,n=e*t.h;i.width=s+"px",i.height=n+"px",i.left=t.initialPosition.x+"px",i.top=t.initialPosition.y+"px"},Lt=function(){if(et){var t=et,e=o.currItem,i=e.fitRatio>1?1:e.fitRatio,s=i*e.w,n=i*e.h;t.width=s+"px",t.height=n+"px",t.left=ht.x+"px",t.top=ht.y+"px"}}}(),m={resize:o.updateSize,orientationchange:function(){clearTimeout(W),W=setTimeout((function(){ut.x!==o.scrollWrap.clientWidth&&o.updateSize()}),500)},scroll:Yt,keydown:$t,click:Gt};var s=F.isOldIOSPhone||F.isOldAndroid||F.isMobileOpera;for(F.animationName&&F.transform&&!s||(a.showAnimationDuration=a.hideAnimationDuration=0),i=0;i=je())&&(c=0),o.currItem=Re(c),(F.isOldIOSPhone||F.isOldAndroid)&&(vt=!1),t.setAttribute("aria-hidden","false"),a.modal&&(vt?t.style.position="fixed":(t.style.position="absolute",t.style.top=n.getScrollY()+"px")),void 0===H&&(St("initialLayout"),H=O=n.getScrollY());var d="pswp--open ";for(a.mainClass&&(d+=a.mainClass+" "),a.showHideOpacity&&(d+="pswp--animate_opacity "),d+=E?"pswp--touch":"pswp--notouch",d+=F.animationName?" pswp--css_animation":"",d+=F.svg?" pswp--svg":"",n.addClass(t,d),o.updateSize(),u=-1,gt=null,i=0;i<3;i++)Mt((i+u)*mt.x,_[i].el.style);D||n.bind(o.scrollWrap,f,o),It("initialZoomInEnd",(function(){o.setContent(_[0],c-1),o.setContent(_[2],c+1),_[0].el.style.display=_[2].el.style.display="block",a.focus&&t.focus(),n.bind(document,"keydown",o),F.transform&&n.bind(o.scrollWrap,"click",o),a.mouseUsed||n.bind(document,"mousemove",Ft),n.bind(window,"resize scroll orientationchange",o),St("bindEvents")})),o.setContent(_[1],c),o.updateCurrItem(),St("afterInit"),vt||(b=setInterval((function(){qt||N||K||g!==o.currItem.initialZoomLevel||o.updateSize()}),1e3)),n.addClass(t,"pswp--visible")}},close:function(){r&&(r=!1,l=!0,St("close"),n.unbind(window,"resize scroll orientationchange",o),n.unbind(window,"scroll",m.scroll),n.unbind(document,"keydown",o),n.unbind(document,"mousemove",Ft),F.transform&&n.unbind(o.scrollWrap,"click",o),N&&n.unbind(window,p,o),clearTimeout(W),St("unbindEvents"),$e(o.currItem,null,!0,o.destroy))},destroy:function(){St("destroy"),He&&clearTimeout(He),t.setAttribute("aria-hidden","true"),t.className=P,b&&clearInterval(b),n.unbind(o.scrollWrap,f,o),n.unbind(window,"scroll",o),fe(),Xt(),xt=null},panTo:function(t,e,i){i||(t>tt.min.x?t=tt.min.x:ttt.min.y?e=tt.min.y:e=3&&(u+=gt+(gt>0?-3:3),i=3);for(var s=0;s0?(e=_.shift(),_[2]=e,u++,Mt((u+2)*mt.x,e.el.style),o.setContent(e,c-i+s+1+1)):(e=_.pop(),_.unshift(e),u--,Mt(u*mt.x,e.el.style),o.setContent(e,c+i-s-1-1));if(et&&1===Math.abs(gt)){var n=Re(x);n.initialZoomLevel!==g&&(qe(n,ut),Ze(n),Et(n))}gt=0,o.updateCurrZoomItem(),x=c,St("afterChange")}}},updateSize:function(e){if(!vt&&a.modal){var i=n.getScrollY();if(H!==i&&(t.style.top=i+"px",H=i),!e&&yt.x===window.innerWidth&&yt.y===window.innerHeight)return;yt.x=window.innerWidth,yt.y=window.innerHeight,t.style.height=yt.y+"px"}if(ut.x=o.scrollWrap.clientWidth,ut.y=o.scrollWrap.clientHeight,Yt(),mt.x=ut.x+Math.round(ut.x*a.spacing),mt.y=ut.y,At(mt.x*pt),St("beforeResize"),void 0!==u){for(var s,r,l,d=0;d<3;d++)s=_[d],Mt((d+u)*mt.x,s.el.style),l=c+d-1,a.loop&&je()>2&&(l=_t(l)),(r=Re(l))&&(C||r.needsUpdate||!r.bounds)?(o.cleanSlide(r),o.setContent(s,l),1===d&&(o.currItem=r,o.updateCurrZoomItem(!0)),r.needsUpdate=!1):-1===s.index&&l>=0&&o.setContent(s,l),r&&r.container&&(qe(r,ut),Ze(r),Et(r));C=!1}v=g=o.currItem.initialZoomLevel,(tt=o.currItem.bounds)&&(ht.x=tt.center.x,ht.y=tt.center.y,Lt(!0)),St("resize")},zoomTo:function(t,e,i,s,o){e&&(v=g,he.x=Math.abs(e.x)-ht.x,he.y=Math.abs(e.y)-ht.y,Ot(ct,ht));var a=Wt(t,!1),r={};jt("x",a,r,t),jt("y",a,r,t);var l=g,d=ht.x,c=ht.y;Dt(r);var h=function(e){1===e?(g=t,ht.x=r.x,ht.y=r.y):(g=(t-l)*e+l,ht.x=(r.x-d)*e+d,ht.y=(r.y-c)*e+c),o&&o(e),Lt(1===e)};i?Zt("customZoomTo",0,1,i,s||n.easing.sine.inOut,h):h(1)}},Kt={},Jt={},te={},ee={},ie={},se=[],ne={},oe=[],ae={},re=0,le={x:0,y:0},de=0,ce={x:0,y:0},he={x:0,y:0},ue={x:0,y:0},pe=function(t,e){return ae.x=Math.abs(t.x-e.x),ae.y=Math.abs(t.y-e.y),Math.sqrt(ae.x*ae.x+ae.y*ae.y)},fe=function(){X&&(A(X),X=null)},me=function(){N&&(X=M(me),Le())},ge=function(t,e){return!(!t||t===document)&&!(t.getAttribute("class")&&t.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(e(t)?t:ge(t.parentNode,e))},ve={},we=function(t,e){return ve.prevent=!ge(t.target,a.isClickableElement),St("preventDragEvent",t,e,ve),ve.prevent},ye=function(t,e){return e.x=t.pageX,e.y=t.pageY,e.id=t.identifier,e},be=function(t,e,i){i.x=.5*(t.x+e.x),i.y=.5*(t.y+e.y)},Ce=function(){var t=ht.y-o.currItem.initialPosition.y;return 1-Math.abs(t/(ut.y/2))},_e={},xe={},Ie=[],Se=function(t){for(;Ie.length>0;)Ie.pop();return L?(lt=0,se.forEach((function(t){0===lt?Ie[0]=t:1===lt&&(Ie[1]=t),lt++}))):t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(Ie[0]=ye(t.touches[0],_e),t.touches.length>1&&(Ie[1]=ye(t.touches[1],xe))):(_e.x=t.pageX,_e.y=t.pageY,_e.id="",Ie[0]=_e),Ie},Te=function(t,e){var i,s,n,r,l=ht[t]+e[t],d=e[t]>0,c=ce.x+e.x,h=ce.x-ne.x;return i=l>tt.min[t]||ltt.min[t]&&(i=a.panEndFriction,tt.min[t]-l,s=tt.min[t]-ct[t]),(s<=0||h<0)&&je()>1?(r=c,h<0&&c>ne.x&&(r=ne.x)):tt.min.x!==tt.max.x&&(n=l)):(l0)&&je()>1?(r=c,h>0&&co.currItem.fitRatio&&(ht[t]+=e[t]*i)):(void 0!==r&&(At(r,!0),Z=r!==ne.x),tt.min.x!==tt.max.x&&(void 0!==n?ht.x=n:Z||(ht.x+=e.x*i)),void 0!==r)},ke=function(t){if(!("mousedown"===t.type&&t.button>0)){if(Be)return void t.preventDefault();if(!Y||"mousedown"!==t.type){if(we(t,!0)&&t.preventDefault(),St("pointerDown"),L){var e=n.arraySearch(se,t.pointerId,"id");e<0&&(e=se.length),se[e]={x:t.pageX,y:t.pageY,id:t.pointerId}}var i=Se(t),s=i.length;Q=null,Xt(),N&&1!==s||(N=nt=!0,n.bind(window,p,o),$=rt=ot=G=Z=V=q=U=!1,st=null,St("firstTouchStart",i),Ot(ct,ht),dt.x=dt.y=0,Ot(ee,i[0]),Ot(ie,ee),ne.x=mt.x*pt,oe=[{x:ee.x,y:ee.y}],R=B=Tt(),Wt(g,!0),fe(),me()),!K&&s>1&&!it&&!Z&&(v=g,U=!1,K=q=!0,dt.y=dt.x=0,Ot(ct,ht),Ot(Kt,i[0]),Ot(Jt,i[1]),be(Kt,Jt,ue),he.x=Math.abs(ue.x)-ht.x,he.y=Math.abs(ue.y)-ht.y,J=pe(Kt,Jt))}}},ze=function(t){if(t.preventDefault(),L){var e=n.arraySearch(se,t.pointerId,"id");if(e>-1){var i=se[e];i.x=t.pageX,i.y=t.pageY}}if(N){var s=Se(t);if(st||V||K)Q=s;else if(ce.x!==mt.x*pt)st="h";else{var o=Math.abs(s[0].x-ee.x)-Math.abs(s[0].y-ee.y);Math.abs(o)>=10&&(st=o>0?"h":"v",Q=s)}}},Le=function(){if(Q){var t=Q.length;if(0!==t)if(Ot(Kt,Q[0]),te.x=Kt.x-ee.x,te.y=Kt.y-ee.y,K&&t>1){if(ee.x=Kt.x,ee.y=Kt.y,!te.x&&!te.y&&function(t,e){return t.x===e.x&&t.y===e.y}(Q[1],Jt))return;Ot(Jt,Q[1]),U||(U=!0,St("zoomGestureStarted"));var e=pe(Kt,Jt),i=Oe(e);i>o.currItem.initialZoomLevel+o.currItem.initialZoomLevel/15&&(rt=!0);var s=1,n=Bt(),r=Rt();if(i1&&(s=1),i=n-s*(n/3);else i>r&&((s=(i-r)/(6*n))>1&&(s=1),i=r+s*n);s<0&&(s=0),e,be(Kt,Jt,le),dt.x+=le.x-ue.x,dt.y+=le.y-ue.y,Ot(ue,le),ht.x=Pt("x",i),ht.y=Pt("y",i),$=i>g,g=i,Lt()}else{if(!st)return;if(nt&&(nt=!1,Math.abs(te.x)>=10&&(te.x-=Q[0].x-ie.x),Math.abs(te.y)>=10&&(te.y-=Q[0].y-ie.y)),ee.x=Kt.x,ee.y=Kt.y,0===te.x&&0===te.y)return;if("v"===st&&a.closeOnVerticalDrag&&"fit"===a.scaleMode&&g===o.currItem.initialZoomLevel){dt.y+=te.y,ht.y+=te.y;var d=Ce();return G=!0,St("onVerticalDrag",d),kt(d),void Lt()}(function(t,e,i){if(t-R>50){var s=oe.length>2?oe.shift():{};s.x=e,s.y=i,oe.push(s),R=t}})(Tt(),Kt.x,Kt.y),V=!0,tt=o.currItem.bounds,Te("x",te)||(Te("y",te),Dt(ht),Lt())}}},Ee=function(t){if(F.isOldAndroid){if(Y&&"mouseup"===t.type)return;t.type.indexOf("touch")>-1&&(clearTimeout(Y),Y=setTimeout((function(){Y=0}),600))}var e;if(St("pointerUp"),we(t,!1)&&t.preventDefault(),L){var i=n.arraySearch(se,t.pointerId,"id");if(i>-1)if(e=se.splice(i,1)[0],navigator.pointerEnabled)e.type=t.pointerType||"mouse";else{e.type={4:"mouse",2:"touch",3:"pen"}[t.pointerType],e.type||(e.type=t.pointerType||"mouse")}}var s,r=Se(t),l=r.length;if("mouseup"===t.type&&(l=0),2===l)return Q=null,!0;1===l&&Ot(ie,r[0]),0!==l||st||it||(e||("mouseup"===t.type?e={x:t.pageX,y:t.pageY,type:"mouse"}:t.changedTouches&&t.changedTouches[0]&&(e={x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY,type:"touch"})),St("touchRelease",t,e));var d=-1;if(0===l&&(N=!1,n.unbind(window,p,o),fe(),K?d=0:-1!==de&&(d=Tt()-de)),de=1===l?Tt():-1,s=-1!==d&&d<150?"zoom":"swipe",K&&l<2&&(K=!1,1===l&&(s="zoomPointerUp"),St("zoomGestureEnded")),Q=null,V||U||it||G)if(Xt(),j||(j=Me()),j.calculateSwipeSpeed("x"),G){if(Ce()o.currItem.fitRatio&&Ae(j))}},Me=function(){var t,e,i={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(s){oe.length>1?(t=Tt()-R+50,e=oe[oe.length-2][s]):(t=Tt()-B,e=ie[s]),i.lastFlickOffset[s]=ee[s]-e,i.lastFlickDist[s]=Math.abs(i.lastFlickOffset[s]),i.lastFlickDist[s]>20?i.lastFlickSpeed[s]=i.lastFlickOffset[s]/t:i.lastFlickSpeed[s]=0,Math.abs(i.lastFlickSpeed[s])<.1&&(i.lastFlickSpeed[s]=0),i.slowDownRatio[s]=.95,i.slowDownRatioReverse[s]=1-i.slowDownRatio[s],i.speedDecelerationRatio[s]=1},calculateOverBoundsAnimOffset:function(t,e){i.backAnimStarted[t]||(ht[t]>tt.min[t]?i.backAnimDestination[t]=tt.min[t]:ht[t]30&&(d||e.lastFlickOffset.x>20)?s=-1:l<-30&&(d||e.lastFlickOffset.x<-20)&&(s=1)}s&&((c+=s)<0?(c=a.loop?je()-1:0,r=!0):c>=je()&&(c=a.loop?0:je()-1,r=!0),r&&!a.loop||(gt+=s,pt-=s,i=!0));var h,u=mt.x*pt,p=Math.abs(u-ce.x);return i||u>ce.x==e.lastFlickSpeed.x>0?(h=Math.abs(e.lastFlickSpeed.x)>0?p/Math.abs(e.lastFlickSpeed.x):333,h=Math.min(h,400),h=Math.max(h,250)):h=333,re===c&&(i=!1),it=!0,St("mainScrollAnimStart"),Zt("mainScroll",ce.x,u,h,n.easing.cubic.out,At,(function(){Xt(),it=!1,re=-1,(i||re!==c)&&o.updateCurrItem(),St("mainScrollAnimComplete")})),i&&o.updateCurrItem(!0),i},Oe=function(t){return 1/J*t*v},De=function(){var t=g,e=Bt(),i=Rt();gi&&(t=i);var s,a=at;return ot&&!$&&!rt&&g1||navigator.msMaxTouchPoints>1),o.likelyTouchDevice=E,m[I]=ke,m[S]=ze,m[T]=Ee,k&&(m[k]=m[T]),F.touch&&(f+=" mousedown",p+=" mousemove mouseup",m.mousedown=m[I],m.mousemove=m[S],m.mouseup=m[T]),E||(a.allowPanToNext=!1)}}});var He,Fe,We,Be,Re,je,$e=function(e,i,s,r){var l;He&&clearTimeout(He),Be=!0,We=!0,e.initialLayout?(l=e.initialLayout,e.initialLayout=null):l=a.getThumbBoundsFn&&a.getThumbBoundsFn(c);var h=s?a.hideAnimationDuration:a.showAnimationDuration,u=function(){Ut("initialZoom"),s?(o.template.removeAttribute("style"),o.bg.removeAttribute("style")):(kt(1),i&&(i.style.display="block"),n.addClass(t,"pswp--animated-in"),St("initialZoom"+(s?"OutEnd":"InEnd"))),r&&r(),Be=!1};if(!h||!l||void 0===l.x)return St("initialZoom"+(s?"Out":"In")),g=e.initialZoomLevel,Ot(ht,e.initialPosition),Lt(),t.style.opacity=s?0:1,kt(1),void(h?setTimeout((function(){u()}),h):u());!function(){var i=d,r=!o.currItem.src||o.currItem.loadError||a.showHideOpacity;e.miniImg&&(e.miniImg.style.webkitBackfaceVisibility="hidden"),s||(g=l.w/e.w,ht.x=l.x,ht.y=l.y-O,o[r?"template":"bg"].style.opacity=.001,Lt()),Vt("initialZoom"),s&&!i&&n.removeClass(t,"pswp--animated-in"),r&&(s?n[(i?"remove":"add")+"Class"](t,"pswp--animate_opacity"):setTimeout((function(){n.addClass(t,"pswp--animate_opacity")}),30)),He=setTimeout((function(){if(St("initialZoom"+(s?"Out":"In")),s){var o=l.w/e.w,a={x:ht.x,y:ht.y},d=g,c=at,p=function(e){1===e?(g=o,ht.x=l.x,ht.y=l.y-H):(g=(o-d)*e+d,ht.x=(l.x-a.x)*e+a.x,ht.y=(l.y-H-a.y)*e+a.y),Lt(),r?t.style.opacity=1-e:kt(c-e*c)};i?Zt("initialZoom",0,1,h,n.easing.cubic.out,p,u):(p(1),He=setTimeout(u,h+20))}else g=e.initialZoomLevel,Ot(ht,e.initialPosition),Lt(),kt(1),r?t.style.opacity=1:kt(1),He=setTimeout(u,h+20)}),s?25:90)}()},Ge={},Ye=[],Ne={index:0,errorMsg:'
The image could not be loaded.
',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Fe.length}},qe=function(t,e,i){if(t.src&&!t.loadError){var s=!i;if(s&&(t.vGap||(t.vGap={top:0,bottom:0}),St("parseVerticalMargin",t)),Ge.x=e.x,Ge.y=e.y-t.vGap.top-t.vGap.bottom,s){var n=Ge.x/t.w,o=Ge.y/t.h;t.fitRatio=n1&&(i=1),t.initialZoomLevel=i,t.bounds||(t.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}})}if(!i)return;return function(t,e,i){var s=t.bounds;s.center.x=Math.round((Ge.x-e)/2),s.center.y=Math.round((Ge.y-i)/2)+t.vGap.top,s.max.x=e>Ge.x?Math.round(Ge.x-e):s.center.x,s.max.y=i>Ge.y?Math.round(Ge.y-i)+t.vGap.top:s.center.y,s.min.x=e>Ge.x?0:s.center.x,s.min.y=i>Ge.y?t.vGap.top:s.center.y}(t,t.w*i,t.h*i),s&&i===t.initialZoomLevel&&(t.initialPosition=t.bounds.center),t.bounds}return t.w=t.h=0,t.initialZoomLevel=t.fitRatio=1,t.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}},t.initialPosition=t.bounds.center,t.bounds},Ue=function(t,e,i,s,n,a){e.loadError||s&&(e.imageAppended=!0,Ze(e,s,e===o.currItem&&bt),i.appendChild(s),a&&setTimeout((function(){e&&e.loaded&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null)}),500))},Ve=function(t){t.loading=!0,t.loaded=!1;var e=t.img=n.createEl("pswp__img","img"),i=function(){t.loading=!1,t.loaded=!0,t.loadComplete?t.loadComplete(t):t.img=null,e.onload=e.onerror=null,e=null};return e.onload=i,e.onerror=function(){t.loadError=!0,i()},e.src=t.src,e},Xe=function(t,e){if(t.src&&t.loadError&&t.container)return e&&(t.container.innerHTML=""),t.container.innerHTML=a.errorMsg.replace("%url%",t.src),!0},Ze=function(t,e,i){if(t.src){e||(e=t.container.lastChild);var s=i?t.w:Math.round(t.w*t.fitRatio),n=i?t.h:Math.round(t.h*t.fitRatio);t.placeholder&&!t.loaded&&(t.placeholder.style.width=s+"px",t.placeholder.style.height=n+"px"),e.style.width=s+"px",e.style.height=n+"px"}},Qe=function(){if(Ye.length){for(var t,e=0;e=0,n=Math.min(i[0],je()),r=Math.min(i[1],je());for(e=1;e<=(s?r:n);e++)o.lazyLoadItem(c+e);for(e=1;e<=(s?n:r);e++)o.lazyLoadItem(c-e)})),It("initialLayout",(function(){o.currItem.initialLayout=a.getThumbBoundsFn&&a.getThumbBoundsFn(c)})),It("mainScrollAnimComplete",Qe),It("initialZoomInEnd",Qe),It("destroy",(function(){for(var t,e=0;e=0&&void 0!==Fe[t]&&Fe[t]},allowProgressiveImg:function(){return a.forceProgressiveLoading||!E||a.mouseUsed||screen.width>1200},setContent:function(t,e){a.loop&&(e=_t(e));var i=o.getItemAt(t.index);i&&(i.container=null);var s,l=o.getItemAt(e);if(l){St("gettingData",e,l),t.index=e,t.item=l;var d=l.container=n.createEl("pswp__zoom-wrap");if(!l.src&&l.html&&(l.html.tagName?d.appendChild(l.html):d.innerHTML=l.html),Xe(l),qe(l,ut),!l.src||l.loadError||l.loaded)l.src&&!l.loadError&&((s=n.createEl("pswp__img","img")).style.opacity=1,s.src=l.src,Ze(l,s),Ue(0,l,d,s));else{if(l.loadComplete=function(i){if(r){if(t&&t.index===e){if(Xe(i,!0))return i.loadComplete=i.img=null,qe(i,ut),Et(i),void(t.index===c&&o.updateCurrZoomItem());i.imageAppended?!Be&&i.placeholder&&(i.placeholder.style.display="none",i.placeholder=null):F.transform&&(it||Be)?Ye.push({item:i,baseDiv:d,img:i.img,index:e,holder:t,clearPlaceholder:!0}):Ue(0,i,d,i.img,0,!0)}i.loadComplete=null,i.img=null,St("imageLoadComplete",e,i)}},n.features.transform){var h="pswp__img pswp__img--placeholder";h+=l.msrc?"":" pswp__img--placeholder--blank";var u=n.createEl(h,l.msrc?"img":"");l.msrc&&(u.src=l.msrc),Ze(l,u),d.appendChild(u),l.placeholder=u}l.loading||Ve(l),o.allowProgressiveImg()&&(!We&&F.transform?Ye.push({item:l,baseDiv:d,img:l.img,index:e,holder:t}):Ue(0,l,d,l.img,0,!0))}We||e!==c?Et(l):(et=d.style,$e(l,s||l.img)),t.el.innerHTML="",t.el.appendChild(d)}else t.el.innerHTML=""},cleanSlide:function(t){t.img&&(t.img.onload=t.img.onerror=null),t.loaded=t.loading=t.img=t.imageAppended=!1}}});var Ke,Je,ti={},ei=function(t,e,i){var s=document.createEvent("CustomEvent"),n={origEvent:t,target:t.target,releasePoint:e,pointerType:i||"touch"};s.initCustomEvent("pswpTap",!0,!0,n),t.target.dispatchEvent(s)};Ct("Tap",{publicMethods:{initTap:function(){It("firstTouchStart",o.onTapStart),It("touchRelease",o.onTapRelease),It("destroy",(function(){ti={},Ke=null}))},onTapStart:function(t){t.length>1&&(clearTimeout(Ke),Ke=null)},onTapRelease:function(t,e){if(e&&!V&&!q&&!qt){var i=e;if(Ke&&(clearTimeout(Ke),Ke=null,function(t,e){return Math.abs(t.x-e.x)<25&&Math.abs(t.y-e.y)<25}(i,ti)))return void St("doubleTap",i);if("mouse"===e.type)return void ei(t,e,"mouse");if("BUTTON"===t.target.tagName.toUpperCase()||n.hasClass(t.target,"pswp__single-tap"))return void ei(t,e);Ot(ti,i),Ke=setTimeout((function(){ei(t,e),Ke=null}),300)}}}}),Ct("DesktopZoom",{publicMethods:{initDesktopZoom:function(){D||(E?It("mouseUsed",(function(){o.setupDesktopZoom()})):o.setupDesktopZoom(!0))},setupDesktopZoom:function(e){Je={};var i="wheel mousewheel DOMMouseScroll";It("bindEvents",(function(){n.bind(t,i,o.handleMouseWheel)})),It("unbindEvents",(function(){Je&&n.unbind(t,i,o.handleMouseWheel)})),o.mouseZoomedIn=!1;var s,a=function(){o.mouseZoomedIn&&(n.removeClass(t,"pswp--zoomed-in"),o.mouseZoomedIn=!1),g<1?n.addClass(t,"pswp--zoom-allowed"):n.removeClass(t,"pswp--zoom-allowed"),r()},r=function(){s&&(n.removeClass(t,"pswp--dragging"),s=!1)};It("resize",a),It("afterChange",a),It("pointerDown",(function(){o.mouseZoomedIn&&(s=!0,n.addClass(t,"pswp--dragging"))})),It("pointerUp",r),e||a()},handleMouseWheel:function(t){if(g<=o.currItem.fitRatio)return a.modal&&(!a.closeOnScroll||qt||N?t.preventDefault():z&&Math.abs(t.deltaY)>2&&(d=!0,o.close())),!0;if(t.stopPropagation(),Je.x=0,"deltaX"in t)1===t.deltaMode?(Je.x=18*t.deltaX,Je.y=18*t.deltaY):(Je.x=t.deltaX,Je.y=t.deltaY);else if("wheelDelta"in t)t.wheelDeltaX&&(Je.x=-.16*t.wheelDeltaX),t.wheelDeltaY?Je.y=-.16*t.wheelDeltaY:Je.y=-.16*t.wheelDelta;else{if(!("detail"in t))return;Je.y=t.detail}Wt(g,!0);var e=ht.x-Je.x,i=ht.y-Je.y;(a.modal||e<=tt.min.x&&e>=tt.max.x&&i<=tt.min.y&&i>=tt.max.y)&&t.preventDefault(),o.panTo(e,i)},toggleDesktopZoom:function(e){e=e||{x:ut.x/2+ft.x,y:ut.y/2+ft.y};var i=a.getDoubleTapZoom(!0,o.currItem),s=g===i;o.mouseZoomedIn=!s,o.zoomTo(s?o.currItem.initialZoomLevel:i,e,333),n[(s?"remove":"add")+"Class"](t,"pswp--zoomed-in")}}});var ii,si,ni,oi,ai,ri,li,di,ci,hi,ui,pi,fi={history:!0,galleryUID:1},mi=function(){return ui.hash.substring(1)},gi=function(){ii&&clearTimeout(ii),ni&&clearTimeout(ni)},vi=function(){var t=mi(),e={};if(t.length<5)return e;var i,s=t.split("&");for(i=0;i-1&&("&"===(li=li.substring(0,e)).slice(-1)&&(li=li.slice(0,-1))),setTimeout((function(){r&&n.bind(window,"hashchange",o.onHashChange)}),40)}},onHashChange:function(){return mi()===li?(ci=!0,void o.close()):void(oi||(ai=!0,o.goTo(vi().pid),ai=!1))},updateURL:function(){gi(),ai||(di?ii=setTimeout(wi,800):wi())}}}),n.extend(o,Qt)}})),function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.PhotoSwipeUI_Default=e()}(this,(function(){"use strict";return function(t,e){var i,s,n,o,a,r,l,d,c,h,u,p,f,m,g,v,w,y,b=this,C=!1,_=!0,x=!0,I={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(t,e){return t.title?(e.children[0].innerHTML=t.title,!0):(e.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return t.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return t.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},S=function(t){if(v)return!0;t=t||window.event,g.timeToIdle&&g.mouseUsed&&!c&&D();for(var i,s,n=(t.target||t.srcElement).getAttribute("class")||"",o=0;o-1&&(i.onTap(),s=!0);if(s){t.stopPropagation&&t.stopPropagation(),v=!0;var a=e.features.isOldAndroid?600:30;setTimeout((function(){v=!1}),a)}},T=function(){return!t.likelyTouchDevice||g.mouseUsed||screen.width>g.fitControlsWidth},k=function(t,i,s){e[(s?"add":"remove")+"Class"](t,"pswp__"+i)},z=function(){var t=1===g.getNumItemsFn();t!==m&&(k(s,"ui--one-slide",t),m=t)},L=function(){k(l,"share-modal--hidden",x)},E=function(){return(x=!x)?(e.removeClass(l,"pswp__share-modal--fade-in"),setTimeout((function(){x&&L()}),300)):(L(),setTimeout((function(){x||e.addClass(l,"pswp__share-modal--fade-in")}),30)),x||A(),!1},M=function(e){var i=(e=e||window.event).target||e.srcElement;return t.shout("shareLinkClick",e,i),!(!i.href||!i.hasAttribute("download")&&(window.open(i.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),x||E(),1))},A=function(){for(var t,e,i,s,n="",o=0;o