PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.4
Elementor Website Builder – more than just a page builder v3.25.4
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
← All changes | assets/js/web-cli.js +11861 -5813 4.3.0-beta33.25.4 View file →
@@ -1,5912 +1,11960 @@
1 -(function(_reduxjs_toolkit) {
1 +/*! elementor - v3.25.0 - 03-11-2024 */
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 __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));
5 +/***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js":
6 +/*!******************************************************************!*\
7 + !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***!
8 + \******************************************************************/
9 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
54 10
55 -//#endregion
11 +"use strict";
12 +__webpack_require__.r(__webpack_exports__);
13 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
14 +/* harmony export */ EnhancerArray: () => (/* binding */ EnhancerArray),
15 +/* harmony export */ MiddlewareArray: () => (/* binding */ MiddlewareArray),
16 +/* harmony export */ SHOULD_AUTOBATCH: () => (/* binding */ SHOULD_AUTOBATCH),
17 +/* harmony export */ TaskAbortError: () => (/* binding */ TaskAbortError),
18 +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes),
19 +/* harmony export */ addListener: () => (/* binding */ addListener),
20 +/* harmony export */ applyMiddleware: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware),
21 +/* harmony export */ autoBatchEnhancer: () => (/* binding */ autoBatchEnhancer),
22 +/* harmony export */ bindActionCreators: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators),
23 +/* harmony export */ clearAllListeners: () => (/* binding */ clearAllListeners),
24 +/* harmony export */ combineReducers: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers),
25 +/* harmony export */ compose: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose),
26 +/* harmony export */ configureStore: () => (/* binding */ configureStore),
27 +/* harmony export */ createAction: () => (/* binding */ createAction),
28 +/* harmony export */ createActionCreatorInvariantMiddleware: () => (/* binding */ createActionCreatorInvariantMiddleware),
29 +/* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk),
30 +/* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector),
31 +/* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter),
32 +/* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware),
33 +/* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware),
34 +/* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]),
35 +/* harmony export */ createReducer: () => (/* binding */ createReducer),
36 +/* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector),
37 +/* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware),
38 +/* harmony export */ createSlice: () => (/* binding */ createSlice),
39 +/* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore),
40 +/* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current),
41 +/* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue),
42 +/* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze),
43 +/* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware),
44 +/* harmony export */ getType: () => (/* binding */ getType),
45 +/* harmony export */ isAction: () => (/* binding */ isAction),
46 +/* harmony export */ isActionCreator: () => (/* binding */ isActionCreator),
47 +/* harmony export */ isAllOf: () => (/* binding */ isAllOf),
48 +/* harmony export */ isAnyOf: () => (/* binding */ isAnyOf),
49 +/* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction),
50 +/* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft),
51 +/* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA),
52 +/* harmony export */ isFulfilled: () => (/* binding */ isFulfilled),
53 +/* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault),
54 +/* harmony export */ isPending: () => (/* binding */ isPending),
55 +/* harmony export */ isPlain: () => (/* binding */ isPlain),
56 +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject),
57 +/* harmony export */ isRejected: () => (/* binding */ isRejected),
58 +/* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue),
59 +/* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore),
60 +/* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError),
61 +/* harmony export */ nanoid: () => (/* binding */ nanoid),
62 +/* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original),
63 +/* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched),
64 +/* harmony export */ removeListener: () => (/* binding */ removeListener),
65 +/* harmony export */ unwrapResult: () => (/* binding */ unwrapResult)
66 +/* harmony export */ });
67 +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs");
68 +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js");
69 +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js");
70 +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js");
71 +var __extends = (undefined && undefined.__extends) || (function () {
72 + var extendStatics = function (d, b) {
73 + extendStatics = Object.setPrototypeOf ||
74 + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
75 + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
76 + return extendStatics(d, b);
77 + };
78 + return function (d, b) {
79 + if (typeof b !== "function" && b !== null)
80 + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
81 + extendStatics(d, b);
82 + function __() { this.constructor = d; }
83 + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
84 + };
85 +})();
86 +var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
87 + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
88 + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
89 + function verb(n) { return function (v) { return step([n, v]); }; }
90 + function step(op) {
91 + if (f) throw new TypeError("Generator is already executing.");
92 + while (_) try {
93 + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
94 + if (y = 0, t) op = [op[0] & 2, t.value];
95 + switch (op[0]) {
96 + case 0: case 1: t = op; break;
97 + case 4: _.label++; return { value: op[1], done: false };
98 + case 5: _.label++; y = op[1]; op = [0]; continue;
99 + case 7: op = _.ops.pop(); _.trys.pop(); continue;
100 + default:
101 + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
102 + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103 + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
104 + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
105 + if (t[2]) _.ops.pop();
106 + _.trys.pop(); continue;
107 + }
108 + op = body.call(thisArg, _);
109 + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
110 + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
111 + }
112 +};
113 +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
114 + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
115 + to[j] = from[i];
116 + return to;
117 +};
118 +var __defProp = Object.defineProperty;
119 +var __defProps = Object.defineProperties;
120 +var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
121 +var __getOwnPropSymbols = Object.getOwnPropertySymbols;
122 +var __hasOwnProp = Object.prototype.hasOwnProperty;
123 +var __propIsEnum = Object.prototype.propertyIsEnumerable;
124 +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
125 +var __spreadValues = function (a, b) {
126 + for (var prop in b || (b = {}))
127 + if (__hasOwnProp.call(b, prop))
128 + __defNormalProp(a, prop, b[prop]);
129 + if (__getOwnPropSymbols)
130 + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
131 + var prop = _c[_i];
132 + if (__propIsEnum.call(b, prop))
133 + __defNormalProp(a, prop, b[prop]);
134 + }
135 + return a;
136 +};
137 +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
138 +var __async = function (__this, __arguments, generator) {
139 + return new Promise(function (resolve, reject) {
140 + var fulfilled = function (value) {
141 + try {
142 + step(generator.next(value));
143 + }
144 + catch (e) {
145 + reject(e);
146 + }
147 + };
148 + var rejected = function (value) {
149 + try {
150 + step(generator.throw(value));
151 + }
152 + catch (e) {
153 + reject(e);
154 + }
155 + };
156 + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
157 + step((generator = generator.apply(__this, __arguments)).next());
158 + });
159 +};
160 +// src/index.ts
161 +
162 +
163 +
164 +
165 +// src/createDraftSafeSelector.ts
166 +
167 +
168 +var createDraftSafeSelector = function () {
169 + var args = [];
170 + for (var _i = 0; _i < arguments.length; _i++) {
171 + args[_i] = arguments[_i];
172 + }
173 + var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args);
174 + var wrappedSelector = function (value) {
175 + var rest = [];
176 + for (var _i = 1; _i < arguments.length; _i++) {
177 + rest[_i - 1] = arguments[_i];
178 + }
179 + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest));
180 + };
181 + return wrappedSelector;
182 +};
183 +// src/configureStore.ts
184 +
185 +// src/devtoolsExtension.ts
186 +
187 +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
188 + if (arguments.length === 0)
189 + return void 0;
190 + if (typeof arguments[0] === "object")
191 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
192 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments);
193 +};
194 +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
195 + return function (noop2) {
196 + return noop2;
197 + };
198 +};
199 +// src/isPlainObject.ts
200 +function isPlainObject(value) {
201 + if (typeof value !== "object" || value === null)
202 + return false;
203 + var proto = Object.getPrototypeOf(value);
204 + if (proto === null)
205 + return true;
206 + var baseProto = proto;
207 + while (Object.getPrototypeOf(baseProto) !== null) {
208 + baseProto = Object.getPrototypeOf(baseProto);
209 + }
210 + return proto === baseProto;
211 +}
212 +// src/getDefaultMiddleware.ts
213 +
214 +// src/tsHelpers.ts
215 +var hasMatchFunction = function (v) {
216 + return v && typeof v.match === "function";
217 +};
218 +// src/createAction.ts
219 +function createAction(type, prepareAction) {
220 + function actionCreator() {
221 + var args = [];
222 + for (var _i = 0; _i < arguments.length; _i++) {
223 + args[_i] = arguments[_i];
224 + }
225 + if (prepareAction) {
226 + var prepared = prepareAction.apply(void 0, args);
227 + if (!prepared) {
228 + throw new Error("prepareAction did not return an object");
229 + }
230 + return __spreadValues(__spreadValues({
231 + type: type,
232 + payload: prepared.payload
233 + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
234 + }
235 + return { type: type, payload: args[0] };
236 + }
237 + actionCreator.toString = function () { return "" + type; };
238 + actionCreator.type = type;
239 + actionCreator.match = function (action) { return action.type === type; };
240 + return actionCreator;
241 +}
242 +function isAction(action) {
243 + return isPlainObject(action) && "type" in action;
244 +}
245 +function isActionCreator(action) {
246 + return typeof action === "function" && "type" in action && hasMatchFunction(action);
247 +}
248 +function isFSA(action) {
249 + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
250 +}
251 +function isValidKey(key) {
252 + return ["type", "payload", "error", "meta"].indexOf(key) > -1;
253 +}
254 +function getType(actionCreator) {
255 + return "" + actionCreator;
256 +}
257 +// src/actionCreatorInvariantMiddleware.ts
258 +function getMessage(type) {
259 + var splitType = type ? ("" + type).split("/") : [];
260 + var actionName = splitType[splitType.length - 1] || "actionCreator";
261 + return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload.";
262 +}
263 +function createActionCreatorInvariantMiddleware(options) {
264 + if (options === void 0) { options = {}; }
265 + if (false) {}
266 + var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c;
267 + return function () { return function (next) { return function (action) {
268 + if (isActionCreator2(action)) {
269 + console.warn(getMessage(action.type));
270 + }
271 + return next(action);
272 + }; }; };
273 +}
274 +// src/utils.ts
275 +
276 +function getTimeMeasureUtils(maxDelay, fnName) {
277 + var elapsed = 0;
278 + return {
279 + measureTime: function (fn) {
280 + var started = Date.now();
281 + try {
282 + return fn();
283 + }
284 + finally {
285 + var finished = Date.now();
286 + elapsed += finished - started;
287 + }
288 + },
289 + warnIfExceeded: function () {
290 + if (elapsed > maxDelay) {
291 + console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.");
292 + }
293 + }
294 + };
295 +}
296 +var MiddlewareArray = /** @class */ (function (_super) {
297 + __extends(MiddlewareArray, _super);
298 + function MiddlewareArray() {
299 + var args = [];
300 + for (var _i = 0; _i < arguments.length; _i++) {
301 + args[_i] = arguments[_i];
302 + }
303 + var _this = _super.apply(this, args) || this;
304 + Object.setPrototypeOf(_this, MiddlewareArray.prototype);
305 + return _this;
306 + }
307 + Object.defineProperty(MiddlewareArray, Symbol.species, {
308 + get: function () {
309 + return MiddlewareArray;
310 + },
311 + enumerable: false,
312 + configurable: true
313 + });
314 + MiddlewareArray.prototype.concat = function () {
315 + var arr = [];
316 + for (var _i = 0; _i < arguments.length; _i++) {
317 + arr[_i] = arguments[_i];
318 + }
319 + return _super.prototype.concat.apply(this, arr);
320 + };
321 + MiddlewareArray.prototype.prepend = function () {
322 + var arr = [];
323 + for (var _i = 0; _i < arguments.length; _i++) {
324 + arr[_i] = arguments[_i];
325 + }
326 + if (arr.length === 1 && Array.isArray(arr[0])) {
327 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
328 + }
329 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
330 + };
331 + return MiddlewareArray;
332 +}(Array));
333 +var EnhancerArray = /** @class */ (function (_super) {
334 + __extends(EnhancerArray, _super);
335 + function EnhancerArray() {
336 + var args = [];
337 + for (var _i = 0; _i < arguments.length; _i++) {
338 + args[_i] = arguments[_i];
339 + }
340 + var _this = _super.apply(this, args) || this;
341 + Object.setPrototypeOf(_this, EnhancerArray.prototype);
342 + return _this;
343 + }
344 + Object.defineProperty(EnhancerArray, Symbol.species, {
345 + get: function () {
346 + return EnhancerArray;
347 + },
348 + enumerable: false,
349 + configurable: true
350 + });
351 + EnhancerArray.prototype.concat = function () {
352 + var arr = [];
353 + for (var _i = 0; _i < arguments.length; _i++) {
354 + arr[_i] = arguments[_i];
355 + }
356 + return _super.prototype.concat.apply(this, arr);
357 + };
358 + EnhancerArray.prototype.prepend = function () {
359 + var arr = [];
360 + for (var _i = 0; _i < arguments.length; _i++) {
361 + arr[_i] = arguments[_i];
362 + }
363 + if (arr.length === 1 && Array.isArray(arr[0])) {
364 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
365 + }
366 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
367 + };
368 + return EnhancerArray;
369 +}(Array));
370 +function freezeDraftable(val) {
371 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () {
372 + }) : val;
373 +}
374 +// src/immutableStateInvariantMiddleware.ts
375 +var isProduction = "development" === "production";
376 +var prefix = "Invariant failed";
377 +function invariant(condition, message) {
378 + if (condition) {
379 + return;
380 + }
381 + if (isProduction) {
382 + throw new Error(prefix);
383 + }
384 + throw new Error(prefix + ": " + (message || ""));
385 +}
386 +function stringify(obj, serializer, indent, decycler) {
387 + return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
388 +}
389 +function getSerialize(serializer, decycler) {
390 + var stack = [], keys = [];
391 + if (!decycler)
392 + decycler = function (_, value) {
393 + if (stack[0] === value)
394 + return "[Circular ~]";
395 + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
396 + };
397 + return function (key, value) {
398 + if (stack.length > 0) {
399 + var thisPos = stack.indexOf(this);
400 + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
401 + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
402 + if (~stack.indexOf(value))
403 + value = decycler.call(this, key, value);
404 + }
405 + else
406 + stack.push(value);
407 + return serializer == null ? value : serializer.call(this, key, value);
408 + };
409 +}
410 +function isImmutableDefault(value) {
411 + return typeof value !== "object" || value == null || Object.isFrozen(value);
412 +}
413 +function trackForMutations(isImmutable, ignorePaths, obj) {
414 + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
415 + return {
416 + detectMutations: function () {
417 + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
418 + }
419 + };
420 +}
421 +function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {
422 + if (ignorePaths === void 0) { ignorePaths = []; }
423 + if (path === void 0) { path = ""; }
424 + if (checkedObjects === void 0) { checkedObjects = new Set(); }
425 + var tracked = { value: obj };
426 + if (!isImmutable(obj) && !checkedObjects.has(obj)) {
427 + checkedObjects.add(obj);
428 + tracked.children = {};
429 + for (var key in obj) {
430 + var childPath = path ? path + "." + key : key;
431 + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
432 + continue;
433 + }
434 + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
435 + }
436 + }
437 + return tracked;
438 +}
439 +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
440 + if (ignoredPaths === void 0) { ignoredPaths = []; }
441 + if (sameParentRef === void 0) { sameParentRef = false; }
442 + if (path === void 0) { path = ""; }
443 + var prevObj = trackedProperty ? trackedProperty.value : void 0;
444 + var sameRef = prevObj === obj;
445 + if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
446 + return { wasMutated: true, path: path };
447 + }
448 + if (isImmutable(prevObj) || isImmutable(obj)) {
449 + return { wasMutated: false };
450 + }
451 + var keysToDetect = {};
452 + for (var key in trackedProperty.children) {
453 + keysToDetect[key] = true;
454 + }
455 + for (var key in obj) {
456 + keysToDetect[key] = true;
457 + }
458 + var hasIgnoredPaths = ignoredPaths.length > 0;
459 + var _loop_1 = function (key) {
460 + var nestedPath = path ? path + "." + key : key;
461 + if (hasIgnoredPaths) {
462 + var hasMatches = ignoredPaths.some(function (ignored) {
463 + if (ignored instanceof RegExp) {
464 + return ignored.test(nestedPath);
465 + }
466 + return nestedPath === ignored;
467 + });
468 + if (hasMatches) {
469 + return "continue";
470 + }
471 + }
472 + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
473 + if (result.wasMutated) {
474 + return { value: result };
475 + }
476 + };
477 + for (var key in keysToDetect) {
478 + var state_1 = _loop_1(key);
479 + if (typeof state_1 === "object")
480 + return state_1.value;
481 + }
482 + return { wasMutated: false };
483 +}
484 +function createImmutableStateInvariantMiddleware(options) {
485 + if (options === void 0) { options = {}; }
486 + if (false) {}
487 + var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;
488 + ignoredPaths = ignoredPaths || ignore;
489 + var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
490 + return function (_c) {
491 + var getState = _c.getState;
492 + var state = getState();
493 + var tracker = track(state);
494 + var result;
495 + return function (next) { return function (action) {
496 + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
497 + measureUtils.measureTime(function () {
498 + state = getState();
499 + result = tracker.detectMutations();
500 + tracker = track(state);
501 + invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
502 + });
503 + var dispatchedAction = next(action);
504 + measureUtils.measureTime(function () {
505 + state = getState();
506 + result = tracker.detectMutations();
507 + tracker = track(state);
508 + result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
509 + });
510 + measureUtils.warnIfExceeded();
511 + return dispatchedAction;
512 + }; };
513 + };
514 +}
515 +// src/serializableStateInvariantMiddleware.ts
516 +function isPlain(val) {
517 + var type = typeof val;
518 + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
519 +}
520 +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
521 + if (path === void 0) { path = ""; }
522 + if (isSerializable === void 0) { isSerializable = isPlain; }
523 + if (ignoredPaths === void 0) { ignoredPaths = []; }
524 + var foundNestedSerializable;
525 + if (!isSerializable(value)) {
526 + return {
527 + keyPath: path || "<root>",
528 + value: value
529 + };
530 + }
531 + if (typeof value !== "object" || value === null) {
532 + return false;
533 + }
534 + if (cache == null ? void 0 : cache.has(value))
535 + return false;
536 + var entries = getEntries != null ? getEntries(value) : Object.entries(value);
537 + var hasIgnoredPaths = ignoredPaths.length > 0;
538 + var _loop_2 = function (key, nestedValue) {
539 + var nestedPath = path ? path + "." + key : key;
540 + if (hasIgnoredPaths) {
541 + var hasMatches = ignoredPaths.some(function (ignored) {
542 + if (ignored instanceof RegExp) {
543 + return ignored.test(nestedPath);
544 + }
545 + return nestedPath === ignored;
546 + });
547 + if (hasMatches) {
548 + return "continue";
549 + }
550 + }
551 + if (!isSerializable(nestedValue)) {
552 + return { value: {
553 + keyPath: nestedPath,
554 + value: nestedValue
555 + } };
556 + }
557 + if (typeof nestedValue === "object") {
558 + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
559 + if (foundNestedSerializable) {
560 + return { value: foundNestedSerializable };
561 + }
562 + }
563 + };
564 + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
565 + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
566 + var state_2 = _loop_2(key, nestedValue);
567 + if (typeof state_2 === "object")
568 + return state_2.value;
569 + }
570 + if (cache && isNestedFrozen(value))
571 + cache.add(value);
572 + return false;
573 +}
574 +function isNestedFrozen(value) {
575 + if (!Object.isFrozen(value))
576 + return false;
577 + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
578 + var nestedValue = _c[_i];
579 + if (typeof nestedValue !== "object" || nestedValue === null)
580 + continue;
581 + if (!isNestedFrozen(nestedValue))
582 + return false;
583 + }
584 + return true;
585 +}
586 +function createSerializableStateInvariantMiddleware(options) {
587 + if (options === void 0) { options = {}; }
588 + if (false) {}
589 + var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;
590 + var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
591 + return function (storeAPI) { return function (next) { return function (action) {
592 + var result = next(action);
593 + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
594 + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
595 + measureUtils.measureTime(function () {
596 + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
597 + if (foundActionNonSerializableValue) {
598 + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
599 + console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
600 + }
601 + });
602 + }
603 + if (!ignoreState) {
604 + measureUtils.measureTime(function () {
605 + var state = storeAPI.getState();
606 + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
607 + if (foundStateNonSerializableValue) {
608 + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
609 + console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)");
610 + }
611 + });
612 + measureUtils.warnIfExceeded();
613 + }
614 + return result;
615 + }; }; };
616 +}
617 +// src/getDefaultMiddleware.ts
618 +function isBoolean(x) {
619 + return typeof x === "boolean";
620 +}
621 +function curryGetDefaultMiddleware() {
622 + return function curriedGetDefaultMiddleware(options) {
623 + return getDefaultMiddleware(options);
624 + };
625 +}
626 +function getDefaultMiddleware(options) {
627 + if (options === void 0) { options = {}; }
628 + var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;
629 + var middlewareArray = new MiddlewareArray();
630 + if (thunk) {
631 + if (isBoolean(thunk)) {
632 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]);
633 + }
634 + else {
635 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument));
636 + }
637 + }
638 + if (true) {
639 + if (immutableCheck) {
640 + var immutableOptions = {};
641 + if (!isBoolean(immutableCheck)) {
642 + immutableOptions = immutableCheck;
643 + }
644 + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
645 + }
646 + if (serializableCheck) {
647 + var serializableOptions = {};
648 + if (!isBoolean(serializableCheck)) {
649 + serializableOptions = serializableCheck;
650 + }
651 + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
652 + }
653 + if (actionCreatorCheck) {
654 + var actionCreatorOptions = {};
655 + if (!isBoolean(actionCreatorCheck)) {
656 + actionCreatorOptions = actionCreatorCheck;
657 + }
658 + middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));
659 + }
660 + }
661 + return middlewareArray;
662 +}
663 +// src/configureStore.ts
664 +var IS_PRODUCTION = "development" === "production";
665 +function configureStore(options) {
666 + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
667 + var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
668 + var rootReducer;
669 + if (typeof reducer === "function") {
670 + rootReducer = reducer;
671 + }
672 + else if (isPlainObject(reducer)) {
673 + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer);
674 + }
675 + else {
676 + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
677 + }
678 + var finalMiddleware = middleware;
679 + if (typeof finalMiddleware === "function") {
680 + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
681 + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
682 + throw new Error("when using a middleware builder function, an array of middleware must be returned");
683 + }
684 + }
685 + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
686 + throw new Error("each middleware provided to configureStore must be a function");
687 + }
688 + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware);
689 + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose;
690 + if (devTools) {
691 + finalCompose = composeWithDevTools(__spreadValues({
692 + trace: !IS_PRODUCTION
693 + }, typeof devTools === "object" && devTools));
694 + }
695 + var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
696 + var storeEnhancers = defaultEnhancers;
697 + if (Array.isArray(enhancers)) {
698 + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
699 + }
700 + else if (typeof enhancers === "function") {
701 + storeEnhancers = enhancers(defaultEnhancers);
702 + }
703 + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
704 + return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
705 +}
706 +// src/createReducer.ts
707 +
708 +// src/mapBuilders.ts
709 +function executeReducerBuilderCallback(builderCallback) {
710 + var actionsMap = {};
711 + var actionMatchers = [];
712 + var defaultCaseReducer;
713 + var builder = {
714 + addCase: function (typeOrActionCreator, reducer) {
715 + if (true) {
716 + if (actionMatchers.length > 0) {
717 + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
718 + }
719 + if (defaultCaseReducer) {
720 + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
721 + }
722 + }
723 + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
724 + if (!type) {
725 + throw new Error("`builder.addCase` cannot be called with an empty action type");
726 + }
727 + if (type in actionsMap) {
728 + throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
729 + }
730 + actionsMap[type] = reducer;
731 + return builder;
732 + },
733 + addMatcher: function (matcher, reducer) {
734 + if (true) {
735 + if (defaultCaseReducer) {
736 + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
737 + }
738 + }
739 + actionMatchers.push({ matcher: matcher, reducer: reducer });
740 + return builder;
741 + },
742 + addDefaultCase: function (reducer) {
743 + if (true) {
744 + if (defaultCaseReducer) {
745 + throw new Error("`builder.addDefaultCase` can only be called once");
746 + }
747 + }
748 + defaultCaseReducer = reducer;
749 + return builder;
750 + }
751 + };
752 + builderCallback(builder);
753 + return [actionsMap, actionMatchers, defaultCaseReducer];
754 +}
755 +// src/createReducer.ts
756 +function isStateFunction(x) {
757 + return typeof x === "function";
758 +}
759 +var hasWarnedAboutObjectNotation = false;
760 +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
761 + if (actionMatchers === void 0) { actionMatchers = []; }
762 + if (true) {
763 + if (typeof mapOrBuilderCallback === "object") {
764 + if (!hasWarnedAboutObjectNotation) {
765 + hasWarnedAboutObjectNotation = true;
766 + console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
767 + }
768 + }
769 + }
770 + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
771 + var getInitialState;
772 + if (isStateFunction(initialState)) {
773 + getInitialState = function () { return freezeDraftable(initialState()); };
774 + }
775 + else {
776 + var frozenInitialState_1 = freezeDraftable(initialState);
777 + getInitialState = function () { return frozenInitialState_1; };
778 + }
779 + function reducer(state, action) {
780 + if (state === void 0) { state = getInitialState(); }
781 + var caseReducers = __spreadArray([
782 + actionsMap[action.type]
783 + ], finalActionMatchers.filter(function (_c) {
784 + var matcher = _c.matcher;
785 + return matcher(action);
786 + }).map(function (_c) {
787 + var reducer2 = _c.reducer;
788 + return reducer2;
789 + }));
790 + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
791 + caseReducers = [finalDefaultCaseReducer];
792 + }
793 + return caseReducers.reduce(function (previousState, caseReducer) {
794 + if (caseReducer) {
795 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) {
796 + var draft = previousState;
797 + var result = caseReducer(draft, action);
798 + if (result === void 0) {
799 + return previousState;
800 + }
801 + return result;
802 + }
803 + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) {
804 + var result = caseReducer(previousState, action);
805 + if (result === void 0) {
806 + if (previousState === null) {
807 + return previousState;
808 + }
809 + throw Error("A case reducer on a non-draftable value must not return undefined");
810 + }
811 + return result;
812 + }
813 + else {
814 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) {
815 + return caseReducer(draft, action);
816 + });
817 + }
818 + }
819 + return previousState;
820 + }, state);
821 + }
822 + reducer.getInitialState = getInitialState;
823 + return reducer;
824 +}
825 +// src/createSlice.ts
826 +var hasWarnedAboutObjectNotation2 = false;
827 +function getType2(slice, actionKey) {
828 + return slice + "/" + actionKey;
829 +}
830 +function createSlice(options) {
831 + var name = options.name;
832 + if (!name) {
833 + throw new Error("`name` is a required option for createSlice");
834 + }
835 + if (typeof process !== "undefined" && "development" === "development") {
836 + if (options.initialState === void 0) {
837 + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
838 + }
839 + }
840 + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
841 + var reducers = options.reducers || {};
842 + var reducerNames = Object.keys(reducers);
843 + var sliceCaseReducersByName = {};
844 + var sliceCaseReducersByType = {};
845 + var actionCreators = {};
846 + reducerNames.forEach(function (reducerName) {
847 + var maybeReducerWithPrepare = reducers[reducerName];
848 + var type = getType2(name, reducerName);
849 + var caseReducer;
850 + var prepareCallback;
851 + if ("reducer" in maybeReducerWithPrepare) {
852 + caseReducer = maybeReducerWithPrepare.reducer;
853 + prepareCallback = maybeReducerWithPrepare.prepare;
854 + }
855 + else {
856 + caseReducer = maybeReducerWithPrepare;
857 + }
858 + sliceCaseReducersByName[reducerName] = caseReducer;
859 + sliceCaseReducersByType[type] = caseReducer;
860 + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
861 + });
862 + function buildReducer() {
863 + if (true) {
864 + if (typeof options.extraReducers === "object") {
865 + if (!hasWarnedAboutObjectNotation2) {
866 + hasWarnedAboutObjectNotation2 = true;
867 + console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
868 + }
869 + }
870 + }
871 + var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
872 + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
873 + return createReducer(initialState, function (builder) {
874 + for (var key in finalCaseReducers) {
875 + builder.addCase(key, finalCaseReducers[key]);
876 + }
877 + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
878 + var m = actionMatchers_1[_i];
879 + builder.addMatcher(m.matcher, m.reducer);
880 + }
881 + if (defaultCaseReducer) {
882 + builder.addDefaultCase(defaultCaseReducer);
883 + }
884 + });
885 + }
886 + var _reducer;
887 + return {
888 + name: name,
889 + reducer: function (state, action) {
890 + if (!_reducer)
891 + _reducer = buildReducer();
892 + return _reducer(state, action);
893 + },
894 + actions: actionCreators,
895 + caseReducers: sliceCaseReducersByName,
896 + getInitialState: function () {
897 + if (!_reducer)
898 + _reducer = buildReducer();
899 + return _reducer.getInitialState();
900 + }
901 + };
902 +}
903 +// src/entities/entity_state.ts
904 +function getInitialEntityState() {
905 + return {
906 + ids: [],
907 + entities: {}
908 + };
909 +}
910 +function createInitialStateFactory() {
911 + function getInitialState(additionalState) {
912 + if (additionalState === void 0) { additionalState = {}; }
913 + return Object.assign(getInitialEntityState(), additionalState);
914 + }
915 + return { getInitialState: getInitialState };
916 +}
917 +// src/entities/state_selectors.ts
918 +function createSelectorsFactory() {
919 + function getSelectors(selectState) {
920 + var selectIds = function (state) { return state.ids; };
921 + var selectEntities = function (state) { return state.entities; };
922 + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
923 + var selectId = function (_, id) { return id; };
924 + var selectById = function (entities, id) { return entities[id]; };
925 + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
926 + if (!selectState) {
927 + return {
928 + selectIds: selectIds,
929 + selectEntities: selectEntities,
930 + selectAll: selectAll,
931 + selectTotal: selectTotal,
932 + selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
933 + };
934 + }
935 + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
936 + return {
937 + selectIds: createDraftSafeSelector(selectState, selectIds),
938 + selectEntities: selectGlobalizedEntities,
939 + selectAll: createDraftSafeSelector(selectState, selectAll),
940 + selectTotal: createDraftSafeSelector(selectState, selectTotal),
941 + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
942 + };
943 + }
944 + return { getSelectors: getSelectors };
945 +}
946 +// src/entities/state_adapter.ts
947 +
948 +function createSingleArgumentStateOperator(mutator) {
949 + var operator = createStateOperator(function (_, state) { return mutator(state); });
950 + return function operation(state) {
951 + return operator(state, void 0);
952 + };
953 +}
954 +function createStateOperator(mutator) {
955 + return function operation(state, arg) {
956 + function isPayloadActionArgument(arg2) {
957 + return isFSA(arg2);
958 + }
959 + var runMutator = function (draft) {
960 + if (isPayloadActionArgument(arg)) {
961 + mutator(arg.payload, draft);
962 + }
963 + else {
964 + mutator(arg, draft);
965 + }
966 + };
967 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) {
968 + runMutator(state);
969 + return state;
970 + }
971 + else {
972 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator);
973 + }
974 + };
975 +}
976 +// src/entities/utils.ts
977 +function selectIdValue(entity, selectId) {
978 + var key = selectId(entity);
979 + if ( true && key === void 0) {
980 + console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString());
981 + }
982 + return key;
983 +}
984 +function ensureEntitiesArray(entities) {
985 + if (!Array.isArray(entities)) {
986 + entities = Object.values(entities);
987 + }
988 + return entities;
989 +}
990 +function splitAddedUpdatedEntities(newEntities, selectId, state) {
991 + newEntities = ensureEntitiesArray(newEntities);
992 + var added = [];
993 + var updated = [];
994 + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
995 + var entity = newEntities_1[_i];
996 + var id = selectIdValue(entity, selectId);
997 + if (id in state.entities) {
998 + updated.push({ id: id, changes: entity });
999 + }
1000 + else {
1001 + added.push(entity);
1002 + }
1003 + }
1004 + return [added, updated];
1005 +}
1006 +// src/entities/unsorted_state_adapter.ts
1007 +function createUnsortedStateAdapter(selectId) {
1008 + function addOneMutably(entity, state) {
1009 + var key = selectIdValue(entity, selectId);
1010 + if (key in state.entities) {
1011 + return;
1012 + }
1013 + state.ids.push(key);
1014 + state.entities[key] = entity;
1015 + }
1016 + function addManyMutably(newEntities, state) {
1017 + newEntities = ensureEntitiesArray(newEntities);
1018 + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
1019 + var entity = newEntities_2[_i];
1020 + addOneMutably(entity, state);
1021 + }
1022 + }
1023 + function setOneMutably(entity, state) {
1024 + var key = selectIdValue(entity, selectId);
1025 + if (!(key in state.entities)) {
1026 + state.ids.push(key);
1027 + }
1028 + state.entities[key] = entity;
1029 + }
1030 + function setManyMutably(newEntities, state) {
1031 + newEntities = ensureEntitiesArray(newEntities);
1032 + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
1033 + var entity = newEntities_3[_i];
1034 + setOneMutably(entity, state);
1035 + }
1036 + }
1037 + function setAllMutably(newEntities, state) {
1038 + newEntities = ensureEntitiesArray(newEntities);
1039 + state.ids = [];
1040 + state.entities = {};
1041 + addManyMutably(newEntities, state);
1042 + }
1043 + function removeOneMutably(key, state) {
1044 + return removeManyMutably([key], state);
1045 + }
1046 + function removeManyMutably(keys, state) {
1047 + var didMutate = false;
1048 + keys.forEach(function (key) {
1049 + if (key in state.entities) {
1050 + delete state.entities[key];
1051 + didMutate = true;
1052 + }
1053 + });
1054 + if (didMutate) {
1055 + state.ids = state.ids.filter(function (id) { return id in state.entities; });
1056 + }
1057 + }
1058 + function removeAllMutably(state) {
1059 + Object.assign(state, {
1060 + ids: [],
1061 + entities: {}
1062 + });
1063 + }
1064 + function takeNewKey(keys, update, state) {
1065 + var original2 = state.entities[update.id];
1066 + var updated = Object.assign({}, original2, update.changes);
1067 + var newKey = selectIdValue(updated, selectId);
1068 + var hasNewKey = newKey !== update.id;
1069 + if (hasNewKey) {
1070 + keys[update.id] = newKey;
1071 + delete state.entities[update.id];
1072 + }
1073 + state.entities[newKey] = updated;
1074 + return hasNewKey;
1075 + }
1076 + function updateOneMutably(update, state) {
1077 + return updateManyMutably([update], state);
1078 + }
1079 + function updateManyMutably(updates, state) {
1080 + var newKeys = {};
1081 + var updatesPerEntity = {};
1082 + updates.forEach(function (update) {
1083 + if (update.id in state.entities) {
1084 + updatesPerEntity[update.id] = {
1085 + id: update.id,
1086 + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
1087 + };
1088 + }
1089 + });
1090 + updates = Object.values(updatesPerEntity);
1091 + var didMutateEntities = updates.length > 0;
1092 + if (didMutateEntities) {
1093 + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
1094 + if (didMutateIds) {
1095 + state.ids = Object.keys(state.entities);
1096 + }
1097 + }
1098 + }
1099 + function upsertOneMutably(entity, state) {
1100 + return upsertManyMutably([entity], state);
1101 + }
1102 + function upsertManyMutably(newEntities, state) {
1103 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1104 + updateManyMutably(updated, state);
1105 + addManyMutably(added, state);
1106 + }
1107 + return {
1108 + removeAll: createSingleArgumentStateOperator(removeAllMutably),
1109 + addOne: createStateOperator(addOneMutably),
1110 + addMany: createStateOperator(addManyMutably),
1111 + setOne: createStateOperator(setOneMutably),
1112 + setMany: createStateOperator(setManyMutably),
1113 + setAll: createStateOperator(setAllMutably),
1114 + updateOne: createStateOperator(updateOneMutably),
1115 + updateMany: createStateOperator(updateManyMutably),
1116 + upsertOne: createStateOperator(upsertOneMutably),
1117 + upsertMany: createStateOperator(upsertManyMutably),
1118 + removeOne: createStateOperator(removeOneMutably),
1119 + removeMany: createStateOperator(removeManyMutably)
1120 + };
1121 +}
1122 +// src/entities/sorted_state_adapter.ts
1123 +function createSortedStateAdapter(selectId, sort) {
1124 + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
1125 + function addOneMutably(entity, state) {
1126 + return addManyMutably([entity], state);
1127 + }
1128 + function addManyMutably(newEntities, state) {
1129 + newEntities = ensureEntitiesArray(newEntities);
1130 + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
1131 + if (models.length !== 0) {
1132 + merge(models, state);
1133 + }
1134 + }
1135 + function setOneMutably(entity, state) {
1136 + return setManyMutably([entity], state);
1137 + }
1138 + function setManyMutably(newEntities, state) {
1139 + newEntities = ensureEntitiesArray(newEntities);
1140 + if (newEntities.length !== 0) {
1141 + merge(newEntities, state);
1142 + }
1143 + }
1144 + function setAllMutably(newEntities, state) {
1145 + newEntities = ensureEntitiesArray(newEntities);
1146 + state.entities = {};
1147 + state.ids = [];
1148 + addManyMutably(newEntities, state);
1149 + }
1150 + function updateOneMutably(update, state) {
1151 + return updateManyMutably([update], state);
1152 + }
1153 + function updateManyMutably(updates, state) {
1154 + var appliedUpdates = false;
1155 + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
1156 + var update = updates_1[_i];
1157 + var entity = state.entities[update.id];
1158 + if (!entity) {
1159 + continue;
1160 + }
1161 + appliedUpdates = true;
1162 + Object.assign(entity, update.changes);
1163 + var newId = selectId(entity);
1164 + if (update.id !== newId) {
1165 + delete state.entities[update.id];
1166 + state.entities[newId] = entity;
1167 + }
1168 + }
1169 + if (appliedUpdates) {
1170 + resortEntities(state);
1171 + }
1172 + }
1173 + function upsertOneMutably(entity, state) {
1174 + return upsertManyMutably([entity], state);
1175 + }
1176 + function upsertManyMutably(newEntities, state) {
1177 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1178 + updateManyMutably(updated, state);
1179 + addManyMutably(added, state);
1180 + }
1181 + function areArraysEqual(a, b) {
1182 + if (a.length !== b.length) {
1183 + return false;
1184 + }
1185 + for (var i = 0; i < a.length && i < b.length; i++) {
1186 + if (a[i] === b[i]) {
1187 + continue;
1188 + }
1189 + return false;
1190 + }
1191 + return true;
1192 + }
1193 + function merge(models, state) {
1194 + models.forEach(function (model) {
1195 + state.entities[selectId(model)] = model;
1196 + });
1197 + resortEntities(state);
1198 + }
1199 + function resortEntities(state) {
1200 + var allEntities = Object.values(state.entities);
1201 + allEntities.sort(sort);
1202 + var newSortedIds = allEntities.map(selectId);
1203 + var ids = state.ids;
1204 + if (!areArraysEqual(ids, newSortedIds)) {
1205 + state.ids = newSortedIds;
1206 + }
1207 + }
1208 + return {
1209 + removeOne: removeOne,
1210 + removeMany: removeMany,
1211 + removeAll: removeAll,
1212 + addOne: createStateOperator(addOneMutably),
1213 + updateOne: createStateOperator(updateOneMutably),
1214 + upsertOne: createStateOperator(upsertOneMutably),
1215 + setOne: createStateOperator(setOneMutably),
1216 + setMany: createStateOperator(setManyMutably),
1217 + setAll: createStateOperator(setAllMutably),
1218 + addMany: createStateOperator(addManyMutably),
1219 + updateMany: createStateOperator(updateManyMutably),
1220 + upsertMany: createStateOperator(upsertManyMutably)
1221 + };
1222 +}
1223 +// src/entities/create_adapter.ts
1224 +function createEntityAdapter(options) {
1225 + if (options === void 0) { options = {}; }
1226 + var _c = __spreadValues({
1227 + sortComparer: false,
1228 + selectId: function (instance) { return instance.id; }
1229 + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
1230 + var stateFactory = createInitialStateFactory();
1231 + var selectorsFactory = createSelectorsFactory();
1232 + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
1233 + return __spreadValues(__spreadValues(__spreadValues({
1234 + selectId: selectId,
1235 + sortComparer: sortComparer
1236 + }, stateFactory), selectorsFactory), stateAdapter);
1237 +}
1238 +// src/nanoid.ts
1239 +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
1240 +var nanoid = function (size) {
1241 + if (size === void 0) { size = 21; }
1242 + var id = "";
1243 + var i = size;
1244 + while (i--) {
1245 + id += urlAlphabet[Math.random() * 64 | 0];
1246 + }
1247 + return id;
1248 +};
1249 +// src/createAsyncThunk.ts
1250 +var commonProperties = [
1251 + "name",
1252 + "message",
1253 + "stack",
1254 + "code"
1255 +];
1256 +var RejectWithValue = /** @class */ (function () {
1257 + function RejectWithValue(payload, meta) {
1258 + this.payload = payload;
1259 + this.meta = meta;
1260 + }
1261 + return RejectWithValue;
1262 +}());
1263 +var FulfillWithMeta = /** @class */ (function () {
1264 + function FulfillWithMeta(payload, meta) {
1265 + this.payload = payload;
1266 + this.meta = meta;
1267 + }
1268 + return FulfillWithMeta;
1269 +}());
1270 +var miniSerializeError = function (value) {
1271 + if (typeof value === "object" && value !== null) {
1272 + var simpleError = {};
1273 + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
1274 + var property = commonProperties_1[_i];
1275 + if (typeof value[property] === "string") {
1276 + simpleError[property] = value[property];
1277 + }
1278 + }
1279 + return simpleError;
1280 + }
1281 + return { message: String(value) };
1282 +};
1283 +var createAsyncThunk = (function () {
1284 + function createAsyncThunk2(typePrefix, payloadCreator, options) {
1285 + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
1286 + payload: payload,
1287 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1288 + arg: arg,
1289 + requestId: requestId,
1290 + requestStatus: "fulfilled"
1291 + })
1292 + }); });
1293 + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
1294 + payload: void 0,
1295 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1296 + arg: arg,
1297 + requestId: requestId,
1298 + requestStatus: "pending"
1299 + })
1300 + }); });
1301 + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
1302 + payload: payload,
1303 + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
1304 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1305 + arg: arg,
1306 + requestId: requestId,
1307 + rejectedWithValue: !!payload,
1308 + requestStatus: "rejected",
1309 + aborted: (error == null ? void 0 : error.name) === "AbortError",
1310 + condition: (error == null ? void 0 : error.name) === "ConditionError"
1311 + })
1312 + }); });
1313 + var displayedWarning = false;
1314 + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
1315 + function class_1() {
1316 + this.signal = {
1317 + aborted: false,
1318 + addEventListener: function () {
1319 + },
1320 + dispatchEvent: function () {
1321 + return false;
1322 + },
1323 + onabort: function () {
1324 + },
1325 + removeEventListener: function () {
1326 + },
1327 + reason: void 0,
1328 + throwIfAborted: function () {
1329 + }
1330 + };
1331 + }
1332 + class_1.prototype.abort = function () {
1333 + if (true) {
1334 + if (!displayedWarning) {
1335 + displayedWarning = true;
1336 + console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.");
1337 + }
1338 + }
1339 + };
1340 + return class_1;
1341 + }());
1342 + function actionCreator(arg) {
1343 + return function (dispatch, getState, extra) {
1344 + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
1345 + var abortController = new AC();
1346 + var abortReason;
1347 + var started = false;
1348 + function abort(reason) {
1349 + abortReason = reason;
1350 + abortController.abort();
1351 + }
1352 + var promise2 = function () {
1353 + return __async(this, null, function () {
1354 + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
1355 + return __generator(this, function (_c) {
1356 + switch (_c.label) {
1357 + case 0:
1358 + _c.trys.push([0, 4, , 5]);
1359 + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
1360 + if (!isThenable(conditionResult)) return [3 /*break*/, 2];
1361 + return [4 /*yield*/, conditionResult];
1362 + case 1:
1363 + conditionResult = _c.sent();
1364 + _c.label = 2;
1365 + case 2:
1366 + if (conditionResult === false || abortController.signal.aborted) {
1367 + throw {
1368 + name: "ConditionError",
1369 + message: "Aborted due to condition callback returning false."
1370 + };
1371 + }
1372 + started = true;
1373 + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
1374 + name: "AbortError",
1375 + message: abortReason || "Aborted"
1376 + }); }); });
1377 + dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));
1378 + return [4 /*yield*/, Promise.race([
1379 + abortedPromise,
1380 + Promise.resolve(payloadCreator(arg, {
1381 + dispatch: dispatch,
1382 + getState: getState,
1383 + extra: extra,
1384 + requestId: requestId,
1385 + signal: abortController.signal,
1386 + abort: abort,
1387 + rejectWithValue: function (value, meta) {
1388 + return new RejectWithValue(value, meta);
1389 + },
1390 + fulfillWithValue: function (value, meta) {
1391 + return new FulfillWithMeta(value, meta);
1392 + }
1393 + })).then(function (result) {
1394 + if (result instanceof RejectWithValue) {
1395 + throw result;
1396 + }
1397 + if (result instanceof FulfillWithMeta) {
1398 + return fulfilled(result.payload, requestId, arg, result.meta);
1399 + }
1400 + return fulfilled(result, requestId, arg);
1401 + })
1402 + ])];
1403 + case 3:
1404 + finalAction = _c.sent();
1405 + return [3 /*break*/, 5];
1406 + case 4:
1407 + err_1 = _c.sent();
1408 + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
1409 + return [3 /*break*/, 5];
1410 + case 5:
1411 + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
1412 + if (!skipDispatch) {
1413 + dispatch(finalAction);
1414 + }
1415 + return [2 /*return*/, finalAction];
1416 + }
1417 + });
1418 + });
1419 + }();
1420 + return Object.assign(promise2, {
1421 + abort: abort,
1422 + requestId: requestId,
1423 + arg: arg,
1424 + unwrap: function () {
1425 + return promise2.then(unwrapResult);
1426 + }
1427 + });
1428 + };
1429 + }
1430 + return Object.assign(actionCreator, {
1431 + pending: pending,
1432 + rejected: rejected,
1433 + fulfilled: fulfilled,
1434 + typePrefix: typePrefix
1435 + });
1436 + }
1437 + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
1438 + return createAsyncThunk2;
1439 +})();
1440 +function unwrapResult(action) {
1441 + if (action.meta && action.meta.rejectedWithValue) {
1442 + throw action.payload;
1443 + }
1444 + if (action.error) {
1445 + throw action.error;
1446 + }
1447 + return action.payload;
1448 +}
1449 +function isThenable(value) {
1450 + return value !== null && typeof value === "object" && typeof value.then === "function";
1451 +}
1452 +// src/matchers.ts
1453 +var matches = function (matcher, action) {
1454 + if (hasMatchFunction(matcher)) {
1455 + return matcher.match(action);
1456 + }
1457 + else {
1458 + return matcher(action);
1459 + }
1460 +};
1461 +function isAnyOf() {
1462 + var matchers = [];
1463 + for (var _i = 0; _i < arguments.length; _i++) {
1464 + matchers[_i] = arguments[_i];
1465 + }
1466 + return function (action) {
1467 + return matchers.some(function (matcher) { return matches(matcher, action); });
1468 + };
1469 +}
1470 +function isAllOf() {
1471 + var matchers = [];
1472 + for (var _i = 0; _i < arguments.length; _i++) {
1473 + matchers[_i] = arguments[_i];
1474 + }
1475 + return function (action) {
1476 + return matchers.every(function (matcher) { return matches(matcher, action); });
1477 + };
1478 +}
1479 +function hasExpectedRequestMetadata(action, validStatus) {
1480 + if (!action || !action.meta)
1481 + return false;
1482 + var hasValidRequestId = typeof action.meta.requestId === "string";
1483 + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
1484 + return hasValidRequestId && hasValidRequestStatus;
1485 +}
1486 +function isAsyncThunkArray(a) {
1487 + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
1488 +}
1489 +function isPending() {
1490 + var asyncThunks = [];
1491 + for (var _i = 0; _i < arguments.length; _i++) {
1492 + asyncThunks[_i] = arguments[_i];
1493 + }
1494 + if (asyncThunks.length === 0) {
1495 + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
1496 + }
1497 + if (!isAsyncThunkArray(asyncThunks)) {
1498 + return isPending()(asyncThunks[0]);
1499 + }
1500 + return function (action) {
1501 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
1502 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1503 + return combinedMatcher(action);
1504 + };
1505 +}
1506 +function isRejected() {
1507 + var asyncThunks = [];
1508 + for (var _i = 0; _i < arguments.length; _i++) {
1509 + asyncThunks[_i] = arguments[_i];
1510 + }
1511 + if (asyncThunks.length === 0) {
1512 + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
1513 + }
1514 + if (!isAsyncThunkArray(asyncThunks)) {
1515 + return isRejected()(asyncThunks[0]);
1516 + }
1517 + return function (action) {
1518 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
1519 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1520 + return combinedMatcher(action);
1521 + };
1522 +}
1523 +function isRejectedWithValue() {
1524 + var asyncThunks = [];
1525 + for (var _i = 0; _i < arguments.length; _i++) {
1526 + asyncThunks[_i] = arguments[_i];
1527 + }
1528 + var hasFlag = function (action) {
1529 + return action && action.meta && action.meta.rejectedWithValue;
1530 + };
1531 + if (asyncThunks.length === 0) {
1532 + return function (action) {
1533 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1534 + return combinedMatcher(action);
1535 + };
1536 + }
1537 + if (!isAsyncThunkArray(asyncThunks)) {
1538 + return isRejectedWithValue()(asyncThunks[0]);
1539 + }
1540 + return function (action) {
1541 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1542 + return combinedMatcher(action);
1543 + };
1544 +}
1545 +function isFulfilled() {
1546 + var asyncThunks = [];
1547 + for (var _i = 0; _i < arguments.length; _i++) {
1548 + asyncThunks[_i] = arguments[_i];
1549 + }
1550 + if (asyncThunks.length === 0) {
1551 + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
1552 + }
1553 + if (!isAsyncThunkArray(asyncThunks)) {
1554 + return isFulfilled()(asyncThunks[0]);
1555 + }
1556 + return function (action) {
1557 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
1558 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1559 + return combinedMatcher(action);
1560 + };
1561 +}
1562 +function isAsyncThunkAction() {
1563 + var asyncThunks = [];
1564 + for (var _i = 0; _i < arguments.length; _i++) {
1565 + asyncThunks[_i] = arguments[_i];
1566 + }
1567 + if (asyncThunks.length === 0) {
1568 + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
1569 + }
1570 + if (!isAsyncThunkArray(asyncThunks)) {
1571 + return isAsyncThunkAction()(asyncThunks[0]);
1572 + }
1573 + return function (action) {
1574 + var matchers = [];
1575 + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
1576 + var asyncThunk = asyncThunks_1[_i];
1577 + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
1578 + }
1579 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1580 + return combinedMatcher(action);
1581 + };
1582 +}
1583 +// src/listenerMiddleware/utils.ts
1584 +var assertFunction = function (func, expected) {
1585 + if (typeof func !== "function") {
1586 + throw new TypeError(expected + " is not a function");
1587 + }
1588 +};
1589 +var noop = function () {
1590 +};
1591 +var catchRejection = function (promise2, onError) {
1592 + if (onError === void 0) { onError = noop; }
1593 + promise2.catch(onError);
1594 + return promise2;
1595 +};
1596 +var addAbortSignalListener = function (abortSignal, callback) {
1597 + abortSignal.addEventListener("abort", callback, { once: true });
1598 + return function () { return abortSignal.removeEventListener("abort", callback); };
1599 +};
1600 +var abortControllerWithReason = function (abortController, reason) {
1601 + var signal = abortController.signal;
1602 + if (signal.aborted) {
1603 + return;
1604 + }
1605 + if (!("reason" in signal)) {
1606 + Object.defineProperty(signal, "reason", {
1607 + enumerable: true,
1608 + value: reason,
1609 + configurable: true,
1610 + writable: true
1611 + });
1612 + }
1613 + ;
1614 + abortController.abort(reason);
1615 +};
1616 +// src/listenerMiddleware/exceptions.ts
1617 +var task = "task";
1618 +var listener = "listener";
1619 +var completed = "completed";
1620 +var cancelled = "cancelled";
1621 +var taskCancelled = "task-" + cancelled;
1622 +var taskCompleted = "task-" + completed;
1623 +var listenerCancelled = listener + "-" + cancelled;
1624 +var listenerCompleted = listener + "-" + completed;
1625 +var TaskAbortError = /** @class */ (function () {
1626 + function TaskAbortError(code) {
1627 + this.code = code;
1628 + this.name = "TaskAbortError";
1629 + this.message = task + " " + cancelled + " (reason: " + code + ")";
1630 + }
1631 + return TaskAbortError;
1632 +}());
1633 +// src/listenerMiddleware/task.ts
1634 +var validateActive = function (signal) {
1635 + if (signal.aborted) {
1636 + throw new TaskAbortError(signal.reason);
1637 + }
1638 +};
1639 +function raceWithSignal(signal, promise2) {
1640 + var cleanup = noop;
1641 + return new Promise(function (resolve, reject) {
1642 + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
1643 + if (signal.aborted) {
1644 + notifyRejection();
1645 + return;
1646 + }
1647 + cleanup = addAbortSignalListener(signal, notifyRejection);
1648 + promise2.finally(function () { return cleanup(); }).then(resolve, reject);
1649 + }).finally(function () {
1650 + cleanup = noop;
1651 + });
1652 +}
1653 +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
1654 + var value, error_1;
1655 + return __generator(this, function (_c) {
1656 + switch (_c.label) {
1657 + case 0:
1658 + _c.trys.push([0, 3, 4, 5]);
1659 + return [4 /*yield*/, Promise.resolve()];
1660 + case 1:
1661 + _c.sent();
1662 + return [4 /*yield*/, task2()];
1663 + case 2:
1664 + value = _c.sent();
1665 + return [2 /*return*/, {
1666 + status: "ok",
1667 + value: value
1668 + }];
1669 + case 3:
1670 + error_1 = _c.sent();
1671 + return [2 /*return*/, {
1672 + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
1673 + error: error_1
1674 + }];
1675 + case 4:
1676 + cleanUp == null ? void 0 : cleanUp();
1677 + return [7 /*endfinally*/];
1678 + case 5: return [2 /*return*/];
1679 + }
1680 + });
1681 +}); };
1682 +var createPause = function (signal) {
1683 + return function (promise2) {
1684 + return catchRejection(raceWithSignal(signal, promise2).then(function (output) {
1685 + validateActive(signal);
1686 + return output;
1687 + }));
1688 + };
1689 +};
1690 +var createDelay = function (signal) {
1691 + var pause = createPause(signal);
1692 + return function (timeoutMs) {
1693 + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
1694 + };
1695 +};
1696 +// src/listenerMiddleware/index.ts
1697 +var assign = Object.assign;
1698 +var INTERNAL_NIL_TOKEN = {};
1699 +var alm = "listenerMiddleware";
1700 +var createFork = function (parentAbortSignal, parentBlockingPromises) {
1701 + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
1702 + return function (taskExecutor, opts) {
1703 + assertFunction(taskExecutor, "taskExecutor");
1704 + var childAbortController = new AbortController();
1705 + linkControllers(childAbortController);
1706 + var result = runTask(function () { return __async(void 0, null, function () {
1707 + var result2;
1708 + return __generator(this, function (_c) {
1709 + switch (_c.label) {
1710 + case 0:
1711 + validateActive(parentAbortSignal);
1712 + validateActive(childAbortController.signal);
1713 + return [4 /*yield*/, taskExecutor({
1714 + pause: createPause(childAbortController.signal),
1715 + delay: createDelay(childAbortController.signal),
1716 + signal: childAbortController.signal
1717 + })];
1718 + case 1:
1719 + result2 = _c.sent();
1720 + validateActive(childAbortController.signal);
1721 + return [2 /*return*/, result2];
1722 + }
1723 + });
1724 + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
1725 + if (opts == null ? void 0 : opts.autoJoin) {
1726 + parentBlockingPromises.push(result);
1727 + }
1728 + return {
1729 + result: createPause(parentAbortSignal)(result),
1730 + cancel: function () {
1731 + abortControllerWithReason(childAbortController, taskCancelled);
1732 + }
1733 + };
1734 + };
1735 +};
1736 +var createTakePattern = function (startListening, signal) {
1737 + var take = function (predicate, timeout) { return __async(void 0, null, function () {
1738 + var unsubscribe, tuplePromise, promises, output;
1739 + return __generator(this, function (_c) {
1740 + switch (_c.label) {
1741 + case 0:
1742 + validateActive(signal);
1743 + unsubscribe = function () {
1744 + };
1745 + tuplePromise = new Promise(function (resolve, reject) {
1746 + var stopListening = startListening({
1747 + predicate: predicate,
1748 + effect: function (action, listenerApi) {
1749 + listenerApi.unsubscribe();
1750 + resolve([
1751 + action,
1752 + listenerApi.getState(),
1753 + listenerApi.getOriginalState()
1754 + ]);
1755 + }
1756 + });
1757 + unsubscribe = function () {
1758 + stopListening();
1759 + reject();
1760 + };
1761 + });
1762 + promises = [
1763 + tuplePromise
1764 + ];
1765 + if (timeout != null) {
1766 + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
1767 + }
1768 + _c.label = 1;
1769 + case 1:
1770 + _c.trys.push([1, , 3, 4]);
1771 + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];
1772 + case 2:
1773 + output = _c.sent();
1774 + validateActive(signal);
1775 + return [2 /*return*/, output];
1776 + case 3:
1777 + unsubscribe();
1778 + return [7 /*endfinally*/];
1779 + case 4: return [2 /*return*/];
1780 + }
1781 + });
1782 + }); };
1783 + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
1784 +};
1785 +var getListenerEntryPropsFrom = function (options) {
1786 + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
1787 + if (type) {
1788 + predicate = createAction(type).match;
1789 + }
1790 + else if (actionCreator) {
1791 + type = actionCreator.type;
1792 + predicate = actionCreator.match;
1793 + }
1794 + else if (matcher) {
1795 + predicate = matcher;
1796 + }
1797 + else if (predicate) {
1798 + }
1799 + else {
1800 + throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
1801 + }
1802 + assertFunction(effect, "options.listener");
1803 + return { predicate: predicate, type: type, effect: effect };
1804 +};
1805 +var createListenerEntry = function (options) {
1806 + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
1807 + var id = nanoid();
1808 + var entry = {
1809 + id: id,
1810 + effect: effect,
1811 + type: type,
1812 + predicate: predicate,
1813 + pending: new Set(),
1814 + unsubscribe: function () {
1815 + throw new Error("Unsubscribe not initialized");
1816 + }
1817 + };
1818 + return entry;
1819 +};
1820 +var cancelActiveListeners = function (entry) {
1821 + entry.pending.forEach(function (controller) {
1822 + abortControllerWithReason(controller, listenerCancelled);
1823 + });
1824 +};
1825 +var createClearListenerMiddleware = function (listenerMap) {
1826 + return function () {
1827 + listenerMap.forEach(cancelActiveListeners);
1828 + listenerMap.clear();
1829 + };
1830 +};
1831 +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
1832 + try {
1833 + errorHandler(errorToNotify, errorInfo);
1834 + }
1835 + catch (errorHandlerError) {
1836 + setTimeout(function () {
1837 + throw errorHandlerError;
1838 + }, 0);
1839 + }
1840 +};
1841 +var addListener = createAction(alm + "/add");
1842 +var clearAllListeners = createAction(alm + "/removeAll");
1843 +var removeListener = createAction(alm + "/remove");
1844 +var defaultErrorHandler = function () {
1845 + var args = [];
1846 + for (var _i = 0; _i < arguments.length; _i++) {
1847 + args[_i] = arguments[_i];
1848 + }
1849 + console.error.apply(console, __spreadArray([alm + "/error"], args));
1850 +};
1851 +function createListenerMiddleware(middlewareOptions) {
1852 + var _this = this;
1853 + if (middlewareOptions === void 0) { middlewareOptions = {}; }
1854 + var listenerMap = new Map();
1855 + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
1856 + assertFunction(onError, "onError");
1857 + var insertEntry = function (entry) {
1858 + entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
1859 + listenerMap.set(entry.id, entry);
1860 + return function (cancelOptions) {
1861 + entry.unsubscribe();
1862 + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
1863 + cancelActiveListeners(entry);
1864 + }
1865 + };
1866 + };
1867 + var findListenerEntry = function (comparator) {
1868 + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
1869 + var entry = _c[_i];
1870 + if (comparator(entry)) {
1871 + return entry;
1872 + }
1873 + }
1874 + return void 0;
1875 + };
1876 + var startListening = function (options) {
1877 + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
1878 + if (!entry) {
1879 + entry = createListenerEntry(options);
1880 + }
1881 + return insertEntry(entry);
1882 + };
1883 + var stopListening = function (options) {
1884 + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
1885 + var entry = findListenerEntry(function (entry2) {
1886 + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
1887 + return matchPredicateOrType && entry2.effect === effect;
1888 + });
1889 + if (entry) {
1890 + entry.unsubscribe();
1891 + if (options.cancelActive) {
1892 + cancelActiveListeners(entry);
1893 + }
1894 + }
1895 + return !!entry;
1896 + };
1897 + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
1898 + var internalTaskController, take, autoJoinPromises, listenerError_1;
1899 + return __generator(this, function (_c) {
1900 + switch (_c.label) {
1901 + case 0:
1902 + internalTaskController = new AbortController();
1903 + take = createTakePattern(startListening, internalTaskController.signal);
1904 + autoJoinPromises = [];
1905 + _c.label = 1;
1906 + case 1:
1907 + _c.trys.push([1, 3, 4, 6]);
1908 + entry.pending.add(internalTaskController);
1909 + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
1910 + getOriginalState: getOriginalState,
1911 + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
1912 + take: take,
1913 + delay: createDelay(internalTaskController.signal),
1914 + pause: createPause(internalTaskController.signal),
1915 + extra: extra,
1916 + signal: internalTaskController.signal,
1917 + fork: createFork(internalTaskController.signal, autoJoinPromises),
1918 + unsubscribe: entry.unsubscribe,
1919 + subscribe: function () {
1920 + listenerMap.set(entry.id, entry);
1921 + },
1922 + cancelActiveListeners: function () {
1923 + entry.pending.forEach(function (controller, _, set) {
1924 + if (controller !== internalTaskController) {
1925 + abortControllerWithReason(controller, listenerCancelled);
1926 + set.delete(controller);
1927 + }
1928 + });
1929 + }
1930 + })))];
1931 + case 2:
1932 + _c.sent();
1933 + return [3 /*break*/, 6];
1934 + case 3:
1935 + listenerError_1 = _c.sent();
1936 + if (!(listenerError_1 instanceof TaskAbortError)) {
1937 + safelyNotifyError(onError, listenerError_1, {
1938 + raisedBy: "effect"
1939 + });
1940 + }
1941 + return [3 /*break*/, 6];
1942 + case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)];
1943 + case 5:
1944 + _c.sent();
1945 + abortControllerWithReason(internalTaskController, listenerCompleted);
1946 + entry.pending.delete(internalTaskController);
1947 + return [7 /*endfinally*/];
1948 + case 6: return [2 /*return*/];
1949 + }
1950 + });
1951 + }); };
1952 + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
1953 + var middleware = function (api) { return function (next) { return function (action) {
1954 + if (!isAction(action)) {
1955 + return next(action);
1956 + }
1957 + if (addListener.match(action)) {
1958 + return startListening(action.payload);
1959 + }
1960 + if (clearAllListeners.match(action)) {
1961 + clearListenerMiddleware();
1962 + return;
1963 + }
1964 + if (removeListener.match(action)) {
1965 + return stopListening(action.payload);
1966 + }
1967 + var originalState = api.getState();
1968 + var getOriginalState = function () {
1969 + if (originalState === INTERNAL_NIL_TOKEN) {
1970 + throw new Error(alm + ": getOriginalState can only be called synchronously");
1971 + }
1972 + return originalState;
1973 + };
1974 + var result;
1975 + try {
1976 + result = next(action);
1977 + if (listenerMap.size > 0) {
1978 + var currentState = api.getState();
1979 + var listenerEntries = Array.from(listenerMap.values());
1980 + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
1981 + var entry = listenerEntries_1[_i];
1982 + var runListener = false;
1983 + try {
1984 + runListener = entry.predicate(action, currentState, originalState);
1985 + }
1986 + catch (predicateError) {
1987 + runListener = false;
1988 + safelyNotifyError(onError, predicateError, {
1989 + raisedBy: "predicate"
1990 + });
1991 + }
1992 + if (!runListener) {
1993 + continue;
1994 + }
1995 + notifyListener(entry, action, api, getOriginalState);
1996 + }
1997 + }
1998 + }
1999 + finally {
2000 + originalState = INTERNAL_NIL_TOKEN;
2001 + }
2002 + return result;
2003 + }; }; };
2004 + return {
2005 + middleware: middleware,
2006 + startListening: startListening,
2007 + stopListening: stopListening,
2008 + clearListeners: clearListenerMiddleware
2009 + };
2010 +}
2011 +// src/autoBatchEnhancer.ts
2012 +var SHOULD_AUTOBATCH = "RTK_autoBatch";
2013 +var prepareAutoBatched = function () { return function (payload) {
2014 + var _c;
2015 + return ({
2016 + payload: payload,
2017 + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
2018 + });
2019 +}; };
2020 +var promise;
2021 +var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {
2022 + throw err;
2023 +}, 0); }); };
2024 +var createQueueWithTimer = function (timeout) {
2025 + return function (notify) {
2026 + setTimeout(notify, timeout);
2027 + };
2028 +};
2029 +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
2030 +var autoBatchEnhancer = function (options) {
2031 + if (options === void 0) { options = { type: "raf" }; }
2032 + return function (next) { return function () {
2033 + var args = [];
2034 + for (var _i = 0; _i < arguments.length; _i++) {
2035 + args[_i] = arguments[_i];
2036 + }
2037 + var store = next.apply(void 0, args);
2038 + var notifying = true;
2039 + var shouldNotifyAtEndOfTick = false;
2040 + var notificationQueued = false;
2041 + var listeners = new Set();
2042 + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
2043 + var notifyListeners = function () {
2044 + notificationQueued = false;
2045 + if (shouldNotifyAtEndOfTick) {
2046 + shouldNotifyAtEndOfTick = false;
2047 + listeners.forEach(function (l) { return l(); });
2048 + }
2049 + };
2050 + return Object.assign({}, store, {
2051 + subscribe: function (listener2) {
2052 + var wrappedListener = function () { return notifying && listener2(); };
2053 + var unsubscribe = store.subscribe(wrappedListener);
2054 + listeners.add(listener2);
2055 + return function () {
2056 + unsubscribe();
2057 + listeners.delete(listener2);
2058 + };
2059 + },
2060 + dispatch: function (action) {
2061 + var _a;
2062 + try {
2063 + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
2064 + shouldNotifyAtEndOfTick = !notifying;
2065 + if (shouldNotifyAtEndOfTick) {
2066 + if (!notificationQueued) {
2067 + notificationQueued = true;
2068 + queueCallback(notifyListeners);
2069 + }
2070 + }
2071 + return store.dispatch(action);
2072 + }
2073 + finally {
2074 + notifying = true;
2075 + }
2076 + }
2077 + });
2078 + }; };
2079 +};
2080 +// src/index.ts
2081 +(0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)();
2082 +
2083 +//# sourceMappingURL=redux-toolkit.esm.js.map
56 2084
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 - }
2085 +/***/ }),
61 2086
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((() => {}));
2087 +/***/ "../assets/dev/js/editor/utils/is-instanceof.js":
2088 +/*!******************************************************!*\
2089 + !*** ../assets/dev/js/editor/utils/is-instanceof.js ***!
2090 + \******************************************************/
2091 +/***/ ((__unused_webpack_module, exports) => {
73 2092
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 - }
2093 +"use strict";
87 2094
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 2095
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 - }
2096 +Object.defineProperty(exports, "__esModule", ({
2097 + value: true
2098 +}));
2099 +exports["default"] = void 0;
2100 +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2101 +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2102 +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
2103 +/**
2104 + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
2105 + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
2106 + * check whether it's instanceof by using the objects constructor and prototype names.
2107 + *
2108 + * @param object
2109 + * @param constructors
2110 + * @return {boolean}
2111 + */
2112 +var _default = function _default(object, constructors) {
2113 + constructors = Array.isArray(constructors) ? constructors : [constructors];
2114 + var _iterator = _createForOfIteratorHelper(constructors),
2115 + _step;
2116 + try {
2117 + for (_iterator.s(); !(_step = _iterator.n()).done;) {
2118 + var _constructor = _step.value;
2119 + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
2120 + return true;
2121 + }
2122 + }
2123 + } catch (err) {
2124 + _iterator.e(err);
2125 + } finally {
2126 + _iterator.f();
2127 + }
2128 + return false;
2129 +};
2130 +exports["default"] = _default;
107 2131
108 -//#endregion
109 -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
110 - function _assertThisInitialized(e) {
111 - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
112 - return e;
113 - }
2132 +/***/ }),
114 2133
115 -//#endregion
116 -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
117 - init_typeof();
118 - function _possibleConstructorReturn(t, e) {
119 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
120 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
121 - return _assertThisInitialized(t);
122 - }
2134 +/***/ "../assets/dev/js/modules/imports/args-object.js":
2135 +/*!*******************************************************!*\
2136 + !*** ../assets/dev/js/modules/imports/args-object.js ***!
2137 + \*******************************************************/
2138 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
123 2139
124 -//#endregion
125 -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
126 - function _getPrototypeOf(t) {
127 - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
128 - return t.__proto__ || Object.getPrototypeOf(t);
129 - }, _getPrototypeOf(t);
130 - }
2140 +"use strict";
131 2141
132 -//#endregion
133 -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
134 - function _setPrototypeOf(t, e) {
135 - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
136 - return t.__proto__ = e, t;
137 - }, _setPrototypeOf(t, e);
138 - }
139 2142
140 -//#endregion
141 -//#region node_modules/@babel/runtime/helpers/esm/inherits.js
142 - function _inherits(t, e) {
143 - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
144 - t.prototype = Object.create(e && e.prototype, { constructor: {
145 - value: t,
146 - writable: !0,
147 - configurable: !0
148 - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
149 - }
2143 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2144 +Object.defineProperty(exports, "__esModule", ({
2145 + value: true
2146 +}));
2147 +exports["default"] = void 0;
2148 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2149 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2150 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2151 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2152 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2153 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2154 +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
2155 +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
2156 +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); }; }
2157 +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; } }
2158 +var ArgsObject = /*#__PURE__*/function (_InstanceType) {
2159 + (0, _inherits2.default)(ArgsObject, _InstanceType);
2160 + var _super = _createSuper(ArgsObject);
2161 + /**
2162 + * Function constructor().
2163 + *
2164 + * Create ArgsObject.
2165 + *
2166 + * @param {{}} args
2167 + */
2168 + function ArgsObject(args) {
2169 + var _this;
2170 + (0, _classCallCheck2.default)(this, ArgsObject);
2171 + _this = _super.call(this);
2172 + _this.args = args;
2173 + return _this;
2174 + }
150 2175
151 -//#endregion
152 -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
153 - function _defineProperty(e, r, t) {
154 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
155 - value: t,
156 - enumerable: !0,
157 - configurable: !0,
158 - writable: !0
159 - }) : e[r] = t, e;
160 - }
2176 + /**
2177 + * Function requireArgument().
2178 + *
2179 + * Validate property in args.
2180 + *
2181 + * @param {string} property
2182 + * @param {{}} args
2183 + *
2184 + * @throws {Error}
2185 + */
2186 + (0, _createClass2.default)(ArgsObject, [{
2187 + key: "requireArgument",
2188 + value: function requireArgument(property) {
2189 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
2190 + if (!Object.prototype.hasOwnProperty.call(args, property)) {
2191 + throw Error("".concat(property, " is required."));
2192 + }
2193 + }
161 2194
162 -//#endregion
163 -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
164 - function _arrayWithHoles(r) {
165 - if (Array.isArray(r)) return r;
166 - }
2195 + /**
2196 + * Function requireArgumentType().
2197 + *
2198 + * Validate property in args using `type === typeof(args.whatever)`.
2199 + *
2200 + * @param {string} property
2201 + * @param {string} type
2202 + * @param {{}} args
2203 + *
2204 + * @throws {Error}
2205 + */
2206 + }, {
2207 + key: "requireArgumentType",
2208 + value: function requireArgumentType(property, type) {
2209 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2210 + this.requireArgument(property, args);
2211 + if ((0, _typeof2.default)(args[property]) !== type) {
2212 + throw Error("".concat(property, " invalid type: ").concat(type, "."));
2213 + }
2214 + }
167 2215
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 - }
2216 + /**
2217 + * Function requireArgumentInstance().
2218 + *
2219 + * Validate property in args using `args.whatever instanceof instance`.
2220 + *
2221 + * @param {string} property
2222 + * @param {*} instance
2223 + * @param {{}} args
2224 + *
2225 + * @throws {Error}
2226 + */
2227 + }, {
2228 + key: "requireArgumentInstance",
2229 + value: function requireArgumentInstance(property, instance) {
2230 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2231 + this.requireArgument(property, args);
2232 + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
2233 + throw Error("".concat(property, " invalid instance."));
2234 + }
2235 + }
197 2236
198 -//#endregion
199 -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
200 - function _arrayLikeToArray$2(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$2, "_arrayLikeToArray");
2237 + /**
2238 + * Function requireArgumentConstructor().
2239 + *
2240 + * Validate property in args using `type === args.whatever.constructor`.
2241 + *
2242 + * @param {string} property
2243 + * @param {*} type
2244 + * @param {{}} args
2245 + *
2246 + * @throws {Error}
2247 + */
2248 + }, {
2249 + key: "requireArgumentConstructor",
2250 + value: function requireArgumentConstructor(property, type) {
2251 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2252 + this.requireArgument(property, args);
206 2253
207 -//#endregion
208 -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
209 - function _unsupportedIterableToArray$2(r, a) {
210 - if (r) {
211 - if ("string" == typeof r) return _arrayLikeToArray$2(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$2(r, a) : void 0;
214 - }
215 - }
216 - __name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray");
2254 + // Note: Converting the constructor to string in order to avoid equation issues
2255 + // due to different memory addresses between iframes (window.Object !== window.top.Object).
2256 + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2257 + throw Error("".concat(property, " invalid constructor type."));
2258 + }
2259 + }
2260 + }], [{
2261 + key: "getInstanceType",
2262 + value: function getInstanceType() {
2263 + return 'ArgsObject';
2264 + }
2265 + }]);
2266 + return ArgsObject;
2267 +}(_instanceType.default);
2268 +exports["default"] = ArgsObject;
217 2269
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 - }
2270 +/***/ }),
223 2271
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$2(r, e) || _nonIterableRest();
228 - }
2272 +/***/ "../assets/dev/js/modules/imports/instance-type.js":
2273 +/*!*********************************************************!*\
2274 + !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2275 + \*********************************************************/
2276 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
229 2277
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 - }
2278 +"use strict";
236 2279
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 2280
249 -//#endregion
250 -//#region assets/dev/js/modules/imports/instance-type.js
251 - function _superPropGet$5(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 - __name(_superPropGet$5, "_superPropGet");
258 - var InstanceType = /*#__PURE__*/ function() {
259 - function InstanceType() {
260 - var _this = this;
261 - _classCallCheck(this, InstanceType);
262 - var target = this instanceof InstanceType ? this.constructor : void 0;
263 - var prototypes = [];
264 - while (target.__proto__ && target.__proto__.name) {
265 - prototypes.push(target.__proto__);
266 - target = target.__proto__;
267 - }
268 - prototypes.reverse().forEach(function(proto) {
269 - return _this instanceof proto;
270 - });
271 - }
272 - return _createClass(InstanceType, null, [{
273 - key: Symbol.hasInstance,
274 - value: function value(target) {
275 - /**
276 - * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
277 - * its give's opportunity to mange capabilities of instanceOf operator.
278 - * saving current class each time will give option later to handle instanceOf manually.
279 - */
280 - var result = _superPropGet$5(InstanceType, Symbol.hasInstance, this, 2)([target]);
281 - if (target && !target.constructor.getInstanceType) return result;
282 - if (target) {
283 - if (!target.instanceTypes) target.instanceTypes = [];
284 - if (!result) {
285 - if (this.getInstanceType() === target.constructor.getInstanceType()) result = true;
286 - }
287 - if (result) {
288 - var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType();
289 - if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name);
290 - }
291 - }
292 - if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
293 - return result;
294 - }
295 - }, {
296 - key: "getInstanceType",
297 - value: function getInstanceType() {
298 - elementorModules.ForceMethodImplementation();
299 - }
300 - }]);
301 - }();
2281 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2282 +Object.defineProperty(exports, "__esModule", ({
2283 + value: true
2284 +}));
2285 +exports["default"] = void 0;
2286 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2287 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2288 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2289 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2290 +var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) {
2291 + function InstanceType() {
2292 + var _this = this;
2293 + (0, _classCallCheck2.default)(this, InstanceType);
2294 + // Since anonymous classes sometimes do not get validated by babel, do it manually.
2295 + var target = this instanceof InstanceType ? this.constructor : void 0;
2296 + var prototypes = [];
2297 + while (target.__proto__ && target.__proto__.name) {
2298 + prototypes.push(target.__proto__);
2299 + target = target.__proto__;
2300 + }
2301 + prototypes.reverse().forEach(function (proto) {
2302 + return _this instanceof proto;
2303 + });
2304 + }
2305 + (0, _createClass2.default)(InstanceType, null, [{
2306 + key: _Symbol$hasInstance,
2307 + value: function value(target) {
2308 + /**
2309 + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2310 + * its give's opportunity to mange capabilities of instanceOf operator.
2311 + * saving current class each time will give option later to handle instanceOf manually.
2312 + */
2313 + var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target);
302 2314
303 -//#endregion
304 -//#region assets/dev/js/editor/utils/is-instanceof.js
305 - function _createForOfIteratorHelper$1(r, e) {
306 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
307 - if (!t) {
308 - if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
309 - t && (r = t);
310 - var _n = 0;
311 - var F = function F() {};
312 - return {
313 - s: F,
314 - n: function n() {
315 - return _n >= r.length ? { done: !0 } : {
316 - done: !1,
317 - value: r[_n++]
318 - };
319 - },
320 - e: function e(r) {
321 - throw r;
322 - },
323 - f: F
324 - };
325 - }
326 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
327 - }
328 - var o;
329 - var a = !0;
330 - var u = !1;
331 - return {
332 - s: function s() {
333 - t = t.call(r);
334 - },
335 - n: function n() {
336 - var r = t.next();
337 - return a = r.done, r;
338 - },
339 - e: function e(r) {
340 - u = !0, o = r;
341 - },
342 - f: function f() {
343 - try {
344 - a || null == t.return || t.return();
345 - } finally {
346 - if (u) throw o;
347 - }
348 - }
349 - };
350 - }
351 - __name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper");
352 - function _unsupportedIterableToArray$1(r, a) {
353 - if (r) {
354 - if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
355 - var t = {}.toString.call(r).slice(8, -1);
356 - 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;
357 - }
358 - }
359 - __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray");
360 - function _arrayLikeToArray$1(r, a) {
361 - (null == a || a > r.length) && (a = r.length);
362 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
363 - return n;
364 - }
365 - __name(_arrayLikeToArray$1, "_arrayLikeToArray");
366 - /**
367 - * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
368 - * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
369 - * check whether it's instanceof by using the objects constructor and prototype names.
370 - *
371 - * @param object
372 - * @param constructors
373 - * @return {boolean}
374 - */
375 - var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) {
376 - constructors = Array.isArray(constructors) ? constructors : [constructors];
377 - var _iterator = _createForOfIteratorHelper$1(constructors);
378 - var _step;
379 - try {
380 - for (_iterator.s(); !(_step = _iterator.n()).done;) {
381 - var constructor = _step.value;
382 - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true;
383 - }
384 - } catch (err) {
385 - _iterator.e(err);
386 - } finally {
387 - _iterator.f();
388 - }
389 - return false;
390 - }), "default");
2315 + // Act normal when validate a class, which does not have instance type.
2316 + if (target && !target.constructor.getInstanceType) {
2317 + return result;
2318 + }
2319 + if (target) {
2320 + if (!target.instanceTypes) {
2321 + target.instanceTypes = [];
2322 + }
2323 + if (!result) {
2324 + if (this.getInstanceType() === target.constructor.getInstanceType()) {
2325 + result = true;
2326 + }
2327 + }
2328 + if (result) {
2329 + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2330 + if (-1 === target.instanceTypes.indexOf(name)) {
2331 + target.instanceTypes.push(name);
2332 + }
2333 + }
2334 + }
2335 + if (!result && target) {
2336 + // Check if the given 'target', is instance of known types.
2337 + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2338 + }
2339 + return result;
2340 + }
2341 + }, {
2342 + key: "getInstanceType",
2343 + value: function getInstanceType() {
2344 + elementorModules.ForceMethodImplementation();
2345 + }
2346 + }]);
2347 + return InstanceType;
2348 +}(Symbol.hasInstance);
2349 +exports["default"] = InstanceType;
391 2350
392 -//#endregion
393 -//#region assets/dev/js/modules/imports/args-object.js
394 - init_typeof();
395 - function _callSuper$35(t, o, e) {
396 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$36() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
397 - }
398 - __name(_callSuper$35, "_callSuper");
399 - function _isNativeReflectConstruct$36() {
400 - try {
401 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
402 - } catch (t) {}
403 - return (_isNativeReflectConstruct$36 = function _isNativeReflectConstruct() {
404 - return !!t;
405 - })();
406 - }
407 - __name(_isNativeReflectConstruct$36, "_isNativeReflectConstruct");
408 - var ArgsObject = /*#__PURE__*/ function(_InstanceType) {
409 - /**
410 - * Function constructor().
411 - *
412 - * Create ArgsObject.
413 - *
414 - * @param {{}} args
415 - */
416 - function ArgsObject(args) {
417 - var _this;
418 - _classCallCheck(this, ArgsObject);
419 - _this = _callSuper$35(this, ArgsObject);
420 - _this.args = args;
421 - return _this;
422 - }
423 - /**
424 - * Function requireArgument().
425 - *
426 - * Validate property in args.
427 - *
428 - * @param {string} property
429 - * @param {{}} args
430 - *
431 - * @throws {Error}
432 - */
433 - _inherits(ArgsObject, _InstanceType);
434 - return _createClass(ArgsObject, [
435 - {
436 - key: "requireArgument",
437 - value: function requireArgument(property) {
438 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args;
439 - if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required."));
440 - }
441 - },
442 - {
443 - key: "requireArgumentType",
444 - value: function requireArgumentType(property, type) {
445 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
446 - this.requireArgument(property, args);
447 - if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, "."));
448 - }
449 - },
450 - {
451 - key: "requireArgumentInstance",
452 - value: function requireArgumentInstance(property, instance) {
453 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
454 - this.requireArgument(property, args);
455 - if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance."));
456 - }
457 - },
458 - {
459 - key: "requireArgumentConstructor",
460 - value: function requireArgumentConstructor(property, type) {
461 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
462 - this.requireArgument(property, args);
463 - if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type."));
464 - }
465 - }
466 - ], [{
467 - key: "getInstanceType",
468 - value: function getInstanceType() {
469 - return "ArgsObject";
470 - }
471 - }]);
472 - }(InstanceType);
2351 +/***/ }),
473 2352
474 -//#endregion
475 -//#region modules/web-cli/assets/js/utils/console.js
476 - var Console = /*#__PURE__*/ function() {
477 - function Console() {
478 - _classCallCheck(this, Console);
479 - }
480 - return _createClass(Console, null, [{
481 - key: "error",
482 - value: function error(message) {
483 - if ($e.devTools) $e.devTools.log.error(message);
484 - if (!(message instanceof $e.modules.HookBreak)) console.error(message);
485 - }
486 - }, {
487 - key: "warn",
488 - value: function warn() {
489 - var _console;
490 - var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
491 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
492 - args.unshift("%c %c", style, "");
493 - (_console = console).warn.apply(_console, args);
494 - }
495 - }]);
496 - }();
2353 +/***/ "../assets/dev/js/modules/imports/module.js":
2354 +/*!**************************************************!*\
2355 + !*** ../assets/dev/js/modules/imports/module.js ***!
2356 + \**************************************************/
2357 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
497 2358
498 -//#endregion
499 -//#region modules/web-cli/assets/js/utils/deprecation.js
2359 +"use strict";
2360 +
2361 +
2362 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2363 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2364 +var Module = function Module() {
2365 + var $ = jQuery,
2366 + instanceParams = arguments,
2367 + self = this,
2368 + events = {};
2369 + var settings;
2370 + var ensureClosureMethods = function ensureClosureMethods() {
2371 + $.each(self, function (methodName) {
2372 + var oldMethod = self[methodName];
2373 + if ('function' !== typeof oldMethod) {
2374 + return;
2375 + }
2376 + self[methodName] = function () {
2377 + return oldMethod.apply(self, arguments);
2378 + };
2379 + });
2380 + };
2381 + var initSettings = function initSettings() {
2382 + settings = self.getDefaultSettings();
2383 + var instanceSettings = instanceParams[0];
2384 + if (instanceSettings) {
2385 + $.extend(true, settings, instanceSettings);
2386 + }
2387 + };
2388 + var init = function init() {
2389 + self.__construct.apply(self, instanceParams);
2390 + ensureClosureMethods();
2391 + initSettings();
2392 + self.trigger('init');
2393 + };
2394 + this.getItems = function (items, itemKey) {
2395 + if (itemKey) {
2396 + var keyStack = itemKey.split('.'),
2397 + currentKey = keyStack.splice(0, 1);
2398 + if (!keyStack.length) {
2399 + return items[currentKey];
2400 + }
2401 + if (!items[currentKey]) {
2402 + return;
2403 + }
2404 + return this.getItems(items[currentKey], keyStack.join('.'));
2405 + }
2406 + return items;
2407 + };
2408 + this.getSettings = function (setting) {
2409 + return this.getItems(settings, setting);
2410 + };
2411 + this.setSettings = function (settingKey, value, settingsContainer) {
2412 + if (!settingsContainer) {
2413 + settingsContainer = settings;
2414 + }
2415 + if ('object' === (0, _typeof2.default)(settingKey)) {
2416 + $.extend(settingsContainer, settingKey);
2417 + return self;
2418 + }
2419 + var keyStack = settingKey.split('.'),
2420 + currentKey = keyStack.splice(0, 1);
2421 + if (!keyStack.length) {
2422 + settingsContainer[currentKey] = value;
2423 + return self;
2424 + }
2425 + if (!settingsContainer[currentKey]) {
2426 + settingsContainer[currentKey] = {};
2427 + }
2428 + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2429 + };
2430 + this.getErrorMessage = function (type, functionName) {
2431 + var message;
2432 + switch (type) {
2433 + case 'forceMethodImplementation':
2434 + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2435 + break;
2436 + default:
2437 + message = 'An error occurs';
2438 + }
2439 + return message;
2440 + };
2441 +
2442 + // TODO: This function should be deleted ?.
2443 + this.forceMethodImplementation = function (functionName) {
2444 + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2445 + };
2446 + this.on = function (eventName, callback) {
2447 + if ('object' === (0, _typeof2.default)(eventName)) {
2448 + $.each(eventName, function (singleEventName) {
2449 + self.on(singleEventName, this);
2450 + });
2451 + return self;
2452 + }
2453 + var eventNames = eventName.split(' ');
2454 + eventNames.forEach(function (singleEventName) {
2455 + if (!events[singleEventName]) {
2456 + events[singleEventName] = [];
2457 + }
2458 + events[singleEventName].push(callback);
2459 + });
2460 + return self;
2461 + };
2462 + this.off = function (eventName, callback) {
2463 + if (!events[eventName]) {
2464 + return self;
2465 + }
2466 + if (!callback) {
2467 + delete events[eventName];
2468 + return self;
2469 + }
2470 + var callbackIndex = events[eventName].indexOf(callback);
2471 + if (-1 !== callbackIndex) {
2472 + delete events[eventName][callbackIndex];
2473 +
2474 + // Reset array index (for next off on same event).
2475 + events[eventName] = events[eventName].filter(function (val) {
2476 + return val;
2477 + });
2478 + }
2479 + return self;
2480 + };
2481 + this.trigger = function (eventName) {
2482 + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2483 + params = Array.prototype.slice.call(arguments, 1);
2484 + if (self[methodName]) {
2485 + self[methodName].apply(self, params);
2486 + }
2487 + var callbacks = events[eventName];
2488 + if (!callbacks) {
2489 + return self;
2490 + }
2491 + $.each(callbacks, function (index, callback) {
2492 + callback.apply(self, params);
2493 + });
2494 + return self;
2495 + };
2496 + init();
2497 +};
2498 +Module.prototype.__construct = function () {};
2499 +Module.prototype.getDefaultSettings = function () {
2500 + return {};
2501 +};
2502 +Module.prototype.getConstructorID = function () {
2503 + return this.constructor.name;
2504 +};
2505 +Module.extend = function (properties) {
2506 + var $ = jQuery,
2507 + parent = this;
2508 + var child = function child() {
2509 + return parent.apply(this, arguments);
2510 + };
2511 + $.extend(child, parent);
2512 + child.prototype = Object.create($.extend({}, parent.prototype, properties));
2513 + child.prototype.constructor = child;
2514 + child.__super__ = parent.prototype;
2515 + return child;
2516 +};
2517 +module.exports = Module;
2518 +
2519 +/***/ }),
2520 +
2521 +/***/ "../modules/web-cli/assets/js/api.js":
2522 +/*!*******************************************!*\
2523 + !*** ../modules/web-cli/assets/js/api.js ***!
2524 + \*******************************************/
2525 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2526 +
2527 +"use strict";
2528 +
2529 +
2530 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2531 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2532 +Object.defineProperty(exports, "__esModule", ({
2533 + value: true
2534 +}));
2535 +exports["default"] = void 0;
2536 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2537 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2538 +var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js"));
2539 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2540 +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js"));
2541 +var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js"));
2542 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js"));
2543 +var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js"));
2544 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2545 +var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js"));
2546 +var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js"));
2547 +var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js"));
2548 +var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js"));
2549 +var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js"));
2550 +var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js"));
2551 +var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js"));
2552 +var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js"));
2553 +var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js"));
2554 +var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js"));
2555 +var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js"));
2556 +var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js"));
2557 +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2558 +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2559 +/* Alphabetical order */
2560 +var API = /*#__PURE__*/function () {
2561 + /**
2562 + * Function constructor().
2563 + *
2564 + * Create's 'elementor' api.
2565 + */
2566 + function API() {
2567 + (0, _classCallCheck2.default)(this, API);
2568 + this.components = new _components.default();
2569 + this.commands = new _commands.default();
2570 + this.commandsInternal = new _commandsInternal.default();
2571 + this.hooks = new _hooks.default();
2572 + this.routes = new _routes.default();
2573 + this.shortcuts = new _shortcuts.default(jQuery(window));
2574 + this.data = new _data.default();
2575 + this.store = new _store.default();
2576 + this.uiStates = new _uiStates.default();
2577 + this.modules = {
2578 + CommandBase: _commandBase.default,
2579 + CommandInternalBase: _commandInternalBase.default,
2580 + CommandData: _commandData.default,
2581 + ComponentBase: _componentBase.default,
2582 + ComponentModalBase: _componentModalBase.default,
2583 + HookBreak: _hookBreak.default,
2584 + hookData: hookData,
2585 + hookUI: hookUI
2586 + };
2587 + this.extras = {
2588 + hashCommands: new _hashCommands.default()
2589 + };
2590 +
2591 + // Backwards compatibility should be last, in order to handle others.
2592 + this.bc = new _backwardsCompatibility.default();
2593 + }
2594 +
2595 + /**
2596 + * Function run().
2597 + *
2598 + * Alias of `$e.commands.run()`.
2599 + *
2600 + * @param {string} command
2601 + * @param {*} [args={}]
2602 + *
2603 + * @return {*} result
2604 + */
2605 + (0, _createClass2.default)(API, [{
2606 + key: "run",
2607 + value: function run(command) {
2608 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2609 + return $e.commands.run(command, args);
2610 + }
2611 +
2612 + /**
2613 + * Function internal().
2614 + *
2615 + * Alias of `$e.commandsInternal.run()`.
2616 + *
2617 + * @param {string} command
2618 + * @param {*} [args={}]
2619 + *
2620 + * @return {boolean} result
2621 + */
2622 + }, {
2623 + key: "internal",
2624 + value: function internal(command) {
2625 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2626 + return $e.commandsInternal.run(command, args);
2627 + }
2628 +
2629 + /**
2630 + * Function route().
2631 + *
2632 + * Alias of `$e.routes.to()`.
2633 + *
2634 + * @param {string} route
2635 + * @param {*} [args={}]
2636 + * @param {Object} [options]
2637 + */
2638 + }, {
2639 + key: "route",
2640 + value: function route(_route) {
2641 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2642 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
2643 + history: true
2644 + };
2645 + return $e.routes.to(_route, args, options);
2646 + }
2647 +
2648 + // TODO: shortcut();
2649 + }]);
2650 + return API;
2651 +}();
2652 +exports["default"] = API;
2653 +
2654 +/***/ }),
2655 +
2656 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js":
2657 +/*!********************************************************************!*\
2658 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***!
2659 + \********************************************************************/
2660 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2661 +
2662 +"use strict";
2663 +
2664 +
2665 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2666 +Object.defineProperty(exports, "__esModule", ({
2667 + value: true
2668 +}));
2669 +exports["default"] = void 0;
2670 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2671 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2672 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2673 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2674 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2675 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2676 +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); }; }
2677 +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; } }
2678 +var BackwardsCompatibility = /*#__PURE__*/function () {
2679 + function BackwardsCompatibility() {
2680 + (0, _classCallCheck2.default)(this, BackwardsCompatibility);
2681 + }
2682 + (0, _createClass2.default)(BackwardsCompatibility, [{
2683 + key: "ensureTab",
2684 + value: function ensureTab(namespace, tabSlug) {
2685 + var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
2686 + var component = $e.components.get(namespace);
2687 + if (!component) {
2688 + var Component = /*#__PURE__*/function (_ComponentBase) {
2689 + (0, _inherits2.default)(Component, _ComponentBase);
2690 + var _super = _createSuper(Component);
2691 + function Component() {
2692 + (0, _classCallCheck2.default)(this, Component);
2693 + return _super.apply(this, arguments);
2694 + }
2695 + (0, _createClass2.default)(Component, [{
2696 + key: "getNamespace",
2697 + value: function getNamespace() {
2698 + return namespace;
2699 + }
2700 + }, {
2701 + key: "renderTab",
2702 + value: function renderTab(tab) {
2703 + elementor.getPanelView().setPage(page).activateTab(tab);
2704 + }
2705 + }]);
2706 + return Component;
2707 + }(_componentBase.default);
2708 + component = $e.components.register(new Component());
2709 + }
2710 + if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) {
2711 + component.addTab(tabSlug, {
2712 + title: elementor.config.tabs[tabSlug]
2713 + });
2714 + }
2715 + }
2716 + }]);
2717 + return BackwardsCompatibility;
2718 +}();
2719 +exports["default"] = BackwardsCompatibility;
2720 +
2721 +/***/ }),
2722 +
2723 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js":
2724 +/*!*****************************************************************************!*\
2725 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***!
2726 + \*****************************************************************************/
2727 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2728 +
2729 +"use strict";
2730 +
2731 +
2732 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2733 +Object.defineProperty(exports, "__esModule", ({
2734 + value: true
2735 +}));
2736 +exports["default"] = void 0;
2737 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2738 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2739 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2740 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2741 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2742 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2743 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2744 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
2745 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2746 +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); }; }
2747 +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; } }
2748 +var CommandsBackwardsCompatibility = /*#__PURE__*/function (_Module) {
2749 + (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module);
2750 + var _super = _createSuper(CommandsBackwardsCompatibility);
2751 + function CommandsBackwardsCompatibility() {
2752 + var _this;
2753 + (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility);
2754 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2755 + args[_key] = arguments[_key];
2756 + }
2757 + _this = _super.call.apply(_super, [this].concat(args));
2758 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "on", function (eventName, callback) {
2759 + if ('run' === eventName) {
2760 + var componentName = _this.getConstructorID();
2761 +
2762 + // Regex takes the first letter and convert it to lower case.
2763 + componentName = componentName.replace(/^./, function (val) {
2764 + return val.toLowerCase();
2765 + });
2766 + _deprecation.default.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )"));
2767 + _this.onOrig('run:before', callback);
2768 + return;
2769 + }
2770 + _this.onOrig(eventName, callback);
2771 + });
2772 + return _this;
2773 + }
2774 + (0, _createClass2.default)(CommandsBackwardsCompatibility, [{
2775 + key: "__construct",
2776 + value: function __construct() {
2777 + this.onOrig = this.on;
2778 + }
2779 + }]);
2780 + return CommandsBackwardsCompatibility;
2781 +}(_module.default);
2782 +exports["default"] = CommandsBackwardsCompatibility;
2783 +
2784 +/***/ }),
2785 +
2786 +/***/ "../modules/web-cli/assets/js/core/commands-internal.js":
2787 +/*!**************************************************************!*\
2788 + !*** ../modules/web-cli/assets/js/core/commands-internal.js ***!
2789 + \**************************************************************/
2790 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2791 +
2792 +"use strict";
2793 +
2794 +
2795 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2796 +Object.defineProperty(exports, "__esModule", ({
2797 + value: true
2798 +}));
2799 +exports["default"] = void 0;
2800 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2801 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2802 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2803 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2804 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2805 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
2806 +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); }; }
2807 +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; } }
2808 +var CommandsInternal = /*#__PURE__*/function (_Commands) {
2809 + (0, _inherits2.default)(CommandsInternal, _Commands);
2810 + var _super = _createSuper(CommandsInternal);
2811 + function CommandsInternal() {
2812 + (0, _classCallCheck2.default)(this, CommandsInternal);
2813 + return _super.apply(this, arguments);
2814 + }
2815 + (0, _createClass2.default)(CommandsInternal, [{
2816 + key: "error",
2817 + value: function error(message) {
2818 + throw Error('Commands internal: ' + message);
2819 + }
2820 + }]);
2821 + return CommandsInternal;
2822 +}(_commands.default);
2823 +exports["default"] = CommandsInternal;
2824 +
2825 +/***/ }),
2826 +
2827 +/***/ "../modules/web-cli/assets/js/core/commands.js":
2828 +/*!*****************************************************!*\
2829 + !*** ../modules/web-cli/assets/js/core/commands.js ***!
2830 + \*****************************************************/
2831 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2832 +
2833 +"use strict";
2834 +
2835 +
2836 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2837 +Object.defineProperty(exports, "__esModule", ({
2838 + value: true
2839 +}));
2840 +exports["default"] = void 0;
2841 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
2842 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
2843 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2844 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2845 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2846 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2847 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2848 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2849 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2850 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2851 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js"));
2852 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ../modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2853 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
2854 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2855 +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2856 +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2857 +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); }; }
2858 +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; } }
500 2859 /**
501 - * @typedef {Object} Version
502 - * @property {number} major1 The first number
503 - * @property {number} major2 The second number
504 - * @property {number} minor The third number
505 - * @property {string} build The fourth number
506 - */
507 - var softDeprecated = function softDeprecated(name, version, replacement) {
508 - if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement);
509 - };
510 - var hardDeprecated = function hardDeprecated(name, version, replacement) {
511 - deprecatedMessage("hard", name, version, replacement);
512 - };
513 - var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
514 - var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
515 - if (replacement) message += " - Use `".concat(replacement, "` instead");
516 - Console.warn(message);
517 - };
518 - var Deprecation = /*#__PURE__*/ function() {
519 - function Deprecation() {
520 - _classCallCheck(this, Deprecation);
521 - }
522 - return _createClass(Deprecation, null, [
523 - {
524 - key: "deprecated",
525 - value: function deprecated(name, version, replacement) {
526 - if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement);
527 - else softDeprecated(name, version, replacement);
528 - }
529 - },
530 - {
531 - key: "parseVersion",
532 - value: function parseVersion(version) {
533 - var versionParts = version.split(".");
534 - if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided");
535 - var _versionParts = _slicedToArray(versionParts, 4);
536 - var major1 = _versionParts[0];
537 - var major2 = _versionParts[1];
538 - var minor = _versionParts[2];
539 - var _versionParts$ = _versionParts[3];
540 - return {
541 - major1: parseInt(major1),
542 - major2: parseInt(major2),
543 - minor: parseInt(minor),
544 - build: _versionParts$ === void 0 ? "" : _versionParts$
545 - };
546 - }
547 - },
548 - {
549 - key: "getTotalMajor",
550 - value: function getTotalMajor(versionObj) {
551 - var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
552 - total = Number((total / 10).toFixed(0));
553 - if (versionObj.major2 > 9) total = versionObj.major2 - 9;
554 - return total;
555 - }
556 - },
557 - {
558 - key: "compareVersion",
559 - value: function compareVersion(version1, version2) {
560 - var _this = this;
561 - return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) {
562 - return _this.getTotalMajor(versionObj);
563 - }).reduce(function(acc, major) {
564 - return acc - major;
565 - });
566 - }
567 - },
568 - {
569 - key: "isSoftDeprecated",
570 - value: function isSoftDeprecated(version) {
571 - return this.compareVersion(version, elementorWebCliConfig.version) <= 4;
572 - }
573 - },
574 - {
575 - key: "isHardDeprecated",
576 - value: function isHardDeprecated(version) {
577 - var total = this.compareVersion(version, elementorWebCliConfig.version);
578 - return total < 0 || total >= 8;
579 - }
580 - }
581 - ]);
582 - }();
2860 + * @typedef {import('../modules/component-base')} ComponentBase
2861 + */
2862 +/**
2863 + * @typedef {import('../modules/command-base')} CommandBase
2864 + */
2865 +/**
2866 + * @typedef {{}} Component
2867 + */
2868 +var Commands = /*#__PURE__*/function (_CommandsBackwardsCom) {
2869 + (0, _inherits2.default)(Commands, _CommandsBackwardsCom);
2870 + var _super = _createSuper(Commands);
2871 + /**
2872 + * Function constructor().
2873 + *
2874 + * Create `$e.commands` API.
2875 + *
2876 + * @param {{}} args
2877 + */
2878 + function Commands() {
2879 + var _this;
2880 + (0, _classCallCheck2.default)(this, Commands);
2881 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2882 + args[_key] = arguments[_key];
2883 + }
2884 + _this = _super.call.apply(_super, [this].concat(args));
2885 + _this.current = {};
2886 + _this.currentArgs = {};
2887 + _this.currentTrace = [];
2888 + _this.commands = {};
2889 + _this.components = {};
2890 + Object.defineProperty((0, _assertThisInitialized2.default)(_this), 'classes', {
2891 + get: function get() {
2892 + _deprecation.default.deprecated('$e.commands.classes', '3.7.0', '$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,');
2893 + return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2894 + }
2895 + });
2896 + return _this;
2897 + }
583 2898
584 -//#endregion
585 -//#region modules/web-cli/assets/js/modules/command-infra.js
586 - function _callSuper$34(t, o, e) {
587 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$35() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
588 - }
589 - __name(_callSuper$34, "_callSuper");
590 - function _isNativeReflectConstruct$35() {
591 - try {
592 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
593 - } catch (t) {}
594 - return (_isNativeReflectConstruct$35 = function _isNativeReflectConstruct() {
595 - return !!t;
596 - })();
597 - }
598 - __name(_isNativeReflectConstruct$35, "_isNativeReflectConstruct");
599 - /**
600 - * @typedef {import('../modules/component-base')} ComponentBase
601 - */
602 - var CommandInfra = /*#__PURE__*/ function(_ArgsObject) {
603 - /**
604 - * Function constructor().
605 - *
606 - * Create Commands Base.
607 - *
608 - * @param {{}} args
609 - */
610 - function CommandInfra() {
611 - var _this;
612 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
613 - _classCallCheck(this, CommandInfra);
614 - _this = _callSuper$34(this, CommandInfra, [args]);
615 - if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`.");
616 - _this.command = _this.constructor.getCommand();
617 - _this.component = _this.constructor.getComponent();
618 - _this.initialize(args);
619 - args = _this.args;
620 - _this.validateArgs(args);
621 - return _this;
622 - }
623 - /**
624 - * Function initialize().
625 - *
626 - * Initialize command, called after construction.
627 - *
628 - * @param {{}} args
629 - */
630 - _inherits(CommandInfra, _ArgsObject);
631 - return _createClass(CommandInfra, [
632 - {
633 - key: "currentCommand",
634 - get: function get() {
635 - Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command");
636 - return this.command;
637 - }
638 - },
639 - {
640 - key: "initialize",
641 - value: function initialize() {
642 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
643 - }
644 - },
645 - {
646 - key: "validateArgs",
647 - value: function validateArgs() {
648 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
649 - }
650 - },
651 - {
652 - key: "apply",
653 - value: function apply() {
654 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
655 - elementorModules.ForceMethodImplementation();
656 - }
657 - },
658 - {
659 - key: "run",
660 - value: function run() {
661 - return this.apply(this.args);
662 - }
663 - },
664 - {
665 - key: "onBeforeRun",
666 - value: function onBeforeRun() {
667 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
668 - }
669 - },
670 - {
671 - key: "onAfterRun",
672 - value: function onAfterRun() {
673 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
674 - arguments.length > 1 && arguments[1];
675 - }
676 - },
677 - {
678 - key: "onBeforeApply",
679 - value: function onBeforeApply() {
680 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
681 - }
682 - },
683 - {
684 - key: "onAfterApply",
685 - value: function onAfterApply() {
686 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
687 - arguments.length > 1 && arguments[1];
688 - }
689 - },
690 - {
691 - key: "onCatchApply",
692 - value: function onCatchApply(e) {}
693 - }
694 - ], [
695 - {
696 - key: "getInstanceType",
697 - value: function getInstanceType() {
698 - return "CommandInfra";
699 - }
700 - },
701 - {
702 - key: "getInfo",
703 - value: function getInfo() {
704 - return {};
705 - }
706 - },
707 - {
708 - key: "getCommand",
709 - value: function getCommand() {
710 - return this.registerConfig.command;
711 - }
712 - },
713 - {
714 - key: "getComponent",
715 - value: function getComponent() {
716 - return this.registerConfig.component;
717 - }
718 - },
719 - {
720 - key: "setRegisterConfig",
721 - value: function setRegisterConfig(config) {
722 - this.registerConfig = Object.freeze(config);
723 - }
724 - }
725 - ]);
726 - }(ArgsObject);
727 - /**
728 - * @type {Object}
729 - */
730 - _defineProperty(CommandInfra, "registerConfig", null);
2899 + /**
2900 + * @param {string} id
2901 + * @return {CommandBase} command class
2902 + */
2903 + (0, _createClass2.default)(Commands, [{
2904 + key: "getCommandClass",
2905 + value: function getCommandClass(id) {
2906 + return this.commands[id];
2907 + }
731 2908
732 -//#endregion
733 -//#region modules/web-cli/assets/js/modules/command-base.js
734 - function _callSuper$33(t, o, e) {
735 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$34() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
736 - }
737 - __name(_callSuper$33, "_callSuper");
738 - function _isNativeReflectConstruct$34() {
739 - try {
740 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
741 - } catch (t) {}
742 - return (_isNativeReflectConstruct$34 = function _isNativeReflectConstruct() {
743 - return !!t;
744 - })();
745 - }
746 - __name(_isNativeReflectConstruct$34, "_isNativeReflectConstruct");
747 - /**
748 - * @name $e.modules.CommandBase
749 - */
750 - var CommandBase = /*#__PURE__*/ function(_CommandInfra) {
751 - function CommandBase() {
752 - _classCallCheck(this, CommandBase);
753 - return _callSuper$33(this, CommandBase, arguments);
754 - }
755 - _inherits(CommandBase, _CommandInfra);
756 - return _createClass(CommandBase, [
757 - {
758 - key: "onBeforeRun",
759 - value: function onBeforeRun() {
760 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
761 - $e.hooks.runUIBefore(this.command, args);
762 - }
763 - },
764 - {
765 - key: "onAfterRun",
766 - value: function onAfterRun() {
767 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
768 - var result = arguments.length > 1 ? arguments[1] : void 0;
769 - $e.hooks.runUIAfter(this.command, args, result);
770 - }
771 - },
772 - {
773 - key: "onBeforeApply",
774 - value: function onBeforeApply() {
775 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
776 - $e.hooks.runDataDependency(this.command, args);
777 - }
778 - },
779 - {
780 - key: "onAfterApply",
781 - value: function onAfterApply() {
782 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
783 - var result = arguments.length > 1 ? arguments[1] : void 0;
784 - return $e.hooks.runDataAfter(this.command, args, result);
785 - }
786 - },
787 - {
788 - key: "onCatchApply",
789 - value: function onCatchApply(e) {
790 - this.runCatchHooks(e);
791 - }
792 - },
793 - {
794 - key: "runCatchHooks",
795 - value: function runCatchHooks(e) {
796 - $e.hooks.runDataCatch(this.command, this.args, e);
797 - $e.hooks.runUICatch(this.command, this.args, e);
798 - }
799 - },
800 - {
801 - key: "requireContainer",
802 - value: function requireContainer() {
803 - var _this = this;
804 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args;
805 - Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`");
806 - if (!args.container && !args.containers) throw Error("container or containers are required.");
807 - if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them.");
808 - (args.containers || [args.container]).forEach(function(container) {
809 - _this.requireArgumentInstance("container", elementorModules.editor.Container, { container });
810 - });
811 - }
812 - }
813 - ], [{
814 - key: "getInstanceType",
815 - value: function getInstanceType() {
816 - return "CommandBase";
817 - }
818 - }]);
819 - }(CommandInfra);
2909 + /**
2910 + * Function getAll().
2911 + *
2912 + * Receive all loaded commands.
2913 + *
2914 + * @return {string[]} commands
2915 + */
2916 + }, {
2917 + key: "getAll",
2918 + value: function getAll() {
2919 + return Object.keys(this.commands).sort();
2920 + }
820 2921
821 -//#endregion
822 -//#region modules/web-cli/assets/js/modules/command-callback-base.js
823 - function _callSuper$32(t, o, e) {
824 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$33() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
825 - }
826 - __name(_callSuper$32, "_callSuper");
827 - function _isNativeReflectConstruct$33() {
828 - try {
829 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
830 - } catch (t) {}
831 - return (_isNativeReflectConstruct$33 = function _isNativeReflectConstruct() {
832 - return !!t;
833 - })();
834 - }
835 - __name(_isNativeReflectConstruct$33, "_isNativeReflectConstruct");
836 - /**
837 - * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
838 - */
839 - var CommandCallbackBase = /*#__PURE__*/ function(_CommandBase) {
840 - function CommandCallbackBase() {
841 - _classCallCheck(this, CommandCallbackBase);
842 - return _callSuper$32(this, CommandCallbackBase, arguments);
843 - }
844 - _inherits(CommandCallbackBase, _CommandBase);
845 - return _createClass(CommandCallbackBase, [{
846 - key: "apply",
847 - value: function apply() {
848 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
849 - return this.constructor.getCallback()(args);
850 - }
851 - }], [{
852 - key: "getInstanceType",
853 - value: function getInstanceType() {
854 - return "CommandCallbackBase";
855 - }
856 - }, {
857 - key: "getCallback",
858 - value: function getCallback() {
859 - return this.registerConfig.callback;
860 - }
861 - }]);
862 - }(CommandBase);
2922 + /**
2923 + * Function register().
2924 + *
2925 + * Register new command.
2926 + *
2927 + * @param {ComponentBase|string} component
2928 + * @param {string} command
2929 + * @param {Function} callback
2930 + *
2931 + * @return {Commands} commands
2932 + */
2933 + }, {
2934 + key: "register",
2935 + value: function register(component, command, callback) {
2936 + var _this2 = this;
2937 + var namespace;
2938 + if ('string' === typeof component) {
2939 + namespace = component;
2940 + component = $e.components.get(namespace);
2941 + if (!component) {
2942 + this.error("'".concat(namespace, "' component is not exist."));
2943 + }
2944 + } else {
2945 + namespace = component.getNamespace();
2946 + }
2947 + var fullCommand = namespace + (command ? '/' + command : '');
2948 + if (this.commands[fullCommand]) {
2949 + this.error("`".concat(fullCommand, "` is already registered."));
2950 + }
2951 + this.commands[fullCommand] = callback;
2952 + this.components[fullCommand] = namespace;
2953 + var shortcuts = component.getShortcuts(),
2954 + shortcut = shortcuts[command];
2955 + if (shortcut) {
2956 + shortcut.command = fullCommand;
2957 + shortcut.callback = function (event) {
2958 + return _this2.runShortcut(fullCommand, event);
2959 + };
2960 + $e.shortcuts.register(shortcut.keys, shortcut);
2961 + }
2962 + return this;
2963 + }
2964 + }, {
2965 + key: "unregister",
2966 + value: function unregister(component, command) {
2967 + var namespace;
2968 + if ('string' === typeof component) {
2969 + namespace = component;
2970 + component = $e.components.get(namespace);
2971 + if (!component) {
2972 + this.error("'".concat(namespace, "' component is not exist."));
2973 + }
2974 + } else {
2975 + namespace = component.getNamespace();
2976 + }
2977 + var fullCommand = namespace + (command ? '/' + command : '');
2978 + if (!this.commands[fullCommand]) {
2979 + this.error("`".concat(fullCommand, "` not exist."));
2980 + }
2981 + delete this.commands[fullCommand];
2982 + delete this.components[fullCommand];
2983 + var shortcuts = component.getShortcuts(),
2984 + shortcut = shortcuts[command];
2985 + if (shortcut) {
2986 + $e.shortcuts.unregister(shortcut.keys, shortcut);
2987 + }
2988 + return this;
2989 + }
863 2990
864 -//#endregion
865 -//#region assets/dev/js/modules/imports/module.js
866 - var require_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
867 - init_typeof();
868 - var Module = function Module() {
869 - var $ = jQuery;
870 - var instanceParams = arguments;
871 - var self = this;
872 - var events = {};
873 - var settings;
874 - var ensureClosureMethods = function ensureClosureMethods() {
875 - $.each(self, function(methodName) {
876 - var oldMethod = self[methodName];
877 - if ("function" !== typeof oldMethod) return;
878 - self[methodName] = function() {
879 - return oldMethod.apply(self, arguments);
880 - };
881 - });
882 - };
883 - var initSettings = function initSettings() {
884 - settings = self.getDefaultSettings();
885 - var instanceSettings = instanceParams[0];
886 - if (instanceSettings) $.extend(true, settings, instanceSettings);
887 - };
888 - var init = function init() {
889 - self.__construct.apply(self, instanceParams);
890 - ensureClosureMethods();
891 - initSettings();
892 - self.trigger("init");
893 - };
894 - this.getItems = function(items, itemKey) {
895 - if (itemKey) {
896 - var keyStack = itemKey.split(".");
897 - var currentKey = keyStack.splice(0, 1);
898 - if (!keyStack.length) return items[currentKey];
899 - if (!items[currentKey]) return;
900 - return this.getItems(items[currentKey], keyStack.join("."));
901 - }
902 - return items;
903 - };
904 - this.getSettings = function(setting) {
905 - return this.getItems(settings, setting);
906 - };
907 - this.setSettings = function(settingKey, value, settingsContainer) {
908 - if (!settingsContainer) settingsContainer = settings;
909 - if ("object" === _typeof(settingKey)) {
910 - $.extend(settingsContainer, settingKey);
911 - return self;
912 - }
913 - var keyStack = settingKey.split(".");
914 - var currentKey = keyStack.splice(0, 1);
915 - if (!keyStack.length) {
916 - settingsContainer[currentKey] = value;
917 - return self;
918 - }
919 - if (!settingsContainer[currentKey]) settingsContainer[currentKey] = {};
920 - return self.setSettings(keyStack.join("."), value, settingsContainer[currentKey]);
921 - };
922 - this.getErrorMessage = function(type, functionName) {
923 - var message;
924 - switch (type) {
925 - case "forceMethodImplementation":
926 - message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
927 - break;
928 - default: message = "An error occurs";
929 - }
930 - return message;
931 - };
932 - this.forceMethodImplementation = function(functionName) {
933 - throw new Error(this.getErrorMessage("forceMethodImplementation", functionName));
934 - };
935 - this.on = function(eventName, callback) {
936 - if ("object" === _typeof(eventName)) {
937 - $.each(eventName, function(singleEventName) {
938 - self.on(singleEventName, this);
939 - });
940 - return self;
941 - }
942 - eventName.split(" ").forEach(function(singleEventName) {
943 - if (!events[singleEventName]) events[singleEventName] = [];
944 - events[singleEventName].push(callback);
945 - });
946 - return self;
947 - };
948 - this.off = function(eventName, callback) {
949 - if (!events[eventName]) return self;
950 - if (!callback) {
951 - delete events[eventName];
952 - return self;
953 - }
954 - var callbackIndex = events[eventName].indexOf(callback);
955 - if (-1 !== callbackIndex) {
956 - delete events[eventName][callbackIndex];
957 - events[eventName] = events[eventName].filter(function(val) {
958 - return val;
959 - });
960 - }
961 - return self;
962 - };
963 - this.trigger = function(eventName) {
964 - var methodName = "on" + eventName[0].toUpperCase() + eventName.slice(1);
965 - var params = Array.prototype.slice.call(arguments, 1);
966 - if (self[methodName]) self[methodName].apply(self, params);
967 - var callbacks = events[eventName];
968 - if (!callbacks) return self;
969 - $.each(callbacks, function(index, callback) {
970 - callback.apply(self, params);
971 - });
972 - return self;
973 - };
974 - init();
975 - };
976 - Module.prototype.__construct = function() {};
977 - Module.prototype.getDefaultSettings = function() {
978 - return {};
979 - };
980 - Module.prototype.getConstructorID = function() {
981 - return this.constructor.name;
982 - };
983 - Module.extend = function(properties) {
984 - var $ = jQuery;
985 - var parent = this;
986 - var child = function child() {
987 - return parent.apply(this, arguments);
988 - };
989 - $.extend(child, parent);
990 - child.prototype = Object.create($.extend({}, parent.prototype, properties));
991 - child.prototype.constructor = child;
992 - child.__super__ = parent.prototype;
993 - return child;
994 - };
995 - module.exports = Module;
996 - }));
2991 + /**
2992 + * Function getComponent().
2993 + *
2994 + * Receive Component of the command.
2995 + *
2996 + * @param {string} command
2997 + *
2998 + * @return {Component} component
2999 + */
3000 + }, {
3001 + key: "getComponent",
3002 + value: function getComponent(command) {
3003 + var namespace = this.components[command];
3004 + return $e.components.get(namespace);
3005 + }
997 3006
998 -//#endregion
999 -//#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
1000 -var import_module = /* @__PURE__ */ __toESM(require_module());
1001 - function _isNativeFunction(t) {
1002 - try {
1003 - return -1 !== Function.toString.call(t).indexOf("[native code]");
1004 - } catch (n) {
1005 - return "function" == typeof t;
1006 - }
1007 - }
3007 + /**
3008 + * Function is().
3009 + *
3010 + * Checks if current running command is the same parameter command.
3011 + *
3012 + * @param {string} command
3013 + *
3014 + * @return {boolean} is this command the same as the one passed in the arguments
3015 + */
3016 + }, {
3017 + key: "is",
3018 + value: function is(command) {
3019 + var component = this.getComponent(command);
3020 + if (!component) {
3021 + return false;
3022 + }
3023 + return command === this.current[component.getServiceName()];
3024 + }
1008 3025
1009 -//#endregion
1010 -//#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
1011 - function _isNativeReflectConstruct$32() {
1012 - try {
1013 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1014 - } catch (t) {}
1015 - return (_isNativeReflectConstruct$32 = function _isNativeReflectConstruct() {
1016 - return !!t;
1017 - })();
1018 - }
1019 - __name(_isNativeReflectConstruct$32, "_isNativeReflectConstruct");
3026 + /**
3027 + * Function isCurrentFirstTrace().
3028 + *
3029 + * Checks if parameter command is the first command in trace that currently running.
3030 + *
3031 + * @param {string} command
3032 + *
3033 + * @return {boolean} is parameter command the first command in trace that currently running
3034 + */
3035 + }, {
3036 + key: "isCurrentFirstTrace",
3037 + value: function isCurrentFirstTrace(command) {
3038 + return command === this.getCurrentFirstTrace();
3039 + }
1020 3040
1021 -//#endregion
1022 -//#region node_modules/@babel/runtime/helpers/esm/construct.js
1023 - function _construct(t, e, r) {
1024 - if (_isNativeReflectConstruct$32()) return Reflect.construct.apply(null, arguments);
1025 - var o = [null];
1026 - o.push.apply(o, e);
1027 - var p = new (t.bind.apply(t, o))();
1028 - return r && _setPrototypeOf(p, r.prototype), p;
1029 - }
3041 + /**
3042 + * Function getCurrent().
3043 + *
3044 + * Receive currently running components and its commands.
3045 + *
3046 + * @param {string} container
3047 + *
3048 + * @return {{}|boolean|*} currently running components
3049 + */
3050 + }, {
3051 + key: "getCurrent",
3052 + value: function getCurrent() {
3053 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3054 + if (container) {
3055 + if (!this.current[container]) {
3056 + return false;
3057 + }
3058 + return this.current[container];
3059 + }
3060 + return this.current;
3061 + }
1030 3062
1031 -//#endregion
1032 -//#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
1033 - function _wrapNativeSuper(t) {
1034 - var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
1035 - return _wrapNativeSuper = function _wrapNativeSuper(t) {
1036 - if (null === t || !_isNativeFunction(t)) return t;
1037 - if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
1038 - if (void 0 !== r) {
1039 - if (r.has(t)) return r.get(t);
1040 - r.set(t, Wrapper);
1041 - }
1042 - function Wrapper() {
1043 - return _construct(t, arguments, _getPrototypeOf(this).constructor);
1044 - }
1045 - return Wrapper.prototype = Object.create(t.prototype, { constructor: {
1046 - value: Wrapper,
1047 - enumerable: !1,
1048 - writable: !0,
1049 - configurable: !0
1050 - } }), _setPrototypeOf(Wrapper, t);
1051 - }, _wrapNativeSuper(t);
1052 - }
3063 + /**
3064 + * Function getCurrentArgs().
3065 + *
3066 + * Receive currently running command args.
3067 + *
3068 + * @param {string} container
3069 + *
3070 + * @return {{}|boolean|*} current arguments
3071 + */
3072 + }, {
3073 + key: "getCurrentArgs",
3074 + value: function getCurrentArgs() {
3075 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3076 + if (container) {
3077 + if (!this.currentArgs[container]) {
3078 + return false;
3079 + }
3080 + return this.currentArgs[container];
3081 + }
3082 + return this.currentArgs;
3083 + }
1053 3084
1054 -//#endregion
1055 -//#region modules/web-cli/assets/js/utils/force-method-implementation.js
1056 - function _callSuper$31(t, o, e) {
1057 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$31() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1058 - }
1059 - __name(_callSuper$31, "_callSuper");
1060 - function _isNativeReflectConstruct$31() {
1061 - try {
1062 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1063 - } catch (t) {}
1064 - return (_isNativeReflectConstruct$31 = function _isNativeReflectConstruct() {
1065 - return !!t;
1066 - })();
1067 - }
1068 - __name(_isNativeReflectConstruct$31, "_isNativeReflectConstruct");
1069 - var ForceMethodImplementation = /*#__PURE__*/ function(_Error) {
1070 - function ForceMethodImplementation() {
1071 - var _this;
1072 - var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1073 - _classCallCheck(this, ForceMethodImplementation);
1074 - _this = _callSuper$31(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
1075 - Error.captureStackTrace(_this, ForceMethodImplementation);
1076 - return _this;
1077 - }
1078 - _inherits(ForceMethodImplementation, _Error);
1079 - return _createClass(ForceMethodImplementation);
1080 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
1081 - var force_method_implementation_default = /* @__PURE__ */ __name((function() {
1082 - var caller = Error().stack.split("\n")[2].trim();
1083 - var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1];
1084 - var info = {};
1085 - info.functionName = callerName;
1086 - info.fullName = callerName;
1087 - if (info.functionName.includes(".")) {
1088 - var parts = info.functionName.split(".");
1089 - info.className = parts[0];
1090 - info.functionName = parts[1];
1091 - } else info.isStatic = true;
1092 - throw new ForceMethodImplementation(info);
1093 - }), "default");
3085 + /**
3086 + * Function getCurrentFirst().
3087 + *
3088 + * Receive first command that currently running.
3089 + *
3090 + * @return {string} first running command
3091 + */
3092 + }, {
3093 + key: "getCurrentFirst",
3094 + value: function getCurrentFirst() {
3095 + return Object.values(this.current)[0];
3096 + }
1094 3097
1095 -//#endregion
1096 -//#region modules/web-cli/assets/js/modules/component-base.js
1097 - function ownKeys$3(e, r) {
1098 - var t = Object.keys(e);
1099 - if (Object.getOwnPropertySymbols) {
1100 - var o = Object.getOwnPropertySymbols(e);
1101 - r && (o = o.filter(function(r) {
1102 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
1103 - })), t.push.apply(t, o);
1104 - }
1105 - return t;
1106 - }
1107 - __name(ownKeys$3, "ownKeys");
1108 - function _objectSpread$3(e) {
1109 - for (var r = 1; r < arguments.length; r++) {
1110 - var t = null != arguments[r] ? arguments[r] : {};
1111 - r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) {
1112 - _defineProperty(e, r, t[r]);
1113 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) {
1114 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1115 - });
1116 - }
1117 - return e;
1118 - }
1119 - __name(_objectSpread$3, "_objectSpread");
1120 - function _callSuper$30(t, o, e) {
1121 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$30() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1122 - }
1123 - __name(_callSuper$30, "_callSuper");
1124 - function _isNativeReflectConstruct$30() {
1125 - try {
1126 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1127 - } catch (t) {}
1128 - return (_isNativeReflectConstruct$30 = function _isNativeReflectConstruct() {
1129 - return !!t;
1130 - })();
1131 - }
1132 - __name(_isNativeReflectConstruct$30, "_isNativeReflectConstruct");
1133 - /**
1134 - * @typedef {import('./command-infra')} CommandInfra
1135 - * @typedef {import('./hook-base')} HookBase
1136 - * @typedef {import('../core/states/ui-state-base')} UiStateBase
1137 - */
1138 - var ComponentBase = /*#__PURE__*/ function(_Module) {
1139 - function ComponentBase() {
1140 - _classCallCheck(this, ComponentBase);
1141 - return _callSuper$30(this, ComponentBase, arguments);
1142 - }
1143 - _inherits(ComponentBase, _Module);
1144 - return _createClass(ComponentBase, [
1145 - {
1146 - key: "__construct",
1147 - value: function __construct() {
1148 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1149 - if (args.manager) this.manager = args.manager;
1150 - this.commands = this.defaultCommands();
1151 - this.commandsInternal = this.defaultCommandsInternal();
1152 - this.hooks = this.defaultHooks();
1153 - this.routes = this.defaultRoutes();
1154 - this.tabs = this.defaultTabs();
1155 - this.shortcuts = this.defaultShortcuts();
1156 - this.utils = this.defaultUtils();
1157 - this.data = this.defaultData();
1158 - this.uiStates = this.defaultUiStates();
1159 - this.states = this.defaultStates();
1160 - this.defaultRoute = "";
1161 - this.currentTab = "";
1162 - }
1163 - },
1164 - {
1165 - key: "registerAPI",
1166 - value: function registerAPI() {
1167 - var _this = this;
1168 - Object.entries(this.getTabs()).forEach(function(tab) {
1169 - return _this.registerTabRoute(tab[0]);
1170 - });
1171 - Object.entries(this.getRoutes()).forEach(function(_ref) {
1172 - var _ref2 = _slicedToArray(_ref, 2);
1173 - var route = _ref2[0];
1174 - var callback = _ref2[1];
1175 - return _this.registerRoute(route, callback);
1176 - });
1177 - Object.entries(this.getCommands()).forEach(function(_ref3) {
1178 - var _ref4 = _slicedToArray(_ref3, 2);
1179 - var command = _ref4[0];
1180 - var callback = _ref4[1];
1181 - return _this.registerCommand(command, callback);
1182 - });
1183 - Object.entries(this.getCommandsInternal()).forEach(function(_ref5) {
1184 - var _ref6 = _slicedToArray(_ref5, 2);
1185 - var command = _ref6[0];
1186 - var callback = _ref6[1];
1187 - return _this.registerCommandInternal(command, callback);
1188 - });
1189 - Object.values(this.getHooks()).forEach(function(instance) {
1190 - return _this.registerHook(instance);
1191 - });
1192 - Object.entries(this.getData()).forEach(function(_ref7) {
1193 - var _ref8 = _slicedToArray(_ref7, 2);
1194 - var command = _ref8[0];
1195 - var callback = _ref8[1];
1196 - return _this.registerData(command, callback);
1197 - });
1198 - Object.values(this.getUiStates()).forEach(function(instance) {
1199 - return _this.registerUiState(instance);
1200 - });
1201 - Object.entries(this.getStates()).forEach(function(_ref9) {
1202 - var _ref0 = _slicedToArray(_ref9, 2);
1203 - var id = _ref0[0];
1204 - var state = _ref0[1];
1205 - return _this.registerState(id, state);
1206 - });
1207 - }
1208 - },
1209 - {
1210 - key: "getNamespace",
1211 - value: function getNamespace() {
1212 - force_method_implementation_default();
1213 - }
1214 - },
1215 - {
1216 - key: "getRootContainer",
1217 - value: function getRootContainer() {
1218 - Deprecation.deprecated("getRootContainer()", "3.7.0", "getServiceName()");
1219 - return this.getServiceName();
1220 - }
1221 - },
1222 - {
1223 - key: "getServiceName",
1224 - value: function getServiceName() {
1225 - return this.getNamespace().split("/")[0];
1226 - }
1227 - },
1228 - {
1229 - key: "store",
1230 - get: function get() {
1231 - return $e.store.get(this.getNamespace());
1232 - }
1233 - },
1234 - {
1235 - key: "defaultTabs",
1236 - value: function defaultTabs() {
1237 - return {};
1238 - }
1239 - },
1240 - {
1241 - key: "defaultRoutes",
1242 - value: function defaultRoutes() {
1243 - return {};
1244 - }
1245 - },
1246 - {
1247 - key: "defaultCommands",
1248 - value: function defaultCommands() {
1249 - return {};
1250 - }
1251 - },
1252 - {
1253 - key: "defaultCommandsInternal",
1254 - value: function defaultCommandsInternal() {
1255 - return {};
1256 - }
1257 - },
1258 - {
1259 - key: "defaultHooks",
1260 - value: function defaultHooks() {
1261 - return {};
1262 - }
1263 - },
1264 - {
1265 - key: "defaultUiStates",
1266 - value: function defaultUiStates() {
1267 - return {};
1268 - }
1269 - },
1270 - {
1271 - key: "defaultStates",
1272 - value: function defaultStates() {
1273 - return {};
1274 - }
1275 - },
1276 - {
1277 - key: "defaultShortcuts",
1278 - value: function defaultShortcuts() {
1279 - return {};
1280 - }
1281 - },
1282 - {
1283 - key: "defaultUtils",
1284 - value: function defaultUtils() {
1285 - return {};
1286 - }
1287 - },
1288 - {
1289 - key: "defaultData",
1290 - value: function defaultData() {
1291 - return {};
1292 - }
1293 - },
1294 - {
1295 - key: "getCommands",
1296 - value: function getCommands() {
1297 - return this.commands;
1298 - }
1299 - },
1300 - {
1301 - key: "getCommandsInternal",
1302 - value: function getCommandsInternal() {
1303 - return this.commandsInternal;
1304 - }
1305 - },
1306 - {
1307 - key: "getHooks",
1308 - value: function getHooks() {
1309 - return this.hooks;
1310 - }
1311 - },
1312 - {
1313 - key: "getUiStates",
1314 - value: function getUiStates() {
1315 - return this.uiStates;
1316 - }
1317 - },
1318 - {
1319 - key: "getStates",
1320 - value: function getStates() {
1321 - return this.states;
1322 - }
1323 - },
1324 - {
1325 - key: "getRoutes",
1326 - value: function getRoutes() {
1327 - return this.routes;
1328 - }
1329 - },
1330 - {
1331 - key: "getTabs",
1332 - value: function getTabs() {
1333 - return this.tabs;
1334 - }
1335 - },
1336 - {
1337 - key: "getShortcuts",
1338 - value: function getShortcuts() {
1339 - return this.shortcuts;
1340 - }
1341 - },
1342 - {
1343 - key: "getData",
1344 - value: function getData() {
1345 - return this.data;
1346 - }
1347 - },
1348 - {
1349 - key: "registerCommand",
1350 - value: function registerCommand(command, context) {
1351 - var commandsType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
1352 - var commandsManager;
1353 - switch (commandsType) {
1354 - case "default":
1355 - commandsManager = $e.commands;
1356 - break;
1357 - case "internal":
1358 - commandsManager = $e.commandsInternal;
1359 - break;
1360 - case "data":
1361 - commandsManager = $e.data;
1362 - break;
1363 - default: throw new Error("Invalid commands type: '".concat(command, "'"));
1364 - }
1365 - var fullCommand = this.getNamespace() + "/" + command;
1366 - var instanceType = context.getInstanceType ? context.getInstanceType() : false;
1367 - var registerConfig = {
1368 - command: fullCommand,
1369 - component: this
1370 - };
1371 - if (!instanceType) {
1372 - if ($e.devTools) $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
1373 - registerConfig.callback = context;
1374 - context = /*#__PURE__*/ function(_CommandCallbackBase) {
1375 - function context() {
1376 - _classCallCheck(this, context);
1377 - return _callSuper$30(this, context, arguments);
1378 - }
1379 - _inherits(context, _CommandCallbackBase);
1380 - return _createClass(context);
1381 - }(CommandCallbackBase);
1382 - }
1383 - context.setRegisterConfig(registerConfig);
1384 - commandsManager.register(this, command, context);
1385 - }
1386 - },
1387 - {
1388 - key: "registerHook",
1389 - value: function registerHook(instance) {
1390 - return instance.register();
1391 - }
1392 - },
1393 - {
1394 - key: "registerCommandInternal",
1395 - value: function registerCommandInternal(command, context) {
1396 - this.registerCommand(command, context, "internal");
1397 - }
1398 - },
1399 - {
1400 - key: "registerUiState",
1401 - value: function registerUiState(instance) {
1402 - $e.uiStates.register(instance);
1403 - }
1404 - },
1405 - {
1406 - key: "registerState",
1407 - value: function registerState(id, stateConfig) {
1408 - id = this.getNamespace() + (id ? "/".concat(id) : "");
1409 - var slice = (0, _reduxjs_toolkit.createSlice)(_objectSpread$3(_objectSpread$3({}, stateConfig), {}, { name: id }));
1410 - $e.store.register(id, slice);
1411 - }
1412 - },
1413 - {
1414 - key: "registerRoute",
1415 - value: function registerRoute(route, callback) {
1416 - $e.routes.register(this, route, callback);
1417 - }
1418 - },
1419 - {
1420 - key: "registerData",
1421 - value: function registerData(command, context) {
1422 - this.registerCommand(command, context, "data");
1423 - }
1424 - },
1425 - {
1426 - key: "unregisterRoute",
1427 - value: function unregisterRoute(route) {
1428 - $e.routes.unregister(this, route);
1429 - }
1430 - },
1431 - {
1432 - key: "registerTabRoute",
1433 - value: function registerTabRoute(tab) {
1434 - var _this2 = this;
1435 - this.registerRoute(tab, function(args) {
1436 - return _this2.activateTab(tab, args);
1437 - });
1438 - }
1439 - },
1440 - {
1441 - key: "dependency",
1442 - value: function dependency() {
1443 - return true;
1444 - }
1445 - },
1446 - {
1447 - key: "open",
1448 - value: function open() {
1449 - return true;
1450 - }
1451 - },
1452 - {
1453 - key: "close",
1454 - value: function close() {
1455 - if (!this.isOpen) return false;
1456 - this.isOpen = false;
1457 - this.inactivate();
1458 - $e.routes.clearCurrent(this.getNamespace());
1459 - $e.routes.clearHistory(this.getServiceName());
1460 - return true;
1461 - }
1462 - },
1463 - {
1464 - key: "activate",
1465 - value: function activate() {
1466 - $e.components.activate(this.getNamespace());
1467 - }
1468 - },
1469 - {
1470 - key: "inactivate",
1471 - value: function inactivate() {
1472 - $e.components.inactivate(this.getNamespace());
1473 - }
1474 - },
1475 - {
1476 - key: "isActive",
1477 - value: function isActive() {
1478 - return $e.components.isActive(this.getNamespace());
1479 - }
1480 - },
1481 - {
1482 - key: "onRoute",
1483 - value: function onRoute(route) {
1484 - this.toggleRouteClass(route, true);
1485 - this.toggleHistoryClass();
1486 - this.activate();
1487 - this.trigger("route/open", route);
1488 - }
1489 - },
1490 - {
1491 - key: "onCloseRoute",
1492 - value: function onCloseRoute(route) {
1493 - this.toggleRouteClass(route, false);
1494 - this.inactivate();
1495 - this.trigger("route/close", route);
1496 - }
1497 - },
1498 - {
1499 - key: "setDefaultRoute",
1500 - value: function setDefaultRoute(route) {
1501 - this.defaultRoute = this.getNamespace() + "/" + route;
1502 - }
1503 - },
1504 - {
1505 - key: "getDefaultRoute",
1506 - value: function getDefaultRoute() {
1507 - return this.defaultRoute;
1508 - }
1509 - },
1510 - {
1511 - key: "removeTab",
1512 - value: function removeTab(tab) {
1513 - delete this.tabs[tab];
1514 - this.unregisterRoute(tab);
1515 - }
1516 - },
1517 - {
1518 - key: "hasTab",
1519 - value: function hasTab(tab) {
1520 - return !!this.tabs[tab];
1521 - }
1522 - },
1523 - {
1524 - key: "addTab",
1525 - value: function addTab(tab, args, position) {
1526 - var _this3 = this;
1527 - this.tabs[tab] = args;
1528 - if ("undefined" !== typeof position) {
1529 - var newTabs = {};
1530 - var ids = Object.keys(this.tabs);
1531 - ids.pop();
1532 - ids.splice(position, 0, tab);
1533 - ids.forEach(function(id) {
1534 - newTabs[id] = _this3.tabs[id];
1535 - });
1536 - this.tabs = newTabs;
1537 - }
1538 - this.registerTabRoute(tab);
1539 - }
1540 - },
1541 - {
1542 - key: "getTabsWrapperSelector",
1543 - value: function getTabsWrapperSelector() {
1544 - return "";
1545 - }
1546 - },
1547 - {
1548 - key: "getTabRoute",
1549 - value: function getTabRoute(tab) {
1550 - return this.getNamespace() + "/" + tab;
1551 - }
1552 - },
1553 - {
1554 - key: "renderTab",
1555 - value: function renderTab(tab) {}
1556 - },
1557 - {
1558 - key: "activateTab",
1559 - value: function activateTab(tab, args) {
1560 - var _this4 = this;
1561 - this.renderTab(tab, args);
1562 - jQuery(this.getTabsWrapperSelector() + " .elementor-component-tab").off("click").on("click", function(event) {
1563 - $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
1564 - }).removeClass("elementor-active").filter("[data-tab=\"" + tab + "\"]").addClass("elementor-active");
1565 - }
1566 - },
1567 - {
1568 - key: "getActiveTabConfig",
1569 - value: function getActiveTabConfig() {
1570 - return this.tabs[this.currentTab] || {};
1571 - }
1572 - },
1573 - {
1574 - key: "getBodyClass",
1575 - value: function getBodyClass(route) {
1576 - return "e-route-" + route.replace(/\//g, "-");
1577 - }
1578 - },
1579 - {
1580 - key: "normalizeCommandName",
1581 - value: function normalizeCommandName(commandName) {
1582 - return commandName.replace(/[A-Z]/g, function(match, offset) {
1583 - return (offset > 0 ? "-" : "") + match.toLowerCase();
1584 - });
1585 - }
1586 - },
1587 - {
1588 - key: "importCommands",
1589 - value: function importCommands(commandsFromImport) {
1590 - var _this5 = this;
1591 - var commands = {};
1592 - Object.entries(commandsFromImport).forEach(function(_ref1) {
1593 - var _ref10 = _slicedToArray(_ref1, 2);
1594 - var className = _ref10[0];
1595 - var Class = _ref10[1];
1596 - var command = _this5.normalizeCommandName(className);
1597 - commands[command] = Class;
1598 - });
1599 - return commands;
1600 - }
1601 - },
1602 - {
1603 - key: "importHooks",
1604 - value: function importHooks(hooksFromImport) {
1605 - var hooks = {};
1606 - for (var key in hooksFromImport) {
1607 - var hook = new hooksFromImport[key]();
1608 - hooks[hook.getId()] = hook;
1609 - }
1610 - return hooks;
1611 - }
1612 - },
1613 - {
1614 - key: "importUiStates",
1615 - value: function importUiStates(statesFromImport) {
1616 - var _this6 = this;
1617 - var uiStates = {};
1618 - Object.values(statesFromImport).forEach(function(className) {
1619 - var uiState = new className(_this6);
1620 - uiStates[uiState.getId()] = uiState;
1621 - });
1622 - return uiStates;
1623 - }
1624 - },
1625 - {
1626 - key: "setUiState",
1627 - value: function setUiState(state, value) {
1628 - $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
1629 - }
1630 - },
1631 - {
1632 - key: "toggleRouteClass",
1633 - value: function toggleRouteClass(route, state) {
1634 - document.body.classList.toggle(this.getBodyClass(route), state);
1635 - }
1636 - },
1637 - {
1638 - key: "toggleHistoryClass",
1639 - value: function toggleHistoryClass() {
1640 - document.body.classList.toggle("e-routes-has-history", !!$e.routes.getHistory(this.getServiceName()).length);
1641 - }
1642 - }
1643 - ]);
1644 - }(import_module.default);
3098 + /**
3099 + * Function getCurrentLast().
3100 + *
3101 + * Receive last command that currently running.
3102 + *
3103 + * @return {string} last running command
3104 + */
3105 + }, {
3106 + key: "getCurrentLast",
3107 + value: function getCurrentLast() {
3108 + var current = Object.values(this.current);
3109 + return current[current.length - 1];
3110 + }
1645 3111
1646 -//#endregion
1647 -//#region modules/web-cli/assets/js/core/backwards-compatibility.js
1648 - function _callSuper$29(t, o, e) {
1649 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$29() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1650 - }
1651 - __name(_callSuper$29, "_callSuper");
1652 - function _isNativeReflectConstruct$29() {
1653 - try {
1654 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1655 - } catch (t) {}
1656 - return (_isNativeReflectConstruct$29 = function _isNativeReflectConstruct() {
1657 - return !!t;
1658 - })();
1659 - }
1660 - __name(_isNativeReflectConstruct$29, "_isNativeReflectConstruct");
1661 - var BackwardsCompatibility = /*#__PURE__*/ function() {
1662 - function BackwardsCompatibility() {
1663 - _classCallCheck(this, BackwardsCompatibility);
1664 - }
1665 - return _createClass(BackwardsCompatibility, [{
1666 - key: "ensureTab",
1667 - value: function ensureTab(namespace, tabSlug) {
1668 - var page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
1669 - var component = $e.components.get(namespace);
1670 - if (!component) {
1671 - var Component = /*#__PURE__*/ function(_ComponentBase) {
1672 - function Component() {
1673 - _classCallCheck(this, Component);
1674 - return _callSuper$29(this, Component, arguments);
1675 - }
1676 - _inherits(Component, _ComponentBase);
1677 - return _createClass(Component, [{
1678 - key: "getNamespace",
1679 - value: function getNamespace() {
1680 - return namespace;
1681 - }
1682 - }, {
1683 - key: "renderTab",
1684 - value: function renderTab(tab) {
1685 - elementor.getPanelView().setPage(page).activateTab(tab);
1686 - }
1687 - }]);
1688 - }(ComponentBase);
1689 - component = $e.components.register(new Component());
1690 - }
1691 - if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) component.addTab(tabSlug, { title: elementor.config.tabs[tabSlug] });
1692 - }
1693 - }]);
1694 - }();
3112 + /**
3113 + * Function getCurrentFirstTrace().
3114 + *
3115 + * Receive first command in trace that currently running
3116 + *
3117 + * @return {string} first command in trace
3118 + */
3119 + }, {
3120 + key: "getCurrentFirstTrace",
3121 + value: function getCurrentFirstTrace() {
3122 + return this.currentTrace[0];
3123 + }
1695 3124
1696 -//#endregion
1697 -//#region modules/web-cli/assets/js/modules/command-internal-base.js
1698 - function _callSuper$28(t, o, e) {
1699 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$28() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1700 - }
1701 - __name(_callSuper$28, "_callSuper");
1702 - function _isNativeReflectConstruct$28() {
1703 - try {
1704 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1705 - } catch (t) {}
1706 - return (_isNativeReflectConstruct$28 = function _isNativeReflectConstruct() {
1707 - return !!t;
1708 - })();
1709 - }
1710 - __name(_isNativeReflectConstruct$28, "_isNativeReflectConstruct");
1711 - /**
1712 - * @name $e.modules.CommandInternalBase
1713 - */
1714 - var CommandInternalBase = /*#__PURE__*/ function(_CommandBase) {
1715 - function CommandInternalBase(args) {
1716 - var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.commandsInternal;
1717 - _classCallCheck(this, CommandInternalBase);
1718 - return _callSuper$28(this, CommandInternalBase, [args, commandsAPI]);
1719 - }
1720 - _inherits(CommandInternalBase, _CommandBase);
1721 - return _createClass(CommandInternalBase, null, [{
1722 - key: "getInstanceType",
1723 - value: function getInstanceType() {
1724 - return "CommandInternalBase";
1725 - }
1726 - }]);
1727 - }(CommandBase);
3125 + /**
3126 + * Function beforeRun().
3127 + *
3128 + * Responsible to add current command to trace and trigger 'run:before' event.
3129 + * Run before command.
3130 + *
3131 + * @param {string} command
3132 + * @param {{}} args
3133 + * @param {boolean} [addTrace=true]
3134 + */
3135 + }, {
3136 + key: "beforeRun",
3137 + value: function beforeRun(command) {
3138 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3139 + var addTrace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
3140 + var component = this.getComponent(command),
3141 + container = component.getServiceName();
3142 + if (addTrace) {
3143 + this.addCurrentTrace(container, command, args);
3144 + }
3145 + if (args.onBefore) {
3146 + args.onBefore.apply(component, [args]);
3147 + }
3148 + this.trigger('run:before', component, command, args);
3149 + window.dispatchEvent(new CustomEvent('elementor/commands/run/before', {
3150 + detail: {
3151 + command: command,
3152 + args: args
3153 + }
3154 + }));
3155 + }
1728 3156
1729 -//#endregion
1730 -//#region modules/web-cli/assets/js/core/data/errors/base-error.js
1731 - function ownKeys$2(e, r) {
1732 - var t = Object.keys(e);
1733 - if (Object.getOwnPropertySymbols) {
1734 - var o = Object.getOwnPropertySymbols(e);
1735 - r && (o = o.filter(function(r) {
1736 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
1737 - })), t.push.apply(t, o);
1738 - }
1739 - return t;
1740 - }
1741 - __name(ownKeys$2, "ownKeys");
1742 - function _objectSpread$2(e) {
1743 - for (var r = 1; r < arguments.length; r++) {
1744 - var t = null != arguments[r] ? arguments[r] : {};
1745 - r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) {
1746 - _defineProperty(e, r, t[r]);
1747 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) {
1748 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1749 - });
1750 - }
1751 - return e;
1752 - }
1753 - __name(_objectSpread$2, "_objectSpread");
1754 - function _callSuper$27(t, o, e) {
1755 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$27() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1756 - }
1757 - __name(_callSuper$27, "_callSuper");
1758 - function _isNativeReflectConstruct$27() {
1759 - try {
1760 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1761 - } catch (t) {}
1762 - return (_isNativeReflectConstruct$27 = function _isNativeReflectConstruct() {
1763 - return !!t;
1764 - })();
1765 - }
1766 - __name(_isNativeReflectConstruct$27, "_isNativeReflectConstruct");
1767 - var BaseError = /*#__PURE__*/ function(_Error) {
1768 - /**
1769 - * Error constructor.
1770 - *
1771 - * @param {string} message
1772 - * @param {string} code
1773 - * @param {*} data
1774 - */
1775 - function BaseError() {
1776 - var _this;
1777 - var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1778 - var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1779 - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1780 - _classCallCheck(this, BaseError);
1781 - _this = _callSuper$27(this, BaseError, [message]);
1782 - /**
1783 - * The server error code.
1784 - *
1785 - * @type {string}
1786 - */
1787 - _defineProperty(_this, "code", "");
1788 - /**
1789 - * Additional data about the current error.
1790 - *
1791 - * @type {*[]}
1792 - */
1793 - _defineProperty(_this, "data", []);
1794 - _this.code = code;
1795 - _this.data = data;
1796 - return _this;
1797 - }
1798 - /**
1799 - * Notify a message when the error occurs.
1800 - */
1801 - _inherits(BaseError, _Error);
1802 - return _createClass(BaseError, [{
1803 - key: "notify",
1804 - value: function notify() {
1805 - Console.error(_objectSpread$2({ message: this.message }, this));
1806 - }
1807 - }], [{
1808 - key: "create",
1809 - value: function create(message) {
1810 - var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1811 - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1812 - return new this(message, code, data);
1813 - }
1814 - }, {
1815 - key: "getHTTPErrorCode",
1816 - value: function getHTTPErrorCode() {
1817 - force_method_implementation_default();
1818 - }
1819 - }]);
1820 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
3157 + /**
3158 + * Function validateRun().
3159 + *
3160 + * Responsible to validate if the run is even possible.
3161 + * Runs immediately after entering `run()`.
3162 + *
3163 + * @param {string} command
3164 + * @param {*} args
3165 + *
3166 + * @return {boolean} dependency result
3167 + */
3168 + }, {
3169 + key: "validateRun",
3170 + value: function validateRun(command) {
3171 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3172 + if (!this.commands[command]) {
3173 + this.error("`".concat(command, "` not found."));
3174 + }
3175 + return this.getComponent(command).dependency(command, args);
3176 + }
1821 3177
1822 -//#endregion
1823 -//#region modules/web-cli/assets/js/core/data/errors/default-error.js
1824 - function _callSuper$26(t, o, e) {
1825 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$26() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1826 - }
1827 - __name(_callSuper$26, "_callSuper");
1828 - function _isNativeReflectConstruct$26() {
1829 - try {
1830 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1831 - } catch (t) {}
1832 - return (_isNativeReflectConstruct$26 = function _isNativeReflectConstruct() {
1833 - return !!t;
1834 - })();
1835 - }
1836 - __name(_isNativeReflectConstruct$26, "_isNativeReflectConstruct");
1837 - var DefaultError = /*#__PURE__*/ function(_BaseError) {
1838 - function DefaultError() {
1839 - _classCallCheck(this, DefaultError);
1840 - return _callSuper$26(this, DefaultError, arguments);
1841 - }
1842 - _inherits(DefaultError, _BaseError);
1843 - return _createClass(DefaultError, null, [{
1844 - key: "getHTTPErrorCode",
1845 - value: function getHTTPErrorCode() {
1846 - return 501;
1847 - }
1848 - }]);
1849 - }(BaseError);
3178 + /**
3179 + * Function run().
3180 + *
3181 + * Runs a command.
3182 + *
3183 + * @param {string} command
3184 + * @param {{}} args
3185 + *
3186 + * @return {boolean|*} results
3187 + */
3188 + }, {
3189 + key: "run",
3190 + value: function run(command) {
3191 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3192 + if (!this.validateRun(command, args)) {
3193 + return false;
3194 + }
3195 + this.beforeRun(command, args);
1850 3196
1851 -//#endregion
1852 -//#region modules/web-cli/assets/js/core/data/errors/error-404.js
1853 - function _callSuper$25(t, o, e) {
1854 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$25() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1855 - }
1856 - __name(_callSuper$25, "_callSuper");
1857 - function _isNativeReflectConstruct$25() {
1858 - try {
1859 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1860 - } catch (t) {}
1861 - return (_isNativeReflectConstruct$25 = function _isNativeReflectConstruct() {
1862 - return !!t;
1863 - })();
1864 - }
1865 - __name(_isNativeReflectConstruct$25, "_isNativeReflectConstruct");
1866 - var Error404 = /*#__PURE__*/ function(_BaseError) {
1867 - function Error404() {
1868 - _classCallCheck(this, Error404);
1869 - return _callSuper$25(this, Error404, arguments);
1870 - }
1871 - _inherits(Error404, _BaseError);
1872 - return _createClass(Error404, [{
1873 - key: "notify",
1874 - value: function notify() {
1875 - Console.warn(this.message);
1876 - }
1877 - }], [{
1878 - key: "getHTTPErrorCode",
1879 - value: function getHTTPErrorCode() {
1880 - return 404;
1881 - }
1882 - }]);
1883 - }(BaseError);
3197 + // Get command class or callback.
3198 + var context = this.commands[command];
1884 3199
1885 -//#endregion
1886 -//#region modules/web-cli/assets/js/core/data/errors/index.js
1887 - var errors_exports = /* @__PURE__ */ __exportAll({
1888 - DefaultError: () => DefaultError,
1889 - Error404: () => Error404
1890 - });
3200 + // Is it command-base based class?
3201 + if (context.getInstanceType) {
3202 + context = new context(args);
3203 + }
3204 + var currentComponent = this.getComponent(command);
1891 3205
1892 -//#endregion
1893 -//#region modules/web-cli/assets/js/modules/command-data.js
1894 - function _callSuper$24(t, o, e) {
1895 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$24() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1896 - }
1897 - __name(_callSuper$24, "_callSuper");
1898 - function _isNativeReflectConstruct$24() {
1899 - try {
1900 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1901 - } catch (t) {}
1902 - return (_isNativeReflectConstruct$24 = function _isNativeReflectConstruct() {
1903 - return !!t;
1904 - })();
1905 - }
1906 - __name(_isNativeReflectConstruct$24, "_isNativeReflectConstruct");
1907 - /**
1908 - * @name $e.modules.CommandData
1909 - */
1910 - /**
1911 - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
1912 - */
1913 - /**
1914 - * @typedef {{}} RequestData
1915 - */
1916 - /**
1917 - * @typedef {import('../core/data/errors/base-error')} BaseError
1918 - */
1919 - var CommandData = /*#__PURE__*/ function(_CommandBase) {
1920 - function CommandData(args) {
1921 - var _this$args$options;
1922 - var _this;
1923 - var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.data;
1924 - _classCallCheck(this, CommandData);
1925 - _this = _callSuper$24(this, CommandData, [args, commandsAPI]);
1926 - /**
1927 - * Data returned from remote.
1928 - *
1929 - * @type {*}
1930 - */
1931 - _defineProperty(_this, "data", void 0);
1932 - /**
1933 - * Fetch type.
1934 - *
1935 - * @type {DataTypes}
1936 - */
1937 - _defineProperty(_this, "type", void 0);
1938 - if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) _this.type = _this.args.options.type;
1939 - return _this;
1940 - }
1941 - /**
1942 - * Function getEndpointFormat().
1943 - *
1944 - * @return {null|string} endpoint format
1945 - */
1946 - _inherits(CommandData, _CommandBase);
1947 - return _createClass(CommandData, [
1948 - {
1949 - key: "getApplyMethods",
1950 - value: function getApplyMethods() {
1951 - var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.type;
1952 - var before;
1953 - var after;
1954 - switch (type) {
1955 - case "create":
1956 - before = this.applyBeforeCreate;
1957 - after = this.applyAfterCreate;
1958 - break;
1959 - case "delete":
1960 - before = this.applyBeforeDelete;
1961 - after = this.applyAfterDelete;
1962 - break;
1963 - case "get":
1964 - before = this.applyBeforeGet;
1965 - after = this.applyAfterGet;
1966 - break;
1967 - case "update":
1968 - before = this.applyBeforeUpdate;
1969 - after = this.applyAfterUpdate;
1970 - break;
1971 - case "options":
1972 - before = this.applyBeforeOptions;
1973 - after = this.applyAfterOptions;
1974 - break;
1975 - default: return false;
1976 - }
1977 - return {
1978 - before: before.bind(this),
1979 - after: after.bind(this)
1980 - };
1981 - }
1982 - },
1983 - {
1984 - key: "getRequestData",
1985 - value: function getRequestData() {
1986 - return {
1987 - type: this.type,
1988 - args: this.args,
1989 - timestamp: (/* @__PURE__ */ new Date()).getTime(),
1990 - component: this.component,
1991 - command: this.command,
1992 - endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
1993 - };
1994 - }
1995 - },
1996 - {
1997 - key: "apply",
1998 - value: function apply() {
1999 - var _this2 = this;
2000 - var applyMethods = this.getApplyMethods();
2001 - this.args = applyMethods.before(this.args);
2002 - var requestData = this.getRequestData();
2003 - return $e.data.fetch(requestData).then(function(data) {
2004 - _this2.data = data;
2005 - _this2.data = applyMethods.after(data, _this2.args);
2006 - _this2.data = { data: _this2.data };
2007 - _this2.data = Object.assign({ __requestData__: requestData }, _this2.data);
2008 - return _this2.data;
2009 - });
2010 - }
2011 - },
2012 - {
2013 - key: "applyBeforeCreate",
2014 - value: function applyBeforeCreate() {
2015 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2016 - }
2017 - },
2018 - {
2019 - key: "applyAfterCreate",
2020 - value: function applyAfterCreate(data) {
2021 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2022 - return data;
2023 - }
2024 - },
2025 - {
2026 - key: "applyBeforeDelete",
2027 - value: function applyBeforeDelete() {
2028 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2029 - }
2030 - },
2031 - {
2032 - key: "applyAfterDelete",
2033 - value: function applyAfterDelete(data) {
2034 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2035 - return data;
2036 - }
2037 - },
2038 - {
2039 - key: "applyBeforeGet",
2040 - value: function applyBeforeGet() {
2041 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2042 - }
2043 - },
2044 - {
2045 - key: "applyAfterGet",
2046 - value: function applyAfterGet(data) {
2047 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2048 - return data;
2049 - }
2050 - },
2051 - {
2052 - key: "applyBeforeUpdate",
2053 - value: function applyBeforeUpdate() {
2054 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2055 - }
2056 - },
2057 - {
2058 - key: "applyAfterUpdate",
2059 - value: function applyAfterUpdate(data) {
2060 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2061 - return data;
2062 - }
2063 - },
2064 - {
2065 - key: "applyBeforeOptions",
2066 - value: function applyBeforeOptions() {
2067 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2068 - }
2069 - },
2070 - {
2071 - key: "applyAfterOptions",
2072 - value: function applyAfterOptions(data) {
2073 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2074 - return data;
2075 - }
2076 - },
2077 - {
2078 - key: "applyAfterCatch",
2079 - value: function applyAfterCatch(e) {
2080 - e.notify();
2081 - }
2082 - },
2083 - {
2084 - key: "onCatchApply",
2085 - value: function onCatchApply(e) {
2086 - var _e;
2087 - var httpErrorCode = ((_e = e) === null || _e === void 0 || (_e = _e.data) === null || _e === void 0 ? void 0 : _e.status) || 501;
2088 - var dataError = Object.values(errors_exports).find(function(error) {
2089 - return error.getHTTPErrorCode() === httpErrorCode;
2090 - });
2091 - if (!dataError) dataError = DefaultError;
2092 - e = dataError.create(e.message, e.code, e.data || []);
2093 - this.runCatchHooks(e);
2094 - this.applyAfterCatch(e);
2095 - }
2096 - }
2097 - ], [{
2098 - key: "getInstanceType",
2099 - value: function getInstanceType() {
2100 - return "CommandData";
2101 - }
2102 - }, {
2103 - key: "getEndpointFormat",
2104 - value: function getEndpointFormat() {
2105 - return null;
2106 - }
2107 - }]);
2108 - }(CommandBase);
3206 + // Is simple callback? (e.g. a route)
3207 + if (!(context instanceof _commandBase.default)) {
3208 + var results = context.apply(currentComponent, [args]);
3209 + this.afterRun(command, args, results);
3210 + return results;
3211 + }
3212 + if (!this.validateInstanceScope(context, currentComponent, command)) {
3213 + return this.removeCurrentTrace(currentComponent);
3214 + }
3215 + return this.runInstance(context);
3216 + }
2109 3217
2110 -//#endregion
2111 -//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
2112 - function asyncGeneratorStep(n, t, e, r, o, a, c) {
2113 - try {
2114 - var i = n[a](c);
2115 - var u = i.value;
2116 - } catch (n) {
2117 - e(n);
2118 - return;
2119 - }
2120 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2121 - }
2122 - function _asyncToGenerator(n) {
2123 - return function() {
2124 - var t = this;
2125 - var e = arguments;
2126 - return new Promise(function(r, o) {
2127 - var a = n.apply(t, e);
2128 - function _next(n) {
2129 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2130 - }
2131 - function _throw(n) {
2132 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2133 - }
2134 - _next(void 0);
2135 - });
2136 - };
2137 - }
3218 + /**
3219 + * Function runInstance().
3220 + *
3221 + * @param {CommandBase} instance
3222 + *
3223 + * @return {boolean|Promise<*>}
3224 + */
3225 + }, {
3226 + key: "runInstance",
3227 + value: function runInstance(instance) {
3228 + var results = null;
2138 3229
2139 -//#endregion
2140 -//#region node_modules/@babel/runtime/helpers/OverloadYield.js
2141 - var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2142 - function _OverloadYield(e, d) {
2143 - this.v = e, this.k = d;
2144 - }
2145 - module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
2146 - }));
3230 + // For UI Hooks.
3231 + instance.onBeforeRun(instance.args);
3232 + try {
3233 + // For data hooks.
3234 + instance.onBeforeApply(instance.args);
3235 + results = instance.run();
3236 + } catch (e) {
3237 + this.catchApply(e, instance);
3238 + if (e instanceof $e.modules.HookBreak) {
3239 + this.removeCurrentTrace(instance.component);
3240 + return false;
3241 + }
3242 + }
3243 + return this.applyRunAfter(instance, results);
3244 + }
2147 3245
2148 -//#endregion
2149 -//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js
2150 - var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2151 - function _regeneratorDefine(e, r, n, t) {
2152 - var i = Object.defineProperty;
2153 - try {
2154 - i({}, "", {});
2155 - } catch (e) {
2156 - i = 0;
2157 - }
2158 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2159 - function o(r, n) {
2160 - _regeneratorDefine(e, r, function(e) {
2161 - return this._invoke(r, n, e);
2162 - });
2163 - }
2164 - r ? i ? i(e, r, {
2165 - value: n,
2166 - enumerable: !t,
2167 - configurable: !t,
2168 - writable: !t
2169 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2170 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2171 - }
2172 - module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2173 - }));
3246 + /**
3247 + * Function applyRunAfter().
3248 + *
3249 + * Responsible for applying everything that need to be run after each command runs.
3250 + * Called on run() after runInstance(), to manipulate results & apply 'after' hooks.
3251 + *
3252 + * @param {CommandBase} instance
3253 + * @param {*} result
3254 + *
3255 + * @return {Promise<*>|*}
3256 + */
3257 + }, {
3258 + key: "applyRunAfter",
3259 + value: function applyRunAfter(instance, result) {
3260 + var _this3 = this;
3261 + // TODO: Temp code determine if it's a jQuery deferred object.
3262 + if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) {
3263 + var handleJQueryDeferred = function handleJQueryDeferred(_result) {
3264 + _result.fail(function (e) {
3265 + _this3.catchApply(e, instance);
3266 + _this3.afterRun(instance.command, instance.args, e);
3267 + });
3268 + _result.done(function (__result) {
3269 + _this3.applyRunAfterSync(instance, __result);
3270 + });
3271 + return _result;
3272 + };
3273 + return handleJQueryDeferred(result);
3274 + } else if (result instanceof Promise) {
3275 + return this.applyRunAfterAsync(instance, result);
3276 + }
3277 + this.applyRunAfterSync(instance, result);
3278 + return result;
3279 + }
2174 3280
2175 -//#endregion
2176 -//#region node_modules/@babel/runtime/helpers/regenerator.js
2177 - var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2178 - var regeneratorDefine = require_regeneratorDefine();
2179 - function _regenerator() {
2180 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2181 - var e;
2182 - var t;
2183 - var r = "function" == typeof Symbol ? Symbol : {};
2184 - var n = r.iterator || "@@iterator";
2185 - var o = r.toStringTag || "@@toStringTag";
2186 - function i(r, n, o, i) {
2187 - var c = n && n.prototype instanceof Generator ? n : Generator;
2188 - var u = Object.create(c.prototype);
2189 - return regeneratorDefine(u, "_invoke", function(r, n, o) {
2190 - var i;
2191 - var c;
2192 - var u;
2193 - var f = 0;
2194 - var p = o || [];
2195 - var y = !1;
2196 - var G = {
2197 - p: 0,
2198 - n: 0,
2199 - v: e,
2200 - a: d,
2201 - f: d.bind(e, 4),
2202 - d: function d(t, r) {
2203 - return i = t, c = 0, u = e, G.n = r, a;
2204 - }
2205 - };
2206 - function d(r, n) {
2207 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2208 - var o;
2209 - var i = p[t];
2210 - var d = G.p;
2211 - var l = i[2];
2212 - 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));
2213 - }
2214 - if (o || r > 1) return a;
2215 - throw y = !0, n;
2216 - }
2217 - return function(o, p, l) {
2218 - if (f > 1) throw TypeError("Generator is already running");
2219 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2220 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2221 - try {
2222 - if (f = 2, i) {
2223 - if (c || (o = "next"), t = i[o]) {
2224 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2225 - if (!t.done) return t;
2226 - u = t.value, c < 2 && (c = 0);
2227 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2228 - i = e;
2229 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2230 - } catch (t) {
2231 - i = e, c = 1, u = t;
2232 - } finally {
2233 - f = 1;
2234 - }
2235 - }
2236 - return {
2237 - value: t,
2238 - done: y
2239 - };
2240 - };
2241 - }(r, o, i), !0), u;
2242 - }
2243 - var a = {};
2244 - function Generator() {}
2245 - function GeneratorFunction() {}
2246 - function GeneratorFunctionPrototype() {}
2247 - t = Object.getPrototypeOf;
2248 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() {
2249 - return this;
2250 - }), t);
2251 - var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2252 - function f(e) {
2253 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2254 - }
2255 - 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() {
2256 - return this;
2257 - }), regeneratorDefine(u, "toString", function() {
2258 - return "[object Generator]";
2259 - }), (module.exports = _regenerator = function _regenerator() {
2260 - return {
2261 - w: i,
2262 - m: f
2263 - };
2264 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2265 - }
2266 - module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2267 - }));
3281 + /**
3282 + * Function applyRunAfterSync().
3283 + *
3284 + * Responsible to handle simple(synchronous) 'run after' behavior.
3285 + * Called on applyRunAfterSync() after runInstance(), to handle results.
3286 + *
3287 + * @param {CommandBase} instance
3288 + * @param {*} result
3289 + */
3290 + }, {
3291 + key: "applyRunAfterSync",
3292 + value: function applyRunAfterSync(instance, result) {
3293 + // Run Data hooks.
3294 + instance.onAfterApply(instance.args, result);
2268 3295
2269 -//#endregion
2270 -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js
2271 - var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2272 - var OverloadYield = require_OverloadYield();
2273 - var regeneratorDefine = require_regeneratorDefine();
2274 - function AsyncIterator(t, e) {
2275 - function n(r, o, i, f) {
2276 - try {
2277 - var c = t[r](o);
2278 - var u = c.value;
2279 - return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) {
2280 - n("next", t, i, f);
2281 - }, function(t) {
2282 - n("throw", t, i, f);
2283 - }) : e.resolve(u).then(function(t) {
2284 - c.value = t, i(c);
2285 - }, function(t) {
2286 - return n("throw", t, i, f);
2287 - });
2288 - } catch (t) {
2289 - f(t);
2290 - }
2291 - }
2292 - var r;
2293 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {
2294 - return this;
2295 - })), regeneratorDefine(this, "_invoke", function(t, o, i) {
2296 - function f() {
2297 - return new e(function(e, r) {
2298 - n(t, i, e, r);
2299 - });
2300 - }
2301 - return r = r ? r.then(f, f) : f();
2302 - }, !0);
2303 - }
2304 - module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2305 - }));
3296 + // For UI hooks.
3297 + instance.onAfterRun(instance.args, result);
3298 + this.afterRun(instance.command, instance.args, result);
3299 + }
2306 3300
2307 -//#endregion
2308 -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js
2309 - var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2310 - var regenerator = require_regenerator$1();
2311 - var regeneratorAsyncIterator = require_regeneratorAsyncIterator();
2312 - function _regeneratorAsyncGen(r, e, t, o, n) {
2313 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2314 - }
2315 - module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2316 - }));
3301 + /**
3302 + * Function applyRunAfterAsync().
3303 + *
3304 + * Await for promise result.
3305 + * Called on applyRunAfter() after runInstance().
3306 + *
3307 + * @param {CommandBase} instance
3308 + * @param {*} result
3309 + */
3310 + }, {
3311 + key: "applyRunAfterAsync",
3312 + value: function applyRunAfterAsync(instance, result) {
3313 + var _this4 = this;
3314 + // Override initial result ( promise ) to await onAfter promises, first!.
3315 + return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
3316 + return _regenerator.default.wrap(function _callee$(_context) {
3317 + while (1) switch (_context.prev = _context.next) {
3318 + case 0:
3319 + _context.next = 2;
3320 + return result.catch(function (e) {
3321 + _this4.catchApply(e, instance);
3322 + _this4.afterRun(instance.command, instance.args, e);
3323 + });
3324 + case 2:
3325 + _context.next = 4;
3326 + return result.then(function (_result) {
3327 + return _this4.applyRunAfterAsyncResult(instance, _result);
3328 + });
3329 + case 4:
3330 + return _context.abrupt("return", result);
3331 + case 5:
3332 + case "end":
3333 + return _context.stop();
3334 + }
3335 + }, _callee);
3336 + }))();
3337 + }
2317 3338
2318 -//#endregion
2319 -//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js
2320 - var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2321 - var regeneratorAsyncGen = require_regeneratorAsyncGen();
2322 - function _regeneratorAsync(n, e, r, t, o) {
2323 - var a = regeneratorAsyncGen(n, e, r, t, o);
2324 - return a.next().then(function(n) {
2325 - return n.done ? n.value : a.next();
2326 - });
2327 - }
2328 - module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2329 - }));
3339 + /**
3340 + * Function applyRunAfterAsyncResult().
3341 + *
3342 + * Responsible to await all promises results.
3343 + * Called on applyRunAfterAsync() after runInstance(), to handle async results.
3344 + * Awaits all the promises, before releasing the command.
3345 + *
3346 + * @param {CommandBase} instance
3347 + * @param {*} result
3348 + */
3349 + }, {
3350 + key: "applyRunAfterAsyncResult",
3351 + value: function () {
3352 + var _applyRunAfterAsyncResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(instance, result) {
3353 + var results, promises;
3354 + return _regenerator.default.wrap(function _callee2$(_context2) {
3355 + while (1) switch (_context2.prev = _context2.next) {
3356 + case 0:
3357 + // Run Data hooks.
3358 + results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) {
3359 + return filtered instanceof Promise;
3360 + }) : [];
3361 + if (!promises.length) {
3362 + _context2.next = 4;
3363 + break;
3364 + }
3365 + _context2.next = 4;
3366 + return Promise.all(promises);
3367 + case 4:
3368 + // For UI hooks.
3369 + instance.onAfterRun(instance.args, result);
3370 + this.afterRun(instance.command, instance.args, result);
3371 + case 6:
3372 + case "end":
3373 + return _context2.stop();
3374 + }
3375 + }, _callee2, this);
3376 + }));
3377 + function applyRunAfterAsyncResult(_x, _x2) {
3378 + return _applyRunAfterAsyncResult.apply(this, arguments);
3379 + }
3380 + return applyRunAfterAsyncResult;
3381 + }()
3382 + /**
3383 + * Function afterRun().
3384 + *
3385 + * Responsible to to clear command from trace, and run 'run:after' event.
3386 + * Method fired after the command runs.
3387 + *
3388 + * @param {string} command
3389 + * @param {{}} args
3390 + * @param {*} results
3391 + * @param {boolean} [removeTrace=true]
3392 + */
3393 + }, {
3394 + key: "afterRun",
3395 + value: function afterRun(command, args) {
3396 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
3397 + var removeTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3398 + var component = this.getComponent(command);
3399 + if (args.onAfter) {
3400 + args.onAfter.apply(component, [args, results]);
3401 + }
3402 + this.trigger('run:after', component, command, args, results);
3403 + window.dispatchEvent(new CustomEvent('elementor/commands/run/after', {
3404 + detail: {
3405 + command: command,
3406 + args: args
3407 + }
3408 + }));
3409 + if (removeTrace) {
3410 + this.removeCurrentTrace(component);
3411 + }
3412 + }
2330 3413
2331 -//#endregion
2332 -//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js
2333 - var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2334 - function _regeneratorKeys(e) {
2335 - var n = Object(e);
2336 - var r = [];
2337 - for (var t in n) r.unshift(t);
2338 - return function e() {
2339 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2340 - return e.done = !0, e;
2341 - };
2342 - }
2343 - module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2344 - }));
3414 + /**
3415 + * @param {Error} e
3416 + * @param {CommandBase} instance
3417 + */
3418 + }, {
3419 + key: "catchApply",
3420 + value: function catchApply(e, instance) {
3421 + instance.onCatchApply(e);
3422 + _console.default.error(e);
3423 + }
2345 3424
2346 -//#endregion
2347 -//#region node_modules/@babel/runtime/helpers/typeof.js
2348 - var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2349 - function _typeof(o) {
2350 - "@babel/helpers - typeof";
2351 - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
2352 - return typeof o;
2353 - } : function(o) {
2354 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
2355 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
2356 - }
2357 - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2358 - }));
3425 + /**
3426 + * Function runShortcut().
3427 + *
3428 + * Run shortcut.
3429 + *
3430 + * It's separated in order to allow override.
3431 + *
3432 + * @param {string} command
3433 + * @param {*} event
3434 + *
3435 + * @return {boolean|*} result
3436 + */
3437 + }, {
3438 + key: "runShortcut",
3439 + value: function runShortcut(command, event) {
3440 + return this.run(command, event);
3441 + }
3442 + }, {
3443 + key: "validateInstanceScope",
3444 + value: function validateInstanceScope(instance, currentComponent, command) {
3445 + if (!(instance instanceof _commandBase.default)) {
3446 + this.error("invalid instance, command: '".concat(command, "' "));
3447 + }
2359 3448
2360 -//#endregion
2361 -//#region node_modules/@babel/runtime/helpers/regeneratorValues.js
2362 - var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2363 - var _typeof = require_typeof()["default"];
2364 - function _regeneratorValues(e) {
2365 - if (null != e) {
2366 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"];
2367 - var r = 0;
2368 - if (t) return t.call(e);
2369 - if ("function" == typeof e.next) return e;
2370 - if (!isNaN(e.length)) return { next: function next() {
2371 - return e && r >= e.length && (e = void 0), {
2372 - value: e && e[r++],
2373 - done: !e
2374 - };
2375 - } };
2376 - }
2377 - throw new TypeError(_typeof(e) + " is not iterable");
2378 - }
2379 - module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2380 - }));
3449 + // In case of different scope.
3450 + if (currentComponent !== instance.component) {
3451 + if ($e.devTools) {
3452 + $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
3453 + }
3454 + return false;
3455 + }
3456 + return true;
3457 + }
3458 + }, {
3459 + key: "addCurrentTrace",
3460 + value: function addCurrentTrace(container, command, args) {
3461 + this.currentTrace.push(command);
3462 + Commands.trace.push(command);
3463 + this.attachCurrent(container, command, args);
3464 + }
3465 + }, {
3466 + key: "removeCurrentTrace",
3467 + value: function removeCurrentTrace(currentComponent) {
3468 + var container = currentComponent.getServiceName();
3469 + this.currentTrace.pop();
3470 + Commands.trace.pop();
3471 + this.detachCurrent(container);
3472 + }
3473 + }, {
3474 + key: "attachCurrent",
3475 + value: function attachCurrent(container, command, args) {
3476 + this.current[container] = command;
3477 + this.currentArgs[container] = args;
3478 + }
3479 + }, {
3480 + key: "detachCurrent",
3481 + value: function detachCurrent(container) {
3482 + delete this.current[container];
3483 + delete this.currentArgs[container];
3484 + }
2381 3485
2382 -//#endregion
2383 -//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js
2384 - var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2385 - var OverloadYield = require_OverloadYield();
2386 - var regenerator = require_regenerator$1();
2387 - var regeneratorAsync = require_regeneratorAsync();
2388 - var regeneratorAsyncGen = require_regeneratorAsyncGen();
2389 - var regeneratorAsyncIterator = require_regeneratorAsyncIterator();
2390 - var regeneratorKeys = require_regeneratorKeys();
2391 - var regeneratorValues = require_regeneratorValues();
2392 - function _regeneratorRuntime() {
2393 - "use strict";
2394 - var r = regenerator();
2395 - var e = r.m(_regeneratorRuntime);
2396 - var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2397 - function n(r) {
2398 - var e = "function" == typeof r && r.constructor;
2399 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2400 - }
2401 - var o = {
2402 - "throw": 1,
2403 - "return": 2,
2404 - "break": 3,
2405 - "continue": 3
2406 - };
2407 - function a(r) {
2408 - var e;
2409 - var t;
2410 - return function(n) {
2411 - e || (e = {
2412 - stop: function stop() {
2413 - return t(n.a, 2);
2414 - },
2415 - "catch": function _catch() {
2416 - return n.v;
2417 - },
2418 - abrupt: function abrupt(r, e) {
2419 - return t(n.a, o[r], e);
2420 - },
2421 - delegateYield: function delegateYield(r, o, a) {
2422 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2423 - },
2424 - finish: function finish(r) {
2425 - return t(n.f, r);
2426 - }
2427 - }, t = function t(r, _t, o) {
2428 - n.p = e.prev, n.n = e.next;
2429 - try {
2430 - return r(_t, o);
2431 - } finally {
2432 - e.next = n.n;
2433 - }
2434 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2435 - try {
2436 - return r.call(this, e);
2437 - } finally {
2438 - n.p = e.prev, n.n = e.next;
2439 - }
2440 - };
2441 - }
2442 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2443 - return {
2444 - wrap: function wrap(e, t, n, o) {
2445 - return r.w(a(e), t, n, o && o.reverse());
2446 - },
2447 - isGeneratorFunction: n,
2448 - mark: r.m,
2449 - awrap: function awrap(r, e) {
2450 - return new OverloadYield(r, e);
2451 - },
2452 - AsyncIterator: regeneratorAsyncIterator,
2453 - async: function async(r, e, t, o, u) {
2454 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2455 - },
2456 - keys: regeneratorKeys,
2457 - values: regeneratorValues
2458 - };
2459 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2460 - }
2461 - module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2462 - }));
3486 + /**
3487 + * Function error().
3488 + *
3489 + * Throws error.
3490 + *
3491 + * @throws {Error}
3492 + *
3493 + * @param {string} message
3494 + */
3495 + }, {
3496 + key: "error",
3497 + value: function error(message) {
3498 + throw Error("Commands: ".concat(message));
3499 + }
3500 + }]);
3501 + return Commands;
3502 +}(_commands.default);
3503 +exports["default"] = Commands;
3504 +(0, _defineProperty2.default)(Commands, "trace", []);
2463 3505
2464 -//#endregion
2465 -//#region node_modules/@babel/runtime/regenerator/index.js
2466 - var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2467 - var runtime = require_regeneratorRuntime()();
2468 - module.exports = runtime;
2469 - try {
2470 - regeneratorRuntime = runtime;
2471 - } catch (accidentalStrictMode) {
2472 - if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime;
2473 - else Function("r", "regeneratorRuntime = r")(runtime);
2474 - }
2475 - }));
3506 +/***/ }),
2476 3507
2477 -//#endregion
2478 -//#region modules/web-cli/assets/js/core/backwards-compatibility/commands.js
2479 -var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator());
2480 - function _callSuper$23(t, o, e) {
2481 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$23() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2482 - }
2483 - __name(_callSuper$23, "_callSuper");
2484 - function _isNativeReflectConstruct$23() {
2485 - try {
2486 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2487 - } catch (t) {}
2488 - return (_isNativeReflectConstruct$23 = function _isNativeReflectConstruct() {
2489 - return !!t;
2490 - })();
2491 - }
2492 - __name(_isNativeReflectConstruct$23, "_isNativeReflectConstruct");
2493 - var CommandsBackwardsCompatibility = /*#__PURE__*/ function(_Module) {
2494 - function CommandsBackwardsCompatibility() {
2495 - var _this;
2496 - _classCallCheck(this, CommandsBackwardsCompatibility);
2497 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
2498 - _this = _callSuper$23(this, CommandsBackwardsCompatibility, [].concat(args));
2499 - _defineProperty(_this, "on", function(eventName, callback) {
2500 - if ("run" === eventName) {
2501 - var componentName = _this.getConstructorID();
2502 - componentName = componentName.replace(/^./, function(val) {
2503 - return val.toLowerCase();
2504 - });
2505 - Deprecation.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), "3.0.0", "$e.".concat(componentName, ".on( 'run:before', ... )"));
2506 - _this.onOrig("run:before", callback);
2507 - return;
2508 - }
2509 - _this.onOrig(eventName, callback);
2510 - });
2511 - return _this;
2512 - }
2513 - _inherits(CommandsBackwardsCompatibility, _Module);
2514 - return _createClass(CommandsBackwardsCompatibility, [{
2515 - key: "__construct",
2516 - value: function __construct() {
2517 - this.onOrig = this.on;
2518 - }
2519 - }]);
2520 - }(import_module.default);
3508 +/***/ "../modules/web-cli/assets/js/core/components.js":
3509 +/*!*******************************************************!*\
3510 + !*** ../modules/web-cli/assets/js/core/components.js ***!
3511 + \*******************************************************/
3512 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2521 3513
2522 -//#endregion
2523 -//#region modules/web-cli/assets/js/core/commands.js
2524 - init_typeof();
2525 - function ownKeys$1(e, r) {
2526 - var t = Object.keys(e);
2527 - if (Object.getOwnPropertySymbols) {
2528 - var o = Object.getOwnPropertySymbols(e);
2529 - r && (o = o.filter(function(r) {
2530 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
2531 - })), t.push.apply(t, o);
2532 - }
2533 - return t;
2534 - }
2535 - __name(ownKeys$1, "ownKeys");
2536 - function _objectSpread$1(e) {
2537 - for (var r = 1; r < arguments.length; r++) {
2538 - var t = null != arguments[r] ? arguments[r] : {};
2539 - r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
2540 - _defineProperty(e, r, t[r]);
2541 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
2542 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
2543 - });
2544 - }
2545 - return e;
2546 - }
2547 - __name(_objectSpread$1, "_objectSpread");
2548 - function _callSuper$22(t, o, e) {
2549 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$22() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2550 - }
2551 - __name(_callSuper$22, "_callSuper");
2552 - function _isNativeReflectConstruct$22() {
2553 - try {
2554 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2555 - } catch (t) {}
2556 - return (_isNativeReflectConstruct$22 = function _isNativeReflectConstruct() {
2557 - return !!t;
2558 - })();
2559 - }
2560 - __name(_isNativeReflectConstruct$22, "_isNativeReflectConstruct");
2561 - /**
2562 - * @typedef {import('../modules/component-base')} ComponentBase
2563 - */
2564 - /**
2565 - * @typedef {import('../modules/command-base')} CommandBase
2566 - */
2567 - /**
2568 - * @typedef {{}} Component
2569 - */
2570 - var Commands = /*#__PURE__*/ function(_CommandsBackwardsCom) {
2571 - /**
2572 - * Function constructor().
2573 - *
2574 - * Create `$e.commands` API.
2575 - *
2576 - * @param {{}} args
2577 - */
2578 - function Commands() {
2579 - var _this;
2580 - _classCallCheck(this, Commands);
2581 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
2582 - _this = _callSuper$22(this, Commands, [].concat(args));
2583 - _this.current = {};
2584 - _this.currentArgs = {};
2585 - _this.currentTrace = [];
2586 - _this.commands = {};
2587 - _this.components = {};
2588 - Object.defineProperty(_this, "classes", { get: function get() {
2589 - Deprecation.deprecated("$e.commands.classes", "3.7.0", "$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,");
2590 - return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2591 - } });
2592 - return _this;
2593 - }
2594 - /**
2595 - * @param {string} id
2596 - * @return {CommandBase} command class
2597 - */
2598 - _inherits(Commands, _CommandsBackwardsCom);
2599 - return _createClass(Commands, [
2600 - {
2601 - key: "getCommandClass",
2602 - value: function getCommandClass(id) {
2603 - return this.commands[id];
2604 - }
2605 - },
2606 - {
2607 - key: "getAll",
2608 - value: function getAll() {
2609 - return Object.keys(this.commands).sort();
2610 - }
2611 - },
2612 - {
2613 - key: "register",
2614 - value: function register(component, command, callback) {
2615 - var _this2 = this;
2616 - var namespace;
2617 - if ("string" === typeof component) {
2618 - namespace = component;
2619 - component = $e.components.get(namespace);
2620 - if (!component) this.error("'".concat(namespace, "' component is not exist."));
2621 - } else namespace = component.getNamespace();
2622 - var fullCommand = namespace + (command ? "/" + command : "");
2623 - if (this.commands[fullCommand]) this.error("`".concat(fullCommand, "` is already registered."));
2624 - this.commands[fullCommand] = callback;
2625 - this.components[fullCommand] = namespace;
2626 - var shortcut = component.getShortcuts()[command];
2627 - if (shortcut) {
2628 - shortcut.command = fullCommand;
2629 - shortcut.callback = function(event) {
2630 - return _this2.runShortcut(fullCommand, event);
2631 - };
2632 - $e.shortcuts.register(shortcut.keys, shortcut);
2633 - }
2634 - return this;
2635 - }
2636 - },
2637 - {
2638 - key: "unregister",
2639 - value: function unregister(component, command) {
2640 - var namespace;
2641 - if ("string" === typeof component) {
2642 - namespace = component;
2643 - component = $e.components.get(namespace);
2644 - if (!component) this.error("'".concat(namespace, "' component is not exist."));
2645 - } else namespace = component.getNamespace();
2646 - var fullCommand = namespace + (command ? "/" + command : "");
2647 - if (!this.commands[fullCommand]) this.error("`".concat(fullCommand, "` not exist."));
2648 - delete this.commands[fullCommand];
2649 - delete this.components[fullCommand];
2650 - var shortcut = component.getShortcuts()[command];
2651 - if (shortcut) $e.shortcuts.unregister(shortcut.keys, shortcut);
2652 - return this;
2653 - }
2654 - },
2655 - {
2656 - key: "getComponent",
2657 - value: function getComponent(command) {
2658 - var namespace = this.components[command];
2659 - return $e.components.get(namespace);
2660 - }
2661 - },
2662 - {
2663 - key: "is",
2664 - value: function is(command) {
2665 - var component = this.getComponent(command);
2666 - if (!component) return false;
2667 - return command === this.current[component.getServiceName()];
2668 - }
2669 - },
2670 - {
2671 - key: "isCurrentFirstTrace",
2672 - value: function isCurrentFirstTrace(command) {
2673 - return command === this.getCurrentFirstTrace();
2674 - }
2675 - },
2676 - {
2677 - key: "getCurrent",
2678 - value: function getCurrent() {
2679 - var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2680 - if (container) {
2681 - if (!this.current[container]) return false;
2682 - return this.current[container];
2683 - }
2684 - return this.current;
2685 - }
2686 - },
2687 - {
2688 - key: "getCurrentArgs",
2689 - value: function getCurrentArgs() {
2690 - var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2691 - if (container) {
2692 - if (!this.currentArgs[container]) return false;
2693 - return this.currentArgs[container];
2694 - }
2695 - return this.currentArgs;
2696 - }
2697 - },
2698 - {
2699 - key: "getCurrentFirst",
2700 - value: function getCurrentFirst() {
2701 - return Object.values(this.current)[0];
2702 - }
2703 - },
2704 - {
2705 - key: "getCurrentLast",
2706 - value: function getCurrentLast() {
2707 - var current = Object.values(this.current);
2708 - return current[current.length - 1];
2709 - }
2710 - },
2711 - {
2712 - key: "getCurrentFirstTrace",
2713 - value: function getCurrentFirstTrace() {
2714 - return this.currentTrace[0];
2715 - }
2716 - },
2717 - {
2718 - key: "beforeRun",
2719 - value: function beforeRun(command) {
2720 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2721 - var addTrace = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
2722 - var component = this.getComponent(command);
2723 - var container = component.getServiceName();
2724 - if (addTrace) this.addCurrentTrace(container, command, args);
2725 - if (args.onBefore) args.onBefore.apply(component, [args]);
2726 - this.trigger("run:before", component, command, args);
2727 - window.dispatchEvent(new CustomEvent("elementor/commands/run/before", { detail: {
2728 - command,
2729 - args
2730 - } }));
2731 - }
2732 - },
2733 - {
2734 - key: "validateRun",
2735 - value: function validateRun(command) {
2736 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2737 - if (!this.commands[command]) this.error("`".concat(command, "` not found."));
2738 - return this.getComponent(command).dependency(command, args);
2739 - }
2740 - },
2741 - {
2742 - key: "run",
2743 - value: function run(command) {
2744 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2745 - if (!this.validateRun(command, args)) return false;
2746 - this.beforeRun(command, args);
2747 - var context = this.commands[command];
2748 - if (context.getInstanceType) context = new context(args);
2749 - var currentComponent = this.getComponent(command);
2750 - if (!(context instanceof CommandBase)) {
2751 - var results = context.apply(currentComponent, [args]);
2752 - this.afterRun(command, args, results);
2753 - return results;
2754 - }
2755 - if (!this.validateInstanceScope(context, currentComponent, command)) return this.removeCurrentTrace(currentComponent);
2756 - return this.runInstance(context);
2757 - }
2758 - },
2759 - {
2760 - key: "runInstance",
2761 - value: function runInstance(instance) {
2762 - var results = null;
2763 - instance.onBeforeRun(instance.args);
2764 - try {
2765 - instance.onBeforeApply(instance.args);
2766 - results = instance.run();
2767 - } catch (e) {
2768 - this.catchApply(e, instance);
2769 - if (e instanceof $e.modules.HookBreak) {
2770 - this.removeCurrentTrace(instance.component);
2771 - return false;
2772 - }
2773 - }
2774 - return this.applyRunAfter(instance, results);
2775 - }
2776 - },
2777 - {
2778 - key: "applyRunAfter",
2779 - value: function applyRunAfter(instance, result) {
2780 - var _this3 = this;
2781 - if (result && "object" === _typeof(result) && result.promise && result.then && result.fail) return function handleJQueryDeferred(_result) {
2782 - _result.fail(function(e) {
2783 - _this3.catchApply(e, instance);
2784 - _this3.afterRun(instance.command, instance.args, e);
2785 - });
2786 - return _result.done(function(__result) {
2787 - return _this3.applyRunAfterAsyncResult(instance, __result);
2788 - });
2789 - }(result);
2790 - else if (result instanceof Promise) return this.applyRunAfterAsync(instance, result);
2791 - this.applyRunAfterSync(instance, result);
2792 - return result;
2793 - }
2794 - },
2795 - {
2796 - key: "applyRunAfterSync",
2797 - value: function applyRunAfterSync(instance, result) {
2798 - instance.onAfterApply(instance.args, result);
2799 - instance.onAfterRun(instance.args, result);
2800 - this.afterRun(instance.command, instance.args, result);
2801 - }
2802 - },
2803 - {
2804 - key: "applyRunAfterAsync",
2805 - value: function applyRunAfterAsync(instance, result) {
2806 - var _this4 = this;
2807 - return _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() {
2808 - return import_regenerator.default.wrap(function(_context) {
2809 - while (1) switch (_context.prev = _context.next) {
2810 - case 0:
2811 - _context.next = 1;
2812 - return result.catch(function(e) {
2813 - _this4.catchApply(e, instance);
2814 - _this4.afterRun(instance.command, instance.args, e);
2815 - });
2816 - case 1:
2817 - _context.next = 2;
2818 - return result.then(function(_result) {
2819 - return _this4.applyRunAfterAsyncResult(instance, _result);
2820 - });
2821 - case 2: return _context.abrupt("return", result);
2822 - case 3:
2823 - case "end": return _context.stop();
2824 - }
2825 - }, _callee);
2826 - }))();
2827 - }
2828 - },
2829 - {
2830 - key: "applyRunAfterAsyncResult",
2831 - value: function() {
2832 - var _applyRunAfterAsyncResult = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(instance, result) {
2833 - var results;
2834 - var promises;
2835 - return import_regenerator.default.wrap(function(_context2) {
2836 - while (1) switch (_context2.prev = _context2.next) {
2837 - case 0:
2838 - results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function(filtered) {
2839 - return filtered instanceof Promise;
2840 - }) : [];
2841 - if (!promises.length) {
2842 - _context2.next = 1;
2843 - break;
2844 - }
2845 - _context2.next = 1;
2846 - return Promise.all(promises);
2847 - case 1:
2848 - instance.onAfterRun(instance.args, result);
2849 - this.afterRun(instance.command, instance.args, result);
2850 - case 2:
2851 - case "end": return _context2.stop();
2852 - }
2853 - }, _callee2, this);
2854 - }));
2855 - function applyRunAfterAsyncResult(_x, _x2) {
2856 - return _applyRunAfterAsyncResult.apply(this, arguments);
2857 - }
2858 - return applyRunAfterAsyncResult;
2859 - }()
2860 - },
2861 - {
2862 - key: "afterRun",
2863 - value: function afterRun(command, args) {
2864 - var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
2865 - var removeTrace = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
2866 - var component = this.getComponent(command);
2867 - if (args.onAfter) args.onAfter.apply(component, [args, results]);
2868 - this.trigger("run:after", component, command, args, results);
2869 - window.dispatchEvent(new CustomEvent("elementor/commands/run/after", { detail: {
2870 - command,
2871 - args
2872 - } }));
2873 - if (removeTrace) this.removeCurrentTrace(component);
2874 - }
2875 - },
2876 - {
2877 - key: "catchApply",
2878 - value: function catchApply(e, instance) {
2879 - instance.onCatchApply(e);
2880 - Console.error(e);
2881 - }
2882 - },
2883 - {
2884 - key: "runShortcut",
2885 - value: function runShortcut(command, event) {
2886 - return this.run(command, event);
2887 - }
2888 - },
2889 - {
2890 - key: "validateInstanceScope",
2891 - value: function validateInstanceScope(instance, currentComponent, command) {
2892 - if (!(instance instanceof CommandBase)) this.error("invalid instance, command: '".concat(command, "' "));
2893 - if (currentComponent !== instance.component) {
2894 - if ($e.devTools) $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
2895 - return false;
2896 - }
2897 - return true;
2898 - }
2899 - },
2900 - {
2901 - key: "addCurrentTrace",
2902 - value: function addCurrentTrace(container, command, args) {
2903 - this.currentTrace.push(command);
2904 - Commands.trace.push(command);
2905 - this.attachCurrent(container, command, args);
2906 - }
2907 - },
2908 - {
2909 - key: "removeCurrentTrace",
2910 - value: function removeCurrentTrace(currentComponent) {
2911 - var container = currentComponent.getServiceName();
2912 - this.currentTrace.pop();
2913 - Commands.trace.pop();
2914 - this.detachCurrent(container);
2915 - }
2916 - },
2917 - {
2918 - key: "attachCurrent",
2919 - value: function attachCurrent(container, command, args) {
2920 - this.current[container] = command;
2921 - this.currentArgs[container] = args;
2922 - }
2923 - },
2924 - {
2925 - key: "detachCurrent",
2926 - value: function detachCurrent(container) {
2927 - delete this.current[container];
2928 - delete this.currentArgs[container];
2929 - }
2930 - },
2931 - {
2932 - key: "error",
2933 - value: function error(message) {
2934 - throw Error("Commands: ".concat(message));
2935 - }
2936 - }
2937 - ]);
2938 - }(CommandsBackwardsCompatibility);
2939 - _defineProperty(Commands, "trace", []);
3514 +"use strict";
2940 3515
2941 -//#endregion
2942 -//#region modules/web-cli/assets/js/core/commands-internal.js
2943 - function _callSuper$21(t, o, e) {
2944 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$21() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2945 - }
2946 - __name(_callSuper$21, "_callSuper");
2947 - function _isNativeReflectConstruct$21() {
2948 - try {
2949 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2950 - } catch (t) {}
2951 - return (_isNativeReflectConstruct$21 = function _isNativeReflectConstruct() {
2952 - return !!t;
2953 - })();
2954 - }
2955 - __name(_isNativeReflectConstruct$21, "_isNativeReflectConstruct");
2956 - var CommandsInternal = /*#__PURE__*/ function(_Commands) {
2957 - function CommandsInternal() {
2958 - _classCallCheck(this, CommandsInternal);
2959 - return _callSuper$21(this, CommandsInternal, arguments);
2960 - }
2961 - _inherits(CommandsInternal, _Commands);
2962 - return _createClass(CommandsInternal, [{
2963 - key: "error",
2964 - value: function error(message) {
2965 - throw Error("Commands internal: " + message);
2966 - }
2967 - }]);
2968 - }(Commands);
2969 3516
2970 -//#endregion
2971 -//#region modules/web-cli/assets/js/modules/commands/close.js
2972 - function _callSuper$20(t, o, e) {
2973 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$20() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2974 - }
2975 - __name(_callSuper$20, "_callSuper");
2976 - function _isNativeReflectConstruct$20() {
2977 - try {
2978 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2979 - } catch (t) {}
2980 - return (_isNativeReflectConstruct$20 = function _isNativeReflectConstruct() {
2981 - return !!t;
2982 - })();
2983 - }
2984 - __name(_isNativeReflectConstruct$20, "_isNativeReflectConstruct");
2985 - var Close = /*#__PURE__*/ function(_CommandBase) {
2986 - function Close() {
2987 - _classCallCheck(this, Close);
2988 - return _callSuper$20(this, Close, arguments);
2989 - }
2990 - _inherits(Close, _CommandBase);
2991 - return _createClass(Close, [{
2992 - key: "apply",
2993 - value: function apply() {
2994 - this.component.close();
2995 - }
2996 - }]);
2997 - }(CommandBase);
3517 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3518 +Object.defineProperty(exports, "__esModule", ({
3519 + value: true
3520 +}));
3521 +exports["default"] = void 0;
3522 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3523 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3524 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3525 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3526 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3527 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3528 +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); }; }
3529 +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; } }
3530 +/**
3531 + * @typedef {{}} Component
3532 + */
3533 +var _default = /*#__PURE__*/function (_Module) {
3534 + (0, _inherits2.default)(_default, _Module);
3535 + var _super = _createSuper(_default);
3536 + function _default() {
3537 + var _this;
3538 + (0, _classCallCheck2.default)(this, _default);
3539 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3540 + args[_key] = arguments[_key];
3541 + }
3542 + _this = _super.call.apply(_super, [this].concat(args));
3543 + _this.components = {};
3544 + _this.activeComponents = {};
3545 + return _this;
3546 + }
3547 + (0, _createClass2.default)(_default, [{
3548 + key: "getAll",
3549 + value: function getAll() {
3550 + return Object.keys(this.components).sort();
3551 + }
3552 + }, {
3553 + key: "register",
3554 + value: function register(component) {
3555 + if (this.components[component.getNamespace()]) {
3556 + return;
3557 + }
3558 + component.registerAPI();
3559 + this.components[component.getNamespace()] = component;
3560 + return component;
3561 + }
2998 3562
2999 -//#endregion
3000 -//#region modules/web-cli/assets/js/modules/commands/open.js
3001 - function _callSuper$19(t, o, e) {
3002 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$19() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3003 - }
3004 - __name(_callSuper$19, "_callSuper");
3005 - function _isNativeReflectConstruct$19() {
3006 - try {
3007 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3008 - } catch (t) {}
3009 - return (_isNativeReflectConstruct$19 = function _isNativeReflectConstruct() {
3010 - return !!t;
3011 - })();
3012 - }
3013 - __name(_isNativeReflectConstruct$19, "_isNativeReflectConstruct");
3014 - var Open = /*#__PURE__*/ function(_CommandBase) {
3015 - function Open() {
3016 - _classCallCheck(this, Open);
3017 - return _callSuper$19(this, Open, arguments);
3018 - }
3019 - _inherits(Open, _CommandBase);
3020 - return _createClass(Open, [{
3021 - key: "apply",
3022 - value: function apply() {
3023 - $e.route(this.component.getNamespace());
3024 - }
3025 - }]);
3026 - }(CommandBase);
3563 + /**
3564 + * @param {string} id
3565 + * @return {Component} component
3566 + */
3567 + }, {
3568 + key: "get",
3569 + value: function get(id) {
3570 + return this.components[id];
3571 + }
3572 + }, {
3573 + key: "getActive",
3574 + value: function getActive() {
3575 + return this.activeComponents;
3576 + }
3577 + }, {
3578 + key: "activate",
3579 + value: function activate(namespace) {
3580 + // Add as last.
3581 + this.inactivate(namespace);
3582 + this.activeComponents[namespace] = true;
3583 + }
3584 + }, {
3585 + key: "inactivate",
3586 + value: function inactivate(namespace) {
3587 + delete this.activeComponents[namespace];
3588 + }
3589 + }, {
3590 + key: "isActive",
3591 + value: function isActive(namespace) {
3592 + return !!this.activeComponents[namespace];
3593 + }
3594 + }]);
3595 + return _default;
3596 +}(_module.default);
3597 +exports["default"] = _default;
3027 3598
3028 -//#endregion
3029 -//#region modules/web-cli/assets/js/modules/commands/toggle.js
3030 - function _callSuper$18(t, o, e) {
3031 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$18() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3032 - }
3033 - __name(_callSuper$18, "_callSuper");
3034 - function _isNativeReflectConstruct$18() {
3035 - try {
3036 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3037 - } catch (t) {}
3038 - return (_isNativeReflectConstruct$18 = function _isNativeReflectConstruct() {
3039 - return !!t;
3040 - })();
3041 - }
3042 - __name(_isNativeReflectConstruct$18, "_isNativeReflectConstruct");
3043 - var Toggle = /*#__PURE__*/ function(_CommandBase) {
3044 - function Toggle() {
3045 - _classCallCheck(this, Toggle);
3046 - return _callSuper$18(this, Toggle, arguments);
3047 - }
3048 - _inherits(Toggle, _CommandBase);
3049 - return _createClass(Toggle, [{
3050 - key: "apply",
3051 - value: function apply() {
3052 - if (this.component.isOpen) this.component.close();
3053 - else $e.route(this.component.getNamespace());
3054 - }
3055 - }]);
3056 - }(CommandBase);
3599 +/***/ }),
3057 3600
3058 -//#endregion
3059 -//#region modules/web-cli/assets/js/modules/commands/index.js
3060 - var commands_exports = /* @__PURE__ */ __exportAll({
3061 - Close: () => Close,
3062 - Open: () => Open,
3063 - Toggle: () => Toggle
3064 - });
3601 +/***/ "../modules/web-cli/assets/js/core/data.js":
3602 +/*!*************************************************!*\
3603 + !*** ../modules/web-cli/assets/js/core/data.js ***!
3604 + \*************************************************/
3605 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3065 3606
3066 -//#endregion
3067 -//#region modules/web-cli/assets/js/modules/component-modal-base.js
3068 - function _callSuper$17(t, o, e) {
3069 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$17() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3070 - }
3071 - __name(_callSuper$17, "_callSuper");
3072 - function _isNativeReflectConstruct$17() {
3073 - try {
3074 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3075 - } catch (t) {}
3076 - return (_isNativeReflectConstruct$17 = function _isNativeReflectConstruct() {
3077 - return !!t;
3078 - })();
3079 - }
3080 - __name(_isNativeReflectConstruct$17, "_isNativeReflectConstruct");
3081 - function _superPropGet$4(t, o, e, r) {
3082 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3083 - return 2 & r && "function" == typeof p ? function(t) {
3084 - return p.apply(e, t);
3085 - } : p;
3086 - }
3087 - __name(_superPropGet$4, "_superPropGet");
3088 - var ComponentModalBase = /*#__PURE__*/ function(_ComponentBase) {
3089 - function ComponentModalBase() {
3090 - _classCallCheck(this, ComponentModalBase);
3091 - return _callSuper$17(this, ComponentModalBase, arguments);
3092 - }
3093 - _inherits(ComponentModalBase, _ComponentBase);
3094 - return _createClass(ComponentModalBase, [
3095 - {
3096 - key: "registerAPI",
3097 - value: function registerAPI() {
3098 - var _this = this;
3099 - _superPropGet$4(ComponentModalBase, "registerAPI", this, 3)([]);
3100 - $e.shortcuts.register("esc", {
3101 - scopes: [this.getNamespace()],
3102 - callback: function callback() {
3103 - return _this.close();
3104 - }
3105 - });
3106 - }
3107 - },
3108 - {
3109 - key: "defaultCommands",
3110 - value: function defaultCommands() {
3111 - return this.importCommands(commands_exports);
3112 - }
3113 - },
3114 - {
3115 - key: "defaultRoutes",
3116 - value: function defaultRoutes() {
3117 - return { "": function _() {} };
3118 - }
3119 - },
3120 - {
3121 - key: "open",
3122 - value: function open() {
3123 - var _this2 = this;
3124 - if (!this.layout) {
3125 - var layout = this.getModalLayout();
3126 - this.layout = new layout({ component: this });
3127 - this.layout.getModal().on("hide", function() {
3128 - return _this2.close();
3129 - });
3130 - }
3131 - this.layout.showModal();
3132 - return true;
3133 - }
3134 - },
3135 - {
3136 - key: "close",
3137 - value: function close() {
3138 - if (!_superPropGet$4(ComponentModalBase, "close", this, 3)([])) return false;
3139 - elementor.hooks.applyFilters("component/modal/close", this.layout.getModal().hide.bind(this.layout.getModal()), this)();
3140 - return true;
3141 - }
3142 - },
3143 - {
3144 - key: "getModalLayout",
3145 - value: function getModalLayout() {
3146 - force_method_implementation_default();
3147 - }
3148 - }
3149 - ]);
3150 - }(ComponentBase);
3607 +"use strict";
3151 3608
3152 -//#endregion
3153 -//#region modules/web-cli/assets/js/core/components.js
3154 - function _callSuper$16(t, o, e) {
3155 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$16() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3156 - }
3157 - __name(_callSuper$16, "_callSuper");
3158 - function _isNativeReflectConstruct$16() {
3159 - try {
3160 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3161 - } catch (t) {}
3162 - return (_isNativeReflectConstruct$16 = function _isNativeReflectConstruct() {
3163 - return !!t;
3164 - })();
3165 - }
3166 - __name(_isNativeReflectConstruct$16, "_isNativeReflectConstruct");
3167 - /**
3168 - * @typedef {{}} Component
3169 - */
3170 - var _default = /*#__PURE__*/ function(_Module) {
3171 - function _default() {
3172 - var _this;
3173 - _classCallCheck(this, _default);
3174 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
3175 - _this = _callSuper$16(this, _default, [].concat(args));
3176 - _this.components = {};
3177 - _this.activeComponents = {};
3178 - return _this;
3179 - }
3180 - _inherits(_default, _Module);
3181 - return _createClass(_default, [
3182 - {
3183 - key: "getAll",
3184 - value: function getAll() {
3185 - return Object.keys(this.components).sort();
3186 - }
3187 - },
3188 - {
3189 - key: "register",
3190 - value: function register(component) {
3191 - if (this.components[component.getNamespace()]) return;
3192 - component.registerAPI();
3193 - this.components[component.getNamespace()] = component;
3194 - return component;
3195 - }
3196 - },
3197 - {
3198 - key: "get",
3199 - value: function get(id) {
3200 - return this.components[id];
3201 - }
3202 - },
3203 - {
3204 - key: "getActive",
3205 - value: function getActive() {
3206 - return this.activeComponents;
3207 - }
3208 - },
3209 - {
3210 - key: "activate",
3211 - value: function activate(namespace) {
3212 - this.inactivate(namespace);
3213 - this.activeComponents[namespace] = true;
3214 - }
3215 - },
3216 - {
3217 - key: "inactivate",
3218 - value: function inactivate(namespace) {
3219 - delete this.activeComponents[namespace];
3220 - }
3221 - },
3222 - {
3223 - key: "isActive",
3224 - value: function isActive(namespace) {
3225 - return !!this.activeComponents[namespace];
3226 - }
3227 - }
3228 - ]);
3229 - }(import_module.default);
3230 3609
3231 -//#endregion
3232 -//#region modules/web-cli/assets/js/core/data/storages/base-storage.js
3610 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3611 +Object.defineProperty(exports, "__esModule", ({
3612 + value: true
3613 +}));
3614 +exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0;
3615 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
3616 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
3617 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
3618 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3619 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3620 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
3621 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3622 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3623 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3624 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3625 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3626 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
3627 +var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js"));
3628 +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); }; }
3629 +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; } }
3233 3630 /**
3234 - * TODO: Merge all storage's to one.
3235 - * Using this technique give's the ability to use JSDOC from 'window.storage'.
3236 - *
3237 - * @implements {Storage}
3238 - */
3239 - var BaseStorage = /*#__PURE__*/ function() {
3240 - /**
3241 - * Create storage wrapper.
3242 - *
3243 - * @param {Storage} provider
3244 - */
3245 - function BaseStorage(provider) {
3246 - _classCallCheck(this, BaseStorage);
3247 - if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) throw new TypeError("Cannot construct BaseStorage instances directly");
3248 - this.provider = provider;
3249 - }
3250 - return _createClass(BaseStorage, [
3251 - {
3252 - key: "clear",
3253 - value: function clear() {
3254 - return this.provider.clear();
3255 - }
3256 - },
3257 - {
3258 - key: "getItem",
3259 - value: function getItem(key) {
3260 - var result = this.provider.getItem(key);
3261 - if (null !== result) return JSON.parse(result);
3262 - return result;
3263 - }
3264 - },
3265 - {
3266 - key: "key",
3267 - value: function key(index) {
3268 - return this.provider.key(index);
3269 - }
3270 - },
3271 - {
3272 - key: "removeItem",
3273 - value: function removeItem(key) {
3274 - return this.provider.removeItem(key);
3275 - }
3276 - },
3277 - {
3278 - key: "setItem",
3279 - value: function setItem(key, value) {
3280 - return this.provider.setItem(key, JSON.stringify(value));
3281 - }
3282 - },
3283 - {
3284 - key: "getAll",
3285 - value: function getAll() {
3286 - var _this = this;
3287 - var keys = Object.keys(this.provider);
3288 - var result = {};
3289 - keys.forEach(function(key) {
3290 - result[key] = _this.getItem(key);
3291 - });
3292 - return result;
3293 - }
3294 - }
3295 - ]);
3296 - }();
3631 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3632 + */
3633 +/**
3634 + * @typedef {import('../modules/component-base')} ComponentBase
3635 + */
3636 +/**
3637 + * @typedef {{}} RequestInfo
3638 + */
3297 3639
3298 -//#endregion
3299 -//#region modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js
3300 - function _callSuper$15(t, o, e) {
3301 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$15() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3302 - }
3303 - __name(_callSuper$15, "_callSuper");
3304 - function _isNativeReflectConstruct$15() {
3305 - try {
3306 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3307 - } catch (t) {}
3308 - return (_isNativeReflectConstruct$15 = function _isNativeReflectConstruct() {
3309 - return !!t;
3310 - })();
3311 - }
3312 - __name(_isNativeReflectConstruct$15, "_isNativeReflectConstruct");
3313 - function _superPropGet$3(t, o, e, r) {
3314 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3315 - return 2 & r && "function" == typeof p ? function(t) {
3316 - return p.apply(e, t);
3317 - } : p;
3318 - }
3319 - __name(_superPropGet$3, "_superPropGet");
3320 - var BasePrefixStorage = /*#__PURE__*/ function(_BaseStorage) {
3321 - function BasePrefixStorage() {
3322 - _classCallCheck(this, BasePrefixStorage);
3323 - return _callSuper$15(this, BasePrefixStorage, arguments);
3324 - }
3325 - _inherits(BasePrefixStorage, _BaseStorage);
3326 - return _createClass(BasePrefixStorage, [
3327 - {
3328 - key: "clear",
3329 - value: function clear() {
3330 - var _this = this;
3331 - Object.keys(this.getAll()).forEach(function(key) {
3332 - return _this.removeItem(key);
3333 - });
3334 - }
3335 - },
3336 - {
3337 - key: "getItem",
3338 - value: function getItem(key) {
3339 - return _superPropGet$3(BasePrefixStorage, "getItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
3340 - }
3341 - },
3342 - {
3343 - key: "removeItem",
3344 - value: function removeItem(key) {
3345 - return _superPropGet$3(BasePrefixStorage, "removeItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
3346 - }
3347 - },
3348 - {
3349 - key: "setItem",
3350 - value: function setItem(key, value) {
3351 - return _superPropGet$3(BasePrefixStorage, "setItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value]);
3352 - }
3353 - },
3354 - {
3355 - key: "getAll",
3356 - value: function getAll() {
3357 - var _this2 = this;
3358 - var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX;
3359 - var keys = Object.keys(this.provider);
3360 - var result = {};
3361 - keys.forEach(function(key) {
3362 - if (key.startsWith(DEFAULT_KEY_PREFIX)) {
3363 - key = key.replace(DEFAULT_KEY_PREFIX, "");
3364 - result[key] = _this2.getItem(key);
3365 - }
3366 - });
3367 - return result;
3368 - }
3369 - }
3370 - ]);
3371 - }(BaseStorage);
3372 - _defineProperty(BasePrefixStorage, "DEFAULT_KEY_PREFIX", "e_");
3640 +/**
3641 + * @typedef {{}} RequestData
3642 + * @property {ComponentBase} component component
3643 + * @property {string} command command
3644 + * @property {{}} args arguments
3645 + * @property {DataTypes} type type
3646 + * @property {number} timestamp timestamp
3647 + * @property {string} endpoint endpoint
3648 + *
3649 + * @property {string} [baseEndpointURL] baseEndpointURL
3650 + * @property {string} [namespace] namespace
3651 + * @property {string} [version] version
3652 + * @property {('hit'|'miss')} [cache] cache
3653 + */
3373 3654
3374 -//#endregion
3375 -//#region modules/web-cli/assets/js/core/data/storages/local-storage.js
3376 - function _callSuper$14(t, o, e) {
3377 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$14() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3378 - }
3379 - __name(_callSuper$14, "_callSuper");
3380 - function _isNativeReflectConstruct$14() {
3381 - try {
3382 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3383 - } catch (t) {}
3384 - return (_isNativeReflectConstruct$14 = function _isNativeReflectConstruct() {
3385 - return !!t;
3386 - })();
3387 - }
3388 - __name(_isNativeReflectConstruct$14, "_isNativeReflectConstruct");
3389 - var LocalStorage = /*#__PURE__*/ function(_BasePrefixStorage) {
3390 - function LocalStorage() {
3391 - _classCallCheck(this, LocalStorage);
3392 - return _callSuper$14(this, LocalStorage, [localStorage]);
3393 - }
3394 - _inherits(LocalStorage, _BasePrefixStorage);
3395 - return _createClass(LocalStorage, [{
3396 - key: "debug",
3397 - value: function debug() {
3398 - var entries = this.getAll();
3399 - var ordered = {};
3400 - Object.keys(entries).sort().forEach(function(key) {
3401 - ordered[key] = entries[key];
3402 - });
3403 - return ordered;
3404 - }
3405 - }]);
3406 - }(BasePrefixStorage);
3655 +/**
3656 + * @typedef {Object} ExtractedCommand
3657 + * @property {string} command command
3658 + * @property {Object} args arguments
3659 + */
3407 3660
3408 -//#endregion
3409 -//#region modules/web-cli/assets/js/core/data/cache.js
3410 - init_typeof();
3411 - /**
3412 - * @typedef {{}} RequestData
3413 - */
3414 - /**
3415 - * @typedef {import('../data')} Data
3416 - */
3417 - /**
3418 - * TODO: Search common logic, create functions to reduce code size.
3419 - */
3420 - var Cache = /*#__PURE__*/ function() {
3421 - /**
3422 - * Function constructor().
3423 - *
3424 - * Create cache.
3425 - *
3426 - * @param {Data} manager
3427 - */
3428 - function Cache(manager) {
3429 - _classCallCheck(this, Cache);
3430 - this.manager = manager;
3431 - this.storage = new LocalStorage();
3432 - }
3433 - /**
3434 - * Function getAsync().
3435 - *
3436 - * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
3437 - * to fake fetch mechanism.
3438 - *
3439 - * @param {RequestData} requestData
3440 - *
3441 - * @return {(Promise|boolean)} request data
3442 - */
3443 - return _createClass(Cache, [
3444 - {
3445 - key: "getAsync",
3446 - value: function getAsync(requestData) {
3447 - var data = this.get(requestData);
3448 - if (null !== data) {
3449 - requestData.cache = "hit";
3450 - return new Promise(function(resolve) {
3451 - resolve(data);
3452 - });
3453 - }
3454 - return false;
3455 - }
3456 - },
3457 - {
3458 - key: "set",
3459 - value: function set(requestData, data) {
3460 - $e.data.validateRequestData(requestData);
3461 - var componentName = requestData.component.getNamespace();
3462 - var pureEndpoint = requestData.endpoint.replace(componentName + "/", "");
3463 - var pureEndpointParts = pureEndpoint.split("/");
3464 - var newData = {};
3465 - if (pureEndpointParts.length && pureEndpoint !== componentName) {
3466 - var result = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3467 - accumulator[pureEndpointPart] = {};
3468 - return accumulator[pureEndpointPart];
3469 - }, newData);
3470 - Object.assign(result, data);
3471 - } else newData = data;
3472 - var oldData = this.storage.getItem(componentName);
3473 - if (oldData !== null) newData = jQuery.extend(true, oldData, newData);
3474 - this.storage.setItem(componentName, newData);
3475 - }
3476 - },
3477 - {
3478 - key: "get",
3479 - value: function get(requestData) {
3480 - $e.data.validateRequestData(requestData);
3481 - var componentName = requestData.component.getNamespace();
3482 - var componentData = this.storage.getItem(componentName);
3483 - if (componentData !== null) {
3484 - if (componentName === requestData.endpoint) return componentData;
3485 - return requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/").reduce(function(accumulator, endpointPart) {
3486 - if (accumulator && accumulator[endpointPart]) return accumulator[endpointPart];
3487 - }, componentData) || null;
3488 - }
3489 - return null;
3490 - }
3491 - },
3492 - {
3493 - key: "update",
3494 - value: function update(requestData) {
3495 - $e.data.validateRequestData(requestData, true);
3496 - var endpoint = requestData.endpoint;
3497 - var response = {};
3498 - Object.entries(this.storage.getAll()).forEach(function(_ref) {
3499 - var _ref2 = _slicedToArray(_ref, 2);
3500 - var endpointKey = _ref2[0];
3501 - var endpointValue = _ref2[1];
3502 - if (endpointValue && endpoint.includes(endpointKey)) {
3503 - var oldData = endpointValue;
3504 - var pureEndpointParts = requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/");
3505 - if (1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace()) response = jQuery.extend(true, oldData, requestData.args.data);
3506 - else {
3507 - var oldSpecificData = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3508 - return accumulator[pureEndpointPart];
3509 - }, oldData);
3510 - response = jQuery.extend(true, oldSpecificData, requestData.args.data);
3511 - }
3512 - }
3513 - });
3514 - if (0 === Object.values(response).length) return false;
3515 - this.set(requestData, response);
3516 - return true;
3517 - }
3518 - },
3519 - {
3520 - key: "delete",
3521 - value: function _delete(requestData) {
3522 - $e.data.validateRequestData(requestData);
3523 - var result = false;
3524 - var componentName = requestData.component.getNamespace();
3525 - if (componentName !== requestData.endpoint) {
3526 - var oldData = this.storage.getItem(componentName);
3527 - var newData = {};
3528 - if (null === oldData) return false;
3529 - var pureEndpointParts = requestData.endpoint.replace(componentName + "/", "").split("/");
3530 - var lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
3531 - pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3532 - if (pureEndpointPart === lastEndpointPart) accumulator[pureEndpointPart] = null;
3533 - else accumulator[pureEndpointPart] = {};
3534 - return accumulator[pureEndpointPart];
3535 - }, newData);
3536 - if (Object.keys(oldData).length) {
3537 - var _deleteKeys = function deleteKeys(target, nullsObject) {
3538 - if (nullsObject) Object.keys(nullsObject).forEach(function(key) {
3539 - if (nullsObject[key] && "object" === _typeof(nullsObject[key])) _deleteKeys(target[key], nullsObject[key]);
3540 - else if (null === nullsObject[key]) {
3541 - delete target[key];
3542 - result = true;
3543 - }
3544 - });
3545 - else Object.keys(target).forEach(function(key) {
3546 - return delete target[key];
3547 - });
3548 - return target;
3549 - };
3550 - this.storage.setItem(componentName, _deleteKeys(oldData, newData));
3551 - }
3552 - } else for (var key in this.storage.getAll()) if (key === requestData.endpoint) {
3553 - this.storage.removeItem(requestData.endpoint);
3554 - result = true;
3555 - break;
3556 - }
3557 - return result;
3558 - }
3559 - }
3560 - ]);
3561 - }();
3661 +// TODO: Return it from the server. Original at WP_REST_Server.
3662 +var READABLE = ['GET'],
3663 + CREATABLE = ['POST'],
3664 + EDITABLE = ['POST', 'PUT', 'PATCH'],
3665 + DELETABLE = ['DELETE'],
3666 + ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
3667 +exports.ALLMETHODS = ALLMETHODS;
3668 +exports.DELETABLE = DELETABLE;
3669 +exports.EDITABLE = EDITABLE;
3670 +exports.CREATABLE = CREATABLE;
3671 +exports.READABLE = READABLE;
3672 +var Data = /*#__PURE__*/function (_Commands) {
3673 + (0, _inherits2.default)(Data, _Commands);
3674 + var _super = _createSuper(Data);
3675 + function Data() {
3676 + var _this;
3677 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3678 + (0, _classCallCheck2.default)(this, Data);
3679 + _this = _super.call(this, args);
3680 + _this.args = Object.assign(args, {
3681 + namespace: 'elementor',
3682 + version: '1',
3683 + baseEndpointURL: elementorWebCliConfig.urls.rest
3684 + });
3685 + _this.cache = new _cache.default((0, _assertThisInitialized2.default)(_this));
3686 + _this.validatedRequests = {};
3687 + _this.commandFormats = {};
3688 + return _this;
3689 + }
3562 3690
3563 -//#endregion
3564 -//#region modules/web-cli/assets/js/core/data.js
3565 - function _callSuper$13(t, o, e) {
3566 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$13() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3567 - }
3568 - __name(_callSuper$13, "_callSuper");
3569 - function _isNativeReflectConstruct$13() {
3570 - try {
3571 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3572 - } catch (t) {}
3573 - return (_isNativeReflectConstruct$13 = function _isNativeReflectConstruct() {
3574 - return !!t;
3575 - })();
3576 - }
3577 - __name(_isNativeReflectConstruct$13, "_isNativeReflectConstruct");
3578 - function _superPropGet$2(t, o, e, r) {
3579 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3580 - return 2 & r && "function" == typeof p ? function(t) {
3581 - return p.apply(e, t);
3582 - } : p;
3583 - }
3584 - __name(_superPropGet$2, "_superPropGet");
3585 - /**
3586 - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3587 - */
3588 - /**
3589 - * @typedef {import('../modules/component-base')} ComponentBase
3590 - */
3591 - /**
3592 - * @typedef {{}} RequestInfo
3593 - */
3594 - /**
3595 - * @typedef {{}} RequestData
3596 - * @property {ComponentBase} component component
3597 - * @property {string} command command
3598 - * @property {{}} args arguments
3599 - * @property {DataTypes} type type
3600 - * @property {number} timestamp timestamp
3601 - * @property {string} endpoint endpoint
3602 - *
3603 - * @property {string} [baseEndpointURL] baseEndpointURL
3604 - * @property {string} [namespace] namespace
3605 - * @property {string} [version] version
3606 - * @property {('hit'|'miss')} [cache] cache
3607 - */
3608 - /**
3609 - * @typedef {Object} ExtractedCommand
3610 - * @property {string} command command
3611 - * @property {Object} args arguments
3612 - */
3613 - var READABLE = ["GET"];
3614 - var CREATABLE = ["POST"];
3615 - var EDITABLE = [
3616 - "POST",
3617 - "PUT",
3618 - "PATCH"
3619 - ];
3620 - var DELETABLE = ["DELETE"];
3621 - var Data$1 = /*#__PURE__*/ function(_Commands) {
3622 - function Data() {
3623 - var _this;
3624 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3625 - _classCallCheck(this, Data);
3626 - _this = _callSuper$13(this, Data, [args]);
3627 - _this.args = Object.assign(args, {
3628 - namespace: "elementor",
3629 - version: "1",
3630 - baseEndpointURL: elementorWebCliConfig.urls.rest
3631 - });
3632 - _this.cache = new Cache(_this);
3633 - _this.validatedRequests = {};
3634 - _this.commandFormats = {};
3635 - return _this;
3636 - }
3637 - /**
3638 - * Function getHTTPMethod().
3639 - *
3640 - * Returns HTTP Method by type.
3641 - *
3642 - * @param {DataTypes} type
3643 - *
3644 - * @return {string|boolean} HTTP Method
3645 - */
3646 - _inherits(Data, _Commands);
3647 - return _createClass(Data, [
3648 - {
3649 - key: "getHTTPMethod",
3650 - value: function getHTTPMethod(type) {
3651 - switch (type) {
3652 - case "create": return "POST";
3653 - case "delete": return "DELETE";
3654 - case "get": return "GET";
3655 - case "update": return "PUT";
3656 - case "options": return "OPTIONS";
3657 - }
3658 - return false;
3659 - }
3660 - },
3661 - {
3662 - key: "getAllowedMethods",
3663 - value: function getAllowedMethods(type) {
3664 - switch (type) {
3665 - case "create": return CREATABLE;
3666 - case "delete": return DELETABLE;
3667 - case "get": return READABLE;
3668 - case "update": return EDITABLE;
3669 - case "options": return ["OPTIONS"];
3670 - }
3671 - return false;
3672 - }
3673 - },
3674 - {
3675 - key: "getEndpointURL",
3676 - value: function getEndpointURL(requestData) {
3677 - var endpoint = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : requestData.endpoint;
3678 - var _requestData$baseEndp = requestData.baseEndpointURL;
3679 - var baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp;
3680 - var _requestData$namespac = requestData.namespace;
3681 - var namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac;
3682 - var _requestData$version = requestData.version;
3683 - var version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3684 - return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3685 - }
3686 - },
3687 - {
3688 - key: "commandToEndpoint",
3689 - value: function commandToEndpoint(command, args) {
3690 - var format = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
3691 - var endpoint = command;
3692 - if ((args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0) && format && format.includes("/{")) format.split("/").filter(function(str) {
3693 - return "{" === str.charAt(0);
3694 - }).forEach(function(param) {
3695 - param = param.replace("{", "");
3696 - param = param.replace("}", "");
3697 - var formatted = Object.entries(args.query).find(function(_ref) {
3698 - return _slicedToArray(_ref, 1)[0] === param;
3699 - });
3700 - if (!formatted) return;
3701 - var key = formatted[0];
3702 - var value = formatted[1].toString();
3703 - format = format.replace(new RegExp("{" + param + "}", "g"), value);
3704 - delete args.query[key];
3705 - });
3706 - if (format) endpoint = format;
3707 - if (format && endpoint.includes("/{")) endpoint = endpoint.substring(0, endpoint.indexOf("/{"));
3708 - if (args.query && Object.values(args.query).length) {
3709 - var queryEntries = Object.entries(args.query).sort(function(_ref3, _ref4) {
3710 - return _slicedToArray(_ref3, 1)[0] - _slicedToArray(_ref4, 1)[0];
3711 - });
3712 - if (queryEntries.length) {
3713 - endpoint += "?";
3714 - queryEntries.forEach(function(_ref7) {
3715 - var _ref8 = _slicedToArray(_ref7, 2);
3716 - var name = _ref8[0];
3717 - var value = _ref8[1];
3718 - value = "".concat(value).replace(/\//g, "%2F");
3719 - endpoint += name + "=" + value + "&";
3720 - });
3721 - }
3722 - endpoint = endpoint.replace(/&$/, "");
3723 - }
3724 - return endpoint;
3725 - }
3726 - },
3727 - {
3728 - key: "commandExtractArgs",
3729 - value: function commandExtractArgs(command) {
3730 - var _command;
3731 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3732 - if ((_command = command) !== null && _command !== void 0 && _command.includes("?")) {
3733 - if (!args.query) args.query = {};
3734 - var commandParts = command.split("?");
3735 - var pureCommand = commandParts[0];
3736 - var queryString = commandParts[1];
3737 - var query = new URLSearchParams(queryString);
3738 - Object.assign(args.query, Object.fromEntries(query));
3739 - command = pureCommand;
3740 - }
3741 - return {
3742 - command,
3743 - args
3744 - };
3745 - }
3746 - },
3747 - {
3748 - key: "validateRequestData",
3749 - value: function validateRequestData(requestData) {
3750 - var requireArgsData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
3751 - if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) return;
3752 - var argsObject = new ArgsObject(requestData);
3753 - argsObject.requireArgument("component");
3754 - argsObject.requireArgumentType("command", "string");
3755 - argsObject.requireArgumentType("endpoint", "string");
3756 - if (requireArgsData) argsObject.requireArgumentType("data", "object", requestData.args);
3757 - if (!requestData.timestamp) requestData.timestamp = (/* @__PURE__ */ new Date()).getTime();
3758 - this.validatedRequests[requestData.timestamp] = true;
3759 - }
3760 - },
3761 - {
3762 - key: "prepareHeaders",
3763 - value: function prepareHeaders(requestData) {
3764 - var _requestData$args;
3765 - var type = requestData.type;
3766 - var nonce = elementorWebCliConfig.nonce;
3767 - var params = {
3768 - signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 || (_requestData$args = _requestData$args.options) === null || _requestData$args === void 0 ? void 0 : _requestData$args.signal,
3769 - credentials: "include"
3770 - };
3771 - var headers = { "X-WP-Nonce": nonce };
3772 - /**
3773 - * Translate:
3774 - * 'create, delete, get, update' to HTTP Methods:
3775 - * 'GET, POST, PUT, PATCH, DELETE'
3776 - */
3777 - var allowedMethods = this.getAllowedMethods(type);
3778 - var method = this.getHTTPMethod(type);
3779 - if ("GET" === method) Object.assign(params, { headers });
3780 - else if (allowedMethods) {
3781 - var _requestData$args2;
3782 - var _requestData$args3;
3783 - if (["POST", "PUT"].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) throw Error("Invalid requestData.args.data");
3784 - Object.assign(headers, { "Content-Type": "application/json" });
3785 - if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) Object.assign(headers, requestData.args.headers);
3786 - Object.assign(params, {
3787 - method,
3788 - headers,
3789 - body: "application/json" === headers["Content-Type"] ? JSON.stringify(requestData.args.data) : requestData.args.data
3790 - });
3791 - } else throw Error("Invalid type: '".concat(type, "'"));
3792 - return params;
3793 - }
3794 - },
3795 - {
3796 - key: "prepareEndpoint",
3797 - value: function prepareEndpoint(requestData) {
3798 - var splitEndpoint = requestData.endpoint.split("?");
3799 - var endpoint = splitEndpoint.shift();
3800 - var endpointAddress = this.getEndpointURL(requestData, endpoint);
3801 - if (splitEndpoint.length) {
3802 - var separator = endpointAddress.includes("?") ? "&" : "?";
3803 - endpointAddress += separator + splitEndpoint.pop();
3804 - }
3805 - return endpointAddress;
3806 - }
3807 - },
3808 - {
3809 - key: "fetch",
3810 - value: function fetch(requestData) {
3811 - var _requestData$args$opt;
3812 - var _this2 = this;
3813 - var fetchAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : window.fetch;
3814 - requestData.cache = "miss";
3815 - var refresh = (_requestData$args$opt = requestData.args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.refresh;
3816 - var getCache = "get" === requestData.type && !refresh;
3817 - var saveCache = ["create", "get"].includes(requestData.type) && !refresh;
3818 - if (getCache) {
3819 - var cachePromise = this.cache.getAsync(requestData);
3820 - if (cachePromise) return cachePromise;
3821 - }
3822 - var params = this.prepareHeaders(requestData);
3823 - return new Promise(/*#__PURE__*/ function() {
3824 - var _ref9 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(resolve, reject) {
3825 - var endpoint;
3826 - var request;
3827 - var response;
3828 - var _t;
3829 - return import_regenerator.default.wrap(function(_context2) {
3830 - while (1) switch (_context2.prev = _context2.next) {
3831 - case 0:
3832 - _context2.prev = 0;
3833 - endpoint = _this2.prepareEndpoint(requestData);
3834 - request = fetchAPI(endpoint, params);
3835 - _context2.next = 1;
3836 - return request.then(/*#__PURE__*/ function() {
3837 - var _ref0 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee(_response) {
3838 - return import_regenerator.default.wrap(function(_context) {
3839 - while (1) switch (_context.prev = _context.next) {
3840 - case 0:
3841 - if (_response.ok) {
3842 - _context.next = 3;
3843 - break;
3844 - }
3845 - if (!_response.headers.get("content-type").includes("application/json")) {
3846 - _context.next = 2;
3847 - break;
3848 - }
3849 - _context.next = 1;
3850 - return _response.json();
3851 - case 1: _response = _context.sent;
3852 - case 2: throw _response;
3853 - case 3: return _context.abrupt("return", _response.json());
3854 - case 4:
3855 - case "end": return _context.stop();
3856 - }
3857 - }, _callee);
3858 - }));
3859 - return function(_x3) {
3860 - return _ref0.apply(this, arguments);
3861 - };
3862 - }());
3863 - case 1:
3864 - response = _context2.sent;
3865 - if (saveCache) _this2.cache.set(requestData, response);
3866 - resolve(response);
3867 - _context2.next = 3;
3868 - break;
3869 - case 2:
3870 - _context2.prev = 2;
3871 - _t = _context2["catch"](0);
3872 - reject(_t);
3873 - case 3:
3874 - case "end": return _context2.stop();
3875 - }
3876 - }, _callee2, null, [[0, 2]]);
3877 - }));
3878 - return function(_x, _x2) {
3879 - return _ref9.apply(this, arguments);
3880 - };
3881 - }());
3882 - }
3883 - },
3884 - {
3885 - key: "getCache",
3886 - value: function getCache(component, command) {
3887 - var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} };
3888 - return this.cache.get({
3889 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3890 - component,
3891 - command,
3892 - args
3893 - });
3894 - }
3895 - },
3896 - {
3897 - key: "setCache",
3898 - value: function setCache(component, command, query, data) {
3899 - var args = { query };
3900 - this.cache.set({
3901 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3902 - component,
3903 - command,
3904 - args
3905 - }, data);
3906 - }
3907 - },
3908 - {
3909 - key: "updateCache",
3910 - value: function updateCache(component, command, query, data) {
3911 - var args = {
3912 - query,
3913 - data
3914 - };
3915 - this.cache.update({
3916 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3917 - component,
3918 - command,
3919 - args
3920 - });
3921 - }
3922 - },
3923 - {
3924 - key: "deleteCache",
3925 - value: function deleteCache(component, command) {
3926 - var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} };
3927 - this.cache.delete({
3928 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3929 - component,
3930 - command,
3931 - args
3932 - });
3933 - }
3934 - },
3935 - {
3936 - key: "registerFormat",
3937 - value: function registerFormat(command, format) {
3938 - this.commandFormats[command] = format;
3939 - }
3940 - },
3941 - {
3942 - key: "create",
3943 - value: function create(command, data) {
3944 - var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3945 - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3946 - return this.run("create", command, {
3947 - query,
3948 - options,
3949 - data
3950 - });
3951 - }
3952 - },
3953 - {
3954 - key: "delete",
3955 - value: function _delete(command) {
3956 - var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3957 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3958 - return this.run("delete", command, {
3959 - query,
3960 - options
3961 - });
3962 - }
3963 - },
3964 - {
3965 - key: "get",
3966 - value: function get(command) {
3967 - var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3968 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3969 - return this.run("get", command, {
3970 - query,
3971 - options
3972 - });
3973 - }
3974 - },
3975 - {
3976 - key: "update",
3977 - value: function update(command, data) {
3978 - var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3979 - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3980 - return this.run("update", command, {
3981 - query,
3982 - options,
3983 - data
3984 - });
3985 - }
3986 - },
3987 - {
3988 - key: "options",
3989 - value: function options(command, query) {
3990 - var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3991 - return this.run("options", command, {
3992 - query,
3993 - options: _options
3994 - });
3995 - }
3996 - },
3997 - {
3998 - key: "register",
3999 - value: function register(component, command, callback) {
4000 - _superPropGet$2(Data, "register", this, 3)([
4001 - component,
4002 - command,
4003 - callback
4004 - ]);
4005 - var fullCommandName = component.getNamespace() + "/" + command;
4006 - var commandInstance = $e.data.getCommandClass(fullCommandName);
4007 - var format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4008 - if (format) $e.data.registerFormat(fullCommandName, format);
4009 - return this;
4010 - }
4011 - },
4012 - {
4013 - key: "run",
4014 - value: function run(type, command, args) {
4015 - args.options.type = type;
4016 - var _this$commandExtractA = this.commandExtractArgs(command, args);
4017 - command = _this$commandExtractA.command;
4018 - args = _this$commandExtractA.args;
4019 - return _superPropGet$2(Data, "run", this, 3)([command, args]);
4020 - }
4021 - },
4022 - {
4023 - key: "error",
4024 - value: function error(message) {
4025 - throw Error("Data commands: " + message);
4026 - }
4027 - }
4028 - ]);
4029 - }(Commands);
3691 + /**
3692 + * Function getHTTPMethod().
3693 + *
3694 + * Returns HTTP Method by type.
3695 + *
3696 + * @param {DataTypes} type
3697 + *
3698 + * @return {string|boolean} HTTP Method
3699 + */
3700 + (0, _createClass2.default)(Data, [{
3701 + key: "getHTTPMethod",
3702 + value: function getHTTPMethod(type) {
3703 + switch (type) {
3704 + case 'create':
3705 + return 'POST';
3706 + case 'delete':
3707 + return 'DELETE';
3708 + case 'get':
3709 + return 'GET';
3710 + case 'update':
3711 + return 'PUT';
3712 + case 'options':
3713 + return 'OPTIONS';
3714 + }
3715 + return false;
3716 + }
4030 3717
4031 -//#endregion
4032 -//#region modules/web-cli/assets/js/extras/hash-commands.js
4033 - function _createForOfIteratorHelper(r, e) {
4034 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
4035 - if (!t) {
4036 - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
4037 - t && (r = t);
4038 - var _n = 0;
4039 - var F = function F() {};
4040 - return {
4041 - s: F,
4042 - n: function n() {
4043 - return _n >= r.length ? { done: !0 } : {
4044 - done: !1,
4045 - value: r[_n++]
4046 - };
4047 - },
4048 - e: function e(r) {
4049 - throw r;
4050 - },
4051 - f: F
4052 - };
4053 - }
4054 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4055 - }
4056 - var o;
4057 - var a = !0;
4058 - var u = !1;
4059 - return {
4060 - s: function s() {
4061 - t = t.call(r);
4062 - },
4063 - n: function n() {
4064 - var r = t.next();
4065 - return a = r.done, r;
4066 - },
4067 - e: function e(r) {
4068 - u = !0, o = r;
4069 - },
4070 - f: function f() {
4071 - try {
4072 - a || null == t.return || t.return();
4073 - } finally {
4074 - if (u) throw o;
4075 - }
4076 - }
4077 - };
4078 - }
4079 - function _unsupportedIterableToArray(r, a) {
4080 - if (r) {
4081 - if ("string" == typeof r) return _arrayLikeToArray(r, a);
4082 - var t = {}.toString.call(r).slice(8, -1);
4083 - 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;
4084 - }
4085 - }
4086 - function _arrayLikeToArray(r, a) {
4087 - (null == a || a > r.length) && (a = r.length);
4088 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4089 - return n;
4090 - }
4091 - var HashCommands = /*#__PURE__*/ function() {
4092 - function HashCommands() {
4093 - _classCallCheck(this, HashCommands);
4094 - /**
4095 - * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
4096 - */
4097 - _defineProperty(this, "dispatchersList", {
4098 - "e:run": {
4099 - runner: function runner() {
4100 - return $e.run;
4101 - },
4102 - isSafe: function isSafe(command) {
4103 - var _$e$commands$getComma;
4104 - return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
4105 - },
4106 - isSafeWithArgs: function isSafeWithArgs(command) {
4107 - var _$e$commands$getComma2;
4108 - return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
4109 - }
4110 - },
4111 - "e:route": {
4112 - runner: function runner() {
4113 - return $e.route;
4114 - },
4115 - isSafe: function isSafe() {
4116 - return true;
4117 - },
4118 - isSafeWithArgs: function isSafeWithArgs() {
4119 - return false;
4120 - }
4121 - }
4122 - });
4123 - /**
4124 - * @typedef HashCommand
4125 - * @property {string} method method
4126 - * @property {string} command command
4127 - * @property {Object} args arguments
4128 - */
4129 - /**
4130 - * List of current loaded hash commands.
4131 - *
4132 - * @type {Array.<HashCommand>}
4133 - */
4134 - _defineProperty(this, "commands", []);
4135 - this.commands = this.get();
4136 - }
4137 - /**
4138 - * Function get().
4139 - *
4140 - * Get API requests that comes from hash ( eg #e:run ).
4141 - *
4142 - * @param {string} hash
4143 - *
4144 - * @return {Array.<HashCommand>} API requests
4145 - */
4146 - return _createClass(HashCommands, [
4147 - {
4148 - key: "get",
4149 - value: function get() {
4150 - var _this = this;
4151 - var hash = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : location.hash;
4152 - var result = [];
4153 - if (hash) hash.substr(1).split("&").forEach(function(hashItem) {
4154 - var _hashItem$split2 = _slicedToArray(hashItem.split("?"), 2);
4155 - var rawCommand = _hashItem$split2[0];
4156 - var rawArgs = _hashItem$split2[1];
4157 - var hashParts = rawCommand.split(":");
4158 - if (3 !== hashParts.length) return;
4159 - var method = hashParts[0] + ":" + hashParts[1];
4160 - if (_this.dispatchersList[method]) {
4161 - var command = hashParts[2];
4162 - var args = _this.parseCommandArgs(rawArgs);
4163 - result.push({
4164 - method,
4165 - command,
4166 - args
4167 - });
4168 - }
4169 - });
4170 - return result;
4171 - }
4172 - },
4173 - {
4174 - key: "run",
4175 - value: function() {
4176 - var _run = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() {
4177 - var commands;
4178 - var _iterator;
4179 - var _step;
4180 - var hashCommand;
4181 - var dispatcher;
4182 - var _iterator2;
4183 - var _step2;
4184 - var _hashCommand;
4185 - var _dispatcher;
4186 - var _args = arguments;
4187 - var _t;
4188 - var _t2;
4189 - return import_regenerator.default.wrap(function(_context) {
4190 - while (1) switch (_context.prev = _context.next) {
4191 - case 0:
4192 - commands = _args.length > 0 && _args[0] !== void 0 ? _args[0] : this.commands;
4193 - _iterator = _createForOfIteratorHelper(commands);
4194 - _context.prev = 1;
4195 - _iterator.s();
4196 - case 2:
4197 - if ((_step = _iterator.n()).done) {
4198 - _context.next = 5;
4199 - break;
4200 - }
4201 - hashCommand = _step.value;
4202 - dispatcher = this.dispatchersList[hashCommand.method];
4203 - if (dispatcher) {
4204 - _context.next = 3;
4205 - break;
4206 - }
4207 - return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
4208 - case 3:
4209 - if (dispatcher.isSafe(hashCommand.command)) {
4210 - _context.next = 4;
4211 - break;
4212 - }
4213 - return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
4214 - case 4:
4215 - _context.next = 2;
4216 - break;
4217 - case 5:
4218 - _context.next = 7;
4219 - break;
4220 - case 6:
4221 - _context.prev = 6;
4222 - _t = _context["catch"](1);
4223 - _iterator.e(_t);
4224 - case 7:
4225 - _context.prev = 7;
4226 - _iterator.f();
4227 - return _context.finish(7);
4228 - case 8:
4229 - _iterator2 = _createForOfIteratorHelper(commands);
4230 - _context.prev = 9;
4231 - _iterator2.s();
4232 - case 10:
4233 - if ((_step2 = _iterator2.n()).done) {
4234 - _context.next = 12;
4235 - break;
4236 - }
4237 - _hashCommand = _step2.value;
4238 - _dispatcher = this.dispatchersList[_hashCommand.method];
4239 - _context.next = 11;
4240 - return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : void 0);
4241 - case 11:
4242 - _context.next = 10;
4243 - break;
4244 - case 12:
4245 - _context.next = 14;
4246 - break;
4247 - case 13:
4248 - _context.prev = 13;
4249 - _t2 = _context["catch"](9);
4250 - _iterator2.e(_t2);
4251 - case 14:
4252 - _context.prev = 14;
4253 - _iterator2.f();
4254 - return _context.finish(14);
4255 - case 15:
4256 - case "end": return _context.stop();
4257 - }
4258 - }, _callee, this, [[
4259 - 1,
4260 - 6,
4261 - 7,
4262 - 8
4263 - ], [
4264 - 9,
4265 - 13,
4266 - 14,
4267 - 15
4268 - ]]);
4269 - }));
4270 - function run() {
4271 - return _run.apply(this, arguments);
4272 - }
4273 - return run;
4274 - }()
4275 - },
4276 - {
4277 - key: "runOnce",
4278 - value: function runOnce() {
4279 - var _this2 = this;
4280 - this.run(this.commands).then(function() {
4281 - _this2.commands = [];
4282 - });
4283 - }
4284 - },
4285 - {
4286 - key: "parseCommandArgs",
4287 - value: function parseCommandArgs(rawArgs) {
4288 - try {
4289 - return JSON.parse(decodeURI(rawArgs || "{}"));
4290 - } catch (e) {
4291 - Console.warn("Hash commands JSON args cannot be parsed. \n\n", e);
4292 - return {};
4293 - }
4294 - }
4295 - }
4296 - ]);
4297 - }();
3718 + /**
3719 + * Function getAllowedMethods().
3720 + *
3721 + * Returns allowed HTTP methods by type.
3722 + *
3723 + * @param {DataTypes} type
3724 + *
3725 + * @return {[string]|boolean} allowed HTTP methods
3726 + */
3727 + }, {
3728 + key: "getAllowedMethods",
3729 + value: function getAllowedMethods(type) {
3730 + switch (type) {
3731 + case 'create':
3732 + return CREATABLE;
3733 + case 'delete':
3734 + return DELETABLE;
3735 + case 'get':
3736 + return READABLE;
3737 + case 'update':
3738 + return EDITABLE;
3739 + case 'options':
3740 + return ['OPTIONS'];
3741 + }
3742 + return false;
3743 + }
4298 3744
4299 -//#endregion
4300 -//#region modules/web-cli/assets/js/modules/hook-break.js
4301 - function _callSuper$12(t, o, e) {
4302 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$12() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4303 - }
4304 - __name(_callSuper$12, "_callSuper");
4305 - function _isNativeReflectConstruct$12() {
4306 - try {
4307 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4308 - } catch (t) {}
4309 - return (_isNativeReflectConstruct$12 = function _isNativeReflectConstruct() {
4310 - return !!t;
4311 - })();
4312 - }
4313 - __name(_isNativeReflectConstruct$12, "_isNativeReflectConstruct");
4314 - var HookBreak = /*#__PURE__*/ function(_Error) {
4315 - function HookBreak() {
4316 - _classCallCheck(this, HookBreak);
4317 - return _callSuper$12(this, HookBreak, ["HookBreak"]);
4318 - }
4319 - _inherits(HookBreak, _Error);
4320 - return _createClass(HookBreak);
4321 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
3745 + /**
3746 + * Function getEndpointURL().
3747 + *
3748 + * Get remote endpoint address.
3749 + *
3750 + * @param {RequestData} requestData
3751 + * @param {string} [endpoint=requestData.endpoint]
3752 + *
3753 + * @return {string} endpoint address
3754 + */
3755 + }, {
3756 + key: "getEndpointURL",
3757 + value: function getEndpointURL(requestData) {
3758 + var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint;
3759 + // Allow to request data override default namespace and args.
3760 + var _requestData$baseEndp = requestData.baseEndpointURL,
3761 + baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp,
3762 + _requestData$namespac = requestData.namespace,
3763 + namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac,
3764 + _requestData$version = requestData.version,
3765 + version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3766 + return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3767 + }
4322 3768
4323 -//#endregion
4324 -//#region modules/web-cli/assets/js/core/hooks/base.js
4325 - function _callSuper$11(t, o, e) {
4326 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4327 - }
4328 - __name(_callSuper$11, "_callSuper");
4329 - function _isNativeReflectConstruct$11() {
4330 - try {
4331 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4332 - } catch (t) {}
4333 - return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() {
4334 - return !!t;
4335 - })();
4336 - }
4337 - __name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct");
4338 - /**
4339 - * @typedef {import('../../modules/hook-base')} HookBase
4340 - */
4341 - var HooksBase = /*#__PURE__*/ function(_Module) {
4342 - /**
4343 - * Function constructor().
4344 - *
4345 - * Create hooks base.
4346 - *
4347 - * @param {{}} args
4348 - */
4349 - function HooksBase() {
4350 - var _this;
4351 - _classCallCheck(this, HooksBase);
4352 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4353 - _this = _callSuper$11(this, HooksBase, [].concat(args));
4354 - /**
4355 - * Current command.
4356 - *
4357 - * @type {string}
4358 - */
4359 - _this.current = "";
4360 - /**
4361 - * Array of ids which in use.
4362 - *
4363 - * @type {Array}
4364 - */
4365 - _this.usedIds = [];
4366 - /**
4367 - * Object of callbacks that was bound by container type.
4368 - *
4369 - * @type {{}}
4370 - */
4371 - _this.callbacks = {
4372 - after: {},
4373 - catch: {}
4374 - };
4375 - /**
4376 - * Object of depth.
4377 - *
4378 - * @type {{}}
4379 - */
4380 - _this.depth = {
4381 - after: {},
4382 - catch: {}
4383 - };
4384 - _this.callbacksFlatList = {};
4385 - return _this;
4386 - }
4387 - _inherits(HooksBase, _Module);
4388 - return _createClass(HooksBase, [
4389 - {
4390 - key: "activate",
4391 - value: function activate() {
4392 - Object.values(this.getAll(true)).forEach(function(callback) {
4393 - callback.activate();
4394 - });
4395 - }
4396 - },
4397 - {
4398 - key: "deactivate",
4399 - value: function deactivate() {
4400 - Object.values(this.getAll(true)).forEach(function(callback) {
4401 - callback.deactivate();
4402 - });
4403 - }
4404 - },
4405 - {
4406 - key: "getType",
4407 - value: function getType() {
4408 - force_method_implementation_default();
4409 - }
4410 - },
4411 - {
4412 - key: "get",
4413 - value: function get(id) {
4414 - return this.callbacksFlatList[id];
4415 - }
4416 - },
4417 - {
4418 - key: "getAll",
4419 - value: function getAll() {
4420 - var _this2 = this;
4421 - if (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false) return this.callbacksFlatList;
4422 - var result = {};
4423 - Object.keys(this.callbacks).forEach(function(event) {
4424 - if (!result[event]) result[event] = [];
4425 - Object.keys(_this2.callbacks[event]).forEach(function(command) {
4426 - result[event].push({
4427 - command,
4428 - callbacks: _this2.callbacks[event][command]
4429 - });
4430 - });
4431 - });
4432 - return result;
4433 - }
4434 - },
4435 - {
4436 - key: "getCurrent",
4437 - value: function getCurrent() {
4438 - return this.current;
4439 - }
4440 - },
4441 - {
4442 - key: "getUsedIds",
4443 - value: function getUsedIds() {
4444 - return this.usedIds;
4445 - }
4446 - },
4447 - {
4448 - key: "getCallbacks",
4449 - value: function getCallbacks(event, command, args) {
4450 - var _args$containers = args.containers;
4451 - var containers = _args$containers === void 0 ? [args.container] : _args$containers;
4452 - var containerType = containers[0] ? containers[0].type : false;
4453 - var callbacks = [];
4454 - if (this.callbacks[event] && this.callbacks[event][command]) {
4455 - if (containerType && this.callbacks[event][command][containerType]) callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
4456 - if (this.callbacks[event][command].all) callbacks = callbacks.concat(this.callbacks[event][command].all);
4457 - }
4458 - if (callbacks.length) return callbacks;
4459 - return false;
4460 - }
4461 - },
4462 - {
4463 - key: "checkEvent",
4464 - value: function checkEvent(event) {
4465 - if (-1 === Object.keys(this.callbacks).indexOf(event)) throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
4466 - }
4467 - },
4468 - {
4469 - key: "checkInstance",
4470 - value: function checkInstance(instance) {
4471 - if (instance.getType() !== this.getType()) throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
4472 - }
4473 - },
4474 - {
4475 - key: "checkId",
4476 - value: function checkId(id) {
4477 - if (-1 !== this.usedIds.indexOf(id)) throw Error("id: '".concat(id, "' is already in use."));
4478 - }
4479 - },
4480 - {
4481 - key: "shouldRun",
4482 - value: function shouldRun(callbacks) {
4483 - return !!callbacks && callbacks.length;
4484 - }
4485 - },
4486 - {
4487 - key: "register",
4488 - value: function register(event, instance) {
4489 - var command = instance.getCommand();
4490 - var id = instance.getId();
4491 - var containerType = instance.getContainerType();
4492 - this.checkEvent(event);
4493 - this.checkInstance(instance);
4494 - this.checkId(id);
4495 - return this.registerCallback(id, event, command, instance, containerType);
4496 - }
4497 - },
4498 - {
4499 - key: "registerCallback",
4500 - value: function registerCallback(id, event, command, instance, containerType) {
4501 - if (!this.callbacks[event][command]) this.callbacks[event][command] = [];
4502 - this.usedIds.push(id);
4503 - if (!this.callbacks[event][command]) this.callbacks[event][command] = {};
4504 - var callback = {
4505 - id,
4506 - callback: instance.run.bind(instance),
4507 - isActive: true,
4508 - activate: function activate() {
4509 - this.isActive = true;
4510 - },
4511 - deactivate: function deactivate() {
4512 - this.isActive = false;
4513 - }
4514 - };
4515 - if (containerType) {
4516 - if (!this.callbacks[event][command][containerType]) this.callbacks[event][command][containerType] = [];
4517 - this.callbacks[event][command][containerType].push(callback);
4518 - } else {
4519 - if (!this.callbacks[event][command].all) this.callbacks[event][command].all = [];
4520 - this.callbacks[event][command].all.push(callback);
4521 - }
4522 - this.callbacksFlatList[callback.id] = callback;
4523 - return callback;
4524 - }
4525 - },
4526 - {
4527 - key: "run",
4528 - value: function run(event, command, args) {
4529 - var result = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0;
4530 - var callbacks = this.getCallbacks(event, command, args);
4531 - if (this.shouldRun(callbacks)) {
4532 - this.current = command;
4533 - this.onRun(command, args, event);
4534 - return this.runCallbacks(event, command, callbacks, args, result);
4535 - }
4536 - return false;
4537 - }
4538 - },
4539 - {
4540 - key: "runCallbacks",
4541 - value: function runCallbacks(event, command, callbacks, args, result) {
4542 - var callbacksResult = [];
4543 - for (var i in callbacks) {
4544 - var callback = callbacks[i];
4545 - if (!callback.isActive) continue;
4546 - if (void 0 === this.depth[event][callback.id]) this.depth[event][callback.id] = 0;
4547 - this.depth[event][callback.id]++;
4548 - if (1 === this.depth[event][callback.id]) {
4549 - this.onCallback(command, args, event, callback.id);
4550 - try {
4551 - var callbackResult = this.runCallback(event, callback, args, result);
4552 - if (!callbackResult) throw Error("Callback failed, event: '".concat(event, "'"));
4553 - callbacksResult.push(callbackResult);
4554 - } catch (e) {
4555 - if (e instanceof $e.modules.HookBreak) throw e;
4556 - Console.error(e);
4557 - }
4558 - }
4559 - this.depth[event][callback.id]--;
4560 - }
4561 - return callbacksResult;
4562 - }
4563 - },
4564 - {
4565 - key: "runCallback",
4566 - value: function runCallback(event, callback, args, result) {
4567 - force_method_implementation_default();
4568 - }
4569 - },
4570 - {
4571 - key: "onRun",
4572 - value: function onRun(command, args, event) {
4573 - force_method_implementation_default();
4574 - }
4575 - },
4576 - {
4577 - key: "onCallback",
4578 - value: function onCallback(command, args, event, id) {
4579 - force_method_implementation_default();
4580 - }
4581 - }
4582 - ]);
4583 - }(import_module.default);
3769 + /**
3770 + * Function commandToEndpoint().
3771 + *
3772 + * Convert command to endpoint.
3773 + *
3774 + * For example `component/command/{arg}` => `controller/endpoint/8`.
3775 + *
3776 + * TODO: Find a better solution.
3777 + *
3778 + * @param {string} command
3779 + * @param {{}} args
3780 + * @param {string|null} [format]
3781 + *
3782 + * @return {string} endpoint
3783 + */
3784 + }, {
3785 + key: "commandToEndpoint",
3786 + value: function commandToEndpoint(command, args) {
3787 + var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3788 + var endpoint = command;
3789 + var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0;
3790 + if (argsQueryLength && format && format.includes('/{')) {
3791 + // Means command includes magic query arguments ( controller/endpoint/{whatever} ).
3792 + var magicParams = format.split('/').filter(function (str) {
3793 + return '{' === str.charAt(0);
3794 + });
3795 + magicParams.forEach(function (param) {
3796 + // Remove the '{', '}'.
3797 + param = param.replace('{', '');
3798 + param = param.replace('}', '');
3799 + var formatted = Object.entries(args.query).find(function (_ref) {
3800 + var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
3801 + key = _ref2[0];
3802 + return key === param;
3803 + });
3804 + if (!formatted) {
3805 + return;
3806 + }
3807 + var key = formatted[0],
3808 + value = formatted[1].toString();
4584 3809
4585 -//#endregion
4586 -//#region modules/web-cli/assets/js/core/hooks/data.js
4587 - function _callSuper$10(t, o, e) {
4588 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4589 - }
4590 - __name(_callSuper$10, "_callSuper");
4591 - function _isNativeReflectConstruct$10() {
4592 - try {
4593 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4594 - } catch (t) {}
4595 - return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() {
4596 - return !!t;
4597 - })();
4598 - }
4599 - __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct");
4600 - function _superPropGet$1(t, o, e, r) {
4601 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
4602 - return 2 & r && "function" == typeof p ? function(t) {
4603 - return p.apply(e, t);
4604 - } : p;
4605 - }
4606 - __name(_superPropGet$1, "_superPropGet");
4607 - var Data = /*#__PURE__*/ function(_HooksBase) {
4608 - function Data() {
4609 - var _this;
4610 - _classCallCheck(this, Data);
4611 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4612 - _this = _callSuper$10(this, Data, [].concat(args));
4613 - _this.callbacks.dependency = {};
4614 - _this.depth.dependency = {};
4615 - return _this;
4616 - }
4617 - _inherits(Data, _HooksBase);
4618 - return _createClass(Data, [
4619 - {
4620 - key: "getType",
4621 - value: function getType() {
4622 - return "data";
4623 - }
4624 - },
4625 - {
4626 - key: "runCallback",
4627 - value: function runCallback(event, callback, args, result) {
4628 - switch (event) {
4629 - case "dependency":
4630 - if (!callback.callback(args)) {
4631 - this.depth[event][callback.id]--;
4632 - throw new $e.modules.HookBreak();
4633 - }
4634 - return true;
4635 - case "catch":
4636 - case "after":
4637 - /**
4638 - * When handling HOOK which is data after (not breakable),
4639 - * even the result of the callback is negative, it is required to return positive,
4640 - * since result of runCallback determine if the callback succeeded.
4641 - */
4642 - return callback.callback(args, result) || "after" === event;
4643 - }
4644 - return false;
4645 - }
4646 - },
4647 - {
4648 - key: "shouldRun",
4649 - value: function shouldRun(callbacks) {
4650 - return _superPropGet$1(Data, "shouldRun", this, 3)([callbacks]) && elementor.documents.getCurrent().history.getActive();
4651 - }
4652 - },
4653 - {
4654 - key: "onRun",
4655 - value: function onRun(command, args, event) {
4656 - if (!$e.devTools) return;
4657 - $e.devTools.log.callbacks().run(this.getType(), command, args, event);
4658 - }
4659 - },
4660 - {
4661 - key: "onCallback",
4662 - value: function onCallback(command, args, event, id) {
4663 - if (!$e.devTools) return;
4664 - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
4665 - }
4666 - }
4667 - ]);
4668 - }(HooksBase);
3810 + // Replace magic params with values.
3811 + format = format.replace(new RegExp('{' + param + '}', 'g'), value);
3812 + delete args.query[key];
3813 + });
3814 + }
3815 + if (format) {
3816 + endpoint = format;
3817 + }
4669 3818
4670 -//#endregion
4671 -//#region modules/web-cli/assets/js/core/hooks/ui.js
4672 - function _callSuper$9(t, o, e) {
4673 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4674 - }
4675 - __name(_callSuper$9, "_callSuper");
4676 - function _isNativeReflectConstruct$9() {
4677 - try {
4678 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4679 - } catch (t) {}
4680 - return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() {
4681 - return !!t;
4682 - })();
4683 - }
4684 - __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct");
4685 - var Ui = /*#__PURE__*/ function(_HooksBase) {
4686 - function Ui() {
4687 - var _this;
4688 - _classCallCheck(this, Ui);
4689 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4690 - _this = _callSuper$9(this, Ui, [].concat(args));
4691 - _this.callbacks.before = {};
4692 - _this.depth.before = {};
4693 - return _this;
4694 - }
4695 - _inherits(Ui, _HooksBase);
4696 - return _createClass(Ui, [
4697 - {
4698 - key: "getType",
4699 - value: function getType() {
4700 - return "ui";
4701 - }
4702 - },
4703 - {
4704 - key: "runCallback",
4705 - value: function runCallback(event, callback, args, result) {
4706 - switch (event) {
4707 - case "before":
4708 - callback.callback(args);
4709 - break;
4710 - case "catch":
4711 - case "after":
4712 - callback.callback(args, result);
4713 - break;
4714 - default: return false;
4715 - }
4716 - return true;
4717 - }
4718 - },
4719 - {
4720 - key: "onRun",
4721 - value: function onRun(command, args, event) {
4722 - if (!$e.devTools) return;
4723 - $e.devTools.log.callbacks().run(this.getType(), command, args, event);
4724 - }
4725 - },
4726 - {
4727 - key: "onCallback",
4728 - value: function onCallback(command, args, event, id) {
4729 - if (!$e.devTools) return;
4730 - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
4731 - }
4732 - }
4733 - ]);
4734 - }(HooksBase);
3819 + // If requested magic param does not exist in args, need to remove it to have fixed endpoint.
3820 + // eg: 'documents/{documentId}/elements/{elementId}' and args { documentId: 4123 }.
3821 + // result: 'documents/4123/elements'
3822 + if (format && endpoint.includes('/{')) {
3823 + endpoint = endpoint.substring(0, endpoint.indexOf('/{'));
3824 + }
3825 + if (args.query && Object.values(args.query).length) {
3826 + // Sorting since the endpoint later will be used as key to store the cache.
3827 + var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) {
3828 + var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
3829 + aKey = _ref5[0];
3830 + var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
3831 + bKey = _ref6[0];
3832 + return aKey - bKey;
3833 + } // Sort by param name.
3834 + );
4735 3835
4736 -//#endregion
4737 -//#region modules/web-cli/assets/js/core/hooks.js
3836 + // `args.query` will become a part of GET params.
3837 + if (queryEntries.length) {
3838 + endpoint += '?';
3839 + queryEntries.forEach(function (_ref7) {
3840 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3841 + name = _ref8[0],
3842 + value = _ref8[1];
3843 + // Replace the character '/' with the encoded version,
3844 + // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character.
3845 + value = "".concat(value).replace(/\//g, '%2F');
3846 + endpoint += name + '=' + value + '&';
3847 + });
3848 + }
3849 +
3850 + // If last character is '&' remove it.
3851 + endpoint = endpoint.replace(/&$/, '');
3852 + }
3853 + return endpoint;
3854 + }
3855 +
3856 + /**
3857 + * Function commandExtractArgs().
3858 + *
3859 + * If the command have query convert it to args.
3860 + *
3861 + * @param {string} command
3862 + * @param {Object} args
3863 + *
3864 + * @return {ExtractedCommand} command
3865 + */
3866 + }, {
3867 + key: "commandExtractArgs",
3868 + value: function commandExtractArgs(command) {
3869 + var _command;
3870 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3871 + if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) {
3872 + if (!args.query) {
3873 + args.query = {};
3874 + }
3875 + var commandParts = command.split('?'),
3876 + pureCommand = commandParts[0],
3877 + queryString = commandParts[1],
3878 + query = new URLSearchParams(queryString);
3879 + Object.assign(args.query, Object.fromEntries(query));
3880 + command = pureCommand;
3881 + }
3882 + return {
3883 + command: command,
3884 + args: args
3885 + };
3886 + }
3887 +
3888 + /**
3889 + * Function validateRequestData().
3890 + *
3891 + * Validate request data requirements.
3892 + *
3893 + * @param {RequestData} requestData
3894 + * @param {boolean} [requireArgsData]
3895 + */
3896 + }, {
3897 + key: "validateRequestData",
3898 + value: function validateRequestData(requestData) {
3899 + var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3900 + // Do not validate if its already valid.
3901 + if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) {
3902 + return;
3903 + }
3904 + var argsObject = new _argsObject.default(requestData);
3905 + argsObject.requireArgument('component');
3906 + argsObject.requireArgumentType('command', 'string');
3907 + argsObject.requireArgumentType('endpoint', 'string');
3908 + if (requireArgsData) {
3909 + argsObject.requireArgumentType('data', 'object', requestData.args);
3910 + }
3911 +
3912 + // Ensure timestamp.
3913 + if (!requestData.timestamp) {
3914 + requestData.timestamp = new Date().getTime();
3915 + }
3916 + this.validatedRequests[requestData.timestamp] = true;
3917 + }
3918 +
3919 + /**
3920 + * Function prepareHeaders().
3921 + *
3922 + * Prepare the headers for each request.
3923 + *
3924 + * @param {RequestData} requestData
3925 + *
3926 + * @return {{}} params
3927 + */
3928 + }, {
3929 + key: "prepareHeaders",
3930 + value: function prepareHeaders(requestData) {
3931 + var _requestData$args, _requestData$args$opt;
3932 + var type = requestData.type,
3933 + nonce = elementorWebCliConfig.nonce,
3934 + params = {
3935 + signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 ? void 0 : (_requestData$args$opt = _requestData$args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.signal,
3936 + credentials: 'include' // Cookies is required for wp reset.
3937 + },
3938 + headers = {
3939 + 'X-WP-Nonce': nonce
3940 + };
3941 +
3942 + /**
3943 + * Translate:
3944 + * 'create, delete, get, update' to HTTP Methods:
3945 + * 'GET, POST, PUT, PATCH, DELETE'
3946 + */
3947 + var allowedMethods = this.getAllowedMethods(type),
3948 + method = this.getHTTPMethod(type);
3949 + if ('GET' === method) {
3950 + Object.assign(params, {
3951 + headers: headers
3952 + });
3953 + } else if (allowedMethods) {
3954 + var _requestData$args2, _requestData$args3;
3955 + if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) {
3956 + throw Error('Invalid requestData.args.data');
3957 + }
3958 + Object.assign(headers, {
3959 + 'Content-Type': 'application/json'
3960 + });
3961 + if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) {
3962 + Object.assign(headers, requestData.args.headers);
3963 + }
3964 + Object.assign(params, {
3965 + method: method,
3966 + headers: headers,
3967 + body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data
3968 + });
3969 + } else {
3970 + throw Error("Invalid type: '".concat(type, "'"));
3971 + }
3972 + return params;
3973 + }
3974 +
3975 + /**
3976 + * Function prepareEndpoint().
3977 + *
3978 + * This method response for building a final endpoint,
3979 + * the main problem is with plain permalink mode + command with query params that creates a weird url,
3980 + * the current method should fix it.
3981 + *
3982 + * @param {RequestData} requestData
3983 + *
3984 + * @return {string} Endpoint URL
3985 + */
3986 + }, {
3987 + key: "prepareEndpoint",
3988 + value: function prepareEndpoint(requestData) {
3989 + var splitEndpoint = requestData.endpoint.split('?'),
3990 + endpoint = splitEndpoint.shift();
3991 + var endpointAddress = this.getEndpointURL(requestData, endpoint);
3992 + if (splitEndpoint.length) {
3993 + var separator = endpointAddress.includes('?') ? '&' : '?';
3994 + endpointAddress += separator + splitEndpoint.pop();
3995 + }
3996 + return endpointAddress;
3997 + }
3998 +
3999 + /**
4000 + * Function fetch().
4001 + *
4002 + * @param {RequestData} requestData
4003 + * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI]
4004 + *
4005 + * @return {Promise<Response>} response
4006 + */
4007 + }, {
4008 + key: "fetch",
4009 + value: function fetch(requestData) {
4010 + var _requestData$args$opt2,
4011 + _this2 = this;
4012 + var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch;
4013 + requestData.cache = 'miss';
4014 + var refresh = (_requestData$args$opt2 = requestData.args.options) === null || _requestData$args$opt2 === void 0 ? void 0 : _requestData$args$opt2.refresh,
4015 + getCache = 'get' === requestData.type && !refresh,
4016 + saveCache = ['create', 'get'].includes(requestData.type) && !refresh;
4017 + if (getCache) {
4018 + var cachePromise = this.cache.getAsync(requestData);
4019 + if (cachePromise) {
4020 + return cachePromise;
4021 + }
4022 + }
4023 + var params = this.prepareHeaders(requestData);
4024 + // eslint-disable-next-line no-async-promise-executor
4025 + return new Promise( /*#__PURE__*/function () {
4026 + var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
4027 + var endpoint, request, response;
4028 + return _regenerator.default.wrap(function _callee2$(_context2) {
4029 + while (1) switch (_context2.prev = _context2.next) {
4030 + case 0:
4031 + _context2.prev = 0;
4032 + endpoint = _this2.prepareEndpoint(requestData);
4033 + request = fetchAPI(endpoint, params);
4034 + _context2.next = 5;
4035 + return request.then( /*#__PURE__*/function () {
4036 + var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_response) {
4037 + return _regenerator.default.wrap(function _callee$(_context) {
4038 + while (1) switch (_context.prev = _context.next) {
4039 + case 0:
4040 + if (_response.ok) {
4041 + _context.next = 6;
4042 + break;
4043 + }
4044 + if (!_response.headers.get('content-type').includes('application/json')) {
4045 + _context.next = 5;
4046 + break;
4047 + }
4048 + _context.next = 4;
4049 + return _response.json();
4050 + case 4:
4051 + _response = _context.sent;
4052 + case 5:
4053 + throw _response;
4054 + case 6:
4055 + return _context.abrupt("return", _response.json());
4056 + case 7:
4057 + case "end":
4058 + return _context.stop();
4059 + }
4060 + }, _callee);
4061 + }));
4062 + return function (_x3) {
4063 + return _ref10.apply(this, arguments);
4064 + };
4065 + }());
4066 + case 5:
4067 + response = _context2.sent;
4068 + // At this point, it got the resolved response from remote.
4069 + // So load cache, and resolve it.
4070 + if (saveCache) {
4071 + _this2.cache.set(requestData, response);
4072 + }
4073 + resolve(response);
4074 + _context2.next = 13;
4075 + break;
4076 + case 10:
4077 + _context2.prev = 10;
4078 + _context2.t0 = _context2["catch"](0);
4079 + reject(_context2.t0);
4080 + case 13:
4081 + case "end":
4082 + return _context2.stop();
4083 + }
4084 + }, _callee2, null, [[0, 10]]);
4085 + }));
4086 + return function (_x, _x2) {
4087 + return _ref9.apply(this, arguments);
4088 + };
4089 + }());
4090 + }
4091 +
4092 + /**
4093 + * Function getCache().
4094 + *
4095 + * @param {ComponentBase} component
4096 + * @param {string} command
4097 + * @param {{}} query
4098 + *
4099 + * @return {{}} cache object
4100 + */
4101 + }, {
4102 + key: "getCache",
4103 + value: function getCache(component, command) {
4104 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4105 + var args = {
4106 + query: query
4107 + };
4108 + return this.cache.get({
4109 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4110 + component: component,
4111 + command: command,
4112 + args: args
4113 + });
4114 + }
4115 +
4116 + /**
4117 + * Function setCache().
4118 + *
4119 + * @param {ComponentBase} component
4120 + * @param {string} command
4121 + * @param {{}} query
4122 + * @param {*} data
4123 + */
4124 + }, {
4125 + key: "setCache",
4126 + value: function setCache(component, command, query, data) {
4127 + var args = {
4128 + query: query
4129 + };
4130 + this.cache.set({
4131 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4132 + component: component,
4133 + command: command,
4134 + args: args
4135 + }, data);
4136 + }
4137 +
4138 + /**
4139 + * Function updateCache().
4140 + *
4141 + * The difference between 'setCache' and 'updateCache' is update will only modify exist values.
4142 + * and 'setCache' will create or update.
4143 + *
4144 + * @param {ComponentBase} component
4145 + * @param {string} command
4146 + * @param {{}} query
4147 + * @param {*} data
4148 + */
4149 + }, {
4150 + key: "updateCache",
4151 + value: function updateCache(component, command, query, data) {
4152 + var args = {
4153 + query: query,
4154 + data: data
4155 + };
4156 + this.cache.update({
4157 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4158 + component: component,
4159 + command: command,
4160 + args: args
4161 + });
4162 + }
4163 +
4164 + /**
4165 + * Function deleteCache().
4166 + *
4167 + * @param {ComponentBase} component
4168 + * @param {string} command
4169 + * @param {{}} query
4170 + */
4171 + }, {
4172 + key: "deleteCache",
4173 + value: function deleteCache(component, command) {
4174 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4175 + var args = {
4176 + query: query
4177 + };
4178 + this.cache.delete({
4179 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4180 + component: component,
4181 + command: command,
4182 + args: args
4183 + });
4184 + }
4185 +
4186 + /**
4187 + * Function registerFormat().
4188 + *
4189 + * Register's format for each command.
4190 + *
4191 + * @param {string} command
4192 + * @param {string} format
4193 + */
4194 + }, {
4195 + key: "registerFormat",
4196 + value: function registerFormat(command, format) {
4197 + this.commandFormats[command] = format;
4198 + }
4199 +
4200 + /**
4201 + * Function create().
4202 + *
4203 + * Run a command, that will be translated as endpoint for creating new data.
4204 + *
4205 + * @param {string} command
4206 + * @param {*} data
4207 + * @param {{}} query
4208 + * @param {{}} options
4209 + *
4210 + * @return {*} result
4211 + */
4212 + }, {
4213 + key: "create",
4214 + value: function create(command, data) {
4215 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4216 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4217 + return this.run('create', command, {
4218 + query: query,
4219 + options: options,
4220 + data: data
4221 + });
4222 + }
4223 +
4224 + /**
4225 + * Function delete().
4226 + *
4227 + * Run a command, that will be translated as endpoint for deleting data.
4228 + *
4229 + * @param {string} command
4230 + * @param {{}} query
4231 + * @param {{}} options
4232 + *
4233 + * @return {*} result
4234 + */
4235 + }, {
4236 + key: "delete",
4237 + value: function _delete(command) {
4238 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4239 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4240 + return this.run('delete', command, {
4241 + query: query,
4242 + options: options
4243 + });
4244 + }
4245 +
4246 + /**
4247 + * Function get().
4248 + *
4249 + * Run a command, that will be translated as endpoint for getting data.
4250 + *
4251 + * @param {string} command
4252 + * @param {{}} query
4253 + * @param {{}} options
4254 + *
4255 + * @return {*} result
4256 + */
4257 + }, {
4258 + key: "get",
4259 + value: function get(command) {
4260 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4261 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4262 + return this.run('get', command, {
4263 + query: query,
4264 + options: options
4265 + });
4266 + }
4267 +
4268 + /**
4269 + * Function update().
4270 + *
4271 + * Run a command, that will be translated as endpoint for updating data.
4272 + *
4273 + * @param {string} command
4274 + * @param {*} data
4275 + * @param {{}} query
4276 + * @param {{}} options
4277 + *
4278 + * @return {*} result
4279 + */
4280 + }, {
4281 + key: "update",
4282 + value: function update(command, data) {
4283 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4284 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4285 + return this.run('update', command, {
4286 + query: query,
4287 + options: options,
4288 + data: data
4289 + });
4290 + }
4291 +
4292 + /**
4293 + * Function options().
4294 + *
4295 + * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint.
4296 + *
4297 + * @param {string} command
4298 + * @param {{}} query
4299 + * @param {{}} options
4300 + *
4301 + * @return {*} result
4302 + */
4303 + }, {
4304 + key: "options",
4305 + value: function options(command, query) {
4306 + var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4307 + return this.run('options', command, {
4308 + query: query,
4309 + options: _options
4310 + });
4311 + }
4312 + }, {
4313 + key: "register",
4314 + value: function register(component, command, callback) {
4315 + (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "register", this).call(this, component, command, callback);
4316 + var fullCommandName = component.getNamespace() + '/' + command,
4317 + commandInstance = $e.data.getCommandClass(fullCommandName),
4318 + format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4319 + if (format) {
4320 + $e.data.registerFormat(fullCommandName, format);
4321 + }
4322 + return this;
4323 + }
4324 +
4325 + /**
4326 + * TODO: Add JSDOC typedef for args ( query and options ).
4327 + *
4328 + * @param {DataTypes} type
4329 + * @param {string} command
4330 + * @param {{}} args
4331 + *
4332 + * @override
4333 + */
4334 + }, {
4335 + key: "run",
4336 + value: function run(type, command, args) {
4337 + args.options.type = type;
4338 + var _this$commandExtractA = this.commandExtractArgs(command, args);
4339 + command = _this$commandExtractA.command;
4340 + args = _this$commandExtractA.args;
4341 + return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "run", this).call(this, command, args);
4342 + }
4343 + }, {
4344 + key: "error",
4345 + value: function error(message) {
4346 + throw Error('Data commands: ' + message);
4347 + }
4348 + }]);
4349 + return Data;
4350 +}(_commands.default);
4351 +exports["default"] = Data;
4352 +
4353 +/***/ }),
4354 +
4355 +/***/ "../modules/web-cli/assets/js/core/data/cache.js":
4356 +/*!*******************************************************!*\
4357 + !*** ../modules/web-cli/assets/js/core/data/cache.js ***!
4358 + \*******************************************************/
4359 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4360 +
4361 +"use strict";
4362 +
4363 +
4364 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4365 +Object.defineProperty(exports, "__esModule", ({
4366 + value: true
4367 +}));
4368 +exports["default"] = void 0;
4369 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
4370 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4371 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4372 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4373 +var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js"));
4738 4374 /**
4739 - * @typedef {import('../modules/hook-base')} HookBase
4740 - */
4741 - var Hooks = /*#__PURE__*/ function() {
4742 - function Hooks() {
4743 - _classCallCheck(this, Hooks);
4744 - _defineProperty(this, "data", new Data());
4745 - _defineProperty(this, "ui", new Ui());
4746 - }
4747 - return _createClass(Hooks, [
4748 - {
4749 - key: "activate",
4750 - value: function activate() {
4751 - this.getTypes().forEach(function(hooksType) {
4752 - hooksType.activate();
4753 - });
4754 - }
4755 - },
4756 - {
4757 - key: "deactivate",
4758 - value: function deactivate() {
4759 - this.getTypes().forEach(function(hooksType) {
4760 - hooksType.deactivate();
4761 - });
4762 - }
4763 - },
4764 - {
4765 - key: "getAll",
4766 - value: function getAll() {
4767 - var flat = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
4768 - var result = {};
4769 - this.getTypes().forEach(function(hooksType) {
4770 - result[hooksType.getType()] = hooksType.getAll(flat);
4771 - });
4772 - return result;
4773 - }
4774 - },
4775 - {
4776 - key: "getTypes",
4777 - value: function getTypes() {
4778 - return [this.data, this.ui];
4779 - }
4780 - },
4781 - {
4782 - key: "getType",
4783 - value: function getType(type) {
4784 - return this.getTypes().find(function(hooks) {
4785 - return type === hooks.getType();
4786 - });
4787 - }
4788 - },
4789 - {
4790 - key: "register",
4791 - value: function register(type, event, instance) {
4792 - return this.getType(type).register(event, instance);
4793 - }
4794 - },
4795 - {
4796 - key: "run",
4797 - value: function run(type, event, command, args) {
4798 - var result = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : void 0;
4799 - return this.getType(type).run(event, command, args, result);
4800 - }
4801 - },
4802 - {
4803 - key: "registerDataAfter",
4804 - value: function registerDataAfter(instance) {
4805 - return this.register("data", "after", instance);
4806 - }
4807 - },
4808 - {
4809 - key: "registerDataCatch",
4810 - value: function registerDataCatch(instance) {
4811 - return this.register("data", "catch", instance);
4812 - }
4813 - },
4814 - {
4815 - key: "registerDataDependency",
4816 - value: function registerDataDependency(instance) {
4817 - return this.register("data", "dependency", instance);
4818 - }
4819 - },
4820 - {
4821 - key: "registerUIAfter",
4822 - value: function registerUIAfter(instance) {
4823 - return this.register("ui", "after", instance);
4824 - }
4825 - },
4826 - {
4827 - key: "registerUICatch",
4828 - value: function registerUICatch(instance) {
4829 - return this.register("ui", "catch", instance);
4830 - }
4831 - },
4832 - {
4833 - key: "registerUIBefore",
4834 - value: function registerUIBefore(instance) {
4835 - return this.register("ui", "before", instance);
4836 - }
4837 - },
4838 - {
4839 - key: "runDataAfter",
4840 - value: function runDataAfter(command, args, result) {
4841 - return this.run("data", "after", command, args, result);
4842 - }
4843 - },
4844 - {
4845 - key: "runDataCatch",
4846 - value: function runDataCatch(command, args, error) {
4847 - return this.run("data", "catch", command, args, error);
4848 - }
4849 - },
4850 - {
4851 - key: "runDataDependency",
4852 - value: function runDataDependency(command, args) {
4853 - return this.run("data", "dependency", command, args);
4854 - }
4855 - },
4856 - {
4857 - key: "runUIAfter",
4858 - value: function runUIAfter(command, args, result) {
4859 - return this.run("ui", "after", command, args, result);
4860 - }
4861 - },
4862 - {
4863 - key: "runUICatch",
4864 - value: function runUICatch(command, args, e) {
4865 - return this.run("ui", "catch", command, args, e);
4866 - }
4867 - },
4868 - {
4869 - key: "runUIBefore",
4870 - value: function runUIBefore(command, args) {
4871 - return this.run("ui", "before", command, args);
4872 - }
4873 - }
4874 - ]);
4875 - }();
4375 + * @typedef {{}} RequestData
4376 + */
4377 +/**
4378 + * @typedef {import('../data')} Data
4379 + */
4380 +/**
4381 + * TODO: Search common logic, create functions to reduce code size.
4382 + */
4383 +var Cache = /*#__PURE__*/function () {
4384 + /**
4385 + * Function constructor().
4386 + *
4387 + * Create cache.
4388 + *
4389 + * @param {Data} manager
4390 + */
4391 + function Cache(manager) {
4392 + (0, _classCallCheck2.default)(this, Cache);
4393 + this.manager = manager;
4394 + this.storage = new _localStorage.default();
4395 + }
4876 4396
4877 -//#endregion
4878 -//#region modules/web-cli/assets/js/core/routes.js
4879 - function _callSuper$8(t, o, e) {
4880 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4881 - }
4882 - __name(_callSuper$8, "_callSuper");
4883 - function _isNativeReflectConstruct$8() {
4884 - try {
4885 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4886 - } catch (t) {}
4887 - return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() {
4888 - return !!t;
4889 - })();
4890 - }
4891 - __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct");
4892 - function _superPropGet(t, o, e, r) {
4893 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
4894 - return 2 & r && "function" == typeof p ? function(t) {
4895 - return p.apply(e, t);
4896 - } : p;
4897 - }
4898 - var Routes = /*#__PURE__*/ function(_Commands) {
4899 - function Routes() {
4900 - var _this;
4901 - _classCallCheck(this, Routes);
4902 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4903 - _this = _callSuper$8(this, Routes, [].concat(args));
4904 - _this.savedStates = {};
4905 - _this.historyPerComponent = {};
4906 - return _this;
4907 - }
4908 - _inherits(Routes, _Commands);
4909 - return _createClass(Routes, [
4910 - {
4911 - key: "refreshContainer",
4912 - value: function refreshContainer(container) {
4913 - var currentRoute = this.getCurrent(container);
4914 - var currentArgs = this.getCurrentArgs(container);
4915 - this.clearCurrent(container);
4916 - this.to(currentRoute, currentArgs);
4917 - }
4918 - },
4919 - {
4920 - key: "getHistory",
4921 - value: function getHistory() {
4922 - var namespaceRoot = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
4923 - if (namespaceRoot) return this.historyPerComponent[namespaceRoot] || [];
4924 - return this.historyPerComponent;
4925 - }
4926 - },
4927 - {
4928 - key: "clearHistory",
4929 - value: function clearHistory(namespaceRoot) {
4930 - delete this.historyPerComponent[namespaceRoot];
4931 - }
4932 - },
4933 - {
4934 - key: "clearCurrent",
4935 - value: function clearCurrent(container) {
4936 - var route = this.current[container];
4937 - if (!route) return;
4938 - this.detachCurrent(container);
4939 - this.getComponent(route).onCloseRoute(route);
4940 - this.dispatchOnClose(route);
4941 - }
4942 - },
4943 - {
4944 - key: "clear",
4945 - value: function clear() {
4946 - var _this2 = this;
4947 - Object.keys(this.current).forEach(function(container) {
4948 - return _this2.clearCurrent(container);
4949 - });
4950 - }
4951 - },
4952 - {
4953 - key: "saveState",
4954 - value: function saveState(container) {
4955 - this.savedStates[container] = {
4956 - route: this.current[container],
4957 - args: this.currentArgs[container]
4958 - };
4959 - return this;
4960 - }
4961 - },
4962 - {
4963 - key: "restoreState",
4964 - value: function restoreState(container) {
4965 - if (!this.savedStates[container]) return false;
4966 - this.to(this.savedStates[container].route, this.savedStates[container].args);
4967 - return true;
4968 - }
4969 - },
4970 - {
4971 - key: "validateRun",
4972 - value: function validateRun(route) {
4973 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4974 - if (!_superPropGet(Routes, "validateRun", this, 3)([route, args])) return false;
4975 - if (this.is(route, args) && !args.refresh) return false;
4976 - var component = this.getComponent(route);
4977 - if (!component.isOpen || args.reOpen) component.isOpen = component.open(args);
4978 - return component.isOpen;
4979 - }
4980 - },
4981 - {
4982 - key: "beforeRun",
4983 - value: function beforeRun(route, args) {
4984 - var container = this.getComponent(route).getServiceName();
4985 - var oldRoute = this.current[container];
4986 - if (oldRoute) this.getComponent(oldRoute).onCloseRoute(oldRoute);
4987 - Commands.trace.push(route);
4988 - _superPropGet(Routes, "beforeRun", this, 3)([
4989 - route,
4990 - args,
4991 - false
4992 - ]);
4993 - this.attachCurrent(container, route, args);
4994 - if (oldRoute) this.dispatchOnClose(oldRoute);
4995 - }
4996 - },
4997 - {
4998 - key: "to",
4999 - value: function to(route, args) {
5000 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true };
5001 - this.run(route, args);
5002 - var namespaceRoot = this.getComponent(route).getServiceName();
5003 - if (options.history) {
5004 - if (!this.historyPerComponent[namespaceRoot]) this.historyPerComponent[namespaceRoot] = [];
5005 - this.historyPerComponent[namespaceRoot].push({
5006 - route,
5007 - args
5008 - });
5009 - }
5010 - }
5011 - },
5012 - {
5013 - key: "back",
5014 - value: function back(namespaceRoot) {
5015 - var history = this.getHistory(namespaceRoot);
5016 - history.pop();
5017 - var last = history.pop();
5018 - if (!last) return;
5019 - this.to(last.route, last.args);
5020 - }
5021 - },
5022 - {
5023 - key: "runShortcut",
5024 - value: function runShortcut(command) {
5025 - this.to(command);
5026 - }
5027 - },
5028 - {
5029 - key: "afterRun",
5030 - value: function afterRun(route, args) {
5031 - var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
5032 - this.getComponent(route).onRoute(route, args);
5033 - this.dispatchOnOpen(route);
5034 - _superPropGet(Routes, "afterRun", this, 3)([
5035 - route,
5036 - args,
5037 - results,
5038 - false
5039 - ]);
5040 - Commands.trace.pop();
5041 - }
5042 - },
5043 - {
5044 - key: "is",
5045 - value: function is(route) {
5046 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5047 - if (!_superPropGet(Routes, "is", this, 3)([route])) return false;
5048 - var container = this.getComponent(route).getServiceName();
5049 - return _.isEqual(args, this.currentArgs[container]);
5050 - }
5051 - },
5052 - {
5053 - key: "isPartOf",
5054 - value: function isPartOf(route) {
5055 - /**
5056 - * Check against current command hierarchically.
5057 - * For example `is( 'panel' )` will be true for `panel/elements`
5058 - * `is( 'panel/editor' )` will be true for `panel/editor/style`
5059 - */
5060 - var container = route.split("/")[0];
5061 - var toCheck = [];
5062 - var currentParts = this.current[container] ? this.current[container].split("/") : [];
5063 - var match = false;
5064 - currentParts.forEach(function(part) {
5065 - toCheck.push(part);
5066 - if (toCheck.join("/") === route) match = true;
5067 - });
5068 - return match;
5069 - }
5070 - },
5071 - {
5072 - key: "error",
5073 - value: function error(message) {
5074 - throw Error("Routes: " + message);
5075 - }
5076 - },
5077 - {
5078 - key: "dispatchOnOpen",
5079 - value: function dispatchOnOpen(route) {
5080 - window.dispatchEvent(new CustomEvent("elementor/routes/open", { detail: { route } }));
5081 - }
5082 - },
5083 - {
5084 - key: "dispatchOnClose",
5085 - value: function dispatchOnClose(route) {
5086 - window.dispatchEvent(new CustomEvent("elementor/routes/close", { detail: { route } }));
5087 - }
5088 - }
5089 - ]);
5090 - }(Commands);
4397 + /**
4398 + * Function getAsync().
4399 + *
4400 + * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
4401 + * to fake fetch mechanism.
4402 + *
4403 + * @param {RequestData} requestData
4404 + *
4405 + * @return {(Promise|boolean)} request data
4406 + */
4407 + (0, _createClass2.default)(Cache, [{
4408 + key: "getAsync",
4409 + value: function getAsync(requestData) {
4410 + var data = this.get(requestData);
4411 + if (null !== data) {
4412 + // If data comes from cache, add 'cache = hit' to requestData.
4413 + requestData.cache = 'hit';
4414 + return new Promise(function (resolve) {
4415 + resolve(data);
4416 + });
4417 + }
5091 4418
5092 -//#endregion
5093 -//#region modules/web-cli/assets/js/utils/environment.js
5094 - var matchUserAgent = function matchUserAgent(UserAgentStr) {
5095 - return userAgent.indexOf(UserAgentStr) >= 0;
5096 - };
5097 - var userAgent = navigator.userAgent;
5098 - var isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(" OPR/");
5099 - var isFirefox = matchUserAgent("Firefox");
5100 - var isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function(p) {
5101 - return "[object SafariRemoteNotification]" === p.toString();
5102 - }(!window.safari || typeof safari !== "undefined" && safari.pushNotification);
5103 - var isIE = /Trident|MSIE/.test(userAgent) && !!document.documentMode;
5104 - var isEdge = !isIE && !!window.StyleMedia || matchUserAgent("Edg");
5105 - var isChrome = !!window.chrome && matchUserAgent("Chrome") && !(isEdge || isOpera);
5106 - var isBlink = matchUserAgent("Chrome") && !!window.CSS;
5107 - var environment = {
5108 - appleWebkit: matchUserAgent("AppleWebKit") && !isBlink,
5109 - blink: isBlink,
5110 - chrome: isChrome,
5111 - edge: isEdge,
5112 - firefox: isFirefox,
5113 - ie: isIE,
5114 - mac: matchUserAgent("Macintosh"),
5115 - opera: isOpera,
5116 - safari: isSafari,
5117 - webkit: matchUserAgent("AppleWebKit")
5118 - };
4419 + // TODO: Check if possible, always return promise and reject it.
4420 + return false;
4421 + }
5119 4422
5120 -//#endregion
5121 -//#region modules/web-cli/assets/js/core/shortcuts.js
5122 - var Shortcuts = /*#__PURE__*/ function() {
5123 - function Shortcuts($window) {
5124 - _classCallCheck(this, Shortcuts);
5125 - this.specialKeys = {
5126 - 13: "enter",
5127 - 27: "esc",
5128 - 38: "up",
5129 - 40: "down",
5130 - 46: "del",
5131 - 191: "?"
5132 - };
5133 - this.component = "";
5134 - this.handlers = {};
5135 - this.bindListener($window);
5136 - }
5137 - return _createClass(Shortcuts, [
5138 - {
5139 - key: "bindListener",
5140 - value: function bindListener($window) {
5141 - var _this = this;
5142 - $window.on("keydown", function(event) {
5143 - return _this.handle(event);
5144 - });
5145 - }
5146 - },
5147 - {
5148 - key: "getAll",
5149 - value: function getAll() {
5150 - var shortcuts = {};
5151 - jQuery.each(this.handlers, function(key, handler) {
5152 - jQuery.each(handler, function(index, config) {
5153 - shortcuts[config.command] = key;
5154 - });
5155 - });
5156 - return shortcuts;
5157 - }
5158 - },
5159 - {
5160 - key: "register",
5161 - value: function register(shortcuts, args) {
5162 - var _this2 = this;
5163 - shortcuts.replace(" ", "").split(",").forEach(function(shortcut) {
5164 - if (!_this2.handlers[shortcut]) _this2.handlers[shortcut] = [];
5165 - _this2.handlers[shortcut].push(args);
5166 - });
5167 - }
5168 - },
5169 - {
5170 - key: "unregister",
5171 - value: function unregister(shortcuts, args) {
5172 - var _this3 = this;
5173 - shortcuts.replace(" ", "").split(",").forEach(function(shortcut) {
5174 - _this3.handlers[shortcut].forEach(function(index, handler) {
5175 - if (args === handler) delete _this3.handlers[shortcut][index];
5176 - });
5177 - });
5178 - }
5179 - },
5180 - {
5181 - key: "handle",
5182 - value: function handle(event) {
5183 - var handlers = this.getHandlersByPriority(event);
5184 - if (!handlers) return;
5185 - var filteredHandlers = handlers.filter(function(handler) {
5186 - if (handler.exclude && -1 !== handler.exclude.indexOf("input")) {
5187 - var $target = jQuery(event.target);
5188 - if ($target.is(":input, .elementor-input") || $target.closest("[contenteditable=\"true\"]").length) return false;
5189 - }
5190 - if (handler.dependency && !handler.dependency(event)) return false;
5191 - if (!handler.allowAltKey && event.altKey) return false;
5192 - return true;
5193 - });
5194 - if (!filteredHandlers.length) return;
5195 - if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) Console.warn("Multiple handlers for shortcut.", filteredHandlers, event);
5196 - event.preventDefault();
5197 - filteredHandlers[0].callback(event);
5198 - }
5199 - },
5200 - {
5201 - key: "isControlEvent",
5202 - value: function isControlEvent(event) {
5203 - return event[environment.mac ? "metaKey" : "ctrlKey"];
5204 - }
5205 - },
5206 - {
5207 - key: "getEventShortcut",
5208 - value: function getEventShortcut(event) {
5209 - var shortcut = [];
5210 - if (event.altKey) shortcut.push("alt");
5211 - if (this.isControlEvent(event)) shortcut.push("ctrl");
5212 - if (event.shiftKey) shortcut.push("shift");
5213 - if (this.specialKeys[event.which]) shortcut.push(this.specialKeys[event.which]);
5214 - else shortcut.push(String.fromCharCode(event.which).toLowerCase());
5215 - return shortcut.join("+");
5216 - }
5217 - },
5218 - {
5219 - key: "isActiveScope",
5220 - value: function isActiveScope(scopes) {
5221 - var activeComponents = Object.keys($e.components.activeComponents);
5222 - var activeComponent = activeComponents[activeComponents.length - 1];
5223 - var component = $e.components.get(activeComponent);
5224 - if (!component) return false;
5225 - var namespace = component.getNamespace();
5226 - if (scopes.some(function(scope) {
5227 - return namespace === scope;
5228 - })) return true;
5229 - var namespaceRoot = component.getServiceName();
5230 - return scopes.some(function(scope) {
5231 - return namespaceRoot === scope;
5232 - });
5233 - }
5234 - },
5235 - {
5236 - key: "getHandlersByPriority",
5237 - value: function getHandlersByPriority(event) {
5238 - var _this4 = this;
5239 - var handlers = this.handlers[this.getEventShortcut(event)];
5240 - if (!handlers) return false;
5241 - var inCurrentScope = handlers.filter(function(handler) {
5242 - return handler.scopes && _this4.isActiveScope(handler.scopes);
5243 - });
5244 - if (inCurrentScope.length) return inCurrentScope;
5245 - var noScope = handlers.filter(function(handler) {
5246 - return !handler.scopes;
5247 - });
5248 - if (noScope.length) return noScope;
5249 - }
5250 - }
5251 - ]);
5252 - }();
4423 + /**
4424 + * Function set().
4425 + *
4426 + * set data to cache.
4427 + *
4428 + * The difference between set() and update() is that set, will modify the data anyway...
4429 + * when update() will only modify exist objects/values.
4430 + *
4431 + * @param {RequestData} requestData
4432 + * @param {*} data
4433 + */
4434 + }, {
4435 + key: "set",
4436 + value: function set(requestData, data) {
4437 + $e.data.validateRequestData(requestData);
4438 + var componentName = requestData.component.getNamespace(),
4439 + pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4440 + pureEndpointParts = pureEndpoint.split('/');
4441 + var newData = {};
5253 4442
5254 -//#endregion
5255 -//#region modules/web-cli/assets/js/core/store.js
5256 - function ownKeys(e, r) {
5257 - var t = Object.keys(e);
5258 - if (Object.getOwnPropertySymbols) {
5259 - var o = Object.getOwnPropertySymbols(e);
5260 - r && (o = o.filter(function(r) {
5261 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
5262 - })), t.push.apply(t, o);
5263 - }
5264 - return t;
5265 - }
5266 - function _objectSpread(e) {
5267 - for (var r = 1; r < arguments.length; r++) {
5268 - var t = null != arguments[r] ? arguments[r] : {};
5269 - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
5270 - _defineProperty(e, r, t[r]);
5271 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
5272 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
5273 - });
5274 - }
5275 - return e;
5276 - }
5277 - /**
5278 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).Slice} Slice
5279 - */
5280 - /**
5281 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).EnhancedStore} EnhancedStore
5282 - */
5283 - /**
5284 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).AnyAction} AnyAction
5285 - */
5286 - /**
5287 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).ThunkMiddlewareFor} ThunkMiddlewareFor
5288 - */
5289 - var Store = /*#__PURE__*/ function() {
5290 - /**
5291 - * Initialize the Store.
5292 - *
5293 - * @return {void}
5294 - */
5295 - function Store() {
5296 - _classCallCheck(this, Store);
5297 - /**
5298 - * @type {Object}
5299 - */
5300 - _defineProperty(this, "slices", {});
5301 - /**
5302 - * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
5303 - */
5304 - _defineProperty(this, "reduxStore", void 0);
5305 - this.slices = {};
5306 - this.reduxStore = this.createStore();
5307 - }
5308 - /**
5309 - * Create a Redux Store object.
5310 - *
5311 - * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
5312 - */
5313 - return _createClass(Store, [
5314 - {
5315 - key: "createStore",
5316 - value: function createStore() {
5317 - return (0, _reduxjs_toolkit.configureStore)({ reducer: function reducer() {} });
5318 - }
5319 - },
5320 - {
5321 - key: "injectReducer",
5322 - value: function injectReducer(id, newReducer) {
5323 - var prevReducers = this.getReducers();
5324 - this.reduxStore.replaceReducer((0, _reduxjs_toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, _defineProperty({}, id, newReducer))));
5325 - }
5326 - },
5327 - {
5328 - key: "register",
5329 - value: function register(sliceId, instance) {
5330 - if (this.slices[sliceId]) throw "Slice with ID '".concat(sliceId, "' already exists.");
5331 - this.slices[sliceId] = instance;
5332 - this.injectReducer(sliceId, instance.reducer);
5333 - }
5334 - },
5335 - {
5336 - key: "get",
5337 - value: function get(sliceId) {
5338 - return this.slices[sliceId];
5339 - }
5340 - },
5341 - {
5342 - key: "getAllSlices",
5343 - value: function getAllSlices() {
5344 - return this.slices;
5345 - }
5346 - },
5347 - {
5348 - key: "getAll",
5349 - value: function getAll() {
5350 - return Object.keys(this.slices).sort();
5351 - }
5352 - },
5353 - {
5354 - key: "getReducers",
5355 - value: function getReducers() {
5356 - return Object.entries(this.slices).reduce(function(reducers, _ref) {
5357 - var _ref2 = _slicedToArray(_ref, 2);
5358 - var key = _ref2[0];
5359 - var slice = _ref2[1];
5360 - return _objectSpread(_objectSpread({}, reducers), {}, _defineProperty({}, key, slice.reducer));
5361 - }, {});
5362 - }
5363 - },
5364 - {
5365 - key: "getReduxStore",
5366 - value: function getReduxStore() {
5367 - return this.reduxStore;
5368 - }
5369 - },
5370 - {
5371 - key: "dispatch",
5372 - value: function dispatch() {
5373 - var _this$reduxStore;
5374 - return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
5375 - }
5376 - },
5377 - {
5378 - key: "getState",
5379 - value: function getState() {
5380 - var sliceId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
5381 - var state = this.reduxStore.getState();
5382 - return sliceId ? state[sliceId] : state;
5383 - }
5384 - },
5385 - {
5386 - key: "replaceReducer",
5387 - value: function replaceReducer() {
5388 - var _this$reduxStore2;
5389 - return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
5390 - }
5391 - },
5392 - {
5393 - key: "subscribe",
5394 - value: function subscribe() {
5395 - var _this$reduxStore3;
5396 - return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
5397 - }
5398 - }
5399 - ]);
5400 - }();
4443 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'.
4444 + // Analyze reaming endpoint.
4445 + if (pureEndpointParts.length && pureEndpoint !== componentName) {
4446 + // Using reaming endpoint parts, to build new data object.
4447 + var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4448 + accumulator[pureEndpointPart] = {};
4449 + return accumulator[pureEndpointPart];
4450 + }, newData);
5401 4451
5402 -//#endregion
5403 -//#region modules/web-cli/assets/js/core/ui-states.js
4452 + // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ).
4453 + Object.assign(result, data);
4454 + } else {
4455 + newData = data;
4456 + }
4457 + var oldData = this.storage.getItem(componentName);
4458 +
4459 + // When have old data, merge it recursively with newData using jQuery.extend().
4460 + if (oldData !== null) {
4461 + newData = jQuery.extend(true, oldData, newData);
4462 + }
4463 + this.storage.setItem(componentName, newData);
4464 + }
4465 +
4466 + /**
4467 + * Function get().
4468 + *
4469 + * Get from exist storage.
4470 + *
4471 + * @param {RequestData} requestData
4472 + *
4473 + * @return {{}} data
4474 + */
4475 + }, {
4476 + key: "get",
4477 + value: function get(requestData) {
4478 + $e.data.validateRequestData(requestData);
4479 + var componentName = requestData.component.getNamespace(),
4480 + componentData = this.storage.getItem(componentName);
4481 + if (componentData !== null) {
4482 + if (componentName === requestData.endpoint) {
4483 + return componentData;
4484 + }
4485 +
4486 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'.
4487 + // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index).
4488 + var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4489 + pureEndpointParts = pureEndpoint.split('/'),
4490 + // eslint-disable-next-line array-callback-return
4491 + result = pureEndpointParts.reduce(function (accumulator, endpointPart) {
4492 + if (accumulator && accumulator[endpointPart]) {
4493 + return accumulator[endpointPart];
4494 + }
4495 + }, componentData);
4496 +
4497 + // Since $e.data.cache.receive will reject only if null is the result.
4498 + return result || null;
4499 + }
4500 + return null;
4501 + }
4502 +
4503 + /**
4504 + * Function update().
4505 + *
4506 + * Update only already exist storage, runs over all storage
4507 + *
4508 + * @param {RequestData} requestData
4509 + *
4510 + * @return {boolean} is updated
4511 + */
4512 + }, {
4513 + key: "update",
4514 + value: function update(requestData) {
4515 + $e.data.validateRequestData(requestData, true);
4516 + var endpoint = requestData.endpoint;
4517 + var response = {};
4518 +
4519 + // Simulate response from cache.
4520 + Object.entries(this.storage.getAll()).forEach(function (_ref) {
4521 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
4522 + endpointKey = _ref2[0],
4523 + /* String*/endpointValue = _ref2[1];
4524 + if (endpointValue && endpoint.includes(endpointKey)) {
4525 + // Assuming it is a specific endpoint.
4526 + var oldData = endpointValue,
4527 + pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4528 + pureEndpointParts = pureEndpoint.split('/'),
4529 + isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace();
4530 +
4531 + // Component update or specific update?
4532 + if (isComponentUpdate) {
4533 + response = jQuery.extend(true, oldData, requestData.args.data);
4534 + } else {
4535 + var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4536 + return accumulator[pureEndpointPart];
4537 + }, oldData);
4538 + response = jQuery.extend(true, oldSpecificData, requestData.args.data);
4539 + }
4540 + }
4541 + });
4542 +
4543 + // If response not found.
4544 + if (0 === Object.values(response).length) {
4545 + return false;
4546 + }
4547 +
4548 + // Update cache.
4549 + this.set(requestData, response);
4550 + return true;
4551 + }
4552 +
4553 + /**
4554 + * Function delete().
4555 + *
4556 + * Delete endpoint from storage.
4557 + *
4558 + * @param {RequestData} requestData
4559 + *
4560 + * @return {boolean} is deleted
4561 + */
4562 + }, {
4563 + key: "delete",
4564 + value: function _delete(requestData) {
4565 + $e.data.validateRequestData(requestData);
4566 + var result = false;
4567 + var componentName = requestData.component.getNamespace();
4568 + if (componentName !== requestData.endpoint) {
4569 + var oldData = this.storage.getItem(componentName),
4570 + newData = {};
4571 + if (null === oldData) {
4572 + return false;
4573 + }
4574 + var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4575 + pureEndpointParts = pureEndpoint.split('/'),
4576 + lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
4577 + pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4578 + if (pureEndpointPart === lastEndpointPart) {
4579 + // Null, means delete.
4580 + accumulator[pureEndpointPart] = null;
4581 + } else {
4582 + accumulator[pureEndpointPart] = {};
4583 + }
4584 + return accumulator[pureEndpointPart];
4585 + }, newData);
4586 + if (Object.keys(oldData).length) {
4587 + var deleteKeys = function deleteKeys(target, nullsObject) {
4588 + if (nullsObject) {
4589 + Object.keys(nullsObject).forEach(function (key) {
4590 + if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) {
4591 + deleteKeys(target[key], nullsObject[key]);
4592 + } else if (null === nullsObject[key]) {
4593 + delete target[key];
4594 + result = true;
4595 + }
4596 + });
4597 + } else {
4598 + // Means need to clear all the object.
4599 + Object.keys(target).forEach(function (key) {
4600 + return delete target[key];
4601 + });
4602 + }
4603 + return target;
4604 + };
4605 + this.storage.setItem(componentName, deleteKeys(oldData, newData));
4606 + }
4607 + } else {
4608 + for (var key in this.storage.getAll()) {
4609 + if (key === requestData.endpoint) {
4610 + this.storage.removeItem(requestData.endpoint);
4611 + result = true;
4612 + break;
4613 + }
4614 + }
4615 + }
4616 + return result;
4617 + }
4618 + }]);
4619 + return Cache;
4620 +}();
4621 +exports["default"] = Cache;
4622 +
4623 +/***/ }),
4624 +
4625 +/***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js":
4626 +/*!*******************************************************************!*\
4627 + !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***!
4628 + \*******************************************************************/
4629 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4630 +
4631 +"use strict";
4632 +
4633 +
4634 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4635 +Object.defineProperty(exports, "__esModule", ({
4636 + value: true
4637 +}));
4638 +exports["default"] = void 0;
4639 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4640 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4641 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
4642 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4643 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4644 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4645 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
4646 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4647 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4648 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
4649 +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4650 +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4651 +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); }; }
4652 +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; } }
4653 +var BaseError = /*#__PURE__*/function (_Error) {
4654 + (0, _inherits2.default)(BaseError, _Error);
4655 + var _super = _createSuper(BaseError);
4656 + /**
4657 + * Error constructor.
4658 + *
4659 + * @param {string} message
4660 + * @param {string} code
4661 + * @param {*} data
4662 + */
4663 + function BaseError() {
4664 + var _this;
4665 + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4666 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4667 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4668 + (0, _classCallCheck2.default)(this, BaseError);
4669 + _this = _super.call(this, message);
4670 + /**
4671 + * The server error code.
4672 + *
4673 + * @type {string}
4674 + */
4675 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "code", '');
4676 + /**
4677 + * Additional data about the current error.
4678 + *
4679 + * @type {*[]}
4680 + */
4681 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", []);
4682 + _this.code = code;
4683 + _this.data = data;
4684 + return _this;
4685 + }
4686 +
4687 + /**
4688 + * Notify a message when the error occurs.
4689 + */
4690 + (0, _createClass2.default)(BaseError, [{
4691 + key: "notify",
4692 + value: function notify() {
4693 + _console.default.error(_objectSpread({
4694 + message: this.message
4695 + }, this));
4696 + }
4697 + }], [{
4698 + key: "create",
4699 + value:
4700 + /**
4701 + * Static helper function to create the error.
4702 + *
4703 + * @param {string} message
4704 + * @param {string} code
4705 + * @param {*} data
4706 + * @return {BaseError} error
4707 + */
4708 + function create(message) {
4709 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4710 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4711 + return new this(message, code, data);
4712 + }
4713 +
4714 + /**
4715 + * Returns the status code of the error.
4716 + */
4717 + }, {
4718 + key: "getHTTPErrorCode",
4719 + value: function getHTTPErrorCode() {
4720 + (0, _forceMethodImplementation.default)();
4721 + }
4722 + }]);
4723 + return BaseError;
4724 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4725 +exports["default"] = BaseError;
4726 +
4727 +/***/ }),
4728 +
4729 +/***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js":
4730 +/*!**********************************************************************!*\
4731 + !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***!
4732 + \**********************************************************************/
4733 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4734 +
4735 +"use strict";
4736 +
4737 +
4738 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4739 +Object.defineProperty(exports, "__esModule", ({
4740 + value: true
4741 +}));
4742 +exports["default"] = exports.DefaultError = void 0;
4743 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4744 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4745 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4746 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4747 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4748 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4749 +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); }; }
4750 +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; } }
4751 +var DefaultError = /*#__PURE__*/function (_BaseError) {
4752 + (0, _inherits2.default)(DefaultError, _BaseError);
4753 + var _super = _createSuper(DefaultError);
4754 + function DefaultError() {
4755 + (0, _classCallCheck2.default)(this, DefaultError);
4756 + return _super.apply(this, arguments);
4757 + }
4758 + (0, _createClass2.default)(DefaultError, null, [{
4759 + key: "getHTTPErrorCode",
4760 + value: function getHTTPErrorCode() {
4761 + return 501;
4762 + }
4763 + }]);
4764 + return DefaultError;
4765 +}(_baseError.default);
4766 +exports.DefaultError = DefaultError;
4767 +var _default = DefaultError;
4768 +exports["default"] = _default;
4769 +
4770 +/***/ }),
4771 +
4772 +/***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js":
4773 +/*!******************************************************************!*\
4774 + !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***!
4775 + \******************************************************************/
4776 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4777 +
4778 +"use strict";
4779 +
4780 +
4781 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4782 +Object.defineProperty(exports, "__esModule", ({
4783 + value: true
4784 +}));
4785 +exports["default"] = exports.Error404 = void 0;
4786 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4787 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4788 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4789 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4790 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4791 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4792 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4793 +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); }; }
4794 +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; } }
4795 +var Error404 = /*#__PURE__*/function (_BaseError) {
4796 + (0, _inherits2.default)(Error404, _BaseError);
4797 + var _super = _createSuper(Error404);
4798 + function Error404() {
4799 + (0, _classCallCheck2.default)(this, Error404);
4800 + return _super.apply(this, arguments);
4801 + }
4802 + (0, _createClass2.default)(Error404, [{
4803 + key: "notify",
4804 + value: function notify() {
4805 + _console.default.warn(this.message);
4806 + }
4807 + }], [{
4808 + key: "getHTTPErrorCode",
4809 + value: function getHTTPErrorCode() {
4810 + return 404;
4811 + }
4812 + }]);
4813 + return Error404;
4814 +}(_baseError.default);
4815 +exports.Error404 = Error404;
4816 +var _default = Error404;
4817 +exports["default"] = _default;
4818 +
4819 +/***/ }),
4820 +
4821 +/***/ "../modules/web-cli/assets/js/core/data/errors/index.js":
4822 +/*!**************************************************************!*\
4823 + !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***!
4824 + \**************************************************************/
4825 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4826 +
4827 +"use strict";
4828 +
4829 +
4830 +Object.defineProperty(exports, "__esModule", ({
4831 + value: true
4832 +}));
4833 +Object.defineProperty(exports, "DefaultError", ({
4834 + enumerable: true,
4835 + get: function get() {
4836 + return _defaultError.DefaultError;
4837 + }
4838 +}));
4839 +Object.defineProperty(exports, "Error404", ({
4840 + enumerable: true,
4841 + get: function get() {
4842 + return _error.Error404;
4843 + }
4844 +}));
4845 +var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js");
4846 +var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js");
4847 +
4848 +/***/ }),
4849 +
4850 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js":
4851 +/*!******************************************************************************!*\
4852 + !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***!
4853 + \******************************************************************************/
4854 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4855 +
4856 +"use strict";
4857 +
4858 +
4859 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4860 +Object.defineProperty(exports, "__esModule", ({
4861 + value: true
4862 +}));
4863 +exports["default"] = void 0;
4864 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4865 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4866 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
4867 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4868 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4869 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4870 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4871 +var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js"));
4872 +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); }; }
4873 +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; } }
4874 +var BasePrefixStorage = /*#__PURE__*/function (_BaseStorage) {
4875 + (0, _inherits2.default)(BasePrefixStorage, _BaseStorage);
4876 + var _super = _createSuper(BasePrefixStorage);
4877 + function BasePrefixStorage() {
4878 + (0, _classCallCheck2.default)(this, BasePrefixStorage);
4879 + return _super.apply(this, arguments);
4880 + }
4881 + (0, _createClass2.default)(BasePrefixStorage, [{
4882 + key: "clear",
4883 + value: function clear() {
4884 + var _this = this;
4885 + Object.keys(this.getAll()).forEach(function (key) {
4886 + return _this.removeItem(key);
4887 + });
4888 + }
4889 + }, {
4890 + key: "getItem",
4891 + value: function getItem(key) {
4892 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "getItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4893 + }
4894 + }, {
4895 + key: "removeItem",
4896 + value: function removeItem(key) {
4897 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "removeItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4898 + }
4899 + }, {
4900 + key: "setItem",
4901 + value: function setItem(key, value) {
4902 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "setItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value);
4903 + }
4904 + }, {
4905 + key: "getAll",
4906 + value: function getAll() {
4907 + var _this2 = this;
4908 + var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX,
4909 + keys = Object.keys(this.provider),
4910 + result = {};
4911 + keys.forEach(function (key) {
4912 + if (key.startsWith(DEFAULT_KEY_PREFIX)) {
4913 + key = key.replace(DEFAULT_KEY_PREFIX, '');
4914 + result[key] = _this2.getItem(key);
4915 + }
4916 + });
4917 + return result;
4918 + }
4919 + }]);
4920 + return BasePrefixStorage;
4921 +}(_baseStorage.default);
4922 +exports["default"] = BasePrefixStorage;
4923 +(0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_');
4924 +
4925 +/***/ }),
4926 +
4927 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js":
4928 +/*!***********************************************************************!*\
4929 + !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***!
4930 + \***********************************************************************/
4931 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4932 +
4933 +"use strict";
4934 +
4935 +
4936 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4937 +Object.defineProperty(exports, "__esModule", ({
4938 + value: true
4939 +}));
4940 +exports["default"] = void 0;
4941 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4942 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5404 4943 /**
5405 - * @typedef {import('./states/ui-state-base')} UiStateBase
5406 - */
5407 - var UiStates = /*#__PURE__*/ function() {
5408 - /**
5409 - * Initialize the State Manager.
5410 - *
5411 - * @return {void}
5412 - */
5413 - function UiStates() {
5414 - _classCallCheck(this, UiStates);
5415 - this.states = {};
5416 - }
5417 - /**
5418 - * Register a new state.
5419 - *
5420 - * @param {UiStateBase} instance - State instance.
5421 - */
5422 - return _createClass(UiStates, [
5423 - {
5424 - key: "register",
5425 - value: function register(instance) {
5426 - var stateId = instance.getPrefixedId();
5427 - if (this.states[stateId]) throw "State '".concat(stateId, "' already exists.");
5428 - this.states[stateId] = instance;
5429 - }
5430 - },
5431 - {
5432 - key: "getAll",
5433 - value: function getAll() {
5434 - var states = {};
5435 - Object.entries(this.states).forEach(function(_ref) {
5436 - var _ref2 = _slicedToArray(_ref, 2);
5437 - var id = _ref2[0];
5438 - var options = _ref2[1].getOptions();
5439 - states[id] = Object.keys(options);
5440 - });
5441 - return states;
5442 - }
5443 - },
5444 - {
5445 - key: "get",
5446 - value: function get(state) {
5447 - if (state) return this.states[state];
5448 - return this.states;
5449 - }
5450 - },
5451 - {
5452 - key: "set",
5453 - value: function set(state, value) {
5454 - if (!this.get(state)) throw "State '".concat(state, "' doesn't exist.");
5455 - var oldValue = this.getCurrent(state);
5456 - var classPrefix = "e-ui-state--".concat(state.replaceAll("/", "-"));
5457 - var oldStateClass = "".concat(classPrefix, "__").concat(oldValue);
5458 - var newStateClass = "".concat(classPrefix, "__").concat(value);
5459 - var scopes = this.get(state).getScopes();
5460 - this.get(state).set(value);
5461 - scopes.forEach(function(scope) {
5462 - scope.classList.remove(oldStateClass);
5463 - if (value) scope.classList.add(newStateClass);
5464 - var event = new CustomEvent("e-ui-state:".concat(state), { detail: {
5465 - oldValue,
5466 - newValue: value
5467 - } });
5468 - scope.dispatchEvent(event);
5469 - });
5470 - }
5471 - },
5472 - {
5473 - key: "remove",
5474 - value: function remove(state) {
5475 - this.set(state, "");
5476 - }
5477 - },
5478 - {
5479 - key: "getCurrent",
5480 - value: function getCurrent(state) {
5481 - var _this$get;
5482 - return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
5483 - }
5484 - }
5485 - ]);
5486 - }();
4944 + * TODO: Merge all storage's to one.
4945 + * Using this technique give's the ability to use JSDOC from 'window.storage'.
4946 + *
4947 + * @implements {Storage}
4948 + */
4949 +var BaseStorage = /*#__PURE__*/function () {
4950 + /**
4951 + * Create storage wrapper.
4952 + *
4953 + * @param {Storage} provider
4954 + */
4955 + function BaseStorage(provider) {
4956 + (0, _classCallCheck2.default)(this, BaseStorage);
4957 + if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) {
4958 + throw new TypeError('Cannot construct BaseStorage instances directly');
4959 + }
4960 + this.provider = provider;
4961 + }
4962 + (0, _createClass2.default)(BaseStorage, [{
4963 + key: "clear",
4964 + value: function clear() {
4965 + return this.provider.clear();
4966 + }
4967 + }, {
4968 + key: "getItem",
4969 + value: function getItem(key) {
4970 + var result = this.provider.getItem(key);
4971 + if (null !== result) {
4972 + return JSON.parse(result);
4973 + }
4974 + return result;
4975 + }
4976 + }, {
4977 + key: "key",
4978 + value: function key(index) {
4979 + return this.provider.key(index);
4980 + }
4981 + }, {
4982 + key: "removeItem",
4983 + value: function removeItem(key) {
4984 + return this.provider.removeItem(key);
4985 + }
4986 + }, {
4987 + key: "setItem",
4988 + value: function setItem(key, value) {
4989 + return this.provider.setItem(key, JSON.stringify(value));
4990 + }
4991 + }, {
4992 + key: "getAll",
4993 + value: function getAll() {
4994 + var _this = this;
4995 + var keys = Object.keys(this.provider),
4996 + result = {};
4997 + keys.forEach(function (key) {
4998 + result[key] = _this.getItem(key);
4999 + });
5000 + return result;
5001 + }
5002 + }]);
5003 + return BaseStorage;
5004 +}();
5005 +exports["default"] = BaseStorage;
5487 5006
5488 -//#endregion
5489 -//#region modules/web-cli/assets/js/modules/hook-base.js
5490 - var HookBase = /*#__PURE__*/ function() {
5491 - /**
5492 - * Function constructor().
5493 - *
5494 - * Create callback base.
5495 - */
5496 - function HookBase() {
5497 - _classCallCheck(this, HookBase);
5498 - /**
5499 - * Callback type, eg ( hook, event ).
5500 - *
5501 - * @type {string}
5502 - */
5503 - _defineProperty(this, "type", void 0);
5504 - /**
5505 - * Full command address, that will hook the callback.
5506 - *
5507 - * @type {string}
5508 - */
5509 - _defineProperty(this, "command", void 0);
5510 - /**
5511 - * Unique id of the callback.
5512 - *
5513 - * @type {string}
5514 - */
5515 - _defineProperty(this, "id", void 0);
5516 - this.initialize();
5517 - this.type = this.getType();
5518 - this.command = this.getCommand();
5519 - this.id = this.getId();
5520 - }
5521 - /**
5522 - * Function initialize().
5523 - *
5524 - * Called after creation of the base, used for initialize extras.
5525 - * Without expending constructor.
5526 - */
5527 - return _createClass(HookBase, [
5528 - {
5529 - key: "initialize",
5530 - value: function initialize() {}
5531 - },
5532 - {
5533 - key: "register",
5534 - value: function register() {
5535 - force_method_implementation_default();
5536 - }
5537 - },
5538 - {
5539 - key: "getType",
5540 - value: function getType() {
5541 - force_method_implementation_default();
5542 - }
5543 - },
5544 - {
5545 - key: "getCommand",
5546 - value: function getCommand() {
5547 - force_method_implementation_default();
5548 - }
5549 - },
5550 - {
5551 - key: "getId",
5552 - value: function getId() {
5553 - force_method_implementation_default();
5554 - }
5555 - },
5556 - {
5557 - key: "getContainerType",
5558 - value: function getContainerType() {}
5559 - },
5560 - {
5561 - key: "getConditions",
5562 - value: function getConditions() {
5563 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
5564 - arguments.length > 1 && arguments[1];
5565 - return true;
5566 - }
5567 - },
5568 - {
5569 - key: "apply",
5570 - value: function apply(args) {
5571 - force_method_implementation_default();
5572 - }
5573 - },
5574 - {
5575 - key: "run",
5576 - value: function run() {
5577 - var _ref$options = (arguments.length <= 0 ? void 0 : arguments[0]).options;
5578 - var options = _ref$options === void 0 ? {} : _ref$options;
5579 - if (options.callbacks && false === options.callbacks[this.id]) return true;
5580 - if (this.getConditions.apply(this, arguments)) {
5581 - if ($e.devTools) $e.devTools.log.callbacks().active(this.type, this.command, this.id);
5582 - return this.apply.apply(this, arguments);
5583 - }
5584 - return true;
5585 - }
5586 - }
5587 - ]);
5588 - }();
5007 +/***/ }),
5589 5008
5590 -//#endregion
5591 -//#region modules/web-cli/assets/js/modules/hooks/data/base.js
5592 - function _callSuper$7(t, o, e) {
5593 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5594 - }
5595 - __name(_callSuper$7, "_callSuper");
5596 - function _isNativeReflectConstruct$7() {
5597 - try {
5598 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5599 - } catch (t) {}
5600 - return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() {
5601 - return !!t;
5602 - })();
5603 - }
5604 - __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct");
5605 - var Base$1 = /*#__PURE__*/ function(_HookBase) {
5606 - function Base() {
5607 - _classCallCheck(this, Base);
5608 - return _callSuper$7(this, Base, arguments);
5609 - }
5610 - _inherits(Base, _HookBase);
5611 - return _createClass(Base, [{
5612 - key: "getType",
5613 - value: function getType() {
5614 - return "data";
5615 - }
5616 - }]);
5617 - }(HookBase);
5009 +/***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js":
5010 +/*!************************************************************************!*\
5011 + !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***!
5012 + \************************************************************************/
5013 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5618 5014
5619 -//#endregion
5620 -//#region modules/web-cli/assets/js/modules/hooks/data/after.js
5621 - function _callSuper$6(t, o, e) {
5622 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5623 - }
5624 - __name(_callSuper$6, "_callSuper");
5625 - function _isNativeReflectConstruct$6() {
5626 - try {
5627 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5628 - } catch (t) {}
5629 - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() {
5630 - return !!t;
5631 - })();
5632 - }
5633 - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct");
5634 - var After$1 = /*#__PURE__*/ function(_Base) {
5635 - function After() {
5636 - _classCallCheck(this, After);
5637 - return _callSuper$6(this, After, arguments);
5638 - }
5639 - _inherits(After, _Base);
5640 - return _createClass(After, [{
5641 - key: "register",
5642 - value: function register() {
5643 - $e.hooks.registerDataAfter(this);
5644 - }
5645 - }]);
5646 - }(Base$1);
5015 +"use strict";
5647 5016
5648 -//#endregion
5649 -//#region modules/web-cli/assets/js/modules/hooks/data/catch.js
5650 - function _callSuper$5(t, o, e) {
5651 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5652 - }
5653 - __name(_callSuper$5, "_callSuper");
5654 - function _isNativeReflectConstruct$5() {
5655 - try {
5656 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5657 - } catch (t) {}
5658 - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() {
5659 - return !!t;
5660 - })();
5661 - }
5662 - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct");
5663 - var Catch$1 = /*#__PURE__*/ function(_Base) {
5664 - function Catch() {
5665 - _classCallCheck(this, Catch);
5666 - return _callSuper$5(this, Catch, arguments);
5667 - }
5668 - _inherits(Catch, _Base);
5669 - return _createClass(Catch, [{
5670 - key: "register",
5671 - value: function register() {
5672 - $e.hooks.registerDataCatch(this);
5673 - }
5674 - }]);
5675 - }(Base$1);
5676 5017
5677 -//#endregion
5678 -//#region modules/web-cli/assets/js/modules/hooks/data/dependency.js
5679 - function _callSuper$4(t, o, e) {
5680 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5681 - }
5682 - __name(_callSuper$4, "_callSuper");
5683 - function _isNativeReflectConstruct$4() {
5684 - try {
5685 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5686 - } catch (t) {}
5687 - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
5688 - return !!t;
5689 - })();
5690 - }
5691 - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct");
5692 - var Dependency = /*#__PURE__*/ function(_Base) {
5693 - function Dependency() {
5694 - _classCallCheck(this, Dependency);
5695 - return _callSuper$4(this, Dependency, arguments);
5696 - }
5697 - _inherits(Dependency, _Base);
5698 - return _createClass(Dependency, [{
5699 - key: "register",
5700 - value: function register() {
5701 - $e.hooks.registerDataDependency(this);
5702 - }
5703 - }]);
5704 - }(Base$1);
5018 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5019 +Object.defineProperty(exports, "__esModule", ({
5020 + value: true
5021 +}));
5022 +exports["default"] = void 0;
5023 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5024 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5025 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5026 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5027 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5028 +var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js"));
5029 +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); }; }
5030 +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; } }
5031 +var LocalStorage = /*#__PURE__*/function (_BasePrefixStorage) {
5032 + (0, _inherits2.default)(LocalStorage, _BasePrefixStorage);
5033 + var _super = _createSuper(LocalStorage);
5034 + function LocalStorage() {
5035 + (0, _classCallCheck2.default)(this, LocalStorage);
5036 + return _super.call(this, localStorage);
5037 + }
5038 + (0, _createClass2.default)(LocalStorage, [{
5039 + key: "debug",
5040 + value: function debug() {
5041 + var entries = this.getAll(),
5042 + ordered = {};
5043 + Object.keys(entries).sort().forEach(function (key) {
5044 + var value = entries[key];
5045 + ordered[key] = value;
5046 + });
5047 + return ordered;
5048 + }
5049 + }]);
5050 + return LocalStorage;
5051 +}(_basePrefixStorage.default);
5052 +exports["default"] = LocalStorage;
5705 5053
5706 -//#endregion
5707 -//#region modules/web-cli/assets/js/modules/hooks/data/index.js
5708 - var data_exports = /* @__PURE__ */ __exportAll({
5709 - After: () => After$1,
5710 - Base: () => Base$1,
5711 - Catch: () => Catch$1,
5712 - Dependency: () => Dependency
5713 - });
5054 +/***/ }),
5714 5055
5715 -//#endregion
5716 -//#region modules/web-cli/assets/js/modules/hooks/ui/base.js
5717 - function _callSuper$3(t, o, e) {
5718 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5719 - }
5720 - __name(_callSuper$3, "_callSuper");
5721 - function _isNativeReflectConstruct$3() {
5722 - try {
5723 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5724 - } catch (t) {}
5725 - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
5726 - return !!t;
5727 - })();
5728 - }
5729 - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct");
5730 - var Base = /*#__PURE__*/ function(_HookBase) {
5731 - function Base() {
5732 - _classCallCheck(this, Base);
5733 - return _callSuper$3(this, Base, arguments);
5734 - }
5735 - _inherits(Base, _HookBase);
5736 - return _createClass(Base, [{
5737 - key: "getType",
5738 - value: function getType() {
5739 - return "ui";
5740 - }
5741 - }]);
5742 - }(HookBase);
5056 +/***/ "../modules/web-cli/assets/js/core/hooks.js":
5057 +/*!**************************************************!*\
5058 + !*** ../modules/web-cli/assets/js/core/hooks.js ***!
5059 + \**************************************************/
5060 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5743 5061
5744 -//#endregion
5745 -//#region modules/web-cli/assets/js/modules/hooks/ui/after.js
5746 - function _callSuper$2(t, o, e) {
5747 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5748 - }
5749 - __name(_callSuper$2, "_callSuper");
5750 - function _isNativeReflectConstruct$2() {
5751 - try {
5752 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5753 - } catch (t) {}
5754 - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
5755 - return !!t;
5756 - })();
5757 - }
5758 - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct");
5759 - var After = /*#__PURE__*/ function(_Base) {
5760 - function After() {
5761 - _classCallCheck(this, After);
5762 - return _callSuper$2(this, After, arguments);
5763 - }
5764 - _inherits(After, _Base);
5765 - return _createClass(After, [{
5766 - key: "register",
5767 - value: function register() {
5768 - $e.hooks.registerUIAfter(this);
5769 - }
5770 - }]);
5771 - }(Base);
5062 +"use strict";
5772 5063
5773 -//#endregion
5774 -//#region modules/web-cli/assets/js/modules/hooks/ui/before.js
5775 - function _callSuper$1(t, o, e) {
5776 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5777 - }
5778 - __name(_callSuper$1, "_callSuper");
5779 - function _isNativeReflectConstruct$1() {
5780 - try {
5781 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5782 - } catch (t) {}
5783 - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
5784 - return !!t;
5785 - })();
5786 - }
5787 - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
5788 - var Before = /*#__PURE__*/ function(_Base) {
5789 - function Before() {
5790 - _classCallCheck(this, Before);
5791 - return _callSuper$1(this, Before, arguments);
5792 - }
5793 - _inherits(Before, _Base);
5794 - return _createClass(Before, [{
5795 - key: "register",
5796 - value: function register() {
5797 - $e.hooks.registerUIBefore(this);
5798 - }
5799 - }]);
5800 - }(Base);
5801 5064
5802 -//#endregion
5803 -//#region modules/web-cli/assets/js/modules/hooks/ui/catch.js
5804 - function _callSuper(t, o, e) {
5805 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5806 - }
5807 - function _isNativeReflectConstruct() {
5808 - try {
5809 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5810 - } catch (t) {}
5811 - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
5812 - return !!t;
5813 - })();
5814 - }
5815 - var Catch = /*#__PURE__*/ function(_Base) {
5816 - function Catch() {
5817 - _classCallCheck(this, Catch);
5818 - return _callSuper(this, Catch, arguments);
5819 - }
5820 - _inherits(Catch, _Base);
5821 - return _createClass(Catch, [{
5822 - key: "register",
5823 - value: function register() {
5824 - $e.hooks.registerUICatch(this);
5825 - }
5826 - }]);
5827 - }(Base);
5065 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5066 +Object.defineProperty(exports, "__esModule", ({
5067 + value: true
5068 +}));
5069 +exports["default"] = void 0;
5070 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5071 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5072 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5073 +var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js"));
5074 +var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js"));
5075 +/**
5076 + * @typedef {import('../modules/hook-base')} HookBase
5077 + */
5078 +var Hooks = /*#__PURE__*/function () {
5079 + function Hooks() {
5080 + (0, _classCallCheck2.default)(this, Hooks);
5081 + (0, _defineProperty2.default)(this, "data", new _data.default());
5082 + (0, _defineProperty2.default)(this, "ui", new _ui.default());
5083 + }
5084 + (0, _createClass2.default)(Hooks, [{
5085 + key: "activate",
5086 + value:
5087 + /**
5088 + * Function activate().
5089 + *
5090 + * Activate all hooks.
5091 + */
5092 + function activate() {
5093 + this.getTypes().forEach(function (hooksType) {
5094 + hooksType.activate();
5095 + });
5096 + }
5828 5097
5829 -//#endregion
5830 -//#region modules/web-cli/assets/js/modules/hooks/ui/index.js
5831 - var ui_exports = /* @__PURE__ */ __exportAll({
5832 - After: () => After,
5833 - Base: () => Base,
5834 - Before: () => Before,
5835 - Catch: () => Catch
5836 - });
5098 + /**
5099 + * Function deactivate().
5100 + *
5101 + * Deactivate all hooks.
5102 + */
5103 + }, {
5104 + key: "deactivate",
5105 + value: function deactivate() {
5106 + this.getTypes().forEach(function (hooksType) {
5107 + hooksType.deactivate();
5108 + });
5109 + }
5110 + }, {
5111 + key: "getAll",
5112 + value: function getAll() {
5113 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5114 + var result = {};
5115 + this.getTypes().forEach(function (hooksType) {
5116 + result[hooksType.getType()] = hooksType.getAll(flat);
5117 + });
5118 + return result;
5119 + }
5120 + }, {
5121 + key: "getTypes",
5122 + value: function getTypes() {
5123 + return [this.data, this.ui];
5124 + }
5125 + }, {
5126 + key: "getType",
5127 + value: function getType(type) {
5128 + return this.getTypes().find(function (hooks) {
5129 + return type === hooks.getType();
5130 + });
5131 + }
5837 5132
5838 -//#endregion
5839 -//#region modules/web-cli/assets/js/api.js
5840 - var API = /*#__PURE__*/ function() {
5841 - /**
5842 - * Function constructor().
5843 - *
5844 - * Create's 'elementor' api.
5845 - */
5846 - function API() {
5847 - _classCallCheck(this, API);
5848 - this.components = new _default();
5849 - this.commands = new Commands();
5850 - this.commandsInternal = new CommandsInternal();
5851 - this.hooks = new Hooks();
5852 - this.routes = new Routes();
5853 - this.shortcuts = new Shortcuts(jQuery(window));
5854 - this.data = new Data$1();
5855 - this.store = new Store();
5856 - this.uiStates = new UiStates();
5857 - this.modules = {
5858 - CommandBase,
5859 - CommandInternalBase,
5860 - CommandData,
5861 - ComponentBase,
5862 - ComponentModalBase,
5863 - HookBreak,
5864 - hookData: data_exports,
5865 - hookUI: ui_exports
5866 - };
5867 - this.extras = { hashCommands: new HashCommands() };
5868 - this.bc = new BackwardsCompatibility();
5869 - }
5870 - /**
5871 - * Function run().
5872 - *
5873 - * Alias of `$e.commands.run()`.
5874 - *
5875 - * @param {string} command
5876 - * @param {*} [args={}]
5877 - *
5878 - * @return {*} result
5879 - */
5880 - return _createClass(API, [
5881 - {
5882 - key: "run",
5883 - value: function run(command) {
5884 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5885 - return $e.commands.run(command, args);
5886 - }
5887 - },
5888 - {
5889 - key: "internal",
5890 - value: function internal(command) {
5891 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5892 - return $e.commandsInternal.run(command, args);
5893 - }
5894 - },
5895 - {
5896 - key: "route",
5897 - value: function route(_route) {
5898 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5899 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true };
5900 - return $e.routes.to(_route, args, options);
5901 - }
5902 - }
5903 - ]);
5904 - }();
5133 + /**
5134 + * Function register().
5135 + *
5136 + * Register hook.
5137 + *
5138 + * @param {string} type
5139 + * @param {string} event
5140 + * @param {HookBase} instance
5141 + *
5142 + * @return {{}} Created callback
5143 + */
5144 + }, {
5145 + key: "register",
5146 + value: function register(type, event, instance) {
5147 + return this.getType(type).register(event, instance);
5148 + }
5905 5149
5906 -//#endregion
5907 -//#region modules/web-cli/assets/js/index.js
5908 - window.$e = new API();
5150 + /**
5151 + * Function run().
5152 + *
5153 + * Run's a hook.
5154 + *
5155 + * @param {string} type
5156 + * @param {string} event
5157 + * @param {string} command
5158 + * @param {{}} args
5159 + * @param {*} result
5160 + *
5161 + * @return {boolean} result
5162 + */
5163 + }, {
5164 + key: "run",
5165 + value: function run(type, event, command, args) {
5166 + var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
5167 + return this.getType(type).run(event, command, args, result);
5168 + }
5909 5169
5910 -//#endregion
5911 -})(elementorVendors.reduxToolkit);
5170 + /**
5171 + * Function registerDataAfter().
5172 + *
5173 + * Register data hook that's run after the command.
5174 + *
5175 + * @param {HookBase} instance
5176 + *
5177 + * @return {{}} callback
5178 + */
5179 + }, {
5180 + key: "registerDataAfter",
5181 + value: function registerDataAfter(instance) {
5182 + return this.register('data', 'after', instance);
5183 + }
5184 +
5185 + /**
5186 + * Function registerDataCatch().
5187 + *
5188 + * Register data hook that's run when the command fails.
5189 + *
5190 + * @param {HookBase} instance
5191 + *
5192 + * @return {{}} callback
5193 + */
5194 + }, {
5195 + key: "registerDataCatch",
5196 + value: function registerDataCatch(instance) {
5197 + return this.register('data', 'catch', instance);
5198 + }
5199 +
5200 + /**
5201 + * Function registerDataDependency().
5202 + *
5203 + * Register data hook that's run before the command as dependency.
5204 + *
5205 + * @param {HookBase} instance
5206 + *
5207 + * @return {{}} callback
5208 + */
5209 + }, {
5210 + key: "registerDataDependency",
5211 + value: function registerDataDependency(instance) {
5212 + return this.register('data', 'dependency', instance);
5213 + }
5214 +
5215 + /**
5216 + * Function registerUIAfter().
5217 + *
5218 + * Register UI hook that's run after the commands run.
5219 + *
5220 + * @param {HookBase} instance
5221 + *
5222 + * @return {{}} callback
5223 + */
5224 + }, {
5225 + key: "registerUIAfter",
5226 + value: function registerUIAfter(instance) {
5227 + return this.register('ui', 'after', instance);
5228 + }
5229 +
5230 + /**
5231 + * Function registerUICatch().
5232 + *
5233 + * Register UI hook that's run when the command fails.
5234 + *
5235 + * @param {HookBase} instance
5236 + *
5237 + * @return {{}} callback
5238 + */
5239 + }, {
5240 + key: "registerUICatch",
5241 + value: function registerUICatch(instance) {
5242 + return this.register('ui', 'catch', instance);
5243 + }
5244 +
5245 + /**
5246 + * Function registerUIBefore().
5247 + *
5248 + * Register UI hook that's run before the command.
5249 + *
5250 + * @param {HookBase} instance
5251 + *
5252 + * @return {{}} callback
5253 + */
5254 + }, {
5255 + key: "registerUIBefore",
5256 + value: function registerUIBefore(instance) {
5257 + return this.register('ui', 'before', instance);
5258 + }
5259 +
5260 + /**
5261 + * Function runDataAfter().
5262 + *
5263 + * Run data hook that's run after the command.
5264 + *
5265 + * @param {string} command
5266 + * @param {{}} args
5267 + * @param {*} result
5268 + *
5269 + * @return {boolean} result
5270 + */
5271 + }, {
5272 + key: "runDataAfter",
5273 + value: function runDataAfter(command, args, result) {
5274 + return this.run('data', 'after', command, args, result);
5275 + }
5276 +
5277 + /**
5278 + * Function runDataCatch().
5279 + *
5280 + * Run data hook that's run when the command fails.
5281 + *
5282 + * @param {string} command
5283 + * @param {{}} args
5284 + * @param {*} error
5285 + *
5286 + * @return {boolean} result
5287 + */
5288 + }, {
5289 + key: "runDataCatch",
5290 + value: function runDataCatch(command, args, error) {
5291 + return this.run('data', 'catch', command, args, error);
5292 + }
5293 +
5294 + /**
5295 + * Function runDataDependency().
5296 + *
5297 + * Run data hook that's run before the command as dependency.
5298 + *
5299 + * @param {string} command
5300 + * @param {{}} args
5301 + *
5302 + * @return {boolean} result
5303 + */
5304 + }, {
5305 + key: "runDataDependency",
5306 + value: function runDataDependency(command, args) {
5307 + return this.run('data', 'dependency', command, args);
5308 + }
5309 +
5310 + /**
5311 + * Function runUIAfter().
5312 + *
5313 + * Run UI hook that's run after the commands run.
5314 + *
5315 + * @param {string} command
5316 + * @param {{}} args
5317 + * @param {*} result
5318 + *
5319 + * @return {boolean} result
5320 + */
5321 + }, {
5322 + key: "runUIAfter",
5323 + value: function runUIAfter(command, args, result) {
5324 + return this.run('ui', 'after', command, args, result);
5325 + }
5326 +
5327 + /**
5328 + * Function runUICatch().
5329 + *
5330 + * Run UI hook that's run when the command fails.
5331 + *
5332 + * @param {string} command
5333 + * @param {{}} args
5334 + * @param {*} e
5335 + *
5336 + * @return {boolean} result
5337 + */
5338 + }, {
5339 + key: "runUICatch",
5340 + value: function runUICatch(command, args, e) {
5341 + return this.run('ui', 'catch', command, args, e);
5342 + }
5343 +
5344 + /**
5345 + * Function runUIBefore().
5346 + *
5347 + * Run UI hook that's run before the command.
5348 + *
5349 + * @param {string} command
5350 + * @param {{}} args
5351 + *
5352 + * @return {boolean} result
5353 + */
5354 + }, {
5355 + key: "runUIBefore",
5356 + value: function runUIBefore(command, args) {
5357 + return this.run('ui', 'before', command, args);
5358 + }
5359 + }]);
5360 + return Hooks;
5361 +}();
5362 +exports["default"] = Hooks;
5363 +
5364 +/***/ }),
5365 +
5366 +/***/ "../modules/web-cli/assets/js/core/hooks/base.js":
5367 +/*!*******************************************************!*\
5368 + !*** ../modules/web-cli/assets/js/core/hooks/base.js ***!
5369 + \*******************************************************/
5370 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5371 +
5372 +"use strict";
5373 +
5374 +
5375 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5376 +Object.defineProperty(exports, "__esModule", ({
5377 + value: true
5378 +}));
5379 +exports["default"] = void 0;
5380 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5381 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5382 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5383 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5384 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5385 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
5386 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
5387 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
5388 +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); }; }
5389 +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; } }
5390 +/**
5391 + * @typedef {import('../../modules/hook-base')} HookBase
5392 + */
5393 +var HooksBase = /*#__PURE__*/function (_Module) {
5394 + (0, _inherits2.default)(HooksBase, _Module);
5395 + var _super = _createSuper(HooksBase);
5396 + /**
5397 + * Function constructor().
5398 + *
5399 + * Create hooks base.
5400 + *
5401 + * @param {{}} args
5402 + */
5403 + function HooksBase() {
5404 + var _this;
5405 + (0, _classCallCheck2.default)(this, HooksBase);
5406 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5407 + args[_key] = arguments[_key];
5408 + }
5409 + _this = _super.call.apply(_super, [this].concat(args));
5410 +
5411 + /**
5412 + * Current command.
5413 + *
5414 + * @type {string}
5415 + */
5416 + _this.current = '';
5417 +
5418 + /**
5419 + * Array of ids which in use.
5420 + *
5421 + * @type {Array}
5422 + */
5423 + _this.usedIds = [];
5424 +
5425 + /**
5426 + * Object of callbacks that was bound by container type.
5427 + *
5428 + * @type {{}}
5429 + */
5430 + _this.callbacks = {
5431 + after: {},
5432 + catch: {}
5433 + };
5434 +
5435 + /**
5436 + * Object of depth.
5437 + *
5438 + * @type {{}}
5439 + */
5440 + _this.depth = {
5441 + after: {},
5442 + catch: {}
5443 + };
5444 + _this.callbacksFlatList = {};
5445 + return _this;
5446 + }
5447 + (0, _createClass2.default)(HooksBase, [{
5448 + key: "activate",
5449 + value: function activate() {
5450 + Object.values(this.getAll(true)).forEach(function (callback) {
5451 + callback.activate();
5452 + });
5453 + }
5454 + }, {
5455 + key: "deactivate",
5456 + value: function deactivate() {
5457 + Object.values(this.getAll(true)).forEach(function (callback) {
5458 + callback.deactivate();
5459 + });
5460 + }
5461 +
5462 + // eslint-disable-next-line jsdoc/require-returns-check
5463 + /**
5464 + * Function getType().
5465 + *
5466 + * Returns type eg: ( event, hook, etc ... ).
5467 + *
5468 + * @return {string} type
5469 + */
5470 + }, {
5471 + key: "getType",
5472 + value: function getType() {
5473 + (0, _forceMethodImplementation.default)();
5474 + }
5475 + }, {
5476 + key: "get",
5477 + value: function get(id) {
5478 + return this.callbacksFlatList[id];
5479 + }
5480 +
5481 + /**
5482 + * Function getAll().
5483 + *
5484 + * Return all possible callbacks.
5485 + *
5486 + * @param {boolean} flat
5487 + *
5488 + * @return {{}} all callbacks
5489 + */
5490 + }, {
5491 + key: "getAll",
5492 + value: function getAll() {
5493 + var _this2 = this;
5494 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5495 + if (flat) {
5496 + return this.callbacksFlatList;
5497 + }
5498 + var result = {};
5499 + Object.keys(this.callbacks).forEach(function (event) {
5500 + if (!result[event]) {
5501 + result[event] = [];
5502 + }
5503 + Object.keys(_this2.callbacks[event]).forEach(function (command) {
5504 + result[event].push({
5505 + command: command,
5506 + callbacks: _this2.callbacks[event][command]
5507 + });
5508 + });
5509 + });
5510 + return result;
5511 + }
5512 +
5513 + /**
5514 + * Function getCurrent();
5515 + *
5516 + * Return current command.
5517 + *
5518 + * @return {string} current command
5519 + */
5520 + }, {
5521 + key: "getCurrent",
5522 + value: function getCurrent() {
5523 + return this.current;
5524 + }
5525 +
5526 + /**
5527 + * Function getUsedIds().
5528 + *
5529 + * Returns the current used ids.
5530 + *
5531 + * @return {Array} used IDs
5532 + */
5533 + }, {
5534 + key: "getUsedIds",
5535 + value: function getUsedIds() {
5536 + return this.usedIds;
5537 + }
5538 +
5539 + /**
5540 + * Function getCallbacks().
5541 + *
5542 + * Get available callbacks for specific event and command.
5543 + *
5544 + * @param {string} event
5545 + * @param {string} command
5546 + * @param {*} args
5547 + * @return {(Array | boolean)} callbacks
5548 + */
5549 + }, {
5550 + key: "getCallbacks",
5551 + value: function getCallbacks(event, command, args) {
5552 + var _args$containers = args.containers,
5553 + containers = _args$containers === void 0 ? [args.container] : _args$containers,
5554 + containerType = containers[0] ? containers[0].type : false;
5555 + var callbacks = [];
5556 + if (this.callbacks[event] && this.callbacks[event][command]) {
5557 + if (containerType && this.callbacks[event][command][containerType]) {
5558 + callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
5559 + }
5560 + if (this.callbacks[event][command].all) {
5561 + callbacks = callbacks.concat(this.callbacks[event][command].all);
5562 + }
5563 + }
5564 + if (callbacks.length) {
5565 + return callbacks;
5566 + }
5567 + return false;
5568 + }
5569 +
5570 + /**
5571 + * Function checkEvent().
5572 + *
5573 + * Validate if the event is available.
5574 + *
5575 + * @param {string} event
5576 + */
5577 + }, {
5578 + key: "checkEvent",
5579 + value: function checkEvent(event) {
5580 + if (-1 === Object.keys(this.callbacks).indexOf(event)) {
5581 + throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
5582 + }
5583 + }
5584 +
5585 + /**
5586 + * Function checkInstance().
5587 + *
5588 + * Validate given instance.
5589 + *
5590 + * @param {HookBase} instance
5591 + */
5592 + }, {
5593 + key: "checkInstance",
5594 + value: function checkInstance(instance) {
5595 + if (instance.getType() !== this.getType()) {
5596 + throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
5597 + }
5598 + }
5599 +
5600 + /**
5601 + * Function checkId().
5602 + *
5603 + * Validate if the id is not used before.
5604 + *
5605 + * @param {string} id
5606 + */
5607 + }, {
5608 + key: "checkId",
5609 + value: function checkId(id) {
5610 + if (-1 !== this.usedIds.indexOf(id)) {
5611 + throw Error("id: '".concat(id, "' is already in use."));
5612 + }
5613 + }
5614 +
5615 + /**
5616 + * Function shouldRun().
5617 + *
5618 + * Determine if the event should run.
5619 + *
5620 + * @param {Array} callbacks
5621 + *
5622 + * @return {boolean} true if there are callbacks, otherwise false
5623 + *
5624 + * @throws {Error}
5625 + */
5626 + }, {
5627 + key: "shouldRun",
5628 + value: function shouldRun(callbacks) {
5629 + return !!callbacks && callbacks.length;
5630 + }
5631 +
5632 + /**
5633 + * Function register().
5634 + *
5635 + * Register the callback instance.
5636 + *
5637 + * @param {string} event
5638 + * @param {HookBase} instance
5639 + *
5640 + * @return {{}} Created callback
5641 + */
5642 + }, {
5643 + key: "register",
5644 + value: function register(event, instance) {
5645 + var command = instance.getCommand(),
5646 + id = instance.getId(),
5647 + containerType = instance.getContainerType();
5648 + this.checkEvent(event);
5649 + this.checkInstance(instance);
5650 + this.checkId(id);
5651 + return this.registerCallback(id, event, command, instance, containerType);
5652 + }
5653 +
5654 + /**
5655 + * Function registerCallback().
5656 + *
5657 + * Register callback.
5658 + *
5659 + * @param {string} id
5660 + * @param {string} event
5661 + * @param {string} command
5662 + * @param {HookBase} instance
5663 + * @param {string} containerType
5664 + *
5665 + * TODO: Consider replace with typedef.
5666 + * @return {{callback: *, id: *, isActive: boolean}} callback
5667 + */
5668 + }, {
5669 + key: "registerCallback",
5670 + value: function registerCallback(id, event, command, instance, containerType) {
5671 + if (!this.callbacks[event][command]) {
5672 + this.callbacks[event][command] = [];
5673 + }
5674 +
5675 + // Save used id(s).
5676 + this.usedIds.push(id);
5677 + if (!this.callbacks[event][command]) {
5678 + this.callbacks[event][command] = {};
5679 + }
5680 +
5681 + // TODO: Create HookCallback class/type.
5682 + var callback = {
5683 + id: id,
5684 + callback: instance.run.bind(instance),
5685 + isActive: true,
5686 + activate: function activate() {
5687 + this.isActive = true;
5688 + },
5689 + deactivate: function deactivate() {
5690 + this.isActive = false;
5691 + }
5692 + };
5693 + if (containerType) {
5694 + if (!this.callbacks[event][command][containerType]) {
5695 + this.callbacks[event][command][containerType] = [];
5696 + }
5697 + this.callbacks[event][command][containerType].push(callback);
5698 + } else {
5699 + if (!this.callbacks[event][command].all) {
5700 + this.callbacks[event][command].all = [];
5701 + }
5702 + this.callbacks[event][command].all.push(callback);
5703 + }
5704 + this.callbacksFlatList[callback.id] = callback;
5705 + return callback;
5706 + }
5707 +
5708 + /**
5709 + * Function run().
5710 + *
5711 + * Run the callbacks.
5712 + *
5713 + * @param {string} event
5714 + * @param {string} command
5715 + * @param {{}} args
5716 + * @param {*} result
5717 + *
5718 + * @return {*} results
5719 + */
5720 + }, {
5721 + key: "run",
5722 + value: function run(event, command, args) {
5723 + var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
5724 + var callbacks = this.getCallbacks(event, command, args);
5725 + if (this.shouldRun(callbacks)) {
5726 + this.current = command;
5727 + this.onRun(command, args, event);
5728 + return this.runCallbacks(event, command, callbacks, args, result);
5729 + }
5730 + return false;
5731 + }
5732 +
5733 + /**
5734 + * Function runCallbacks().
5735 + *
5736 + * Run's the given callbacks.
5737 + *
5738 + * @param {string} event
5739 + * @param {string} command
5740 + * @param {Array} callbacks
5741 + * @param {{}} args
5742 + * @param {[]} result
5743 + */
5744 + }, {
5745 + key: "runCallbacks",
5746 + value: function runCallbacks(event, command, callbacks, args, result) {
5747 + var callbacksResult = [];
5748 + for (var i in callbacks) {
5749 + var callback = callbacks[i];
5750 + if (!callback.isActive) {
5751 + continue;
5752 + }
5753 +
5754 + // If not exist, set zero.
5755 + if (undefined === this.depth[event][callback.id]) {
5756 + this.depth[event][callback.id] = 0;
5757 + }
5758 + this.depth[event][callback.id]++;
5759 +
5760 + // Prevent recursive hooks.
5761 + if (1 === this.depth[event][callback.id]) {
5762 + this.onCallback(command, args, event, callback.id);
5763 + try {
5764 + var callbackResult = this.runCallback(event, callback, args, result);
5765 + if (!callbackResult) {
5766 + throw Error("Callback failed, event: '".concat(event, "'"));
5767 + }
5768 + callbacksResult.push(callbackResult);
5769 + } catch (e) {
5770 + // If its 'Hook-Break' then parent `try {}` will handle it.
5771 + if (e instanceof $e.modules.HookBreak) {
5772 + throw e;
5773 + }
5774 + _console.default.error(e);
5775 + }
5776 + }
5777 + this.depth[event][callback.id]--;
5778 + }
5779 + return callbacksResult;
5780 + }
5781 +
5782 + // eslint-disable-next-line jsdoc/require-returns-check
5783 + /**
5784 + * Function runCallback().
5785 + *
5786 + * Run's the given callback.
5787 + *
5788 + * @param {string} event
5789 + * @param {{}} callback
5790 + * @param {{}} args
5791 + * @param {*} result
5792 + *
5793 + * @return {*} results
5794 + *
5795 + * @throws {Error}
5796 + */
5797 + }, {
5798 + key: "runCallback",
5799 + value: function runCallback(event, callback, args, result) {
5800 + // eslint-disable-line no-unused-vars
5801 + (0, _forceMethodImplementation.default)();
5802 + }
5803 +
5804 + /**
5805 + * Function onRun().
5806 + *
5807 + * Called before run a set of callbacks.
5808 + *
5809 + * @param {string} command
5810 + * @param {{}} args
5811 + * @param {string} event
5812 + *
5813 + * @throws {Error}
5814 + */
5815 + }, {
5816 + key: "onRun",
5817 + value: function onRun(command, args, event) {
5818 + // eslint-disable-line no-unused-vars
5819 + (0, _forceMethodImplementation.default)();
5820 + }
5821 +
5822 + /**
5823 + * Function onCallback().
5824 + *
5825 + * Called before a single callback.
5826 + *
5827 + * @param {string} command
5828 + * @param {{}} args
5829 + * @param {string} event
5830 + * @param {string} id
5831 + *
5832 + * @throws {Error}
5833 + */
5834 + }, {
5835 + key: "onCallback",
5836 + value: function onCallback(command, args, event, id) {
5837 + // eslint-disable-line no-unused-vars
5838 + (0, _forceMethodImplementation.default)();
5839 + }
5840 + }]);
5841 + return HooksBase;
5842 +}(_module.default);
5843 +exports["default"] = HooksBase;
5844 +
5845 +/***/ }),
5846 +
5847 +/***/ "../modules/web-cli/assets/js/core/hooks/data.js":
5848 +/*!*******************************************************!*\
5849 + !*** ../modules/web-cli/assets/js/core/hooks/data.js ***!
5850 + \*******************************************************/
5851 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5852 +
5853 +"use strict";
5854 +
5855 +
5856 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5857 +Object.defineProperty(exports, "__esModule", ({
5858 + value: true
5859 +}));
5860 +exports["default"] = void 0;
5861 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5862 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5863 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
5864 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5865 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5866 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5867 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5868 +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); }; }
5869 +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; } }
5870 +var Data = /*#__PURE__*/function (_HooksBase) {
5871 + (0, _inherits2.default)(Data, _HooksBase);
5872 + var _super = _createSuper(Data);
5873 + function Data() {
5874 + var _this;
5875 + (0, _classCallCheck2.default)(this, Data);
5876 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5877 + args[_key] = arguments[_key];
5878 + }
5879 + _this = _super.call.apply(_super, [this].concat(args));
5880 + _this.callbacks.dependency = {};
5881 + _this.depth.dependency = {};
5882 + return _this;
5883 + }
5884 + (0, _createClass2.default)(Data, [{
5885 + key: "getType",
5886 + value: function getType() {
5887 + return 'data';
5888 + }
5889 + }, {
5890 + key: "runCallback",
5891 + value: function runCallback(event, callback, args, result) {
5892 + switch (event) {
5893 + case 'dependency':
5894 + {
5895 + // If callback returns false and its dependency, then 'Hook-Break'.
5896 + if (!callback.callback(args)) {
5897 + this.depth[event][callback.id]--;
5898 +
5899 + // Throw custom break to be catch by the base for 'Safe' exit.
5900 + throw new $e.modules.HookBreak();
5901 + }
5902 + return true;
5903 + }
5904 + case 'catch':
5905 + case 'after':
5906 + {
5907 + /**
5908 + * When handling HOOK which is data after (not breakable),
5909 + * even the result of the callback is negative, it is required to return positive,
5910 + * since result of runCallback determine if the callback succeeded.
5911 + */
5912 + return callback.callback(args, result) || 'after' === event;
5913 + }
5914 + }
5915 + return false;
5916 + }
5917 + }, {
5918 + key: "shouldRun",
5919 + value: function shouldRun(callbacks) {
5920 + return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "shouldRun", this).call(this, callbacks) && elementor.documents.getCurrent().history.getActive();
5921 + }
5922 + }, {
5923 + key: "onRun",
5924 + value: function onRun(command, args, event) {
5925 + if (!$e.devTools) {
5926 + return;
5927 + }
5928 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5929 + }
5930 + }, {
5931 + key: "onCallback",
5932 + value: function onCallback(command, args, event, id) {
5933 + if (!$e.devTools) {
5934 + return;
5935 + }
5936 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5937 + }
5938 + }]);
5939 + return Data;
5940 +}(_base.default);
5941 +exports["default"] = Data;
5942 +
5943 +/***/ }),
5944 +
5945 +/***/ "../modules/web-cli/assets/js/core/hooks/ui.js":
5946 +/*!*****************************************************!*\
5947 + !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***!
5948 + \*****************************************************/
5949 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5950 +
5951 +"use strict";
5952 +
5953 +
5954 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5955 +Object.defineProperty(exports, "__esModule", ({
5956 + value: true
5957 +}));
5958 +exports["default"] = void 0;
5959 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5960 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5961 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5962 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5963 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5964 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5965 +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); }; }
5966 +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; } }
5967 +var Ui = /*#__PURE__*/function (_HooksBase) {
5968 + (0, _inherits2.default)(Ui, _HooksBase);
5969 + var _super = _createSuper(Ui);
5970 + function Ui() {
5971 + var _this;
5972 + (0, _classCallCheck2.default)(this, Ui);
5973 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5974 + args[_key] = arguments[_key];
5975 + }
5976 + _this = _super.call.apply(_super, [this].concat(args));
5977 + _this.callbacks.before = {};
5978 + _this.depth.before = {};
5979 + return _this;
5980 + }
5981 + (0, _createClass2.default)(Ui, [{
5982 + key: "getType",
5983 + value: function getType() {
5984 + return 'ui';
5985 + }
5986 + }, {
5987 + key: "runCallback",
5988 + value: function runCallback(event, callback, args, result) {
5989 + switch (event) {
5990 + case 'before':
5991 + callback.callback(args);
5992 + break;
5993 + case 'catch':
5994 + case 'after':
5995 + callback.callback(args, result);
5996 + break;
5997 + default:
5998 + return false;
5999 + }
6000 + return true;
6001 + }
6002 + }, {
6003 + key: "onRun",
6004 + value: function onRun(command, args, event) {
6005 + if (!$e.devTools) {
6006 + return;
6007 + }
6008 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
6009 + }
6010 + }, {
6011 + key: "onCallback",
6012 + value: function onCallback(command, args, event, id) {
6013 + if (!$e.devTools) {
6014 + return;
6015 + }
6016 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
6017 + }
6018 + }]);
6019 + return Ui;
6020 +}(_base.default);
6021 +exports["default"] = Ui;
6022 +
6023 +/***/ }),
6024 +
6025 +/***/ "../modules/web-cli/assets/js/core/routes.js":
6026 +/*!***************************************************!*\
6027 + !*** ../modules/web-cli/assets/js/core/routes.js ***!
6028 + \***************************************************/
6029 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6030 +
6031 +"use strict";
6032 +
6033 +
6034 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6035 +Object.defineProperty(exports, "__esModule", ({
6036 + value: true
6037 +}));
6038 +exports["default"] = void 0;
6039 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6040 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6041 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
6042 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6043 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6044 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6045 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js"));
6046 +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); }; }
6047 +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; } }
6048 +var Routes = /*#__PURE__*/function (_Commands) {
6049 + (0, _inherits2.default)(Routes, _Commands);
6050 + var _super = _createSuper(Routes);
6051 + function Routes() {
6052 + var _this;
6053 + (0, _classCallCheck2.default)(this, Routes);
6054 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6055 + args[_key] = arguments[_key];
6056 + }
6057 + _this = _super.call.apply(_super, [this].concat(args));
6058 + _this.savedStates = {};
6059 + _this.historyPerComponent = {};
6060 + return _this;
6061 + }
6062 + (0, _createClass2.default)(Routes, [{
6063 + key: "refreshContainer",
6064 + value: function refreshContainer(container) {
6065 + var currentRoute = this.getCurrent(container),
6066 + currentArgs = this.getCurrentArgs(container);
6067 + this.clearCurrent(container);
6068 + this.to(currentRoute, currentArgs);
6069 + }
6070 + }, {
6071 + key: "getHistory",
6072 + value: function getHistory() {
6073 + var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
6074 + if (namespaceRoot) {
6075 + return this.historyPerComponent[namespaceRoot] || [];
6076 + }
6077 + return this.historyPerComponent;
6078 + }
6079 + }, {
6080 + key: "clearHistory",
6081 + value: function clearHistory(namespaceRoot) {
6082 + delete this.historyPerComponent[namespaceRoot];
6083 + }
6084 + }, {
6085 + key: "clearCurrent",
6086 + value: function clearCurrent(container) {
6087 + var route = this.current[container];
6088 + if (!route) {
6089 + return;
6090 + }
6091 + this.detachCurrent(container);
6092 + this.getComponent(route).onCloseRoute(route);
6093 + this.dispatchOnClose(route);
6094 + }
6095 + }, {
6096 + key: "clear",
6097 + value: function clear() {
6098 + var _this2 = this;
6099 + Object.keys(this.current).forEach(function (container) {
6100 + return _this2.clearCurrent(container);
6101 + });
6102 + }
6103 + }, {
6104 + key: "saveState",
6105 + value: function saveState(container) {
6106 + this.savedStates[container] = {
6107 + route: this.current[container],
6108 + args: this.currentArgs[container]
6109 + };
6110 + return this;
6111 + }
6112 + }, {
6113 + key: "restoreState",
6114 + value: function restoreState(container) {
6115 + if (!this.savedStates[container]) {
6116 + return false;
6117 + }
6118 + this.to(this.savedStates[container].route, this.savedStates[container].args);
6119 + return true;
6120 + }
6121 + }, {
6122 + key: "validateRun",
6123 + value: function validateRun(route) {
6124 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6125 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "validateRun", this).call(this, route, args)) {
6126 + return false;
6127 + }
6128 + if (this.is(route, args) && !args.refresh) {
6129 + return false;
6130 + }
6131 + var component = this.getComponent(route);
6132 + if (!component.isOpen || args.reOpen) {
6133 + component.isOpen = component.open(args);
6134 + }
6135 + return component.isOpen;
6136 + }
6137 +
6138 + /**
6139 + * @override
6140 + */
6141 + }, {
6142 + key: "beforeRun",
6143 + value: function beforeRun(route, args) {
6144 + var component = this.getComponent(route),
6145 + container = component.getServiceName(),
6146 + oldRoute = this.current[container];
6147 + if (oldRoute) {
6148 + this.getComponent(oldRoute).onCloseRoute(oldRoute);
6149 + }
6150 + _commands.default.trace.push(route);
6151 + (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "beforeRun", this).call(this, route, args, false);
6152 + this.attachCurrent(container, route, args);
6153 +
6154 + // In the previous condition, `$e.routes.is()` resolves the old route as active (because the actual route
6155 + // switching happens inside `this.attachCurrent()`), so we can't use it there.
6156 + if (oldRoute) {
6157 + this.dispatchOnClose(oldRoute);
6158 + }
6159 + }
6160 + }, {
6161 + key: "to",
6162 + value: function to(route, args) {
6163 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
6164 + history: true
6165 + };
6166 + this.run(route, args);
6167 + var namespaceRoot = this.getComponent(route).getServiceName();
6168 + if (options.history) {
6169 + if (!this.historyPerComponent[namespaceRoot]) {
6170 + this.historyPerComponent[namespaceRoot] = [];
6171 + }
6172 + this.historyPerComponent[namespaceRoot].push({
6173 + route: route,
6174 + args: args
6175 + });
6176 + }
6177 + }
6178 + }, {
6179 + key: "back",
6180 + value: function back(namespaceRoot) {
6181 + var history = this.getHistory(namespaceRoot);
6182 +
6183 + // Remove current;
6184 + history.pop();
6185 + var last = history.pop();
6186 + if (!last) {
6187 + return;
6188 + }
6189 + this.to(last.route, last.args);
6190 + }
6191 +
6192 + // Don't use the event object.
6193 + }, {
6194 + key: "runShortcut",
6195 + value: function runShortcut(command) {
6196 + this.to(command);
6197 + }
6198 +
6199 + // Don't clear current route.
6200 + }, {
6201 + key: "afterRun",
6202 + value: function afterRun(route, args) {
6203 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
6204 + var component = this.getComponent(route);
6205 + component.onRoute(route, args);
6206 + this.dispatchOnOpen(route);
6207 + (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "afterRun", this).call(this, route, args, results, false);
6208 + _commands.default.trace.pop();
6209 + }
6210 + }, {
6211 + key: "is",
6212 + value: function is(route) {
6213 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6214 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "is", this).call(this, route)) {
6215 + return false;
6216 + }
6217 + var container = this.getComponent(route).getServiceName();
6218 + return _.isEqual(args, this.currentArgs[container]);
6219 + }
6220 + }, {
6221 + key: "isPartOf",
6222 + value: function isPartOf(route) {
6223 + /**
6224 + * Check against current command hierarchically.
6225 + * For example `is( 'panel' )` will be true for `panel/elements`
6226 + * `is( 'panel/editor' )` will be true for `panel/editor/style`
6227 + */
6228 + var parts = route.split('/'),
6229 + container = parts[0],
6230 + toCheck = [],
6231 + currentParts = this.current[container] ? this.current[container].split('/') : [];
6232 + var match = false;
6233 + currentParts.forEach(function (part) {
6234 + toCheck.push(part);
6235 + if (toCheck.join('/') === route) {
6236 + match = true;
6237 + }
6238 + });
6239 + return match;
6240 + }
6241 + }, {
6242 + key: "error",
6243 + value: function error(message) {
6244 + throw Error('Routes: ' + message);
6245 + }
6246 + }, {
6247 + key: "dispatchOnOpen",
6248 + value: function dispatchOnOpen(route) {
6249 + window.dispatchEvent(new CustomEvent('elementor/routes/open', {
6250 + detail: {
6251 + route: route
6252 + }
6253 + }));
6254 + }
6255 + }, {
6256 + key: "dispatchOnClose",
6257 + value: function dispatchOnClose(route) {
6258 + window.dispatchEvent(new CustomEvent('elementor/routes/close', {
6259 + detail: {
6260 + route: route
6261 + }
6262 + }));
6263 + }
6264 + }]);
6265 + return Routes;
6266 +}(_commands.default);
6267 +exports["default"] = Routes;
6268 +
6269 +/***/ }),
6270 +
6271 +/***/ "../modules/web-cli/assets/js/core/shortcuts.js":
6272 +/*!******************************************************!*\
6273 + !*** ../modules/web-cli/assets/js/core/shortcuts.js ***!
6274 + \******************************************************/
6275 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6276 +
6277 +"use strict";
6278 +
6279 +
6280 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6281 +Object.defineProperty(exports, "__esModule", ({
6282 + value: true
6283 +}));
6284 +exports["default"] = void 0;
6285 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6286 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6287 +var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js"));
6288 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6289 +var Shortcuts = /*#__PURE__*/function () {
6290 + function Shortcuts($window) {
6291 + (0, _classCallCheck2.default)(this, Shortcuts);
6292 + this.specialKeys = {
6293 + 13: 'enter',
6294 + 27: 'esc',
6295 + 38: 'up',
6296 + 40: 'down',
6297 + 46: 'del',
6298 + 191: '?'
6299 + };
6300 + this.component = '';
6301 + this.handlers = {};
6302 + this.bindListener($window);
6303 + }
6304 + (0, _createClass2.default)(Shortcuts, [{
6305 + key: "bindListener",
6306 + value: function bindListener($window) {
6307 + var _this = this;
6308 + $window.on('keydown', function (event) {
6309 + return _this.handle(event);
6310 + });
6311 + }
6312 + }, {
6313 + key: "getAll",
6314 + value: function getAll() {
6315 + var shortcuts = {};
6316 + jQuery.each(this.handlers, function (key, handler) {
6317 + jQuery.each(handler, function (index, config) {
6318 + shortcuts[config.command] = key;
6319 + });
6320 + });
6321 + return shortcuts;
6322 + }
6323 +
6324 + /**
6325 + * @param {string} shortcuts
6326 + * @param {Object} args
6327 + * @param {Function} args.callback Required
6328 + * @param {string} args.component Optional
6329 + * @param {Function} args.dependency Optional
6330 + * @param {Array} args.exclude Optional
6331 + * @param {boolean} args.allowAltKey Optional
6332 + */
6333 + }, {
6334 + key: "register",
6335 + value: function register(shortcuts, args) {
6336 + var _this2 = this;
6337 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6338 + if (!_this2.handlers[shortcut]) {
6339 + _this2.handlers[shortcut] = [];
6340 + }
6341 + _this2.handlers[shortcut].push(args);
6342 + });
6343 + }
6344 + }, {
6345 + key: "unregister",
6346 + value: function unregister(shortcuts, args) {
6347 + var _this3 = this;
6348 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6349 + _this3.handlers[shortcut].forEach(function (index, handler) {
6350 + if (args === handler) {
6351 + delete _this3.handlers[shortcut][index];
6352 + }
6353 + });
6354 + });
6355 + }
6356 + }, {
6357 + key: "handle",
6358 + value: function handle(event) {
6359 + var handlers = this.getHandlersByPriority(event);
6360 + if (!handlers) {
6361 + return;
6362 + }
6363 + var filteredHandlers = handlers.filter(function (handler) {
6364 + if (handler.exclude && -1 !== handler.exclude.indexOf('input')) {
6365 + var $target = jQuery(event.target);
6366 + if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) {
6367 + return false;
6368 + }
6369 + }
6370 + if (handler.dependency && !handler.dependency(event)) {
6371 + return false;
6372 + }
6373 +
6374 + // Fix for some keyboard sources that consider alt key as ctrl key
6375 + if (!handler.allowAltKey && event.altKey) {
6376 + return false;
6377 + }
6378 + return true;
6379 + });
6380 + if (!filteredHandlers.length) {
6381 + return;
6382 + }
6383 + if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) {
6384 + _console.default.warn('Multiple handlers for shortcut.', filteredHandlers, event);
6385 + }
6386 + event.preventDefault();
6387 + filteredHandlers[0].callback(event);
6388 + }
6389 + }, {
6390 + key: "isControlEvent",
6391 + value: function isControlEvent(event) {
6392 + return event[_environment.default.mac ? 'metaKey' : 'ctrlKey'];
6393 + }
6394 + }, {
6395 + key: "getEventShortcut",
6396 + value: function getEventShortcut(event) {
6397 + var shortcut = [];
6398 + if (event.altKey) {
6399 + shortcut.push('alt');
6400 + }
6401 + if (this.isControlEvent(event)) {
6402 + shortcut.push('ctrl');
6403 + }
6404 + if (event.shiftKey) {
6405 + shortcut.push('shift');
6406 + }
6407 + if (this.specialKeys[event.which]) {
6408 + shortcut.push(this.specialKeys[event.which]);
6409 + } else {
6410 + shortcut.push(String.fromCharCode(event.which).toLowerCase());
6411 + }
6412 + return shortcut.join('+');
6413 + }
6414 + }, {
6415 + key: "isActiveScope",
6416 + value: function isActiveScope(scopes) {
6417 + var activeComponents = Object.keys($e.components.activeComponents),
6418 + activeComponent = activeComponents[activeComponents.length - 1],
6419 + component = $e.components.get(activeComponent);
6420 + if (!component) {
6421 + return false;
6422 + }
6423 + var namespace = component.getNamespace();
6424 + var filteredByNamespace = scopes.some(function (scope) {
6425 + return namespace === scope;
6426 + });
6427 + if (filteredByNamespace) {
6428 + return true;
6429 + }
6430 +
6431 + // Else filter by namespaceRoot.
6432 + var namespaceRoot = component.getServiceName();
6433 + return scopes.some(function (scope) {
6434 + return namespaceRoot === scope;
6435 + });
6436 + }
6437 + }, {
6438 + key: "getHandlersByPriority",
6439 + value: function getHandlersByPriority(event) {
6440 + var _this4 = this;
6441 + var handlers = this.handlers[this.getEventShortcut(event)];
6442 + if (!handlers) {
6443 + return false;
6444 + }
6445 +
6446 + // TODO: Prioritize current scope before roo scope.
6447 + var inCurrentScope = handlers.filter(function (handler) {
6448 + return handler.scopes && _this4.isActiveScope(handler.scopes);
6449 + });
6450 + if (inCurrentScope.length) {
6451 + return inCurrentScope;
6452 + }
6453 + var noScope = handlers.filter(function (handler) {
6454 + return !handler.scopes;
6455 + });
6456 + if (noScope.length) {
6457 + return noScope;
6458 + }
6459 + }
6460 + }]);
6461 + return Shortcuts;
6462 +}();
6463 +exports["default"] = Shortcuts;
6464 +
6465 +/***/ }),
6466 +
6467 +/***/ "../modules/web-cli/assets/js/core/store.js":
6468 +/*!**************************************************!*\
6469 + !*** ../modules/web-cli/assets/js/core/store.js ***!
6470 + \**************************************************/
6471 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6472 +
6473 +"use strict";
6474 +
6475 +
6476 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6477 +Object.defineProperty(exports, "__esModule", ({
6478 + value: true
6479 +}));
6480 +exports["default"] = void 0;
6481 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6482 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6483 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6484 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6485 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
6486 +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6487 +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6488 +/**
6489 + * @typedef {import('@reduxjs/toolkit').Slice} Slice
6490 + */
6491 +/**
6492 + * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore
6493 + */
6494 +/**
6495 + * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction
6496 + */
6497 +/**
6498 + * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor
6499 + */
6500 +var Store = /*#__PURE__*/function () {
6501 + /**
6502 + * Initialize the Store.
6503 + *
6504 + * @return {void}
6505 + */
6506 + function Store() {
6507 + (0, _classCallCheck2.default)(this, Store);
6508 + /**
6509 + * @type {Object}
6510 + */
6511 + (0, _defineProperty2.default)(this, "slices", {});
6512 + /**
6513 + * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
6514 + */
6515 + (0, _defineProperty2.default)(this, "reduxStore", void 0);
6516 + this.slices = {};
6517 + this.reduxStore = this.createStore();
6518 + }
6519 +
6520 + /**
6521 + * Create a Redux Store object.
6522 + *
6523 + * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
6524 + */
6525 + (0, _createClass2.default)(Store, [{
6526 + key: "createStore",
6527 + value: function createStore() {
6528 + return (0, _toolkit.configureStore)({
6529 + // Use an empty function instead of empty object since an empty object
6530 + // isn't a valid reducer value.
6531 + reducer: function reducer() {}
6532 + });
6533 + }
6534 +
6535 + /**
6536 + * Inject a new reducer.
6537 + *
6538 + * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function
6539 + *
6540 + * @param {string} id - Reducer unique ID.
6541 + * @param {Function} newReducer - New reducer to inject.
6542 + *
6543 + * @return {void}
6544 + */
6545 + }, {
6546 + key: "injectReducer",
6547 + value: function injectReducer(id, newReducer) {
6548 + var prevReducers = this.getReducers();
6549 + this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer))));
6550 + }
6551 +
6552 + /**
6553 + * Register a Redux Store slice.
6554 + *
6555 + * @param {string} sliceId - Slice unique ID.
6556 + * @param {Slice} instance - Slice object to add.
6557 + *
6558 + * @return {void}
6559 + */
6560 + }, {
6561 + key: "register",
6562 + value: function register(sliceId, instance) {
6563 + if (this.slices[sliceId]) {
6564 + throw "Slice with ID '".concat(sliceId, "' already exists.");
6565 + }
6566 + this.slices[sliceId] = instance;
6567 + this.injectReducer(sliceId, instance.reducer);
6568 + }
6569 +
6570 + /**
6571 + * Get a specific slice.
6572 + *
6573 + * @param {string|null} sliceId - Slice ID to get.
6574 + *
6575 + * @return {Slice} slice
6576 + */
6577 + }, {
6578 + key: "get",
6579 + value: function get(sliceId) {
6580 + return this.slices[sliceId];
6581 + }
6582 +
6583 + /**
6584 + * Get all slices.
6585 + *
6586 + * @return {Object} slices
6587 + */
6588 + }, {
6589 + key: "getAllSlices",
6590 + value: function getAllSlices() {
6591 + return this.slices;
6592 + }
6593 +
6594 + /**
6595 + * Get All slices.
6596 + *
6597 + * @return {Object} slices
6598 + */
6599 + }, {
6600 + key: "getAll",
6601 + value: function getAll() {
6602 + return Object.keys(this.slices).sort();
6603 + }
6604 +
6605 + /**
6606 + * Return the current reducers.
6607 + *
6608 + * @return {Object} reducers
6609 + */
6610 + }, {
6611 + key: "getReducers",
6612 + value: function getReducers() {
6613 + return Object.entries(this.slices).reduce(function (reducers, _ref) {
6614 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6615 + key = _ref2[0],
6616 + slice = _ref2[1];
6617 + return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer));
6618 + }, {});
6619 + }
6620 +
6621 + /**
6622 + * Get the actual Redux store object.
6623 + *
6624 + * @return {Object} redux store object
6625 + */
6626 + }, {
6627 + key: "getReduxStore",
6628 + value: function getReduxStore() {
6629 + return this.reduxStore;
6630 + }
6631 +
6632 + /**
6633 + * Proxy to Redux's `dispatch()` function.
6634 + *
6635 + * @return {*} the dispatched action
6636 + */
6637 + }, {
6638 + key: "dispatch",
6639 + value: function dispatch() {
6640 + var _this$reduxStore;
6641 + return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
6642 + }
6643 +
6644 + /**
6645 + * Proxy to Redux's `getState()` function, with the ability to get a specific slice.
6646 + *
6647 + * @param {string|null} sliceId
6648 + *
6649 + * @return {*} The current state tree of the application
6650 + */
6651 + }, {
6652 + key: "getState",
6653 + value: function getState() {
6654 + var sliceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
6655 + var state = this.reduxStore.getState();
6656 + return sliceId ? state[sliceId] : state;
6657 + }
6658 +
6659 + /**
6660 + * Proxy to Redux's `replaceReducer()` function.
6661 + * TODO: Do we want that?
6662 + *
6663 + * @return {*} undefined
6664 + */
6665 + }, {
6666 + key: "replaceReducer",
6667 + value: function replaceReducer() {
6668 + var _this$reduxStore2;
6669 + return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
6670 + }
6671 +
6672 + /**
6673 + * Proxy to Redux's `subscribe()` function.
6674 + *
6675 + * @return {*} A function that unsubscribes the change listener
6676 + */
6677 + }, {
6678 + key: "subscribe",
6679 + value: function subscribe() {
6680 + var _this$reduxStore3;
6681 + return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
6682 + }
6683 + }]);
6684 + return Store;
6685 +}();
6686 +exports["default"] = Store;
6687 +
6688 +/***/ }),
6689 +
6690 +/***/ "../modules/web-cli/assets/js/core/ui-states.js":
6691 +/*!******************************************************!*\
6692 + !*** ../modules/web-cli/assets/js/core/ui-states.js ***!
6693 + \******************************************************/
6694 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6695 +
6696 +"use strict";
6697 +
6698 +
6699 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6700 +Object.defineProperty(exports, "__esModule", ({
6701 + value: true
6702 +}));
6703 +exports["default"] = void 0;
6704 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6705 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6706 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6707 +/**
6708 + * @typedef {import('./states/ui-state-base')} UiStateBase
6709 + */
6710 +var UiStates = /*#__PURE__*/function () {
6711 + /**
6712 + * Initialize the State Manager.
6713 + *
6714 + * @return {void}
6715 + */
6716 + function UiStates() {
6717 + (0, _classCallCheck2.default)(this, UiStates);
6718 + this.states = {};
6719 + }
6720 +
6721 + /**
6722 + * Register a new state.
6723 + *
6724 + * @param {UiStateBase} instance - State instance.
6725 + */
6726 + (0, _createClass2.default)(UiStates, [{
6727 + key: "register",
6728 + value: function register(instance) {
6729 + var stateId = instance.getPrefixedId();
6730 + if (this.states[stateId]) {
6731 + throw "State '".concat(stateId, "' already exists.");
6732 + }
6733 + this.states[stateId] = instance;
6734 + }
6735 +
6736 + /**
6737 + * Get all existing states with their options:
6738 + *
6739 + * {
6740 + * 'state-id': [
6741 + * 'option-1',
6742 + * 'option-2',
6743 + * 'option-3',
6744 + * ],
6745 + * }
6746 + *
6747 + * @return {Object} all existing states
6748 + */
6749 + }, {
6750 + key: "getAll",
6751 + value: function getAll() {
6752 + var states = {};
6753 + Object.entries(this.states).forEach(function (_ref) {
6754 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6755 + id = _ref2[0],
6756 + instance = _ref2[1];
6757 + var options = instance.getOptions();
6758 + states[id] = Object.keys(options);
6759 + });
6760 + return states;
6761 + }
6762 +
6763 + /**
6764 + * Get the state value, or return all of them if no `state` is set.
6765 + *
6766 + * @param {string} state - State ID.
6767 + *
6768 + * @return {UiStateBase} state value
6769 + */
6770 + }, {
6771 + key: "get",
6772 + value: function get(state) {
6773 + if (state) {
6774 + return this.states[state];
6775 + }
6776 + return this.states;
6777 + }
6778 +
6779 + /**
6780 + * Set the current state value and trigger its callbacks & events.
6781 + * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue`
6782 + * under `e.detail`.
6783 + * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element.
6784 + *
6785 + * @param {string} state - State ID.
6786 + * @param {string} value - New state value.
6787 + *
6788 + * @return {void}
6789 + */
6790 + }, {
6791 + key: "set",
6792 + value: function set(state, value) {
6793 + // Invalid state or option.
6794 + if (!this.get(state)) {
6795 + throw "State '".concat(state, "' doesn't exist.");
6796 + }
6797 + var oldValue = this.getCurrent(state),
6798 + classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')),
6799 + oldStateClass = "".concat(classPrefix, "__").concat(oldValue),
6800 + newStateClass = "".concat(classPrefix, "__").concat(value),
6801 + scopes = this.get(state).getScopes();
6802 +
6803 + // Set the current state to the new value.
6804 + this.get(state).set(value);
6805 + scopes.forEach(function (scope) {
6806 + scope.classList.remove(oldStateClass);
6807 +
6808 + // Set the new class only if there is a value (i.e. it's not a state removal action).
6809 + if (value) {
6810 + scope.classList.add(newStateClass);
6811 + }
6812 +
6813 + // Dispatch a custom state-change event to the scope.
6814 + var event = new CustomEvent("e-ui-state:".concat(state), {
6815 + detail: {
6816 + oldValue: oldValue,
6817 + newValue: value
6818 + }
6819 + });
6820 + scope.dispatchEvent(event);
6821 + });
6822 + }
6823 +
6824 + /**
6825 + * Remove a state.
6826 + *
6827 + * @param {string} state - State ID.
6828 + *
6829 + * @return {void}
6830 + */
6831 + }, {
6832 + key: "remove",
6833 + value: function remove(state) {
6834 + this.set(state, '');
6835 + }
6836 +
6837 + /**
6838 + * Get the current state value.
6839 + *
6840 + * @param {string} state - State ID.
6841 + *
6842 + * @return {string} current state value
6843 + */
6844 + }, {
6845 + key: "getCurrent",
6846 + value: function getCurrent(state) {
6847 + var _this$get;
6848 + return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
6849 + }
6850 + }]);
6851 + return UiStates;
6852 +}();
6853 +exports["default"] = UiStates;
6854 +
6855 +/***/ }),
6856 +
6857 +/***/ "../modules/web-cli/assets/js/extras/hash-commands.js":
6858 +/*!************************************************************!*\
6859 + !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***!
6860 + \************************************************************/
6861 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6862 +
6863 +"use strict";
6864 +
6865 +
6866 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6867 +Object.defineProperty(exports, "__esModule", ({
6868 + value: true
6869 +}));
6870 +exports["default"] = void 0;
6871 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
6872 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
6873 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6874 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6875 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6876 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6877 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6878 +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6879 +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6880 +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6881 +var HashCommands = /*#__PURE__*/function () {
6882 + function HashCommands() {
6883 + (0, _classCallCheck2.default)(this, HashCommands);
6884 + /**
6885 + * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
6886 + */
6887 + (0, _defineProperty2.default)(this, "dispatchersList", {
6888 + 'e:run': {
6889 + runner: function runner() {
6890 + return $e.run;
6891 + },
6892 + isSafe: function isSafe(command) {
6893 + var _$e$commands$getComma;
6894 + return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
6895 + },
6896 + isSafeWithArgs: function isSafeWithArgs(command) {
6897 + var _$e$commands$getComma2;
6898 + return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
6899 + }
6900 + },
6901 + 'e:route': {
6902 + runner: function runner() {
6903 + return $e.route;
6904 + },
6905 + isSafe: function isSafe() {
6906 + return true;
6907 + },
6908 + isSafeWithArgs: function isSafeWithArgs() {
6909 + return false;
6910 + }
6911 + }
6912 + });
6913 + /**
6914 + * @typedef HashCommand
6915 + * @property {string} method method
6916 + * @property {string} command command
6917 + * @property {Object} args arguments
6918 + */
6919 + /**
6920 + * List of current loaded hash commands.
6921 + *
6922 + * @type {Array.<HashCommand>}
6923 + */
6924 + (0, _defineProperty2.default)(this, "commands", []);
6925 + this.commands = this.get();
6926 + }
6927 +
6928 + /**
6929 + * Function get().
6930 + *
6931 + * Get API requests that comes from hash ( eg #e:run ).
6932 + *
6933 + * @param {string} hash
6934 + *
6935 + * @return {Array.<HashCommand>} API requests
6936 + */
6937 + (0, _createClass2.default)(HashCommands, [{
6938 + key: "get",
6939 + value: function get() {
6940 + var _this = this;
6941 + var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash;
6942 + var result = [];
6943 + if (hash) {
6944 + // Remove first '#' and split each '&'.
6945 + var hashList = hash.substr(1).split('&');
6946 + hashList.forEach(function (hashItem) {
6947 + // eslint-disable-next-line @wordpress/no-unused-vars-before-return
6948 + var _hashItem$split = hashItem.split('?'),
6949 + _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2),
6950 + rawCommand = _hashItem$split2[0],
6951 + rawArgs = _hashItem$split2[1];
6952 + var hashParts = rawCommand.split(':');
6953 + if (3 !== hashParts.length) {
6954 + return;
6955 + }
6956 + var method = hashParts[0] + ':' + hashParts[1],
6957 + dispatcher = _this.dispatchersList[method];
6958 + if (dispatcher) {
6959 + var command = hashParts[2],
6960 + args = _this.parseCommandArgs(rawArgs);
6961 + result.push({
6962 + method: method,
6963 + command: command,
6964 + args: args
6965 + });
6966 + }
6967 + });
6968 + }
6969 + return result;
6970 + }
6971 +
6972 + /**
6973 + * Function run().
6974 + *
6975 + * Run API requests that comes from hash ( eg #e:run ).
6976 + *
6977 + * @param {Array.<HashCommand>} [commands=this.commands]
6978 + */
6979 + }, {
6980 + key: "run",
6981 + value: function () {
6982 + var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
6983 + var commands,
6984 + _iterator,
6985 + _step,
6986 + hashCommand,
6987 + dispatcher,
6988 + _iterator2,
6989 + _step2,
6990 + _hashCommand,
6991 + _dispatcher,
6992 + _args = arguments;
6993 + return _regenerator.default.wrap(function _callee$(_context) {
6994 + while (1) switch (_context.prev = _context.next) {
6995 + case 0:
6996 + commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands;
6997 + // To allow validate the run first.
6998 + _iterator = _createForOfIteratorHelper(commands);
6999 + _context.prev = 2;
7000 + _iterator.s();
7001 + case 4:
7002 + if ((_step = _iterator.n()).done) {
7003 + _context.next = 13;
7004 + break;
7005 + }
7006 + hashCommand = _step.value;
7007 + dispatcher = this.dispatchersList[hashCommand.method];
7008 + if (dispatcher) {
7009 + _context.next = 9;
7010 + break;
7011 + }
7012 + return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
7013 + case 9:
7014 + if (dispatcher.isSafe(hashCommand.command)) {
7015 + _context.next = 11;
7016 + break;
7017 + }
7018 + return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
7019 + case 11:
7020 + _context.next = 4;
7021 + break;
7022 + case 13:
7023 + _context.next = 18;
7024 + break;
7025 + case 15:
7026 + _context.prev = 15;
7027 + _context.t0 = _context["catch"](2);
7028 + _iterator.e(_context.t0);
7029 + case 18:
7030 + _context.prev = 18;
7031 + _iterator.f();
7032 + return _context.finish(18);
7033 + case 21:
7034 + // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again).
7035 + _iterator2 = _createForOfIteratorHelper(commands);
7036 + _context.prev = 22;
7037 + _iterator2.s();
7038 + case 24:
7039 + if ((_step2 = _iterator2.n()).done) {
7040 + _context.next = 31;
7041 + break;
7042 + }
7043 + _hashCommand = _step2.value;
7044 + _dispatcher = this.dispatchersList[_hashCommand.method];
7045 + _context.next = 29;
7046 + return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined);
7047 + case 29:
7048 + _context.next = 24;
7049 + break;
7050 + case 31:
7051 + _context.next = 36;
7052 + break;
7053 + case 33:
7054 + _context.prev = 33;
7055 + _context.t1 = _context["catch"](22);
7056 + _iterator2.e(_context.t1);
7057 + case 36:
7058 + _context.prev = 36;
7059 + _iterator2.f();
7060 + return _context.finish(36);
7061 + case 39:
7062 + case "end":
7063 + return _context.stop();
7064 + }
7065 + }, _callee, this, [[2, 15, 18, 21], [22, 33, 36, 39]]);
7066 + }));
7067 + function run() {
7068 + return _run.apply(this, arguments);
7069 + }
7070 + return run;
7071 + }()
7072 + /**
7073 + * Function runOnce().
7074 + *
7075 + * Do same as `run` but clear `this.commands` before leaving.
7076 + */
7077 + }, {
7078 + key: "runOnce",
7079 + value: function runOnce() {
7080 + var _this2 = this;
7081 + this.run(this.commands).then(function () {
7082 + _this2.commands = [];
7083 + });
7084 + }
7085 +
7086 + /**
7087 + * Takes a args in form of JSON and parse it.
7088 + *
7089 + * @param {string} rawArgs
7090 + * @return {Object} args in as an object
7091 + */
7092 + }, {
7093 + key: "parseCommandArgs",
7094 + value: function parseCommandArgs(rawArgs) {
7095 + try {
7096 + return JSON.parse(decodeURI(rawArgs || '{}'));
7097 + } catch (e) {
7098 + _console.default.warn('Hash commands JSON args cannot be parsed. \n\n', e);
7099 + return {};
7100 + }
7101 + }
7102 + }]);
7103 + return HashCommands;
7104 +}();
7105 +exports["default"] = HashCommands;
7106 +
7107 +/***/ }),
7108 +
7109 +/***/ "../modules/web-cli/assets/js/modules/command-base.js":
7110 +/*!************************************************************!*\
7111 + !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
7112 + \************************************************************/
7113 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7114 +
7115 +"use strict";
7116 +
7117 +
7118 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7119 +Object.defineProperty(exports, "__esModule", ({
7120 + value: true
7121 +}));
7122 +exports["default"] = void 0;
7123 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7124 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7125 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7126 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7127 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7128 +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
7129 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7130 +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); }; }
7131 +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; } }
7132 +/**
7133 + * @name $e.modules.CommandBase
7134 + */
7135 +var CommandBase = /*#__PURE__*/function (_CommandInfra) {
7136 + (0, _inherits2.default)(CommandBase, _CommandInfra);
7137 + var _super = _createSuper(CommandBase);
7138 + function CommandBase() {
7139 + (0, _classCallCheck2.default)(this, CommandBase);
7140 + return _super.apply(this, arguments);
7141 + }
7142 + (0, _createClass2.default)(CommandBase, [{
7143 + key: "onBeforeRun",
7144 + value: function onBeforeRun() {
7145 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7146 + $e.hooks.runUIBefore(this.command, args);
7147 + }
7148 + }, {
7149 + key: "onAfterRun",
7150 + value: function onAfterRun() {
7151 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7152 + var result = arguments.length > 1 ? arguments[1] : undefined;
7153 + $e.hooks.runUIAfter(this.command, args, result);
7154 + }
7155 + }, {
7156 + key: "onBeforeApply",
7157 + value: function onBeforeApply() {
7158 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7159 + $e.hooks.runDataDependency(this.command, args);
7160 + }
7161 + }, {
7162 + key: "onAfterApply",
7163 + value: function onAfterApply() {
7164 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7165 + var result = arguments.length > 1 ? arguments[1] : undefined;
7166 + $e.hooks.runDataAfter(this.command, args, result);
7167 + }
7168 + }, {
7169 + key: "onCatchApply",
7170 + value: function onCatchApply(e) {
7171 + this.runCatchHooks(e);
7172 + }
7173 +
7174 + /**
7175 + * Run all the catch hooks.
7176 + *
7177 + * @param {Error} e
7178 + */
7179 + }, {
7180 + key: "runCatchHooks",
7181 + value: function runCatchHooks(e) {
7182 + $e.hooks.runDataCatch(this.command, this.args, e);
7183 + $e.hooks.runUICatch(this.command, this.args, e);
7184 + }
7185 +
7186 + /**
7187 + * TODO - Remove - Backwards compatibility.
7188 + *
7189 + * Function requireContainer().
7190 + *
7191 + * Validate `arg.container` & `arg.containers`.
7192 + *
7193 + * @param {{}} args
7194 + * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead.
7195 + *
7196 + * @throws {Error}
7197 + */
7198 + }, {
7199 + key: "requireContainer",
7200 + value: function requireContainer() {
7201 + var _this = this;
7202 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
7203 + _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
7204 + if (!args.container && !args.containers) {
7205 + throw Error('container or containers are required.');
7206 + }
7207 + if (args.container && args.containers) {
7208 + throw Error('container and containers cannot go together please select one of them.');
7209 + }
7210 + var containers = args.containers || [args.container];
7211 + containers.forEach(function (container) {
7212 + _this.requireArgumentInstance('container', elementorModules.editor.Container, {
7213 + container: container
7214 + });
7215 + });
7216 + }
7217 + }], [{
7218 + key: "getInstanceType",
7219 + value: function getInstanceType() {
7220 + return 'CommandBase';
7221 + }
7222 + }]);
7223 + return CommandBase;
7224 +}(_commandInfra.default);
7225 +exports["default"] = CommandBase;
7226 +
7227 +/***/ }),
7228 +
7229 +/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
7230 +/*!*********************************************************************!*\
7231 + !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
7232 + \*********************************************************************/
7233 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7234 +
7235 +"use strict";
7236 +
7237 +
7238 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7239 +Object.defineProperty(exports, "__esModule", ({
7240 + value: true
7241 +}));
7242 +exports["default"] = void 0;
7243 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7244 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7245 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7246 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7247 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7248 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7249 +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); }; }
7250 +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; } }
7251 +/**
7252 + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
7253 + */
7254 +var CommandCallbackBase = /*#__PURE__*/function (_CommandBase) {
7255 + (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
7256 + var _super = _createSuper(CommandCallbackBase);
7257 + function CommandCallbackBase() {
7258 + (0, _classCallCheck2.default)(this, CommandCallbackBase);
7259 + return _super.apply(this, arguments);
7260 + }
7261 + (0, _createClass2.default)(CommandCallbackBase, [{
7262 + key: "apply",
7263 + value: function apply() {
7264 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7265 + return this.constructor.getCallback()(args);
7266 + }
7267 + }], [{
7268 + key: "getInstanceType",
7269 + value: function getInstanceType() {
7270 + return 'CommandCallbackBase';
7271 + }
7272 +
7273 + /**
7274 + * Get original callback of the command.
7275 + *
7276 + * Support pure callbacks ( Non command-base ).
7277 + *
7278 + * @return {()=>{}} Command Results.
7279 + */
7280 + }, {
7281 + key: "getCallback",
7282 + value: function getCallback() {
7283 + return this.registerConfig.callback;
7284 + }
7285 + }]);
7286 + return CommandCallbackBase;
7287 +}(_commandBase.default);
7288 +exports["default"] = CommandCallbackBase;
7289 +
7290 +/***/ }),
7291 +
7292 +/***/ "../modules/web-cli/assets/js/modules/command-data.js":
7293 +/*!************************************************************!*\
7294 + !*** ../modules/web-cli/assets/js/modules/command-data.js ***!
7295 + \************************************************************/
7296 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7297 +
7298 +"use strict";
7299 +
7300 +
7301 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7302 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
7303 +Object.defineProperty(exports, "__esModule", ({
7304 + value: true
7305 +}));
7306 +exports["default"] = void 0;
7307 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7308 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7309 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
7310 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7311 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7312 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7313 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7314 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7315 +var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js"));
7316 +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
7317 +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
7318 +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); }; }
7319 +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; } }
7320 +/**
7321 + * @name $e.modules.CommandData
7322 + */
7323 +/**
7324 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
7325 + */
7326 +/**
7327 + * @typedef {{}} RequestData
7328 + */
7329 +/**
7330 + * @typedef {import('../core/data/errors/base-error')} BaseError
7331 + */
7332 +var CommandData = /*#__PURE__*/function (_CommandBase) {
7333 + (0, _inherits2.default)(CommandData, _CommandBase);
7334 + var _super = _createSuper(CommandData);
7335 + function CommandData(args) {
7336 + var _this$args$options;
7337 + var _this;
7338 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data;
7339 + (0, _classCallCheck2.default)(this, CommandData);
7340 + _this = _super.call(this, args, commandsAPI);
7341 + /**
7342 + * Data returned from remote.
7343 + *
7344 + * @type {*}
7345 + */
7346 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", void 0);
7347 + /**
7348 + * Fetch type.
7349 + *
7350 + * @type {DataTypes}
7351 + */
7352 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0);
7353 + if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) {
7354 + _this.type = _this.args.options.type;
7355 + }
7356 + return _this;
7357 + }
7358 +
7359 + /**
7360 + * Function getEndpointFormat().
7361 + *
7362 + * @return {null|string} endpoint format
7363 + */
7364 + (0, _createClass2.default)(CommandData, [{
7365 + key: "getApplyMethods",
7366 + value:
7367 + /**
7368 + * @param {DataTypes} type
7369 + *
7370 + * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods
7371 + */
7372 + function getApplyMethods() {
7373 + var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type;
7374 + var before, after;
7375 + switch (type) {
7376 + case 'create':
7377 + before = this.applyBeforeCreate;
7378 + after = this.applyAfterCreate;
7379 + break;
7380 + case 'delete':
7381 + before = this.applyBeforeDelete;
7382 + after = this.applyAfterDelete;
7383 + break;
7384 + case 'get':
7385 + before = this.applyBeforeGet;
7386 + after = this.applyAfterGet;
7387 + break;
7388 + case 'update':
7389 + before = this.applyBeforeUpdate;
7390 + after = this.applyAfterUpdate;
7391 + break;
7392 + case 'options':
7393 + before = this.applyBeforeOptions;
7394 + after = this.applyAfterOptions;
7395 + break;
7396 + default:
7397 + return false;
7398 + }
7399 + return {
7400 + before: before.bind(this),
7401 + after: after.bind(this)
7402 + };
7403 + }
7404 +
7405 + /**
7406 + * Function getRequestData().
7407 + *
7408 + * @return {RequestData} request data
7409 + */
7410 + }, {
7411 + key: "getRequestData",
7412 + value: function getRequestData() {
7413 + return {
7414 + type: this.type,
7415 + args: this.args,
7416 + timestamp: new Date().getTime(),
7417 + component: this.component,
7418 + command: this.command,
7419 + endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
7420 + };
7421 + }
7422 + }, {
7423 + key: "apply",
7424 + value: function apply() {
7425 + var _this2 = this;
7426 + var applyMethods = this.getApplyMethods();
7427 +
7428 + // Run 'before' method.
7429 + this.args = applyMethods.before(this.args);
7430 + var requestData = this.getRequestData();
7431 + return $e.data.fetch(requestData).then(function (data) {
7432 + _this2.data = data;
7433 +
7434 + // Run 'after' method.
7435 + _this2.data = applyMethods.after(data, _this2.args);
7436 + _this2.data = {
7437 + data: _this2.data
7438 + };
7439 +
7440 + // Append requestData.
7441 + _this2.data = Object.assign({
7442 + __requestData__: requestData
7443 + }, _this2.data);
7444 + return _this2.data;
7445 + });
7446 + }
7447 +
7448 + /**
7449 + * @param {*} [args={}]
7450 + * @return {{}} filtered args
7451 + */
7452 + }, {
7453 + key: "applyBeforeCreate",
7454 + value: function applyBeforeCreate() {
7455 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7456 + return args;
7457 + }
7458 +
7459 + /**
7460 + * @param {{}} data
7461 + * @param {*} [args={}]
7462 + * @return {{}} filtered result
7463 + */
7464 + }, {
7465 + key: "applyAfterCreate",
7466 + value: function applyAfterCreate(data) {
7467 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7468 + // eslint-disable-line no-unused-vars
7469 + return data;
7470 + }
7471 +
7472 + /**
7473 + * @param {*} [args={}]
7474 + * @return {{}} filtered args
7475 + */
7476 + }, {
7477 + key: "applyBeforeDelete",
7478 + value: function applyBeforeDelete() {
7479 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7480 + return args;
7481 + }
7482 +
7483 + /**
7484 + * @param {{}} data
7485 + * @param {*} [args={}]
7486 + * @return {{}} filtered result
7487 + */
7488 + }, {
7489 + key: "applyAfterDelete",
7490 + value: function applyAfterDelete(data) {
7491 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7492 + // eslint-disable-line no-unused-vars
7493 + return data;
7494 + }
7495 +
7496 + /**
7497 + * @param {*} [args={}]
7498 + * @return {{}} filtered args
7499 + */
7500 + }, {
7501 + key: "applyBeforeGet",
7502 + value: function applyBeforeGet() {
7503 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7504 + return args;
7505 + }
7506 +
7507 + /**
7508 + * @param {{}} data
7509 + * @param {*} [args={}]
7510 + * @return {{}} filtered result
7511 + */
7512 + }, {
7513 + key: "applyAfterGet",
7514 + value: function applyAfterGet(data) {
7515 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7516 + // eslint-disable-line no-unused-vars
7517 + return data;
7518 + }
7519 +
7520 + /**
7521 + * @param {*} [args={}]
7522 + * @return {{}} filtered args
7523 + */
7524 + }, {
7525 + key: "applyBeforeUpdate",
7526 + value: function applyBeforeUpdate() {
7527 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7528 + return args;
7529 + }
7530 +
7531 + /**
7532 + * @param {{}} data
7533 + * @param {*} [args={}]
7534 + * @return {{}} filtered result
7535 + */
7536 + }, {
7537 + key: "applyAfterUpdate",
7538 + value: function applyAfterUpdate(data) {
7539 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7540 + // eslint-disable-line no-unused-vars
7541 + return data;
7542 + }
7543 +
7544 + /**
7545 + * @param {*} [args={}]
7546 + * @return {{}} filtered args
7547 + */
7548 + }, {
7549 + key: "applyBeforeOptions",
7550 + value: function applyBeforeOptions() {
7551 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7552 + return args;
7553 + }
7554 +
7555 + /**
7556 + * @param {{}} data
7557 + * @param {*} [args={}]
7558 + * @return {{}} filtered result
7559 + */
7560 + }, {
7561 + key: "applyAfterOptions",
7562 + value: function applyAfterOptions(data) {
7563 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7564 + // eslint-disable-line no-unused-vars
7565 + return data;
7566 + }
7567 +
7568 + /**
7569 + * @param {BaseError} e
7570 + */
7571 + }, {
7572 + key: "applyAfterCatch",
7573 + value: function applyAfterCatch(e) {
7574 + e.notify();
7575 + }
7576 + }, {
7577 + key: "onCatchApply",
7578 + value: function onCatchApply(e) {
7579 + var _e, _e$data;
7580 + // TODO: If the errors that returns from the server is consistent remove the '?' from 'e'
7581 + var httpErrorCode = ((_e = e) === null || _e === void 0 ? void 0 : (_e$data = _e.data) === null || _e$data === void 0 ? void 0 : _e$data.status) || 501;
7582 + var dataError = Object.values(errors).find(function (error) {
7583 + return error.getHTTPErrorCode() === httpErrorCode;
7584 + });
7585 + if (!dataError) {
7586 + dataError = errors.DefaultError;
7587 + }
7588 + e = dataError.create(e.message, e.code, e.data || []);
7589 + this.runCatchHooks(e);
7590 + this.applyAfterCatch(e);
7591 + }
7592 + }], [{
7593 + key: "getInstanceType",
7594 + value: function getInstanceType() {
7595 + return 'CommandData';
7596 + }
7597 + }, {
7598 + key: "getEndpointFormat",
7599 + value: function getEndpointFormat() {
7600 + return null;
7601 + }
7602 + }]);
7603 + return CommandData;
7604 +}(_commandBase.default);
7605 +exports["default"] = CommandData;
7606 +
7607 +/***/ }),
7608 +
7609 +/***/ "../modules/web-cli/assets/js/modules/command-infra.js":
7610 +/*!*************************************************************!*\
7611 + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
7612 + \*************************************************************/
7613 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7614 +
7615 +"use strict";
7616 +
7617 +
7618 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7619 +Object.defineProperty(exports, "__esModule", ({
7620 + value: true
7621 +}));
7622 +exports["default"] = void 0;
7623 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7624 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7625 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7626 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7627 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7628 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7629 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
7630 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7631 +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); }; }
7632 +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; } }
7633 +/**
7634 + * @typedef {import('../modules/component-base')} ComponentBase
7635 + */
7636 +var CommandInfra = /*#__PURE__*/function (_ArgsObject) {
7637 + (0, _inherits2.default)(CommandInfra, _ArgsObject);
7638 + var _super = _createSuper(CommandInfra);
7639 + /**
7640 + * Function constructor().
7641 + *
7642 + * Create Commands Base.
7643 + *
7644 + * @param {{}} args
7645 + */
7646 + function CommandInfra() {
7647 + var _this;
7648 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7649 + (0, _classCallCheck2.default)(this, CommandInfra);
7650 + _this = _super.call(this, args);
7651 + if (!_this.constructor.registerConfig) {
7652 + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
7653 + }
7654 +
7655 + // Acknowledge self about which command it run.
7656 + _this.command = _this.constructor.getCommand();
7657 +
7658 + // Assign instance of current component.
7659 + _this.component = _this.constructor.getComponent();
7660 +
7661 + // Who ever need do something before without `super` the constructor can use `initialize` method.
7662 + _this.initialize(args);
7663 +
7664 + // Refresh args, maybe the changed via `initialize`.
7665 + args = _this.args;
7666 +
7667 + // Validate args before run.
7668 + _this.validateArgs(args);
7669 + return _this;
7670 + }
7671 +
7672 + /**
7673 + * Function initialize().
7674 + *
7675 + * Initialize command, called after construction.
7676 + *
7677 + * @param {{}} args
7678 + */
7679 + (0, _createClass2.default)(CommandInfra, [{
7680 + key: "currentCommand",
7681 + get:
7682 + /**
7683 + * @deprecated since 3.7.0, use `this.command` instead.
7684 + */
7685 + function get() {
7686 + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
7687 + return this.command;
7688 + }
7689 + }, {
7690 + key: "initialize",
7691 + value: function initialize() {
7692 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7693 + } // eslint-disable-line no-unused-vars
7694 +
7695 + /**
7696 + * Function validateArgs().
7697 + *
7698 + * Validate command arguments.
7699 + *
7700 + * @param {{}} args
7701 + */
7702 + }, {
7703 + key: "validateArgs",
7704 + value: function validateArgs() {
7705 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7706 + } // eslint-disable-line no-unused-vars
7707 +
7708 + // eslint-disable-next-line jsdoc/require-returns-check
7709 + /**
7710 + * Function apply().
7711 + *
7712 + * Do the actual command.
7713 + *
7714 + * @param {{}} args
7715 + *
7716 + * @return {*} Command results.
7717 + */
7718 + }, {
7719 + key: "apply",
7720 + value: function apply() {
7721 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7722 + // eslint-disable-line no-unused-vars
7723 + elementorModules.ForceMethodImplementation();
7724 + }
7725 +
7726 + /**
7727 + * Function run().
7728 + *
7729 + * Run command with history & hooks.
7730 + *
7731 + * @return {*} Command results.
7732 + */
7733 + }, {
7734 + key: "run",
7735 + value: function run() {
7736 + return this.apply(this.args);
7737 + }
7738 +
7739 + /**
7740 + * Function onBeforeRun.
7741 + *
7742 + * Called before run().
7743 + *
7744 + * @param {{}} args
7745 + */
7746 + }, {
7747 + key: "onBeforeRun",
7748 + value: function onBeforeRun() {
7749 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7750 + } // eslint-disable-line no-unused-vars
7751 +
7752 + /**
7753 + * Function onAfterRun.
7754 + *
7755 + * Called after run().
7756 + *
7757 + * @param {{}} args
7758 + * @param {*} result
7759 + */
7760 + }, {
7761 + key: "onAfterRun",
7762 + value: function onAfterRun() {
7763 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7764 + var result = arguments.length > 1 ? arguments[1] : undefined;
7765 + } // eslint-disable-line no-unused-vars
7766 +
7767 + /**
7768 + * Function onBeforeApply.
7769 + *
7770 + * Called before apply().
7771 + *
7772 + * @param {{}} args
7773 + */
7774 + }, {
7775 + key: "onBeforeApply",
7776 + value: function onBeforeApply() {
7777 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7778 + } // eslint-disable-line no-unused-vars
7779 +
7780 + /**
7781 + * Function onAfterApply.
7782 + *
7783 + * Called after apply().
7784 + *
7785 + * @param {{}} args
7786 + * @param {*} result
7787 + */
7788 + }, {
7789 + key: "onAfterApply",
7790 + value: function onAfterApply() {
7791 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7792 + var result = arguments.length > 1 ? arguments[1] : undefined;
7793 + } // eslint-disable-line no-unused-vars
7794 +
7795 + /**
7796 + * Function onCatchApply.
7797 + *
7798 + * Called after apply() failed.
7799 + *
7800 + * @param {Error} e
7801 + */
7802 + }, {
7803 + key: "onCatchApply",
7804 + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
7805 + }], [{
7806 + key: "getInstanceType",
7807 + value: function getInstanceType() {
7808 + return 'CommandInfra';
7809 + }
7810 +
7811 + /**
7812 + * Get info of command.
7813 + *
7814 + * @return {Object} Extra information about the command.
7815 + */
7816 + }, {
7817 + key: "getInfo",
7818 + value: function getInfo() {
7819 + return {};
7820 + }
7821 +
7822 + /**
7823 + * @return {string} Self command name.
7824 + */
7825 + }, {
7826 + key: "getCommand",
7827 + value: function getCommand() {
7828 + return this.registerConfig.command;
7829 + }
7830 +
7831 + /**
7832 + * @return {ComponentBase} Self component
7833 + */
7834 + }, {
7835 + key: "getComponent",
7836 + value: function getComponent() {
7837 + return this.registerConfig.component;
7838 + }
7839 + }, {
7840 + key: "setRegisterConfig",
7841 + value: function setRegisterConfig(config) {
7842 + this.registerConfig = Object.freeze(config);
7843 + }
7844 + }]);
7845 + return CommandInfra;
7846 +}(_argsObject.default);
7847 +exports["default"] = CommandInfra;
7848 +/**
7849 + * @type {Object}
7850 + */
7851 +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
7852 +
7853 +/***/ }),
7854 +
7855 +/***/ "../modules/web-cli/assets/js/modules/command-internal-base.js":
7856 +/*!*********************************************************************!*\
7857 + !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***!
7858 + \*********************************************************************/
7859 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7860 +
7861 +"use strict";
7862 +
7863 +
7864 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7865 +Object.defineProperty(exports, "__esModule", ({
7866 + value: true
7867 +}));
7868 +exports["default"] = void 0;
7869 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7870 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7871 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7872 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7873 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7874 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7875 +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); }; }
7876 +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; } }
7877 +/**
7878 + * @name $e.modules.CommandInternalBase
7879 + */
7880 +var CommandInternalBase = /*#__PURE__*/function (_CommandBase) {
7881 + (0, _inherits2.default)(CommandInternalBase, _CommandBase);
7882 + var _super = _createSuper(CommandInternalBase);
7883 + function CommandInternalBase(args) {
7884 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal;
7885 + (0, _classCallCheck2.default)(this, CommandInternalBase);
7886 + return _super.call(this, args, commandsAPI);
7887 + }
7888 + (0, _createClass2.default)(CommandInternalBase, null, [{
7889 + key: "getInstanceType",
7890 + value: function getInstanceType() {
7891 + return 'CommandInternalBase';
7892 + }
7893 + }]);
7894 + return CommandInternalBase;
7895 +}(_commandBase.default);
7896 +exports["default"] = CommandInternalBase;
7897 +
7898 +/***/ }),
7899 +
7900 +/***/ "../modules/web-cli/assets/js/modules/commands/close.js":
7901 +/*!**************************************************************!*\
7902 + !*** ../modules/web-cli/assets/js/modules/commands/close.js ***!
7903 + \**************************************************************/
7904 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7905 +
7906 +"use strict";
7907 +
7908 +
7909 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7910 +Object.defineProperty(exports, "__esModule", ({
7911 + value: true
7912 +}));
7913 +exports["default"] = exports.Close = void 0;
7914 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7915 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7916 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7917 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7918 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7919 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7920 +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); }; }
7921 +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; } }
7922 +var Close = /*#__PURE__*/function (_CommandBase) {
7923 + (0, _inherits2.default)(Close, _CommandBase);
7924 + var _super = _createSuper(Close);
7925 + function Close() {
7926 + (0, _classCallCheck2.default)(this, Close);
7927 + return _super.apply(this, arguments);
7928 + }
7929 + (0, _createClass2.default)(Close, [{
7930 + key: "apply",
7931 + value: function apply() {
7932 + this.component.close();
7933 + }
7934 + }]);
7935 + return Close;
7936 +}(_commandBase.default);
7937 +exports.Close = Close;
7938 +var _default = Close;
7939 +exports["default"] = _default;
7940 +
7941 +/***/ }),
7942 +
7943 +/***/ "../modules/web-cli/assets/js/modules/commands/index.js":
7944 +/*!**************************************************************!*\
7945 + !*** ../modules/web-cli/assets/js/modules/commands/index.js ***!
7946 + \**************************************************************/
7947 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7948 +
7949 +"use strict";
7950 +
7951 +
7952 +Object.defineProperty(exports, "__esModule", ({
7953 + value: true
7954 +}));
7955 +Object.defineProperty(exports, "Close", ({
7956 + enumerable: true,
7957 + get: function get() {
7958 + return _close.Close;
7959 + }
7960 +}));
7961 +Object.defineProperty(exports, "Open", ({
7962 + enumerable: true,
7963 + get: function get() {
7964 + return _open.Open;
7965 + }
7966 +}));
7967 +Object.defineProperty(exports, "Toggle", ({
7968 + enumerable: true,
7969 + get: function get() {
7970 + return _toggle.Toggle;
7971 + }
7972 +}));
7973 +var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js");
7974 +var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js");
7975 +var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js");
7976 +
7977 +/***/ }),
7978 +
7979 +/***/ "../modules/web-cli/assets/js/modules/commands/open.js":
7980 +/*!*************************************************************!*\
7981 + !*** ../modules/web-cli/assets/js/modules/commands/open.js ***!
7982 + \*************************************************************/
7983 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7984 +
7985 +"use strict";
7986 +
7987 +
7988 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7989 +Object.defineProperty(exports, "__esModule", ({
7990 + value: true
7991 +}));
7992 +exports["default"] = exports.Open = void 0;
7993 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7994 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7995 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7996 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7997 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7998 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7999 +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); }; }
8000 +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; } }
8001 +var Open = /*#__PURE__*/function (_CommandBase) {
8002 + (0, _inherits2.default)(Open, _CommandBase);
8003 + var _super = _createSuper(Open);
8004 + function Open() {
8005 + (0, _classCallCheck2.default)(this, Open);
8006 + return _super.apply(this, arguments);
8007 + }
8008 + (0, _createClass2.default)(Open, [{
8009 + key: "apply",
8010 + value: function apply() {
8011 + $e.route(this.component.getNamespace());
8012 + }
8013 + }]);
8014 + return Open;
8015 +}(_commandBase.default);
8016 +exports.Open = Open;
8017 +var _default = Open;
8018 +exports["default"] = _default;
8019 +
8020 +/***/ }),
8021 +
8022 +/***/ "../modules/web-cli/assets/js/modules/commands/toggle.js":
8023 +/*!***************************************************************!*\
8024 + !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***!
8025 + \***************************************************************/
8026 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8027 +
8028 +"use strict";
8029 +
8030 +
8031 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8032 +Object.defineProperty(exports, "__esModule", ({
8033 + value: true
8034 +}));
8035 +exports["default"] = exports.Toggle = void 0;
8036 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8037 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8038 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8039 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8040 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8041 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
8042 +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); }; }
8043 +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; } }
8044 +var Toggle = /*#__PURE__*/function (_CommandBase) {
8045 + (0, _inherits2.default)(Toggle, _CommandBase);
8046 + var _super = _createSuper(Toggle);
8047 + function Toggle() {
8048 + (0, _classCallCheck2.default)(this, Toggle);
8049 + return _super.apply(this, arguments);
8050 + }
8051 + (0, _createClass2.default)(Toggle, [{
8052 + key: "apply",
8053 + value: function apply() {
8054 + if (this.component.isOpen) {
8055 + this.component.close();
8056 + } else {
8057 + $e.route(this.component.getNamespace());
8058 + }
8059 + }
8060 + }]);
8061 + return Toggle;
8062 +}(_commandBase.default);
8063 +exports.Toggle = Toggle;
8064 +var _default = Toggle;
8065 +exports["default"] = _default;
8066 +
8067 +/***/ }),
8068 +
8069 +/***/ "../modules/web-cli/assets/js/modules/component-base.js":
8070 +/*!**************************************************************!*\
8071 + !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
8072 + \**************************************************************/
8073 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8074 +
8075 +"use strict";
8076 +
8077 +
8078 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8079 +Object.defineProperty(exports, "__esModule", ({
8080 + value: true
8081 +}));
8082 +exports["default"] = void 0;
8083 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8084 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
8085 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8086 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8087 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8088 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8089 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8090 +var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
8091 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
8092 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
8093 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8094 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
8095 +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8096 +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8097 +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); }; }
8098 +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; } }
8099 +/**
8100 + * @typedef {import('./command-infra')} CommandInfra
8101 + * @typedef {import('./hook-base')} HookBase
8102 + * @typedef {import('../core/states/ui-state-base')} UiStateBase
8103 + */
8104 +var ComponentBase = /*#__PURE__*/function (_Module) {
8105 + (0, _inherits2.default)(ComponentBase, _Module);
8106 + var _super = _createSuper(ComponentBase);
8107 + function ComponentBase() {
8108 + (0, _classCallCheck2.default)(this, ComponentBase);
8109 + return _super.apply(this, arguments);
8110 + }
8111 + (0, _createClass2.default)(ComponentBase, [{
8112 + key: "__construct",
8113 + value: function __construct() {
8114 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8115 + if (args.manager) {
8116 + this.manager = args.manager;
8117 + }
8118 + this.commands = this.defaultCommands();
8119 + this.commandsInternal = this.defaultCommandsInternal();
8120 + this.hooks = this.defaultHooks();
8121 + this.routes = this.defaultRoutes();
8122 + this.tabs = this.defaultTabs();
8123 + this.shortcuts = this.defaultShortcuts();
8124 + this.utils = this.defaultUtils();
8125 + this.data = this.defaultData();
8126 + this.uiStates = this.defaultUiStates();
8127 + this.states = this.defaultStates();
8128 + this.defaultRoute = '';
8129 + this.currentTab = '';
8130 + }
8131 + }, {
8132 + key: "registerAPI",
8133 + value: function registerAPI() {
8134 + var _this = this;
8135 + Object.entries(this.getTabs()).forEach(function (tab) {
8136 + return _this.registerTabRoute(tab[0]);
8137 + });
8138 + Object.entries(this.getRoutes()).forEach(function (_ref) {
8139 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
8140 + route = _ref2[0],
8141 + callback = _ref2[1];
8142 + return _this.registerRoute(route, callback);
8143 + });
8144 + Object.entries(this.getCommands()).forEach(function (_ref3) {
8145 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
8146 + command = _ref4[0],
8147 + callback = _ref4[1];
8148 + return _this.registerCommand(command, callback);
8149 + });
8150 + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
8151 + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
8152 + command = _ref6[0],
8153 + callback = _ref6[1];
8154 + return _this.registerCommandInternal(command, callback);
8155 + });
8156 + Object.values(this.getHooks()).forEach(function (instance) {
8157 + return _this.registerHook(instance);
8158 + });
8159 + Object.entries(this.getData()).forEach(function (_ref7) {
8160 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
8161 + command = _ref8[0],
8162 + callback = _ref8[1];
8163 + return _this.registerData(command, callback);
8164 + });
8165 + Object.values(this.getUiStates()).forEach(function (instance) {
8166 + return _this.registerUiState(instance);
8167 + });
8168 + Object.entries(this.getStates()).forEach(function (_ref9) {
8169 + var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
8170 + id = _ref10[0],
8171 + state = _ref10[1];
8172 + return _this.registerState(id, state);
8173 + });
8174 + }
8175 +
8176 + // eslint-disable-next-line jsdoc/require-returns-check
8177 + /**
8178 + * @return {string} namespace
8179 + */
8180 + }, {
8181 + key: "getNamespace",
8182 + value: function getNamespace() {
8183 + (0, _forceMethodImplementation.default)();
8184 + }
8185 +
8186 + /**
8187 + * @deprecated since 3.7.0, use `getServiceName()` instead.
8188 + */
8189 + }, {
8190 + key: "getRootContainer",
8191 + value: function getRootContainer() {
8192 + _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
8193 + return this.getServiceName();
8194 + }
8195 + }, {
8196 + key: "getServiceName",
8197 + value: function getServiceName() {
8198 + return this.getNamespace().split('/')[0];
8199 + }
8200 + }, {
8201 + key: "store",
8202 + get: function get() {
8203 + return $e.store.get(this.getNamespace());
8204 + }
8205 + }, {
8206 + key: "defaultTabs",
8207 + value: function defaultTabs() {
8208 + return {};
8209 + }
8210 + }, {
8211 + key: "defaultRoutes",
8212 + value: function defaultRoutes() {
8213 + return {};
8214 + }
8215 + }, {
8216 + key: "defaultCommands",
8217 + value: function defaultCommands() {
8218 + return {};
8219 + }
8220 + }, {
8221 + key: "defaultCommandsInternal",
8222 + value: function defaultCommandsInternal() {
8223 + return {};
8224 + }
8225 + }, {
8226 + key: "defaultHooks",
8227 + value: function defaultHooks() {
8228 + return {};
8229 + }
8230 +
8231 + /**
8232 + * Get the component's default UI states.
8233 + *
8234 + * @return {Object} default UI states
8235 + */
8236 + }, {
8237 + key: "defaultUiStates",
8238 + value: function defaultUiStates() {
8239 + return {};
8240 + }
8241 +
8242 + /**
8243 + * Get the component's Redux slice settings.
8244 + *
8245 + * @return {Object} Redux slice settings
8246 + */
8247 + }, {
8248 + key: "defaultStates",
8249 + value: function defaultStates() {
8250 + return {};
8251 + }
8252 + }, {
8253 + key: "defaultShortcuts",
8254 + value: function defaultShortcuts() {
8255 + return {};
8256 + }
8257 + }, {
8258 + key: "defaultUtils",
8259 + value: function defaultUtils() {
8260 + return {};
8261 + }
8262 + }, {
8263 + key: "defaultData",
8264 + value: function defaultData() {
8265 + return {};
8266 + }
8267 + }, {
8268 + key: "getCommands",
8269 + value: function getCommands() {
8270 + return this.commands;
8271 + }
8272 + }, {
8273 + key: "getCommandsInternal",
8274 + value: function getCommandsInternal() {
8275 + return this.commandsInternal;
8276 + }
8277 + }, {
8278 + key: "getHooks",
8279 + value: function getHooks() {
8280 + return this.hooks;
8281 + }
8282 +
8283 + /**
8284 + * Retrieve the component's UI states.
8285 + *
8286 + * @return {Object} UI states
8287 + */
8288 + }, {
8289 + key: "getUiStates",
8290 + value: function getUiStates() {
8291 + return this.uiStates;
8292 + }
8293 +
8294 + /**
8295 + * Retrieve the component's Redux Slice.
8296 + *
8297 + * @return {Object} Redux Slice
8298 + */
8299 + }, {
8300 + key: "getStates",
8301 + value: function getStates() {
8302 + return this.states;
8303 + }
8304 + }, {
8305 + key: "getRoutes",
8306 + value: function getRoutes() {
8307 + return this.routes;
8308 + }
8309 + }, {
8310 + key: "getTabs",
8311 + value: function getTabs() {
8312 + return this.tabs;
8313 + }
8314 + }, {
8315 + key: "getShortcuts",
8316 + value: function getShortcuts() {
8317 + return this.shortcuts;
8318 + }
8319 + }, {
8320 + key: "getData",
8321 + value: function getData() {
8322 + return this.data;
8323 + }
8324 +
8325 + /**
8326 + * @param {string} command
8327 + * @param {(()=>{}|CommandInfra)} context
8328 + * @param {'default'|'internal'|'data'} commandsType
8329 + */
8330 + }, {
8331 + key: "registerCommand",
8332 + value: function registerCommand(command, context) {
8333 + var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
8334 + var commandsManager;
8335 + switch (commandsType) {
8336 + case 'default':
8337 + commandsManager = $e.commands;
8338 + break;
8339 + case 'internal':
8340 + commandsManager = $e.commandsInternal;
8341 + break;
8342 + case 'data':
8343 + commandsManager = $e.data;
8344 + break;
8345 + default:
8346 + throw new Error("Invalid commands type: '".concat(command, "'"));
8347 + }
8348 + var fullCommand = this.getNamespace() + '/' + command,
8349 + instanceType = context.getInstanceType ? context.getInstanceType() : false,
8350 + registerConfig = {
8351 + command: fullCommand,
8352 + component: this
8353 + };
8354 +
8355 + // Support pure callback.
8356 + if (!instanceType) {
8357 + if ($e.devTools) {
8358 + $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
8359 + }
8360 + registerConfig.callback = context;
8361 +
8362 + // Unique class.
8363 + context = /*#__PURE__*/function (_CommandCallbackBase) {
8364 + (0, _inherits2.default)(context, _CommandCallbackBase);
8365 + var _super2 = _createSuper(context);
8366 + function context() {
8367 + (0, _classCallCheck2.default)(this, context);
8368 + return _super2.apply(this, arguments);
8369 + }
8370 + return (0, _createClass2.default)(context);
8371 + }(_commandCallbackBase.default);
8372 + }
8373 + context.setRegisterConfig(registerConfig);
8374 + commandsManager.register(this, command, context);
8375 + }
8376 +
8377 + /**
8378 + * @param {HookBase} instance
8379 + */
8380 + }, {
8381 + key: "registerHook",
8382 + value: function registerHook(instance) {
8383 + return instance.register();
8384 + }
8385 + }, {
8386 + key: "registerCommandInternal",
8387 + value: function registerCommandInternal(command, context) {
8388 + this.registerCommand(command, context, 'internal');
8389 + }
8390 +
8391 + /**
8392 + * Register a UI state.
8393 + *
8394 + * @param {UiStateBase} instance - UI state instance.
8395 + *
8396 + * @return {void}
8397 + */
8398 + }, {
8399 + key: "registerUiState",
8400 + value: function registerUiState(instance) {
8401 + $e.uiStates.register(instance);
8402 + }
8403 +
8404 + /**
8405 + * Register a Redux Slice.
8406 + *
8407 + * @param {string} id - State id.
8408 + * @param {Object} stateConfig - The state config.
8409 + *
8410 + * @return {void}
8411 + */
8412 + }, {
8413 + key: "registerState",
8414 + value: function registerState(id, stateConfig) {
8415 + id = this.getNamespace() + (id ? "/".concat(id) : '');
8416 + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
8417 + name: id
8418 + }));
8419 + $e.store.register(id, slice);
8420 + }
8421 + }, {
8422 + key: "registerRoute",
8423 + value: function registerRoute(route, callback) {
8424 + $e.routes.register(this, route, callback);
8425 + }
8426 + }, {
8427 + key: "registerData",
8428 + value: function registerData(command, context) {
8429 + this.registerCommand(command, context, 'data');
8430 + }
8431 + }, {
8432 + key: "unregisterRoute",
8433 + value: function unregisterRoute(route) {
8434 + $e.routes.unregister(this, route);
8435 + }
8436 + }, {
8437 + key: "registerTabRoute",
8438 + value: function registerTabRoute(tab) {
8439 + var _this2 = this;
8440 + this.registerRoute(tab, function (args) {
8441 + return _this2.activateTab(tab, args);
8442 + });
8443 + }
8444 + }, {
8445 + key: "dependency",
8446 + value: function dependency() {
8447 + return true;
8448 + }
8449 + }, {
8450 + key: "open",
8451 + value: function open() {
8452 + return true;
8453 + }
8454 + }, {
8455 + key: "close",
8456 + value: function close() {
8457 + if (!this.isOpen) {
8458 + return false;
8459 + }
8460 + this.isOpen = false;
8461 + this.inactivate();
8462 + $e.routes.clearCurrent(this.getNamespace());
8463 + $e.routes.clearHistory(this.getServiceName());
8464 + return true;
8465 + }
8466 + }, {
8467 + key: "activate",
8468 + value: function activate() {
8469 + $e.components.activate(this.getNamespace());
8470 + }
8471 + }, {
8472 + key: "inactivate",
8473 + value: function inactivate() {
8474 + $e.components.inactivate(this.getNamespace());
8475 + }
8476 + }, {
8477 + key: "isActive",
8478 + value: function isActive() {
8479 + return $e.components.isActive(this.getNamespace());
8480 + }
8481 + }, {
8482 + key: "onRoute",
8483 + value: function onRoute(route) {
8484 + this.toggleRouteClass(route, true);
8485 + this.toggleHistoryClass();
8486 + this.activate();
8487 + this.trigger('route/open', route);
8488 + }
8489 + }, {
8490 + key: "onCloseRoute",
8491 + value: function onCloseRoute(route) {
8492 + this.toggleRouteClass(route, false);
8493 + this.inactivate();
8494 + this.trigger('route/close', route);
8495 + }
8496 + }, {
8497 + key: "setDefaultRoute",
8498 + value: function setDefaultRoute(route) {
8499 + this.defaultRoute = this.getNamespace() + '/' + route;
8500 + }
8501 + }, {
8502 + key: "getDefaultRoute",
8503 + value: function getDefaultRoute() {
8504 + return this.defaultRoute;
8505 + }
8506 + }, {
8507 + key: "removeTab",
8508 + value: function removeTab(tab) {
8509 + delete this.tabs[tab];
8510 + this.unregisterRoute(tab);
8511 + }
8512 + }, {
8513 + key: "hasTab",
8514 + value: function hasTab(tab) {
8515 + return !!this.tabs[tab];
8516 + }
8517 + }, {
8518 + key: "addTab",
8519 + value: function addTab(tab, args, position) {
8520 + var _this3 = this;
8521 + this.tabs[tab] = args;
8522 + // It can be 0.
8523 + if ('undefined' !== typeof position) {
8524 + var newTabs = {};
8525 + var ids = Object.keys(this.tabs);
8526 + // Remove new tab
8527 + ids.pop();
8528 +
8529 + // Add it to position.
8530 + ids.splice(position, 0, tab);
8531 + ids.forEach(function (id) {
8532 + newTabs[id] = _this3.tabs[id];
8533 + });
8534 + this.tabs = newTabs;
8535 + }
8536 + this.registerTabRoute(tab);
8537 + }
8538 + }, {
8539 + key: "getTabsWrapperSelector",
8540 + value: function getTabsWrapperSelector() {
8541 + return '';
8542 + }
8543 + }, {
8544 + key: "getTabRoute",
8545 + value: function getTabRoute(tab) {
8546 + return this.getNamespace() + '/' + tab;
8547 + }
8548 + }, {
8549 + key: "renderTab",
8550 + value: function renderTab(tab) {} // eslint-disable-line
8551 + }, {
8552 + key: "activateTab",
8553 + value: function activateTab(tab, args) {
8554 + var _this4 = this;
8555 + this.renderTab(tab, args);
8556 + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
8557 + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
8558 + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
8559 + }
8560 + }, {
8561 + key: "getActiveTabConfig",
8562 + value: function getActiveTabConfig() {
8563 + return this.tabs[this.currentTab] || {};
8564 + }
8565 + }, {
8566 + key: "getBodyClass",
8567 + value: function getBodyClass(route) {
8568 + return 'e-route-' + route.replace(/\//g, '-');
8569 + }
8570 +
8571 + /**
8572 + * If command includes uppercase character convert it to lowercase and add `-`.
8573 + * e.g: `CopyAll` is converted to `copy-all`.
8574 + *
8575 + * @param {string} commandName
8576 + */
8577 + }, {
8578 + key: "normalizeCommandName",
8579 + value: function normalizeCommandName(commandName) {
8580 + return commandName.replace(/[A-Z]/g, function (match, offset) {
8581 + return (offset > 0 ? '-' : '') + match.toLowerCase();
8582 + });
8583 + }
8584 +
8585 + /**
8586 + * @param {{}} commandsFromImport
8587 + * @return {{}} imported commands
8588 + */
8589 + }, {
8590 + key: "importCommands",
8591 + value: function importCommands(commandsFromImport) {
8592 + var _this5 = this;
8593 + var commands = {};
8594 +
8595 + // Convert `Commands` to `ComponentBase` workable format.
8596 + Object.entries(commandsFromImport).forEach(function (_ref11) {
8597 + var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
8598 + className = _ref12[0],
8599 + Class = _ref12[1];
8600 + var command = _this5.normalizeCommandName(className);
8601 + commands[command] = Class;
8602 + });
8603 + return commands;
8604 + }
8605 + }, {
8606 + key: "importHooks",
8607 + value: function importHooks(hooksFromImport) {
8608 + var hooks = {};
8609 + for (var key in hooksFromImport) {
8610 + var hook = new hooksFromImport[key]();
8611 + hooks[hook.getId()] = hook;
8612 + }
8613 + return hooks;
8614 + }
8615 +
8616 + /**
8617 + * Import & initialize the component's UI states.
8618 + * Should be used inside `defaultUiState()`.
8619 + *
8620 + * @param {Object} statesFromImport - UI states from import.
8621 + *
8622 + * @return {Object} UI States
8623 + */
8624 + }, {
8625 + key: "importUiStates",
8626 + value: function importUiStates(statesFromImport) {
8627 + var _this6 = this;
8628 + var uiStates = {};
8629 + Object.values(statesFromImport).forEach(function (className) {
8630 + var uiState = new className(_this6);
8631 + uiStates[uiState.getId()] = uiState;
8632 + });
8633 + return uiStates;
8634 + }
8635 +
8636 + /**
8637 + * Set a UI state value.
8638 + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
8639 + *
8640 + * @param {string} state - Non-prefixed state ID.
8641 + * @param {*} value - New state value.
8642 + *
8643 + * @return {void}
8644 + */
8645 + }, {
8646 + key: "setUiState",
8647 + value: function setUiState(state, value) {
8648 + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
8649 + }
8650 + }, {
8651 + key: "toggleRouteClass",
8652 + value: function toggleRouteClass(route, state) {
8653 + document.body.classList.toggle(this.getBodyClass(route), state);
8654 + }
8655 + }, {
8656 + key: "toggleHistoryClass",
8657 + value: function toggleHistoryClass() {
8658 + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
8659 + }
8660 + }]);
8661 + return ComponentBase;
8662 +}(_module.default);
8663 +exports["default"] = ComponentBase;
8664 +
8665 +/***/ }),
8666 +
8667 +/***/ "../modules/web-cli/assets/js/modules/component-modal-base.js":
8668 +/*!********************************************************************!*\
8669 + !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***!
8670 + \********************************************************************/
8671 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8672 +
8673 +"use strict";
8674 +
8675 +
8676 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8677 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
8678 +Object.defineProperty(exports, "__esModule", ({
8679 + value: true
8680 +}));
8681 +exports["default"] = void 0;
8682 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8683 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8684 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
8685 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8686 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8687 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8688 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
8689 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js"));
8690 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8691 +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8692 +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8693 +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); }; }
8694 +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; } }
8695 +var ComponentModalBase = /*#__PURE__*/function (_ComponentBase) {
8696 + (0, _inherits2.default)(ComponentModalBase, _ComponentBase);
8697 + var _super = _createSuper(ComponentModalBase);
8698 + function ComponentModalBase() {
8699 + (0, _classCallCheck2.default)(this, ComponentModalBase);
8700 + return _super.apply(this, arguments);
8701 + }
8702 + (0, _createClass2.default)(ComponentModalBase, [{
8703 + key: "registerAPI",
8704 + value: function registerAPI() {
8705 + var _this = this;
8706 + (0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "registerAPI", this).call(this);
8707 + $e.shortcuts.register('esc', {
8708 + scopes: [this.getNamespace()],
8709 + callback: function callback() {
8710 + return _this.close();
8711 + }
8712 + });
8713 + }
8714 + }, {
8715 + key: "defaultCommands",
8716 + value: function defaultCommands() {
8717 + return this.importCommands(commands);
8718 + }
8719 + }, {
8720 + key: "defaultRoutes",
8721 + value: function defaultRoutes() {
8722 + return {
8723 + '': function _() {/* Nothing to do, it's already rendered. */}
8724 + };
8725 + }
8726 + }, {
8727 + key: "open",
8728 + value: function open() {
8729 + var _this2 = this;
8730 + if (!this.layout) {
8731 + var layout = this.getModalLayout();
8732 + this.layout = new layout({
8733 + component: this
8734 + });
8735 + this.layout.getModal().on('hide', function () {
8736 + return _this2.close();
8737 + });
8738 + }
8739 + this.layout.showModal();
8740 + return true;
8741 + }
8742 + }, {
8743 + key: "close",
8744 + value: function close() {
8745 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "close", this).call(this)) {
8746 + return false;
8747 + }
8748 + this.layout.getModal().hide();
8749 + return true;
8750 + }
8751 + }, {
8752 + key: "getModalLayout",
8753 + value: function getModalLayout() {
8754 + (0, _forceMethodImplementation.default)();
8755 + }
8756 + }]);
8757 + return ComponentModalBase;
8758 +}(_componentBase.default);
8759 +exports["default"] = ComponentModalBase;
8760 +
8761 +/***/ }),
8762 +
8763 +/***/ "../modules/web-cli/assets/js/modules/hook-base.js":
8764 +/*!*********************************************************!*\
8765 + !*** ../modules/web-cli/assets/js/modules/hook-base.js ***!
8766 + \*********************************************************/
8767 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8768 +
8769 +"use strict";
8770 +
8771 +
8772 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8773 +Object.defineProperty(exports, "__esModule", ({
8774 + value: true
8775 +}));
8776 +exports["default"] = void 0;
8777 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8778 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8779 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8780 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8781 +var HookBase = /*#__PURE__*/function () {
8782 + /**
8783 + * Function constructor().
8784 + *
8785 + * Create callback base.
8786 + */
8787 + function HookBase() {
8788 + (0, _classCallCheck2.default)(this, HookBase);
8789 + /**
8790 + * Callback type, eg ( hook, event ).
8791 + *
8792 + * @type {string}
8793 + */
8794 + (0, _defineProperty2.default)(this, "type", void 0);
8795 + /**
8796 + * Full command address, that will hook the callback.
8797 + *
8798 + * @type {string}
8799 + */
8800 + (0, _defineProperty2.default)(this, "command", void 0);
8801 + /**
8802 + * Unique id of the callback.
8803 + *
8804 + * @type {string}
8805 + */
8806 + (0, _defineProperty2.default)(this, "id", void 0);
8807 + this.initialize();
8808 + this.type = this.getType();
8809 + this.command = this.getCommand();
8810 + this.id = this.getId();
8811 + }
8812 +
8813 + /**
8814 + * Function initialize().
8815 + *
8816 + * Called after creation of the base, used for initialize extras.
8817 + * Without expending constructor.
8818 + */
8819 + (0, _createClass2.default)(HookBase, [{
8820 + key: "initialize",
8821 + value: function initialize() {}
8822 +
8823 + /**
8824 + * Function register().
8825 + *
8826 + * Used to register the callback.
8827 + *
8828 + * @throws {Error}
8829 + */
8830 + }, {
8831 + key: "register",
8832 + value: function register() {
8833 + (0, _forceMethodImplementation.default)();
8834 + }
8835 +
8836 + // eslint-disable-next-line jsdoc/require-returns-check
8837 + /**
8838 + * Function getType().
8839 + *
8840 + * Get type eg: ( hook, event, etc ... ).
8841 + *
8842 + * @return {string} type
8843 + *
8844 + * @throws {Error}
8845 + */
8846 + }, {
8847 + key: "getType",
8848 + value: function getType() {
8849 + (0, _forceMethodImplementation.default)();
8850 + }
8851 +
8852 + // eslint-disable-next-line jsdoc/require-returns-check
8853 + /**
8854 + * Function getCommand().
8855 + *
8856 + * Returns the full command path for callback binding.
8857 + *
8858 + * Supports array of strings ( commands ).
8859 + *
8860 + * @return {string} command
8861 + *
8862 + * @throws {Error}
8863 + */
8864 + }, {
8865 + key: "getCommand",
8866 + value: function getCommand() {
8867 + (0, _forceMethodImplementation.default)();
8868 + }
8869 +
8870 + // eslint-disable-next-line jsdoc/require-returns-check
8871 + /**
8872 + * Function getId().
8873 + *
8874 + * Returns command id for the hook (should be unique).
8875 + *
8876 + * @return {string} id
8877 + *
8878 + * @throws {Error}
8879 + */
8880 + }, {
8881 + key: "getId",
8882 + value: function getId() {
8883 + (0, _forceMethodImplementation.default)();
8884 + }
8885 +
8886 + // eslint-disable-next-line jsdoc/require-returns-check
8887 + /**
8888 + * Function getContainerType().
8889 + *
8890 + * Bind eContainer type to callback.
8891 + *
8892 + * Used to gain performance.
8893 + *
8894 + * @return {string} type
8895 + */
8896 + }, {
8897 + key: "getContainerType",
8898 + value: function getContainerType() {}
8899 +
8900 + /**
8901 + * Function getConditions().
8902 + *
8903 + * Condition for running the callback, if true, call to apply().
8904 + *
8905 + * @param {*} [args={}]
8906 + * @param {*} [result=*]
8907 + *
8908 + * @return {boolean} conditions
8909 + */
8910 + }, {
8911 + key: "getConditions",
8912 + value: function getConditions() {
8913 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8914 + var result = arguments.length > 1 ? arguments[1] : undefined;
8915 + // eslint-disable-line no-unused-vars
8916 + return true;
8917 + }
8918 +
8919 + // eslint-disable-next-line jsdoc/require-returns-check
8920 + /**
8921 + * Function apply().
8922 + *
8923 + * Apply the callback, ( The actual affect of the callback ).
8924 + *
8925 + * @param {*} [args={}]
8926 + *
8927 + * @return {*} results
8928 + */
8929 + }, {
8930 + key: "apply",
8931 + value: function apply(args) {
8932 + // eslint-disable-line no-unused-vars
8933 + (0, _forceMethodImplementation.default)();
8934 + }
8935 +
8936 + /**
8937 + * Function run().
8938 + *
8939 + * Run the callback.
8940 + *
8941 + * @param {*} args
8942 + *
8943 + * @return {*} results
8944 + */
8945 + }, {
8946 + key: "run",
8947 + value: function run() {
8948 + var _ref = arguments.length <= 0 ? undefined : arguments[0],
8949 + _ref$options = _ref.options,
8950 + options = _ref$options === void 0 ? {} : _ref$options;
8951 +
8952 + // Disable callback if requested by args.options.
8953 + if (options.callbacks && false === options.callbacks[this.id]) {
8954 + return true;
8955 + }
8956 + if (this.getConditions.apply(this, arguments)) {
8957 + if ($e.devTools) {
8958 + $e.devTools.log.callbacks().active(this.type, this.command, this.id);
8959 + }
8960 + return this.apply.apply(this, arguments);
8961 + }
8962 + return true;
8963 + }
8964 + }]);
8965 + return HookBase;
8966 +}();
8967 +exports["default"] = HookBase;
8968 +
8969 +/***/ }),
8970 +
8971 +/***/ "../modules/web-cli/assets/js/modules/hook-break.js":
8972 +/*!**********************************************************!*\
8973 + !*** ../modules/web-cli/assets/js/modules/hook-break.js ***!
8974 + \**********************************************************/
8975 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8976 +
8977 +"use strict";
8978 +
8979 +
8980 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8981 +Object.defineProperty(exports, "__esModule", ({
8982 + value: true
8983 +}));
8984 +exports["default"] = void 0;
8985 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8986 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8987 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8988 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8989 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8990 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
8991 +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); }; }
8992 +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; } }
8993 +var HookBreak = /*#__PURE__*/function (_Error) {
8994 + (0, _inherits2.default)(HookBreak, _Error);
8995 + var _super = _createSuper(HookBreak);
8996 + function HookBreak() {
8997 + (0, _classCallCheck2.default)(this, HookBreak);
8998 + return _super.call(this, 'HookBreak');
8999 + }
9000 + return (0, _createClass2.default)(HookBreak);
9001 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9002 +exports["default"] = HookBreak;
9003 +
9004 +/***/ }),
9005 +
9006 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js":
9007 +/*!****************************************************************!*\
9008 + !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***!
9009 + \****************************************************************/
9010 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9011 +
9012 +"use strict";
9013 +
9014 +
9015 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9016 +Object.defineProperty(exports, "__esModule", ({
9017 + value: true
9018 +}));
9019 +exports["default"] = exports.After = void 0;
9020 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9021 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9022 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9023 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9024 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9025 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9026 +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); }; }
9027 +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; } }
9028 +var After = /*#__PURE__*/function (_Base) {
9029 + (0, _inherits2.default)(After, _Base);
9030 + var _super = _createSuper(After);
9031 + function After() {
9032 + (0, _classCallCheck2.default)(this, After);
9033 + return _super.apply(this, arguments);
9034 + }
9035 + (0, _createClass2.default)(After, [{
9036 + key: "register",
9037 + value: function register() {
9038 + $e.hooks.registerDataAfter(this);
9039 + }
9040 + }]);
9041 + return After;
9042 +}(_base.default);
9043 +exports.After = After;
9044 +var _default = After;
9045 +exports["default"] = _default;
9046 +
9047 +/***/ }),
9048 +
9049 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js":
9050 +/*!***************************************************************!*\
9051 + !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***!
9052 + \***************************************************************/
9053 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9054 +
9055 +"use strict";
9056 +
9057 +
9058 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9059 +Object.defineProperty(exports, "__esModule", ({
9060 + value: true
9061 +}));
9062 +exports["default"] = exports.Base = void 0;
9063 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9064 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9065 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9066 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9067 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9068 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9069 +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); }; }
9070 +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; } }
9071 +var Base = /*#__PURE__*/function (_HookBase) {
9072 + (0, _inherits2.default)(Base, _HookBase);
9073 + var _super = _createSuper(Base);
9074 + function Base() {
9075 + (0, _classCallCheck2.default)(this, Base);
9076 + return _super.apply(this, arguments);
9077 + }
9078 + (0, _createClass2.default)(Base, [{
9079 + key: "getType",
9080 + value: function getType() {
9081 + return 'data';
9082 + }
9083 + }]);
9084 + return Base;
9085 +}(_hookBase.default);
9086 +exports.Base = Base;
9087 +var _default = Base;
9088 +exports["default"] = _default;
9089 +
9090 +/***/ }),
9091 +
9092 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js":
9093 +/*!****************************************************************!*\
9094 + !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***!
9095 + \****************************************************************/
9096 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9097 +
9098 +"use strict";
9099 +
9100 +
9101 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9102 +Object.defineProperty(exports, "__esModule", ({
9103 + value: true
9104 +}));
9105 +exports["default"] = exports.Catch = void 0;
9106 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9107 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9108 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9109 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9110 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9111 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9112 +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); }; }
9113 +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; } }
9114 +var Catch = /*#__PURE__*/function (_Base) {
9115 + (0, _inherits2.default)(Catch, _Base);
9116 + var _super = _createSuper(Catch);
9117 + function Catch() {
9118 + (0, _classCallCheck2.default)(this, Catch);
9119 + return _super.apply(this, arguments);
9120 + }
9121 + (0, _createClass2.default)(Catch, [{
9122 + key: "register",
9123 + value: function register() {
9124 + $e.hooks.registerDataCatch(this);
9125 + }
9126 + }]);
9127 + return Catch;
9128 +}(_base.default);
9129 +exports.Catch = Catch;
9130 +var _default = Catch;
9131 +exports["default"] = _default;
9132 +
9133 +/***/ }),
9134 +
9135 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js":
9136 +/*!*********************************************************************!*\
9137 + !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***!
9138 + \*********************************************************************/
9139 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9140 +
9141 +"use strict";
9142 +
9143 +
9144 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9145 +Object.defineProperty(exports, "__esModule", ({
9146 + value: true
9147 +}));
9148 +exports["default"] = exports.Dependency = void 0;
9149 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9150 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9151 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9152 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9153 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9154 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9155 +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); }; }
9156 +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; } }
9157 +var Dependency = /*#__PURE__*/function (_Base) {
9158 + (0, _inherits2.default)(Dependency, _Base);
9159 + var _super = _createSuper(Dependency);
9160 + function Dependency() {
9161 + (0, _classCallCheck2.default)(this, Dependency);
9162 + return _super.apply(this, arguments);
9163 + }
9164 + (0, _createClass2.default)(Dependency, [{
9165 + key: "register",
9166 + value: function register() {
9167 + $e.hooks.registerDataDependency(this);
9168 + }
9169 + }]);
9170 + return Dependency;
9171 +}(_base.default);
9172 +exports.Dependency = Dependency;
9173 +var _default = Dependency;
9174 +exports["default"] = _default;
9175 +
9176 +/***/ }),
9177 +
9178 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js":
9179 +/*!****************************************************************!*\
9180 + !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***!
9181 + \****************************************************************/
9182 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9183 +
9184 +"use strict";
9185 +
9186 +
9187 +Object.defineProperty(exports, "__esModule", ({
9188 + value: true
9189 +}));
9190 +Object.defineProperty(exports, "After", ({
9191 + enumerable: true,
9192 + get: function get() {
9193 + return _after.After;
9194 + }
9195 +}));
9196 +Object.defineProperty(exports, "Base", ({
9197 + enumerable: true,
9198 + get: function get() {
9199 + return _base.Base;
9200 + }
9201 +}));
9202 +Object.defineProperty(exports, "Catch", ({
9203 + enumerable: true,
9204 + get: function get() {
9205 + return _catch.Catch;
9206 + }
9207 +}));
9208 +Object.defineProperty(exports, "Dependency", ({
9209 + enumerable: true,
9210 + get: function get() {
9211 + return _dependency.Dependency;
9212 + }
9213 +}));
9214 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js");
9215 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js");
9216 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js");
9217 +var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js");
9218 +
9219 +/***/ }),
9220 +
9221 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js":
9222 +/*!**************************************************************!*\
9223 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***!
9224 + \**************************************************************/
9225 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9226 +
9227 +"use strict";
9228 +
9229 +
9230 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9231 +Object.defineProperty(exports, "__esModule", ({
9232 + value: true
9233 +}));
9234 +exports["default"] = exports.After = void 0;
9235 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9236 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9237 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9238 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9239 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9240 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9241 +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); }; }
9242 +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; } }
9243 +var After = /*#__PURE__*/function (_Base) {
9244 + (0, _inherits2.default)(After, _Base);
9245 + var _super = _createSuper(After);
9246 + function After() {
9247 + (0, _classCallCheck2.default)(this, After);
9248 + return _super.apply(this, arguments);
9249 + }
9250 + (0, _createClass2.default)(After, [{
9251 + key: "register",
9252 + value: function register() {
9253 + $e.hooks.registerUIAfter(this);
9254 + }
9255 + }]);
9256 + return After;
9257 +}(_base.default);
9258 +exports.After = After;
9259 +var _default = After;
9260 +exports["default"] = _default;
9261 +
9262 +/***/ }),
9263 +
9264 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js":
9265 +/*!*************************************************************!*\
9266 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***!
9267 + \*************************************************************/
9268 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9269 +
9270 +"use strict";
9271 +
9272 +
9273 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9274 +Object.defineProperty(exports, "__esModule", ({
9275 + value: true
9276 +}));
9277 +exports["default"] = exports.Base = void 0;
9278 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9279 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9280 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9281 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9282 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9283 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9284 +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); }; }
9285 +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; } }
9286 +var Base = /*#__PURE__*/function (_HookBase) {
9287 + (0, _inherits2.default)(Base, _HookBase);
9288 + var _super = _createSuper(Base);
9289 + function Base() {
9290 + (0, _classCallCheck2.default)(this, Base);
9291 + return _super.apply(this, arguments);
9292 + }
9293 + (0, _createClass2.default)(Base, [{
9294 + key: "getType",
9295 + value: function getType() {
9296 + return 'ui';
9297 + }
9298 + }]);
9299 + return Base;
9300 +}(_hookBase.default);
9301 +exports.Base = Base;
9302 +var _default = Base;
9303 +exports["default"] = _default;
9304 +
9305 +/***/ }),
9306 +
9307 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js":
9308 +/*!***************************************************************!*\
9309 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***!
9310 + \***************************************************************/
9311 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9312 +
9313 +"use strict";
9314 +
9315 +
9316 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9317 +Object.defineProperty(exports, "__esModule", ({
9318 + value: true
9319 +}));
9320 +exports["default"] = exports.Before = void 0;
9321 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9322 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9323 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9324 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9325 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9326 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9327 +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); }; }
9328 +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; } }
9329 +var Before = /*#__PURE__*/function (_Base) {
9330 + (0, _inherits2.default)(Before, _Base);
9331 + var _super = _createSuper(Before);
9332 + function Before() {
9333 + (0, _classCallCheck2.default)(this, Before);
9334 + return _super.apply(this, arguments);
9335 + }
9336 + (0, _createClass2.default)(Before, [{
9337 + key: "register",
9338 + value: function register() {
9339 + $e.hooks.registerUIBefore(this);
9340 + }
9341 + }]);
9342 + return Before;
9343 +}(_base.default);
9344 +exports.Before = Before;
9345 +var _default = Before;
9346 +exports["default"] = _default;
9347 +
9348 +/***/ }),
9349 +
9350 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js":
9351 +/*!**************************************************************!*\
9352 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***!
9353 + \**************************************************************/
9354 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9355 +
9356 +"use strict";
9357 +
9358 +
9359 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9360 +Object.defineProperty(exports, "__esModule", ({
9361 + value: true
9362 +}));
9363 +exports["default"] = exports.Catch = void 0;
9364 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9365 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9366 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9367 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9368 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9369 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9370 +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); }; }
9371 +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; } }
9372 +var Catch = /*#__PURE__*/function (_Base) {
9373 + (0, _inherits2.default)(Catch, _Base);
9374 + var _super = _createSuper(Catch);
9375 + function Catch() {
9376 + (0, _classCallCheck2.default)(this, Catch);
9377 + return _super.apply(this, arguments);
9378 + }
9379 + (0, _createClass2.default)(Catch, [{
9380 + key: "register",
9381 + value: function register() {
9382 + $e.hooks.registerUICatch(this);
9383 + }
9384 + }]);
9385 + return Catch;
9386 +}(_base.default);
9387 +exports.Catch = Catch;
9388 +var _default = Catch;
9389 +exports["default"] = _default;
9390 +
9391 +/***/ }),
9392 +
9393 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js":
9394 +/*!**************************************************************!*\
9395 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***!
9396 + \**************************************************************/
9397 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9398 +
9399 +"use strict";
9400 +
9401 +
9402 +Object.defineProperty(exports, "__esModule", ({
9403 + value: true
9404 +}));
9405 +Object.defineProperty(exports, "After", ({
9406 + enumerable: true,
9407 + get: function get() {
9408 + return _after.After;
9409 + }
9410 +}));
9411 +Object.defineProperty(exports, "Base", ({
9412 + enumerable: true,
9413 + get: function get() {
9414 + return _base.Base;
9415 + }
9416 +}));
9417 +Object.defineProperty(exports, "Before", ({
9418 + enumerable: true,
9419 + get: function get() {
9420 + return _before.Before;
9421 + }
9422 +}));
9423 +Object.defineProperty(exports, "Catch", ({
9424 + enumerable: true,
9425 + get: function get() {
9426 + return _catch.Catch;
9427 + }
9428 +}));
9429 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js");
9430 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js");
9431 +var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js");
9432 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js");
9433 +
9434 +/***/ }),
9435 +
9436 +/***/ "../modules/web-cli/assets/js/utils/console.js":
9437 +/*!*****************************************************!*\
9438 + !*** ../modules/web-cli/assets/js/utils/console.js ***!
9439 + \*****************************************************/
9440 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9441 +
9442 +"use strict";
9443 +
9444 +
9445 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9446 +Object.defineProperty(exports, "__esModule", ({
9447 + value: true
9448 +}));
9449 +exports["default"] = void 0;
9450 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9451 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9452 +var Console = /*#__PURE__*/function () {
9453 + function Console() {
9454 + (0, _classCallCheck2.default)(this, Console);
9455 + }
9456 + (0, _createClass2.default)(Console, null, [{
9457 + key: "error",
9458 + value: function error(message) {
9459 + // Show an error if devTools is available.
9460 + if ($e.devTools) {
9461 + $e.devTools.log.error(message);
9462 + }
9463 +
9464 + // If not a 'Hook-Break' then show error.
9465 + if (!(message instanceof $e.modules.HookBreak)) {
9466 + // eslint-disable-next-line no-console
9467 + console.error(message);
9468 + }
9469 + }
9470 + }, {
9471 + key: "warn",
9472 + value: function warn() {
9473 + var _console;
9474 + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
9475 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9476 + args[_key] = arguments[_key];
9477 + }
9478 + args.unshift('%c %c', style, '');
9479 + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
9480 + }
9481 + }]);
9482 + return Console;
9483 +}();
9484 +exports["default"] = Console;
9485 +
9486 +/***/ }),
9487 +
9488 +/***/ "../modules/web-cli/assets/js/utils/deprecation.js":
9489 +/*!*********************************************************!*\
9490 + !*** ../modules/web-cli/assets/js/utils/deprecation.js ***!
9491 + \*********************************************************/
9492 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9493 +
9494 +"use strict";
9495 +
9496 +
9497 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9498 +Object.defineProperty(exports, "__esModule", ({
9499 + value: true
9500 +}));
9501 +exports["default"] = void 0;
9502 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
9503 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9504 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9505 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
9506 +// Copied from `modules/dev-tools/assets/js/deprecation.js`
9507 +/**
9508 + * @typedef {Object} Version
9509 + * @property {number} major1 The first number
9510 + * @property {number} major2 The second number
9511 + * @property {number} minor The third number
9512 + * @property {string} build The fourth number
9513 + */
9514 +var softDeprecated = function softDeprecated(name, version, replacement) {
9515 + if (elementorWebCliConfig.isDebug) {
9516 + deprecatedMessage('soft', name, version, replacement);
9517 + }
9518 +};
9519 +var hardDeprecated = function hardDeprecated(name, version, replacement) {
9520 + deprecatedMessage('hard', name, version, replacement);
9521 +};
9522 +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
9523 + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
9524 + if (replacement) {
9525 + message += " - Use `".concat(replacement, "` instead");
9526 + }
9527 + _console.default.warn(message);
9528 +};
9529 +var Deprecation = /*#__PURE__*/function () {
9530 + function Deprecation() {
9531 + (0, _classCallCheck2.default)(this, Deprecation);
9532 + }
9533 + (0, _createClass2.default)(Deprecation, null, [{
9534 + key: "deprecated",
9535 + value: function deprecated(name, version, replacement) {
9536 + if (this.isHardDeprecated(version)) {
9537 + hardDeprecated(name, version, replacement);
9538 + } else {
9539 + softDeprecated(name, version, replacement);
9540 + }
9541 + }
9542 +
9543 + /**
9544 + * @param {string} version
9545 + *
9546 + * @return {Version}
9547 + */
9548 + }, {
9549 + key: "parseVersion",
9550 + value: function parseVersion(version) {
9551 + var versionParts = version.split('.');
9552 + if (versionParts.length < 3 || versionParts.length > 4) {
9553 + throw new RangeError('Invalid Semantic Version string provided');
9554 + }
9555 + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
9556 + major1 = _versionParts[0],
9557 + major2 = _versionParts[1],
9558 + minor = _versionParts[2],
9559 + _versionParts$ = _versionParts[3],
9560 + build = _versionParts$ === void 0 ? '' : _versionParts$;
9561 + return {
9562 + major1: parseInt(major1),
9563 + major2: parseInt(major2),
9564 + minor: parseInt(minor),
9565 + build: build
9566 + };
9567 + }
9568 +
9569 + /**
9570 + * Get total of major.
9571 + *
9572 + * Since `get_total_major` cannot determine how much really versions between 2.9.0 and 3.3.0 if there is 2.10.0 version for example,
9573 + * versions with major2 more then 9 will be added to total.
9574 + *
9575 + * @param {Version} versionObj
9576 + *
9577 + * @return {number}
9578 + */
9579 + }, {
9580 + key: "getTotalMajor",
9581 + value: function getTotalMajor(versionObj) {
9582 + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
9583 + total = Number((total / 10).toFixed(0));
9584 + if (versionObj.major2 > 9) {
9585 + total = versionObj.major2 - 9;
9586 + }
9587 + return total;
9588 + }
9589 +
9590 + /**
9591 + * @param {string} version1
9592 + * @param {string} version2
9593 + *
9594 + * @return {number}
9595 + */
9596 + }, {
9597 + key: "compareVersion",
9598 + value: function compareVersion(version1, version2) {
9599 + var _this = this;
9600 + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
9601 + return _this.getTotalMajor(versionObj);
9602 + }).reduce(function (acc, major) {
9603 + return acc - major;
9604 + });
9605 + }
9606 +
9607 + /**
9608 + * @param {string} version
9609 + *
9610 + * @return {boolean}
9611 + */
9612 + }, {
9613 + key: "isSoftDeprecated",
9614 + value: function isSoftDeprecated(version) {
9615 + var total = this.compareVersion(version, elementorWebCliConfig.version);
9616 + return total <= 4;
9617 + }
9618 +
9619 + /**
9620 + * @param {string} version
9621 + * @return {boolean}
9622 + */
9623 + }, {
9624 + key: "isHardDeprecated",
9625 + value: function isHardDeprecated(version) {
9626 + var total = this.compareVersion(version, elementorWebCliConfig.version);
9627 + return total < 0 || total >= 8;
9628 + }
9629 + }]);
9630 + return Deprecation;
9631 +}();
9632 +exports["default"] = Deprecation;
9633 +
9634 +/***/ }),
9635 +
9636 +/***/ "../modules/web-cli/assets/js/utils/environment.js":
9637 +/*!*********************************************************!*\
9638 + !*** ../modules/web-cli/assets/js/utils/environment.js ***!
9639 + \*********************************************************/
9640 +/***/ ((__unused_webpack_module, exports) => {
9641 +
9642 +"use strict";
9643 +
9644 +
9645 +Object.defineProperty(exports, "__esModule", ({
9646 + value: true
9647 +}));
9648 +exports["default"] = void 0;
9649 +// TODO: Copied from `core/common/assets/js/utils/environment.js`.
9650 +var matchUserAgent = function matchUserAgent(UserAgentStr) {
9651 + return userAgent.indexOf(UserAgentStr) >= 0;
9652 + },
9653 + userAgent = navigator.userAgent,
9654 + // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
9655 +
9656 + // Opera 8.0+
9657 + isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'),
9658 + // Firefox 1.0+
9659 + isFirefox = matchUserAgent('Firefox'),
9660 + // Safari 3.0+ "[object HTMLElementConstructor]"
9661 + isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) {
9662 + return '[object SafariRemoteNotification]' === p.toString();
9663 + }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification),
9664 + // Internet Explorer 6-11
9665 + isIE = /Trident|MSIE/.test(userAgent) && ( /* @cc_on!@*/ false || !!document.documentMode),
9666 + // Edge 20+
9667 + isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'),
9668 + // Google Chrome (Not accurate)
9669 + isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera),
9670 + // Blink engine
9671 + isBlink = matchUserAgent('Chrome') && !!window.CSS,
9672 + // Apple Webkit engine
9673 + isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink,
9674 + environment = {
9675 + appleWebkit: isAppleWebkit,
9676 + blink: isBlink,
9677 + chrome: isChrome,
9678 + edge: isEdge,
9679 + firefox: isFirefox,
9680 + ie: isIE,
9681 + mac: matchUserAgent('Macintosh'),
9682 + opera: isOpera,
9683 + safari: isSafari,
9684 + webkit: matchUserAgent('AppleWebKit')
9685 + };
9686 +var _default = environment;
9687 +exports["default"] = _default;
9688 +
9689 +/***/ }),
9690 +
9691 +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
9692 +/*!*************************************************************************!*\
9693 + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
9694 + \*************************************************************************/
9695 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9696 +
9697 +"use strict";
9698 +
9699 +
9700 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9701 +Object.defineProperty(exports, "__esModule", ({
9702 + value: true
9703 +}));
9704 +exports["default"] = exports.ForceMethodImplementation = void 0;
9705 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9706 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9707 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
9708 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9709 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9710 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9711 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
9712 +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); }; }
9713 +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; } }
9714 +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
9715 +var ForceMethodImplementation = /*#__PURE__*/function (_Error) {
9716 + (0, _inherits2.default)(ForceMethodImplementation, _Error);
9717 + var _super = _createSuper(ForceMethodImplementation);
9718 + function ForceMethodImplementation() {
9719 + var _this;
9720 + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9721 + (0, _classCallCheck2.default)(this, ForceMethodImplementation);
9722 + _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."));
9723 + Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation);
9724 + return _this;
9725 + }
9726 + return (0, _createClass2.default)(ForceMethodImplementation);
9727 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9728 +exports.ForceMethodImplementation = ForceMethodImplementation;
9729 +var _default = function _default() {
9730 + var stack = Error().stack,
9731 + caller = stack.split('\n')[2].trim(),
9732 + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
9733 + info = {};
9734 + info.functionName = callerName;
9735 + info.fullName = callerName;
9736 + if (info.functionName.includes('.')) {
9737 + var parts = info.functionName.split('.');
9738 + info.className = parts[0];
9739 + info.functionName = parts[1];
9740 + } else {
9741 + info.isStatic = true;
9742 + }
9743 + throw new ForceMethodImplementation(info);
9744 +};
9745 +exports["default"] = _default;
9746 +
9747 +/***/ }),
9748 +
9749 +/***/ "../node_modules/redux-thunk/es/index.js":
9750 +/*!***********************************************!*\
9751 + !*** ../node_modules/redux-thunk/es/index.js ***!
9752 + \***********************************************/
9753 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9754 +
9755 +"use strict";
9756 +__webpack_require__.r(__webpack_exports__);
9757 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9758 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
9759 +/* harmony export */ });
9760 +/** A function that accepts a potential "extra argument" value to be injected later,
9761 + * and returns an instance of the thunk middleware that uses that value
9762 + */
9763 +function createThunkMiddleware(extraArgument) {
9764 + // Standard Redux middleware definition pattern:
9765 + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
9766 + var middleware = function middleware(_ref) {
9767 + var dispatch = _ref.dispatch,
9768 + getState = _ref.getState;
9769 + return function (next) {
9770 + return function (action) {
9771 + // The thunk middleware looks for any functions that were passed to `store.dispatch`.
9772 + // If this "action" is really a function, call it and return the result.
9773 + if (typeof action === 'function') {
9774 + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
9775 + return action(dispatch, getState, extraArgument);
9776 + } // Otherwise, pass the action down the middleware chain as usual
9777 +
9778 +
9779 + return next(action);
9780 + };
9781 + };
9782 + };
9783 +
9784 + return middleware;
9785 +}
9786 +
9787 +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
9788 +// with whatever "extra arg" they want to inject into their thunks
9789 +
9790 +thunk.withExtraArgument = createThunkMiddleware;
9791 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
9792 +
9793 +/***/ }),
9794 +
9795 +/***/ "../node_modules/redux/es/redux.js":
9796 +/*!*****************************************!*\
9797 + !*** ../node_modules/redux/es/redux.js ***!
9798 + \*****************************************/
9799 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9800 +
9801 +"use strict";
9802 +__webpack_require__.r(__webpack_exports__);
9803 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9804 +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes),
9805 +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware),
9806 +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators),
9807 +/* harmony export */ combineReducers: () => (/* binding */ combineReducers),
9808 +/* harmony export */ compose: () => (/* binding */ compose),
9809 +/* harmony export */ createStore: () => (/* binding */ createStore),
9810 +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore)
9811 +/* harmony export */ });
9812 +/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
9813 +
9814 +
9815 +/**
9816 + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
9817 + *
9818 + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
9819 + * during build.
9820 + * @param {number} code
9821 + */
9822 +function formatProdErrorMessage(code) {
9823 + return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
9824 +}
9825 +
9826 +// Inlined version of the `symbol-observable` polyfill
9827 +var $$observable = (function () {
9828 + return typeof Symbol === 'function' && Symbol.observable || '@@observable';
9829 +})();
9830 +
9831 +/**
9832 + * These are private action types reserved by Redux.
9833 + * For any unknown actions, you must return the current state.
9834 + * If the current state is undefined, you must return the initial state.
9835 + * Do not reference these action types directly in your code.
9836 + */
9837 +var randomString = function randomString() {
9838 + return Math.random().toString(36).substring(7).split('').join('.');
9839 +};
9840 +
9841 +var ActionTypes = {
9842 + INIT: "@@redux/INIT" + randomString(),
9843 + REPLACE: "@@redux/REPLACE" + randomString(),
9844 + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
9845 + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
9846 + }
9847 +};
9848 +
9849 +/**
9850 + * @param {any} obj The object to inspect.
9851 + * @returns {boolean} True if the argument appears to be a plain object.
9852 + */
9853 +function isPlainObject(obj) {
9854 + if (typeof obj !== 'object' || obj === null) return false;
9855 + var proto = obj;
9856 +
9857 + while (Object.getPrototypeOf(proto) !== null) {
9858 + proto = Object.getPrototypeOf(proto);
9859 + }
9860 +
9861 + return Object.getPrototypeOf(obj) === proto;
9862 +}
9863 +
9864 +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
9865 +function miniKindOf(val) {
9866 + if (val === void 0) return 'undefined';
9867 + if (val === null) return 'null';
9868 + var type = typeof val;
9869 +
9870 + switch (type) {
9871 + case 'boolean':
9872 + case 'string':
9873 + case 'number':
9874 + case 'symbol':
9875 + case 'function':
9876 + {
9877 + return type;
9878 + }
9879 + }
9880 +
9881 + if (Array.isArray(val)) return 'array';
9882 + if (isDate(val)) return 'date';
9883 + if (isError(val)) return 'error';
9884 + var constructorName = ctorName(val);
9885 +
9886 + switch (constructorName) {
9887 + case 'Symbol':
9888 + case 'Promise':
9889 + case 'WeakMap':
9890 + case 'WeakSet':
9891 + case 'Map':
9892 + case 'Set':
9893 + return constructorName;
9894 + } // other
9895 +
9896 +
9897 + return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
9898 +}
9899 +
9900 +function ctorName(val) {
9901 + return typeof val.constructor === 'function' ? val.constructor.name : null;
9902 +}
9903 +
9904 +function isError(val) {
9905 + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
9906 +}
9907 +
9908 +function isDate(val) {
9909 + if (val instanceof Date) return true;
9910 + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
9911 +}
9912 +
9913 +function kindOf(val) {
9914 + var typeOfVal = typeof val;
9915 +
9916 + if (true) {
9917 + typeOfVal = miniKindOf(val);
9918 + }
9919 +
9920 + return typeOfVal;
9921 +}
9922 +
9923 +/**
9924 + * @deprecated
9925 + *
9926 + * **We recommend using the `configureStore` method
9927 + * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
9928 + *
9929 + * Redux Toolkit is our recommended approach for writing Redux logic today,
9930 + * including store setup, reducers, data fetching, and more.
9931 + *
9932 + * **For more details, please read this Redux docs page:**
9933 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
9934 + *
9935 + * `configureStore` from Redux Toolkit is an improved version of `createStore` that
9936 + * simplifies setup and helps avoid common bugs.
9937 + *
9938 + * You should not be using the `redux` core package by itself today, except for learning purposes.
9939 + * The `createStore` method from the core `redux` package will not be removed, but we encourage
9940 + * all users to migrate to using Redux Toolkit for all Redux code.
9941 + *
9942 + * If you want to use `createStore` without this visual deprecation warning, use
9943 + * the `legacy_createStore` import instead:
9944 + *
9945 + * `import { legacy_createStore as createStore} from 'redux'`
9946 + *
9947 + */
9948 +
9949 +function createStore(reducer, preloadedState, enhancer) {
9950 + var _ref2;
9951 +
9952 + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
9953 + throw new Error( false ? 0 : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
9954 + }
9955 +
9956 + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
9957 + enhancer = preloadedState;
9958 + preloadedState = undefined;
9959 + }
9960 +
9961 + if (typeof enhancer !== 'undefined') {
9962 + if (typeof enhancer !== 'function') {
9963 + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
9964 + }
9965 +
9966 + return enhancer(createStore)(reducer, preloadedState);
9967 + }
9968 +
9969 + if (typeof reducer !== 'function') {
9970 + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
9971 + }
9972 +
9973 + var currentReducer = reducer;
9974 + var currentState = preloadedState;
9975 + var currentListeners = [];
9976 + var nextListeners = currentListeners;
9977 + var isDispatching = false;
9978 + /**
9979 + * This makes a shallow copy of currentListeners so we can use
9980 + * nextListeners as a temporary list while dispatching.
9981 + *
9982 + * This prevents any bugs around consumers calling
9983 + * subscribe/unsubscribe in the middle of a dispatch.
9984 + */
9985 +
9986 + function ensureCanMutateNextListeners() {
9987 + if (nextListeners === currentListeners) {
9988 + nextListeners = currentListeners.slice();
9989 + }
9990 + }
9991 + /**
9992 + * Reads the state tree managed by the store.
9993 + *
9994 + * @returns {any} The current state tree of your application.
9995 + */
9996 +
9997 +
9998 + function getState() {
9999 + if (isDispatching) {
10000 + throw new Error( false ? 0 : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
10001 + }
10002 +
10003 + return currentState;
10004 + }
10005 + /**
10006 + * Adds a change listener. It will be called any time an action is dispatched,
10007 + * and some part of the state tree may potentially have changed. You may then
10008 + * call `getState()` to read the current state tree inside the callback.
10009 + *
10010 + * You may call `dispatch()` from a change listener, with the following
10011 + * caveats:
10012 + *
10013 + * 1. The subscriptions are snapshotted just before every `dispatch()` call.
10014 + * If you subscribe or unsubscribe while the listeners are being invoked, this
10015 + * will not have any effect on the `dispatch()` that is currently in progress.
10016 + * However, the next `dispatch()` call, whether nested or not, will use a more
10017 + * recent snapshot of the subscription list.
10018 + *
10019 + * 2. The listener should not expect to see all state changes, as the state
10020 + * might have been updated multiple times during a nested `dispatch()` before
10021 + * the listener is called. It is, however, guaranteed that all subscribers
10022 + * registered before the `dispatch()` started will be called with the latest
10023 + * state by the time it exits.
10024 + *
10025 + * @param {Function} listener A callback to be invoked on every dispatch.
10026 + * @returns {Function} A function to remove this change listener.
10027 + */
10028 +
10029 +
10030 + function subscribe(listener) {
10031 + if (typeof listener !== 'function') {
10032 + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
10033 + }
10034 +
10035 + if (isDispatching) {
10036 + throw new Error( false ? 0 : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
10037 + }
10038 +
10039 + var isSubscribed = true;
10040 + ensureCanMutateNextListeners();
10041 + nextListeners.push(listener);
10042 + return function unsubscribe() {
10043 + if (!isSubscribed) {
10044 + return;
10045 + }
10046 +
10047 + if (isDispatching) {
10048 + throw new Error( false ? 0 : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
10049 + }
10050 +
10051 + isSubscribed = false;
10052 + ensureCanMutateNextListeners();
10053 + var index = nextListeners.indexOf(listener);
10054 + nextListeners.splice(index, 1);
10055 + currentListeners = null;
10056 + };
10057 + }
10058 + /**
10059 + * Dispatches an action. It is the only way to trigger a state change.
10060 + *
10061 + * The `reducer` function, used to create the store, will be called with the
10062 + * current state tree and the given `action`. Its return value will
10063 + * be considered the **next** state of the tree, and the change listeners
10064 + * will be notified.
10065 + *
10066 + * The base implementation only supports plain object actions. If you want to
10067 + * dispatch a Promise, an Observable, a thunk, or something else, you need to
10068 + * wrap your store creating function into the corresponding middleware. For
10069 + * example, see the documentation for the `redux-thunk` package. Even the
10070 + * middleware will eventually dispatch plain object actions using this method.
10071 + *
10072 + * @param {Object} action A plain object representing “what changed”. It is
10073 + * a good idea to keep actions serializable so you can record and replay user
10074 + * sessions, or use the time travelling `redux-devtools`. An action must have
10075 + * a `type` property which may not be `undefined`. It is a good idea to use
10076 + * string constants for action types.
10077 + *
10078 + * @returns {Object} For convenience, the same action object you dispatched.
10079 + *
10080 + * Note that, if you use a custom middleware, it may wrap `dispatch()` to
10081 + * return something else (for example, a Promise you can await).
10082 + */
10083 +
10084 +
10085 + function dispatch(action) {
10086 + if (!isPlainObject(action)) {
10087 + throw new Error( false ? 0 : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
10088 + }
10089 +
10090 + if (typeof action.type === 'undefined') {
10091 + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
10092 + }
10093 +
10094 + if (isDispatching) {
10095 + throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
10096 + }
10097 +
10098 + try {
10099 + isDispatching = true;
10100 + currentState = currentReducer(currentState, action);
10101 + } finally {
10102 + isDispatching = false;
10103 + }
10104 +
10105 + var listeners = currentListeners = nextListeners;
10106 +
10107 + for (var i = 0; i < listeners.length; i++) {
10108 + var listener = listeners[i];
10109 + listener();
10110 + }
10111 +
10112 + return action;
10113 + }
10114 + /**
10115 + * Replaces the reducer currently used by the store to calculate the state.
10116 + *
10117 + * You might need this if your app implements code splitting and you want to
10118 + * load some of the reducers dynamically. You might also need this if you
10119 + * implement a hot reloading mechanism for Redux.
10120 + *
10121 + * @param {Function} nextReducer The reducer for the store to use instead.
10122 + * @returns {void}
10123 + */
10124 +
10125 +
10126 + function replaceReducer(nextReducer) {
10127 + if (typeof nextReducer !== 'function') {
10128 + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
10129 + }
10130 +
10131 + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
10132 + // Any reducers that existed in both the new and old rootReducer
10133 + // will receive the previous state. This effectively populates
10134 + // the new state tree with any relevant data from the old one.
10135 +
10136 + dispatch({
10137 + type: ActionTypes.REPLACE
10138 + });
10139 + }
10140 + /**
10141 + * Interoperability point for observable/reactive libraries.
10142 + * @returns {observable} A minimal observable of state changes.
10143 + * For more information, see the observable proposal:
10144 + * https://github.com/tc39/proposal-observable
10145 + */
10146 +
10147 +
10148 + function observable() {
10149 + var _ref;
10150 +
10151 + var outerSubscribe = subscribe;
10152 + return _ref = {
10153 + /**
10154 + * The minimal observable subscription method.
10155 + * @param {Object} observer Any object that can be used as an observer.
10156 + * The observer object should have a `next` method.
10157 + * @returns {subscription} An object with an `unsubscribe` method that can
10158 + * be used to unsubscribe the observable from the store, and prevent further
10159 + * emission of values from the observable.
10160 + */
10161 + subscribe: function subscribe(observer) {
10162 + if (typeof observer !== 'object' || observer === null) {
10163 + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
10164 + }
10165 +
10166 + function observeState() {
10167 + if (observer.next) {
10168 + observer.next(getState());
10169 + }
10170 + }
10171 +
10172 + observeState();
10173 + var unsubscribe = outerSubscribe(observeState);
10174 + return {
10175 + unsubscribe: unsubscribe
10176 + };
10177 + }
10178 + }, _ref[$$observable] = function () {
10179 + return this;
10180 + }, _ref;
10181 + } // When a store is created, an "INIT" action is dispatched so that every
10182 + // reducer returns their initial state. This effectively populates
10183 + // the initial state tree.
10184 +
10185 +
10186 + dispatch({
10187 + type: ActionTypes.INIT
10188 + });
10189 + return _ref2 = {
10190 + dispatch: dispatch,
10191 + subscribe: subscribe,
10192 + getState: getState,
10193 + replaceReducer: replaceReducer
10194 + }, _ref2[$$observable] = observable, _ref2;
10195 +}
10196 +/**
10197 + * Creates a Redux store that holds the state tree.
10198 + *
10199 + * **We recommend using `configureStore` from the
10200 + * `@reduxjs/toolkit` package**, which replaces `createStore`:
10201 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
10202 + *
10203 + * The only way to change the data in the store is to call `dispatch()` on it.
10204 + *
10205 + * There should only be a single store in your app. To specify how different
10206 + * parts of the state tree respond to actions, you may combine several reducers
10207 + * into a single reducer function by using `combineReducers`.
10208 + *
10209 + * @param {Function} reducer A function that returns the next state tree, given
10210 + * the current state tree and the action to handle.
10211 + *
10212 + * @param {any} [preloadedState] The initial state. You may optionally specify it
10213 + * to hydrate the state from the server in universal apps, or to restore a
10214 + * previously serialized user session.
10215 + * If you use `combineReducers` to produce the root reducer function, this must be
10216 + * an object with the same shape as `combineReducers` keys.
10217 + *
10218 + * @param {Function} [enhancer] The store enhancer. You may optionally specify it
10219 + * to enhance the store with third-party capabilities such as middleware,
10220 + * time travel, persistence, etc. The only store enhancer that ships with Redux
10221 + * is `applyMiddleware()`.
10222 + *
10223 + * @returns {Store} A Redux store that lets you read the state, dispatch actions
10224 + * and subscribe to changes.
10225 + */
10226 +
10227 +var legacy_createStore = createStore;
10228 +
10229 +/**
10230 + * Prints a warning in the console if it exists.
10231 + *
10232 + * @param {String} message The warning message.
10233 + * @returns {void}
10234 + */
10235 +function warning(message) {
10236 + /* eslint-disable no-console */
10237 + if (typeof console !== 'undefined' && typeof console.error === 'function') {
10238 + console.error(message);
10239 + }
10240 + /* eslint-enable no-console */
10241 +
10242 +
10243 + try {
10244 + // This error was thrown as a convenience so that if you enable
10245 + // "break on all exceptions" in your console,
10246 + // it would pause the execution at this line.
10247 + throw new Error(message);
10248 + } catch (e) {} // eslint-disable-line no-empty
10249 +
10250 +}
10251 +
10252 +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
10253 + var reducerKeys = Object.keys(reducers);
10254 + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
10255 +
10256 + if (reducerKeys.length === 0) {
10257 + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
10258 + }
10259 +
10260 + if (!isPlainObject(inputState)) {
10261 + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
10262 + }
10263 +
10264 + var unexpectedKeys = Object.keys(inputState).filter(function (key) {
10265 + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
10266 + });
10267 + unexpectedKeys.forEach(function (key) {
10268 + unexpectedKeyCache[key] = true;
10269 + });
10270 + if (action && action.type === ActionTypes.REPLACE) return;
10271 +
10272 + if (unexpectedKeys.length > 0) {
10273 + return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
10274 + }
10275 +}
10276 +
10277 +function assertReducerShape(reducers) {
10278 + Object.keys(reducers).forEach(function (key) {
10279 + var reducer = reducers[key];
10280 + var initialState = reducer(undefined, {
10281 + type: ActionTypes.INIT
10282 + });
10283 +
10284 + if (typeof initialState === 'undefined') {
10285 + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
10286 + }
10287 +
10288 + if (typeof reducer(undefined, {
10289 + type: ActionTypes.PROBE_UNKNOWN_ACTION()
10290 + }) === 'undefined') {
10291 + throw new Error( false ? 0 : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
10292 + }
10293 + });
10294 +}
10295 +/**
10296 + * Turns an object whose values are different reducer functions, into a single
10297 + * reducer function. It will call every child reducer, and gather their results
10298 + * into a single state object, whose keys correspond to the keys of the passed
10299 + * reducer functions.
10300 + *
10301 + * @param {Object} reducers An object whose values correspond to different
10302 + * reducer functions that need to be combined into one. One handy way to obtain
10303 + * it is to use ES6 `import * as reducers` syntax. The reducers may never return
10304 + * undefined for any action. Instead, they should return their initial state
10305 + * if the state passed to them was undefined, and the current state for any
10306 + * unrecognized action.
10307 + *
10308 + * @returns {Function} A reducer function that invokes every reducer inside the
10309 + * passed object, and builds a state object with the same shape.
10310 + */
10311 +
10312 +
10313 +function combineReducers(reducers) {
10314 + var reducerKeys = Object.keys(reducers);
10315 + var finalReducers = {};
10316 +
10317 + for (var i = 0; i < reducerKeys.length; i++) {
10318 + var key = reducerKeys[i];
10319 +
10320 + if (true) {
10321 + if (typeof reducers[key] === 'undefined') {
10322 + warning("No reducer provided for key \"" + key + "\"");
10323 + }
10324 + }
10325 +
10326 + if (typeof reducers[key] === 'function') {
10327 + finalReducers[key] = reducers[key];
10328 + }
10329 + }
10330 +
10331 + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
10332 + // keys multiple times.
10333 +
10334 + var unexpectedKeyCache;
10335 +
10336 + if (true) {
10337 + unexpectedKeyCache = {};
10338 + }
10339 +
10340 + var shapeAssertionError;
10341 +
10342 + try {
10343 + assertReducerShape(finalReducers);
10344 + } catch (e) {
10345 + shapeAssertionError = e;
10346 + }
10347 +
10348 + return function combination(state, action) {
10349 + if (state === void 0) {
10350 + state = {};
10351 + }
10352 +
10353 + if (shapeAssertionError) {
10354 + throw shapeAssertionError;
10355 + }
10356 +
10357 + if (true) {
10358 + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
10359 +
10360 + if (warningMessage) {
10361 + warning(warningMessage);
10362 + }
10363 + }
10364 +
10365 + var hasChanged = false;
10366 + var nextState = {};
10367 +
10368 + for (var _i = 0; _i < finalReducerKeys.length; _i++) {
10369 + var _key = finalReducerKeys[_i];
10370 + var reducer = finalReducers[_key];
10371 + var previousStateForKey = state[_key];
10372 + var nextStateForKey = reducer(previousStateForKey, action);
10373 +
10374 + if (typeof nextStateForKey === 'undefined') {
10375 + var actionType = action && action.type;
10376 + throw new Error( false ? 0 : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
10377 + }
10378 +
10379 + nextState[_key] = nextStateForKey;
10380 + hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
10381 + }
10382 +
10383 + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
10384 + return hasChanged ? nextState : state;
10385 + };
10386 +}
10387 +
10388 +function bindActionCreator(actionCreator, dispatch) {
10389 + return function () {
10390 + return dispatch(actionCreator.apply(this, arguments));
10391 + };
10392 +}
10393 +/**
10394 + * Turns an object whose values are action creators, into an object with the
10395 + * same keys, but with every function wrapped into a `dispatch` call so they
10396 + * may be invoked directly. This is just a convenience method, as you can call
10397 + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
10398 + *
10399 + * For convenience, you can also pass an action creator as the first argument,
10400 + * and get a dispatch wrapped function in return.
10401 + *
10402 + * @param {Function|Object} actionCreators An object whose values are action
10403 + * creator functions. One handy way to obtain it is to use ES6 `import * as`
10404 + * syntax. You may also pass a single function.
10405 + *
10406 + * @param {Function} dispatch The `dispatch` function available on your Redux
10407 + * store.
10408 + *
10409 + * @returns {Function|Object} The object mimicking the original object, but with
10410 + * every action creator wrapped into the `dispatch` call. If you passed a
10411 + * function as `actionCreators`, the return value will also be a single
10412 + * function.
10413 + */
10414 +
10415 +
10416 +function bindActionCreators(actionCreators, dispatch) {
10417 + if (typeof actionCreators === 'function') {
10418 + return bindActionCreator(actionCreators, dispatch);
10419 + }
10420 +
10421 + if (typeof actionCreators !== 'object' || actionCreators === null) {
10422 + throw new Error( false ? 0 : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
10423 + }
10424 +
10425 + var boundActionCreators = {};
10426 +
10427 + for (var key in actionCreators) {
10428 + var actionCreator = actionCreators[key];
10429 +
10430 + if (typeof actionCreator === 'function') {
10431 + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
10432 + }
10433 + }
10434 +
10435 + return boundActionCreators;
10436 +}
10437 +
10438 +/**
10439 + * Composes single-argument functions from right to left. The rightmost
10440 + * function can take multiple arguments as it provides the signature for
10441 + * the resulting composite function.
10442 + *
10443 + * @param {...Function} funcs The functions to compose.
10444 + * @returns {Function} A function obtained by composing the argument functions
10445 + * from right to left. For example, compose(f, g, h) is identical to doing
10446 + * (...args) => f(g(h(...args))).
10447 + */
10448 +function compose() {
10449 + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
10450 + funcs[_key] = arguments[_key];
10451 + }
10452 +
10453 + if (funcs.length === 0) {
10454 + return function (arg) {
10455 + return arg;
10456 + };
10457 + }
10458 +
10459 + if (funcs.length === 1) {
10460 + return funcs[0];
10461 + }
10462 +
10463 + return funcs.reduce(function (a, b) {
10464 + return function () {
10465 + return a(b.apply(void 0, arguments));
10466 + };
10467 + });
10468 +}
10469 +
10470 +/**
10471 + * Creates a store enhancer that applies middleware to the dispatch method
10472 + * of the Redux store. This is handy for a variety of tasks, such as expressing
10473 + * asynchronous actions in a concise manner, or logging every action payload.
10474 + *
10475 + * See `redux-thunk` package as an example of the Redux middleware.
10476 + *
10477 + * Because middleware is potentially asynchronous, this should be the first
10478 + * store enhancer in the composition chain.
10479 + *
10480 + * Note that each middleware will be given the `dispatch` and `getState` functions
10481 + * as named arguments.
10482 + *
10483 + * @param {...Function} middlewares The middleware chain to be applied.
10484 + * @returns {Function} A store enhancer applying the middleware.
10485 + */
10486 +
10487 +function applyMiddleware() {
10488 + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
10489 + middlewares[_key] = arguments[_key];
10490 + }
10491 +
10492 + return function (createStore) {
10493 + return function () {
10494 + var store = createStore.apply(void 0, arguments);
10495 +
10496 + var _dispatch = function dispatch() {
10497 + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
10498 + };
10499 +
10500 + var middlewareAPI = {
10501 + getState: store.getState,
10502 + dispatch: function dispatch() {
10503 + return _dispatch.apply(void 0, arguments);
10504 + }
10505 + };
10506 + var chain = middlewares.map(function (middleware) {
10507 + return middleware(middlewareAPI);
10508 + });
10509 + _dispatch = compose.apply(void 0, chain)(store.dispatch);
10510 + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
10511 + dispatch: _dispatch
10512 + });
10513 + };
10514 + };
10515 +}
10516 +
10517 +
10518 +
10519 +
10520 +/***/ }),
10521 +
10522 +/***/ "../node_modules/reselect/es/defaultMemoize.js":
10523 +/*!*****************************************************!*\
10524 + !*** ../node_modules/reselect/es/defaultMemoize.js ***!
10525 + \*****************************************************/
10526 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10527 +
10528 +"use strict";
10529 +__webpack_require__.r(__webpack_exports__);
10530 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10531 +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator),
10532 +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck),
10533 +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize)
10534 +/* harmony export */ });
10535 +// Cache implementation based on Erik Rasmussen's `lru-memoize`:
10536 +// https://github.com/erikras/lru-memoize
10537 +var NOT_FOUND = 'NOT_FOUND';
10538 +
10539 +function createSingletonCache(equals) {
10540 + var entry;
10541 + return {
10542 + get: function get(key) {
10543 + if (entry && equals(entry.key, key)) {
10544 + return entry.value;
10545 + }
10546 +
10547 + return NOT_FOUND;
10548 + },
10549 + put: function put(key, value) {
10550 + entry = {
10551 + key: key,
10552 + value: value
10553 + };
10554 + },
10555 + getEntries: function getEntries() {
10556 + return entry ? [entry] : [];
10557 + },
10558 + clear: function clear() {
10559 + entry = undefined;
10560 + }
10561 + };
10562 +}
10563 +
10564 +function createLruCache(maxSize, equals) {
10565 + var entries = [];
10566 +
10567 + function get(key) {
10568 + var cacheIndex = entries.findIndex(function (entry) {
10569 + return equals(key, entry.key);
10570 + }); // We found a cached entry
10571 +
10572 + if (cacheIndex > -1) {
10573 + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
10574 +
10575 + if (cacheIndex > 0) {
10576 + entries.splice(cacheIndex, 1);
10577 + entries.unshift(entry);
10578 + }
10579 +
10580 + return entry.value;
10581 + } // No entry found in cache, return sentinel
10582 +
10583 +
10584 + return NOT_FOUND;
10585 + }
10586 +
10587 + function put(key, value) {
10588 + if (get(key) === NOT_FOUND) {
10589 + // TODO Is unshift slow?
10590 + entries.unshift({
10591 + key: key,
10592 + value: value
10593 + });
10594 +
10595 + if (entries.length > maxSize) {
10596 + entries.pop();
10597 + }
10598 + }
10599 + }
10600 +
10601 + function getEntries() {
10602 + return entries;
10603 + }
10604 +
10605 + function clear() {
10606 + entries = [];
10607 + }
10608 +
10609 + return {
10610 + get: get,
10611 + put: put,
10612 + getEntries: getEntries,
10613 + clear: clear
10614 + };
10615 +}
10616 +
10617 +var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
10618 + return a === b;
10619 +};
10620 +function createCacheKeyComparator(equalityCheck) {
10621 + return function areArgumentsShallowlyEqual(prev, next) {
10622 + if (prev === null || next === null || prev.length !== next.length) {
10623 + return false;
10624 + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
10625 +
10626 +
10627 + var length = prev.length;
10628 +
10629 + for (var i = 0; i < length; i++) {
10630 + if (!equalityCheck(prev[i], next[i])) {
10631 + return false;
10632 + }
10633 + }
10634 +
10635 + return true;
10636 + };
10637 +}
10638 +// defaultMemoize now supports a configurable cache size with LRU behavior,
10639 +// and optional comparison of the result value with existing values
10640 +function defaultMemoize(func, equalityCheckOrOptions) {
10641 + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
10642 + equalityCheck: equalityCheckOrOptions
10643 + };
10644 + var _providedOptions$equa = providedOptions.equalityCheck,
10645 + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
10646 + _providedOptions$maxS = providedOptions.maxSize,
10647 + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
10648 + resultEqualityCheck = providedOptions.resultEqualityCheck;
10649 + var comparator = createCacheKeyComparator(equalityCheck);
10650 + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
10651 +
10652 + function memoized() {
10653 + var value = cache.get(arguments);
10654 +
10655 + if (value === NOT_FOUND) {
10656 + // @ts-ignore
10657 + value = func.apply(null, arguments);
10658 +
10659 + if (resultEqualityCheck) {
10660 + var entries = cache.getEntries();
10661 + var matchingEntry = entries.find(function (entry) {
10662 + return resultEqualityCheck(entry.value, value);
10663 + });
10664 +
10665 + if (matchingEntry) {
10666 + value = matchingEntry.value;
10667 + }
10668 + }
10669 +
10670 + cache.put(arguments, value);
10671 + }
10672 +
10673 + return value;
10674 + }
10675 +
10676 + memoized.clearCache = function () {
10677 + return cache.clear();
10678 + };
10679 +
10680 + return memoized;
10681 +}
10682 +
10683 +/***/ }),
10684 +
10685 +/***/ "../node_modules/reselect/es/index.js":
10686 +/*!********************************************!*\
10687 + !*** ../node_modules/reselect/es/index.js ***!
10688 + \********************************************/
10689 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10690 +
10691 +"use strict";
10692 +__webpack_require__.r(__webpack_exports__);
10693 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10694 +/* harmony export */ createSelector: () => (/* binding */ createSelector),
10695 +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator),
10696 +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector),
10697 +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
10698 +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
10699 +/* harmony export */ });
10700 +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
10701 +
10702 +
10703 +
10704 +function getDependencies(funcs) {
10705 + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
10706 +
10707 + if (!dependencies.every(function (dep) {
10708 + return typeof dep === 'function';
10709 + })) {
10710 + var dependencyTypes = dependencies.map(function (dep) {
10711 + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
10712 + }).join(', ');
10713 + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
10714 + }
10715 +
10716 + return dependencies;
10717 +}
10718 +
10719 +function createSelectorCreator(memoize) {
10720 + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10721 + memoizeOptionsFromArgs[_key - 1] = arguments[_key];
10722 + }
10723 +
10724 + var createSelector = function createSelector() {
10725 + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
10726 + funcs[_key2] = arguments[_key2];
10727 + }
10728 +
10729 + var _recomputations = 0;
10730 +
10731 + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
10732 + // So, start by declaring the default value here.
10733 + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
10734 +
10735 +
10736 + var directlyPassedOptions = {
10737 + memoizeOptions: undefined
10738 + }; // Normally, the result func or "output selector" is the last arg
10739 +
10740 + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
10741 +
10742 + if (typeof resultFunc === 'object') {
10743 + directlyPassedOptions = resultFunc; // and pop the real result func off
10744 +
10745 + resultFunc = funcs.pop();
10746 + }
10747 +
10748 + if (typeof resultFunc !== 'function') {
10749 + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
10750 + } // Determine which set of options we're using. Prefer options passed directly,
10751 + // but fall back to options given to createSelectorCreator.
10752 +
10753 +
10754 + var _directlyPassedOption = directlyPassedOptions,
10755 + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
10756 + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
10757 + // is an array. In most libs I've looked at, it's an equality function or options object.
10758 + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
10759 + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
10760 + // we wrap it in an array so we can apply it.
10761 +
10762 + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
10763 + var dependencies = getDependencies(funcs);
10764 + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
10765 + _recomputations++; // apply arguments instead of spreading for performance.
10766 +
10767 + return resultFunc.apply(null, arguments);
10768 + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
10769 +
10770 + var selector = memoize(function dependenciesChecker() {
10771 + var params = [];
10772 + var length = dependencies.length;
10773 +
10774 + for (var i = 0; i < length; i++) {
10775 + // apply arguments instead of spreading and mutate a local list of params for performance.
10776 + // @ts-ignore
10777 + params.push(dependencies[i].apply(null, arguments));
10778 + } // apply arguments instead of spreading for performance.
10779 +
10780 +
10781 + _lastResult = memoizedResultFunc.apply(null, params);
10782 + return _lastResult;
10783 + });
10784 + Object.assign(selector, {
10785 + resultFunc: resultFunc,
10786 + memoizedResultFunc: memoizedResultFunc,
10787 + dependencies: dependencies,
10788 + lastResult: function lastResult() {
10789 + return _lastResult;
10790 + },
10791 + recomputations: function recomputations() {
10792 + return _recomputations;
10793 + },
10794 + resetRecomputations: function resetRecomputations() {
10795 + return _recomputations = 0;
10796 + }
10797 + });
10798 + return selector;
10799 + }; // @ts-ignore
10800 +
10801 +
10802 + return createSelector;
10803 +}
10804 +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
10805 +// Manual definition of state and output arguments
10806 +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
10807 + if (selectorCreator === void 0) {
10808 + selectorCreator = createSelector;
10809 + }
10810 +
10811 + if (typeof selectors !== 'object') {
10812 + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
10813 + }
10814 +
10815 + var objectKeys = Object.keys(selectors);
10816 + var resultSelector = selectorCreator( // @ts-ignore
10817 + objectKeys.map(function (key) {
10818 + return selectors[key];
10819 + }), function () {
10820 + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
10821 + values[_key3] = arguments[_key3];
10822 + }
10823 +
10824 + return values.reduce(function (composition, value, index) {
10825 + composition[objectKeys[index]] = value;
10826 + return composition;
10827 + }, {});
10828 + });
10829 + return resultSelector;
10830 +};
10831 +
10832 +/***/ }),
10833 +
10834 +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
10835 +/*!******************************************************************!*\
10836 + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
10837 + \******************************************************************/
10838 +/***/ ((module) => {
10839 +
10840 +function _arrayLikeToArray(arr, len) {
10841 + if (len == null || len > arr.length) len = arr.length;
10842 + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
10843 + return arr2;
10844 +}
10845 +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
10846 +
10847 +/***/ }),
10848 +
10849 +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
10850 +/*!****************************************************************!*\
10851 + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
10852 + \****************************************************************/
10853 +/***/ ((module) => {
10854 +
10855 +function _arrayWithHoles(arr) {
10856 + if (Array.isArray(arr)) return arr;
10857 +}
10858 +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
10859 +
10860 +/***/ }),
10861 +
10862 +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
10863 +/*!***********************************************************************!*\
10864 + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
10865 + \***********************************************************************/
10866 +/***/ ((module) => {
10867 +
10868 +function _assertThisInitialized(self) {
10869 + if (self === void 0) {
10870 + throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10871 + }
10872 + return self;
10873 +}
10874 +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
10875 +
10876 +/***/ }),
10877 +
10878 +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
10879 +/*!******************************************************************!*\
10880 + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
10881 + \******************************************************************/
10882 +/***/ ((module) => {
10883 +
10884 +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10885 + try {
10886 + var info = gen[key](arg);
10887 + var value = info.value;
10888 + } catch (error) {
10889 + reject(error);
10890 + return;
10891 + }
10892 + if (info.done) {
10893 + resolve(value);
10894 + } else {
10895 + Promise.resolve(value).then(_next, _throw);
10896 + }
10897 +}
10898 +function _asyncToGenerator(fn) {
10899 + return function () {
10900 + var self = this,
10901 + args = arguments;
10902 + return new Promise(function (resolve, reject) {
10903 + var gen = fn.apply(self, args);
10904 + function _next(value) {
10905 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
10906 + }
10907 + function _throw(err) {
10908 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
10909 + }
10910 + _next(undefined);
10911 + });
10912 + };
10913 +}
10914 +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
10915 +
10916 +/***/ }),
10917 +
10918 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
10919 +/*!****************************************************************!*\
10920 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
10921 + \****************************************************************/
10922 +/***/ ((module) => {
10923 +
10924 +function _classCallCheck(instance, Constructor) {
10925 + if (!(instance instanceof Constructor)) {
10926 + throw new TypeError("Cannot call a class as a function");
10927 + }
10928 +}
10929 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
10930 +
10931 +/***/ }),
10932 +
10933 +/***/ "../node_modules/@babel/runtime/helpers/construct.js":
10934 +/*!***********************************************************!*\
10935 + !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
10936 + \***********************************************************/
10937 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10938 +
10939 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
10940 +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
10941 +function _construct(t, e, r) {
10942 + if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
10943 + var o = [null];
10944 + o.push.apply(o, e);
10945 + var p = new (t.bind.apply(t, o))();
10946 + return r && setPrototypeOf(p, r.prototype), p;
10947 +}
10948 +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
10949 +
10950 +/***/ }),
10951 +
10952 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
10953 +/*!*************************************************************!*\
10954 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
10955 + \*************************************************************/
10956 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10957 +
10958 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
10959 +function _defineProperties(target, props) {
10960 + for (var i = 0; i < props.length; i++) {
10961 + var descriptor = props[i];
10962 + descriptor.enumerable = descriptor.enumerable || false;
10963 + descriptor.configurable = true;
10964 + if ("value" in descriptor) descriptor.writable = true;
10965 + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
10966 + }
10967 +}
10968 +function _createClass(Constructor, protoProps, staticProps) {
10969 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
10970 + if (staticProps) _defineProperties(Constructor, staticProps);
10971 + Object.defineProperty(Constructor, "prototype", {
10972 + writable: false
10973 + });
10974 + return Constructor;
10975 +}
10976 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
10977 +
10978 +/***/ }),
10979 +
10980 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
10981 +/*!****************************************************************!*\
10982 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
10983 + \****************************************************************/
10984 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10985 +
10986 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
10987 +function _defineProperty(obj, key, value) {
10988 + key = toPropertyKey(key);
10989 + if (key in obj) {
10990 + Object.defineProperty(obj, key, {
10991 + value: value,
10992 + enumerable: true,
10993 + configurable: true,
10994 + writable: true
10995 + });
10996 + } else {
10997 + obj[key] = value;
10998 + }
10999 + return obj;
11000 +}
11001 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
11002 +
11003 +/***/ }),
11004 +
11005 +/***/ "../node_modules/@babel/runtime/helpers/get.js":
11006 +/*!*****************************************************!*\
11007 + !*** ../node_modules/@babel/runtime/helpers/get.js ***!
11008 + \*****************************************************/
11009 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11010 +
11011 +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
11012 +function _get() {
11013 + if (typeof Reflect !== "undefined" && Reflect.get) {
11014 + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
11015 + } else {
11016 + module.exports = _get = function _get(target, property, receiver) {
11017 + var base = superPropBase(target, property);
11018 + if (!base) return;
11019 + var desc = Object.getOwnPropertyDescriptor(base, property);
11020 + if (desc.get) {
11021 + return desc.get.call(arguments.length < 3 ? target : receiver);
11022 + }
11023 + return desc.value;
11024 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11025 + }
11026 + return _get.apply(this, arguments);
11027 +}
11028 +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
11029 +
11030 +/***/ }),
11031 +
11032 +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
11033 +/*!****************************************************************!*\
11034 + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
11035 + \****************************************************************/
11036 +/***/ ((module) => {
11037 +
11038 +function _getPrototypeOf(o) {
11039 + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
11040 + return o.__proto__ || Object.getPrototypeOf(o);
11041 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11042 + return _getPrototypeOf(o);
11043 +}
11044 +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11045 +
11046 +/***/ }),
11047 +
11048 +/***/ "../node_modules/@babel/runtime/helpers/inherits.js":
11049 +/*!**********************************************************!*\
11050 + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
11051 + \**********************************************************/
11052 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11053 +
11054 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11055 +function _inherits(subClass, superClass) {
11056 + if (typeof superClass !== "function" && superClass !== null) {
11057 + throw new TypeError("Super expression must either be null or a function");
11058 + }
11059 + subClass.prototype = Object.create(superClass && superClass.prototype, {
11060 + constructor: {
11061 + value: subClass,
11062 + writable: true,
11063 + configurable: true
11064 + }
11065 + });
11066 + Object.defineProperty(subClass, "prototype", {
11067 + writable: false
11068 + });
11069 + if (superClass) setPrototypeOf(subClass, superClass);
11070 +}
11071 +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
11072 +
11073 +/***/ }),
11074 +
11075 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
11076 +/*!***********************************************************************!*\
11077 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
11078 + \***********************************************************************/
11079 +/***/ ((module) => {
11080 +
11081 +function _interopRequireDefault(obj) {
11082 + return obj && obj.__esModule ? obj : {
11083 + "default": obj
11084 + };
11085 +}
11086 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
11087 +
11088 +/***/ }),
11089 +
11090 +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
11091 +/*!******************************************************************!*\
11092 + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
11093 + \******************************************************************/
11094 +/***/ ((module) => {
11095 +
11096 +function _isNativeFunction(fn) {
11097 + try {
11098 + return Function.toString.call(fn).indexOf("[native code]") !== -1;
11099 + } catch (e) {
11100 + return typeof fn === "function";
11101 + }
11102 +}
11103 +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
11104 +
11105 +/***/ }),
11106 +
11107 +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
11108 +/*!**************************************************************************!*\
11109 + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
11110 + \**************************************************************************/
11111 +/***/ ((module) => {
11112 +
11113 +function _isNativeReflectConstruct() {
11114 + try {
11115 + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
11116 + } catch (t) {}
11117 + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
11118 + return !!t;
11119 + }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
11120 +}
11121 +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
11122 +
11123 +/***/ }),
11124 +
11125 +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
11126 +/*!**********************************************************************!*\
11127 + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
11128 + \**********************************************************************/
11129 +/***/ ((module) => {
11130 +
11131 +function _iterableToArrayLimit(r, l) {
11132 + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
11133 + if (null != t) {
11134 + var e,
11135 + n,
11136 + i,
11137 + u,
11138 + a = [],
11139 + f = !0,
11140 + o = !1;
11141 + try {
11142 + if (i = (t = t.call(r)).next, 0 === l) {
11143 + if (Object(t) !== t) return;
11144 + f = !1;
11145 + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
11146 + } catch (r) {
11147 + o = !0, n = r;
11148 + } finally {
11149 + try {
11150 + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
11151 + } finally {
11152 + if (o) throw n;
11153 + }
11154 + }
11155 + return a;
11156 + }
11157 +}
11158 +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
11159 +
11160 +/***/ }),
11161 +
11162 +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
11163 +/*!*****************************************************************!*\
11164 + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
11165 + \*****************************************************************/
11166 +/***/ ((module) => {
11167 +
11168 +function _nonIterableRest() {
11169 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11170 +}
11171 +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
11172 +
11173 +/***/ }),
11174 +
11175 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
11176 +/*!***************************************************************************!*\
11177 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
11178 + \***************************************************************************/
11179 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11180 +
11181 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11182 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
11183 +function _possibleConstructorReturn(self, call) {
11184 + if (call && (_typeof(call) === "object" || typeof call === "function")) {
11185 + return call;
11186 + } else if (call !== void 0) {
11187 + throw new TypeError("Derived constructors may only return object or undefined");
11188 + }
11189 + return assertThisInitialized(self);
11190 +}
11191 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
11192 +
11193 +/***/ }),
11194 +
11195 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
11196 +/*!********************************************************************!*\
11197 + !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
11198 + \********************************************************************/
11199 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11200 +
11201 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11202 +function _regeneratorRuntime() {
11203 + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11204 + module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
11205 + return e;
11206 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11207 + var t,
11208 + e = {},
11209 + r = Object.prototype,
11210 + n = r.hasOwnProperty,
11211 + o = Object.defineProperty || function (t, e, r) {
11212 + t[e] = r.value;
11213 + },
11214 + i = "function" == typeof Symbol ? Symbol : {},
11215 + a = i.iterator || "@@iterator",
11216 + c = i.asyncIterator || "@@asyncIterator",
11217 + u = i.toStringTag || "@@toStringTag";
11218 + function define(t, e, r) {
11219 + return Object.defineProperty(t, e, {
11220 + value: r,
11221 + enumerable: !0,
11222 + configurable: !0,
11223 + writable: !0
11224 + }), t[e];
11225 + }
11226 + try {
11227 + define({}, "");
11228 + } catch (t) {
11229 + define = function define(t, e, r) {
11230 + return t[e] = r;
11231 + };
11232 + }
11233 + function wrap(t, e, r, n) {
11234 + var i = e && e.prototype instanceof Generator ? e : Generator,
11235 + a = Object.create(i.prototype),
11236 + c = new Context(n || []);
11237 + return o(a, "_invoke", {
11238 + value: makeInvokeMethod(t, r, c)
11239 + }), a;
11240 + }
11241 + function tryCatch(t, e, r) {
11242 + try {
11243 + return {
11244 + type: "normal",
11245 + arg: t.call(e, r)
11246 + };
11247 + } catch (t) {
11248 + return {
11249 + type: "throw",
11250 + arg: t
11251 + };
11252 + }
11253 + }
11254 + e.wrap = wrap;
11255 + var h = "suspendedStart",
11256 + l = "suspendedYield",
11257 + f = "executing",
11258 + s = "completed",
11259 + y = {};
11260 + function Generator() {}
11261 + function GeneratorFunction() {}
11262 + function GeneratorFunctionPrototype() {}
11263 + var p = {};
11264 + define(p, a, function () {
11265 + return this;
11266 + });
11267 + var d = Object.getPrototypeOf,
11268 + v = d && d(d(values([])));
11269 + v && v !== r && n.call(v, a) && (p = v);
11270 + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
11271 + function defineIteratorMethods(t) {
11272 + ["next", "throw", "return"].forEach(function (e) {
11273 + define(t, e, function (t) {
11274 + return this._invoke(e, t);
11275 + });
11276 + });
11277 + }
11278 + function AsyncIterator(t, e) {
11279 + function invoke(r, o, i, a) {
11280 + var c = tryCatch(t[r], t, o);
11281 + if ("throw" !== c.type) {
11282 + var u = c.arg,
11283 + h = u.value;
11284 + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
11285 + invoke("next", t, i, a);
11286 + }, function (t) {
11287 + invoke("throw", t, i, a);
11288 + }) : e.resolve(h).then(function (t) {
11289 + u.value = t, i(u);
11290 + }, function (t) {
11291 + return invoke("throw", t, i, a);
11292 + });
11293 + }
11294 + a(c.arg);
11295 + }
11296 + var r;
11297 + o(this, "_invoke", {
11298 + value: function value(t, n) {
11299 + function callInvokeWithMethodAndArg() {
11300 + return new e(function (e, r) {
11301 + invoke(t, n, e, r);
11302 + });
11303 + }
11304 + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
11305 + }
11306 + });
11307 + }
11308 + function makeInvokeMethod(e, r, n) {
11309 + var o = h;
11310 + return function (i, a) {
11311 + if (o === f) throw new Error("Generator is already running");
11312 + if (o === s) {
11313 + if ("throw" === i) throw a;
11314 + return {
11315 + value: t,
11316 + done: !0
11317 + };
11318 + }
11319 + for (n.method = i, n.arg = a;;) {
11320 + var c = n.delegate;
11321 + if (c) {
11322 + var u = maybeInvokeDelegate(c, n);
11323 + if (u) {
11324 + if (u === y) continue;
11325 + return u;
11326 + }
11327 + }
11328 + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
11329 + if (o === h) throw o = s, n.arg;
11330 + n.dispatchException(n.arg);
11331 + } else "return" === n.method && n.abrupt("return", n.arg);
11332 + o = f;
11333 + var p = tryCatch(e, r, n);
11334 + if ("normal" === p.type) {
11335 + if (o = n.done ? s : l, p.arg === y) continue;
11336 + return {
11337 + value: p.arg,
11338 + done: n.done
11339 + };
11340 + }
11341 + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
11342 + }
11343 + };
11344 + }
11345 + function maybeInvokeDelegate(e, r) {
11346 + var n = r.method,
11347 + o = e.iterator[n];
11348 + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
11349 + var i = tryCatch(o, e.iterator, r.arg);
11350 + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
11351 + var a = i.arg;
11352 + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
11353 + }
11354 + function pushTryEntry(t) {
11355 + var e = {
11356 + tryLoc: t[0]
11357 + };
11358 + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
11359 + }
11360 + function resetTryEntry(t) {
11361 + var e = t.completion || {};
11362 + e.type = "normal", delete e.arg, t.completion = e;
11363 + }
11364 + function Context(t) {
11365 + this.tryEntries = [{
11366 + tryLoc: "root"
11367 + }], t.forEach(pushTryEntry, this), this.reset(!0);
11368 + }
11369 + function values(e) {
11370 + if (e || "" === e) {
11371 + var r = e[a];
11372 + if (r) return r.call(e);
11373 + if ("function" == typeof e.next) return e;
11374 + if (!isNaN(e.length)) {
11375 + var o = -1,
11376 + i = function next() {
11377 + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
11378 + return next.value = t, next.done = !0, next;
11379 + };
11380 + return i.next = i;
11381 + }
11382 + }
11383 + throw new TypeError(_typeof(e) + " is not iterable");
11384 + }
11385 + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
11386 + value: GeneratorFunctionPrototype,
11387 + configurable: !0
11388 + }), o(GeneratorFunctionPrototype, "constructor", {
11389 + value: GeneratorFunction,
11390 + configurable: !0
11391 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
11392 + var e = "function" == typeof t && t.constructor;
11393 + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
11394 + }, e.mark = function (t) {
11395 + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
11396 + }, e.awrap = function (t) {
11397 + return {
11398 + __await: t
11399 + };
11400 + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
11401 + return this;
11402 + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
11403 + void 0 === i && (i = Promise);
11404 + var a = new AsyncIterator(wrap(t, r, n, o), i);
11405 + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
11406 + return t.done ? t.value : a.next();
11407 + });
11408 + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
11409 + return this;
11410 + }), define(g, "toString", function () {
11411 + return "[object Generator]";
11412 + }), e.keys = function (t) {
11413 + var e = Object(t),
11414 + r = [];
11415 + for (var n in e) r.push(n);
11416 + return r.reverse(), function next() {
11417 + for (; r.length;) {
11418 + var t = r.pop();
11419 + if (t in e) return next.value = t, next.done = !1, next;
11420 + }
11421 + return next.done = !0, next;
11422 + };
11423 + }, e.values = values, Context.prototype = {
11424 + constructor: Context,
11425 + reset: function reset(e) {
11426 + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
11427 + },
11428 + stop: function stop() {
11429 + this.done = !0;
11430 + var t = this.tryEntries[0].completion;
11431 + if ("throw" === t.type) throw t.arg;
11432 + return this.rval;
11433 + },
11434 + dispatchException: function dispatchException(e) {
11435 + if (this.done) throw e;
11436 + var r = this;
11437 + function handle(n, o) {
11438 + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
11439 + }
11440 + for (var o = this.tryEntries.length - 1; o >= 0; --o) {
11441 + var i = this.tryEntries[o],
11442 + a = i.completion;
11443 + if ("root" === i.tryLoc) return handle("end");
11444 + if (i.tryLoc <= this.prev) {
11445 + var c = n.call(i, "catchLoc"),
11446 + u = n.call(i, "finallyLoc");
11447 + if (c && u) {
11448 + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
11449 + if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
11450 + } else if (c) {
11451 + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
11452 + } else {
11453 + if (!u) throw new Error("try statement without catch or finally");
11454 + if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
11455 + }
11456 + }
11457 + }
11458 + },
11459 + abrupt: function abrupt(t, e) {
11460 + for (var r = this.tryEntries.length - 1; r >= 0; --r) {
11461 + var o = this.tryEntries[r];
11462 + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
11463 + var i = o;
11464 + break;
11465 + }
11466 + }
11467 + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
11468 + var a = i ? i.completion : {};
11469 + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
11470 + },
11471 + complete: function complete(t, e) {
11472 + if ("throw" === t.type) throw t.arg;
11473 + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
11474 + },
11475 + finish: function finish(t) {
11476 + for (var e = this.tryEntries.length - 1; e >= 0; --e) {
11477 + var r = this.tryEntries[e];
11478 + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
11479 + }
11480 + },
11481 + "catch": function _catch(t) {
11482 + for (var e = this.tryEntries.length - 1; e >= 0; --e) {
11483 + var r = this.tryEntries[e];
11484 + if (r.tryLoc === t) {
11485 + var n = r.completion;
11486 + if ("throw" === n.type) {
11487 + var o = n.arg;
11488 + resetTryEntry(r);
11489 + }
11490 + return o;
11491 + }
11492 + }
11493 + throw new Error("illegal catch attempt");
11494 + },
11495 + delegateYield: function delegateYield(e, r, n) {
11496 + return this.delegate = {
11497 + iterator: values(e),
11498 + resultName: r,
11499 + nextLoc: n
11500 + }, "next" === this.method && (this.arg = t), y;
11501 + }
11502 + }, e;
11503 +}
11504 +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
11505 +
11506 +/***/ }),
11507 +
11508 +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
11509 +/*!****************************************************************!*\
11510 + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
11511 + \****************************************************************/
11512 +/***/ ((module) => {
11513 +
11514 +function _setPrototypeOf(o, p) {
11515 + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
11516 + o.__proto__ = p;
11517 + return o;
11518 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11519 + return _setPrototypeOf(o, p);
11520 +}
11521 +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11522 +
11523 +/***/ }),
11524 +
11525 +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
11526 +/*!***************************************************************!*\
11527 + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
11528 + \***************************************************************/
11529 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11530 +
11531 +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
11532 +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
11533 +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
11534 +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
11535 +function _slicedToArray(arr, i) {
11536 + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11537 +}
11538 +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11539 +
11540 +/***/ }),
11541 +
11542 +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
11543 +/*!***************************************************************!*\
11544 + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
11545 + \***************************************************************/
11546 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11547 +
11548 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11549 +function _superPropBase(object, property) {
11550 + while (!Object.prototype.hasOwnProperty.call(object, property)) {
11551 + object = getPrototypeOf(object);
11552 + if (object === null) break;
11553 + }
11554 + return object;
11555 +}
11556 +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
11557 +
11558 +/***/ }),
11559 +
11560 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
11561 +/*!*************************************************************!*\
11562 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
11563 + \*************************************************************/
11564 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11565 +
11566 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11567 +function toPrimitive(t, r) {
11568 + if ("object" != _typeof(t) || !t) return t;
11569 + var e = t[Symbol.toPrimitive];
11570 + if (void 0 !== e) {
11571 + var i = e.call(t, r || "default");
11572 + if ("object" != _typeof(i)) return i;
11573 + throw new TypeError("@@toPrimitive must return a primitive value.");
11574 + }
11575 + return ("string" === r ? String : Number)(t);
11576 +}
11577 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
11578 +
11579 +/***/ }),
11580 +
11581 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
11582 +/*!***************************************************************!*\
11583 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
11584 + \***************************************************************/
11585 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11586 +
11587 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11588 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
11589 +function toPropertyKey(t) {
11590 + var i = toPrimitive(t, "string");
11591 + return "symbol" == _typeof(i) ? i : String(i);
11592 +}
11593 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
11594 +
11595 +/***/ }),
11596 +
11597 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
11598 +/*!********************************************************!*\
11599 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
11600 + \********************************************************/
11601 +/***/ ((module) => {
11602 +
11603 +function _typeof(o) {
11604 + "@babel/helpers - typeof";
11605 +
11606 + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
11607 + return typeof o;
11608 + } : function (o) {
11609 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
11610 + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
11611 +}
11612 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
11613 +
11614 +/***/ }),
11615 +
11616 +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
11617 +/*!****************************************************************************!*\
11618 + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
11619 + \****************************************************************************/
11620 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11621 +
11622 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
11623 +function _unsupportedIterableToArray(o, minLen) {
11624 + if (!o) return;
11625 + if (typeof o === "string") return arrayLikeToArray(o, minLen);
11626 + var n = Object.prototype.toString.call(o).slice(8, -1);
11627 + if (n === "Object" && o.constructor) n = o.constructor.name;
11628 + if (n === "Map" || n === "Set") return Array.from(o);
11629 + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
11630 +}
11631 +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11632 +
11633 +/***/ }),
11634 +
11635 +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
11636 +/*!*****************************************************************!*\
11637 + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
11638 + \*****************************************************************/
11639 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11640 +
11641 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11642 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11643 +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
11644 +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
11645 +function _wrapNativeSuper(Class) {
11646 + var _cache = typeof Map === "function" ? new Map() : undefined;
11647 + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
11648 + if (Class === null || !isNativeFunction(Class)) return Class;
11649 + if (typeof Class !== "function") {
11650 + throw new TypeError("Super expression must either be null or a function");
11651 + }
11652 + if (typeof _cache !== "undefined") {
11653 + if (_cache.has(Class)) return _cache.get(Class);
11654 + _cache.set(Class, Wrapper);
11655 + }
11656 + function Wrapper() {
11657 + return construct(Class, arguments, getPrototypeOf(this).constructor);
11658 + }
11659 + Wrapper.prototype = Object.create(Class.prototype, {
11660 + constructor: {
11661 + value: Wrapper,
11662 + enumerable: false,
11663 + writable: true,
11664 + configurable: true
11665 + }
11666 + });
11667 + return setPrototypeOf(Wrapper, Class);
11668 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11669 + return _wrapNativeSuper(Class);
11670 +}
11671 +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
11672 +
11673 +/***/ }),
11674 +
11675 +/***/ "../node_modules/@babel/runtime/regenerator/index.js":
11676 +/*!***********************************************************!*\
11677 + !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
11678 + \***********************************************************/
11679 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11680 +
11681 +// TODO(Babel 8): Remove this file.
11682 +
11683 +var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
11684 +module.exports = runtime;
11685 +
11686 +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
11687 +try {
11688 + regeneratorRuntime = runtime;
11689 +} catch (accidentalStrictMode) {
11690 + if (typeof globalThis === "object") {
11691 + globalThis.regeneratorRuntime = runtime;
11692 + } else {
11693 + Function("r", "regeneratorRuntime = r")(runtime);
11694 + }
11695 +}
11696 +
11697 +
11698 +/***/ }),
11699 +
11700 +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
11701 +/*!********************************************************************!*\
11702 + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
11703 + \********************************************************************/
11704 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11705 +
11706 +"use strict";
11707 +__webpack_require__.r(__webpack_exports__);
11708 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11709 +/* harmony export */ "default": () => (/* binding */ _defineProperty)
11710 +/* harmony export */ });
11711 +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
11712 +
11713 +function _defineProperty(obj, key, value) {
11714 + key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key);
11715 + if (key in obj) {
11716 + Object.defineProperty(obj, key, {
11717 + value: value,
11718 + enumerable: true,
11719 + configurable: true,
11720 + writable: true
11721 + });
11722 + } else {
11723 + obj[key] = value;
11724 + }
11725 + return obj;
11726 +}
11727 +
11728 +/***/ }),
11729 +
11730 +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
11731 +/*!*******************************************************************!*\
11732 + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
11733 + \*******************************************************************/
11734 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11735 +
11736 +"use strict";
11737 +__webpack_require__.r(__webpack_exports__);
11738 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11739 +/* harmony export */ "default": () => (/* binding */ _objectSpread2)
11740 +/* harmony export */ });
11741 +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
11742 +
11743 +function ownKeys(e, r) {
11744 + var t = Object.keys(e);
11745 + if (Object.getOwnPropertySymbols) {
11746 + var o = Object.getOwnPropertySymbols(e);
11747 + r && (o = o.filter(function (r) {
11748 + return Object.getOwnPropertyDescriptor(e, r).enumerable;
11749 + })), t.push.apply(t, o);
11750 + }
11751 + return t;
11752 +}
11753 +function _objectSpread2(e) {
11754 + for (var r = 1; r < arguments.length; r++) {
11755 + var t = null != arguments[r] ? arguments[r] : {};
11756 + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
11757 + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]);
11758 + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
11759 + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
11760 + });
11761 + }
11762 + return e;
11763 +}
11764 +
11765 +/***/ }),
11766 +
11767 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
11768 +/*!*****************************************************************!*\
11769 + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
11770 + \*****************************************************************/
11771 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11772 +
11773 +"use strict";
11774 +__webpack_require__.r(__webpack_exports__);
11775 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11776 +/* harmony export */ "default": () => (/* binding */ toPrimitive)
11777 +/* harmony export */ });
11778 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
11779 +
11780 +function toPrimitive(t, r) {
11781 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t;
11782 + var e = t[Symbol.toPrimitive];
11783 + if (void 0 !== e) {
11784 + var i = e.call(t, r || "default");
11785 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i;
11786 + throw new TypeError("@@toPrimitive must return a primitive value.");
11787 + }
11788 + return ("string" === r ? String : Number)(t);
11789 +}
11790 +
11791 +/***/ }),
11792 +
11793 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
11794 +/*!*******************************************************************!*\
11795 + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
11796 + \*******************************************************************/
11797 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11798 +
11799 +"use strict";
11800 +__webpack_require__.r(__webpack_exports__);
11801 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11802 +/* harmony export */ "default": () => (/* binding */ toPropertyKey)
11803 +/* harmony export */ });
11804 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
11805 +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
11806 +
11807 +
11808 +function toPropertyKey(t) {
11809 + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string");
11810 + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : String(i);
11811 +}
11812 +
11813 +/***/ }),
11814 +
11815 +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js":
11816 +/*!************************************************************!*\
11817 + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
11818 + \************************************************************/
11819 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11820 +
11821 +"use strict";
11822 +__webpack_require__.r(__webpack_exports__);
11823 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11824 +/* harmony export */ "default": () => (/* binding */ _typeof)
11825 +/* harmony export */ });
11826 +function _typeof(o) {
11827 + "@babel/helpers - typeof";
11828 +
11829 + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
11830 + return typeof o;
11831 + } : function (o) {
11832 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
11833 + }, _typeof(o);
11834 +}
11835 +
11836 +/***/ }),
11837 +
11838 +/***/ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs":
11839 +/*!******************************************************************************!*\
11840 + !*** ../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs ***!
11841 + \******************************************************************************/
11842 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11843 +
11844 +"use strict";
11845 +__webpack_require__.r(__webpack_exports__);
11846 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11847 +/* harmony export */ Immer: () => (/* binding */ un),
11848 +/* harmony export */ applyPatches: () => (/* binding */ pn),
11849 +/* harmony export */ castDraft: () => (/* binding */ K),
11850 +/* harmony export */ castImmutable: () => (/* binding */ $),
11851 +/* harmony export */ createDraft: () => (/* binding */ ln),
11852 +/* harmony export */ current: () => (/* binding */ R),
11853 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
11854 +/* harmony export */ enableAllPlugins: () => (/* binding */ J),
11855 +/* harmony export */ enableES5: () => (/* binding */ F),
11856 +/* harmony export */ enableMapSet: () => (/* binding */ C),
11857 +/* harmony export */ enablePatches: () => (/* binding */ T),
11858 +/* harmony export */ finishDraft: () => (/* binding */ dn),
11859 +/* harmony export */ freeze: () => (/* binding */ d),
11860 +/* harmony export */ immerable: () => (/* binding */ L),
11861 +/* harmony export */ isDraft: () => (/* binding */ r),
11862 +/* harmony export */ isDraftable: () => (/* binding */ t),
11863 +/* harmony export */ nothing: () => (/* binding */ H),
11864 +/* harmony export */ original: () => (/* binding */ e),
11865 +/* harmony export */ produce: () => (/* binding */ fn),
11866 +/* harmony export */ produceWithPatches: () => (/* binding */ cn),
11867 +/* harmony export */ setAutoFreeze: () => (/* binding */ sn),
11868 +/* harmony export */ setUseProxies: () => (/* binding */ vn)
11869 +/* harmony export */ });
11870 +function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(true){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return false||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if( true&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return true&&f(r),en.get(r,n)},set:function(r){var t=this[Q]; true&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return true&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return true&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q]; true&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fn);
11871 +//# sourceMappingURL=immer.esm.js.map
11872 +
11873 +
11874 +/***/ })
11875 +
11876 +/******/ });
11877 +/************************************************************************/
11878 +/******/ // The module cache
11879 +/******/ var __webpack_module_cache__ = {};
11880 +/******/
11881 +/******/ // The require function
11882 +/******/ function __webpack_require__(moduleId) {
11883 +/******/ // Check if module is in cache
11884 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
11885 +/******/ if (cachedModule !== undefined) {
11886 +/******/ return cachedModule.exports;
11887 +/******/ }
11888 +/******/ // Create a new module (and put it into the cache)
11889 +/******/ var module = __webpack_module_cache__[moduleId] = {
11890 +/******/ // no module.id needed
11891 +/******/ // no module.loaded needed
11892 +/******/ exports: {}
11893 +/******/ };
11894 +/******/
11895 +/******/ // Execute the module function
11896 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11897 +/******/
11898 +/******/ // Return the exports of the module
11899 +/******/ return module.exports;
11900 +/******/ }
11901 +/******/
11902 +/************************************************************************/
11903 +/******/ /* webpack/runtime/define property getters */
11904 +/******/ (() => {
11905 +/******/ // define getter functions for harmony exports
11906 +/******/ __webpack_require__.d = (exports, definition) => {
11907 +/******/ for(var key in definition) {
11908 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
11909 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
11910 +/******/ }
11911 +/******/ }
11912 +/******/ };
11913 +/******/ })();
11914 +/******/
11915 +/******/ /* webpack/runtime/global */
11916 +/******/ (() => {
11917 +/******/ __webpack_require__.g = (function() {
11918 +/******/ if (typeof globalThis === 'object') return globalThis;
11919 +/******/ try {
11920 +/******/ return this || new Function('return this')();
11921 +/******/ } catch (e) {
11922 +/******/ if (typeof window === 'object') return window;
11923 +/******/ }
11924 +/******/ })();
11925 +/******/ })();
11926 +/******/
11927 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
11928 +/******/ (() => {
11929 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
11930 +/******/ })();
11931 +/******/
11932 +/******/ /* webpack/runtime/make namespace object */
11933 +/******/ (() => {
11934 +/******/ // define __esModule on exports
11935 +/******/ __webpack_require__.r = (exports) => {
11936 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
11937 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
11938 +/******/ }
11939 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
11940 +/******/ };
11941 +/******/ })();
11942 +/******/
11943 +/************************************************************************/
11944 +var __webpack_exports__ = {};
11945 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
11946 +(() => {
11947 +"use strict";
11948 +/*!*********************************************!*\
11949 + !*** ../modules/web-cli/assets/js/index.js ***!
11950 + \*********************************************/
11951 +
11952 +
11953 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
11954 +var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js"));
11955 +window.$e = new _api.default();
11956 +})();
11957 +
11958 +/******/ })()
11959 +;
5912 11960 //# sourceMappingURL=web-cli.js.map