PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.0-beta1
Elementor Website Builder – more than just a page builder v3.34.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | assets/js/common.js +98 -705 4.1.4 → 3.34.0-beta1 View file →
@@ -1,445 +1,7 @@
1 1 /******/ (() => { // webpackBootstrap
2 2 /******/ var __webpack_modules__ = ({
3 3
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 -
10 -"use strict";
11 -
12 -
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;
439 -
440 -/***/ }),
441 -
442 4 /***/ "../assets/dev/js/editor/utils/files-upload-handler.js":
443 5 /*!*************************************************************!*\
444 6 !*** ../assets/dev/js/editor/utils/files-upload-handler.js ***!
445 7 \*************************************************************/
@@ -1027,18 +589,11 @@
1027 589 });
1028 590 }
1029 591 },
1030 592 button: {
1031 - tag: 'button'
593 + tag: 'div'
1032 594 }
1033 595 });
1034 -
1035 - // Add role="status" and aria-live for screen reader announcement
1036 - toast.getElements('widget').attr({
1037 - role: 'status',
1038 - 'aria-live': 'polite',
1039 - 'aria-atomic': 'true'
1040 - });
1041 596 this.getToast = function () {
1042 597 return toast;
1043 598 };
1044 599 },
@@ -1045,10 +600,8 @@
1045 600 showToast: function showToast(options) {
1046 601 var toast = this.getToast();
1047 602 toast.setMessage(options.message);
1048 603 toast.getElements('buttonsWrapper').empty();
1049 - toast.focusedButton = null;
1050 - toast.buttons = [];
1051 604 var isPositionValid = this.isPositionValid(options === null || options === void 0 ? void 0 : options.position);
1052 605 if (!isPositionValid) {
1053 606 this.positionToWindow();
1054 607 }
@@ -1775,16 +1328,14 @@
1775 1328 var cacheKey = this.getCacheKey(request);
1776 1329 if (_.has(this.cache, cacheKey)) {
1777 1330 deferred = jQuery.Deferred().done(request.success).resolve(this.cache[cacheKey]);
1778 1331 } else {
1779 - var _request$error;
1780 1332 deferred = this.addRequest(request.action, {
1781 1333 data: request.data,
1782 1334 unique_id: request.unique_id,
1783 1335 success: function success(data) {
1784 1336 return _this3.cache[cacheKey] = data;
1785 - },
1786 - error: (_request$error = request.error) !== null && _request$error !== void 0 ? _request$error : function () {}
1337 + }
1787 1338 }, immediately).done(request.success);
1788 1339 }
1789 1340 return deferred;
1790 1341 }
@@ -2184,55 +1735,8 @@
2184 1735 value: true
2185 1736 }));
2186 1737 exports["default"] = void 0;
2187 1738 var eventsConfig = {
2188 - appTypes: {
2189 - editor: 'editor',
2190 - wpAdmin: 'wpadmin',
2191 - wpDash: 'wpdash'
2192 - },
2193 - targetTypes: {
2194 - dropdownItem: 'dropdown_item',
2195 - button: 'button',
2196 - tab: 'tab',
2197 - toggle: 'toggle',
2198 - searchInput: 'search_input',
2199 - searchResult: 'search_result',
2200 - buttons: 'buttons',
2201 - searchWidget: 'search_widget',
2202 - wpDashAdminMenuItem: 'wpdash_admin_menu_item',
2203 - wpDashEditorMenu: 'wpdash_editor_menu',
2204 - wpDashSubMenuItem: 'wpdash_sub_menu_item'
2205 - },
2206 - interactionResults: {
2207 - actionSelected: 'action_selected',
2208 - navigate: 'navigate',
2209 - create: 'create',
2210 - sessionEnd: 'session_end',
2211 - tabChanged: 'tab_changed',
2212 - assetInserted: 'asset_inserted',
2213 - assetFavorite: 'asset_favorite',
2214 - aiGenerate: 'ai_generate',
2215 - resultsUpdated: 'results_updated',
2216 - noResults: 'no_results',
2217 - selected: 'selected',
2218 - promotionViewed: 'promotion_viewed',
2219 - upgradeNow: 'upgrade_now',
2220 - elementorSideMenuOpened: 'elementor_side_menu_opened',
2221 - editorSubMenuOpened: 'wpdash_editor_sub_menu_opened',
2222 - themeBuilderPromotionWindow: 'theme_builder_promotion_window'
2223 - },
2224 - targetNames: {
2225 - publishDropdown: {
2226 - saveDraft: 'save_draft',
2227 - saveAsTemplate: 'save_as_template',
2228 - viewPage: 'view_page',
2229 - copyAndShare: 'copy_and_share'
2230 - },
2231 - pageList: {
2232 - addNewPage: 'add_new_page'
2233 - }
2234 - },
2235 1739 triggers: {
2236 1740 click: 'Click',
2237 1741 rightClick: 'Right Click',
2238 1742 doubleClick: 'Double Click',
@@ -2240,18 +1744,13 @@
2240 1744 toggleClick: 'Toggle Click',
2241 1745 dropdownClick: 'Click Dropdown',
2242 1746 editorLoaded: 'Editor Loaded',
2243 1747 visible: 'Visible',
2244 - pageLoaded: 'Page Loaded',
2245 - typing: 'Typing',
2246 - tabSelect: 'Tab Select',
2247 - insert: 'Insert',
2248 - hover: 'Hover'
1748 + pageLoaded: 'Page Loaded'
2249 1749 },
2250 1750 locations: {
2251 1751 widgetPanel: 'Widget Panel',
2252 1752 topBar: 'Top Bar',
2253 - sidebar: 'Sidebar',
2254 1753 elementorEditor: 'Elementor Editor',
2255 1754 templatesLibrary: {
2256 1755 library: 'Templates Library'
2257 1756 },
@@ -2263,16 +1762,10 @@
2263 1762 },
2264 1763 variables: 'Variables Panel',
2265 1764 variablesManager: 'Variables Manager',
2266 1765 admin: 'WP admin',
2267 - wpDashAdmin: 'wpdash_admin',
2268 1766 structurePanel: 'Structure Panel',
2269 - canvas: 'Canvas',
2270 - leftPanel: 'Left Panel',
2271 - elementorLibrary: 'Elementor Library',
2272 - components: {
2273 - instanceEditingPanel: 'Instance Editing Panel'
2274 - }
1767 + canvas: 'Canvas'
2275 1768 },
2276 1769 secondaryLocations: {
2277 1770 layout: 'Layout Section',
2278 1771 basic: 'Basic Section',
@@ -2345,19 +1838,9 @@
2345 1838 pluginToolsTab: 'plugin_tools_tab',
2346 1839 pluginWebsiteTemplatesTab: 'plugin_website_templates_tab'
2347 1840 },
2348 1841 componentsTab: 'Components Tab',
2349 - canvasElement: 'Canvas Element',
2350 - publishDropdown: 'Publish Dropdown',
2351 - pageListDropdown: 'Page List Dropdown',
2352 - emptyBox: 'Empty Box',
2353 - searchBar: 'Search Bar',
2354 - finderResults: 'Finder Results',
2355 - libraryTabs: 'Library Tabs',
2356 - assetCard: 'Asset Card',
2357 - wpDashElementorCoreMenu: 'elementor_editor_core_menu',
2358 - wpDashElementorCoreSubMenu: 'elementor_editor_core_sub_menu',
2359 - wpDashThemeBuilder: 'wpdash_core_sub_menu_theme_builder'
1842 + canvasElement: 'Canvas Element'
2360 1843 },
2361 1844 elements: {
2362 1845 accordionSection: 'Accordion section',
2363 1846 buttonIcon: 'Button Icon',
@@ -2406,9 +1889,8 @@
2406 1889 accountConnected: 'account_connected'
2407 1890 },
2408 1891 // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade
2409 1892 elementorEditor: {
2410 - editorLoaded: 'editor_loaded',
2411 1893 checklist: {
2412 1894 checklistHeaderClose: 'checklist_header_close_icon',
2413 1895 checklistFirstPopup: 'checklist popup triggered'
2414 1896 },
@@ -2423,31 +1905,16 @@
2423 1905 connect: 'connect_variable',
2424 1906 save: 'save_new_variable',
2425 1907 openManager: 'open_variables_manager',
2426 1908 saveChanges: 'save_variables_changes',
2427 - delete: 'delete_variable',
2428 - variableSyncToV3: 'variable_sync_to_v3'
1909 + delete: 'delete_variable'
2429 1910 },
2430 - design_system: {
2431 - importOpened: 'design_system_import_opened',
2432 - fileSelected: 'design_system_file_selected',
2433 - validationFailed: 'design_system_validation_failed',
2434 - conflictChoice: 'design_system_conflict_choice',
2435 - confirmed: 'design_system_import_confirmed',
2436 - imported: 'design_system_imported',
2437 - importFailed: 'design_system_import_failed'
2438 - },
2439 1911 components: {
2440 1912 createClicked: 'component_create_clicked',
2441 1913 createCancelled: 'component_creation_cancelled',
2442 1914 created: 'component_created',
2443 1915 instanceAdded: 'component_instance_added',
2444 - edited: 'component_edited',
2445 - propertiesPanelOpened: 'component_properties_panel_opened',
2446 - propertiesGroupCreated: 'component_properties_group_created',
2447 - propertyExposed: 'component_property_exposed',
2448 - propertyRemoved: 'component_property_removed',
2449 - detached: 'component_detached'
1916 + edited: 'component_edited'
2450 1917 },
2451 1918 global_classes: {
2452 1919 classApplied: 'class_applied',
2453 1920 classRemoved: 'class_removed',
@@ -2465,35 +1932,9 @@
2465 1932 classUsageHovered: 'class_usage_hovered',
2466 1933 classStyled: 'class_styled',
2467 1934 classStateClicked: 'class_state_clicked',
2468 1935 classUsageClicked: 'class_usage_clicked',
2469 - classDuplicate: 'class_duplicate',
2470 - classSyncToV3PopupShown: 'class_sync_to_v3_popup_shown',
2471 - classSyncToV3: 'class_sync_to_v3',
2472 - classSyncToV3PopupClick: 'class_sync_to_v3_popup_click'
2473 - },
2474 - editorOne: {
2475 - topBarPublishDropdown: 'top_bar_publish_dropdown',
2476 - topBarPageList: 'top_bar_page_list',
2477 - siteSettingsSession: 'site_settings_session',
2478 - eLibraryNav: 'e_library_nav',
2479 - eLibraryInsert: 'e_library_insert',
2480 - eLibraryFavorite: 'e_library_favorite',
2481 - eLibraryGenerateAi: 'e_library_generate_ai',
2482 - finderSearchInput: 'finder_search_input',
2483 - finderResultSelect: 'finder_result_select',
2484 - canvasEmptyBoxAction: 'canvas_empty_box_action',
2485 - widgetPanelSearch: 'widget_panel_search',
2486 - wpDashElementorMenuClick: 'wpdash_elementor_menu_click',
2487 - wpDashEditorSubMenuHover: 'wpdash_editor_sub_menu_hover',
2488 - wpDashThemeBuilderClick: 'wpdash_theme_builder_click'
2489 - },
2490 - interactions: {
2491 - created: 'interactions_created'
2492 - },
2493 - promotions: {
2494 - viewPromotion: 'view_promotion',
2495 - upgradePromotionClick: 'upgrade_promotion_click'
1936 + classDuplicate: 'class_duplicate'
2496 1937 }
2497 1938 }
2498 1939 };
2499 1940 var _default = exports["default"] = eventsConfig;
@@ -2509,9 +1950,8 @@
2509 1950 "use strict";
2510 1951
2511 1952
2512 1953 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2513 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2514 1954 Object.defineProperty(exports, "__esModule", ({
2515 1955 value: true
2516 1956 }));
2517 1957 exports["default"] = void 0;
@@ -2523,17 +1963,20 @@
2523 1963 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2524 1964 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2525 1965 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2526 1966 var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ./events-config */ "../core/common/modules/events-manager/assets/js/events-config.js"));
2527 -var _mixpanelBrowser = _interopRequireWildcard(__webpack_require__(/*! mixpanel-browser */ "../node_modules/mixpanel-browser/dist/mixpanel.module.js"));
1967 +var _mixpanelBrowser = _interopRequireDefault(__webpack_require__(/*! mixpanel-browser */ "../node_modules/mixpanel-browser/dist/mixpanel.module.js"));
2528 1968 var _tiers = __webpack_require__(/*! elementor-utils/tiers */ "../assets/dev/js/utils/tiers.js");
2529 -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
2530 1969 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; }
2531 1970 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; }
2532 1971 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2533 1972 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2534 -/** @type {Mixpanel | null} */
2535 -var mixpanelInstance = null;
1973 +function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
1974 +function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
1975 +function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
1976 +function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
1977 +function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
1978 +var _sessionRecordingInProgress = /*#__PURE__*/new WeakMap();
2536 1979 var _default = exports["default"] = /*#__PURE__*/function (_elementorModules$Mod) {
2537 1980 function _default() {
2538 1981 var _this;
2539 1982 (0, _classCallCheck2.default)(this, _default);
@@ -2541,9 +1984,9 @@
2541 1984 args[_key] = arguments[_key];
2542 1985 }
2543 1986 _this = _callSuper(this, _default, [].concat(args));
2544 1987 (0, _defineProperty2.default)(_this, "trackingEnabled", false);
2545 - (0, _defineProperty2.default)(_this, "availableExperiments", []);
1988 + _classPrivateFieldInitSpec(_this, _sessionRecordingInProgress, false);
2546 1989 return _this;
2547 1990 }
2548 1991 (0, _inherits2.default)(_default, _elementorModules$Mod);
2549 1992 return (0, _createClass2.default)(_default, [{
@@ -2548,71 +1991,51 @@
2548 1991 (0, _inherits2.default)(_default, _elementorModules$Mod);
2549 1992 return (0, _createClass2.default)(_default, [{
2550 1993 key: "onInit",
2551 1994 value: function onInit() {
2552 - var _this2 = this;
1995 + var _elementorCommon$conf, _elementorCommon$conf2;
2553 1996 this.config = _eventsConfig.default;
2554 - if (!this.canSendEvents()) {
2555 - return;
2556 - }
2557 - this.initializeMixpanel(function () {
2558 - return _this2.enableTracking();
1997 + _mixpanelBrowser.default.init((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.token, {
1998 + persistence: 'localStorage',
1999 + autocapture: false,
2000 + record_sessions_percent: 0,
2001 + record_idle_timeout_ms: 60000,
2002 + record_max_ms: 300000,
2003 + record_mask_text_selector: '',
2004 + flags: true,
2005 + api_hosts: {
2006 + flags: 'https://api-eu.mixpanel.com'
2007 + }
2559 2008 });
2560 - }
2561 - }, {
2562 - key: "initializeMixpanel",
2563 - value: function initializeMixpanel(onLoaded) {
2564 - if (mixpanelInstance && mixpanelInstance.isInitialized) {
2565 - onLoaded(mixpanelInstance);
2566 - } else {
2567 - var _elementorCommon$conf, _elementorCommon$conf2, _elementorCommon$conf3, _elementorCommon$conf4, _elementorCommon$conf5;
2568 - mixpanelInstance = _mixpanelBrowser.default.init((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.token, {
2569 - persistence: 'localStorage',
2570 - debug: (_elementorCommon$conf2 = (_elementorCommon$conf3 = elementorCommon.config.editor_events) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.debug) !== null && _elementorCommon$conf2 !== void 0 ? _elementorCommon$conf2 : false,
2571 - autocapture: false,
2572 - flags: true,
2573 - api_host: 'https://api-eu.mixpanel.com',
2574 - loaded: onLoaded,
2575 - record_sessions_percent: (_elementorCommon$conf4 = (_elementorCommon$conf5 = elementorCommon.config.editor_events) === null || _elementorCommon$conf5 === void 0 ? void 0 : _elementorCommon$conf5.session_recording_percent) !== null && _elementorCommon$conf4 !== void 0 ? _elementorCommon$conf4 : 0,
2576 - record_idle_timeout_ms: 60 * 1000,
2577 - // 60 Seconds
2578 - record_min_ms: 5 * 1000,
2579 - // 5 Seconds
2580 - record_mask_text_selector: '',
2581 - remote_settings_mode: 'strict'
2582 - }, 'elementor-editor');
2009 + if ((_elementorCommon$conf2 = elementorCommon.config.editor_events) !== null && _elementorCommon$conf2 !== void 0 && _elementorCommon$conf2.can_send_events) {
2010 + this.enableTracking();
2583 2011 }
2584 - elementorCommon.config.editor_events.mixpanelInstance = mixpanelInstance;
2585 2012 }
2586 2013 }, {
2587 2014 key: "enableTracking",
2588 2015 value: function enableTracking() {
2589 - var _elementorCommon$conf6;
2590 - if (!this.isMixpanelReady()) {
2591 - return;
2592 - }
2593 - var userId = (_elementorCommon$conf6 = elementorCommon.config.editor_events) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.user_id;
2594 - mixpanelInstance.register({
2595 - appType: 'Editor'
2596 - });
2016 + var _elementorCommon$conf3;
2017 + var userId = (_elementorCommon$conf3 = elementorCommon.config.library_connect) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.user_id;
2597 2018 if (userId) {
2598 - var _elementorCommon$conf7;
2599 - mixpanelInstance.identify(userId);
2600 - mixpanelInstance.people.set_once({
2019 + var _elementorCommon$conf4;
2020 + _mixpanelBrowser.default.identify(userId);
2021 + _mixpanelBrowser.default.register({
2022 + appType: 'Editor'
2023 + });
2024 + _mixpanelBrowser.default.people.set_once({
2601 2025 $user_id: userId,
2602 2026 $last_login: new Date().toISOString(),
2603 - $plan_type: ((_elementorCommon$conf7 = elementorCommon.config.library_connect) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.plan_type) || _tiers.TIERS.free
2027 + $plan_type: ((_elementorCommon$conf4 = elementorCommon.config.library_connect) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.plan_type) || _tiers.TIERS.free
2604 2028 });
2605 2029 }
2606 2030 this.trackingEnabled = true;
2607 - this.availableExperiments = Object.keys(elementorCommon.config.experimentalFeatures || {});
2608 2031 }
2609 2032 }, {
2610 2033 key: "dispatchEvent",
2611 2034 value: function dispatchEvent(name, data) {
2612 - var _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10, _elementorCommon$conf11, _elementorCommon$conf12, _elementorCommon$conf13, _elementorCommon$conf14;
2035 + var _elementorCommon$conf5, _elementorCommon$conf6, _elementorCommon$conf7, _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10, _elementorCommon$conf11, _elementorCommon$conf12;
2613 2036 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2614 - if (!this.canSendEvents()) {
2037 + if (!((_elementorCommon$conf5 = elementorCommon.config.editor_events) !== null && _elementorCommon$conf5 !== void 0 && _elementorCommon$conf5.can_send_events)) {
2615 2038 return;
2616 2039 }
2617 2040 if (!this.trackingEnabled) {
2618 2041 this.enableTracking();
@@ -2617,31 +2040,66 @@
2617 2040 if (!this.trackingEnabled) {
2618 2041 this.enableTracking();
2619 2042 }
2620 2043 var eventData = _objectSpread({
2621 - user_id: ((_elementorCommon$conf8 = elementorCommon.config.editor_events) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.user_id) || null,
2622 - user_roles: ((_elementorCommon$conf9 = elementorCommon.config.library_connect) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.user_roles) || [],
2623 - subscription_id: ((_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.subscription_id) || null,
2624 - user_tier: ((_elementorCommon$conf1 = elementorCommon.config.library_connect) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.current_access_tier) || null,
2625 - url: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.site_url,
2626 - wp_version: (_elementorCommon$conf11 = elementorCommon.config.editor_events) === null || _elementorCommon$conf11 === void 0 ? void 0 : _elementorCommon$conf11.wp_version,
2627 - client_id: (_elementorCommon$conf12 = elementorCommon.config.editor_events) === null || _elementorCommon$conf12 === void 0 ? void 0 : _elementorCommon$conf12.site_key,
2628 - app_version: (_elementorCommon$conf13 = elementorCommon.config.editor_events) === null || _elementorCommon$conf13 === void 0 ? void 0 : _elementorCommon$conf13.elementor_version,
2629 - site_language: (_elementorCommon$conf14 = elementorCommon.config.editor_events) === null || _elementorCommon$conf14 === void 0 ? void 0 : _elementorCommon$conf14.site_language,
2630 - experiments: this.availableExperiments
2044 + user_id: ((_elementorCommon$conf6 = elementorCommon.config.library_connect) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.user_id) || null,
2045 + user_roles: ((_elementorCommon$conf7 = elementorCommon.config.library_connect) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.user_roles) || [],
2046 + subscription_id: ((_elementorCommon$conf8 = elementorCommon.config.editor_events) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.subscription_id) || null,
2047 + user_tier: ((_elementorCommon$conf9 = elementorCommon.config.library_connect) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.current_access_tier) || null,
2048 + url: (_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.site_url,
2049 + wp_version: (_elementorCommon$conf1 = elementorCommon.config.editor_events) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.wp_version,
2050 + client_id: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.site_key,
2051 + app_version: (_elementorCommon$conf11 = elementorCommon.config.editor_events) === null || _elementorCommon$conf11 === void 0 ? void 0 : _elementorCommon$conf11.elementor_version,
2052 + site_language: (_elementorCommon$conf12 = elementorCommon.config.editor_events) === null || _elementorCommon$conf12 === void 0 ? void 0 : _elementorCommon$conf12.site_language
2631 2053 }, data);
2632 - mixpanelInstance.track(name, eventData, options);
2054 + _mixpanelBrowser.default.track(name, eventData, options);
2633 2055 }
2634 2056 }, {
2057 + key: "startSessionRecording",
2058 + value: function startSessionRecording() {
2059 + var _elementorCommon$conf13;
2060 + if (!((_elementorCommon$conf13 = elementorCommon.config.editor_events) !== null && _elementorCommon$conf13 !== void 0 && _elementorCommon$conf13.can_send_events) || this.isSessionRecordingInProgress()) {
2061 + return;
2062 + }
2063 + if (!this.trackingEnabled) {
2064 + this.enableTracking();
2065 + }
2066 + _mixpanelBrowser.default.start_session_recording();
2067 + this.setSessionRecordingInProgress(true);
2068 + }
2069 + }, {
2070 + key: "stopSessionRecording",
2071 + value: function stopSessionRecording() {
2072 + var _elementorCommon$conf14;
2073 + if (!((_elementorCommon$conf14 = elementorCommon.config.editor_events) !== null && _elementorCommon$conf14 !== void 0 && _elementorCommon$conf14.can_send_events) || !this.isSessionRecordingInProgress()) {
2074 + return;
2075 + }
2076 + _mixpanelBrowser.default.stop_session_recording();
2077 + this.setSessionRecordingInProgress(false);
2078 + }
2079 + }, {
2080 + key: "setSessionRecordingInProgress",
2081 + value: function setSessionRecordingInProgress(value) {
2082 + if ('boolean' !== typeof value) {
2083 + return;
2084 + }
2085 + _classPrivateFieldSet(_sessionRecordingInProgress, this, value);
2086 + }
2087 + }, {
2088 + key: "isSessionRecordingInProgress",
2089 + value: function isSessionRecordingInProgress() {
2090 + return _classPrivateFieldGet(_sessionRecordingInProgress, this);
2091 + }
2092 + }, {
2635 2093 key: "featureFlagIsActive",
2636 2094 value: function () {
2637 2095 var _featureFlagIsActive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(flagName) {
2638 - var _mixpanelInstance;
2096 + var _mixpanel$flags;
2639 2097 var isEnabled;
2640 2098 return _regenerator.default.wrap(function (_context) {
2641 2099 while (1) switch (_context.prev = _context.next) {
2642 2100 case 0:
2643 - if (!('function' !== typeof ((_mixpanelInstance = mixpanelInstance) === null || _mixpanelInstance === void 0 || (_mixpanelInstance = _mixpanelInstance.flags) === null || _mixpanelInstance === void 0 ? void 0 : _mixpanelInstance.is_enabled))) {
2101 + if (!('function' !== typeof (_mixpanelBrowser.default === null || _mixpanelBrowser.default === void 0 || (_mixpanel$flags = _mixpanelBrowser.default.flags) === null || _mixpanel$flags === void 0 ? void 0 : _mixpanel$flags.is_enabled))) {
2644 2102 _context.next = 1;
2645 2103 break;
2646 2104 }
2647 2105 return _context.abrupt("return", false);
@@ -2646,9 +2104,9 @@
2646 2104 }
2647 2105 return _context.abrupt("return", false);
2648 2106 case 1:
2649 2107 _context.next = 2;
2650 - return mixpanelInstance.flags.is_enabled(flagName, false);
2108 + return _mixpanelBrowser.default.flags.is_enabled(flagName, false);
2651 2109 case 2:
2652 2110 isEnabled = _context.sent;
2653 2111 return _context.abrupt("return", true === isEnabled);
2654 2112 case 3:
@@ -2677,37 +2135,34 @@
2677 2135 while (1) switch (_context2.prev = _context2.next) {
2678 2136 case 0:
2679 2137 defaultValue = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 'control';
2680 2138 _context2.prev = 1;
2681 - if (this.canSendEvents()) {
2139 + isAbTestingEnabled = (_elementorCommon$conf15 = (_elementorCommon$conf16 = elementorCommon.config.editor_events) === null || _elementorCommon$conf16 === void 0 ? void 0 : _elementorCommon$conf16.flags_enabled) !== null && _elementorCommon$conf15 !== void 0 ? _elementorCommon$conf15 : false;
2140 + if (isAbTestingEnabled) {
2682 2141 _context2.next = 2;
2683 2142 break;
2684 2143 }
2685 2144 return _context2.abrupt("return", defaultValue);
2686 2145 case 2:
2687 - isAbTestingEnabled = (_elementorCommon$conf15 = (_elementorCommon$conf16 = elementorCommon.config.editor_events) === null || _elementorCommon$conf16 === void 0 ? void 0 : _elementorCommon$conf16.flags_enabled) !== null && _elementorCommon$conf15 !== void 0 ? _elementorCommon$conf15 : false;
2688 - if (isAbTestingEnabled) {
2146 + if (_mixpanelBrowser.default) {
2689 2147 _context2.next = 3;
2690 2148 break;
2691 2149 }
2692 2150 return _context2.abrupt("return", defaultValue);
2693 2151 case 3:
2694 - if (mixpanelInstance) {
2152 + if (this.trackingEnabled) {
2695 2153 _context2.next = 4;
2696 2154 break;
2697 2155 }
2698 2156 return _context2.abrupt("return", defaultValue);
2699 2157 case 4:
2700 - if (!this.trackingEnabled) {
2701 - this.enableTracking();
2702 - }
2703 - if (mixpanelInstance.flags) {
2158 + if (_mixpanelBrowser.default.flags) {
2704 2159 _context2.next = 5;
2705 2160 break;
2706 2161 }
2707 2162 return _context2.abrupt("return", defaultValue);
2708 2163 case 5:
2709 - if (!('function' !== typeof mixpanelInstance.flags.get_variant_value)) {
2164 + if (!('function' !== typeof _mixpanelBrowser.default.flags.get_variant_value)) {
2710 2165 _context2.next = 6;
2711 2166 break;
2712 2167 }
2713 2168 return _context2.abrupt("return", defaultValue);
@@ -2712,9 +2167,9 @@
2712 2167 }
2713 2168 return _context2.abrupt("return", defaultValue);
2714 2169 case 6:
2715 2170 _context2.next = 7;
2716 - return mixpanelInstance.flags.get_variant_value(experimentName, defaultValue);
2171 + return _mixpanelBrowser.default.flags.get_variant_value(experimentName, defaultValue);
2717 2172 case 7:
2718 2173 variant = _context2.sent;
2719 2174 if (!(undefined === variant || null === variant)) {
2720 2175 _context2.next = 8;
@@ -2743,37 +2198,13 @@
2743 2198 value: function startExperiment(experimentName, experimentVariant) {
2744 2199 if (!this.trackingEnabled) {
2745 2200 return;
2746 2201 }
2747 - mixpanelInstance.track('$experiment_started', {
2202 + _mixpanelBrowser.default.track('$experiment_started', {
2748 2203 'Experiment name': experimentName,
2749 2204 'Variant name': experimentVariant
2750 2205 });
2751 2206 }
2752 - }, {
2753 - key: "isMixpanelReady",
2754 - value: function isMixpanelReady() {
2755 - if ('undefined' === typeof mixpanelInstance || !mixpanelInstance) {
2756 - return false;
2757 - }
2758 - try {
2759 - var distinctId = mixpanelInstance.get_distinct_id();
2760 - return distinctId !== undefined && distinctId !== null;
2761 - } catch (error) {
2762 - return false;
2763 - }
2764 - }
2765 - }, {
2766 - key: "canSendEvents",
2767 - value: function canSendEvents() {
2768 - var _elementorCommon;
2769 - return !!((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.config) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.editor_events) !== null && _elementorCommon !== void 0 && _elementorCommon.can_send_events);
2770 - }
2771 - }, {
2772 - key: "getMixpanelInstance",
2773 - value: function getMixpanelInstance() {
2774 - return this.isMixpanelReady() ? mixpanelInstance : undefined;
2775 - }
2776 2207 }]);
2777 2208 }(elementorModules.Module);
2778 2209
2779 2210 /***/ }),
@@ -3378,12 +2809,10 @@
3378 2809 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3379 2810 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3380 2811 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3381 2812 var _categories = _interopRequireDefault(__webpack_require__(/*! ./categories */ "../core/common/modules/finder/assets/js/modal/views/categories.js"));
3382 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
3383 2813 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
3384 2814 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3385 -var FINDER_SEARCH_DEBOUNCE_MS = 300;
3386 2815 var _default = exports["default"] = /*#__PURE__*/function (_Marionette$LayoutVie) {
3387 2816 function _default() {
3388 2817 (0, _classCallCheck2.default)(this, _default);
3389 2818 return _callSuper(this, _default, arguments);
@@ -3420,30 +2849,15 @@
3420 2849 content: '#elementor-finder__content'
3421 2850 };
3422 2851 }
3423 2852 }, {
3424 - key: "initialize",
3425 - value: function initialize() {
3426 - this.debouncedTrackSearch = (0, _editorOneEvents.createDebouncedFinderSearch)(FINDER_SEARCH_DEBOUNCE_MS);
3427 - }
3428 - }, {
3429 2853 key: "showCategoriesView",
3430 2854 value: function showCategoriesView() {
3431 2855 this.content.show(new _categories.default());
3432 2856 }
3433 2857 }, {
3434 - key: "getResultsCount",
3435 - value: function getResultsCount() {
3436 - if (!this.content.currentView) {
3437 - return 0;
3438 - }
3439 - var $visibleItems = this.content.currentView.$el.find('.elementor-finder__results__item:visible');
3440 - return $visibleItems.length;
3441 - }
3442 - }, {
3443 2858 key: "onSearchInputInput",
3444 2859 value: function onSearchInputInput() {
3445 - var _this = this;
3446 2860 var value = this.ui.searchInput.val();
3447 2861 if (value) {
3448 2862 elementorCommon.finder.channel.reply('filter:text', value).trigger('filter:change');
3449 2863 if (!(this.content.currentView instanceof _categories.default)) {
@@ -3448,23 +2862,11 @@
3448 2862 elementorCommon.finder.channel.reply('filter:text', value).trigger('filter:change');
3449 2863 if (!(this.content.currentView instanceof _categories.default)) {
3450 2864 this.showCategoriesView();
3451 2865 }
3452 - setTimeout(function () {
3453 - var resultsCount = _this.getResultsCount();
3454 - _this.debouncedTrackSearch(resultsCount, value);
3455 - }, 50);
3456 2866 }
3457 2867 this.content.currentView.$el.toggle(!!value);
3458 2868 }
3459 - }, {
3460 - key: "onDestroy",
3461 - value: function onDestroy() {
3462 - var _this$debouncedTrackS;
3463 - if ((_this$debouncedTrackS = this.debouncedTrackSearch) !== null && _this$debouncedTrackS !== void 0 && _this$debouncedTrackS.cancel) {
3464 - this.debouncedTrackSearch.cancel();
3465 - }
3466 - }
3467 2869 }]);
3468 2870 }(Marionette.LayoutView);
3469 2871
3470 2872 /***/ }),
@@ -3575,9 +2977,8 @@
3575 2977 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3576 2978 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3577 2979 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3578 2980 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3579 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
3580 2981 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
3581 2982 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3582 2983 var _default = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
3583 2984 function _default() {
@@ -3600,20 +3001,13 @@
3600 3001 value: function events() {
3601 3002 this.$el[0].addEventListener('click', this.onClick.bind(this), true);
3602 3003 }
3603 3004 }, {
3604 - key: "trackResultSelect",
3605 - value: function trackResultSelect() {
3606 - var title = this.model.get('title');
3607 - _editorOneEvents.EditorOneEventManager.sendFinderResultSelect(title);
3608 - }
3609 - }, {
3610 3005 key: "onClick",
3611 3006 value: function onClick(e) {
3612 3007 var _this = this;
3613 3008 var lockOptions = this.model.get('lock');
3614 3009 if (!(lockOptions !== null && lockOptions !== void 0 && lockOptions.is_locked)) {
3615 - this.trackResultSelect();
3616 3010 return;
3617 3011 }
3618 3012 e.preventDefault();
3619 3013 e.stopImmediatePropagation();
@@ -3629,9 +3023,8 @@
3629 3023 confirm: lockOptions.button.text,
3630 3024 cancel: __('Cancel', 'elementor')
3631 3025 },
3632 3026 onConfirm: function onConfirm() {
3633 - _this.trackResultSelect();
3634 3027 var link = _this.replaceLockLinkPlaceholders(lockOptions.button.url);
3635 3028 window.open(link, '_blank');
3636 3029 }
3637 3030 }).show();