PageSourceSearch

https://www.sympoziumrenemacha.cz/dist/Amca/assets/fancybox.esm.2ca083c9.js

js sympoziumrenemacha.cz collected 2026-10-07 03:51:48 UTC 89,085 bytes, 8 lines download raw bytes

1const E=h=>typeof h=="object"&&h!==null&&h.constructor===Object&&Object.prototype.toString.call(h)==="[object Object]",b=(...h)=>{let t=!1;typeof h[0]=="boolean"&&(t=h.shift());let e=h[0];if(!e||typeof e!="object")throw new Error("extendee must be an object");const i=h.slice(1),s=i.length;for(let o=0;o<s;o++){const n=i[o];for(let a in n)if(n.hasOwnProperty(a)){const r=n[a];if(t&&(Array.isArray(r)||E(r))){const c=Array.isArray(r)?[]:{};e[a]=b(!0,e.hasOwnProperty(a)?e[a]:c,r)}else e[a]=r}}return e},v=(h,t=1e4)=>(h=parseFloat(h)||0,Math.round((h+Number.EPSILON)*t)/t),_=function(h){return!!(h&&typeof h=="object"&&h instanceof Element&&h!==document.body)&&!h.__Panzoom&&(function(t){const e=getComputedStyle(t)["overflow-y"],i=getComputedStyle(t)["overflow-x"],s=(e==="scroll"||e==="auto")&&Math.abs(t.scrollHeight-t.clientHeight)>1,o=(i==="scroll"||i==="auto")&&Math.abs(t.scrollWidth-t.clientWidth)>1;return s||o}(h)?h:_(h.parentNode))},tt=typeof window!="undefined"&&window.ResizeObserver||class{constructor(h){this.observables=[],this.boundCheck=this.check.bind(this),this.boundCheck(),this.callback=h}observe(h){if(this.observables.some(e=>e.el===h))return;const t={el:h,size:{height:h.clientHeight,width:h.clientWidth}};this.observables.push(t)}unobserve(h){this.observables=this.observables.filter(t=>t.el!==h)}disconnect(){this.observables=[]}check(){const h=this.observables.filter(t=>{const e=t.el.clientHeight,i=t.el.clientWidth;if(t.size.height!==e||t.size.width!==i)return t.size.height=e,t.size.width=i,!0}).map(t=>t.el);h.length>0&&this.callback(h),window.requestAnimationFrame(this.boundCheck)}};class S{constructor(t){this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY}}const B=(h,t)=>t?Math.sqrt((t.clientX-h.clientX)**2+(t.clientY-h.clientY)**2):0,O=(h,t)=>t?{clientX:(h.clientX+t.clientX)/2,clientY:(h.clientY+t.clientY)/2}:h;class et{constructor(t,{start:e=()=>!0,move:i=()=>{},end:s=()=>{}}={}){this._element=t,this.startPointers=[],this.currentPointers=[],this._pointerStart=o=>{if(o.buttons>0&&o.button!==0)return;const n=new S(o);this.currentPointers.some(a=>a.id===n.id)||this._triggerPointerStart(n,o)&&(window.addEventListener("mousemove",this._move),window.addEventListener("mouseup",this._pointerEnd))},this._touchStart=o=>{for(const n of Array.from(o.changedTouches||[]))this._triggerPointerStart(new S(n),o)},this._move=o=>{const n=this.currentPointers.slice(),a=(r=>"changedTouches"in r)(o)?Array.from(o.changedTouches).map(r=>new S(r)):[new S(o)];for(const r of a){const c=this.currentPointers.findIndex(l=>l.id===r.id);c<0||(this.currentPointers[c]=r)}this._moveCallback(n,this.currentPointers.slice(),o)},this._triggerPointerEnd=(o,n)=>{const a=this.currentPointers.findIndex(r=>
1r.id===o.id);return!(a<0)&&(this.currentPointers.splice(a,1),this.startPointers.splice(a,1),this._endCallback(o,n),!0)},this._pointerEnd=o=>{o.buttons>0&&o.button!==0||this._triggerPointerEnd(new S(o),o)&&(window.removeEventListener("mousemove",this._move,{passive:!1}),window.removeEventListener("mouseup",this._pointerEnd,{passive:!1}))},this._touchEnd=o=>{for(const n of Array.from(o.changedTouches||[]))this._triggerPointerEnd(new S(n),o)},this._startCallback=e,this._moveCallback=i,this._endCallback=s,this._element.addEventListener("mousedown",this._pointerStart,{passive:!1}),this._element.addEventListener("touchstart",this._touchStart,{passive:!1}),this._element.addEventListener("touchmove",this._move,{passive:!1}),this._element.addEventListener("touchend",this._touchEnd),this._element.addEventListener("touchcancel",this._touchEnd)}stop(){this._element.removeEventListener("mousedown",this._pointerStart,{passive:!1}),this._element.removeEventListener("touchstart",this._touchStart,{passive:!1}),this._element.removeEventListener("touchmove",this._move,{passive:!1}),this._element.removeEventListener("touchend",this._touchEnd),this._element.removeEventListener("touchcancel",this._touchEnd),window.removeEventListener("mousemove",this._move),window.removeEventListener("mouseup",this._pointerEnd)}_triggerPointerStart(t,e){return!!this._startCallback(t,e)&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}}class I{constructor(t={}){this.options=b(!0,{},t),this.plugins=[],this.events={};for(const e of["on","once"])for(const i of Object.entries(this.options[e]||{}))this[e](...i)}option(t,e,...i){t=String(t);let s=(o=t,n=this.options,o.split(".").reduce(function(a,r){return a&&a[r]},n));var o,n;return typeof s=="function"&&(s=s.call(this,this,...i)),s===void 0?e:s}localize(t,e=[]){return t=(t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,(i,s,o)=>{let n="";o?n=this.option(`${s[0]+s.toLowerCase().substring(1)}.l10n.${o}`):s&&(n=this.option(`l10n.${s}`)),n||(n=i);for(let a=0;a<e.length;a++)n=n.split(e[a][0]).join(e[a][1]);return n})).replace(/\{\{(.*)\}\}/,(i,s)=>s)}on(t,e){if(E(t)){for(const i of Object.entries(t))this.on(...i);return this}return String(t).split(" ").forEach(i=>{const s=this.events[i]=this.events[i]||[];s.indexOf(e)==-1&&s.push(e)}),this}once(t,e){if(E(t)){for(const i of Object.entries(t))this.once(...i);return this}return String(t).split(" ").forEach(i=>{const s=(...o)=>{this.off(i,s),e.call(this,this,...o)};s._=e,this.on(i,s)}),this}off(t,e){if(!E(t))return t.split(" ").forEach(i=>{const s=this.events[i];if(!s||!s.length)return this;let o=-1;for(let n=0,a=s.length;n<a;n++){const r=s[n];if(r&&(r===e||r._===e)){o=n;break}}o!=-1&&s.splice(o,1)}),this;for(const i of Object.entries(t))this.off(...i)}trigger(t,...e){for(const i of[...this.events[t]||[]].slice())if(i&&i.call(this,this,...e)===!1)return!1;for(const i of[...this.events["*"]||[]].slice())if(i&&i.call(this,t,this,...e)===!1)return!1;return!0}attachPlugins(t){const e={};for(const[i,s]of Object.entries(t||{}))this.options[i]===!1||this.plugins[i]||(this.options[i]=b({},s.defaults||{},this.options[i]),e[i]=new s(this));for(const[i,s]of Object.entries(e))s.attach(this);return this.plugins=Object.assign({},this.plugins,e),this}detachPlugins(){for(const t in this.plugins){let e;(e=this.plugins[t])&&typeof e.detach=="function"&&e.detach(this)}return this.plugins={},this}}const it={touch:!0,zoom:!0,pinchToZoom:!0,panOnlyZoomed:!1,lockAxis:!1,friction:.64,decelFriction:.88,zoomFriction:.74,bounceForce:.2,baseScale:1,minScale:1,maxScale:2,step:.5,textSelection:!1,click:"toggleZoom",wheel:"zoom",wheelFactor:42,wheelLimit:5,draggableClass:"is-draggable",draggingClass:"is-dragging",ratio:1};class P extends I{constructor(t,e={}){super(b(!0,{},it,e)),this.state="init",this.$container=t;for(const i of["onLoad","onWheel","onClick"])this[i]=this[i].bind(this);this.initLayout(),this.resetValues(),this.attachPlugins(P.Plugins),this.trigger("init"),this.updateMetrics(),this.attachEvents(),this.trigger("ready"),this.option("centerOnStart")===!1?this.state="ready":this.panTo({friction:0}),t.__Panzoom=this}initLayout(){const t=this.$container;if(!(t instanceof HTMLElement))throw new Error("Panzoom: Container not found");const e=this.option("content")||t.querySelector(".panzoom__content");
1if(!e)throw new Error("Panzoom: Content not found");this.$content=e;let i=this.option("viewport")||t.querySelector(".panzoom__viewport");i||this.option("wrapInner")===!1||(i=document.createElement("div"),i.classList.add("panzoom__viewport"),i.append(...t.childNodes),t.appendChild(i)),this.$viewport=i||e.parentNode}resetValues(){this.updateRate=this.option("updateRate",/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?250:24),this.container={width:0,height:0},this.viewport={width:0,height:0},this.content={origWidth:0,origHeight:0,width:0,height:0,x:this.option("x",0),y:this.option("y",0),scale:this.option("baseScale")},this.transform={x:0,y:0,scale:1},this.resetDragPosition()}onLoad(t){this.updateMetrics(),this.panTo({scale:this.option("baseScale"),friction:0}),this.trigger("load",t)}onClick(t){if(t.defaultPrevented||document.activeElement&&document.activeElement.closest("[contenteditable]"))return;if(this.option("textSelection")&&window.getSelection().toString().length&&(!t.target||!t.target.hasAttribute("data-fancybox-close")))return void t.stopPropagation();const e=this.$content.getClientRects()[0];if(this.state!=="ready"&&(this.dragPosition.midPoint||Math.abs(e.top-this.dragStart.rect.top)>1||Math.abs(e.left-this.dragStart.rect.left)>1))return t.preventDefault(),void t.stopPropagation();this.trigger("click",t)!==!1&&this.option("zoom")&&this.option("click")==="toggleZoom"&&(t.preventDefault(),t.stopPropagation(),this.zoomWithClick(t))}onWheel(t){this.trigger("wheel",t)!==!1&&this.option("zoom")&&this.option("wheel")&&this.zoomWithWheel(t)}zoomWithWheel(t){this.changedDelta===void 0&&(this.changedDelta=0);const e=Math.max(-1,Math.min(1,-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)),i=this.content.scale;let s=i*(100+e*this.option("wheelFactor"))/100;if(e<0&&Math.abs(i-this.option("minScale"))<.01||e>0&&Math.abs(i-this.option("maxScale"))<.01?(this.changedDelta+=Math.abs(e),s=i):(this.changedDelta=0,s=Math.max(Math.min(s,this.option("maxScale")),this.option("minScale"))),this.changedDelta>this.option("wheelLimit")||(t.preventDefault(),s===i))return;const o=this.$content.getBoundingClientRect(),n=t.clientX-o.left,a=t.clientY-o.top;this.zoomTo(s,{x:n,y:a})}zoomWithClick(t){const e=this.$content.getClientRects()[0],i=t.clientX-e.left,s=t.clientY-e.top;this.toggleZoom({x:i,y:s})}attachEvents(){this.$content.addEventListener("load",this.onLoad),this.$container.addEventListener("wheel",this.onWheel,{passive:!1}),this.$container.addEventListener("click",this.onClick,{passive:!1}),this.initObserver();const t=new et(this.$container,{start:(e,i)=>{if(!this.option("touch")||this.velocity.scale<0)return!1;const s=i.composedPath()[0];return!t.currentPointers.length&&(["BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(s.nodeName)!==-1||this.option("textSelection")&&((o,n,a)=>{const r=o.childNodes,c=document.createRange();for(let l=0;l<r.length;l++){const u=r[l];if(u.nodeType!==Node.TEXT_NODE)continue;c.selectNodeContents(u);const f=c.getBoundingClientRect();if(n>=f.left&&a>=f.top&&n<=f.right&&a<=f.bottom)return u}return!1})(s,e.clientX,e.clientY))?!1:!_(s)&&this.trigger("touchStart",i)!==!1&&(i.type==="mousedown"&&i.preventDefault(),this.state="pointerdown",this.resetDragPosition(),this.dragPosition.midPoint=null,this.dragPosition.time=Date.now(),!0)},move:(e,i,s)=>{if(this.state!=="pointerdown")return;if(this.trigger("touchMove",s)===!1)return void s.preventDefault();if(i.length<2&&this.option("panOnlyZoomed")===!0&&this.content.width<=this.viewport.width&&this.content.height<=this.viewport.height&&this.transform.scale<=this.option("baseScale")||i.length>1&&(!this.option("zoom")||this.option("pinchToZoom")===!1))return;const o=O(e[0],e[1]),n=O(i[0],i[1]),a=n.clientX-o.clientX,r=n.clientY-o.clientY,c=B(e[0],e[1]),l=B(i[0],i[1]),u=c&&l?l/c:1;this.dragOffset.x+=a,this.dragOffset.y+=r,this.dragOffset.scale*=u,this.dragOffset.time=Date.now()-this.dragPosition.time;const f=this.dragStart.scale===1&&this.option("lockAxis");if(f&&!this.lockAxis){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void s.preventDefault();const d=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockAxis=d>45&&d<135?"y":"x"}if(f==="xy"||this.lockAxis!=="y"){if(s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),this.lockAxis&&(this.dragOffset[this.lockAxis==="x"?"y":"x"]=0),this.$container.classList.add(this.option("draggingClass")),this.transform.scale===this.option("baseScale")&&this.lockAxis==="y"||(this.dragPosition.x=this.dragStart.x+this.dragOffset.x),this.transform.scale===this.option("baseScale")&&this.lockAxis==="x"||(this.dragPosition.y=this.dragStart.y+this.dragOffset.y),this.dragPosition.scale=this.dragStart.scale*this.dragOffset.scale,i.length>1){const d=O(t.startPointers[0],t.startPointers[1]),g=d.clientX-this.dragStart.rect.x,m=d.clientY-this.dragStart.rect.y,{deltaX:y,deltaY:$}=this.getZoomDelta(this.content.scale*this.dragOffset.scale,g,m);this.dragPosition.x-=y,this.dragPosition.y-=$,this.dragPosition.midPoint=n}else this.setDragResistance();this.transform={x:this.dragPosition.x,y:this.dragPosition.y,scale:this.dragPosition.scale},this.startAnimation()}},end:(e,i)=>{if(this.state!=="pointerdown")return;if(this._dragOffset={...this.dragOffset},t.currentPointers.length)return void this.resetDragPosition();if(this.state="decel",this.friction=this.option("decelFriction"),this.recalculateTransform(),this.$container.classList.remove(this.option("draggingClass")),this.trigger("touchEnd",i)===!1||this.state!=="decel")return;const s=this.option("minScale");if(this.transform.scale<s)return void this.zoomTo(s,{friction:.64});const o=this.option("maxScale");if(this.transform.scale-o>.01){const n=this.dragPosition.midPoint||e,a=this.$content.getClientRects()[0];
1this.zoomTo(o,{friction:.64,x:n.clientX-a.left,y:n.clientY-a.top})}}});this.pointerTracker=t}initObserver(){this.resizeObserver||(this.resizeObserver=new tt(()=>{this.updateTimer||(this.updateTimer=setTimeout(()=>{const t=this.$container.getBoundingClientRect();t.width&&t.height?((Math.abs(t.width-this.container.width)>1||Math.abs(t.height-this.container.height)>1)&&(this.isAnimating()&&this.endAnimation(!0),this.updateMetrics(),this.panTo({x:this.content.x,y:this.content.y,scale:this.option("baseScale"),friction:0})),this.updateTimer=null):this.updateTimer=null},this.updateRate))}),this.resizeObserver.observe(this.$container))}resetDragPosition(){this.lockAxis=null,this.friction=this.option("friction"),this.velocity={x:0,y:0,scale:0};const{x:t,y:e,scale:i}=this.content;this.dragStart={rect:this.$content.getBoundingClientRect(),x:t,y:e,scale:i},this.dragPosition={...this.dragPosition,x:t,y:e,scale:i},this.dragOffset={x:0,y:0,scale:1,time:0}}updateMetrics(t){t!==!0&&this.trigger("beforeUpdate");const e=this.$container,i=this.$content,s=this.$viewport,o=i instanceof HTMLImageElement,n=this.option("zoom"),a=this.option("resizeParent",n);let r=this.option("width"),c=this.option("height"),l=r||(u=i,Math.max(parseFloat(u.naturalWidth||0),parseFloat(u.width&&u.width.baseVal&&u.width.baseVal.value||0),parseFloat(u.offsetWidth||0),parseFloat(u.scrollWidth||0)));var u;let f=c||(x=>Math.max(parseFloat(x.naturalHeight||0),parseFloat(x.height&&x.height.baseVal&&x.height.baseVal.value||0),parseFloat(x.offsetHeight||0),parseFloat(x.scrollHeight||0)))(i);Object.assign(i.style,{width:r?`${r}px`:"",height:c?`${c}px`:"",maxWidth:"",maxHeight:""}),a&&Object.assign(s.style,{width:"",height:""});const d=this.option("ratio");l=v(l*d),f=v(f*d),r=l,c=f;const g=i.getBoundingClientRect(),m=s.getBoundingClientRect(),y=s==e?m:e.getBoundingClientRect();let $=Math.max(s.offsetWidth,v(m.width)),F=Math.max(s.offsetHeight,v(m.height)),z=window.getComputedStyle(s);if($-=parseFloat(z.paddingLeft)+parseFloat(z.paddingRight),F-=parseFloat(z.paddingTop)+parseFloat(z.paddingBottom),this.viewport.width=$,this.viewport.height=F,n){if(Math.abs(l-g.width)>.1||Math.abs(f-g.height)>.1){const x=((N,R,J,Q)=>{const D=Math.min(J/N||0,Q/R);return{width:N*D||0,height:R*D||0}})(l,f,Math.min(l,g.width),Math.min(f,g.height));r=v(x.width),c=v(x.height)}Object.assign(i.style,{width:`${r}px`,height:`${c}px`,transform:""})}if(a&&(Object.assign(s.style,{width:`${r}px`,height:`${c}px`}),this.viewport={...this.viewport,width:r,height:c}),o&&n&&typeof this.options.maxScale!="function"){const x=this.option("maxScale");this.options.maxScale=function(){return this.content.origWidth>0&&this.content.fitWidth>0?this.content.origWidth/this.content.fitWidth:x}}this.content={...this.content,origWidth:l,origHeight:f,fitWidth:r,fitHeight:c,width:r,height:c,scale:1,isZoomable:n},this.container={width:y.width,height:y.height},t!==!0&&this.trigger("afterUpdate")}zoomIn(t){this.zoomTo(this.content.scale+(t||this.option("step")))}zoomOut(t){this.zoomTo(this.content.scale-(t||this.option("step")))}toggleZoom(t={}){const e=this.option("maxScale"),i=this.option("baseScale"),s=this.content.scale>i+.5*(e-i)?i:e;this.zoomTo(s,t)}zoomTo(t=this.option("baseScale"),{x:e=null,y:i=null}={}){t=Math.max(Math.min(t,this.option("maxScale")),this.option("minScale"));const s=v(this.content.scale/(this.content.width/this.content.fitWidth),1e7);e===null&&(e=this.content.width*s*.5),i===null&&(i=this.content.height*s*.5);const{deltaX:o,deltaY:n}=this.getZoomDelta(t,e,i);e=this.content.x-o,i=this.content.y-n,this.panTo({x:e,y:i,scale:t,friction:this.option("zoomFriction")})}getZoomDelta(t,e=0,i=0){const s=this.content.fitWidth*this.content.scale,o=this.content.fitHeight*this.content.scale,n=e>0&&s?e/s:0,a=i>0&&o?i/o:0;return{deltaX:(this.content.fitWidth*t-s)*n,deltaY:(this.content.fitHeight*t-o)*a}}panTo({x:t=this.content.x,y:e=this.content.y,scale:i,friction:s=this.option("friction"),ignoreBounds:o=!1}={}){if(i=i||this.content.scale||1,!o){const{boundX:n,boundY:a}=this.getBounds(i);n&&(t=Math.max(Math.min(t,n.to),n.from)),a&&(e=Math.max(Math.min(e,a.to),a.from))}this.friction=s,this.transform={...this.transform,x:t,y:e,scale:i},s?(this.state="panning",this.velocity={x:(1/this.friction-1)*(t-this.content.x),y:(1/this.friction-1)*(e-this.content.y),scale:(1/this.friction-1)*(i-this.content.scale)},this.startAnimation()):this.endAnimation()}startAnimation(){this.rAF?cancelAnimationFrame(this.rAF):this.trigger("startAnimation"),this.rAF=requestAnimationFrame(()=>this.animate())}animate(){if(this.setEdgeForce(),this.setDragForce(),this.velocity.x*=this.friction,this.velocity.y*=this.friction,this.velocity.scale*=this.friction,this.content.x+=this.velocity.x,this.content.y+=this.velocity.y,this.content.scale+=this.velocity.scale,this.isAnimating())this.setTransform();else if(this.state!=="pointerdown")return void this.endAnimation();this.rAF=requestAnimationFrame(()=>this.animate())}getBounds(t){let e=this.boundX,i=this.boundY;if(e!==void 0&&i!==void 0)return{boundX:e,boundY:i};e={from:0,to:0},i={from:0,to:0},t=t||this.transform.scale;const s=this.content.fitWidth*t,o=this.content.fitHeight*t,n=this.viewport.width,a=this.viewport.height;if(s<n){const r=v(.5*(n-s));e.from=r,e.to=r}else e.from=v(n-s);if(o<a){const r=.5*(a-o);i.from=r,i.to=r}else i.from=v(a-o);return{boundX:e,boundY:i}}setEdgeForce(){if(this.state!=="decel")return;const t=this.option("bounceForce"),{boundX:e,boundY:i}=this.getBounds(Math.max(this.transform.scale,this.content.scale));let s,o,n,a;if(e&&(s=this.content.x<e.from,o=this.content.x>e.to),i&&(n=this.content.y<i.from,a=this.content.y>i.to),s||o){let r=((s?e.from:e.to)-this.content.x)*t;const c=this.content.x+(this.velocity.x+r)/this.friction;c>=e.from&&c<=e.to&&(r+=this.velocity.x),this.velocity.x=r,this.recalculateTransform()}if(n||a){let r=((n?i.from:i.to)-this.content.y)*t;const c=this.content.y+(r+this.velocity.y)/this.friction;c>=i.from&&c<=i.to&&(r+=this.velocity.y),this.velocity.y=r,this.recalculateTransform()}}setDragResistance(){if(this.state!=="pointerdown")return;const{boundX:t,boundY:e}=this.getBounds(this.dragPosition.scale);let i,s,o,n;if(t&&(i=this.dragPosition.x<t.from,s=this.dragPosition.x>t.to),e&&(o=this.dragPosition.y<e.from,n=this.dragPosition.y>e.to),(i||s)&&(!i||!s)){const a=i?t.from:t.to,r=a-this.dragPosition.x;this.dragPosition.x=a-.3*r}if((o||n)&&(!o||!n)){const a=o?e.from:e.to,r=a-this.dragPosition.y;this.dragPosition.y=a-.3*r}}setDragForce(){this.state==="pointerdown"&&(this.velocity.x=this.dragPosition.x-this.content.x,this.velocity.y=this.dragPosition.y-this.content.y,this.velocity.scale=this.dragPosition.scale-this.content.scale)}recalculateTransform(){this.transform.x=this.content.x+this.velocity.x/(1/this.friction-1),this.transform.y=this.content.y+this.velocity.y/(1/this.friction-1),this.transform.scale=this.content.scale+this.velocity.scale/(1/this.friction-1)}isAnimating(){return!(!this.friction||!(Math.abs(this.velocity.x)>.05||Math.abs(this.velocity.y)>.05||Math.abs(this.velocity.scale)>.05))}setTransform(t){let e,i,s;if(t?(e=v(this.transform.x),i=v(this.transform.y),s=this.transform.scale,this.content={...this.content,x:e,y:i,scale:s}):(e=v(this.content.x),i=v(this.content.y),s=this.content.scale/(this.content.width/this.content.fitWidth),this.content={...this.content,x:e,y:i}),this.trigger("beforeTransform"),e=v(this.content.x),i=v(this.content.y),t&&this.option("zoom")){let o,n;o=v(this.content.fitWidth*s),n=v(this.content.fitHeight*s),this.content.width=o,this.content.height=n,this.transform={...this.transform,width:o,height:n,scale:s},Object.assign(this.$content.style,{width:`${o}px`,height:`${n}px`,maxWidth:"none",maxHeight:"none",transform:`translate3d(${e}px, ${i}px, 0) scale(1)`})}else this.$content.style.transform=`translate3d(${e}px, ${i}px, 0) scale(${s})`;this.trigger("afterTransform")}endAnimation(t){cancelAnimationFrame(this.rAF),this.rAF=null,this.velocity={x:0,y:0,scale:0}
1,this.setTransform(!0),this.state="ready",this.handleCursor(),t!==!0&&this.trigger("endAnimation")}handleCursor(){const t=this.option("draggableClass");t&&this.option("touch")&&(this.option("panOnlyZoomed")==1&&this.content.width<=this.viewport.width&&this.content.height<=this.viewport.height&&this.transform.scale<=this.option("baseScale")?this.$container.classList.remove(t):this.$container.classList.add(t))}detachEvents(){this.$content.removeEventListener("load",this.onLoad),this.$container.removeEventListener("wheel",this.onWheel,{passive:!1}),this.$container.removeEventListener("click",this.onClick,{passive:!1}),this.pointerTracker&&(this.pointerTracker.stop(),this.pointerTracker=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}destroy(){this.state!=="destroy"&&(this.state="destroy",clearTimeout(this.updateTimer),this.updateTimer=null,cancelAnimationFrame(this.rAF),this.rAF=null,this.detachEvents(),this.detachPlugins(),this.resetDragPosition())}}P.version="4.0.31",P.Plugins={};const H=(h,t)=>{let e=0;return function(...i){const s=new Date().getTime();if(!(s-e<t))return e=s,h(...i)}};class q{constructor(t){this.$container=null,this.$prev=null,this.$next=null,this.carousel=t,this.onRefresh=this.onRefresh.bind(this)}option(t){return this.carousel.option(`Navigation.${t}`)}createButton(t){const e=document.createElement("button");e.setAttribute("title",this.carousel.localize(`{{${t.toUpperCase()}}}`));const i=this.option("classNames.button")+" "+this.option(`classNames.${t}`);return e.classList.add(...i.split(" ")),e.setAttribute("tabindex","0"),e.innerHTML=this.carousel.localize(this.option(`${t}Tpl`)),e.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.carousel["slide"+(t==="next"?"Next":"Prev")]()}),e}build(){this.$container||(this.$container=document.createElement("div"),this.$container.classList.add(...this.option("classNames.main").split(" ")),this.carousel.$container.appendChild(this.$container)),this.$next||(this.$next=this.createButton("next"),this.$container.appendChild(this.$next)),this.$prev||(this.$prev=this.createButton("prev"),this.$container.appendChild(this.$prev))}onRefresh(){const t=this.carousel.pages.length;t<=1||t>1&&this.carousel.elemDimWidth<this.carousel.wrapDimWidth&&!Number.isInteger(this.carousel.option("slidesPerPage"))?this.cleanup():(this.build(),this.$prev.removeAttribute("disabled"),this.$next.removeAttribute("disabled"),this.carousel.option("infiniteX",this.carousel.option("infinite"))||(this.carousel.page<=0&&this.$prev.setAttribute("disabled",""),this.carousel.page>=t-1&&this.$next.setAttribute("disabled","")))}cleanup(){this.$prev&&this.$prev.remove(),this.$prev=null,this.$next&&this.$next.remove(),this.$next=null,this.$container&&this.$container.remove(),this.$container=null}attach(){this.carousel.on("refresh change",this.onRefresh)}detach(){this.carousel.off("refresh change",this.onRefresh),this.cleanup()}}q.defaults={prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>',nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>',classNames:{main:"carousel__nav",button:"carousel__button",next:"is-next",prev:"is-prev"}};class U{constructor(t){this.carousel=t,this.selectedIndex=null,this.friction=0,this.onNavReady=this.onNavReady.bind(this),this.onNavClick=this.onNavClick.bind(this),this.onNavCreateSlide=this.onNavCreateSlide.bind(this),this.onTargetChange=this.onTargetChange.bind(this)}addAsTargetFor(t){this.target=this.carousel,this.nav=t,this.attachEvents()}addAsNavFor(t){this.target=t,this.nav=this.carousel,this.attachEvents()}attachEvents(){this.nav.options.initialSlide=this.target.options.initialPage,this.nav.on("ready",this.onNavReady),this.nav.on("createSlide",this.onNavCreateSlide),this.nav.on("Panzoom.click",this.onNavClick),this.target.on("change",this.onTargetChange),this.target.on("Panzoom.afterUpdate",this.onTargetChange)}onNavReady(){this.onTargetChange(!0)}onNavClick(t,e,i){const s=i.target.closest(".carousel__slide");if(!s)return;i.stopPropagation();const o=parseInt(s.dataset.index,10),n=this.target.findPageForSlide(o);this.target.page!==n&&this.target.slideTo(n,{friction:this.friction}),this.markSelectedSlide(o)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){const t=this.target.pages[this.target.page].indexes[0],e=this.nav.findPageForSlide(t);this.nav.slideTo(e),this.markSelectedSlide(t)}markSelectedSlide(t){this.selectedIndex=t,[...this.nav.slides].filter(i=>i.$el&&i.$el.classList.remove("is-nav-selected"));const e=this.nav.slides[t];e&&e.$el&&e.$el.classList.add("is-nav-selected")}attach(t){const e=t.options.Sync;(e.target||e.nav)&&(e.target?this.addAsNavFor(e.target):e.nav&&this.addAsTargetFor(e.nav),this.friction=e.friction)}detach(){this.nav&&(this.nav.off("ready",this.onNavReady),this.nav.off("Panzoom.click",this.onNavClick),this.nav.off("createSlide",this.onNavCreateSlide)),this.target&&(this.target.off("Panzoom.afterUpdate",this.onTargetChange),this.target.off("change",this.onTargetChange))}}U.defaults={friction:.92};const st={Navigation:q,Dots:class{constructor(h){this.carousel=h,this.$list=null,this.events={change:this.onChange.bind(this),refresh:this.onRefresh.bind(this)}}buildList(){if(this.carousel.pages.length<this.carousel.option("Dots.minSlideCount"))return;const h=document.createElement("ol");return h.classList.add("carousel__dots"),h.addEventListener("click",t=>{if(!("page"in t.target.dataset))return;t.preventDefault(),t.stopPropagation();const e=parseInt(t.target.dataset.page,10),i=this.carousel;e!==i.page&&(i.pages.length<3&&i.option("infinite")?i[e==0?"slidePrev":"slideNext"]():i.slideTo(e))}),this.$list=h,this.carousel.$container.appendChild(h),this.carousel.$container.classList.add("has-dots"),h}removeList(){this.$list&&(this.$list.parentNode.removeChild(this.$list),this.$list=null),this.carousel.$container.classList.remove("has-dots")}rebuildDots(){let h=this.$list;const t=!!h,e=this.carousel.pages.length;if(e<2)return void(t&&this.removeList());t||(h=this.buildList());const i=this.$list.children.length;if(i>e)for(let s=e;s<i;s++)this.$list.removeChild(this.$list.lastChild);else{for(let s=i;s<e;s++){const o=document.createElement("li");o.classList.add("carousel__dot"),o.dataset.page=s,o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.setAttribute("title",this.carousel.localize("{{GOTO}}",[["%d",s+1]])),o.addEventListener("keydown",n=>
1{const a=n.code;let r;a==="Enter"||a==="NumpadEnter"?r=o:a==="ArrowRight"?r=o.nextSibling:a==="ArrowLeft"&&(r=o.previousSibling),r&&r.click()}),this.$list.appendChild(o)}this.setActiveDot()}}setActiveDot(){if(!this.$list)return;this.$list.childNodes.forEach(t=>{t.classList.remove("is-selected")});const h=this.$list.childNodes[this.carousel.page];h&&h.classList.add("is-selected")}onChange(){this.setActiveDot()}onRefresh(){this.rebuildDots()}attach(){this.carousel.on(this.events)}detach(){this.removeList(),this.carousel.off(this.events),this.carousel=null}},Sync:U},ot={slides:[],preload:0,slidesPerPage:"auto",initialPage:null,initialSlide:null,friction:.92,center:!0,infinite:!0,fill:!0,dragFree:!1,prefix:"",classNames:{viewport:"carousel__viewport",track:"carousel__track",slide:"carousel__slide",slideSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}};class T extends I{constructor(t,e={}){if(super(e=b(!0,{},ot,e)),this.state="init",this.$container=t,!(this.$container instanceof HTMLElement))throw new Error("No root element provided");this.slideNext=H(this.slideNext.bind(this),250),this.slidePrev=H(this.slidePrev.bind(this),250),this.init(),t.__Carousel=this}init(){this.pages=[],this.page=this.pageIndex=null,this.prevPage=this.prevPageIndex=null,this.attachPlugins(T.Plugins),this.trigger("init"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.$track&&this.pages.length&&(this.$track.style.transform=`translate3d(${-1*this.pages[this.page].left}px, 0px, 0) scale(1)`),this.manageSlideVisiblity(),this.initPanzoom(),this.state="ready",this.trigger("ready")}initLayout(){const t=this.option("prefix"),e=this.option("classNames");this.$viewport=this.option("viewport")||this.$container.querySelector(`.${t}${e.viewport}`),this.$viewport||(this.$viewport=document.createElement("div"),this.$viewport.classList.add(...(t+e.viewport).split(" ")),this.$viewport.append(...this.$container.childNodes),this.$container.appendChild(this.$viewport)),this.$track=this.option("track")||this.$container.querySelector(`.${t}${e.track}`),this.$track||(this.$track=document.createElement("div"),this.$track.classList.add(...(t+e.track).split(" ")),this.$track.append(...this.$viewport.childNodes),this.$viewport.appendChild(this.$track))}initSlides(){this.slides=[],this.$viewport.querySelectorAll(`.${this.option("prefix")}${this.option("classNames.slide")}`).forEach(t=>{const e={$el:t,isDom:!0};this.slides.push(e),this.trigger("createSlide",e,this.slides.length)}),Array.isArray(this.options.slides)&&(this.slides=b(!0,[...this.slides],this.options.slides))}updateMetrics(){let t,e=0,i=[];this.slides.forEach((d,g)=>{const m=d.$el,y=d.isDom||!t?this.getSlideMetrics(m):t;d.index=g,d.width=y,d.left=e,t=y,e+=y,i.push(g)});let s=Math.max(this.$track.offsetWidth,v(this.$track.getBoundingClientRect().width)),o=getComputedStyle(this.$track);s-=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),this.contentWidth=e,this.viewportWidth=s;const n=[],a=this.option("slidesPerPage");if(Number.isInteger(a)&&e>s)for(let d=0;d<this.slides.length;d+=a)n.push({indexes:i.slice(d,d+a),slides:this.slides.slice(d,d+a)});else{let d=0,g=0;for(let m=0;m<this.slides.length;m+=1){let y=this.slides[m];(!n.length||g+y.width>s)&&(n.push({indexes:[],slides:[]}),d=n.length-1,g=0),g+=y.width,n[d].indexes.push(m),n[d].slides.push(y)}}const r=this.option("center"),c=this.option("fill");n.forEach((d,g)=>{d.index=g,d.width=d.slides.reduce((m,y)=>m+y.width,0),d.left=d.slides[0].left,r&&(d.left+=.5*(s-d.width)*-1),c&&!this.option("infiniteX",this.option("infinite"))&&e>s&&(d.left=Math.max(d.left,0),d.left=Math.min(d.left,e-s))});const l=[];let u;n.forEach(d=>{const g={...d};u&&g.left===u.left?(u.width+=g.width,u.slides=[...u.slides,...g.slides],u.indexes=[...u.indexes,...g.indexes]):(g.index=l.length,u=g,l.push(g))}),this.pages=l;let f=this.page;if(f===null){const d=this.option("initialSlide");f=d!==null?this.findPageForSlide(d):parseInt(this.option("initialPage",0),10)||0,l[f]||(f=l.length&&f>l.length?l[l.length-1].index:0),this.page=f,this.pageIndex=f}this.updatePanzoom(),this.trigger("refresh")}getSlideMetrics(t){if(!t){const s=this.slides[0];(t=document.createElement("div")).dataset.isTestEl=1,t.style.visibility="hidden",t.classList.add(...(this.option("prefix")+this.option("classNames.slide")).split(" ")),s.customClass&&t.classList.add(...s.customClass.split(" ")),this.$track.prepend(t)}let e=Math.max(t.offsetWidth,v(t.getBoundingClientRect().width));const i=t.currentStyle||window.getComputedStyle(t);return e=e+(parseFloat(i.marginLeft)||0)+(parseFloat(i.marginRight)||0),t.dataset.isTestEl&&t.remove(),e}findPageForSlide(t){t=parseInt(t,10)||0;const e=this.pages.find(i=>i.indexes.indexOf(t)>-1);return e?e.index:null}slideNext(){this.slideTo(this.pageIndex+1)}
1slidePrev(){this.slideTo(this.pageIndex-1)}slideTo(t,e={}){const{x:i=-1*this.setPage(t,!0),y:s=0,friction:o=this.option("friction")}=e;this.Panzoom.content.x===i&&!this.Panzoom.velocity.x&&o||(this.Panzoom.panTo({x:i,y:s,friction:o,ignoreBounds:!0}),this.state==="ready"&&this.Panzoom.state==="ready"&&this.trigger("settle"))}initPanzoom(){this.Panzoom&&this.Panzoom.destroy();const t=b(!0,{},{content:this.$track,wrapInner:!1,resizeParent:!1,zoom:!1,click:!1,lockAxis:"x",x:this.pages.length?-1*this.pages[this.page].left:0,centerOnStart:!1,textSelection:()=>this.option("textSelection",!1),panOnlyZoomed:function(){return this.content.width<=this.viewport.width}},this.option("Panzoom"));this.Panzoom=new P(this.$container,t),this.Panzoom.on({"*":(e,...i)=>this.trigger(`Panzoom.${e}`,...i),afterUpdate:()=>{this.updatePage()},beforeTransform:this.onBeforeTransform.bind(this),touchEnd:this.onTouchEnd.bind(this),endAnimation:()=>{this.trigger("settle")}}),this.updateMetrics(),this.manageSlideVisiblity()}updatePanzoom(){this.Panzoom&&(this.Panzoom.content={...this.Panzoom.content,fitWidth:this.contentWidth,origWidth:this.contentWidth,width:this.contentWidth},this.pages.length>1&&this.option("infiniteX",this.option("infinite"))?this.Panzoom.boundX=null:this.pages.length&&(this.Panzoom.boundX={from:-1*this.pages[this.pages.length-1].left,to:-1*this.pages[0].left}),this.option("infiniteY",this.option("infinite"))?this.Panzoom.boundY=null:this.Panzoom.boundY={from:0,to:0},this.Panzoom.handleCursor())}manageSlideVisiblity(){const t=this.contentWidth,e=this.viewportWidth;let i=this.Panzoom?-1*this.Panzoom.content.x:this.pages.length?this.pages[this.page].left:0;const s=this.option("preload"),o=this.option("infiniteX",this.option("infinite")),n=parseFloat(getComputedStyle(this.$viewport,null).getPropertyValue("padding-left")),a=parseFloat(getComputedStyle(this.$viewport,null).getPropertyValue("padding-right"));this.slides.forEach(l=>{let u,f,d=0;u=i-n,f=i+e+a,u-=s*(e+n+a),f+=s*(e+n+a);const g=l.left+l.width>u&&l.left<f;u=i+t-n,f=i+t+e+a,u-=s*(e+n+a);const m=o&&l.left+l.width>u&&l.left<f;u=i-t-n,f=i-t+e+a,u-=s*(e+n+a);const y=o&&l.left+l.width>u&&l.left<f;m||g||y?(this.createSlideEl(l),g&&(d=0),m&&(d=-1),y&&(d=1),l.left+l.width>i&&l.left<=i+e+a&&(d=0)):this.removeSlideEl(l),l.hasDiff=d});let r=0,c=0;this.slides.forEach((l,u)=>{let f=0;l.$el?(u!==r||l.hasDiff?f=c+l.hasDiff*t:c=0,l.$el.style.left=Math.abs(f)>.1?`${c+l.hasDiff*t}px`:"",r++):c+=l.width}),this.markSelectedSlides()}createSlideEl(t){if(!t)return;if(t.$el){let n=t.$el.dataset.index;if(!n||parseInt(n,10)!==t.index){let a;t.$el.dataset.index=t.index,t.$el.querySelectorAll("[data-lazy-srcset]").forEach(r=>{r.srcset=r.dataset.lazySrcset}),t.$el.querySelectorAll("[data-lazy-src]").forEach(r=>{let c=r.dataset.lazySrc;r instanceof HTMLImageElement?r.src=c:r.style.backgroundImage=`url('${c}')`}),(a=t.$el.dataset.lazySrc)&&(t.$el.style.backgroundImage=`url('${a}')`),t.state="ready"}return}const e=document.createElement("div");e.dataset.index=t.index,e.classList.add(...(this.option("prefix")+this.option("classNames.slide")).split(" ")),t.customClass&&e.classList.add(...t.customClass.split(" ")),t.html&&(e.innerHTML=t.html);const i=[];this.slides.forEach((n,a)=>{n.$el&&i.push(a)});const s=t.index;let o=null;if(i.length){let n=i.reduce((a,r)=>Math.abs(r-s)<Math.abs(a-s)?r:a);o=this.slides[n]}return this.$track.insertBefore(e,o&&o.$el?o.index<t.index?o.$el.nextSibling:o.$el:null),t.$el=e,this.trigger("createSlide",t,s),t}removeSlideEl(t){t.$el&&!t.isDom&&(this.trigger("removeSlide",t),t.$el.remove(),t.$el=null)}markSelectedSlides(){const t=this.option("classNames.slideSelected"),e="aria-hidden";this.slides.forEach((i,s)=>{const o=i.$el;if(!o)return;const n=this.pages[this.page];n&&n.indexes&&n.indexes.indexOf(s)>-1?(t&&!o.classList.contains(t)&&(o.classList.add(t),this.trigger("selectSlide",i)),o.removeAttribute(e)):(t&&o.classList.contains(t)&&(o.classList.remove(t),this.trigger("unselectSlide",i)),o.setAttribute(e,!0))})}updatePage(){this.updateMetrics(),this.slideTo(this.page,{friction:0})}onBeforeTransform(){this.option("infiniteX",this.option("infinite"))&&this.manageInfiniteTrack(),this.manageSlideVisiblity()}manageInfiniteTrack(){const t=this.contentWidth,e=this.viewportWidth;if(!this.option("infiniteX",this.option("infinite"))||this.pages.length<2||t<e)return;const i=this.Panzoom;let s=!1;return i.content.x<-1*(t-e)&&(i.content.x+=t,this.pageIndex=this.pageIndex-this.pages.length,s=!0),i.content.x>e&&(i.content.x-=t,this.pageIndex=this.pageIndex+this.pages.length,s=!0),s&&i.state==="pointerdown"&&i.resetDragPosition(),s}onTouchEnd(t,e){const i=this.option("dragFree");if(!i&&this.pages.length>1&&t.dragOffset.time<350&&Math.abs(t.dragOffset.y)<1&&Math.abs(t.dragOffset.x)>5)this[t.dragOffset.x<0?"slideNext":"slidePrev"]();else if(i){const[,s]=this.getPageFromPosition(-1*t.transform.x);this.setPage(s)}else this.slideToClosest()}slideToClosest(t={}){let[,e]=this.getPageFromPosition(-1*this.Panzoom.content.x);this.slideTo(e,t)}getPageFromPosition(t){const e=this.pages.length;this.option("center")&&(t+=.5*this.viewportWidth);const i=Math.floor(t/this.contentWidth);t-=i*this.contentWidth;let s=this.slides.find(o=>o.left<=t&&o.left+o.width>t);if(s){let o=this.findPageForSlide(s.index);return[o,o+i*e]}return[0,0]}setPage(t,e){let i=0,s=parseInt(t,10)||0;const o=this.page,n=this.pageIndex,a=this.pages.length,r=this.contentWidth,c=this.viewportWidth;if(t=(s%a+a)%a,this.option("infiniteX",this.option("infinite"))&&r>c){const l=Math.floor(s/a)||0,u=r;if(i=this.pages[t].left+l*u,e===!0&&a>2){let f=-1*this.Panzoom.content.x;const d=i-u,g=i+u,m=Math.abs(f-i),y=Math.abs(f-d),$=Math.abs(f-g);$<m&&$<=y?(i=g,s+=a):y<m&&y<$&&(i=d,s-=a)}}else t=s=Math.max(0,Math.min(s,a-1)),i=this.pages.length?this.pages[t].left:0;return this.page=t,this.pageIndex=s,o!==null&&t!==o&&(this.prevPage=o,this.prevPageIndex=n,this.trigger("change",t,o)),i}
1destroy(){this.state="destroy",this.slides.forEach(t=>{this.removeSlideEl(t)}),this.slides=[],this.Panzoom.destroy(),this.detachPlugins()}}T.version="4.0.31",T.Plugins=st;const k=!(typeof window=="undefined"||!window.document||!window.document.createElement);let M=null;const W=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"]):not([disabled]):not([aria-hidden])'],L=h=>{if(h&&k){M===null&&document.createElement("div").focus({get preventScroll(){return M=!0,!1}});try{if(h.setActive)h.setActive();else if(M)h.focus({preventScroll:!0});else{const t=window.pageXOffset||document.body.scrollTop,e=window.pageYOffset||document.body.scrollLeft;h.focus(),document.body.scrollTo({top:t,left:e,behavior:"auto"})}}catch{}}},nt={minSlideCount:2,minScreenHeight:500,autoStart:!0,key:"t",Carousel:{},tpl:`<div class="fancybox__thumb" style="background-image:url('{{src}}')"></div>`};class Y{constructor(t){this.fancybox=t,this.$container=null,this.state="init";for(const e of["onPrepare","onClosing","onKeydown"])this[e]=this[e].bind(this);this.events={prepare:this.onPrepare,closing:this.onClosing,keydown:this.onKeydown}}onPrepare(){this.getSlides().length<this.fancybox.option("Thumbs.minSlideCount")?this.state="disabled":this.fancybox.option("Thumbs.autoStart")===!0&&this.fancybox.Carousel.Panzoom.content.height>=this.fancybox.option("Thumbs.minScreenHeight")&&this.build()}onClosing(){this.Carousel&&this.Carousel.Panzoom.detachEvents()}onKeydown(t,e){e===t.option("Thumbs.key")&&this.toggle()}build(){if(this.$container)return;const t=document.createElement("div");t.classList.add("fancybox__thumbs"),this.fancybox.$carousel.parentNode.insertBefore(t,this.fancybox.$carousel.nextSibling),this.Carousel=new T(t,b(!0,{Dots:!1,Navigation:!1,Sync:{friction:0},infinite:!1,center:!0,fill:!0,dragFree:!0,slidesPerPage:1,preload:1},this.fancybox.option("Thumbs.Carousel"),{Sync:{target:this.fancybox.Carousel},slides:this.getSlides()})),this.Carousel.Panzoom.on("wheel",(e,i)=>{i.preventDefault(),this.fancybox[i.deltaY<0?"prev":"next"]()}),this.$container=t,this.state="visible"}getSlides(){const t=[];for(const e of this.fancybox.items){const i=e.thumb;i&&t.push({html:this.fancybox.option("Thumbs.tpl").replace(/\{\{src\}\}/gi,i),customClass:`has-thumb has-${e.type||"image"}`})}return t}toggle(){this.state==="visible"?this.hide():this.state==="hidden"?this.show():this.build()}show(){this.state==="hidden"&&(this.$container.style.display="",this.Carousel.Panzoom.attachEvents(),this.state="visible")}hide(){this.state==="visible"&&(this.Carousel.Panzoom.detachEvents(),this.$container.style.display="none",this.state="hidden")}cleanup(){this.Carousel&&(this.Carousel.destroy(),this.Carousel=null),this.$container&&(this.$container.remove(),this.$container=null),this.state="init"}attach(){this.fancybox.on(this.events)}detach(){this.fancybox.off(this.events),this.cleanup()}}Y.defaults=nt;const X=(h,t)=>{const e=new URL(h),i=new URLSearchParams(e.search);let s=new URLSearchParams;for(const[n,a]of[...i,...Object.entries(t)])n==="t"?s.set("start",parseInt(a)):s.set(n,a);s=s.toString();let o=h.match(/#t=((.*)?\d+s)/);return o&&(s+=`#t=${o[1]}`),s},j={video:{autoplay:!0,ratio:16/9},youtube:{autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},vimeo:{hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},html5video:{tpl:`<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
2  <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn't support embedded videos.</video>`,format:""}};class V{constructor(t){this.fancybox=t;for(const e of["onInit","onReady","onCreateSlide","onRemoveSlide","onSelectSlide","onUnselectSlide","onRefresh","onMessage"])this[e]=this[e].bind(this);this.events={init:this.onInit,ready:this.onReady,"Carousel.createSlide":this.onCreateSlide,"Carousel.removeSlide":this.onRemoveSlide,"Carousel.selectSlide":this.onSelectSlide,"Carousel.unselectSlide":this.onUnselectSlide,"Carousel.refresh":this.onRefresh}}onInit(){for(const t of this.fancybox.items)this.processType(t)}processType(t){if(t.html)return t.src=t.html,t.type="html",void delete t.html;const e=t.src||"";let i=t.type||this.fancybox.options.type,s=null;if(!e||typeof e=="string"){if(s=e.match(/(?:youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const o=X(e,this.fancybox.option("Html.youtube")),n=encodeURIComponent(s[1]);t.videoId=n,t.src=`https://www.youtube-nocookie.com/embed/${n}?${o}`,t.thumb=t.thumb||`https://i.ytimg.com/vi/${n}/mqdefault.jpg`,t.vendor="youtube",i="video"}else if(s=e.match(/^.+vimeo.com\/(?:\/)?([\d]+)(.*)?/)){const o=X(e,this.fancybox.option("Html.vimeo")),n=encodeURIComponent(s[1]);t.videoId=n,t.src=`https://player.vimeo.com/video/${n}?${o}`,t.vendor="vimeo",i="video"}else(s=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(t.src=`//maps.google.${s[1]}/?ll=${(s[2]?s[2]+"&z="+Math.floor(s[3])+(s[4]?s[4].replace(/^\//,"&"):""):s[4]+"").replace(/\?/,"&")}&output=${s[4]&&s[4].indexOf("layer=c")>0?"svembed":"embed"}`,i="map"):(s=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(t.src=`//maps.google.${s[1]}/maps?q=${s[2].replace("query=","q=").replace("api=1","")}&output=embed`,i="map");i||(e.charAt(0)==="#"?i="inline":(s=e.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(i="html5video",t.format=t.format||"video/"+(s[1]==="ogv"?"ogg":s[1])):e.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?i="image":e.match(/\.(pdf)((\?|#).*)?$/i)&&(i="pdf")),t.type=i||this.fancybox.option("defaultType","image"),i!=="html5video"&&i!=="video"||(t.video=b({},this.fancybox.option("Html.video"),t.video),t._width&&t._height?t.ratio=parseFloat(t._width)/parseFloat(t._height):t.ratio=t.ratio||t.video.ratio||j.video.ratio)}}
2onReady(){this.fancybox.Carousel.slides.forEach(t=>{t.$el&&(this.setContent(t),t.index===this.fancybox.getSlide().index&&this.playVideo(t))})}onCreateSlide(t,e,i){this.fancybox.state==="ready"&&this.setContent(i)}loadInlineContent(t){let e;if(t.src instanceof HTMLElement)e=t.src;else if(typeof t.src=="string"){const i=t.src.split("#",2),s=i.length===2&&i[0]===""?i[1]:i[0];e=document.getElementById(s)}if(e){if(t.type==="clone"||e.$placeHolder){e=e.cloneNode(!0);let i=e.getAttribute("id");i=i?`${i}--clone`:`clone-${this.fancybox.id}-${t.index}`,e.setAttribute("id",i)}else{const i=document.createElement("div");i.classList.add("fancybox-placeholder"),e.parentNode.insertBefore(i,e),e.$placeHolder=i}this.fancybox.setContent(t,e)}else this.fancybox.setError(t,"{{ELEMENT_NOT_FOUND}}")}loadAjaxContent(t){const e=this.fancybox,i=new XMLHttpRequest;e.showLoading(t),i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&e.state==="ready"&&(e.hideLoading(t),i.status===200?e.setContent(t,i.responseText):e.setError(t,i.status===404?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const s=t.ajax||null;i.open(s?"POST":"GET",t.src),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(s),t.xhr=i}loadIframeContent(t){const e=this.fancybox,i=document.createElement("iframe");if(i.className="fancybox__iframe",i.setAttribute("id",`fancybox__iframe_${e.id}_${t.index}`),i.setAttribute("allow","autoplay; fullscreen"),i.setAttribute("scrolling","auto"),t.$iframe=i,t.type!=="iframe"||t.preload===!1)return i.setAttribute("src",t.src),this.fancybox.setContent(t,i),void this.resizeIframe(t);e.showLoading(t);const s=document.createElement("div");s.style.visibility="hidden",this.fancybox.setContent(t,s),s.appendChild(i),i.onerror=()=>{e.setError(t,"{{IFRAME_ERROR}}")},i.onload=()=>{e.hideLoading(t);let o=!1;i.isReady||(i.isReady=!0,o=!0),i.src.length&&(i.parentNode.style.visibility="",this.resizeIframe(t),o&&e.revealContent(t))},i.setAttribute("src",t.src)}setAspectRatio(t){const e=t.$content,i=t.ratio;if(!e)return;let s=t._width,o=t._height;if(i||s&&o){Object.assign(e.style,{width:s&&o?"100%":"",height:s&&o?"100%":"",maxWidth:"",maxHeight:""});let n=e.offsetWidth,a=e.offsetHeight;if(s=s||n,o=o||a,s>n||o>a){let r=Math.min(n/s,a/o);s*=r,o*=r}Math.abs(s/o-i)>.01&&(i<s/o?s=o*i:o=s/i),Object.assign(e.style,{width:`${s}px`,height:`${o}px`})}}resizeIframe(t){const e=t.$iframe;if(!e)return;let i=t._width||0,s=t._height||0;i&&s&&(t.autoSize=!1);const o=e.parentNode,n=o&&o.style;if(t.preload!==!1&&t.autoSize!==!1&&n)try{const a=window.getComputedStyle(o),r=parseFloat(a.paddingLeft)+parseFloat(a.paddingRight),c=parseFloat(a.paddingTop)+parseFloat(a.paddingBottom),l=e.contentWindow.document,u=l.getElementsByTagName("html")[0],f=l.body;n.width="",f.style.overflow="hidden",i=i||u.scrollWidth+r,n.width=`${i}px`,f.style.overflow="",n.flex="0 0 auto",n.height=`${f.scrollHeight}px`,s=u.scrollHeight+c}catch{}if(i||s){const a={flex:"0 1 auto"};i&&(a.width=`${i}px`),s&&(a.height=`${s}px`),Object.assign(n,a)}}onRefresh(t,e){e.slides.forEach(i=>{i.$el&&(i.$iframe&&this.resizeIframe(i),i.ratio&&this.setAspectRatio(i))})}setContent(t){if(t&&!t.isDom){switch(t.type){case"html":this.fancybox.setContent(t,t.src);break;case"html5video":this.fancybox.setContent(t,this.fancybox.option("Html.html5video.tpl").replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.format||t.html5video&&t.html5video.format||"").replace("{{poster}}",t.poster||t.thumb||""));break;case"inline":case"clone":this.loadInlineContent(t);break;case"ajax":this.loadAjaxContent(t);break;case"pdf":case"video":case"map":t.preload=!1;case"iframe":this.loadIframeContent(t)}t.ratio&&this.setAspectRatio(t)}}onSelectSlide(t,e,i){t.state==="ready"&&this.playVideo(i)}playVideo(t){if(t.type==="html5video"&&t.video.autoplay)try{const i=t.$el.querySelector("video");if(i){const s=i.play();s!==void 0&&s.then(()=>{}).catch(o=>{i.muted=!0,i.play()})}}catch{}if(t.type!=="video"||!t.$iframe||!t.$iframe.contentWindow)return;const e=()=>{if(t.state==="done"&&t.$iframe&&t.$iframe.contentWindow){let i;if(t.$iframe.isReady)return t.video&&t.video.autoplay&&(i=t.vendor=="youtube"?{event:"command",func:"playVideo"}:{method:"play",value:"true"}),void(i&&t.$iframe.contentWindow.postMessage(JSON.stringify(i),"*"));t.vendor==="youtube"&&(i={event:"listening",id:t.$iframe.getAttribute("id")},t.$iframe.contentWindow.postMessage(JSON.stringify(i),"*"))}t.poller=setTimeout(e,250)};e()}onUnselectSlide(t,e,i){if(i.type==="html5video"){try{i.$el.querySelector("video").pause()}catch{}return}let s=!1;i.vendor=="vimeo"?s={method:"pause",value:"true"}:i.vendor==="youtube"&&(s={event:"command",func:"pauseVideo"}),s&&i.$iframe&&i.$iframe.contentWindow&&i.$iframe.contentWindow.postMessage(JSON.stringify(s),"*"),clearTimeout(i.poller)}onRemoveSlide(t,e,i){i.xhr&&(i.xhr.abort(),i.xhr=null),i.$iframe&&(i.$iframe.onload=i.$iframe.onerror=null,i.$iframe.
2src="//about:blank",i.$iframe=null);const s=i.$content;i.type==="inline"&&s&&(s.classList.remove("fancybox__content"),s.style.display!=="none"&&(s.style.display="none")),i.$closeButton&&(i.$closeButton.remove(),i.$closeButton=null);const o=s&&s.$placeHolder;o&&(o.parentNode.insertBefore(s,o),o.remove(),s.$placeHolder=null)}onMessage(t){try{let e=JSON.parse(t.data);if(t.origin==="https://player.vimeo.com"){if(e.event==="ready")for(let i of document.getElementsByClassName("fancybox__iframe"))i.contentWindow===t.source&&(i.isReady=1)}else t.origin==="https://www.youtube-nocookie.com"&&e.event==="onReady"&&(document.getElementById(e.id).isReady=1)}catch{}}attach(){this.fancybox.on(this.events),window.addEventListener("message",this.onMessage,!1)}detach(){this.fancybox.off(this.events),window.removeEventListener("message",this.onMessage,!1)}}V.defaults=j;class Z{constructor(t){this.fancybox=t;for(const e of["onReady","onClosing","onDone","onPageChange","onCreateSlide","onRemoveSlide","onImageStatusChange"])this[e]=this[e].bind(this);this.events={ready:this.onReady,closing:this.onClosing,done:this.onDone,"Carousel.change":this.onPageChange,"Carousel.createSlide":this.onCreateSlide,"Carousel.removeSlide":this.onRemoveSlide}}onReady(){this.fancybox.Carousel.slides.forEach(t=>{t.$el&&this.setContent(t)})}onDone(t,e){this.handleCursor(e)}onClosing(t){clearTimeout(this.clickTimer),this.clickTimer=null,t.Carousel.slides.forEach(e=>{e.$image&&(e.state="destroy"),e.Panzoom&&e.Panzoom.detachEvents()}),this.fancybox.state==="closing"&&this.canZoom(t.getSlide())&&this.zoomOut()}onCreateSlide(t,e,i){this.fancybox.state==="ready"&&this.setContent(i)}onRemoveSlide(t,e,i){i.$image&&(i.$el.classList.remove(t.option("Image.canZoomInClass")),i.$image.remove(),i.$image=null),i.Panzoom&&(i.Panzoom.destroy(),i.Panzoom=null),i.$el&&i.$el.dataset&&delete i.$el.dataset.imageFit}setContent(t){if(t.isDom||t.html||t.type&&t.type!=="image"||t.$image)return;t.type="image",t.state="loading";const e=document.createElement("div");e.style.visibility="hidden";const i=document.createElement("img");i.addEventListener("load",o=>{o.stopImmediatePropagation(),this.onImageStatusChange(t)}),i.addEventListener("error",()=>{this.onImageStatusChange(t)}),i.src=t.src,i.alt="",i.draggable=!1,i.classList.add("fancybox__image"),t.srcset&&i.setAttribute("srcset",t.srcset),t.sizes&&i.setAttribute("sizes",t.sizes),t.$image=i;const s=this.fancybox.option("Image.wrap");if(s){const o=document.createElement("div");o.classList.add(typeof s=="string"?s:"fancybox__image-wrap"),o.appendChild(i),e.appendChild(o),t.$wrap=o}else e.appendChild(i);t.$el.dataset.imageFit=this.fancybox.option("Image.fit"),this.fancybox.setContent(t,e),i.complete||i.error?this.onImageStatusChange(t):this.fancybox.showLoading(t)}onImageStatusChange(t){const e=t.$image;e&&t.state==="loading"&&(e.complete&&e.naturalWidth&&e.naturalHeight?(this.fancybox.hideLoading(t),this.fancybox.option("Image.fit")==="contain"&&this.initSlidePanzoom(t),t.$el.addEventListener("wheel",i=>this.onWheel(t,i),{passive:!1}),t.$content.addEventListener("click",i=>this.onClick(t,i),{passive:!1}),this.revealContent(t)):this.fancybox.setError(t,"{{IMAGE_ERROR}}"))}initSlidePanzoom(t){t.Panzoom||(t.Panzoom=new P(t.$el,b(!0,this.fancybox.option("Image.Panzoom",{}),{viewport:t.$wrap,content:t.$image,width:t._width,height:t._height,wrapInner:!1,textSelection:!0,touch:this.fancybox.option("Image.touch"),panOnlyZoomed:!0,click:!1,wheel:!1})),t.Panzoom.on("startAnimation",()=>{this.fancybox.trigger("Image.startAnimation",t)}),t.Panzoom.on("endAnimation",()=>{t.state==="zoomIn"&&this.fancybox.done(t),this.handleCursor(t),this.fancybox.trigger("Image.endAnimation",t)}),t.Panzoom.on("afterUpdate",()=>{this.handleCursor(t),this.fancybox.trigger("Image.afterUpdate",t)}))}revealContent(t){this.fancybox.Carousel.prevPage===null&&t.index===this.fancybox.options.startIndex&&this.canZoom(t)?this.zoomIn():this.fancybox.revealContent(t)}getZoomInfo(t){const e=t.$thumb.getBoundingClientRect(),i=e.width,s=e.height,o=t.$content.getBoundingClientRect(),n=o.width,a=o.height,r=o.top-e.top,c=o.left-e.left;let l=this.fancybox.option("Image.zoomOpacity");return l==="auto"&&(l=Math.abs(i/s-n/a)>.1),{top:r,left:c,scale:n&&i?i/n:1,opacity:l}}canZoom(t){const e=this.fancybox,i=e.$container;
2if(window.visualViewport&&window.visualViewport.scale!==1||t.Panzoom&&!t.Panzoom.content.width||!e.option("Image.zoom")||e.option("Image.fit")!=="contain")return!1;const s=t.$thumb;if(!s||t.state==="loading")return!1;i.classList.add("fancybox__no-click");const o=s.getBoundingClientRect();let n;if(this.fancybox.option("Image.ignoreCoveredThumbnail")){const a=document.elementFromPoint(o.left+1,o.top+1)===s,r=document.elementFromPoint(o.right-1,o.bottom-1)===s;n=a&&r}else n=document.elementFromPoint(o.left+.5*o.width,o.top+.5*o.height)===s;return i.classList.remove("fancybox__no-click"),n}zoomIn(){const t=this.fancybox,e=t.getSlide(),i=e.Panzoom,{top:s,left:o,scale:n,opacity:a}=this.getZoomInfo(e);t.trigger("reveal",e),i.panTo({x:-1*o,y:-1*s,scale:n,friction:0,ignoreBounds:!0}),e.$content.style.visibility="",e.state="zoomIn",a===!0&&i.on("afterTransform",r=>{e.state!=="zoomIn"&&e.state!=="zoomOut"||(r.$content.style.opacity=Math.min(1,1-(1-r.content.scale)/(1-n)))}),i.panTo({x:0,y:0,scale:1,friction:this.fancybox.option("Image.zoomFriction")})}zoomOut(){const t=this.fancybox,e=t.getSlide(),i=e.Panzoom;if(!i)return;e.state="zoomOut",t.state="customClosing",e.$caption&&(e.$caption.style.visibility="hidden");let s=this.fancybox.option("Image.zoomFriction");const o=n=>{const{top:a,left:r,scale:c,opacity:l}=this.getZoomInfo(e);n||l||(s*=.82),i.panTo({x:-1*r,y:-1*a,scale:c,friction:s,ignoreBounds:!0}),s*=.98};window.addEventListener("scroll",o),i.once("endAnimation",()=>{window.removeEventListener("scroll",o),t.destroy()}),o()}handleCursor(t){if(t.type!=="image"||!t.$el)return;const e=t.Panzoom,i=this.fancybox.option("Image.click",!1,t),s=this.fancybox.option("Image.touch"),o=t.$el.classList,n=this.fancybox.option("Image.canZoomInClass"),a=this.fancybox.option("Image.canZoomOutClass");o.remove(a),o.remove(n),e&&i==="toggleZoom"?e&&e.content.scale===1&&e.option("maxScale")-e.content.scale>.01?o.add(n):e.content.scale>1&&!s&&o.add(a):i==="close"&&o.add(a)}onWheel(t,e){if(this.fancybox.state==="ready"&&this.fancybox.trigger("Image.wheel",e)!==!1)switch(this.fancybox.option("Image.wheel")){case"zoom":t.state==="done"&&t.Panzoom&&t.Panzoom.zoomWithWheel(e);break;case"close":this.fancybox.close();break;case"slide":this.fancybox[e.deltaY<0?"prev":"next"]()}}onClick(t,e){if(this.fancybox.state!=="ready")return;const i=t.Panzoom;if(i&&(i.dragPosition.midPoint||i.dragOffset.x!==0||i.dragOffset.y!==0||i.dragOffset.scale!==1))return;if(this.fancybox.Carousel.Panzoom.lockAxis)return!1;const s=a=>{switch(a){case"toggleZoom":e.stopPropagation(),t.Panzoom&&t.Panzoom.zoomWithClick(e);break;case"close":this.fancybox.close();break;case"next":e.stopPropagation(),this.fancybox.next()}},o=this.fancybox.option("Image.click"),n=this.fancybox.option("Image.doubleClick");n?this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null,s(n)):this.clickTimer=setTimeout(()=>{this.clickTimer=null,s(o)},300):s(o)}onPageChange(t,e){const i=t.getSlide();e.slides.forEach(s=>{s.Panzoom&&s.state==="done"&&s.index!==i.index&&s.Panzoom.panTo({x:0,y:0,scale:1,friction:.8})})}attach(){this.fancybox.on(this.events)}detach(){this.fancybox.off(this.events)}}Z.defaults={canZoomInClass:"can-zoom_in",canZoomOutClass:"can-zoom_out",zoom:!0,zoomOpacity:"auto",zoomFriction:.82,ignoreCoveredThumbnail:!1,touch:!0,click:"toggleZoom",doubleClick:null,wheel:"zoom",fit:"contain",wrap:!1,Panzoom:{ratio:1}};class w{constructor(t){this.fancybox=t;for(const e of["onChange","onClosing"])this[e]=this[e].bind(this);this.events={initCarousel:this.onChange,"Carousel.change":this.onChange,closing:this.onClosing},this.hasCreatedHistory=!1,this.origHash="",this.timer=null}onChange(t){const e=t.Carousel;this.timer&&clearTimeout(this.timer);const i=e.prevPage===null,s=t.getSlide(),o=new URL(document.URL).hash;let n=!1;if(s.slug)n="#"+s.slug;else{const a=s.$trigger&&s.$trigger.dataset,r=t.option("slug")||a&&a.fancybox;r&&r.length&&r!=="true"&&(n="#"+r+(e.slides.length>1?"-"+(s.index+1):""))}i&&(this.origHash=o!==n?o:""),n&&o!==n&&(this.timer=setTimeout(()=>{try{window.history[i?"pushState":"replaceState"]({},document.title,window.location.pathname+window.location.search+n),i&&(this.hasCreatedHistory=!0)}catch{}},300))}onClosing(){if(this.timer&&clearTimeout(this.timer),this.hasSilentClose!==!0)try{return void window.history.replaceState({},document.title,window.location.pathname+window.location.search+(this.origHash||""))}catch{}}attach(t){t.on(this.events)}detach(t){t.off(this.events)}static startFromUrl(){const t=w.Fancybox;if(!t||t.getInstance()||t.defaults.Hash===!1)return;const{hash:e,slug:i,index:s}=w.getParsedURL();if(!i)return;let o=document.querySelector(`[data-slug="${e}"]`);if(o&&o.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),t.getInstance())return;const n=document.querySelectorAll(`[data-fancybox="${i}"]`);n.length&&(s===null&&n.length===1?o=n[0]:s&&(o=n[s-1]),o&&o.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))}static onHashChange(){const{slug:t,index:e}=w.getParsedURL(),i=w.Fancybox,s=i&&i.getInstance();if(s&&s.plugins.Hash){if(t){const o=s.Carousel;if(t===s.option("slug"))return o.slideTo(e-1);for(let r of o.slides)if(r.slug&&r.slug===t)return o.slideTo(r.index);const n=s.getSlide(),a=n.$trigger&&n.$trigger.dataset;if(a&&a.fancybox===t)return o.slideTo(e-1)}s.plugins.Hash.hasSilentClose=!0,s.close()}w.startFromUrl()}static create(t){function e(){window.addEventListener("hashchange",w.onHashChange,!1),w.startFromUrl()}w.Fancybox=t,k&&window.requestAnimationFrame(()=>{/complete|interactive|loaded/.test(document.readyState)?e():document.addEventListener("DOMContentLoaded",e)})}static destroy(){window.removeEventListener("hashchange",w.onHashChange,!1)}static getParsedURL(){const t=window.location.hash.substr(1),e=t.split("-"),i=e.length>1&&/^\+?\d+$/.test(e[e.length-1])&&parseInt(e.pop(-1),10)||null;return{hash:t,slug:e.join("-"),index:i}}}const C={pageXOffset:0,pageYOffset:0,element:()=>document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,activate(h){C.pageXOffset=window.pageXOffset,C.pageYOffset=window.pageYOffset,h.requestFullscreen?h.requestFullscreen():h.mozRequestFullScreen?h.mozRequestFullScreen():h.webkitRequestFullscreen?h.webkitRequestFullscreen():h.msRequestFullscreen&&h.msRequestFullscreen()},deactivate(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}};class at{constructor(t){this.fancybox=t,this.active=!1,this.handleVisibilityChange=this.handleVisibilityChange.bind(this)}isActive(){return this.active}setTimer(){if(!this.active||this.timer)return;const t=this.fancybox.option("slideshow.delay",3e3);this.timer=setTimeout(()=>{this.timer=null,this.fancybox.option("infinite")||this.fancybox.getSlide().index!==this.fancybox.Carousel.slides.length-1?this.fancybox.next():this.fancybox.jumpTo(0,{friction:0})},t);let e=this.$progress;e||(e=document.createElement("div"),e.classList.add("fancybox__progress"),this.fancybox.$carousel.parentNode.insertBefore(e,this.fancybox.$carousel),this.$progress=e,e.offsetHeight),e.style.transitionDuration=`${t}ms`,e.style.transform="scaleX(1)"}clearTimer(){clearTimeout(this.timer),this.timer=null,this.$progress&&(this.$progress.style.transitionDuration="",this.$progress.style.transform="",this.$progress.offsetHeight)}activate(){this.active||(this.active=!0,this.fancybox.$container.classList.add("has-slideshow"),this.fancybox.getSlide().state==="done"&&this.setTimer(),document.addEventListener("visibilitychange",this.handleVisibilityChange,!1))}handleVisibilityChange(){this.deactivate()}deactivate(){this.active=!1,this.clearTimer(),this.fancybox.$container.classList.remove("has-slideshow"),document.removeEventListener("visibilitychange",this.handleVisibilityChange,!1)}toggle(){this.active?this.deactivate():this.fancybox.Carousel.slides.length>1&&this.activate()}}const rt={display:["counter","zoom","slideshow","fullscreen","thumbs","close"],autoEnable:!0,items:{counter:{position:"left",type:"div",class:"fancybox__counter",html:'<span data-fancybox-index=""></span>&nbsp;/&nbsp;<span data-fancybox-count=""></span>',attr:{tabindex:-1}},prev:{type:"button",class:"fancybox__button--prev",label:"PREV",html:'<svg viewBox="0 0 24 24">
2<path d="M15 4l-8 8 8 8"/></svg>',attr:{"data-fancybox-prev":""}},next:{type:"button",class:"fancybox__button--next",label:"NEXT",html:'<svg viewBox="0 0 24 24"><path d="M8 4l8 8-8 8"/></svg>',attr:{"data-fancybox-next":""}},fullscreen:{type:"button",class:"fancybox__button--fullscreen",label:"TOGGLE_FULLSCREEN",html:`<svg viewBox="0 0 24 24">
3                <g><path d="M3 8 V3h5"></path><path d="M21 8V3h-5"></path><path d="M8 21H3v-5"></path><path d="M16 21h5v-5"></path></g>
4                <g><path d="M7 2v5H2M17 2v5h5M2 17h5v5M22 17h-5v5"/></g>
5            </svg>`,click:function(h){h.preventDefault(),C.element()?C.deactivate():C.activate(this.fancybox.$container)}},slideshow:{type:"button",class:"fancybox__button--slideshow",label:"TOGGLE_SLIDESHOW",html:`<svg viewBox="0 0 24 24">
6                <g><path d="M6 4v16"/><path d="M20 12L6 20"/><path d="M20 12L6 4"/></g>
7                <g><path d="M7 4v15M17 4v15"/></g>
8            </svg>`,click:function(h){h.preventDefault(),this.Slideshow.toggle()}},zoom:{type:"button",class:"fancybox__button--zoom",label:"TOGGLE_ZOOM",html:'<svg viewBox="0 0 24 24"><circle cx="10" cy="10" r="7"></circle><path d="M16 16 L21 21"></svg>',click:function(h){h.preventDefault();const t=this.fancybox.getSlide().Panzoom;t&&t.toggleZoom()}},download:{type:"link",label:"DOWNLOAD",class:"fancybox__button--download",html:'<svg viewBox="0 0 24 24"><path d="M12 15V3m0 12l-4-4m4 4l4-4M2 17l.62 2.48A2 2 0 004.56 21h14.88a2 2 0 001.94-1.51L22 17"/></svg>',click:function(h){h.stopPropagation()}},thumbs:{type:"button",label:"TOGGLE_THUMBS",class:"fancybox__button--thumbs",html:'<svg viewBox="0 0 24 24"><circle cx="4" cy="4" r="1" /><circle cx="12" cy="4" r="1" transform="rotate(90 12 4)"/><circle cx="20" cy="4" r="1" transform="rotate(90 20 4)"/><circle cx="4" cy="12" r="1" transform="rotate(90 4 12)"/><circle cx="12" cy="12" r="1" transform="rotate(90 12 12)"/><circle cx="20" cy="12" r="1" transform="rotate(90 20 12)"/><circle cx="4" cy="20" r="1" transform="rotate(90 4 20)"/><circle cx="12" cy="20" r="1" transform="rotate(90 12 20)"/><circle cx="20" cy="20" r="1" transform="rotate(90 20 20)"/></svg>',click:function(h){h.stopPropagation();const t=this.fancybox.plugins.Thumbs;t&&t.toggle()}},close:{type:"button",label:"CLOSE",class:"fancybox__button--close",html:'<svg viewBox="0 0 24 24"><path d="M20 20L4 4m16 0L4 20"></path></svg>',attr:{"data-fancybox-close":"",tabindex:0}}}};class G{constructor(t){this.fancybox=t,this.$container=null,this.state="init";for(const e of["onInit","onPrepare","onDone","onKeydown","onClosing","onChange","onSettle","onRefresh"])this[e]=this[e].bind(this);this.events={init:this.onInit,prepare:this.onPrepare,done:this.onDone,keydown:this.onKeydown,closing:this.onClosing,"Carousel.change":this.onChange,"Carousel.settle":this.onSettle,"Carousel.Panzoom.touchStart":()=>this.onRefresh(),"Image.startAnimation":(e,i)=>this.onRefresh(i),"Image.afterUpdate":(e,i)=>this.onRefresh(i)}}onInit(){if(this.fancybox.option("Toolbar.autoEnable")){let t=!1;for(const e of this.fancybox.items)if(e.type==="image"){t=!0;break}if(!t)return void(this.state="disabled")}for(const t of this.fancybox.option("Toolbar.display"))if((E(t)?t.id:t)==="close"){this.fancybox.options.closeButton=!1;break}}onPrepare(){const t=this.fancybox;if(this.state==="init"&&(this.build(),this.update(),this.Slideshow=new at(t),!t.Carousel.prevPage&&(t.option("slideshow.autoStart")&&this.Slideshow.activate(),t.option("fullscreen.autoStart")&&!C.element())))try{C.activate(t.$container)}catch{}}onFsChange(){window.scrollTo(C.pageXOffset,C.pageYOffset)}onSettle(){const t=this.fancybox,e=this.Slideshow;e&&e.isActive()&&(t.getSlide().index!==t.Carousel.slides.length-1||t.option("infinite")?t.getSlide().state==="done"&&e.setTimer():e.deactivate())}onChange(){this.update(),this.Slideshow&&this.Slideshow.isActive()&&this.Slideshow.clearTimer()}onDone(t,e){const i=this.Slideshow;e.index===t.getSlide().index&&(this.update(),i&&i.isActive()&&(t.option("infinite")||e.index!==t.Carousel.slides.length-1?i.setTimer():i.deactivate()))}onRefresh(t){t&&t.index!==this.fancybox.getSlide().index||(this.update(),!this.Slideshow||!this.Slideshow.isActive()||t&&t.state!=="done"||this.Slideshow.deactivate())}onKeydown(t,e,i){e===" "&&this.Slideshow&&(this.Slideshow.toggle(),i.preventDefault())}onClosing(){this.Slideshow&&this.Slideshow.deactivate(),document.removeEventListener("fullscreenchange",this.onFsChange)}createElement(t){let e;t.type==="div"?e=document.createElement("div"):(e=document.createElement(t.type==="link"?"a":"button"),e.classList.add("carousel__button")),e.innerHTML=t.html,e.setAttribute("tabindex",t.tabindex||0),t.class&&e.classList.add(...t.class.split(" "));for(const s in t.attr)e.setAttribute(s,t.attr[s]);t.label&&e.setAttribute("title",this.fancybox.localize(`{{${t.label}}}`)),t.click&&e.addEventListener("click",t.click.bind(this)),t.id==="prev"&&e.setAttribute("data-fancybox-prev",""),t.id==="next"&&e.setAttribute("data-fancybox-next","");const i=e.querySelector("svg");return i&&(i.setAttribute("role","img"),i.setAttribute("tabindex","-1"),i.setAttribute("xmlns","http://www.w3.org/2000/svg")),e}build(){this.cleanup();const t=this.fancybox.option("Toolbar.items"),e=[{position:"left",items:[]},{position:"center",items:[]},{position:"right",items:[]}],i=this.fancybox.plugins.Thumbs;for(const o of this.fancybox.option("Toolbar.display")){let n,a;if(E(o)?(n=o.id,a=b({},t[n],o)):(n=o,a=t[n]),["counter","next","prev","slideshow"].includes(n)&&this.fancybox.items.length<2)continue;if(n==="fullscreen"){if(!document.fullscreenEnabled||window.fullScreen)continue;document.addEventListener("fullscreenchange",this.onFsChange)}if(n==="thumbs"&&(!i||i.state==="disabled")||!a)continue;let r=a.position||"right",c=e.find(l=>l.position===r);c&&c.items.push(a)}const s=document.createElement("div");s.classList.add("fancybox__toolbar");for(const o of e)if(o.items.length){const n=document.createElement("div");n.classList.add("fancybox__toolbar__items"),n.classList.add(`fancybox__toolbar__items--${o.position}`);for(const a of o.items)n.appendChild(this.createElement(a));s.appendChild(n)}this.fancybox.$carousel.parentNode.insertBefore(s,this.fancybox.$carousel),this.$container=s}update(){const t=this.fancybox.getSlide(),e=t.index,i=this.fancybox.items.length,s=t.downloadSrc||(t.type!=="image"||t.error?null:t.src);for(const a of this.fancybox.$container.querySelectorAll("a.fancybox__button--download"))s?(a.removeAttribute("disabled"),a.removeAttribute("tabindex"),a.setAttribute("href",s),a.setAttribute("download",s),a.setAttribute("target","_blank")):(a.setAttribute("disabled",""),a.setAttribute("tabindex",-1),a.removeAttribute("href"),a.removeAttribute("download"));const o=t.Panzoom,n=o&&o.option("maxScale")>o.option("baseScale");for(const a of this.fancybox.$container.querySelectorAll(".fancybox__button--zoom"))n?a.removeAttribute("disabled"):a.setAttribute("disabled","");for(const a of this.fancybox.$container.querySelectorAll("[data-fancybox-index]"))a.innerHTML=t.index+1;for(const a of this.fancybox.$container.querySelectorAll("[data-fancybox-count]"))a.innerHTML=i;if(!this.fancybox.option("infinite")){for(const a of this.fancybox.$container.querySelectorAll("[data-fancybox-prev]"))e===0?a.setAttribute("disabled",""):a.removeAttribute("disabled");for(const a of this.fancybox.$container.querySelectorAll("[data-fancybox-next]"))e===i-1?a.setAttribute("disabled",""):a.removeAttribute("disabled")}}cleanup(){this.Slideshow&&this.Slideshow.isActive()&&this.Slideshow.clearTimer(),this.$container&&this.$container.remove(),this.$container=null}attach(){this.fancybox.on(this.events)}detach(){this.fancybox.off(this.events),this.cleanup()}}G.defaults=rt;const ht={ScrollLock:class{constructor(h){this.fancybox=h,this.viewport=null,this.pendingUpdate=null;for(const t of["onReady","onResize","onTouchstart","onTouchmove"])this[t]=this[t].bind(this)}
8onReady(){const h=window.visualViewport;h&&(this.viewport=h,this.startY=0,h.addEventListener("resize",this.onResize),this.updateViewport()),window.addEventListener("touchstart",this.onTouchstart,{passive:!1}),window.addEventListener("touchmove",this.onTouchmove,{passive:!1}),window.addEventListener("wheel",this.onWheel,{passive:!1})}onResize(){this.updateViewport()}updateViewport(){const h=this.fancybox,t=this.viewport,e=t.scale||1,i=h.$container;if(!i)return;let s="",o="",n="";e-1>.1&&(s=t.width*e+"px",o=t.height*e+"px",n=`translate3d(${t.offsetLeft}px, ${t.offsetTop}px, 0) scale(${1/e})`),i.style.width=s,i.style.height=o,i.style.transform=n}onTouchstart(h){this.startY=h.touches?h.touches[0].screenY:h.screenY}onTouchmove(h){const t=this.startY,e=window.innerWidth/window.document.documentElement.clientWidth;if(!h.cancelable||h.touches.length>1||e!==1)return;const i=_(h.composedPath()[0]);if(!i)return void h.preventDefault();const s=window.getComputedStyle(i),o=parseInt(s.getPropertyValue("height"),10),n=h.touches?h.touches[0].screenY:h.screenY,a=t<=n&&i.scrollTop===0,r=t>=n&&i.scrollHeight-i.scrollTop===o;(a||r)&&h.preventDefault()}onWheel(h){_(h.composedPath()[0])||h.preventDefault()}cleanup(){this.pendingUpdate&&(cancelAnimationFrame(this.pendingUpdate),this.pendingUpdate=null);const h=this.viewport;h&&(h.removeEventListener("resize",this.onResize),this.viewport=null),window.removeEventListener("touchstart",this.onTouchstart,!1),window.removeEventListener("touchmove",this.onTouchmove,!1),window.removeEventListener("wheel",this.onWheel,{passive:!1})}attach(){this.fancybox.on("initLayout",this.onReady)}detach(){this.fancybox.off("initLayout",this.onReady),this.cleanup()}},Thumbs:Y,Html:V,Toolbar:G,Image:Z,Hash:w},K={startIndex:0,preload:1,infinite:!0,showClass:"fancybox-zoomInUp",hideClass:"fancybox-fadeOut",animated:!0,hideScrollbar:!0,parentEl:null,mainClass:null,autoFocus:!0,trapFocus:!0,placeFocusBack:!0,click:"close",closeButton:"inside",dragToClose:!0,keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"next",ArrowDown:"prev",ArrowRight:"next",ArrowLeft:"prev"},template:{closeButton:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"/></svg>',spinner:'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="25 25 50 50" tabindex="-1"><circle cx="50" cy="50" r="20"/></svg>',main:null},l10n:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}},A=new Map;let lt=0;class p extends I{constructor(t,e={}){t=t.map(i=>(i.width&&(i._width=i.width),i.height&&(i._height=i.height),i)),super(b(!0,{},K,e)),this.bindHandlers(),this.state="init",this.setItems(t),this.attachPlugins(p.Plugins),this.trigger("init"),this.option("hideScrollbar")===!0&&this.hideScrollbar(),this.initLayout(),this.initCarousel(),this.attachEvents(),A.set(this.id,this),this.trigger("prepare"),this.state="ready",this.trigger("ready"),this.$container.setAttribute("aria-hidden","false"),this.option("trapFocus")&&this.focus()}option(t,...e){const i=this.getSlide();let s=i?i[t]:void 0;return s!==void 0?(typeof s=="function"&&(s=s.call(this,this,...e)),s):super.option(t,...e)}bindHandlers(){for(const t of["onMousedown","onKeydown","onClick","onFocus","onCreateSlide","onSettle","onTouchMove","onTouchEnd","onTransform"])this[t]=this[t].bind(this)}attachEvents(){document.addEventListener("mousedown",this.onMousedown),document.addEventListener("keydown",this.onKeydown,!0),this.option("trapFocus")&&document.addEventListener("focus",this.onFocus,!0),this.$container.addEventListener("click",this.onClick)}detachEvents(){document.removeEventListener("mousedown",this.onMousedown),document.removeEventListener("keydown",this.onKeydown,!0),document.removeEventListener("focus",this.onFocus,!0),this.$container.removeEventListener("click",this.onClick)}initLayout(){this.$root=this.option("parentEl")||document.body;let t=this.option("template.main");t&&(this.$root.insertAdjacentHTML("beforeend",this.localize(t)),this.$container=this.$root.querySelector(".fancybox__container")),this.$container||(this.$container=document.createElement("div"),this.$root.appendChild(this.$container)),this.$container.onscroll=()=>(this.$container.scrollLeft=0,!1),Object.entries({class:"fancybox__container",role:"dialog",tabIndex:"-1","aria-modal":"true","aria-hidden":"true","aria-label":this.localize("{{MODAL}}")}
8).forEach(i=>this.$container.setAttribute(...i)),this.option("animated")&&this.$container.classList.add("is-animated"),this.$backdrop=this.$container.querySelector(".fancybox__backdrop"),this.$backdrop||(this.$backdrop=document.createElement("div"),this.$backdrop.classList.add("fancybox__backdrop"),this.$container.appendChild(this.$backdrop)),this.$carousel=this.$container.querySelector(".fancybox__carousel"),this.$carousel||(this.$carousel=document.createElement("div"),this.$carousel.classList.add("fancybox__carousel"),this.$container.appendChild(this.$carousel)),this.$container.Fancybox=this,this.id=this.$container.getAttribute("id"),this.id||(this.id=this.options.id||++lt,this.$container.setAttribute("id","fancybox-"+this.id));const e=this.option("mainClass");return e&&this.$container.classList.add(...e.split(" ")),document.documentElement.classList.add("with-fancybox"),this.trigger("initLayout"),this}setItems(t){const e=[];for(const i of t){const s=i.$trigger;if(s){const a=s.dataset||{};i.src=a.src||s.getAttribute("href")||i.src,i.type=a.type||i.type,!i.src&&s instanceof HTMLImageElement&&(i.src=s.currentSrc||i.$trigger.src)}let o=i.$thumb;if(!o){let a=i.$trigger&&i.$trigger.origTarget;a&&(o=a instanceof HTMLImageElement?a:a.querySelector("img:not([aria-hidden])")),!o&&i.$trigger&&(o=i.$trigger instanceof HTMLImageElement?i.$trigger:i.$trigger.querySelector("img:not([aria-hidden])"))}i.$thumb=o||null;let n=i.thumb;!n&&o&&(n=o.currentSrc||o.src,!n&&o.dataset&&(n=o.dataset.lazySrc||o.dataset.src)),n||i.type!=="image"||(n=i.src),i.thumb=n||null,i.caption=i.caption||"",e.push(i)}this.items=e}initCarousel(){return this.Carousel=new T(this.$carousel,b(!0,{},{prefix:"",classNames:{viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"},textSelection:!0,preload:this.option("preload"),friction:.88,slides:this.items,initialPage:this.options.startIndex,slidesPerPage:1,infiniteX:this.option("infinite"),infiniteY:!0,l10n:this.option("l10n"),Dots:!1,Navigation:{classNames:{main:"fancybox__nav",button:"carousel__button",next:"is-next",prev:"is-prev"}},Panzoom:{textSelection:!0,panOnlyZoomed:()=>this.Carousel&&this.Carousel.pages&&this.Carousel.pages.length<2&&!this.option("dragToClose"),lockAxis:()=>{if(this.Carousel){let t="x";return this.option("dragToClose")&&(t+="y"),t}}},on:{"*":(t,...e)=>this.trigger(`Carousel.${t}`,...e),init:t=>this.Carousel=t,createSlide:this.onCreateSlide,settle:this.onSettle}},this.option("Carousel"))),this.option("dragToClose")&&this.Carousel.Panzoom.on({touchMove:this.onTouchMove,afterTransform:this.onTransform,touchEnd:this.onTouchEnd}),this.trigger("initCarousel"),this}onCreateSlide(t,e){let i=e.caption||"";if(typeof this.options.caption=="function"&&(i=this.options.caption.call(this,this,this.Carousel,e)),typeof i=="string"&&i.length){const s=document.createElement("div"),o=`fancybox__caption_${this.id}_${e.index}`;s.className="fancybox__caption",s.innerHTML=i,s.setAttribute("id",o),e.$caption=e.$el.appendChild(s),e.$el.classList.add("has-caption"),e.$el.setAttribute("aria-labelledby",o)}}onSettle(){this.option("autoFocus")&&this.focus()}onFocus(t){this.isTopmost()&&this.focus(t)}onClick(t){if(t.defaultPrevented)return;let e=t.composedPath()[0];if(e.matches("[data-fancybox-close]"))return t.preventDefault(),void p.close(!1,t);if(e.matches("[data-fancybox-next]"))return t.preventDefault(),void p.next();if(e.matches("[data-fancybox-prev]"))return t.preventDefault(),void p.prev();const i=document.activeElement;if(i){if(i.closest("[contenteditable]"))return;e.matches(W)||i.blur()}if(!e.closest(".fancybox__content")&&!getSelection().toString().length&&this.trigger("click",t)!==!1)switch(this.option("click")){case"close":this.close();break;case"next":this.next()}}onTouchMove(){const t=this.getSlide().Panzoom;return!t||t.content.scale===1}onTouchEnd(t){const e=t.dragOffset.y;Math.abs(e)>=150||Math.abs(e)>=35&&t.dragOffset.time<350?(this.option("hideClass")&&(this.getSlide().hideClass="fancybox-throwOut"+(t.content.y<0?"Up":"Down")),this.close()):t.lockAxis==="y"&&t.panTo({y:0})}onTransform(t){if(this.$backdrop){const e=Math.abs(t.content.y),i=e<1?""
8:Math.max(.33,Math.min(1,1-e/t.content.fitHeight*1.5));this.$container.style.setProperty("--fancybox-ts",i?"0s":""),this.$container.style.setProperty("--fancybox-opacity",i)}}onMousedown(){this.state==="ready"&&document.body.classList.add("is-using-mouse")}onKeydown(t){if(!this.isTopmost())return;document.body.classList.remove("is-using-mouse");const e=t.key,i=this.option("keyboard");if(!i||t.ctrlKey||t.altKey||t.shiftKey)return;const s=t.composedPath()[0],o=document.activeElement&&document.activeElement.classList,n=o&&o.contains("carousel__button");if(e!=="Escape"&&!n&&(t.target.isContentEditable||["BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(s.nodeName)!==-1)||this.trigger("keydown",e,t)===!1)return;const a=i[e];typeof this[a]=="function"&&this[a]()}getSlide(){const t=this.Carousel;if(!t)return null;const e=t.page===null?t.option("initialPage"):t.page,i=t.pages||[];return i.length&&i[e]?i[e].slides[0]:null}focus(t){if(p.ignoreFocusChange||["init","closing","customClosing","destroy"].indexOf(this.state)>-1)return;const e=this.$container,i=this.getSlide(),s=i.state==="done"?i.$el:null;if(s&&s.contains(document.activeElement))return;t&&t.preventDefault(),p.ignoreFocusChange=!0;const o=Array.from(e.querySelectorAll(W));let n,a=[];for(let r of o){const c=r.offsetParent,l=s&&s.contains(r),u=!this.Carousel.$viewport.contains(r);c&&(l||u)?(a.push(r),r.dataset.origTabindex!==void 0&&(r.tabIndex=r.dataset.origTabindex,r.removeAttribute("data-orig-tabindex")),(r.hasAttribute("autoFocus")||!n&&l&&!r.classList.contains("carousel__button"))&&(n=r)):(r.dataset.origTabindex=r.dataset.origTabindex===void 0?r.getAttribute("tabindex"):r.dataset.origTabindex,r.tabIndex=-1)}t?a.indexOf(t.target)>-1?this.lastFocus=t.target:this.lastFocus===e?L(a[a.length-1]):L(e):this.option("autoFocus")&&n?L(n):a.indexOf(document.activeElement)<0&&L(e),this.lastFocus=document.activeElement,p.ignoreFocusChange=!1}hideScrollbar(){if(!k)return;const t=window.innerWidth-document.documentElement.getBoundingClientRect().width,e="fancybox-style-noscroll";let i=document.getElementById(e);i||t>0&&(i=document.createElement("style"),i.id=e,i.type="text/css",i.innerHTML=`.compensate-for-scrollbar {padding-right: ${t}px;}`,document.getElementsByTagName("head")[0].appendChild(i),document.body.classList.add("compensate-for-scrollbar"))}revealScrollbar(){document.body.classList.remove("compensate-for-scrollbar");const t=document.getElementById("fancybox-style-noscroll");t&&t.remove()}clearContent(t){this.Carousel.trigger("removeSlide",t),t.$content&&(t.$content.remove(),t.$content=null),t.$closeButton&&(t.$closeButton.remove(),t.$closeButton=null),t._className&&t.$el.classList.remove(t._className)}setContent(t,e,i={}){let s;const o=t.$el;if(e instanceof HTMLElement)["img","iframe","video","audio"].indexOf(e.nodeName.toLowerCase())>-1?(s=document.createElement("div"),s.appendChild(e)):s=e;else{const n=document.createRange().createContextualFragment(e);s=document.createElement("div"),s.appendChild(n)}if(t.filter&&!t.error&&(s=s.querySelector(t.filter)),s instanceof Element)return t._className=`has-${i.suffix||t.type||"unknown"}`,o.classList.add(t._className),s.classList.add("fancybox__content"),s.style.display!=="none"&&getComputedStyle(s).getPropertyValue("display")!=="none"||(s.style.display=t.display||this.option("defaultDisplay")||"flex"),t.id&&s.setAttribute("id",t.id),t.$content=s,o.prepend(s),this.manageCloseButton(t),t.state!=="loading"&&this.revealContent(t),s;this.setError(t,"{{ELEMENT_NOT_FOUND}}")}manageCloseButton(t){const e=t.closeButton===void 0?this.option("closeButton"):t.closeButton;if(!e||e==="top"&&this.$closeButton)return;const i=document.createElement("button");i.classList.add("carousel__button","is-close"),i.setAttribute("title",this.options.l10n.CLOSE),i.innerHTML=this.option("template.closeButton"),i.addEventListener("click",s=>this.close(s)),e==="inside"?(t.$closeButton&&t.$closeButton.remove(),t.$closeButton=t.$content.appendChild(i)):this.$closeButton=this.$container.insertBefore(i,this.$container.firstChild)}revealContent(t){this.trigger("reveal",t),t.$content.style.visibility="";let e=!1;t.error||t.state==="loading"||this.Carousel.prevPage!==null||t.index!==this.options.startIndex||(e=t.showClass===void 0?this.option("showClass"):t.showClass),e?(t.state="animating",this.animateCSS(t.$content,e,()=>{this.done(t)})):this.done(t)}
8animateCSS(t,e,i){if(t&&t.dispatchEvent(new CustomEvent("animationend",{bubbles:!0,cancelable:!0})),!t||!e)return void(typeof i=="function"&&i());const s=function(o){o.currentTarget===this&&(t.removeEventListener("animationend",s),i&&i(),t.classList.remove(e))};t.addEventListener("animationend",s),t.classList.add(e)}done(t){t.state="done",this.trigger("done",t);const e=this.getSlide();e&&t.index===e.index&&this.option("autoFocus")&&this.focus()}setError(t,e){t.error=e,this.hideLoading(t),this.clearContent(t);const i=document.createElement("div");i.classList.add("fancybox-error"),i.innerHTML=this.localize(e||"<p>{{ERROR}}</p>"),this.setContent(t,i,{suffix:"error"})}showLoading(t){t.state="loading",t.$el.classList.add("is-loading");let e=t.$el.querySelector(".fancybox__spinner");e||(e=document.createElement("div"),e.classList.add("fancybox__spinner"),e.innerHTML=this.option("template.spinner"),e.addEventListener("click",()=>{this.Carousel.Panzoom.velocity||this.close()}),t.$el.prepend(e))}hideLoading(t){const e=t.$el&&t.$el.querySelector(".fancybox__spinner");e&&(e.remove(),t.$el.classList.remove("is-loading")),t.state==="loading"&&(this.trigger("load",t),t.state="ready")}next(){const t=this.Carousel;t&&t.pages.length>1&&t.slideNext()}prev(){const t=this.Carousel;t&&t.pages.length>1&&t.slidePrev()}jumpTo(...t){this.Carousel&&this.Carousel.slideTo(...t)}isClosing(){return["closing","customClosing","destroy"].includes(this.state)}isTopmost(){return p.getInstance().id==this.id}close(t){if(t&&t.preventDefault(),this.isClosing()||this.trigger("shouldClose",t)===!1||(this.state="closing",this.Carousel.Panzoom.destroy(),this.detachEvents(),this.trigger("closing",t),this.state==="destroy"))return;this.$container.setAttribute("aria-hidden","true"),this.$container.classList.add("is-closing");const e=this.getSlide();if(this.Carousel.slides.forEach(i=>{i.$content&&i.index!==e.index&&this.Carousel.trigger("removeSlide",i)}),this.state==="closing"){const i=e.hideClass===void 0?this.option("hideClass"):e.hideClass;this.animateCSS(e.$content,i,()=>{this.destroy()},!0)}}destroy(){if(this.state==="destroy")return;this.state="destroy",this.trigger("destroy");const t=this.option("placeFocusBack")?this.option("triggerTarget",this.getSlide().$trigger):null;this.Carousel.destroy(),this.detachPlugins(),this.Carousel=null,this.options={},this.events={},this.$container.remove(),this.$container=this.$backdrop=this.$carousel=null,t&&L(t),A.delete(this.id);const e=p.getInstance();e?e.focus():(document.documentElement.classList.remove("with-fancybox"),document.body.classList.remove("is-using-mouse"),this.revealScrollbar())}static show(t,e={}){return new p(t,e)}static fromEvent(t,e={}){if(t.defaultPrevented||t.button&&t.button!==0||t.ctrlKey||t.metaKey||t.shiftKey)return;const i=t.composedPath()[0];let s,o,n,a=i;if((a.matches("[data-fancybox-trigger]")||(a=a.closest("[data-fancybox-trigger]")))&&(e.triggerTarget=a,s=a&&a.dataset&&a.dataset.fancyboxTrigger),s){const c=document.querySelectorAll(`[data-fancybox="${s}"]`),l=parseInt(a.dataset.fancyboxIndex,10)||0;a=c.length?c[l]:a}Array.from(p.openers.keys()).reverse().some(c=>{n=a||i;let l=!1;try{n instanceof Element&&(typeof c=="string"||c instanceof String)&&(l=n.matches(c)||(n=n.closest(c)))}catch{}return!!l&&(t.preventDefault(),o=c,!0)});let r=!1;if(o){e.event=t,e.target=n,n.origTarget=i,r=p.fromOpener(o,e);const c=p.getInstance();c&&c.state==="ready"&&t.detail&&document.body.classList.add("is-using-mouse")}return r}static fromOpener(t,e={}
8){let i=[],s=e.startIndex||0,o=e.target||null;const n=(e=b({},e,p.openers.get(t))).groupAll!==void 0&&e.groupAll,a=e.groupAttr===void 0?"data-fancybox":e.groupAttr,r=a&&o?o.getAttribute(`${a}`):"";if(!o||r||n){const l=e.root||(o?o.getRootNode():document.body);i=[].slice.call(l.querySelectorAll(t))}if(o&&!n&&(i=r?i.filter(l=>l.getAttribute(`${a}`)===r):[o]),!i.length)return!1;const c=p.getInstance();return!(c&&i.indexOf(c.options.$trigger)>-1)&&(s=o?i.indexOf(o):s,i=i.map(function(l){const u=["false","0","no","null","undefined"],f=["true","1","yes"],d=Object.assign({},l.dataset),g={};for(let[m,y]of Object.entries(d))if(m!=="fancybox")if(m==="width"||m==="height")g[`_${m}`]=y;else if(typeof y=="string"||y instanceof String)if(u.indexOf(y)>-1)g[m]=!1;else if(f.indexOf(g[m])>-1)g[m]=!0;else try{g[m]=JSON.parse(y)}catch{g[m]=y}else g[m]=y;return l instanceof Element&&(g.$trigger=l),g}),new p(i,b({},e,{startIndex:s,$trigger:o})))}static bind(t,e={}){function i(){document.body.addEventListener("click",p.fromEvent,!1)}k&&(p.openers.size||(/complete|interactive|loaded/.test(document.readyState)?i():document.addEventListener("DOMContentLoaded",i)),p.openers.set(t,e))}static unbind(t){p.openers.delete(t),p.openers.size||p.destroy()}static destroy(){let t;for(;t=p.getInstance();)t.destroy();p.openers=new Map,document.body.removeEventListener("click",p.fromEvent,!1)}static getInstance(t){return t?A.get(t):Array.from(A.values()).reverse().find(e=>!e.isClosing()&&e)||null}static close(t=!0,e){if(t)for(const i of A.values())i.close(e);else{const i=p.getInstance();i&&i.close(e)}}static next(){const t=p.getInstance();t&&t.next()}static prev(){const t=p.getInstance();t&&t.prev()}}p.version="4.0.31",p.defaults=K,p.openers=new Map,p.Plugins=ht,p.bind("[data-fancybox]");for(const[h,t]of Object.entries(p.Plugins||{}))typeof t.create=="function"&&t.create(p);export{T as Carousel,p as Fancybox,P as Panzoom};

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.