!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,function(F){"use strict";function j(t,e){return!(!t||t===document.body||e&&t===e)&&(s(t)?t:j(t.parentElement,e))}function d(t){var e=(new DOMParser).parseFromString(t,"text/html").body;if(1(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*e)/e),s=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf("hidden"),s=-1!==i.indexOf("visible");return e&&!n&&!s},H=t=>(""+(t||"")).split(" ").filter(t=>!!t),f=(e,t,i)=>{H(t).forEach(t=>{e&&e.classList.toggle(t,i||!1)})};class o{constructor(t){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const a={passive:!1};class B{constructor(t,{start:e=()=>!0,move:i=()=>{},end:n=()=>{}}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[t]=this[t].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,a),this.element.addEventListener("touchstart",this.onTouchStart,a),this.element.addEventListener("touchmove",this.onMove,a),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(t){if(t.buttons&&0===t.button){const e=new o(t);this.currentPointers.some(t=>t.id===e.id)||this.triggerPointerStart(e,t)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new o(e),t);window.addEventListener("blur",this.onWindowBlur)}onMove(e){const t=this.currentPointers.slice(),i="changedTouches"in e?Array.from(e.changedTouches||[]).map(t=>new o(t)):[new o(e)],n=[];for(const e of i){const t=this.currentPointers.findIndex(t=>t.id===e.id);t<0||(n.push(e),this.currentPointers[t]=e)}n.length&&this.moveCallback(e,this.currentPointers.slice(),t)}onPointerEnd(t){0t.id===e.id);i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){var t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,a),this.element.removeEventListener("touchstart",this.onTouchStart,a),this.element.removeEventListener("touchmove",this.onMove,a),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function N(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function _(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}function W(t,e){return t.split(".").reduce((t,e)=>"object"==typeof t?t[e]:void 0,e)}const X=t=>"object"==typeof t&&null!==t&&t.constructor===Object&&"[object Object]"===Object.prototype.toString.call(t),u=(n,...e)=>{const i=e.length;for(let t=0;t{var i=Array.isArray(e)?[]:{};n[t]||Object.assign(n,{[t]:i}),X(e)?Object.assign(n[t],u(i,e)):Array.isArray(e)?Object.assign(n,{[t]:[...e]}):Object.assign(n,{[t]:e})})}return n};class t{constructor(t={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?u({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=W(t,this.options);return i=i&&"function"==typeof i?i.call(this,this,...e):i}optionFor(t,e,i,...n){let s=W(e,t);var o;(s="false"===(s="true"===(s="string"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))?s:parseFloat(s))?!0:s)?!1:s)&&"function"==typeof s&&(s=s.call(this,this,t,...n));let a=W(e,this.options);return a&&"function"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){var e=this.options.classes;return e&&e[t]||""}localize(e,i=[]){e=String(e).replace(/\{\{(\w+).?(\w+)?\}\}/g,(t,e,i)=>{let n="";return i?n=this.option(e[0]+e.toLowerCase().substring(1)+".l10n."+i):e&&(n=this.option("l10n."+e)),n=n||t});for(let t=0;te)}on(t,i){let e=[];"string"==typeof t?e=t.split(" "):Array.isArray(t)&&(e=t),this.events||(this.events=new Map),e.forEach(t=>{let e=this.events.get(t);e||(this.events.set(t,[]),e=[]),e.includes(i)||e.push(i),this.events.set(t,e)})}off(t,i){let e=[];"string"==typeof t?e=t.split(" "):Array.isArray(t)&&(e=t),e.forEach(t=>{const e=this.events.get(t);if(Array.isArray(e)){const t=e.indexOf(i);-1t(this,...e)),"*"!==t&&this.emit("*",t,...e)}}Object.defineProperty(t,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.17"}),Object.defineProperty(t,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class Y extends t{constructor(t={}){super(t),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(var[i,n]of Object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,o]of e)this.plugins[t]=o,o.attach();this.emit("attachPlugins")}detachPlugins(t){for(const e of t=t||Object.keys(this.plugins)){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit("detachPlugins"),this}}var x,p;(i=x=x||{})[i.Init=0]="Init",i[i.Error=1]="Error",i[i.Ready=2]="Ready",i[i.Panning=3]="Panning",i[i.Mousemove=4]="Mousemove",i[i.Destroy=5]="Destroy";const g=["a","b","c","d","e","f"],q={PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"},V={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:q},m='
',l=t=>t&&null!==t&&t instanceof Element&&"nodeType"in t,b=(e,t)=>{e&&H(t).forEach(t=>{e.classList.remove(t)})},v=(e,t)=>{e&&H(t).forEach(t=>{e.classList.add(t)})},y={a:1,b:0,c:0,d:1,e:0,f:0},w=1e3,S="mousemove",Z="drag",G="content";let U=null,$=null;class c extends Y{get isTouchDevice(){return $=null===$?window.matchMedia("(hover: none)").matches:$}get isMobile(){return U=null===U?/iPhone|iPad|iPod|Android/i.test(navigator.userAgent):U}get panMode(){return this.options.panMode!==S||this.isTouchDevice?Z:S}get panOnlyZoomed(){var t=this.options.panOnlyZoomed;return"auto"===t?this.isTouchDevice:t}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){var{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){var{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option("minScale")||1}get fullScale(){var t=this["contentRect"];return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){var{containerRect:t,contentRect:e}=this,t=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,t)}get isScaling(){return 1e-5t)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){if(super(e),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:x.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},y)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},y)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error("Container Element Not Found");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},c.Plugins),i)),this.emit("init");const n=this.content;if(n.addEventListener("load",this.onLoad),n.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){t.classList.add(this.cn("isLoading"));const e=d(m);!t.contains(n)||n.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null==(i=n.parentElement)?void 0:i.insertBefore(e,n))||null}this.emit("beforeLoad")}else queueMicrotask(()=>{this.enable()})}initContent(){const t=this["container"],e=this.cn(G);let i=this.option(G)||t.querySelector("."+e);if(i||(i=t.querySelector("img,picture")||t.firstElementChild)&&v(i,e),!(i=i instanceof HTMLPictureElement?i.querySelector("img"):i))throw new Error("No content found");this.content=i}onLoad(){this.spinner&&(this.spinner.remove(),this.spinner=null),this.option("spinner")&&this.container.classList.remove(this.cn("isLoading")),this.emit("afterLoad"),this.state===x.Init?this.enable():this.updateMetrics()}onError(){this.state!==x.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=x.Error,this.emit("error"))}attachObserver(){var t;const e=()=>.1{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout(()=>{e()&&this.onResize(),this.updateTimer=null},500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))})),null!=(t=this.resizeObserver)&&t.observe(this.container)}detachObserver(){var t;null!=(t=this.resizeObserver)&&t.disconnect()}attachEvents(){const t=this["container"];t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new B(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(S,this.onMouseMove)}detachEvents(){var t;const e=this["container"];e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("wheel",this.onWheel,{passive:!1}),null!=(t=this.pointerTracker)&&t.stop(),this.pointerTracker=null,document.removeEventListener(S,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){var t=this.friction,e=(this.setTargetForce(),this.option("maxVelocity"));for(const i of g)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame(()=>this.animate()):this.stop("current")}setTargetForce(){for(const t of g)"e"===t&&this.isBouncingX||"f"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){var i=this["current"],t=i.e+t,i=i.f+e,e=this.getBounds(),{x:n,y:s}=e,o=n.min,n=n.max,a=s.min,s=s.max;let r=0,l=0;return o!==1/0&&t{this.option("zoom")&&t&&"string"==typeof t&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(t)&&"function"==typeof this[t]&&(e.preventDefault(),this[t]({event:e}))},a=this.option("click",e),r=this.option("dblClick",e);r?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout(()=>{1===this.clicks?(this.emit("click",e),!e.defaultPrevented&&a&&o(a)):(this.emit("dblClick",e),e.defaultPrevented||o(r)),this.clicks=0,this.clickTimer=null},350))):(this.emit("click",e),!e.defaultPrevented&&a&&o(a))}}}}addTrackingPoint(t){const e=this.trackingPoints.filter(t=>t.time>Date.now()-100);e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];var n=this.content.getBoundingClientRect();if(this.dragStart={x:n.x,y:n.y,top:n.top,left:n.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===S&&1this.maxScale+1e-5||t&&!a&&!r)&&(h=.35),this.applyChange({panX:a,panY:r,friction:h}),this.emit("decel",l,c,d,e)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce(function(t,e){return Math.abs(e)>Math.abs(t)?e:t}),e=Math.max(-1,Math.min(1,e));this.emit("wheel",t,e),this.panMode===S||t.defaultPrevented||("pan"===(e=this.option("wheel"))?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):"zoom"===e&&!1!==this.option("zoom")&&this.zoomWithWheel(t))}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){"Escape"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit("beforeTransform");const{current:t,target:e,content:i,contentRect:n}=this,s=Object.assign({},y);for(const i of g){const n="e"==i||"f"===i?w:1e5;s[i]=E(t[i],n),Math.abs(e[i]-t[i])<("e"==i||"f"===i?.51:.001)&&(t[i]=e[i])}let{a:o,b:a,c:r,d:l,e:c,f:h}=s,d=`matrix(${o}, ${a}, ${r}, ${l}, ${c}, ${h})`,u=i.parentElement instanceof HTMLPictureElement?i.parentElement:i;var p,m;(u=this.option("transformParent")?u.parentElement||u:u).style.transform!==d&&(u.style.transform=d,{contentWidth:p,contentHeight:m}=this.calculateContentDim(),n.width=p,n.height=m,this.emit("afterTransform"))}updateMetrics(r=!1){if(this&&this.state!==x.Destroy&&!this.isContentLoading){const f=Math.max(1,(null==(l=window.visualViewport)?void 0:l.scale)||1),{container:g,content:b}=this,v=b instanceof HTMLImageElement,y=g.getBoundingClientRect(),w=getComputedStyle(this.container);var l=y.width*f,c=y.height*f,h=parseFloat(w.paddingTop)+parseFloat(w.paddingBottom),d=l-(parseFloat(w.paddingLeft)+parseFloat(w.paddingRight));this.containerRect={width:l,height:c,innerWidth:d,innerHeight:c-h};let t=this.option("width")||"auto",e=this.option("height")||"auto",i=("auto"===t&&(t=parseFloat(b.dataset.width||"")||(((l=b)instanceof HTMLImageElement?l.naturalWidth:l instanceof SVGElement?l.width.baseVal.value:Math.max(l.offsetWidth,l.scrollWidth))||0)),"auto"===e&&(e=parseFloat(b.dataset.height||"")||(((d=b)instanceof HTMLImageElement?d.naturalHeight:d instanceof SVGElement?d.height.baseVal.value:Math.max(d.offsetHeight,d.scrollHeight))||0)),b.parentElement instanceof HTMLPictureElement?b.parentElement:b);var u,p,m,c=(i=this.option("transformParent")?i.parentElement||i:i).getAttribute("style")||"",h=(i.style.setProperty("transform","none","important"),v&&(i.style.width="",i.style.height=""),i.offsetHeight,b.getBoundingClientRect());let n=h.width*f,s=h.height*f,o=0,a=0;v&&(1this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===x.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}}getBounds(){var a=this.option("bounds");if("auto"!==a)return a;var{contentWidth:a,contentHeight:r}=this.calculateContentDim(this.target);let l=0,c=0,h=0,d=0;var u=this.option("infinite");if(!0===u||this.lockedAxis&&u===this.lockedAxis)l=-1/0,h=1/0,c=-1/0,d=1/0;else{let{containerRect:t,contentRect:e}=this,i=E(this.contentRect.fitWidth*this.targetScale,w),n=E(this.contentRect.fitHeight*this.targetScale,w),{innerWidth:s,innerHeight:o}=t;this.containerRect.width===i&&(s=t.width),this.containerRect.width===n&&(o=t.height),a>s&&(h=.5*(a-s),l=-1*h,u=.5*(e.right-e.left),l+=u,h+=u),this.contentRect.fitWidth>s&&ao&&(d=.5*(r-o),c=-1*d,u=.5*(e.bottom-e.top),c+=u,d+=u),this.contentRect.fitHeight>o&&rE(n.fitWidth,1)||E(n.height,1)>E(n.fitHeight,1))&&(u=!0),E(n.width*o,1)E(o),m=!p&&!u&&d&&E(c)i&&(n=i/e)}t=t.scale(n)}t=t.translate(-o,-a).translate(-u,-r).multiply(p),s&&(t=t.rotate(s)),l&&(t=t.scale(-1,1)),c&&(t=t.scale(1,-1));for(const e of g)"e"!==e&&"f"!==e&&(t[e]>this.minScale+1e-5||t[e]this.animate()))}panWithMouse(i,n=this.option("mouseMoveFriction")){if(this.pmme=i,this.panMode===S&&i&&!(E(this.targetScale)<=E(this.minScale))){this.emit("mouseMove",i);const{container:o,containerRect:a,contentRect:r}=this,l=a.width,c=a.height,h=o.getBoundingClientRect(),d=(i.clientX||0)-h.left,u=(i.clientY||0)-h.top;let{contentWidth:t,contentHeight:e}=this.calculateContentDim(this.target);var i=this.option("mouseMoveFactor"),i=(1Math.abs(t)?e:t}),i=Math.max(-1,Math.min(1,i)),{targetScale:n,maxScale:s,minScale:o}=this;let t=n*(100+45*i)/100;t=E(t)E(s)&&E(n)>=E(s)?(this.cwd+=Math.abs(i),s):(this.cwd=0,Math.max(Math.min(t,s),o)),this.cwd>this.option("wheelLimit")||(e.preventDefault(),E(t)!==E(n)&&this.zoomTo(t,{event:e}))}}}canZoomIn(){return this.option("zoom")&&(E(this.contentRect.width,1)E(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo("fit",t)}zoomToCover(t){this.zoomTo("cover",t)}zoomToFull(t){this.zoomTo("full",t)}zoomToMax(t){this.zoomTo("max",t)}toggleZoom(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.fullScale-this.minScale)?"full":"fit",t)}toggleMax(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.maxScale-this.minScale)?"max":"fit",t)}toggleCover(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.coverScale-this.minScale)?"cover":"fit",t)}iterateZoom(t){this.zoomTo("next",t)}zoomTo(i=1,{friction:n="auto",originX:s=0,originY:o=0,event:a}={}){if(!this.isContentLoading&&this.state!==x.Destroy){const c=this["targetScale"];this.stop();let t=1;if(a=this.panMode===S?this.pmme||a:a){const i=this.content.getBoundingClientRect(),n=a.clientX||0,c=a.clientY||0;s=n-i.left-.5*i.width,o=c-i.top-.5*i.height}var r=this.fullScale,l=this.maxScale;let e=this.coverScale;t="number"==typeof i?i/c:("next"===i&&(r-e<.2&&(e=r),i=c{n&&(n=!1,e(...t),setTimeout(()=>{n=!0},i))}}const J=(t,e)=>{let i=[];return t.childNodes.forEach(t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)}),i},r=((i=p=p||{})[i.Init=0]="Init",i[i.Ready=1]="Ready",i[i.Destroy=2]="Destroy",t=>{var e;return(t="string"==typeof t?{html:t}:t)instanceof String||t instanceof HTMLElement||void 0!==(e=t.thumb)&&("string"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb),Object.assign({html:"",el:null,isDom:!1,class:"",index:-1,dim:0,gap:0,pos:0,transition:!1},t)});class e extends t{constructor(t,e){super(e),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}class Q extends e{constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;return t||(t=document.createElement("ul"),v(t,this.cn("list")),t.setAttribute("role","tablist"),this.instance.container.appendChild(t),v(this.instance.container,this.cn("hasDots")),this.list=t),t}refresh(){var i;const n=this.instance.pages.length,s=Math.min(2,this.option("minCount")),o=Math.max(2e3,this.option("maxCount")),a=this.option("dynamicFrom");if(no)this.cleanup();else{var r="number"==typeof a&&5=a,l=!this.list||this.isDynamic!==r||this.list.children.length!==n;l&&this.cleanup();const c=this.build();if(f(c,this.cn("isDynamic"),!!r),l)for(let t=0;t',dynamicFrom:11,maxCount:1/0,minCount:2}});const h="disabled",P="next",tt="prev";class et extends e{constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){var i=this.instance,n=i.pages.length,s=i.page;if(n<2)this.cleanup();else{this.build();let t=this.prev,e=this.next;t&&e&&(t.removeAttribute(h),e.removeAttribute(h),i.isInfinite||(s<=0&&t.setAttribute(h,""),n-1<=s&&e.setAttribute(h,"")))}}createButton(t){const e=this.instance,i=document.createElement("button");i.setAttribute("tabindex","0"),i.setAttribute("title",e.localize(`{{${t.toUpperCase()}}}`)),v(i,this.cn("button")+" "+this.cn(t===P?"isNext":"isPrev"));var n=e.isRTL?t===P?tt:P:t;return i.innerHTML=e.localize(this.option(n+"Tpl")),i.dataset["carousel"+((n=t)?n.match("^[a-z]")?n.charAt(0).toUpperCase()+n.substring(1):n:"")]="true",i}build(){let t=this.container;t||(this.container=t=document.createElement("div"),v(t,this.cn("container")),this.instance.container.appendChild(t)),this.next||(this.next=t.appendChild(this.createButton(P))),this.prev||(this.prev=t.appendChild(this.createButton(tt)))}cleanup(){this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove(),this.prev=null,this.next=null,this.container=null}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(et,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'',prevTpl:''}});class it extends e{constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){this.nav&&this.target&&(this.nav.options.initialSlide=this.target.options.initialPage,this.nav.on("ready",this.onNavReady),this.nav.state===p.Ready&&this.onNavReady(this.nav),this.target.on("ready",this.onTargetReady),this.target.state===p.Ready&&this.onTargetReady(this.target))}onNavReady(t){t.on("createSlide",this.onNavCreateSlide),t.on("Panzoom.click",this.onNavClick),t.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on("change",this.onTargetChange),t.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){i.pointerType||this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n;if(!(3{t.el&&t.el.classList[t.index===e?"add":"remove"]("is-nav-selected")}))}attach(){var t=this.options.target,e=this.options.nav;t?this.addAsNavFor(t):e&&this.addAsTargetFor(e)}detach(){const t=this,e=t.nav,i=t.target;e&&(e.off("ready",t.onNavReady),e.off("createSlide",t.onNavCreateSlide),e.off("Panzoom.click",t.onNavClick),e.off("Panzoom.touchEnd",t.onNavTouch)),this.nav=null,i&&(i.off("ready",t.onTargetReady),i.off("refresh",t.onTargetChange),i.off("change",t.onTargetChange)),this.target=null}}Object.defineProperty(it,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});var C,M,i={Navigation:et,Dots:Q,Sync:it};class T extends Y{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===p.Ready}get isInfinite(){let t=!1;var{contentDim:e,viewportDim:i,pages:n,slides:s}=this;return t=2<=n.length&&e+s[0].dim>=i?this.option("infinite"):t}get isRTL(){return"rtl"===this.option("direction")}get isHorizontal(){return"x"===this.option("axis")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:p.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),!(t="string"==typeof t?document.querySelector(t):t)||!l(t))throw new Error("No Element found");this.container=t,this.slideNext=K(this.slideNext.bind(this),150),this.slidePrev=K(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask(()=>{this.processOptions()})}processOptions(){const t=u({},T.defaults,this.userOptions);let e="";var i=t.breakpoints;if(i&&X(i))for(var[n,s]of Object.entries(i))window.matchMedia(n).matches&&X(s)&&(e+=n,u(t,s));e===this.bp&&this.state!==p.Init||(this.bp=e,this.state===p.Ready&&(t.initialSlide=this.pages[this.page].slides[0].index),this.state!==p.Init&&this.destroy(),super.setOptions(t),!1===this.option("enabled")?this.attachEvents():setTimeout(()=>{this.init()},0))}init(){this.state=p.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},T.Plugins),this.userPlugins)),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=p.Ready,this.emit("ready")}initLayout(){const t=this["container"],e=this.option("classes");v(t,this.cn("container")),f(t,e.isLTR,!this.isRTL),f(t,e.isRTL,this.isRTL),f(t,e.isVertical,!this.isHorizontal),f(t,e.isHorizontal,this.isHorizontal);let i=this.option("viewport")||t.querySelector("."+e.viewport),n=(i||(i=document.createElement("div"),v(i,e.viewport),i.append(...J(t,"."+e.slide)),t.prepend(i)),this.option("track")||t.querySelector("."+e.track));n||(n=document.createElement("div"),v(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute("aria-live","polite"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit("initLayout")}initSlides(){var t=this["track"];if(t){this.slides=[],[...J(t,"."+this.cn("slide"))].forEach(t=>{l(t)&&(t=r({el:t,isDom:!0,index:this.slides.length}),this.slides.push(t),this.emit("initSlide",t,this.slides.length))});for(var e of this.option("slides",[])){const i=r(e);i.index=this.slides.length,this.slides.push(i),this.emit("initSlide",i,this.slides.length)}this.emit("initSlides")}}setInitialPage(){var t=this.option("initialSlide"),t="number"==typeof t?this.getPageForSlide(t):parseInt(this.option("initialPage",0)+"",10)||0;this.page=t}setInitialPosition(){if(this.track&&this.pages.length){var e=this.isHorizontal;let t=this.page;this.pages[t]||(this.page=t=0);var i=this.pages[t].pos*(this.isRTL&&e?1:-1);this.track.style.transform=`translate3d(${e?i+"px":"0"}, ${e?"0":i+"px"}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);var t=this.option("Panzoom")||{};this.panzoom=new c(this.viewport,u({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on("*",(t,e,...i)=>{this.emit("Panzoom."+e,t,...i)}),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option("slidesPerPage"),s=(("number"!=typeof n||e<=i)&&(n=1/0),0),o=0,a=0;for(const e of this.slides)(!t.length||o+e.dim>i||a===n)&&(t.push((r={},Object.assign({index:-1,slides:[],dim:0,pos:-1},r))),s=t.length-1,o=0,a=0),t[s].slides.push(e),o+=e.dim+e.gap,a++;var r;return t}processPages(){const t=this.pages,{contentDim:i,viewportDim:n}=this,s=this.option("center"),o=this.option("fill"),a=o&&s&&i>n&&!this.isInfinite;if(t.forEach((t,e)=>{t.index=e,t.pos=t.slides[0].pos,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e=i-.5*n?t.pos=i-n:s&&(t.pos+=-.5*(n-t.dim))}),t.forEach((t,e)=>{o&&!this.isInfinite&&i>n&&(t.pos=Math.max(t.pos,0),t.pos=Math.min(t.pos,i-n)),t.pos=E(t.pos,1e3),t.dim=E(t.dim,1e3),t.pos<.1&&-.1{const e=Object.assign({},t);l&&e.pos===l.pos?(l.dim+=e.dim,l.slides=[...l.slides,...e.slides]):(e.index=r.length,l=e,r.push(e))}),r}getPageFromIndex(t=0){var e=this.pages.length;return t=parseInt((t||0).toString())||0,this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0)}getSlideMetrics(t){var e=this.isHorizontal?"width":"height";let i=0,n,s=t.el;if(s?i=parseFloat(s.dataset[e]||"")||0:((s=document.createElement("div")).style.visibility="hidden",v(s,this.cn("slide")+" "+t.class),(this.track||document.body).prepend(s)),i)s.style[e]=i+"px",s.style["width"==e?"height":"width"]="";else{const t=Math.max(1,(null==(o=window.visualViewport)?void 0:o.scale)||1);i=s.getBoundingClientRect()[e]*t}var o=getComputedStyle(s);return"content-box"===o.boxSizing&&(this.isHorizontal?i=(i+=parseFloat(o.paddingLeft)||0)+(parseFloat(o.paddingRight)||0):i=(i+=parseFloat(o.paddingTop)||0)+(parseFloat(o.paddingBottom)||0)),n=parseFloat(o[this.isHorizontal?"marginRight":"marginBottom"])||0,t.el||s.remove(),{dim:E(i,1e3),gap:E(n,1e3)}}getBounds(){const{isInfinite:t,isRTL:e,isHorizontal:i,pages:n}=this;let s={min:0,max:0};if(t)s={min:-1/0,max:1/0};else if(n.length){const t=n[0].pos,o=n[n.length-1].pos;s=e&&i?{min:t,max:o}:{min:-1*o,max:-1*t}}return{x:i?s:{min:0,max:0},y:i?{min:0,max:0}:s}}repositionSlides(){let e,{isHorizontal:t,isRTL:i,isInfinite:n,viewport:s,viewportDim:o,contentDim:a,page:r,pages:l,slides:c,panzoom:h}=this,d=0,u=0,p=0,m=0;h?m=-1*h.current[this.axis]:l[r]&&(m=l[r].pos||0),e=t?i?"right":"left":"top",i&&t&&(m*=-1);for(const t of c)t.el?("top"==e?(t.el.style.right="",t.el.style.left=""):t.el.style.top="",t.index!==d?t.el.style[e]=0===u?"":E(u,1e3)+"px":t.el.style[e]="",p+=t.dim+t.gap,d++):u+=t.dim+t.gap;if(n&&p&&s){var f=getComputedStyle(s),g="padding",b=t?"Right":"Bottom",v=parseFloat(f[g+(t?"Left":"Top")]);m-=v,o=(o+=v)+parseFloat(f[g+b]);for(const t of c)t.el&&(E(t.pos)E(a-o)&&(t.el.style[e]=E(u+p,1e3)+"px"),E(t.pos+t.gap)>=E(a-o)&&E(t.pos)>E(m+o)&&E(m){t.el&&a.push(e)}),e.index);let t=null;var s=(t=a.length?n[a.reduce((t,e)=>Math.abs(e-r)this.page?1:-1,o=this.pages[s].pos*(this.isRTL?1:-1);if(this.page===s&&E(o,1e3)===E(n.target[this.axis],1e3))return!1;this.clearTransitions();var a=n.isResting;v(this.container,this.cn("inTransition"));const r=this.pages[this.page].slides[0],l=this.pages[s].slides[0];this.inTransition.add(l.index),this.createSlideEl(l);let c=r.el,h=l.el;a||"slide"===e||(e="fadeFast",c=null);var a=this.isRTL?"next":"prev",d=this.isRTL?"prev":"next";return c&&(this.inTransition.add(r.index),r.transition=e,c.addEventListener("animationend",this.onAnimationEnd),c.classList.add(`f-${e}Out`,"to-"+(0s-n&&(i=1,t-=s)):(t>n&&(i=1,t-=s),t{t instanceof HTMLImageElement&&s.add(t)});let t=Array.from(i.querySelectorAll("[data-lazy-src]"));i.dataset.lazySrc&&t.push(i),t.map(t=>{t instanceof HTMLImageElement?s.add(t):l(t)&&(t.style.backgroundImage=`url('${t.dataset.lazySrc||""}')`,delete t.dataset.lazySrc)});const a=(t,e,i)=>{i&&(i.remove(),i=null),e.complete&&(e.classList.add(o),setTimeout(()=>{e.classList.remove(o)},350),e.style.display=""),this.option("adaptiveHeight")&&t.el&&-1{a(e,n,t)}),n.addEventListener("load",()=>{a(e,n,t)}),setTimeout(()=>{n.parentNode&&e.el&&(n.complete?a(e,n,t):(t=d(m),n.parentNode.insertBefore(t,n)))},300)}}}onAnimationEnd(t){const e=t.target,i=e?parseInt(e.dataset.index||"",10)||0:-1,n=this.slides[i],s=t.animationName;e&&n&&s&&((t=!!this.inTransition.has(i)&&n.transition)&&s.substring(0,t.length+2)==="f-"+t&&this.inTransition.delete(i),this.inTransition.size||this.clearTransitions(),i===this.page&&null!=(t=this.panzoom)&&t.isResting&&this.emit("settle"))}onDecel(i,n=0,s=0){var{isRTL:o,isHorizontal:a,axis:r,pages:l}=this,c=l.length,h=Math.abs(Math.atan2(s,n)/(Math.PI/180)),h=45{t.el&&(e=Math.max(e,t.el.offsetHeight))})),n.style.height=e?e+"px":""}}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{contentDim:n,viewportDim:s,pages:o,page:a}=this,r=(n=n+(null==(e=this.slides[this.slides.length-1])?void 0:e.gap)||0,0);r=this.panzoom?-1*this.panzoom.current[this.axis]:o[a]&&o[a].pos||0,this.isInfinite&&(r-=Math.floor(r/n)*n),this.isRTL&&this.isHorizontal&&(r*=-1);var l=r-s*t,c=r+s*(t+1),h=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of h){const s=t.pos+e*n,o=t.pos+t.dim+t.gap+e*n;sl&&i.add(t)}return i}getPageFromPosition(i){var{viewportDim:t,contentDim:e}=this,n=this.pages.length,s=this.slides.length,s=this.slides[s-1];const o=this.option("center");o&&(i+=.5*t),this.isInfinite||(i=Math.max(this.slides[0].pos,Math.min(i,s.pos)));var t=e+s.gap,e=Math.floor(i/t)||0;i-=e*t;let a=s,r=this.slides.find(t=>{var e=i+(a&&!o?.5*a.dim:0);return(a=t).pos<=e&&t.pos+t.dim+t.gap>e});return r=r||s,{page:(t=this.getPageForSlide(r.index))+e*n,pageIndex:t}}destroy(){if(![p.Destroy].includes(this.state)){this.state=p.Destroy;const{container:e,viewport:i,track:n,slides:s,panzoom:o}=this,a=this.option("classes");e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),o&&(o.destroy(),this.panzoom=null),s&&s.forEach(t=>{this.removeSlideEl(t)}),this.detachPlugins(),i&&i.offsetParent&&n&&n.offsetParent&&i.replaceWith(...n.childNodes);for(const[i,n]of Object.entries(a))"container"!==i&&n&&e.classList.remove(n);this.track=null,this.viewport=null,this.page=0,this.slides=[];var t=this.events.get("ready");this.events=new Map,t&&this.events.set("ready",t)}}}Object.defineProperty(T,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(T,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}}}),Object.defineProperty(T,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:i});function nt(t){var e=window.pageYOffset,i=window.pageYOffset+window.innerHeight;if(!l(t))return 0;var n=(t=t.getBoundingClientRect()).y+window.pageYOffset,s=t.y+t.height+window.pageYOffset;if(s{if(t&&O){void 0===st&&document.createElement("div").focus({get preventScroll(){return!(st=!0)}});try{var e,i;st?t.focus({preventScroll:!0}):(e=window.pageXOffset||document.body.scrollTop,i=window.pageYOffset||document.body.scrollLeft,t.focus(),document.body.scrollTo({top:e,left:i,behavior:"auto"}))}catch(t){}}},rt={dragToClose:!0,hideScrollbar:!0,Carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},contentClick:"toggleZoom",contentDblClick:!1,backdropClick:"close",animated:!0,idle:3500,showClass:"f-zoomInUp",hideClass:"f-fadeOut",commonCaption:!1,parentEl:null,startIndex:0,l10n:Object.assign(Object.assign({},q),{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"}),tpl:{closeButton:'',main:''},groupAll:!1,groupAttr:"data-fancybox",defaultType:"image",defaultDisplay:"block",autoFocus:!0,trapFocus:!0,placeFocusBack:!0,closeButton:"auto",keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"prev",ArrowDown:"next",ArrowRight:"next",ArrowLeft:"prev"},Fullscreen:{autoStart:!1},compact:()=>window.matchMedia("(max-width: 578px), (max-height: 578px)").matches,wheel:"zoom"},lt=((i=C=C||{})[i.Init=0]="Init",i[i.Ready=1]="Ready",i[i.Closing=2]="Closing",i[i.CustomClosing=3]="CustomClosing",i[i.Destroy=4]="Destroy",(i=M=M||{})[i.Loading=0]="Loading",i[i.Opening=1]="Opening",i[i.Ready=2]="Ready",i[i.Closing=3]="Closing",()=>{queueMicrotask(()=>{{const{slug:i,index:n}=A.parseURL(),s=D.getInstance();if(s&&!1!==s.option("Hash")){const o=s.carousel;if(i&&o){for(var t of o.slides)if(t.slug&&t.slug===i)return void o.slideTo(t.index);if(i===s.option("slug"))return void o.slideTo(n-1);var e=s.getSlide(),e=e&&e.triggerEl&&e.triggerEl.dataset;if(e&&e.fancybox===i)return void o.slideTo(n-1)}A.hasSilentClose=!0,s.close()}return void A.startFromUrl()}})});class A extends e{constructor(){super(...arguments),Object.defineProperty(this,"origHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null})}onChange(){const s=this.instance,o=s.carousel;this.timer&&clearTimeout(this.timer);var a=s.getSlide();if(o&&a){const r=s.isOpeningSlide(a),l=new URL(document.URL).hash;let t,e=a.slug||void 0,i=a.triggerEl||void 0,n=(!(t=e||this.instance.option("slug"))&&i&&i.dataset&&(t=i.dataset.fancybox),"");t&&"true"!==t&&(n="#"+t+(!e&&1{try{s.state===C.Ready&&window.history[r?"pushState":"replaceState"]({},document.title,window.location.pathname+window.location.search+n)}catch(t){}},300))}}onClose(){if(this.timer&&clearTimeout(this.timer),!0!==A.hasSilentClose)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(this.origHash||""))}catch(t){}}attach(){const t=this.instance;t.on("Carousel.ready",this.onChange),t.on("Carousel.change",this.onChange),t.on("close",this.onClose)}detach(){const t=this.instance;t.off("Carousel.ready",this.onChange),t.off("Carousel.change",this.onChange),t.off("close",this.onClose)}static parseURL(){const t=window.location.hash.slice(1),e=t.split("-"),i=e[e.length-1],n=i&&/^\+?\d+$/.test(i)&&parseInt(e.pop()||"1",10)||1;return{hash:t,slug:e.join("-"),index:n}}static startFromUrl(){if(A.hasSilentClose=!1,!D.getInstance()&&!1!==D.defaults.Hash){var{hash:e,slug:i,index:n}=A.parseURL();if(i){let t=document.querySelector(`[data-slug="${e}"]`);t&&t.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),D.getInstance()||(e=document.querySelectorAll(`[data-fancybox="${i}"]`)).length&&(t=e[n-1])&&t.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0}))}}}static destroy(){window.removeEventListener("hashchange",lt,!1)}}function ct(){window.addEventListener("hashchange",lt,!1),setTimeout(()=>{A.startFromUrl()},500)}Object.defineProperty(A,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(A,"hasSilentClose",{enumerable:!0,configurable:!0,writable:!0,value:!1}),O&&(/complete|interactive|loaded/.test(document.readyState)?ct():document.addEventListener("DOMContentLoaded",ct));class ht extends e{onCreateSlide(t,e,l){const c=this.instance,i=c.optionFor(l,"src")||"",{el:h,type:n}=l;h&&"image"===n&&"string"==typeof i&&this.setContent(l,i).then(i=>{const n=l.contentEl,s=l.imageEl,e=l.thumbElSrc;if(!c.isClosing()&&n&&s){n.offsetHeight;var o,a=!!c.isOpeningSlide(l)&&this.getZoomInfo(l);if(this.option("protected")){h.addEventListener("contextmenu",t=>{t.preventDefault()});const i=document.createElement("div");v(i,"fancybox-protected"),n.appendChild(i)}if(e&&a){const s=i.contentRect,h=Math.max(s.fullWidth,s.fullHeight);let t=null;!a.opacity&&1200{t&&(v(t,"f-fadeFastOut"),setTimeout(()=>{t&&(t.remove(),t=null)},200))};o=e,new Promise((t,e)=>{const i=new Image;i.onload=t,i.onerror=e,i.src=o}).then(()=>{l.state=M.Opening,this.instance.emit("reveal",l),this.zoomIn(l).then(()=>{r(),this.instance.done(l)},()=>{c.hideLoading(l)}),t&&setTimeout(()=>{r()},2500{c.hideLoading(l),c.revealContent(l)})}else{const n=this.optionFor(l,"initialSize"),s=this.optionFor(l,"zoom"),h={event:c.prevMouseMoveEvent||c.options.event,friction:s?.12:0};let t=c.optionFor(l,"showClass")||void 0,e=!0;c.isOpeningSlide(l)&&("full"===n?i.zoomToFull(h):"cover"===n?i.zoomToCover(h):"max"===n?i.zoomToMax(h):e=!1,i.stop("current")),e&&t&&(t=i.isDragging?"f-fadeIn":""),c.revealContent(l,t)}}},()=>{c.setError(l,"{{IMAGE_ERROR}}")})}onRemoveSlide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(t,e,i,n){for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onClose(){const t=this.instance,e=t.container,i=t.getSlide();if(e&&e.parentElement&&i){const{el:r,contentEl:l,panzoom:c}=i,h=i.thumbElSrc;if(r&&h&&l&&c&&!c.isContentLoading&&c.state!==x.Init&&c.state!==x.Destroy){c.updateMetrics();var n=this.getZoomInfo(i);if(n){this.instance.state=C.CustomClosing,e.classList.remove("is-zooming-in"),e.classList.add("is-zooming-out"),l.style.backgroundImage=`url('${h}')`;var s=e.getBoundingClientRect(),{x:o,y:s,scale:a,opacity:n}=(1===((null==(o=window.visualViewport)?void 0:o.scale)||1)&&Object.assign(e.style,{position:"absolute",top:window.pageYOffset+"px",left:window.pageXOffset+"px",bottom:"auto",right:"auto",width:s.width+"px",height:s.height+"px",overflow:"hidden"}),n);if(n){const o=(e=>{const i=a-e;return t=>1+((t-e)/i*-1||0)})(c.scale);c.on("afterTransform",()=>{l.style.opacity=o(c.scale)+""})}c.on("endAnimation",()=>{t.destroy()}),c.target.a=a,c.target.b=0,c.target.c=0,c.target.d=a,c.panTo({x:o,y:s,scale:a,friction:n?.2:.33,ignoreBounds:!0}),c.isResting&&t.destroy()}}}}setContent(a,r){return new Promise((e,i)=>{var n;const s=this.instance,o=a.el;if(o){s.showLoading(a);let t=this.optionFor(a,"content");(t="string"==typeof t?d(t):t)&&l(t)||((t=document.createElement("img"))instanceof HTMLImageElement&&(t.src=r||"",t.alt=(null==(n=a.caption)?void 0:n.replace(/<[^>]+>/gi,"").substring(0,1e3))||`Image ${a.index+1} of `+(null==(n=s.carousel)?void 0:n.pages.length),t.draggable=!1,a.srcset&&t.setAttribute("srcset",a.srcset)),a.sizes&&t.setAttribute("sizes",a.sizes)),t.classList.add("fancybox-image"),a.imageEl=t,s.setContent(a,t,!1),a.panzoom=new c(o,u({},this.option("Panzoom")||{},{content:t,width:s.optionFor(a,"width","auto"),height:s.optionFor(a,"height","auto"),wheel:()=>{var t=s.option("wheel");return("zoom"===t||"pan"==t)&&t},click:(t,e)=>{if(s.isCompact||s.isClosing())return!1;if(a.index!==(null==(i=s.getSlide())?void 0:i.index))return!1;var i=!e||e.target&&(null==(i=a.contentEl)?void 0:i.contains(e.target));return s.option(i?"contentClick":"backdropClick")||!1},dblClick:()=>s.isCompact?"toggleZoom":s.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,transformParent:!0,on:{ready:t=>{e(t)},error:()=>{i()},destroy:()=>{i()}}}))}else i()})}zoomIn(f){return new Promise((e,t)=>{const i=this.instance,n=i.container,{panzoom:s,contentEl:o,el:a}=f;s&&s.updateMetrics();var r=this.getZoomInfo(f);if(r&&a&&o&&s&&n){const{x:c,y:h,scale:d,opacity:u}=r,p=()=>{f.state!==M.Closing&&(u&&(o.style.opacity=Math.max(Math.min(1,1-(1-s.scale)/(1-d)),0)+""),1<=s.scale&&s.scale>s.targetScale-.1&&e(s))},m=t=>{b(n,"is-zooming-in"),t.scale<.99||1.01{t()}),s.panTo({x:c,y:h,scale:d,friction:0,ignoreBounds:!0}),s.stop("current");var r={event:"mousemove"===s.panMode?i.prevMouseMoveEvent||i.options.event:void 0},l=this.optionFor(f,"initialSize");v(n,"is-zooming-in"),i.hideLoading(f),"full"===l?s.zoomToFull(r):"cover"===l?s.zoomToCover(r):"max"===l?s.zoomToMax(r):s.reset(.172)}else t()})}getZoomInfo(t){const{el:e,imageEl:i,thumbEl:n,panzoom:s}=t;if(!e||!i||!n||!s||nt(n)<3||!this.optionFor(t,"zoom")||this.instance.state===C.Destroy)return!1;if(1!==((null==(t=window.visualViewport)?void 0:t.scale)||1))return!1;var{top:t,left:o,width:a,height:r}=n.getBoundingClientRect(),{top:l,left:c,fitWidth:h,fitHeight:d}=s.contentRect;if(!(a&&r&&h&&d))return!1;var u=s.container.getBoundingClientRect(),c=-1*((c+=u.left)+.5*h-(o+.5*a)),o=-1*((l+=u.top)+.5*d-(t+.5*r)),u=a/h;let p=this.option("zoomOpacity")||!1;return{x:c,y:o,scale:u,opacity:p="auto"===p?.1{const i=new URL(t),n=new URLSearchParams(i.search),s=new URLSearchParams;for(const[t,i]of[...n,...Object.entries(e)]){var o=i.toString();"t"===t?s.set("start",parseInt(o).toString()):s.set(t,o)}let a=s.toString(),r=t.match(/#t=((.*)?\d+s)/);return r&&(a+="#t="+r[1]),a},ut=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo","video"];class pt extends e{onInitSlide(t,e,i){this.processType(i)}onCreateSlide(t,e,i){this.setContent(i)}onRemoveSlide(t,e,i){i.closeBtnEl&&(i.closeBtnEl.remove(),i.closeBtnEl=void 0),i.xhr&&(i.xhr.abort(),i.xhr=null);const n=i.iframeEl,s=(n&&(n.onload=n.onerror=null,n.src="//about:blank",i.iframeEl=null),i.contentEl),o=i.placeholderEl;if("inline"===i.type&&s&&o)s.classList.remove("fancybox__content"),"none"!==s.style.display&&(s.style.display="none"),o.parentNode&&o.parentNode.insertBefore(s,o),o.remove(),i.placeholderEl=null;else for(;i.el&&i.el.firstChild;)i.el.removeChild(i.el.firstChild)}onSelectSlide(t,e,i){i.state===M.Ready&&this.playVideo()}onUnselectSlide(t,e,i){var n,s;if("html5video"===i.type)try{null!=(s=null==(n=i.el)?void 0:n.querySelector("video"))&&s.pause()}catch(t){}else{let t;"vimeo"===i.type?t={method:"pause",value:"true"}:"youtube"===i.type&&(t={event:"command",func:"pauseVideo"}),t&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(t),"*"),i.poller&&clearTimeout(i.poller)}}onDone(t,e){t.isCurrentSlide(e)&&!t.isClosing()&&this.playVideo()}onRefresh(t,e){e.slides.forEach(t=>{t.el&&(this.setAspectRatio(t),this.resizeIframe(t))})}onMessage(t){try{var e=JSON.parse(t.data);if("https://player.vimeo.com"===t.origin){if("ready"===e.event)for(var i of Array.from(document.getElementsByClassName("fancybox__iframe")))i instanceof HTMLIFrameElement&&i.contentWindow===t.source&&(i.dataset.ready="true")}else if(t.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&"onReady"===e.event){const t=document.getElementById(e.id);t&&(t.dataset.ready="true")}}catch(t){}}loadAjaxContent(t){var e=this.instance.optionFor(t,"src")||"";this.instance.showLoading(t);const i=this.instance,n=new XMLHttpRequest;i.showLoading(t),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===C.Ready&&(i.hideLoading(t),200===n.status?i.setContent(t,n.responseText):i.setError(t,404===n.status?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};var s=t.ajax||null;n.open(s?"POST":"GET",e+""),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(s),t.xhr=n}setInlineContent(e){let i=null;if(l(e.src)?i=e.src:"string"==typeof e.src&&(n=e.src.split("#",2).pop(),i=n?document.getElementById(n):null),i){if("clone"===e.type||i.closest(".fancybox__slide")){var n=(i=i.cloneNode(!0)).dataset.animationName;n&&(i.classList.remove(n),delete i.dataset.animationName);let t=i.getAttribute("id");t=t?t+"--clone":`clone-${this.instance.id}-`+e.index,i.setAttribute("id",t)}else if(i.parentNode){const t=document.createElement("div");t.classList.add("fancybox-placeholder"),i.parentNode.insertBefore(t,i),e.placeholderEl=t}this.instance.setContent(e,i)}else this.instance.setError(e,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(e){const{src:t,el:i}=e;if(t&&"string"==typeof t&&i){const s=this.instance,o=document.createElement("iframe");o.className="fancybox__iframe",o.setAttribute("id",`fancybox__iframe_${s.id}_`+e.index);for(const[t,i]of Object.entries(this.optionFor(e,"iframeAttr")||{}))o.setAttribute(t,i);o.onerror=()=>{s.setError(e,"{{IFRAME_ERROR}}")},e.iframeEl=o;var n=this.optionFor(e,"preload");if(i.classList.add("is-loading"),"iframe"!==e.type||!1===n)return o.setAttribute("src",e.src+""),this.resizeIframe(e),void s.setContent(e,o);s.showLoading(e),o.onload=()=>{var t;o.src.length&&(t="true"!==o.dataset.ready,o.dataset.ready="true",this.resizeIframe(e),t?s.revealContent(e):s.hideLoading(e))},o.setAttribute("src",t),s.setContent(e,o,!1)}}resizeIframe(n){const s=n.iframeEl,o=null==s?void 0:s.parentElement;if(s&&o){let t=n.autoSize,e=n.width||0,i=n.height||0;e&&i&&(t=!1);const a=o&&o.style;if(!1!==n.preload&&!1!==t&&a)try{const n=window.getComputedStyle(o),t=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),r=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),l=s.contentWindow;if(l){const n=l.document,s=n.getElementsByTagName("html")[0],o=n.body;a.width="",o.style.overflow="hidden",e=e||s.scrollWidth+t,a.width=e+"px",o.style.overflow="",a.flex="0 0 auto",a.height=o.scrollHeight+"px",i=s.scrollHeight+r}}catch(n){}if(e||i){const n={flex:"0 1 auto",width:"",height:""};e&&(n.width=e+"px"),i&&(n.height=i+"px"),Object.assign(a,n)}}}playVideo(){const e=this.instance.getSlide();if(e){const t=e["el"];if(t&&t.offsetParent&&this.optionFor(e,"videoAutoplay")){if("html5video"===e.type)try{const e=t.querySelector("video");if(e){const t=e.play();void 0!==t&&t.then(()=>{}).catch(t=>{e.muted=!0,e.play()})}}catch(e){}if("youtube"===e.type||"vimeo"===e.type){const i=()=>{if(e.iframeEl&&e.iframeEl.contentWindow){let t;if("true"===e.iframeEl.dataset.ready)return(t="youtube"===e.type?{event:"command",func:"playVideo"}:{method:"play",value:"true"})&&e.iframeEl.contentWindow.postMessage(JSON.stringify(t),"*"),void(e.poller=void 0);"youtube"===e.type&&(t={event:"listening",id:e.iframeEl.getAttribute("id")},e.iframeEl.contentWindow.postMessage(JSON.stringify(t),"*"))}e.poller=setTimeout(i,250)};i()}}}}processType(i){if(i.html)return i.type="html",i.src=i.html,void(i.html="");const n=this.instance.optionFor(i,"src","");if(n&&"string"==typeof n){let t=i.type,e=null;var s,o,a;if((e=n.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i))?(s=(o=this.optionFor(i,"youtube"))["nocookie"],o=function(t,e){var i={};for(s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,s=Object.getOwnPropertySymbols(t);n\n Sorry, your browser doesn\'t support embedded videos.',videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}}});class mt extends e{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:"ready"}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return"ready"!==this.state}onReady(t){this.option("autoStart")&&(t.isInfinite||t.page{this.timer=null,this.inHover||this.onTimerEnd()},e),this.emit("set")}}clear(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.removeProgressBar()}start(){if(this.set(),this.option("pauseOnHover")){const t=this.instance.container;t.addEventListener("mouseenter",this.onMouseEnter,!1),t.addEventListener("mouseleave",this.onMouseLeave,!1)}document.addEventListener("visibilitychange",this.onVisibilityChange,!1)}stop(){const t=this.instance.container;this.clear(),this.state="ready",t.removeEventListener("mouseenter",this.onMouseEnter,!1),t.removeEventListener("mouseleave",this.onMouseLeave,!1),document.removeEventListener("visibilitychange",this.onVisibilityChange,!1),b(t,"has-autoplay"),this.emit("stop")}pause(){"play"===this.state&&(this.state="pause",this.clear(),this.emit("pause"))}resume(){const t=this.instance;if(t.isInfinite||t.page!==t.pages.length-1)if("play"!==this.state){if("pause"===this.state&&!this.inHover){const t=new Event("resume",{bubbles:!0,cancelable:!0});this.emit("resume",event),t.defaultPrevented||this.set()}}else this.set();else this.stop()}toggle(){"play"===this.state||"pause"===this.state?this.stop():this.set()}attach(){const t=this,e=t.instance;e.on("ready",t.onReady),e.on("Panzoom.startAnimation",t.onChange),e.on("Panzoom.endAnimation",t.onSettle),e.on("Panzoom.touchMove",t.onChange)}detach(){const t=this,e=t.instance;e.off("ready",t.onReady),e.off("Panzoom.startAnimation",t.onChange),e.off("Panzoom.endAnimation",t.onSettle),e.off("Panzoom.touchMove",t.onChange),t.stop()}}Object.defineProperty(mt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class ft extends e{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(n){const t=n.carousel;if(t){const i=n.container;i&&(t.options.Autoplay=u({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{set:t=>{var e;i.classList.add("has-slideshow"),(null==(e=n.getSlide())?void 0:e.state)!==M.Ready&&t.pause()},stop:()=>{i.classList.remove("has-slideshow"),n.isCompact||n.endIdle()},resume:(t,e)=>{var i;!e||!e.cancelable||(null==(i=n.getSlide())?void 0:i.state)===M.Ready&&null!=(i=null==(i=n.carousel)?void 0:i.panzoom)&&i.isResting||e.preventDefault()}}}),t.attachPlugins({Autoplay:mt}),this.ref=t.plugins.Autoplay)}}onReady(t){const e=t.carousel,i=this.ref;e&&i&&this.option("playOnStart")&&(e.isInfinite||e.page{t.isCurrentSlide(e)&&i.stop()}),t.isCurrentSlide(e)&&i.resume()}}onKeydown(t,e){const i=this.ref;i&&e===this.option("key")&&"BUTTON"!==(null==(e=document.activeElement)?void 0:e.nodeName)&&i.toggle()}attach(){const t=this,e=t.instance;e.on("Carousel.init",t.onPrepare),e.on("Carousel.ready",t.onReady),e.on("done",t.onDone),e.on("keydown",t.onKeydown)}detach(){const t=this,e=t.instance;e.off("Carousel.init",t.onPrepare),e.off("Carousel.ready",t.onReady),e.off("done",t.onDone),e.off("keydown",t.onKeydown)}}Object.defineProperty(ft,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:t=>{var e;return(null==(e=t.instance.container)?void 0:e.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||t.instance.container},timeout:3e3}});var z,i={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'',type:"modern"};(n=z=z||{})[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Hidden=2]="Hidden",n[n.Disabled=3]="Disabled";let gt=class extends e{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"shouldCenter",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:z.Init})}formatThumb(t,e){return this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}getSlides(){const e=[],i=this.option("thumbTpl")||"";if(i)for(const n of this.instance.slides||[]){let t="";n.type&&(t="for-"+n.type,n.type&&["video","youtube","vimeo","html5video"].includes(n.type)&&(t+=" for-video")),e.push({html:this.formatThumb(n,i),customClass:t})}return e}onInitSlide(t,e){var i=e.el;i&&(e.thumbSrc=i.dataset.thumbSrc||e.thumbSrc||"",e.thumbClipWidth=parseFloat(i.dataset.thumbClipWidth||"")||e.thumbClipWidth||0,e.thumbHeight=parseFloat(i.dataset.thumbHeight||"")||e.thumbHeight||0)}onInitSlides(){this.state===z.Init&&this.build()}onRefreshM(){this.refreshModern()}onChangeM(){"modern"===this.type&&(this.shouldCenter=!0,this.centerModern())}onClickModern(t){t.preventDefault(),t.stopPropagation();const e=this.instance,i=e.page,n=t=>{if(t){t=t.closest("[data-carousel-index]");if(t)return parseInt(t.dataset.carouselIndex||"",10)||0}return-1},s=(t,e)=>{t=document.elementFromPoint(t,e);return t?n(t):-1};let o=n(t.target);var a,r;o<0&&((o=s(t.clientX+this.thumbGap,t.clientY))===i&&(o=i-1)),o<0&&((o=s(t.clientX-this.thumbGap,t.clientY))===i&&(o=i+1)),(o=o<0?(a=this.thumbExtraGap,r=s(t.clientX-a,t.clientY),a=s(t.clientX+a,t.clientY),o=(o=o<0&&r===i?i+1:o)<0&&a===i?i-1:o):o)===i?this.centerModern():-1{this.emit("ready")})}}buildModern(){if("modern"===this.type){const{container:e,track:t,instance:o}=this,i=this.option("thumbTpl")||"";if(e&&t&&i){v(e,"is-horizontal"),this.updateModern();for(const e of o.slides||[]){const o=document.createElement("div");if(v(o,this.cn("slide")),e.type){let t="for-"+e.type;["video","youtube","vimeo","html5video"].includes(e.type)&&(t+=" for-video"),v(o,t)}o.appendChild(d(this.formatThumb(e,i))),e.thumbSlideEl=o,t.appendChild(o),this.resizeModernSlide(e)}const n=new o.constructor.Panzoom(e,{content:t,lockAxis:"x",zoom:!1,panOnlyZoomed:!1,bounds:()=>{let t=0,e=0,i=o.slides[0],n=o.slides[o.slides.length-1],s=o.slides[o.page];return i&&n&&s&&(e=-1*this.getModernThumbPos(0),0!==o.page&&(e+=.5*(i.thumbWidth||0)),t=-1*this.getModernThumbPos(o.slides.length-1),o.page!==o.slides.length-1&&(t+=(n.thumbWidth||0)-(s.thumbWidth||0)-.5*(n.thumbWidth||0))),{x:{min:t,max:e},y:{min:0,max:0}}}});n.on("touchStart",(t,e)=>{this.shouldCenter=!1}),n.on("click",(t,e)=>this.onClickModern(e)),n.on("ready",()=>{this.centerModern(),this.emit("ready")}),n.on(["afterTransform","refresh"],t=>{this.lazyLoadModern()}),this.panzoom=n,this.refreshModern()}}}updateModern(){var t;"modern"===this.type&&(t=this["container"],t&&(this.thumbGap=parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-gap"))||0,this.thumbExtraGap=parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-extra-gap"))||0,this.thumbWidth=parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-width"))||40,this.thumbClipWidth=parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-clip-width"))||40,this.thumbHeight=parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-height"))||40))}refreshModern(){var t;if("modern"===this.type){this.updateModern();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.onTransformM(),null!=(t=this.panzoom)&&t.updateMetrics(!0),this.centerModern(0)}}centerModern(n){const s=this.instance,{container:t,panzoom:o}=this;if(t&&o&&o.state!==x.Init){var a=s.page;let e=this.getModernThumbPos(a),i=e;for(let t=s.page-3;ts.pages.length-1||t===s.page)){const E=1-Math.abs(s.getProgress(t));0o.containerRect.width&&(n=.5,t=0)),o.options.maxVelocity=t,o.applyChange({panX:E(-1*i-o.target.e,1e3),friction:null===s.prevPage?0:n})}}lazyLoadModern(){const{instance:e,panzoom:i}=this;if(i){var n=-1*i.current.e||0;let t=this.getModernThumbPos(e.page);if(i.state!==x.Init||0===t)for(const t of e.slides||[]){const e=t.thumbSlideEl;if(e){const o=e.querySelector("img[data-lazy-src]"),a=t.index,r=this.getModernThumbPos(a),l=n-.5*i.containerRect.innerWidth,c=l+i.containerRect.innerWidth;if(!(!o||r{e.offsetParent&&(e.classList.remove(this.cn("isLoading")),h.remove())},!1)}}}}}}resizeModernSlide(t){var e;"modern"===this.type&&t.thumbSlideEl&&(e=t.thumbClipWidth&&t.thumbHeight?Math.round(this.thumbHeight*(t.thumbClipWidth/t.thumbHeight)):this.thumbWidth,t.thumbWidth=e)}getModernThumbPos(t){var e=this.instance.slides[t],i=this.panzoom;if(!i||!i.contentRect.fitWidth)return 0;let n=i.containerRect.innerWidth,s=i.contentRect.width;2===this.instance.slides.length&&(--t,s=2*this.thumbClipWidth);i=t*(this.thumbClipWidth+this.thumbGap)+this.thumbExtraGap+.5*(e.thumbWidth||0);return i-=s>n?.5*n:.5*s,E(i||0,1)}build(){const e=this.instance,t=e.container,i=this.option("minCount")||0;if(i){let t=0;for(const i of e.slides||[])i.thumbSrc&&t++;if(t{setTimeout(()=>{var t;null!=(t=null==o?void 0:o.querySelector(`[data-carousel-index="${e.page}"]`))&&t.focus()},100)})}}cleanup(){this.carousel&&this.carousel.destroy(),this.carousel=null,this.panzoom&&this.panzoom.destroy(),this.panzoom=null,this.container&&this.container.remove(),this.container=null,this.track=null,this.state=z.Init,b(this.instance.container,this.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===p.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on("Panzoom.afterTransform",t.onTransformM),e.on("Panzoom.refresh",t.onRefreshM),e.on("change",t.onChangeM)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off("Panzoom.afterTransform",t.onTransformM),e.off("Panzoom.refresh",t.onRefreshM),e.off("change",t.onChangeM),t.cleanup()}};Object.defineProperty(gt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:i});var L,n=Object.assign(Object.assign({},i),{key:"t",showOnStart:!0,parentEl:null});class bt extends e{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){var t=this.ref;return t&&t.state!==z.Disabled}get isHidden(){return this.hidden}onInit(){const t=this.instance,e=t.carousel;var i;!this.ref&&e&&(i=this.option("parentEl")||t.footer||t.container)&&(e.options.Thumbs=u({},this.options,{parentEl:i,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:t.option("Carousel.friction")},on:{click:(t,e)=>{e.stopPropagation()}}},on:{ready:t=>{const e=t.container;e&&this.hidden&&(this.refresh(),e.style.transition="none",this.hide(),e.offsetHeight,queueMicrotask(()=>{e.style.transition="",this.show()}))}}}),e.attachPlugins({Thumbs:gt}),this.ref=e.plugins.Thumbs,this.option("showOnStart")||(this.ref.state=z.Hidden,this.hidden=!0))}onResize(){var t;const e=null==(t=this.ref)?void 0:t.container;e&&(e.style.maxHeight="")}onKeydown(t,e){var i=this.option("key");i&&i===e&&this.toggle()}toggle(){const t=this.ref;t&&t.state!==z.Disabled&&(t.state!==z.Hidden?this.hidden?this.show():this.hide():t.build())}show(){const t=this.ref,e=t&&t.state!==z.Disabled&&t.container;e&&(this.refresh(),e.offsetHeight,e.removeAttribute("aria-hidden"),e.classList.remove("is-hidden"),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetHeight,e.classList.add("is-hidden"),e.setAttribute("aria-hidden","true")),this.hidden=!0}refresh(){var t=this.ref;if(t&&t.state!==z.Disabled){const e=t.container,i=(null==e?void 0:e.firstChild)||null;e&&i&&i.childNodes.length&&(e.style.maxHeight=i.getBoundingClientRect().height+"px")}}attach(){const t=this,e=t.instance;e.state===C.Init?e.on("Carousel.init",t.onInit):t.onInit(),e.on("resize",t.onResize),e.on("keydown",t.onKeydown)}detach(){var t;const e=this,i=e.instance;i.off("Carousel.init",e.onInit),i.off("resize",e.onResize),i.off("keydown",e.onKeydown),null!=(t=i.carousel)&&t.detachPlugins(["Thumbs"]),e.ref=null}}Object.defineProperty(bt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:n});const vt={panLeft:{icon:'',change:{panX:-100}},panRight:{icon:'',change:{panX:100}},panUp:{icon:'',change:{panY:-100}},panDown:{icon:'',change:{panY:100}},zoomIn:{icon:'',action:"zoomIn"},zoomOut:{icon:'',action:"zoomOut"},toggle1to1:{icon:'',action:"toggleZoom"},toggleZoom:{icon:'',action:"toggleZoom"},iterateZoom:{icon:'',action:"iterateZoom"},rotateCCW:{icon:'',action:"rotateCCW"},rotateCW:{icon:'',action:"rotateCW"},flipX:{icon:'',action:"flipX"},flipY:{icon:'',action:"flipY"},fitX:{icon:'',action:"fitX"},fitY:{icon:'',action:"fitY"},reset:{icon:'',action:"reset"},toggleFS:{icon:'',action:"toggleFS"}},yt=((i=L=L||{})[i.Init=0]="Init",i[i.Ready=1]="Ready",i[i.Disabled=2]="Disabled",{tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"});class wt extends e{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:L.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(o){var a;if(o.carousel){let t=this.option("display"),e=this.option("absolute"),i=this.option("enabled");if("auto"===i){const o=this.instance.carousel;let e=0;if(o)for(const t of o.slides)!t.panzoom&&"image"!==t.type||e++;e||(i=!1)}let n=0;var r={left:[],middle:[],right:[]};if(t=i?t:void 0)for(const o of["left","middle","right"])for(const e of t[o]){const t=this.createEl(e);t&&(null!=(a=r[o])&&a.push(t),n++)}let s=null;if(s=n?this.createContainer():s){for(const[o,a]of Object.entries(r)){const t=document.createElement("div");v(t,"fancybox__toolbar__column is-"+o);for(const o of a)t.appendChild(o);"auto"!==e||"middle"!==o||a.length||(e=!0),s.appendChild(t)}!0===e&&v(s,"is-absolute"),this.state=L.Ready,this.onRefresh()}else this.state=L.Disabled}}onClick(e){const t=this.instance,i=t.getSlide(),n=null==i?void 0:i.panzoom,s=e.target,o=s&&l(s)?s.dataset:null;if(o){if(void 0!==o.fancyboxToggleThumbs)return e.preventDefault(),e.stopPropagation(),void(null!=(r=t.plugins.Thumbs)&&r.toggle());if(void 0!==o.fancyboxToggleFullscreen)return e.preventDefault(),e.stopPropagation(),void this.instance.toggleFullscreen();if(void 0!==o.fancyboxToggleSlideshow){e.preventDefault(),e.stopPropagation();const r=null==(a=t.carousel)?void 0:a.plugins.Autoplay;var a=r.isActive;return n&&"mousemove"===n.panMode&&!a&&n.reset(),void(a?r.stop():r.start())}var r=o.panzoomAction,a=o.panzoomChange;if((a||r)&&(e.preventDefault(),e.stopPropagation()),a){let t={};try{t=JSON.parse(a)}catch(e){}n&&n.applyChange(t)}else r&&n&&n[r]&&n[r]()}}onChange(){this.onRefresh()}onRefresh(){if(!this.instance.isClosing()){const i=this.container;if(i){const n=this.instance.getSlide();if(n&&n.state===M.Ready){const s=n&&!n.error&&n.panzoom;for(const n of i.querySelectorAll("[data-panzoom-action]"))s?(n.removeAttribute("disabled"),n.removeAttribute("tabindex")):(n.setAttribute("disabled",""),n.setAttribute("tabindex","-1"));var t=s&&s.canZoomIn(),e=s&&s.canZoomOut();for(const n of i.querySelectorAll('[data-panzoom-action="zoomIn"]'))t?(n.removeAttribute("disabled"),n.removeAttribute("tabindex")):(n.setAttribute("disabled",""),n.setAttribute("tabindex","-1"));for(const n of i.querySelectorAll('[data-panzoom-action="zoomOut"]'))e?(n.removeAttribute("disabled"),n.removeAttribute("tabindex")):(n.setAttribute("disabled",""),n.setAttribute("tabindex","-1"));for(const n of i.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){e||t?(n.removeAttribute("disabled"),n.removeAttribute("tabindex")):(n.setAttribute("disabled",""),n.setAttribute("tabindex","-1"));const i=n.querySelector("g");i&&(i.style.display=t?"":"none")}}}}}onDone(t,e){var i;null!=(i=e.panzoom)&&i.on("afterTransform",()=>{this.instance.isCurrentSlide(e)&&this.onRefresh()}),this.instance.isCurrentSlide(e)&&this.onRefresh()}createContainer(){var t=this.instance.container;if(!t)return null;const e=this.option("parentEl")||t,i=document.createElement("div");return v(i,"fancybox__toolbar"),e.prepend(i),i.addEventListener("click",this.onClick,{passive:!1,capture:!0}),t&&v(t,"has-toolbar"),this.container=i}createEl(t){var e,i=this.instance.carousel;if(!i)return null;if("toggleFS"===t)return null;if("fullscreen"===t&&!this.instance.fsAPI)return null;let n=null;var s=i.slides.length||0;let o=0,a=0;for(const t of i.slides)!t.panzoom&&"image"!==t.type||o++,"image"!==t.type&&!t.downloadSrc||a++;if(s<2&&["infobar","prev","next"].includes(t))return n;if(void 0!==vt[t]&&!o)return null;if("download"===t&&!a)return null;if("thumbs"===t){const t=this.instance.plugins.Thumbs;if(!t||!t.isEnabled)return null}if("slideshow"===t&&(null==(e=this.instance.carousel)||!e.plugins.Autoplay||s<2))return null;if(void 0!==vt[t]){const e=vt[t];(n=document.createElement("button")).setAttribute("title",this.instance.localize(`{{${t.toUpperCase()}}}`)),v(n,"f-button"),e.action&&(n.dataset.panzoomAction=e.action),e.change&&(n.dataset.panzoomChange=JSON.stringify(e.change)),n.appendChild(d(this.instance.localize(e.icon)))}else{const e=(this.option("items")||[])[t];e&&(n=d(this.instance.localize(e.tpl)),"function"==typeof e.click&&n.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof e.click&&e.click.call(this,this,t)}))}const r=null==n?void 0:n.querySelector("svg");if(r)for(const[t,e]of Object.entries(yt))r.getAttribute(t)||r.setAttribute(t,String(e));return n}removeContainer(){const t=this.container;t&&t.remove(),this.container=null,this.state=L.Disabled;var e=this.instance.container;e&&b(e,"has-toolbar")}attach(){const t=this,e=t.instance;e.on("Carousel.initSlides",t.onReady),e.on("done",t.onDone),e.on("reveal",t.onChange),e.on("Carousel.change",t.onChange),t.onReady(t.instance)}detach(){const t=this,e=t.instance;e.off("Carousel.initSlides",t.onReady),e.off("done",t.onDone),e.off("reveal",t.onChange),e.off("Carousel.change",t.onChange),t.removeContainer()}}Object.defineProperty(wt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'
/
'},download:{tpl:''},prev:{tpl:''},next:{tpl:''},slideshow:{tpl:''},fullscreen:{tpl:''},thumbs:{tpl:''},close:{tpl:''}},parentEl:null}});function xt(){var t=window.getSelection();return t&&"Range"===t.type}const Et={Hash:A,Html:pt,Images:ht,Slideshow:ft,Thumbs:bt,Toolbar:wt},St="with-fancybox",Pt="hide-scrollbar",Ct="--fancybox-scrollbar-compensate",Mt="--fancybox-body-margin",Tt="is-animated",Ot="is-loading";let R=null,k=null;const I=new Map;let At=0;class D extends Y{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(t=[],e={},i={}){super(e),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:C.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fsAPI",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fsAPI=(()=>{let t,e="",i="",n="";return document.fullscreenEnabled?(e="requestFullscreen",i="exitFullscreen",n="fullscreenElement"):document.webkitFullscreenEnabled&&(e="webkitRequestFullscreen",i="webkitExitFullscreen",n="webkitFullscreenElement"),t=e?{request:function(t){return"webkitRequestFullscreen"===e?t[e](Element.ALLOW_KEYBOARD_INPUT):t[e]()},exit:function(){return document[n]&&document[i]()},isFullscreen:function(){return document[n]}}:t})(),this.id=e.id||++At,I.set(this.id,this),this.userSlides=t,this.userPlugins=i,queueMicrotask(()=>{this.init()})}init(){if(this.state!==C.Destroy){if(this.state=C.Init,this.attachPlugins(Object.assign(Object.assign({},D.Plugins),this.userPlugins)),this.emit("init"),!0===this.option("hideScrollbar"))if(O){const n=document.body;if(!n.classList.contains(Pt)){let t=window.innerWidth-document.documentElement.getBoundingClientRect().width;t<0&&(t=0);var e=n.currentStyle||window.getComputedStyle(n),e=parseFloat(e.marginRight);document.documentElement.style.setProperty(Ct,t+"px"),e&&n.style.setProperty(Mt,e+"px"),n.classList.add(Pt)}}this.initLayout(),this.scale();const t=()=>{this.initCarousel(this.userSlides),this.state=C.Ready,this.attachEvents(),this.emit("ready"),setTimeout(()=>{this.container&&this.container.setAttribute("aria-hidden","false")},16)},i=this.fsAPI;this.option("Fullscreen.autoStart")&&i&&!i.isFullscreen()?i.request(this.container).then(()=>t()).catch(()=>t()):t()}}initLayout(){var t;const e=this.option("parentEl")||document.body,i=d(this.localize(this.option("tpl.main")||""));i&&(i.setAttribute("id","fancybox-"+this.id),i.setAttribute("aria-label",this.localize("{{MODAL}}")),i.classList.toggle("is-compact",this.isCompact),v(i,this.option("mainClass")||""),this.container=i,this.footer=i.querySelector(".fancybox__footer"),e.appendChild(i),v(document.documentElement,St),R&&k||(R=document.createElement("span"),v(R,"fancybox-focus-guard"),R.setAttribute("tabindex","0"),R.setAttribute("aria-hidden","true"),R.setAttribute("aria-label","Focus guard"),k=R.cloneNode(),null!=(t=i.parentElement)&&t.insertBefore(R,i),null!=(t=i.parentElement)&&t.append(k)),this.option("animated")&&(v(i,Tt),setTimeout(()=>{this.isClosing()||b(i,Tt)},350)),this.emit("initLayout"))}initCarousel(t){const e=this.container;if(e){var i=e.querySelector(".fancybox__carousel");if(i){const n=this.carousel=new T(i,u({},{slides:t,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));n.on("*",(t,e,...i)=>{this.emit("Carousel."+e,t,...i)}),n.on(["ready","change"],()=>{var t,e=this.getSlide();e&&null!=(t=e.panzoom)&&t.updateControls(),this.manageCaption(e)}),n.on("removeSlide",(t,e)=>{e.closeBtnEl&&e.closeBtnEl.remove(),e.closeBtnEl=void 0,e.captionEl&&e.captionEl.remove(),e.captionEl=void 0,e.spinnerEl&&e.spinnerEl.remove(),e.spinnerEl=void 0,e.state=void 0}),n.on("Panzoom.touchStart",()=>{this.isCompact||this.endIdle()}),n.on("settle",()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&this.checkFocus()}),this.option("dragToClose")&&(n.on("Panzoom.afterTransform",(t,e)=>{var i=this.getSlide();if(!i||!s(i.el)){const n=this.container;if(n){const t=Math.abs(e.current.f),s=t<1?"":Math.max(.5,Math.min(1,1-t/e.contentRect.fitHeight*1.5));n.style.setProperty("--fancybox-ts",s?"0s":""),n.style.setProperty("--fancybox-opacity",s+"")}}}),n.on("Panzoom.touchEnd",(t,e,i)=>{var n=this.getSlide();n&&s(n.el)||e.isMobile&&document.activeElement&&-1!==["TEXTAREA","INPUT"].indexOf(null==(n=document.activeElement)?void 0:n.nodeName)||(n=Math.abs(e.dragOffset.y),"y"===e.lockedAxis&&(200<=n||50<=n&&e.dragOffset.time<300)&&(i&&i.cancelable&&i.preventDefault(),this.close(i,"f-throwOut"+(e.current.f<0?"Up":"Down"))))})),n.on(["change"],t=>{var e;let i=null==(e=this.getSlide())?void 0:e.triggerEl;if(i){const e=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}}),n.on(["refresh","change"],e=>{const i=this.container;if(i){for(const n of i.querySelectorAll("[data-fancybox-current-index]"))n.innerHTML=e.page+1;for(const n of i.querySelectorAll("[data-fancybox-count]"))n.innerHTML=e.pages.length;if(!e.isInfinite){for(const n of i.querySelectorAll("[data-fancybox-next]"))e.page{this.toggleIdle(),this.clickTimer=null},350);else if(this.emit("click",e),!e.defaultPrevented){let t=!1;if(o.closest(".fancybox__content")){if(s){if(s.closest("[contenteditable]"))return;o.matches(ot)||s.blur()}if(xt())return;t=this.option("contentClick")}else o.closest(".fancybox__carousel")&&!o.matches(ot)&&(t=this.option("backdropClick"));"close"===t?(e.preventDefault(),this.close(e)):"next"===t?(e.preventDefault(),this.next()):"prev"===t&&(e.preventDefault(),this.prev())}}}}}onWheel(t){var e=this.option("wheel",t),i="slide"===e,n=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce(function(t,e){return Math.abs(e)>Math.abs(t)?e:t}),n=Math.max(-1,Math.min(1,n)),s=Date.now();this.pwt&&s-this.pwt<300?i&&t.preventDefault():(this.pwt=s,this.emit("wheel",t),t.defaultPrevented||("close"===e?(t.preventDefault(),this.close(t)):"slide"===e&&(t.preventDefault(),this[0{var t;null!=(t=this.caption)&&t.remove(),this.caption=null})}}}checkFocus(t){var e,i=document.activeElement||null;i&&null!=(e=this.container)&&e.contains(i)||this.focus(t)}focus(n){var s,o;if(!this.ignoreFocusChange){const a=document.activeElement||null,r=(null==n?void 0:n.target)||null,l=this.container,c=this.getSlide();if(l&&null!=(s=this.carousel)&&s.viewport&&(n||!a||!l.contains(a))){const h=c&&c.state===M.Ready?c.el:null;if(h&&!h.contains(a)&&l!==a){n&&n.cancelable&&n.preventDefault(),this.ignoreFocusChange=!0;let t=[],e=null;for(o of Array.from(l.querySelectorAll(ot))){const s=!o.offsetParent||o.closest('[aria-hidden="true"]'),a=h&&h.contains(o),r=!this.carousel.viewport.contains(o);o===l||(a||r)&&!s?(t.push(o),void 0!==o.dataset.origTabindex&&(o.tabIndex=parseFloat(o.dataset.origTabindex)),o.removeAttribute("data-orig-tabindex"),!o.hasAttribute("autoFocus")&&e||(e=o)):(o.dataset.origTabindex=void 0===o.dataset.origTabindex?o.getAttribute("tabindex")||void 0:o.dataset.origTabindex,o.tabIndex=-1)}let i=null;n?(!r||t.indexOf(r)<0)&&(i=e||l,t.length&&(a===k?i=t[0]:this.lastFocus!==l&&a!==R||(i=t[t.length-1]))):i=(!c||"image"!==c.type)&&e||l,i&&at(i),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}}}}next(){const t=this.carousel;t&&1{t.target===e&&e.dataset.animationName&&(e.removeEventListener("animationend",s),delete e.dataset.animationName,n&&n(),b(e,i))};e.dataset.animationName=i,e.addEventListener("animationend",s),v(e,i)}else n&&n()}stop(t){t&&t.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:t}))}setContent(e,i="",n=!0){if(!this.isClosing()){const s=e.el;if(s){let t=null;if(l(i)?t=i:(t=d(i+""),l(t)||((t=document.createElement("div")).innerHTML=i+"")),["img","picture","iframe","video","audio"].includes(t.nodeName.toLowerCase())){const e=document.createElement("div");e.appendChild(t),t=e}(t=l(t)&&e.filter&&!e.error?t.querySelector(e.filter):t)&&l(t)?(v(t,"fancybox__content"),e.id&&t.setAttribute("id",e.id),"none"!==t.style.display&&"none"!==getComputedStyle(t).getPropertyValue("display")||(t.style.display=e.display||this.option("defaultDisplay")||"flex"),s.classList.add("has-"+(e.error?"error":e.type||"unknown")),s.prepend(t),e.contentEl=t,n&&this.revealContent(e),this.manageCloseBtn(e),this.manageCaption(e)):this.setError(e,"{{ELEMENT_NOT_FOUND}}")}}}revealContent(t,e){var i=t.el,n=t.contentEl;i&&n&&(this.emit("reveal",t),this.hideLoading(t),t.state=M.Opening,(e=this.isOpeningSlide(t)?void 0===e?this.optionFor(t,"showClass"):e:"f-fadeIn")?this.animate(n,e,()=>{this.done(t)}):this.done(t))}done(t){this.isClosing()||(t.state=M.Ready,this.emit("done",t),v(t.el,"is-done"),this.isCurrentSlide(t)&&this.option("autoFocus")&&queueMicrotask(()=>{this.option("autoFocus")&&(this.option("autoFocus")?this.focus():this.checkFocus())}),this.isOpeningSlide(t)&&!this.isCompact&&this.option("idle")&&this.setIdle())}isCurrentSlide(t){var e=this.getSlide();return!(!t||!e)&&e.index===t.index}isOpeningSlide(t){var e;return null===(null==(e=this.carousel)?void 0:e.prevPage)&&t.index===(null==(e=this.getSlide())?void 0:e.index)}showLoading(e){e.state=M.Loading;const i=e.el;i&&(v(i,Ot),this.emit("loading",e),e.spinnerEl||setTimeout(()=>{var t;this.isClosing()||e.spinnerEl||e.state!==M.Loading||(t=d(m),e.spinnerEl=t,i.prepend(t),this.animate(t,"f-fadeIn"))},250))}hideLoading(t){var e=t.el;if(e){const i=t.spinnerEl;this.isClosing()?null!=i&&i.remove():(b(e,Ot),i&&this.animate(i,"f-fadeOut",()=>{i.remove()}),t.state===M.Loading&&(this.emit("loaded",t),t.state=M.Ready))}}setError(t,e){if(!this.isClosing()){this.emit("error"),t.error=e,this.hideLoading(t),this.clearContent(t);const i=document.createElement("div");i.classList.add("fancybox-error"),i.innerHTML=this.localize(e||"

{{ERROR}}

"),this.setContent(t,i)}}clearContent(t){null!=(e=this.carousel)&&e.emit("removeSlide",t),t.contentEl&&(t.contentEl.remove(),t.contentEl=void 0),t.closeBtnEl&&(t.closeBtnEl.remove(),t.closeBtnEl=void 0);var e=t.el;e&&(b(e,Ot),b(e,"has-error"),b(e,"has-unknown"),b(e,"has-"+(t.type||"unknown")))}getSlide(){var t=this.carousel;return(null==(t=null==t?void 0:t.pages[null==t?void 0:t.page])?void 0:t.slides[0])||void 0}close(t,e){if(!this.isClosing()){var i=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",i,t),!i.defaultPrevented){t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());const n=this.fsAPI,s=()=>{this.proceedClose(t,e)};n&&n.isFullscreen()?Promise.resolve(n.exit()).then(()=>s()):s()}}}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(t=!1){var e=()=>{this.clearIdle(),this.idle=!0,v(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(t)e();else{const t=this.option("idle");t&&(this.idleTimer=setTimeout(e,t))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,b(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){const t=this.fsAPI;t&&(t.isFullscreen()?t.exit():this.container&&t.request(this.container))}isClosing(){return[C.Closing,C.CustomClosing,C.Destroy].includes(this.state)}proceedClose(t,e){var i;this.state=C.Closing,this.clearIdle(),this.detachEvents();const n=this.container,s=this.carousel,o=this.getSlide(),a=o&&this.option("placeFocusBack")?o.triggerEl||this.option("trigger"):null;if(a&&(nt(a)?at(a):a.focus()),n&&(v(n,"is-closing"),n.setAttribute("aria-hidden","true"),this.option("animated")&&v(n,Tt),n.style.pointerEvents="none"),s){s.clearTransitions(),null!=(i=s.panzoom)&&i.destroy(),null!=(i=s.plugins.Navigation)&&i.detach();for(const t of s.slides){t.state=M.Closing,this.hideLoading(t);const e=t.contentEl,i=(e&&this.stop(e),null==t?void 0:t.panzoom);i&&(i.stop(),i.detachEvents(),i.detachObserver()),this.isCurrentSlide(t)||s.emit("removeSlide",t)}}this.emit("close",t),this.state!==C.CustomClosing?(e=void 0===e&&o?this.optionFor(o,"hideClass"):e)&&o?(this.animate(o.contentEl,e,()=>{s&&s.emit("removeSlide",o)}),setTimeout(()=>{this.destroy()},500)):this.destroy():setTimeout(()=>{this.destroy()},500)}destroy(){var t;if(this.state!==C.Destroy){this.state=C.Destroy,null!=(t=this.carousel)&&t.destroy();const e=this.container,i=(e&&e.remove(),I.delete(this.id),D.getInstance());if(i)i.focus();else{if(R&&(R.remove(),R=null),k&&(k.remove(),k=null),b(document.documentElement,St),O){const n=document,s=n.body;s.classList.remove(Pt),s.style.setProperty(Mt,""),n.documentElement.style.setProperty(Ct,"")}this.emit("destroy")}}}static bind(n,s,o){if(O){let t,e="",i={};if(void 0===n?t=document.body:"string"==typeof n?(t=document.body,e=n,"object"==typeof s&&(i=s||{})):(t=n,"string"==typeof s&&(e=s),"object"==typeof o&&(i=o||{})),t&&l(t)){e=e||"[data-fancybox]";const a=D.openers.get(t)||new Map;a.set(e,i),D.openers.set(t,a),1===a.size&&t.addEventListener("click",D.fromEvent)}}}static unbind(t,e){let i,n="";if("string"==typeof t?(i=document.body,n=t):(i=t,"string"==typeof e&&(n=e)),i){const s=D.openers.get(i);s&&n&&s.delete(n),n&&s||(D.openers.delete(i),i.removeEventListener("click",D.fromEvent))}}static destroy(){let t;for(;t=D.getInstance();)t.destroy();for(const t of D.openers.keys())t.removeEventListener("click",D.fromEvent);D.openers=new Map}static fromEvent(i){if(!i.defaultPrevented&&!(i.button&&0!==i.button||i.ctrlKey||i.metaKey||i.shiftKey)){let l=i.composedPath()[0];var n=l.closest("[data-fancybox-trigger]");if(n){const i=n.dataset.fancyboxTrigger||"",t=document.querySelectorAll(`[data-fancybox="${i}"]`),e=parseInt(n.dataset.fancyboxIndex||"",10)||0;l=t[e]||l}if(l&&l instanceof Element){let s,o,a,r;if([...D.openers].reverse().find(([n,t])=>!(!n.contains(l)||![...t].reverse().find(([t,e])=>{var i=l.closest(t);return!!i&&(s=n,o=t,a=i,r=e,!0)}))),s&&o&&a){r=r||{},i.preventDefault(),l=a;let t=[],e=u({},rt,r);e.event=i,e.trigger=l,e.delegate=n;const c=e.groupAll,h=e.groupAttr,d=h&&l?l.getAttribute(""+h):"";if(l&&!d&&!c||(t=[].slice.call(s.querySelectorAll(o))),(t=l&&!c?d?t.filter(t=>t.getAttribute(""+h)===d):[l]:t).length)return(i=D.getInstance())&&i.options.trigger&&-1!t.isClosing()&&t)||null}static getSlide(){var t;return(null==(t=D.getInstance())?void 0:t.getSlide())||null}static show(t=[],e={}){return new D(t,e)}static next(){const t=D.getInstance();t&&t.next()}static prev(){const t=D.getInstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of I.values())t.close(...e);else{const t=D.getInstance();t&&t.close(...e)}}}Object.defineProperty(D,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.17"}),Object.defineProperty(D,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:rt}),Object.defineProperty(D,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:Et}),Object.defineProperty(D,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),F.Carousel=T,F.Fancybox=D,F.Panzoom=c});