(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.registerWidget=exports.isElement=exports.getSiblings=exports.visible=exports.offset=exports.fadeToggle=exports.fadeOut=exports.fadeIn=exports.slideToggle=exports.slideUp=exports.slideDown=void 0;
function _typeof(obj){ "@babel/helpers - typeof"; if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){ _typeof=function _typeof(obj){ return typeof obj; };}else{ _typeof=function _typeof(obj){ return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype ? "symbol":typeof obj; };} return _typeof(obj); }
var slideDown=function slideDown(element){
var duration=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:300;
var display=window.getComputedStyle(element).display;
if(display==="none"){
display="block";
}
element.style.transitionProperty="height";
element.style.transitionDuration="".concat(duration, "ms");
element.style.opacity=0;
element.style.display=display;
var height=element.offsetHeight;
element.style.height=0;
element.style.opacity=1;
element.style.overflow="hidden";
setTimeout(function (){
element.style.height="".concat(height, "px");
}, 5);
window.setTimeout(function (){
element.style.removeProperty("height");
element.style.removeProperty("overflow");
element.style.removeProperty("transition-duration");
element.style.removeProperty("transition-property");
element.style.removeProperty("opacity");
}, duration + 50);
};
exports.slideDown=slideDown;
var slideUp=function slideUp(element){
var duration=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:300;
element.style.boxSizing="border-box";
element.style.transitionProperty="height, margin";
element.style.transitionDuration="".concat(duration, "ms");
element.style.height="".concat(element.offsetHeight, "px");
element.style.marginTop=0;
element.style.marginBottom=0;
element.style.overflow="hidden";
setTimeout(function (){
element.style.height=0;
}, 5);
window.setTimeout(function (){
element.style.display="none";
element.style.removeProperty("height");
element.style.removeProperty("margin-top");
element.style.removeProperty("margin-bottom");
element.style.removeProperty("overflow");
element.style.removeProperty("transition-duration");
element.style.removeProperty("transition-property");
}, duration + 50);
};
exports.slideUp=slideUp;
var slideToggle=function slideToggle(element, duration){
window.getComputedStyle(element).display==="none" ? slideDown(element, duration):slideUp(element, duration);
};
exports.slideToggle=slideToggle;
var fadeIn=function fadeIn(element){
var _options=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:{};
var options={
duration: 300,
display: null,
opacity: 1,
callback: null
};
Object.assign(options, _options);
element.style.opacity=0;
element.style.display=options.display||"block";
setTimeout(function (){
element.style.transition="".concat(options.duration, "ms opacity ease");
element.style.opacity=options.opacity;
}, 5);
setTimeout(function (){
element.style.removeProperty("transition");
!!options.callback&&options.callback();
}, options.duration + 50);
};
exports.fadeIn=fadeIn;
var fadeOut=function fadeOut(element){
var _options=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:{};
var options={
duration: 300,
display: null,
opacity: 0,
callback: null
};
Object.assign(options, _options);
element.style.opacity=1;
element.style.display=options.display||"block";
setTimeout(function (){
element.style.transition="".concat(options.duration, "ms opacity ease");
element.style.opacity=options.opacity;
}, 5);
setTimeout(function (){
element.style.display="none";
element.style.removeProperty("transition");
!!options.callback&&options.callback();
}, options.duration + 50);
};
exports.fadeOut=fadeOut;
var fadeToggle=function fadeToggle(element, options){
window.getComputedStyle(element).display==="none" ? fadeIn(element, options):fadeOut(element, options);
};
exports.fadeToggle=fadeToggle;
var offset=function offset(element){
if(!element.getClientRects().length){
return {
top: 0,
left: 0
};}
var rect=element.getBoundingClientRect();
var win=element.ownerDocument.defaultView;
return {
top: rect.top + win.pageYOffset,
left: rect.left + win.pageXOffset
};};
exports.offset=offset;
var visible=function visible(element){
if(!element){
return false;
}
return !!(element.offsetWidth||element.offsetHeight||element.getClientRects().length);
};
exports.visible=visible;
var getSiblings=function getSiblings(e){
var siblings=[];
if(!e.parentNode){
return siblings;
}
var sibling=e.parentNode.firstChild;
while (sibling){
if(sibling.nodeType===1&&sibling!==e){
siblings.push(sibling);
}
sibling=sibling.nextSibling;
}
return siblings;
};
exports.getSiblings=getSiblings;
var isElement=function isElement(o){
return (typeof HTMLElement==="undefined" ? "undefined":_typeof(HTMLElement))==="object" ? o instanceof HTMLElement
: o&&_typeof(o)==="object"&&o!==null&&o.nodeType===1&&typeof o.nodeName==="string";
};
exports.isElement=isElement;
var registerWidget=function registerWidget(className, widgetName){
var skin=arguments.length > 2&&arguments[2]!==undefined ? arguments[2]:"default";
if(!(className||widgetName)){
return;
}
jQuery(window).on("elementor/frontend/init", function (){
var addHandler=function addHandler($element){
elementorFrontend.elementsHandler.addHandler(className, {
$element: $element
});
};
elementorFrontend.hooks.addAction("frontend/element_ready/".concat(widgetName, ".").concat(skin), addHandler);
});
};
exports.registerWidget=registerWidget;
},{}],2:[function(require,module,exports){
"use strict";
function _typeof(obj){ "@babel/helpers - typeof"; if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){ _typeof=function _typeof(obj){ return typeof obj; };}else{ _typeof=function _typeof(obj){ return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype ? "symbol":typeof obj; };} return _typeof(obj); }
var _utils=require("../lib/utils");
function _classCallCheck(instance, Constructor){ if(!(instance instanceof Constructor)){ throw new TypeError("Cannot call a class as a function"); }}
function _defineProperties(target, props){ for (var i=0; i < props.length; i++){ var descriptor=props[i]; descriptor.enumerable=descriptor.enumerable||false; descriptor.configurable=true; if("value" in descriptor) descriptor.writable=true; Object.defineProperty(target, descriptor.key, descriptor); }}
function _createClass(Constructor, protoProps, staticProps){ if(protoProps) _defineProperties(Constructor.prototype, protoProps); if(staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _get(target, property, receiver){ if(typeof Reflect!=="undefined"&&Reflect.get){ _get=Reflect.get; }else{ _get=function _get(target, property, receiver){ var base=_superPropBase(target, property); if(!base) return; var desc=Object.getOwnPropertyDescriptor(base, property); if(desc.get){ return desc.get.call(receiver); } return desc.value; };} return _get(target, property, receiver||target); }
function _superPropBase(object, property){ while (!Object.prototype.hasOwnProperty.call(object, property)){ object=_getPrototypeOf(object); if(object===null) break; } return object; }
function _inherits(subClass, superClass){ if(typeof superClass!=="function"&&superClass!==null){ throw new TypeError("Super expression must either be null or a function"); } subClass.prototype=Object.create(superClass&&superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true }});if(superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p){ _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o, p){ o.__proto__=p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived){ var hasNativeReflectConstruct=_isNativeReflectConstruct(); return function _createSuperInternal(){ var Super=_getPrototypeOf(Derived), result; if(hasNativeReflectConstruct){ var NewTarget=_getPrototypeOf(this).constructor; result=Reflect.construct(Super, arguments, NewTarget); }else{ result=Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); };}
function _possibleConstructorReturn(self, call){ if(call&&(_typeof(call)==="object"||typeof call==="function")){ return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self){ if(self===void 0){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct(){ if(typeof Reflect==="undefined"||!Reflect.construct) return false; if(Reflect.construct.sham) return false; if(typeof Proxy==="function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function (){})); return true; } catch (e){ return false; }}
function _getPrototypeOf(o){ _getPrototypeOf=Object.setPrototypeOf ? Object.getPrototypeOf:function _getPrototypeOf(o){ return o.__proto__||Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
var OEW_ImageGallery=function (_elementorModules$fro){
_inherits(OEW_ImageGallery, _elementorModules$fro);
var _super=_createSuper(OEW_ImageGallery);
function OEW_ImageGallery(){
_classCallCheck(this, OEW_ImageGallery);
return _super.apply(this, arguments);
}
_createClass(OEW_ImageGallery, [{
key: "getDefaultSettings",
value: function getDefaultSettings(){
return {
selectors: {
imageGallery: ".oew-image-gallery",
galleryItemLink: "a.oew-gallery-item-inner",
galleryMasonry: ".oew-image-gallery.oew-masonry",
photoSwipe: ".pswp",
body: "body"
}};}}, {
key: "getDefaultElements",
value: function getDefaultElements(){
var element=this.$element.get(0);
var selectors=this.getSettings("selectors");
return {
imageGallery: element.querySelector(selectors.imageGallery),
galleryItemLinks: element.querySelectorAll(selectors.galleryItemLink),
galleryMasonry: element.querySelector(selectors.galleryMasonry),
photoSwipe: document.querySelector(selectors.photoSwipe),
body: document.body
};}}, {
key: "onInit",
value: function onInit(){
var _get2;
for (var _len=arguments.length, args=new Array(_len), _key=0; _key < _len; _key++){
args[_key]=arguments[_key];
}
(_get2=_get(_getPrototypeOf(OEW_ImageGallery.prototype), "onInit", this)).call.apply(_get2, [this].concat(args));
this.addPhotoSwipeToDOM();
this.initLightbox();
if(this.isMasonry()){
this.initMasonry();
}}
}, {
key: "initLightbox",
value: function initLightbox(){
var _this$elements$galler,
_this=this;
(_this$elements$galler=this.elements.galleryItemLinks)===null||_this$elements$galler===void 0 ? void 0:_this$elements$galler.forEach(function (galleryItemLink){
galleryItemLink.addEventListener("click", _this.openLightbox.bind(_this));
});
}}, {
key: "openLightbox",
value: function openLightbox(event){
event.preventDefault();
event.stopPropagation();
var galleryItemLink=event.currentTarget;
var images=Array.from(this.elements.galleryItemLinks).reduce(function (acc, _galleryItemLink){
var src=_galleryItemLink.getAttribute("href");
var width=_galleryItemLink.dataset.width;
var height=_galleryItemLink.dataset.height;
acc.push({
src: src,
w: width,
h: height
});
return acc;
}, []);
var photoSwipe=new PhotoSwipe(this.elements.photoSwipe, PhotoSwipeUI_Default, images, {
index: this.getGalleryItemIndex(galleryItemLink),
bgOpacity: 0.75,
showHideOpacity: true
});
photoSwipe.init();
}}, {
key: "getGalleryItemIndex",
value: function getGalleryItemIndex(galleryItemLink){
for (var index=0; index < this.elements.galleryItemLinks.length; index++){
if(this.elements.galleryItemLinks[index]==galleryItemLink){
return index;
}}
return 0;
}}, {
key: "initMasonry",
value: function initMasonry(){
if(this.isEdit){
salvattore.init();
}}
}, {
key: "isMasonry",
value: function isMasonry(){
if(document.body.classList.contains("no-isotope")){
return false;
}
return !!this.elements.galleryMasonry;
}}, {
key: "addPhotoSwipeToDOM",
value: function addPhotoSwipeToDOM(){
if(!!this.elements.photoSwipe){
return;
}
this.elements.body.insertAdjacentHTML("beforeend", "<!-- Root element of PhotoSwipe. Must have class pswp. -->\n            <div class=\"pswp\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n                <!-- Background of PhotoSwipe. \n                    It's a separate element as animating opacity is faster than rgba(). -->\n                <div class=\"pswp__bg\"></div>\n\n                <!-- Slides wrapper with overflow:hidden. -->\n                <div class=\"pswp__scroll-wrap\">\n                    <!-- Container that holds slides. \n                        PhotoSwipe keeps only 3 of them in the DOM to save memory.\n                        Don't modify these 3 pswp__item elements, data is added later on. -->\n                    <div class=\"pswp__container\">\n                        <div class=\"pswp__item\"></div>\n                        <div class=\"pswp__item\"></div>\n                        <div class=\"pswp__item\"></div>\n                    </div>\n\n                    <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->\n                    <div class=\"pswp__ui pswp__ui--hidden\">\n                        <div class=\"pswp__top-bar\">\n                            <!--  Controls are self-explanatory. Order can be changed. -->\n                            <div class=\"pswp__counter\"></div>\n\n                            <button class=\"pswp__button pswp__button--close\" title=\"Close (Esc)\"></button>\n                            <button class=\"pswp__button pswp__button--share\" title=\"Share\"></button>\n                            <button class=\"pswp__button pswp__button--fs\" title=\"Toggle fullscreen\"></button>\n                            <button class=\"pswp__button pswp__button--zoom\" title=\"Zoom in/out\"></button>\n\n                            <!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->\n                            <!-- element will get class pswp__preloader--active when preloader is running -->\n                            <div class=\"pswp__preloader\">\n                                <div class=\"pswp__preloader__icn\">\n                                <div class=\"pswp__preloader__cut\">\n                                    <div class=\"pswp__preloader__donut\"></div>\n                                </div>\n                                </div>\n                            </div>\n                        </div>\n\n                        <div class=\"pswp__share-modal pswp__share-modal--hidden pswp__single-tap\">\n                            <div class=\"pswp__share-tooltip\"></div> \n                        </div>\n\n                        <button class=\"pswp__button pswp__button--arrow--left\" title=\"Previous (arrow left)\">\n                        </button>\n\n                        <button class=\"pswp__button pswp__button--arrow--right\" title=\"Next (arrow right)\">\n                        </button>\n\n                        <div class=\"pswp__caption\">\n                            <div class=\"pswp__caption__center\"></div>\n                        </div>\n                    </div>\n                </div>\n            </div>");
this.elements.photoSwipe=document.querySelector(this.getSettings("selectors.photoSwipe"));
}}]);
return OEW_ImageGallery;
}(elementorModules.frontend.handlers.Base);
(0, _utils.registerWidget)(OEW_ImageGallery, "oew-image-gallery");
},{"../lib/utils":1}]},{},[2]);