| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
/******/ "use strict"; |
| 3 |
/*!**************************************************************!*\ |
| 4 |
!*** ../modules/pro-install/assets/js/pro-install-events.js ***! |
| 5 |
\**************************************************************/ |
| 6 |
|
| 7 |
|
| 8 |
function getDispatchEvent() { |
| 9 |
var _window$elementorComm, _window$elementorComm2, _eventsManager$dispat; |
| 10 |
var isEnabled = (_window$elementorComm = window.elementorCommon) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.config) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.experimentalFeatures) === null || _window$elementorComm === void 0 ? void 0 : _window$elementorComm.editor_events; |
| 11 |
if (!isEnabled) { |
| 12 |
return null; |
| 13 |
} |
| 14 |
var eventsManager = (_window$elementorComm2 = window.elementorCommon) === null || _window$elementorComm2 === void 0 ? void 0 : _window$elementorComm2.eventsManager; |
| 15 |
return (eventsManager === null || eventsManager === void 0 || (_eventsManager$dispat = eventsManager.dispatchEvent) === null || _eventsManager$dispat === void 0 ? void 0 : _eventsManager$dispat.bind(eventsManager)) || null; |
| 16 |
} |
| 17 |
function trackEditorEvent(eventName, eventData) { |
| 18 |
var dispatchEvent = getDispatchEvent(); |
| 19 |
if (!dispatchEvent) { |
| 20 |
return; |
| 21 |
} |
| 22 |
dispatchEvent(eventName, eventData); |
| 23 |
} |
| 24 |
window.trackUpgradeNowClickEvent = function () { |
| 25 |
trackEditorEvent('upgrade_subscription', { |
| 26 |
app_type: 'editor', |
| 27 |
location: 'Elementor WP-admin pages', |
| 28 |
secondaryLocation: 'Connect account page', |
| 29 |
trigger: 'click' |
| 30 |
}); |
| 31 |
}; |
| 32 |
window.trackConnectAccountEvent = function () { |
| 33 |
Promise.resolve(trackEditorEvent('connect_account', { |
| 34 |
app_type: 'editor', |
| 35 |
location: 'Elementor WP-admin pages', |
| 36 |
secondaryLocation: 'Connect account page', |
| 37 |
trigger: 'click' |
| 38 |
})).catch(function () {}); |
| 39 |
}; |
| 40 |
window.trackOpenConnectPageEvent = function () { |
| 41 |
trackEditorEvent('open_connect_page', { |
| 42 |
app_type: 'editor', |
| 43 |
location: 'Elementor WP-admin pages', |
| 44 |
secondaryLocation: 'Connect account page', |
| 45 |
trigger: 'page_load' |
| 46 |
}); |
| 47 |
}; |
| 48 |
window.trackProInstallEvent = function () { |
| 49 |
trackEditorEvent('pro_install', { |
| 50 |
app_type: 'editor', |
| 51 |
location: 'Elementor WP-admin pages', |
| 52 |
secondaryLocation: 'Connect account page', |
| 53 |
trigger: 'click' |
| 54 |
}); |
| 55 |
}; |
| 56 |
|
| 57 |
// Attach events on DOM ready |
| 58 |
document.addEventListener('DOMContentLoaded', function () { |
| 59 |
window.trackOpenConnectPageEvent(); |
| 60 |
var upgradeButton = document.querySelector('.elementor-pro-connect-promotion .elementor-box-action .button-upgrade'); |
| 61 |
if (upgradeButton) { |
| 62 |
upgradeButton.addEventListener('click', window.trackUpgradeNowClickEvent); |
| 63 |
} |
| 64 |
var connectButton = document.querySelector('#elementor-connect-license'); |
| 65 |
if (connectButton) { |
| 66 |
connectButton.addEventListener('click', window.trackConnectAccountEvent); |
| 67 |
} |
| 68 |
var proInstallButton = document.querySelector('#elementor-connect-install-pro'); |
| 69 |
if (proInstallButton) { |
| 70 |
proInstallButton.addEventListener('click', window.trackProInstallEvent); |
| 71 |
} |
| 72 |
}); |
| 73 |
/******/ })() |
| 74 |
; |
| 75 |
//# sourceMappingURL=pro-install-events.js.map |