PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0-beta3
Elementor Website Builder – more than just a page builder v4.3.0-beta3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / assets / js / app-loader.js

app-loader.js in Elementor Website Builder – more than just a page builder 4.3.0-beta3, at assets/js/app-loader.js

1,852 lines 56.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(_reduxjs_toolkit) {
2
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 __esmMin = (fn, res, err) => () => {
15 if (err) throw err[0];
16 try {
17 return fn && (res = fn(fn = 0)), res;
18 } catch (e) {
19 throw err = [e], e;
20 }
21 };
22 var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23 var __exportAll = (all, no_symbols) => {
24 let target = {};
25 for (var name in all) {
26 __defProp(target, name, {
27 get: all[name],
28 enumerable: true
29 });
30 }
31 if (!no_symbols) {
32 __defProp(target, Symbol.toStringTag, { value: "Module" });
33 }
34 return target;
35 };
36 var __copyProps = (to, from, except, desc) => {
37 if (from && typeof from === "object" || typeof from === "function") {
38 for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
39 key = keys[i];
40 if (!__hasOwnProp.call(to, key) && key !== except) {
41 __defProp(to, key, {
42 get: ((k) => from[k]).bind(null, key),
43 enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44 });
45 }
46 }
47 }
48 return to;
49 };
50 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
51 value: mod,
52 enumerable: true
53 }) : target, mod));
54
55 //#endregion
56
57 //#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
58 function _classCallCheck(a, n) {
59 if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
60 }
61
62 //#endregion
63 //#region node_modules/@babel/runtime/helpers/esm/typeof.js
64 function _typeof(o) {
65 "@babel/helpers - typeof";
66 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
67 return typeof o;
68 } : function(o) {
69 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
70 }, _typeof(o);
71 }
72 var init_typeof = __esmMin((() => {}));
73
74 //#endregion
75 //#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
76 init_typeof();
77 function toPrimitive(t, r) {
78 if ("object" != _typeof(t) || !t) return t;
79 var e = t[Symbol.toPrimitive];
80 if (void 0 !== e) {
81 var i = e.call(t, r || "default");
82 if ("object" != _typeof(i)) return i;
83 throw new TypeError("@@toPrimitive must return a primitive value.");
84 }
85 return ("string" === r ? String : Number)(t);
86 }
87
88 //#endregion
89 //#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
90 init_typeof();
91 function toPropertyKey(t) {
92 var i = toPrimitive(t, "string");
93 return "symbol" == _typeof(i) ? i : i + "";
94 }
95
96 //#endregion
97 //#region node_modules/@babel/runtime/helpers/esm/createClass.js
98 function _defineProperties(e, r) {
99 for (var t = 0; t < r.length; t++) {
100 var o = r[t];
101 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
102 }
103 }
104 function _createClass(e, r, t) {
105 return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
106 }
107
108 //#endregion
109 //#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
110 function _defineProperty(e, r, t) {
111 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
112 value: t,
113 enumerable: !0,
114 configurable: !0,
115 writable: !0
116 }) : e[r] = t, e;
117 }
118
119 //#endregion
120 //#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
121 function _assertThisInitialized(e) {
122 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
123 return e;
124 }
125
126 //#endregion
127 //#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
128 init_typeof();
129 function _possibleConstructorReturn(t, e) {
130 if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
131 if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
132 return _assertThisInitialized(t);
133 }
134
135 //#endregion
136 //#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
137 function _getPrototypeOf(t) {
138 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
139 return t.__proto__ || Object.getPrototypeOf(t);
140 }, _getPrototypeOf(t);
141 }
142
143 //#endregion
144 //#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
145 function _setPrototypeOf(t, e) {
146 return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
147 return t.__proto__ = e, t;
148 }, _setPrototypeOf(t, e);
149 }
150
151 //#endregion
152 //#region node_modules/@babel/runtime/helpers/esm/inherits.js
153 function _inherits(t, e) {
154 if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
155 t.prototype = Object.create(e && e.prototype, { constructor: {
156 value: t,
157 writable: !0,
158 configurable: !0
159 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
160 }
161
162 //#endregion
163 //#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
164 function _arrayWithHoles(r) {
165 if (Array.isArray(r)) return r;
166 }
167
168 //#endregion
169 //#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
170 function _iterableToArrayLimit(r, l) {
171 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
172 if (null != t) {
173 var e;
174 var n;
175 var i;
176 var u;
177 var a = [];
178 var f = !0;
179 var o = !1;
180 try {
181 if (i = (t = t.call(r)).next, 0 === l) {
182 if (Object(t) !== t) return;
183 f = !1;
184 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
185 } catch (r) {
186 o = !0, n = r;
187 } finally {
188 try {
189 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
190 } finally {
191 if (o) throw n;
192 }
193 }
194 return a;
195 }
196 }
197
198 //#endregion
199 //#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
200 function _arrayLikeToArray$1(r, a) {
201 (null == a || a > r.length) && (a = r.length);
202 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
203 return n;
204 }
205 __name(_arrayLikeToArray$1, "_arrayLikeToArray");
206
207 //#endregion
208 //#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
209 function _unsupportedIterableToArray$1(r, a) {
210 if (r) {
211 if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
212 var t = {}.toString.call(r).slice(8, -1);
213 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;
214 }
215 }
216 __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray");
217
218 //#endregion
219 //#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
220 function _nonIterableRest() {
221 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
222 }
223
224 //#endregion
225 //#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js
226 function _slicedToArray(r, e) {
227 return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest();
228 }
229
230 //#endregion
231 //#region node_modules/@babel/runtime/helpers/esm/superPropBase.js
232 function _superPropBase(t, o) {
233 for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
234 return t;
235 }
236
237 //#endregion
238 //#region node_modules/@babel/runtime/helpers/esm/get.js
239 function _get() {
240 return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
241 var p = _superPropBase(e, t);
242 if (p) {
243 var n = Object.getOwnPropertyDescriptor(p, t);
244 return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
245 }
246 }, _get.apply(null, arguments);
247 }
248
249 //#endregion
250 //#region assets/dev/js/modules/imports/instance-type.js
251 function _superPropGet(t, o, e, r) {
252 var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
253 return 2 & r && "function" == typeof p ? function(t) {
254 return p.apply(e, t);
255 } : p;
256 }
257 var InstanceType = /*#__PURE__*/ function() {
258 function InstanceType() {
259 var _this = this;
260 _classCallCheck(this, InstanceType);
261 var target = this instanceof InstanceType ? this.constructor : void 0;
262 var prototypes = [];
263 while (target.__proto__ && target.__proto__.name) {
264 prototypes.push(target.__proto__);
265 target = target.__proto__;
266 }
267 prototypes.reverse().forEach(function(proto) {
268 return _this instanceof proto;
269 });
270 }
271 return _createClass(InstanceType, null, [{
272 key: Symbol.hasInstance,
273 value: function value(target) {
274 /**
275 * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
276 * its give's opportunity to mange capabilities of instanceOf operator.
277 * saving current class each time will give option later to handle instanceOf manually.
278 */
279 var result = _superPropGet(InstanceType, Symbol.hasInstance, this, 2)([target]);
280 if (target && !target.constructor.getInstanceType) return result;
281 if (target) {
282 if (!target.instanceTypes) target.instanceTypes = [];
283 if (!result) {
284 if (this.getInstanceType() === target.constructor.getInstanceType()) result = true;
285 }
286 if (result) {
287 var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType();
288 if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name);
289 }
290 }
291 if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
292 return result;
293 }
294 }, {
295 key: "getInstanceType",
296 value: function getInstanceType() {
297 elementorModules.ForceMethodImplementation();
298 }
299 }]);
300 }();
301
302 //#endregion
303 //#region assets/dev/js/editor/utils/is-instanceof.js
304 function _createForOfIteratorHelper(r, e) {
305 var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
306 if (!t) {
307 if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
308 t && (r = t);
309 var _n = 0;
310 var F = function F() {};
311 return {
312 s: F,
313 n: function n() {
314 return _n >= r.length ? { done: !0 } : {
315 done: !1,
316 value: r[_n++]
317 };
318 },
319 e: function e(r) {
320 throw r;
321 },
322 f: F
323 };
324 }
325 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
326 }
327 var o;
328 var a = !0;
329 var u = !1;
330 return {
331 s: function s() {
332 t = t.call(r);
333 },
334 n: function n() {
335 var r = t.next();
336 return a = r.done, r;
337 },
338 e: function e(r) {
339 u = !0, o = r;
340 },
341 f: function f() {
342 try {
343 a || null == t.return || t.return();
344 } finally {
345 if (u) throw o;
346 }
347 }
348 };
349 }
350 function _unsupportedIterableToArray(r, a) {
351 if (r) {
352 if ("string" == typeof r) return _arrayLikeToArray(r, a);
353 var t = {}.toString.call(r).slice(8, -1);
354 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;
355 }
356 }
357 function _arrayLikeToArray(r, a) {
358 (null == a || a > r.length) && (a = r.length);
359 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
360 return n;
361 }
362 /**
363 * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
364 * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
365 * check whether it's instanceof by using the objects constructor and prototype names.
366 *
367 * @param object
368 * @param constructors
369 * @return {boolean}
370 */
371 var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) {
372 constructors = Array.isArray(constructors) ? constructors : [constructors];
373 var _iterator = _createForOfIteratorHelper(constructors);
374 var _step;
375 try {
376 for (_iterator.s(); !(_step = _iterator.n()).done;) {
377 var constructor = _step.value;
378 if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true;
379 }
380 } catch (err) {
381 _iterator.e(err);
382 } finally {
383 _iterator.f();
384 }
385 return false;
386 }), "default");
387
388 //#endregion
389 //#region assets/dev/js/modules/imports/args-object.js
390 init_typeof();
391 function _callSuper$9(t, o, e) {
392 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
393 }
394 __name(_callSuper$9, "_callSuper");
395 function _isNativeReflectConstruct$10() {
396 try {
397 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
398 } catch (t) {}
399 return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() {
400 return !!t;
401 })();
402 }
403 __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct");
404 var ArgsObject = /*#__PURE__*/ function(_InstanceType) {
405 /**
406 * Function constructor().
407 *
408 * Create ArgsObject.
409 *
410 * @param {{}} args
411 */
412 function ArgsObject(args) {
413 var _this;
414 _classCallCheck(this, ArgsObject);
415 _this = _callSuper$9(this, ArgsObject);
416 _this.args = args;
417 return _this;
418 }
419 /**
420 * Function requireArgument().
421 *
422 * Validate property in args.
423 *
424 * @param {string} property
425 * @param {{}} args
426 *
427 * @throws {Error}
428 */
429 _inherits(ArgsObject, _InstanceType);
430 return _createClass(ArgsObject, [
431 {
432 key: "requireArgument",
433 value: function requireArgument(property) {
434 var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args;
435 if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required."));
436 }
437 },
438 {
439 key: "requireArgumentType",
440 value: function requireArgumentType(property, type) {
441 var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
442 this.requireArgument(property, args);
443 if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, "."));
444 }
445 },
446 {
447 key: "requireArgumentInstance",
448 value: function requireArgumentInstance(property, instance) {
449 var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
450 this.requireArgument(property, args);
451 if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance."));
452 }
453 },
454 {
455 key: "requireArgumentConstructor",
456 value: function requireArgumentConstructor(property, type) {
457 var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
458 this.requireArgument(property, args);
459 if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type."));
460 }
461 }
462 ], [{
463 key: "getInstanceType",
464 value: function getInstanceType() {
465 return "ArgsObject";
466 }
467 }]);
468 }(InstanceType);
469
470 //#endregion
471 //#region modules/web-cli/assets/js/utils/console.js
472 var Console = /*#__PURE__*/ function() {
473 function Console() {
474 _classCallCheck(this, Console);
475 }
476 return _createClass(Console, null, [{
477 key: "error",
478 value: function error(message) {
479 if ($e.devTools) $e.devTools.log.error(message);
480 if (!(message instanceof $e.modules.HookBreak)) console.error(message);
481 }
482 }, {
483 key: "warn",
484 value: function warn() {
485 var _console;
486 var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
487 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
488 args.unshift("%c %c", style, "");
489 (_console = console).warn.apply(_console, args);
490 }
491 }]);
492 }();
493
494 //#endregion
495 //#region modules/web-cli/assets/js/utils/deprecation.js
496 /**
497 * @typedef {Object} Version
498 * @property {number} major1 The first number
499 * @property {number} major2 The second number
500 * @property {number} minor The third number
501 * @property {string} build The fourth number
502 */
503 var softDeprecated = function softDeprecated(name, version, replacement) {
504 if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement);
505 };
506 var hardDeprecated = function hardDeprecated(name, version, replacement) {
507 deprecatedMessage("hard", name, version, replacement);
508 };
509 var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
510 var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
511 if (replacement) message += " - Use `".concat(replacement, "` instead");
512 Console.warn(message);
513 };
514 var Deprecation = /*#__PURE__*/ function() {
515 function Deprecation() {
516 _classCallCheck(this, Deprecation);
517 }
518 return _createClass(Deprecation, null, [
519 {
520 key: "deprecated",
521 value: function deprecated(name, version, replacement) {
522 if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement);
523 else softDeprecated(name, version, replacement);
524 }
525 },
526 {
527 key: "parseVersion",
528 value: function parseVersion(version) {
529 var versionParts = version.split(".");
530 if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided");
531 var _versionParts = _slicedToArray(versionParts, 4);
532 var major1 = _versionParts[0];
533 var major2 = _versionParts[1];
534 var minor = _versionParts[2];
535 var _versionParts$ = _versionParts[3];
536 return {
537 major1: parseInt(major1),
538 major2: parseInt(major2),
539 minor: parseInt(minor),
540 build: _versionParts$ === void 0 ? "" : _versionParts$
541 };
542 }
543 },
544 {
545 key: "getTotalMajor",
546 value: function getTotalMajor(versionObj) {
547 var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
548 total = Number((total / 10).toFixed(0));
549 if (versionObj.major2 > 9) total = versionObj.major2 - 9;
550 return total;
551 }
552 },
553 {
554 key: "compareVersion",
555 value: function compareVersion(version1, version2) {
556 var _this = this;
557 return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) {
558 return _this.getTotalMajor(versionObj);
559 }).reduce(function(acc, major) {
560 return acc - major;
561 });
562 }
563 },
564 {
565 key: "isSoftDeprecated",
566 value: function isSoftDeprecated(version) {
567 return this.compareVersion(version, elementorWebCliConfig.version) <= 4;
568 }
569 },
570 {
571 key: "isHardDeprecated",
572 value: function isHardDeprecated(version) {
573 var total = this.compareVersion(version, elementorWebCliConfig.version);
574 return total < 0 || total >= 8;
575 }
576 }
577 ]);
578 }();
579
580 //#endregion
581 //#region modules/web-cli/assets/js/modules/command-infra.js
582 function _callSuper$8(t, o, e) {
583 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
584 }
585 __name(_callSuper$8, "_callSuper");
586 function _isNativeReflectConstruct$9() {
587 try {
588 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
589 } catch (t) {}
590 return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() {
591 return !!t;
592 })();
593 }
594 __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct");
595 /**
596 * @typedef {import('../modules/component-base')} ComponentBase
597 */
598 var CommandInfra = /*#__PURE__*/ function(_ArgsObject) {
599 /**
600 * Function constructor().
601 *
602 * Create Commands Base.
603 *
604 * @param {{}} args
605 */
606 function CommandInfra() {
607 var _this;
608 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
609 _classCallCheck(this, CommandInfra);
610 _this = _callSuper$8(this, CommandInfra, [args]);
611 if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`.");
612 _this.command = _this.constructor.getCommand();
613 _this.component = _this.constructor.getComponent();
614 _this.initialize(args);
615 args = _this.args;
616 _this.validateArgs(args);
617 return _this;
618 }
619 /**
620 * Function initialize().
621 *
622 * Initialize command, called after construction.
623 *
624 * @param {{}} args
625 */
626 _inherits(CommandInfra, _ArgsObject);
627 return _createClass(CommandInfra, [
628 {
629 key: "currentCommand",
630 get: function get() {
631 Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command");
632 return this.command;
633 }
634 },
635 {
636 key: "initialize",
637 value: function initialize() {
638 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
639 }
640 },
641 {
642 key: "validateArgs",
643 value: function validateArgs() {
644 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
645 }
646 },
647 {
648 key: "apply",
649 value: function apply() {
650 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
651 elementorModules.ForceMethodImplementation();
652 }
653 },
654 {
655 key: "run",
656 value: function run() {
657 return this.apply(this.args);
658 }
659 },
660 {
661 key: "onBeforeRun",
662 value: function onBeforeRun() {
663 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
664 }
665 },
666 {
667 key: "onAfterRun",
668 value: function onAfterRun() {
669 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
670 arguments.length > 1 && arguments[1];
671 }
672 },
673 {
674 key: "onBeforeApply",
675 value: function onBeforeApply() {
676 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
677 }
678 },
679 {
680 key: "onAfterApply",
681 value: function onAfterApply() {
682 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
683 arguments.length > 1 && arguments[1];
684 }
685 },
686 {
687 key: "onCatchApply",
688 value: function onCatchApply(e) {}
689 }
690 ], [
691 {
692 key: "getInstanceType",
693 value: function getInstanceType() {
694 return "CommandInfra";
695 }
696 },
697 {
698 key: "getInfo",
699 value: function getInfo() {
700 return {};
701 }
702 },
703 {
704 key: "getCommand",
705 value: function getCommand() {
706 return this.registerConfig.command;
707 }
708 },
709 {
710 key: "getComponent",
711 value: function getComponent() {
712 return this.registerConfig.component;
713 }
714 },
715 {
716 key: "setRegisterConfig",
717 value: function setRegisterConfig(config) {
718 this.registerConfig = Object.freeze(config);
719 }
720 }
721 ]);
722 }(ArgsObject);
723 /**
724 * @type {Object}
725 */
726 _defineProperty(CommandInfra, "registerConfig", null);
727
728 //#endregion
729 //#region modules/web-cli/assets/js/modules/command-base.js
730 function _callSuper$7(t, o, e) {
731 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
732 }
733 __name(_callSuper$7, "_callSuper");
734 function _isNativeReflectConstruct$8() {
735 try {
736 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
737 } catch (t) {}
738 return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() {
739 return !!t;
740 })();
741 }
742 __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct");
743 /**
744 * @name $e.modules.CommandBase
745 */
746 var CommandBase = /*#__PURE__*/ function(_CommandInfra) {
747 function CommandBase() {
748 _classCallCheck(this, CommandBase);
749 return _callSuper$7(this, CommandBase, arguments);
750 }
751 _inherits(CommandBase, _CommandInfra);
752 return _createClass(CommandBase, [
753 {
754 key: "onBeforeRun",
755 value: function onBeforeRun() {
756 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
757 $e.hooks.runUIBefore(this.command, args);
758 }
759 },
760 {
761 key: "onAfterRun",
762 value: function onAfterRun() {
763 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
764 var result = arguments.length > 1 ? arguments[1] : void 0;
765 $e.hooks.runUIAfter(this.command, args, result);
766 }
767 },
768 {
769 key: "onBeforeApply",
770 value: function onBeforeApply() {
771 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
772 $e.hooks.runDataDependency(this.command, args);
773 }
774 },
775 {
776 key: "onAfterApply",
777 value: function onAfterApply() {
778 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
779 var result = arguments.length > 1 ? arguments[1] : void 0;
780 return $e.hooks.runDataAfter(this.command, args, result);
781 }
782 },
783 {
784 key: "onCatchApply",
785 value: function onCatchApply(e) {
786 this.runCatchHooks(e);
787 }
788 },
789 {
790 key: "runCatchHooks",
791 value: function runCatchHooks(e) {
792 $e.hooks.runDataCatch(this.command, this.args, e);
793 $e.hooks.runUICatch(this.command, this.args, e);
794 }
795 },
796 {
797 key: "requireContainer",
798 value: function requireContainer() {
799 var _this = this;
800 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args;
801 Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`");
802 if (!args.container && !args.containers) throw Error("container or containers are required.");
803 if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them.");
804 (args.containers || [args.container]).forEach(function(container) {
805 _this.requireArgumentInstance("container", elementorModules.editor.Container, { container });
806 });
807 }
808 }
809 ], [{
810 key: "getInstanceType",
811 value: function getInstanceType() {
812 return "CommandBase";
813 }
814 }]);
815 }(CommandInfra);
816
817 //#endregion
818 //#region modules/web-cli/assets/js/modules/command-callback-base.js
819 function _callSuper$6(t, o, e) {
820 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
821 }
822 __name(_callSuper$6, "_callSuper");
823 function _isNativeReflectConstruct$7() {
824 try {
825 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
826 } catch (t) {}
827 return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() {
828 return !!t;
829 })();
830 }
831 __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct");
832 /**
833 * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
834 */
835 var CommandCallbackBase = /*#__PURE__*/ function(_CommandBase) {
836 function CommandCallbackBase() {
837 _classCallCheck(this, CommandCallbackBase);
838 return _callSuper$6(this, CommandCallbackBase, arguments);
839 }
840 _inherits(CommandCallbackBase, _CommandBase);
841 return _createClass(CommandCallbackBase, [{
842 key: "apply",
843 value: function apply() {
844 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
845 return this.constructor.getCallback()(args);
846 }
847 }], [{
848 key: "getInstanceType",
849 value: function getInstanceType() {
850 return "CommandCallbackBase";
851 }
852 }, {
853 key: "getCallback",
854 value: function getCallback() {
855 return this.registerConfig.callback;
856 }
857 }]);
858 }(CommandBase);
859
860 //#endregion
861 //#region assets/dev/js/modules/imports/module.js
862 var require_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
863 init_typeof();
864 var Module = function Module() {
865 var $ = jQuery;
866 var instanceParams = arguments;
867 var self = this;
868 var events = {};
869 var settings;
870 var ensureClosureMethods = function ensureClosureMethods() {
871 $.each(self, function(methodName) {
872 var oldMethod = self[methodName];
873 if ("function" !== typeof oldMethod) return;
874 self[methodName] = function() {
875 return oldMethod.apply(self, arguments);
876 };
877 });
878 };
879 var initSettings = function initSettings() {
880 settings = self.getDefaultSettings();
881 var instanceSettings = instanceParams[0];
882 if (instanceSettings) $.extend(true, settings, instanceSettings);
883 };
884 var init = function init() {
885 self.__construct.apply(self, instanceParams);
886 ensureClosureMethods();
887 initSettings();
888 self.trigger("init");
889 };
890 this.getItems = function(items, itemKey) {
891 if (itemKey) {
892 var keyStack = itemKey.split(".");
893 var currentKey = keyStack.splice(0, 1);
894 if (!keyStack.length) return items[currentKey];
895 if (!items[currentKey]) return;
896 return this.getItems(items[currentKey], keyStack.join("."));
897 }
898 return items;
899 };
900 this.getSettings = function(setting) {
901 return this.getItems(settings, setting);
902 };
903 this.setSettings = function(settingKey, value, settingsContainer) {
904 if (!settingsContainer) settingsContainer = settings;
905 if ("object" === _typeof(settingKey)) {
906 $.extend(settingsContainer, settingKey);
907 return self;
908 }
909 var keyStack = settingKey.split(".");
910 var currentKey = keyStack.splice(0, 1);
911 if (!keyStack.length) {
912 settingsContainer[currentKey] = value;
913 return self;
914 }
915 if (!settingsContainer[currentKey]) settingsContainer[currentKey] = {};
916 return self.setSettings(keyStack.join("."), value, settingsContainer[currentKey]);
917 };
918 this.getErrorMessage = function(type, functionName) {
919 var message;
920 switch (type) {
921 case "forceMethodImplementation":
922 message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
923 break;
924 default: message = "An error occurs";
925 }
926 return message;
927 };
928 this.forceMethodImplementation = function(functionName) {
929 throw new Error(this.getErrorMessage("forceMethodImplementation", functionName));
930 };
931 this.on = function(eventName, callback) {
932 if ("object" === _typeof(eventName)) {
933 $.each(eventName, function(singleEventName) {
934 self.on(singleEventName, this);
935 });
936 return self;
937 }
938 eventName.split(" ").forEach(function(singleEventName) {
939 if (!events[singleEventName]) events[singleEventName] = [];
940 events[singleEventName].push(callback);
941 });
942 return self;
943 };
944 this.off = function(eventName, callback) {
945 if (!events[eventName]) return self;
946 if (!callback) {
947 delete events[eventName];
948 return self;
949 }
950 var callbackIndex = events[eventName].indexOf(callback);
951 if (-1 !== callbackIndex) {
952 delete events[eventName][callbackIndex];
953 events[eventName] = events[eventName].filter(function(val) {
954 return val;
955 });
956 }
957 return self;
958 };
959 this.trigger = function(eventName) {
960 var methodName = "on" + eventName[0].toUpperCase() + eventName.slice(1);
961 var params = Array.prototype.slice.call(arguments, 1);
962 if (self[methodName]) self[methodName].apply(self, params);
963 var callbacks = events[eventName];
964 if (!callbacks) return self;
965 $.each(callbacks, function(index, callback) {
966 callback.apply(self, params);
967 });
968 return self;
969 };
970 init();
971 };
972 Module.prototype.__construct = function() {};
973 Module.prototype.getDefaultSettings = function() {
974 return {};
975 };
976 Module.prototype.getConstructorID = function() {
977 return this.constructor.name;
978 };
979 Module.extend = function(properties) {
980 var $ = jQuery;
981 var parent = this;
982 var child = function child() {
983 return parent.apply(this, arguments);
984 };
985 $.extend(child, parent);
986 child.prototype = Object.create($.extend({}, parent.prototype, properties));
987 child.prototype.constructor = child;
988 child.__super__ = parent.prototype;
989 return child;
990 };
991 module.exports = Module;
992 }));
993
994 //#endregion
995 //#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
996 var import_module = /* @__PURE__ */ __toESM(require_module());
997 function _isNativeFunction(t) {
998 try {
999 return -1 !== Function.toString.call(t).indexOf("[native code]");
1000 } catch (n) {
1001 return "function" == typeof t;
1002 }
1003 }
1004
1005 //#endregion
1006 //#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
1007 function _isNativeReflectConstruct$6() {
1008 try {
1009 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1010 } catch (t) {}
1011 return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() {
1012 return !!t;
1013 })();
1014 }
1015 __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct");
1016
1017 //#endregion
1018 //#region node_modules/@babel/runtime/helpers/esm/construct.js
1019 function _construct(t, e, r) {
1020 if (_isNativeReflectConstruct$6()) return Reflect.construct.apply(null, arguments);
1021 var o = [null];
1022 o.push.apply(o, e);
1023 var p = new (t.bind.apply(t, o))();
1024 return r && _setPrototypeOf(p, r.prototype), p;
1025 }
1026
1027 //#endregion
1028 //#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
1029 function _wrapNativeSuper(t) {
1030 var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
1031 return _wrapNativeSuper = function _wrapNativeSuper(t) {
1032 if (null === t || !_isNativeFunction(t)) return t;
1033 if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
1034 if (void 0 !== r) {
1035 if (r.has(t)) return r.get(t);
1036 r.set(t, Wrapper);
1037 }
1038 function Wrapper() {
1039 return _construct(t, arguments, _getPrototypeOf(this).constructor);
1040 }
1041 return Wrapper.prototype = Object.create(t.prototype, { constructor: {
1042 value: Wrapper,
1043 enumerable: !1,
1044 writable: !0,
1045 configurable: !0
1046 } }), _setPrototypeOf(Wrapper, t);
1047 }, _wrapNativeSuper(t);
1048 }
1049
1050 //#endregion
1051 //#region modules/web-cli/assets/js/utils/force-method-implementation.js
1052 function _callSuper$5(t, o, e) {
1053 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1054 }
1055 __name(_callSuper$5, "_callSuper");
1056 function _isNativeReflectConstruct$5() {
1057 try {
1058 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1059 } catch (t) {}
1060 return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() {
1061 return !!t;
1062 })();
1063 }
1064 __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct");
1065 var ForceMethodImplementation = /*#__PURE__*/ function(_Error) {
1066 function ForceMethodImplementation() {
1067 var _this;
1068 var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1069 _classCallCheck(this, ForceMethodImplementation);
1070 _this = _callSuper$5(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
1071 Error.captureStackTrace(_this, ForceMethodImplementation);
1072 return _this;
1073 }
1074 _inherits(ForceMethodImplementation, _Error);
1075 return _createClass(ForceMethodImplementation);
1076 }(/*#__PURE__*/ _wrapNativeSuper(Error));
1077 var force_method_implementation_default = /* @__PURE__ */ __name((function() {
1078 var caller = Error().stack.split("\n")[2].trim();
1079 var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1];
1080 var info = {};
1081 info.functionName = callerName;
1082 info.fullName = callerName;
1083 if (info.functionName.includes(".")) {
1084 var parts = info.functionName.split(".");
1085 info.className = parts[0];
1086 info.functionName = parts[1];
1087 } else info.isStatic = true;
1088 throw new ForceMethodImplementation(info);
1089 }), "default");
1090
1091 //#endregion
1092 //#region modules/web-cli/assets/js/modules/component-base.js
1093 function ownKeys(e, r) {
1094 var t = Object.keys(e);
1095 if (Object.getOwnPropertySymbols) {
1096 var o = Object.getOwnPropertySymbols(e);
1097 r && (o = o.filter(function(r) {
1098 return Object.getOwnPropertyDescriptor(e, r).enumerable;
1099 })), t.push.apply(t, o);
1100 }
1101 return t;
1102 }
1103 function _objectSpread(e) {
1104 for (var r = 1; r < arguments.length; r++) {
1105 var t = null != arguments[r] ? arguments[r] : {};
1106 r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
1107 _defineProperty(e, r, t[r]);
1108 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
1109 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1110 });
1111 }
1112 return e;
1113 }
1114 function _callSuper$4(t, o, e) {
1115 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1116 }
1117 __name(_callSuper$4, "_callSuper");
1118 function _isNativeReflectConstruct$4() {
1119 try {
1120 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1121 } catch (t) {}
1122 return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
1123 return !!t;
1124 })();
1125 }
1126 __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct");
1127 /**
1128 * @typedef {import('./command-infra')} CommandInfra
1129 * @typedef {import('./hook-base')} HookBase
1130 * @typedef {import('../core/states/ui-state-base')} UiStateBase
1131 */
1132 var ComponentBase = /*#__PURE__*/ function(_Module) {
1133 function ComponentBase() {
1134 _classCallCheck(this, ComponentBase);
1135 return _callSuper$4(this, ComponentBase, arguments);
1136 }
1137 _inherits(ComponentBase, _Module);
1138 return _createClass(ComponentBase, [
1139 {
1140 key: "__construct",
1141 value: function __construct() {
1142 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1143 if (args.manager) this.manager = args.manager;
1144 this.commands = this.defaultCommands();
1145 this.commandsInternal = this.defaultCommandsInternal();
1146 this.hooks = this.defaultHooks();
1147 this.routes = this.defaultRoutes();
1148 this.tabs = this.defaultTabs();
1149 this.shortcuts = this.defaultShortcuts();
1150 this.utils = this.defaultUtils();
1151 this.data = this.defaultData();
1152 this.uiStates = this.defaultUiStates();
1153 this.states = this.defaultStates();
1154 this.defaultRoute = "";
1155 this.currentTab = "";
1156 }
1157 },
1158 {
1159 key: "registerAPI",
1160 value: function registerAPI() {
1161 var _this = this;
1162 Object.entries(this.getTabs()).forEach(function(tab) {
1163 return _this.registerTabRoute(tab[0]);
1164 });
1165 Object.entries(this.getRoutes()).forEach(function(_ref) {
1166 var _ref2 = _slicedToArray(_ref, 2);
1167 var route = _ref2[0];
1168 var callback = _ref2[1];
1169 return _this.registerRoute(route, callback);
1170 });
1171 Object.entries(this.getCommands()).forEach(function(_ref3) {
1172 var _ref4 = _slicedToArray(_ref3, 2);
1173 var command = _ref4[0];
1174 var callback = _ref4[1];
1175 return _this.registerCommand(command, callback);
1176 });
1177 Object.entries(this.getCommandsInternal()).forEach(function(_ref5) {
1178 var _ref6 = _slicedToArray(_ref5, 2);
1179 var command = _ref6[0];
1180 var callback = _ref6[1];
1181 return _this.registerCommandInternal(command, callback);
1182 });
1183 Object.values(this.getHooks()).forEach(function(instance) {
1184 return _this.registerHook(instance);
1185 });
1186 Object.entries(this.getData()).forEach(function(_ref7) {
1187 var _ref8 = _slicedToArray(_ref7, 2);
1188 var command = _ref8[0];
1189 var callback = _ref8[1];
1190 return _this.registerData(command, callback);
1191 });
1192 Object.values(this.getUiStates()).forEach(function(instance) {
1193 return _this.registerUiState(instance);
1194 });
1195 Object.entries(this.getStates()).forEach(function(_ref9) {
1196 var _ref0 = _slicedToArray(_ref9, 2);
1197 var id = _ref0[0];
1198 var state = _ref0[1];
1199 return _this.registerState(id, state);
1200 });
1201 }
1202 },
1203 {
1204 key: "getNamespace",
1205 value: function getNamespace() {
1206 force_method_implementation_default();
1207 }
1208 },
1209 {
1210 key: "getRootContainer",
1211 value: function getRootContainer() {
1212 Deprecation.deprecated("getRootContainer()", "3.7.0", "getServiceName()");
1213 return this.getServiceName();
1214 }
1215 },
1216 {
1217 key: "getServiceName",
1218 value: function getServiceName() {
1219 return this.getNamespace().split("/")[0];
1220 }
1221 },
1222 {
1223 key: "store",
1224 get: function get() {
1225 return $e.store.get(this.getNamespace());
1226 }
1227 },
1228 {
1229 key: "defaultTabs",
1230 value: function defaultTabs() {
1231 return {};
1232 }
1233 },
1234 {
1235 key: "defaultRoutes",
1236 value: function defaultRoutes() {
1237 return {};
1238 }
1239 },
1240 {
1241 key: "defaultCommands",
1242 value: function defaultCommands() {
1243 return {};
1244 }
1245 },
1246 {
1247 key: "defaultCommandsInternal",
1248 value: function defaultCommandsInternal() {
1249 return {};
1250 }
1251 },
1252 {
1253 key: "defaultHooks",
1254 value: function defaultHooks() {
1255 return {};
1256 }
1257 },
1258 {
1259 key: "defaultUiStates",
1260 value: function defaultUiStates() {
1261 return {};
1262 }
1263 },
1264 {
1265 key: "defaultStates",
1266 value: function defaultStates() {
1267 return {};
1268 }
1269 },
1270 {
1271 key: "defaultShortcuts",
1272 value: function defaultShortcuts() {
1273 return {};
1274 }
1275 },
1276 {
1277 key: "defaultUtils",
1278 value: function defaultUtils() {
1279 return {};
1280 }
1281 },
1282 {
1283 key: "defaultData",
1284 value: function defaultData() {
1285 return {};
1286 }
1287 },
1288 {
1289 key: "getCommands",
1290 value: function getCommands() {
1291 return this.commands;
1292 }
1293 },
1294 {
1295 key: "getCommandsInternal",
1296 value: function getCommandsInternal() {
1297 return this.commandsInternal;
1298 }
1299 },
1300 {
1301 key: "getHooks",
1302 value: function getHooks() {
1303 return this.hooks;
1304 }
1305 },
1306 {
1307 key: "getUiStates",
1308 value: function getUiStates() {
1309 return this.uiStates;
1310 }
1311 },
1312 {
1313 key: "getStates",
1314 value: function getStates() {
1315 return this.states;
1316 }
1317 },
1318 {
1319 key: "getRoutes",
1320 value: function getRoutes() {
1321 return this.routes;
1322 }
1323 },
1324 {
1325 key: "getTabs",
1326 value: function getTabs() {
1327 return this.tabs;
1328 }
1329 },
1330 {
1331 key: "getShortcuts",
1332 value: function getShortcuts() {
1333 return this.shortcuts;
1334 }
1335 },
1336 {
1337 key: "getData",
1338 value: function getData() {
1339 return this.data;
1340 }
1341 },
1342 {
1343 key: "registerCommand",
1344 value: function registerCommand(command, context) {
1345 var commandsType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
1346 var commandsManager;
1347 switch (commandsType) {
1348 case "default":
1349 commandsManager = $e.commands;
1350 break;
1351 case "internal":
1352 commandsManager = $e.commandsInternal;
1353 break;
1354 case "data":
1355 commandsManager = $e.data;
1356 break;
1357 default: throw new Error("Invalid commands type: '".concat(command, "'"));
1358 }
1359 var fullCommand = this.getNamespace() + "/" + command;
1360 var instanceType = context.getInstanceType ? context.getInstanceType() : false;
1361 var registerConfig = {
1362 command: fullCommand,
1363 component: this
1364 };
1365 if (!instanceType) {
1366 if ($e.devTools) $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
1367 registerConfig.callback = context;
1368 context = /*#__PURE__*/ function(_CommandCallbackBase) {
1369 function context() {
1370 _classCallCheck(this, context);
1371 return _callSuper$4(this, context, arguments);
1372 }
1373 _inherits(context, _CommandCallbackBase);
1374 return _createClass(context);
1375 }(CommandCallbackBase);
1376 }
1377 context.setRegisterConfig(registerConfig);
1378 commandsManager.register(this, command, context);
1379 }
1380 },
1381 {
1382 key: "registerHook",
1383 value: function registerHook(instance) {
1384 return instance.register();
1385 }
1386 },
1387 {
1388 key: "registerCommandInternal",
1389 value: function registerCommandInternal(command, context) {
1390 this.registerCommand(command, context, "internal");
1391 }
1392 },
1393 {
1394 key: "registerUiState",
1395 value: function registerUiState(instance) {
1396 $e.uiStates.register(instance);
1397 }
1398 },
1399 {
1400 key: "registerState",
1401 value: function registerState(id, stateConfig) {
1402 id = this.getNamespace() + (id ? "/".concat(id) : "");
1403 var slice = (0, _reduxjs_toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, { name: id }));
1404 $e.store.register(id, slice);
1405 }
1406 },
1407 {
1408 key: "registerRoute",
1409 value: function registerRoute(route, callback) {
1410 $e.routes.register(this, route, callback);
1411 }
1412 },
1413 {
1414 key: "registerData",
1415 value: function registerData(command, context) {
1416 this.registerCommand(command, context, "data");
1417 }
1418 },
1419 {
1420 key: "unregisterRoute",
1421 value: function unregisterRoute(route) {
1422 $e.routes.unregister(this, route);
1423 }
1424 },
1425 {
1426 key: "registerTabRoute",
1427 value: function registerTabRoute(tab) {
1428 var _this2 = this;
1429 this.registerRoute(tab, function(args) {
1430 return _this2.activateTab(tab, args);
1431 });
1432 }
1433 },
1434 {
1435 key: "dependency",
1436 value: function dependency() {
1437 return true;
1438 }
1439 },
1440 {
1441 key: "open",
1442 value: function open() {
1443 return true;
1444 }
1445 },
1446 {
1447 key: "close",
1448 value: function close() {
1449 if (!this.isOpen) return false;
1450 this.isOpen = false;
1451 this.inactivate();
1452 $e.routes.clearCurrent(this.getNamespace());
1453 $e.routes.clearHistory(this.getServiceName());
1454 return true;
1455 }
1456 },
1457 {
1458 key: "activate",
1459 value: function activate() {
1460 $e.components.activate(this.getNamespace());
1461 }
1462 },
1463 {
1464 key: "inactivate",
1465 value: function inactivate() {
1466 $e.components.inactivate(this.getNamespace());
1467 }
1468 },
1469 {
1470 key: "isActive",
1471 value: function isActive() {
1472 return $e.components.isActive(this.getNamespace());
1473 }
1474 },
1475 {
1476 key: "onRoute",
1477 value: function onRoute(route) {
1478 this.toggleRouteClass(route, true);
1479 this.toggleHistoryClass();
1480 this.activate();
1481 this.trigger("route/open", route);
1482 }
1483 },
1484 {
1485 key: "onCloseRoute",
1486 value: function onCloseRoute(route) {
1487 this.toggleRouteClass(route, false);
1488 this.inactivate();
1489 this.trigger("route/close", route);
1490 }
1491 },
1492 {
1493 key: "setDefaultRoute",
1494 value: function setDefaultRoute(route) {
1495 this.defaultRoute = this.getNamespace() + "/" + route;
1496 }
1497 },
1498 {
1499 key: "getDefaultRoute",
1500 value: function getDefaultRoute() {
1501 return this.defaultRoute;
1502 }
1503 },
1504 {
1505 key: "removeTab",
1506 value: function removeTab(tab) {
1507 delete this.tabs[tab];
1508 this.unregisterRoute(tab);
1509 }
1510 },
1511 {
1512 key: "hasTab",
1513 value: function hasTab(tab) {
1514 return !!this.tabs[tab];
1515 }
1516 },
1517 {
1518 key: "addTab",
1519 value: function addTab(tab, args, position) {
1520 var _this3 = this;
1521 this.tabs[tab] = args;
1522 if ("undefined" !== typeof position) {
1523 var newTabs = {};
1524 var ids = Object.keys(this.tabs);
1525 ids.pop();
1526 ids.splice(position, 0, tab);
1527 ids.forEach(function(id) {
1528 newTabs[id] = _this3.tabs[id];
1529 });
1530 this.tabs = newTabs;
1531 }
1532 this.registerTabRoute(tab);
1533 }
1534 },
1535 {
1536 key: "getTabsWrapperSelector",
1537 value: function getTabsWrapperSelector() {
1538 return "";
1539 }
1540 },
1541 {
1542 key: "getTabRoute",
1543 value: function getTabRoute(tab) {
1544 return this.getNamespace() + "/" + tab;
1545 }
1546 },
1547 {
1548 key: "renderTab",
1549 value: function renderTab(tab) {}
1550 },
1551 {
1552 key: "activateTab",
1553 value: function activateTab(tab, args) {
1554 var _this4 = this;
1555 this.renderTab(tab, args);
1556 jQuery(this.getTabsWrapperSelector() + " .elementor-component-tab").off("click").on("click", function(event) {
1557 $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
1558 }).removeClass("elementor-active").filter("[data-tab=\"" + tab + "\"]").addClass("elementor-active");
1559 }
1560 },
1561 {
1562 key: "getActiveTabConfig",
1563 value: function getActiveTabConfig() {
1564 return this.tabs[this.currentTab] || {};
1565 }
1566 },
1567 {
1568 key: "getBodyClass",
1569 value: function getBodyClass(route) {
1570 return "e-route-" + route.replace(/\//g, "-");
1571 }
1572 },
1573 {
1574 key: "normalizeCommandName",
1575 value: function normalizeCommandName(commandName) {
1576 return commandName.replace(/[A-Z]/g, function(match, offset) {
1577 return (offset > 0 ? "-" : "") + match.toLowerCase();
1578 });
1579 }
1580 },
1581 {
1582 key: "importCommands",
1583 value: function importCommands(commandsFromImport) {
1584 var _this5 = this;
1585 var commands = {};
1586 Object.entries(commandsFromImport).forEach(function(_ref1) {
1587 var _ref10 = _slicedToArray(_ref1, 2);
1588 var className = _ref10[0];
1589 var Class = _ref10[1];
1590 var command = _this5.normalizeCommandName(className);
1591 commands[command] = Class;
1592 });
1593 return commands;
1594 }
1595 },
1596 {
1597 key: "importHooks",
1598 value: function importHooks(hooksFromImport) {
1599 var hooks = {};
1600 for (var key in hooksFromImport) {
1601 var hook = new hooksFromImport[key]();
1602 hooks[hook.getId()] = hook;
1603 }
1604 return hooks;
1605 }
1606 },
1607 {
1608 key: "importUiStates",
1609 value: function importUiStates(statesFromImport) {
1610 var _this6 = this;
1611 var uiStates = {};
1612 Object.values(statesFromImport).forEach(function(className) {
1613 var uiState = new className(_this6);
1614 uiStates[uiState.getId()] = uiState;
1615 });
1616 return uiStates;
1617 }
1618 },
1619 {
1620 key: "setUiState",
1621 value: function setUiState(state, value) {
1622 $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
1623 }
1624 },
1625 {
1626 key: "toggleRouteClass",
1627 value: function toggleRouteClass(route, state) {
1628 document.body.classList.toggle(this.getBodyClass(route), state);
1629 }
1630 },
1631 {
1632 key: "toggleHistoryClass",
1633 value: function toggleHistoryClass() {
1634 document.body.classList.toggle("e-routes-has-history", !!$e.routes.getHistory(this.getServiceName()).length);
1635 }
1636 }
1637 ]);
1638 }(import_module.default);
1639
1640 //#endregion
1641 //#region app/assets/js/loader/commands/close.js
1642 function _callSuper$3(t, o, e) {
1643 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1644 }
1645 __name(_callSuper$3, "_callSuper");
1646 function _isNativeReflectConstruct$3() {
1647 try {
1648 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1649 } catch (t) {}
1650 return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
1651 return !!t;
1652 })();
1653 }
1654 __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct");
1655 var Close = /*#__PURE__*/ function(_$e$modules$CommandBa) {
1656 function Close() {
1657 _classCallCheck(this, Close);
1658 return _callSuper$3(this, Close, arguments);
1659 }
1660 _inherits(Close, _$e$modules$CommandBa);
1661 return _createClass(Close, [{
1662 key: "apply",
1663 value: function apply() {
1664 if (!this.component.close()) return false;
1665 this.component.iframe.remove();
1666 this.component.iframe = null;
1667 if (this.component.backdrop) {
1668 this.component.backdrop.remove();
1669 this.component.backdrop = null;
1670 }
1671 document.body.style.overflow = "";
1672 return true;
1673 }
1674 }]);
1675 }($e.modules.CommandBase);
1676
1677 //#endregion
1678 //#region app/assets/js/loader/commands/load.js
1679 function _callSuper$2(t, o, e) {
1680 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1681 }
1682 __name(_callSuper$2, "_callSuper");
1683 function _isNativeReflectConstruct$2() {
1684 try {
1685 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1686 } catch (t) {}
1687 return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
1688 return !!t;
1689 })();
1690 }
1691 __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct");
1692 var Load = /*#__PURE__*/ function(_$e$modules$CommandBa) {
1693 function Load() {
1694 _classCallCheck(this, Load);
1695 return _callSuper$2(this, Load, arguments);
1696 }
1697 _inherits(Load, _$e$modules$CommandBa);
1698 return _createClass(Load, [{
1699 key: "apply",
1700 value: function apply(args) {
1701 var component = this.component;
1702 if (!component.iframe) {
1703 component.backdrop = document.createElement("div");
1704 component.backdrop.className = "elementor-app-backdrop";
1705 component.backdrop.style.display = "none";
1706 component.backdrop.addEventListener("click", function() {
1707 $e.run("app/close");
1708 });
1709 document.body.appendChild(component.backdrop);
1710 component.iframe = document.createElement("iframe");
1711 component.iframe.className = "elementor-app-iframe";
1712 component.iframe.style.display = "none";
1713 component.iframe.addEventListener("load", function() {
1714 if (component.iframe) component.iframe.classList.add("elementor-app-iframe--visible");
1715 if (component.backdrop) component.backdrop.classList.add("elementor-app-backdrop--visible");
1716 });
1717 document.body.appendChild(component.iframe);
1718 }
1719 if (args.url === component.iframe.src) return;
1720 component.iframe.src = args.url;
1721 }
1722 }]);
1723 }($e.modules.CommandBase);
1724
1725 //#endregion
1726 //#region app/assets/js/loader/commands/open.js
1727 function _callSuper$1(t, o, e) {
1728 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1729 }
1730 __name(_callSuper$1, "_callSuper");
1731 function _isNativeReflectConstruct$1() {
1732 try {
1733 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1734 } catch (t) {}
1735 return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
1736 return !!t;
1737 })();
1738 }
1739 __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
1740 var Open = /*#__PURE__*/ function(_$e$modules$CommandBa) {
1741 function Open() {
1742 _classCallCheck(this, Open);
1743 return _callSuper$1(this, Open, arguments);
1744 }
1745 _inherits(Open, _$e$modules$CommandBa);
1746 return _createClass(Open, [{
1747 key: "apply",
1748 value: function apply(args) {
1749 $e.route("app", args);
1750 return true;
1751 }
1752 }]);
1753 }($e.modules.CommandBase);
1754
1755 //#endregion
1756 //#region app/assets/js/loader/commands/index.js
1757 var commands_exports = /* @__PURE__ */ __exportAll({
1758 Close: () => Close,
1759 Load: () => Load,
1760 Open: () => Open
1761 });
1762
1763 //#endregion
1764 //#region app/assets/js/loader/component.js
1765 function _callSuper(t, o, e) {
1766 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1767 }
1768 function _isNativeReflectConstruct() {
1769 try {
1770 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1771 } catch (t) {}
1772 return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
1773 return !!t;
1774 })();
1775 }
1776 var Component = /*#__PURE__*/ function(_ComponentModalBase) {
1777 function Component() {
1778 _classCallCheck(this, Component);
1779 return _callSuper(this, Component, arguments);
1780 }
1781 _inherits(Component, _ComponentModalBase);
1782 return _createClass(Component, [
1783 {
1784 key: "getNamespace",
1785 value: function getNamespace() {
1786 return "app";
1787 }
1788 },
1789 {
1790 key: "defaultRoutes",
1791 value: function defaultRoutes() {
1792 var _this = this;
1793 return { "": function _(args) {
1794 args.url = args.url || elementorAppConfig.menu_url;
1795 $e.run("app/load", args);
1796 _this.iframe.style.display = "";
1797 if (_this.backdrop) _this.backdrop.style.display = "";
1798 document.body.style.overflow = "hidden";
1799 } };
1800 }
1801 },
1802 {
1803 key: "defaultCommands",
1804 value: function defaultCommands() {
1805 return this.importCommands(commands_exports);
1806 }
1807 },
1808 {
1809 key: "defaultShortcuts",
1810 value: function defaultShortcuts() {
1811 return {
1812 "": { keys: "ctrl+shift+e" },
1813 close: {
1814 keys: "esc",
1815 scopes: [this.getNamespace()]
1816 }
1817 };
1818 }
1819 }
1820 ]);
1821 }(ComponentBase);
1822
1823 //#endregion
1824 //#region app/assets/js/app-loader.js
1825 window.elementorAppLoader = new (/* @__PURE__ */ function() {
1826 function AppLoader() {
1827 _classCallCheck(this, AppLoader);
1828 _defineProperty(this, "selector", "a.elementor-app-link, .elementor-app-link .ab-item");
1829 $e.components.register(new Component());
1830 window.addEventListener("DOMContentLoaded", this.onLoad.bind(this));
1831 }
1832 return _createClass(AppLoader, [{
1833 key: "onLoad",
1834 value: function onLoad() {
1835 var links = document.querySelectorAll(this.selector);
1836 if (!links.length) return;
1837 links.forEach(function(link) {
1838 link.addEventListener("click", function(event) {
1839 event.preventDefault();
1840 $e.run("app/open", { url: link.href });
1841 });
1842 link.addEventListener("mouseenter", function() {
1843 $e.run("app/load", { url: link.href });
1844 });
1845 });
1846 }
1847 }]);
1848 }())();
1849
1850 //#endregion
1851 })(elementorVendors.reduxToolkit);
1852 //# sourceMappingURL=app-loader.js.map