PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.3
Elementor Website Builder – more than just a page builder v4.0.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 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/common.js +45 -156 4.1.0-beta3 → 4.0.3 View file →
@@ -2340,9 +2340,8 @@
2340 2340 accountConnected: 'account_connected'
2341 2341 },
2342 2342 // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade
2343 2343 elementorEditor: {
2344 - editorLoaded: 'editor_loaded',
2345 2344 checklist: {
2346 2345 checklistHeaderClose: 'checklist_header_close_icon',
2347 2346 checklistFirstPopup: 'checklist popup triggered'
2348 2347 },
@@ -2360,17 +2359,8 @@
2360 2359 saveChanges: 'save_variables_changes',
2361 2360 delete: 'delete_variable',
2362 2361 variableSyncToV3: 'variable_sync_to_v3'
2363 2362 },
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 2363 components: {
2374 2364 createClicked: 'component_create_clicked',
2375 2365 createCancelled: 'component_creation_cancelled',
2376 2366 created: 'component_created',
@@ -2440,9 +2430,8 @@
2440 2430 "use strict";
2441 2431
2442 2432
2443 2433 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 2434 Object.defineProperty(exports, "__esModule", ({
2446 2435 value: true
2447 2436 }));
2448 2437 exports["default"] = void 0;
@@ -2454,18 +2443,14 @@
2454 2443 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2455 2444 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2456 2445 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2457 2446 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"));
2447 +var _mixpanelBrowser = _interopRequireDefault(__webpack_require__(/*! mixpanel-browser */ "../node_modules/mixpanel-browser/dist/mixpanel.module.js"));
2459 2448 var _tiers = __webpack_require__(/*! elementor-utils/tiers */ "../assets/dev/js/utils/tiers.js");
2460 -var _sessionRecording = __webpack_require__(/*! ./session-recording */ "../core/common/modules/events-manager/assets/js/session-recording.js");
2461 -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); }
2462 2449 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; }
2463 2450 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; }
2464 2451 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)); }
2465 2452 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2466 -/** @type {Mixpanel | null} */
2467 -var mixpanelInstance = null;
2468 2453 var _default = exports["default"] = /*#__PURE__*/function (_elementorModules$Mod) {
2469 2454 function _default() {
2470 2455 var _this;
2471 2456 (0, _classCallCheck2.default)(this, _default);
@@ -2480,15 +2465,13 @@
2480 2465 (0, _inherits2.default)(_default, _elementorModules$Mod);
2481 2466 return (0, _createClass2.default)(_default, [{
2482 2467 key: "onInit",
2483 2468 value: function onInit() {
2484 - var _elementorCommon$conf,
2485 - _this2 = this;
2469 + var _this2 = this;
2486 2470 this.config = _eventsConfig.default;
2487 2471 if (!this.canSendEvents()) {
2488 2472 return;
2489 2473 }
2490 - (0, _sessionRecording.configureSessionRecording)((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.session_recording_events);
2491 2474 this.initializeMixpanel(function () {
2492 2475 return _this2.enableTracking();
2493 2476 });
2494 2477 }
@@ -2494,48 +2477,37 @@
2494 2477 }
2495 2478 }, {
2496 2479 key: "initializeMixpanel",
2497 2480 value: function initializeMixpanel(onLoaded) {
2498 - if (mixpanelInstance && mixpanelInstance.isInitialized) {
2499 - onLoaded(mixpanelInstance);
2500 - } else {
2501 - var _elementorCommon$conf2;
2502 - mixpanelInstance = _mixpanelBrowser.default.init((_elementorCommon$conf2 = elementorCommon.config.editor_events) === null || _elementorCommon$conf2 === void 0 ? void 0 : _elementorCommon$conf2.token, {
2503 - persistence: 'localStorage',
2504 - autocapture: false,
2505 - flags: true,
2506 - api_host: 'https://api-eu.mixpanel.com',
2507 - loaded: onLoaded,
2508 - record_sessions_percent: 0,
2509 - record_idle_timeout_ms: 60 * 1000,
2510 - // 60 Seconds
2511 - record_min_ms: 5 * 1000,
2512 - // 5 Seconds
2513 - record_max_ms: 30 * 1000,
2514 - // 30 Seconds
2515 - record_mask_text_selector: ''
2516 - }, 'elementor-editor');
2517 - }
2518 - elementorCommon.config.editor_events.mixpanelInstance = mixpanelInstance;
2481 + var _elementorCommon$conf;
2482 + _mixpanelBrowser.default.init((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.token, {
2483 + persistence: 'localStorage',
2484 + autocapture: false,
2485 + flags: true,
2486 + api_hosts: {
2487 + flags: 'https://api-eu.mixpanel.com'
2488 + },
2489 + loaded: onLoaded
2490 + });
2519 2491 }
2520 2492 }, {
2521 2493 key: "enableTracking",
2522 2494 value: function enableTracking() {
2523 - var _elementorCommon$conf3;
2495 + var _elementorCommon$conf2;
2524 2496 if (!this.isMixpanelReady()) {
2525 2497 return;
2526 2498 }
2527 - var userId = (_elementorCommon$conf3 = elementorCommon.config.editor_events) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.user_id;
2528 - mixpanelInstance.register({
2529 - appType: 'Editor'
2530 - });
2499 + var userId = (_elementorCommon$conf2 = elementorCommon.config.editor_events) === null || _elementorCommon$conf2 === void 0 ? void 0 : _elementorCommon$conf2.user_id;
2531 2500 if (userId) {
2532 - var _elementorCommon$conf4;
2533 - mixpanelInstance.identify(userId);
2534 - mixpanelInstance.people.set_once({
2501 + var _elementorCommon$conf3;
2502 + _mixpanelBrowser.default.identify(userId);
2503 + _mixpanelBrowser.default.register({
2504 + appType: 'Editor'
2505 + });
2506 + _mixpanelBrowser.default.people.set_once({
2535 2507 $user_id: userId,
2536 2508 $last_login: new Date().toISOString(),
2537 - $plan_type: ((_elementorCommon$conf4 = elementorCommon.config.library_connect) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.plan_type) || _tiers.TIERS.free
2509 + $plan_type: ((_elementorCommon$conf3 = elementorCommon.config.library_connect) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.plan_type) || _tiers.TIERS.free
2538 2510 });
2539 2511 }
2540 2512 this.trackingEnabled = true;
2541 2513 this.availableExperiments = Object.keys(elementorCommon.config.experimentalFeatures || {});
@@ -2542,9 +2514,9 @@
2542 2514 }
2543 2515 }, {
2544 2516 key: "dispatchEvent",
2545 2517 value: function dispatchEvent(name, data) {
2546 - var _elementorCommon$conf5, _elementorCommon$conf6, _elementorCommon$conf7, _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10, _elementorCommon$conf11;
2518 + var _elementorCommon$conf4, _elementorCommon$conf5, _elementorCommon$conf6, _elementorCommon$conf7, _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10;
2547 2519 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2548 2520 if (!this.canSendEvents()) {
2549 2521 return;
2550 2522 }
@@ -2551,35 +2523,31 @@
2551 2523 if (!this.trackingEnabled) {
2552 2524 this.enableTracking();
2553 2525 }
2554 2526 var eventData = _objectSpread({
2555 - user_id: ((_elementorCommon$conf5 = elementorCommon.config.editor_events) === null || _elementorCommon$conf5 === void 0 ? void 0 : _elementorCommon$conf5.user_id) || null,
2556 - user_roles: ((_elementorCommon$conf6 = elementorCommon.config.library_connect) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.user_roles) || [],
2557 - subscription_id: ((_elementorCommon$conf7 = elementorCommon.config.editor_events) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.subscription_id) || null,
2558 - user_tier: ((_elementorCommon$conf8 = elementorCommon.config.library_connect) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.current_access_tier) || null,
2559 - url: (_elementorCommon$conf9 = elementorCommon.config.editor_events) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.site_url,
2560 - wp_version: (_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.wp_version,
2561 - client_id: (_elementorCommon$conf1 = elementorCommon.config.editor_events) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.site_key,
2562 - app_version: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.elementor_version,
2563 - site_language: (_elementorCommon$conf11 = elementorCommon.config.editor_events) === null || _elementorCommon$conf11 === void 0 ? void 0 : _elementorCommon$conf11.site_language,
2527 + user_id: ((_elementorCommon$conf4 = elementorCommon.config.editor_events) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.user_id) || null,
2528 + user_roles: ((_elementorCommon$conf5 = elementorCommon.config.library_connect) === null || _elementorCommon$conf5 === void 0 ? void 0 : _elementorCommon$conf5.user_roles) || [],
2529 + subscription_id: ((_elementorCommon$conf6 = elementorCommon.config.editor_events) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.subscription_id) || null,
2530 + user_tier: ((_elementorCommon$conf7 = elementorCommon.config.library_connect) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.current_access_tier) || null,
2531 + url: (_elementorCommon$conf8 = elementorCommon.config.editor_events) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.site_url,
2532 + wp_version: (_elementorCommon$conf9 = elementorCommon.config.editor_events) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.wp_version,
2533 + client_id: (_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.site_key,
2534 + app_version: (_elementorCommon$conf1 = elementorCommon.config.editor_events) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.elementor_version,
2535 + site_language: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.site_language,
2564 2536 experiments: this.availableExperiments
2565 2537 }, data);
2566 - mixpanelInstance.track(name, eventData, options);
2567 - var recordingDecision = (0, _sessionRecording.handleSessionRecording)(name, mixpanelInstance);
2568 - if (recordingDecision) {
2569 - mixpanelInstance.track(recordingDecision, eventData);
2570 - }
2538 + _mixpanelBrowser.default.track(name, eventData, options);
2571 2539 }
2572 2540 }, {
2573 2541 key: "featureFlagIsActive",
2574 2542 value: function () {
2575 2543 var _featureFlagIsActive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(flagName) {
2576 - var _mixpanelInstance;
2544 + var _mixpanel$flags;
2577 2545 var isEnabled;
2578 2546 return _regenerator.default.wrap(function (_context) {
2579 2547 while (1) switch (_context.prev = _context.next) {
2580 2548 case 0:
2581 - if (!('function' !== typeof ((_mixpanelInstance = mixpanelInstance) === null || _mixpanelInstance === void 0 || (_mixpanelInstance = _mixpanelInstance.flags) === null || _mixpanelInstance === void 0 ? void 0 : _mixpanelInstance.is_enabled))) {
2549 + 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))) {
2582 2550 _context.next = 1;
2583 2551 break;
2584 2552 }
2585 2553 return _context.abrupt("return", false);
@@ -2584,9 +2552,9 @@
2584 2552 }
2585 2553 return _context.abrupt("return", false);
2586 2554 case 1:
2587 2555 _context.next = 2;
2588 - return mixpanelInstance.flags.is_enabled(flagName, false);
2556 + return _mixpanelBrowser.default.flags.is_enabled(flagName, false);
2589 2557 case 2:
2590 2558 isEnabled = _context.sent;
2591 2559 return _context.abrupt("return", true === isEnabled);
2592 2560 case 3:
@@ -2604,10 +2572,10 @@
2604 2572 key: "getExperimentVariant",
2605 2573 value: function () {
2606 2574 var _getExperimentVariant = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(experimentName) {
2607 2575 var defaultValue,
2576 + _elementorCommon$conf11,
2608 2577 _elementorCommon$conf12,
2609 - _elementorCommon$conf13,
2610 2578 isAbTestingEnabled,
2611 2579 variant,
2612 2580 _args2 = arguments,
2613 2581 _t;
@@ -2621,9 +2589,9 @@
2621 2589 break;
2622 2590 }
2623 2591 return _context2.abrupt("return", defaultValue);
2624 2592 case 2:
2625 - isAbTestingEnabled = (_elementorCommon$conf12 = (_elementorCommon$conf13 = elementorCommon.config.editor_events) === null || _elementorCommon$conf13 === void 0 ? void 0 : _elementorCommon$conf13.flags_enabled) !== null && _elementorCommon$conf12 !== void 0 ? _elementorCommon$conf12 : false;
2593 + 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;
2626 2594 if (isAbTestingEnabled) {
2627 2595 _context2.next = 3;
2628 2596 break;
2629 2597 }
@@ -2628,9 +2596,9 @@
2628 2596 break;
2629 2597 }
2630 2598 return _context2.abrupt("return", defaultValue);
2631 2599 case 3:
2632 - if (mixpanelInstance) {
2600 + if (_mixpanelBrowser.default) {
2633 2601 _context2.next = 4;
2634 2602 break;
2635 2603 }
2636 2604 return _context2.abrupt("return", defaultValue);
@@ -2637,15 +2605,15 @@
2637 2605 case 4:
2638 2606 if (!this.trackingEnabled) {
2639 2607 this.enableTracking();
2640 2608 }
2641 - if (mixpanelInstance.flags) {
2609 + if (_mixpanelBrowser.default.flags) {
2642 2610 _context2.next = 5;
2643 2611 break;
2644 2612 }
2645 2613 return _context2.abrupt("return", defaultValue);
2646 2614 case 5:
2647 - if (!('function' !== typeof mixpanelInstance.flags.get_variant_value)) {
2615 + if (!('function' !== typeof _mixpanelBrowser.default.flags.get_variant_value)) {
2648 2616 _context2.next = 6;
2649 2617 break;
2650 2618 }
2651 2619 return _context2.abrupt("return", defaultValue);
@@ -2650,9 +2618,9 @@
2650 2618 }
2651 2619 return _context2.abrupt("return", defaultValue);
2652 2620 case 6:
2653 2621 _context2.next = 7;
2654 - return mixpanelInstance.flags.get_variant_value(experimentName, defaultValue);
2622 + return _mixpanelBrowser.default.flags.get_variant_value(experimentName, defaultValue);
2655 2623 case 7:
2656 2624 variant = _context2.sent;
2657 2625 if (!(undefined === variant || null === variant)) {
2658 2626 _context2.next = 8;
@@ -2681,9 +2649,9 @@
2681 2649 value: function startExperiment(experimentName, experimentVariant) {
2682 2650 if (!this.trackingEnabled) {
2683 2651 return;
2684 2652 }
2685 - mixpanelInstance.track('$experiment_started', {
2653 + _mixpanelBrowser.default.track('$experiment_started', {
2686 2654 'Experiment name': experimentName,
2687 2655 'Variant name': experimentVariant
2688 2656 });
2689 2657 }
@@ -2689,13 +2657,13 @@
2689 2657 }
2690 2658 }, {
2691 2659 key: "isMixpanelReady",
2692 2660 value: function isMixpanelReady() {
2693 - if ('undefined' === typeof mixpanelInstance || !mixpanelInstance) {
2661 + if ('undefined' === typeof _mixpanelBrowser.default || !_mixpanelBrowser.default) {
2694 2662 return false;
2695 2663 }
2696 2664 try {
2697 - var distinctId = mixpanelInstance.get_distinct_id();
2665 + var distinctId = _mixpanelBrowser.default.get_distinct_id();
2698 2666 return distinctId !== undefined && distinctId !== null;
2699 2667 } catch (error) {
2700 2668 return false;
2701 2669 }
@@ -2708,91 +2676,12 @@
2708 2676 }
2709 2677 }, {
2710 2678 key: "getMixpanelInstance",
2711 2679 value: function getMixpanelInstance() {
2712 - return this.isMixpanelReady() ? mixpanelInstance : undefined;
2680 + return this.isMixpanelReady() ? _mixpanelBrowser.default : undefined;
2713 2681 }
2714 2682 }]);
2715 2683 }(elementorModules.Module);
2716 -
2717 -/***/ }),
2718 -
2719 -/***/ "../core/common/modules/events-manager/assets/js/session-recording.js":
2720 -/*!****************************************************************************!*\
2721 - !*** ../core/common/modules/events-manager/assets/js/session-recording.js ***!
2722 - \****************************************************************************/
2723 -/***/ ((__unused_webpack_module, exports) => {
2724 -
2725 -"use strict";
2726 -
2727 -
2728 -Object.defineProperty(exports, "__esModule", ({
2729 - value: true
2730 -}));
2731 -exports.configureSessionRecording = configureSessionRecording;
2732 -exports.getIsRecording = getIsRecording;
2733 -exports.handleSessionRecording = handleSessionRecording;
2734 -var RECORD_SESSION_PERCENT = 1;
2735 -var sessionRecordingPairs = [];
2736 -var activeEndEvent = null;
2737 -var isRecording = false;
2738 -function shouldRecordSession(distinctId, percent) {
2739 - var fraction = Math.min(Math.max(percent / 100, 0), 1);
2740 - var hash = 0;
2741 - for (var i = 0; i < distinctId.length; i++) {
2742 - // eslint-disable-next-line no-bitwise
2743 - hash = hash * 31 + distinctId.charCodeAt(i) >>> 0;
2744 - }
2745 - return hash / 4294967295 < fraction;
2746 -}
2747 -
2748 -/**
2749 - * @param {Array<{start: string, end?: string|null}>} pairs
2750 - */
2751 -function configureSessionRecording(pairs) {
2752 - if (!Array.isArray(pairs)) {
2753 - return;
2754 - }
2755 - sessionRecordingPairs = pairs.filter(function (pair) {
2756 - return 'string' === typeof (pair === null || pair === void 0 ? void 0 : pair.start) && pair.start;
2757 - });
2758 -}
2759 -
2760 -/**
2761 - * Evaluates whether to start/stop recording based on the event name.
2762 - *
2763 - * @param {string} name
2764 - * @param {import('mixpanel-browser').Mixpanel} mixpanelInstance
2765 - * @return {'recording_started'|'recording_skipped'|'recording_stopped'|null} The recording decision, or null if no action taken.
2766 - */
2767 -function handleSessionRecording(name, mixpanelInstance) {
2768 - var matchedPair = sessionRecordingPairs.find(function (pair) {
2769 - return pair.start === name;
2770 - });
2771 - if (matchedPair) {
2772 - var distinctId = mixpanelInstance.get_distinct_id();
2773 - if (shouldRecordSession(distinctId, RECORD_SESSION_PERCENT)) {
2774 - var _matchedPair$end;
2775 - mixpanelInstance.start_session_recording();
2776 - isRecording = true;
2777 - activeEndEvent = (_matchedPair$end = matchedPair.end) !== null && _matchedPair$end !== void 0 ? _matchedPair$end : null;
2778 - return 'recording_started';
2779 - }
2780 - isRecording = false;
2781 - activeEndEvent = null;
2782 - return 'recording_skipped';
2783 - }
2784 - if (activeEndEvent && name === activeEndEvent) {
2785 - mixpanelInstance.stop_session_recording();
2786 - isRecording = false;
2787 - activeEndEvent = null;
2788 - return 'recording_stopped';
2789 - }
2790 - return null;
2791 -}
2792 -function getIsRecording() {
2793 - return isRecording;
2794 -}
2795 2684
2796 2685 /***/ }),
2797 2686
2798 2687 /***/ "../core/common/modules/finder/assets/js/commands/index.js":