PageSourceSearch

https://www.ohpolly.com/cdn/shop/t/1735/assets/vendor-photoswipe.js?v=48584825539910101801782836741

js ohpolly.com collected 2026-10-03 20:37:56 UTC 51,961 bytes, 5 lines download raw bytes

vendor: 19,482 bytes, lines 1-4
1/*!
2 * PhotoSwipe 5.2.7 - https://photoswipe.com
3 * (c) 2022 Dmytro Semenov
4 */(function(n,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis<"u"?globalThis:n||self).PhotoSwipe=t()})(this,function(){function t(t2,i2,s2){const h2=document.createElement(i2||"div");return t2&&(h2.className=t2),s2&&s2.appendChild(h2),h2}function i(t2,i2){return t2.x=i2.x,t2.y=i2.y,i2.id!==void 0&&(t2.id=i2.id),t2}function s(t2){t2.x=Math.round(t2.x),t2.y=Math.round(t2.y)}function h(t2,i2){const s2=Math.abs(t2.x-i2.x),h2=Math.abs(t2.y-i2.y);return Math.sqrt(s2*s2+h2*h2)}function e(t2,i2){return t2.x===i2.x&&t2.y===i2.y}function n(t2,i2,s2){return Math.min(Math.max(t2,i2),s2)}function o(t2,i2,s2){let h2="translate3d("+t2+"px,"+(i2||0)+"px,0)";return s2!==void 0&&(h2+=" scale3d("+s2+","+s2+",1)"),h2}function r(t2,i2,s2,h2){t2.style.transform=o(i2,s2,h2)}function a(t2,i2,s2,h2){t2.style.transition=i2?i2+" "+s2+"ms "+(h2||"cubic-bezier(.4,0,.22,1)"):"none"}function c(t2,i2,s2){t2.style.width=typeof i2=="number"?i2+"px":i2,t2.style.height=typeof s2=="number"?s2+"px":s2}const l="idle",p="loading",u="loaded",d="error";let m=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{m=!0}}))}catch{}class f{constructor(){this.t=[]}add(t2,i2,s2,h2){this.i(t2,i2,s2,h2)}remove(t2,i2,s2,h2){this.i(t2,i2,s2,h2,!0)}removeAll(){this.t.forEach(t2=>{this.i(t2.target,t2.type,t2.listener,t2.passive,!0,!0)}),this.t=[]}i(t2,i2,s2,h2,e2,n2){if(!t2)return;const o2=e2?"removeEventListener":"addEventListener";i2.split(" ").forEach(i3=>{if(i3){n2||(e2?this.t=this.t.filter(h3=>h3.type!==i3||h3.listener!==s2||h3.target!==t2):this.t.push({target:t2,type:i3,listener:s2,passive:h2}));const r2=!!m&&{passive:h2||!1};t2[o2](i3,s2,r2)}})}}function w(t2,i2){if(t2.getViewportSizeFn){const s2=t2.getViewportSizeFn(t2,i2);if(s2)return s2}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function g(t2,i2,s2,h2,e2){let n2;if(i2.paddingFn)n2=i2.paddingFn(s2,h2,e2)[t2];else if(i2.padding)n2=i2.padding[t2];else{const s3="padding"+t2[0].toUpperCase()+t2.slice(1);i2[s3]&&(n2=i2[s3])}return n2||0}function _(t2,i2,s2,h2){return{x:i2.x-g("left",t2,i2,s2,h2)-g("right",t2,i2,s2,h2),y:i2.y-g("top",t2,i2,s2,h2)-g("bottom",t2,i2,s2,h2)}}class v{constructor(t2){this.slide=t2,this.currZoomLevel=1,this.center={},this.max={},this.min={},this.reset()}update(t2){this.currZoomLevel=t2,this.slide.width?(this.o("x"),this.o("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}o(t2){const{pswp:i2}=this.slide,s2=this.slide[t2==="x"?"width":"height"]*this.currZoomLevel,h2=g(t2==="x"?"left":"top",i2.options,i2.viewportSize,this.slide.data,this.slide.index),e2=this.slide.panAreaSize[t2];this.center[t2]=Math.round((e2-s2)/2)+h2,this.max[t2]=s2>e2?Math.round(e2-s2)+h2:this.center[t2],this.min[t2]=s2>e2?h2:this.center[t2]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t2,i2){return n(i2,this.max[t2],this.min[t2])}}class y{constructor(t2,i2,s2,h2){this.pswp=h2,this.options=t2,this.itemData=i2,this.index=s2}update(t2,i2,s2){this.elementSize={x:t2,y:i2},this.panAreaSize=s2;const h2=this.panAreaSize.x/this.elementSize.x,e2=this.panAreaSize.y/this.elementSize.y;this.fit=Math.min(1,h2<e2?h2:e2),this.fill=Math.min(1,h2>e2?h2:e2),this.vFill=Math.min(1,e2),this.initial=this.l(),this.secondary=this.p(),this.max=Math.max(this.initial,this.secondary,this.u()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}m(t2){const i2=t2+"ZoomLevel",s2=this.options[i2];if(s2)return typeof s2=="function"?s2(this):s2==="fill"?this.fill:s2==="fit"?this.fit:Number(s2)}p(){let t2=this.m("secondary");return t2||(t2=Math.min(1,3*this.fit),t2*this.elementSize.x>4e3&&(t2=4e3/this.elementSize.x),t2)}l(){return this.m("initial")||this.fit}u(){return this.m("max")||Math.max(1,4*this.fit)}}class b{constructor(i2,s2,h2){this.data=i2,this.index=s2,this.pswp=h2,this.isActive=s2===h2.currIndex,this.currentResolution=0,this.panAreaSize={},this.isFirstSlide=this.isActive&&!h2.opener.isOpen,this.zoomLevels=new y(h2.options,i2,s2,h2),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:s2}),this.pan={x:0,y:0},this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=t("pswp__zoom-wrap"),this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.bounds=new v(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t2){t2&&!this.isActive?this.activate():!t2&&this.isActive&&this.deactivate()}append(t2){this.holderElement=t2,this.data?(this.calculateSize(),this.container.style.transformOrigin="0 0",this.load(),this.appendHeavy(),this.updateContentSize(),this.holderElement.innerHTML="",this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate()):this.holderElement.innerHTML=""}load(){this.content.load(),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t2}=this;!this.heavyAppended&&t2.opener.isOpen&&!t2.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t2){const i2=this.currentResolution||this.zoomLevels.initial;if(!i2)return;const s2=Math.round(this.width*i2)||this.pswp.viewportSize.x,h2=Math.round(this.height*i2)||this.pswp.viewportSize.y;(this.sizeChanged(s2,h2)||t2)&&this.content.setDisplayedSize(s2,h2)}sizeChanged(t2,i2){return(t2!==this.prevDisplayedWidth||i2!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t2,this.prevDisplayedHeight=i2,!0)}getPlaceholderElement(){if(this.content.placeholder)return this.content.placeholder.element}zoomTo(t2,i2,h2,e2){const{pswp:o2}=this;if(!this.isZoomable()||o2.mainScroll.isShifted())return;o2.dispatch("beforeZoomTo",{destZoomLevel:t2,centerPoint:i2,transitionDuration:h2}),o2.animations.stopAllPan();const r2=this.currZoomLevel;e2||(t2=n(t2,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t2),this.pan.x=this.calculateZoomToPanOffset("x",i2,r2),this.pan.y=this.calculateZoomToPanOffset("y",i2,r2),s(this.pan);const a2=()=>{this.g(t2),this.applyCurrentZoomPan()};h2?o2.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a2,duration:h2,easing:o2.options.easing}):a2()}toggleZoom(t2){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t2,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t2){this.currZoomLevel=t2,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t2,i2,s2){if(this.bounds.max[t2]-this.bounds.min[t2]===0)return this.bounds.center[t2];i2||(i2=this.pswp.getViewportCenterPoint());const h2=this.currZoomLevel/s2;return this.bounds.correctPan(t2,(this.pan[t2]-i2[t2])*h2+i2[t2])}panTo(t2,i2){this.pan.x=this.bounds.correctPan("x",t2),this.pan.y=this.bounds.correctPan("y",i2),this.applyCurrentZoomPan()}isPannable(){return this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),i(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_(t2,i2,s2){s2/=this.currentResolution||this.zoomLevels.initial,r(this.container,t2,i2,s2)}calculateSize(){const{pswp:t2}=this;i(this.panAreaSize,_(t2.options,t2.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t2.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t2=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return o(this.pan.x,this.pan.y,t2)}g(t2){t2!==this.currentResolution&&(this.currentResolution=t2,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}class x{constructor(t2){this.gestures=t2,this.pswp=t2.pswp,this.startPan={}}start(){i(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t2,prevP1:i2,dragAxis:h2,pswp:e2}=this.gestures,{currSlide:n2}=e2;if(h2==="y"&&e2.options.closeOnVerticalDrag&&n2.currZoomLevel<=n2.zoomLevels.fit&&!this.gestures.isMultitouch){const s2=n2.pan.y+(t2.y-i2.y);if(!e2.dispatch("verticalDrag",{panY:s2}).defaultPrevented){this.v("y",s2,.6);const t3=1-Math.abs(this.S(n2.pan.y));e2.applyBgOpacity(t3),n2.applyCurrentZoomPan()}}else this.M("x")||(this.M("y"),s(n2.pan),n2.applyCurrentZoomPan())}end(){const{pswp:t2,velocity:i2}=this.gestures,{mainScroll:s2}=t2;let h2=0;if(t2.animations.stopAll(),s2.isShifted()){const e2=(s2.x-s2.getCurrSlideX())/t2.viewportSize.x;i2.x<-.5&&e2<0||i2.x<.1&&e2<-.5?(h2=1,i2.x=Math.min(i2.x,0)):(i2.x>.5&&e2>0||i2.x>-.1&&e2>.5)&&(h2=-1,i2.x=Math.max(i2.x,0)),s2.moveIndexBy(h2,!0,i2.x)}t2.currSlide.currZoomLevel>t2.currSlide.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this.P("x"),this.P("y"))}P(t2){const{pswp:i2}=this,{currSlide:s2}=i2,{velocity:h2}=this.gestures,{pan:e2,bounds:o2}=s2,r2=e2[t2],a2=i2.bgOpacity<1&&t2==="y",c2=r2+(function(t3,i3){return t3*i3/(1-i3)})(h2[t2],.995);if(a2){const t3=this.S(r2),s3=this.S(c2);if(t3<0&&s3<-.4||t3>0&&s3>.4)return void i2.close()}const l2=o2.correctPan(t2,c2);if(r2===l2)return;const p2=l2===c2?1:.82,u2=i2.bgOpacity,d2=l2-r2;i2.animations.startSpring({name:"panGesture"+t2,isPan:!0,start:r2,end:l2,velocity:h2[t2],dampingRatio:p2,onUpdate:h3=>{if(a2&&i2.bgOpacity<1){const t3=1-(l2-h3)/d2;i2.applyBgOpacity(n(u2+(1-u2)*t3,0,1))}e2[t2]=Math.floor(h3),s2.applyCurrentZoomPan()}})}M(t2){const{p1:i2,pswp:s2,dragAxis:h2,prevP1:e2,isMultitouch:n2}=this.gestures,{currSlide:o2,mainScroll:r2}=s2,a2=i2[t2]-e2[t2],c2=r2.x+a2;if(!a2)return;if(t2==="x"&&!o2.isPannable()&&!n2)return r2.moveTo(c2,!0),!0;const{bounds:l2}=o2,p2=o2.pan[t2]+a2;if(s2.options.allowPanToNext&&h2==="x"&&t2==="x"&&!n2){const i3=r2.getCurrSlideX(),s3=r2.x-i3,h3=a2>0,e3=!h3;if(p2>l2.min[t2]&&h3){if(l2.min[t2]<=this.startPan[t2])return r2.moveTo(c2,!0),!0;this.v(t2,p2)}else if(p2<l2.max[t2]&&e3){if(this.startPan[t2]<=l2.max[t2])return r2.moveTo(c2,!0),!0;this.v(t2,p2)}else if(s3!==0){if(s3>0)return r2.moveTo(Math.max(c2,i3),!0),!0;if(s3<0)return r2.moveTo(Math.min(c2,i3),!0),!0}else this.v(t2,p2)}else t2==="y"&&(r2.isShifted()||l2.min.y===l2.max.y)||this.v(t2,p2)}S(t2){return(t2-this.pswp.currSlide.bounds.center.y)/(this.pswp.viewportSize.y/3)}v(t2,i2,s2){const{pan:h2,bounds:e2}=this.pswp.currSlide;if(e2.correctPan(t2,i2)!==i2||s2){const e3=Math.round(i2-h2[t2]);h2[t2]+=e3*(s2||.35)}else h2[t2]=i2}}function S(t2,i2,s2){return t2.x=(i2.x+s2.x)/2,t2.y=(i2.y+s2.y)/2,t2}class M{constructor(t2){this.gestures=t2,this.pswp=this.gestures.pswp,this.C={},this.T={},this.D={}}start(){this.I=this.pswp.currSlide.currZoomLevel,i(this.C,this.pswp.currSlide.pan),this.pswp.animations.stopAllPan(),this.A=!1}change(){const{p1:t2,startP1:i2,p2:s2,startP2:e2,pswp:n2}=this.gestures,{currSlide:o2}=n2,r2=o2.zoomLevels.min,a2=o2.zoomLevels.max;if(!o2.isZoomable()||n2.mainScroll.isShifted())return;S(this.T,i2,e2),S(this.D,t2,s2);let c2=1/h(i2,e2)*h(t2,s2)*this.I;if(c2>o2.zoomLevels.initial+o2.zoomLevels.initial/15&&(this.A=!0),c2<r2)if(n2.options.pinchToClose&&!this.A&&this.I<=o2.zoomLevels.initial){const t3=1-(r2-c2)/(r2/1.2);n2.dispatch("pinchClose",{bgOpacity:t3}).defaultPrevented||n2.applyBgOpacity(t3)}else c2=r2-.15*(r2-c2);else c2>a2&&(c2=a2+.05*(c2-a2));o2.pan.x=this.L("x",c2),o2.pan.y=this.L("y",c2),o2.setZoomLevel(c2),o2.applyCurrentZoomPan()}end(){const{pswp:t2}=this,{currSlide:i2}=t2;i2.currZoomLevel<i2.zoomLevels.initial&&!this.A&&t2.options.pinchToClose?t2.close():this.correctZoomPan()}L(t2,i2){const s2=i2/this.I;return this.D[t2]-(this.T[t2]-this.C[t2])*s2}correctZoomPan(t2){const{pswp:s2}=this,{currSlide:h2}=s2;if(!h2.isZoomable())return;this.D.x===void 0&&(t2=!0);const o2=h2.currZoomLevel;let r2,a2=!0;o2<h2.zoomLevels.initial?r2=h2.zoomLevels.initial:o2>h2.zoomLevels.max?r2=h2.zoomLevels.max:(a2=!1,r2=o2);const c2=s2.bgOpacity,l2=s2.bgOpacity<1,p2=i({},h2.pan);let u2=i({},p2);t2&&(this.D.x=0,this.D.y=0,this.T.x=0,this.T.y=0,this.I=o2,i(this.C,p2)),a2&&(u2={x:this.L("x",r2),y:this.L("y",r2)}),h2.setZoomLevel(r2),u2={x:h2.bounds.correctPan("x",u2.x),y:h2.bounds.correctPan("y",u2.y)},h2.setZoomLevel(o2);let d2=!0;if(e(u2,p2)&&(d2=!1),!d2&&!a2&&!l2)return h2.g(r2),void h2.applyCurrentZoomPan();s2.animations.stopAllPan(),s2.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t3=>{if(t3/=1e3,d2||a2){if(d2&&(h2.pan.x=p2.x+(u2.x-p2.x)*t3,h2.pan.y=p2.y+(u2.y-p2.y)*t3),a2){const i2=o2+(r2-o2)*t3;h2.setZoomLevel(i2)}h2.applyCurrentZoomPan()}l2&&s2.bgOpacity<1&&s2.applyBgOpacity(n(c2+(1-c2)*t3,0,1))},onComplete:()=>{h2.g(r2),h2.applyCurrentZoomPan()}})}}function z(t2){return!!t2.target.closest(".pswp__container")}class P{constructor(t2){this.gestures=t2}click(t2,i2){const s2=i2.target.classList,h2=s2.contains("pswp__img"),e2=s2.contains("pswp__item")||s2.contains("pswp__zoom-wrap");h2?this.k("imageClick",t2,i2):e2&&this.k("bgClick",t2,i2)}tap(t2,i2){z(i2)&&this.k("tap",t2,i2)}doubleTap(t2,i2){z(i2)&&this.k("doubleTap",t2,i2)}k(t2,i2,s2){const{pswp:h2}=this.gestures,{currSlide:e2}=h2,n2=t2+"Action",o2=h2.options[n2];if(!h2.dispatch(n2,{point:i2,originalEvent:s2}).defaultPrevented)if(typeof o2!="function")switch(o2){case"close":case"next":h2[o2]();break;case"zoom":e2.toggleZoom(i2);break;case"zoom-or-close":e2.isZoomable()&&e2.zoomLevels.secondary!==e2.zoomLevels.initial?e2.toggleZoom(i2):h2.options.clickToCloseNonZoomable&&h2.close();break;case"toggle-controls":this.gestures.pswp.element.classList.toggle("pswp--ui-visible")}else o2.call(h2,i2,s2)}}class C{constructor(t2){this.pswp=t2,this.dragAxis=void 0,this.p1={},this.p2={},this.prevP1={},this.prevP2={},this.startP1={},this.startP2={},this.velocity={},this.Z={},this.F={},this.O=0,this.B=[],this.R="ontouchstart"in window,this.N=!!window.PointerEvent,this.supportsTouch=this.R||this.N&&navigator.maxTouchPoints>1,this.supportsTouch||(t2.options.allowPanToNext=!1),this.drag=new x(this),this.zoomLevels=new M(this),this.tapHandler=new P(this),t2.on("bindEvents",()=>{t2.events.add(t2.scrollWrap,"click",t3=>this.G(t3)),this.N?this.V("pointer","down","up","cancel"):this.R?(this.V("touch","start","end","cancel"),t2.scrollWrap.ontouchmove=()=>{},t2.scrollWrap.ontouchend=()=>{}):this.V("mouse","down","up")})}V(t2,i2,s2,h2){const{pswp:e2}=this,{events:n2}=e2,o2=h2?t2+h2:"";n2.add(e2.scrollWrap,t2+i2,this.onPointerDown.bind(this)),n2.add(window,t2+"move",this.onPointerMove.bind(this)),n2.add(window,t2+s2,this.onPointerUp.bind(this)),o2&&n2.add(e2.scrollWrap,o2,this.onPointerUp.bind(this))}onPointerDown(t2){let s2;if(t2.type!=="mousedown"&&t2.pointerType!=="mouse"||(s2=!0),s2&&t2.button>0)return;const{pswp:h2}=this;h2.opener.isOpen?h2.dispatch("pointerDown",{originalEvent:t2}).defaultPrevented||(s2&&(h2.mouseDetected(),this.U(t2)),h2.animations.stopAll(),this.q(t2,"down"),this.pointerDown=!0,this.O===1&&(this.dragAxis=null,i(this.startP1,this.p1)),this.O>1?(this.H(),this.isMultitouch=!0):this.isMultitouch=!1):t2.preventDefault()}onPointerMove(t2){t2.preventDefault(),this.O&&(this.q(t2,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t2}).defaultPrevented||(this.O!==1||this.isDragging?this.O>1&&!this.isZooming&&(this.K(),this.isZooming=!0,this.W(),this.zoomLevels.start(),this.j(),this.X()):(this.dragAxis||this.Y(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this.H(),this.W(),this.$=Date.now(),this.J=!1,i(this.F,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this.j(),this.X()))))}K(){this.isDragging&&(this.isDragging=!1,this.J||this.tt(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t2){this.O&&(this.q(t2,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t2}).defaultPrevented||(this.O===0&&(this.pointerDown=!1,this.j(),this.isDragging?this.K():this.isZooming||this.isMultitouch||this.it(t2)),this.O<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this.O===1&&(this.dragAxis=null,this.W()))))}X(){(this.isDragging||this.isZooming)&&(this.tt(),this.isDragging?e(this.p1,this.prevP1)||this.drag.change():e(this.p1,this.prevP1)&&e(this.p2,this.prevP2)||this.zoomLevels.change(),this.st(),this.raf=requestAnimationFrame(this.X.bind(this)))}tt(t2){const s2=Date.now(),h2=s2-this.$;h2<50&&!t2||(this.velocity.x=this.ht("x",h2),this.velocity.y=this.ht("y",h2),this.$=s2,i(this.F,this.p1),this.J=!0)}it(t2){const{mainScroll:s2}=this.pswp;if(s2.isShifted())return void s2.moveIndexBy(0,!0);if(t2.type.indexOf("cancel")>0)return;if(t2.type==="mouseup"||t2.pointerType==="mouse")return void this.tapHandler.click(this.startP1,t2);const e2=this.pswp.options.doubleTapAction?300:0;this.et?(this.H(),h(this.Z,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t2)):(i(this.Z,this.startP1),this.et=setTimeout(()=>{this.tapHandler.tap(this.startP1,t2),this.H()},e2))}H(){this.et&&(clearTimeout(this.et),this.et=null)}ht(t2,i2){const s2=this.p1[t2]-this.F[t2];return Math.abs(s2)>1&&i2>5?s2/i2:0}j(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}U(t2){return t2.preventDefault(),!0}q(t2,s2){if(this.N){const h2=t2,e2=this.B.findIndex(t3=>t3.id===h2.pointerId);s2==="up"&&e2>-1?this.B.splice(e2,1):s2==="down"&&e2===-1?this.B.push(this.nt(h2,{})):e2>-1&&this.nt(h2,this.B[e2]),this.O=this.B.length,this.O>0&&i(this.p1,this.B[0]),this.O>1&&i(this.p2,this.B[1])}else{const i2=t2;this.O=0,i2.type.indexOf("touch")>-1?i2.touches&&i2.touches.length>0&&(this.nt(i2.touches[0],this.p1),this.O++,i2.touches.length>1&&(this.nt(i2.touches[1],this.p2),this.O++)):(this.nt(t2,this.p1),s2==="up"?this.O=0:this.O++)}}st(){i(this.prevP1,this.p1),i(this.prevP2,this.p2)}W(){i(this.startP1,this.p1),i(this.startP2,this.p2),this.st()}Y(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t2=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(t2!==0){const i2=t2>0?"x":"y";Math.abs(this.p1[i2]-this.startP1[i2])>=10&&(this.dragAxis=i2)}}}nt(t2,i2){return i2.x=t2.pageX-this.pswp.offset.x,i2.y=t2.pageY-this.pswp.offset.y,"pointerId"in t2?i2.i
4d=t2.pointerId:t2.identifier!==void 0&&(i2.id=t2.identifier),i2}G(t2){this.pswp.mainScroll.isShifted()&&(t2.preventDefault(),t2.stopPropagation())}}class T{constructor(t2){this.pswp=t2,this.x=0,this.slideWidth=void 0,this.itemHolders=void 0,this.resetPosition()}resize(t2){const{pswp:i2}=this,s2=Math.round(i2.viewportSize.x+i2.viewportSize.x*i2.options.spacing),h2=s2!==this.slideWidth;h2&&(this.slideWidth=s2,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i3,s3)=>{h2&&r(i3.el,(s3+this.ot)*this.slideWidth),t2&&i3.slide&&i3.slide.resize()})}resetPosition(){this.rt=0,this.at=0,this.slideWidth=0,this.ot=-1}appendHolders(){this.itemHolders=[];for(let i2=0;i2<3;i2++){const s2=t("pswp__item",!1,this.pswp.container);s2.style.display=i2===1?"block":"none",this.itemHolders.push({el:s2})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t2,i2,s2){const{pswp:h2}=this;let e2=h2.potentialIndex+t2;const n2=h2.getNumItems();if(h2.canLoop()){e2=h2.getLoopedIndex(e2);const i3=(t2+n2)%n2;t2=i3<=n2/2?i3:i3-n2}else e2<0?e2=0:e2>=n2&&(e2=n2-1),t2=e2-h2.potentialIndex;h2.potentialIndex=e2,this.rt-=t2,h2.animations.stopMainScroll();const o2=this.getCurrSlideX();if(i2){h2.animations.startSpring({isMainScroll:!0,start:this.x,end:o2,velocity:s2||0,naturalFrequency:30,dampingRatio:1,onUpdate:t4=>{this.moveTo(t4)},onComplete:()=>{this.updateCurrItem(),h2.appendHeavy()}});let t3=h2.potentialIndex-h2.currIndex;if(h2.canLoop()){const i3=(t3+n2)%n2;t3=i3<=n2/2?i3:i3-n2}Math.abs(t3)>1&&this.updateCurrItem()}else this.moveTo(o2),this.updateCurrItem();if(t2)return!0}getCurrSlideX(){return this.slideWidth*this.rt}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t2}=this,i2=this.at-this.rt;if(!i2)return;this.at=this.rt,t2.currIndex=t2.potentialIndex;let s2,h2=Math.abs(i2);h2>=3&&(this.ot+=i2+(i2>0?-3:3),h2=3);for(let e2=0;e2<h2;e2++)i2>0?(s2=this.itemHolders.shift(),this.itemHolders[2]=s2,this.ot++,r(s2.el,(this.ot+2)*this.slideWidth),t2.setContent(s2,t2.currIndex-h2+e2+2)):(s2=this.itemHolders.pop(),this.itemHolders.unshift(s2),this.ot--,r(s2.el,this.ot*this.slideWidth),t2.setContent(s2,t2.currIndex+h2-e2-2));Math.abs(this.ot)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t2.animations.stopAllPan(),this.itemHolders.forEach((t3,i3)=>{t3.slide&&t3.slide.setIsActive(i3===1)}),t2.currSlide=this.itemHolders[1].slide,t2.contentLoader.updateLazy(i2),t2.currSlide.applyCurrentZoomPan(),t2.dispatch("change")}moveTo(t2,i2){let s2,h2;!this.pswp.canLoop()&&i2&&(s2=(this.slideWidth*this.rt-t2)/this.slideWidth,s2+=this.pswp.currIndex,h2=Math.round(t2-this.x),(s2<0&&h2>0||s2>=this.pswp.getNumItems()-1&&h2<0)&&(t2=this.x+.35*h2)),this.x=t2,r(this.pswp.container,t2),this.pswp.dispatch("moveMainScroll",{x:t2,dragging:i2})}}class D{constructor(t2){this.pswp=t2,t2.on("bindEvents",()=>{t2.options.initialPointerPos||this.ct(),t2.events.add(document,"focusin",this.lt.bind(this)),t2.events.add(document,"keydown",this.ut.bind(this))});const i2=document.activeElement;t2.on("destroy",()=>{t2.options.returnFocus&&i2&&this.dt&&i2.focus()})}ct(){this.dt||(this.pswp.element.focus(),this.dt=!0)}ut(t2){const{pswp:i2}=this;if(i2.dispatch("keydown",{originalEvent:t2}).defaultPrevented||(function(t3){if(t3.which===2||t3.ctrlKey||t3.metaKey||t3.altKey||t3.shiftKey)return!0})(t2))return;let s2,h2,e2;switch(t2.keyCode){case 27:i2.options.escKey&&(s2="close");break;case 90:s2="toggleZoom";break;case 37:h2="x";break;case 38:h2="y";break;case 39:h2="x",e2=!0;break;case 40:e2=!0,h2="y";break;case 9:this.ct()}if(h2){t2.preventDefault();const{currSlide:n2}=i2;i2.options.arrowKeys&&h2==="x"&&i2.getNumItems()>1?s2=e2?"next":"prev":n2&&n2.currZoomLevel>n2.zoomLevels.fit&&(n2.pan[h2]+=e2?-80:80,n2.panTo(n2.pan.x,n2.pan.y))}s2&&(t2.preventDefault(),i2[s2]())}lt(t2){const{template:i2}=this.pswp;document===t2.target||i2===t2.target||i2.contains(t2.target)||i2.focus()}}class I{constructor(t2){this.props=t2;const{target:i2,onComplete:s2,transform:h2,onFinish:e2}=t2;let{duration:n2,easing:o2}=t2;this.onFinish=e2;const r2=h2?"transform":"opacity",c2=t2[r2];this.ft=i2,this.wt=s2,n2=n2||333,o2=o2||"cubic-bezier(.4,0,.22,1)",this.gt=this.gt.bind(this),this._t=setTimeout(()=>{a(i2,r2,n2,o2),this._t=setTimeout(()=>{i2.addEventListener("transitionend",this.gt,!1),i2.addEventListener("transitioncancel",this.gt,!1),i2.
4style[r2]=c2},30)},0)}gt(t2){t2.target===this.ft&&this.vt()}vt(){this.yt||(this.yt=!0,this.onFinish(),this.wt&&this.wt())}destroy(){this._t&&clearTimeout(this._t),a(this.ft),this.ft.removeEventListener("transitionend",this.gt,!1),this.ft.removeEventListener("transitioncancel",this.gt,!1),this.yt||this.vt()}}class A{constructor(t2,i2,s2){this.velocity=1e3*t2,this.bt=i2||.75,this.xt=s2||12,this.bt<1&&(this.St=this.xt*Math.sqrt(1-this.bt*this.bt))}easeFrame(t2,i2){let s2,h2=0;i2/=1e3;const e2=Math.E**(-this.bt*this.xt*i2);if(this.bt===1)s2=this.velocity+this.xt*t2,h2=(t2+s2*i2)*e2,this.velocity=h2*-this.xt+s2*e2;else if(this.bt<1){s2=1/this.St*(this.bt*this.xt*t2+this.velocity);const n2=Math.cos(this.St*i2),o2=Math.sin(this.St*i2);h2=e2*(t2*n2+s2*o2),this.velocity=h2*-this.xt*this.bt+e2*(-this.St*t2*o2+this.St*s2*n2)}return h2}}class E{constructor(t2){this.props=t2;const{start:i2,end:s2,velocity:h2,onUpdate:e2,onComplete:n2,onFinish:o2,dampingRatio:r2,naturalFrequency:a2}=t2;this.onFinish=o2;const c2=new A(h2,r2,a2);let l2=Date.now(),p2=i2-s2;const u2=()=>{this.Mt&&(p2=c2.easeFrame(p2,Date.now()-l2),Math.abs(p2)<1&&Math.abs(c2.velocity)<50?(e2(s2),n2&&n2(),this.onFinish()):(l2=Date.now(),e2(p2+s2),this.Mt=requestAnimationFrame(u2)))};this.Mt=requestAnimationFrame(u2)}destroy(){this.Mt>=0&&cancelAnimationFrame(this.Mt),this.Mt=null}}class L{constructor(){this.activeAnimations=[]}startSpring(t2){this.zt(t2,!0)}startTransition(t2){this.zt(t2)}zt(t2,i2){let s2;return s2=i2?new E(t2):new I(t2),this.activeAnimations.push(s2),s2.onFinish=()=>this.stop(s2),s2}stop(t2){t2.destroy();const i2=this.activeAnimations.indexOf(t2);i2>-1&&this.activeAnimations.splice(i2,1)}stopAll(){this.activeAnimations.forEach(t2=>{t2.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t2=>!t2.props.isPan||(t2.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t2=>!t2.props.isMainScroll||(t2.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t2=>t2.props.isPan)}}class k{constructor(t2){this.pswp=t2,t2.events.add(t2.element,"wheel",this.Pt.bind(this))}Pt(t2){t2.preventDefault();const{currSlide:i2}=this.pswp;let{deltaX:s2,deltaY:h2}=t2;if(i2&&!this.pswp.dispatch("wheel",{originalEvent:t2}).defaultPrevented)if(t2.ctrlKey||this.pswp.options.wheelToZoom){if(i2.isZoomable()){let s3=-h2;t2.deltaMode===1?s3*=.05:s3*=t2.deltaMode?1:.002,s3=2**s3;const e2=i2.currZoomLevel*s3;i2.zoomTo(e2,{x:t2.clientX,y:t2.clientY})}}else i2.isPannable()&&(t2.deltaMode===1&&(s2*=18,h2*=18),i2.panTo(i2.pan.x-s2,i2.pan.y-h2))}}class Z{constructor(i2,s2){const h2=s2.name||s2.className;let e2=s2.html;if(i2.options[h2]===!1)return;typeof i2.options[h2+"SVG"]=="string"&&(e2=i2.options[h2+"SVG"]),i2.dispatch("uiElementCreate",{data:s2});let n2,o2="";s2.isButton?(o2+="pswp__button ",o2+=s2.className||`pswp__button--${s2.name}`):o2+=s2.className||`pswp__${s2.name}`;let r2=s2.isButton?s2.tagName||"button":s2.tagName||"div";if(r2=r2.toLowerCase(),n2=t(o2,r2),s2.isButton){n2=t(o2,r2),r2==="button"&&(n2.type="button");let{title:e3}=s2;const{ariaLabel:a3}=s2;typeof i2.options[h2+"Title"]=="string"&&(e3=i2.options[h2+"Title"]),e3&&(n2.title=e3),(a3||e3)&&n2.setAttribute("aria-label",a3||e3)}n2.innerHTML=(function(t2){if(typeof t2=="string")return t2;if(!t2||!t2.isCustomSVG)return"";const i3=t2;
4let s3='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s3=s3.split("%d").join(i3.size||32),i3.outlineID&&(s3+='<use class="pswp__icn-shadow" xlink:href="#'+i3.outlineID+'"/>'),s3+=i3.inner,s3+="</svg>",s3})(e2),s2.onInit&&s2.onInit(n2,i2),s2.onClick&&(n2.onclick=t2=>{typeof s2.onClick=="string"?i2[s2.onClick]():s2.onClick(t2,n2,i2)});const a2=s2.appendTo||"bar";let c2;a2==="bar"?(i2.topBar||(i2.topBar=t("pswp__top-bar pswp__hide-on-close","div",i2.scrollWrap)),c2=i2.topBar):(n2.classList.add("pswp__hide-on-close"),c2=a2==="wrapper"?i2.scrollWrap:i2.element),c2.appendChild(i2.applyFilters("uiElement",n2,s2))}}function F(t2,i2,s2){t2.classList.add("pswp__button--arrow"),i2.on("change",()=>{i2.options.loop||(t2.disabled=s2?!(i2.currIndex<i2.getNumItems()-1):!(i2.currIndex>0))})}const O={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:F},B={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t2,i2)=>{F(t2,i2,!0)}},R={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},N={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},G={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t2,i2)=>{let s2,h2;const e2=i3=>{var h3,e3;s2!==i3&&(s2=i3,h3="active",e3=i3,t2.classList[e3?"add":"remove"]("pswp__preloader--"+h3))},n2=()=>{if(!i2.currSlide.content.isLoading())return e2(!1),void(h2&&(clearTimeout(h2),h2=null));h2||(h2=setTimeout(()=>{e2(i2.currSlide.content.isLoading()),h2=null},i2.options.preloaderDelay))};i2.on("change",n2),i2.on("loadComplete",t3=>{i2.currSlide===t3.slide&&n2()}),i2.ui.updatePreloaderVisibility=n2}},V={name:"counter",order:5,onInit:(t2,i2)=>{i2.on("change",()=>{t2.innerText=i2.currIndex+1+i2.options.indexIndicatorSep+i2.getNumItems()})}};function U(t2,i2){t2.classList[i2?"add":"remove"]("pswp--zoomed-in")}class q{constructor(t2){this.pswp=t2,this.updatePreloaderVisibility=void 0,this.Ct=void 0}init(){const{pswp:t2}=this;this.isRegistered=!1,this.uiElementsData=[R,O,B,N,G,V],t2.dispatch("uiRegister"),this.uiElementsData.sort((t3,i2)=>(t3.order||0)-(i2.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t3=>{this.registerElement(t3)}),t2.on("change",()=>{t2.element.classList[t2.getNumItems()===1?"add":"remove"]("pswp--one-slide")}),t2.on("zoomPanUpdate",()=>this.Tt())}registerElement(t2){this.isRegistered?this.items.push(new Z(this.pswp,t2)):this.uiElementsData.push(t2)}Tt(){const{template:t2,currSlide:i2,options:s2}=this.pswp;let{currZoomLevel:h2}=i2;if(this.pswp.opener.isClosing||(this.pswp.opener.isOpen||(h2=i2.zoomLevels.initial),h2===this.Ct))return;this.Ct=h2;const e2=i2.zoomLevels.initial-i2.zoomLevels.secondary;if(Math.abs(e2)<.01||!i2.isZoomable())return U(t2,!1),void t2.classList.remove("pswp--zoom-allowed");t2.classList.add("pswp--zoom-allowed");const n2=e2<0;h2===i2.zoomLevels.secondary?U(t2,n2):h2>i2.zoomLevels.secondary?U(t2,!0):U(t2,!1),s2.imageClickAction!=="zoom"&&s2.imageClickAction!=="zoom-or-close"||t2.classList.add("pswp--click-to-zoom")}}class H{constructor(t2,i2){this.type=t2,i2&&Object.assign(this,i2)}preventDefault(){this.defaultPrevented=!0}}class K{constructor(i2,s2){this.element=t("pswp__img pswp__img--placeholder",i2?"img":"",s2),i2&&(this.element.decoding="async",this.element.alt="",this.element.src=i2,this.element.setAttribute("role","presentation")),this.element.setAttribute("aria-hiden","true")}setDisplayedSize(t2,i2){this.element&&(this.element.tagName==="IMG"?(c(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=o(0,0,t2/250)):c(this.element,t2,i2))}destroy(){this.element.parentNode&&this.element.remove(),this.element=null}}class W{constructor(t2,i2,s2){this.instance=i2,this.data=t2,this.index=s2,this.element=void 0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.state=l,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.t
4ype="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=null)},500)}load(i2,s2){if(!this.placeholder&&this.slide&&this.usePlaceholder()){const t2=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new K(t2,this.slide.container)}this.element&&!s2||this.instance.dispatch("contentLoad",{content:this,isLazy:i2}).defaultPrevented||(this.isImageContent()?this.loadImage(i2):(this.element=t("pswp__content"),this.element.innerHTML=this.data.html||""),s2&&this.slide&&this.slide.updateContentSize(!0))}loadImage(i2){const s2=t("pswp__img","img");this.element=s2,this.instance.dispatch("contentLoadImage",{content:this,isLazy:i2}).defaultPrevented||(this.data.srcset&&(s2.srcset=this.data.srcset),s2.src=this.data.src,s2.alt=this.data.alt||"",this.state=p,s2.complete?this.onLoaded():(s2.onload=()=>{this.onLoaded()},s2.onerror=()=>{this.onError()}))}setSlide(t2){this.slide=t2,this.hasSlide=!0,this.instance=t2.pswp}onLoaded(){this.state=u,this.slide&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.slide.container.innerHTML="",this.append(),this.slide.updateContentSize(!0)))}onError(){this.state=d,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===p,this)}isError(){return this.state===d}isImageContent(){return this.type==="image"}setDisplayedSize(t2,i2){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t2,i2),!this.instance.dispatch("contentResize",{content:this,width:t2,height:i2}).defaultPrevented&&(c(this.element,t2,i2),this.isImageContent()&&!this.isError()))){const s2=this.element;s2.srcset&&(!s2.dataset.largestUsedSize||t2>parseInt(s2.dataset.largestUsedSize,10))&&(s2.sizes=t2+"px",s2.dataset.largestUsedSize=String(t2)),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t2,height:i2,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==d,this)}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=null,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=null))}displayError(){if(this.slide){let i2=t("pswp__error-msg");i2.innerText=this.instance.options.errorMsg,i2=this.instance.applyFilters("contentErrorElement",i2,this),this.element=t("pswp__content pswp__error-msg-container"),this.element.appendChild(i2),this.slide.container.innerHTML="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){this.isAttached=!0,this.state!==d?this.instance.dispatch("contentAppend",{content:this}).defaultPrevented||(this.isImageContent()?this.slide&&!this.slide.isActive&&"decode"in this.element?(this.isDecoding=!0,requestAnimationFrame(()=>{this.element&&this.element.tagName==="IMG"&&this.element.decode().then(()=>{this.isDecoding=!1,requestAnimationFrame(()=>{this.appendImage()})}).catch(()=>{this.isDecoding=!1})})):(!this.placeholder||this.state!==u&&this.state!==d||this.removePlaceholder(),this.appendImage()):this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element)):this.displayError()}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||this.slide&&(this.isImageContent()&&this.isDecoding?this.appendImage():this.isError()&&this.load(!1,!0))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this})}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||this.element&&this.element.parentNode&&this.element.remove()}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||this.slide&&this.element&&!this.element.parentNode&&(this.slide.container.appendChild(this.element),!this.placeholder||this.state!==u&&this.state!==d||this.removePlaceholder()))}}class j{constructor(t2){this.pswp=t2,this.isClosed=!0,this.Dt=this.Dt.bind(this),this.It=void 0,t2.on("firstZoomPan",this.Dt)}open(){this.Dt(),this.zt()}close(){if(this.isClosed||this.isClosing||this.isOpening)return!1;const t2=this.pswp.currSlide;return this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this.At=this.pswp.options.hideAnimationDuration,t2&&t2.currZoomLevel*t2.width>=this.pswp.options.maxWidthToAnimate&&(this.At=0),this.Et(),setTimeout(()=>{this.zt()},this.Lt?30:0),!0}Dt(){if(this.pswp.off("firstZoomPan",this.Dt),!this.isOpening){const t2=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this.At=this.pswp.options.showAnimationDuration,t2&&t2.zoomLevels.initial*t2.width>=this.pswp.options.maxWidthToAnimate&&(this.At=0),this.Et()}}Et(){const{pswp:t2}=this,i2=this.pswp.currSlide,{options:s2}=t2;if(s2.showHideAnimationType==="fade"?(s2.showHideOpacity=!0,this.It=!1):s2.showHideAnimationType==="none"?(s2.showHideOpacity=!1,this.At=0,this.It=!1):this.isOpening&&t2.kt?this.It=t2.kt:this.It=this.pswp.getThumbBounds(),this.Zt=i2.getPlaceholderElement(),t2.animations.stopAll(),this.Ft=this.At>50,this.Ot=!!this.It&&i2.content&&i2.content.usePlaceholder()&&(!this.isClosing||!t2.mainScroll.isShifted()),this.Ot?this.Bt=s2.showHideOpacity:(this.Bt=!0,this.isOpening&&(i2.zoomAndPanToInitial(),i2.applyCurrentZoomPan())),this.Rt=!this.Bt&&this.pswp.options.bgOpacity>.003,this.Nt=this.Bt?t2.element:t2.bg,!this.Ft)return this.At=0,this.Ot=!1,this.Rt=!1,this.Bt=!0,void(this.isOpening&&(t2.element.style.opacity=String(.003),t2.applyBgOpacity(1)));this.Ot&&this.It&&this.It.innerRect?(this.Lt=!0,this.Gt=this.pswp.container,this.Vt=this.pswp.currSlide.holderElement,t2.container.style.overflow="hidden",t2.container.style.width=t2.viewportSize.x+"px"):this.Lt=!1,this.isOpening?(this.Bt?(t2.element.style.opacity=String(.003),t2.applyBgOpacity(1)):(this.Rt&&(t2.bg.style.opacity=String(.003)),t2.element.style.opacity="1"),this.Ot&&(this.Ut(),this.Zt&&(this.Zt.style.willChange="transform",this.Zt.style.opacity=String(.003)))):this.isClosing&&(t2.mainScroll.itemHolders[0].el.style.display="none",t2.mainScroll.itemHolders[2].el.style.display="none",this.Lt&&t2.mainScroll.x!==0&&(t2.mainScroll.resetPosition(),t2.mainScroll.resize()))}zt(){this.isOpening&&this.Ft&&this.Zt&&this.Zt.tagName==="IMG"?new Promise(t2=>{let i2=!1,s2=!0;var h2;(h2=this.Zt,"decode"in h2?h2.decode():h2.complete?Promise.resolve(h2):new Promise((t3,i3)=>{h2.onload=()=>t3(h2),h2.onerror=i3})).finally(()=>{i2=!0,s2||t2()}),setTimeout(()=>{s2=!1,i2&&t2()},50),setTimeout(t2,250)}).finally(()=>this.qt()):this.qt()}qt(){this.pswp.element.style.setProperty("--pswp-transition-duration",this.At+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element.classList[this.isOpening?"add":"remove"]("pswp--ui-visible"),this.isOpening?(this.Zt&&(this.Zt.style.opacity="1"),this.Ht()):this.isClosing&&this.Kt(),this.Ft||this.Wt()}Wt(){const{pswp:t2}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t2.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t2.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t2.destroy():this.isOpen&&(this.Ot&&(t2.container.style.overflow="visible",t2.container.style.width="100%"),t2.currSlide.applyCurrentZoomPan())}Ht(){const{pswp:t2}=this;
vendor: 1,368 bytes, line 4
4this.Ot&&(this.Lt&&(this.jt(this.Gt,"transform","translate3d(0,0,0)"),this.jt(this.Vt,"transform","none")),t2.currSlide.zoomAndPanToInitial(),this.jt(t2.currSlide.container,"transform",t2.currSlide.getCurrentTransform())),this.Rt&&this.jt(t2.bg,"opacity",String(t2.options.bgOpacity)),this.Bt&&this.jt(t2.element,"opacity","1")}Kt(){const{pswp:t2}=this;this.Ot&&this.Ut(!0),this.Rt&&t2.bgOpacity>.01&&this.jt(t2.bg,"opacity","0"),this.Bt&&this.jt(t2.element,"opacity","0")}Ut(t2){if(!this.It)return;const{pswp:s2}=this,{innerRect:h2}=this.It,{currSlide:e2,viewportSize:n2}=s2;if(this.Lt){const i2=-n2.x+(this.It.x-h2.x)+h2.w,s3=-n2.y+(this.It.y-h2.y)+h2.h,e3=n2.x-h2.w,a2=n2.y-h2.h;t2?(this.jt(this.Gt,"transform",o(i2,s3)),this.jt(this.Vt,"transform",o(e3,a2))):(r(this.Gt,i2,s3),r(this.Vt,e3,a2))}i(e2.pan,h2||this.It),e2.currZoomLevel=this.It.w/e2.width,t2?this.jt(e2.container,"transform",e2.getCurrentTransform()):e2.applyCurrentZoomPan()}jt(t2,i2,s2){if(!this.At)return void(t2.style[i2]=s2);const{animations:h2}=this.pswp,e2={duration:this.At,easing:this.pswp.options.easing,onComplete:()=>{h2.activeAnimations.length||this.Wt()},target:t2};e2[i2]=s2,h2.startTransition(e2)}}function X(t2,i2){const s2=i2.getItemData(t2);if(!i2.dispatch("lazyLoadSlide",{index:t2,itemData:s2}).defaultPrevented)return(function(t3,i3,s3){const h2=i3.createContentFromData(t3,s3);
4if(!h2||!h2.lazyLoad)return;const{options:e2}=i3,n2=_(e2,i3.viewportSize||w(e2,i3),t3,s3),o2=new y(e2,t3,-1);return o2.update(h2.width,h2.height,n2),h2.lazyLoad(),h2.setDisplayedSize(Math.ceil(h2.width*o2.initial),Math.ceil(h2.height*o2.initial)),h2})(s2,i2,t2)}class Y{constructor(t2){this.pswp=t2,this.limit=Math.max(t2.options.preload[0]+t2.options.preload[1]+1,5),this.Xt=[]}updateLazy(t2){const{pswp:i2}=this;if(i2.dispatch("lazyLoad").defaultPrevented)return;const{preload:s2}=i2.options,h2=t2===void 0||t2>=0;let e2;for(e2=0;e2<=s2[1];e2++)this.loadSlideByIndex(i2.currIndex+(h2?e2:-e2));for(e2=1;e2<=s2[0];e2++)this.loadSlideByIndex(i2.currIndex+(h2?-e2:e2))}loadSlideByIndex(t2){t2=this.pswp.getLoopedIndex(t2);let i2=this.getContentByIndex(t2);i2||(i2=X(t2,this.pswp),i2&&this.addToCache(i2))}getContentBySlide(t2){let i2=this.getContentByIndex(t2.index);return i2||(i2=this.pswp.createContentFromData(t2.data,t2.index),i2&&this.addToCache(i2)),i2&&i2.setSlide(t2),i2}addToCache(t2){if(this.removeByIndex(t2.index),this.Xt.push(t2),this.Xt.length>this.limit){const t3=this.Xt.findIndex(t4=>!t4.isAttached&&!t4.hasSlide);t3!==-1&&this.Xt.splice(t3,1)[0].destroy()}}removeByIndex(t2){const i2=this.Xt.findIndex(i3=>i3.index===t2);i2!==-1&&this.Xt.splice(i2,1)}getContentByIndex(t2){return this.Xt.find(i2=>i2.index===t2)}destroy(){this.Xt.forEach(t2=>t2.destroy()),this.Xt=null}}const $={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class J extends class extends class{constructor(){this.Yt={},this.$t={},this.pswp=void 0,this.options=void 0}addFilter(t2,i2,s2=100){this.$t[t2]||(this.$t[t2]=[]),this.$t[t2].push({fn:i2,priority:s2}),this.$t[t2].sort((t3,i3)=>t3.priority-i3.priority),this.pswp&&this.pswp.addFilter(t2,i2,s2)}removeFilter(t2,i2){this.$t[t2]&&(this.$t[t2]=this.$t[t2].filter(t3=>t3.fn!==i2)),this.pswp&&this.pswp.removeFilter(t2,i2)}applyFilters(t2,...i2){return this.$t[t2]&&this.$t[t2].forEach(t3=>{i2[0]=t3.fn.apply(this,i2)}),i2[0]}on(t2,i2){this.Yt[t2]||(this.Yt[t2]=[]),this.Yt[t2].push(i2),this.pswp&&this.pswp.on(t2,i2)}off(t2,i2){this.Yt[t2]&&(this.Yt[t2]=this.Yt[t2].filter(t3=>i2!==t3)),this.pswp&&this.pswp.off(t2,i2)}dispatch(t2,i2){if(this.pswp)return this.pswp.dispatch(t2,i2);const s2=new H(t2,i2);return this.Yt&&this.Yt[t2]&&this.Yt[t2].forEach(t3=>{t3.call(this,s2)}),s2}}{getNumItems(){let t2;const{dataSource:i2}=this.options;i2?"length"in i2?t2=i2.length:"gallery"in i2&&(i2.items||(i2.items=this.Jt(i2.gallery)),i2.items&&(t2=i2.items.length)):t2=0;const s2=this.dispatch("numItems",{dataSource:i2,numItems:t2});return this.applyFilters("numItems",s2.numItems,i2)}createContentFromData(t2,i2){return new W(t2,this,i2)}getItemData(t2){const{dataSource:i2}=this.options;let s2;Array.isArray(i2)?s2=i2[t2]:i2&&i2.gallery&&(i2.items||(i2.items=this.Jt(i2.gallery)),s2=i2.items[t2]);let h2=s2;h2 instanceof Element&&(h2=this.Qt(h2));const e2=this.dispatch("itemData",{itemData:h2||{},index:t2});return this.applyFilters("itemData",e2.itemData,t2)}Jt(t2){return this.options.children||this.options.childSelector?(function(t3,i2,s2=document){let h2=[];if(t3 instanceof Element)h2=[t3];else if(t3 instanceof NodeList||Array.isArray(t3))h2=Array.from(t3);else{const e2=typeof t3=="string"?t3:i2;e2&&(h2=Array.from(s2.querySelectorAll(e2)))}return h2})(this.options.children,this.options.childSelector,t2)||[]:[t2]}Qt(t2){const i2={element:t2},s2=t2.tagName==="A"?t2:t2.querySelector("a");if(s2){i2.src=s2.dataset.pswpSrc||s2.href,s2.dataset.pswpSrcset&&(i2.srcset=s2.dataset.pswpSrcset),i2.width=parseInt(s2.dataset.pswpWidth,10),i2.height=parseInt(s2.dataset.pswpHeight,10),i2.w=i2.width,i2.h=i2.height,s2.dataset.pswpType&&(i2.type=s2.dataset.pswpType);const h2=t2.querySelector("img");h2&&(i2.msrc=h2.currentSrc||h2.src,i2.alt=h2.getAttribute("alt")),(s2.dataset.pswpCropped||s2.dataset.cropped)&&(i2.thumbCropped=!0)}return this.applyFilters("domItemData",i2,t2,s2)}}{constructor(t2){super(),this.ti(t2),this.offset={},this.ii={},this.viewportSize={},this.bgOpacity=1,this.topBar=void 0,this.events=new f,this.animations=new L,this.mainScroll=ne
4w T(this),this.gestures=new C(this),this.opener=new j(this),this.keyboard=new D(this),this.contentLoader=new Y(this)}init(){if(this.isOpen||this.isDestroying)return;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this.si();let t2="pswp--open";return this.gestures.supportsTouch&&(t2+=" pswp--touch"),this.options.mainClass&&(t2+=" "+this.options.mainClass),this.element.className+=" "+t2,this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new k(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this.hi=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this.hi,slide:void 0}),this.kt=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{this.setContent(this.mainScroll.itemHolders[0],this.currIndex-1),this.setContent(this.mainScroll.itemHolders[2],this.currIndex+1),this.mainScroll.itemHolders[0].el.style.display="block",this.mainScroll.itemHolders[2].el.style.display="block",this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this.ei.bind(this)),this.events.add(window,"scroll",this.ni.bind(this)),this.dispatch("bindEvents")}),this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t2){const i2=this.getNumItems();return this.options.loop&&(t2>i2-1&&(t2-=i2),t2<0&&(t2+=i2)),t2=n(t2,0,i2-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t2=>{t2.slide&&t2.slide.appendHeavy()})}goTo(t2){this.mainScroll.moveIndexBy(this.getLoopedIndex(t2)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t2){this.currSlide.zoomTo(...t2)}toggleZoom(){this.currSlide.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this.listeners=null,this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null,this.element.remove(),this.mainScroll.itemHolders.forEach(t2=>{t2.slide&&t2.slide.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t2){this.contentLoader.removeByIndex(t2),this.mainScroll.itemHolders.forEach((i2,s2)=>{let h2=this.currSlide.index-1+s2;this.canLoop()&&(h2=this.getLoopedIndex(h2)),h2===t2&&(this.setContent(i2,t2,!0),s2===1&&(this.currSlide=i2.slide,i2.slide.setIsActive(!0)))}),this.dispatch("change")}setContent(t2,i2,s2){if(this.canLoop()&&(i2=this.getLoopedIndex(i2)),t2.slide){if(t2.slide.index===i2&&!s2)return;t2.slide.destroy(),t2.slide=null}if(!this.canLoop()&&(i2<0||i2>=this.getNumItems()))return;const h2=this.getItemData(i2);t2.slide=new b(h2,i2,this),i2===this.currIndex&&(this.currSlide=t2.slide),t2.slide.append(t2.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t2){if(this.isDestroying)return;const s2=w(this.options,this);!t2&&e(s2,this.ii)||(i(this.ii,s2),this.dispatch("beforeResize"),i(this.viewportSize,this.ii),this.ni(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t2){this.bgOpacity=Math.max(t2,0),this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity)}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element.classList.add("pswp--has_mouse"))}ei(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}ni(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t2,i2){this.offset.x=t2,this.offset.y=i2,this.dispatch("updateScrollOffset")}si(){this.element=t("pswp"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=t("pswp__bg",!1,this.element),this.scrollWrap=t("pswp__scroll-wrap",!1,this.element),this.container=t("pswp__container",!1,this.scrollWrap),this.mainScroll.appendHolders(),this.ui=new q(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return(function(t2,i2,s2){const h2=s2.dispatch("thumbBounds",{index:t2,itemData:i2,instance:s2});if(h2.thumbBounds)return h2.thumbBounds;const{element:e2}=i2;let n2,o2;if(e2&&s2.options.thumbSelector!==!1){const t3=s2.options.thumbSelector||"img";o2=e2.matches(t3)?e2:e2.querySelector(t3)}return o2=s2.applyFilters("thumbEl",o2,i2,t2),o2&&(n2=i2.thumbCropped?(function(t3,i3,s3){const h3=t3.getBoundingClientRect(),e3=h3.width/i3,n3=h3.height/s3,o3=e3>n3?e3:n3,r2=(h3.width-i3*o3)/2,a2=(h3.height-s3*o3)/2,c2={x:h3.left+r2,y:h3.top+a2,
4w:i3*o3};return c2.innerRect={w:h3.width,h:h3.height,x:r2,y:a2},c2})(o2,i2.width||i2.w,i2.height||i2.h):(function(t3){const i3=t3.getBoundingClientRect();return{x:i3.left,y:i3.top,w:i3.width}})(o2)),s2.applyFilters("thumbBounds",n2,i2,t2)})(this.currIndex,this.currSlide?this.currSlide.data:this.hi,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}ti(t2){window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t2.showHideAnimationType="none",t2.zoomAnimationDuration=0),this.options={...$,...t2}}}return J});
5//# sourceMappingURL=/cdn/shop/t/1735/assets/vendor-photoswipe.js.map?v=48584825539910101801782836741

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.