', {
class: settings.classes.container
});
this.elements.$motionFXLayer = jQuery('
', {
class: settings.classes.layer
});
this.updateBackgroundLayerSize();
this.elements.$motionFXContainer.prepend(this.elements.$motionFXLayer);
const $addBackgroundLayerTo = settings.addBackgroundLayerTo ? this.$element.find(settings.addBackgroundLayerTo) : this.$element;
$addBackgroundLayerTo.prepend(this.elements.$motionFXContainer);
}
removeBackgroundLayer() {
this.elements.$motionFXContainer.remove();
}
updateBackgroundLayerSize() {
const settings = this.getSettings(),
speed = {
x: 0,
y: 0
},
mouseInteraction = settings.interactions.mouseMove,
scrollInteraction = settings.interactions.scroll;
if (mouseInteraction && mouseInteraction.translateXY) {
speed.x = mouseInteraction.translateXY.speed * 10;
speed.y = mouseInteraction.translateXY.speed * 10;
}
if (scrollInteraction) {
if (scrollInteraction.translateX) {
speed.x = scrollInteraction.translateX.speed * 10;
}
if (scrollInteraction.translateY) {
speed.y = scrollInteraction.translateY.speed * 10;
}
}
this.elements.$motionFXLayer.css({
width: 100 + speed.x + '%',
height: 100 + speed.y + '%'
});
}
defineDimensions() {
const $dimensionsElement = this.getSettings('$dimensionsElement') || this.$element,
elementOffset = $dimensionsElement.offset();
const dimensions = {
elementHeight: $dimensionsElement.outerHeight(),
elementWidth: $dimensionsElement.outerWidth(),
elementTop: elementOffset.top,
elementLeft: elementOffset.left
};
dimensions.elementRange = dimensions.elementHeight + innerHeight;
this.setSettings('dimensions', dimensions);
if ('background' === this.getSettings('type')) {
this.defineBackgroundLayerDimensions();
}
}
defineBackgroundLayerDimensions() {
const dimensions = this.getSettings('dimensions');
dimensions.layerHeight = this.elements.$motionFXLayer.height();
dimensions.layerWidth = this.elements.$motionFXLayer.width();
dimensions.movableX = dimensions.layerWidth - dimensions.elementWidth;
dimensions.movableY = dimensions.layerHeight - dimensions.elementHeight;
this.setSettings('dimensions', dimensions);
}
initInteractionsTypes() {
this.interactionsTypes = {
scroll: _scroll.default,
mouseMove: _mouseMove.default
};
}
prepareSpecialActions() {
const settings = this.getSettings(),
hasTiltEffect = !!(settings.interactions.mouseMove && settings.interactions.mouseMove.tilt);
this.elements.$parent.toggleClass(settings.classes.perspective, hasTiltEffect);
}
cleanSpecialActions() {
const settings = this.getSettings();
this.elements.$parent.removeClass(settings.classes.perspective);
}
runInteractions() {
var _this = this;
const settings = this.getSettings();
this.actions.setCSSTransformVariables(settings.elementSettings);
this.prepareSpecialActions();
jQuery.each(settings.interactions, (interactionName, actions) => {
this.interactions[interactionName] = new this.interactionsTypes[interactionName]({
motionFX: this,
callback: function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
jQuery.each(actions, (actionName, actionData) => _this.actions.runAction(actionName, actionData, ...args));
}
});
this.interactions[interactionName].run();
});
}
destroyInteractions() {
this.cleanSpecialActions();
jQuery.each(this.interactions, (interactionName, interaction) => interaction.destroy());
this.interactions = {};
}
refresh() {
this.actions.setSettings(this.getSettings());
if ('background' === this.getSettings('type')) {
this.updateBackgroundLayerSize();
this.defineBackgroundLayerDimensions();
}
this.actions.refresh();
this.destroyInteractions();
this.runInteractions();
}
destroy() {
this.destroyInteractions();
this.actions.refresh();
const settings = this.getSettings();
this.$element.removeClass(settings.classes.element);
this.elements.$parent.removeClass(settings.classes.parent);
if ('background' === settings.type) {
this.$element.removeClass(settings.classes.backgroundType);
this.removeBackgroundLayer();
}
}
onInit() {
super.onInit();
const settings = this.getSettings();
this.$element = settings.$element;
this.elements.$parent = this.$element.parent();
this.$element.addClass(settings.classes.element);
this.elements.$parent = this.$element.parent();
this.elements.$parent.addClass(settings.classes.parent);
if ('background' === settings.type) {
this.$element.addClass(settings.classes.backgroundType);
this.addBackgroundLayer();
}
this.defineDimensions();
settings.$targetElement = 'element' === settings.type ? this.$element : this.elements.$motionFXLayer;
this.interactions = {};
this.actions = new _actions.default(settings);
this.initInteractionsTypes();
this.runInteractions();
}
}
exports["default"] = _default;
/***/ }),
/***/ "../modules/payments/assets/js/frontend/frontend.js":
/*!**********************************************************!*\
!*** ../modules/payments/assets/js/frontend/frontend.js ***!
\**********************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class _default extends elementorModules.Module {
constructor() {
super();
elementorFrontend.elementsHandler.attachHandler('paypal-button', () => __webpack_require__.e(/*! import() | paypal-button */ "paypal-button").then(__webpack_require__.bind(__webpack_require__, /*! ./handlers/paypal-button */ "../modules/payments/assets/js/frontend/handlers/paypal-button.js")));
elementorFrontend.elementsHandler.attachHandler('stripe-button', () => Promise.all(/*! import() | stripe-button */[__webpack_require__.e("vendors-node_modules_dompurify_dist_purify_js"), __webpack_require__.e("stripe-button")]).then(__webpack_require__.bind(__webpack_require__, /*! ./handlers/stripe-button */ "../modules/payments/assets/js/frontend/handlers/stripe-button.js")));
}
}
exports["default"] = _default;
/***/ }),
/***/ "../modules/progress-tracker/assets/js/frontend/frontend.js":
/*!******************************************************************!*\
!*** ../modules/progress-tracker/assets/js/frontend/frontend.js ***!
\******************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class _default extends elementorModules.Module {
constructor() {
super();
elementorFrontend.elementsHandler.attachHandler('progress-tracker', () => __webpack_require__.e(/*! import() | progress-tracker */ "progress-tracker").then(__webpack_require__.bind(__webpack_require__, /*! ./handlers/progress-tracker */ "../modules/progress-tracker/assets/js/frontend/handlers/progress-tracker.js")));
}
}
exports["default"] = _default;
/***/ }),
/***/ "../modules/sticky/assets/js/frontend/frontend.js":
/*!********************************************************!*\
!*** ../modules/sticky/assets/js/frontend/frontend.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _sticky = _interopRequireDefault(__webpack_require__(/*! ./handlers/sticky */ "../modules/sticky/assets/js/frontend/handlers/sticky.js"));
class _default extends elementorModules.Module {
constructor() {
super();
elementorFrontend.elementsHandler.attachHandler('section', _sticky.default, null);
elementorFrontend.elementsHandler.attachHandler('container', _sticky.default, null);
elementorFrontend.elementsHandler.attachHandler('widget', _sticky.default, null);
}
}
exports["default"] = _default;
/***/ }),
/***/ "../modules/sticky/assets/js/frontend/handlers/sticky.js":
/*!***************************************************************!*\
!*** ../modules/sticky/assets/js/frontend/handlers/sticky.js ***!
\***************************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _default = exports["default"] = elementorModules.frontend.handlers.Base.extend({
currentConfig: {},
debouncedReactivate: null,
bindEvents() {
elementorFrontend.addListenerOnce(this.getUniqueHandlerID() + 'sticky', 'resize', this.reactivateOnResize);
},
unbindEvents() {
elementorFrontend.removeListeners(this.getUniqueHandlerID() + 'sticky', 'resize', this.reactivateOnResize);
},
isStickyInstanceActive() {
return undefined !== this.$element.data('sticky');
},
/**
* Get the current active setting value for a responsive control.
*
* @param {string} setting
* @return {any} - Setting value.
*/
getResponsiveSetting(setting) {
const elementSettings = this.getElementSettings();
return elementorFrontend.getCurrentDeviceSetting(elementSettings, setting);
},
/**
* Return an array of settings names for responsive control (e.g. `settings`, `setting_tablet`, `setting_mobile` ).
*
* @param {string} setting
* @return {string[]} - List of settings.
*/
getResponsiveSettingList(setting) {
const breakpoints = Object.keys(elementorFrontend.config.responsive.activeBreakpoints);
return ['', ...breakpoints].map(suffix => {
return suffix ? `${setting}_${suffix}` : setting;
});
},
getConfig() {
const elementSettings = this.getElementSettings(),
stickyOptions = {
to: elementSettings.sticky,
offset: this.getResponsiveSetting('sticky_offset'),
effectsOffset: this.getResponsiveSetting('sticky_effects_offset'),
classes: {
sticky: 'elementor-sticky',
stickyActive: 'elementor-sticky--active elementor-section--handles-inside',
stickyEffects: 'elementor-sticky--effects',
spacer: 'elementor-sticky__spacer'
},
isRTL: elementorFrontend.config.is_rtl,
// In edit mode, since the preview is an iframe, the scrollbar is on the left. The scrollbar width is
// compensated for in this case.
handleScrollbarWidth: elementorFrontend.isEditMode()
},
$wpAdminBar = elementorFrontend.elements.$wpAdminBar,
isParentContainer = this.isContainerElement(this.$element[0]) && !this.isContainerElement(this.$element[0].parentElement);
if ($wpAdminBar.length && 'top' === elementSettings.sticky && 'fixed' === $wpAdminBar.css('position')) {
stickyOptions.offset += $wpAdminBar.height();
}
// The `stickyOptions.parent` value should only be applied to inner elements, and not to top level containers.
if (elementSettings.sticky_parent && !isParentContainer) {
// TODO: The e-container classes should be removed in the next update.
stickyOptions.parent = '.e-container, .e-container__inner, .e-con, .e-con-inner, .elementor-widget-wrap';
}
return stickyOptions;
},
activate() {
this.currentConfig = this.getConfig();
this.$element.sticky(this.currentConfig);
},
deactivate() {
if (!this.isStickyInstanceActive()) {
return;
}
this.$element.sticky('destroy');
},
run(refresh) {
if (!this.getElementSettings('sticky')) {
this.deactivate();
return;
}
var currentDeviceMode = elementorFrontend.getCurrentDeviceMode(),
activeDevices = this.getElementSettings('sticky_on');
if (-1 !== activeDevices.indexOf(currentDeviceMode)) {
if (true === refresh) {
this.reactivate();
} else if (!this.isStickyInstanceActive()) {
this.activate();
}
} else {
this.deactivate();
}
},
/**
* Reactivate the sticky instance on resize only if the new sticky config is different from the current active one,
* in order to avoid re-initializing the sticky when not needed, and avoid layout shifts.
* The config can be different between devices, so this need to be checked on each screen resize to make sure that
* the current screen size uses the appropriate Sticky config.
*
* @return {void}
*/
reactivateOnResize() {
clearTimeout(this.debouncedReactivate);
this.debouncedReactivate = setTimeout(() => {
const config = this.getConfig(),
isDifferentConfig = JSON.stringify(config) !== JSON.stringify(this.currentConfig);
if (isDifferentConfig) {
this.run(true);
}
}, 300);
},
reactivate() {
this.deactivate();
this.activate();
},
onElementChange(settingKey) {
if (-1 !== ['sticky', 'sticky_on'].indexOf(settingKey)) {
this.run(true);
}
// Settings that trigger a re-activation when changed.
const settings = [...this.getResponsiveSettingList('sticky_offset'), ...this.getResponsiveSettingList('sticky_effects_offset'), 'sticky_parent'];
if (-1 !== settings.indexOf(settingKey)) {
this.reactivate();
}
},
/**
* Listen to device mode changes and re-initialize the sticky.
*
* @return {void}
*/
onDeviceModeChange() {
// Wait for the call stack to be empty.
// The `run` function requests the current device mode from the CSS so it's not ready immediately.
// (need to wait for the `deviceMode` event to change the CSS).
// See `elementorFrontend.getCurrentDeviceMode()` for reference.
setTimeout(() => this.run(true));
},
onInit() {
elementorModules.frontend.handlers.Base.prototype.onInit.apply(this, arguments);
if (elementorFrontend.isEditMode()) {
elementor.listenTo(elementor.channels.deviceMode, 'change', () => this.onDeviceModeChange());
}
this.run();
},
onDestroy() {
elementorModules.frontend.handlers.Base.prototype.onDestroy.apply(this, arguments);
this.deactivate();
},
/**
*
* @param {HTMLElement|null|undefined} element
* @return {boolean} Is the passed element a container.
*/
isContainerElement(element) {
const containerClasses = [
// TODO: The e-container classes should be removed in the next update.
'e-container', 'e-container__inner', 'e-con', 'e-con-inner'];
return containerClasses.some(containerClass => {
return element?.classList.contains(containerClass);
});
}
});
/***/ }),
/***/ "../modules/video-playlist/assets/js/frontend/frontend.js":
/*!****************************************************************!*\
!*** ../modules/video-playlist/assets/js/frontend/frontend.js ***!
\****************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
class _default extends elementorModules.Module {
constructor() {
super();
elementorFrontend.hooks.addAction('frontend/element_ready/video-playlist.default', $element => {
__webpack_require__.e(/*! import() | video-playlist */ "video-playlist").then(__webpack_require__.bind(__webpack_require__, /*! ./handler */ "../modules/video-playlist/assets/js/frontend/handler.js")).then(_ref => {
let {
default: dynamicHandler
} = _ref;
elementorFrontend.elementsHandler.addHandler(dynamicHandler, {
$element,
toggleSelf: false
});
});
});
}
}
exports["default"] = _default;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
/*!****************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
/*!***********************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
\***********************************************************************/
/***/ ((module) => {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
/*!*************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
/*!***************************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
/*!********************************************************!*\
!*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
\********************************************************/
/***/ ((module) => {
function _typeof(o) {
"@babel/helpers - typeof";
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ var __webpack_exports__ = (__webpack_exec__("../assets/dev/js/frontend/frontend.js"));
/******/ }
]);
//# sourceMappingURL=frontend.js.map