| @@ -1,3718 +1,1795 @@ | ||
| 1 | -(function(_wordpress_i18n) { | |
| 1 | +/*! elementor - v3.8.0 - 08-11-2022 */ | |
| 2 | +/******/ (() => { // webpackBootstrap | |
| 3 | +/******/ var __webpack_modules__ = ({ | |
| 2 | 4 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __create = Object.create; | |
| 5 | - var __defProp = Object.defineProperty; | |
| 6 | - var __name = (target, value) => __defProp(target, "name", { | |
| 7 | - value, | |
| 8 | - configurable: true | |
| 9 | - }); | |
| 10 | - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | - var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | - var __getProtoOf = Object.getPrototypeOf; | |
| 13 | - var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 15 | - var __copyProps = (to, from, except, desc) => { | |
| 16 | - if (from && typeof from === "object" || typeof from === "function") { | |
| 17 | - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 18 | - key = keys[i]; | |
| 19 | - if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 20 | - __defProp(to, key, { | |
| 21 | - get: ((k) => from[k]).bind(null, key), | |
| 22 | - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 23 | - }); | |
| 24 | - } | |
| 25 | - } | |
| 26 | - } | |
| 27 | - return to; | |
| 28 | - }; | |
| 29 | - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 30 | - value: mod, | |
| 31 | - enumerable: true | |
| 32 | - }) : target, mod)); | |
| 5 | +/***/ "../assets/dev/js/admin/maintenance-mode.js": | |
| 6 | +/*!**************************************************!*\ | |
| 7 | + !*** ../assets/dev/js/admin/maintenance-mode.js ***! | |
| 8 | + \**************************************************/ | |
| 9 | +/***/ ((module) => { | |
| 33 | 10 | |
| 34 | -//#endregion | |
| 11 | +"use strict"; | |
| 35 | 12 | |
| 36 | -//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js | |
| 37 | - function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 38 | - try { | |
| 39 | - var i = n[a](c); | |
| 40 | - var u = i.value; | |
| 41 | - } catch (n) { | |
| 42 | - e(n); | |
| 43 | - return; | |
| 44 | - } | |
| 45 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 46 | - } | |
| 47 | - function _asyncToGenerator(n) { | |
| 48 | - return function() { | |
| 49 | - var t = this; | |
| 50 | - var e = arguments; | |
| 51 | - return new Promise(function(r, o) { | |
| 52 | - var a = n.apply(t, e); | |
| 53 | - function _next(n) { | |
| 54 | - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 55 | - } | |
| 56 | - function _throw(n) { | |
| 57 | - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 58 | - } | |
| 59 | - _next(void 0); | |
| 60 | - }); | |
| 61 | - }; | |
| 62 | - } | |
| 63 | 13 | |
| 64 | -//#endregion | |
| 65 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 66 | - function _arrayWithHoles(r) { | |
| 67 | - if (Array.isArray(r)) return r; | |
| 68 | - } | |
| 14 | +module.exports = elementorModules.ViewModule.extend({ | |
| 15 | + getDefaultSettings: function getDefaultSettings() { | |
| 16 | + return { | |
| 17 | + selectors: { | |
| 18 | + modeSelect: '.elementor_maintenance_mode_mode select', | |
| 19 | + maintenanceModeTable: '#tab-maintenance_mode table', | |
| 20 | + maintenanceModeDescriptions: '.elementor-maintenance-mode-description', | |
| 21 | + excludeModeSelect: '.elementor_maintenance_mode_exclude_mode select', | |
| 22 | + excludeRolesArea: '.elementor_maintenance_mode_exclude_roles', | |
| 23 | + templateSelect: '.elementor_maintenance_mode_template_id select', | |
| 24 | + editTemplateButton: '.elementor-edit-template', | |
| 25 | + maintenanceModeError: '.elementor-maintenance-mode-error' | |
| 26 | + }, | |
| 27 | + classes: { | |
| 28 | + isEnabled: 'elementor-maintenance-mode-is-enabled' | |
| 29 | + } | |
| 30 | + }; | |
| 31 | + }, | |
| 32 | + getDefaultElements: function getDefaultElements() { | |
| 33 | + var elements = {}, | |
| 34 | + selectors = this.getSettings('selectors'); | |
| 35 | + elements.$modeSelect = jQuery(selectors.modeSelect); | |
| 36 | + elements.$maintenanceModeTable = elements.$modeSelect.parents(selectors.maintenanceModeTable); | |
| 37 | + elements.$excludeModeSelect = elements.$maintenanceModeTable.find(selectors.excludeModeSelect); | |
| 38 | + elements.$excludeRolesArea = elements.$maintenanceModeTable.find(selectors.excludeRolesArea); | |
| 39 | + elements.$templateSelect = elements.$maintenanceModeTable.find(selectors.templateSelect); | |
| 40 | + elements.$editTemplateButton = elements.$maintenanceModeTable.find(selectors.editTemplateButton); | |
| 41 | + elements.$maintenanceModeDescriptions = elements.$maintenanceModeTable.find(selectors.maintenanceModeDescriptions); | |
| 42 | + elements.$maintenanceModeError = elements.$maintenanceModeTable.find(selectors.maintenanceModeError); | |
| 43 | + return elements; | |
| 44 | + }, | |
| 45 | + handleModeSelectChange: function handleModeSelectChange() { | |
| 46 | + var settings = this.getSettings(), | |
| 47 | + elements = this.elements; | |
| 48 | + elements.$maintenanceModeTable.toggleClass(settings.classes.isEnabled, !!elements.$modeSelect.val()); | |
| 49 | + elements.$maintenanceModeDescriptions.hide(); | |
| 50 | + elements.$maintenanceModeDescriptions.filter('[data-value="' + elements.$modeSelect.val() + '"]').show(); | |
| 51 | + }, | |
| 52 | + handleExcludeModeSelectChange: function handleExcludeModeSelectChange() { | |
| 53 | + var elements = this.elements; | |
| 54 | + elements.$excludeRolesArea.toggle('custom' === elements.$excludeModeSelect.val()); | |
| 55 | + }, | |
| 56 | + handleTemplateSelectChange: function handleTemplateSelectChange() { | |
| 57 | + var elements = this.elements; | |
| 58 | + var templateID = elements.$templateSelect.val(); | |
| 59 | + if (!templateID) { | |
| 60 | + elements.$editTemplateButton.hide(); | |
| 61 | + elements.$maintenanceModeError.show(); | |
| 62 | + return; | |
| 63 | + } | |
| 64 | + var editUrl = elementorAdmin.config.home_url + '?p=' + templateID + '&elementor'; | |
| 65 | + elements.$editTemplateButton.prop('href', editUrl).show(); | |
| 66 | + elements.$maintenanceModeError.hide(); | |
| 67 | + }, | |
| 68 | + bindEvents: function bindEvents() { | |
| 69 | + var elements = this.elements; | |
| 70 | + elements.$modeSelect.on('change', this.handleModeSelectChange.bind(this)); | |
| 71 | + elements.$excludeModeSelect.on('change', this.handleExcludeModeSelectChange.bind(this)); | |
| 72 | + elements.$templateSelect.on('change', this.handleTemplateSelectChange.bind(this)); | |
| 73 | + }, | |
| 74 | + onAdminInit: function onAdminInit() { | |
| 75 | + this.handleModeSelectChange(); | |
| 76 | + this.handleExcludeModeSelectChange(); | |
| 77 | + this.handleTemplateSelectChange(); | |
| 78 | + }, | |
| 79 | + onInit: function onInit() { | |
| 80 | + elementorModules.ViewModule.prototype.onInit.apply(this, arguments); | |
| 81 | + elementorCommon.elements.$window.on('elementor/admin/init', this.onAdminInit); | |
| 82 | + } | |
| 83 | +}); | |
| 69 | 84 | |
| 70 | -//#endregion | |
| 71 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 72 | - function _iterableToArrayLimit(r, l) { | |
| 73 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 74 | - if (null != t) { | |
| 75 | - var e; | |
| 76 | - var n; | |
| 77 | - var i; | |
| 78 | - var u; | |
| 79 | - var a = []; | |
| 80 | - var f = !0; | |
| 81 | - var o = !1; | |
| 82 | - try { | |
| 83 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 84 | - if (Object(t) !== t) return; | |
| 85 | - f = !1; | |
| 86 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 87 | - } catch (r) { | |
| 88 | - o = !0, n = r; | |
| 89 | - } finally { | |
| 90 | - try { | |
| 91 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 92 | - } finally { | |
| 93 | - if (o) throw n; | |
| 94 | - } | |
| 95 | - } | |
| 96 | - return a; | |
| 97 | - } | |
| 98 | - } | |
| 85 | +/***/ }), | |
| 99 | 86 | |
| 100 | -//#endregion | |
| 101 | -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 102 | - function _arrayLikeToArray$2(r, a) { | |
| 103 | - (null == a || a > r.length) && (a = r.length); | |
| 104 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 105 | - return n; | |
| 106 | - } | |
| 107 | - __name(_arrayLikeToArray$2, "_arrayLikeToArray"); | |
| 87 | +/***/ "../assets/dev/js/admin/menu-handler.js": | |
| 88 | +/*!**********************************************!*\ | |
| 89 | + !*** ../assets/dev/js/admin/menu-handler.js ***! | |
| 90 | + \**********************************************/ | |
| 91 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 108 | 92 | |
| 109 | -//#endregion | |
| 110 | -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 111 | - function _unsupportedIterableToArray$2(r, a) { | |
| 112 | - if (r) { | |
| 113 | - if ("string" == typeof r) return _arrayLikeToArray$2(r, a); | |
| 114 | - var t = {}.toString.call(r).slice(8, -1); | |
| 115 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; | |
| 116 | - } | |
| 117 | - } | |
| 118 | - __name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray"); | |
| 93 | +"use strict"; | |
| 119 | 94 | |
| 120 | -//#endregion | |
| 121 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 122 | - function _nonIterableRest() { | |
| 123 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 124 | - } | |
| 125 | 95 | |
| 126 | -//#endregion | |
| 127 | -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 128 | - function _slicedToArray(r, e) { | |
| 129 | - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest(); | |
| 130 | - } | |
| 96 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 97 | +Object.defineProperty(exports, "__esModule", ({ | |
| 98 | + value: true | |
| 99 | +})); | |
| 100 | +exports["default"] = void 0; | |
| 101 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 102 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 103 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 104 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 105 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 106 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 107 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 108 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 109 | +var MenuHandler = /*#__PURE__*/function (_elementorModules$Vie) { | |
| 110 | + (0, _inherits2.default)(MenuHandler, _elementorModules$Vie); | |
| 111 | + var _super = _createSuper(MenuHandler); | |
| 112 | + function MenuHandler() { | |
| 113 | + (0, _classCallCheck2.default)(this, MenuHandler); | |
| 114 | + return _super.apply(this, arguments); | |
| 115 | + } | |
| 116 | + (0, _createClass2.default)(MenuHandler, [{ | |
| 117 | + key: "getDefaultSettings", | |
| 118 | + value: function getDefaultSettings() { | |
| 119 | + return { | |
| 120 | + selectors: { | |
| 121 | + currentSubmenuItems: '#adminmenu .current' | |
| 122 | + } | |
| 123 | + }; | |
| 124 | + } | |
| 125 | + }, { | |
| 126 | + key: "getDefaultElements", | |
| 127 | + value: function getDefaultElements() { | |
| 128 | + var settings = this.getSettings(); | |
| 129 | + return { | |
| 130 | + $currentSubmenuItems: jQuery(settings.selectors.currentSubmenuItems), | |
| 131 | + $adminPageMenuLink: jQuery("a[href=\"".concat(settings.path, "\"]")) | |
| 132 | + }; | |
| 133 | + } | |
| 131 | 134 | |
| 132 | -//#endregion | |
| 133 | -//#region node_modules/@babel/runtime/helpers/OverloadYield.js | |
| 134 | - var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 135 | - function _OverloadYield(e, d) { | |
| 136 | - this.v = e, this.k = d; | |
| 137 | - } | |
| 138 | - module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 139 | - })); | |
| 135 | + // This method highlights the currently visited submenu item for the slug provided as an argument to this handler. | |
| 136 | + // This method also accepts a jQuery instance of a custom submenu item to highlight. If provided, the provided | |
| 137 | + // item will be the one highlighted. | |
| 138 | + }, { | |
| 139 | + key: "highlightSubMenuItem", | |
| 140 | + value: function highlightSubMenuItem() { | |
| 141 | + var $element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | |
| 142 | + var $submenuItem = $element || this.elements.$adminPageMenuLink; | |
| 143 | + if (this.elements.$currentSubmenuItems.length) { | |
| 144 | + this.elements.$currentSubmenuItems.removeClass('current'); | |
| 145 | + } | |
| 146 | + $submenuItem.addClass('current'); | |
| 140 | 147 | |
| 141 | -//#endregion | |
| 142 | -//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js | |
| 143 | - var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 144 | - function _regeneratorDefine(e, r, n, t) { | |
| 145 | - var i = Object.defineProperty; | |
| 146 | - try { | |
| 147 | - i({}, "", {}); | |
| 148 | - } catch (e) { | |
| 149 | - i = 0; | |
| 150 | - } | |
| 151 | - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 152 | - function o(r, n) { | |
| 153 | - _regeneratorDefine(e, r, function(e) { | |
| 154 | - return this._invoke(r, n, e); | |
| 155 | - }); | |
| 156 | - } | |
| 157 | - r ? i ? i(e, r, { | |
| 158 | - value: n, | |
| 159 | - enumerable: !t, | |
| 160 | - configurable: !t, | |
| 161 | - writable: !t | |
| 162 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 163 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 164 | - } | |
| 165 | - module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 166 | - })); | |
| 148 | + // Need to add the 'current' class to the link element's parent `<li>` element as well. | |
| 149 | + $submenuItem.parent().addClass('current'); | |
| 150 | + } | |
| 151 | + }, { | |
| 152 | + key: "highlightTopLevelMenuItem", | |
| 153 | + value: function highlightTopLevelMenuItem($elementToHighlight) { | |
| 154 | + var $elementToRemove = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | |
| 155 | + var activeClasses = 'wp-has-current-submenu wp-menu-open current'; | |
| 156 | + $elementToHighlight.parent().addClass(activeClasses).removeClass('wp-not-current-submenu'); | |
| 157 | + if ($elementToRemove) { | |
| 158 | + $elementToRemove.removeClass(activeClasses); | |
| 159 | + } | |
| 160 | + } | |
| 161 | + }, { | |
| 162 | + key: "onInit", | |
| 163 | + value: function onInit() { | |
| 164 | + (0, _get2.default)((0, _getPrototypeOf2.default)(MenuHandler.prototype), "onInit", this).call(this); | |
| 165 | + var settings = this.getSettings(); | |
| 166 | + if (window.location.href.includes(settings.path)) { | |
| 167 | + this.highlightSubMenuItem(); | |
| 168 | + } | |
| 169 | + } | |
| 170 | + }]); | |
| 171 | + return MenuHandler; | |
| 172 | +}(elementorModules.ViewModule); | |
| 173 | +exports["default"] = MenuHandler; | |
| 167 | 174 | |
| 168 | -//#endregion | |
| 169 | -//#region node_modules/@babel/runtime/helpers/regenerator.js | |
| 170 | - var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 171 | - var regeneratorDefine = require_regeneratorDefine(); | |
| 172 | - function _regenerator() { | |
| 173 | - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 174 | - var e; | |
| 175 | - var t; | |
| 176 | - var r = "function" == typeof Symbol ? Symbol : {}; | |
| 177 | - var n = r.iterator || "@@iterator"; | |
| 178 | - var o = r.toStringTag || "@@toStringTag"; | |
| 179 | - function i(r, n, o, i) { | |
| 180 | - var c = n && n.prototype instanceof Generator ? n : Generator; | |
| 181 | - var u = Object.create(c.prototype); | |
| 182 | - return regeneratorDefine(u, "_invoke", function(r, n, o) { | |
| 183 | - var i; | |
| 184 | - var c; | |
| 185 | - var u; | |
| 186 | - var f = 0; | |
| 187 | - var p = o || []; | |
| 188 | - var y = !1; | |
| 189 | - var G = { | |
| 190 | - p: 0, | |
| 191 | - n: 0, | |
| 192 | - v: e, | |
| 193 | - a: d, | |
| 194 | - f: d.bind(e, 4), | |
| 195 | - d: function d(t, r) { | |
| 196 | - return i = t, c = 0, u = e, G.n = r, a; | |
| 197 | - } | |
| 198 | - }; | |
| 199 | - function d(r, n) { | |
| 200 | - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 201 | - var o; | |
| 202 | - var i = p[t]; | |
| 203 | - var d = G.p; | |
| 204 | - var l = i[2]; | |
| 205 | - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); | |
| 206 | - } | |
| 207 | - if (o || r > 1) return a; | |
| 208 | - throw y = !0, n; | |
| 209 | - } | |
| 210 | - return function(o, p, l) { | |
| 211 | - if (f > 1) throw TypeError("Generator is already running"); | |
| 212 | - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 213 | - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 214 | - try { | |
| 215 | - if (f = 2, i) { | |
| 216 | - if (c || (o = "next"), t = i[o]) { | |
| 217 | - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 218 | - if (!t.done) return t; | |
| 219 | - u = t.value, c < 2 && (c = 0); | |
| 220 | - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 221 | - i = e; | |
| 222 | - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 223 | - } catch (t) { | |
| 224 | - i = e, c = 1, u = t; | |
| 225 | - } finally { | |
| 226 | - f = 1; | |
| 227 | - } | |
| 228 | - } | |
| 229 | - return { | |
| 230 | - value: t, | |
| 231 | - done: y | |
| 232 | - }; | |
| 233 | - }; | |
| 234 | - }(r, o, i), !0), u; | |
| 235 | - } | |
| 236 | - var a = {}; | |
| 237 | - function Generator() {} | |
| 238 | - function GeneratorFunction() {} | |
| 239 | - function GeneratorFunctionPrototype() {} | |
| 240 | - t = Object.getPrototypeOf; | |
| 241 | - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { | |
| 242 | - return this; | |
| 243 | - }), t); | |
| 244 | - var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 245 | - function f(e) { | |
| 246 | - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 247 | - } | |
| 248 | - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() { | |
| 249 | - return this; | |
| 250 | - }), regeneratorDefine(u, "toString", function() { | |
| 251 | - return "[object Generator]"; | |
| 252 | - }), (module.exports = _regenerator = function _regenerator() { | |
| 253 | - return { | |
| 254 | - w: i, | |
| 255 | - m: f | |
| 256 | - }; | |
| 257 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 258 | - } | |
| 259 | - module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 260 | - })); | |
| 175 | +/***/ }), | |
| 261 | 176 | |
| 262 | -//#endregion | |
| 263 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js | |
| 264 | - var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 265 | - var OverloadYield = require_OverloadYield(); | |
| 266 | - var regeneratorDefine = require_regeneratorDefine(); | |
| 267 | - function AsyncIterator(t, e) { | |
| 268 | - function n(r, o, i, f) { | |
| 269 | - try { | |
| 270 | - var c = t[r](o); | |
| 271 | - var u = c.value; | |
| 272 | - return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { | |
| 273 | - n("next", t, i, f); | |
| 274 | - }, function(t) { | |
| 275 | - n("throw", t, i, f); | |
| 276 | - }) : e.resolve(u).then(function(t) { | |
| 277 | - c.value = t, i(c); | |
| 278 | - }, function(t) { | |
| 279 | - return n("throw", t, i, f); | |
| 280 | - }); | |
| 281 | - } catch (t) { | |
| 282 | - f(t); | |
| 283 | - } | |
| 284 | - } | |
| 285 | - var r; | |
| 286 | - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { | |
| 287 | - return this; | |
| 288 | - })), regeneratorDefine(this, "_invoke", function(t, o, i) { | |
| 289 | - function f() { | |
| 290 | - return new e(function(e, r) { | |
| 291 | - n(t, i, e, r); | |
| 292 | - }); | |
| 293 | - } | |
| 294 | - return r = r ? r.then(f, f) : f(); | |
| 295 | - }, !0); | |
| 296 | - } | |
| 297 | - module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 298 | - })); | |
| 177 | +/***/ "../assets/dev/js/admin/new-template/template-controls.js": | |
| 178 | +/*!****************************************************************!*\ | |
| 179 | + !*** ../assets/dev/js/admin/new-template/template-controls.js ***! | |
| 180 | + \****************************************************************/ | |
| 181 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 299 | 182 | |
| 300 | -//#endregion | |
| 301 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js | |
| 302 | - var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 303 | - var regenerator = require_regenerator$1(); | |
| 304 | - var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 305 | - function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 306 | - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 307 | - } | |
| 308 | - module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 309 | - })); | |
| 183 | +"use strict"; | |
| 310 | 184 | |
| 311 | -//#endregion | |
| 312 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js | |
| 313 | - var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 314 | - var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 315 | - function _regeneratorAsync(n, e, r, t, o) { | |
| 316 | - var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 317 | - return a.next().then(function(n) { | |
| 318 | - return n.done ? n.value : a.next(); | |
| 319 | - }); | |
| 320 | - } | |
| 321 | - module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 322 | - })); | |
| 323 | 185 | |
| 324 | -//#endregion | |
| 325 | -//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js | |
| 326 | - var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 327 | - function _regeneratorKeys(e) { | |
| 328 | - var n = Object(e); | |
| 329 | - var r = []; | |
| 330 | - for (var t in n) r.unshift(t); | |
| 331 | - return function e() { | |
| 332 | - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 333 | - return e.done = !0, e; | |
| 334 | - }; | |
| 335 | - } | |
| 336 | - module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 337 | - })); | |
| 186 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 187 | +Object.defineProperty(exports, "__esModule", ({ | |
| 188 | + value: true | |
| 189 | +})); | |
| 190 | +exports["default"] = void 0; | |
| 191 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 192 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 193 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 194 | +var TemplateControls = /*#__PURE__*/function () { | |
| 195 | + function TemplateControls() { | |
| 196 | + (0, _classCallCheck2.default)(this, TemplateControls); | |
| 197 | + } | |
| 198 | + (0, _createClass2.default)(TemplateControls, [{ | |
| 199 | + key: "setDynamicControlsVisibility", | |
| 200 | + value: function setDynamicControlsVisibility(lookupControlIdPrefix, controls) { | |
| 201 | + if (undefined === controls) { | |
| 202 | + return; | |
| 203 | + } | |
| 204 | + var controlsArray = Object.entries(controls); | |
| 205 | + for (var _i = 0, _controlsArray = controlsArray; _i < _controlsArray.length; _i++) { | |
| 206 | + var _controlsArray$_i = (0, _slicedToArray2.default)(_controlsArray[_i], 2), | |
| 207 | + controlId = _controlsArray$_i[0], | |
| 208 | + controlSettings = _controlsArray$_i[1]; | |
| 209 | + this.setVisibilityForControl(lookupControlIdPrefix, controlSettings, controlId); | |
| 210 | + } | |
| 211 | + } | |
| 212 | + }, { | |
| 213 | + key: "setVisibilityForControl", | |
| 214 | + value: function setVisibilityForControl(lookupControlIdPrefix, controlSettings, controlId) { | |
| 215 | + var _controlSettings$cond, | |
| 216 | + _this = this; | |
| 217 | + var conditions = Object.entries((_controlSettings$cond = controlSettings.conditions) !== null && _controlSettings$cond !== void 0 ? _controlSettings$cond : {}); | |
| 218 | + conditions.forEach(function (condition) { | |
| 219 | + _this.changeVisibilityBasedOnCondition(lookupControlIdPrefix, condition, controlId); | |
| 220 | + }); | |
| 221 | + } | |
| 222 | + }, { | |
| 223 | + key: "changeVisibilityBasedOnCondition", | |
| 224 | + value: function changeVisibilityBasedOnCondition(lookupControlIdPrefix, condition, controlId) { | |
| 225 | + var _condition = (0, _slicedToArray2.default)(condition, 2), | |
| 226 | + conditionKey = _condition[0], | |
| 227 | + conditionValue = _condition[1]; | |
| 228 | + var targetControlWrapper = document.getElementById(lookupControlIdPrefix + controlId + '__wrapper'); | |
| 229 | + var lookupControl = document.getElementById(lookupControlIdPrefix + conditionKey); | |
| 230 | + targetControlWrapper.classList.toggle('elementor-hidden', !lookupControl || conditionValue !== lookupControl.value); | |
| 231 | + } | |
| 232 | + }]); | |
| 233 | + return TemplateControls; | |
| 234 | +}(); | |
| 235 | +exports["default"] = TemplateControls; | |
| 338 | 236 | |
| 339 | -//#endregion | |
| 340 | -//#region node_modules/@babel/runtime/helpers/typeof.js | |
| 341 | - var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 342 | - function _typeof(o) { | |
| 343 | - "@babel/helpers - typeof"; | |
| 344 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 345 | - return typeof o; | |
| 346 | - } : function(o) { | |
| 347 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 348 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 349 | - } | |
| 350 | - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 351 | - })); | |
| 237 | +/***/ }), | |
| 352 | 238 | |
| 353 | -//#endregion | |
| 354 | -//#region node_modules/@babel/runtime/helpers/regeneratorValues.js | |
| 355 | - var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 356 | - var _typeof = require_typeof()["default"]; | |
| 357 | - function _regeneratorValues(e) { | |
| 358 | - if (null != e) { | |
| 359 | - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; | |
| 360 | - var r = 0; | |
| 361 | - if (t) return t.call(e); | |
| 362 | - if ("function" == typeof e.next) return e; | |
| 363 | - if (!isNaN(e.length)) return { next: function next() { | |
| 364 | - return e && r >= e.length && (e = void 0), { | |
| 365 | - value: e && e[r++], | |
| 366 | - done: !e | |
| 367 | - }; | |
| 368 | - } }; | |
| 369 | - } | |
| 370 | - throw new TypeError(_typeof(e) + " is not iterable"); | |
| 371 | - } | |
| 372 | - module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 373 | - })); | |
| 239 | +/***/ "../assets/dev/js/editor/utils/files-upload-handler.js": | |
| 240 | +/*!*************************************************************!*\ | |
| 241 | + !*** ../assets/dev/js/editor/utils/files-upload-handler.js ***! | |
| 242 | + \*************************************************************/ | |
| 243 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 374 | 244 | |
| 375 | -//#endregion | |
| 376 | -//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js | |
| 377 | - var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 378 | - var OverloadYield = require_OverloadYield(); | |
| 379 | - var regenerator = require_regenerator$1(); | |
| 380 | - var regeneratorAsync = require_regeneratorAsync(); | |
| 381 | - var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 382 | - var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 383 | - var regeneratorKeys = require_regeneratorKeys(); | |
| 384 | - var regeneratorValues = require_regeneratorValues(); | |
| 385 | - function _regeneratorRuntime() { | |
| 386 | - "use strict"; | |
| 387 | - var r = regenerator(); | |
| 388 | - var e = r.m(_regeneratorRuntime); | |
| 389 | - var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 390 | - function n(r) { | |
| 391 | - var e = "function" == typeof r && r.constructor; | |
| 392 | - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 393 | - } | |
| 394 | - var o = { | |
| 395 | - "throw": 1, | |
| 396 | - "return": 2, | |
| 397 | - "break": 3, | |
| 398 | - "continue": 3 | |
| 399 | - }; | |
| 400 | - function a(r) { | |
| 401 | - var e; | |
| 402 | - var t; | |
| 403 | - return function(n) { | |
| 404 | - e || (e = { | |
| 405 | - stop: function stop() { | |
| 406 | - return t(n.a, 2); | |
| 407 | - }, | |
| 408 | - "catch": function _catch() { | |
| 409 | - return n.v; | |
| 410 | - }, | |
| 411 | - abrupt: function abrupt(r, e) { | |
| 412 | - return t(n.a, o[r], e); | |
| 413 | - }, | |
| 414 | - delegateYield: function delegateYield(r, o, a) { | |
| 415 | - return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 416 | - }, | |
| 417 | - finish: function finish(r) { | |
| 418 | - return t(n.f, r); | |
| 419 | - } | |
| 420 | - }, t = function t(r, _t, o) { | |
| 421 | - n.p = e.prev, n.n = e.next; | |
| 422 | - try { | |
| 423 | - return r(_t, o); | |
| 424 | - } finally { | |
| 425 | - e.next = n.n; | |
| 426 | - } | |
| 427 | - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 428 | - try { | |
| 429 | - return r.call(this, e); | |
| 430 | - } finally { | |
| 431 | - n.p = e.prev, n.n = e.next; | |
| 432 | - } | |
| 433 | - }; | |
| 434 | - } | |
| 435 | - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 436 | - return { | |
| 437 | - wrap: function wrap(e, t, n, o) { | |
| 438 | - return r.w(a(e), t, n, o && o.reverse()); | |
| 439 | - }, | |
| 440 | - isGeneratorFunction: n, | |
| 441 | - mark: r.m, | |
| 442 | - awrap: function awrap(r, e) { | |
| 443 | - return new OverloadYield(r, e); | |
| 444 | - }, | |
| 445 | - AsyncIterator: regeneratorAsyncIterator, | |
| 446 | - async: function async(r, e, t, o, u) { | |
| 447 | - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 448 | - }, | |
| 449 | - keys: regeneratorKeys, | |
| 450 | - values: regeneratorValues | |
| 451 | - }; | |
| 452 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 453 | - } | |
| 454 | - module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 455 | - })); | |
| 245 | +"use strict"; | |
| 246 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 456 | 247 | |
| 457 | -//#endregion | |
| 458 | -//#region node_modules/@babel/runtime/regenerator/index.js | |
| 459 | - var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 460 | - var runtime = require_regeneratorRuntime()(); | |
| 461 | - module.exports = runtime; | |
| 462 | - try { | |
| 463 | - regeneratorRuntime = runtime; | |
| 464 | - } catch (accidentalStrictMode) { | |
| 465 | - if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; | |
| 466 | - else Function("r", "regeneratorRuntime = r")(runtime); | |
| 467 | - } | |
| 468 | - })); | |
| 469 | 248 | |
| 470 | -//#endregion | |
| 471 | -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js | |
| 472 | -var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 473 | - function _classCallCheck(a, n) { | |
| 474 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 475 | - } | |
| 249 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 250 | +Object.defineProperty(exports, "__esModule", ({ | |
| 251 | + value: true | |
| 252 | +})); | |
| 253 | +exports["default"] = void 0; | |
| 254 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 255 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 256 | +var FilesUploadHandler = /*#__PURE__*/function () { | |
| 257 | + function FilesUploadHandler() { | |
| 258 | + (0, _classCallCheck2.default)(this, FilesUploadHandler); | |
| 259 | + } | |
| 260 | + (0, _createClass2.default)(FilesUploadHandler, null, [{ | |
| 261 | + key: "isUploadEnabled", | |
| 262 | + value: function isUploadEnabled(mediaType) { | |
| 263 | + var unfilteredFilesTypes = ['svg', 'application/json']; | |
| 264 | + if (!unfilteredFilesTypes.includes(mediaType)) { | |
| 265 | + return true; | |
| 266 | + } | |
| 267 | + return elementorCommon.config.filesUpload.unfilteredFiles; | |
| 268 | + } | |
| 269 | + }, { | |
| 270 | + key: "setUploadTypeCaller", | |
| 271 | + value: function setUploadTypeCaller(frame) { | |
| 272 | + frame.uploader.uploader.param('uploadTypeCaller', 'elementor-wp-media-upload'); | |
| 273 | + } | |
| 274 | + }, { | |
| 275 | + key: "getUnfilteredFilesNotEnabledDialog", | |
| 276 | + value: function getUnfilteredFilesNotEnabledDialog(callback) { | |
| 277 | + var onConfirm = function onConfirm() { | |
| 278 | + elementorCommon.ajax.addRequest('enable_unfiltered_files_upload', {}, true); | |
| 279 | + elementorCommon.config.filesUpload.unfilteredFiles = true; | |
| 280 | + callback(); | |
| 281 | + }; | |
| 282 | + return elementor.helpers.getSimpleDialog('e-enable-unfiltered-files-dialog', __('Enable Unfiltered File Uploads', 'elementor'), __('Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.', 'elementor'), __('Enable', 'elementor'), onConfirm); | |
| 283 | + } | |
| 284 | + }, { | |
| 285 | + key: "getUnfilteredFilesNotEnabledImportTemplateDialog", | |
| 286 | + value: function getUnfilteredFilesNotEnabledImportTemplateDialog(callback) { | |
| 287 | + return elementorCommon.dialogsManager.createWidget('confirm', { | |
| 288 | + id: 'e-enable-unfiltered-files-dialog-import-template', | |
| 289 | + headerMessage: __('Enable Unfiltered File Uploads', 'elementor'), | |
| 290 | + message: __('Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.', 'elementor') + '<br /><br />' + __('If you do not enable uploading unfiltered files, any SVG or JSON (including lottie) files used in the uploaded template will not be imported.', 'elementor'), | |
| 291 | + position: { | |
| 292 | + my: 'center center', | |
| 293 | + at: 'center center' | |
| 294 | + }, | |
| 295 | + strings: { | |
| 296 | + confirm: __('Enable and Import', 'elementor'), | |
| 297 | + cancel: __('Import Without Enabling', 'elementor') | |
| 298 | + }, | |
| 299 | + onConfirm: function onConfirm() { | |
| 300 | + elementorCommon.ajax.addRequest('enable_unfiltered_files_upload', { | |
| 301 | + success: function success() { | |
| 302 | + // This utility is used in both the admin and the Editor. | |
| 303 | + elementorCommon.config.filesUpload.unfilteredFiles = true; | |
| 304 | + callback(); | |
| 305 | + } | |
| 306 | + }, true); | |
| 307 | + }, | |
| 308 | + onCancel: function onCancel() { | |
| 309 | + return callback(); | |
| 310 | + } | |
| 311 | + }); | |
| 312 | + } | |
| 313 | + }]); | |
| 314 | + return FilesUploadHandler; | |
| 315 | +}(); | |
| 316 | +exports["default"] = FilesUploadHandler; | |
| 476 | 317 | |
| 477 | -//#endregion | |
| 478 | -//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 479 | - function _typeof(o) { | |
| 480 | - "@babel/helpers - typeof"; | |
| 481 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 482 | - return typeof o; | |
| 483 | - } : function(o) { | |
| 484 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 485 | - }, _typeof(o); | |
| 486 | - } | |
| 318 | +/***/ }), | |
| 487 | 319 | |
| 488 | -//#endregion | |
| 489 | -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 490 | - function toPrimitive(t, r) { | |
| 491 | - if ("object" != _typeof(t) || !t) return t; | |
| 492 | - var e = t[Symbol.toPrimitive]; | |
| 493 | - if (void 0 !== e) { | |
| 494 | - var i = e.call(t, r || "default"); | |
| 495 | - if ("object" != _typeof(i)) return i; | |
| 496 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 497 | - } | |
| 498 | - return ("string" === r ? String : Number)(t); | |
| 499 | - } | |
| 320 | +/***/ "../assets/dev/js/utils/events.js": | |
| 321 | +/*!****************************************!*\ | |
| 322 | + !*** ../assets/dev/js/utils/events.js ***! | |
| 323 | + \****************************************/ | |
| 324 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 500 | 325 | |
| 501 | -//#endregion | |
| 502 | -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 503 | - function toPropertyKey(t) { | |
| 504 | - var i = toPrimitive(t, "string"); | |
| 505 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 506 | - } | |
| 326 | +"use strict"; | |
| 507 | 327 | |
| 508 | -//#endregion | |
| 509 | -//#region node_modules/@babel/runtime/helpers/esm/createClass.js | |
| 510 | - function _defineProperties(e, r) { | |
| 511 | - for (var t = 0; t < r.length; t++) { | |
| 512 | - var o = r[t]; | |
| 513 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 514 | - } | |
| 515 | - } | |
| 516 | - function _createClass(e, r, t) { | |
| 517 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; | |
| 518 | - } | |
| 519 | 328 | |
| 520 | -//#endregion | |
| 521 | -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js | |
| 522 | - function _assertThisInitialized(e) { | |
| 523 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 524 | - return e; | |
| 525 | - } | |
| 329 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 330 | +Object.defineProperty(exports, "__esModule", ({ | |
| 331 | + value: true | |
| 332 | +})); | |
| 333 | +exports["default"] = exports.Events = void 0; | |
| 334 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 335 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 336 | +var Events = /*#__PURE__*/function () { | |
| 337 | + function Events() { | |
| 338 | + (0, _classCallCheck2.default)(this, Events); | |
| 339 | + } | |
| 340 | + (0, _createClass2.default)(Events, null, [{ | |
| 341 | + key: "dispatch", | |
| 342 | + value: | |
| 343 | + /** | |
| 344 | + * Dispatch an Elementor event. | |
| 345 | + * | |
| 346 | + * Will dispatch both native event & jQuery event (as BC). | |
| 347 | + * By default, `bcEvent` is `null`. | |
| 348 | + * | |
| 349 | + * @param {Object} context - The context that will dispatch the event. | |
| 350 | + * @param {string} event - Event to dispatch. | |
| 351 | + * @param {*} data - Data to pass to the event, default to `null`. | |
| 352 | + * @param {string|null} bcEvent - BC event to dispatch, default to `null`. | |
| 353 | + * | |
| 354 | + * @return {void} | |
| 355 | + */ | |
| 356 | + function dispatch(context, event) { | |
| 357 | + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | |
| 358 | + var bcEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; | |
| 359 | + // Make sure to use the native context if it's a jQuery instance. | |
| 360 | + context = context instanceof jQuery ? context[0] : context; | |
| 526 | 361 | |
| 527 | -//#endregion | |
| 528 | -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js | |
| 529 | - function _possibleConstructorReturn(t, e) { | |
| 530 | - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 531 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 532 | - return _assertThisInitialized(t); | |
| 533 | - } | |
| 362 | + // Dispatch the BC event only if exists. | |
| 363 | + if (bcEvent) { | |
| 364 | + context.dispatchEvent(new CustomEvent(bcEvent, { | |
| 365 | + detail: data | |
| 366 | + })); | |
| 367 | + } | |
| 534 | 368 | |
| 535 | -//#endregion | |
| 536 | -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js | |
| 537 | - function _getPrototypeOf(t) { | |
| 538 | - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { | |
| 539 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 540 | - }, _getPrototypeOf(t); | |
| 541 | - } | |
| 369 | + // jQuery's `.on()` listens also to native custom events, so there is no need | |
| 370 | + // to dispatch also a jQuery event. | |
| 371 | + context.dispatchEvent(new CustomEvent(event, { | |
| 372 | + detail: data | |
| 373 | + })); | |
| 374 | + } | |
| 375 | + }]); | |
| 376 | + return Events; | |
| 377 | +}(); | |
| 378 | +exports.Events = Events; | |
| 379 | +var _default = Events; | |
| 380 | +exports["default"] = _default; | |
| 542 | 381 | |
| 543 | -//#endregion | |
| 544 | -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js | |
| 545 | - function _setPrototypeOf(t, e) { | |
| 546 | - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { | |
| 547 | - return t.__proto__ = e, t; | |
| 548 | - }, _setPrototypeOf(t, e); | |
| 549 | - } | |
| 382 | +/***/ }), | |
| 550 | 383 | |
| 551 | -//#endregion | |
| 552 | -//#region node_modules/@babel/runtime/helpers/esm/inherits.js | |
| 553 | - function _inherits(t, e) { | |
| 554 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 555 | - t.prototype = Object.create(e && e.prototype, { constructor: { | |
| 556 | - value: t, | |
| 557 | - writable: !0, | |
| 558 | - configurable: !0 | |
| 559 | - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); | |
| 560 | - } | |
| 384 | +/***/ "../core/common/assets/js/utils/environment.js": | |
| 385 | +/*!*****************************************************!*\ | |
| 386 | + !*** ../core/common/assets/js/utils/environment.js ***! | |
| 387 | + \*****************************************************/ | |
| 388 | +/***/ ((__unused_webpack_module, exports) => { | |
| 561 | 389 | |
| 562 | -//#endregion | |
| 563 | -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js | |
| 564 | - function _superPropBase(t, o) { | |
| 565 | - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); | |
| 566 | - return t; | |
| 567 | - } | |
| 390 | +"use strict"; | |
| 568 | 391 | |
| 569 | -//#endregion | |
| 570 | -//#region node_modules/@babel/runtime/helpers/esm/get.js | |
| 571 | - function _get() { | |
| 572 | - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { | |
| 573 | - var p = _superPropBase(e, t); | |
| 574 | - if (p) { | |
| 575 | - var n = Object.getOwnPropertyDescriptor(p, t); | |
| 576 | - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 577 | - } | |
| 578 | - }, _get.apply(null, arguments); | |
| 579 | - } | |
| 580 | 392 | |
| 581 | -//#endregion | |
| 582 | -//#region assets/dev/js/admin/menu-handler.js | |
| 583 | - function _callSuper$11(t, o, e) { | |
| 584 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 585 | - } | |
| 586 | - __name(_callSuper$11, "_callSuper"); | |
| 587 | - function _isNativeReflectConstruct$11() { | |
| 588 | - try { | |
| 589 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 590 | - } catch (t) {} | |
| 591 | - return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() { | |
| 592 | - return !!t; | |
| 593 | - })(); | |
| 594 | - } | |
| 595 | - __name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct"); | |
| 596 | - function _superPropGet$4(t, o, e, r) { | |
| 597 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 598 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 599 | - return p.apply(e, t); | |
| 600 | - } : p; | |
| 601 | - } | |
| 602 | - __name(_superPropGet$4, "_superPropGet"); | |
| 603 | - var MenuHandler = /*#__PURE__*/ function(_elementorModules$Vie) { | |
| 604 | - function MenuHandler() { | |
| 605 | - _classCallCheck(this, MenuHandler); | |
| 606 | - return _callSuper$11(this, MenuHandler, arguments); | |
| 607 | - } | |
| 608 | - _inherits(MenuHandler, _elementorModules$Vie); | |
| 609 | - return _createClass(MenuHandler, [ | |
| 610 | - { | |
| 611 | - key: "getDefaultSettings", | |
| 612 | - value: function getDefaultSettings() { | |
| 613 | - return { selectors: { currentSubmenuItems: "#adminmenu .current" } }; | |
| 614 | - } | |
| 615 | - }, | |
| 616 | - { | |
| 617 | - key: "getDefaultElements", | |
| 618 | - value: function getDefaultElements() { | |
| 619 | - var settings = this.getSettings(); | |
| 620 | - return { | |
| 621 | - $currentSubmenuItems: jQuery(settings.selectors.currentSubmenuItems), | |
| 622 | - $adminPageMenuLink: jQuery("a[href=\"".concat(settings.path, "\"]")) | |
| 623 | - }; | |
| 624 | - } | |
| 625 | - }, | |
| 626 | - { | |
| 627 | - key: "highlightSubMenuItem", | |
| 628 | - value: function highlightSubMenuItem() { | |
| 629 | - var $submenuItem = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null) || this.elements.$adminPageMenuLink; | |
| 630 | - if (this.elements.$currentSubmenuItems.length) this.elements.$currentSubmenuItems.removeClass("current"); | |
| 631 | - $submenuItem.addClass("current"); | |
| 632 | - $submenuItem.parent().addClass("current"); | |
| 633 | - } | |
| 634 | - }, | |
| 635 | - { | |
| 636 | - key: "highlightTopLevelMenuItem", | |
| 637 | - value: function highlightTopLevelMenuItem($elementToHighlight) { | |
| 638 | - var $elementToRemove = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; | |
| 639 | - var activeClasses = "wp-has-current-submenu wp-menu-open current"; | |
| 640 | - $elementToHighlight.parent().addClass(activeClasses).removeClass("wp-not-current-submenu"); | |
| 641 | - if ($elementToRemove) $elementToRemove.removeClass(activeClasses); | |
| 642 | - } | |
| 643 | - }, | |
| 644 | - { | |
| 645 | - key: "onInit", | |
| 646 | - value: function onInit() { | |
| 647 | - _superPropGet$4(MenuHandler, "onInit", this, 3)([]); | |
| 648 | - var settings = this.getSettings(); | |
| 649 | - if (window.location.href.includes(settings.path)) this.highlightSubMenuItem(); | |
| 650 | - } | |
| 651 | - } | |
| 652 | - ]); | |
| 653 | - }(elementorModules.ViewModule); | |
| 393 | +Object.defineProperty(exports, "__esModule", ({ | |
| 394 | + value: true | |
| 395 | +})); | |
| 396 | +exports["default"] = void 0; | |
| 397 | +var matchUserAgent = function matchUserAgent(UserAgentStr) { | |
| 398 | + return userAgent.indexOf(UserAgentStr) >= 0; | |
| 399 | + }, | |
| 400 | + userAgent = navigator.userAgent, | |
| 401 | + // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser | |
| 654 | 402 | |
| 655 | -//#endregion | |
| 656 | -//#region modules/landing-pages/assets/js/admin/landing-pages.js | |
| 657 | - function _callSuper$10(t, o, e) { | |
| 658 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 659 | - } | |
| 660 | - __name(_callSuper$10, "_callSuper"); | |
| 661 | - function _isNativeReflectConstruct$10() { | |
| 662 | - try { | |
| 663 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 664 | - } catch (t) {} | |
| 665 | - return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() { | |
| 666 | - return !!t; | |
| 667 | - })(); | |
| 668 | - } | |
| 669 | - __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct"); | |
| 670 | - function _superPropGet$3(t, o, e, r) { | |
| 671 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 672 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 673 | - return p.apply(e, t); | |
| 674 | - } : p; | |
| 675 | - } | |
| 676 | - __name(_superPropGet$3, "_superPropGet"); | |
| 677 | - var LandingPagesHandler = /*#__PURE__*/ function(_AdminMenuHandler) { | |
| 678 | - function LandingPagesHandler() { | |
| 679 | - _classCallCheck(this, LandingPagesHandler); | |
| 680 | - return _callSuper$10(this, LandingPagesHandler, arguments); | |
| 681 | - } | |
| 682 | - _inherits(LandingPagesHandler, _AdminMenuHandler); | |
| 683 | - return _createClass(LandingPagesHandler, [ | |
| 684 | - { | |
| 685 | - key: "getDefaultSettings", | |
| 686 | - value: function getDefaultSettings() { | |
| 687 | - var pageName = "e-landing-page"; | |
| 688 | - var adminMenuSelectors = { | |
| 689 | - landingPagesTablePage: "a[href=\"edit.php?post_type=" + pageName + "\"]", | |
| 690 | - landingPagesAddNewPage: "a[href=\"edit.php?post_type=elementor_library&page=" + pageName + "\"]" | |
| 691 | - }; | |
| 692 | - return { selectors: { | |
| 693 | - addButton: ".page-title-action:first", | |
| 694 | - pagesMenuItemAndLink: "#menu-pages, #menu-pages > a", | |
| 695 | - landingPagesMenuItem: "".concat(adminMenuSelectors.landingPagesTablePage, ", ").concat(adminMenuSelectors.landingPagesAddNewPage), | |
| 696 | - templatesMenuItem: ".menu-icon-elementor_library" | |
| 697 | - } }; | |
| 698 | - } | |
| 699 | - }, | |
| 700 | - { | |
| 701 | - key: "getDefaultElements", | |
| 702 | - value: function getDefaultElements() { | |
| 703 | - var selectors = this.getSettings("selectors"); | |
| 704 | - var elements = _superPropGet$3(LandingPagesHandler, "getDefaultElements", this, 3)([]); | |
| 705 | - elements.$landingPagesMenuItem = jQuery(selectors.landingPagesMenuItem); | |
| 706 | - elements.$templatesMenuItem = jQuery(selectors.templatesMenuItem); | |
| 707 | - elements.$pagesMenuItemAndLink = jQuery(selectors.pagesMenuItemAndLink); | |
| 708 | - return elements; | |
| 709 | - } | |
| 710 | - }, | |
| 711 | - { | |
| 712 | - key: "onInit", | |
| 713 | - value: function onInit() { | |
| 714 | - _superPropGet$3(LandingPagesHandler, "onInit", this, 3)([]); | |
| 715 | - var settings = this.getSettings(); | |
| 716 | - var isLandingPagesTablePage = !!window.location.href.includes(settings.paths.landingPagesTablePage); | |
| 717 | - var isLandingPagesTrashPage = !!window.location.href.includes(settings.paths.landingPagesTrashPage); | |
| 718 | - var isLandingPagesCreateYourFirstPage = !!window.location.href.includes(settings.paths.landingPagesAddNewPage); | |
| 719 | - if (isLandingPagesTablePage || isLandingPagesTrashPage || isLandingPagesCreateYourFirstPage || settings.isLandingPageAdminEdit) { | |
| 720 | - this.highlightTopLevelMenuItem(this.elements.$templatesMenuItem, this.elements.$pagesMenuItemAndLink); | |
| 721 | - this.highlightSubMenuItem(this.elements.$landingPagesMenuItem); | |
| 722 | - jQuery(settings.selectors.addButton).attr("href", elementorAdminConfig.urls.addNewLandingPageUrl); | |
| 723 | - } | |
| 724 | - } | |
| 725 | - } | |
| 726 | - ]); | |
| 727 | - }(MenuHandler); | |
| 403 | + // Opera 8.0+ | |
| 404 | + isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'), | |
| 405 | + // Firefox 1.0+ | |
| 406 | + isFirefox = matchUserAgent('Firefox'), | |
| 407 | + // Safari 3.0+ "[object HTMLElementConstructor]" | |
| 408 | + isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) { | |
| 409 | + return '[object SafariRemoteNotification]' === p.toString(); | |
| 410 | + }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification), | |
| 411 | + // Internet Explorer 6-11 | |
| 412 | + isIE = /Trident|MSIE/.test(userAgent) && ( /* @cc_on!@*/ false || !!document.documentMode), | |
| 413 | + // Edge 20+ | |
| 414 | + isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'), | |
| 415 | + // Google Chrome (Not accurate) | |
| 416 | + isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera), | |
| 417 | + // Blink engine | |
| 418 | + isBlink = matchUserAgent('Chrome') && !!window.CSS, | |
| 419 | + // Apple Webkit engine | |
| 420 | + isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink, | |
| 421 | + environment = { | |
| 422 | + appleWebkit: isAppleWebkit, | |
| 423 | + blink: isBlink, | |
| 424 | + chrome: isChrome, | |
| 425 | + edge: isEdge, | |
| 426 | + firefox: isFirefox, | |
| 427 | + ie: isIE, | |
| 428 | + mac: matchUserAgent('Macintosh'), | |
| 429 | + opera: isOpera, | |
| 430 | + safari: isSafari, | |
| 431 | + webkit: matchUserAgent('AppleWebKit') | |
| 432 | + }; | |
| 433 | +var _default = environment; | |
| 434 | +exports["default"] = _default; | |
| 728 | 435 | |
| 729 | -//#endregion | |
| 730 | -//#region modules/landing-pages/assets/js/admin/module.js | |
| 731 | - function _callSuper$9(t, o, e) { | |
| 732 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 733 | - } | |
| 734 | - __name(_callSuper$9, "_callSuper"); | |
| 735 | - function _isNativeReflectConstruct$9() { | |
| 736 | - try { | |
| 737 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 738 | - } catch (t) {} | |
| 739 | - return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() { | |
| 740 | - return !!t; | |
| 741 | - })(); | |
| 742 | - } | |
| 743 | - __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct"); | |
| 744 | - var _default$1 = /*#__PURE__*/ function(_elementorModules$Mod) { | |
| 745 | - function _default() { | |
| 746 | - var _this; | |
| 747 | - _classCallCheck(this, _default); | |
| 748 | - _this = _callSuper$9(this, _default); | |
| 749 | - elementorCommon.elements.$window.on("elementor/admin/init", function() { | |
| 750 | - _this.runHandler(); | |
| 751 | - }); | |
| 752 | - return _this; | |
| 753 | - } | |
| 754 | - _inherits(_default, _elementorModules$Mod); | |
| 755 | - return _createClass(_default, [{ | |
| 756 | - key: "runHandler", | |
| 757 | - value: function runHandler() { | |
| 758 | - var _elementorAdmin$confi; | |
| 759 | - var _elementorAdmin$confi2; | |
| 760 | - var pageName = "e-landing-page"; | |
| 761 | - var paths = { | |
| 762 | - landingPagesTablePage: "edit.php?post_type=" + pageName, | |
| 763 | - landingPagesAddNewPage: "edit.php?post_type=elementor_library&page=" + pageName, | |
| 764 | - landingPagesTrashPage: "edit.php?post_status=trash&post_type=" + pageName | |
| 765 | - }; | |
| 766 | - new LandingPagesHandler({ | |
| 767 | - path: (_elementorAdmin$confi = elementorAdmin.config.landingPages) !== null && _elementorAdmin$confi !== void 0 && _elementorAdmin$confi.landingPagesHasPages ? paths.landingPagesTablePage : paths.landingPagesAddNewPage, | |
| 768 | - isLandingPageAdminEdit: (_elementorAdmin$confi2 = elementorAdmin.config.landingPages) === null || _elementorAdmin$confi2 === void 0 ? void 0 : _elementorAdmin$confi2.isLandingPageAdminEdit, | |
| 769 | - paths | |
| 770 | - }); | |
| 771 | - } | |
| 772 | - }]); | |
| 773 | - }(elementorModules.Module); | |
| 436 | +/***/ }), | |
| 774 | 437 | |
| 775 | -//#endregion | |
| 776 | -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 777 | - function _defineProperty(e, r, t) { | |
| 778 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 779 | - value: t, | |
| 780 | - enumerable: !0, | |
| 781 | - configurable: !0, | |
| 782 | - writable: !0 | |
| 783 | - }) : e[r] = t, e; | |
| 784 | - } | |
| 438 | +/***/ "../core/experiments/assets/js/admin/behaviors/experiments-dependency.js": | |
| 439 | +/*!*******************************************************************************!*\ | |
| 440 | + !*** ../core/experiments/assets/js/admin/behaviors/experiments-dependency.js ***! | |
| 441 | + \*******************************************************************************/ | |
| 442 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 785 | 443 | |
| 786 | -//#endregion | |
| 787 | -//#region core/experiments/assets/js/admin/behaviors/experiments-messages.js | |
| 788 | - var STATE_ACTIVE = "active"; | |
| 789 | - var STATE_INACTIVE = "inactive"; | |
| 790 | - var STATE_DEFAULT = "default"; | |
| 791 | - var ExperimentsMessages = /*#__PURE__*/ function() { | |
| 792 | - function ExperimentsMessages(_ref) { | |
| 793 | - var selects = _ref.selects; | |
| 794 | - var submit = _ref.submit; | |
| 795 | - _classCallCheck(this, ExperimentsMessages); | |
| 796 | - _defineProperty(this, "elements", {}); | |
| 797 | - this.elements = { | |
| 798 | - /** | |
| 799 | - * @type {HTMLSelectElement[]} | |
| 800 | - */ | |
| 801 | - selects, | |
| 802 | - /** | |
| 803 | - * @type {HTMLInputElement} | |
| 804 | - */ | |
| 805 | - submit | |
| 806 | - }; | |
| 807 | - } | |
| 808 | - return _createClass(ExperimentsMessages, [ | |
| 809 | - { | |
| 810 | - key: "bindEvents", | |
| 811 | - value: function bindEvents() { | |
| 812 | - var _this = this; | |
| 813 | - this.elements.selects.forEach(function(select) { | |
| 814 | - select.addEventListener("change", function(e) { | |
| 815 | - return _this.onExperimentStateChange(e); | |
| 816 | - }); | |
| 817 | - }); | |
| 818 | - } | |
| 819 | - }, | |
| 820 | - { | |
| 821 | - key: "onExperimentStateChange", | |
| 822 | - value: function onExperimentStateChange(e) { | |
| 823 | - var experimentId = e.currentTarget.dataset.experimentId; | |
| 824 | - switch (this.getExperimentActualState(experimentId)) { | |
| 825 | - case STATE_ACTIVE: | |
| 826 | - if (this.shouldShowDependenciesDialog(experimentId)) this.showDependenciesDialog(experimentId); | |
| 827 | - break; | |
| 828 | - case STATE_INACTIVE: | |
| 829 | - if (this.shouldShowDeactivationDialog(experimentId)) this.showDeactivationDialog(experimentId); | |
| 830 | - else this.deactivateDependantExperiments(experimentId); | |
| 831 | - break; | |
| 832 | - default: break; | |
| 833 | - } | |
| 834 | - } | |
| 835 | - }, | |
| 836 | - { | |
| 837 | - key: "getExperimentData", | |
| 838 | - value: function getExperimentData(experimentId) { | |
| 839 | - return elementorAdminConfig.experiments[experimentId]; | |
| 840 | - } | |
| 841 | - }, | |
| 842 | - { | |
| 843 | - key: "getExperimentDependencies", | |
| 844 | - value: function getExperimentDependencies(experimentId) { | |
| 845 | - var _this2 = this; | |
| 846 | - return this.getExperimentData(experimentId).dependencies.map(function(dependencyId) { | |
| 847 | - return _this2.getExperimentData(dependencyId); | |
| 848 | - }); | |
| 849 | - } | |
| 850 | - }, | |
| 851 | - { | |
| 852 | - key: "getExperimentSelect", | |
| 853 | - value: function getExperimentSelect(experimentId) { | |
| 854 | - return this.elements.selects.find(function(select) { | |
| 855 | - return select.matches("[data-experiment-id=\"".concat(experimentId, "\"]")); | |
| 856 | - }); | |
| 857 | - } | |
| 858 | - }, | |
| 859 | - { | |
| 860 | - key: "setExperimentState", | |
| 861 | - value: function setExperimentState(experimentId, state) { | |
| 862 | - this.getExperimentSelect(experimentId).value = state; | |
| 863 | - } | |
| 864 | - }, | |
| 865 | - { | |
| 866 | - key: "getExperimentActualState", | |
| 867 | - value: function getExperimentActualState(experimentId) { | |
| 868 | - var _this$getExperimentSe; | |
| 869 | - var state = (_this$getExperimentSe = this.getExperimentSelect(experimentId)) === null || _this$getExperimentSe === void 0 ? void 0 : _this$getExperimentSe.value; | |
| 870 | - if (!state) return this.getExperimentData(experimentId).state; | |
| 871 | - if (state !== STATE_DEFAULT) return state; | |
| 872 | - return this.isExperimentActiveByDefault(experimentId) ? STATE_ACTIVE : STATE_INACTIVE; | |
| 873 | - } | |
| 874 | - }, | |
| 875 | - { | |
| 876 | - key: "isExperimentActive", | |
| 877 | - value: function isExperimentActive(experimentId) { | |
| 878 | - return this.getExperimentActualState(experimentId) === STATE_ACTIVE; | |
| 879 | - } | |
| 880 | - }, | |
| 881 | - { | |
| 882 | - key: "isExperimentActiveByDefault", | |
| 883 | - value: function isExperimentActiveByDefault(experimentId) { | |
| 884 | - return this.getExperimentData(experimentId).default === STATE_ACTIVE; | |
| 885 | - } | |
| 886 | - }, | |
| 887 | - { | |
| 888 | - key: "areAllDependenciesActive", | |
| 889 | - value: function areAllDependenciesActive(dependencies) { | |
| 890 | - var _this3 = this; | |
| 891 | - return dependencies.every(function(dependency) { | |
| 892 | - return _this3.isExperimentActive(dependency.name); | |
| 893 | - }); | |
| 894 | - } | |
| 895 | - }, | |
| 896 | - { | |
| 897 | - key: "deactivateDependantExperiments", | |
| 898 | - value: function deactivateDependantExperiments(experimentId) { | |
| 899 | - var _this4 = this; | |
| 900 | - Object.entries(elementorAdminConfig.experiments).forEach(function(_ref2) { | |
| 901 | - var _ref3 = _slicedToArray(_ref2, 2); | |
| 902 | - var id = _ref3[0]; | |
| 903 | - var isDependant = _ref3[1].dependencies.includes(experimentId); | |
| 904 | - var isActive = _this4.getExperimentActualState(id) === STATE_ACTIVE; | |
| 905 | - if (isDependant && isActive) _this4.setExperimentState(id, STATE_INACTIVE); | |
| 906 | - }); | |
| 907 | - } | |
| 908 | - }, | |
| 909 | - { | |
| 910 | - key: "shouldShowDependenciesDialog", | |
| 911 | - value: function shouldShowDependenciesDialog(experimentId) { | |
| 912 | - var dependencies = this.getExperimentDependencies(experimentId); | |
| 913 | - return !this.areAllDependenciesActive(dependencies); | |
| 914 | - } | |
| 915 | - }, | |
| 916 | - { | |
| 917 | - key: "shouldShowDeactivationDialog", | |
| 918 | - value: function shouldShowDeactivationDialog(experimentId) { | |
| 919 | - var getExperimentData = this.getExperimentData(experimentId); | |
| 920 | - var isInitialStateActive = getExperimentData.state === STATE_ACTIVE || getExperimentData.state === STATE_DEFAULT && getExperimentData.default === STATE_ACTIVE; | |
| 921 | - return !!this.getMessage(experimentId, "on_deactivate") && isInitialStateActive; | |
| 922 | - } | |
| 923 | - }, | |
| 924 | - { | |
| 925 | - key: "showDialog", | |
| 926 | - value: function showDialog(dialog) { | |
| 927 | - return elementorCommon.dialogsManager.createWidget("confirm", { | |
| 928 | - id: "e-experiments-messages-dialog", | |
| 929 | - headerMessage: dialog.headerMessage, | |
| 930 | - message: dialog.message, | |
| 931 | - position: { | |
| 932 | - my: "center center", | |
| 933 | - at: "center center" | |
| 934 | - }, | |
| 935 | - strings: { | |
| 936 | - confirm: dialog.strings.confirm, | |
| 937 | - cancel: dialog.strings.cancel | |
| 938 | - }, | |
| 939 | - hide: { | |
| 940 | - onOutsideClick: false, | |
| 941 | - onBackgroundClick: false, | |
| 942 | - onEscKeyPress: false | |
| 943 | - }, | |
| 944 | - onConfirm: dialog.onConfirm, | |
| 945 | - onCancel: dialog.onCancel | |
| 946 | - }).show(); | |
| 947 | - } | |
| 948 | - }, | |
| 949 | - { | |
| 950 | - key: "getSiteLanguageCode", | |
| 951 | - value: function getSiteLanguageCode() { | |
| 952 | - var languageCode = document.querySelector("html").getAttribute("lang"); | |
| 953 | - return languageCode !== null && languageCode !== void 0 ? languageCode : "en"; | |
| 954 | - } | |
| 955 | - }, | |
| 956 | - { | |
| 957 | - key: "formatDependenciesList", | |
| 958 | - value: function formatDependenciesList(dependencies) { | |
| 959 | - var dependenciesTitles = dependencies.map(function(d) { | |
| 960 | - return d.title; | |
| 961 | - }); | |
| 962 | - var languageCode = this.getSiteLanguageCode(); | |
| 963 | - return new Intl.ListFormat(languageCode).format(dependenciesTitles); | |
| 964 | - } | |
| 965 | - }, | |
| 966 | - { | |
| 967 | - key: "showDependenciesDialog", | |
| 968 | - value: function showDependenciesDialog(experimentId) { | |
| 969 | - var _this5 = this; | |
| 970 | - var experimentName = this.getExperimentData(experimentId).title; | |
| 971 | - var dependenciesList = this.formatDependenciesList(this.getExperimentDependencies(experimentId)); | |
| 972 | - var message = (0, _wordpress_i18n.__)("In order to use %1$s, first you need to activate %2$s.", "elementor").replace("%1$s", "<strong>".concat(experimentName, "</strong>")).replace("%2$s", dependenciesList); | |
| 973 | - this.showDialog({ | |
| 974 | - message, | |
| 975 | - headerMessage: (0, _wordpress_i18n.__)("First, activate another experiment.", "elementor"), | |
| 976 | - strings: { | |
| 977 | - confirm: (0, _wordpress_i18n.__)("Activate", "elementor"), | |
| 978 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 979 | - }, | |
| 980 | - onConfirm: function onConfirm() { | |
| 981 | - _this5.getExperimentDependencies(experimentId).forEach(function(dependency) { | |
| 982 | - _this5.setExperimentState(dependency.name, STATE_ACTIVE); | |
| 983 | - }); | |
| 984 | - _this5.elements.submit.click(); | |
| 985 | - }, | |
| 986 | - onCancel: function onCancel() { | |
| 987 | - _this5.setExperimentState(experimentId, STATE_INACTIVE); | |
| 988 | - } | |
| 989 | - }); | |
| 990 | - } | |
| 991 | - }, | |
| 992 | - { | |
| 993 | - key: "showDeactivationDialog", | |
| 994 | - value: function showDeactivationDialog(experimentId) { | |
| 995 | - var _this6 = this; | |
| 996 | - this.showDialog({ | |
| 997 | - message: this.getMessage(experimentId, "on_deactivate"), | |
| 998 | - headerMessage: (0, _wordpress_i18n.__)("Are you sure?", "elementor"), | |
| 999 | - strings: { | |
| 1000 | - confirm: (0, _wordpress_i18n.__)("Deactivate", "elementor"), | |
| 1001 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 1002 | - }, | |
| 1003 | - onConfirm: function onConfirm() { | |
| 1004 | - _this6.setExperimentState(experimentId, STATE_INACTIVE); | |
| 1005 | - _this6.deactivateDependantExperiments(experimentId); | |
| 1006 | - _this6.elements.submit.click(); | |
| 1007 | - }, | |
| 1008 | - onCancel: function onCancel() { | |
| 1009 | - _this6.setExperimentState(experimentId, STATE_ACTIVE); | |
| 1010 | - } | |
| 1011 | - }); | |
| 1012 | - } | |
| 1013 | - }, | |
| 1014 | - { | |
| 1015 | - key: "getMessage", | |
| 1016 | - value: function getMessage(experimentId, messageId) { | |
| 1017 | - var _this$getExperimentDa; | |
| 1018 | - return (_this$getExperimentDa = this.getExperimentData(experimentId)) === null || _this$getExperimentDa === void 0 ? void 0 : _this$getExperimentDa.messages[messageId]; | |
| 1019 | - } | |
| 1020 | - } | |
| 1021 | - ]); | |
| 1022 | - }(); | |
| 444 | +"use strict"; | |
| 445 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 1023 | 446 | |
| 1024 | -//#endregion | |
| 1025 | -//#region \0vite/preload-helper.js | |
| 1026 | - var scriptRel = "modulepreload"; | |
| 1027 | - var assetsURL = function(dep) { | |
| 1028 | - return "/" + dep; | |
| 1029 | - }; | |
| 1030 | - var seen = {}; | |
| 1031 | - var __vitePreload = function preload(baseModule, deps, importerUrl) { | |
| 1032 | - let promise = Promise.resolve(); | |
| 1033 | - if (false && deps && deps.length > 0) { | |
| 1034 | - const links = document.getElementsByTagName("link"); | |
| 1035 | - const cspNonceMeta = document.querySelector("meta[property=csp-nonce]"); | |
| 1036 | - const cspNonce = (cspNonceMeta === null || cspNonceMeta === void 0 ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta === null || cspNonceMeta === void 0 ? void 0 : cspNonceMeta.getAttribute("nonce")); | |
| 1037 | - function allSettled(promises) { | |
| 1038 | - return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({ | |
| 1039 | - status: "fulfilled", | |
| 1040 | - value | |
| 1041 | - }), (reason) => ({ | |
| 1042 | - status: "rejected", | |
| 1043 | - reason | |
| 1044 | - })))); | |
| 1045 | - } | |
| 1046 | - function importMetaResolve(specifier) { | |
| 1047 | - if ({}.resolve) return {}.resolve(specifier); | |
| 1048 | - return new URL( | |
| 1049 | - specifier, | |
| 1050 | - /** #__KEEP__ */ | |
| 1051 | - {}.url | |
| 1052 | - ).href; | |
| 1053 | - } | |
| 1054 | - promise = allSettled(deps.map((dep) => { | |
| 1055 | - dep = assetsURL(dep, importerUrl); | |
| 1056 | - dep = importMetaResolve(dep); | |
| 1057 | - if (dep in seen) return; | |
| 1058 | - seen[dep] = true; | |
| 1059 | - const isCss = dep.endsWith(".css"); | |
| 1060 | - for (let i = links.length - 1; i >= 0; i--) { | |
| 1061 | - const link = links[i]; | |
| 1062 | - if (link.href === dep && (!isCss || link.rel === "stylesheet")) return; | |
| 1063 | - } | |
| 1064 | - const link = document.createElement("link"); | |
| 1065 | - link.rel = isCss ? "stylesheet" : scriptRel; | |
| 1066 | - if (!isCss) link.as = "script"; | |
| 1067 | - link.crossOrigin = ""; | |
| 1068 | - link.href = dep; | |
| 1069 | - if (cspNonce) link.setAttribute("nonce", cspNonce); | |
| 1070 | - document.head.appendChild(link); | |
| 1071 | - if (isCss) return new Promise((res, rej) => { | |
| 1072 | - link.addEventListener("load", res); | |
| 1073 | - link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`))); | |
| 1074 | - }); | |
| 1075 | - })); | |
| 1076 | - } | |
| 1077 | - function handlePreloadError(err) { | |
| 1078 | - const e = new Event("vite:preloadError", { cancelable: true }); | |
| 1079 | - e.payload = err; | |
| 1080 | - window.dispatchEvent(e); | |
| 1081 | - if (!e.defaultPrevented) throw err; | |
| 1082 | - } | |
| 1083 | - return promise.then((res) => { | |
| 1084 | - for (const item of res || []) { | |
| 1085 | - if (item.status !== "rejected") continue; | |
| 1086 | - handlePreloadError(item.reason); | |
| 1087 | - } | |
| 1088 | - return baseModule().catch(handlePreloadError); | |
| 1089 | - }); | |
| 1090 | - }; | |
| 1091 | 447 | |
| 1092 | -//#endregion | |
| 1093 | -//#region core/experiments/assets/js/admin/module.js | |
| 1094 | - function _callSuper$8(t, o, e) { | |
| 1095 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1096 | - } | |
| 1097 | - __name(_callSuper$8, "_callSuper"); | |
| 1098 | - function _isNativeReflectConstruct$8() { | |
| 1099 | - try { | |
| 1100 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1101 | - } catch (t) {} | |
| 1102 | - return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() { | |
| 1103 | - return !!t; | |
| 1104 | - })(); | |
| 1105 | - } | |
| 1106 | - __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct"); | |
| 1107 | - function _superPropGet$2(t, o, e, r) { | |
| 1108 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 1109 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 1110 | - return p.apply(e, t); | |
| 1111 | - } : p; | |
| 1112 | - } | |
| 1113 | - __name(_superPropGet$2, "_superPropGet"); | |
| 1114 | - var ExperimentsModule = /*#__PURE__*/ function(_elementorModules$Vie) { | |
| 1115 | - function ExperimentsModule() { | |
| 1116 | - _classCallCheck(this, ExperimentsModule); | |
| 1117 | - return _callSuper$8(this, ExperimentsModule, arguments); | |
| 1118 | - } | |
| 1119 | - _inherits(ExperimentsModule, _elementorModules$Vie); | |
| 1120 | - return _createClass(ExperimentsModule, [ | |
| 1121 | - { | |
| 1122 | - key: "getDefaultSettings", | |
| 1123 | - value: function getDefaultSettings() { | |
| 1124 | - return { selectors: { | |
| 1125 | - experimentIndicators: ".e-experiment__title__indicator", | |
| 1126 | - experimentForm: "#elementor-settings-form", | |
| 1127 | - experimentSelects: ".e-experiment__select", | |
| 1128 | - experimentsButtons: ".e-experiment__button" | |
| 1129 | - } }; | |
| 1130 | - } | |
| 1131 | - }, | |
| 1132 | - { | |
| 1133 | - key: "getDefaultElements", | |
| 1134 | - value: function getDefaultElements() { | |
| 1135 | - var selectors = this.getSettings().selectors; | |
| 1136 | - return { | |
| 1137 | - $experimentIndicators: jQuery(selectors.experimentIndicators), | |
| 1138 | - $experimentForm: jQuery(selectors.experimentForm), | |
| 1139 | - $experimentSelects: jQuery(selectors.experimentSelects), | |
| 1140 | - $experimentsButtons: jQuery(selectors.experimentsButtons) | |
| 1141 | - }; | |
| 1142 | - } | |
| 1143 | - }, | |
| 1144 | - { | |
| 1145 | - key: "bindEvents", | |
| 1146 | - value: function bindEvents() { | |
| 1147 | - var _this = this; | |
| 1148 | - this.elements.$experimentsButtons.on("click", function(event) { | |
| 1149 | - return _this.onExperimentsButtonsClick(event); | |
| 1150 | - }); | |
| 1151 | - } | |
| 1152 | - }, | |
| 1153 | - { | |
| 1154 | - key: "onExperimentsButtonsClick", | |
| 1155 | - value: function onExperimentsButtonsClick(event) { | |
| 1156 | - var submitButton = jQuery(event.currentTarget); | |
| 1157 | - this.elements.$experimentSelects.val(submitButton.val()); | |
| 1158 | - this.elements.$experimentForm.find("#submit").trigger("click"); | |
| 1159 | - } | |
| 1160 | - }, | |
| 1161 | - { | |
| 1162 | - key: "addTipsy", | |
| 1163 | - value: function addTipsy($element) { | |
| 1164 | - $element.tipsy({ | |
| 1165 | - gravity: "s", | |
| 1166 | - offset: 8, | |
| 1167 | - title: function title() { | |
| 1168 | - return this.getAttribute("data-tooltip"); | |
| 1169 | - } | |
| 1170 | - }); | |
| 1171 | - } | |
| 1172 | - }, | |
| 1173 | - { | |
| 1174 | - key: "addIndicatorsTooltips", | |
| 1175 | - value: function addIndicatorsTooltips() { | |
| 1176 | - var _this2 = this; | |
| 1177 | - this.elements.$experimentIndicators.each(function(index, experimentIndicator) { | |
| 1178 | - return _this2.addTipsy(jQuery(experimentIndicator)); | |
| 1179 | - }); | |
| 1180 | - } | |
| 1181 | - }, | |
| 1182 | - { | |
| 1183 | - key: "onInit", | |
| 1184 | - value: function onInit() { | |
| 1185 | - var _this3 = this; | |
| 1186 | - _superPropGet$2(ExperimentsModule, "onInit", this, 3)([]); | |
| 1187 | - this.experimentsDependency = new ExperimentsMessages({ | |
| 1188 | - selects: this.elements.$experimentSelects.toArray(), | |
| 1189 | - submit: this.elements.$experimentForm.find("#submit").get(0) | |
| 1190 | - }); | |
| 1191 | - this.experimentsDependency.bindEvents(); | |
| 1192 | - if (this.elements.$experimentIndicators.length) __vitePreload(() => import( | |
| 1193 | - /* webpackIgnore: true */ | |
| 1194 | - "".concat(elementorCommon.config.urls.assets, "lib/tipsy/tipsy.min.js?ver=1.0.0") | |
| 1195 | -).then(function() { | |
| 1196 | - return _this3.addIndicatorsTooltips(); | |
| 1197 | - }), void 0); | |
| 1198 | - } | |
| 1199 | - } | |
| 1200 | - ]); | |
| 1201 | - }(elementorModules.ViewModule); | |
| 448 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 449 | +Object.defineProperty(exports, "__esModule", ({ | |
| 450 | + value: true | |
| 451 | +})); | |
| 452 | +exports["default"] = void 0; | |
| 453 | +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 454 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 455 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 456 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 457 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 458 | +var STATE_ACTIVE = 'active'; | |
| 459 | +var STATE_INACTIVE = 'inactive'; | |
| 460 | +var STATE_DEFAULT = 'default'; | |
| 461 | +var ExperimentsDependency = /*#__PURE__*/function () { | |
| 462 | + function ExperimentsDependency(_ref) { | |
| 463 | + var selects = _ref.selects, | |
| 464 | + submit = _ref.submit; | |
| 465 | + (0, _classCallCheck2.default)(this, ExperimentsDependency); | |
| 466 | + (0, _defineProperty2.default)(this, "elements", {}); | |
| 467 | + this.elements = { | |
| 468 | + /** | |
| 469 | + * @type {HTMLSelectElement[]} | |
| 470 | + */ | |
| 471 | + selects: selects, | |
| 472 | + /** | |
| 473 | + * @type {HTMLInputElement} | |
| 474 | + */ | |
| 475 | + submit: submit | |
| 476 | + }; | |
| 477 | + } | |
| 478 | + (0, _createClass2.default)(ExperimentsDependency, [{ | |
| 479 | + key: "bindEvents", | |
| 480 | + value: function bindEvents() { | |
| 481 | + var _this = this; | |
| 482 | + this.elements.selects.forEach(function (select) { | |
| 483 | + select.addEventListener('change', function (e) { | |
| 484 | + return _this.onExperimentStateChange(e); | |
| 485 | + }); | |
| 486 | + }); | |
| 487 | + } | |
| 488 | + }, { | |
| 489 | + key: "onExperimentStateChange", | |
| 490 | + value: function onExperimentStateChange(e) { | |
| 491 | + var experimentId = e.currentTarget.dataset.experimentId, | |
| 492 | + experimentNewState = this.getExperimentActualState(experimentId); | |
| 493 | + switch (experimentNewState) { | |
| 494 | + case STATE_ACTIVE: | |
| 495 | + if (this.shouldShowDependenciesDialog(experimentId)) { | |
| 496 | + this.showDependenciesDialog(experimentId); | |
| 497 | + } | |
| 498 | + break; | |
| 499 | + case STATE_INACTIVE: | |
| 500 | + this.deactivateDependantExperiments(experimentId); | |
| 501 | + break; | |
| 502 | + default: | |
| 503 | + break; | |
| 504 | + } | |
| 505 | + } | |
| 506 | + }, { | |
| 507 | + key: "getExperimentData", | |
| 508 | + value: function getExperimentData(experimentId) { | |
| 509 | + return elementorAdminConfig.experiments[experimentId]; | |
| 510 | + } | |
| 511 | + }, { | |
| 512 | + key: "getExperimentDependencies", | |
| 513 | + value: function getExperimentDependencies(experimentId) { | |
| 514 | + var _this2 = this; | |
| 515 | + return this.getExperimentData(experimentId).dependencies.map(function (dependencyId) { | |
| 516 | + return _this2.getExperimentData(dependencyId); | |
| 517 | + }); | |
| 518 | + } | |
| 519 | + }, { | |
| 520 | + key: "getExperimentSelect", | |
| 521 | + value: function getExperimentSelect(experimentId) { | |
| 522 | + return this.elements.selects.find(function (select) { | |
| 523 | + return select.matches("[data-experiment-id=\"".concat(experimentId, "\"]")); | |
| 524 | + }); | |
| 525 | + } | |
| 526 | + }, { | |
| 527 | + key: "setExperimentState", | |
| 528 | + value: function setExperimentState(experimentId, state) { | |
| 529 | + this.getExperimentSelect(experimentId).value = state; | |
| 530 | + } | |
| 531 | + }, { | |
| 532 | + key: "getExperimentActualState", | |
| 533 | + value: function getExperimentActualState(experimentId) { | |
| 534 | + var state = this.getExperimentSelect(experimentId).value; | |
| 535 | + if (state !== STATE_DEFAULT) { | |
| 536 | + return state; | |
| 537 | + } | |
| 1202 | 538 | |
| 1203 | -//#endregion | |
| 1204 | -//#region core/common/assets/js/utils/environment.js | |
| 1205 | - var matchUserAgent = function matchUserAgent(UserAgentStr) { | |
| 1206 | - return userAgent.indexOf(UserAgentStr) >= 0; | |
| 1207 | - }; | |
| 1208 | - var userAgent = navigator.userAgent; | |
| 1209 | - var isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(" OPR/"); | |
| 1210 | - var isFirefox = matchUserAgent("Firefox"); | |
| 1211 | - var isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function(p) { | |
| 1212 | - return "[object SafariRemoteNotification]" === p.toString(); | |
| 1213 | - }(!window.safari || typeof safari !== "undefined" && safari.pushNotification); | |
| 1214 | - var isIE = /Trident|MSIE/.test(userAgent) && !!document.documentMode; | |
| 1215 | - var isEdge = !isIE && !!window.StyleMedia || matchUserAgent("Edg"); | |
| 1216 | - var isChrome = !!window.chrome && matchUserAgent("Chrome") && !(isEdge || isOpera); | |
| 1217 | - var isBlink = matchUserAgent("Chrome") && !!window.CSS; | |
| 1218 | - var isAppleWebkit = matchUserAgent("AppleWebKit") && !isBlink; | |
| 1219 | - var environment = { | |
| 1220 | - isTouchDevice: "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, | |
| 1221 | - appleWebkit: isAppleWebkit, | |
| 1222 | - blink: isBlink, | |
| 1223 | - chrome: isChrome, | |
| 1224 | - edge: isEdge, | |
| 1225 | - firefox: isFirefox, | |
| 1226 | - ie: isIE, | |
| 1227 | - mac: matchUserAgent("Macintosh"), | |
| 1228 | - opera: isOpera, | |
| 1229 | - safari: isSafari, | |
| 1230 | - webkit: matchUserAgent("AppleWebKit") | |
| 1231 | - }; | |
| 539 | + // Normalize the "default" state to the actual state value. | |
| 540 | + return this.isExperimentActiveByDefault(experimentId) ? STATE_ACTIVE : STATE_INACTIVE; | |
| 541 | + } | |
| 542 | + }, { | |
| 543 | + key: "isExperimentActive", | |
| 544 | + value: function isExperimentActive(experimentId) { | |
| 545 | + return this.getExperimentActualState(experimentId) === STATE_ACTIVE; | |
| 546 | + } | |
| 547 | + }, { | |
| 548 | + key: "isExperimentActiveByDefault", | |
| 549 | + value: function isExperimentActiveByDefault(experimentId) { | |
| 550 | + return this.getExperimentData(experimentId).default === STATE_ACTIVE; | |
| 551 | + } | |
| 552 | + }, { | |
| 553 | + key: "areAllDependenciesActive", | |
| 554 | + value: function areAllDependenciesActive(dependencies) { | |
| 555 | + var _this3 = this; | |
| 556 | + return dependencies.every(function (dependency) { | |
| 557 | + return _this3.isExperimentActive(dependency.name); | |
| 558 | + }); | |
| 559 | + } | |
| 560 | + }, { | |
| 561 | + key: "deactivateDependantExperiments", | |
| 562 | + value: function deactivateDependantExperiments(experimentId) { | |
| 563 | + var _this4 = this; | |
| 564 | + Object.entries(elementorAdminConfig.experiments).forEach(function (_ref2) { | |
| 565 | + var _ref3 = (0, _slicedToArray2.default)(_ref2, 2), | |
| 566 | + id = _ref3[0], | |
| 567 | + experimentData = _ref3[1]; | |
| 568 | + var isDependant = experimentData.dependencies.includes(experimentId); | |
| 569 | + if (isDependant) { | |
| 570 | + _this4.setExperimentState(id, STATE_INACTIVE); | |
| 571 | + } | |
| 572 | + }); | |
| 573 | + } | |
| 574 | + }, { | |
| 575 | + key: "shouldShowDependenciesDialog", | |
| 576 | + value: function shouldShowDependenciesDialog(experimentId) { | |
| 577 | + var dependencies = this.getExperimentDependencies(experimentId); | |
| 578 | + return !this.areAllDependenciesActive(dependencies); | |
| 579 | + } | |
| 580 | + }, { | |
| 581 | + key: "showDependenciesDialog", | |
| 582 | + value: function showDependenciesDialog(experimentId) { | |
| 583 | + var _this5 = this; | |
| 584 | + var experiment = this.getExperimentData(experimentId), | |
| 585 | + dependencies = this.getExperimentDependencies(experimentId); | |
| 586 | + var dependenciesList = this.joinDepenednciesNames(dependencies.map(function (d) { | |
| 587 | + return d.title; | |
| 588 | + }), ', ', ' & '); | |
| 1232 | 589 | |
| 1233 | -//#endregion | |
| 1234 | -//#region assets/dev/js/utils/events.js | |
| 1235 | - var Events = /*#__PURE__*/ function() { | |
| 1236 | - function Events() { | |
| 1237 | - _classCallCheck(this, Events); | |
| 1238 | - } | |
| 1239 | - return _createClass(Events, null, [{ | |
| 1240 | - key: "dispatch", | |
| 1241 | - value: function dispatch(context, event) { | |
| 1242 | - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; | |
| 1243 | - var bcEvent = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; | |
| 1244 | - context = context instanceof jQuery ? context[0] : context; | |
| 1245 | - if (bcEvent) context.dispatchEvent(new CustomEvent(bcEvent, { detail: data })); | |
| 1246 | - context.dispatchEvent(new CustomEvent(event, { detail: data })); | |
| 1247 | - } | |
| 1248 | - }]); | |
| 1249 | - }(); | |
| 590 | + // Translators: %1$s: Experiment title, %2$s: Experiment dependencies list | |
| 591 | + var message = __('In order to use %1$s, first you need to activate %2$s.', 'elementor').replace('%1$s', "<strong>".concat(experiment.title, "</strong>")).replace('%2$s', "<strong>".concat(dependenciesList, "</strong>")); | |
| 592 | + elementorCommon.dialogsManager.createWidget('confirm', { | |
| 593 | + id: 'e-experiments-dependency-dialog', | |
| 594 | + headerMessage: __('First, activate another experiment.', 'elementor'), | |
| 595 | + message: message, | |
| 596 | + position: { | |
| 597 | + my: 'center center', | |
| 598 | + at: 'center center' | |
| 599 | + }, | |
| 600 | + strings: { | |
| 601 | + confirm: __('Activate', 'elementor'), | |
| 602 | + cancel: __('Cancel', 'elementor') | |
| 603 | + }, | |
| 604 | + hide: { | |
| 605 | + onOutsideClick: false, | |
| 606 | + onBackgroundClick: false, | |
| 607 | + onEscKeyPress: false | |
| 608 | + }, | |
| 609 | + onConfirm: function onConfirm() { | |
| 610 | + dependencies.forEach(function (dependency) { | |
| 611 | + _this5.setExperimentState(dependency.name, STATE_ACTIVE); | |
| 612 | + }); | |
| 613 | + _this5.elements.submit.click(); | |
| 614 | + }, | |
| 615 | + onCancel: function onCancel() { | |
| 616 | + _this5.setExperimentState(experimentId, STATE_INACTIVE); | |
| 617 | + } | |
| 618 | + }).show(); | |
| 619 | + } | |
| 620 | + }, { | |
| 621 | + key: "joinDepenednciesNames", | |
| 622 | + value: function joinDepenednciesNames(array, glue) { | |
| 623 | + var finalGlue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; | |
| 624 | + if ('' === finalGlue) { | |
| 625 | + return array.join(glue); | |
| 626 | + } | |
| 627 | + if (!array.length) { | |
| 628 | + return ''; | |
| 629 | + } | |
| 630 | + if (1 === array.length) { | |
| 631 | + return array[0]; | |
| 632 | + } | |
| 633 | + var clone = (0, _toConsumableArray2.default)(array), | |
| 634 | + lastItem = clone.pop(); | |
| 635 | + return clone.join(glue) + finalGlue + lastItem; | |
| 636 | + } | |
| 637 | + }]); | |
| 638 | + return ExperimentsDependency; | |
| 639 | +}(); | |
| 640 | +exports["default"] = ExperimentsDependency; | |
| 1250 | 641 | |
| 1251 | -//#endregion | |
| 1252 | -//#region assets/dev/js/editor/utils/files-upload-handler.js | |
| 1253 | - var FilesUploadHandler = /*#__PURE__*/ function() { | |
| 1254 | - function FilesUploadHandler() { | |
| 1255 | - _classCallCheck(this, FilesUploadHandler); | |
| 1256 | - } | |
| 1257 | - return _createClass(FilesUploadHandler, null, [ | |
| 1258 | - { | |
| 1259 | - key: "isUploadEnabled", | |
| 1260 | - value: function isUploadEnabled(mediaType) { | |
| 1261 | - if (!["svg", "application/json"].includes(mediaType)) return true; | |
| 1262 | - return elementorCommon.config.filesUpload.unfilteredFiles; | |
| 1263 | - } | |
| 1264 | - }, | |
| 1265 | - { | |
| 1266 | - key: "setUploadTypeCaller", | |
| 1267 | - value: function setUploadTypeCaller(frame) { | |
| 1268 | - frame.uploader.uploader.param("uploadTypeCaller", "elementor-wp-media-upload"); | |
| 1269 | - } | |
| 1270 | - }, | |
| 1271 | - { | |
| 1272 | - key: "getUnfilteredFilesNonAdminDialog", | |
| 1273 | - value: function getUnfilteredFilesNonAdminDialog() { | |
| 1274 | - return elementorCommon.dialogsManager.createWidget("alert", { | |
| 1275 | - id: "e-unfiltered-files-disabled-dialog", | |
| 1276 | - headerMessage: (0, _wordpress_i18n.__)("Sorry, you can't upload that file yet", "elementor"), | |
| 1277 | - message: (0, _wordpress_i18n.__)("This is because JSON files may pose a security risk.", "elementor") + "<br><br>" + (0, _wordpress_i18n.__)("To upload them anyway, ask the site administrator to enable unfiltered file uploads.", "elementor"), | |
| 1278 | - strings: { confirm: (0, _wordpress_i18n.__)("Got it", "elementor") } | |
| 1279 | - }); | |
| 1280 | - } | |
| 1281 | - }, | |
| 1282 | - { | |
| 1283 | - key: "getUnfilteredFilesNotEnabledDialog", | |
| 1284 | - value: function getUnfilteredFilesNotEnabledDialog(callback) { | |
| 1285 | - var elementorInstance = window.elementorAdmin || window.elementor; | |
| 1286 | - if (!elementorInstance.config.user.is_administrator) return this.getUnfilteredFilesNonAdminDialog(); | |
| 1287 | - return elementorInstance.helpers.getSimpleDialog("e-enable-unfiltered-files-dialog", (0, _wordpress_i18n.__)("Enable Unfiltered File Uploads", "elementor"), (0, _wordpress_i18n.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.", "elementor"), (0, _wordpress_i18n.__)("Enable", "elementor"), function onConfirm() { | |
| 1288 | - elementorCommon.ajax.addRequest("enable_unfiltered_files_upload", {}, true); | |
| 1289 | - elementorCommon.config.filesUpload.unfilteredFiles = true; | |
| 1290 | - callback(); | |
| 1291 | - }); | |
| 1292 | - } | |
| 1293 | - }, | |
| 1294 | - { | |
| 1295 | - key: "getUnfilteredFilesNotEnabledImportTemplateDialog", | |
| 1296 | - value: function getUnfilteredFilesNotEnabledImportTemplateDialog(callback) { | |
| 1297 | - if (!(window.elementorAdmin || window.elementor).config.user.is_administrator) return this.getUnfilteredFilesNonAdminDialog(); | |
| 1298 | - return elementorCommon.dialogsManager.createWidget("confirm", { | |
| 1299 | - id: "e-enable-unfiltered-files-dialog-import-template", | |
| 1300 | - headerMessage: (0, _wordpress_i18n.__)("Enable Unfiltered File Uploads", "elementor"), | |
| 1301 | - message: (0, _wordpress_i18n.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.", "elementor") + "<br /><br />" + (0, _wordpress_i18n.__)("If you do not enable uploading unfiltered files, any SVG or JSON (including lottie) files used in the uploaded template will not be imported.", "elementor"), | |
| 1302 | - position: { | |
| 1303 | - my: "center center", | |
| 1304 | - at: "center center" | |
| 1305 | - }, | |
| 1306 | - strings: { | |
| 1307 | - confirm: (0, _wordpress_i18n.__)("Enable and Import", "elementor"), | |
| 1308 | - cancel: (0, _wordpress_i18n.__)("Import Without Enabling", "elementor") | |
| 1309 | - }, | |
| 1310 | - onConfirm: function onConfirm() { | |
| 1311 | - elementorCommon.ajax.addRequest("enable_unfiltered_files_upload", { success: function success() { | |
| 1312 | - elementorCommon.config.filesUpload.unfilteredFiles = true; | |
| 1313 | - callback(); | |
| 1314 | - } }, true); | |
| 1315 | - }, | |
| 1316 | - onCancel: function onCancel() { | |
| 1317 | - return callback(); | |
| 1318 | - } | |
| 1319 | - }); | |
| 1320 | - } | |
| 1321 | - } | |
| 1322 | - ]); | |
| 1323 | - }(); | |
| 642 | +/***/ }), | |
| 1324 | 643 | |
| 1325 | -//#endregion | |
| 1326 | -//#region assets/dev/js/admin/new-template/template-controls.js | |
| 1327 | - var TemplateControls = /*#__PURE__*/ function() { | |
| 1328 | - function TemplateControls() { | |
| 1329 | - _classCallCheck(this, TemplateControls); | |
| 1330 | - } | |
| 1331 | - return _createClass(TemplateControls, [ | |
| 1332 | - { | |
| 1333 | - key: "setDynamicControlsVisibility", | |
| 1334 | - value: function setDynamicControlsVisibility(lookupControlIdPrefix, controls) { | |
| 1335 | - if (void 0 === controls) return; | |
| 1336 | - var controlsArray = Object.entries(controls); | |
| 1337 | - for (var _i = 0, _controlsArray = controlsArray; _i < _controlsArray.length; _i++) { | |
| 1338 | - var _controlsArray$_i = _slicedToArray(_controlsArray[_i], 2); | |
| 1339 | - var controlId = _controlsArray$_i[0]; | |
| 1340 | - var controlSettings = _controlsArray$_i[1]; | |
| 1341 | - this.setVisibilityForControl(lookupControlIdPrefix, controlSettings, controlId); | |
| 1342 | - } | |
| 1343 | - } | |
| 1344 | - }, | |
| 1345 | - { | |
| 1346 | - key: "setVisibilityForControl", | |
| 1347 | - value: function setVisibilityForControl(lookupControlIdPrefix, controlSettings, controlId) { | |
| 1348 | - var _controlSettings$cond; | |
| 1349 | - var _this = this; | |
| 1350 | - Object.entries((_controlSettings$cond = controlSettings.conditions) !== null && _controlSettings$cond !== void 0 ? _controlSettings$cond : {}).forEach(function(condition) { | |
| 1351 | - _this.changeVisibilityBasedOnCondition(lookupControlIdPrefix, condition, controlId); | |
| 1352 | - }); | |
| 1353 | - } | |
| 1354 | - }, | |
| 1355 | - { | |
| 1356 | - key: "changeVisibilityBasedOnCondition", | |
| 1357 | - value: function changeVisibilityBasedOnCondition(lookupControlIdPrefix, condition, controlId) { | |
| 1358 | - var _condition = _slicedToArray(condition, 2); | |
| 1359 | - var conditionKey = _condition[0]; | |
| 1360 | - var conditionValue = _condition[1]; | |
| 1361 | - var targetControlWrapper = document.getElementById(lookupControlIdPrefix + controlId + "__wrapper"); | |
| 1362 | - var lookupControl = document.getElementById(lookupControlIdPrefix + conditionKey); | |
| 1363 | - targetControlWrapper.classList.toggle("elementor-hidden", !lookupControl || conditionValue !== lookupControl.value); | |
| 1364 | - } | |
| 1365 | - } | |
| 1366 | - ]); | |
| 1367 | - }(); | |
| 644 | +/***/ "../core/experiments/assets/js/admin/module.js": | |
| 645 | +/*!*****************************************************!*\ | |
| 646 | + !*** ../core/experiments/assets/js/admin/module.js ***! | |
| 647 | + \*****************************************************/ | |
| 648 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1368 | 649 | |
| 1369 | -//#endregion | |
| 1370 | -//#region assets/dev/js/utils/json-upload-warning-message.js | |
| 1371 | - var genericMessageIntroductionKey = "upload_json_warning_generic_message"; | |
| 1372 | - /** | |
| 1373 | - * @type {import('../utils/introduction').default | null} | |
| 1374 | - */ | |
| 1375 | - var genericWarningModal = null; | |
| 1376 | - function showJsonUploadWarningMessageIfNeeded(_ref) { | |
| 1377 | - var introductionMap = _ref.introductionMap; | |
| 1378 | - var IntroductionClass = _ref.IntroductionClass; | |
| 1379 | - var _ref$waitForSetViewed = _ref.waitForSetViewed; | |
| 1380 | - var waitForSetViewed = _ref$waitForSetViewed === void 0 ? false : _ref$waitForSetViewed; | |
| 1381 | - if (!genericWarningModal) genericWarningModal = createGenericWarningModal(IntroductionClass); | |
| 1382 | - genericWarningModal.setIntroductionMap(introductionMap); | |
| 1383 | - if (genericWarningModal.introductionViewed) return Promise.resolve(); | |
| 1384 | - var dialog = genericWarningModal.getDialog(); | |
| 1385 | - return new Promise(function(resolve, reject) { | |
| 1386 | - dialog.onHide = function() { | |
| 1387 | - reject(); | |
| 1388 | - }; | |
| 1389 | - dialog.onConfirm = /*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { | |
| 1390 | - return import_regenerator.default.wrap(function(_context) { | |
| 1391 | - while (1) switch (_context.prev = _context.next) { | |
| 1392 | - case 0: | |
| 1393 | - if (!dialog.getElements("checkbox-dont-show-again").prop("checked")) { | |
| 1394 | - _context.next = 3; | |
| 1395 | - break; | |
| 1396 | - } | |
| 1397 | - if (!waitForSetViewed) { | |
| 1398 | - _context.next = 2; | |
| 1399 | - break; | |
| 1400 | - } | |
| 1401 | - _context.next = 1; | |
| 1402 | - return genericWarningModal.setViewed(); | |
| 1403 | - case 1: | |
| 1404 | - _context.next = 3; | |
| 1405 | - break; | |
| 1406 | - case 2: genericWarningModal.setViewed(); | |
| 1407 | - case 3: | |
| 1408 | - resolve(); | |
| 1409 | - dialog.hide(); | |
| 1410 | - case 4: | |
| 1411 | - case "end": return _context.stop(); | |
| 1412 | - } | |
| 1413 | - }, _callee); | |
| 1414 | - })); | |
| 1415 | - dialog.onCancel = function() { | |
| 1416 | - dialog.hide(); | |
| 1417 | - }; | |
| 1418 | - genericWarningModal.show(); | |
| 1419 | - }); | |
| 1420 | - } | |
| 1421 | - /** | |
| 1422 | - * @param {import('../utils/introduction').default.prototype.constructor} IntroductionClass | |
| 1423 | - * | |
| 1424 | - * @return {import('../utils/introduction').default} | |
| 1425 | - */ | |
| 1426 | - function createGenericWarningModal(IntroductionClass) { | |
| 1427 | - var _introduction$getDial; | |
| 1428 | - var _introduction$getDial2; | |
| 1429 | - var dialogId = "e-generic-warning-modal-for-json-upload"; | |
| 1430 | - var introduction = new IntroductionClass({ | |
| 1431 | - introductionKey: genericMessageIntroductionKey, | |
| 1432 | - dialogType: "confirm", | |
| 1433 | - dialogOptions: { | |
| 1434 | - id: dialogId, | |
| 1435 | - headerMessage: (0, _wordpress_i18n.__)("Warning: JSON files may be unsafe", "elementor"), | |
| 1436 | - message: (0, _wordpress_i18n.__)("Uploading JSON files from unknown sources can be harmful and put your site at risk. For maximum safety, only install JSON files from trusted sources.", "elementor"), | |
| 1437 | - effects: { | |
| 1438 | - show: "fadeIn", | |
| 1439 | - hide: "fadeOut" | |
| 1440 | - }, | |
| 1441 | - hide: { | |
| 1442 | - onBackgroundClick: true, | |
| 1443 | - onButtonClick: false | |
| 1444 | - }, | |
| 1445 | - strings: { | |
| 1446 | - confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), | |
| 1447 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 1448 | - } | |
| 1449 | - } | |
| 1450 | - }); | |
| 1451 | - var _createCheckboxAndLab = createCheckboxAndLabel(dialogId); | |
| 1452 | - var checkbox = _createCheckboxAndLab.checkbox; | |
| 1453 | - var label = _createCheckboxAndLab.label; | |
| 1454 | - introduction.getDialog().addElement("checkbox-dont-show-again", checkbox); | |
| 1455 | - (_introduction$getDial = introduction.getDialog().getElements("message")) === null || _introduction$getDial === void 0 || (_introduction$getDial2 = _introduction$getDial.append) === null || _introduction$getDial2 === void 0 || _introduction$getDial2.call(_introduction$getDial, label); | |
| 1456 | - return introduction; | |
| 1457 | - } | |
| 1458 | - function createCheckboxAndLabel(dialogId) { | |
| 1459 | - var checkboxId = "".concat(dialogId, "-dont-show-again"); | |
| 1460 | - var checkbox = document.createElement("input"); | |
| 1461 | - checkbox.type = "checkbox"; | |
| 1462 | - checkbox.name = checkboxId; | |
| 1463 | - checkbox.id = checkboxId; | |
| 1464 | - var label = document.createElement("label"); | |
| 1465 | - label.htmlFor = checkboxId; | |
| 1466 | - label.textContent = (0, _wordpress_i18n.__)("Do not show this message again", "elementor"); | |
| 1467 | - label.style.display = "block"; | |
| 1468 | - label.style.marginTop = "20px"; | |
| 1469 | - label.style.marginBottom = "20px"; | |
| 1470 | - label.prepend(checkbox); | |
| 1471 | - return { | |
| 1472 | - checkbox, | |
| 1473 | - label | |
| 1474 | - }; | |
| 1475 | - } | |
| 650 | +"use strict"; | |
| 1476 | 651 | |
| 1477 | -//#endregion | |
| 1478 | -//#region modules/floating-buttons/assets/js/floating-buttons/admin/floating-buttons.js | |
| 1479 | - function _callSuper$7(t, o, e) { | |
| 1480 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1481 | - } | |
| 1482 | - __name(_callSuper$7, "_callSuper"); | |
| 1483 | - function _isNativeReflectConstruct$7() { | |
| 1484 | - try { | |
| 1485 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1486 | - } catch (t) {} | |
| 1487 | - return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() { | |
| 1488 | - return !!t; | |
| 1489 | - })(); | |
| 1490 | - } | |
| 1491 | - __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct"); | |
| 1492 | - function _superPropGet$1(t, o, e, r) { | |
| 1493 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 1494 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 1495 | - return p.apply(e, t); | |
| 1496 | - } : p; | |
| 1497 | - } | |
| 1498 | - __name(_superPropGet$1, "_superPropGet"); | |
| 1499 | - var FloatingButtonsHandler = /*#__PURE__*/ function(_AdminMenuHandler) { | |
| 1500 | - function FloatingButtonsHandler() { | |
| 1501 | - _classCallCheck(this, FloatingButtonsHandler); | |
| 1502 | - return _callSuper$7(this, FloatingButtonsHandler, arguments); | |
| 1503 | - } | |
| 1504 | - _inherits(FloatingButtonsHandler, _AdminMenuHandler); | |
| 1505 | - return _createClass(FloatingButtonsHandler, [ | |
| 1506 | - { | |
| 1507 | - key: "getDefaultSettings", | |
| 1508 | - value: function getDefaultSettings() { | |
| 1509 | - var pageName = "e-floating-buttons"; | |
| 1510 | - var adminMenuSelectors = { | |
| 1511 | - contactPagesTablePage: "a[href=\"edit.php?post_type=" + pageName + "\"]", | |
| 1512 | - contactPagesAddNewPage: "a[href=\"edit.php?post_type=elementor_library&page=" + pageName + "\"]" | |
| 1513 | - }; | |
| 1514 | - return { selectors: { | |
| 1515 | - addButton: ".page-title-action:first", | |
| 1516 | - templatesMenuItem: ".menu-icon-elementor_library", | |
| 1517 | - contactPagesMenuItem: "".concat(adminMenuSelectors.contactPagesTablePage, ", ").concat(adminMenuSelectors.contactPagesAddNewPage) | |
| 1518 | - } }; | |
| 1519 | - } | |
| 1520 | - }, | |
| 1521 | - { | |
| 1522 | - key: "getDefaultElements", | |
| 1523 | - value: function getDefaultElements() { | |
| 1524 | - var selectors = this.getSettings("selectors"); | |
| 1525 | - var elements = _superPropGet$1(FloatingButtonsHandler, "getDefaultElements", this, 3)([]); | |
| 1526 | - elements.$templatesMenuItem = jQuery(selectors.templatesMenuItem); | |
| 1527 | - elements.$contactPagesMenuItem = jQuery(selectors.contactPagesMenuItem); | |
| 1528 | - return elements; | |
| 1529 | - } | |
| 1530 | - }, | |
| 1531 | - { | |
| 1532 | - key: "onInit", | |
| 1533 | - value: function onInit() { | |
| 1534 | - var _elementorAdminConfig; | |
| 1535 | - _superPropGet$1(FloatingButtonsHandler, "onInit", this, 3)([]); | |
| 1536 | - var settings = this.getSettings(); | |
| 1537 | - var isContactPagesTablePage = !!window.location.href.includes(settings.paths.contactPagesTablePage); | |
| 1538 | - var isContactPagesTrashPage = !!window.location.href.includes(settings.paths.contactPagesTrashPage); | |
| 1539 | - var isLContactPagesCreateYourFirstPage = !!window.location.href.includes(settings.paths.contactPagesAddNewPage); | |
| 1540 | - if ((_elementorAdminConfig = elementorAdminConfig.urls) !== null && _elementorAdminConfig !== void 0 && _elementorAdminConfig.viewContactPageUrl) this.elements.$templatesMenuItem.find("li.submenu-e-contact a").attr("href", elementorAdminConfig.urls.viewContactPageUrl); | |
| 1541 | - if (isContactPagesTablePage || isContactPagesTrashPage || isLContactPagesCreateYourFirstPage) { | |
| 1542 | - this.highlightTopLevelMenuItem(this.elements.$templatesMenuItem, this.elements.$pagesMenuItemAndLink); | |
| 1543 | - this.highlightSubMenuItem(this.elements.$contactPagesMenuItem); | |
| 1544 | - jQuery(settings.selectors.addButton).attr("href", elementorAdminConfig.urls.addNewLinkUrlContact); | |
| 1545 | - } | |
| 1546 | - } | |
| 1547 | - } | |
| 1548 | - ]); | |
| 1549 | - }(MenuHandler); | |
| 1550 | 652 | |
| 1551 | -//#endregion | |
| 1552 | -//#region modules/floating-buttons/assets/js/floating-buttons/admin/module.js | |
| 1553 | - function _callSuper$6(t, o, e) { | |
| 1554 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1555 | - } | |
| 1556 | - __name(_callSuper$6, "_callSuper"); | |
| 1557 | - function _isNativeReflectConstruct$6() { | |
| 1558 | - try { | |
| 1559 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1560 | - } catch (t) {} | |
| 1561 | - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { | |
| 1562 | - return !!t; | |
| 1563 | - })(); | |
| 1564 | - } | |
| 1565 | - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct"); | |
| 1566 | - var _default = /*#__PURE__*/ function(_elementorModules$Mod) { | |
| 1567 | - function _default() { | |
| 1568 | - var _this; | |
| 1569 | - _classCallCheck(this, _default); | |
| 1570 | - _this = _callSuper$6(this, _default); | |
| 1571 | - elementorCommon.elements.$window.on("elementor/admin/init", function() { | |
| 1572 | - _this.runHandler(); | |
| 1573 | - }); | |
| 1574 | - return _this; | |
| 1575 | - } | |
| 1576 | - _inherits(_default, _elementorModules$Mod); | |
| 1577 | - return _createClass(_default, [{ | |
| 1578 | - key: "runHandler", | |
| 1579 | - value: function runHandler() { | |
| 1580 | - var pageNameContact = "e-floating-buttons"; | |
| 1581 | - new FloatingButtonsHandler({ paths: { | |
| 1582 | - contactPagesTablePage: "edit.php?post_type=" + pageNameContact, | |
| 1583 | - contactPagesAddNewPage: "edit.php?post_type=elementor_library&page=" + pageNameContact, | |
| 1584 | - contactPagesTrashPage: "edit.php?post_status=trash&post_type=" + pageNameContact | |
| 1585 | - } }); | |
| 1586 | - } | |
| 1587 | - }]); | |
| 1588 | - }(elementorModules.Module); | |
| 653 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 654 | +Object.defineProperty(exports, "__esModule", ({ | |
| 655 | + value: true | |
| 656 | +})); | |
| 657 | +exports["default"] = void 0; | |
| 658 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 659 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 660 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 661 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 662 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 663 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 664 | +var _experimentsDependency = _interopRequireDefault(__webpack_require__(/*! ./behaviors/experiments-dependency */ "../core/experiments/assets/js/admin/behaviors/experiments-dependency.js")); | |
| 665 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 666 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 667 | +var ExperimentsModule = /*#__PURE__*/function (_elementorModules$Vie) { | |
| 668 | + (0, _inherits2.default)(ExperimentsModule, _elementorModules$Vie); | |
| 669 | + var _super = _createSuper(ExperimentsModule); | |
| 670 | + function ExperimentsModule() { | |
| 671 | + (0, _classCallCheck2.default)(this, ExperimentsModule); | |
| 672 | + return _super.apply(this, arguments); | |
| 673 | + } | |
| 674 | + (0, _createClass2.default)(ExperimentsModule, [{ | |
| 675 | + key: "getDefaultSettings", | |
| 676 | + value: function getDefaultSettings() { | |
| 677 | + return { | |
| 678 | + selectors: { | |
| 679 | + experimentIndicators: '.e-experiment__title__indicator', | |
| 680 | + experimentForm: '#elementor-settings-form', | |
| 681 | + experimentSelects: '.e-experiment__select', | |
| 682 | + experimentsButtons: '.e-experiment__button' | |
| 683 | + } | |
| 684 | + }; | |
| 685 | + } | |
| 686 | + }, { | |
| 687 | + key: "getDefaultElements", | |
| 688 | + value: function getDefaultElements() { | |
| 689 | + var _this$getSettings = this.getSettings(), | |
| 690 | + selectors = _this$getSettings.selectors; | |
| 691 | + return { | |
| 692 | + $experimentIndicators: jQuery(selectors.experimentIndicators), | |
| 693 | + $experimentForm: jQuery(selectors.experimentForm), | |
| 694 | + $experimentSelects: jQuery(selectors.experimentSelects), | |
| 695 | + $experimentsButtons: jQuery(selectors.experimentsButtons) | |
| 696 | + }; | |
| 697 | + } | |
| 698 | + }, { | |
| 699 | + key: "bindEvents", | |
| 700 | + value: function bindEvents() { | |
| 701 | + var _this = this; | |
| 702 | + this.elements.$experimentsButtons.on('click', function (event) { | |
| 703 | + return _this.onExperimentsButtonsClick(event); | |
| 704 | + }); | |
| 705 | + } | |
| 706 | + }, { | |
| 707 | + key: "onExperimentsButtonsClick", | |
| 708 | + value: function onExperimentsButtonsClick(event) { | |
| 709 | + var submitButton = jQuery(event.currentTarget); | |
| 710 | + this.elements.$experimentSelects.val(submitButton.val()); | |
| 711 | + this.elements.$experimentForm.find('#submit').trigger('click'); | |
| 712 | + } | |
| 713 | + }, { | |
| 714 | + key: "addTipsy", | |
| 715 | + value: function addTipsy($element) { | |
| 716 | + $element.tipsy({ | |
| 717 | + gravity: 's', | |
| 718 | + offset: 8, | |
| 719 | + title: function title() { | |
| 720 | + return this.getAttribute('data-tooltip'); | |
| 721 | + } | |
| 722 | + }); | |
| 723 | + } | |
| 724 | + }, { | |
| 725 | + key: "addIndicatorsTooltips", | |
| 726 | + value: function addIndicatorsTooltips() { | |
| 727 | + var _this2 = this; | |
| 728 | + this.elements.$experimentIndicators.each(function (index, experimentIndicator) { | |
| 729 | + return _this2.addTipsy(jQuery(experimentIndicator)); | |
| 730 | + }); | |
| 731 | + } | |
| 732 | + }, { | |
| 733 | + key: "onInit", | |
| 734 | + value: function onInit() { | |
| 735 | + var _this3 = this; | |
| 736 | + (0, _get2.default)((0, _getPrototypeOf2.default)(ExperimentsModule.prototype), "onInit", this).call(this); | |
| 737 | + this.experimentsDependency = new _experimentsDependency.default({ | |
| 738 | + selects: this.elements.$experimentSelects.toArray(), | |
| 739 | + submit: this.elements.$experimentForm.find('#submit').get(0) | |
| 740 | + }); | |
| 741 | + this.experimentsDependency.bindEvents(); | |
| 742 | + if (this.elements.$experimentIndicators.length) { | |
| 743 | + import( /* webpackIgnore: true */"".concat(elementorCommon.config.urls.assets, "lib/tipsy/tipsy.min.js?ver=1.0.0")).then(function () { | |
| 744 | + return _this3.addIndicatorsTooltips(); | |
| 745 | + }); | |
| 746 | + } | |
| 747 | + } | |
| 748 | + }]); | |
| 749 | + return ExperimentsModule; | |
| 750 | +}(elementorModules.ViewModule); | |
| 751 | +exports["default"] = ExperimentsModule; | |
| 1589 | 752 | |
| 1590 | -//#endregion | |
| 1591 | -//#region app/assets/js/event-track/dashboard/base-tracking.js | |
| 1592 | - var BaseTracking = /*#__PURE__*/ function() { | |
| 1593 | - function BaseTracking() { | |
| 1594 | - _classCallCheck(this, BaseTracking); | |
| 1595 | - } | |
| 1596 | - return _createClass(BaseTracking, null, [ | |
| 1597 | - { | |
| 1598 | - key: "ensureOwnArrays", | |
| 1599 | - value: function ensureOwnArrays() { | |
| 1600 | - if (!Object.prototype.hasOwnProperty.call(this, "observers")) this.observers = []; | |
| 1601 | - if (!Object.prototype.hasOwnProperty.call(this, "eventListeners")) this.eventListeners = []; | |
| 1602 | - } | |
| 1603 | - }, | |
| 1604 | - { | |
| 1605 | - key: "destroy", | |
| 1606 | - value: function destroy() { | |
| 1607 | - this.ensureOwnArrays(); | |
| 1608 | - this.observers.forEach(function(observer) { | |
| 1609 | - return observer.disconnect(); | |
| 1610 | - }); | |
| 1611 | - this.observers = []; | |
| 1612 | - this.eventListeners.forEach(function(_ref) { | |
| 1613 | - var target = _ref.target; | |
| 1614 | - var type = _ref.type; | |
| 1615 | - var handler = _ref.handler; | |
| 1616 | - var options = _ref.options; | |
| 1617 | - target.removeEventListener(type, handler, options); | |
| 1618 | - }); | |
| 1619 | - this.eventListeners = []; | |
| 1620 | - } | |
| 1621 | - }, | |
| 1622 | - { | |
| 1623 | - key: "addObserver", | |
| 1624 | - value: function addObserver(target, options, callback) { | |
| 1625 | - this.ensureOwnArrays(); | |
| 1626 | - var observer = new MutationObserver(callback); | |
| 1627 | - observer.observe(target, options); | |
| 1628 | - this.observers.push(observer); | |
| 1629 | - return observer; | |
| 1630 | - } | |
| 1631 | - }, | |
| 1632 | - { | |
| 1633 | - key: "addEventListenerTracked", | |
| 1634 | - value: function addEventListenerTracked(target, type, handler) { | |
| 1635 | - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; | |
| 1636 | - this.ensureOwnArrays(); | |
| 1637 | - target.addEventListener(type, handler, options); | |
| 1638 | - this.eventListeners.push({ | |
| 1639 | - target, | |
| 1640 | - type, | |
| 1641 | - handler, | |
| 1642 | - options | |
| 1643 | - }); | |
| 1644 | - } | |
| 1645 | - } | |
| 1646 | - ]); | |
| 1647 | - }(); | |
| 753 | +/***/ }), | |
| 1648 | 754 | |
| 1649 | -//#endregion | |
| 1650 | -//#region app/assets/js/event-track/dashboard/navigation.js | |
| 1651 | - function _callSuper$5(t, o, e) { | |
| 1652 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1653 | - } | |
| 1654 | - __name(_callSuper$5, "_callSuper"); | |
| 1655 | - function _isNativeReflectConstruct$5() { | |
| 1656 | - try { | |
| 1657 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1658 | - } catch (t) {} | |
| 1659 | - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { | |
| 1660 | - return !!t; | |
| 1661 | - })(); | |
| 1662 | - } | |
| 1663 | - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct"); | |
| 1664 | - var ELEMENTOR_MENU_SELECTORS = { | |
| 1665 | - ELEMENTOR_TOP_LEVEL: "li#toplevel_page_elementor", | |
| 1666 | - TEMPLATES_TOP_LEVEL: "li#menu-posts-elementor_library", | |
| 1667 | - ELEMENTOR_HOME_TOP_LEVEL: "li#toplevel_page_elementor-home", | |
| 1668 | - ADMIN_MENU: "#adminmenu", | |
| 1669 | - TOP_LEVEL_LINK: ".wp-menu-name", | |
| 1670 | - SUBMENU_CONTAINER: ".wp-submenu", | |
| 1671 | - SUBMENU_ITEM: ".wp-submenu li a", | |
| 1672 | - SUBMENU_ITEM_TOP_LEVEL: ".wp-has-submenu", | |
| 1673 | - SIDEBAR_NAVIGATION: "#editor-one-sidebar-navigation" | |
| 1674 | - }; | |
| 1675 | - var NavigationTracking = /*#__PURE__*/ function(_BaseTracking) { | |
| 1676 | - function NavigationTracking() { | |
| 1677 | - _classCallCheck(this, NavigationTracking); | |
| 1678 | - return _callSuper$5(this, NavigationTracking, arguments); | |
| 1679 | - } | |
| 1680 | - _inherits(NavigationTracking, _BaseTracking); | |
| 1681 | - return _createClass(NavigationTracking, null, [ | |
| 1682 | - { | |
| 1683 | - key: "init", | |
| 1684 | - value: function init() { | |
| 1685 | - if (WpDashboardTracking.isEditorOneActive()) { | |
| 1686 | - this.attachSidebarNavigationTracking(); | |
| 1687 | - this.attachElementorHomeMenuTracking(); | |
| 1688 | - } else { | |
| 1689 | - this.attachElementorMenuTracking(); | |
| 1690 | - this.attachTemplatesMenuTracking(); | |
| 1691 | - } | |
| 1692 | - } | |
| 1693 | - }, | |
| 1694 | - { | |
| 1695 | - key: "attachTemplatesMenuTracking", | |
| 1696 | - value: function attachTemplatesMenuTracking() { | |
| 1697 | - var templatesMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.TEMPLATES_TOP_LEVEL); | |
| 1698 | - if (!templatesMenu) return; | |
| 1699 | - this.attachMenuTracking(templatesMenu, "Templates"); | |
| 1700 | - } | |
| 1701 | - }, | |
| 1702 | - { | |
| 1703 | - key: "attachElementorHomeMenuTracking", | |
| 1704 | - value: function attachElementorHomeMenuTracking() { | |
| 1705 | - var elementorHomeMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_HOME_TOP_LEVEL); | |
| 1706 | - if (!elementorHomeMenu) return; | |
| 1707 | - this.attachMenuTracking(elementorHomeMenu, "Elementor"); | |
| 1708 | - } | |
| 1709 | - }, | |
| 1710 | - { | |
| 1711 | - key: "attachElementorMenuTracking", | |
| 1712 | - value: function attachElementorMenuTracking() { | |
| 1713 | - var elementorMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_TOP_LEVEL); | |
| 1714 | - if (!elementorMenu) return; | |
| 1715 | - this.attachMenuTracking(elementorMenu, "Elementor"); | |
| 1716 | - } | |
| 1717 | - }, | |
| 1718 | - { | |
| 1719 | - key: "attachSidebarNavigationTracking", | |
| 1720 | - value: function attachSidebarNavigationTracking() { | |
| 1721 | - var sidebar = document.querySelector(ELEMENTOR_MENU_SELECTORS.SIDEBAR_NAVIGATION); | |
| 1722 | - if (sidebar) this.attachSidebarClickListener(sidebar); | |
| 1723 | - } | |
| 1724 | - }, | |
| 1725 | - { | |
| 1726 | - key: "attachSidebarClickListener", | |
| 1727 | - value: function attachSidebarClickListener(sidebar) { | |
| 1728 | - var _this = this; | |
| 1729 | - this.addEventListenerTracked(sidebar, "click", function(event) { | |
| 1730 | - _this.handleSidebarClick(event); | |
| 1731 | - }, { capture: true }); | |
| 1732 | - } | |
| 1733 | - }, | |
| 1734 | - { | |
| 1735 | - key: "attachMenuTracking", | |
| 1736 | - value: function attachMenuTracking(menuElement, menuName) { | |
| 1737 | - var _this2 = this; | |
| 1738 | - this.addEventListenerTracked(menuElement, "click", function(event) { | |
| 1739 | - _this2.handleMenuClick(event, menuName); | |
| 1740 | - }); | |
| 1741 | - } | |
| 1742 | - }, | |
| 1743 | - { | |
| 1744 | - key: "handleMenuClick", | |
| 1745 | - value: function handleMenuClick(event, menuName) { | |
| 1746 | - var link = event.target.closest("a"); | |
| 1747 | - if (!link) return; | |
| 1748 | - var isTopLevel = link.classList.contains("menu-top"); | |
| 1749 | - var itemId = this.extractItemId(link); | |
| 1750 | - var area = this.determineNavArea(link); | |
| 1751 | - WpDashboardTracking.trackNavClicked(itemId, isTopLevel ? null : menuName, area); | |
| 1752 | - } | |
| 1753 | - }, | |
| 1754 | - { | |
| 1755 | - key: "handleSidebarClick", | |
| 1756 | - value: function handleSidebarClick(event) { | |
| 1757 | - var clickedElement = event.target.closest("a, button, [role=\"button\"]"); | |
| 1758 | - if (!clickedElement) return; | |
| 1759 | - var itemId = this.extractSidebarItemId(clickedElement); | |
| 1760 | - WpDashboardTracking.trackNavClicked(itemId, null, NAV_AREAS.SIDEBAR_MENU); | |
| 1761 | - } | |
| 1762 | - }, | |
| 1763 | - { | |
| 1764 | - key: "extractSidebarItemId", | |
| 1765 | - value: function extractSidebarItemId(element) { | |
| 1766 | - var paragraph = element.querySelector("p"); | |
| 1767 | - if (paragraph) return paragraph.textContent.trim(); | |
| 1768 | - var textContent = element.textContent.trim(); | |
| 1769 | - if (textContent) return textContent; | |
| 1770 | - return "unknown"; | |
| 1771 | - } | |
| 1772 | - }, | |
| 1773 | - { | |
| 1774 | - key: "extractPageFromUrl", | |
| 1775 | - value: function extractPageFromUrl(href) { | |
| 1776 | - var urlParams = new URLSearchParams(href.split("?")[1] || ""); | |
| 1777 | - var page = urlParams.get("page"); | |
| 1778 | - if (page) return page; | |
| 1779 | - var postType = urlParams.get("post_type"); | |
| 1780 | - if (postType) return postType; | |
| 1781 | - return "unknown"; | |
| 1782 | - } | |
| 1783 | - }, | |
| 1784 | - { | |
| 1785 | - key: "extractItemId", | |
| 1786 | - value: function extractItemId(link) { | |
| 1787 | - var textContent = link.textContent.trim(); | |
| 1788 | - if (textContent) return textContent; | |
| 1789 | - var href = link.getAttribute("href"); | |
| 1790 | - if (href) return this.extractPageFromUrl(href); | |
| 1791 | - var linkId = link.getAttribute("id"); | |
| 1792 | - if (linkId) return linkId; | |
| 1793 | - return "unknown"; | |
| 1794 | - } | |
| 1795 | - }, | |
| 1796 | - { | |
| 1797 | - key: "determineNavArea", | |
| 1798 | - value: function determineNavArea(link) { | |
| 1799 | - if (link.closest("li.menu-top")) { | |
| 1800 | - if (link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_CONTAINER)) { | |
| 1801 | - if (link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_ITEM_TOP_LEVEL).classList.contains("wp-not-current-submenu")) return NAV_AREAS.HOVER_MENU; | |
| 1802 | - return NAV_AREAS.SUBMENU; | |
| 1803 | - } | |
| 1804 | - return NAV_AREAS.LEFT_MENU; | |
| 1805 | - } | |
| 1806 | - return NAV_AREAS.LEFT_MENU; | |
| 1807 | - } | |
| 1808 | - } | |
| 1809 | - ]); | |
| 1810 | - }(BaseTracking); | |
| 755 | +/***/ "../modules/landing-pages/assets/js/admin/landing-pages.js": | |
| 756 | +/*!*****************************************************************!*\ | |
| 757 | + !*** ../modules/landing-pages/assets/js/admin/landing-pages.js ***! | |
| 758 | + \*****************************************************************/ | |
| 759 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1811 | 760 | |
| 1812 | -//#endregion | |
| 1813 | -//#region app/assets/js/event-track/dashboard/plugin-actions.js | |
| 1814 | - function _callSuper$4(t, o, e) { | |
| 1815 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1816 | - } | |
| 1817 | - __name(_callSuper$4, "_callSuper"); | |
| 1818 | - function _isNativeReflectConstruct$4() { | |
| 1819 | - try { | |
| 1820 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1821 | - } catch (t) {} | |
| 1822 | - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { | |
| 1823 | - return !!t; | |
| 1824 | - })(); | |
| 1825 | - } | |
| 1826 | - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct"); | |
| 1827 | - var PLUGIN_TYPE = { | |
| 1828 | - ELEMENTOR: "core", | |
| 1829 | - ELEMENTOR_PRO: "pro" | |
| 1830 | - }; | |
| 1831 | - var PluginActions = /*#__PURE__*/ function(_BaseTracking) { | |
| 1832 | - function PluginActions() { | |
| 1833 | - _classCallCheck(this, PluginActions); | |
| 1834 | - return _callSuper$4(this, PluginActions, arguments); | |
| 1835 | - } | |
| 1836 | - _inherits(PluginActions, _BaseTracking); | |
| 1837 | - return _createClass(PluginActions, null, [ | |
| 1838 | - { | |
| 1839 | - key: "init", | |
| 1840 | - value: function init() { | |
| 1841 | - this.attachCoreDeactivationTracking(); | |
| 1842 | - this.attachProDeactivationTracking(); | |
| 1843 | - this.attachProDeletionTracking(); | |
| 1844 | - } | |
| 1845 | - }, | |
| 1846 | - { | |
| 1847 | - key: "attachCoreDeactivationTracking", | |
| 1848 | - value: function attachCoreDeactivationTracking() { | |
| 1849 | - var _this = this; | |
| 1850 | - var dialogForm = document.querySelector("#elementor-deactivate-feedback-dialog-form"); | |
| 1851 | - if (!dialogForm) return; | |
| 1852 | - this.addEventListenerTracked(dialogForm, "change", function(event) { | |
| 1853 | - var target = event.target; | |
| 1854 | - if (target.classList.contains("elementor-deactivate-feedback-dialog-input")) _this.selectedReason = target.value; | |
| 1855 | - }); | |
| 1856 | - this.observeModalButtons(); | |
| 1857 | - } | |
| 1858 | - }, | |
| 1859 | - { | |
| 1860 | - key: "attachProDeactivationTracking", | |
| 1861 | - value: function attachProDeactivationTracking() { | |
| 1862 | - var _this2 = this; | |
| 1863 | - var pluginsTable = document.querySelector(".plugins"); | |
| 1864 | - if (!pluginsTable) return; | |
| 1865 | - this.addEventListenerTracked(pluginsTable, "click", function(event) { | |
| 1866 | - var link = event.target.closest("a"); | |
| 1867 | - if (link && "deactivate-elementor-pro" === link.id) _this2.trackProDeactivation(); | |
| 1868 | - }, { capture: true }); | |
| 1869 | - } | |
| 1870 | - }, | |
| 1871 | - { | |
| 1872 | - key: "observeModalButtons", | |
| 1873 | - value: function observeModalButtons() { | |
| 1874 | - var _this3 = this; | |
| 1875 | - var checkAndAttachDelegation = function checkAndAttachDelegation() { | |
| 1876 | - var modal = document.querySelector("#elementor-deactivate-feedback-modal"); | |
| 1877 | - if (!modal) return false; | |
| 1878 | - _this3.addEventListenerTracked(modal, "click", function(event) { | |
| 1879 | - var submitButton = event.target.closest(".dialog-submit"); | |
| 1880 | - var skipButton = event.target.closest(".dialog-skip"); | |
| 1881 | - if (submitButton) _this3.trackCoreDeactivation("submit&deactivate"); | |
| 1882 | - else if (skipButton) _this3.trackCoreDeactivation("skip&deactivate"); | |
| 1883 | - }, { capture: true }); | |
| 1884 | - return true; | |
| 1885 | - }; | |
| 1886 | - if (checkAndAttachDelegation()) return; | |
| 1887 | - this.addObserver(document.body, { | |
| 1888 | - childList: true, | |
| 1889 | - subtree: true | |
| 1890 | - }, function(mutations, observer) { | |
| 1891 | - if (checkAndAttachDelegation()) observer.disconnect(); | |
| 1892 | - }); | |
| 1893 | - } | |
| 1894 | - }, | |
| 1895 | - { | |
| 1896 | - key: "getUserInput", | |
| 1897 | - value: function getUserInput() { | |
| 1898 | - if (!this.selectedReason || !["found_a_better_plugin", "other"].includes(this.selectedReason)) return null; | |
| 1899 | - var inputField = document.querySelector("input[name=\"reason_".concat(this.selectedReason, "\"]")); | |
| 1900 | - if (inputField && inputField.value) return inputField.value; | |
| 1901 | - return null; | |
| 1902 | - } | |
| 1903 | - }, | |
| 1904 | - { | |
| 1905 | - key: "trackCoreDeactivation", | |
| 1906 | - value: function trackCoreDeactivation(action) { | |
| 1907 | - var properties = { | |
| 1908 | - deactivate_form_submit: action, | |
| 1909 | - deactivate_plugin_type: PLUGIN_TYPE.ELEMENTOR | |
| 1910 | - }; | |
| 1911 | - if (this.selectedReason) properties.deactivate_feedback_reason = this.selectedReason; | |
| 1912 | - var userInput = this.getUserInput(); | |
| 1913 | - if (userInput) properties.deactivate_feedback_reason += "/".concat(userInput); | |
| 1914 | - WpDashboardTracking.dispatchEvent("wpdash_deactivate_plugin", properties, { send_immediately: true }); | |
| 1915 | - } | |
| 1916 | - }, | |
| 1917 | - { | |
| 1918 | - key: "trackProDeactivation", | |
| 1919 | - value: function trackProDeactivation() { | |
| 1920 | - this.trackProAction("deactivate"); | |
| 1921 | - } | |
| 1922 | - }, | |
| 1923 | - { | |
| 1924 | - key: "attachProDeletionTracking", | |
| 1925 | - value: function attachProDeletionTracking() { | |
| 1926 | - var _this4 = this; | |
| 1927 | - if ("undefined" === typeof jQuery) return; | |
| 1928 | - jQuery(document).on("wp-plugin-deleting", function(event, args) { | |
| 1929 | - if ("elementor-pro" === (args === null || args === void 0 ? void 0 : args.slug)) _this4.trackProAction("delete"); | |
| 1930 | - }); | |
| 1931 | - } | |
| 1932 | - }, | |
| 1933 | - { | |
| 1934 | - key: "destroy", | |
| 1935 | - value: function destroy() { | |
| 1936 | - if ("undefined" !== typeof jQuery) jQuery(document).off("wp-plugin-deleting"); | |
| 1937 | - BaseTracking.destroy.call(this); | |
| 1938 | - } | |
| 1939 | - }, | |
| 1940 | - { | |
| 1941 | - key: "trackProAction", | |
| 1942 | - value: function trackProAction(action) { | |
| 1943 | - var config = { | |
| 1944 | - deactivate: { | |
| 1945 | - eventName: "wpdash_deactivate_plugin", | |
| 1946 | - propertyKey: "deactivate_plugin_type" | |
| 1947 | - }, | |
| 1948 | - delete: { | |
| 1949 | - eventName: "wpdash_delete_plugin", | |
| 1950 | - propertyKey: "plugin_delete" | |
| 1951 | - } | |
| 1952 | - }[action]; | |
| 1953 | - if (!config) return; | |
| 1954 | - var properties = _defineProperty({}, config.propertyKey, PLUGIN_TYPE.ELEMENTOR_PRO); | |
| 1955 | - WpDashboardTracking.dispatchEvent(config.eventName, properties, { send_immediately: true }); | |
| 1956 | - } | |
| 1957 | - } | |
| 1958 | - ]); | |
| 1959 | - }(BaseTracking); | |
| 1960 | - _defineProperty(PluginActions, "selectedReason", null); | |
| 761 | +"use strict"; | |
| 1961 | 762 | |
| 1962 | -//#endregion | |
| 1963 | -//#region app/assets/js/event-track/dashboard/promotion.js | |
| 1964 | - function _callSuper$3(t, o, e) { | |
| 1965 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1966 | - } | |
| 1967 | - __name(_callSuper$3, "_callSuper"); | |
| 1968 | - function _isNativeReflectConstruct$3() { | |
| 1969 | - try { | |
| 1970 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1971 | - } catch (t) {} | |
| 1972 | - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { | |
| 1973 | - return !!t; | |
| 1974 | - })(); | |
| 1975 | - } | |
| 1976 | - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); | |
| 1977 | - var PROMO_SELECTORS = { | |
| 1978 | - PROMO_PAGE: ".e-feature-promotion, .elementor-settings-form-page, #elementor-element-manager-wrap", | |
| 1979 | - PROMO_BLANK_STATE: ".elementor-blank_state", | |
| 1980 | - CTA_BUTTON: ".go-pro", | |
| 1981 | - TITLE: "h3" | |
| 1982 | - }; | |
| 1983 | - var PromotionTracking = /*#__PURE__*/ function(_BaseTracking) { | |
| 1984 | - function PromotionTracking() { | |
| 1985 | - _classCallCheck(this, PromotionTracking); | |
| 1986 | - return _callSuper$3(this, PromotionTracking, arguments); | |
| 1987 | - } | |
| 1988 | - _inherits(PromotionTracking, _BaseTracking); | |
| 1989 | - return _createClass(PromotionTracking, null, [ | |
| 1990 | - { | |
| 1991 | - key: "init", | |
| 1992 | - value: function init() { | |
| 1993 | - this.attachDelegatedTracking(); | |
| 1994 | - } | |
| 1995 | - }, | |
| 1996 | - { | |
| 1997 | - key: "attachDelegatedTracking", | |
| 1998 | - value: function attachDelegatedTracking() { | |
| 1999 | - var _this = this; | |
| 2000 | - this.addEventListenerTracked(document, "click", function(event) { | |
| 2001 | - var target = event.target; | |
| 2002 | - if (!target) return; | |
| 2003 | - var button = target.closest("a".concat(PROMO_SELECTORS.CTA_BUTTON)); | |
| 2004 | - if (!button) return; | |
| 2005 | - var promoPage = button.closest("".concat(PROMO_SELECTORS.PROMO_PAGE, ", ").concat(PROMO_SELECTORS.PROMO_BLANK_STATE)); | |
| 2006 | - if (!promoPage) return; | |
| 2007 | - _this.handlePromoClick(button, promoPage); | |
| 2008 | - }, { capture: true }); | |
| 2009 | - } | |
| 2010 | - }, | |
| 2011 | - { | |
| 2012 | - key: "handlePromoClick", | |
| 2013 | - value: function handlePromoClick(button, promoPage) { | |
| 2014 | - var promoTitle = this.extractPromoTitle(promoPage, button); | |
| 2015 | - var destination = button.getAttribute("href"); | |
| 2016 | - var path = this.extractPromoPath(); | |
| 2017 | - WpDashboardTracking.trackPromoClicked(promoTitle, destination, path); | |
| 2018 | - } | |
| 2019 | - }, | |
| 2020 | - { | |
| 2021 | - key: "extractPromoTitle", | |
| 2022 | - value: function extractPromoTitle(promoPage, button) { | |
| 2023 | - var titleElement = promoPage.querySelector(PROMO_SELECTORS.TITLE); | |
| 2024 | - return titleElement ? titleElement.textContent.trim() : button.textContent.trim(); | |
| 2025 | - } | |
| 2026 | - }, | |
| 2027 | - { | |
| 2028 | - key: "extractPromoPath", | |
| 2029 | - value: function extractPromoPath() { | |
| 2030 | - var page = new URLSearchParams(window.location.search).get("page"); | |
| 2031 | - if (!page) return "elementor"; | |
| 2032 | - return page.replace("elementor_", "").replace(/_/g, "/"); | |
| 2033 | - } | |
| 2034 | - } | |
| 2035 | - ]); | |
| 2036 | - }(BaseTracking); | |
| 2037 | 763 | |
| 2038 | -//#endregion | |
| 2039 | -//#region app/assets/js/event-track/dashboard/utils.js | |
| 2040 | - var DashboardUtils = { isElementorPage: function isElementorPage() { | |
| 2041 | - var urlParams = new URLSearchParams(window.location.search); | |
| 2042 | - var page = urlParams.get("page"); | |
| 2043 | - if (page && WpDashboardTracking.elementorPages.some(function(p) { | |
| 2044 | - return page.includes(p); | |
| 2045 | - })) return true; | |
| 2046 | - var postType = urlParams.get("post_type"); | |
| 2047 | - if (WpDashboardTracking.elementorPostTypes.includes(postType)) return true; | |
| 2048 | - return document.body.className.split(" ").some(function(cls) { | |
| 2049 | - return cls.includes("elementor") && (cls.includes("page") || cls.includes("post-type")); | |
| 2050 | - }); | |
| 2051 | - } }; | |
| 764 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 765 | +Object.defineProperty(exports, "__esModule", ({ | |
| 766 | + value: true | |
| 767 | +})); | |
| 768 | +exports["default"] = void 0; | |
| 769 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 770 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 771 | +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 772 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 773 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 774 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 775 | +var _menuHandler = _interopRequireDefault(__webpack_require__(/*! elementor-admin/menu-handler */ "../assets/dev/js/admin/menu-handler.js")); | |
| 776 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 777 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 778 | +var LandingPagesHandler = /*#__PURE__*/function (_AdminMenuHandler) { | |
| 779 | + (0, _inherits2.default)(LandingPagesHandler, _AdminMenuHandler); | |
| 780 | + var _super = _createSuper(LandingPagesHandler); | |
| 781 | + function LandingPagesHandler() { | |
| 782 | + (0, _classCallCheck2.default)(this, LandingPagesHandler); | |
| 783 | + return _super.apply(this, arguments); | |
| 784 | + } | |
| 785 | + (0, _createClass2.default)(LandingPagesHandler, [{ | |
| 786 | + key: "getDefaultSettings", | |
| 787 | + value: function getDefaultSettings() { | |
| 788 | + var pageName = 'e-landing-page', | |
| 789 | + adminMenuSelectors = { | |
| 790 | + // The escaping is done because jQuery requires it for selectors. | |
| 791 | + landingPagesTablePage: 'a[href="edit.php?post_type=' + pageName + '"]', | |
| 792 | + landingPagesAddNewPage: 'a[href="edit.php?post_type=elementor_library&page=' + pageName + '"]' | |
| 793 | + }; | |
| 794 | + return { | |
| 795 | + selectors: { | |
| 796 | + addButton: '.page-title-action:first', | |
| 797 | + pagesMenuItemAndLink: '#menu-pages, #menu-pages > a', | |
| 798 | + landingPagesMenuItem: "".concat(adminMenuSelectors.landingPagesTablePage, ", ").concat(adminMenuSelectors.landingPagesAddNewPage), | |
| 799 | + templatesMenuItem: '.menu-icon-elementor_library' | |
| 800 | + } | |
| 801 | + }; | |
| 802 | + } | |
| 803 | + }, { | |
| 804 | + key: "getDefaultElements", | |
| 805 | + value: function getDefaultElements() { | |
| 806 | + var selectors = this.getSettings('selectors'), | |
| 807 | + elements = (0, _get2.default)((0, _getPrototypeOf2.default)(LandingPagesHandler.prototype), "getDefaultElements", this).call(this); | |
| 808 | + elements.$landingPagesMenuItem = jQuery(selectors.landingPagesMenuItem); | |
| 809 | + elements.$templatesMenuItem = jQuery(selectors.templatesMenuItem); | |
| 810 | + elements.$pagesMenuItemAndLink = jQuery(selectors.pagesMenuItemAndLink); | |
| 811 | + return elements; | |
| 812 | + } | |
| 813 | + }, { | |
| 814 | + key: "onInit", | |
| 815 | + value: function onInit() { | |
| 816 | + (0, _get2.default)((0, _getPrototypeOf2.default)(LandingPagesHandler.prototype), "onInit", this).call(this); | |
| 817 | + var settings = this.getSettings(), | |
| 818 | + isLandingPagesTablePage = !!window.location.href.includes(settings.paths.landingPagesTablePage), | |
| 819 | + isLandingPagesTrashPage = !!window.location.href.includes(settings.paths.landingPagesTrashPage), | |
| 820 | + isLandingPagesCreateYourFirstPage = !!window.location.href.includes(settings.paths.landingPagesAddNewPage); | |
| 2052 | 821 | |
| 2053 | -//#endregion | |
| 2054 | -//#region app/assets/js/event-track/dashboard/screen-view.js | |
| 2055 | - function _createForOfIteratorHelper$1(r, e) { | |
| 2056 | - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 2057 | - if (!t) { | |
| 2058 | - if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { | |
| 2059 | - t && (r = t); | |
| 2060 | - var _n = 0; | |
| 2061 | - var F = function F() {}; | |
| 2062 | - return { | |
| 2063 | - s: F, | |
| 2064 | - n: function n() { | |
| 2065 | - return _n >= r.length ? { done: !0 } : { | |
| 2066 | - done: !1, | |
| 2067 | - value: r[_n++] | |
| 2068 | - }; | |
| 2069 | - }, | |
| 2070 | - e: function e(r) { | |
| 2071 | - throw r; | |
| 2072 | - }, | |
| 2073 | - f: F | |
| 2074 | - }; | |
| 2075 | - } | |
| 2076 | - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 2077 | - } | |
| 2078 | - var o; | |
| 2079 | - var a = !0; | |
| 2080 | - var u = !1; | |
| 2081 | - return { | |
| 2082 | - s: function s() { | |
| 2083 | - t = t.call(r); | |
| 2084 | - }, | |
| 2085 | - n: function n() { | |
| 2086 | - var r = t.next(); | |
| 2087 | - return a = r.done, r; | |
| 2088 | - }, | |
| 2089 | - e: function e(r) { | |
| 2090 | - u = !0, o = r; | |
| 2091 | - }, | |
| 2092 | - f: function f() { | |
| 2093 | - try { | |
| 2094 | - a || null == t.return || t.return(); | |
| 2095 | - } finally { | |
| 2096 | - if (u) throw o; | |
| 2097 | - } | |
| 2098 | - } | |
| 2099 | - }; | |
| 2100 | - } | |
| 2101 | - __name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper"); | |
| 2102 | - function _unsupportedIterableToArray$1(r, a) { | |
| 2103 | - if (r) { | |
| 2104 | - if ("string" == typeof r) return _arrayLikeToArray$1(r, a); | |
| 2105 | - var t = {}.toString.call(r).slice(8, -1); | |
| 2106 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; | |
| 2107 | - } | |
| 2108 | - } | |
| 2109 | - __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray"); | |
| 2110 | - function _arrayLikeToArray$1(r, a) { | |
| 2111 | - (null == a || a > r.length) && (a = r.length); | |
| 2112 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 2113 | - return n; | |
| 2114 | - } | |
| 2115 | - __name(_arrayLikeToArray$1, "_arrayLikeToArray"); | |
| 2116 | - function _callSuper$2(t, o, e) { | |
| 2117 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2118 | - } | |
| 2119 | - __name(_callSuper$2, "_callSuper"); | |
| 2120 | - function _isNativeReflectConstruct$2() { | |
| 2121 | - try { | |
| 2122 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2123 | - } catch (t) {} | |
| 2124 | - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { | |
| 2125 | - return !!t; | |
| 2126 | - })(); | |
| 2127 | - } | |
| 2128 | - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); | |
| 2129 | - function _superPropGet(t, o, e, r) { | |
| 2130 | - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 2131 | - return 2 & r && "function" == typeof p ? function(t) { | |
| 2132 | - return p.apply(e, t); | |
| 2133 | - } : p; | |
| 2134 | - } | |
| 2135 | - var SCREEN_SELECTORS = { | |
| 2136 | - NAV_TAB_WRAPPER: ".nav-tab-wrapper", | |
| 2137 | - NAV_TAB: ".nav-tab", | |
| 2138 | - NAV_TAB_ACTIVE: ".nav-tab-active", | |
| 2139 | - SETTINGS_FORM_PAGE: ".elementor-settings-form-page", | |
| 2140 | - SETTINGS_FORM_PAGE_ACTIVE: ".elementor-settings-form-page.elementor-active", | |
| 2141 | - FLOATING_ELEMENTS_MODAL: "#elementor-new-floating-elements-modal", | |
| 2142 | - TEMPLATE_DIALOG_MODAL: "#elementor-new-template-dialog-content" | |
| 2143 | - }; | |
| 2144 | - var TRACKED_MODALS = [SCREEN_SELECTORS.FLOATING_ELEMENTS_MODAL, SCREEN_SELECTORS.TEMPLATE_DIALOG_MODAL]; | |
| 2145 | - var ScreenViewTracking = /*#__PURE__*/ function(_BaseTracking) { | |
| 2146 | - function ScreenViewTracking() { | |
| 2147 | - _classCallCheck(this, ScreenViewTracking); | |
| 2148 | - return _callSuper$2(this, ScreenViewTracking, arguments); | |
| 2149 | - } | |
| 2150 | - _inherits(ScreenViewTracking, _BaseTracking); | |
| 2151 | - return _createClass(ScreenViewTracking, null, [ | |
| 2152 | - { | |
| 2153 | - key: "init", | |
| 2154 | - value: function init() { | |
| 2155 | - if (!DashboardUtils.isElementorPage()) return; | |
| 2156 | - var screenData = this.getScreenData(); | |
| 2157 | - if (screenData) this.trackScreen(screenData.screenId, screenData.screenType); | |
| 2158 | - this.attachTabChangeTracking(); | |
| 2159 | - } | |
| 2160 | - }, | |
| 2161 | - { | |
| 2162 | - key: "destroy", | |
| 2163 | - value: function destroy() { | |
| 2164 | - _superPropGet(ScreenViewTracking, "destroy", this, 2)([]); | |
| 2165 | - this.trackedScreens.clear(); | |
| 2166 | - } | |
| 2167 | - }, | |
| 2168 | - { | |
| 2169 | - key: "getScreenData", | |
| 2170 | - value: function getScreenData() { | |
| 2171 | - var urlParams = new URLSearchParams(window.location.search); | |
| 2172 | - var page = urlParams.get("page"); | |
| 2173 | - var postType = urlParams.get("post_type"); | |
| 2174 | - var hash = window.location.hash; | |
| 2175 | - var screenId = ""; | |
| 2176 | - var screenType = ""; | |
| 2177 | - if (page) screenId = page; | |
| 2178 | - else if (postType) screenId = postType; | |
| 2179 | - else screenId = this.getScreenIdFromBody(); | |
| 2180 | - if (this.isElementorAppPage()) { | |
| 2181 | - var appScreenData = this.getAppScreenData(hash); | |
| 2182 | - if (appScreenData) return appScreenData; | |
| 2183 | - } | |
| 2184 | - var hasNavTabs = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 2185 | - var hasSettingsTabs = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE).length > 1; | |
| 2186 | - if (hasNavTabs || hasSettingsTabs || hash && !this.isElementorAppPage()) { | |
| 2187 | - screenType = SCREEN_TYPES.TAB; | |
| 2188 | - if (hash) { | |
| 2189 | - var tabId = hash.replace(/^#(tab-)?/, ""); | |
| 2190 | - screenId = "".concat(screenId, "-").concat(tabId); | |
| 2191 | - } else if (hasNavTabs) { | |
| 2192 | - var activeTab = document.querySelector(SCREEN_SELECTORS.NAV_TAB_ACTIVE); | |
| 2193 | - if (activeTab) { | |
| 2194 | - var tabText = activeTab.textContent.trim(); | |
| 2195 | - var tabHref = activeTab.getAttribute("href"); | |
| 2196 | - if (tabText) screenId = "".concat(screenId, "-").concat(this.sanitizeScreenId(tabText)); | |
| 2197 | - else if (tabHref && tabHref.includes("#")) { | |
| 2198 | - var _tabId = tabHref.split("#")[1]; | |
| 2199 | - screenId = "".concat(screenId, "-").concat(_tabId); | |
| 2200 | - } | |
| 2201 | - } | |
| 2202 | - } else if (hasSettingsTabs) { | |
| 2203 | - var activeSettingsTab = document.querySelector(SCREEN_SELECTORS.SETTINGS_FORM_PAGE_ACTIVE); | |
| 2204 | - if (activeSettingsTab) { | |
| 2205 | - var _tabId2 = activeSettingsTab.id; | |
| 2206 | - if (_tabId2) screenId = "".concat(screenId, "-").concat(_tabId2); | |
| 2207 | - } | |
| 2208 | - } | |
| 2209 | - } | |
| 2210 | - return { | |
| 2211 | - screenId, | |
| 2212 | - screenType | |
| 2213 | - }; | |
| 2214 | - } | |
| 2215 | - }, | |
| 2216 | - { | |
| 2217 | - key: "isElementorAppPage", | |
| 2218 | - value: function isElementorAppPage() { | |
| 2219 | - return "elementor-app" === new URLSearchParams(window.location.search).get("page"); | |
| 2220 | - } | |
| 2221 | - }, | |
| 2222 | - { | |
| 2223 | - key: "getAppScreenData", | |
| 2224 | - value: function getAppScreenData(hash) { | |
| 2225 | - if (!hash) return null; | |
| 2226 | - var cleanHash = hash.replace(/^#/, ""); | |
| 2227 | - if (!cleanHash.startsWith("/")) return null; | |
| 2228 | - var pathParts = cleanHash.split("/").filter(Boolean); | |
| 2229 | - if (0 === pathParts.length) return null; | |
| 2230 | - return { | |
| 2231 | - screenId: pathParts.join("/"), | |
| 2232 | - screenType: SCREEN_TYPES.APP_SCREEN | |
| 2233 | - }; | |
| 2234 | - } | |
| 2235 | - }, | |
| 2236 | - { | |
| 2237 | - key: "getScreenIdFromBody", | |
| 2238 | - value: function getScreenIdFromBody() { | |
| 2239 | - var _iterator = _createForOfIteratorHelper$1(document.body.className.split(" ")); | |
| 2240 | - var _step; | |
| 2241 | - try { | |
| 2242 | - for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 2243 | - var cls = _step.value; | |
| 2244 | - if (cls.startsWith("elementor") && (cls.includes("page") || cls.includes("post-type"))) return cls; | |
| 2245 | - } | |
| 2246 | - } catch (err) { | |
| 2247 | - _iterator.e(err); | |
| 2248 | - } finally { | |
| 2249 | - _iterator.f(); | |
| 2250 | - } | |
| 2251 | - return "elementor-unknown"; | |
| 2252 | - } | |
| 2253 | - }, | |
| 2254 | - { | |
| 2255 | - key: "sanitizeScreenId", | |
| 2256 | - value: function sanitizeScreenId(text) { | |
| 2257 | - return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""); | |
| 2258 | - } | |
| 2259 | - }, | |
| 2260 | - { | |
| 2261 | - key: "attachTabChangeTracking", | |
| 2262 | - value: function attachTabChangeTracking() { | |
| 2263 | - this.attachNavTabTracking(); | |
| 2264 | - this.attachHashChangeTracking(); | |
| 2265 | - this.attachSettingsTabTracking(); | |
| 2266 | - this.attachModalTracking(); | |
| 2267 | - } | |
| 2268 | - }, | |
| 2269 | - { | |
| 2270 | - key: "attachNavTabTracking", | |
| 2271 | - value: function attachNavTabTracking() { | |
| 2272 | - var _this = this; | |
| 2273 | - var wrapper = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 2274 | - if (!wrapper) return; | |
| 2275 | - this.addEventListenerTracked(wrapper, "click", function(event) { | |
| 2276 | - var navTab = event.target.closest(SCREEN_SELECTORS.NAV_TAB); | |
| 2277 | - if (navTab && !navTab.classList.contains("nav-tab-active")) { | |
| 2278 | - var screenData = _this.getScreenData(); | |
| 2279 | - if (screenData) _this.trackScreen(screenData.screenId, screenData.screenType); | |
| 2280 | - } | |
| 2281 | - }); | |
| 2282 | - } | |
| 2283 | - }, | |
| 2284 | - { | |
| 2285 | - key: "attachHashChangeTracking", | |
| 2286 | - value: function attachHashChangeTracking() { | |
| 2287 | - var _this2 = this; | |
| 2288 | - this.addEventListenerTracked(window, "hashchange", function() { | |
| 2289 | - var screenData = _this2.getScreenData(); | |
| 2290 | - if (screenData) _this2.trackScreen(screenData.screenId, screenData.screenType); | |
| 2291 | - }); | |
| 2292 | - } | |
| 2293 | - }, | |
| 2294 | - { | |
| 2295 | - key: "attachSettingsTabTracking", | |
| 2296 | - value: function attachSettingsTabTracking() { | |
| 2297 | - var _this3 = this; | |
| 2298 | - var settingsPages = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE); | |
| 2299 | - if (0 === settingsPages.length) return; | |
| 2300 | - settingsPages.forEach(function(page) { | |
| 2301 | - _this3.addObserver(page, { | |
| 2302 | - attributes: true, | |
| 2303 | - attributeFilter: ["class"] | |
| 2304 | - }, function() { | |
| 2305 | - var screenData = _this3.getScreenData(); | |
| 2306 | - if (screenData) _this3.trackScreen(screenData.screenId, screenData.screenType); | |
| 2307 | - }); | |
| 2308 | - }); | |
| 2309 | - } | |
| 2310 | - }, | |
| 2311 | - { | |
| 2312 | - key: "attachModalTracking", | |
| 2313 | - value: function attachModalTracking() { | |
| 2314 | - var _this4 = this; | |
| 2315 | - this.addObserver(document.body, { | |
| 2316 | - childList: true, | |
| 2317 | - subtree: true | |
| 2318 | - }, function(mutations) { | |
| 2319 | - var _iterator2 = _createForOfIteratorHelper$1(mutations); | |
| 2320 | - var _step2; | |
| 2321 | - try { | |
| 2322 | - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) if ("childList" === _step2.value.type) TRACKED_MODALS.forEach(function(modalSelector) { | |
| 2323 | - var modal = document.querySelector(modalSelector); | |
| 2324 | - if (modal && _this4.isModalVisible(modal)) { | |
| 2325 | - var modalId = modalSelector.replace("#", ""); | |
| 2326 | - _this4.trackScreen(modalId, SCREEN_TYPES.POPUP); | |
| 2327 | - } | |
| 2328 | - }); | |
| 2329 | - } catch (err) { | |
| 2330 | - _iterator2.e(err); | |
| 2331 | - } finally { | |
| 2332 | - _iterator2.f(); | |
| 2333 | - } | |
| 2334 | - }); | |
| 2335 | - } | |
| 2336 | - }, | |
| 2337 | - { | |
| 2338 | - key: "isModalVisible", | |
| 2339 | - value: function isModalVisible(element) { | |
| 2340 | - if (!element) return false; | |
| 2341 | - var style = window.getComputedStyle(element); | |
| 2342 | - return "none" !== style.display && 0 !== parseFloat(style.opacity); | |
| 2343 | - } | |
| 2344 | - }, | |
| 2345 | - { | |
| 2346 | - key: "trackScreen", | |
| 2347 | - value: function trackScreen(screenId) { | |
| 2348 | - var screenType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : SCREEN_TYPES.TOP_LEVEL_PAGE; | |
| 2349 | - var trackingKey = "".concat(screenId, "-").concat(screenType); | |
| 2350 | - if (this.trackedScreens.has(trackingKey)) return; | |
| 2351 | - this.trackedScreens.add(trackingKey); | |
| 2352 | - WpDashboardTracking.trackScreenViewed(screenId, screenType); | |
| 2353 | - } | |
| 2354 | - } | |
| 2355 | - ]); | |
| 2356 | - }(BaseTracking); | |
| 2357 | - _defineProperty(ScreenViewTracking, "trackedScreens", /* @__PURE__ */ new Set()); | |
| 822 | + // If the current page is a Landing Pages Page (the Posts Table page, "Create Your First.." page, or a native | |
| 823 | + // WordPress dashboard page edit screen when using WordPress' Classic Editor). | |
| 824 | + if (isLandingPagesTablePage || isLandingPagesTrashPage || isLandingPagesCreateYourFirstPage || settings.isLandingPageAdminEdit) { | |
| 825 | + // Make sure the active admin top level menu item is 'Templates', and not 'Pages'. | |
| 826 | + this.highlightTopLevelMenuItem(this.elements.$templatesMenuItem, this.elements.$pagesMenuItemAndLink); | |
| 827 | + this.highlightSubMenuItem(this.elements.$landingPagesMenuItem); | |
| 2358 | 828 | |
| 2359 | -//#endregion | |
| 2360 | -//#region app/assets/js/event-track/dashboard/menu-promotion.js | |
| 2361 | - function _callSuper$1(t, o, e) { | |
| 2362 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2363 | - } | |
| 2364 | - __name(_callSuper$1, "_callSuper"); | |
| 2365 | - function _isNativeReflectConstruct$1() { | |
| 2366 | - try { | |
| 2367 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2368 | - } catch (t) {} | |
| 2369 | - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { | |
| 2370 | - return !!t; | |
| 2371 | - })(); | |
| 2372 | - } | |
| 2373 | - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); | |
| 2374 | - var PROMO_MENU_ITEMS = { | |
| 2375 | - go_elementor_pro: "Upgrade", | |
| 2376 | - "elementor-one-upgrade": "Upgrade" | |
| 2377 | - }; | |
| 2378 | - var MenuPromotionTracking = /*#__PURE__*/ function(_BaseTracking) { | |
| 2379 | - function MenuPromotionTracking() { | |
| 2380 | - _classCallCheck(this, MenuPromotionTracking); | |
| 2381 | - return _callSuper$1(this, MenuPromotionTracking, arguments); | |
| 2382 | - } | |
| 2383 | - _inherits(MenuPromotionTracking, _BaseTracking); | |
| 2384 | - return _createClass(MenuPromotionTracking, null, [ | |
| 2385 | - { | |
| 2386 | - key: "init", | |
| 2387 | - value: function init() { | |
| 2388 | - this.attachDelegatedTracking(); | |
| 2389 | - } | |
| 2390 | - }, | |
| 2391 | - { | |
| 2392 | - key: "attachDelegatedTracking", | |
| 2393 | - value: function attachDelegatedTracking() { | |
| 2394 | - var _this = this; | |
| 2395 | - this.addEventListenerTracked(document, "click", function(event) { | |
| 2396 | - var target = event.target; | |
| 2397 | - if (!target) return; | |
| 2398 | - var link = target.closest("a"); | |
| 2399 | - if (!link) return; | |
| 2400 | - var href = link.getAttribute("href"); | |
| 2401 | - if (!href) return; | |
| 2402 | - var menuItemKey = _this.extractPromoMenuKey(href); | |
| 2403 | - if (!menuItemKey) return; | |
| 2404 | - _this.handleMenuPromoClick(link, menuItemKey); | |
| 2405 | - }, { capture: true }); | |
| 2406 | - } | |
| 2407 | - }, | |
| 2408 | - { | |
| 2409 | - key: "extractPromoMenuKey", | |
| 2410 | - value: function extractPromoMenuKey(href) { | |
| 2411 | - for (var _i = 0, _Object$keys = Object.keys(PROMO_MENU_ITEMS); _i < _Object$keys.length; _i++) { | |
| 2412 | - var menuItemKey = _Object$keys[_i]; | |
| 2413 | - if (href.includes("page=".concat(menuItemKey))) return menuItemKey; | |
| 2414 | - } | |
| 2415 | - return null; | |
| 2416 | - } | |
| 2417 | - }, | |
| 2418 | - { | |
| 2419 | - key: "handleMenuPromoClick", | |
| 2420 | - value: function handleMenuPromoClick(menuItem, menuItemKey) { | |
| 2421 | - var destination = menuItem.getAttribute("href"); | |
| 2422 | - var promoName = PROMO_MENU_ITEMS[menuItemKey]; | |
| 2423 | - var path = menuItemKey.replace("elementor_", "").replace(/_/g, "/"); | |
| 2424 | - WpDashboardTracking.trackPromoClicked(promoName, destination, path); | |
| 2425 | - } | |
| 2426 | - } | |
| 2427 | - ]); | |
| 2428 | - }(BaseTracking); | |
| 829 | + // Overwrite the 'Add New' button at the top of the page to open in Elementor with the library module open. | |
| 830 | + jQuery(settings.selectors.addButton).attr('href', elementorAdminConfig.urls.addNewLandingPageUrl); | |
| 831 | + } | |
| 832 | + } | |
| 833 | + }]); | |
| 834 | + return LandingPagesHandler; | |
| 835 | +}(_menuHandler.default); | |
| 836 | +exports["default"] = LandingPagesHandler; | |
| 2429 | 837 | |
| 2430 | -//#endregion | |
| 2431 | -//#region app/assets/js/event-track/dashboard/action-controls.js | |
| 2432 | - function _createForOfIteratorHelper(r, e) { | |
| 2433 | - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 2434 | - if (!t) { | |
| 2435 | - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { | |
| 2436 | - t && (r = t); | |
| 2437 | - var _n = 0; | |
| 2438 | - var F = function F() {}; | |
| 2439 | - return { | |
| 2440 | - s: F, | |
| 2441 | - n: function n() { | |
| 2442 | - return _n >= r.length ? { done: !0 } : { | |
| 2443 | - done: !1, | |
| 2444 | - value: r[_n++] | |
| 2445 | - }; | |
| 2446 | - }, | |
| 2447 | - e: function e(r) { | |
| 2448 | - throw r; | |
| 2449 | - }, | |
| 2450 | - f: F | |
| 2451 | - }; | |
| 2452 | - } | |
| 2453 | - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 2454 | - } | |
| 2455 | - var o; | |
| 2456 | - var a = !0; | |
| 2457 | - var u = !1; | |
| 2458 | - return { | |
| 2459 | - s: function s() { | |
| 2460 | - t = t.call(r); | |
| 2461 | - }, | |
| 2462 | - n: function n() { | |
| 2463 | - var r = t.next(); | |
| 2464 | - return a = r.done, r; | |
| 2465 | - }, | |
| 2466 | - e: function e(r) { | |
| 2467 | - u = !0, o = r; | |
| 2468 | - }, | |
| 2469 | - f: function f() { | |
| 2470 | - try { | |
| 2471 | - a || null == t.return || t.return(); | |
| 2472 | - } finally { | |
| 2473 | - if (u) throw o; | |
| 2474 | - } | |
| 2475 | - } | |
| 2476 | - }; | |
| 2477 | - } | |
| 2478 | - function _unsupportedIterableToArray(r, a) { | |
| 2479 | - if (r) { | |
| 2480 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 2481 | - var t = {}.toString.call(r).slice(8, -1); | |
| 2482 | - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; | |
| 2483 | - } | |
| 2484 | - } | |
| 2485 | - function _arrayLikeToArray(r, a) { | |
| 2486 | - (null == a || a > r.length) && (a = r.length); | |
| 2487 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 2488 | - return n; | |
| 2489 | - } | |
| 2490 | - function _callSuper(t, o, e) { | |
| 2491 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2492 | - } | |
| 2493 | - function _isNativeReflectConstruct() { | |
| 2494 | - try { | |
| 2495 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2496 | - } catch (t) {} | |
| 2497 | - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 2498 | - return !!t; | |
| 2499 | - })(); | |
| 2500 | - } | |
| 2501 | - var EXCLUDED_SELECTORS = { | |
| 2502 | - ADMIN_MENU: "#adminmenu", | |
| 2503 | - TOP_BAR: ".e-admin-top-bar", | |
| 2504 | - TOP_BAR_EDITOR_ONE: "#editor-one-top-bar", | |
| 2505 | - WP_ADMIN_BAR: "#wpadminbar", | |
| 2506 | - SUBMENU: ".wp-submenu", | |
| 2507 | - PROMO_PAGE: ".e-feature-promotion", | |
| 2508 | - PROMO_BLANK_STATE: ".elementor-blank_state", | |
| 2509 | - APP: ".e-app", | |
| 2510 | - SIDEBAR_NAVIGATION: "#editor-one-sidebar-navigation", | |
| 2511 | - FLYOUT_MENU: ".elementor-submenu-flyout" | |
| 2512 | - }; | |
| 2513 | - var ActionControlTracking = /*#__PURE__*/ function(_BaseTracking) { | |
| 2514 | - function ActionControlTracking() { | |
| 2515 | - _classCallCheck(this, ActionControlTracking); | |
| 2516 | - return _callSuper(this, ActionControlTracking, arguments); | |
| 2517 | - } | |
| 2518 | - _inherits(ActionControlTracking, _BaseTracking); | |
| 2519 | - return _createClass(ActionControlTracking, null, [ | |
| 2520 | - { | |
| 2521 | - key: "init", | |
| 2522 | - value: function init() { | |
| 2523 | - if (!DashboardUtils.isElementorPage()) return; | |
| 2524 | - this.attachDelegatedHandlers(); | |
| 2525 | - this.addTrackingAttributesToFilterButtons(); | |
| 2526 | - this.initializeLinkDataIds(); | |
| 2527 | - } | |
| 2528 | - }, | |
| 2529 | - { | |
| 2530 | - key: "initializeLinkDataIds", | |
| 2531 | - value: function initializeLinkDataIds() { | |
| 2532 | - var _this = this; | |
| 2533 | - var initializeLinks = function initializeLinks() { | |
| 2534 | - document.querySelectorAll("a[href]").forEach(function(link) { | |
| 2535 | - if (_this.isExcludedElement(link) || _this.isNavigationLink(link) || link.hasAttribute("data-id")) return; | |
| 2536 | - var href = link.getAttribute("href"); | |
| 2537 | - if (!href) return; | |
| 2538 | - var cleanedHref = _this.removeNonceFromUrl(href); | |
| 2539 | - if (cleanedHref) link.setAttribute("data-id", cleanedHref); | |
| 2540 | - }); | |
| 2541 | - }; | |
| 2542 | - if ("loading" === document.readyState) document.addEventListener("DOMContentLoaded", initializeLinks); | |
| 2543 | - else initializeLinks(); | |
| 2544 | - } | |
| 2545 | - }, | |
| 2546 | - { | |
| 2547 | - key: "addTrackingAttributesToFilterButtons", | |
| 2548 | - value: function addTrackingAttributesToFilterButtons() { | |
| 2549 | - var body = document.body; | |
| 2550 | - if (!body) return; | |
| 2551 | - var screenPrefix = ""; | |
| 2552 | - switch (true) { | |
| 2553 | - case body.classList.contains("post-type-elementor_library"): | |
| 2554 | - screenPrefix = "elementor_library-library"; | |
| 2555 | - break; | |
| 2556 | - case body.classList.contains("post-type-e-floating-buttons"): | |
| 2557 | - screenPrefix = "e-floating-buttons"; | |
| 2558 | - break; | |
| 2559 | - default: return; | |
| 2560 | - } | |
| 2561 | - var addDataIdToListTableButtons = function addDataIdToListTableButtons() { | |
| 2562 | - [ | |
| 2563 | - { | |
| 2564 | - id: "post-query-submit", | |
| 2565 | - suffix: "filter" | |
| 2566 | - }, | |
| 2567 | - { | |
| 2568 | - id: "search-submit", | |
| 2569 | - suffix: "search" | |
| 2570 | - }, | |
| 2571 | - { | |
| 2572 | - id: "doaction", | |
| 2573 | - suffix: "apply" | |
| 2574 | - }, | |
| 2575 | - { | |
| 2576 | - id: "doaction2", | |
| 2577 | - suffix: "apply-bottom" | |
| 2578 | - } | |
| 2579 | - ].forEach(function(config) { | |
| 2580 | - var button = document.getElementById(config.id); | |
| 2581 | - if (!button || button.hasAttribute("data-id")) return; | |
| 2582 | - button.setAttribute("data-id", "".concat(screenPrefix, "-button-").concat(config.suffix)); | |
| 2583 | - }); | |
| 2584 | - }; | |
| 2585 | - if ("loading" === document.readyState) document.addEventListener("DOMContentLoaded", addDataIdToListTableButtons); | |
| 2586 | - else addDataIdToListTableButtons(); | |
| 2587 | - } | |
| 2588 | - }, | |
| 2589 | - { | |
| 2590 | - key: "isExcludedElement", | |
| 2591 | - value: function isExcludedElement(element) { | |
| 2592 | - for (var _i = 0, _Object$values = Object.values(EXCLUDED_SELECTORS); _i < _Object$values.length; _i++) { | |
| 2593 | - var selector = _Object$values[_i]; | |
| 2594 | - if (element.closest(selector)) return true; | |
| 2595 | - } | |
| 2596 | - if (element.classList.contains("go-pro")) return true; | |
| 2597 | - return false; | |
| 2598 | - } | |
| 2599 | - }, | |
| 2600 | - { | |
| 2601 | - key: "attachDelegatedHandlers", | |
| 2602 | - value: function attachDelegatedHandlers() { | |
| 2603 | - var _this2 = this; | |
| 2604 | - var FILTER_BUTTON_IDS = ["search-submit", "post-query-submit"]; | |
| 2605 | - this.addEventListenerTracked(document, "click", function(event) { | |
| 2606 | - var _event$target; | |
| 2607 | - var base = event.target && 1 === event.target.nodeType ? event.target : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.parentElement; | |
| 2608 | - if (!base) return; | |
| 2609 | - var toggle = base.closest(".elementor-role-toggle"); | |
| 2610 | - if (toggle && !_this2.isExcludedElement(toggle)) { | |
| 2611 | - _this2.trackControl(toggle, CONTROL_TYPES.TOGGLE); | |
| 2612 | - return; | |
| 2613 | - } | |
| 2614 | - var button = base.closest("button, input[type=\"submit\"], input[type=\"button\"], .button, .e-btn"); | |
| 2615 | - if (button && !_this2.isExcludedElement(button)) { | |
| 2616 | - if (FILTER_BUTTON_IDS.includes(button.id)) { | |
| 2617 | - _this2.trackControl(button, CONTROL_TYPES.FILTER); | |
| 2618 | - return; | |
| 2619 | - } | |
| 2620 | - _this2.trackControl(button, CONTROL_TYPES.BUTTON); | |
| 2621 | - return; | |
| 2622 | - } | |
| 2623 | - var link = base.closest("a"); | |
| 2624 | - if (link && !_this2.isExcludedElement(link) && !_this2.isNavigationLink(link)) _this2.trackControl(link, CONTROL_TYPES.LINK); | |
| 2625 | - }, { capture: false }); | |
| 2626 | - this.addEventListenerTracked(document, "change", function(event) { | |
| 2627 | - var _event$target2; | |
| 2628 | - var base = event.target && 1 === event.target.nodeType ? event.target : (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.parentElement; | |
| 2629 | - if (!base) return; | |
| 2630 | - var toggle = null; | |
| 2631 | - if (WpDashboardTracking.isEditorOneActive()) toggle = base.closest(".MuiSwitch-switchBase"); | |
| 2632 | - else toggle = base.closest(".components-toggle-control"); | |
| 2633 | - if (toggle && !_this2.isExcludedElement(toggle)) { | |
| 2634 | - _this2.trackControl(toggle, CONTROL_TYPES.TOGGLE); | |
| 2635 | - return; | |
| 2636 | - } | |
| 2637 | - var checkbox = base.closest("input[type=\"checkbox\"]"); | |
| 2638 | - if (checkbox && !_this2.isExcludedElement(checkbox)) { | |
| 2639 | - _this2.trackControl(checkbox, CONTROL_TYPES.CHECKBOX); | |
| 2640 | - return; | |
| 2641 | - } | |
| 2642 | - var radio = base.closest("input[type=\"radio\"]"); | |
| 2643 | - if (radio && !_this2.isExcludedElement(radio)) { | |
| 2644 | - _this2.trackControl(radio, CONTROL_TYPES.RADIO); | |
| 2645 | - return; | |
| 2646 | - } | |
| 2647 | - var select = base.closest("select"); | |
| 2648 | - if (select && !_this2.isExcludedElement(select)) _this2.trackControl(select, CONTROL_TYPES.SELECT); | |
| 2649 | - }); | |
| 2650 | - } | |
| 2651 | - }, | |
| 2652 | - { | |
| 2653 | - key: "isNavigationLink", | |
| 2654 | - value: function isNavigationLink(link) { | |
| 2655 | - var href = link.getAttribute("href"); | |
| 2656 | - if (!href) return false; | |
| 2657 | - if (href.startsWith("#") && href.includes("tab")) return true; | |
| 2658 | - if (link.classList.contains("nav-tab")) return true; | |
| 2659 | - return !!link.closest(".wp-submenu, #adminmenu, .e-admin-top-bar, #wpadminbar"); | |
| 2660 | - } | |
| 2661 | - }, | |
| 2662 | - { | |
| 2663 | - key: "trackControl", | |
| 2664 | - value: function trackControl(element, controlType) { | |
| 2665 | - var controlIdentifier = this.extractControlIdentifier(element, controlType); | |
| 2666 | - if (!controlIdentifier) return; | |
| 2667 | - WpDashboardTracking.trackActionControl(controlIdentifier, controlType); | |
| 2668 | - } | |
| 2669 | - }, | |
| 2670 | - { | |
| 2671 | - key: "extractControlIdentifier", | |
| 2672 | - value: function extractControlIdentifier(element, controlType) { | |
| 2673 | - if (CONTROL_TYPES.RADIO === controlType) { | |
| 2674 | - var name = element.getAttribute("name"); | |
| 2675 | - var value = element.value || element.getAttribute("value"); | |
| 2676 | - if (name && value) return "".concat(name, "-").concat(value); | |
| 2677 | - if (name) return name; | |
| 2678 | - } | |
| 2679 | - if (CONTROL_TYPES.SELECT === controlType) { | |
| 2680 | - var _name = element.getAttribute("name"); | |
| 2681 | - if (_name) return _name; | |
| 2682 | - } | |
| 2683 | - if (CONTROL_TYPES.CHECKBOX === controlType) { | |
| 2684 | - var _name2 = element.getAttribute("name"); | |
| 2685 | - if (_name2) { | |
| 2686 | - if (document.querySelectorAll("input[type=\"checkbox\"][name=\"".concat(CSS.escape(_name2), "\"]")).length > 1) { | |
| 2687 | - var _value = element.value || element.getAttribute("value"); | |
| 2688 | - if (_value) return "".concat(_name2, "-").concat(_value); | |
| 2689 | - } | |
| 2690 | - return _name2; | |
| 2691 | - } | |
| 2692 | - } | |
| 2693 | - if (CONTROL_TYPES.LINK === controlType) { | |
| 2694 | - var dataId = element.getAttribute("data-id"); | |
| 2695 | - if (dataId) return dataId; | |
| 2696 | - var href = element.getAttribute("href"); | |
| 2697 | - if (href) return this.removeNonceFromUrl(href); | |
| 2698 | - } | |
| 2699 | - if (CONTROL_TYPES.BUTTON === controlType || CONTROL_TYPES.TOGGLE === controlType || CONTROL_TYPES.FILTER === controlType) { | |
| 2700 | - var _dataId = element.getAttribute("data-id"); | |
| 2701 | - if (_dataId) return _dataId; | |
| 2702 | - var classIdMatch = this.extractClassId(element); | |
| 2703 | - if (classIdMatch) return classIdMatch; | |
| 2704 | - } | |
| 2705 | - return ""; | |
| 2706 | - } | |
| 2707 | - }, | |
| 2708 | - { | |
| 2709 | - key: "extractClassId", | |
| 2710 | - value: function extractClassId(element) { | |
| 2711 | - var classes = element.className; | |
| 2712 | - if (!classes || "string" !== typeof classes) return ""; | |
| 2713 | - var _iterator = _createForOfIteratorHelper(classes.split(" ")); | |
| 2714 | - var _step; | |
| 2715 | - try { | |
| 2716 | - for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 2717 | - var cls = _step.value; | |
| 2718 | - if (cls.startsWith("e-id-")) return cls.substring(5); | |
| 2719 | - } | |
| 2720 | - } catch (err) { | |
| 2721 | - _iterator.e(err); | |
| 2722 | - } finally { | |
| 2723 | - _iterator.f(); | |
| 2724 | - } | |
| 2725 | - return ""; | |
| 2726 | - } | |
| 2727 | - }, | |
| 2728 | - { | |
| 2729 | - key: "removeNonceFromUrl", | |
| 2730 | - value: function removeNonceFromUrl(url) { | |
| 2731 | - try { | |
| 2732 | - var urlObj = new URL(url, window.location.origin); | |
| 2733 | - urlObj.searchParams.delete("_wpnonce"); | |
| 2734 | - var postParam = urlObj.searchParams.get("post"); | |
| 2735 | - if (postParam !== null && /^[0-9]+$/.test(postParam)) urlObj.searchParams.delete("post"); | |
| 2736 | - return urlObj.pathname + urlObj.search + urlObj.hash; | |
| 2737 | - } catch (e) { | |
| 2738 | - return url; | |
| 2739 | - } | |
| 2740 | - } | |
| 2741 | - } | |
| 2742 | - ]); | |
| 2743 | - }(BaseTracking); | |
| 838 | +/***/ }), | |
| 2744 | 839 | |
| 2745 | -//#endregion | |
| 2746 | -//#region app/assets/js/event-track/wp-dashboard-tracking.js | |
| 2747 | - var _WpDashboardTracking; | |
| 2748 | - var SESSION_TIMEOUT_MINUTES = 30; | |
| 2749 | - var MINUTE_MS = 60 * 1e3; | |
| 2750 | - var SESSION_TIMEOUT = SESSION_TIMEOUT_MINUTES * MINUTE_MS; | |
| 2751 | - var ACTIVITY_CHECK_INTERVAL = 1 * MINUTE_MS; | |
| 2752 | - var SESSION_STORAGE_KEY = "elementor_wpdash_session"; | |
| 2753 | - var PENDING_NAV_CLICK_KEY = "elementor_wpdash_pending_nav"; | |
| 2754 | - var CONTROL_TYPES = { | |
| 2755 | - BUTTON: "button", | |
| 2756 | - CHECKBOX: "checkbox", | |
| 2757 | - RADIO: "radio", | |
| 2758 | - LINK: "link", | |
| 2759 | - SELECT: "select", | |
| 2760 | - TOGGLE: "toggle", | |
| 2761 | - FILTER: "filter" | |
| 2762 | - }; | |
| 2763 | - var NAV_AREAS = { | |
| 2764 | - LEFT_MENU: "left_menu", | |
| 2765 | - SUBMENU: "submenu", | |
| 2766 | - HOVER_MENU: "hover_menu", | |
| 2767 | - TOP_BAR: "top_bar", | |
| 2768 | - SIDEBAR_MENU: "sidebar" | |
| 2769 | - }; | |
| 2770 | - var SCREEN_TYPES = { | |
| 2771 | - TAB: "tab", | |
| 2772 | - POPUP: "popup", | |
| 2773 | - APP_SCREEN: "app_screen" | |
| 2774 | - }; | |
| 2775 | - var WpDashboardTracking = /*#__PURE__*/ function() { | |
| 2776 | - function WpDashboardTracking() { | |
| 2777 | - _classCallCheck(this, WpDashboardTracking); | |
| 2778 | - } | |
| 2779 | - return _createClass(WpDashboardTracking, null, [ | |
| 2780 | - { | |
| 2781 | - key: "getElementorCommon", | |
| 2782 | - value: function getElementorCommon() { | |
| 2783 | - return window.elementorCommon; | |
| 2784 | - } | |
| 2785 | - }, | |
| 2786 | - { | |
| 2787 | - key: "init", | |
| 2788 | - value: function init() { | |
| 2789 | - if (this.initialized) return; | |
| 2790 | - this.restoreOrCreateSession(); | |
| 2791 | - if (this.isEventsManagerAvailable()) { | |
| 2792 | - this.startSessionMonitoring(); | |
| 2793 | - this.attachActivityListeners(); | |
| 2794 | - this.attachNavigationListener(); | |
| 2795 | - this.initialized = true; | |
| 2796 | - } | |
| 2797 | - } | |
| 2798 | - }, | |
| 2799 | - { | |
| 2800 | - key: "restoreOrCreateSession", | |
| 2801 | - value: function restoreOrCreateSession() { | |
| 2802 | - var storedSession = this.getStoredSession(); | |
| 2803 | - if (storedSession) { | |
| 2804 | - this.sessionStartTime = storedSession.sessionStartTime; | |
| 2805 | - this.navItemsVisited = new Set(storedSession.navItemsVisited); | |
| 2806 | - this.lastActivityTime = Date.now(); | |
| 2807 | - this.sessionEnded = false; | |
| 2808 | - } else { | |
| 2809 | - this.sessionStartTime = Date.now(); | |
| 2810 | - this.lastActivityTime = Date.now(); | |
| 2811 | - this.sessionEnded = false; | |
| 2812 | - this.navItemsVisited = /* @__PURE__ */ new Set(); | |
| 2813 | - } | |
| 2814 | - this.processPendingNavClick(); | |
| 2815 | - this.saveSessionToStorage(); | |
| 2816 | - } | |
| 2817 | - }, | |
| 2818 | - { | |
| 2819 | - key: "isEditorOneActive", | |
| 2820 | - value: function isEditorOneActive() { | |
| 2821 | - var _elementorCommon$conf; | |
| 2822 | - var _elementorCommon$conf2; | |
| 2823 | - var elementorCommon = this.getElementorCommon(); | |
| 2824 | - return (_elementorCommon$conf = elementorCommon === null || elementorCommon === void 0 || (_elementorCommon$conf2 = elementorCommon.config) === null || _elementorCommon$conf2 === void 0 || (_elementorCommon$conf2 = _elementorCommon$conf2.editor_events) === null || _elementorCommon$conf2 === void 0 ? void 0 : _elementorCommon$conf2.isEditorOneActive) !== null && _elementorCommon$conf !== void 0 ? _elementorCommon$conf : false; | |
| 2825 | - } | |
| 2826 | - }, | |
| 2827 | - { | |
| 2828 | - key: "processPendingNavClick", | |
| 2829 | - value: function processPendingNavClick() { | |
| 2830 | - try { | |
| 2831 | - var pendingNav = sessionStorage.getItem(PENDING_NAV_CLICK_KEY); | |
| 2832 | - if (pendingNav) { | |
| 2833 | - var _JSON$parse = JSON.parse(pendingNav); | |
| 2834 | - var itemId = _JSON$parse.itemId; | |
| 2835 | - var rootItem = _JSON$parse.rootItem; | |
| 2836 | - var area = _JSON$parse.area; | |
| 2837 | - this.navItemsVisited.add(itemId); | |
| 2838 | - var properties = { | |
| 2839 | - wpdash_nav_item_id: itemId, | |
| 2840 | - wpdash_nav_area: area | |
| 2841 | - }; | |
| 2842 | - if (rootItem) properties.wpdash_nav_item_root = rootItem; | |
| 2843 | - this.dispatchEvent("wpdash_nav_clicked", properties, { send_immediately: true }); | |
| 2844 | - sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); | |
| 2845 | - } | |
| 2846 | - } catch (error) { | |
| 2847 | - sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); | |
| 2848 | - } | |
| 2849 | - } | |
| 2850 | - }, | |
| 2851 | - { | |
| 2852 | - key: "getStoredSession", | |
| 2853 | - value: function getStoredSession() { | |
| 2854 | - try { | |
| 2855 | - var stored = sessionStorage.getItem(SESSION_STORAGE_KEY); | |
| 2856 | - return stored ? JSON.parse(stored) : null; | |
| 2857 | - } catch (error) { | |
| 2858 | - return null; | |
| 2859 | - } | |
| 2860 | - } | |
| 2861 | - }, | |
| 2862 | - { | |
| 2863 | - key: "saveSessionToStorage", | |
| 2864 | - value: function saveSessionToStorage() { | |
| 2865 | - var sessionData = { | |
| 2866 | - sessionStartTime: this.sessionStartTime, | |
| 2867 | - navItemsVisited: Array.from(this.navItemsVisited) | |
| 2868 | - }; | |
| 2869 | - sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(sessionData)); | |
| 2870 | - } | |
| 2871 | - }, | |
| 2872 | - { | |
| 2873 | - key: "clearStoredSession", | |
| 2874 | - value: function clearStoredSession() { | |
| 2875 | - sessionStorage.removeItem(SESSION_STORAGE_KEY); | |
| 2876 | - } | |
| 2877 | - }, | |
| 2878 | - { | |
| 2879 | - key: "isEventsManagerAvailable", | |
| 2880 | - value: function isEventsManagerAvailable() { | |
| 2881 | - var elementorCommon = this.getElementorCommon(); | |
| 2882 | - return (elementorCommon === null || elementorCommon === void 0 ? void 0 : elementorCommon.eventsManager) && "function" === typeof elementorCommon.eventsManager.dispatchEvent; | |
| 2883 | - } | |
| 2884 | - }, | |
| 2885 | - { | |
| 2886 | - key: "canSendEvents", | |
| 2887 | - value: function canSendEvents() { | |
| 2888 | - var _elementorCommon$conf3; | |
| 2889 | - var _elementorCommon$conf4; | |
| 2890 | - var elementorCommon = this.getElementorCommon(); | |
| 2891 | - return (_elementorCommon$conf3 = elementorCommon === null || elementorCommon === void 0 || (_elementorCommon$conf4 = elementorCommon.config) === null || _elementorCommon$conf4 === void 0 || (_elementorCommon$conf4 = _elementorCommon$conf4.editor_events) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.can_send_events) !== null && _elementorCommon$conf3 !== void 0 ? _elementorCommon$conf3 : false; | |
| 2892 | - } | |
| 2893 | - }, | |
| 2894 | - { | |
| 2895 | - key: "dispatchEvent", | |
| 2896 | - value: function dispatchEvent(eventName) { | |
| 2897 | - var _elementorCommon$even; | |
| 2898 | - var properties = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 2899 | - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 2900 | - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) return; | |
| 2901 | - var elementorCommon = this.getElementorCommon(); | |
| 2902 | - elementorCommon === null || elementorCommon === void 0 || (_elementorCommon$even = elementorCommon.eventsManager) === null || _elementorCommon$even === void 0 || _elementorCommon$even.dispatchEvent(eventName, properties, options); | |
| 2903 | - } | |
| 2904 | - }, | |
| 2905 | - { | |
| 2906 | - key: "updateActivity", | |
| 2907 | - value: function updateActivity() { | |
| 2908 | - this.lastActivityTime = Date.now(); | |
| 2909 | - } | |
| 2910 | - }, | |
| 2911 | - { | |
| 2912 | - key: "startSessionMonitoring", | |
| 2913 | - value: function startSessionMonitoring() { | |
| 2914 | - var _this = this; | |
| 2915 | - this.activityCheckInterval = setInterval(function() { | |
| 2916 | - _this.checkSessionTimeout(); | |
| 2917 | - }, ACTIVITY_CHECK_INTERVAL); | |
| 2918 | - window.addEventListener("beforeunload", function() { | |
| 2919 | - if (!_this.sessionEnded && !_this.isNavigatingToElementor) _this.trackSessionEnd("tab_closed"); | |
| 2920 | - }); | |
| 2921 | - document.addEventListener("visibilitychange", function() { | |
| 2922 | - if (!_this.sessionEnded && document.hidden) { | |
| 2923 | - if (Date.now() - _this.lastActivityTime > SESSION_TIMEOUT) _this.trackSessionEnd("tab_inactive"); | |
| 2924 | - } | |
| 2925 | - }); | |
| 2926 | - } | |
| 2927 | - }, | |
| 2928 | - { | |
| 2929 | - key: "isElementorPage", | |
| 2930 | - value: function isElementorPage(url) { | |
| 2931 | - try { | |
| 2932 | - var params = new URL(url, window.location.origin).searchParams; | |
| 2933 | - var page = params.get("page"); | |
| 2934 | - var postType = params.get("post_type"); | |
| 2935 | - var action = params.get("action"); | |
| 2936 | - return !!(page && this.elementorPages.some(function(p) { | |
| 2937 | - return page.includes(p); | |
| 2938 | - }) || postType && this.elementorPostTypes.includes(postType) || action && action.includes(this.anyPageWithElementorString)); | |
| 2939 | - } catch (error) { | |
| 2940 | - return false; | |
| 2941 | - } | |
| 2942 | - } | |
| 2943 | - }, | |
| 2944 | - { | |
| 2945 | - key: "isPluginsPage", | |
| 2946 | - value: function isPluginsPage(url) { | |
| 2947 | - try { | |
| 2948 | - return new URL(url, window.location.origin).pathname.includes("plugins.php"); | |
| 2949 | - } catch (error) { | |
| 2950 | - return false; | |
| 2951 | - } | |
| 2952 | - } | |
| 2953 | - }, | |
| 2954 | - { | |
| 2955 | - key: "isNavigatingAwayFromElementor", | |
| 2956 | - value: function isNavigatingAwayFromElementor(targetUrl) { | |
| 2957 | - if (!targetUrl) return false; | |
| 2958 | - if (targetUrl.startsWith("#")) return false; | |
| 2959 | - return !this.isElementorPage(targetUrl); | |
| 2960 | - } | |
| 2961 | - }, | |
| 2962 | - { | |
| 2963 | - key: "isLinkOpeningInNewTab", | |
| 2964 | - value: function isLinkOpeningInNewTab(link) { | |
| 2965 | - var target = link.getAttribute("target"); | |
| 2966 | - return "_blank" === target || "_new" === target; | |
| 2967 | - } | |
| 2968 | - }, | |
| 2969 | - { | |
| 2970 | - key: "attachNavigationListener", | |
| 2971 | - value: function attachNavigationListener() { | |
| 2972 | - var _this2 = this; | |
| 2973 | - var handleLinkClick = function handleLinkClick(event) { | |
| 2974 | - var link = event.target.closest("a"); | |
| 2975 | - if (link && link.href) { | |
| 2976 | - if (_this2.isLinkOpeningInNewTab(link)) return; | |
| 2977 | - if (!_this2.sessionEnded && _this2.isNavigatingAwayFromElementor(link.href)) _this2.trackSessionEnd("navigate_away"); | |
| 2978 | - else if (_this2.isElementorPage(link.href)) _this2.isNavigatingToElementor = true; | |
| 2979 | - } | |
| 2980 | - if (event.target.closest("#editor-one-sidebar-navigation")) _this2.isNavigatingToElementor = true; | |
| 2981 | - }; | |
| 2982 | - var handleFormSubmit = function handleFormSubmit(event) { | |
| 2983 | - var form = event.target; | |
| 2984 | - if (form.action) { | |
| 2985 | - if (!_this2.sessionEnded && _this2.isNavigatingAwayFromElementor(form.action)) _this2.trackSessionEnd("navigate_away"); | |
| 2986 | - else if (_this2.isElementorPage(form.action)) _this2.isNavigatingToElementor = true; | |
| 2987 | - } | |
| 2988 | - }; | |
| 2989 | - document.addEventListener("click", handleLinkClick, true); | |
| 2990 | - document.addEventListener("submit", handleFormSubmit, true); | |
| 2991 | - this.navigationListeners.push({ | |
| 2992 | - type: "click", | |
| 2993 | - handler: handleLinkClick | |
| 2994 | - }, { | |
| 2995 | - type: "submit", | |
| 2996 | - handler: handleFormSubmit | |
| 2997 | - }); | |
| 2998 | - } | |
| 2999 | - }, | |
| 3000 | - { | |
| 3001 | - key: "checkSessionTimeout", | |
| 3002 | - value: function checkSessionTimeout() { | |
| 3003 | - if (Date.now() - this.lastActivityTime > SESSION_TIMEOUT && !this.sessionEnded) this.trackSessionEnd("timeout"); | |
| 3004 | - } | |
| 3005 | - }, | |
| 3006 | - { | |
| 3007 | - key: "attachActivityListeners", | |
| 3008 | - value: function attachActivityListeners() { | |
| 3009 | - var _this3 = this; | |
| 3010 | - [ | |
| 3011 | - "mousedown", | |
| 3012 | - "keydown", | |
| 3013 | - "scroll", | |
| 3014 | - "touchstart", | |
| 3015 | - "click" | |
| 3016 | - ].forEach(function(event) { | |
| 3017 | - document.addEventListener(event, function() { | |
| 3018 | - _this3.updateActivity(); | |
| 3019 | - }, { | |
| 3020 | - capture: true, | |
| 3021 | - passive: true | |
| 3022 | - }); | |
| 3023 | - }); | |
| 3024 | - } | |
| 3025 | - }, | |
| 3026 | - { | |
| 3027 | - key: "formatDuration", | |
| 3028 | - value: function formatDuration(milliseconds) { | |
| 3029 | - var totalSeconds = Math.floor(milliseconds / 1e3); | |
| 3030 | - return Number(totalSeconds.toFixed(2)); | |
| 3031 | - } | |
| 3032 | - }, | |
| 3033 | - { | |
| 3034 | - key: "trackNavClicked", | |
| 3035 | - value: function trackNavClicked(itemId) { | |
| 3036 | - var rootItem = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; | |
| 3037 | - var area = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : NAV_AREAS.LEFT_MENU; | |
| 3038 | - if (!this.initialized) { | |
| 3039 | - var pendingNav = { | |
| 3040 | - itemId, | |
| 3041 | - rootItem, | |
| 3042 | - area | |
| 3043 | - }; | |
| 3044 | - sessionStorage.setItem(PENDING_NAV_CLICK_KEY, JSON.stringify(pendingNav)); | |
| 3045 | - return; | |
| 3046 | - } | |
| 3047 | - this.updateActivity(); | |
| 3048 | - this.navItemsVisited.add(itemId); | |
| 3049 | - this.saveSessionToStorage(); | |
| 3050 | - var properties = { | |
| 3051 | - wpdash_nav_item_id: itemId, | |
| 3052 | - wpdash_nav_area: area | |
| 3053 | - }; | |
| 3054 | - if (rootItem) properties.wpdash_nav_item_root = rootItem; | |
| 3055 | - this.dispatchEvent("wpdash_nav_clicked", properties); | |
| 3056 | - } | |
| 3057 | - }, | |
| 3058 | - { | |
| 3059 | - key: "trackScreenViewed", | |
| 3060 | - value: function trackScreenViewed(screenId) { | |
| 3061 | - var screenType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : SCREEN_TYPES.TAB; | |
| 3062 | - this.updateActivity(); | |
| 3063 | - var properties = { | |
| 3064 | - wpdash_screen_id: screenId, | |
| 3065 | - wpdash_screen_type: screenType | |
| 3066 | - }; | |
| 3067 | - this.dispatchEvent("wpdash_screen_viewed", properties); | |
| 3068 | - } | |
| 3069 | - }, | |
| 3070 | - { | |
| 3071 | - key: "trackActionControl", | |
| 3072 | - value: function trackActionControl(controlIdentifier, controlType) { | |
| 3073 | - this.updateActivity(); | |
| 3074 | - var properties = { | |
| 3075 | - wpdash_action_control_interacted: controlIdentifier, | |
| 3076 | - wpdash_control_type: controlType | |
| 3077 | - }; | |
| 3078 | - this.dispatchEvent("wpdash_action_control", properties); | |
| 3079 | - } | |
| 3080 | - }, | |
| 3081 | - { | |
| 3082 | - key: "trackPromoClicked", | |
| 3083 | - value: function trackPromoClicked(promoName, destination, clickPath) { | |
| 3084 | - this.updateActivity(); | |
| 3085 | - var properties = { | |
| 3086 | - wpdash_promo_name: promoName, | |
| 3087 | - wpdash_promo_destination: destination, | |
| 3088 | - wpdash_promo_clicked_path: clickPath | |
| 3089 | - }; | |
| 3090 | - this.dispatchEvent("wpdash_promo_clicked", properties); | |
| 3091 | - } | |
| 3092 | - }, | |
| 3093 | - { | |
| 3094 | - key: "trackSessionEnd", | |
| 3095 | - value: function trackSessionEnd() { | |
| 3096 | - var reason = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "timeout"; | |
| 3097 | - if (this.sessionEnded) return; | |
| 3098 | - this.sessionEnded = true; | |
| 3099 | - if (this.activityCheckInterval) { | |
| 3100 | - clearInterval(this.activityCheckInterval); | |
| 3101 | - this.activityCheckInterval = null; | |
| 3102 | - } | |
| 3103 | - var duration = Date.now() - this.sessionStartTime; | |
| 3104 | - var properties = { | |
| 3105 | - wpdash_endstate_nav_summary: Array.from(this.navItemsVisited), | |
| 3106 | - wpdash_endstate_nav_count: this.navItemsVisited.size, | |
| 3107 | - wpdash_endstate_duration: this.formatDuration(duration), | |
| 3108 | - reason | |
| 3109 | - }; | |
| 3110 | - this.dispatchEvent("wpdash_session_end_state", properties); | |
| 3111 | - this.clearStoredSession(); | |
| 3112 | - } | |
| 3113 | - }, | |
| 3114 | - { | |
| 3115 | - key: "destroy", | |
| 3116 | - value: function destroy() { | |
| 3117 | - if (this.activityCheckInterval) clearInterval(this.activityCheckInterval); | |
| 3118 | - this.navigationListeners.forEach(function(_ref) { | |
| 3119 | - var type = _ref.type; | |
| 3120 | - var handler = _ref.handler; | |
| 3121 | - document.removeEventListener(type, handler, true); | |
| 3122 | - }); | |
| 3123 | - this.navigationListeners = []; | |
| 3124 | - ScreenViewTracking.destroy(); | |
| 3125 | - PromotionTracking.destroy(); | |
| 3126 | - MenuPromotionTracking.destroy(); | |
| 3127 | - ActionControlTracking.destroy(); | |
| 3128 | - this.initialized = false; | |
| 3129 | - } | |
| 3130 | - } | |
| 3131 | - ]); | |
| 3132 | - }(); | |
| 3133 | - _WpDashboardTracking = WpDashboardTracking; | |
| 3134 | - _defineProperty(WpDashboardTracking, "anyPageWithElementorString", "elementor"); | |
| 3135 | - _defineProperty(WpDashboardTracking, "elementorPages", [ | |
| 3136 | - _WpDashboardTracking.anyPageWithElementorString, | |
| 3137 | - "e-form-submissions", | |
| 3138 | - "popup_templates" | |
| 3139 | - ]); | |
| 3140 | - _defineProperty(WpDashboardTracking, "elementorPostTypes", [ | |
| 3141 | - "elementor_library", | |
| 3142 | - "e-floating-buttons", | |
| 3143 | - "elementor_snippet", | |
| 3144 | - "elementor_font", | |
| 3145 | - "elementor_icons" | |
| 3146 | - ]); | |
| 3147 | - _defineProperty(WpDashboardTracking, "sessionStartTime", Date.now()); | |
| 3148 | - _defineProperty(WpDashboardTracking, "lastActivityTime", Date.now()); | |
| 3149 | - _defineProperty(WpDashboardTracking, "sessionEnded", false); | |
| 3150 | - _defineProperty(WpDashboardTracking, "navItemsVisited", /* @__PURE__ */ new Set()); | |
| 3151 | - _defineProperty(WpDashboardTracking, "activityCheckInterval", null); | |
| 3152 | - _defineProperty(WpDashboardTracking, "initialized", false); | |
| 3153 | - _defineProperty(WpDashboardTracking, "navigationListeners", []); | |
| 3154 | - _defineProperty(WpDashboardTracking, "isNavigatingToElementor", false); | |
| 3155 | - window.addEventListener("elementor/admin/init", function() { | |
| 3156 | - var currentUrl = window.location.href; | |
| 3157 | - var isPluginsPage = WpDashboardTracking.isPluginsPage(currentUrl); | |
| 3158 | - var isElementorPage = WpDashboardTracking.isElementorPage(currentUrl); | |
| 3159 | - if (isPluginsPage) PluginActions.init(); | |
| 3160 | - NavigationTracking.init(); | |
| 3161 | - if (isElementorPage) { | |
| 3162 | - WpDashboardTracking.init(); | |
| 3163 | - ScreenViewTracking.init(); | |
| 3164 | - PromotionTracking.init(); | |
| 3165 | - MenuPromotionTracking.init(); | |
| 3166 | - ActionControlTracking.init(); | |
| 3167 | - } | |
| 3168 | - }); | |
| 3169 | - window.addEventListener("beforeunload", function() { | |
| 3170 | - NavigationTracking.destroy(); | |
| 3171 | - PluginActions.destroy(); | |
| 3172 | - WpDashboardTracking.destroy(); | |
| 3173 | - }); | |
| 840 | +/***/ "../modules/landing-pages/assets/js/admin/module.js": | |
| 841 | +/*!**********************************************************!*\ | |
| 842 | + !*** ../modules/landing-pages/assets/js/admin/module.js ***! | |
| 843 | + \**********************************************************/ | |
| 844 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3174 | 845 | |
| 3175 | -//#endregion | |
| 3176 | -//#region assets/dev/js/admin/maintenance-mode.js | |
| 3177 | - var require_maintenance_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 3178 | - module.exports = elementorModules.ViewModule.extend({ | |
| 3179 | - getDefaultSettings: function getDefaultSettings() { | |
| 3180 | - return { | |
| 3181 | - selectors: { | |
| 3182 | - modeSelect: ".elementor_maintenance_mode_mode select", | |
| 3183 | - maintenanceModeTable: "#tab-maintenance_mode table", | |
| 3184 | - maintenanceModeDescriptions: ".elementor-maintenance-mode-description", | |
| 3185 | - excludeModeSelect: ".elementor_maintenance_mode_exclude_mode select", | |
| 3186 | - excludeRolesArea: ".elementor_maintenance_mode_exclude_roles", | |
| 3187 | - templateSelect: ".elementor_maintenance_mode_template_id select", | |
| 3188 | - editTemplateButton: ".elementor-edit-template", | |
| 3189 | - maintenanceModeError: ".elementor-maintenance-mode-error" | |
| 3190 | - }, | |
| 3191 | - classes: { isEnabled: "elementor-maintenance-mode-is-enabled" } | |
| 3192 | - }; | |
| 3193 | - }, | |
| 3194 | - getDefaultElements: function getDefaultElements() { | |
| 3195 | - var elements = {}; | |
| 3196 | - var selectors = this.getSettings("selectors"); | |
| 3197 | - elements.$modeSelect = jQuery(selectors.modeSelect); | |
| 3198 | - elements.$maintenanceModeTable = elements.$modeSelect.parents(selectors.maintenanceModeTable); | |
| 3199 | - elements.$excludeModeSelect = elements.$maintenanceModeTable.find(selectors.excludeModeSelect); | |
| 3200 | - elements.$excludeRolesArea = elements.$maintenanceModeTable.find(selectors.excludeRolesArea); | |
| 3201 | - elements.$templateSelect = elements.$maintenanceModeTable.find(selectors.templateSelect); | |
| 3202 | - elements.$editTemplateButton = elements.$maintenanceModeTable.find(selectors.editTemplateButton); | |
| 3203 | - elements.$maintenanceModeDescriptions = elements.$maintenanceModeTable.find(selectors.maintenanceModeDescriptions); | |
| 3204 | - elements.$maintenanceModeError = elements.$maintenanceModeTable.find(selectors.maintenanceModeError); | |
| 3205 | - return elements; | |
| 3206 | - }, | |
| 3207 | - handleModeSelectChange: function handleModeSelectChange() { | |
| 3208 | - var settings = this.getSettings(); | |
| 3209 | - var elements = this.elements; | |
| 3210 | - elements.$maintenanceModeTable.toggleClass(settings.classes.isEnabled, !!elements.$modeSelect.val()); | |
| 3211 | - elements.$maintenanceModeDescriptions.hide(); | |
| 3212 | - elements.$maintenanceModeDescriptions.filter("[data-value=\"" + elements.$modeSelect.val() + "\"]").show(); | |
| 3213 | - }, | |
| 3214 | - handleExcludeModeSelectChange: function handleExcludeModeSelectChange() { | |
| 3215 | - var elements = this.elements; | |
| 3216 | - elements.$excludeRolesArea.toggle("custom" === elements.$excludeModeSelect.val()); | |
| 3217 | - }, | |
| 3218 | - handleTemplateSelectChange: function handleTemplateSelectChange() { | |
| 3219 | - var elements = this.elements; | |
| 3220 | - var templateID = elements.$templateSelect.val(); | |
| 3221 | - if (!templateID) { | |
| 3222 | - elements.$editTemplateButton.hide(); | |
| 3223 | - elements.$maintenanceModeError.show(); | |
| 3224 | - return; | |
| 3225 | - } | |
| 3226 | - var editUrl = elementorAdmin.config.home_url + "?p=" + templateID + "&elementor"; | |
| 3227 | - elements.$editTemplateButton.prop("href", editUrl).show(); | |
| 3228 | - elements.$maintenanceModeError.hide(); | |
| 3229 | - }, | |
| 3230 | - bindEvents: function bindEvents() { | |
| 3231 | - var elements = this.elements; | |
| 3232 | - elements.$modeSelect.on("change", this.handleModeSelectChange.bind(this)); | |
| 3233 | - elements.$excludeModeSelect.on("change", this.handleExcludeModeSelectChange.bind(this)); | |
| 3234 | - elements.$templateSelect.on("change", this.handleTemplateSelectChange.bind(this)); | |
| 3235 | - }, | |
| 3236 | - onAdminInit: function onAdminInit() { | |
| 3237 | - this.handleModeSelectChange(); | |
| 3238 | - this.handleExcludeModeSelectChange(); | |
| 3239 | - this.handleTemplateSelectChange(); | |
| 3240 | - }, | |
| 3241 | - onInit: function onInit() { | |
| 3242 | - elementorModules.ViewModule.prototype.onInit.apply(this, arguments); | |
| 3243 | - elementorCommon.elements.$window.on("elementor/admin/init", this.onAdminInit); | |
| 3244 | - } | |
| 3245 | - }); | |
| 3246 | - })); | |
| 846 | +"use strict"; | |
| 3247 | 847 | |
| 3248 | -//#endregion | |
| 3249 | -//#region assets/dev/js/admin/admin.js | |
| 3250 | - (function($) { | |
| 3251 | - var ElementorAdmin = elementorModules.ViewModule.extend({ | |
| 3252 | - maintenanceMode: null, | |
| 3253 | - config: elementorAdminConfig, | |
| 3254 | - getDefaultElements: function getDefaultElements() { | |
| 3255 | - var elements = { | |
| 3256 | - $switchMode: $("#elementor-switch-mode"), | |
| 3257 | - $goToEditLink: $("#elementor-go-to-edit-page-link"), | |
| 3258 | - $switchModeInput: $("#elementor-switch-mode-input"), | |
| 3259 | - $switchModeButton: $("#elementor-switch-mode-button"), | |
| 3260 | - $elementorLoader: $(".elementor-loader"), | |
| 3261 | - $builderEditor: $("#elementor-editor"), | |
| 3262 | - $importButton: $("#elementor-import-template-trigger"), | |
| 3263 | - $importNowButton: $("#e-import-template-action"), | |
| 3264 | - $importArea: $("#elementor-import-template-area"), | |
| 3265 | - $importForm: $("#elementor-import-template-form"), | |
| 3266 | - $importFormFileInput: $("#elementor-import-template-form input[type=\"file\"]"), | |
| 3267 | - $settingsForm: $("#elementor-settings-form"), | |
| 3268 | - $settingsTabsWrapper: $("#elementor-settings-tabs-wrapper"), | |
| 3269 | - $menuGoProLink: $("a[href=\"admin.php?page=go_elementor_pro\"], a[href*=\"admin.php?page=elementor-one-upgrade\"]"), | |
| 3270 | - $reMigrateGlobalsButton: $(".elementor-re-migrate-globals-button") | |
| 3271 | - }; | |
| 3272 | - elements.$settingsFormPages = elements.$settingsForm.find(".elementor-settings-form-page"); | |
| 3273 | - elements.$activeSettingsPage = elements.$settingsFormPages.filter(".elementor-active"); | |
| 3274 | - elements.$settingsTabs = elements.$settingsTabsWrapper.children(); | |
| 3275 | - elements.$activeSettingsTab = elements.$settingsTabs.filter(".nav-tab-active"); | |
| 3276 | - return elements; | |
| 3277 | - }, | |
| 3278 | - toggleStatus: function toggleStatus() { | |
| 3279 | - var isElementorMode = this.isElementorMode(); | |
| 3280 | - elementorCommon.elements.$body.toggleClass("elementor-editor-active", isElementorMode).toggleClass("elementor-editor-inactive", !isElementorMode); | |
| 3281 | - }, | |
| 3282 | - bindEvents: function bindEvents() { | |
| 3283 | - var self = this; | |
| 3284 | - self.elements.$switchModeButton.on("click", function(event) { | |
| 3285 | - event.preventDefault(); | |
| 3286 | - if (self.isElementorMode()) elementorCommon.dialogsManager.createWidget("confirm", { | |
| 3287 | - message: (0, _wordpress_i18n.__)("Please note that you are switching to WordPress default editor. Your current layout, design and content might break.", "elementor"), | |
| 3288 | - headerMessage: (0, _wordpress_i18n.__)("Back to WordPress Editor", "elementor"), | |
| 3289 | - strings: { | |
| 3290 | - confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), | |
| 3291 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 3292 | - }, | |
| 3293 | - defaultOption: "confirm", | |
| 3294 | - onConfirm: function onConfirm() { | |
| 3295 | - self.elements.$switchModeInput.val(""); | |
| 3296 | - self.toggleStatus(); | |
| 3297 | - } | |
| 3298 | - }).show(); | |
| 3299 | - else { | |
| 3300 | - self.elements.$switchModeInput.val(true); | |
| 3301 | - var $wpTitle = $("#title"); | |
| 3302 | - if (!$wpTitle.val()) $wpTitle.val("Elementor #" + $("#post_ID").val()); | |
| 3303 | - if (wp.autosave) wp.autosave.server.triggerSave(); | |
| 3304 | - self.animateLoader(); | |
| 3305 | - $(document).on("heartbeat-tick.autosave", function() { | |
| 3306 | - elementorCommon.elements.$window.off("beforeunload.edit-post"); | |
| 3307 | - location.href = self.elements.$goToEditLink.attr("href"); | |
| 3308 | - }); | |
| 3309 | - self.toggleStatus(); | |
| 3310 | - } | |
| 3311 | - }); | |
| 3312 | - self.elements.$goToEditLink.on("click", function() { | |
| 3313 | - self.animateLoader(); | |
| 3314 | - }); | |
| 3315 | - $(".e-notice--dismissible").on("click", ".e-notice__dismiss, .e-notice-dismiss", function(event) { | |
| 3316 | - event.preventDefault(); | |
| 3317 | - var $wrapperElm = $(this).closest(".e-notice--dismissible"); | |
| 3318 | - $.post(ajaxurl, { | |
| 3319 | - action: "elementor_set_admin_notice_viewed", | |
| 3320 | - notice_id: $wrapperElm.data("notice_id"), | |
| 3321 | - _wpnonce: $wrapperElm.data("nonce") | |
| 3322 | - }); | |
| 3323 | - $wrapperElm.fadeTo(100, 0, function() { | |
| 3324 | - $wrapperElm.slideUp(100, function() { | |
| 3325 | - $wrapperElm.remove(); | |
| 3326 | - }); | |
| 3327 | - }); | |
| 3328 | - }); | |
| 3329 | - var campaignNotices = { plugin_image_optimization: "elementor_image_optimization_campaign" }; | |
| 3330 | - Object.keys(campaignNotices).forEach(function(noticeId) { | |
| 3331 | - $(".e-notice--cta.e-notice--dismissible[data-notice_id=\"".concat(noticeId, "\"] a.e-button--cta")).on("click", function() { | |
| 3332 | - var $button = $(this); | |
| 3333 | - elementorCommon.ajax.addRequest(campaignNotices[noticeId], { data: { | |
| 3334 | - campaign: ($button === null || $button === void 0 ? void 0 : $button.data("campaign")) || "", | |
| 3335 | - source: ($button === null || $button === void 0 ? void 0 : $button.data("source")) || "", | |
| 3336 | - medium: ($button === null || $button === void 0 ? void 0 : $button.data("medium")) || "" | |
| 3337 | - } }); | |
| 3338 | - }); | |
| 3339 | - }); | |
| 3340 | - $(".e-a-apps .e-a-item[data-plugin=\"image-optimization/image-optimization.php\"] a.e-btn").on("click", function() { | |
| 3341 | - var $button = $(this); | |
| 3342 | - elementorCommon.ajax.addRequest("elementor_image_optimization_campaign", { data: { | |
| 3343 | - campaign: ($button === null || $button === void 0 ? void 0 : $button.data("campaign")) || "", | |
| 3344 | - source: ($button === null || $button === void 0 ? void 0 : $button.data("source")) || "", | |
| 3345 | - medium: ($button === null || $button === void 0 ? void 0 : $button.data("medium")) || "" | |
| 3346 | - } }); | |
| 3347 | - }); | |
| 3348 | - $("#elementor-clear-cache-button").on("click", function(event) { | |
| 3349 | - event.preventDefault(); | |
| 3350 | - var $thisButton = $(this); | |
| 3351 | - $thisButton.removeClass("success").addClass("loading"); | |
| 3352 | - $.post(ajaxurl, { | |
| 3353 | - action: "elementor_clear_cache", | |
| 3354 | - _nonce: $thisButton.data("nonce") | |
| 3355 | - }).done(function() { | |
| 3356 | - $thisButton.removeClass("loading").addClass("success"); | |
| 3357 | - }); | |
| 3358 | - }); | |
| 3359 | - $("#elementor-library-sync-button").on("click", function(event) { | |
| 3360 | - event.preventDefault(); | |
| 3361 | - var $thisButton = $(this); | |
| 3362 | - $thisButton.removeClass("success").addClass("loading"); | |
| 3363 | - $.post(ajaxurl, { | |
| 3364 | - action: "elementor_reset_library", | |
| 3365 | - _nonce: $thisButton.data("nonce") | |
| 3366 | - }).done(function() { | |
| 3367 | - $thisButton.removeClass("loading").addClass("success"); | |
| 3368 | - }); | |
| 3369 | - }); | |
| 3370 | - $("#elementor-recreate-kit-button").on("click", function(event) { | |
| 3371 | - event.preventDefault(); | |
| 3372 | - var $thisButton = $(this); | |
| 3373 | - $thisButton.removeClass("success error").addClass("loading").next(".e-recreate-kit-error-message").remove(); | |
| 3374 | - $.post(ajaxurl, { | |
| 3375 | - action: "elementor_recreate_kit", | |
| 3376 | - _nonce: $thisButton.data("nonce") | |
| 3377 | - }).done(function() { | |
| 3378 | - $thisButton.removeClass("loading").addClass("success"); | |
| 3379 | - }).fail(function(_ref) { | |
| 3380 | - var _responseJSON$data; | |
| 3381 | - var responseJSON = _ref.responseJSON; | |
| 3382 | - $thisButton.removeClass("loading").addClass("error"); | |
| 3383 | - if ((_responseJSON$data = responseJSON.data) !== null && _responseJSON$data !== void 0 && _responseJSON$data.message) $thisButton.after("<div class=\"e-recreate-kit-error-message\">".concat(responseJSON.data.message, "</div>")); | |
| 3384 | - }); | |
| 3385 | - }); | |
| 3386 | - $("#elementor-replace-url-button").on("click", function(event) { | |
| 3387 | - event.preventDefault(); | |
| 3388 | - var $this = $(this); | |
| 3389 | - var $tr = $this.parents("tr"); | |
| 3390 | - var $from = $tr.find("[name=\"from\"]"); | |
| 3391 | - var $to = $tr.find("[name=\"to\"]"); | |
| 3392 | - $this.removeClass("success").addClass("loading"); | |
| 3393 | - $.post(ajaxurl, { | |
| 3394 | - action: "elementor_replace_url", | |
| 3395 | - from: $from.val(), | |
| 3396 | - to: $to.val(), | |
| 3397 | - _nonce: $this.data("nonce") | |
| 3398 | - }).done(function(response) { | |
| 3399 | - $this.removeClass("loading"); | |
| 3400 | - if (response.success) $this.addClass("success"); | |
| 3401 | - elementorCommon.dialogsManager.createWidget("alert", { message: response.data }).show(); | |
| 3402 | - }); | |
| 3403 | - }); | |
| 3404 | - $("#elementor_upgrade_fa_button").on("click", function(event) { | |
| 3405 | - event.preventDefault(); | |
| 3406 | - var $updateButton = $(this); | |
| 3407 | - $updateButton.addClass("loading"); | |
| 3408 | - elementorCommon.dialogsManager.createWidget("confirm", { | |
| 3409 | - id: "confirm_fa_migration_admin_modal", | |
| 3410 | - message: (0, _wordpress_i18n.__)("I understand that by upgrading to Font Awesome 5,", "elementor") + "<br>" + (0, _wordpress_i18n.__)("I acknowledge that some changes may affect my website and that this action cannot be undone.", "elementor"), | |
| 3411 | - headerMessage: (0, _wordpress_i18n.__)("Font Awesome 5 Migration", "elementor"), | |
| 3412 | - strings: { | |
| 3413 | - confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), | |
| 3414 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 3415 | - }, | |
| 3416 | - defaultOption: "confirm", | |
| 3417 | - onConfirm: function onConfirm() { | |
| 3418 | - $updateButton.removeClass("error").addClass("loading"); | |
| 3419 | - var _$updateButton$data = $updateButton.data(); | |
| 3420 | - var _nonce = _$updateButton$data._nonce; | |
| 3421 | - var action = _$updateButton$data.action; | |
| 3422 | - var redirectUrl = _$updateButton$data.redirectUrl; | |
| 3423 | - $.post(ajaxurl, { | |
| 3424 | - action, | |
| 3425 | - _nonce | |
| 3426 | - }).done(function(response) { | |
| 3427 | - $updateButton.removeClass("loading").addClass("success"); | |
| 3428 | - var messageElement = document.createElement("p"); | |
| 3429 | - messageElement.appendChild(document.createTextNode(response.data.message)); | |
| 3430 | - $("#elementor_upgrade_fa_button").parent().append(messageElement); | |
| 3431 | - if (redirectUrl) { | |
| 3432 | - location.href = decodeURIComponent(redirectUrl); | |
| 3433 | - return; | |
| 3434 | - } | |
| 3435 | - history.go(-1); | |
| 3436 | - }).fail(function() { | |
| 3437 | - $updateButton.removeClass("loading").addClass("error"); | |
| 3438 | - }); | |
| 3439 | - }, | |
| 3440 | - onCancel: function onCancel() { | |
| 3441 | - $updateButton.removeClass("loading").addClass("error"); | |
| 3442 | - } | |
| 3443 | - }).show(); | |
| 3444 | - }); | |
| 3445 | - self.elements.$settingsTabs.on({ | |
| 3446 | - click: function click(event) { | |
| 3447 | - event.preventDefault(); | |
| 3448 | - self.activateSettingsTab(event.currentTarget); | |
| 3449 | - event.currentTarget.focus(); | |
| 3450 | - }, | |
| 3451 | - focus: function focus() { | |
| 3452 | - self.activateSettingsTab(this); | |
| 3453 | - } | |
| 3454 | - }); | |
| 3455 | - $("select.elementor-rollback-select").on("change", function() { | |
| 3456 | - var $this = $(this); | |
| 3457 | - var $rollbackButton = $this.next(".elementor-rollback-button"); | |
| 3458 | - var placeholderText = $rollbackButton.data("placeholder-text"); | |
| 3459 | - var placeholderUrl = $rollbackButton.data("placeholder-url"); | |
| 3460 | - $rollbackButton.html(placeholderText.replace("{VERSION}", $this.val())); | |
| 3461 | - $rollbackButton.data("href", placeholderUrl.replace("VERSION", $this.val())); | |
| 3462 | - }).trigger("change"); | |
| 3463 | - $(".elementor-rollback-button").on("click", function(event) { | |
| 3464 | - event.preventDefault(); | |
| 3465 | - var $this = $(this); | |
| 3466 | - elementorCommon.dialogsManager.createWidget("confirm", { | |
| 3467 | - headerMessage: (0, _wordpress_i18n.__)("Rollback to Previous Version", "elementor"), | |
| 3468 | - message: (0, _wordpress_i18n.__)("Are you sure you want to reinstall previous version?", "elementor"), | |
| 3469 | - strings: { | |
| 3470 | - confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), | |
| 3471 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 3472 | - }, | |
| 3473 | - onConfirm: function onConfirm() { | |
| 3474 | - $this.addClass("loading"); | |
| 3475 | - location.href = $this.data("href"); | |
| 3476 | - } | |
| 3477 | - }).show(); | |
| 3478 | - }); | |
| 3479 | - self.elements.$reMigrateGlobalsButton.on("click", function(event) { | |
| 3480 | - event.preventDefault(); | |
| 3481 | - var $this = $(event.currentTarget); | |
| 3482 | - elementorCommon.dialogsManager.createWidget("confirm", { | |
| 3483 | - headerMessage: (0, _wordpress_i18n.__)("Migrate to v3.0", "elementor"), | |
| 3484 | - message: (0, _wordpress_i18n.__)("Please note that this process will revert all changes made to Global Colors and Fonts since upgrading to v3.x.", "elementor"), | |
| 3485 | - strings: { | |
| 3486 | - confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), | |
| 3487 | - cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") | |
| 3488 | - }, | |
| 3489 | - onConfirm: function onConfirm() { | |
| 3490 | - $this.removeClass("success").addClass("loading"); | |
| 3491 | - elementorCommon.ajax.addRequest("re_migrate_globals", { success: function success() { | |
| 3492 | - return $this.removeClass("loading").addClass("success"); | |
| 3493 | - } }); | |
| 3494 | - } | |
| 3495 | - }).show(); | |
| 3496 | - }); | |
| 3497 | - $(".elementor_google_font select").on("change", function() { | |
| 3498 | - $(".elementor_font_display").toggle("1" === $(this).val()); | |
| 3499 | - }).trigger("change"); | |
| 3500 | - }, | |
| 3501 | - onInit: function onInit() { | |
| 3502 | - elementorModules.ViewModule.prototype.onInit.apply(this, arguments); | |
| 3503 | - this.initTemplatesImport(); | |
| 3504 | - this.initMaintenanceMode(); | |
| 3505 | - this.goToSettingsTabFromHash(); | |
| 3506 | - this.openLinksInNewTab(); | |
| 3507 | - this.addUserAgentClasses(); | |
| 3508 | - this.roleManager.init(); | |
| 3509 | - if (elementorCommon.config.experimentalFeatures["landing-pages"]) new _default$1(); | |
| 3510 | - if (elementorCommon.config.experimentalFeatures.container) new _default(); | |
| 3511 | - this.templateControls = new TemplateControls(); | |
| 3512 | - new ExperimentsModule(); | |
| 3513 | - }, | |
| 3514 | - addUserAgentClasses: function addUserAgentClasses() { | |
| 3515 | - var body = document.querySelector("body"); | |
| 3516 | - Object.entries(environment).forEach(function(_ref2) { | |
| 3517 | - var _ref3 = _slicedToArray(_ref2, 2); | |
| 3518 | - var key = _ref3[0]; | |
| 3519 | - if (!_ref3[1]) return; | |
| 3520 | - body.classList.add("e--ua-" + key); | |
| 3521 | - }); | |
| 3522 | - }, | |
| 3523 | - /** | |
| 3524 | - * Open Links in New Tab | |
| 3525 | - * | |
| 3526 | - * Adds a `target="_blank"` attribute to the Admin Dashboard menu items specified in the `elements` array, | |
| 3527 | - * if the elements are found in the DOM. The items in the `elements` array should be jQuery instances. | |
| 3528 | - * | |
| 3529 | - * @since 3.6.0 | |
| 3530 | - */ | |
| 3531 | - openLinksInNewTab: function openLinksInNewTab() { | |
| 3532 | - [this.elements.$menuGoProLink].forEach(function($element) { | |
| 3533 | - if ($element.length) $element.attr("target", "_blank"); | |
| 3534 | - }); | |
| 3535 | - }, | |
| 3536 | - initTemplatesImport: function initTemplatesImport() { | |
| 3537 | - var _elementorAdminConfig; | |
| 3538 | - var _elementorAdminConfig2; | |
| 3539 | - if (!(elementorAdminConfig.user.is_administrator || ((_elementorAdminConfig = (_elementorAdminConfig2 = elementorAdminConfig.user.restrictions) === null || _elementorAdminConfig2 === void 0 ? void 0 : _elementorAdminConfig2.includes("json-upload")) !== null && _elementorAdminConfig !== void 0 ? _elementorAdminConfig : false)) || !elementorCommon.elements.$body.hasClass("post-type-elementor_library")) return; | |
| 3540 | - if (0 === this.elements.$importNowButton.length) return; | |
| 3541 | - var self = this; | |
| 3542 | - var $importForm = self.elements.$importForm; | |
| 3543 | - var $importButton = self.elements.$importButton; | |
| 3544 | - var $importArea = self.elements.$importArea; | |
| 3545 | - var $importNowButton = self.elements.$importNowButton; | |
| 3546 | - var $importFormFileInput = self.elements.$importFormFileInput; | |
| 3547 | - self.elements.$formAnchor = $(".wp-header-end"); | |
| 3548 | - $("#wpbody-content").find(".page-title-action").first().before($importButton); | |
| 3549 | - self.elements.$formAnchor.after($importArea); | |
| 3550 | - $importButton.on("click", function() { | |
| 3551 | - $("#elementor-import-template-area").toggle(); | |
| 3552 | - }); | |
| 3553 | - var messages = { | |
| 3554 | - jsonUploadWarning: { shown: false }, | |
| 3555 | - enableUnfilteredFiles: { shown: false } | |
| 3556 | - }; | |
| 3557 | - var originalButtonValue = $importNowButton[0].value; | |
| 3558 | - $importForm.on("submit", /*#__PURE__*/ function() { | |
| 3559 | - var _ref4 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee(event) { | |
| 3560 | - var hasImportedFiles; | |
| 3561 | - var areUnfilteredFilesEnabled; | |
| 3562 | - var enableUnfilteredFilesModal; | |
| 3563 | - return import_regenerator.default.wrap(function(_context) { | |
| 3564 | - while (1) switch (_context.prev = _context.next) { | |
| 3565 | - case 0: | |
| 3566 | - $importNowButton[0].disabled = true; | |
| 3567 | - $importNowButton[0].value = (0, _wordpress_i18n.__)("Importing...", "elementor"); | |
| 3568 | - if (messages.jsonUploadWarning.shown) { | |
| 3569 | - _context.next = 5; | |
| 3570 | - break; | |
| 3571 | - } | |
| 3572 | - event.preventDefault(); | |
| 3573 | - _context.prev = 1; | |
| 3574 | - _context.next = 2; | |
| 3575 | - return showJsonUploadWarningMessageIfNeeded({ | |
| 3576 | - IntroductionClass: window.elementorModules.admin.utils.Introduction, | |
| 3577 | - introductionMap: window.elementorAdmin.config.user.introduction, | |
| 3578 | - waitForSetViewed: true | |
| 3579 | - }); | |
| 3580 | - case 2: | |
| 3581 | - messages.jsonUploadWarning.shown = true; | |
| 3582 | - $importForm.trigger("submit"); | |
| 3583 | - _context.next = 4; | |
| 3584 | - break; | |
| 3585 | - case 3: | |
| 3586 | - _context.prev = 3; | |
| 3587 | - _context["catch"](1); | |
| 3588 | - $importNowButton[0].disabled = false; | |
| 3589 | - $importNowButton[0].value = originalButtonValue; | |
| 3590 | - case 4: return _context.abrupt("return"); | |
| 3591 | - case 5: | |
| 3592 | - hasImportedFiles = $importFormFileInput[0].files.length; | |
| 3593 | - areUnfilteredFilesEnabled = elementorCommon.config.filesUpload.unfilteredFiles; | |
| 3594 | - if (!(hasImportedFiles && !areUnfilteredFilesEnabled && !messages.enableUnfilteredFiles.shown)) { | |
| 3595 | - _context.next = 6; | |
| 3596 | - break; | |
| 3597 | - } | |
| 3598 | - event.preventDefault(); | |
| 3599 | - enableUnfilteredFilesModal = FilesUploadHandler.getUnfilteredFilesNotEnabledImportTemplateDialog(function() { | |
| 3600 | - messages.enableUnfilteredFiles.shown = true; | |
| 3601 | - $importForm.trigger("submit"); | |
| 3602 | - }); | |
| 3603 | - enableUnfilteredFilesModal.show(); | |
| 3604 | - return _context.abrupt("return"); | |
| 3605 | - case 6: | |
| 3606 | - messages.jsonUploadWarning.shown = false; | |
| 3607 | - messages.enableUnfilteredFiles.shown = false; | |
| 3608 | - case 7: | |
| 3609 | - case "end": return _context.stop(); | |
| 3610 | - } | |
| 3611 | - }, _callee, null, [[1, 3]]); | |
| 3612 | - })); | |
| 3613 | - return function(_x) { | |
| 3614 | - return _ref4.apply(this, arguments); | |
| 3615 | - }; | |
| 3616 | - }()); | |
| 3617 | - }, | |
| 3618 | - initMaintenanceMode: function initMaintenanceMode() { | |
| 3619 | - var MaintenanceMode = require_maintenance_mode(); | |
| 3620 | - this.maintenanceMode = new MaintenanceMode(); | |
| 3621 | - }, | |
| 3622 | - isElementorMode: function isElementorMode() { | |
| 3623 | - return !!this.elements.$switchModeInput.val(); | |
| 3624 | - }, | |
| 3625 | - animateLoader: function animateLoader() { | |
| 3626 | - this.elements.$goToEditLink.addClass("elementor-animate"); | |
| 3627 | - }, | |
| 3628 | - activateSettingsTab: function activateSettingsTab(tabElement) { | |
| 3629 | - if (!(tabElement !== null && tabElement !== void 0 && tabElement.hash)) return; | |
| 3630 | - var hrefWithoutHash = location.href.replace(/#.*/, ""); | |
| 3631 | - history.pushState({}, "", hrefWithoutHash + tabElement.hash); | |
| 3632 | - this.goToSettingsTabFromHash(); | |
| 3633 | - }, | |
| 3634 | - goToSettingsTabFromHash: function goToSettingsTabFromHash() { | |
| 3635 | - var hash = location.hash.slice(1); | |
| 3636 | - if (hash) this.goToSettingsTab(hash); | |
| 3637 | - }, | |
| 3638 | - goToSettingsTab: function goToSettingsTab(tabName) { | |
| 3639 | - var $pages = this.elements.$settingsFormPages; | |
| 3640 | - if (!$pages.length) return; | |
| 3641 | - var $activePage = $pages.filter("#" + tabName); | |
| 3642 | - this.elements.$activeSettingsPage.removeClass("elementor-active"); | |
| 3643 | - this.elements.$activeSettingsTab.removeClass("nav-tab-active"); | |
| 3644 | - var $activeTab = this.elements.$settingsTabs.filter("#elementor-settings-" + tabName); | |
| 3645 | - $activePage.addClass("elementor-active"); | |
| 3646 | - $activeTab.addClass("nav-tab-active"); | |
| 3647 | - this.elements.$settingsForm.attr("action", "options.php#" + tabName); | |
| 3648 | - this.elements.$activeSettingsPage = $activePage; | |
| 3649 | - this.elements.$activeSettingsTab = $activeTab; | |
| 3650 | - }, | |
| 3651 | - translate: function translate(stringKey, templateArgs) { | |
| 3652 | - return elementorCommon.translate(stringKey, null, templateArgs, this.config.i18n); | |
| 3653 | - }, | |
| 3654 | - roleManager: { | |
| 3655 | - selectors: { | |
| 3656 | - body: "elementor-role-manager", | |
| 3657 | - row: ".elementor-role-row", | |
| 3658 | - label: ".elementor-role-label", | |
| 3659 | - excludedIndicator: ".elementor-role-excluded-indicator", | |
| 3660 | - excludedField: "input[name=\"elementor_exclude_user_roles[]\"]", | |
| 3661 | - controlsContainer: ".elementor-role-controls", | |
| 3662 | - toggleHandle: ".elementor-role-toggle", | |
| 3663 | - arrowUp: "dashicons-arrow-up", | |
| 3664 | - arrowDown: "dashicons-arrow-down" | |
| 3665 | - }, | |
| 3666 | - toggle: function toggle($trigger) { | |
| 3667 | - var self = this; | |
| 3668 | - var $row = $trigger.closest(self.selectors.row); | |
| 3669 | - var $toggleHandleIcon = $row.find(self.selectors.toggleHandle).find(".dashicons"); | |
| 3670 | - var $controls = $row.find(self.selectors.controlsContainer); | |
| 3671 | - $controls.toggleClass("hidden"); | |
| 3672 | - if ($controls.hasClass("hidden")) $toggleHandleIcon.removeClass(self.selectors.arrowUp).addClass(self.selectors.arrowDown); | |
| 3673 | - else $toggleHandleIcon.removeClass(self.selectors.arrowDown).addClass(self.selectors.arrowUp); | |
| 3674 | - self.updateLabel($row); | |
| 3675 | - }, | |
| 3676 | - updateLabel: function updateLabel($row) { | |
| 3677 | - var self = this; | |
| 3678 | - var $indicator = $row.find(self.selectors.excludedIndicator); | |
| 3679 | - var excluded = $row.find(self.selectors.excludedField).is(":checked"); | |
| 3680 | - if (excluded) $indicator.html($indicator.data("excluded-label")); | |
| 3681 | - else $indicator.html(""); | |
| 3682 | - self.setAdvancedState($row, excluded); | |
| 3683 | - }, | |
| 3684 | - setAdvancedState: function setAdvancedState($row, state) { | |
| 3685 | - var self = this; | |
| 3686 | - $row.find("input[type=\"checkbox\"]").not(self.selectors.excludedField).each(function(index, input) { | |
| 3687 | - $(input).prop("disabled", state); | |
| 3688 | - }); | |
| 3689 | - }, | |
| 3690 | - bind: function bind() { | |
| 3691 | - var self = this; | |
| 3692 | - $(document).on("click", self.selectors.label + "," + self.selectors.toggleHandle, function(event) { | |
| 3693 | - event.stopPropagation(); | |
| 3694 | - event.preventDefault(); | |
| 3695 | - self.toggle($(this)); | |
| 3696 | - }).on("change", self.selectors.excludedField, function() { | |
| 3697 | - self.updateLabel($(this).closest(self.selectors.row)); | |
| 3698 | - }); | |
| 3699 | - }, | |
| 3700 | - init: function init() { | |
| 3701 | - var self = this; | |
| 3702 | - if (!$("body[class*=\"" + self.selectors.body + "\"]").length) return; | |
| 3703 | - self.bind(); | |
| 3704 | - $(self.selectors.row).each(function(index, row) { | |
| 3705 | - self.updateLabel($(row)); | |
| 3706 | - }); | |
| 3707 | - } | |
| 3708 | - } | |
| 3709 | - }); | |
| 3710 | - $(function() { | |
| 3711 | - window.elementorAdmin = new ElementorAdmin(); | |
| 3712 | - Events.dispatch(elementorCommon.elements.$window, "elementor/admin/init"); | |
| 3713 | - }); | |
| 3714 | - })(jQuery); | |
| 3715 | 848 | |
| 3716 | -//#endregion | |
| 3717 | -})(wp.i18n); | |
| 849 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 850 | +Object.defineProperty(exports, "__esModule", ({ | |
| 851 | + value: true | |
| 852 | +})); | |
| 853 | +exports["default"] = void 0; | |
| 854 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 855 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 856 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 857 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 858 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 859 | +var _landingPages = _interopRequireDefault(__webpack_require__(/*! ./landing-pages */ "../modules/landing-pages/assets/js/admin/landing-pages.js")); | |
| 860 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 861 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 862 | +var _default = /*#__PURE__*/function (_elementorModules$Mod) { | |
| 863 | + (0, _inherits2.default)(_default, _elementorModules$Mod); | |
| 864 | + var _super = _createSuper(_default); | |
| 865 | + function _default() { | |
| 866 | + var _this; | |
| 867 | + (0, _classCallCheck2.default)(this, _default); | |
| 868 | + _this = _super.call(this); | |
| 869 | + elementorCommon.elements.$window.on('elementor/admin/init', function () { | |
| 870 | + _this.runHandler(); | |
| 871 | + }); | |
| 872 | + return _this; | |
| 873 | + } | |
| 874 | + (0, _createClass2.default)(_default, [{ | |
| 875 | + key: "runHandler", | |
| 876 | + value: function runHandler() { | |
| 877 | + var _elementorAdmin$confi, _elementorAdmin$confi2; | |
| 878 | + var pageName = 'e-landing-page', | |
| 879 | + paths = { | |
| 880 | + landingPagesTablePage: 'edit.php?post_type=' + pageName, | |
| 881 | + landingPagesAddNewPage: 'edit.php?post_type=elementor_library&page=' + pageName, | |
| 882 | + landingPagesTrashPage: 'edit.php?post_status=trash&post_type=' + pageName | |
| 883 | + }, | |
| 884 | + args = { | |
| 885 | + path: (_elementorAdmin$confi = elementorAdmin.config.landingPages) !== null && _elementorAdmin$confi !== void 0 && _elementorAdmin$confi.landingPagesHasPages ? paths.landingPagesTablePage : paths.landingPagesAddNewPage, | |
| 886 | + isLandingPageAdminEdit: (_elementorAdmin$confi2 = elementorAdmin.config.landingPages) === null || _elementorAdmin$confi2 === void 0 ? void 0 : _elementorAdmin$confi2.isLandingPageAdminEdit, | |
| 887 | + paths: paths | |
| 888 | + }; | |
| 889 | + | |
| 890 | + // This class modifies elements in the WordPress admin that are rendered "wrong" by the WordPress core | |
| 891 | + // and could not be modified in the backend. | |
| 892 | + new _landingPages.default(args); | |
| 893 | + } | |
| 894 | + }]); | |
| 895 | + return _default; | |
| 896 | +}(elementorModules.Module); | |
| 897 | +exports["default"] = _default; | |
| 898 | + | |
| 899 | +/***/ }), | |
| 900 | + | |
| 901 | +/***/ "@wordpress/i18n": | |
| 902 | +/*!**************************!*\ | |
| 903 | + !*** external "wp.i18n" ***! | |
| 904 | + \**************************/ | |
| 905 | +/***/ ((module) => { | |
| 906 | + | |
| 907 | +"use strict"; | |
| 908 | +module.exports = wp.i18n; | |
| 909 | + | |
| 910 | +/***/ }), | |
| 911 | + | |
| 912 | +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 913 | +/*!******************************************************************!*\ | |
| 914 | + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 915 | + \******************************************************************/ | |
| 916 | +/***/ ((module) => { | |
| 917 | + | |
| 918 | +function _arrayLikeToArray(arr, len) { | |
| 919 | + if (len == null || len > arr.length) len = arr.length; | |
| 920 | + for (var i = 0, arr2 = new Array(len); i < len; i++) { | |
| 921 | + arr2[i] = arr[i]; | |
| 922 | + } | |
| 923 | + return arr2; | |
| 924 | +} | |
| 925 | +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 926 | + | |
| 927 | +/***/ }), | |
| 928 | + | |
| 929 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 930 | +/*!****************************************************************!*\ | |
| 931 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 932 | + \****************************************************************/ | |
| 933 | +/***/ ((module) => { | |
| 934 | + | |
| 935 | +function _arrayWithHoles(arr) { | |
| 936 | + if (Array.isArray(arr)) return arr; | |
| 937 | +} | |
| 938 | +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 939 | + | |
| 940 | +/***/ }), | |
| 941 | + | |
| 942 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": | |
| 943 | +/*!*******************************************************************!*\ | |
| 944 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! | |
| 945 | + \*******************************************************************/ | |
| 946 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 947 | + | |
| 948 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 949 | +function _arrayWithoutHoles(arr) { | |
| 950 | + if (Array.isArray(arr)) return arrayLikeToArray(arr); | |
| 951 | +} | |
| 952 | +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 953 | + | |
| 954 | +/***/ }), | |
| 955 | + | |
| 956 | +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 957 | +/*!***********************************************************************!*\ | |
| 958 | + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 959 | + \***********************************************************************/ | |
| 960 | +/***/ ((module) => { | |
| 961 | + | |
| 962 | +function _assertThisInitialized(self) { | |
| 963 | + if (self === void 0) { | |
| 964 | + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 965 | + } | |
| 966 | + return self; | |
| 967 | +} | |
| 968 | +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 969 | + | |
| 970 | +/***/ }), | |
| 971 | + | |
| 972 | +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 973 | +/*!****************************************************************!*\ | |
| 974 | + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 975 | + \****************************************************************/ | |
| 976 | +/***/ ((module) => { | |
| 977 | + | |
| 978 | +function _classCallCheck(instance, Constructor) { | |
| 979 | + if (!(instance instanceof Constructor)) { | |
| 980 | + throw new TypeError("Cannot call a class as a function"); | |
| 981 | + } | |
| 982 | +} | |
| 983 | +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 984 | + | |
| 985 | +/***/ }), | |
| 986 | + | |
| 987 | +/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 988 | +/*!*************************************************************!*\ | |
| 989 | + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 990 | + \*************************************************************/ | |
| 991 | +/***/ ((module) => { | |
| 992 | + | |
| 993 | +function _defineProperties(target, props) { | |
| 994 | + for (var i = 0; i < props.length; i++) { | |
| 995 | + var descriptor = props[i]; | |
| 996 | + descriptor.enumerable = descriptor.enumerable || false; | |
| 997 | + descriptor.configurable = true; | |
| 998 | + if ("value" in descriptor) descriptor.writable = true; | |
| 999 | + Object.defineProperty(target, descriptor.key, descriptor); | |
| 1000 | + } | |
| 1001 | +} | |
| 1002 | +function _createClass(Constructor, protoProps, staticProps) { | |
| 1003 | + if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
| 1004 | + if (staticProps) _defineProperties(Constructor, staticProps); | |
| 1005 | + Object.defineProperty(Constructor, "prototype", { | |
| 1006 | + writable: false | |
| 1007 | + }); | |
| 1008 | + return Constructor; | |
| 1009 | +} | |
| 1010 | +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1011 | + | |
| 1012 | +/***/ }), | |
| 1013 | + | |
| 1014 | +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 1015 | +/*!****************************************************************!*\ | |
| 1016 | + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 1017 | + \****************************************************************/ | |
| 1018 | +/***/ ((module) => { | |
| 1019 | + | |
| 1020 | +function _defineProperty(obj, key, value) { | |
| 1021 | + if (key in obj) { | |
| 1022 | + Object.defineProperty(obj, key, { | |
| 1023 | + value: value, | |
| 1024 | + enumerable: true, | |
| 1025 | + configurable: true, | |
| 1026 | + writable: true | |
| 1027 | + }); | |
| 1028 | + } else { | |
| 1029 | + obj[key] = value; | |
| 1030 | + } | |
| 1031 | + return obj; | |
| 1032 | +} | |
| 1033 | +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1034 | + | |
| 1035 | +/***/ }), | |
| 1036 | + | |
| 1037 | +/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 1038 | +/*!*****************************************************!*\ | |
| 1039 | + !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 1040 | + \*****************************************************/ | |
| 1041 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1042 | + | |
| 1043 | +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 1044 | +function _get() { | |
| 1045 | + if (typeof Reflect !== "undefined" && Reflect.get) { | |
| 1046 | + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1047 | + } else { | |
| 1048 | + module.exports = _get = function _get(target, property, receiver) { | |
| 1049 | + var base = superPropBase(target, property); | |
| 1050 | + if (!base) return; | |
| 1051 | + var desc = Object.getOwnPropertyDescriptor(base, property); | |
| 1052 | + if (desc.get) { | |
| 1053 | + return desc.get.call(arguments.length < 3 ? target : receiver); | |
| 1054 | + } | |
| 1055 | + return desc.value; | |
| 1056 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1057 | + } | |
| 1058 | + return _get.apply(this, arguments); | |
| 1059 | +} | |
| 1060 | +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1061 | + | |
| 1062 | +/***/ }), | |
| 1063 | + | |
| 1064 | +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 1065 | +/*!****************************************************************!*\ | |
| 1066 | + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 1067 | + \****************************************************************/ | |
| 1068 | +/***/ ((module) => { | |
| 1069 | + | |
| 1070 | +function _getPrototypeOf(o) { | |
| 1071 | + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | |
| 1072 | + return o.__proto__ || Object.getPrototypeOf(o); | |
| 1073 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1074 | + return _getPrototypeOf(o); | |
| 1075 | +} | |
| 1076 | +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1077 | + | |
| 1078 | +/***/ }), | |
| 1079 | + | |
| 1080 | +/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 1081 | +/*!**********************************************************!*\ | |
| 1082 | + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 1083 | + \**********************************************************/ | |
| 1084 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1085 | + | |
| 1086 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 1087 | +function _inherits(subClass, superClass) { | |
| 1088 | + if (typeof superClass !== "function" && superClass !== null) { | |
| 1089 | + throw new TypeError("Super expression must either be null or a function"); | |
| 1090 | + } | |
| 1091 | + subClass.prototype = Object.create(superClass && superClass.prototype, { | |
| 1092 | + constructor: { | |
| 1093 | + value: subClass, | |
| 1094 | + writable: true, | |
| 1095 | + configurable: true | |
| 1096 | + } | |
| 1097 | + }); | |
| 1098 | + Object.defineProperty(subClass, "prototype", { | |
| 1099 | + writable: false | |
| 1100 | + }); | |
| 1101 | + if (superClass) setPrototypeOf(subClass, superClass); | |
| 1102 | +} | |
| 1103 | +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1104 | + | |
| 1105 | +/***/ }), | |
| 1106 | + | |
| 1107 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 1108 | +/*!***********************************************************************!*\ | |
| 1109 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 1110 | + \***********************************************************************/ | |
| 1111 | +/***/ ((module) => { | |
| 1112 | + | |
| 1113 | +function _interopRequireDefault(obj) { | |
| 1114 | + return obj && obj.__esModule ? obj : { | |
| 1115 | + "default": obj | |
| 1116 | + }; | |
| 1117 | +} | |
| 1118 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1119 | + | |
| 1120 | +/***/ }), | |
| 1121 | + | |
| 1122 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js": | |
| 1123 | +/*!*****************************************************************!*\ | |
| 1124 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***! | |
| 1125 | + \*****************************************************************/ | |
| 1126 | +/***/ ((module) => { | |
| 1127 | + | |
| 1128 | +function _iterableToArray(iter) { | |
| 1129 | + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | |
| 1130 | +} | |
| 1131 | +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1132 | + | |
| 1133 | +/***/ }), | |
| 1134 | + | |
| 1135 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 1136 | +/*!**********************************************************************!*\ | |
| 1137 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 1138 | + \**********************************************************************/ | |
| 1139 | +/***/ ((module) => { | |
| 1140 | + | |
| 1141 | +function _iterableToArrayLimit(arr, i) { | |
| 1142 | + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; | |
| 1143 | + if (_i == null) return; | |
| 1144 | + var _arr = []; | |
| 1145 | + var _n = true; | |
| 1146 | + var _d = false; | |
| 1147 | + var _s, _e; | |
| 1148 | + try { | |
| 1149 | + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { | |
| 1150 | + _arr.push(_s.value); | |
| 1151 | + if (i && _arr.length === i) break; | |
| 1152 | + } | |
| 1153 | + } catch (err) { | |
| 1154 | + _d = true; | |
| 1155 | + _e = err; | |
| 1156 | + } finally { | |
| 1157 | + try { | |
| 1158 | + if (!_n && _i["return"] != null) _i["return"](); | |
| 1159 | + } finally { | |
| 1160 | + if (_d) throw _e; | |
| 1161 | + } | |
| 1162 | + } | |
| 1163 | + return _arr; | |
| 1164 | +} | |
| 1165 | +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1166 | + | |
| 1167 | +/***/ }), | |
| 1168 | + | |
| 1169 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 1170 | +/*!*****************************************************************!*\ | |
| 1171 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 1172 | + \*****************************************************************/ | |
| 1173 | +/***/ ((module) => { | |
| 1174 | + | |
| 1175 | +function _nonIterableRest() { | |
| 1176 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 1177 | +} | |
| 1178 | +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1179 | + | |
| 1180 | +/***/ }), | |
| 1181 | + | |
| 1182 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js": | |
| 1183 | +/*!*******************************************************************!*\ | |
| 1184 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! | |
| 1185 | + \*******************************************************************/ | |
| 1186 | +/***/ ((module) => { | |
| 1187 | + | |
| 1188 | +function _nonIterableSpread() { | |
| 1189 | + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 1190 | +} | |
| 1191 | +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1192 | + | |
| 1193 | +/***/ }), | |
| 1194 | + | |
| 1195 | +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 1196 | +/*!***************************************************************************!*\ | |
| 1197 | + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 1198 | + \***************************************************************************/ | |
| 1199 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1200 | + | |
| 1201 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 1202 | +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 1203 | +function _possibleConstructorReturn(self, call) { | |
| 1204 | + if (call && (_typeof(call) === "object" || typeof call === "function")) { | |
| 1205 | + return call; | |
| 1206 | + } else if (call !== void 0) { | |
| 1207 | + throw new TypeError("Derived constructors may only return object or undefined"); | |
| 1208 | + } | |
| 1209 | + return assertThisInitialized(self); | |
| 1210 | +} | |
| 1211 | +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1212 | + | |
| 1213 | +/***/ }), | |
| 1214 | + | |
| 1215 | +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 1216 | +/*!****************************************************************!*\ | |
| 1217 | + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 1218 | + \****************************************************************/ | |
| 1219 | +/***/ ((module) => { | |
| 1220 | + | |
| 1221 | +function _setPrototypeOf(o, p) { | |
| 1222 | + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | |
| 1223 | + o.__proto__ = p; | |
| 1224 | + return o; | |
| 1225 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1226 | + return _setPrototypeOf(o, p); | |
| 1227 | +} | |
| 1228 | +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1229 | + | |
| 1230 | +/***/ }), | |
| 1231 | + | |
| 1232 | +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 1233 | +/*!***************************************************************!*\ | |
| 1234 | + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 1235 | + \***************************************************************/ | |
| 1236 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1237 | + | |
| 1238 | +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 1239 | +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 1240 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 1241 | +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 1242 | +function _slicedToArray(arr, i) { | |
| 1243 | + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); | |
| 1244 | +} | |
| 1245 | +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1246 | + | |
| 1247 | +/***/ }), | |
| 1248 | + | |
| 1249 | +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 1250 | +/*!***************************************************************!*\ | |
| 1251 | + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 1252 | + \***************************************************************/ | |
| 1253 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1254 | + | |
| 1255 | +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 1256 | +function _superPropBase(object, property) { | |
| 1257 | + while (!Object.prototype.hasOwnProperty.call(object, property)) { | |
| 1258 | + object = getPrototypeOf(object); | |
| 1259 | + if (object === null) break; | |
| 1260 | + } | |
| 1261 | + return object; | |
| 1262 | +} | |
| 1263 | +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1264 | + | |
| 1265 | +/***/ }), | |
| 1266 | + | |
| 1267 | +/***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js": | |
| 1268 | +/*!*******************************************************************!*\ | |
| 1269 | + !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***! | |
| 1270 | + \*******************************************************************/ | |
| 1271 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1272 | + | |
| 1273 | +var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"); | |
| 1274 | +var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js"); | |
| 1275 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 1276 | +var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js"); | |
| 1277 | +function _toConsumableArray(arr) { | |
| 1278 | + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); | |
| 1279 | +} | |
| 1280 | +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1281 | + | |
| 1282 | +/***/ }), | |
| 1283 | + | |
| 1284 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 1285 | +/*!********************************************************!*\ | |
| 1286 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 1287 | + \********************************************************/ | |
| 1288 | +/***/ ((module) => { | |
| 1289 | + | |
| 1290 | +function _typeof(obj) { | |
| 1291 | + "@babel/helpers - typeof"; | |
| 1292 | + | |
| 1293 | + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | |
| 1294 | + return typeof obj; | |
| 1295 | + } : function (obj) { | |
| 1296 | + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
| 1297 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj); | |
| 1298 | +} | |
| 1299 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1300 | + | |
| 1301 | +/***/ }), | |
| 1302 | + | |
| 1303 | +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 1304 | +/*!****************************************************************************!*\ | |
| 1305 | + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 1306 | + \****************************************************************************/ | |
| 1307 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1308 | + | |
| 1309 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 1310 | +function _unsupportedIterableToArray(o, minLen) { | |
| 1311 | + if (!o) return; | |
| 1312 | + if (typeof o === "string") return arrayLikeToArray(o, minLen); | |
| 1313 | + var n = Object.prototype.toString.call(o).slice(8, -1); | |
| 1314 | + if (n === "Object" && o.constructor) n = o.constructor.name; | |
| 1315 | + if (n === "Map" || n === "Set") return Array.from(o); | |
| 1316 | + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); | |
| 1317 | +} | |
| 1318 | +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 1319 | + | |
| 1320 | +/***/ }) | |
| 1321 | + | |
| 1322 | +/******/ }); | |
| 1323 | +/************************************************************************/ | |
| 1324 | +/******/ // The module cache | |
| 1325 | +/******/ var __webpack_module_cache__ = {}; | |
| 1326 | +/******/ | |
| 1327 | +/******/ // The require function | |
| 1328 | +/******/ function __webpack_require__(moduleId) { | |
| 1329 | +/******/ // Check if module is in cache | |
| 1330 | +/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 1331 | +/******/ if (cachedModule !== undefined) { | |
| 1332 | +/******/ return cachedModule.exports; | |
| 1333 | +/******/ } | |
| 1334 | +/******/ // Create a new module (and put it into the cache) | |
| 1335 | +/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 1336 | +/******/ // no module.id needed | |
| 1337 | +/******/ // no module.loaded needed | |
| 1338 | +/******/ exports: {} | |
| 1339 | +/******/ }; | |
| 1340 | +/******/ | |
| 1341 | +/******/ // Execute the module function | |
| 1342 | +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 1343 | +/******/ | |
| 1344 | +/******/ // Return the exports of the module | |
| 1345 | +/******/ return module.exports; | |
| 1346 | +/******/ } | |
| 1347 | +/******/ | |
| 1348 | +/************************************************************************/ | |
| 1349 | +var __webpack_exports__ = {}; | |
| 1350 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 1351 | +(() => { | |
| 1352 | +"use strict"; | |
| 1353 | +/*!***************************************!*\ | |
| 1354 | + !*** ../assets/dev/js/admin/admin.js ***! | |
| 1355 | + \***************************************/ | |
| 1356 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 1357 | + | |
| 1358 | + | |
| 1359 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1360 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1361 | +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/modules/landing-pages/assets/js/admin/module */ "../modules/landing-pages/assets/js/admin/module.js")); | |
| 1362 | +var _module2 = _interopRequireDefault(__webpack_require__(/*! elementor/core/experiments/assets/js/admin/module */ "../core/experiments/assets/js/admin/module.js")); | |
| 1363 | +var _environment = _interopRequireDefault(__webpack_require__(/*! ../../../../core/common/assets/js/utils/environment */ "../core/common/assets/js/utils/environment.js")); | |
| 1364 | +var _events = _interopRequireDefault(__webpack_require__(/*! elementor-utils/events */ "../assets/dev/js/utils/events.js")); | |
| 1365 | +var _filesUploadHandler = _interopRequireDefault(__webpack_require__(/*! ../editor/utils/files-upload-handler */ "../assets/dev/js/editor/utils/files-upload-handler.js")); | |
| 1366 | +var _templateControls = _interopRequireDefault(__webpack_require__(/*! ./new-template/template-controls.js */ "../assets/dev/js/admin/new-template/template-controls.js")); | |
| 1367 | +(function ($) { | |
| 1368 | + var ElementorAdmin = elementorModules.ViewModule.extend({ | |
| 1369 | + maintenanceMode: null, | |
| 1370 | + config: elementorAdminConfig, | |
| 1371 | + getDefaultElements: function getDefaultElements() { | |
| 1372 | + var elements = { | |
| 1373 | + $switchMode: $('#elementor-switch-mode'), | |
| 1374 | + $goToEditLink: $('#elementor-go-to-edit-page-link'), | |
| 1375 | + $switchModeInput: $('#elementor-switch-mode-input'), | |
| 1376 | + $switchModeButton: $('#elementor-switch-mode-button'), | |
| 1377 | + $elementorLoader: $('.elementor-loader'), | |
| 1378 | + $builderEditor: $('#elementor-editor'), | |
| 1379 | + $importButton: $('#elementor-import-template-trigger'), | |
| 1380 | + $importNowButton: $('#e-import-template-action'), | |
| 1381 | + $importArea: $('#elementor-import-template-area'), | |
| 1382 | + $importForm: $('#elementor-import-template-form'), | |
| 1383 | + $importFormFileInput: $('#elementor-import-template-form input[type="file"]'), | |
| 1384 | + $settingsForm: $('#elementor-settings-form'), | |
| 1385 | + $settingsTabsWrapper: $('#elementor-settings-tabs-wrapper'), | |
| 1386 | + $menuGetHelpLink: $('a[href="admin.php?page=go_knowledge_base_site"]'), | |
| 1387 | + $menuGoProLink: $('a[href="admin.php?page=go_elementor_pro"]'), | |
| 1388 | + $reMigrateGlobalsButton: $('.elementor-re-migrate-globals-button') | |
| 1389 | + }; | |
| 1390 | + elements.$settingsFormPages = elements.$settingsForm.find('.elementor-settings-form-page'); | |
| 1391 | + elements.$activeSettingsPage = elements.$settingsFormPages.filter('.elementor-active'); | |
| 1392 | + elements.$settingsTabs = elements.$settingsTabsWrapper.children(); | |
| 1393 | + elements.$activeSettingsTab = elements.$settingsTabs.filter('.nav-tab-active'); | |
| 1394 | + return elements; | |
| 1395 | + }, | |
| 1396 | + toggleStatus: function toggleStatus() { | |
| 1397 | + var isElementorMode = this.isElementorMode(); | |
| 1398 | + elementorCommon.elements.$body.toggleClass('elementor-editor-active', isElementorMode).toggleClass('elementor-editor-inactive', !isElementorMode); | |
| 1399 | + }, | |
| 1400 | + bindEvents: function bindEvents() { | |
| 1401 | + var self = this; | |
| 1402 | + self.elements.$switchModeButton.on('click', function (event) { | |
| 1403 | + event.preventDefault(); | |
| 1404 | + if (self.isElementorMode()) { | |
| 1405 | + elementorCommon.dialogsManager.createWidget('confirm', { | |
| 1406 | + message: __('Please note that you are switching to WordPress default editor. Your current layout, design and content might break.', 'elementor'), | |
| 1407 | + headerMessage: __('Back to WordPress Editor', 'elementor'), | |
| 1408 | + strings: { | |
| 1409 | + confirm: __('Continue', 'elementor'), | |
| 1410 | + cancel: __('Cancel', 'elementor') | |
| 1411 | + }, | |
| 1412 | + defaultOption: 'confirm', | |
| 1413 | + onConfirm: function onConfirm() { | |
| 1414 | + self.elements.$switchModeInput.val(''); | |
| 1415 | + self.toggleStatus(); | |
| 1416 | + } | |
| 1417 | + }).show(); | |
| 1418 | + } else { | |
| 1419 | + self.elements.$switchModeInput.val(true); | |
| 1420 | + var $wpTitle = $('#title'); | |
| 1421 | + if (!$wpTitle.val()) { | |
| 1422 | + $wpTitle.val('Elementor #' + $('#post_ID').val()); | |
| 1423 | + } | |
| 1424 | + if (wp.autosave) { | |
| 1425 | + wp.autosave.server.triggerSave(); | |
| 1426 | + } | |
| 1427 | + self.animateLoader(); | |
| 1428 | + $(document).on('heartbeat-tick.autosave', function () { | |
| 1429 | + elementorCommon.elements.$window.off('beforeunload.edit-post'); | |
| 1430 | + location.href = self.elements.$goToEditLink.attr('href'); | |
| 1431 | + }); | |
| 1432 | + self.toggleStatus(); | |
| 1433 | + } | |
| 1434 | + }); | |
| 1435 | + self.elements.$goToEditLink.on('click', function () { | |
| 1436 | + self.animateLoader(); | |
| 1437 | + }); | |
| 1438 | + $('.e-notice--dismissible').on('click', '.e-notice__dismiss, .e-notice-dismiss', function (event) { | |
| 1439 | + event.preventDefault(); | |
| 1440 | + var $wrapperElm = $(this).closest('.e-notice--dismissible'); | |
| 1441 | + $.post(ajaxurl, { | |
| 1442 | + action: 'elementor_set_admin_notice_viewed', | |
| 1443 | + notice_id: $wrapperElm.data('notice_id') | |
| 1444 | + }); | |
| 1445 | + $wrapperElm.fadeTo(100, 0, function () { | |
| 1446 | + $wrapperElm.slideUp(100, function () { | |
| 1447 | + $wrapperElm.remove(); | |
| 1448 | + }); | |
| 1449 | + }); | |
| 1450 | + }); | |
| 1451 | + $('#elementor-clear-cache-button').on('click', function (event) { | |
| 1452 | + event.preventDefault(); | |
| 1453 | + var $thisButton = $(this); | |
| 1454 | + $thisButton.removeClass('success').addClass('loading'); | |
| 1455 | + $.post(ajaxurl, { | |
| 1456 | + action: 'elementor_clear_cache', | |
| 1457 | + _nonce: $thisButton.data('nonce') | |
| 1458 | + }).done(function () { | |
| 1459 | + $thisButton.removeClass('loading').addClass('success'); | |
| 1460 | + }); | |
| 1461 | + }); | |
| 1462 | + $('#elementor-library-sync-button').on('click', function (event) { | |
| 1463 | + event.preventDefault(); | |
| 1464 | + var $thisButton = $(this); | |
| 1465 | + $thisButton.removeClass('success').addClass('loading'); | |
| 1466 | + $.post(ajaxurl, { | |
| 1467 | + action: 'elementor_reset_library', | |
| 1468 | + _nonce: $thisButton.data('nonce') | |
| 1469 | + }).done(function () { | |
| 1470 | + $thisButton.removeClass('loading').addClass('success'); | |
| 1471 | + }); | |
| 1472 | + }); | |
| 1473 | + $('#elementor-recreate-kit-button').on('click', function (event) { | |
| 1474 | + event.preventDefault(); | |
| 1475 | + var $thisButton = $(this); | |
| 1476 | + $thisButton.removeClass('success error').addClass('loading').next('.e-recreate-kit-error-message').remove(); | |
| 1477 | + $.post(ajaxurl, { | |
| 1478 | + action: 'elementor_recreate_kit', | |
| 1479 | + _nonce: $thisButton.data('nonce') | |
| 1480 | + }).done(function () { | |
| 1481 | + $thisButton.removeClass('loading').addClass('success'); | |
| 1482 | + }).fail(function (_ref) { | |
| 1483 | + var _responseJSON$data; | |
| 1484 | + var responseJSON = _ref.responseJSON; | |
| 1485 | + $thisButton.removeClass('loading').addClass('error'); | |
| 1486 | + if ((_responseJSON$data = responseJSON.data) !== null && _responseJSON$data !== void 0 && _responseJSON$data.message) { | |
| 1487 | + $thisButton.after("<div class=\"e-recreate-kit-error-message\">".concat(responseJSON.data.message, "</div>")); | |
| 1488 | + } | |
| 1489 | + }); | |
| 1490 | + }); | |
| 1491 | + $('#elementor-replace-url-button').on('click', function (event) { | |
| 1492 | + event.preventDefault(); | |
| 1493 | + var $this = $(this), | |
| 1494 | + $tr = $this.parents('tr'), | |
| 1495 | + $from = $tr.find('[name="from"]'), | |
| 1496 | + $to = $tr.find('[name="to"]'); | |
| 1497 | + $this.removeClass('success').addClass('loading'); | |
| 1498 | + $.post(ajaxurl, { | |
| 1499 | + action: 'elementor_replace_url', | |
| 1500 | + from: $from.val(), | |
| 1501 | + to: $to.val(), | |
| 1502 | + _nonce: $this.data('nonce') | |
| 1503 | + }).done(function (response) { | |
| 1504 | + $this.removeClass('loading'); | |
| 1505 | + if (response.success) { | |
| 1506 | + $this.addClass('success'); | |
| 1507 | + } | |
| 1508 | + elementorCommon.dialogsManager.createWidget('alert', { | |
| 1509 | + message: response.data | |
| 1510 | + }).show(); | |
| 1511 | + }); | |
| 1512 | + }); | |
| 1513 | + $('#elementor_upgrade_fa_button').on('click', function (event) { | |
| 1514 | + event.preventDefault(); | |
| 1515 | + var $updateButton = $(this); | |
| 1516 | + $updateButton.addClass('loading'); | |
| 1517 | + elementorCommon.dialogsManager.createWidget('confirm', { | |
| 1518 | + id: 'confirm_fa_migration_admin_modal', | |
| 1519 | + message: __('I understand that by upgrading to Font Awesome 5,', 'elementor') + '<br>' + __('I acknowledge that some changes may affect my website and that this action cannot be undone.', 'elementor'), | |
| 1520 | + headerMessage: __('Font Awesome 5 Migration', 'elementor'), | |
| 1521 | + strings: { | |
| 1522 | + confirm: __('Continue', 'elementor'), | |
| 1523 | + cancel: __('Cancel', 'elementor') | |
| 1524 | + }, | |
| 1525 | + defaultOption: 'confirm', | |
| 1526 | + onConfirm: function onConfirm() { | |
| 1527 | + $updateButton.removeClass('error').addClass('loading'); | |
| 1528 | + var _$updateButton$data = $updateButton.data(), | |
| 1529 | + _nonce = _$updateButton$data._nonce, | |
| 1530 | + action = _$updateButton$data.action, | |
| 1531 | + redirectUrl = _$updateButton$data.redirectUrl; | |
| 1532 | + $.post(ajaxurl, { | |
| 1533 | + action: action, | |
| 1534 | + _nonce: _nonce | |
| 1535 | + }).done(function (response) { | |
| 1536 | + $updateButton.removeClass('loading').addClass('success'); | |
| 1537 | + var messageElement = document.createElement('p'); | |
| 1538 | + messageElement.appendChild(document.createTextNode(response.data.message)); | |
| 1539 | + $('#elementor_upgrade_fa_button').parent().append(messageElement); | |
| 1540 | + if (redirectUrl) { | |
| 1541 | + location.href = decodeURIComponent(redirectUrl); | |
| 1542 | + return; | |
| 1543 | + } | |
| 1544 | + history.go(-1); | |
| 1545 | + }).fail(function () { | |
| 1546 | + $updateButton.removeClass('loading').addClass('error'); | |
| 1547 | + }); | |
| 1548 | + }, | |
| 1549 | + onCancel: function onCancel() { | |
| 1550 | + $updateButton.removeClass('loading').addClass('error'); | |
| 1551 | + } | |
| 1552 | + }).show(); | |
| 1553 | + }); | |
| 1554 | + self.elements.$settingsTabs.on({ | |
| 1555 | + click: function click(event) { | |
| 1556 | + event.preventDefault(); | |
| 1557 | + event.currentTarget.focus(); // Safari does not focus the tab automatically | |
| 1558 | + }, | |
| 1559 | + focus: function focus() { | |
| 1560 | + // Using focus event to enable navigation by tab key | |
| 1561 | + var hrefWithoutHash = location.href.replace(/#.*/, ''); | |
| 1562 | + history.pushState({}, '', hrefWithoutHash + this.hash); | |
| 1563 | + self.goToSettingsTabFromHash(); | |
| 1564 | + } | |
| 1565 | + }); | |
| 1566 | + $('select.elementor-rollback-select').on('change', function () { | |
| 1567 | + var $this = $(this), | |
| 1568 | + $rollbackButton = $this.next('.elementor-rollback-button'), | |
| 1569 | + placeholderText = $rollbackButton.data('placeholder-text'), | |
| 1570 | + placeholderUrl = $rollbackButton.data('placeholder-url'); | |
| 1571 | + $rollbackButton.html(placeholderText.replace('{VERSION}', $this.val())); | |
| 1572 | + $rollbackButton.attr('href', placeholderUrl.replace('VERSION', $this.val())); | |
| 1573 | + }).trigger('change'); | |
| 1574 | + $('.elementor-rollback-button').on('click', function (event) { | |
| 1575 | + event.preventDefault(); | |
| 1576 | + var $this = $(this); | |
| 1577 | + elementorCommon.dialogsManager.createWidget('confirm', { | |
| 1578 | + headerMessage: __('Rollback to Previous Version', 'elementor'), | |
| 1579 | + message: __('Are you sure you want to reinstall previous version?', 'elementor'), | |
| 1580 | + strings: { | |
| 1581 | + confirm: __('Continue', 'elementor'), | |
| 1582 | + cancel: __('Cancel', 'elementor') | |
| 1583 | + }, | |
| 1584 | + onConfirm: function onConfirm() { | |
| 1585 | + $this.addClass('loading'); | |
| 1586 | + location.href = $this.attr('href'); | |
| 1587 | + } | |
| 1588 | + }).show(); | |
| 1589 | + }); | |
| 1590 | + self.elements.$reMigrateGlobalsButton.on('click', function (event) { | |
| 1591 | + event.preventDefault(); | |
| 1592 | + var $this = $(event.currentTarget); | |
| 1593 | + elementorCommon.dialogsManager.createWidget('confirm', { | |
| 1594 | + headerMessage: __('Migrate to v3.0', 'elementor'), | |
| 1595 | + message: __('Please note that this process will revert all changes made to Global Colors and Fonts since upgrading to v3.x.', 'elementor'), | |
| 1596 | + strings: { | |
| 1597 | + confirm: __('Continue', 'elementor'), | |
| 1598 | + cancel: __('Cancel', 'elementor') | |
| 1599 | + }, | |
| 1600 | + onConfirm: function onConfirm() { | |
| 1601 | + $this.removeClass('success').addClass('loading'); | |
| 1602 | + elementorCommon.ajax.addRequest('re_migrate_globals', { | |
| 1603 | + success: function success() { | |
| 1604 | + return $this.removeClass('loading').addClass('success'); | |
| 1605 | + } | |
| 1606 | + }); | |
| 1607 | + } | |
| 1608 | + }).show(); | |
| 1609 | + }); | |
| 1610 | + $('.elementor_css_print_method select').on('change', function () { | |
| 1611 | + var $descriptions = $('.elementor-css-print-method-description'); | |
| 1612 | + $descriptions.hide(); | |
| 1613 | + $descriptions.filter('[data-value="' + $(this).val() + '"]').show(); | |
| 1614 | + }).trigger('change'); | |
| 1615 | + }, | |
| 1616 | + onInit: function onInit() { | |
| 1617 | + elementorModules.ViewModule.prototype.onInit.apply(this, arguments); | |
| 1618 | + this.initTemplatesImport(); | |
| 1619 | + this.initMaintenanceMode(); | |
| 1620 | + this.goToSettingsTabFromHash(); | |
| 1621 | + this.openLinksInNewTab(); | |
| 1622 | + this.addUserAgentClasses(); | |
| 1623 | + this.roleManager.init(); | |
| 1624 | + if (elementorCommon.config.experimentalFeatures['landing-pages']) { | |
| 1625 | + new _module.default(); | |
| 1626 | + } | |
| 1627 | + this.templateControls = new _templateControls.default(); | |
| 1628 | + new _module2.default(); | |
| 1629 | + }, | |
| 1630 | + addUserAgentClasses: function addUserAgentClasses() { | |
| 1631 | + var body = document.querySelector('body'); | |
| 1632 | + Object.entries(_environment.default).forEach(function (_ref2) { | |
| 1633 | + var _ref3 = (0, _slicedToArray2.default)(_ref2, 2), | |
| 1634 | + key = _ref3[0], | |
| 1635 | + value = _ref3[1]; | |
| 1636 | + if (!value) { | |
| 1637 | + return; | |
| 1638 | + } | |
| 1639 | + body.classList.add('e--ua-' + key); | |
| 1640 | + }); | |
| 1641 | + }, | |
| 1642 | + /** | |
| 1643 | + * Open Links in New Tab | |
| 1644 | + * | |
| 1645 | + * Adds a `target="_blank"` attribute to the Admin Dashboard menu items specified in the `elements` array, | |
| 1646 | + * if the elements are found in the DOM. The items in the `elements` array should be jQuery instances. | |
| 1647 | + * | |
| 1648 | + * @since 3.6.0 | |
| 1649 | + */ | |
| 1650 | + openLinksInNewTab: function openLinksInNewTab() { | |
| 1651 | + var elements = [this.elements.$menuGetHelpLink, this.elements.$menuGoProLink]; | |
| 1652 | + elements.forEach(function ($element) { | |
| 1653 | + // Only add the attribute if the element is found. | |
| 1654 | + if ($element.length) { | |
| 1655 | + $element.attr('target', '_blank'); | |
| 1656 | + } | |
| 1657 | + }); | |
| 1658 | + }, | |
| 1659 | + initTemplatesImport: function initTemplatesImport() { | |
| 1660 | + if (!elementorCommon.elements.$body.hasClass('post-type-elementor_library')) { | |
| 1661 | + return; | |
| 1662 | + } | |
| 1663 | + var self = this, | |
| 1664 | + $importForm = self.elements.$importForm, | |
| 1665 | + $importButton = self.elements.$importButton, | |
| 1666 | + $importArea = self.elements.$importArea, | |
| 1667 | + $importNowButton = self.elements.$importNowButton, | |
| 1668 | + $importFormFileInput = self.elements.$importFormFileInput; | |
| 1669 | + self.elements.$formAnchor = $('.wp-header-end'); | |
| 1670 | + $('#wpbody-content').find('.page-title-action').last().after($importButton); | |
| 1671 | + self.elements.$formAnchor.after($importArea); | |
| 1672 | + $importButton.on('click', function () { | |
| 1673 | + $('#elementor-import-template-area').toggle(); | |
| 1674 | + }); | |
| 1675 | + $importForm.on('submit', function (event) { | |
| 1676 | + $importNowButton[0].disabled = true; | |
| 1677 | + $importNowButton[0].value = __('Importing...', 'elementor'); | |
| 1678 | + if ($importFormFileInput[0].files.length && !elementorCommon.config.filesUpload.unfilteredFiles) { | |
| 1679 | + event.preventDefault(); | |
| 1680 | + var enableUnfilteredFilesModal = _filesUploadHandler.default.getUnfilteredFilesNotEnabledImportTemplateDialog(function () { | |
| 1681 | + $importForm.trigger('submit'); | |
| 1682 | + }); | |
| 1683 | + enableUnfilteredFilesModal.show(); | |
| 1684 | + } | |
| 1685 | + }); | |
| 1686 | + }, | |
| 1687 | + initMaintenanceMode: function initMaintenanceMode() { | |
| 1688 | + var MaintenanceMode = __webpack_require__(/*! elementor-admin/maintenance-mode */ "../assets/dev/js/admin/maintenance-mode.js"); | |
| 1689 | + this.maintenanceMode = new MaintenanceMode(); | |
| 1690 | + }, | |
| 1691 | + isElementorMode: function isElementorMode() { | |
| 1692 | + return !!this.elements.$switchModeInput.val(); | |
| 1693 | + }, | |
| 1694 | + animateLoader: function animateLoader() { | |
| 1695 | + this.elements.$goToEditLink.addClass('elementor-animate'); | |
| 1696 | + }, | |
| 1697 | + goToSettingsTabFromHash: function goToSettingsTabFromHash() { | |
| 1698 | + var hash = location.hash.slice(1); | |
| 1699 | + if (hash) { | |
| 1700 | + this.goToSettingsTab(hash); | |
| 1701 | + } | |
| 1702 | + }, | |
| 1703 | + goToSettingsTab: function goToSettingsTab(tabName) { | |
| 1704 | + var $pages = this.elements.$settingsFormPages; | |
| 1705 | + if (!$pages.length) { | |
| 1706 | + return; | |
| 1707 | + } | |
| 1708 | + var $activePage = $pages.filter('#' + tabName); | |
| 1709 | + this.elements.$activeSettingsPage.removeClass('elementor-active'); | |
| 1710 | + this.elements.$activeSettingsTab.removeClass('nav-tab-active'); | |
| 1711 | + var $activeTab = this.elements.$settingsTabs.filter('#elementor-settings-' + tabName); | |
| 1712 | + $activePage.addClass('elementor-active'); | |
| 1713 | + $activeTab.addClass('nav-tab-active'); | |
| 1714 | + this.elements.$settingsForm.attr('action', 'options.php#' + tabName); | |
| 1715 | + this.elements.$activeSettingsPage = $activePage; | |
| 1716 | + this.elements.$activeSettingsTab = $activeTab; | |
| 1717 | + }, | |
| 1718 | + translate: function translate(stringKey, templateArgs) { | |
| 1719 | + return elementorCommon.translate(stringKey, null, templateArgs, this.config.i18n); | |
| 1720 | + }, | |
| 1721 | + roleManager: { | |
| 1722 | + selectors: { | |
| 1723 | + body: 'elementor-role-manager', | |
| 1724 | + row: '.elementor-role-row', | |
| 1725 | + label: '.elementor-role-label', | |
| 1726 | + excludedIndicator: '.elementor-role-excluded-indicator', | |
| 1727 | + excludedField: 'input[name="elementor_exclude_user_roles[]"]', | |
| 1728 | + controlsContainer: '.elementor-role-controls', | |
| 1729 | + toggleHandle: '.elementor-role-toggle', | |
| 1730 | + arrowUp: 'dashicons-arrow-up', | |
| 1731 | + arrowDown: 'dashicons-arrow-down' | |
| 1732 | + }, | |
| 1733 | + toggle: function toggle($trigger) { | |
| 1734 | + var self = this, | |
| 1735 | + $row = $trigger.closest(self.selectors.row), | |
| 1736 | + $toggleHandleIcon = $row.find(self.selectors.toggleHandle).find('.dashicons'), | |
| 1737 | + $controls = $row.find(self.selectors.controlsContainer); | |
| 1738 | + $controls.toggleClass('hidden'); | |
| 1739 | + if ($controls.hasClass('hidden')) { | |
| 1740 | + $toggleHandleIcon.removeClass(self.selectors.arrowUp).addClass(self.selectors.arrowDown); | |
| 1741 | + } else { | |
| 1742 | + $toggleHandleIcon.removeClass(self.selectors.arrowDown).addClass(self.selectors.arrowUp); | |
| 1743 | + } | |
| 1744 | + self.updateLabel($row); | |
| 1745 | + }, | |
| 1746 | + updateLabel: function updateLabel($row) { | |
| 1747 | + var self = this, | |
| 1748 | + $indicator = $row.find(self.selectors.excludedIndicator), | |
| 1749 | + excluded = $row.find(self.selectors.excludedField).is(':checked'); | |
| 1750 | + if (excluded) { | |
| 1751 | + $indicator.html($indicator.data('excluded-label')); | |
| 1752 | + } else { | |
| 1753 | + $indicator.html(''); | |
| 1754 | + } | |
| 1755 | + self.setAdvancedState($row, excluded); | |
| 1756 | + }, | |
| 1757 | + setAdvancedState: function setAdvancedState($row, state) { | |
| 1758 | + var self = this, | |
| 1759 | + $controls = $row.find('input[type="checkbox"]').not(self.selectors.excludedField); | |
| 1760 | + $controls.each(function (index, input) { | |
| 1761 | + $(input).prop('disabled', state); | |
| 1762 | + }); | |
| 1763 | + }, | |
| 1764 | + bind: function bind() { | |
| 1765 | + var self = this; | |
| 1766 | + $(document).on('click', self.selectors.label + ',' + self.selectors.toggleHandle, function (event) { | |
| 1767 | + event.stopPropagation(); | |
| 1768 | + event.preventDefault(); | |
| 1769 | + self.toggle($(this)); | |
| 1770 | + }).on('change', self.selectors.excludedField, function () { | |
| 1771 | + self.updateLabel($(this).closest(self.selectors.row)); | |
| 1772 | + }); | |
| 1773 | + }, | |
| 1774 | + init: function init() { | |
| 1775 | + var self = this; | |
| 1776 | + if (!$('body[class*="' + self.selectors.body + '"]').length) { | |
| 1777 | + return; | |
| 1778 | + } | |
| 1779 | + self.bind(); | |
| 1780 | + $(self.selectors.row).each(function (index, row) { | |
| 1781 | + self.updateLabel($(row)); | |
| 1782 | + }); | |
| 1783 | + } | |
| 1784 | + } | |
| 1785 | + }); | |
| 1786 | + $(function () { | |
| 1787 | + window.elementorAdmin = new ElementorAdmin(); | |
| 1788 | + _events.default.dispatch(elementorCommon.elements.$window, 'elementor/admin/init'); | |
| 1789 | + }); | |
| 1790 | +})(jQuery); | |
| 1791 | +})(); | |
| 1792 | + | |
| 1793 | +/******/ })() | |
| 1794 | +; | |
| 3718 | 1795 | //# sourceMappingURL=admin.js.map |