// @fancyapps/ui/fancybox v4.0.12 !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(t){"use strict";function e(t,e){var i=object.keys(t);if(object.getownpropertysymbols){var n=object.getownpropertysymbols(t);e&&(n=n.filter((function(e){return object.getownpropertydescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function i(t){for(var i=1;it.length)&&(e=t.length);for(var i=0,n=new array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new typeerror("invalid attempt to iterate non-iterable instance.\nin order to be iterable, non-array objects must have a [symbol.iterator]() method.")}var a,s=!0,r=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){r=!0,a=t},f:function(){try{s||null==i.return||i.return()}finally{if(r)throw a}}}}var b=function(t){return"object"===n(t)&&null!==t&&t.constructor===object&&"[object object]"===object.prototype.tostring.call(t)},x=function t(){for(var e=!1,i=arguments.length,o=new array(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:1e4;return t=parsefloat(t)||0,math.round((t+number.epsilon)*e)/e},k="undefined"!=typeof window&&window.resizeobserver||function(){function t(e){o(this,t),this.observables=[],this.boundcheck=this.check.bind(this),this.boundcheck(),this.callback=e}return s(t,[{key:"observe",value:function(t){if(!this.observables.some((function(e){return e.el===t}))){var e={el:t,size:{height:t.clientheight,width:t.clientwidth}};this.observables.push(e)}}},{key:"unobserve",value:function(t){this.observables=this.observables.filter((function(e){return e.el!==t}))}},{key:"disconnect",value:function(){this.observables=[]}},{key:"check",value:function(){var t=this.observables.filter((function(t){var e=t.el.clientheight,i=t.el.clientwidth;if(t.size.height!==e||t.size.width!==i)return t.size.height=e,t.size.width=i,!0})).map((function(t){return t.el}));t.length>0&&this.callback(t),window.requestanimationframe(this.boundcheck)}}]),t}(),s=function(){var t=window.getselection?window.getselection():document.selection;t&&t.rangecount&&t.getrangeat(0).getclientrects().length&&(t.removeallranges?t.removeallranges():t.empty&&t.empty())},c=function t(e){o(this,t),this.id=-1,this.id=e.pointerid||e.identifier||-1,this.pagex=e.pagex,this.pagey=e.pagey,this.clientx=e.clientx,this.clienty=e.clienty,this.nativepointer=e};function $(t,e){return e?math.sqrt(math.pow(e.clientx-t.clientx,2)+math.pow(e.clienty-t.clienty,2)):0}function e(t,e){return e?{clientx:(t.clientx+e.clientx)/2,clienty:(t.clienty+e.clienty)/2}:t}var p=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.start,s=void 0===a?function(){return!0}:a,r=n.move,l=void 0===r?function(){}:r,c=n.end,h=void 0===c?function(){}:c;o(this,t),this.element=e,this.startpointers=[],this.currentpointers=[],this.startcallback=s,this.movecallback=l,this.endcallback=h,this.onstart=function(t){if(!t.button||0===t.button){var e=new c(t);if(!1===i.startcallback(e,t))return!1;t.preventdefault(),s(),i.currentpointers.push(e),i.startpointers.push(e),(t.target&&"setpointercapture"in t.target?t.target:i.element).setpointercapture(t.pointerid),i.element.addeventlistener("pointermove",i.onmove),i.element.addeventlistener("pointerup",i.onend),i.element.addeventlistener("pointercancel",i.onend)}},this.onmove=function(t){for(var e=i.currentpointers.slice(),n=[],o=function(){var t=s[a],e=i.currentpointers.findindex((function(e){return e.id===t.id}));if(e<0)return"continue";n.push(t),i.currentpointers[e]=t},a=0,s=[new c(t)];a1,o=("scroll"===i||"auto"===i)&&math.abs(t.scrollwidth-t.clientwidth)>1;return n||o}(e)?e:t(e.parentnode))},l=function(t,e){return t.split(".").reduce((function(t,e){return t&&t[e]}),e)},a=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.options=x(!0,{},e),this.plugins=[],this.events={};for(var i=0,n=["on","once"];i2?o-2:0),s=2;s1&&void 0!==arguments[1]?arguments[1]:[];return t=(t=string(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,(function(t,n,o){var a="";o?a=e.option("".concat(n[0]+n.tolowercase().substring(1),".l10n.").concat(o)):n&&(a=e.option("l10n.".concat(n))),a||(a=t);for(var s=0;s1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:{};o(this,n),(i=e.call(this,x(!0,{},o,a))).state="init",i.$container=t;for(var s=0,r=["onload","onwheel","onclick"];s1||math.abs(e.left-this.dragstart.rect.left)>1))return t.preventdefault(),void t.stoppropagation();!1!==this.trigger("click",t)&&this.option("zoom")&&"togglezoom"===this.option("click")&&(t.preventdefault(),t.stoppropagation(),this.zoomwithclick(t))}}},{key:"onwheel",value:function(t){!1!==this.trigger("wheel",t)&&this.option("zoom")&&this.option("wheel")&&this.zoomwithwheel(t)}},{key:"zoomwithwheel",value:function(t){void 0===this.changeddelta&&(this.changeddelta=0);var e=math.max(-1,math.min(1,-t.deltay||-t.deltax||t.wheeldelta||-t.detail)),i=this.content.scale,n=i*(100+e*this.option("wheelfactor"))/100;if(e<0&&math.abs(i-this.option("minscale"))<.01||e>0&&math.abs(i-this.option("maxscale"))<.01?(this.changeddelta+=math.abs(e),n=i):(this.changeddelta=0,n=math.max(math.min(n,this.option("maxscale")),this.option("minscale"))),!(this.changeddelta>this.option("wheellimit"))&&(t.preventdefault(),n!==i)){var o=this.$content.getboundingclientrect(),a=t.clientx-o.left,s=t.clienty-o.top;this.zoomto(n,{x:a,y:s})}}},{key:"zoomwithclick",value:function(t){var e=this.$content.getclientrects()[0],i=t.clientx-e.left,n=t.clienty-e.top;this.togglezoom({x:i,y:n})}},{key:"attachevents",value:function(){var t=this;this.$content.addeventlistener("load",this.onload),this.$container.addeventlistener("wheel",this.onwheel,{passive:!1}),this.$container.addeventlistener("click",this.onclick,{passive:!1}),this.initobserver();var e=new p(this.$container,{start:function(i,n){if(!t.option("touch"))return!1;if(!(t.velocity.scale<0)){if(!e.currentpointers.length){if(-1!==["button","textarea","option","input","select","video"].indexof(n.target.nodename))return!1;if(t.option("textselection")&&function(t,e,i){for(var n=t.childnodes,o=document.createrange(),a=0;a=r.left&&i>=r.top&&e<=r.right&&i<=r.bottom)return s}}return!1}(n.target,n.clientx,n.clienty))return!1;if(t(n.target))return!1}return!1!==t.trigger("touchstart",n)&&(t.state="pointerdown",t.resetdragposition(),t.dragposition.midpoint=null,t.dragposition.time=date.now(),!0)}},move:function(i,n,o){if("pointerdown"===t.state)if(0!=t.trigger("touchmove",o)){if(!(n.length<2&&1==t.option("panonlyzoomed")&&t.content.width<=t.viewport.width&&t.content.height<=t.viewport.height&&t.transform.scale<=t.option("basescale"))&&(!(n.length>1)||t.option("zoom")&&!1!==t.option("pinchtozoom"))){o.preventdefault(),o.stoppropagation();var a=e(i[0],i[1]),s=e(n[0],n[1]),r=s.clientx-a.clientx,l=s.clienty-a.clienty,c=$(i[0],i[1]),h=$(n[0],n[1]),d=c?h/c:1;t.dragoffset.x+=r,t.dragoffset.y+=l,t.dragoffset.scale*=d,t.dragoffset.time=date.now()-t.dragposition.time;var u=1===t.dragstart.scale&&t.option("lockaxis");if(u&&!t.lockaxis){if(math.abs(t.dragoffset.x)<6&&math.abs(t.dragoffset.y)<6)return;if("xy"===u){var f=math.abs(180*math.atan2(t.dragoffset.y,t.dragoffset.x)/math.pi);t.lockaxis=f>45&&f<135?"y":"x"}else t.lockaxis=u}if(t.lockaxis&&(t.dragoffset["x"===t.lockaxis?"y":"x"]=0),t.$container.classlist.add(t.option("draggingclass")),t.transform.scale===t.option("basescale")&&"y"===t.lockaxis||(t.dragposition.x=t.dragstart.x+t.dragoffset.x),t.transform.scale===t.option("basescale")&&"x"===t.lockaxis||(t.dragposition.y=t.dragstart.y+t.dragoffset.y),t.dragposition.scale=t.dragstart.scale*t.dragoffset.scale,n.length>1){var v=e(e.startpointers[0],e.startpointers[1]),p=v.clientx-t.dragstart.rect.x,g=v.clienty-t.dragstart.rect.y,m=t.getzoomdelta(t.content.scale*t.dragoffset.scale,p,g),y=m.deltax,b=m.deltay;t.dragposition.x-=y,t.dragposition.y-=b,t.dragposition.midpoint=s}else t.setdragresistance();t.transform={x:t.dragposition.x,y:t.dragposition.y,scale:t.dragposition.scale},t.startanimation()}}else o.preventdefault()},end:function(n,o){if("pointerdown"===t.state)if(t._dragoffset=i({},t.dragoffset),e.currentpointers.length)t.resetdragposition();else if(t.state="decel",t.friction=t.option("decelfriction"),t.recalculatetransform(),t.$container.classlist.remove(t.option("draggingclass")),!1!==t.trigger("touchend",o)&&"decel"===t.state){var a=t.option("minscale");if(t.transform.scale.01){var r=t.dragposition.midpoint||n,l=t.$content.getclientrects()[0];t.zoomto(s,{friction:.64,x:r.clientx-l.left,y:r.clienty-l.top})}else;}}}});this.pointertracker=e}},{key:"initobserver",value:function(){var t=this;this.resizeobserver||(this.resizeobserver=new k((function(){t.updatetimer||(t.updatetimer=settimeout((function(){var e=t.$container.getboundingclientrect();e.width&&e.height?((math.abs(e.width-t.container.width)>1||math.abs(e.height-t.container.height)>1)&&(t.isanimating()&&t.endanimation(!0),t.updatemetrics(),t.panto({x:t.content.x,y:t.content.y,scale:t.option("basescale"),friction:0})),t.updatetimer=null):t.updatetimer=null}),t.updaterate))})),this.resizeobserver.observe(this.$container))}},{key:"resetdragposition",value:function(){this.lockaxis=null,this.friction=this.option("friction"),this.velocity={x:0,y:0,scale:0};var t=this.content,e=t.x,n=t.y,o=t.scale;this.dragstart={rect:this.$content.getboundingclientrect(),x:e,y:n,scale:o},this.dragposition=i(i({},this.dragposition),{},{x:e,y:n,scale:o}),this.dragoffset={x:0,y:0,scale:1,time:0}}},{key:"updatemetrics",value:function(t){!0!==t&&this.trigger("beforeupdate");var e,n=this.$container,o=this.$content,a=this.$viewport,s=o instanceof htmlimageelement,r=this.option("zoom"),l=this.option("resizeparent",r),c=this.option("width"),h=this.option("height"),d=c||(e=o,math.max(parsefloat(e.naturalwidth||0),parsefloat(e.width&&e.width.baseval&&e.width.baseval.value||0),parsefloat(e.offsetwidth||0),parsefloat(e.scrollwidth||0))),u=h||function(t){return math.max(parsefloat(t.naturalheight||0),parsefloat(t.height&&t.height.baseval&&t.height.baseval.value||0),parsefloat(t.offsetheight||0),parsefloat(t.scrollheight||0))}(o);object.assign(o.style,{width:c?"".concat(c,"px"):"",height:h?"".concat(h,"px"):"",maxwidth:"",maxheight:""}),l&&object.assign(a.style,{width:"",height:""});var f=this.option("ratio");c=d=w(d*f),h=u=w(u*f);var v=o.getboundingclientrect(),p=a.getboundingclientrect(),g=a==n?p:n.getboundingclientrect(),m=math.max(a.offsetwidth,w(p.width)),y=math.max(a.offsetheight,w(p.height)),b=window.getcomputedstyle(a);if(m-=parsefloat(b.paddingleft)+parsefloat(b.paddingright),y-=parsefloat(b.paddingtop)+parsefloat(b.paddingbottom),this.viewport.width=m,this.viewport.height=y,r){if(math.abs(d-v.width)>.1||math.abs(u-v.height)>.1){var x=function(t,e,i,n){var o=math.min(i/t||0,n/e);return{width:t*o||0,height:e*o||0}}(d,u,math.min(d,v.width),math.min(u,v.height));c=w(x.width),h=w(x.height)}object.assign(o.style,{width:"".concat(c,"px"),height:"".concat(h,"px"),transform:""})}if(l&&(object.assign(a.style,{width:"".concat(c,"px"),height:"".concat(h,"px")}),this.viewport=i(i({},this.viewport),{},{width:c,height:h})),s&&r&&"function"!=typeof this.options.maxscale){var k=this.option("maxscale");this.options.maxscale=function(){return this.content.origwidth>0&&this.content.fitwidth>0?this.content.origwidth/this.content.fitwidth:k}}this.content=i(i({},this.content),{},{origwidth:d,origheight:u,fitwidth:c,fitheight:h,width:c,height:h,scale:1,iszoomable:r}),this.container={width:g.width,height:g.height},!0!==t&&this.trigger("afterupdate")}},{key:"zoomin",value:function(t){this.zoomto(this.content.scale+(t||this.option("step")))}},{key:"zoomout",value:function(t){this.zoomto(this.content.scale-(t||this.option("step")))}},{key:"togglezoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.option("maxscale"),i=this.option("basescale"),n=this.content.scale>i+.5*(e-i)?i:e;this.zoomto(n,t)}},{key:"zoomto",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.option("basescale"),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.x,n=void 0===i?null:i,o=e.y,a=void 0===o?null:o;t=math.max(math.min(t,this.option("maxscale")),this.option("minscale"));var s=w(this.content.scale/(this.content.width/this.content.fitwidth),1e7);null===n&&(n=this.content.width*s*.5),null===a&&(a=this.content.height*s*.5);var r=this.getzoomdelta(t,n,a),l=r.deltax,c=r.deltay;n=this.content.x-l,a=this.content.y-c,this.panto({x:n,y:a,scale:t,friction:this.option("zoomfriction")})}},{key:"getzoomdelta",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.content.fitwidth*this.content.scale,o=this.content.fitheight*this.content.scale,a=e>0&&n?e/n:0,s=i>0&&o?i/o:0,r=this.content.fitwidth*t,l=this.content.fitheight*t,c=(r-n)*a,h=(l-o)*s;return{deltax:c,deltay:h}}},{key:"panto",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,n=void 0===e?this.content.x:e,o=t.y,a=void 0===o?this.content.y:o,s=t.scale,r=t.friction,l=void 0===r?this.option("friction"):r,c=t.ignorebounds,h=void 0!==c&&c;if(s=s||this.content.scale||1,!h){var d=this.getbounds(s),u=d.boundx,f=d.boundy;u&&(n=math.max(math.min(n,u.to),u.from)),f&&(a=math.max(math.min(a,f.to),f.from))}this.friction=l,this.transform=i(i({},this.transform),{},{x:n,y:a,scale:s}),l?(this.state="panning",this.velocity={x:(1/this.friction-1)*(n-this.content.x),y:(1/this.friction-1)*(a-this.content.y),scale:(1/this.friction-1)*(s-this.content.scale)},this.startanimation()):this.endanimation()}},{key:"startanimation",value:function(){var t=this;this.raf?cancelanimationframe(this.raf):this.trigger("startanimation"),this.raf=requestanimationframe((function(){return t.animate()}))}},{key:"animate",value:function(){var t=this;if(this.setedgeforce(),this.setdragforce(),this.velocity.x*=this.friction,this.velocity.y*=this.friction,this.velocity.scale*=this.friction,this.content.x+=this.velocity.x,this.content.y+=this.velocity.y,this.content.scale+=this.velocity.scale,this.isanimating())this.settransform();else if("pointerdown"!==this.state)return void this.endanimation();this.raf=requestanimationframe((function(){return t.animate()}))}},{key:"getbounds",value:function(t){var e=this.boundx,i=this.boundy;if(void 0!==e&&void 0!==i)return{boundx:e,boundy:i};e={from:0,to:0},i={from:0,to:0},t=t||this.transform.scale;var n=this.content.fitwidth,o=this.content.fitheight,a=n*t,s=o*t,r=this.viewport.width,l=this.viewport.height;if(n<=r){var c=.5*(r-a),h=.5*(a-n);e.from=w(c-h),e.to=w(c+h)}else e.from=w(r-a);if(o<=l){var d=.5*(l-s),u=.5*(s-o);i.from=w(d-u),i.to=w(d+u)}else i.from=w(l-a);return{boundx:e,boundy:i}}},{key:"setedgeforce",value:function(){if("decel"===this.state){var t,e,i,n,o=this.option("bounceforce"),a=this.getbounds(math.max(this.transform.scale,this.content.scale)),s=a.boundx,r=a.boundy;if(s&&(t=this.content.xs.to),r&&(i=this.content.yr.to),t||e){var l=((t?s.from:s.to)-this.content.x)*o,c=this.content.x+(this.velocity.x+l)/this.friction;c>=s.from&&c<=s.to&&(l+=this.velocity.x),this.velocity.x=l,this.recalculatetransform()}if(i||n){var h=((i?r.from:r.to)-this.content.y)*o,d=this.content.y+(h+this.velocity.y)/this.friction;d>=r.from&&d<=r.to&&(h+=this.velocity.y),this.velocity.y=h,this.recalculatetransform()}}}},{key:"setdragresistance",value:function(){if("pointerdown"===this.state){var t,e,i,n,o=this.getbounds(this.dragposition.scale),a=o.boundx,s=o.boundy;if(a&&(t=this.dragposition.xa.to),s&&(i=this.dragposition.ys.to),(t||e)&&(!t||!e)){var r=t?a.from:a.to,l=r-this.dragposition.x;this.dragposition.x=r-.3*l}if((i||n)&&(!i||!n)){var c=i?s.from:s.to,h=c-this.dragposition.y;this.dragposition.y=c-.3*h}}}},{key:"setdragforce",value:function(){"pointerdown"===this.state&&(this.velocity.x=this.dragposition.x-this.content.x,this.velocity.y=this.dragposition.y-this.content.y,this.velocity.scale=this.dragposition.scale-this.content.scale)}},{key:"recalculatetransform",value:function(){this.transform.x=this.content.x+this.velocity.x/(1/this.friction-1),this.transform.y=this.content.y+this.velocity.y/(1/this.friction-1),this.transform.scale=this.content.scale+this.velocity.scale/(1/this.friction-1)}},{key:"isanimating",value:function(){return!(!this.friction||!(math.abs(this.velocity.x)>.05||math.abs(this.velocity.y)>.05||math.abs(this.velocity.scale)>.05))}},{key:"settransform",value:function(t){var e,n,o,a,s;(t?(e=w(this.transform.x),n=w(this.transform.y),o=this.transform.scale,this.content=i(i({},this.content),{},{x:e,y:n,scale:o})):(e=w(this.content.x),n=w(this.content.y),o=this.content.scale/(this.content.width/this.content.fitwidth),this.content=i(i({},this.content),{},{x:e,y:n})),this.trigger("beforetransform"),e=w(this.content.x),n=w(this.content.y),t&&this.option("zoom"))?(a=w(this.content.fitwidth*o),s=w(this.content.fitheight*o),this.content.width=a,this.content.height=s,this.transform=i(i({},this.transform),{},{width:a,height:s,scale:o}),object.assign(this.$content.style,{width:"".concat(a,"px"),height:"".concat(s,"px"),maxwidth:"none",maxheight:"none",transform:"translate3d(".concat(e,"px, ").concat(n,"px, 0) scale(1)")})):this.$content.style.transform="translate3d(".concat(e,"px, ").concat(n,"px, 0) scale(").concat(o,")");this.trigger("aftertransform")}},{key:"endanimation",value:function(t){cancelanimationframe(this.raf),this.raf=null,this.velocity={x:0,y:0,scale:0},this.settransform(!0),this.state="ready",this.handlecursor(),!0!==t&&this.trigger("endanimation")}},{key:"handlecursor",value:function(){var t=this.option("draggableclass");t&&this.option("touch")&&(1==this.option("panonlyzoomed")&&this.content.width<=this.viewport.width&&this.content.height<=this.viewport.height&&this.transform.scale<=this.option("basescale")?this.$container.classlist.remove(t):this.$container.classlist.add(t))}},{key:"detachevents",value:function(){this.$content.removeeventlistener("load",this.onload),this.$container.removeeventlistener("wheel",this.onwheel,{passive:!1}),this.$container.removeeventlistener("click",this.onclick,{passive:!1}),this.pointertracker&&(this.pointertracker.stop(),this.pointertracker=null),this.resizeobserver&&(this.resizeobserver.disconnect(),this.resizeobserver=null)}},{key:"destroy",value:function(){"destroy"!==this.state&&(this.state="destroy",cleartimeout(this.updatetimer),this.updatetimer=null,cancelanimationframe(this.raf),this.raf=null,this.detachevents(),this.detachplugins(),this.resetdragposition())}}]),n}(a);z.version="4.0.12",z.plugins={};var _=function(t,e){var i=0;return function(){var n=(new date).gettime();if(!(n-i1&&this.carousel.elemdimwidth=t-1&&this.$next.setattribute("disabled","")))}},{key:"cleanup",value:function(){this.$prev&&this.$prev.remove(),this.$prev=null,this.$next&&this.$next.remove(),this.$next=null,this.$container&&this.$container.remove(),this.$container=null}},{key:"attach",value:function(){this.carousel.on("refresh change",this.onrefresh)}},{key:"detach",value:function(){this.carousel.off("refresh change",this.onrefresh),this.cleanup()}}]),t}();m.defaults={prevtpl:'',nexttpl:'',classnames:{main:"carousel__nav",button:"carousel__button",next:"is-next",prev:"is-prev"}};var i=function(){function t(e){o(this,t),this.carousel=e,this.$list=null,this.events={change:this.onchange.bind(this),refresh:this.onrefresh.bind(this)}}return s(t,[{key:"buildlist",value:function(){var t=this;if(!(this.carousel.pages.lengthn)for(var a=n;a1&&void 0!==arguments[1]?arguments[1]:{};if(o(this,n),a=x(!0,{},n,a),(i=e.call(this,a)).state="init",i.$container=t,!(i.$container instanceof htmlelement))throw new error("no root element provided");return i.slidenext=_(i.slidenext.bind(d(i)),250),i.slideprev=_(i.slideprev.bind(d(i)),250),i.init(),i}return s(n,[{key:"init",value:function(){this.pages=[],this.page=this.pageindex=null,this.prevpage=this.prevpageindex=null,this.attachplugins(n.plugins),this.trigger("init"),this.initlayout(),this.initslides(),this.updatemetrics(),this.$track&&this.pages.length&&(this.$track.style.transform="translate3d(".concat(-1*this.pages[this.page].left,"px, 0px, 0) scale(1)")),this.manageslidevisiblity(),this.initpanzoom(),this.state="ready",this.trigger("ready")}},{key:"initlayout",value:function(){var t,e,i=this.option("prefix"),n=this.option("classnames");(this.$viewport=this.option("viewport")||this.$container.queryselector(".".concat(i).concat(n.viewport)),this.$viewport)||(this.$viewport=document.createelement("div"),this.$viewport.classlist.add(i+n.viewport),(t=this.$viewport).append.apply(t,p(this.$container.childnodes)),this.$container.appendchild(this.$viewport));(this.$track=this.option("track")||this.$container.queryselector(".".concat(i).concat(n.track)),this.$track)||(this.$track=document.createelement("div"),this.$track.classlist.add(i+n.track),(e=this.$track).append.apply(e,p(this.$viewport.childnodes)),this.$viewport.appendchild(this.$track))}},{key:"initslides",value:function(){var t=this;this.slides=[],this.$viewport.queryselectorall(".".concat(this.option("prefix")).concat(this.option("classnames.slide"))).foreach((function(e){var i={$el:e,isdom:!0};t.slides.push(i),t.trigger("createslide",i,t.slides.length)})),array.isarray(this.options.slides)&&(this.slides=x(!0,p(this.slides),this.options.slides))}},{key:"updatemetrics",value:function(){var t,e=this,n=0,o=[];this.slides.foreach((function(i,a){var s=i.$el,r=i.isdom||!t?e.getslidemetrics(s):t;i.index=a,i.width=r,i.left=n,t=r,n+=r,o.push(a)}));var a=math.max(this.$track.offsetwidth,w(this.$track.getboundingclientrect().width)),s=getcomputedstyle(this.$track);a-=parsefloat(s.paddingleft)+parsefloat(s.paddingright),this.contentwidth=n,this.viewportwidth=a;var r=[],l=this.option("slidesperpage");if(number.isinteger(l)&&n>a)for(var c=0;ca)&&(r.push({indexes:[],slides:[]}),h=r.length-1,d=0),d+=f.width,r[h].indexes.push(u),r[h].slides.push(f)}var v=this.option("center"),g=this.option("fill");r.foreach((function(t,i){t.index=i,t.width=t.slides.reduce((function(t,e){return t+e.width}),0),t.left=t.slides[0].left,v&&(t.left+=.5*(a-t.width)*-1),g&&!e.option("infinitex",e.option("infinite"))&&n>a&&(t.left=math.max(t.left,0),t.left=math.min(t.left,n-a))}));var m,y=[];r.foreach((function(t){var e=i({},t);m&&e.left===m.left?(m.width+=e.width,m.slides=[].concat(p(m.slides),p(e.slides)),m.indexes=[].concat(p(m.indexes),p(e.indexes))):(e.index=y.length,m=e,y.push(e))})),this.pages=y;var b=this.page;if(null===b){var x=this.option("initialslide");b=null!==x?this.findpageforslide(x):this.option("initialpage",0),y[b]||(b=y.length&&b>y.length?y[y.length-1].index:0),this.page=b,this.pageindex=b}this.updatepanzoom(),this.trigger("refresh")}},{key:"getslidemetrics",value:function(t){if(!t){var e,i=this.slides[0];if((t=document.createelement("div")).dataset.istestel=1,t.style.visibility="hidden",t.classlist.add(this.option("prefix")+this.option("classnames.slide")),i.customclass)(e=t.classlist).add.apply(e,p(i.customclass.split(" ")));this.$track.prepend(t)}var n=math.max(t.offsetwidth,w(t.getboundingclientrect().width)),o=t.currentstyle||window.getcomputedstyle(t);return n=n+(parsefloat(o.marginleft)||0)+(parsefloat(o.marginright)||0),t.dataset.istestel&&t.remove(),n}},{key:"findpageforslide",value:function(t){var e=this.pages.find((function(e){return e.indexes.indexof(t)>-1}));return e?e.index:null}},{key:"slidenext",value:function(){this.slideto(this.pageindex+1)}},{key:"slideprev",value:function(){this.slideto(this.pageindex-1)}},{key:"slideto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.x,n=void 0===i?-1*this.setpage(t,!0):i,o=e.y,a=void 0===o?0:o,s=e.friction,r=void 0===s?this.option("friction"):s;this.panzoom.content.x===n&&!this.panzoom.velocity.x&&r||(this.panzoom.panto({x:n,y:a,friction:r,ignorebounds:!0}),"ready"===this.state&&"ready"===this.panzoom.state&&this.trigger("settle"))}},{key:"initpanzoom",value:function(){var t=this;this.panzoom&&this.panzoom.destroy();var e=x(!0,{},{content:this.$track,wrapinner:!1,resizeparent:!1,zoom:!1,click:!1,lockaxis:"x",x:this.pages.length?-1*this.pages[this.page].left:0,centeronstart:!1,textselection:function(){return t.option("textselection",!1)},panonlyzoomed:function(){return this.content.width<=this.viewport.width}},this.option("panzoom"));this.panzoom=new z(this.$container,e),this.panzoom.on({"*":function(e){for(var i=arguments.length,n=new array(i>1?i-1:0),o=1;o1&&this.option("infinitex",this.option("infinite"))?this.panzoom.boundx=null:this.pages.length&&(this.panzoom.boundx={from:-1*this.pages[this.pages.length-1].left,to:-1*this.pages[0].left}),this.option("infinitey",this.option("infinite"))?this.panzoom.boundy=null:this.panzoom.boundy={from:0,to:0},this.panzoom.handlecursor())}},{key:"manageslidevisiblity",value:function(){var t=this,e=this.contentwidth,i=this.viewportwidth,n=this.panzoom?-1*this.panzoom.content.x:this.pages.length?this.pages[this.page].left:0,o=this.option("preload"),a=this.option("infinitex",this.option("infinite")),s=parsefloat(getcomputedstyle(this.$viewport,null).getpropertyvalue("padding-left")),r=parsefloat(getcomputedstyle(this.$viewport,null).getpropertyvalue("padding-right"));this.slides.foreach((function(l){var c,h,d=0;c=n-s,h=n+i+r,c-=o*(i+s+r),h+=o*(i+s+r);var u=l.left+l.width>c&&l.leftc&&l.leftc&&l.leftn&&l.left<=n+i+r&&(d=0)):t.removeslideel(l),l.hasdiff=d}));var l=0,c=0;this.slides.foreach((function(t,i){var n=0;t.$el?(i!==l||t.hasdiff?n=c+t.hasdiff*e:c=0,t.$el.style.left=math.abs(n)>.1?"".concat(c+t.hasdiff*e,"px"):"",l++):c+=t.width})),this.markselectedslides()}},{key:"createslideel",value:function(t){if(t){if(!t.$el){var e,i=document.createelement("div");if(i.dataset.index=t.index,i.classlist.add(this.option("prefix")+this.option("classnames.slide")),t.customclass)(e=i.classlist).add.apply(e,p(t.customclass.split(" ")));t.html&&(i.innerhtml=t.html);var n=[];this.slides.foreach((function(t,e){t.$el&&n.push(e)}));var o=t.index,a=null;if(n.length){var s=n.reduce((function(t,e){return math.abs(e-o)-1?(e&&!a.classlist.contains(e)&&(a.classlist.add(e),t.trigger("selectslide",n)),a.removeattribute(i)):(e&&a.classlist.contains(e)&&(a.classlist.remove(e),t.trigger("unselectslide",n)),a.setattribute(i,!0))}}))}},{key:"updatepage",value:function(){this.updatemetrics(),this.slideto(this.page,{friction:0})}},{key:"onbeforetransform",value:function(){this.option("infinitex",this.option("infinite"))&&this.manageinfinitetrack(),this.manageslidevisiblity()}},{key:"manageinfinitetrack",value:function(){var t=this.contentwidth,e=this.viewportwidth;if(!(!this.option("infinitex",this.option("infinite"))||this.pages.length<2||te&&(i.content.x-=t,this.pageindex=this.pageindex+this.pages.length,n=!0),n&&"pointerdown"===i.state&&i.resetdragposition(),n}}},{key:"ontouchend",value:function(t,e){var i=this.option("dragfree");if(!i&&this.pages.length>1&&t.dragoffset.time<350&&math.abs(t.dragoffset.y)<1&&math.abs(t.dragoffset.x)>5)this[t.dragoffset.x<0?"slidenext":"slideprev"]();else if(i){var n=v(this.getpagefromposition(-1*t.transform.x),2)[1];this.setpage(n)}else this.slidetoclosest()}},{key:"slidetoclosest",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getpagefromposition(-1*this.panzoom.content.x),i=v(e,2),n=i[1];this.slideto(n,t)}},{key:"getpagefromposition",value:function(t){var e=this.pages.length;this.option("center")&&(t+=.5*this.viewportwidth);var i=math.floor(t/this.contentwidth);t-=i*this.contentwidth;var n=this.slides.find((function(e){return e.left<=t&&e.left+e.width>t}));if(n){var o=this.findpageforslide(n.index);return[o,o+i*e]}return[0,0]}},{key:"setpage",value:function(t,e){var i=0,n=parseint(t,10)||0,o=this.page,a=this.pageindex,s=this.pages.length,r=this.contentwidth,l=this.viewportwidth;if(t=(n%s+s)%s,this.option("infinitex",this.option("infinite"))&&r>l){var c=math.floor(n/s)||0,h=r;if(i=this.pages[t].left+c*h,!0===e&&s>2){var d=-1*this.panzoom.content.x,u=i-h,f=i+h,v=math.abs(d-i),p=math.abs(d-u),g=math.abs(d-f);g.1&&(o="".concat(e.width*i,"px"),a="".concat(e.height*i,"px"),s="translate3d(".concat(e.offsetleft,"px, ").concat(e.offsettop,"px, 0) scale(").concat(1/i,")")),n.style.width=o,n.style.height=a,n.style.transform=s}}},{key:"ontouchstart",value:function(t){this.starty=t.touches?t.touches[0].screeny:t.screeny}},{key:"ontouchmove",value:function(t){var e=this.starty,i=window.innerwidth/window.document.documentelement.clientwidth;if(t.cancelable&&!(t.touches.length>1||1!==i)){var n=t.target,o=t(n);if(o){var a=window.getcomputedstyle(o),s=parseint(a.getpropertyvalue("height"),10),r=t.touches?t.touches[0].screeny:t.screeny,l=e<=r&&0===o.scrolltop,c=e>=r&&o.scrollheight-o.scrolltop===s;(l||c)&&t.preventdefault()}else t.preventdefault()}}},{key:"cleanup",value:function(){this.pendingupdate&&(cancelanimationframe(this.pendingupdate),this.pendingupdate=null);var t=this.viewport;t&&(t.removeeventlistener("resize",this.onresize),this.viewport=null),window.removeeventlistener("touchstart",this.ontouchstart,!1),window.removeeventlistener("touchmove",this.ontouchmove,!1)}},{key:"attach",value:function(){this.fancybox.on("initlayout",this.onready)}},{key:"detach",value:function(){this.fancybox.off("initlayout",this.onready),this.cleanup()}}]),t}(),q=function(){function t(e){o(this,t),this.fancybox=e,this.$container=null,this.state="init";for(var i=0,n=["onprepare","onclosing","onkeydown"];i=this.fancybox.option("thumbs.minscreenheight")&&this.build()}},{key:"onclosing",value:function(){this.carousel&&this.carousel.panzoom.detachevents()}},{key:"onkeydown",value:function(t,e){e===t.option("thumbs.key")&&this.toggle()}},{key:"build",value:function(){var t=this;if(!this.$container){var e=document.createelement("div");e.classlist.add("fancybox__thumbs"),this.fancybox.$carousel.parentnode.insertbefore(e,this.fancybox.$carousel.nextsibling),this.carousel=new d(e,x(!0,{dots:!1,navigation:!1,sync:{friction:0},infinite:!1,center:!0,fill:!0,dragfree:!0,slidesperpage:1,preload:1},this.fancybox.option("thumbs.carousel"),{sync:{target:this.fancybox.carousel},slides:this.getslides()})),this.carousel.panzoom.on("wheel",(function(e,i){i.preventdefault(),t.fancybox[i.deltay<0?"prev":"next"]()})),this.$container=e,this.state="visible"}}},{key:"getslides",value:function(){var t,e=[],i=y(this.fancybox.items);try{for(i.s();!(t=i.n()).done;){var n=t.value,o=n.thumb;o&&e.push({html:'
"),customclass:"has-thumb has-".concat(n.type||"image")})}}catch(t){i.e(t)}finally{i.f()}return e}},{key:"toggle",value:function(){"visible"===this.state?this.hide():"hidden"===this.state?this.show():this.build()}},{key:"show",value:function(){"hidden"===this.state&&(this.$container.style.display="",this.carousel.panzoom.attachevents(),this.state="visible")}},{key:"hide",value:function(){"visible"===this.state&&(this.carousel.panzoom.detachevents(),this.$container.style.display="none",this.state="hidden")}},{key:"cleanup",value:function(){this.carousel&&(this.carousel.destroy(),this.carousel=null),this.$container&&(this.$container.remove(),this.$container=null),this.state="init"}},{key:"attach",value:function(){this.fancybox.on(this.events)}},{key:"detach",value:function(){this.fancybox.off(this.events),this.cleanup()}}]),t}();q.defaults={minslidecount:2,minscreenheight:500,autostart:!0,key:"t",carousel:{}};var y=function(t){return object.entries(t).map((function(t){return t.map(encodeuricomponent).join("=")})).join("&")},u={video:{autoplay:!0,ratio:16/9},youtube:{autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},vimeo:{hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},html5video:{tpl:'',format:""}},v=function(){function t(e){o(this,t),this.fancybox=e;for(var i=0,n=["oninit","onready","oncreateslide","onremoveslide","onselectslide","onunselectslide","onrefresh","onmessage"];i0?"svembed":"embed"),i="map"):(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(t.src="//maps.google.".concat(n[1],"/maps?q=").concat(n[2].replace("query=","q=").replace("api=1",""),"&output=embed"),i="map");i||("#"===e.charat(0)?i="inline":(n=e.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(i="html5video",t.format=t.format||"video/"+("ogv"===n[1]?"ogg":n[1])):e.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?i="image":e.match(/\.(pdf)((\?|#).*)?$/i)&&(i="pdf")),t.type=i||this.fancybox.option("defaulttype","image"),"html5video"!==i&&"video"!==i||(t.video=x({},this.fancybox.option("html.video"),t.video),t._width&&t._height?t.ratio=parsefloat(t._width)/parsefloat(t._height):t.ratio=t.ratio||t.video.ratio||u.video.ratio)}}},{key:"onready",value:function(){var t=this;this.fancybox.carousel.slides.foreach((function(e){e.$el&&(t.setcontent(e),e.index===t.fancybox.getslide().index&&t.playvideo(e))}))}},{key:"oncreateslide",value:function(t,e,i){"ready"===this.fancybox.state&&this.setcontent(i)}},{key:"loadinlinecontent",value:function(t){var e;if(t.src instanceof htmlelement)e=t.src;else if("string"==typeof t.src){var i=t.src.split("#",2),n=2===i.length&&""===i[0]?i[1]:i[0];e=document.getelementbyid(n)}if(e){if("clone"===t.type||e.$placeholder){var o=(e=e.clonenode(!0)).getattribute("id");o=o?"".concat(o,"--clone"):"clone-".concat(this.fancybox.id,"-").concat(t.index),e.setattribute("id",o)}else{var a=document.createelement("div");a.classlist.add("fancybox-placeholder"),e.parentnode.insertbefore(a,e),e.$placeholder=a}this.fancybox.setcontent(t,e)}else this.fancybox.seterror(t,"{{element_not_found}}")}},{key:"loadajaxcontent",value:function(t){var e=this.fancybox,i=new xmlhttprequest;e.showloading(t),i.onreadystatechange=function(){i.readystate===xmlhttprequest.done&&"ready"===e.state&&(e.hideloading(t),200===i.status?e.setcontent(t,i.responsetext):e.seterror(t,404===i.status?"{{ajax_not_found}}":"{{ajax_forbidden}}"))},i.open("get",t.src),i.setrequestheader("x-requested-with","xmlhttprequest"),i.send(t.ajax||null),t.xhr=i}},{key:"loadiframecontent",value:function(t){var e=this,i=this.fancybox,n=document.createelement("iframe");if(n.classname="fancybox__iframe",n.setattribute("id","fancybox__iframe_".concat(i.id,"_").concat(t.index)),n.setattribute("allow","autoplay; fullscreen"),n.setattribute("scrolling","auto"),t.$iframe=n,"iframe"!==t.type||!1===t.preload)return n.setattribute("src",t.src),this.fancybox.setcontent(t,n),void this.resizeiframe(t);i.showloading(t);var o=document.createelement("div");o.style.visibility="hidden",this.fancybox.setcontent(t,o),o.appendchild(n),n.onerror=function(){i.seterror(t,"{{iframe_error}}")},n.onload=function(){i.hideloading(t);var o=!1;n.isready||(n.isready=!0,o=!0),n.src.length&&(n.parentnode.style.visibility="",e.resizeiframe(t),o&&i.revealcontent(t))},n.setattribute("src",t.src)}},{key:"setaspectratio",value:function(t){var e=t.$content,i=t.ratio;if(e){var n=t._width,o=t._height;if(i||n&&o){object.assign(e.style,{width:n&&o?"100%":"",height:n&&o?"100%":"",maxwidth:"",maxheight:""});var a=e.offsetwidth,s=e.offsetheight;if(o=o||s,(n=n||a)>a||o>s){var r=math.min(a/n,s/o);n*=r,o*=r}math.abs(n/o-i)>.01&&(i.1),{top:r,left:l,scale:a&&i?i/a:1,opacity:c}}},{key:"canzoom",value:function(t){var e=this.fancybox,i=e.$container;if(window.visualviewport&&1!==window.visualviewport.scale)return!1;if(t.panzoom&&!t.panzoom.content.width)return!1;if(!e.option("image.zoom")||"contain"!==e.option("image.fit"))return!1;var n=t.$thumb;if(!n||"loading"===t.state)return!1;i.classlist.add("fancybox__no-click");var o,a=n.getboundingclientrect();if(this.fancybox.option("image.ignorecoveredthumbnail")){var s=document.elementfrompoint(a.left+1,a.top+1)===n,r=document.elementfrompoint(a.right-1,a.bottom-1)===n;o=s&&r}else o=document.elementfrompoint(a.left+.5*a.width,a.top+.5*a.height)===n;return i.classlist.remove("fancybox__no-click"),o}},{key:"zoomin",value:function(){var t=this.fancybox,e=t.getslide(),i=e.panzoom,n=this.getzoominfo(e),o=n.top,a=n.left,s=n.scale,r=n.opacity;e.state="zoomin",t.trigger("reveal",e),i.panto({x:-1*a,y:-1*o,scale:s,friction:0,ignorebounds:!0}),e.$content.style.visibility="",!0===r&&i.on("aftertransform",(function(t){"zoomin"!==e.state&&"zoomout"!==e.state||(t.$content.style.opacity=math.min(1,1-(1-t.content.scale)/(1-s)))})),i.panto({x:0,y:0,scale:1,friction:this.fancybox.option("image.zoomfriction")})}},{key:"zoomout",value:function(){var t=this,e=this.fancybox,i=e.getslide(),n=i.panzoom;if(n){i.state="zoomout",e.state="customclosing",i.$caption&&(i.$caption.style.visibility="hidden");var o=this.fancybox.option("image.zoomfriction"),a=function(e){var a=t.getzoominfo(i),s=a.top,r=a.left,l=a.scale,c=a.opacity;e||c||(o*=.82),n.panto({x:-1*r,y:-1*s,scale:l,friction:o,ignorebounds:!0}),o*=.98};window.addeventlistener("scroll",a),n.once("endanimation",(function(){window.removeeventlistener("scroll",a),e.destroy()})),a()}}},{key:"handlecursor",value:function(t){if("image"===t.type&&t.$el){var e=t.panzoom,i=this.fancybox.option("image.click",!1,t),n=this.fancybox.option("image.touch"),o=t.$el.classlist,a=this.fancybox.option("image.canzoominclass"),s=this.fancybox.option("image.canzoomoutclass");if(e&&"togglezoom"===i)e&&1===e.content.scale&&e.option("maxscale")-e.content.scale>.01?(o.remove(s),o.add(a)):e.content.scale>1&&!n&&o.add(s);else"close"===i&&o.add(s)}}},{key:"onwheel",value:function(t,e){if("ready"===this.fancybox.state&&!1!==this.fancybox.trigger("image.wheel",e))switch(this.fancybox.option("image.wheel")){case"zoom":t.panzoom&&t.panzoom.zoomwithwheel(e);break;case"close":this.fancybox.close();break;case"slide":this.fancybox[e.deltay<0?"prev":"next"]()}}},{key:"onclick",value:function(t,e){var i=this;if("ready"===this.fancybox.state){var n=t.panzoom;if(!n||!n.dragposition.midpoint&&0===n.dragoffset.x&&0===n.dragoffset.y&&1===n.dragoffset.scale){if(this.fancybox.carousel.panzoom.lockaxis)return!1;var o=function(n){switch(n){case"togglezoom":e.stoppropagation(),t.panzoom&&t.panzoom.zoomwithclick(e);break;case"close":i.fancybox.close();break;case"next":e.stoppropagation(),i.fancybox.next()}},a=this.fancybox.option("image.click"),s=this.fancybox.option("image.doubleclick");s?this.clicktimer?(cleartimeout(this.clicktimer),this.clicktimer=null,o(s)):this.clicktimer=settimeout((function(){i.clicktimer=null,o(a)}),300):o(a)}}}},{key:"onpagechange",value:function(t,e){var i=t.getslide();e.slides.foreach((function(t){t.panzoom&&"done"===t.state&&t.index!==i.index&&t.panzoom.panto({x:0,y:0,scale:1,friction:.8})}))}},{key:"attach",value:function(){this.fancybox.on(this.events)}},{key:"detach",value:function(){this.fancybox.off(this.events)}}]),t}();z.defaults={canzoominclass:"can-zoom_in",canzoomoutclass:"can-zoom_out",zoom:!0,zoomopacity:"auto",zoomfriction:.82,ignorecoveredthumbnail:!1,touch:!0,click:"togglezoom",doubleclick:null,wheel:"zoom",fit:"contain",wrap:!1,panzoom:{ratio:1}};var g=function(){var t=window.location.hash.substr(1),e=t.split("-"),i=e.length>1&&/^\+?\d+$/.test(e[e.length-1])&&parseint(e.pop(-1),10)||null;return{hash:t,slug:e.join("-"),index:i}},k=function(){function t(e){o(this,t),this.fancybox=e;for(var i=0,n=["onchange","onclosing"];i1?"-"+(o.index+1):""))}n&&(this.orighash=s!==r?this.orighash:""),r&&s!==r&&(this.timer=settimeout((function(){try{window.history[n?"pushstate":"replacestate"]({},document.title,window.location.pathname+window.location.search+"#"+r),n&&(t.hascreatedhistory=!0)}catch(t){}}),300))}},{key:"onclosing",value:function(){if(this.timer&&cleartimeout(this.timer),!0!==this.hassilentclose){if(!this.hascreatedhistory)try{return void window.history.replacestate({},document.title,window.location.pathname+window.location.search+(this.orighash?"#"+this.orighash:""))}catch(t){}window.history.back()}}},{key:"attach",value:function(t){t.on(this.events)}},{key:"detach",value:function(t){t.off(this.events)}}],[{key:"startfromurl",value:function(){if(t.fancybox&&!t.fancybox.getinstance()){var e=g(),i=e.hash,n=e.slug,o=e.index;if(n){var a=document.queryselector('[data-slug="'.concat(i,'"]'));if(a&&a.dispatchevent(new customevent("click",{bubbles:!0,cancelable:!0})),!t.fancybox.getinstance()){var s=document.queryselectorall('[data-fancybox="'.concat(n,'"]'));s.length&&(null===o&&1===s.length?a=s[0]:o&&(a=s[o-1]),a&&a.dispatchevent(new customevent("click",{bubbles:!0,cancelable:!0})))}}}}},{key:"onhashchange",value:function(){var e=g(),i=e.slug,n=e.index,o=t.fancybox.getinstance();if(o){if(i){var a,s=o.carousel,r=y(s.slides);try{for(r.s();!(a=r.n()).done;){var l=a.value;if(l.slug&&l.slug===i)return s.slideto(l.index)}}catch(t){r.e(t)}finally{r.f()}var c=o.getslide(),h=c.$trigger&&c.$trigger.dataset;if(h&&h.fancybox===i)return s.slideto(n-1)}o.plugins.hash.hassilentclose=!0,o.close()}t.startfromurl()}},{key:"create",value:function(e){function i(){window.addeventlistener("hashchange",t.onhashchange,!1),t.startfromurl()}t.fancybox=e,b&&window.requestanimationframe((function(){/complete|interactive|loaded/.test(document.readystate)?i():document.addeventlistener("domcontentloaded",i)}))}},{key:"destroy",value:function(){window.removeeventlistener("hashchange",t.onhashchange,!1)}}]),t}(),j={pagexoffset:0,pageyoffset:0,element:function(){return document.fullscreenelement||document.mozfullscreenelement||document.webkitfullscreenelement},activate:function(t){j.pagexoffset=window.pagexoffset,j.pageyoffset=window.pageyoffset,t.requestfullscreen?t.requestfullscreen():t.mozrequestfullscreen?t.mozrequestfullscreen():t.webkitrequestfullscreen?t.webkitrequestfullscreen():t.msrequestfullscreen&&t.msrequestfullscreen()},deactivate:function(){document.exitfullscreen?document.exitfullscreen():document.mozcancelfullscreen?document.mozcancelfullscreen():document.webkitexitfullscreen&&document.webkitexitfullscreen()}},q=function(){function t(e){o(this,t),this.fancybox=e,this.active=!1,this.handlevisibilitychange=this.handlevisibilitychange.bind(this)}return s(t,[{key:"isactive",value:function(){return this.active}},{key:"settimer",value:function(){var t=this;if(this.active&&!this.timer){var e=this.fancybox.option("slideshow.delay",3e3);this.timer=settimeout((function(){t.timer=null,t.fancybox.option("infinite")||t.fancybox.getslide().index!==t.fancybox.carousel.slides.length-1?t.fancybox.next():t.fancybox.jumpto(0,{friction:0})}),e);var i=this.$progress;i||((i=document.createelement("div")).classlist.add("fancybox__progress"),this.fancybox.$carousel.parentnode.insertbefore(i,this.fancybox.$carousel),this.$progress=i,i.offsetheight),i.style.transitionduration="".concat(e,"ms"),i.style.transform="scalex(1)"}}},{key:"cleartimer",value:function(){cleartimeout(this.timer),this.timer=null,this.$progress&&(this.$progress.style.transitionduration="",this.$progress.style.transform="",this.$progress.offsetheight)}},{key:"activate",value:function(){this.active||(this.active=!0,this.fancybox.$container.classlist.add("has-slideshow"),"done"===this.fancybox.getslide().state&&this.settimer(),document.addeventlistener("visibilitychange",this.handlevisibilitychange,!1))}},{key:"handlevisibilitychange",value:function(){this.deactivate()}},{key:"deactivate",value:function(){this.active=!1,this.cleartimer(),this.fancybox.$container.classlist.remove("has-slideshow"),document.removeeventlistener("visibilitychange",this.handlevisibilitychange,!1)}},{key:"toggle",value:function(){this.active?this.deactivate():this.fancybox.carousel.slides.length>1&&this.activate()}}]),t}(),tt={display:["counter","zoom","slideshow","fullscreen","thumbs","close"],autoenable:!0,items:{counter:{type:"div",class:"fancybox__counter",html:' / ',tabindex:-1,position:"left"},prev:{type:"button",class:"fancybox__button--prev",label:"prev",html:'',attr:{"data-fancybox-prev":""}},next:{type:"button",class:"fancybox__button--next",label:"next",html:'',attr:{"data-fancybox-next":""}},fullscreen:{type:"button",class:"fancybox__button--fullscreen",label:"toggle_fullscreen",html:'\n \n \n ',click:function(t){t.preventdefault(),j.element()?j.deactivate():j.activate(this.fancybox.$container)}},slideshow:{type:"button",class:"fancybox__button--slideshow",label:"toggle_slideshow",html:'\n \n \n ',click:function(t){t.preventdefault(),this.slideshow.toggle()}},zoom:{type:"button",class:"fancybox__button--zoom",label:"toggle_zoom",html:'',click:function(t){t.preventdefault();var e=this.fancybox.getslide().panzoom;e&&e.togglezoom()}},download:{type:"link",label:"download",class:"fancybox__button--download",html:'',click:function(t){t.stoppropagation()}},thumbs:{type:"button",label:"toggle_thumbs",class:"fancybox__button--thumbs",html:'',click:function(t){t.stoppropagation();var e=this.fancybox.plugins.thumbs;e&&e.toggle()}},close:{type:"button",label:"close",class:"fancybox__button--close",html:'',tabindex:0,attr:{"data-fancybox-close":""}}}},et=function(){function t(e){var i=this;o(this,t),this.fancybox=e,this.$container=null,this.state="init";for(var n=0,a=["oninit","onprepare","ondone","onkeydown","onclosing","onchange","onsettle","onrefresh"];nl.option("basescale"),h=y(this.fancybox.$container.queryselectorall(".fancybox__button--zoom"));try{for(h.s();!(r=h.n()).done;){var d=r.value;c?d.removeattribute("disabled"):d.setattribute("disabled","")}}catch(t){h.e(t)}finally{h.f()}var u,f=y(this.fancybox.$container.queryselectorall("[data-fancybox-index]"));try{for(f.s();!(u=f.n()).done;){u.value.innerhtml=e.index+1}}catch(t){f.e(t)}finally{f.f()}var v,p=y(this.fancybox.$container.queryselectorall("[data-fancybox-count]"));try{for(p.s();!(v=p.n()).done;){v.value.innerhtml=n}}catch(t){p.e(t)}finally{p.f()}if(!this.fancybox.option("infinite")){var g,m=y(this.fancybox.$container.queryselectorall("[data-fancybox-prev]"));try{for(m.s();!(g=m.n()).done;){var b=g.value;0===i?b.setattribute("disabled",""):b.removeattribute("disabled")}}catch(t){m.e(t)}finally{m.f()}var x,w=y(this.fancybox.$container.queryselectorall("[data-fancybox-next]"));try{for(w.s();!(x=w.n()).done;){var k=x.value;i===n-1?k.setattribute("disabled",""):k.removeattribute("disabled")}}catch(t){w.e(t)}finally{w.f()}}}},{key:"cleanup",value:function(){this.slideshow&&this.slideshow.isactive()&&this.slideshow.cleartimer(),this.$container&&this.$container.remove(),this.$container=null}},{key:"attach",value:function(){this.fancybox.on(this.events)}},{key:"detach",value:function(){this.fancybox.off(this.events),this.cleanup()}}]),t}();et.defaults=tt;var it={scrolllock:x,thumbs:q,html:v,toolbar:et,image:z,hash:k},nt={startindex:0,preload:1,infinite:!0,showclass:"fancybox-zoominup",hideclass:"fancybox-fadeout",animated:!0,hidescrollbar:!0,parentel:null,mainclass:null,autofocus:!0,trapfocus:!0,placefocusback:!0,click:"close",closebutton:"inside",dragtoclose:!0,keyboard:{escape:"close",delete:"close",backspace:"close",pageup:"next",pagedown:"prev",arrowup:"next",arrowdown:"prev",arrowright:"next",arrowleft:"prev"},template:{closebutton:'',spinner:'',main:null},l10n:{close:"close",next:"next",prev:"previous",modal:"you can close this modal content with the esc key",error:"something went wrong, please try again later",image_error:"image not found",element_not_found:"html element not found",ajax_not_found:"error loading ajax : not found",ajax_forbidden:"error loading ajax : forbidden",iframe_error:"error loading page",toggle_zoom:"toggle zoom level",toggle_thumbs:"toggle thumbnails",toggle_slideshow:"toggle slideshow",toggle_fullscreen:"toggle full-screen mode",download:"download"}},ot={},at=0,st=function(t){l(i,t);var e=f(i);function i(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,i),(n=e.call(this,x(!0,{},nt,a))).bindhandlers(),n.state="init",n.setitems(t),n.attachplugins(i.plugins),n.trigger("init"),!0===n.option("hidescrollbar")&&n.hidescrollbar(),n.initlayout(),n.initcarousel(),n.attachevents(),ot[n.id]=d(n),n.trigger("prepare"),n.state="ready",n.trigger("ready"),n.$container.setattribute("aria-hidden","false"),n.option("trapfocus")&&n.focus(),n}return s(i,[{key:"bindhandlers",value:function(){for(var t=0,e=["onmousedown","onkeydown","onclick","onfocus","oncreateslide","onsettle","ontouchmove","ontouchend","ontransform"];t1?i-1:0),o=1;o=150||math.abs(e)>=35&&t.dragoffset.time<350?(this.option("hideclass")&&(this.getslide().hideclass="fancybox-throwout".concat(t.content.y<0?"up":"down")),this.close()):"y"===t.lockaxis&&t.panto({y:0})}},{key:"ontransform",value:function(t){if(this.$backdrop){var e=math.abs(t.content.y),i=e<1?"":math.max(.33,math.min(1,1-e/t.content.fitheight*1.5));this.$container.style.setproperty("--fancybox-ts",i?"0s":""),this.$container.style.setproperty("--fancybox-opacity",i)}}},{key:"onmousedown",value:function(){"ready"===this.state&&document.body.classlist.add("is-using-mouse")}},{key:"onkeydown",value:function(t){if(i.getinstance().id===this.id){document.body.classlist.remove("is-using-mouse");var e=t.key,n=this.option("keyboard");if(n&&!t.ctrlkey&&!t.altkey&&!t.shiftkey){var o=document.activeelement&&document.activeelement.classlist,a=o&&o.contains("carousel__button");if("escape"!==e&&!a)if(t.target.iscontenteditable||-1!==["button","textarea","option","input","select","video"].indexof(t.target.nodename))return;if(!1!==this.trigger("keydown",e,t)){var s=n[e];"function"==typeof this[s]&&this[s]()}}}}},{key:"getslide",value:function(){var t=this.carousel;if(!t)return null;var e=null===t.page?t.option("initialpage"):t.page,i=t.pages||[];return i.length&&i[e]?i[e].slides[0]:null}},{key:"focus",value:function(t){if(!(i.ignorefocuschange||["init","closing","customclosing","destroy"].indexof(this.state)>-1)){t&&t.preventdefault(),i.ignorefocuschange=!0;for(var e,n=this.$container,o=this.getslide(),a="done"===o.state?o.$el:null,s=[],r=0,l=array.from(n.queryselectorall(w));r-1?this.lastfocus=t.target:this.lastfocus===n?j(s[s.length-1]):j(n):this.option("autofocus")&&e?j(e):s.indexof(document.activeelement)<0&&j(n),this.lastfocus=document.activeelement,i.ignorefocuschange=!1}}},{key:"hidescrollbar",value:function(){if(b){var t=window.innerwidth-document.documentelement.getboundingclientrect().width,e="fancybox-style-noscroll",i=document.getelementbyid(e);i||t>0&&((i=document.createelement("style")).id=e,i.type="text/css",i.innerhtml=".compensate-for-scrollbar {padding-right: ".concat(t,"px;}"),document.getelementsbytagname("head")[0].appendchild(i),document.body.classlist.add("compensate-for-scrollbar"))}}},{key:"revealscrollbar",value:function(){document.body.classlist.remove("compensate-for-scrollbar");var t=document.getelementbyid("fancybox-style-noscroll");t&&t.remove()}},{key:"clearcontent",value:function(t){this.carousel.trigger("removeslide",t),t.$content&&(t.$content.remove(),t.$content=null),t.$closebutton&&(t.$closebutton.remove(),t.$closebutton=null),t._classname&&t.$el.classlist.remove(t._classname)}},{key:"setcontent",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.$el;if(e instanceof htmlelement)["img","iframe","video","audio"].indexof(e.nodename.tolowercase())>-1?(i=document.createelement("div")).appendchild(e):i=e;else{var a=document.createrange().createcontextualfragment(e);(i=document.createelement("div")).appendchild(a)}if(t.filter&&!t.error&&(i=i.queryselector(t.filter)),i instanceof element)return t._classname="has-".concat(n.suffix||t.type||"unknown"),o.classlist.add(t._classname),i.classlist.add("fancybox__content"),"none"!==i.style.display&&"none"!==getcomputedstyle(i).getpropertyvalue("display")||(i.style.display=t.display||this.option("defaultdisplay")||"flex"),t.id&&i.setattribute("id",t.id),t.$content=i,o.prepend(i),this.manageclosebutton(t),"loading"!==t.state&&this.revealcontent(t),i;this.seterror(t,"{{element_not_found}}")}},{key:"manageclosebutton",value:function(t){var e=this,i=void 0===t.closebutton?this.option("closebutton"):t.closebutton;if(i&&("top"!==i||!this.$closebutton)){var n=document.createelement("button");n.classlist.add("carousel__button","is-close"),n.setattribute("title",this.options.l10n.close),n.innerhtml=this.option("template.closebutton"),n.addeventlistener("click",(function(t){return e.close(t)})),"inside"===i?(t.$closebutton&&t.$closebutton.remove(),t.$closebutton=t.$content.appendchild(n)):this.$closebutton=this.$container.insertbefore(n,this.$container.firstchild)}}},{key:"revealcontent",value:function(t){var e=this;this.trigger("reveal",t),t.$content.style.visibility="";var i=!1;t.error||"loading"===t.state||null!==this.carousel.prevpage||t.index!==this.options.startindex||(i=void 0===t.showclass?this.option("showclass"):t.showclass),i?(t.state="animating",this.animatecss(t.$content,i,(function(){e.done(t)}))):this.done(t)}},{key:"animatecss",value:function(t,e,i){if(t&&t.dispatchevent(new customevent("animationend",{bubbles:!0,cancelable:!0})),t&&e){t.addeventlistener("animationend",(function n(o){o.currenttarget===this&&(t.removeeventlistener("animationend",n),i&&i(),t.classlist.remove(e))})),t.classlist.add(e)}else"function"==typeof i&&i()}},{key:"done",value:function(t){t.state="done",this.trigger("done",t);var e=this.getslide();e&&t.index===e.index&&this.option("autofocus")&&this.focus()}},{key:"seterror",value:function(t,e){t.error=e,this.hideloading(t),this.clearcontent(t);var i=document.createelement("div");i.classlist.add("fancybox-error"),i.innerhtml=this.localize(e||"

