(function($){
var Sticky=function(element, userSettings){
var $element,
isSticky=false,
isFollowingParent=false,
isReachedEffectsPoint=false,
elements={},
settings,
elementOffsetValue,
elementWidth;
var defaultSettings={
to: 'top',
offset: 0,
effectsOffset: 0,
parent: false,
classes: {
sticky: 'sticky',
stickyActive: 'sticky-active',
stickyEffects: 'sticky-effects',
spacer: 'sticky-spacer',
},
isRTL: false,
isScrollSnapActive: false,
handleScrollbarWidth: false,
};
var initElements=function(){
$element=$(element).addClass(settings.classes.sticky);
elements.$window=$(window);
elements.$body=$(document).find('body');
if(settings.parent){
elements.$parent=$element.parent();
if('parent'!==settings.parent){
elements.$parent=elements.$parent.closest(settings.parent);
}}
};
var initSettings=function(){
settings=jQuery.extend(true, defaultSettings, userSettings);
};
var bindEvents=function(){
elements.$window.on('resize', onWindowResize);
if(settings.isScrollSnapActive){
elements.$body.on('scroll', onWindowScroll);
}else{
elements.$window.on('scroll', onWindowScroll);
}};
var unbindEvents=function(){
elements.$window
.off('scroll', onWindowScroll)
.off('resize', onWindowResize);
elements.$body.off('scroll', onWindowScroll);
};
var init=function(){
initSettings();
initElements();
bindEvents();
checkPosition();
};
var backupCSS=function($elementBackupCSS, backupState, properties){
var css={},
elementStyle=$elementBackupCSS[ 0 ].style;
properties.forEach(function(property){
css[ property ]=undefined!==elementStyle[ property ] ? elementStyle[ property ]:'';
});
$elementBackupCSS.data('css-backup-' + backupState, css);
};
var getCSSBackup=function($elementCSSBackup, backupState){
return $elementCSSBackup.data('css-backup-' + backupState);
};
const updateElementSizesData=()=> {
elementWidth=getElementOuterSize($element, 'width');
elementOffsetValue=$element.offset().left;
if(settings.isRTL){
const documentWidth=settings.handleScrollbarWidth ? window.innerWidth:document.body.offsetWidth;
elementOffsetValue=Math.max(documentWidth - elementWidth - elementOffsetValue, 0);
}}
var addSpacer=function(){
elements.$spacer=$element.clone()
.addClass(settings.classes.spacer)
.css({
visibility: 'hidden',
transition: 'none',
animation: 'none',
});
$element.after(elements.$spacer);
};
var removeSpacer=function(){
elements.$spacer.remove();
};
var stickElement=function(){
backupCSS($element, 'unsticky', [ 'position', 'width', 'margin-top', 'margin-bottom', 'top', 'bottom', 'inset-inline-start' ]);
const css={
position: 'fixed',
width: elementWidth,
marginTop: 0,
marginBottom: 0,
};
css[ settings.to ]=settings.offset;
css[ 'top'===settings.to ? 'bottom':'top' ]='';
if(elementOffsetValue){
css[ 'inset-inline-start' ]=elementOffsetValue + 'px';
}
$element
.css(css)
.addClass(settings.classes.stickyActive);
};
var unstickElement=function(){
$element
.css(getCSSBackup($element, 'unsticky') )
.removeClass(settings.classes.stickyActive);
};
var followParent=function(){
backupCSS(elements.$parent, 'childNotFollowing', [ 'position' ]);
elements.$parent.css('position', 'relative');
backupCSS($element, 'notFollowing', [ 'position', 'inset-inline-start', 'top', 'bottom' ]);
const css={
position: 'absolute',
};
elementOffsetValue=elements.$spacer.position().left;
if(settings.isRTL){
const parentWidth=$element.parent().outerWidth(),
elementOffsetValueLeft=elements.$spacer.position().left;
elementWidth=elements.$spacer.outerWidth();
elementOffsetValue=Math.max(parentWidth - elementWidth - elementOffsetValueLeft, 0);
}
css[ 'inset-inline-start' ]=elementOffsetValue + 'px';
css[ settings.to ]='';
css[ 'top'===settings.to ? 'bottom':'top' ]=0;
$element.css(css);
isFollowingParent=true;
};
var unfollowParent=function(){
elements.$parent.css(getCSSBackup(elements.$parent, 'childNotFollowing') );
$element.css(getCSSBackup($element, 'notFollowing') );
isFollowingParent=false;
};
var getElementOuterSize=function($elementOuterSize, dimension, includeMargins){
var computedStyle=getComputedStyle($elementOuterSize[ 0 ]),
elementSize=parseFloat(computedStyle[ dimension ]),
sides='height'===dimension ? [ 'top', 'bottom' ]:[ 'left', 'right' ],
propertiesToAdd=[];
if('border-box'!==computedStyle.boxSizing){
propertiesToAdd.push('border', 'padding');
}
if(includeMargins){
propertiesToAdd.push('margin');
}
propertiesToAdd.forEach(function(property){
sides.forEach(function(side){
elementSize +=parseFloat(computedStyle[ property + '-' + side ]);
});
});
return elementSize;
};
var getElementViewportOffset=function($elementViewportOffset){
var windowScrollTop=elements.$window.scrollTop(),
elementHeight=getElementOuterSize($elementViewportOffset, 'height'),
viewportHeight=innerHeight,
elementOffsetFromTop=$elementViewportOffset.offset().top,
distanceFromTop=elementOffsetFromTop - windowScrollTop,
topFromBottom=distanceFromTop - viewportHeight;
return {
top: {
fromTop: distanceFromTop,
fromBottom: topFromBottom,
},
bottom: {
fromTop: distanceFromTop + elementHeight,
fromBottom: topFromBottom + elementHeight,
},
};};
var stick=function(){
updateElementSizesData();
addSpacer();
stickElement();
isSticky=true;
$element.trigger('sticky:stick');
};
var unstick=function(){
unstickElement();
removeSpacer();
isSticky=false;
$element.trigger('sticky:unstick');
};
var checkParent=function(){
var elementOffset=getElementViewportOffset($element),
isTop='top'===settings.to;
if(isFollowingParent){
var isNeedUnfollowing=isTop ? elementOffset.top.fromTop > settings.offset:elementOffset.bottom.fromBottom < -settings.offset;
if(isNeedUnfollowing){
unfollowParent();
}}else{
var parentOffset=getElementViewportOffset(elements.$parent),
parentStyle=getComputedStyle(elements.$parent[ 0 ]),
borderWidthToDecrease=parseFloat(parentStyle[ isTop ? 'borderBottomWidth':'borderTopWidth' ]),
parentViewportDistance=isTop ? parentOffset.bottom.fromTop - borderWidthToDecrease:parentOffset.top.fromBottom + borderWidthToDecrease,
isNeedFollowing=isTop ? parentViewportDistance <=elementOffset.bottom.fromTop:parentViewportDistance >=elementOffset.top.fromBottom;
if(isNeedFollowing){
followParent();
}}
};
var checkEffectsPoint=function(distanceFromTriggerPoint){
if(isReachedEffectsPoint&&-distanceFromTriggerPoint < settings.effectsOffset){
$element.removeClass(settings.classes.stickyEffects);
isReachedEffectsPoint=false;
}else if(! isReachedEffectsPoint&&-distanceFromTriggerPoint >=settings.effectsOffset){
$element.addClass(settings.classes.stickyEffects);
isReachedEffectsPoint=true;
}};
var checkPosition=function(){
var offset=settings.offset,
distanceFromTriggerPoint;
if(isSticky){
var spacerViewportOffset=getElementViewportOffset(elements.$spacer);
distanceFromTriggerPoint='top'===settings.to ? spacerViewportOffset.top.fromTop - offset:-spacerViewportOffset.bottom.fromBottom - offset;
if(settings.parent){
checkParent();
}
if(distanceFromTriggerPoint > 0){
unstick();
}}else{
var elementViewportOffset=getElementViewportOffset($element);
distanceFromTriggerPoint='top'===settings.to ? elementViewportOffset.top.fromTop - offset:-elementViewportOffset.bottom.fromBottom - offset;
if(distanceFromTriggerPoint <=0){
stick();
if(settings.parent){
checkParent();
}}
}
checkEffectsPoint(distanceFromTriggerPoint);
};
var onWindowScroll=function(){
checkPosition();
};
var onWindowResize=function(){
if(! isSticky){
return;
}
unstickElement();
removeSpacer();
updateElementSizesData();
addSpacer();
stickElement();
if(settings.parent){
isFollowingParent=false;
checkParent();
}};
this.destroy=function(){
if(isSticky){
unstick();
}
unbindEvents();
$element.removeClass(settings.classes.sticky);
};
init();
};
$.fn.sticky=function(settings){
var isCommand='string'===typeof settings;
this.each(function(){
var $this=$(this);
if(! isCommand){
$this.data('sticky', new Sticky(this, settings) );
return;
}
var instance=$this.data('sticky');
if(! instance){
throw Error('Trying to perform the `' + settings + '` method prior to initialization');
}
if(! instance[ settings ]){
throw ReferenceError('Method `' + settings + '` not found in sticky instance');
}
instance[ settings ].apply(instance, Array.prototype.slice.call(arguments, 1) );
if('destroy'===settings){
$this.removeData('sticky');
}});
return this;
};
window.Sticky=Sticky;
})(jQuery);
var EGallery =
(function(modules){
var installedModules={};
function __webpack_require__(moduleId){
if(installedModules[moduleId]){
return installedModules[moduleId].exports;
}
var module=installedModules[moduleId]={
i: moduleId,
l: false,
exports: {}
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.l=true;
return module.exports;
}
__webpack_require__.m=modules;
__webpack_require__.c=installedModules;
__webpack_require__.d=function(exports, name, getter){
if(!__webpack_require__.o(exports, name)){
Object.defineProperty(exports, name, { enumerable: true, get: getter });
}
};
__webpack_require__.r=function(exports){
if(typeof Symbol!=='undefined'&&Symbol.toStringTag){
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
}
Object.defineProperty(exports, '__esModule', { value: true });
};
__webpack_require__.t=function(value, mode){
if(mode & 1) value=__webpack_require__(value);
if(mode & 8) return value;
if((mode & 4)&&typeof value==='object'&&value&&value.__esModule) return value;
var ns=Object.create(null);
__webpack_require__.r(ns);
Object.defineProperty(ns, 'default', { enumerable: true, value: value });
if(mode & 2&&typeof value!='string') for(var key in value) __webpack_require__.d(ns, key, function(key){ return value[key]; }.bind(null, key));
return ns;
};
__webpack_require__.n=function(module){
var getter=module&&module.__esModule ?
function getDefault(){ return module['default']; } :
function getModuleExports(){ return module; };
__webpack_require__.d(getter, 'a', getter);
return getter;
};
__webpack_require__.o=function(object, property){ return Object.prototype.hasOwnProperty.call(object, property); };
__webpack_require__.p="";
return __webpack_require__(__webpack_require__.s="./src/js/e-gallery.js");
})
({
"./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
(function(module, exports){
function _assertThisInitialized(self){
if(self===void 0){
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports=_assertThisInitialized;
}),
"./node_modules/@babel/runtime/helpers/classCallCheck.js":
(function(module, exports){
function _classCallCheck(instance, Constructor){
if(!(instance instanceof Constructor)){
throw new TypeError("Cannot call a class as a function");
}}
module.exports=_classCallCheck;
}),
"./node_modules/@babel/runtime/helpers/createClass.js":
(function(module, exports){
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;
}
module.exports=_createClass;
}),
"./node_modules/@babel/runtime/helpers/getPrototypeOf.js":
(function(module, exports){
function _getPrototypeOf(o){
module.exports=_getPrototypeOf=Object.setPrototypeOf ? Object.getPrototypeOf:function _getPrototypeOf(o){
return o.__proto__||Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
module.exports=_getPrototypeOf;
}),
"./node_modules/@babel/runtime/helpers/inherits.js":
(function(module, exports, __webpack_require__){
var setPrototypeOf=__webpack_require__( "./node_modules/@babel/runtime/helpers/setPrototypeOf.js");
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);
}
module.exports=_inherits;
}),
"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
(function(module, exports, __webpack_require__){
var _typeof=__webpack_require__( "./node_modules/@babel/runtime/helpers/typeof.js");
var assertThisInitialized=__webpack_require__( "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
function _possibleConstructorReturn(self, call){
if(call&&(_typeof(call)==="object"||typeof call==="function")){
return call;
}
return assertThisInitialized(self);
}
module.exports=_possibleConstructorReturn;
}),
"./node_modules/@babel/runtime/helpers/setPrototypeOf.js":
(function(module, exports){
function _setPrototypeOf(o, p){
module.exports=_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o, p){
o.__proto__=p;
return o;
};
return _setPrototypeOf(o, p);
}
module.exports=_setPrototypeOf;
}),
"./node_modules/@babel/runtime/helpers/typeof.js":
(function(module, exports){
function _typeof3(obj){ if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){ _typeof3=function _typeof3(obj){ return typeof obj; };}else{ _typeof3=function _typeof3(obj){ return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype ? "symbol":typeof obj; };} return _typeof3(obj); }
function _typeof2(obj){
if(typeof Symbol==="function"&&_typeof3(Symbol.iterator)==="symbol"){
_typeof2=function _typeof2(obj){
return _typeof3(obj);
};}else{
_typeof2=function _typeof2(obj){
return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype ? "symbol":_typeof3(obj);
};}
return _typeof2(obj);
}
function _typeof(obj){
if(typeof Symbol==="function"&&_typeof2(Symbol.iterator)==="symbol"){
module.exports=_typeof=function _typeof(obj){
return _typeof2(obj);
};}else{
module.exports=_typeof=function _typeof(obj){
return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype ? "symbol":_typeof2(obj);
};}
return _typeof(obj);
}
module.exports=_typeof;
}),
"./src/js/e-gallery.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "default", function(){ return EGallery; });
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__( "./node_modules/@babel/runtime/helpers/classCallCheck.js");
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__( "./node_modules/@babel/runtime/helpers/createClass.js");
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
var _types_grid__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__( "./src/js/types/grid.js");
var _types_justified__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__( "./src/js/types/justified.js");
var _types_masonry__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__( "./src/js/types/masonry.js");
var _scss_e_gallery_scss__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__( "./src/scss/e-gallery.scss");
var _scss_e_gallery_scss__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_scss_e_gallery_scss__WEBPACK_IMPORTED_MODULE_5__);
var EGallery =
function (){
function EGallery(userSettings){
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, EGallery);
this.userSettings=userSettings;
this.initGalleriesTypes();
this.createGallery();
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(EGallery, [{
key: "getDefaultSettings",
value: function getDefaultSettings(){
return {
container: null,
items: null,
type: 'grid',
tags: [],
overlay: false,
overlayTemplate: '<div class="{{ classesPrefix }}{{ classes.overlayTitle }}">{{ title }}</div><div class="{{ classesPrefix }}{{ classes.overlayDescription }}">{{ description }}</div>',
columns: 5,
horizontalGap: 10,
verticalGap: 10,
rtl: false,
animationDuration: 350,
lazyLoad: false,
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 initGalleriesTypes(){
this.galleriesTypes={
grid: _types_grid__WEBPACK_IMPORTED_MODULE_2__["default"],
justified: _types_justified__WEBPACK_IMPORTED_MODULE_3__["default"],
masonry: _types_masonry__WEBPACK_IMPORTED_MODULE_4__["default"]
};}}, {
key: "createGallery",
value: function createGallery(){
var settings=jQuery.extend(this.getDefaultSettings(), this.userSettings);
var GalleryHandlerType=this.galleriesTypes[settings.type];
this.galleryHandler=new GalleryHandlerType(settings);
}}, {
key: "setSettings",
value: function setSettings(key, value){
this.galleryHandler.setSettings(key, value);
}}, {
key: "destroy",
value: function destroy(){
this.galleryHandler.destroy();
}}]);
return EGallery;
}();
}),
"./src/js/types/base.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "default", function(){ return BaseGalleryType; });
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__( "./node_modules/@babel/runtime/helpers/classCallCheck.js");
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__( "./node_modules/@babel/runtime/helpers/createClass.js");
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
var _utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__( "./src/js/utils/index.js");
var BaseGalleryType =
function (){
function BaseGalleryType(settings){
var _this=this;
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BaseGalleryType);
this.settings=jQuery.extend(true, this.getDefaultSettings(), settings);
this.$container=jQuery(this.settings.container);
this.timeouts=[];
this.initElements();
this.prepareGallery();
var oldRunGallery=this.runGallery.bind(this);
this.runGallery=this.debounce(function (){
for (var _len=arguments.length, args=new Array(_len), _key=0; _key < _len; _key++){
args[_key]=arguments[_key];
}
if(_this.settings.lazyLoad){
oldRunGallery.apply(void 0, args);
}else{
_this.allImagesPromise.then(function (){
return oldRunGallery.apply(void 0, args);
});
}}, 300);
if(this.settings.lazyLoad){
this.handleScroll=this.debounce(function (){
return _this.lazyLoadImages();
}, 16);
}
this.bindEvents();
this.runGallery();
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BaseGalleryType, [{
key: "getDefaultSettings",
value: function getDefaultSettings(){
return {};}}, {
key: "getItemClass",
value: function getItemClass(className){
return this.settings.classesPrefix + className;
}}, {
key: "initElements",
value: function initElements(){
this.elements={
$window: jQuery(window)
};
var directionClass='-' + (this.settings.rtl ? 'rtl':'ltr');
var containerClasses=this.getItemClass(this.settings.classes.container) + ' ' + this.getItemClass(this.settings.type) + ' ' + this.getItemClass(directionClass);
if(this.settings.lazyLoad){
containerClasses +=' ' + this.getItemClass(this.settings.classes.lazyLoad);
}
this.$container.addClass(containerClasses);
}}, {
key: "bindEvents",
value: function bindEvents(){
this.elements.$window.on('resize', this.runGallery);
if(this.settings.lazyLoad){
this.elements.$window.on('scroll', this.handleScroll);
}}
}, {
key: "getNestedObjectData",
value: function getNestedObjectData(object, key){
var keyStack=key.split('.'),
currentKey=keyStack.splice(0, 1);
if(!keyStack.length){
return {
object: object,
key: key
};}
return this.getNestedObjectData(object[currentKey], keyStack.join('.'));
}}, {
key: "getTemplateArgs",
value: function getTemplateArgs(args, key){
var nestedObjectData=this.getNestedObjectData(args, key);
return nestedObjectData.object[nestedObjectData.key]||'';
}}, {
key: "getCurrentBreakpoint",
value: function getCurrentBreakpoint(){
var breakpoints=Object.keys(this.settings.breakpoints).map(Number).sort(function (a, b){
return a - b;
});
var currentBreakpoint=0;
breakpoints.some(function (breakpoint){
if(innerWidth < breakpoint){
currentBreakpoint=breakpoint;
return true;
}
return false;
});
return currentBreakpoint;
}}, {
key: "getCurrentDeviceSetting",
value: function getCurrentDeviceSetting(settingKey){
var currentBreakpoint=this.getCurrentBreakpoint();
if(currentBreakpoint){
return this.settings.breakpoints[currentBreakpoint][settingKey];
}
return this.settings[settingKey];
}}, {
key: "getActiveItems",
value: function getActiveItems(){
var returnIndexes=arguments.length > 0&&arguments[0]!==undefined ? arguments[0]:false;
var activeTags=this.settings.tags,
activeIndexes=[];
if(!activeTags.length){
if(returnIndexes){
this.$items.each(function (index){
activeIndexes.push(index);
});
return activeIndexes;
}
return this.$items;
}
var filteredItems=this.$items.filter(function (index, item){
var itemTags=item.dataset.eGalleryTags;
if(!itemTags){
return false;
}
itemTags=itemTags.split(/[ ,]+/);
if(activeTags.some(function (tag){
return itemTags.includes(tag);
})){
if(returnIndexes){
activeIndexes.push(index);
}
return true;
}
return false;
});
if(returnIndexes){
return activeIndexes;
}
return filteredItems;
}}, {
key: "getImageData",
value: function getImageData(index){
if(this.settings.tags.length){
index=this.getActiveItems(true)[index];
}
return this.imagesData[index];
}}, {
key: "compileTemplate",
value: function compileTemplate(template, args){
var _this2=this;
return template.replace(/{{([^}]+)}}/g, function (match, placeholder){
return _this2.getTemplateArgs(args, placeholder.trim());
});
}}, {
key: "createOverlay",
value: function createOverlay(overlayData){
var _this$settings=this.settings,
classes=_this$settings.classes,
overlayTemplate=_this$settings.overlayTemplate,
$overlay=jQuery('<div>', {
"class": this.getItemClass(classes.overlay)
}),
overlayContent=this.compileTemplate(overlayTemplate, jQuery.extend(true, this.settings, overlayData));
$overlay.html(overlayContent);
return $overlay;
}}, {
key: "createItem",
value: function createItem(itemData){
var classes=this.settings.classes,
$item=jQuery('<div>', {
"class": this.getItemClass(classes.item),
'data-e-gallery-tags': itemData.tags
}),
$image=jQuery('<div>', {
"class": this.getItemClass(classes.image)
});
var $overlay;
if(!this.settings.lazyLoad){
$image.css('background-image', 'url(' + itemData.thumbnail + ')');
}
if(this.settings.overlay){
$overlay=this.createOverlay(itemData);
}
var $contentWrapper=$item;
if(itemData.url){
$contentWrapper=jQuery('<a>', {
"class": this.getItemClass(classes.link),
href: itemData.url
});
$item.html($contentWrapper);
}
$contentWrapper.html($image);
if($overlay){
$contentWrapper.append($overlay);
}
return $item;
}}, {
key: "debounce",
value: function debounce(func, wait){
var _this3=this;
var timeout;
return function (){
for (var _len2=arguments.length, args=new Array(_len2), _key2=0; _key2 < _len2; _key2++){
args[_key2]=arguments[_key2];
}
clearTimeout(timeout);
timeout=setTimeout(function (){
return func.apply(void 0, args);
}, wait);
_this3.timeouts.push(timeout);
};}}, {
key: "buildGallery",
value: function buildGallery(){
var _this4=this;
var items=this.settings.items;
this.$items=jQuery();
items.forEach(function (item){
var $item=_this4.createItem(item);
_this4.$items=_this4.$items.add($item);
_this4.$container.append($item);
});
}}, {
key: "loadImages",
value: function loadImages(){
var _this5=this;
var allPromises=[];
this.settings.items.forEach(function (item, index){
var image=new Image(),
promise=new Promise(function (resolve){
image.onload=resolve;
});
allPromises.push(promise);
promise.then(function (){
return _this5.calculateImageSize(image, index);
});
image.src=item.thumbnail;
});
this.allImagesPromise=Promise.all(allPromises);
}}, {
key: "lazyLoadImages",
value: function lazyLoadImages(){
var _this6=this;
if(this.lazyLoadComplete){
return;
}
var $items=this.getActiveItems(),
itemsIndexes=this.getActiveItems(true);
$items.each(function (index, item){
var itemData=_this6.settings.items[itemsIndexes[index]];
if(itemData.loading||!Object(_utils__WEBPACK_IMPORTED_MODULE_2__["elementInView"])(item)){
return true;
}
itemData.loading=true;
var $item=jQuery(item),
image=new Image(),
promise=new Promise(function (resolve){
image.onload=resolve;
});
promise.then(function (){
$item.find(_this6.settings.selectors.image).css('background-image', 'url("' + itemData.thumbnail + '")').addClass(_this6.getItemClass(_this6.settings.classes.imageLoaded));
_this6.loadedItemsCount++;
if(_this6.loadedItemsCount===_this6.settings.items.length){
_this6.lazyLoadComplete=true;
}});
image.src=itemData.thumbnail;
return true;
});
}}, {
key: "calculateImageSize",
value: function calculateImageSize(image, index){
this.imagesData[index]={
width: image.width,
height: image.height,
ratio: image.width / image.height
};}}, {
key: "createImagesData",
value: function createImagesData(){
var _this7=this;
this.settings.items.forEach(function (item, index){
return _this7.calculateImageSize(item, index);
});
}}, {
key: "makeGalleryFromContent",
value: function makeGalleryFromContent(){
var selectors=this.settings.selectors,
isLazyLoad=this.settings.lazyLoad,
items=[];
this.$items=this.$container.find(selectors.items);
this.$items.each(function (index, item){
var $image=jQuery(item).find(selectors.image);
items[index]={
thumbnail: $image.data('thumbnail')
};
if(isLazyLoad){
items[index].width=$image.data('width');
items[index].height=$image.data('height');
}else{
$image.css('background-image', "url(\"".concat($image.data('thumbnail'), "\")"));
}});
this.settings.items=items;
}}, {
key: "prepareGallery",
value: function prepareGallery(){
if(this.settings.items){
this.buildGallery();
}else{
this.makeGalleryFromContent();
}
this.imagesData=[];
if(this.settings.lazyLoad){
this.loadedItemsCount=0;
this.lazyLoadComplete=false;
this.createImagesData();
}else{
this.loadImages();
}}
}, {
key: "runGallery",
value: function runGallery(refresh){
var _this8=this;
var containerStyle=this.$container[0].style;
containerStyle.setProperty('--hgap', this.getCurrentDeviceSetting('horizontalGap') + 'px');
containerStyle.setProperty('--vgap', this.getCurrentDeviceSetting('verticalGap') + 'px');
containerStyle.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));
if(this.settings.lazyLoad){
setTimeout(function (){
return _this8.lazyLoadImages();
}, 300);
}
this.run(refresh);
}}, {
key: "setSettings",
value: function setSettings(key, value){
var nestedObjectData=this.getNestedObjectData(this.settings, key);
if(nestedObjectData.object){
nestedObjectData.object[nestedObjectData.key]=value;
this.runGallery(true);
}}
}, {
key: "unbindEvents",
value: function unbindEvents(){
this.elements.$window.off('resize', this.runGallery);
}}, {
key: "destroy",
value: function destroy(){
this.unbindEvents();
this.$container.empty();
this.timeouts.forEach(function (timeout){
return clearTimeout(timeout);
});
}}]);
return BaseGalleryType;
}();
}),
"./src/js/types/grid.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "default", function(){ return Grid; });
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__( "./node_modules/@babel/runtime/helpers/classCallCheck.js");
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__( "./node_modules/@babel/runtime/helpers/createClass.js");
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__( "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__( "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__( "./node_modules/@babel/runtime/helpers/inherits.js");
var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
var _base__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__( "./src/js/types/base.js");
var Grid =
function (_BaseGalleryType){
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Grid, _BaseGalleryType);
function Grid(){
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Grid);
return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Grid).apply(this, arguments));
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Grid, [{
key: "getDefaultSettings",
value: function getDefaultSettings(){
return {
aspectRatio: '16:9'
};}}, {
key: "setItemsPosition",
value: function setItemsPosition(){
var columns=this.getCurrentDeviceSetting('columns');
this.getActiveItems().each(function (index, item){
item.style.setProperty('--column', index % columns);
item.style.setProperty('--row', Math.floor(index / columns));
});
}}, {
key: "setContainerSize",
value: function setContainerSize(){
var columns=this.getCurrentDeviceSetting('columns'),
rows=Math.ceil(this.getActiveItems().length / columns),
containerStyle=this.$container[0].style;
containerStyle.setProperty('--columns', columns);
containerStyle.setProperty('--rows', rows);
var itemWidth=this.getActiveItems().width(),
aspectRatio=this.settings.aspectRatio.split(':'),
aspectRatioPercents=aspectRatio[1] / aspectRatio[0],
itemHeight=aspectRatioPercents * itemWidth,
totalHeight=itemHeight * rows + this.getCurrentDeviceSetting('horizontalGap') * (rows - 1),
calculatedAspectRatio=totalHeight / this.$container.width() * 100;
containerStyle.setProperty('--aspect-ratio', aspectRatioPercents * 100 + '%');
containerStyle.setProperty('--container-aspect-ratio', calculatedAspectRatio + '%');
}}, {
key: "run",
value: function run(){
var _this=this;
var animatedClass=this.getItemClass(this.settings.classes.animated);
this.$container.addClass(animatedClass);
setTimeout(function (){
_this.setItemsPosition();
_this.setContainerSize();
setTimeout(function (){
return _this.$container.removeClass(animatedClass);
}, _this.settings.animationDuration);
}, 50);
}}]);
return Grid;
}(_base__WEBPACK_IMPORTED_MODULE_5__["default"]);
}),
"./src/js/types/justified.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "default", function(){ return Justified; });
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__( "./node_modules/@babel/runtime/helpers/classCallCheck.js");
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__( "./node_modules/@babel/runtime/helpers/createClass.js");
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__( "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__( "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__( "./node_modules/@babel/runtime/helpers/inherits.js");
var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
var _base__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__( "./src/js/types/base.js");
var Justified =
function (_BaseGalleryType){
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Justified, _BaseGalleryType);
function Justified(){
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Justified);
return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Justified).apply(this, arguments));
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Justified, [{
key: "getDefaultSettings",
value: function getDefaultSettings(){
return {
idealRowHeight: 200,
lastRow: 'auto',
breakpoints: {
1024: {
idealRowHeight: 150
},
768: {
idealRowHeight: 100
}}
};}}, {
key: "run",
value: function run(){
this.rowsHeights=[];
this.rowsCount=0;
this.containerWidth=this.$container.width();
this.makeJustifiedRow(0);
}}, {
key: "makeJustifiedRow",
value: function makeJustifiedRow(startIndex){
var oldRowWidth=0;
for (var index=startIndex;; index++){
var imageData=this.getImageData(index);
var itemComputedWidth=Math.round(this.getCurrentDeviceSetting('idealRowHeight') * imageData.ratio);
if(itemComputedWidth > this.containerWidth){
itemComputedWidth=this.containerWidth;
}
var newRowWidth=oldRowWidth + itemComputedWidth;
if(newRowWidth > this.containerWidth){
var oldDiff=this.containerWidth - oldRowWidth,
newDiff=newRowWidth - this.containerWidth;
if(oldDiff < newDiff){
this.fitImagesInContainer(startIndex, index, oldRowWidth);
this.rowsCount++;
this.makeJustifiedRow(index);
break;
}}
var isLastItem=index===this.getActiveItems().length - 1;
imageData.computedWidth=itemComputedWidth;
if(isLastItem){
var lastRowMode=this.getCurrentDeviceSetting('lastRow');
if('hide'!==lastRowMode){
var totalRowWidth='fit'===lastRowMode||0.7 <=newRowWidth / this.containerWidth ? newRowWidth:this.containerWidth;
this.fitImagesInContainer(startIndex, index + 1, totalRowWidth);
}
this.inflateGalleryHeight();
break;
}
oldRowWidth=newRowWidth;
}}
}, {
key: "fitImagesInContainer",
value: function fitImagesInContainer(startIndex, endIndex, rowWidth){
var gapCount=endIndex - startIndex - 1,
$items=this.getActiveItems();
var aggregatedWidth=0;
for (var index=startIndex; index < endIndex; index++){
var imageData=this.getImageData(index),
percentWidth=imageData.computedWidth / rowWidth,
item=$items.get(index),
firstRowItemClass=this.getItemClass(this.settings.classes.firstRowItem);
item.style.setProperty('--item-width', percentWidth);
item.style.setProperty('--gap-count', gapCount);
item.style.setProperty('--item-height', imageData.height / imageData.width * 100 + '%');
item.style.setProperty('--item-start', aggregatedWidth);
item.style.setProperty('--item-row-index', index - startIndex);
aggregatedWidth +=percentWidth;
if(index===startIndex){
item.classList.add(firstRowItemClass);
var imagePxWidth=percentWidth * (this.containerWidth - gapCount * this.getCurrentDeviceSetting('horizontalGap'));
this.rowsHeights.push(imagePxWidth / imageData.ratio);
}else{
item.classList.remove(firstRowItemClass);
}}
}}, {
key: "inflateGalleryHeight",
value: function inflateGalleryHeight(){
var totalRowsHeight=this.rowsHeights.reduce(function (total, item){
return total + item;
}),
finalContainerHeight=totalRowsHeight + this.rowsCount * this.getCurrentDeviceSetting('verticalGap'),
containerAspectRatio=finalContainerHeight / this.containerWidth,
percentRowsHeights=this.rowsHeights.map(function (rowHeight){
return rowHeight / finalContainerHeight * 100;
});
var currentRow=-1,
accumulatedTop=0;
this.getActiveItems().each(function (index, item){
var itemRowIndex=item.style.getPropertyValue('--item-row-index'),
isFirstItem='0'===itemRowIndex;
if(isFirstItem){
currentRow++;
if(currentRow){
accumulatedTop +=percentRowsHeights[currentRow - 1];
}}
item.style.setProperty('--item-top', accumulatedTop + '%');
item.style.setProperty('--item-height', percentRowsHeights[currentRow] + '%');
item.style.setProperty('--row', currentRow);
});
this.$container[0].style.setProperty('--container-aspect-ratio', containerAspectRatio);
}}]);
return Justified;
}(_base__WEBPACK_IMPORTED_MODULE_5__["default"]);
}),
"./src/js/types/masonry.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "default", function(){ return Masonry; });
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__( "./node_modules/@babel/runtime/helpers/classCallCheck.js");
var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__( "./node_modules/@babel/runtime/helpers/createClass.js");
var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__( "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__( "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__( "./node_modules/@babel/runtime/helpers/inherits.js");
var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
var _base__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__( "./src/js/types/base.js");
var Masonry =
function (_BaseGalleryType){
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Masonry, _BaseGalleryType);
function Masonry(){
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Masonry);
return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Masonry).apply(this, arguments));
}
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Masonry, [{
key: "run",
value: function run(refresh){
var _this=this;
var currentBreakpoint=this.getCurrentBreakpoint();
if(!refresh&&currentBreakpoint===this.currentBreakpoint){
return;
}
this.currentBreakpoint=currentBreakpoint;
var heights=[],
itemsInColumn=[],
aggregatedHeights=[],
columns=this.getCurrentDeviceSetting('columns'),
containerWidth=this.$container.width(),
horizontalGap=this.getCurrentDeviceSetting('horizontalGap'),
itemWidth=(containerWidth - horizontalGap * (columns - 1)) / columns,
$items=this.getActiveItems();
var naturalColumnHeight=0;
for (var i=0; i < columns; i++){
itemsInColumn[i]=0;
heights[i]=0;
}
$items.each(function (index, item){
var imageData=_this.getImageData(index),
itemHeight=itemWidth / imageData.ratio;
var indexAtRow=index % columns;
naturalColumnHeight=heights[indexAtRow];
jQuery.each(heights, function (colNumber, currentColHeight){
if(currentColHeight&&naturalColumnHeight > currentColHeight + 5){
naturalColumnHeight=currentColHeight;
indexAtRow=colNumber;
}});
aggregatedHeights[index]=heights[indexAtRow];
heights[indexAtRow] +=itemHeight;
item.style.setProperty('--item-height', imageData.height / imageData.width * 100 + '%');
item.style.setProperty('--column', indexAtRow);
item.style.setProperty('--items-in-column', itemsInColumn[indexAtRow]);
itemsInColumn[indexAtRow]++;
});
var highestColumn=Math.max.apply(Math, heights),
highestColumnIndex=heights.indexOf(highestColumn),
rows=itemsInColumn[highestColumnIndex],
highestColumnsGapsCount=rows - 1,
containerAspectRatio=highestColumn / containerWidth;
this.$container[0].style.setProperty('--columns', columns);
this.$container[0].style.setProperty('--highest-column-gap-count', highestColumnsGapsCount);
this.$container.css('padding-bottom', containerAspectRatio * 100 + '%');
$items.each(function (index, item){
var percentHeight=aggregatedHeights[index] ? aggregatedHeights[index] / highestColumn * 100:0;
item.style.setProperty('--percent-height', percentHeight + '%');
});
}}]);
return Masonry;
}(_base__WEBPACK_IMPORTED_MODULE_5__["default"]);
}),
"./src/js/utils/element-in-view.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, "default", function(){ return elementInView; });
function elementInView(element){
var elementPart=arguments.length > 1&&arguments[1]!==undefined ? arguments[1]:'top';
var elementTop=element.getBoundingClientRect().top,
elementHeight=element.offsetHeight,
elementBottom=elementTop + elementHeight;
var elementPosition;
if('middle'===elementPart){
elementPosition=elementTop + elementHeight / 2;
}else if('bottom'===elementPart){
elementPosition=elementBottom;
}else{
elementPosition=elementTop;
}
return elementPosition <=innerHeight&&elementBottom >=0;
}
}),
"./src/js/utils/index.js":
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_require__.r(__webpack_exports__);
var _element_in_view__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__( "./src/js/utils/element-in-view.js");
__webpack_require__.d(__webpack_exports__, "elementInView", function(){ return _element_in_view__WEBPACK_IMPORTED_MODULE_0__["default"]; });
}),
"./src/scss/e-gallery.scss":
(function(module, exports, __webpack_require__){
})
})["default"];
;(function (factory){
'use strict';
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
factory(require('jquery'));
}else{
if(typeof jQuery==='undefined'){
throw 'jquery-numerator requires jQuery to be loaded first';
}
factory(jQuery);
}}(function ($){
var pluginName="numerator",
defaults={
easing: 'swing',
duration: 500,
delimiter: undefined,
rounding: 0,
toValue: undefined,
fromValue: undefined,
queue: false,
onStart: function(){},
onStep: function(){},
onProgress: function(){},
onComplete: function(){}};
function Plugin(element, options){
this.element=element;
this.settings=$.extend({}, defaults, options);
this._defaults=defaults;
this._name=pluginName;
this.init();
}
Plugin.prototype={
init: function (){
this.parseElement();
this.setValue();
},
parseElement: function (){
var elText=$.trim($(this.element).text());
this.settings.fromValue=this.settings.fromValue||this.format(elText);
},
setValue: function(){
var self=this;
$({value: self.settings.fromValue}).animate({value: self.settings.toValue}, {
duration: parseInt(self.settings.duration, 10),
easing: self.settings.easing,
start: self.settings.onStart,
step: function(now, fx){
$(self.element).text(self.format(now));
self.settings.onStep(now, fx);
},
progress: self.settings.onProgress,
complete: self.settings.onComplete
});
},
format: function(value){
var self=this;
if(parseInt(this.settings.rounding) < 1){
value=parseInt(value, 10);
}else{
value=parseFloat(value).toFixed(parseInt(this.settings.rounding));
}
if(self.settings.delimiter){
return this.delimit(value)
}else{
return value;
}},
delimit: function(value){
var self=this;
value=value.toString();
if(self.settings.rounding&&parseInt(self.settings.rounding, 10) > 0){
var decimals=value.substring((value.length - (self.settings.rounding + 1)), value.length),
wholeValue=value.substring(0, (value.length - (self.settings.rounding + 1)));
return self.addDelimiter(wholeValue) + decimals;
}else{
return self.addDelimiter(value);
}},
addDelimiter: function(value){
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, this.settings.delimiter);
}};
$.fn[ pluginName ]=function(options){
return this.each(function(){
if($.data(this, "plugin_" + pluginName) ){
$.data(this, 'plugin_' + pluginName, null);
}
$.data(this, "plugin_" + pluginName, new Plugin(this, options) );
});
};}));
(()=> {
"use strict";
var __webpack_modules__=({});
var __webpack_module_cache__={};
function __webpack_require__(moduleId){
var cachedModule=__webpack_module_cache__[moduleId];
if(cachedModule!==undefined){
return cachedModule.exports;
}
var module=__webpack_module_cache__[moduleId]={
exports: {}
};
if(!(moduleId in __webpack_modules__)){
delete __webpack_module_cache__[moduleId];
var e=new Error("Cannot find module '" + moduleId + "'");
e.code='MODULE_NOT_FOUND';
throw e;
}
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
__webpack_require__.m=__webpack_modules__;
(()=> {
var deferred=[];
__webpack_require__.O=(result, chunkIds, fn, priority)=> {
if(chunkIds){
priority=priority||0;
for(var i=deferred.length; i > 0&&deferred[i - 1][2] > priority; i--) deferred[i]=deferred[i - 1];
deferred[i]=[chunkIds, fn, priority];
return;
}
var notFulfilled=Infinity;
for (var i=0; i < deferred.length; i++){
var [chunkIds, fn, priority]=deferred[i];
var fulfilled=true;
for (var j=0; j < chunkIds.length; j++){
if((priority & 1===0||notFulfilled >=priority)&&Object.keys(__webpack_require__.O).every((key)=> (__webpack_require__.O[key](chunkIds[j])))){
chunkIds.splice(j--, 1);
}else{
fulfilled=false;
if(priority < notFulfilled) notFulfilled=priority;
}
}
if(fulfilled){
deferred.splice(i--, 1)
var r=fn();
if(r!==undefined) result=r;
}
}
return result;
};
})();
(()=> {
__webpack_require__.f={};
__webpack_require__.e=(chunkId)=> {
return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=> {
__webpack_require__.f[key](chunkId, promises);
return promises;
}, []));
};
})();
(()=> {
__webpack_require__.u=(chunkId)=> {
if(chunkId==="code-highlight") return "" + chunkId + ".872070dcb83100cdc6a7.bundle.js";
if(chunkId==="video-playlist") return "" + chunkId + ".d7d184236c3e54fc0c27.bundle.js";
if(chunkId==="paypal-button") return "" + chunkId + ".557bf338d556d8411f0e.bundle.js";
if(chunkId==="vendors-node_modules_dompurify_dist_purify_cjs_js") return "e8fec410b4ec8b8ad5e5.bundle.js";
if(chunkId==="stripe-button") return "" + chunkId + ".ff670b274b64f1097386.bundle.js";
if(chunkId==="progress-tracker") return "" + chunkId + ".26b12b208974a26b52d0.bundle.js";
if(chunkId==="animated-headline") return "" + chunkId + ".248bbeadaf74dd446e7d.bundle.js";
if(chunkId==="media-carousel") return "" + chunkId + ".1eb08e97c13152575144.bundle.js";
if(chunkId==="carousel") return "" + chunkId + ".f93681c60a8355c99044.bundle.js";
if(chunkId==="countdown") return "" + chunkId + ".7bd51efbed8eaac97b16.bundle.js";
if(chunkId==="hotspot") return "" + chunkId + ".1555f80c1d14215e6b69.bundle.js";
if(chunkId==="form") return "form.333cc493ca6159f7ee0e.bundle.js";
if(chunkId==="gallery") return "" + chunkId + ".1f2d6260aa05f94aca68.bundle.js";
if(chunkId==="lottie") return "" + chunkId + ".4cf7a751c39c2d5e59f3.bundle.js";
if(chunkId==="nav-menu") return "" + chunkId + ".393f7e8d1eb984d695bc.bundle.js";
if(chunkId==="popup") return "" + chunkId + ".467433314d83de8c86ec.bundle.js";
if(chunkId==="load-more") return "" + chunkId + ".862f17c31e360ff1934e.bundle.js";
if(chunkId==="posts") return "" + chunkId + ".b01cefd7be5b5933ef48.bundle.js";
if(chunkId==="portfolio") return "" + chunkId + ".d389311c484631ccbb99.bundle.js";
if(chunkId==="share-buttons") return "" + chunkId + ".c76474949213ab8d37c0.bundle.js";
if(chunkId==="slides") return "" + chunkId + ".aefbc8effd03bc1b7881.bundle.js";
if(chunkId==="social") return "" + chunkId + ".b8ce24160d1e761ca0a6.bundle.js";
if(chunkId==="table-of-contents") return "" + chunkId + ".8496840ef16d1ad4138f.bundle.js";
if(chunkId==="archive-posts") return "" + chunkId + ".d82fc1f6376a91acb912.bundle.js";
if(chunkId==="search-form") return "" + chunkId + ".2fe57bcace4909ad8f6a.bundle.js";
if(chunkId==="woocommerce-menu-cart") return "" + chunkId + ".d64f5409c5ae5e079f89.bundle.js";
if(chunkId==="woocommerce-purchase-summary") return "" + chunkId + ".f27e4afffb08961d9bd6.bundle.js";
if(chunkId==="woocommerce-checkout-page") return "" + chunkId + ".1e854a92527f7870a712.bundle.js";
if(chunkId==="woocommerce-cart") return "" + chunkId + ".b85d04bc7b7a472432cf.bundle.js";
if(chunkId==="woocommerce-my-account") return "" + chunkId + ".9a2312ed0688c67a0cb5.bundle.js";
if(chunkId==="woocommerce-notices") return "" + chunkId + ".a2feb6e26254257dbe93.bundle.js";
if(chunkId==="product-add-to-cart") return "" + chunkId + ".7dd001c520feddf0ce5a.bundle.js";
if(chunkId==="loop") return "loop.8f668e18a5d491cc01b7.bundle.js";
if(chunkId==="loop-carousel") return "" + chunkId + ".5eddbaa4e0c79c44c5c1.bundle.js";
if(chunkId==="ajax-pagination") return "" + chunkId + ".dfa3a82618d618a6a6bf.bundle.js";
if(chunkId==="mega-menu") return "" + chunkId + ".9c175c27b10a1a51ffad.bundle.js";
if(chunkId==="mega-menu-stretch-content") return "" + chunkId + ".65ac3ff61cbda73d513e.bundle.js";
if(chunkId==="menu-title-keyboard-handler") return "" + chunkId + ".000fb4658b703c6ebe56.bundle.js";
if(chunkId==="nested-carousel") return "" + chunkId + ".925fbc1c35869d1767d5.bundle.js";
if(chunkId==="taxonomy-filter") return "" + chunkId + ".77f346809c2657dd250a.bundle.js";
if(chunkId==="off-canvas") return "" + chunkId + ".c6c9ad84eff54adcd9f3.bundle.js";
if(chunkId==="contact-buttons") return "" + chunkId + ".0f9a28de84eecdb341e1.bundle.js";
if(chunkId==="contact-buttons-var-10") return "" + chunkId + ".6caef1cb29200dd63f5a.bundle.js";
if(chunkId==="modules_floating-buttons_assets_js_frontend_classes_floatin-bar-dom_js-modules_floating-butto-2c1e90") return "38a015cfd4402fcba18c.bundle.js";
if(chunkId==="floating-bars-var-2") return "" + chunkId + ".a7a076850ecbe78bb8c7.bundle.js";
if(chunkId==="floating-bars-var-3") return "" + chunkId + ".c5d9c759b0475977fd76.bundle.js";
if(chunkId==="search") return "" + chunkId + ".eb99cbb2b336e50a443a.bundle.js";
return undefined;
};
})();
(()=> {
__webpack_require__.g=(function(){
if(typeof globalThis==='object') return globalThis;
try {
return this||new Function('return this')();
} catch (e){
if(typeof window==='object') return window;
}
})();
})();
(()=> {
__webpack_require__.o=(obj, prop)=> (Object.prototype.hasOwnProperty.call(obj, prop))
})();
(()=> {
var inProgress={};
var dataWebpackPrefix="elementor-pro:";
__webpack_require__.l=(url, done, key, chunkId)=> {
if(inProgress[url]){ inProgress[url].push(done); return; }
var script, needAttach;
if(key!==undefined){
var scripts=document.getElementsByTagName("script");
for(var i=0; i < scripts.length; i++){
var s=scripts[i];
if(s.getAttribute("src")==url||s.getAttribute("data-webpack")==dataWebpackPrefix + key){ script=s; break; }
}
}
if(!script){
needAttach=true;
script=document.createElement('script');
script.charset='utf-8';
if(__webpack_require__.nc){
script.setAttribute("nonce", __webpack_require__.nc);
}
script.setAttribute("data-webpack", dataWebpackPrefix + key);
script.src=url;
}
inProgress[url]=[done];
var onScriptComplete=(prev, event)=> {
script.onerror=script.onload=null;
clearTimeout(timeout);
var doneFns=inProgress[url];
delete inProgress[url];
script.parentNode&&script.parentNode.removeChild(script);
doneFns&&doneFns.forEach((fn)=> (fn(event)));
if(prev) return prev(event);
}
var timeout=setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
script.onerror=onScriptComplete.bind(null, script.onerror);
script.onload=onScriptComplete.bind(null, script.onload);
needAttach&&document.head.appendChild(script);
};
})();
(()=> {
var scriptUrl;
if(__webpack_require__.g.importScripts) scriptUrl=__webpack_require__.g.location + "";
var document=__webpack_require__.g.document;
if(!scriptUrl&&document){
if(document.currentScript&&document.currentScript.tagName.toUpperCase()==='SCRIPT')
scriptUrl=document.currentScript.src;
if(!scriptUrl){
var scripts=document.getElementsByTagName("script");
if(scripts.length){
var i=scripts.length - 1;
while (i > -1&&(!scriptUrl||!/^http(s?):/.test(scriptUrl))) scriptUrl=scripts[i--].src;
}
}
}
if(!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
scriptUrl=scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
__webpack_require__.p=scriptUrl;
})();
(()=> {
var installedChunks={
"webpack-pro.runtime": 0
};
__webpack_require__.f.j=(chunkId, promises)=> {
var installedChunkData=__webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId]:undefined;
if(installedChunkData!==0){
if(installedChunkData){
promises.push(installedChunkData[2]);
}else{
if("webpack-pro.runtime"!=chunkId){
var promise=new Promise((resolve, reject)=> (installedChunkData=installedChunks[chunkId]=[resolve, reject]));
promises.push(installedChunkData[2]=promise);
var url=__webpack_require__.p + __webpack_require__.u(chunkId);
var error=new Error();
var loadingEnded=(event)=> {
if(__webpack_require__.o(installedChunks, chunkId)){
installedChunkData=installedChunks[chunkId];
if(installedChunkData!==0) installedChunks[chunkId]=undefined;
if(installedChunkData){
var errorType=event&&(event.type==='load' ? 'missing':event.type);
var realSrc=event&&event.target&&event.target.src;
error.message='Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
error.name='ChunkLoadError';
error.type=errorType;
error.request=realSrc;
installedChunkData[1](error);
}
}
};
__webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
} else installedChunks[chunkId]=0;
}
}
};
__webpack_require__.O.j=(chunkId)=> (installedChunks[chunkId]===0);
var webpackJsonpCallback=(parentChunkLoadingFunction, data)=> {
var [chunkIds, moreModules, runtime]=data;
var moduleId, chunkId, i=0;
if(chunkIds.some((id)=> (installedChunks[id]!==0))){
for(moduleId in moreModules){
if(__webpack_require__.o(moreModules, moduleId)){
__webpack_require__.m[moduleId]=moreModules[moduleId];
}
}
if(runtime) var result=runtime(__webpack_require__);
}
if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
for(;i < chunkIds.length; i++){
chunkId=chunkIds[i];
if(__webpack_require__.o(installedChunks, chunkId)&&installedChunks[chunkId]){
installedChunks[chunkId][0]();
}
installedChunks[chunkId]=0;
}
return __webpack_require__.O(result);
}
var chunkLoadingGlobal=self["webpackChunkelementor_pro"]=self["webpackChunkelementor_pro"]||[];
chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
chunkLoadingGlobal.push=webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
})();
})()
;
(()=> {
var __webpack_modules__=({
507:
((__unused_webpack_module, __webpack_exports__, __webpack_require__)=> {
"use strict";
__webpack_require__.d(__webpack_exports__, {
A: ()=> ( createHooks_default)
});
;
function validateNamespace(namespace){
if("string"!==typeof namespace||""===namespace){
console.error("The namespace must be a non-empty string.");
return false;
}
if(!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)){
console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."
);
return false;
}
return true;
}
var validateNamespace_default=validateNamespace;
;
function validateHookName(hookName){
if("string"!==typeof hookName||""===hookName){
console.error("The hook name must be a non-empty string.");
return false;
}
if(/^__/.test(hookName)){
console.error("The hook name cannot begin with `__`.");
return false;
}
if(!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)){
console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."
);
return false;
}
return true;
}
var validateHookName_default=validateHookName;
;
function createAddHook(hooks, storeKey){
return function addHook(hookName, namespace, callback, priority=10){
const hooksStore=hooks[storeKey];
if(!validateHookName_default(hookName)){
return;
}
if(!validateNamespace_default(namespace)){
return;
}
if("function"!==typeof callback){
console.error("The hook callback must be a function.");
return;
}
if("number"!==typeof priority){
console.error("If specified, the hook priority must be a number."
);
return;
}
const handler={ callback, priority, namespace };
if(hooksStore[hookName]){
const handlers=hooksStore[hookName].handlers;
let i;
for (i=handlers.length; i > 0; i--){
if(priority >=handlers[i - 1].priority){
break;
}}
if(i===handlers.length){
handlers[i]=handler;
}else{
handlers.splice(i, 0, handler);
}
hooksStore.__current.forEach((hookInfo)=> {
if(hookInfo.name===hookName&&hookInfo.currentIndex >=i){
hookInfo.currentIndex++;
}});
}else{
hooksStore[hookName]={
handlers: [handler],
runs: 0
};}
if(hookName!=="hookAdded"){
hooks.doAction("hookAdded",
hookName,
namespace,
callback,
priority
);
}};}
var createAddHook_default=createAddHook;
;
function createRemoveHook(hooks, storeKey, removeAll=false){
return function removeHook(hookName, namespace){
const hooksStore=hooks[storeKey];
if(!validateHookName_default(hookName)){
return;
}
if(!removeAll&&!validateNamespace_default(namespace)){
return;
}
if(!hooksStore[hookName]){
return 0;
}
let handlersRemoved=0;
if(removeAll){
handlersRemoved=hooksStore[hookName].handlers.length;
hooksStore[hookName]={
runs: hooksStore[hookName].runs,
handlers: []
};}else{
const handlers=hooksStore[hookName].handlers;
for (let i=handlers.length - 1; i >=0; i--){
if(handlers[i].namespace===namespace){
handlers.splice(i, 1);
handlersRemoved++;
hooksStore.__current.forEach((hookInfo)=> {
if(hookInfo.name===hookName&&hookInfo.currentIndex >=i){
hookInfo.currentIndex--;
}});
}}
}
if(hookName!=="hookRemoved"){
hooks.doAction("hookRemoved", hookName, namespace);
}
return handlersRemoved;
};}
var createRemoveHook_default=createRemoveHook;
;
function createHasHook(hooks, storeKey){
return function hasHook(hookName, namespace){
const hooksStore=hooks[storeKey];
if("undefined"!==typeof namespace){
return hookName in hooksStore&&hooksStore[hookName].handlers.some((hook)=> hook.namespace===namespace
);
}
return hookName in hooksStore;
};}
var createHasHook_default=createHasHook;
;
function createRunHook(hooks, storeKey, returnFirstArg, async){
return function runHook(hookName, ...args){
const hooksStore=hooks[storeKey];
if(!hooksStore[hookName]){
hooksStore[hookName]={
handlers: [],
runs: 0
};}
hooksStore[hookName].runs++;
const handlers=hooksStore[hookName].handlers;
if(false){}
if(!handlers||!handlers.length){
return returnFirstArg ? args[0]:void 0;
}
const hookInfo={
name: hookName,
currentIndex: 0
};
async function asyncRunner(){
try {
hooksStore.__current.add(hookInfo);
let result=returnFirstArg ? args[0]:void 0;
while (hookInfo.currentIndex < handlers.length){
const handler=handlers[hookInfo.currentIndex];
result=await handler.callback.apply(null, args);
if(returnFirstArg){
args[0]=result;
}
hookInfo.currentIndex++;
}
return returnFirstArg ? result:void 0;
} finally {
hooksStore.__current.delete(hookInfo);
}}
function syncRunner(){
try {
hooksStore.__current.add(hookInfo);
let result=returnFirstArg ? args[0]:void 0;
while (hookInfo.currentIndex < handlers.length){
const handler=handlers[hookInfo.currentIndex];
result=handler.callback.apply(null, args);
if(returnFirstArg){
args[0]=result;
}
hookInfo.currentIndex++;
}
return returnFirstArg ? result:void 0;
} finally {
hooksStore.__current.delete(hookInfo);
}}
return (async ? asyncRunner:syncRunner)();
};}
var createRunHook_default=createRunHook;
;
function createCurrentHook(hooks, storeKey){
return function currentHook(){
const hooksStore=hooks[storeKey];
const currentArray=Array.from(hooksStore.__current);
return currentArray.at(-1)?.name ?? null;
};}
var createCurrentHook_default=createCurrentHook;
;
function createDoingHook(hooks, storeKey){
return function doingHook(hookName){
const hooksStore=hooks[storeKey];
if("undefined"===typeof hookName){
return hooksStore.__current.size > 0;
}
return Array.from(hooksStore.__current).some((hook)=> hook.name===hookName
);
};}
var createDoingHook_default=createDoingHook;
;
function createDidHook(hooks, storeKey){
return function didHook(hookName){
const hooksStore=hooks[storeKey];
if(!validateHookName_default(hookName)){
return;
}
return hooksStore[hookName]&&hooksStore[hookName].runs ? hooksStore[hookName].runs:0;
};}
var createDidHook_default=createDidHook;
;
class _Hooks {
actions;
filters;
addAction;
addFilter;
removeAction;
removeFilter;
hasAction;
hasFilter;
removeAllActions;
removeAllFilters;
doAction;
doActionAsync;
applyFilters;
applyFiltersAsync;
currentAction;
currentFilter;
doingAction;
doingFilter;
didAction;
didFilter;
constructor(){
this.actions= Object.create(null);
this.actions.__current= new Set();
this.filters= Object.create(null);
this.filters.__current= new Set();
this.addAction=createAddHook_default(this, "actions");
this.addFilter=createAddHook_default(this, "filters");
this.removeAction=createRemoveHook_default(this, "actions");
this.removeFilter=createRemoveHook_default(this, "filters");
this.hasAction=createHasHook_default(this, "actions");
this.hasFilter=createHasHook_default(this, "filters");
this.removeAllActions=createRemoveHook_default(this, "actions", true);
this.removeAllFilters=createRemoveHook_default(this, "filters", true);
this.doAction=createRunHook_default(this, "actions", false, false);
this.doActionAsync=createRunHook_default(this, "actions", false, true);
this.applyFilters=createRunHook_default(this, "filters", true, false);
this.applyFiltersAsync=createRunHook_default(this, "filters", true, true);
this.currentAction=createCurrentHook_default(this, "actions");
this.currentFilter=createCurrentHook_default(this, "filters");
this.doingAction=createDoingHook_default(this, "actions");
this.doingFilter=createDoingHook_default(this, "filters");
this.didAction=createDidHook_default(this, "actions");
this.didFilter=createDidHook_default(this, "filters");
}}
function createHooks(){
return new _Hooks();
}
var createHooks_default=createHooks;
}),
8770:
(()=> {
})
});
var __webpack_module_cache__={};
function __webpack_require__(moduleId){
var cachedModule=__webpack_module_cache__[moduleId];
if(cachedModule!==undefined){
return cachedModule.exports;
}
var module=__webpack_module_cache__[moduleId]={
exports: {}
};
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
(()=> {
__webpack_require__.n=(module)=> {
var getter=module&&module.__esModule ?
()=> (module['default']) :
()=> (module);
__webpack_require__.d(getter, { a: getter });
return getter;
};
})();
(()=> {
__webpack_require__.d=(exports, definition)=> {
for(var key in definition){
if(__webpack_require__.o(definition, key)&&!__webpack_require__.o(exports, key)){
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
}
}
};
})();
(()=> {
__webpack_require__.o=(obj, prop)=> (Object.prototype.hasOwnProperty.call(obj, prop))
})();
(()=> {
__webpack_require__.r=(exports)=> {
if(typeof Symbol!=='undefined'&&Symbol.toStringTag){
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
}
Object.defineProperty(exports, '__esModule', { value: true });
};
})();
var __webpack_exports__={};
(()=> {
"use strict";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
actions: ()=> ( actions),
addAction: ()=> ( addAction),
addFilter: ()=> ( addFilter),
applyFilters: ()=> ( applyFilters),
applyFiltersAsync: ()=> ( applyFiltersAsync),
createHooks: ()=> ( _createHooks__WEBPACK_IMPORTED_MODULE_1__.A),
currentAction: ()=> ( currentAction),
currentFilter: ()=> ( currentFilter),
defaultHooks: ()=> ( defaultHooks),
didAction: ()=> ( didAction),
didFilter: ()=> ( didFilter),
doAction: ()=> ( doAction),
doActionAsync: ()=> ( doActionAsync),
doingAction: ()=> ( doingAction),
doingFilter: ()=> ( doingFilter),
filters: ()=> ( filters),
hasAction: ()=> ( hasAction),
hasFilter: ()=> ( hasFilter),
removeAction: ()=> ( removeAction),
removeAllActions: ()=> ( removeAllActions),
removeAllFilters: ()=> ( removeAllFilters),
removeFilter: ()=> ( removeFilter)
});
var _createHooks__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(507);
var _types__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(8770);
var _types__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_0__);
var __WEBPACK_REEXPORT_OBJECT__={};
for(const __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_0__) if(["default","actions","addAction","addFilter","applyFilters","applyFiltersAsync","createHooks","currentAction","currentFilter","defaultHooks","didAction","didFilter","doAction","doActionAsync","doingAction","doingFilter","filters","hasAction","hasFilter","removeAction","removeAllActions","removeAllFilters","removeFilter"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__]=()=> _types__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
const defaultHooks=(0,_createHooks__WEBPACK_IMPORTED_MODULE_1__ .A)();
const {
addAction,
addFilter,
removeAction,
removeFilter,
hasAction,
hasFilter,
removeAllActions,
removeAllFilters,
doAction,
doActionAsync,
applyFilters,
applyFiltersAsync,
currentAction,
currentFilter,
doingAction,
doingFilter,
didAction,
didFilter,
actions,
filters
}=defaultHooks;
})();
(window.wp=window.wp||{}).hooks=__webpack_exports__;
})()
;
(()=> {
"use strict";
var __webpack_require__={};
(()=> {
__webpack_require__.d=(exports, definition)=> {
for(var key in definition){
if(__webpack_require__.o(definition, key)&&!__webpack_require__.o(exports, key)){
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
}
}
};
})();
(()=> {
__webpack_require__.o=(obj, prop)=> (Object.prototype.hasOwnProperty.call(obj, prop))
})();
(()=> {
__webpack_require__.r=(exports)=> {
if(typeof Symbol!=='undefined'&&Symbol.toStringTag){
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
}
Object.defineProperty(exports, '__esModule', { value: true });
};
})();
var __webpack_exports__={};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
__: ()=> ( __),
_n: ()=> ( _n),
_nx: ()=> ( _nx),
_x: ()=> ( _x),
createI18n: ()=> ( createI18n),
defaultI18n: ()=> ( default_i18n_default),
getLocaleData: ()=> ( getLocaleData),
hasTranslation: ()=> ( hasTranslation),
isRTL: ()=> ( isRTL),
resetLocaleData: ()=> ( resetLocaleData),
setLocaleData: ()=> ( setLocaleData),
sprintf: ()=> ( sprintf_sprintf),
subscribe: ()=> ( subscribe)
});
;
var PATTERN =
/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;
function sprintf(string, ...args){
var i=0;
if(Array.isArray(args[0])){
args= (
args[0]
);
}
return string.replace(PATTERN, function (){
var index,
name,
precision,
type,
value;
index=arguments[3];
name=arguments[5];
precision=arguments[7];
type=arguments[9];
if(type==='%'){
return '%';
}
if(precision==='*'){
precision=args[i];
i++;
}
if(name===undefined){
if(index===undefined){
index=i + 1;
}
i++;
value=args[index - 1];
}else if(args[0] &&
typeof args[0]==='object' &&
args[0].hasOwnProperty(name)
){
value=args[0][name];
}
if(type==='f'){
value=parseFloat(value)||0;
}else if(type==='d'){
value=parseInt(value)||0;
}
if(precision!==undefined){
if(type==='f'){
value=value.toFixed(precision);
}else if(type==='s'){
value=value.substr(0, precision);
}}
return value!==undefined&&value!==null ? value:'';
});
}
;
function sprintf_sprintf(format, ...args){
return sprintf(format, ...args);
}
;
var PRECEDENCE, OPENERS, TERMINATORS, postfix_PATTERN;
PRECEDENCE={
'(': 9,
'!': 8,
'*': 7,
'/': 7,
'%': 7,
'+': 6,
'-': 6,
'<': 5,
'<=': 5,
'>': 5,
'>=': 5,
'==': 4,
'!=': 4,
'&&': 3,
'||': 2,
'?': 1,
'?:': 1,
};
OPENERS=[ '(', '?' ];
TERMINATORS={
')': [ '(' ],
':': [ '?', '?:' ],
};
postfix_PATTERN=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
function postfix(expression){
var terms=[],
stack=[],
match, operator, term, element;
while(( match=expression.match(postfix_PATTERN) )){
operator=match[ 0 ];
term=expression.substr(0, match.index).trim();
if(term){
terms.push(term);
}
while(( element=stack.pop()) ){
if(TERMINATORS[ operator ]){
if(TERMINATORS[ operator ][ 0 ]===element){
operator=TERMINATORS[ operator ][ 1 ]||operator;
break;
}}else if(OPENERS.indexOf(element) >=0||PRECEDENCE[ element ] < PRECEDENCE[ operator ]){
stack.push(element);
break;
}
terms.push(element);
}
if(! TERMINATORS[ operator ]){
stack.push(operator);
}
expression=expression.substr(match.index + operator.length);
}
expression=expression.trim();
if(expression){
terms.push(expression);
}
return terms.concat(stack.reverse());
}
;
var OPERATORS={
'!': function(a){
return ! a;
},
'*': function(a, b){
return a * b;
},
'/': function(a, b){
return a / b;
},
'%': function(a, b){
return a % b;
},
'+': function(a, b){
return a + b;
},
'-': function(a, b){
return a - b;
},
'<': function(a, b){
return a < b;
},
'<=': function(a, b){
return a <=b;
},
'>': function(a, b){
return a > b;
},
'>=': function(a, b){
return a >=b;
},
'==': function(a, b){
return a===b;
},
'!=': function(a, b){
return a!==b;
},
'&&': function(a, b){
return a&&b;
},
'||': function(a, b){
return a||b;
},
'?:': function(a, b, c){
if(a){
throw b;
}
return c;
},
};
function evaluate(postfix, variables){
var stack=[],
i, j, args, getOperatorResult, term, value;
for(i=0; i < postfix.length; i++){
term=postfix[ i ];
getOperatorResult=OPERATORS[ term ];
if(getOperatorResult){
j=getOperatorResult.length;
args=Array(j);
while(j--){
args[ j ]=stack.pop();
}
try {
value=getOperatorResult.apply(null, args);
} catch(earlyReturn){
return earlyReturn;
}}else if(variables.hasOwnProperty(term) ){
value=variables[ term ];
}else{
value=+term;
}
stack.push(value);
}
return stack[ 0 ];
}
;
function compile(expression){
var terms=postfix(expression);
return function(variables){
return evaluate(terms, variables);
};}
;
function pluralForms(expression){
var evaluate=compile(expression);
return function(n){
return +evaluate( { n: n });
};}
;
var DEFAULT_OPTIONS={
contextDelimiter: '\u0004',
onMissingKey: null,
};
function getPluralExpression(pf){
var parts, i, part;
parts=pf.split(';');
for(i=0; i < parts.length; i++){
part=parts[ i ].trim();
if(part.indexOf('plural=')===0){
return part.substr(7);
}}
}
function Tannin(data, options){
var key;
this.data=data;
this.pluralForms={};
this.options={};
for(key in DEFAULT_OPTIONS){
this.options[ key ]=options!==undefined&&key in options
? options[ key ]
: DEFAULT_OPTIONS[ key ];
}}
Tannin.prototype.getPluralForm=function(domain, n){
var getPluralForm=this.pluralForms[ domain ],
config, plural, pf;
if(! getPluralForm){
config=this.data[ domain ][ '' ];
pf=(
config[ 'Plural-Forms' ] ||
config[ 'plural-forms' ] ||
config.plural_forms
);
if(typeof pf!=='function'){
plural=getPluralExpression(
config[ 'Plural-Forms' ] ||
config[ 'plural-forms' ] ||
config.plural_forms
);
pf=pluralForms(plural);
}
getPluralForm=this.pluralForms[ domain ]=pf;
}
return getPluralForm(n);
};
Tannin.prototype.dcnpgettext=function(domain, context, singular, plural, n){
var index, key, entry;
if(n===undefined){
index=0;
}else{
index=this.getPluralForm(domain, n);
}
key=singular;
if(context){
key=context + this.options.contextDelimiter + singular;
}
entry=this.data[ domain ][ key ];
if(entry&&entry[ index ]){
return entry[ index ];
}
if(this.options.onMissingKey){
this.options.onMissingKey(singular, domain);
}
return index===0 ? singular:plural;
};
;
const DEFAULT_LOCALE_DATA={
"": {
plural_forms(n){
return n===1 ? 0:1;
}}
};
const I18N_HOOK_REGEXP=/^i18n\.(n?gettext|has_translation)(_|$)/;
const createI18n=(initialData, initialDomain, hooks)=> {
const tannin=new Tannin({});
const listeners= new Set();
const notifyListeners=()=> {
listeners.forEach((listener)=> listener());
};
const subscribe=(callback)=> {
listeners.add(callback);
return ()=> listeners.delete(callback);
};
const getLocaleData=(domain="default")=> tannin.data[domain];
const doSetLocaleData=(data, domain="default")=> {
tannin.data[domain]={
...tannin.data[domain],
...data
};
tannin.data[domain][""]={
...DEFAULT_LOCALE_DATA[""],
...tannin.data[domain]?.[""]
};
delete tannin.pluralForms[domain];
};
const setLocaleData=(data, domain)=> {
doSetLocaleData(data, domain);
notifyListeners();
};
const addLocaleData=(data, domain="default")=> {
tannin.data[domain]={
...tannin.data[domain],
...data,
"": {
...DEFAULT_LOCALE_DATA[""],
...tannin.data[domain]?.[""],
...data?.[""]
}};
delete tannin.pluralForms[domain];
notifyListeners();
};
const resetLocaleData=(data, domain)=> {
tannin.data={};
tannin.pluralForms={};
setLocaleData(data, domain);
};
const dcnpgettext=(domain="default", context, single, plural, number)=> {
if(!tannin.data[domain]){
doSetLocaleData(void 0, domain);
}
return tannin.dcnpgettext(domain, context, single, plural, number);
};
const getFilterDomain=(domain)=> domain||"default";
const __=(text, domain)=> {
let translation=dcnpgettext(domain, void 0, text);
if(!hooks){
return translation;
}
translation=hooks.applyFilters("i18n.gettext",
translation,
text,
domain
);
return hooks.applyFilters("i18n.gettext_" + getFilterDomain(domain),
translation,
text,
domain
);
};
const _x=(text, context, domain)=> {
let translation=dcnpgettext(domain, context, text);
if(!hooks){
return translation;
}
translation=hooks.applyFilters("i18n.gettext_with_context",
translation,
text,
context,
domain
);
return hooks.applyFilters("i18n.gettext_with_context_" + getFilterDomain(domain),
translation,
text,
context,
domain
);
};
const _n=(single, plural, number, domain)=> {
let translation=dcnpgettext(
domain,
void 0,
single,
plural,
number
);
if(!hooks){
return translation;
}
translation=hooks.applyFilters("i18n.ngettext",
translation,
single,
plural,
number,
domain
);
return hooks.applyFilters("i18n.ngettext_" + getFilterDomain(domain),
translation,
single,
plural,
number,
domain
);
};
const _nx=(single, plural, number, context, domain)=> {
let translation=dcnpgettext(
domain,
context,
single,
plural,
number
);
if(!hooks){
return translation;
}
translation=hooks.applyFilters("i18n.ngettext_with_context",
translation,
single,
plural,
number,
context,
domain
);
return hooks.applyFilters("i18n.ngettext_with_context_" + getFilterDomain(domain),
translation,
single,
plural,
number,
context,
domain
);
};
const isRTL=()=> {
return "rtl"===_x("ltr", "text direction");
};
const hasTranslation=(single, context, domain)=> {
const key=context ? context + "" + single:single;
let result = !!tannin.data?.[domain ?? "default"]?.[key];
if(hooks){
result=hooks.applyFilters("i18n.has_translation",
result,
single,
context,
domain
);
result=hooks.applyFilters("i18n.has_translation_" + getFilterDomain(domain),
result,
single,
context,
domain
);
}
return result;
};
if(initialData){
setLocaleData(initialData, initialDomain);
}
if(hooks){
const onHookAddedOrRemoved=(hookName)=> {
if(I18N_HOOK_REGEXP.test(hookName)){
notifyListeners();
}};
hooks.addAction("hookAdded", "core/i18n", onHookAddedOrRemoved);
hooks.addAction("hookRemoved", "core/i18n", onHookAddedOrRemoved);
}
return {
getLocaleData,
setLocaleData,
addLocaleData,
resetLocaleData,
subscribe,
__,
_x,
_n,
_nx,
isRTL,
hasTranslation
};};
;
const external_wp_hooks_namespaceObject=window["wp"]["hooks"];
;
const i18n=createI18n(void 0, void 0, external_wp_hooks_namespaceObject.defaultHooks);
var default_i18n_default=i18n;
const getLocaleData=i18n.getLocaleData.bind(i18n);
const setLocaleData=i18n.setLocaleData.bind(i18n);
const resetLocaleData=i18n.resetLocaleData.bind(i18n);
const subscribe=i18n.subscribe.bind(i18n);
const __=i18n.__.bind(i18n);
const _x=i18n._x.bind(i18n);
const _n=i18n._n.bind(i18n);
const _nx=i18n._nx.bind(i18n);
const isRTL=i18n.isRTL.bind(i18n);
const hasTranslation=i18n.hasTranslation.bind(i18n);
;
(window.wp=window.wp||{}).i18n=__webpack_exports__;
})()
;