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