| @@ -1721,16 +1721,14 @@ | ||
| 1721 | 1721 | var cacheKey = this.getCacheKey(request); |
| 1722 | 1722 | if (_.has(this.cache, cacheKey)) { |
| 1723 | 1723 | deferred = jQuery.Deferred().done(request.success).resolve(this.cache[cacheKey]); |
| 1724 | 1724 | } else { |
| 1725 | - var _request$error; | |
| 1726 | 1725 | deferred = this.addRequest(request.action, { |
| 1727 | 1726 | data: request.data, |
| 1728 | 1727 | unique_id: request.unique_id, |
| 1729 | 1728 | success: function success(data) { |
| 1730 | 1729 | return _this3.cache[cacheKey] = data; |
| 1731 | - }, | |
| 1732 | - error: (_request$error = request.error) !== null && _request$error !== void 0 ? _request$error : function () {} | |
| 1730 | + } | |
| 1733 | 1731 | }, immediately).done(request.success); |
| 1734 | 1732 | } |
| 1735 | 1733 | return deferred; |
| 1736 | 1734 | } |
| @@ -2340,9 +2338,8 @@ | ||
| 2340 | 2338 | accountConnected: 'account_connected' |
| 2341 | 2339 | }, |
| 2342 | 2340 | // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade |
| 2343 | 2341 | elementorEditor: { |
| 2344 | - editorLoaded: 'editor_loaded', | |
| 2345 | 2342 | checklist: { |
| 2346 | 2343 | checklistHeaderClose: 'checklist_header_close_icon', |
| 2347 | 2344 | checklistFirstPopup: 'checklist popup triggered' |
| 2348 | 2345 | }, |
| @@ -2357,20 +2354,10 @@ | ||
| 2357 | 2354 | connect: 'connect_variable', |
| 2358 | 2355 | save: 'save_new_variable', |
| 2359 | 2356 | openManager: 'open_variables_manager', |
| 2360 | 2357 | saveChanges: 'save_variables_changes', |
| 2361 | - delete: 'delete_variable', | |
| 2362 | - variableSyncToV3: 'variable_sync_to_v3' | |
| 2358 | + delete: 'delete_variable' | |
| 2363 | 2359 | }, |
| 2364 | - design_system: { | |
| 2365 | - importOpened: 'design_system_import_opened', | |
| 2366 | - fileSelected: 'design_system_file_selected', | |
| 2367 | - validationFailed: 'design_system_validation_failed', | |
| 2368 | - conflictChoice: 'design_system_conflict_choice', | |
| 2369 | - confirmed: 'design_system_import_confirmed', | |
| 2370 | - imported: 'design_system_imported', | |
| 2371 | - importFailed: 'design_system_import_failed' | |
| 2372 | - }, | |
| 2373 | 2360 | components: { |
| 2374 | 2361 | createClicked: 'component_create_clicked', |
| 2375 | 2362 | createCancelled: 'component_creation_cancelled', |
| 2376 | 2363 | created: 'component_created', |
| @@ -2399,12 +2386,9 @@ | ||
| 2399 | 2386 | classUsageHovered: 'class_usage_hovered', |
| 2400 | 2387 | classStyled: 'class_styled', |
| 2401 | 2388 | classStateClicked: 'class_state_clicked', |
| 2402 | 2389 | classUsageClicked: 'class_usage_clicked', |
| 2403 | - classDuplicate: 'class_duplicate', | |
| 2404 | - classSyncToV3PopupShown: 'class_sync_to_v3_popup_shown', | |
| 2405 | - classSyncToV3: 'class_sync_to_v3', | |
| 2406 | - classSyncToV3PopupClick: 'class_sync_to_v3_popup_click' | |
| 2390 | + classDuplicate: 'class_duplicate' | |
| 2407 | 2391 | }, |
| 2408 | 2392 | editorOne: { |
| 2409 | 2393 | topBarPublishDropdown: 'top_bar_publish_dropdown', |
| 2410 | 2394 | topBarPageList: 'top_bar_page_list', |
| @@ -2440,9 +2424,8 @@ | ||
| 2440 | 2424 | "use strict"; |
| 2441 | 2425 | |
| 2442 | 2426 | |
| 2443 | 2427 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 2444 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 2445 | 2428 | Object.defineProperty(exports, "__esModule", ({ |
| 2446 | 2429 | value: true |
| 2447 | 2430 | })); |
| 2448 | 2431 | exports["default"] = void 0; |
| @@ -2454,17 +2437,14 @@ | ||
| 2454 | 2437 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 2455 | 2438 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 2456 | 2439 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 2457 | 2440 | var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ./events-config */ "../core/common/modules/events-manager/assets/js/events-config.js")); |
| 2458 | -var _mixpanelBrowser = _interopRequireWildcard(__webpack_require__(/*! mixpanel-browser */ "../node_modules/mixpanel-browser/dist/mixpanel.module.js")); | |
| 2441 | +var _mixpanelBrowser = _interopRequireDefault(__webpack_require__(/*! mixpanel-browser */ "../node_modules/mixpanel-browser/dist/mixpanel.module.js")); | |
| 2459 | 2442 | var _tiers = __webpack_require__(/*! elementor-utils/tiers */ "../assets/dev/js/utils/tiers.js"); |
| 2460 | -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); } | |
| 2461 | 2443 | 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; } |
| 2462 | 2444 | 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; } |
| 2463 | 2445 | 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)); } |
| 2464 | 2446 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } |
| 2465 | -/** @type {Mixpanel | null} */ | |
| 2466 | -var mixpanelInstance = null; | |
| 2467 | 2447 | var _default = exports["default"] = /*#__PURE__*/function (_elementorModules$Mod) { |
| 2468 | 2448 | function _default() { |
| 2469 | 2449 | var _this; |
| 2470 | 2450 | (0, _classCallCheck2.default)(this, _default); |
| @@ -2472,9 +2452,8 @@ | ||
| 2472 | 2452 | args[_key] = arguments[_key]; |
| 2473 | 2453 | } |
| 2474 | 2454 | _this = _callSuper(this, _default, [].concat(args)); |
| 2475 | 2455 | (0, _defineProperty2.default)(_this, "trackingEnabled", false); |
| 2476 | - (0, _defineProperty2.default)(_this, "availableExperiments", []); | |
| 2477 | 2456 | return _this; |
| 2478 | 2457 | } |
| 2479 | 2458 | (0, _inherits2.default)(_default, _elementorModules$Mod); |
| 2480 | 2459 | return (0, _createClass2.default)(_default, [{ |
| @@ -2491,57 +2470,45 @@ | ||
| 2491 | 2470 | } |
| 2492 | 2471 | }, { |
| 2493 | 2472 | key: "initializeMixpanel", |
| 2494 | 2473 | value: function initializeMixpanel(onLoaded) { |
| 2495 | - if (mixpanelInstance && mixpanelInstance.isInitialized) { | |
| 2496 | - onLoaded(mixpanelInstance); | |
| 2497 | - } else { | |
| 2498 | - var _elementorCommon$conf, _elementorCommon$conf2, _elementorCommon$conf3, _elementorCommon$conf4, _elementorCommon$conf5; | |
| 2499 | - mixpanelInstance = _mixpanelBrowser.default.init((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.token, { | |
| 2500 | - persistence: 'localStorage', | |
| 2501 | - 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, | |
| 2502 | - autocapture: false, | |
| 2503 | - flags: true, | |
| 2504 | - api_host: 'https://api-eu.mixpanel.com', | |
| 2505 | - loaded: onLoaded, | |
| 2506 | - 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, | |
| 2507 | - record_idle_timeout_ms: 60 * 1000, | |
| 2508 | - // 60 Seconds | |
| 2509 | - record_min_ms: 5 * 1000, | |
| 2510 | - // 5 Seconds | |
| 2511 | - record_mask_text_selector: '', | |
| 2512 | - remote_settings_mode: 'strict' | |
| 2513 | - }, 'elementor-editor'); | |
| 2514 | - } | |
| 2515 | - elementorCommon.config.editor_events.mixpanelInstance = mixpanelInstance; | |
| 2474 | + var _elementorCommon$conf; | |
| 2475 | + _mixpanelBrowser.default.init((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.token, { | |
| 2476 | + persistence: 'localStorage', | |
| 2477 | + autocapture: false, | |
| 2478 | + flags: true, | |
| 2479 | + api_hosts: { | |
| 2480 | + flags: 'https://api-eu.mixpanel.com' | |
| 2481 | + }, | |
| 2482 | + loaded: onLoaded | |
| 2483 | + }); | |
| 2516 | 2484 | } |
| 2517 | 2485 | }, { |
| 2518 | 2486 | key: "enableTracking", |
| 2519 | 2487 | value: function enableTracking() { |
| 2520 | - var _elementorCommon$conf6; | |
| 2488 | + var _elementorCommon$conf2; | |
| 2521 | 2489 | if (!this.isMixpanelReady()) { |
| 2522 | 2490 | return; |
| 2523 | 2491 | } |
| 2524 | - var userId = (_elementorCommon$conf6 = elementorCommon.config.editor_events) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.user_id; | |
| 2525 | - mixpanelInstance.register({ | |
| 2526 | - appType: 'Editor' | |
| 2527 | - }); | |
| 2492 | + var userId = (_elementorCommon$conf2 = elementorCommon.config.library_connect) === null || _elementorCommon$conf2 === void 0 ? void 0 : _elementorCommon$conf2.user_id; | |
| 2528 | 2493 | if (userId) { |
| 2529 | - var _elementorCommon$conf7; | |
| 2530 | - mixpanelInstance.identify(userId); | |
| 2531 | - mixpanelInstance.people.set_once({ | |
| 2494 | + var _elementorCommon$conf3; | |
| 2495 | + _mixpanelBrowser.default.identify(userId); | |
| 2496 | + _mixpanelBrowser.default.register({ | |
| 2497 | + appType: 'Editor' | |
| 2498 | + }); | |
| 2499 | + _mixpanelBrowser.default.people.set_once({ | |
| 2532 | 2500 | $user_id: userId, |
| 2533 | 2501 | $last_login: new Date().toISOString(), |
| 2534 | - $plan_type: ((_elementorCommon$conf7 = elementorCommon.config.library_connect) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.plan_type) || _tiers.TIERS.free | |
| 2502 | + $plan_type: ((_elementorCommon$conf3 = elementorCommon.config.library_connect) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.plan_type) || _tiers.TIERS.free | |
| 2535 | 2503 | }); |
| 2536 | 2504 | } |
| 2537 | 2505 | this.trackingEnabled = true; |
| 2538 | - this.availableExperiments = Object.keys(elementorCommon.config.experimentalFeatures || {}); | |
| 2539 | 2506 | } |
| 2540 | 2507 | }, { |
| 2541 | 2508 | key: "dispatchEvent", |
| 2542 | 2509 | value: function dispatchEvent(name, data) { |
| 2543 | - var _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10, _elementorCommon$conf11, _elementorCommon$conf12, _elementorCommon$conf13, _elementorCommon$conf14; | |
| 2510 | + var _elementorCommon$conf4, _elementorCommon$conf5, _elementorCommon$conf6, _elementorCommon$conf7, _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10; | |
| 2544 | 2511 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 2545 | 2512 | if (!this.canSendEvents()) { |
| 2546 | 2513 | return; |
| 2547 | 2514 | } |
| @@ -2548,31 +2515,30 @@ | ||
| 2548 | 2515 | if (!this.trackingEnabled) { |
| 2549 | 2516 | this.enableTracking(); |
| 2550 | 2517 | } |
| 2551 | 2518 | var eventData = _objectSpread({ |
| 2552 | - user_id: ((_elementorCommon$conf8 = elementorCommon.config.editor_events) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.user_id) || null, | |
| 2553 | - user_roles: ((_elementorCommon$conf9 = elementorCommon.config.library_connect) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.user_roles) || [], | |
| 2554 | - subscription_id: ((_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.subscription_id) || null, | |
| 2555 | - user_tier: ((_elementorCommon$conf1 = elementorCommon.config.library_connect) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.current_access_tier) || null, | |
| 2556 | - url: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.site_url, | |
| 2557 | - wp_version: (_elementorCommon$conf11 = elementorCommon.config.editor_events) === null || _elementorCommon$conf11 === void 0 ? void 0 : _elementorCommon$conf11.wp_version, | |
| 2558 | - client_id: (_elementorCommon$conf12 = elementorCommon.config.editor_events) === null || _elementorCommon$conf12 === void 0 ? void 0 : _elementorCommon$conf12.site_key, | |
| 2559 | - app_version: (_elementorCommon$conf13 = elementorCommon.config.editor_events) === null || _elementorCommon$conf13 === void 0 ? void 0 : _elementorCommon$conf13.elementor_version, | |
| 2560 | - site_language: (_elementorCommon$conf14 = elementorCommon.config.editor_events) === null || _elementorCommon$conf14 === void 0 ? void 0 : _elementorCommon$conf14.site_language, | |
| 2561 | - experiments: this.availableExperiments | |
| 2519 | + user_id: ((_elementorCommon$conf4 = elementorCommon.config.library_connect) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.user_id) || null, | |
| 2520 | + user_roles: ((_elementorCommon$conf5 = elementorCommon.config.library_connect) === null || _elementorCommon$conf5 === void 0 ? void 0 : _elementorCommon$conf5.user_roles) || [], | |
| 2521 | + subscription_id: ((_elementorCommon$conf6 = elementorCommon.config.editor_events) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.subscription_id) || null, | |
| 2522 | + user_tier: ((_elementorCommon$conf7 = elementorCommon.config.library_connect) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.current_access_tier) || null, | |
| 2523 | + url: (_elementorCommon$conf8 = elementorCommon.config.editor_events) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.site_url, | |
| 2524 | + wp_version: (_elementorCommon$conf9 = elementorCommon.config.editor_events) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.wp_version, | |
| 2525 | + client_id: (_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.site_key, | |
| 2526 | + app_version: (_elementorCommon$conf1 = elementorCommon.config.editor_events) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.elementor_version, | |
| 2527 | + site_language: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.site_language | |
| 2562 | 2528 | }, data); |
| 2563 | - mixpanelInstance.track(name, eventData, options); | |
| 2529 | + _mixpanelBrowser.default.track(name, eventData, options); | |
| 2564 | 2530 | } |
| 2565 | 2531 | }, { |
| 2566 | 2532 | key: "featureFlagIsActive", |
| 2567 | 2533 | value: function () { |
| 2568 | 2534 | var _featureFlagIsActive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(flagName) { |
| 2569 | - var _mixpanelInstance; | |
| 2535 | + var _mixpanel$flags; | |
| 2570 | 2536 | var isEnabled; |
| 2571 | 2537 | return _regenerator.default.wrap(function (_context) { |
| 2572 | 2538 | while (1) switch (_context.prev = _context.next) { |
| 2573 | 2539 | case 0: |
| 2574 | - if (!('function' !== typeof ((_mixpanelInstance = mixpanelInstance) === null || _mixpanelInstance === void 0 || (_mixpanelInstance = _mixpanelInstance.flags) === null || _mixpanelInstance === void 0 ? void 0 : _mixpanelInstance.is_enabled))) { | |
| 2540 | + 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))) { | |
| 2575 | 2541 | _context.next = 1; |
| 2576 | 2542 | break; |
| 2577 | 2543 | } |
| 2578 | 2544 | return _context.abrupt("return", false); |
| @@ -2577,9 +2543,9 @@ | ||
| 2577 | 2543 | } |
| 2578 | 2544 | return _context.abrupt("return", false); |
| 2579 | 2545 | case 1: |
| 2580 | 2546 | _context.next = 2; |
| 2581 | - return mixpanelInstance.flags.is_enabled(flagName, false); | |
| 2547 | + return _mixpanelBrowser.default.flags.is_enabled(flagName, false); | |
| 2582 | 2548 | case 2: |
| 2583 | 2549 | isEnabled = _context.sent; |
| 2584 | 2550 | return _context.abrupt("return", true === isEnabled); |
| 2585 | 2551 | case 3: |
| @@ -2597,10 +2563,10 @@ | ||
| 2597 | 2563 | key: "getExperimentVariant", |
| 2598 | 2564 | value: function () { |
| 2599 | 2565 | var _getExperimentVariant = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(experimentName) { |
| 2600 | 2566 | var defaultValue, |
| 2601 | - _elementorCommon$conf15, | |
| 2602 | - _elementorCommon$conf16, | |
| 2567 | + _elementorCommon$conf11, | |
| 2568 | + _elementorCommon$conf12, | |
| 2603 | 2569 | isAbTestingEnabled, |
| 2604 | 2570 | variant, |
| 2605 | 2571 | _args2 = arguments, |
| 2606 | 2572 | _t; |
| @@ -2614,9 +2580,9 @@ | ||
| 2614 | 2580 | break; |
| 2615 | 2581 | } |
| 2616 | 2582 | return _context2.abrupt("return", defaultValue); |
| 2617 | 2583 | case 2: |
| 2618 | - 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; | |
| 2584 | + isAbTestingEnabled = (_elementorCommon$conf11 = (_elementorCommon$conf12 = elementorCommon.config.editor_events) === null || _elementorCommon$conf12 === void 0 ? void 0 : _elementorCommon$conf12.flags_enabled) !== null && _elementorCommon$conf11 !== void 0 ? _elementorCommon$conf11 : false; | |
| 2619 | 2585 | if (isAbTestingEnabled) { |
| 2620 | 2586 | _context2.next = 3; |
| 2621 | 2587 | break; |
| 2622 | 2588 | } |
| @@ -2621,9 +2587,9 @@ | ||
| 2621 | 2587 | break; |
| 2622 | 2588 | } |
| 2623 | 2589 | return _context2.abrupt("return", defaultValue); |
| 2624 | 2590 | case 3: |
| 2625 | - if (mixpanelInstance) { | |
| 2591 | + if (_mixpanelBrowser.default) { | |
| 2626 | 2592 | _context2.next = 4; |
| 2627 | 2593 | break; |
| 2628 | 2594 | } |
| 2629 | 2595 | return _context2.abrupt("return", defaultValue); |
| @@ -2630,15 +2596,15 @@ | ||
| 2630 | 2596 | case 4: |
| 2631 | 2597 | if (!this.trackingEnabled) { |
| 2632 | 2598 | this.enableTracking(); |
| 2633 | 2599 | } |
| 2634 | - if (mixpanelInstance.flags) { | |
| 2600 | + if (_mixpanelBrowser.default.flags) { | |
| 2635 | 2601 | _context2.next = 5; |
| 2636 | 2602 | break; |
| 2637 | 2603 | } |
| 2638 | 2604 | return _context2.abrupt("return", defaultValue); |
| 2639 | 2605 | case 5: |
| 2640 | - if (!('function' !== typeof mixpanelInstance.flags.get_variant_value)) { | |
| 2606 | + if (!('function' !== typeof _mixpanelBrowser.default.flags.get_variant_value)) { | |
| 2641 | 2607 | _context2.next = 6; |
| 2642 | 2608 | break; |
| 2643 | 2609 | } |
| 2644 | 2610 | return _context2.abrupt("return", defaultValue); |
| @@ -2643,9 +2609,9 @@ | ||
| 2643 | 2609 | } |
| 2644 | 2610 | return _context2.abrupt("return", defaultValue); |
| 2645 | 2611 | case 6: |
| 2646 | 2612 | _context2.next = 7; |
| 2647 | - return mixpanelInstance.flags.get_variant_value(experimentName, defaultValue); | |
| 2613 | + return _mixpanelBrowser.default.flags.get_variant_value(experimentName, defaultValue); | |
| 2648 | 2614 | case 7: |
| 2649 | 2615 | variant = _context2.sent; |
| 2650 | 2616 | if (!(undefined === variant || null === variant)) { |
| 2651 | 2617 | _context2.next = 8; |
| @@ -2674,9 +2640,9 @@ | ||
| 2674 | 2640 | value: function startExperiment(experimentName, experimentVariant) { |
| 2675 | 2641 | if (!this.trackingEnabled) { |
| 2676 | 2642 | return; |
| 2677 | 2643 | } |
| 2678 | - mixpanelInstance.track('$experiment_started', { | |
| 2644 | + _mixpanelBrowser.default.track('$experiment_started', { | |
| 2679 | 2645 | 'Experiment name': experimentName, |
| 2680 | 2646 | 'Variant name': experimentVariant |
| 2681 | 2647 | }); |
| 2682 | 2648 | } |
| @@ -2682,13 +2648,13 @@ | ||
| 2682 | 2648 | } |
| 2683 | 2649 | }, { |
| 2684 | 2650 | key: "isMixpanelReady", |
| 2685 | 2651 | value: function isMixpanelReady() { |
| 2686 | - if ('undefined' === typeof mixpanelInstance || !mixpanelInstance) { | |
| 2652 | + if ('undefined' === typeof _mixpanelBrowser.default || !_mixpanelBrowser.default) { | |
| 2687 | 2653 | return false; |
| 2688 | 2654 | } |
| 2689 | 2655 | try { |
| 2690 | - var distinctId = mixpanelInstance.get_distinct_id(); | |
| 2656 | + var distinctId = _mixpanelBrowser.default.get_distinct_id(); | |
| 2691 | 2657 | return distinctId !== undefined && distinctId !== null; |
| 2692 | 2658 | } catch (error) { |
| 2693 | 2659 | return false; |
| 2694 | 2660 | } |
| @@ -2701,9 +2667,9 @@ | ||
| 2701 | 2667 | } |
| 2702 | 2668 | }, { |
| 2703 | 2669 | key: "getMixpanelInstance", |
| 2704 | 2670 | value: function getMixpanelInstance() { |
| 2705 | - return this.isMixpanelReady() ? mixpanelInstance : undefined; | |
| 2671 | + return this.isMixpanelReady() ? _mixpanelBrowser.default : undefined; | |
| 2706 | 2672 | } |
| 2707 | 2673 | }]); |
| 2708 | 2674 | }(elementorModules.Module); |
| 2709 | 2675 | |