{{error}}

"),this.setcontent(t,i,{suffix:"error"})}},{key:"showloading",value:function(t){var e=this;t.state="loading",t.$el.classlist.add("is-loading");var i=t.$el.queryselector(".fancybox__spinner");i||((i=document.createelement("div")).classlist.add("fancybox__spinner"),i.innerhtml=this.option("template.spinner"),i.addeventlistener("click",(function(){e.carousel.panzoom.velocity||e.close()})),t.$el.prepend(i))}},{key:"hideloading",value:function(t){var e=t.$el&&t.$el.queryselector(".fancybox__spinner");e&&(e.remove(),t.$el.classlist.remove("is-loading")),"loading"===t.state&&(this.trigger("load",t),t.state="ready")}},{key:"next",value:function(){var t=this.carousel;t&&t.pages.length>1&&t.slidenext()}},{key:"prev",value:function(){var t=this.carousel;t&&t.pages.length>1&&t.slideprev()}},{key:"jumpto",value:function(){var t;this.carousel&&(t=this.carousel).slideto.apply(t,arguments)}},{key:"close",value:function(t){var e=this;if(t&&t.preventdefault(),!["closing","customclosing","destroy"].includes(this.state)&&!1!==this.trigger("shouldclose",t)&&(this.state="closing",this.carousel.panzoom.destroy(),this.detachevents(),this.trigger("closing",t),"destroy"!==this.state)){this.$container.setattribute("aria-hidden","true"),this.$container.classlist.add("is-closing");var i=this.getslide();if(this.carousel.slides.foreach((function(t){t.$content&&t.index!==i.index&&e.carousel.trigger("removeslide",t)})),"closing"===this.state){var n=void 0===i.hideclass?this.option("hideclass"):i.hideclass;this.animatecss(i.$content,n,(function(){e.destroy()}),!0)}}}},{key:"destroy",value:function(){if("destroy"!==this.state){this.state="destroy",this.trigger("destroy");var t=this.option("placefocusback")?this.getslide().$trigger:null;this.carousel.destroy(),this.detachplugins(),this.carousel=null,this.options={},this.events={},this.$container.remove(),this.$container=this.$backdrop=this.$carousel=null,t&&j(t),delete ot[this.id];var e=i.getinstance();e?e.focus():(document.documentelement.classlist.remove("with-fancybox"),document.body.classlist.remove("is-using-mouse"),this.revealscrollbar())}}}],[{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new i(t,e)}},{key:"fromevent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.defaultprevented&&!(t.button&&0!==t.button||t.ctrlkey||t.metakey||t.shiftkey)){var n,o,a,s=t.target;if((s.matches("[data-fancybox-trigger]")||(s=s.closest("[data-fancybox-trigger]")))&&(n=s&&s.dataset&&s.dataset.fancyboxtrigger),n){var r=document.queryselectorall('[data-fancybox="'.concat(n,'"]')),l=parseint(s.dataset.fancyboxindex,10)||0;s=r.length?r[l]:s}s||(s=t.target),array.from(i.openers.keys()).reverse().some((function(e){a=s;var i=!1;try{a instanceof element&&("string"==typeof e||e instanceof string)&&(i=a.matches(e)||(a=a.closest(e)))}catch(t){}return!!i&&(t.preventdefault(),o=e,!0)}));var c=!1;if(o){e.event=t,e.target=a,a.origtarget=t.target,c=i.fromopener(o,e);var h=i.getinstance();h&&"ready"===h.state&&t.detail&&document.body.classlist.add("is-using-mouse")}return c}}},{key:"fromopener",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){for(var e=["false","0","no","null","undefined"],i=["true","1","yes"],n=object.assign({},t.dataset),o={},a=0,s=object.entries(n);a-1)o[l]=!1;else if(i.indexof(o[l])>-1)o[l]=!0;else try{o[l]=json.parse(c)}catch(t){o[l]=c}else o[l]=c}return t instanceof element&&(o.$trigger=t),o},o=[],a=e.startindex||0,s=e.target||null,r=void 0!==(e=x({},e,i.openers.get(t))).groupall&&e.groupall,l=void 0===e.groupattr?"data-fancybox":e.groupattr,c=l&&s?s.getattribute("".concat(l)):"";if((!s||c||r)&&(o=[].slice.call(document.queryselectorall(t))),s&&!r&&(o=c?o.filter((function(t){return t.getattribute("".concat(l))===c})):[s]),!o.length)return!1;var h=i.getinstance();return!(h&&o.indexof(h.options.$trigger)>-1)&&(a=s?o.indexof(s):a,new i(o=o.map(n),x({},e,{startindex:a,$trigger:s})))}},{key:"bind",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function n(){document.body.addeventlistener("click",i.fromevent,!1)}b&&(i.openers.size||(/complete|interactive|loaded/.test(document.readystate)?n():document.addeventlistener("domcontentloaded",n)),i.openers.set(t,e))}},{key:"unbind",value:function(t){i.openers.delete(t),i.openers.size||i.destroy()}},{key:"destroy",value:function(){for(var t;t=i.getinstance();)t.destroy();i.openers=new map,document.body.removeeventlistener("click",i.fromevent,!1)}},{key:"getinstance",value:function(t){return t?ot[t]:object.values(ot).reverse().find((function(t){return!["closing","customclosing","destroy"].includes(t.state)&&t}))||null}},{key:"close",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=null;e=i.getinstance();)if(e.close(),!t)return}},{key:"next",value:function(){var t=i.getinstance();t&&t.next()}},{key:"prev",value:function(){var t=i.getinstance();t&&t.prev()}}]),i}(a);st.version="4.0.12",st.defaults=nt,st.openers=new map,st.plugins=it,st.bind("[data-fancybox]");for(var rt=0,lt=object.entries(st.plugins||{});rt