packages
1 year ago
152486453d0e39071cdb.bundle.js
1 year ago
294b4bf3066815c5927f.bundle.min.js
1 year ago
2f08057553c95b827d30.bundle.min.js
1 year ago
4748df03726015eef04f.bundle.min.js
1 year ago
49d9a23b08ff2c138b03.bundle.min.js
1 year ago
49d9a23b08ff2c138b03.bundle.min.js.LICENSE.txt
1 year ago
7b18c3f2f2bfffda289f.bundle.js
1 year ago
9c42cff515a6191fddaf.bundle.min.js
1 year ago
a730ee9caa710006b307.bundle.js
1 year ago
accordion.8799675460c73eb48972.bundle.min.js
1 year ago
accordion.c16b88b2e8a0c50189bc.bundle.js
1 year ago
admin-feedback.js
1 year ago
admin-feedback.min.js
1 year ago
admin-modules.js
1 year ago
admin-modules.min.js
1 year ago
admin-modules.min.js.LICENSE.txt
3 years ago
admin-notifications.js
1 year ago
admin-notifications.min.js
1 year ago
admin-notifications.min.js.LICENSE.txt
1 year ago
admin-top-bar.js
1 year ago
admin-top-bar.min.js
1 year ago
admin.js
1 year ago
admin.min.js
1 year ago
admin.min.js.LICENSE.txt
3 years ago
ai-admin.js
1 year ago
ai-admin.min.js
1 year ago
ai-admin.min.js.LICENSE.txt
2 years ago
ai-gutenberg.js
1 year ago
ai-gutenberg.min.js
1 year ago
ai-gutenberg.min.js.LICENSE.txt
2 years ago
ai-layout.js
1 year ago
ai-layout.min.js
1 year ago
ai-layout.min.js.LICENSE.txt
2 years ago
ai-media-library.js
1 year ago
ai-media-library.min.js
1 year ago
ai-media-library.min.js.LICENSE.txt
2 years ago
ai.js
1 year ago
ai.min.js
1 year ago
ai.min.js.LICENSE.txt
1 year ago
alert.c3c6a3fdf4745bd26b7f.bundle.js
1 year ago
alert.cbc2a0fee74ee3ed0419.bundle.min.js
1 year ago
announcements-app.js
1 year ago
announcements-app.min.js
1 year ago
announcements-app.min.js.LICENSE.txt
3 years ago
app-loader.js
1 year ago
app-loader.min.js
1 year ago
app-packages.js
1 year ago
app-packages.min.js
1 year ago
app-packages.min.js.LICENSE.txt
3 years ago
app.js
1 year ago
app.min.js
1 year ago
app.min.js.LICENSE.txt
3 years ago
atomic-widgets-editor.js
1 year ago
atomic-widgets-editor.min.js
1 year ago
b7931adecb98651a09c7.bundle.min.js
1 year ago
bdd4030576f6a94a4f0d.bundle.js
1 year ago
beta-tester.js
1 year ago
beta-tester.min.js
1 year ago
c96bb3445f3bc9de7d26.bundle.min.js
1 year ago
checklist.js
1 year ago
checklist.min.js
1 year ago
checklist.min.js.LICENSE.txt
1 year ago
common-modules.js
1 year ago
common-modules.min.js
1 year ago
common.js
1 year ago
common.min.js
1 year ago
common.min.js.LICENSE.txt
3 years ago
contact-buttons.31aad77620f461830ce9.bundle.min.js
1 year ago
contact-buttons.a5e2cc7274ba4c94eb66.bundle.js
1 year ago
container-converter.js
1 year ago
container-converter.min.js
1 year ago
container.a7f0a15dfa05df34e1f7.bundle.js
1 year ago
container.c65a2a923085e1120e75.bundle.min.js
1 year ago
counter.02cef29c589e742d4c8c.bundle.min.js
1 year ago
counter.3f74a246dff765f39aea.bundle.js
1 year ago
d91e4d7f57d57af2aab9.bundle.min.js
1 year ago
d9299811bc70ddb82fbf.bundle.js
1 year ago
dev-tools.js
1 year ago
dev-tools.min.js
1 year ago
e-home-screen.js
1 year ago
e-home-screen.min.js
1 year ago
e-wc-product-editor.js
1 year ago
e-wc-product-editor.min.js
1 year ago
e-wc-product-editor.min.js.LICENSE.txt
1 year ago
e3f753621bf9be55ec4d.bundle.js
1 year ago
editor-document.js
1 year ago
editor-document.min.js
1 year ago
editor-environment-v2.js
1 year ago
editor-environment-v2.min.js
1 year ago
editor-loader-v1.js
1 year ago
editor-loader-v1.min.js
1 year ago
editor-loader-v2.js
1 year ago
editor-loader-v2.min.js
1 year ago
editor-modules.js
1 year ago
editor-modules.min.js
1 year ago
editor-modules.min.js.LICENSE.txt
3 years ago
editor-notifications.js
1 year ago
editor-notifications.min.js
1 year ago
editor-notifications.min.js.LICENSE.txt
1 year ago
editor.js
1 year ago
editor.min.js
1 year ago
editor.min.js.LICENSE.txt
1 year ago
element-manager-admin.js
1 year ago
element-manager-admin.min.js
1 year ago
element-manager-admin.min.js.LICENSE.txt
2 years ago
elementor-admin-bar.js
1 year ago
elementor-admin-bar.min.js
1 year ago
f634673e5824ceb13f3d.bundle.js
1 year ago
fa0cbd4c7b6a8ad83224.bundle.js
1 year ago
fd6a00ae23a1bc2c6190.bundle.js
1 year ago
floating-bars.1ebb83f158244b35bda6.bundle.js
1 year ago
floating-bars.e4547b87bc6fb09381ca.bundle.min.js
1 year ago
floating-elements-modal.js
1 year ago
floating-elements-modal.min.js
1 year ago
frontend-modules.js
1 year ago
frontend-modules.min.js
1 year ago
frontend.js
1 year ago
frontend.min.js
1 year ago
gutenberg.js
1 year ago
gutenberg.min.js
1 year ago
image-carousel.4455c6362492d9067512.bundle.min.js
1 year ago
image-carousel.9399f19d95d7300cbc2e.bundle.js
1 year ago
import-export-admin.js
1 year ago
import-export-admin.min.js
1 year ago
kit-elements-defaults-editor.js
1 year ago
kit-elements-defaults-editor.min.js
1 year ago
kit-elements-defaults-editor.min.js.LICENSE.txt
3 years ago
kit-library.1f8d31888dc9d19dd031.bundle.min.js
1 year ago
kit-library.ac1a4cd5deae5526ce49.bundle.js
1 year ago
lightbox.01a419d1fcdd47a75a77.bundle.min.js
1 year ago
lightbox.2c9ae19597fcd2a76c3a.bundle.js
1 year ago
media-hints.js
1 year ago
media-hints.min.js
1 year ago
nested-accordion.82e5c4e9017e457a5f2e.bundle.js
1 year ago
nested-accordion.c3b109b714293a16bd95.bundle.min.js
1 year ago
nested-accordion.js
1 year ago
nested-accordion.min.js
1 year ago
nested-accordion.min.js.LICENSE.txt
3 years ago
nested-elements.js
1 year ago
nested-elements.min.js
1 year ago
nested-tabs.js
1 year ago
nested-tabs.min.js
1 year ago
nested-tabs.min.js.LICENSE.txt
3 years ago
nested-title-keyboard-handler.0b608656da2be746fb80.bundle.min.js
1 year ago
nested-title-keyboard-handler.92a73d7a8a75bcb8cd67.bundle.js
1 year ago
new-template.js
1 year ago
new-template.min.js
1 year ago
notes.js
1 year ago
notes.min.js
1 year ago
onboarding.4a4002ff7ea58bfa166e.bundle.min.js
1 year ago
onboarding.5ceee1b219b66e943cb0.bundle.js
1 year ago
progress.6d15c16f0f5c4792940f.bundle.js
1 year ago
progress.985f012a6336ab21cb44.bundle.min.js
1 year ago
responsive-bar.js
1 year ago
responsive-bar.min.js
1 year ago
styleguide-app-initiator.js
1 year ago
styleguide-app-initiator.min.js
1 year ago
styleguide-app-initiator.min.js.LICENSE.txt
3 years ago
styleguide.js
1 year ago
styleguide.min.js
1 year ago
tabs.520bc2ed4560c561029e.bundle.js
1 year ago
tabs.c2af5be7f9cb3cdcf3d5.bundle.min.js
1 year ago
text-editor.2c35aafbe5bf0e127950.bundle.min.js
1 year ago
text-editor.2f2f7e0ea1e16387a004.bundle.js
1 year ago
text-path.39fb59e43970222f5a3e.bundle.min.js
1 year ago
text-path.39fb59e43970222f5a3e.bundle.min.js.LICENSE.txt
1 year ago
text-path.a20877e832db83423958.bundle.js
1 year ago
toggle.31881477c45ff5cf9d4d.bundle.min.js
1 year ago
toggle.d79746a764407a0828ee.bundle.js
1 year ago
video.78c625e89ab767d621c5.bundle.min.js
1 year ago
video.817bd6a65a1542503aac.bundle.js
1 year ago
web-cli.js
1 year ago
web-cli.min.js
1 year ago
web-cli.min.js.LICENSE.txt
3 years ago
webpack.runtime.js
1 year ago
webpack.runtime.min.js
1 year ago
wp-audio.75f0ced143febb8cd31a.bundle.min.js
1 year ago
wp-audio.b8efdc046bc9df72a075.bundle.js
1 year ago
floating-bars.1ebb83f158244b35bda6.bundle.js
461 lines
| 1 | /*! elementor - v3.25.0 - 16-10-2024 */ |
| 2 | (self["webpackChunkelementor"] = self["webpackChunkelementor"] || []).push([["floating-bars"],{ |
| 3 | |
| 4 | /***/ "../modules/floating-buttons/assets/js/floating-bars/frontend/classes/floatin-bar-dom.js": |
| 5 | /*!***********************************************************************************************!*\ |
| 6 | !*** ../modules/floating-buttons/assets/js/floating-bars/frontend/classes/floatin-bar-dom.js ***! |
| 7 | \***********************************************************************************************/ |
| 8 | /***/ ((__unused_webpack_module, exports) => { |
| 9 | |
| 10 | "use strict"; |
| 11 | |
| 12 | |
| 13 | Object.defineProperty(exports, "__esModule", ({ |
| 14 | value: true |
| 15 | })); |
| 16 | exports["default"] = void 0; |
| 17 | class FloatingBarDomHelper { |
| 18 | constructor($element) { |
| 19 | this.$element = $element; |
| 20 | } |
| 21 | maybeMoveToTop() { |
| 22 | const el = this.$element[0]; |
| 23 | const widget = el.querySelector('.e-floating-bars'); |
| 24 | if (elementorFrontend.isEditMode()) { |
| 25 | widget.classList.add('is-sticky'); |
| 26 | return; |
| 27 | } |
| 28 | if (el.dataset.widget_type.startsWith('floating-bars') && widget.classList.contains('has-vertical-position-top') && !widget.classList.contains('is-sticky')) { |
| 29 | const wpAdminBar = document.getElementById('wpadminbar'); |
| 30 | const elementToInsert = el.closest('.elementor'); |
| 31 | if (wpAdminBar) { |
| 32 | wpAdminBar.after(elementToInsert); |
| 33 | } else { |
| 34 | document.body.prepend(elementToInsert); |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | exports["default"] = FloatingBarDomHelper; |
| 40 | |
| 41 | /***/ }), |
| 42 | |
| 43 | /***/ "../modules/floating-buttons/assets/js/floating-bars/frontend/handlers/floating-bars.js": |
| 44 | /*!**********************************************************************************************!*\ |
| 45 | !*** ../modules/floating-buttons/assets/js/floating-bars/frontend/handlers/floating-bars.js ***! |
| 46 | \**********************************************************************************************/ |
| 47 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 48 | |
| 49 | "use strict"; |
| 50 | |
| 51 | |
| 52 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 53 | Object.defineProperty(exports, "__esModule", ({ |
| 54 | value: true |
| 55 | })); |
| 56 | exports["default"] = void 0; |
| 57 | var _base = _interopRequireDefault(__webpack_require__(/*! elementor-frontend/handlers/base */ "../assets/dev/js/frontend/handlers/base.js")); |
| 58 | var _floatinBarDom = _interopRequireDefault(__webpack_require__(/*! ../classes/floatin-bar-dom */ "../modules/floating-buttons/assets/js/floating-bars/frontend/classes/floatin-bar-dom.js")); |
| 59 | var _clickTracking = _interopRequireDefault(__webpack_require__(/*! ../../../shared/frontend/handlers/click-tracking */ "../modules/floating-buttons/assets/js/shared/frontend/handlers/click-tracking.js")); |
| 60 | class FloatingBarsHandler extends _base.default { |
| 61 | getDefaultSettings() { |
| 62 | return { |
| 63 | selectors: { |
| 64 | main: '.e-floating-bars', |
| 65 | closeButton: '.e-floating-bars__close-button', |
| 66 | ctaButton: '.e-floating-bars__cta-button' |
| 67 | }, |
| 68 | constants: { |
| 69 | ctaEntranceAnimation: 'style_cta_button_animation', |
| 70 | ctaEntranceAnimationDelay: 'style_cta_button_animation_delay', |
| 71 | hasEntranceAnimation: 'has-entrance-animation', |
| 72 | visible: 'visible', |
| 73 | isSticky: 'is-sticky', |
| 74 | hasVerticalPositionTop: 'has-vertical-position-top', |
| 75 | hasVerticalPositionBottom: 'has-vertical-position-bottom', |
| 76 | isHidden: 'is-hidden', |
| 77 | animated: 'animated' |
| 78 | } |
| 79 | }; |
| 80 | } |
| 81 | getDefaultElements() { |
| 82 | const selectors = this.getSettings('selectors'); |
| 83 | return { |
| 84 | main: this.$element[0].querySelector(selectors.main), |
| 85 | mainAll: this.$element[0].querySelectorAll(selectors.main), |
| 86 | closeButton: this.$element[0].querySelector(selectors.closeButton), |
| 87 | ctaButton: this.$element[0].querySelector(selectors.ctaButton) |
| 88 | }; |
| 89 | } |
| 90 | onElementChange(property) { |
| 91 | const changedProperties = ['advanced_vertical_position']; |
| 92 | if (changedProperties.includes(property)) { |
| 93 | this.initDefaultState(); |
| 94 | } |
| 95 | } |
| 96 | getResponsiveSetting(controlName) { |
| 97 | const currentDevice = elementorFrontend.getCurrentDeviceMode(); |
| 98 | return elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(), controlName, '', currentDevice); |
| 99 | } |
| 100 | bindEvents() { |
| 101 | if (this.elements.closeButton) { |
| 102 | this.elements.closeButton.addEventListener('click', this.closeFloatingBar.bind(this)); |
| 103 | } |
| 104 | if (this.elements.ctaButton) { |
| 105 | this.elements.ctaButton.addEventListener('animationend', this.handleAnimationEnd.bind(this)); |
| 106 | } |
| 107 | if (this.elements.main) { |
| 108 | window.addEventListener('keyup', this.onDocumentKeyup.bind(this)); |
| 109 | } |
| 110 | if (this.hasStickyElements()) { |
| 111 | window.addEventListener('resize', this.handleStickyElements.bind(this)); |
| 112 | } |
| 113 | } |
| 114 | isStickyTop() { |
| 115 | const { |
| 116 | isSticky, |
| 117 | hasVerticalPositionTop |
| 118 | } = this.getSettings('constants'); |
| 119 | return this.elements.main.classList.contains(isSticky) && this.elements.main.classList.contains(hasVerticalPositionTop); |
| 120 | } |
| 121 | isStickyBottom() { |
| 122 | const { |
| 123 | isSticky, |
| 124 | hasVerticalPositionBottom |
| 125 | } = this.getSettings('constants'); |
| 126 | return this.elements.main.classList.contains(isSticky) && this.elements.main.classList.contains(hasVerticalPositionBottom); |
| 127 | } |
| 128 | hasStickyElements() { |
| 129 | const stickyElements = document.querySelectorAll('.elementor-sticky'); |
| 130 | return stickyElements.length > 0; |
| 131 | } |
| 132 | focusOnLoad() { |
| 133 | this.elements.main.setAttribute('tabindex', '0'); |
| 134 | this.elements.main.focus({ |
| 135 | focusVisible: true |
| 136 | }); |
| 137 | } |
| 138 | applyBodyPadding() { |
| 139 | const mainHeight = this.elements.main.offsetHeight; |
| 140 | document.body.style.paddingTop = `${mainHeight}px`; |
| 141 | } |
| 142 | removeBodyPadding() { |
| 143 | document.body.style.paddingTop = '0'; |
| 144 | } |
| 145 | handleWPAdminBar() { |
| 146 | const wpAdminBar = elementorFrontend.elements.$wpAdminBar; |
| 147 | if (wpAdminBar.length) { |
| 148 | this.elements.main.style.top = `${wpAdminBar.height()}px`; |
| 149 | } |
| 150 | } |
| 151 | handleStickyElements() { |
| 152 | const mainHeight = this.elements.main.offsetHeight; |
| 153 | const wpAdminBar = elementorFrontend.elements.$wpAdminBar; |
| 154 | const stickyElements = document.querySelectorAll('.elementor-sticky:not(.elementor-sticky__spacer)'); |
| 155 | if (0 === stickyElements.length) { |
| 156 | return; |
| 157 | } |
| 158 | stickyElements.forEach(stickyElement => { |
| 159 | const dataSettings = stickyElement.getAttribute('data-settings'); |
| 160 | const stickyPosition = JSON.parse(dataSettings)?.sticky; |
| 161 | const isTop = '0px' === stickyElement.style.top || 'top' === stickyPosition; |
| 162 | const isBottom = '0px' === stickyElement.style.bottom || 'bottom' === stickyPosition; |
| 163 | if (this.isStickyTop() && isTop) { |
| 164 | if (wpAdminBar.length) { |
| 165 | stickyElement.style.top = `${mainHeight + wpAdminBar.height()}px`; |
| 166 | } else { |
| 167 | stickyElement.style.top = `${mainHeight}px`; |
| 168 | } |
| 169 | } else if (this.isStickyBottom() && isBottom) { |
| 170 | stickyElement.style.bottom = `${mainHeight}px`; |
| 171 | } |
| 172 | if (elementorFrontend.isEditMode()) { |
| 173 | if (isTop) { |
| 174 | stickyElement.style.top = this.isStickyTop() ? `${mainHeight}px` : '0px'; |
| 175 | } else if (isBottom) { |
| 176 | stickyElement.style.bottom = this.isStickyBottom() ? `${mainHeight}px` : '0px'; |
| 177 | } |
| 178 | } |
| 179 | }); |
| 180 | document.querySelectorAll('.elementor-sticky__spacer').forEach(stickySpacer => { |
| 181 | const dataSettings = stickySpacer.getAttribute('data-settings'); |
| 182 | const stickyPosition = JSON.parse(dataSettings)?.sticky; |
| 183 | const isTop = '0px' === stickySpacer.style.top || 'top' === stickyPosition; |
| 184 | if (this.isStickyTop() && isTop) { |
| 185 | stickySpacer.style.marginBottom = `${mainHeight}px`; |
| 186 | } |
| 187 | }); |
| 188 | } |
| 189 | closeFloatingBar() { |
| 190 | const { |
| 191 | isHidden |
| 192 | } = this.getSettings('constants'); |
| 193 | if (!elementorFrontend.isEditMode()) { |
| 194 | this.elements.main.classList.add(isHidden); |
| 195 | if (this.hasStickyElements()) { |
| 196 | this.handleStickyElements(); |
| 197 | } else if (this.isStickyTop()) { |
| 198 | this.removeBodyPadding(); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | initEntranceAnimation() { |
| 203 | const { |
| 204 | animated, |
| 205 | ctaEntranceAnimation, |
| 206 | ctaEntranceAnimationDelay, |
| 207 | hasEntranceAnimation |
| 208 | } = this.getSettings('constants'); |
| 209 | const entranceAnimationClass = this.getResponsiveSetting(ctaEntranceAnimation); |
| 210 | const entranceAnimationDelay = this.getResponsiveSetting(ctaEntranceAnimationDelay) || 0; |
| 211 | const setTimeoutDelay = entranceAnimationDelay + 500; |
| 212 | this.elements.ctaButton.classList.add(animated); |
| 213 | this.elements.ctaButton.classList.add(entranceAnimationClass); |
| 214 | setTimeout(() => { |
| 215 | this.elements.ctaButton.classList.remove(hasEntranceAnimation); |
| 216 | }, setTimeoutDelay); |
| 217 | } |
| 218 | handleAnimationEnd() { |
| 219 | this.removeEntranceAnimationClasses(); |
| 220 | this.focusOnLoad(); |
| 221 | } |
| 222 | removeEntranceAnimationClasses() { |
| 223 | if (!this.elements.ctaButton) { |
| 224 | return; |
| 225 | } |
| 226 | const { |
| 227 | animated, |
| 228 | ctaEntranceAnimation, |
| 229 | visible |
| 230 | } = this.getSettings('constants'); |
| 231 | const entranceAnimationClass = this.getResponsiveSetting(ctaEntranceAnimation); |
| 232 | this.elements.ctaButton.classList.remove(animated); |
| 233 | this.elements.ctaButton.classList.remove(entranceAnimationClass); |
| 234 | this.elements.ctaButton.classList.add(visible); |
| 235 | } |
| 236 | onDocumentKeyup(event) { |
| 237 | // Bail if not ESC key |
| 238 | if (event.keyCode !== 27 || !this.elements.main) { |
| 239 | return; |
| 240 | } |
| 241 | |
| 242 | /* eslint-disable @wordpress/no-global-active-element */ |
| 243 | if (this.elements.main.contains(document.activeElement)) { |
| 244 | this.closeFloatingBar(); |
| 245 | } |
| 246 | /* eslint-enable @wordpress/no-global-active-element */ |
| 247 | } |
| 248 | |
| 249 | initDefaultState() { |
| 250 | const { |
| 251 | hasEntranceAnimation |
| 252 | } = this.getSettings('constants'); |
| 253 | if (this.isStickyTop()) { |
| 254 | this.handleWPAdminBar(); |
| 255 | } |
| 256 | if (this.hasStickyElements()) { |
| 257 | this.handleStickyElements(); |
| 258 | } else if (this.isStickyTop()) { |
| 259 | this.applyBodyPadding(); |
| 260 | } |
| 261 | if (this.elements.main && !this.elements.ctaButton.classList.contains(hasEntranceAnimation) && !elementorFrontend.isEditMode()) { |
| 262 | this.focusOnLoad(); |
| 263 | } |
| 264 | } |
| 265 | setupInnerContainer() { |
| 266 | this.elements.main.closest('.e-con-inner').classList.add('e-con-inner--floating-bars'); |
| 267 | this.elements.main.closest('.e-con').classList.add('e-con--floating-bars'); |
| 268 | } |
| 269 | onInit() { |
| 270 | const { |
| 271 | hasEntranceAnimation |
| 272 | } = this.getSettings('constants'); |
| 273 | super.onInit(...arguments); |
| 274 | this.clickTrackingHandler = new _clickTracking.default({ |
| 275 | $element: this.$element |
| 276 | }); |
| 277 | const domHelper = new _floatinBarDom.default(this.$element); |
| 278 | domHelper.maybeMoveToTop(); |
| 279 | if (this.elements.ctaButton && this.elements.ctaButton.classList.contains(hasEntranceAnimation)) { |
| 280 | this.initEntranceAnimation(); |
| 281 | } |
| 282 | this.initDefaultState(); |
| 283 | this.setupInnerContainer(); |
| 284 | } |
| 285 | } |
| 286 | exports["default"] = FloatingBarsHandler; |
| 287 | |
| 288 | /***/ }), |
| 289 | |
| 290 | /***/ "../modules/floating-buttons/assets/js/shared/frontend/handlers/click-tracking.js": |
| 291 | /*!****************************************************************************************!*\ |
| 292 | !*** ../modules/floating-buttons/assets/js/shared/frontend/handlers/click-tracking.js ***! |
| 293 | \****************************************************************************************/ |
| 294 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 295 | |
| 296 | "use strict"; |
| 297 | |
| 298 | |
| 299 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 300 | Object.defineProperty(exports, "__esModule", ({ |
| 301 | value: true |
| 302 | })); |
| 303 | exports["default"] = void 0; |
| 304 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 305 | var _base = _interopRequireDefault(__webpack_require__(/*! elementor-frontend/handlers/base */ "../assets/dev/js/frontend/handlers/base.js")); |
| 306 | class ClickTrackingHandler extends _base.default { |
| 307 | constructor() { |
| 308 | super(...arguments); |
| 309 | (0, _defineProperty2.default)(this, "clicks", []); |
| 310 | } |
| 311 | getDefaultSettings() { |
| 312 | return { |
| 313 | selectors: { |
| 314 | contentWrapper: '.e-contact-buttons__content-wrapper', |
| 315 | contactButtonCore: '.e-contact-buttons__send-button', |
| 316 | contentWrapperFloatingBars: '.e-floating-bars', |
| 317 | floatingBarCTAButton: '.e-floating-bars__cta-button', |
| 318 | elementorWrapper: '[data-elementor-type="floating-buttons"]' |
| 319 | } |
| 320 | }; |
| 321 | } |
| 322 | getDefaultElements() { |
| 323 | const selectors = this.getSettings('selectors'); |
| 324 | return { |
| 325 | contentWrapper: this.$element[0].querySelector(selectors.contentWrapper), |
| 326 | contentWrapperFloatingBars: this.$element[0].querySelector(selectors.contentWrapperFloatingBars) |
| 327 | }; |
| 328 | } |
| 329 | bindEvents() { |
| 330 | if (this.elements.contentWrapper) { |
| 331 | this.elements.contentWrapper.addEventListener('click', this.onChatButtonTrackClick.bind(this)); |
| 332 | } |
| 333 | if (this.elements.contentWrapperFloatingBars) { |
| 334 | this.elements.contentWrapperFloatingBars.addEventListener('click', this.onChatButtonTrackClick.bind(this)); |
| 335 | } |
| 336 | window.addEventListener('beforeunload', () => { |
| 337 | if (this.clicks.length > 0) { |
| 338 | this.sendClicks(); |
| 339 | } |
| 340 | }); |
| 341 | } |
| 342 | onChatButtonTrackClick(event) { |
| 343 | const targetElement = event.target || event.srcElement; |
| 344 | const selectors = this.getSettings('selectors'); |
| 345 | if (targetElement.matches(selectors.contactButtonCore) || targetElement.closest(selectors.contactButtonCore) || targetElement.matches(selectors.floatingBarCTAButton) || targetElement.closest(selectors.floatingBarCTAButton)) { |
| 346 | this.getDocumentIdAndTrack(targetElement, selectors); |
| 347 | } |
| 348 | } |
| 349 | getDocumentIdAndTrack(targetElement, selectors) { |
| 350 | const documentId = targetElement.closest(selectors.elementorWrapper).dataset.elementorId; |
| 351 | this.trackClick(documentId); |
| 352 | } |
| 353 | trackClick(documentId) { |
| 354 | if (!documentId) { |
| 355 | return; |
| 356 | } |
| 357 | this.clicks.push(documentId); |
| 358 | if (this.clicks.length >= 10) { |
| 359 | this.sendClicks(); |
| 360 | } |
| 361 | } |
| 362 | sendClicks() { |
| 363 | const formData = new FormData(); |
| 364 | formData.append('action', 'elementor_send_clicks'); |
| 365 | formData.append('_nonce', elementorFrontendConfig?.nonces?.floatingButtonsClickTracking); |
| 366 | this.clicks.forEach(documentId => formData.append('clicks[]', documentId)); |
| 367 | fetch(elementorFrontendConfig?.urls?.ajaxurl, { |
| 368 | method: 'POST', |
| 369 | body: formData |
| 370 | }).then(() => { |
| 371 | this.clicks = []; |
| 372 | }); |
| 373 | } |
| 374 | } |
| 375 | exports["default"] = ClickTrackingHandler; |
| 376 | |
| 377 | /***/ }), |
| 378 | |
| 379 | /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": |
| 380 | /*!****************************************************************!*\ |
| 381 | !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! |
| 382 | \****************************************************************/ |
| 383 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 384 | |
| 385 | var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); |
| 386 | function _defineProperty(obj, key, value) { |
| 387 | key = toPropertyKey(key); |
| 388 | if (key in obj) { |
| 389 | Object.defineProperty(obj, key, { |
| 390 | value: value, |
| 391 | enumerable: true, |
| 392 | configurable: true, |
| 393 | writable: true |
| 394 | }); |
| 395 | } else { |
| 396 | obj[key] = value; |
| 397 | } |
| 398 | return obj; |
| 399 | } |
| 400 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 401 | |
| 402 | /***/ }), |
| 403 | |
| 404 | /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": |
| 405 | /*!*************************************************************!*\ |
| 406 | !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! |
| 407 | \*************************************************************/ |
| 408 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 409 | |
| 410 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 411 | function toPrimitive(t, r) { |
| 412 | if ("object" != _typeof(t) || !t) return t; |
| 413 | var e = t[Symbol.toPrimitive]; |
| 414 | if (void 0 !== e) { |
| 415 | var i = e.call(t, r || "default"); |
| 416 | if ("object" != _typeof(i)) return i; |
| 417 | throw new TypeError("@@toPrimitive must return a primitive value."); |
| 418 | } |
| 419 | return ("string" === r ? String : Number)(t); |
| 420 | } |
| 421 | module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 422 | |
| 423 | /***/ }), |
| 424 | |
| 425 | /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": |
| 426 | /*!***************************************************************!*\ |
| 427 | !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! |
| 428 | \***************************************************************/ |
| 429 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 430 | |
| 431 | var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); |
| 432 | var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); |
| 433 | function toPropertyKey(t) { |
| 434 | var i = toPrimitive(t, "string"); |
| 435 | return "symbol" == _typeof(i) ? i : String(i); |
| 436 | } |
| 437 | module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 438 | |
| 439 | /***/ }), |
| 440 | |
| 441 | /***/ "../node_modules/@babel/runtime/helpers/typeof.js": |
| 442 | /*!********************************************************!*\ |
| 443 | !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! |
| 444 | \********************************************************/ |
| 445 | /***/ ((module) => { |
| 446 | |
| 447 | function _typeof(o) { |
| 448 | "@babel/helpers - typeof"; |
| 449 | |
| 450 | return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { |
| 451 | return typeof o; |
| 452 | } : function (o) { |
| 453 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 454 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); |
| 455 | } |
| 456 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 457 | |
| 458 | /***/ }) |
| 459 | |
| 460 | }]); |
| 461 | //# sourceMappingURL=floating-bars.1ebb83f158244b35bda6.bundle.js.map |