/*! e-gallery v1.2.0 by elementor */ var egallery=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||object.defineproperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof symbol&&symbol.tostringtag&&object.defineproperty(t,symbol.tostringtag,{value:"module"}),object.defineproperty(t,"__esmodule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esmodule)return t;var n=object.create(null);if(i.r(n),object.defineproperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esmodule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return object.prototype.hasownproperty.call(t,e)},i.p="",i(i.s=9)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new typeerror("cannot call a class as a function")}},function(t,e){function i(t,e){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0],e=this.settings.tags,i=[];if(!e.length)return t?(this.$items.each(function(t){i.push(t)}),i):this.$items;var n=this.$items.filter(function(n,s){var r=s.dataset.egallerytags;return!!r&&(r=r.split(/[ ,]+/),!!e.some(function(t){return r.includes(t)})&&(t&&i.push(n),!0))});return t?i:n}},{key:"getimagedata",value:function(t){return this.settings.tags.length&&(t=this.getactiveitems(!0)[t]),this.imagesdata[t]}},{key:"compiletemplate",value:function(t,e){var i=this;return t.replace(/{{([^}]+)}}/g,function(t,n){return i.gettemplateargs(e,n.trim())})}},{key:"createoverlay",value:function(t){var e=this.settings,i=e.classes,n=e.overlaytemplate,s=jquery("
",{class:this.getitemclass(i.overlay)}),r=this.compiletemplate(n,jquery.extend(!0,this.settings,t));return s.html(r),s}},{key:"createitem",value:function(t){var e,i=this.settings.classes,n=jquery("
",{class:this.getitemclass(i.item),"data-e-gallery-tags":t.tags}),s=jquery("
",{class:this.getitemclass(i.image)});this.settings.lazyload||s.css("background-image","url("+t.thumbnail+")"),this.settings.overlay&&(e=this.createoverlay(t));var r=n;return t.url&&(r=jquery("",{class:this.getitemclass(i.link),href:t.url}),n.html(r)),r.html(s),e&&r.append(e),n}},{key:"debounce",value:function(t,e){var i,n=this;return function(){for(var s=arguments.length,r=new array(s),a=0;a1&&void 0!==arguments[1]?arguments[1]:"top",i=t.getboundingclientrect().top,n=t.offsetheight,s=i+n;return("middle"===e?i+n/2:"bottom"===e?s:i)<=innerheight&&s>=0}(n))return!0;s.loading=!0;var r=jquery(n),a=new image;return new promise(function(t){a.onload=t}).then(function(){r.find(t.settings.selectors.image).css("background-image",'url("'+s.thumbnail+'")').addclass(t.getitemclass(t.settings.classes.imageloaded)),t.loadeditemscount++,t.loadeditemscount===t.settings.items.length&&(t.lazyloadcomplete=!0)}),a.src=s.thumbnail,!0})}}},{key:"calculateimagesize",value:function(t,e){this.imagesdata[e]={width:t.width,height:t.height,ratio:t.width/t.height}}},{key:"createimagesdata",value:function(){var t=this;this.settings.items.foreach(function(e,i){return t.calculateimagesize(e,i)})}},{key:"makegalleryfromcontent",value:function(){var t=this.settings.selectors,e=this.settings.lazyload,i=[];this.$items=this.$container.find(t.items),this.$items.each(function(n,s){var r=jquery(s).find(t.image);i[n]={thumbnail:r.data("thumbnail")},e?(i[n].width=r.data("width"),i[n].height=r.data("height")):r.css("background-image",'url("'.concat(r.data("thumbnail"),'")'))}),this.settings.items=i}},{key:"preparegallery",value:function(){this.settings.items?this.buildgallery():this.makegalleryfromcontent(),this.imagesdata=[],this.settings.lazyload?(this.loadeditemscount=0,this.lazyloadcomplete=!1,this.createimagesdata()):this.loadimages()}},{key:"rungallery",value:function(t){var e=this,i=this.$container[0].style;i.setproperty("--hgap",this.getcurrentdevicesetting("horizontalgap")+"px"),i.setproperty("--vgap",this.getcurrentdevicesetting("verticalgap")+"px"),i.setproperty("--animation-duration",this.settings.animationduration+"ms"),this.$items.addclass(this.getitemclass(this.settings.classes.hidden)),this.getactiveitems().removeclass(this.getitemclass(this.settings.classes.hidden)),this.settings.lazyload&&settimeout(function(){return e.lazyloadimages()},300),this.run(t)}},{key:"setsettings",value:function(t,e){var i=this.getnestedobjectdata(this.settings,t);i.object&&(i.object[i.key]=e,this.rungallery(!0))}},{key:"unbindevents",value:function(){this.elements.$window.off("resize",this.rungallery)}},{key:"destroy",value:function(){this.unbindevents(),this.$container.empty(),this.timeouts.foreach(function(t){return cleartimeout(t)})}}]),t}(),f=function(t){function e(){return s()(this,e),l()(this,c()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"getdefaultsettings",value:function(){return{aspectratio:"16:9"}}},{key:"setitemsposition",value:function(){var t=this.getcurrentdevicesetting("columns");this.getactiveitems().each(function(e,i){i.style.setproperty("--column",e%t),i.style.setproperty("--row",math.floor(e/t))})}},{key:"setcontainersize",value:function(){var t=this.getcurrentdevicesetting("columns"),e=math.ceil(this.getactiveitems().length/t),i=this.$container[0].style;i.setproperty("--columns",t),i.setproperty("--rows",e);var n=this.getactiveitems().width(),s=this.settings.aspectratio.split(":"),r=s[1]/s[0],a=(r*n*e+this.getcurrentdevicesetting("horizontalgap")*(e-1))/this.$container.width()*100;i.setproperty("--aspect-ratio",100*r+"%"),i.setproperty("--container-aspect-ratio",a+"%")}},{key:"run",value:function(){var t=this,e=this.getitemclass(this.settings.classes.animated);this.$container.addclass(e),settimeout(function(){t.setitemsposition(),t.setcontainersize(),settimeout(function(){return t.$container.removeclass(e)},t.settings.animationduration)},50)}}]),e}(g),m=function(t){function e(){return s()(this,e),l()(this,c()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"getdefaultsettings",value:function(){return{idealrowheight:200,lastrow:"auto",breakpoints:{1024:{idealrowheight:150},768:{idealrowheight:100}}}}},{key:"run",value:function(){this.rowsheights=[],this.rowscount=0,this.containerwidth=this.$container.width(),this.makejustifiedrow(0)}},{key:"makejustifiedrow",value:function(t){for(var e=0,i=t;;i++){var n=this.getimagedata(i),s=math.round(this.getcurrentdevicesetting("idealrowheight")*n.ratio);s>this.containerwidth&&(s=this.containerwidth);var r=e+s;if(r>this.containerwidth)if(this.containerwidth-ee+5&&(c=e,h=t)}),r[t]=n[h],n[h]+=u,i.style.setproperty("--item-height",o.height/o.width*100+"%"),i.style.setproperty("--column",h),i.style.setproperty("--items-in-column",s[h]),s[h]++});var y=math.max.apply(math,n),g=n.indexof(y),f=s[g]-1,m=y/o;this.$container[0].style.setproperty("--columns",a),this.$container[0].style.setproperty("--highest-column-gap-count",f),this.$container.css("padding-bottom",100*m+"%"),u.each(function(t,e){var i=r[t]?r[t]/y*100:0;e.style.setproperty("--percent-height",i+"%")})}}}]),e}(g);i(8);i.d(e,"default",function(){return p});var p=function(){function t(e){s()(this,t),this.usersettings=e,this.initgalleriestypes(),this.creategallery()}return a()(t,[{key:"getdefaultsettings",value:function(){return{container:null,items:null,type:"grid",tags:[],overlay:!1,overlaytemplate:'
{{ title }}
{{ description }}
',columns:5,horizontalgap:10,verticalgap:10,rtl:!1,animationduration:350,lazyload:!1,classesprefix:"e-gallery-",classes:{container:"container",item:"item",image:"image",overlay:"overlay",overlaytitle:"overlay__title",overlaydescription:"overlay__description",link:"link",firstrowitem:"first-row-item",animated:"-animated",hidden:"item--hidden",lazyload:"-lazyload",imageloaded:"image-loaded"},selectors:{items:".e-gallery-item",image:".e-gallery-image"},breakpoints:{1024:{horizontalgap:5,verticalgap:5,columns:4},768:{horizontalgap:1,verticalgap:1,columns:2}}}}},{key:"initgalleriestypes",value:function(){this.galleriestypes={grid:f,justified:m,masonry:d}}},{key:"creategallery",value:function(){var t=jquery.extend(this.getdefaultsettings(),this.usersettings),e=this.galleriestypes[t.type];this.galleryhandler=new e(t)}},{key:"setsettings",value:function(t,e){this.galleryhandler.setsettings(t,e)}},{key:"destroy",value:function(){this.galleryhandler.destroy()}}]),t}()}]).default;