PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.1
Elementor Website Builder – more than just a page builder v4.2.1
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/editor-one-menu.js +1243 -1150 4.3.0 → 4.2.1 View file →
@@ -1,1167 +1,1260 @@
1 -(function() {
1 +/******/ (() => { // webpackBootstrap
2 +/******/ var __webpack_modules__ = ({
2 3
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
4 +/***/ "../assets/dev/js/editor/utils/editor-one-events.js":
5 +/*!**********************************************************!*\
6 + !*** ../assets/dev/js/editor/utils/editor-one-events.js ***!
7 + \**********************************************************/
8 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9 9
10 -//#endregion
10 +"use strict";
11 11
12 -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
13 - function _classCallCheck(a, n) {
14 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
15 - }
16 12
17 -//#endregion
18 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
19 - function _typeof(o) {
20 - "@babel/helpers - typeof";
21 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
22 - return typeof o;
23 - } : function(o) {
24 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
25 - }, _typeof(o);
26 - }
13 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
14 +Object.defineProperty(exports, "__esModule", ({
15 + value: true
16 +}));
17 +exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0;
18 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
19 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
20 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
21 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23 +var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () {
24 + function EditorOneEventManager() {
25 + (0, _classCallCheck2.default)(this, EditorOneEventManager);
26 + }
27 + return (0, _createClass2.default)(EditorOneEventManager, null, [{
28 + key: "getEventsManager",
29 + value: function getEventsManager() {
30 + var _elementorCommon;
31 + return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
32 + }
33 + }, {
34 + key: "getConfig",
35 + value: function getConfig() {
36 + var _this$getEventsManage;
37 + return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
38 + }
39 + }, {
40 + key: "canSendEvents",
41 + value: function canSendEvents() {
42 + var _elementorCommon2;
43 + return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false;
44 + }
45 + }, {
46 + key: "isEventsManagerAvailable",
47 + value: function isEventsManagerAvailable() {
48 + var eventsManager = this.getEventsManager();
49 + return eventsManager && 'function' === typeof eventsManager.dispatchEvent;
50 + }
51 + }, {
52 + key: "dispatchEvent",
53 + value: function dispatchEvent(eventName, payload) {
54 + if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
55 + return false;
56 + }
57 + this.getEventsManager().dispatchEvent(eventName, payload);
58 + }
59 + }, {
60 + key: "toLowerSnake",
61 + value: function toLowerSnake(value) {
62 + if (!value || 'string' !== typeof value) {
63 + return value;
64 + }
65 + return value.replace(/\s+/g, '_').toLowerCase();
66 + }
67 + }, {
68 + key: "decodeHtmlEntities",
69 + value: function decodeHtmlEntities(text) {
70 + if (!text || 'string' !== typeof text) {
71 + return text;
72 + }
73 + var doc = new DOMParser().parseFromString(text, 'text/html');
74 + return doc.body.textContent || text;
75 + }
76 + }, {
77 + key: "isInEditorContext",
78 + value: function isInEditorContext() {
79 + var _window$elementor;
80 + return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
81 + }
82 + }, {
83 + key: "getFinderContext",
84 + value: function getFinderContext() {
85 + var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
86 + var config = this.getConfig();
87 + var isEditor = this.isInEditorContext();
88 + return {
89 + windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin,
90 + targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar)
91 + };
92 + }
93 + }, {
94 + key: "createBasePayload",
95 + value: function createBasePayload() {
96 + var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
97 + var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
98 + var config = this.getConfig();
99 + return _objectSpread({
100 + app_type: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : 'editor',
101 + window_name: (_config$appTypes$edit2 = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.editor) !== null && _config$appTypes$edit2 !== void 0 ? _config$appTypes$edit2 : 'editor'
102 + }, overrides);
103 + }
104 + }, {
105 + key: "sendTopBarPublishDropdown",
106 + value: function sendTopBarPublishDropdown(targetName) {
107 + var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
108 + var config = this.getConfig();
109 + return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({
110 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
111 + target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
112 + target_name: targetName,
113 + interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
114 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
115 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
116 + location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
117 + interaction_description: 'User selected an action from the publish dropdown'
118 + }));
119 + }
120 + }, {
121 + key: "sendTopBarPageList",
122 + value: function sendTopBarPageList(targetName) {
123 + var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
124 + var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
125 + var config = this.getConfig();
126 + return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({
127 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
128 + target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
129 + target_name: targetName,
130 + interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate,
131 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
132 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
133 + location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
134 + interaction_description: 'User selected an action from the page list dropdown'
135 + }));
136 + }
137 + }, {
138 + key: "sendSiteSettingsSession",
139 + value: function sendSiteSettingsSession(_ref) {
140 + var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
141 + var targetType = _ref.targetType,
142 + _ref$visitedItems = _ref.visitedItems,
143 + visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
144 + _ref$savedItems = _ref.savedItems,
145 + savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
146 + state = _ref.state;
147 + var config = this.getConfig();
148 + return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({
149 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
150 + target_type: targetType,
151 + target_name: 'site_settings',
152 + interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
153 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
154 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
155 + interaction_description: 'Records areas visited as part of the site setting session',
156 + metadata: {
157 + visited_items: visitedItems,
158 + saved_items: savedItems
159 + },
160 + state: state
161 + }));
162 + }
163 + }, {
164 + key: "sendELibraryNav",
165 + value: function sendELibraryNav(tabName) {
166 + var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
167 + var config = this.getConfig();
168 + return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({
169 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
170 + target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
171 + target_name: this.toLowerSnake(tabName),
172 + interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
173 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
174 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
175 + interaction_description: 'User navigates within elementor library'
176 + }));
177 + }
178 + }, {
179 + key: "sendELibraryInsert",
180 + value: function sendELibraryInsert(_ref2) {
181 + var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
182 + var assetId = _ref2.assetId,
183 + assetName = _ref2.assetName,
184 + libraryType = _ref2.libraryType,
185 + _ref2$proRequired = _ref2.proRequired,
186 + proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
187 + var config = this.getConfig();
188 + var payload = this.createBasePayload({
189 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
190 + target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
191 + target_name: String(assetId),
192 + interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
193 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
194 + location_l1: this.toLowerSnake(libraryType),
195 + location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
196 + interaction_description: 'User inserts block/pages from elementor library',
197 + metadata: {
198 + template_id: String(assetId),
199 + template_name: this.decodeHtmlEntities(assetName) || ''
200 + }
201 + });
202 + if (proRequired) {
203 + payload.state = 'pro_plan_required';
204 + }
205 + return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload);
206 + }
207 + }, {
208 + key: "sendELibraryFavorite",
209 + value: function sendELibraryFavorite(_ref3) {
210 + var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
211 + var assetId = _ref3.assetId,
212 + assetName = _ref3.assetName,
213 + libraryType = _ref3.libraryType,
214 + isFavorite = _ref3.isFavorite,
215 + _ref3$proRequired = _ref3.proRequired,
216 + proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
217 + var config = this.getConfig();
218 + var payload = this.createBasePayload({
219 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
220 + target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
221 + target_name: String(assetId),
222 + interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
223 + target_value: Boolean(isFavorite),
224 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
225 + location_l1: this.toLowerSnake(libraryType),
226 + location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
227 + interaction_description: 'User favorite block/pages from elementor library',
228 + metadata: {
229 + template_id: String(assetId),
230 + template_name: this.decodeHtmlEntities(assetName) || ''
231 + }
232 + });
233 + if (proRequired) {
234 + payload.state = 'pro_plan_required';
235 + }
236 + return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload);
237 + }
238 + }, {
239 + key: "sendELibraryGenerateAi",
240 + value: function sendELibraryGenerateAi(_ref4) {
241 + var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
242 + var assetId = _ref4.assetId,
243 + assetName = _ref4.assetName,
244 + libraryType = _ref4.libraryType;
245 + var config = this.getConfig();
246 + return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({
247 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
248 + target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
249 + target_name: String(assetId),
250 + interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
251 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
252 + location_l1: this.toLowerSnake(libraryType),
253 + location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
254 + interaction_description: 'User generated block/page based on a library asset',
255 + metadata: {
256 + template_id: String(assetId),
257 + template_name: this.decodeHtmlEntities(assetName) || ''
258 + }
259 + }));
260 + }
261 + }, {
262 + key: "sendFinderSearchInput",
263 + value: function sendFinderSearchInput(_ref5) {
264 + var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
265 + var resultsCount = _ref5.resultsCount,
266 + _ref5$searchTerm = _ref5.searchTerm,
267 + searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
268 + var config = this.getConfig();
269 + var hasResults = resultsCount > 0;
270 + var finderContext = this.getFinderContext();
271 + var payload = this.createBasePayload({
272 + window_name: finderContext.windowName,
273 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
274 + target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
275 + target_name: 'finder',
276 + interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults,
277 + target_location: finderContext.targetLocation,
278 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
279 + interaction_description: 'Finder search input, follows debounce behavior',
280 + metadata: {
281 + results_count: resultsCount
282 + }
283 + });
284 + if (!hasResults && searchTerm) {
285 + payload.metadata.search_term = searchTerm;
286 + }
287 + return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload);
288 + }
289 + }, {
290 + key: "sendFinderResultSelect",
291 + value: function sendFinderResultSelect(choice) {
292 + var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
293 + var config = this.getConfig();
294 + var finderContext = this.getFinderContext();
295 + return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({
296 + window_name: finderContext.windowName,
297 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
298 + target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
299 + target_name: choice,
300 + interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
301 + target_location: finderContext.targetLocation,
302 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
303 + location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
304 + interaction_description: 'Finder search results was selected'
305 + }));
306 + }
307 + }, {
308 + key: "sendCanvasEmptyBoxAction",
309 + value: function sendCanvasEmptyBoxAction(_ref6) {
310 + var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
311 + var targetName = _ref6.targetName,
312 + _ref6$metadata = _ref6.metadata,
313 + metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
314 + _ref6$containerCreate = _ref6.containerCreated,
315 + containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
316 + var config = this.getConfig();
317 + var payload = this.createBasePayload({
318 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
319 + target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
320 + target_name: targetName,
321 + interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
322 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
323 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
324 + interaction_description: 'Empty box on canvas actions'
325 + });
326 + if (Object.keys(metadata).length > 0) {
327 + payload.metadata = metadata;
328 + }
329 + if (containerCreated !== null) {
330 + payload.state = containerCreated;
331 + }
332 + return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload);
333 + }
334 + }, {
335 + key: "sendWidgetPanelSearch",
336 + value: function sendWidgetPanelSearch(_ref7) {
337 + var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
338 + var resultsCount = _ref7.resultsCount,
339 + _ref7$userInput = _ref7.userInput,
340 + userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
341 + var config = this.getConfig();
342 + var hasResults = resultsCount > 0;
343 + var payload = this.createBasePayload({
344 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
345 + target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
346 + target_name: 'search_widget',
347 + interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults,
348 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
349 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
350 + location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
351 + interaction_description: 'Widget search input, follows debounce behavior'
352 + });
353 + if (!hasResults && userInput) {
354 + payload.metadata = {
355 + user_input: userInput
356 + };
357 + }
358 + return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload);
359 + }
360 + }, {
361 + key: "createWpDashPayload",
362 + value: function createWpDashPayload() {
363 + var _config$appTypes$wpDa, _config$appTypes5, _config$locations11;
364 + var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
365 + var config = this.getConfig();
366 + return this.createBasePayload(_objectSpread({
367 + window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes5 = config.appTypes) === null || _config$appTypes5 === void 0 ? void 0 : _config$appTypes5.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : 'wpdash',
368 + target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
369 + location_l2: ''
370 + }, overrides));
371 + }
372 + }, {
373 + key: "sendWpDashElementorMenuClick",
374 + value: function sendWpDashElementorMenuClick() {
375 + var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11;
376 + var config = this.getConfig();
377 + return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({
378 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
379 + target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
380 + target_name: 'elementor_menu_item',
381 + interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
382 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
383 + interaction_description: 'core_user_clicked_elementor_menu_item'
384 + }));
385 + }
386 + }, {
387 + key: "sendWpDashEditorSubMenuHover",
388 + value: function sendWpDashEditorSubMenuHover() {
389 + var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12;
390 + var config = this.getConfig();
391 + return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({
392 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
393 + target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
394 + target_name: 'wpdash_editor_sub_menu',
395 + interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
396 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
397 + interaction_description: 'core_user_hovered_sub_menu'
398 + }));
399 + }
400 + }, {
401 + key: "sendWpDashThemeBuilderClick",
402 + value: function sendWpDashThemeBuilderClick() {
403 + var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13;
404 + var config = this.getConfig();
405 + return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({
406 + interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
407 + target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
408 + target_name: 'theme_builder_menu_item',
409 + interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
410 + location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
411 + interaction_description: 'core_user_clicked_theme_builder_menu_item'
412 + }));
413 + }
414 + }]);
415 +}();
416 +var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
417 + var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
418 + return _.debounce(function (resultsCount, searchTerm) {
419 + EditorOneEventManager.sendFinderSearchInput({
420 + resultsCount: resultsCount,
421 + searchTerm: searchTerm
422 + });
423 + }, delay);
424 +};
425 +var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
426 + var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
427 + return _.debounce(function (resultsCount, userInput) {
428 + EditorOneEventManager.sendWidgetPanelSearch({
429 + resultsCount: resultsCount,
430 + userInput: userInput
431 + });
432 + }, delay);
433 +};
434 +var _default = exports["default"] = EditorOneEventManager;
27 435
28 -//#endregion
29 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
30 - function toPrimitive(t, r) {
31 - if ("object" != _typeof(t) || !t) return t;
32 - var e = t[Symbol.toPrimitive];
33 - if (void 0 !== e) {
34 - var i = e.call(t, r || "default");
35 - if ("object" != _typeof(i)) return i;
36 - throw new TypeError("@@toPrimitive must return a primitive value.");
37 - }
38 - return ("string" === r ? String : Number)(t);
39 - }
436 +/***/ }),
40 437
41 -//#endregion
42 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
43 - function toPropertyKey(t) {
44 - var i = toPrimitive(t, "string");
45 - return "symbol" == _typeof(i) ? i : i + "";
46 - }
438 +/***/ "../modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js":
439 +/*!****************************************************************************************!*\
440 + !*** ../modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js ***!
441 + \****************************************************************************************/
442 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
47 443
48 -//#endregion
49 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
50 - function _defineProperties(e, r) {
51 - for (var t = 0; t < r.length; t++) {
52 - var o = r[t];
53 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
54 - }
55 - }
56 - function _createClass(e, r, t) {
57 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
58 - }
444 +"use strict";
59 445
60 -//#endregion
61 -//#region modules/editor-one/assets/js/admin-menu/classes/flyout-menu-renderer.js
62 - var FlyoutMenuRenderer = /*#__PURE__*/ function() {
63 - function FlyoutMenuRenderer(config) {
64 - _classCallCheck(this, FlyoutMenuRenderer);
65 - this.config = config;
66 - }
67 - return _createClass(FlyoutMenuRenderer, [{
68 - key: "render",
69 - value: function render() {
70 - var editorFlyout = this.config.editorFlyout;
71 - if (!editorFlyout || !editorFlyout.items || !editorFlyout.items.length) return false;
72 - var editorLi = this.findEditorInMenu("#toplevel_page_elementor-home");
73 - if (!editorLi) return false;
74 - editorLi.classList.add("elementor-has-flyout");
75 - var editorFlyoutUl = document.createElement("ul");
76 - editorFlyoutUl.className = "elementor-submenu-flyout elementor-level-3";
77 - editorFlyout.items.forEach(function(item) {
78 - if (item.has_divider_before) {
79 - var dividerLi = document.createElement("li");
80 - dividerLi.className = "elementor-flyout-divider";
81 - dividerLi.setAttribute("role", "separator");
82 - editorFlyoutUl.appendChild(dividerLi);
83 - }
84 - var li = document.createElement("li");
85 - li.setAttribute("data-group-id", item.group_id || "");
86 - li.setAttribute("data-slug", item.slug || "");
87 - var a = document.createElement("a");
88 - a.href = item.url;
89 - a.textContent = item.label;
90 - li.appendChild(a);
91 - editorFlyoutUl.appendChild(li);
92 - });
93 - editorLi.appendChild(editorFlyoutUl);
94 - return true;
95 - }
96 - }, {
97 - key: "findEditorInMenu",
98 - value: function findEditorInMenu(menuSelector) {
99 - var menuItem = document.querySelector(menuSelector);
100 - if (!menuItem) return null;
101 - var submenu = menuItem.querySelector(".wp-submenu");
102 - if (!submenu) return null;
103 - var editorItem = submenu.querySelector("a[href$=\"page=elementor\"]");
104 - if (!editorItem) return null;
105 - return editorItem.closest("li");
106 - }
107 - }]);
108 - }();
109 446
110 -//#endregion
111 -//#region modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js
112 - var SidebarMenuHandler = /*#__PURE__*/ function() {
113 - function SidebarMenuHandler() {
114 - _classCallCheck(this, SidebarMenuHandler);
115 - this.elementorHomeMenu = this.findElementorHomeMenu();
116 - if (this.elementorHomeMenu) {
117 - this.deactivateOtherMenus();
118 - this.activateElementorMenu();
119 - this.highlightSubmenu();
120 - }
121 - }
122 - return _createClass(SidebarMenuHandler, [
123 - {
124 - key: "findElementorHomeMenu",
125 - value: function findElementorHomeMenu() {
126 - return document.querySelector("#toplevel_page_elementor-home");
127 - }
128 - },
129 - {
130 - key: "deactivateOtherMenus",
131 - value: function deactivateOtherMenus() {
132 - var _this = this;
133 - document.querySelectorAll("#adminmenu li.wp-has-current-submenu").forEach(function(item) {
134 - if (item !== _this.elementorHomeMenu) {
135 - item.classList.remove("wp-has-current-submenu", "wp-menu-open", "selected");
136 - item.classList.add("wp-not-current-submenu");
137 - var link = item.querySelector(":scope > a");
138 - if (link) link.classList.remove("wp-has-current-submenu", "wp-menu-open", "current");
139 - }
140 - });
141 - }
142 - },
143 - {
144 - key: "activateElementorMenu",
145 - value: function activateElementorMenu() {
146 - this.elementorHomeMenu.classList.remove("wp-not-current-submenu");
147 - this.elementorHomeMenu.classList.add("wp-has-current-submenu", "wp-menu-open", "selected");
148 - var elementorLink = this.elementorHomeMenu.querySelector(":scope > a.menu-top");
149 - if (elementorLink) elementorLink.classList.add("wp-has-current-submenu", "wp-menu-open");
150 - }
151 - },
152 - {
153 - key: "highlightSubmenu",
154 - value: function highlightSubmenu() {
155 - var page = new URL(window.location.href).searchParams.get("page");
156 - var targetSlug = "elementor";
157 - if ("elementor" === page || "elementor-home" === page) targetSlug = "elementor";
158 - else if ("e-form-submissions" === page) targetSlug = "e-form-submissions";
159 - else if ("elementor-mcp" === page) targetSlug = "elementor-mcp";
160 - else if ("elementor-theme-builder" === page) targetSlug = "elementor-theme-builder";
161 - this.elementorHomeMenu.querySelectorAll(".wp-submenu li").forEach(function(item) {
162 - var link = item.querySelector("a");
163 - if (!link) return;
164 - item.classList.remove("current");
165 - link.classList.remove("current");
166 - link.setAttribute("aria-current", "");
167 - if (new URL(link.href, window.location.origin).searchParams.get("page") === targetSlug) {
168 - item.classList.add("current");
169 - link.classList.add("current");
170 - link.setAttribute("aria-current", "page");
171 - }
172 - });
173 - }
174 - }
175 - ]);
176 - }();
447 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
448 +Object.defineProperty(exports, "__esModule", ({
449 + value: true
450 +}));
451 +exports.FlyoutInteractionHandler = void 0;
452 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
453 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
454 +var _menuEventsTracker = __webpack_require__(/*! ./menu-events-tracker */ "../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js");
455 +var FlyoutInteractionHandler = exports.FlyoutInteractionHandler = /*#__PURE__*/function () {
456 + function FlyoutInteractionHandler() {
457 + (0, _classCallCheck2.default)(this, FlyoutInteractionHandler);
458 + this.activeMenu = null;
459 + this.activeParent = null;
460 + this.closeTimeout = null;
461 + this.lastMousePos = null;
462 + this.exitPoint = null;
463 + this.mouseMoveHandler = null;
464 + }
465 + return (0, _createClass2.default)(FlyoutInteractionHandler, [{
466 + key: "handle",
467 + value: function handle() {
468 + this.setupFlyoutMenus();
469 + this.setupMobileSupport();
470 + }
471 + }, {
472 + key: "setupFlyoutMenus",
473 + value: function setupFlyoutMenus() {
474 + var _this = this;
475 + var menuItems = document.querySelectorAll('#adminmenu li.elementor-has-flyout');
476 + menuItems.forEach(function (parentLi) {
477 + var flyoutMenu = parentLi.querySelector('.elementor-submenu-flyout');
478 + if (!flyoutMenu) {
479 + return;
480 + }
481 + _this.attachHoverEvents(parentLi, flyoutMenu);
482 + _this.attachFocusEvents(parentLi, flyoutMenu);
483 + _this.attachKeyboardEvents(parentLi, flyoutMenu);
484 + });
485 + }
486 + }, {
487 + key: "attachHoverEvents",
488 + value: function attachHoverEvents(parentLi, flyoutMenu) {
489 + var _this2 = this;
490 + parentLi.addEventListener('mouseenter', function () {
491 + // If moving to a new parent that is NOT part of the current active tree
492 + if (_this2.activeMenu && !_this2.activeMenu.contains(parentLi) && _this2.activeMenu !== flyoutMenu) {
493 + // If we are moving to a sibling or unrelated menu, close the current one immediately
494 + // UNLESS we are in the safe zone triangle of the parent
495 + if (!_this2.isCursorInSafeZone()) {
496 + _this2.hideFlyout(_this2.activeMenu);
497 + }
498 + }
499 + _this2.clearCloseTimeout();
500 + _this2.showFlyout(parentLi, flyoutMenu);
501 + });
502 + parentLi.addEventListener('mouseleave', function (event) {
503 + _this2.exitPoint = {
504 + x: event.clientX,
505 + y: event.clientY
506 + };
507 + _this2.scheduleClose(parentLi, flyoutMenu);
508 + });
509 + flyoutMenu.addEventListener('mouseenter', function () {
510 + _this2.clearCloseTimeout();
511 + _this2.stopMouseTracking();
512 + });
513 + flyoutMenu.addEventListener('mouseleave', function (event) {
514 + _this2.exitPoint = {
515 + x: event.clientX,
516 + y: event.clientY
517 + };
518 + _this2.scheduleClose(parentLi, flyoutMenu);
519 + });
520 + }
521 + }, {
522 + key: "attachFocusEvents",
523 + value: function attachFocusEvents(parentLi, flyoutMenu) {
524 + var _this3 = this;
525 + var parentLink = parentLi.querySelector(':scope > a');
526 + if (parentLink) {
527 + parentLink.addEventListener('focus', function () {
528 + _this3.showFlyout(parentLi, flyoutMenu);
529 + });
530 + }
531 + flyoutMenu.addEventListener('focusout', function (event) {
532 + if (!parentLi.contains(event.relatedTarget)) {
533 + _this3.hideFlyout(flyoutMenu);
534 + }
535 + });
536 + }
537 + }, {
538 + key: "attachKeyboardEvents",
539 + value: function attachKeyboardEvents(parentLi, flyoutMenu) {
540 + var _this4 = this;
541 + parentLi.addEventListener('keydown', function (event) {
542 + _this4.handleKeyNavigation(event, parentLi, flyoutMenu);
543 + });
544 + }
545 + }, {
546 + key: "showFlyout",
547 + value: function showFlyout(parentLi, flyoutMenu) {
548 + var wasAlreadyVisible = flyoutMenu.classList.contains('elementor-submenu-flyout-visible');
549 + if (this.activeMenu && this.activeMenu !== flyoutMenu) {
550 + this.hideFlyout(this.activeMenu);
551 + }
552 + this.exitPoint = null;
553 + this.positionFlyout(parentLi, flyoutMenu);
554 + flyoutMenu.classList.add('elementor-submenu-flyout-visible');
555 + this.activeMenu = flyoutMenu;
556 + this.activeParent = parentLi;
557 + if (!wasAlreadyVisible) {
558 + _menuEventsTracker.MenuEventsTracker.trackEditorSubMenuOpened();
559 + }
560 + }
561 + }, {
562 + key: "hideFlyout",
563 + value: function hideFlyout(flyoutMenu) {
564 + flyoutMenu.classList.remove('elementor-submenu-flyout-visible');
565 + if (this.activeMenu === flyoutMenu) {
566 + this.activeMenu = null;
567 + this.activeParent = null;
568 + this.exitPoint = null;
569 + this.stopMouseTracking();
570 + }
571 + }
572 + }, {
573 + key: "scheduleClose",
574 + value: function scheduleClose(parentLi, flyoutMenu) {
575 + var _this5 = this;
576 + this.clearCloseTimeout();
577 + this.startMouseTracking(parentLi, flyoutMenu);
578 + this.closeTimeout = setTimeout(function () {
579 + _this5.checkAndClose(flyoutMenu);
580 + }, 300);
581 + }
582 + }, {
583 + key: "checkAndClose",
584 + value: function checkAndClose(flyoutMenu) {
585 + var _this6 = this;
586 + if (!this.activeMenu) {
587 + return;
588 + }
589 + if (!this.isCursorInSafeZone()) {
590 + this.hideFlyout(flyoutMenu);
591 + } else {
592 + this.closeTimeout = setTimeout(function () {
593 + _this6.checkAndClose(flyoutMenu);
594 + }, 300);
595 + }
596 + }
597 + }, {
598 + key: "clearCloseTimeout",
599 + value: function clearCloseTimeout() {
600 + if (this.closeTimeout) {
601 + clearTimeout(this.closeTimeout);
602 + this.closeTimeout = null;
603 + }
604 + }
605 + }, {
606 + key: "startMouseTracking",
607 + value: function startMouseTracking() {
608 + var _this7 = this;
609 + this.stopMouseTracking();
610 + this.mouseMoveHandler = function (event) {
611 + _this7.lastMousePos = {
612 + x: event.clientX,
613 + y: event.clientY
614 + };
615 + };
616 + document.addEventListener('mousemove', this.mouseMoveHandler);
617 + }
618 + }, {
619 + key: "stopMouseTracking",
620 + value: function stopMouseTracking() {
621 + if (this.mouseMoveHandler) {
622 + document.removeEventListener('mousemove', this.mouseMoveHandler);
623 + this.mouseMoveHandler = null;
624 + }
625 + this.lastMousePos = null;
626 + }
627 + }, {
628 + key: "isCursorInSafeZone",
629 + value: function isCursorInSafeZone() {
630 + if (!this.lastMousePos || !this.activeMenu || !this.activeParent) {
631 + return false;
632 + }
633 + var cursor = this.lastMousePos;
634 + var parentRect = this.activeParent.getBoundingClientRect();
635 + if (this.isPointInRect(cursor, parentRect)) {
636 + return true;
637 + }
638 + var flyoutRect = this.activeMenu.getBoundingClientRect();
639 + if (this.isPointInRect(cursor, flyoutRect)) {
640 + return true;
641 + }
642 + return this.isPointInTriangle(cursor, parentRect, flyoutRect);
643 + }
644 + }, {
645 + key: "isPointInRect",
646 + value: function isPointInRect(point, rect) {
647 + return point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom;
648 + }
649 + }, {
650 + key: "isPointInTriangle",
651 + value: function isPointInTriangle(cursor, parentRect, flyoutRect) {
652 + var exitX = this.exitPoint ? this.exitPoint.x : parentRect.right;
653 + var distParent = Math.abs(exitX - parentRect.right);
654 + var distFlyout = Math.abs(exitX - flyoutRect.left);
655 + var triangleApex, baseTop, baseBottom;
177 656
178 -//#endregion
179 -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
180 - function _defineProperty(e, r, t) {
181 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
182 - value: t,
183 - enumerable: !0,
184 - configurable: !0,
185 - writable: !0
186 - }) : e[r] = t, e;
187 - }
657 + // Determine direction: Moving towards Flyout (default) or towards Parent (backwards)
658 + if (distParent < distFlyout) {
659 + // Moving towards Flyout
660 + triangleApex = this.exitPoint || {
661 + x: parentRect.right,
662 + y: parentRect.top + parentRect.height / 2
663 + };
664 + baseTop = {
665 + x: flyoutRect.left,
666 + y: flyoutRect.top - 100
667 + };
668 + baseBottom = {
669 + x: flyoutRect.left,
670 + y: flyoutRect.bottom + 100
671 + };
672 + } else {
673 + // Moving towards Parent
674 + triangleApex = this.exitPoint || {
675 + x: flyoutRect.left,
676 + y: flyoutRect.top + flyoutRect.height / 2
677 + };
678 + baseTop = {
679 + x: parentRect.right,
680 + y: parentRect.top - 100
681 + };
682 + baseBottom = {
683 + x: parentRect.right,
684 + y: parentRect.bottom + 100
685 + };
686 + }
687 + return this.pointInTriangle(cursor, triangleApex, baseTop, baseBottom);
688 + }
689 + }, {
690 + key: "pointInTriangle",
691 + value: function pointInTriangle(p, v1, v2, v3) {
692 + var sign = function sign(p1, p2, p3) {
693 + return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
694 + };
695 + var d1 = sign(p, v1, v2);
696 + var d2 = sign(p, v2, v3);
697 + var d3 = sign(p, v3, v1);
698 + var hasNeg = 0 > d1 || 0 > d2 || 0 > d3;
699 + var hasPos = 0 < d1 || 0 < d2 || 0 < d3;
700 + return !(hasNeg && hasPos);
701 + }
702 + }, {
703 + key: "positionFlyout",
704 + value: function positionFlyout(parentLi, flyoutMenu) {
705 + var windowHeight = window.innerHeight;
706 + var flyoutHeight = flyoutMenu.offsetHeight;
707 + var parentRect = parentLi.getBoundingClientRect();
708 + var relativeTop = parentRect.top;
709 + if (relativeTop + flyoutHeight > windowHeight) {
710 + var newTop = windowHeight - flyoutHeight - relativeTop;
711 + if (newTop < -relativeTop) {
712 + newTop = -relativeTop + 10;
713 + }
714 + flyoutMenu.style.top = newTop + 'px';
715 + } else {
716 + delete flyoutMenu.style.top;
717 + }
718 + }
719 + }, {
720 + key: "handleKeyNavigation",
721 + value: function handleKeyNavigation(event, parentLi, flyoutMenu) {
722 + var allLinks = flyoutMenu.querySelectorAll('a');
723 + var focusedLink = flyoutMenu.querySelector('a:focus');
724 + var currentIndex = Array.from(allLinks).indexOf(focusedLink);
725 + var isVisible = flyoutMenu.classList.contains('elementor-submenu-flyout-visible');
726 + switch (event.key) {
727 + case 'ArrowRight':
728 + if (!isVisible) {
729 + var _allLinks$;
730 + event.preventDefault();
731 + this.showFlyout(parentLi, flyoutMenu);
732 + (_allLinks$ = allLinks[0]) === null || _allLinks$ === void 0 || _allLinks$.focus();
733 + }
734 + break;
735 + case 'ArrowLeft':
736 + if (isVisible) {
737 + var _parentLi$querySelect;
738 + event.preventDefault();
739 + this.hideFlyout(flyoutMenu);
740 + (_parentLi$querySelect = parentLi.querySelector(':scope > a')) === null || _parentLi$querySelect === void 0 || _parentLi$querySelect.focus();
741 + }
742 + break;
743 + case 'ArrowDown':
744 + if (isVisible && currentIndex >= 0) {
745 + var _allLinks$nextIndex;
746 + event.preventDefault();
747 + var nextIndex = (currentIndex + 1) % allLinks.length;
748 + (_allLinks$nextIndex = allLinks[nextIndex]) === null || _allLinks$nextIndex === void 0 || _allLinks$nextIndex.focus();
749 + }
750 + break;
751 + case 'ArrowUp':
752 + if (isVisible && currentIndex >= 0) {
753 + var _allLinks$prevIndex;
754 + event.preventDefault();
755 + var prevIndex = (currentIndex - 1 + allLinks.length) % allLinks.length;
756 + (_allLinks$prevIndex = allLinks[prevIndex]) === null || _allLinks$prevIndex === void 0 || _allLinks$prevIndex.focus();
757 + }
758 + break;
759 + case 'Escape':
760 + if (isVisible) {
761 + var _parentLi$querySelect2;
762 + event.preventDefault();
763 + this.hideFlyout(flyoutMenu);
764 + (_parentLi$querySelect2 = parentLi.querySelector(':scope > a')) === null || _parentLi$querySelect2 === void 0 || _parentLi$querySelect2.focus();
765 + }
766 + break;
767 + }
768 + }
769 + }, {
770 + key: "setupMobileSupport",
771 + value: function setupMobileSupport() {
772 + var _this8 = this;
773 + if (window.innerWidth > 782) {
774 + return;
775 + }
776 + var menuLinks = document.querySelectorAll('#adminmenu li.elementor-has-flyout > a');
777 + menuLinks.forEach(function (link) {
778 + link.addEventListener('click', function (event) {
779 + _this8.handleMobileClick(event, link);
780 + });
781 + });
782 + document.addEventListener('click', function (event) {
783 + _this8.handleDocumentClick(event);
784 + });
785 + }
786 + }, {
787 + key: "handleMobileClick",
788 + value: function handleMobileClick(event, link) {
789 + var parentLi = link.parentElement;
790 + var flyoutMenu = parentLi.querySelector('.elementor-submenu-flyout');
791 + if (!flyoutMenu) {
792 + return;
793 + }
794 + if (parentLi.classList.contains('elementor-flyout-open')) {
795 + return;
796 + }
797 + event.preventDefault();
798 + document.querySelectorAll('#adminmenu li.elementor-has-flyout').forEach(function (item) {
799 + item.classList.remove('elementor-flyout-open');
800 + });
801 + parentLi.classList.add('elementor-flyout-open');
802 + }
803 + }, {
804 + key: "handleDocumentClick",
805 + value: function handleDocumentClick(event) {
806 + if (!event.target.closest('#adminmenu li.elementor-has-flyout')) {
807 + document.querySelectorAll('#adminmenu li.elementor-has-flyout').forEach(function (item) {
808 + item.classList.remove('elementor-flyout-open');
809 + });
810 + }
811 + }
812 + }]);
813 +}();
188 814
189 -//#endregion
190 -//#region assets/dev/js/editor/utils/editor-one-events.js
191 - function ownKeys(e, r) {
192 - var t = Object.keys(e);
193 - if (Object.getOwnPropertySymbols) {
194 - var o = Object.getOwnPropertySymbols(e);
195 - r && (o = o.filter(function(r) {
196 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
197 - })), t.push.apply(t, o);
198 - }
199 - return t;
200 - }
201 - function _objectSpread(e) {
202 - for (var r = 1; r < arguments.length; r++) {
203 - var t = null != arguments[r] ? arguments[r] : {};
204 - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
205 - _defineProperty(e, r, t[r]);
206 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
207 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
208 - });
209 - }
210 - return e;
211 - }
212 - var EditorOneEventManager = /*#__PURE__*/ function() {
213 - function EditorOneEventManager() {
214 - _classCallCheck(this, EditorOneEventManager);
215 - }
216 - return _createClass(EditorOneEventManager, null, [
217 - {
218 - key: "getEventsManager",
219 - value: function getEventsManager() {
220 - var _elementorCommon;
221 - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
222 - }
223 - },
224 - {
225 - key: "getConfig",
226 - value: function getConfig() {
227 - var _this$getEventsManage;
228 - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
229 - }
230 - },
231 - {
232 - key: "canSendEvents",
233 - value: function canSendEvents() {
234 - var _elementorCommon2;
235 - return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false;
236 - }
237 - },
238 - {
239 - key: "isEventsManagerAvailable",
240 - value: function isEventsManagerAvailable() {
241 - var eventsManager = this.getEventsManager();
242 - return eventsManager && "function" === typeof eventsManager.dispatchEvent;
243 - }
244 - },
245 - {
246 - key: "dispatchEvent",
247 - value: function dispatchEvent(eventName, payload) {
248 - try {
249 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) return false;
250 - this.getEventsManager().dispatchEvent(eventName, payload);
251 - return true;
252 - } catch (error) {
253 - return false;
254 - }
255 - }
256 - },
257 - {
258 - key: "toLowerSnake",
259 - value: function toLowerSnake(value) {
260 - if (!value || "string" !== typeof value) return value;
261 - return value.replace(/\s+/g, "_").toLowerCase();
262 - }
263 - },
264 - {
265 - key: "decodeHtmlEntities",
266 - value: function decodeHtmlEntities(text) {
267 - if (!text || "string" !== typeof text) return text;
268 - return new DOMParser().parseFromString(text, "text/html").body.textContent || text;
269 - }
270 - },
271 - {
272 - key: "isInEditorContext",
273 - value: function isInEditorContext() {
274 - var _window$elementor;
275 - return "undefined" !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
276 - }
277 - },
278 - {
279 - key: "getFinderContext",
280 - value: function getFinderContext() {
281 - var _config$appTypes;
282 - var _config$appTypes2;
283 - var _config$locations;
284 - var _config$locations2;
285 - var config = this.getConfig();
286 - var isEditor = this.isInEditorContext();
287 - return {
288 - windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin,
289 - targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar)
290 - };
291 - }
292 - },
293 - {
294 - key: "createBasePayload",
295 - value: function createBasePayload() {
296 - var _config$appTypes$edit;
297 - var _config$appTypes3;
298 - var overrides = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
299 - var config = this.getConfig();
300 - return _objectSpread({ window_name: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : "editor" }, overrides);
301 - }
302 - },
303 - {
304 - key: "sendTopBarPublishDropdown",
305 - value: function sendTopBarPublishDropdown(targetName) {
306 - var _config$names;
307 - var _config$triggers;
308 - var _config$targetTypes;
309 - var _config$interactionRe;
310 - var _config$locations3;
311 - var _config$secondaryLoca;
312 - var _config$targetTypes2;
313 - var config = this.getConfig();
314 - return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({
315 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
316 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
317 - target_name: targetName,
318 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
319 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
320 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
321 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
322 - interaction_description: "User selected an action from the publish dropdown"
323 - }));
324 - }
325 - },
326 - {
327 - key: "sendTopBarPageList",
328 - value: function sendTopBarPageList(targetName) {
329 - var _config$names2;
330 - var _config$triggers2;
331 - var _config$targetTypes3;
332 - var _config$interactionRe2;
333 - var _config$interactionRe3;
334 - var _config$locations4;
335 - var _config$secondaryLoca2;
336 - var _config$targetTypes4;
337 - var isCreate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
338 - var config = this.getConfig();
339 - return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({
340 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
341 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
342 - target_name: targetName,
343 - interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate,
344 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
345 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
346 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
347 - interaction_description: "User selected an action from the page list dropdown"
348 - }));
349 - }
350 - },
351 - {
352 - key: "sendSiteSettingsSession",
353 - value: function sendSiteSettingsSession(_ref) {
354 - var _config$names3;
355 - var _config$triggers3;
356 - var _config$interactionRe4;
357 - var _config$locations5;
358 - var _config$secondaryLoca3;
359 - var targetType = _ref.targetType;
360 - var _ref$visitedItems = _ref.visitedItems;
361 - var visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems;
362 - var _ref$savedItems = _ref.savedItems;
363 - var savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems;
364 - var state = _ref.state;
365 - var config = this.getConfig();
366 - return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({
367 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
368 - target_type: targetType,
369 - target_name: "site_settings",
370 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
371 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
372 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
373 - interaction_description: "Records areas visited as part of the site setting session",
374 - metadata: {
375 - visited_items: visitedItems,
376 - saved_items: savedItems
377 - },
378 - state
379 - }));
380 - }
381 - },
382 - {
383 - key: "sendELibraryNav",
384 - value: function sendELibraryNav(tabName) {
385 - var _config$names4;
386 - var _config$triggers4;
387 - var _config$targetTypes5;
388 - var _config$interactionRe5;
389 - var _config$locations6;
390 - var _config$secondaryLoca4;
391 - var config = this.getConfig();
392 - return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({
393 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
394 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
395 - target_name: this.toLowerSnake(tabName),
396 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
397 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
398 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
399 - interaction_description: "User navigates within elementor library"
400 - }));
401 - }
402 - },
403 - {
404 - key: "sendELibraryInsert",
405 - value: function sendELibraryInsert(_ref2) {
406 - var _config$triggers5;
407 - var _config$targetTypes6;
408 - var _config$interactionRe6;
409 - var _config$locations7;
410 - var _config$secondaryLoca5;
411 - var _config$names5;
412 - var assetId = _ref2.assetId;
413 - var assetName = _ref2.assetName;
414 - var libraryType = _ref2.libraryType;
415 - var _ref2$proRequired = _ref2.proRequired;
416 - var proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
417 - var config = this.getConfig();
418 - var payload = this.createBasePayload({
419 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
420 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
421 - target_name: String(assetId),
422 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
423 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
424 - location_l1: this.toLowerSnake(libraryType),
425 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
426 - interaction_description: "User inserts block/pages from elementor library",
427 - metadata: {
428 - template_id: String(assetId),
429 - template_name: this.decodeHtmlEntities(assetName) || ""
430 - }
431 - });
432 - if (proRequired) payload.state = "pro_plan_required";
433 - return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload);
434 - }
435 - },
436 - {
437 - key: "sendELibraryFavorite",
438 - value: function sendELibraryFavorite(_ref3) {
439 - var _config$triggers6;
440 - var _config$targetTypes7;
441 - var _config$interactionRe7;
442 - var _config$locations8;
443 - var _config$secondaryLoca6;
444 - var _config$names6;
445 - var assetId = _ref3.assetId;
446 - var assetName = _ref3.assetName;
447 - var libraryType = _ref3.libraryType;
448 - var isFavorite = _ref3.isFavorite;
449 - var _ref3$proRequired = _ref3.proRequired;
450 - var proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
451 - var config = this.getConfig();
452 - var payload = this.createBasePayload({
453 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
454 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
455 - target_name: String(assetId),
456 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
457 - target_value: Boolean(isFavorite),
458 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
459 - location_l1: this.toLowerSnake(libraryType),
460 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
461 - interaction_description: "User favorite block/pages from elementor library",
462 - metadata: {
463 - template_id: String(assetId),
464 - template_name: this.decodeHtmlEntities(assetName) || ""
465 - }
466 - });
467 - if (proRequired) payload.state = "pro_plan_required";
468 - return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload);
469 - }
470 - },
471 - {
472 - key: "sendELibraryGenerateAi",
473 - value: function sendELibraryGenerateAi(_ref4) {
474 - var _config$names7;
475 - var _config$triggers7;
476 - var _config$targetTypes8;
477 - var _config$interactionRe8;
478 - var _config$locations9;
479 - var _config$secondaryLoca7;
480 - var assetId = _ref4.assetId;
481 - var assetName = _ref4.assetName;
482 - var libraryType = _ref4.libraryType;
483 - var config = this.getConfig();
484 - return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({
485 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
486 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
487 - target_name: String(assetId),
488 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
489 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
490 - location_l1: this.toLowerSnake(libraryType),
491 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
492 - interaction_description: "User generated block/page based on a library asset",
493 - metadata: {
494 - template_id: String(assetId),
495 - template_name: this.decodeHtmlEntities(assetName) || ""
496 - }
497 - }));
498 - }
499 - },
500 - {
501 - key: "sendFinderSearchInput",
502 - value: function sendFinderSearchInput(_ref5) {
503 - var _config$triggers8;
504 - var _config$targetTypes9;
505 - var _config$interactionRe9;
506 - var _config$interactionRe0;
507 - var _config$secondaryLoca8;
508 - var _config$names8;
509 - var resultsCount = _ref5.resultsCount;
510 - var _ref5$searchTerm = _ref5.searchTerm;
511 - var searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
512 - var config = this.getConfig();
513 - var hasResults = resultsCount > 0;
514 - var finderContext = this.getFinderContext();
515 - var payload = this.createBasePayload({
516 - window_name: finderContext.windowName,
517 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
518 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
519 - target_name: "finder",
520 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults,
521 - target_location: finderContext.targetLocation,
522 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
523 - interaction_description: "Finder search input, follows debounce behavior",
524 - metadata: { results_count: resultsCount }
525 - });
526 - if (!hasResults && searchTerm) payload.metadata.search_term = searchTerm;
527 - return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload);
528 - }
529 - },
530 - {
531 - key: "sendFinderResultSelect",
532 - value: function sendFinderResultSelect(choice) {
533 - var _config$names9;
534 - var _config$triggers9;
535 - var _config$targetTypes0;
536 - var _config$interactionRe1;
537 - var _config$secondaryLoca9;
538 - var _config$secondaryLoca0;
539 - var config = this.getConfig();
540 - var finderContext = this.getFinderContext();
541 - return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({
542 - window_name: finderContext.windowName,
543 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
544 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
545 - target_name: choice,
546 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
547 - target_location: finderContext.targetLocation,
548 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
549 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
550 - interaction_description: "Finder search results was selected"
551 - }));
552 - }
553 - },
554 - {
555 - key: "sendCanvasEmptyBoxAction",
556 - value: function sendCanvasEmptyBoxAction(_ref6) {
557 - var _config$triggers0;
558 - var _config$targetTypes1;
559 - var _config$interactionRe10;
560 - var _config$locations0;
561 - var _config$secondaryLoca1;
562 - var _config$names0;
563 - var targetName = _ref6.targetName;
564 - var _ref6$metadata = _ref6.metadata;
565 - var metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata;
566 - var _ref6$containerCreate = _ref6.containerCreated;
567 - var containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
568 - var config = this.getConfig();
569 - var payload = this.createBasePayload({
570 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
571 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
572 - target_name: targetName,
573 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
574 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
575 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
576 - interaction_description: "Empty box on canvas actions"
577 - });
578 - if (Object.keys(metadata).length > 0) payload.metadata = metadata;
579 - if (containerCreated !== null) payload.state = containerCreated;
580 - return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload);
581 - }
582 - },
583 - {
584 - key: "sendWidgetPanelSearch",
585 - value: function sendWidgetPanelSearch(_ref7) {
586 - var _config$triggers1;
587 - var _config$targetTypes10;
588 - var _config$interactionRe11;
589 - var _config$interactionRe12;
590 - var _config$locations1;
591 - var _config$locations10;
592 - var _config$secondaryLoca10;
593 - var _config$names1;
594 - var resultsCount = _ref7.resultsCount;
595 - var _ref7$userInput = _ref7.userInput;
596 - var userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
597 - var config = this.getConfig();
598 - var hasResults = resultsCount > 0;
599 - var payload = this.createBasePayload({
600 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
601 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
602 - target_name: "search_widget",
603 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults,
604 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
605 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
606 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
607 - interaction_description: "Widget search input, follows debounce behavior"
608 - });
609 - if (!hasResults && userInput) payload.metadata = { user_input: userInput };
610 - return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload);
611 - }
612 - },
613 - {
614 - key: "createWpDashPayload",
615 - value: function createWpDashPayload() {
616 - var _config$appTypes$wpDa;
617 - var _config$appTypes4;
618 - var _config$locations11;
619 - var overrides = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
620 - var config = this.getConfig();
621 - return this.createBasePayload(_objectSpread({
622 - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : "wpdash",
623 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
624 - location_l2: ""
625 - }, overrides));
626 - }
627 - },
628 - {
629 - key: "sendWpDashElementorMenuClick",
630 - value: function sendWpDashElementorMenuClick() {
631 - var _config$names10;
632 - var _config$triggers10;
633 - var _config$targetTypes11;
634 - var _config$interactionRe13;
635 - var _config$secondaryLoca11;
636 - var config = this.getConfig();
637 - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({
638 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
639 - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
640 - target_name: "elementor_menu_item",
641 - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
642 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
643 - interaction_description: "core_user_clicked_elementor_menu_item"
644 - }));
645 - }
646 - },
647 - {
648 - key: "sendWpDashEditorSubMenuHover",
649 - value: function sendWpDashEditorSubMenuHover() {
650 - var _config$names11;
651 - var _config$triggers11;
652 - var _config$targetTypes12;
653 - var _config$interactionRe14;
654 - var _config$secondaryLoca12;
655 - var config = this.getConfig();
656 - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({
657 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
658 - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
659 - target_name: "wpdash_editor_sub_menu",
660 - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
661 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
662 - interaction_description: "core_user_hovered_sub_menu"
663 - }));
664 - }
665 - },
666 - {
667 - key: "sendWpDashThemeBuilderClick",
668 - value: function sendWpDashThemeBuilderClick() {
669 - var _config$names12;
670 - var _config$triggers12;
671 - var _config$targetTypes13;
672 - var _config$interactionRe15;
673 - var _config$secondaryLoca13;
674 - var config = this.getConfig();
675 - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({
676 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
677 - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
678 - target_name: "theme_builder_menu_item",
679 - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
680 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
681 - interaction_description: "core_user_clicked_theme_builder_menu_item"
682 - }));
683 - }
684 - },
685 - {
686 - key: "sendSidebarMenuItemClicked",
687 - value: function sendSidebarMenuItemClicked(_ref8) {
688 - var eventId = _ref8.eventId;
689 - var groupEventId = _ref8.groupEventId;
690 - try {
691 - var _config$windowNames;
692 - var _config$triggers13;
693 - var _config$targetTypes14;
694 - var _config$interactionRe16;
695 - var _config$locations12;
696 - var _config$names13;
697 - var config = this.getConfig();
698 - var payload = this.createBasePayload({
699 - window_name: config === null || config === void 0 || (_config$windowNames = config.windowNames) === null || _config$windowNames === void 0 ? void 0 : _config$windowNames.sidebarMenu,
700 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers13 = config.triggers) === null || _config$triggers13 === void 0 ? void 0 : _config$triggers13.click),
701 - target_type: config === null || config === void 0 || (_config$targetTypes14 = config.targetTypes) === null || _config$targetTypes14 === void 0 ? void 0 : _config$targetTypes14.link,
702 - target_name: eventId,
703 - interaction_result: config === null || config === void 0 || (_config$interactionRe16 = config.interactionResults) === null || _config$interactionRe16 === void 0 ? void 0 : _config$interactionRe16.pageOpened,
704 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations12 = config.locations) === null || _config$locations12 === void 0 ? void 0 : _config$locations12.sidebar)
705 - });
706 - if (groupEventId) payload.location_l1 = groupEventId;
707 - return this.dispatchEvent(config === null || config === void 0 || (_config$names13 = config.names) === null || _config$names13 === void 0 || (_config$names13 = _config$names13.editorOne) === null || _config$names13 === void 0 ? void 0 : _config$names13.sidebarMenuItemClicked, payload);
708 - } catch (error) {
709 - return false;
710 - }
711 - }
712 - },
713 - {
714 - key: "sendSidebarMenuGroupToggled",
715 - value: function sendSidebarMenuGroupToggled(_ref9) {
716 - var eventId = _ref9.eventId;
717 - var isExpanded = _ref9.isExpanded;
718 - try {
719 - var _config$interactionRe17;
720 - var _config$interactionRe18;
721 - var _config$names14;
722 - var _config$windowNames2;
723 - var _config$triggers14;
724 - var _config$targetTypes15;
725 - var _config$locations13;
726 - var config = this.getConfig();
727 - var interactionResult = isExpanded ? config === null || config === void 0 || (_config$interactionRe17 = config.interactionResults) === null || _config$interactionRe17 === void 0 ? void 0 : _config$interactionRe17.expanded : config === null || config === void 0 || (_config$interactionRe18 = config.interactionResults) === null || _config$interactionRe18 === void 0 ? void 0 : _config$interactionRe18.collapsed;
728 - return this.dispatchEvent(config === null || config === void 0 || (_config$names14 = config.names) === null || _config$names14 === void 0 || (_config$names14 = _config$names14.editorOne) === null || _config$names14 === void 0 ? void 0 : _config$names14.sidebarMenuGroupToggled, this.createBasePayload({
729 - window_name: config === null || config === void 0 || (_config$windowNames2 = config.windowNames) === null || _config$windowNames2 === void 0 ? void 0 : _config$windowNames2.sidebarMenu,
730 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers14 = config.triggers) === null || _config$triggers14 === void 0 ? void 0 : _config$triggers14.click),
731 - target_type: config === null || config === void 0 || (_config$targetTypes15 = config.targetTypes) === null || _config$targetTypes15 === void 0 ? void 0 : _config$targetTypes15.toggle,
732 - target_name: eventId,
733 - interaction_result: interactionResult,
734 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations13 = config.locations) === null || _config$locations13 === void 0 ? void 0 : _config$locations13.sidebar)
735 - }));
736 - } catch (error) {
737 - return false;
738 - }
739 - }
740 - }
741 - ]);
742 - }();
815 +/***/ }),
743 816
744 -//#endregion
745 -//#region modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js
746 - var SELECTORS = {
747 - elementorMenuLink: "#toplevel_page_elementor-home > a.menu-top",
748 - themeBuilderItem: "[data-slug=\"elementor-theme-builder\"] a, .wp-submenu a[href*=\"page=elementor-theme-builder\"]"
749 - };
750 - var MenuEventsTracker = /*#__PURE__*/ function() {
751 - function MenuEventsTracker() {
752 - _classCallCheck(this, MenuEventsTracker);
753 - }
754 - return _createClass(MenuEventsTracker, null, [
755 - {
756 - key: "attach",
757 - value: function attach() {
758 - this.attachElementorMenuClick();
759 - this.attachThemeBuilderClick();
760 - }
761 - },
762 - {
763 - key: "attachElementorMenuClick",
764 - value: function attachElementorMenuClick() {
765 - var menuLink = document.querySelector(SELECTORS.elementorMenuLink);
766 - if (!menuLink) return;
767 - menuLink.addEventListener("click", function() {
768 - EditorOneEventManager.sendWpDashElementorMenuClick();
769 - });
770 - }
771 - },
772 - {
773 - key: "attachThemeBuilderClick",
774 - value: function attachThemeBuilderClick() {
775 - document.addEventListener("click", function(event) {
776 - if (event.target.closest(SELECTORS.themeBuilderItem)) EditorOneEventManager.sendWpDashThemeBuilderClick();
777 - }, true);
778 - }
779 - },
780 - {
781 - key: "trackEditorSubMenuOpened",
782 - value: function trackEditorSubMenuOpened() {
783 - EditorOneEventManager.sendWpDashEditorSubMenuHover();
784 - }
785 - }
786 - ]);
787 - }();
817 +/***/ "../modules/editor-one/assets/js/admin-menu/classes/flyout-menu-renderer.js":
818 +/*!**********************************************************************************!*\
819 + !*** ../modules/editor-one/assets/js/admin-menu/classes/flyout-menu-renderer.js ***!
820 + \**********************************************************************************/
821 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
788 822
789 -//#endregion
790 -//#region modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js
791 - var FlyoutInteractionHandler = /*#__PURE__*/ function() {
792 - function FlyoutInteractionHandler() {
793 - _classCallCheck(this, FlyoutInteractionHandler);
794 - this.activeMenu = null;
795 - this.activeParent = null;
796 - this.closeTimeout = null;
797 - this.lastMousePos = null;
798 - this.exitPoint = null;
799 - this.mouseMoveHandler = null;
800 - }
801 - return _createClass(FlyoutInteractionHandler, [
802 - {
803 - key: "handle",
804 - value: function handle() {
805 - this.setupFlyoutMenus();
806 - this.setupMobileSupport();
807 - }
808 - },
809 - {
810 - key: "setupFlyoutMenus",
811 - value: function setupFlyoutMenus() {
812 - var _this = this;
813 - document.querySelectorAll("#adminmenu li.elementor-has-flyout").forEach(function(parentLi) {
814 - var flyoutMenu = parentLi.querySelector(".elementor-submenu-flyout");
815 - if (!flyoutMenu) return;
816 - _this.attachHoverEvents(parentLi, flyoutMenu);
817 - _this.attachFocusEvents(parentLi, flyoutMenu);
818 - _this.attachKeyboardEvents(parentLi, flyoutMenu);
819 - });
820 - }
821 - },
822 - {
823 - key: "attachHoverEvents",
824 - value: function attachHoverEvents(parentLi, flyoutMenu) {
825 - var _this2 = this;
826 - parentLi.addEventListener("mouseenter", function() {
827 - if (_this2.activeMenu && !_this2.activeMenu.contains(parentLi) && _this2.activeMenu !== flyoutMenu) {
828 - if (!_this2.isCursorInSafeZone()) _this2.hideFlyout(_this2.activeMenu);
829 - }
830 - _this2.clearCloseTimeout();
831 - _this2.showFlyout(parentLi, flyoutMenu);
832 - });
833 - parentLi.addEventListener("mouseleave", function(event) {
834 - _this2.exitPoint = {
835 - x: event.clientX,
836 - y: event.clientY
837 - };
838 - _this2.scheduleClose(parentLi, flyoutMenu);
839 - });
840 - flyoutMenu.addEventListener("mouseenter", function() {
841 - _this2.clearCloseTimeout();
842 - _this2.stopMouseTracking();
843 - });
844 - flyoutMenu.addEventListener("mouseleave", function(event) {
845 - _this2.exitPoint = {
846 - x: event.clientX,
847 - y: event.clientY
848 - };
849 - _this2.scheduleClose(parentLi, flyoutMenu);
850 - });
851 - }
852 - },
853 - {
854 - key: "attachFocusEvents",
855 - value: function attachFocusEvents(parentLi, flyoutMenu) {
856 - var _this3 = this;
857 - var parentLink = parentLi.querySelector(":scope > a");
858 - if (parentLink) parentLink.addEventListener("focus", function() {
859 - _this3.showFlyout(parentLi, flyoutMenu);
860 - });
861 - flyoutMenu.addEventListener("focusout", function(event) {
862 - if (!parentLi.contains(event.relatedTarget)) _this3.hideFlyout(flyoutMenu);
863 - });
864 - }
865 - },
866 - {
867 - key: "attachKeyboardEvents",
868 - value: function attachKeyboardEvents(parentLi, flyoutMenu) {
869 - var _this4 = this;
870 - parentLi.addEventListener("keydown", function(event) {
871 - _this4.handleKeyNavigation(event, parentLi, flyoutMenu);
872 - });
873 - }
874 - },
875 - {
876 - key: "showFlyout",
877 - value: function showFlyout(parentLi, flyoutMenu) {
878 - var wasAlreadyVisible = flyoutMenu.classList.contains("elementor-submenu-flyout-visible");
879 - if (this.activeMenu && this.activeMenu !== flyoutMenu) this.hideFlyout(this.activeMenu);
880 - this.exitPoint = null;
881 - this.positionFlyout(parentLi, flyoutMenu);
882 - flyoutMenu.classList.add("elementor-submenu-flyout-visible");
883 - this.activeMenu = flyoutMenu;
884 - this.activeParent = parentLi;
885 - if (!wasAlreadyVisible) MenuEventsTracker.trackEditorSubMenuOpened();
886 - }
887 - },
888 - {
889 - key: "hideFlyout",
890 - value: function hideFlyout(flyoutMenu) {
891 - flyoutMenu.classList.remove("elementor-submenu-flyout-visible");
892 - if (this.activeMenu === flyoutMenu) {
893 - this.activeMenu = null;
894 - this.activeParent = null;
895 - this.exitPoint = null;
896 - this.stopMouseTracking();
897 - }
898 - }
899 - },
900 - {
901 - key: "scheduleClose",
902 - value: function scheduleClose(parentLi, flyoutMenu) {
903 - var _this5 = this;
904 - this.clearCloseTimeout();
905 - this.startMouseTracking(parentLi, flyoutMenu);
906 - this.closeTimeout = setTimeout(function() {
907 - _this5.checkAndClose(flyoutMenu);
908 - }, 300);
909 - }
910 - },
911 - {
912 - key: "checkAndClose",
913 - value: function checkAndClose(flyoutMenu) {
914 - var _this6 = this;
915 - if (!this.activeMenu) return;
916 - if (!this.isCursorInSafeZone()) this.hideFlyout(flyoutMenu);
917 - else this.closeTimeout = setTimeout(function() {
918 - _this6.checkAndClose(flyoutMenu);
919 - }, 300);
920 - }
921 - },
922 - {
923 - key: "clearCloseTimeout",
924 - value: function clearCloseTimeout() {
925 - if (this.closeTimeout) {
926 - clearTimeout(this.closeTimeout);
927 - this.closeTimeout = null;
928 - }
929 - }
930 - },
931 - {
932 - key: "startMouseTracking",
933 - value: function startMouseTracking() {
934 - var _this7 = this;
935 - this.stopMouseTracking();
936 - this.mouseMoveHandler = function(event) {
937 - _this7.lastMousePos = {
938 - x: event.clientX,
939 - y: event.clientY
940 - };
941 - };
942 - document.addEventListener("mousemove", this.mouseMoveHandler);
943 - }
944 - },
945 - {
946 - key: "stopMouseTracking",
947 - value: function stopMouseTracking() {
948 - if (this.mouseMoveHandler) {
949 - document.removeEventListener("mousemove", this.mouseMoveHandler);
950 - this.mouseMoveHandler = null;
951 - }
952 - this.lastMousePos = null;
953 - }
954 - },
955 - {
956 - key: "isCursorInSafeZone",
957 - value: function isCursorInSafeZone() {
958 - if (!this.lastMousePos || !this.activeMenu || !this.activeParent) return false;
959 - var cursor = this.lastMousePos;
960 - var parentRect = this.activeParent.getBoundingClientRect();
961 - if (this.isPointInRect(cursor, parentRect)) return true;
962 - var flyoutRect = this.activeMenu.getBoundingClientRect();
963 - if (this.isPointInRect(cursor, flyoutRect)) return true;
964 - return this.isPointInTriangle(cursor, parentRect, flyoutRect);
965 - }
966 - },
967 - {
968 - key: "isPointInRect",
969 - value: function isPointInRect(point, rect) {
970 - return point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom;
971 - }
972 - },
973 - {
974 - key: "isPointInTriangle",
975 - value: function isPointInTriangle(cursor, parentRect, flyoutRect) {
976 - var exitX = this.exitPoint ? this.exitPoint.x : parentRect.right;
977 - var distParent = Math.abs(exitX - parentRect.right);
978 - var distFlyout = Math.abs(exitX - flyoutRect.left);
979 - var triangleApex;
980 - var baseTop;
981 - var baseBottom;
982 - if (distParent < distFlyout) {
983 - triangleApex = this.exitPoint || {
984 - x: parentRect.right,
985 - y: parentRect.top + parentRect.height / 2
986 - };
987 - baseTop = {
988 - x: flyoutRect.left,
989 - y: flyoutRect.top - 100
990 - };
991 - baseBottom = {
992 - x: flyoutRect.left,
993 - y: flyoutRect.bottom + 100
994 - };
995 - } else {
996 - triangleApex = this.exitPoint || {
997 - x: flyoutRect.left,
998 - y: flyoutRect.top + flyoutRect.height / 2
999 - };
1000 - baseTop = {
1001 - x: parentRect.right,
1002 - y: parentRect.top - 100
1003 - };
1004 - baseBottom = {
1005 - x: parentRect.right,
1006 - y: parentRect.bottom + 100
1007 - };
1008 - }
1009 - return this.pointInTriangle(cursor, triangleApex, baseTop, baseBottom);
1010 - }
1011 - },
1012 - {
1013 - key: "pointInTriangle",
1014 - value: function pointInTriangle(p, v1, v2, v3) {
1015 - var sign = function sign(p1, p2, p3) {
1016 - return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);
1017 - };
1018 - var d1 = sign(p, v1, v2);
1019 - var d2 = sign(p, v2, v3);
1020 - var d3 = sign(p, v3, v1);
1021 - return !((0 > d1 || 0 > d2 || 0 > d3) && (0 < d1 || 0 < d2 || 0 < d3));
1022 - }
1023 - },
1024 - {
1025 - key: "positionFlyout",
1026 - value: function positionFlyout(parentLi, flyoutMenu) {
1027 - var windowHeight = window.innerHeight;
1028 - var flyoutHeight = flyoutMenu.offsetHeight;
1029 - var relativeTop = parentLi.getBoundingClientRect().top;
1030 - if (relativeTop + flyoutHeight > windowHeight) {
1031 - var newTop = windowHeight - flyoutHeight - relativeTop;
1032 - if (newTop < -relativeTop) newTop = -relativeTop + 10;
1033 - flyoutMenu.style.top = newTop + "px";
1034 - } else delete flyoutMenu.style.top;
1035 - }
1036 - },
1037 - {
1038 - key: "handleKeyNavigation",
1039 - value: function handleKeyNavigation(event, parentLi, flyoutMenu) {
1040 - var allLinks = flyoutMenu.querySelectorAll("a");
1041 - var focusedLink = flyoutMenu.querySelector("a:focus");
1042 - var currentIndex = Array.from(allLinks).indexOf(focusedLink);
1043 - var isVisible = flyoutMenu.classList.contains("elementor-submenu-flyout-visible");
1044 - switch (event.key) {
1045 - case "ArrowRight":
1046 - if (!isVisible) {
1047 - var _allLinks$;
1048 - event.preventDefault();
1049 - this.showFlyout(parentLi, flyoutMenu);
1050 - (_allLinks$ = allLinks[0]) === null || _allLinks$ === void 0 || _allLinks$.focus();
1051 - }
1052 - break;
1053 - case "ArrowLeft":
1054 - if (isVisible) {
1055 - var _parentLi$querySelect;
1056 - event.preventDefault();
1057 - this.hideFlyout(flyoutMenu);
1058 - (_parentLi$querySelect = parentLi.querySelector(":scope > a")) === null || _parentLi$querySelect === void 0 || _parentLi$querySelect.focus();
1059 - }
1060 - break;
1061 - case "ArrowDown":
1062 - if (isVisible && currentIndex >= 0) {
1063 - var _allLinks$nextIndex;
1064 - event.preventDefault();
1065 - (_allLinks$nextIndex = allLinks[(currentIndex + 1) % allLinks.length]) === null || _allLinks$nextIndex === void 0 || _allLinks$nextIndex.focus();
1066 - }
1067 - break;
1068 - case "ArrowUp":
1069 - if (isVisible && currentIndex >= 0) {
1070 - var _allLinks$prevIndex;
1071 - event.preventDefault();
1072 - (_allLinks$prevIndex = allLinks[(currentIndex - 1 + allLinks.length) % allLinks.length]) === null || _allLinks$prevIndex === void 0 || _allLinks$prevIndex.focus();
1073 - }
1074 - break;
1075 - case "Escape":
1076 - if (isVisible) {
1077 - var _parentLi$querySelect2;
1078 - event.preventDefault();
1079 - this.hideFlyout(flyoutMenu);
1080 - (_parentLi$querySelect2 = parentLi.querySelector(":scope > a")) === null || _parentLi$querySelect2 === void 0 || _parentLi$querySelect2.focus();
1081 - }
1082 - break;
1083 - }
1084 - }
1085 - },
1086 - {
1087 - key: "setupMobileSupport",
1088 - value: function setupMobileSupport() {
1089 - var _this8 = this;
1090 - if (window.innerWidth > 782) return;
1091 - document.querySelectorAll("#adminmenu li.elementor-has-flyout > a").forEach(function(link) {
1092 - link.addEventListener("click", function(event) {
1093 - _this8.handleMobileClick(event, link);
1094 - });
1095 - });
1096 - document.addEventListener("click", function(event) {
1097 - _this8.handleDocumentClick(event);
1098 - });
1099 - }
1100 - },
1101 - {
1102 - key: "handleMobileClick",
1103 - value: function handleMobileClick(event, link) {
1104 - var parentLi = link.parentElement;
1105 - if (!parentLi.querySelector(".elementor-submenu-flyout")) return;
1106 - if (parentLi.classList.contains("elementor-flyout-open")) return;
1107 - event.preventDefault();
1108 - document.querySelectorAll("#adminmenu li.elementor-has-flyout").forEach(function(item) {
1109 - item.classList.remove("elementor-flyout-open");
1110 - });
1111 - parentLi.classList.add("elementor-flyout-open");
1112 - }
1113 - },
1114 - {
1115 - key: "handleDocumentClick",
1116 - value: function handleDocumentClick(event) {
1117 - if (!event.target.closest("#adminmenu li.elementor-has-flyout")) document.querySelectorAll("#adminmenu li.elementor-has-flyout").forEach(function(item) {
1118 - item.classList.remove("elementor-flyout-open");
1119 - });
1120 - }
1121 - }
1122 - ]);
1123 - }();
823 +"use strict";
1124 824
1125 -//#endregion
1126 -//#region modules/editor-one/assets/js/admin-menu/app.js
1127 - var EditorOneMenu = /*#__PURE__*/ function() {
1128 - function EditorOneMenu() {
1129 - var _window;
1130 - _classCallCheck(this, EditorOneMenu);
1131 - this.config = ((_window = window) === null || _window === void 0 ? void 0 : _window.editorOneMenuConfig) || {};
1132 - }
1133 - return _createClass(EditorOneMenu, [
1134 - {
1135 - key: "init",
1136 - value: function init() {
1137 - MenuEventsTracker.attach();
1138 - if (this.isSidebarNavigationActive()) {
1139 - new SidebarMenuHandler();
1140 - return;
1141 - }
1142 - this.buildFlyoutMenus();
1143 - }
1144 - },
1145 - {
1146 - key: "isSidebarNavigationActive",
1147 - value: function isSidebarNavigationActive() {
1148 - return document.body.classList.contains("e-has-sidebar-navigation");
1149 - }
1150 - },
1151 - {
1152 - key: "buildFlyoutMenus",
1153 - value: function buildFlyoutMenus() {
1154 - if (new FlyoutMenuRenderer(this.config).render()) new FlyoutInteractionHandler().handle();
1155 - }
1156 - }
1157 - ]);
1158 - }();
1159 - var initEditorOneMenu = function initEditorOneMenu() {
1160 - new EditorOneMenu().init();
1161 - };
1162 - if ("loading" === document.readyState) document.addEventListener("DOMContentLoaded", initEditorOneMenu);
1163 - else initEditorOneMenu();
1164 825
1165 -//#endregion
826 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
827 +Object.defineProperty(exports, "__esModule", ({
828 + value: true
829 +}));
830 +exports.FlyoutMenuRenderer = void 0;
831 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
832 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
833 +var FlyoutMenuRenderer = exports.FlyoutMenuRenderer = /*#__PURE__*/function () {
834 + function FlyoutMenuRenderer(config) {
835 + (0, _classCallCheck2.default)(this, FlyoutMenuRenderer);
836 + this.config = config;
837 + }
838 + return (0, _createClass2.default)(FlyoutMenuRenderer, [{
839 + key: "render",
840 + value: function render() {
841 + var editorFlyout = this.config.editorFlyout;
842 + if (!editorFlyout || !editorFlyout.items || !editorFlyout.items.length) {
843 + return false;
844 + }
845 + var editorLi = this.findEditorInMenu("#toplevel_page_elementor-home");
846 + if (!editorLi) {
847 + return false;
848 + }
849 + editorLi.classList.add('elementor-has-flyout');
850 + var editorFlyoutUl = document.createElement('ul');
851 + editorFlyoutUl.className = 'elementor-submenu-flyout elementor-level-3';
852 + editorFlyout.items.forEach(function (item) {
853 + if (item.has_divider_before) {
854 + var dividerLi = document.createElement('li');
855 + dividerLi.className = 'elementor-flyout-divider';
856 + dividerLi.setAttribute('role', 'separator');
857 + editorFlyoutUl.appendChild(dividerLi);
858 + }
859 + var li = document.createElement('li');
860 + li.setAttribute('data-group-id', item.group_id || '');
861 + li.setAttribute('data-slug', item.slug || '');
862 + var a = document.createElement('a');
863 + a.href = item.url;
864 + a.textContent = item.label;
865 + li.appendChild(a);
866 + editorFlyoutUl.appendChild(li);
867 + });
868 + editorLi.appendChild(editorFlyoutUl);
869 + return true;
870 + }
871 + }, {
872 + key: "findEditorInMenu",
873 + value: function findEditorInMenu(menuSelector) {
874 + var menuItem = document.querySelector(menuSelector);
875 + if (!menuItem) {
876 + return null;
877 + }
878 + var submenu = menuItem.querySelector('.wp-submenu');
879 + if (!submenu) {
880 + return null;
881 + }
882 + var editorItem = submenu.querySelector('a[href$="page=elementor"]');
883 + if (!editorItem) {
884 + return null;
885 + }
886 + return editorItem.closest('li');
887 + }
888 + }]);
889 +}();
890 +
891 +/***/ }),
892 +
893 +/***/ "../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js":
894 +/*!*********************************************************************************!*\
895 + !*** ../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js ***!
896 + \*********************************************************************************/
897 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
898 +
899 +"use strict";
900 +
901 +
902 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
903 +Object.defineProperty(exports, "__esModule", ({
904 + value: true
905 +}));
906 +exports.MenuEventsTracker = void 0;
907 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
908 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
909 +var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
910 +var SELECTORS = {
911 + elementorMenuLink: '#toplevel_page_elementor-home > a.menu-top',
912 + themeBuilderItem: '[data-slug="elementor-theme-builder"] a, .wp-submenu a[href*="page=elementor-theme-builder"]'
913 +};
914 +var MenuEventsTracker = exports.MenuEventsTracker = /*#__PURE__*/function () {
915 + function MenuEventsTracker() {
916 + (0, _classCallCheck2.default)(this, MenuEventsTracker);
917 + }
918 + return (0, _createClass2.default)(MenuEventsTracker, null, [{
919 + key: "attach",
920 + value: function attach() {
921 + this.attachElementorMenuClick();
922 + this.attachThemeBuilderClick();
923 + }
924 + }, {
925 + key: "attachElementorMenuClick",
926 + value: function attachElementorMenuClick() {
927 + var menuLink = document.querySelector(SELECTORS.elementorMenuLink);
928 + if (!menuLink) {
929 + return;
930 + }
931 + menuLink.addEventListener('click', function () {
932 + _editorOneEvents.EditorOneEventManager.sendWpDashElementorMenuClick();
933 + });
934 + }
935 + }, {
936 + key: "attachThemeBuilderClick",
937 + value: function attachThemeBuilderClick() {
938 + document.addEventListener('click', function (event) {
939 + var link = event.target.closest(SELECTORS.themeBuilderItem);
940 + if (link) {
941 + _editorOneEvents.EditorOneEventManager.sendWpDashThemeBuilderClick();
942 + }
943 + }, true);
944 + }
945 + }, {
946 + key: "trackEditorSubMenuOpened",
947 + value: function trackEditorSubMenuOpened() {
948 + _editorOneEvents.EditorOneEventManager.sendWpDashEditorSubMenuHover();
949 + }
950 + }]);
951 +}();
952 +
953 +/***/ }),
954 +
955 +/***/ "../modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js":
956 +/*!**********************************************************************************!*\
957 + !*** ../modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js ***!
958 + \**********************************************************************************/
959 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
960 +
961 +"use strict";
962 +
963 +
964 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
965 +Object.defineProperty(exports, "__esModule", ({
966 + value: true
967 +}));
968 +exports.SidebarMenuHandler = void 0;
969 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
970 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
971 +var SidebarMenuHandler = exports.SidebarMenuHandler = /*#__PURE__*/function () {
972 + function SidebarMenuHandler() {
973 + (0, _classCallCheck2.default)(this, SidebarMenuHandler);
974 + this.elementorHomeMenu = this.findElementorHomeMenu();
975 + if (this.elementorHomeMenu) {
976 + this.deactivateOtherMenus();
977 + this.activateElementorMenu();
978 + this.highlightSubmenu();
979 + }
980 + }
981 + return (0, _createClass2.default)(SidebarMenuHandler, [{
982 + key: "findElementorHomeMenu",
983 + value: function findElementorHomeMenu() {
984 + return document.querySelector('#toplevel_page_elementor-home');
985 + }
986 + }, {
987 + key: "deactivateOtherMenus",
988 + value: function deactivateOtherMenus() {
989 + var _this = this;
990 + document.querySelectorAll('#adminmenu li.wp-has-current-submenu').forEach(function (item) {
991 + if (item !== _this.elementorHomeMenu) {
992 + item.classList.remove('wp-has-current-submenu', 'wp-menu-open', 'selected');
993 + item.classList.add('wp-not-current-submenu');
994 + var link = item.querySelector(':scope > a');
995 + if (link) {
996 + link.classList.remove('wp-has-current-submenu', 'wp-menu-open', 'current');
997 + }
998 + }
999 + });
1000 + }
1001 + }, {
1002 + key: "activateElementorMenu",
1003 + value: function activateElementorMenu() {
1004 + this.elementorHomeMenu.classList.remove('wp-not-current-submenu');
1005 + this.elementorHomeMenu.classList.add('wp-has-current-submenu', 'wp-menu-open', 'selected');
1006 + var elementorLink = this.elementorHomeMenu.querySelector(':scope > a.menu-top');
1007 + if (elementorLink) {
1008 + elementorLink.classList.add('wp-has-current-submenu', 'wp-menu-open');
1009 + }
1010 + }
1011 + }, {
1012 + key: "highlightSubmenu",
1013 + value: function highlightSubmenu() {
1014 + var currentUrl = new URL(window.location.href);
1015 + var searchParams = currentUrl.searchParams;
1016 + var page = searchParams.get('page');
1017 + var targetSlug = 'elementor';
1018 + if ('elementor' === page || 'elementor-home' === page) {
1019 + targetSlug = 'elementor';
1020 + } else if ('e-form-submissions' === page) {
1021 + targetSlug = 'e-form-submissions';
1022 + } else if ('elementor-theme-builder' === page) {
1023 + targetSlug = 'elementor-theme-builder';
1024 + }
1025 + var submenuItems = this.elementorHomeMenu.querySelectorAll('.wp-submenu li');
1026 + submenuItems.forEach(function (item) {
1027 + var link = item.querySelector('a');
1028 + if (!link) {
1029 + return;
1030 + }
1031 + item.classList.remove('current');
1032 + link.classList.remove('current');
1033 + link.setAttribute('aria-current', '');
1034 + var linkUrl = new URL(link.href, window.location.origin);
1035 + var linkPage = linkUrl.searchParams.get('page');
1036 + if (linkPage === targetSlug) {
1037 + item.classList.add('current');
1038 + link.classList.add('current');
1039 + link.setAttribute('aria-current', 'page');
1040 + }
1041 + });
1042 + }
1043 + }]);
1044 +}();
1045 +
1046 +/***/ }),
1047 +
1048 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
1049 +/*!****************************************************************!*\
1050 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
1051 + \****************************************************************/
1052 +/***/ ((module) => {
1053 +
1054 +function _classCallCheck(a, n) {
1055 + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
1056 +}
1057 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
1058 +
1059 +/***/ }),
1060 +
1061 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
1062 +/*!*************************************************************!*\
1063 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
1064 + \*************************************************************/
1065 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1066 +
1067 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
1068 +function _defineProperties(e, r) {
1069 + for (var t = 0; t < r.length; t++) {
1070 + var o = r[t];
1071 + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
1072 + }
1073 +}
1074 +function _createClass(e, r, t) {
1075 + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
1076 + writable: !1
1077 + }), e;
1078 +}
1079 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
1080 +
1081 +/***/ }),
1082 +
1083 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
1084 +/*!****************************************************************!*\
1085 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
1086 + \****************************************************************/
1087 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1088 +
1089 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
1090 +function _defineProperty(e, r, t) {
1091 + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
1092 + value: t,
1093 + enumerable: !0,
1094 + configurable: !0,
1095 + writable: !0
1096 + }) : e[r] = t, e;
1097 +}
1098 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
1099 +
1100 +/***/ }),
1101 +
1102 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
1103 +/*!***********************************************************************!*\
1104 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
1105 + \***********************************************************************/
1106 +/***/ ((module) => {
1107 +
1108 +function _interopRequireDefault(e) {
1109 + return e && e.__esModule ? e : {
1110 + "default": e
1111 + };
1112 +}
1113 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
1114 +
1115 +/***/ }),
1116 +
1117 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
1118 +/*!*************************************************************!*\
1119 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
1120 + \*************************************************************/
1121 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1122 +
1123 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1124 +function toPrimitive(t, r) {
1125 + if ("object" != _typeof(t) || !t) return t;
1126 + var e = t[Symbol.toPrimitive];
1127 + if (void 0 !== e) {
1128 + var i = e.call(t, r || "default");
1129 + if ("object" != _typeof(i)) return i;
1130 + throw new TypeError("@@toPrimitive must return a primitive value.");
1131 + }
1132 + return ("string" === r ? String : Number)(t);
1133 +}
1134 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
1135 +
1136 +/***/ }),
1137 +
1138 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
1139 +/*!***************************************************************!*\
1140 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
1141 + \***************************************************************/
1142 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1143 +
1144 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
1145 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
1146 +function toPropertyKey(t) {
1147 + var i = toPrimitive(t, "string");
1148 + return "symbol" == _typeof(i) ? i : i + "";
1149 +}
1150 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
1151 +
1152 +/***/ }),
1153 +
1154 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
1155 +/*!********************************************************!*\
1156 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
1157 + \********************************************************/
1158 +/***/ ((module) => {
1159 +
1160 +function _typeof(o) {
1161 + "@babel/helpers - typeof";
1162 +
1163 + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
1164 + return typeof o;
1165 + } : function (o) {
1166 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1167 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
1168 +}
1169 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
1170 +
1171 +/***/ })
1172 +
1173 +/******/ });
1174 +/************************************************************************/
1175 +/******/ // The module cache
1176 +/******/ var __webpack_module_cache__ = {};
1177 +/******/
1178 +/******/ // The require function
1179 +/******/ function __webpack_require__(moduleId) {
1180 +/******/ // Check if module is in cache
1181 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
1182 +/******/ if (cachedModule !== undefined) {
1183 +/******/ return cachedModule.exports;
1184 +/******/ }
1185 +/******/ // Create a new module (and put it into the cache)
1186 +/******/ var module = __webpack_module_cache__[moduleId] = {
1187 +/******/ // no module.id needed
1188 +/******/ // no module.loaded needed
1189 +/******/ exports: {}
1190 +/******/ };
1191 +/******/
1192 +/******/ // Execute the module function
1193 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1194 +/******/
1195 +/******/ // Return the exports of the module
1196 +/******/ return module.exports;
1197 +/******/ }
1198 +/******/
1199 +/************************************************************************/
1200 +var __webpack_exports__ = {};
1201 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
1202 +(() => {
1203 +"use strict";
1204 +/*!*********************************************************!*\
1205 + !*** ../modules/editor-one/assets/js/admin-menu/app.js ***!
1206 + \*********************************************************/
1207 +
1208 +
1209 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1210 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1211 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1212 +var _flyoutMenuRenderer = __webpack_require__(/*! ./classes/flyout-menu-renderer */ "../modules/editor-one/assets/js/admin-menu/classes/flyout-menu-renderer.js");
1213 +var _sidebarMenuHandler = __webpack_require__(/*! ./classes/sidebar-menu-handler */ "../modules/editor-one/assets/js/admin-menu/classes/sidebar-menu-handler.js");
1214 +var _flyoutInteractionHandler = __webpack_require__(/*! ./classes/flyout-interaction-handler */ "../modules/editor-one/assets/js/admin-menu/classes/flyout-interaction-handler.js");
1215 +var _menuEventsTracker = __webpack_require__(/*! ./classes/menu-events-tracker */ "../modules/editor-one/assets/js/admin-menu/classes/menu-events-tracker.js");
1216 +var EditorOneMenu = /*#__PURE__*/function () {
1217 + function EditorOneMenu() {
1218 + var _window;
1219 + (0, _classCallCheck2.default)(this, EditorOneMenu);
1220 + this.config = ((_window = window) === null || _window === void 0 ? void 0 : _window.editorOneMenuConfig) || {};
1221 + }
1222 + return (0, _createClass2.default)(EditorOneMenu, [{
1223 + key: "init",
1224 + value: function init() {
1225 + _menuEventsTracker.MenuEventsTracker.attach();
1226 + if (this.isSidebarNavigationActive()) {
1227 + new _sidebarMenuHandler.SidebarMenuHandler();
1228 + return;
1229 + }
1230 + this.buildFlyoutMenus();
1231 + }
1232 + }, {
1233 + key: "isSidebarNavigationActive",
1234 + value: function isSidebarNavigationActive() {
1235 + return document.body.classList.contains('e-has-sidebar-navigation');
1236 + }
1237 + }, {
1238 + key: "buildFlyoutMenus",
1239 + value: function buildFlyoutMenus() {
1240 + var renderer = new _flyoutMenuRenderer.FlyoutMenuRenderer(this.config);
1241 + if (renderer.render()) {
1242 + new _flyoutInteractionHandler.FlyoutInteractionHandler().handle();
1243 + }
1244 + }
1245 + }]);
1246 +}();
1247 +var initEditorOneMenu = function initEditorOneMenu() {
1248 + var editorOneMenu = new EditorOneMenu();
1249 + editorOneMenu.init();
1250 +};
1251 +if ('loading' === document.readyState) {
1252 + document.addEventListener('DOMContentLoaded', initEditorOneMenu);
1253 +} else {
1254 + initEditorOneMenu();
1255 +}
1166 1256 })();
1257 +
1258 +/******/ })()
1259 +;
1167 1260 //# sourceMappingURL=editor-one-menu.js.map